n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}gt.__dashjs_factory_name="LowLatencyThroughputModel";var ht=c.Z.getSingletonFactory(gt),pt=n(5717);function mt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yt(e){e=e||{};var t,n,r,i,o,s,c,d,g,h,p,m=this.context,y=e.errHandler,E=e.dashMetrics,v=e.mediaPlayerModel,_=e.requestModifier,T=e.boxParser,b=e.errors,A=e.requestTimeout||0,I=(0,u.Z)(m).getInstance(),R=(0,N.Z)(m).getInstance();function w(e,t){var u,f=e.request,p=[],b=!0,N=!0,D=new Date,O=D,M=0,P=null,L=null;if(!_||!E||!y)throw new Error("config object is not correct or missing");var F,x=function(e){f.requestStartDate=D,f.requestEndDate=new Date,f.firstByteDate=f.firstByteDate||D,f.fileLoaderType=L;var t=u.response?u.response.responseURL:null,n=u.response?u.response.status:null,r=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:null,i=r&&R.get().streaming.cmsd&&R.get().streaming.cmsd.enabled?c.parseResponseHeaders(r,f.mediaType):null;E.addHttpRequest(f,t,n,r,e?p:null,i)},k=function(e){N=!1,x(e),f.type===C.w.MPD_TYPE&&(E.addManifestUpdate(f),I.trigger(l.Z.MANIFEST_LOADING_FINISHED,{request:f}))},U=function(){if(P&&(clearTimeout(P),P=null),-1!==n.indexOf(u)&&(n.splice(n.indexOf(u),1),N))if(k(!1),t>0){try{R.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&f.type===C.w.MEDIA_SEGMENT_TYPE&&v.getRetryAttemptsForType(C.w.MEDIA_SEGMENT_TYPE)===t&&I.trigger(l.Z.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};i.push(r),r.timeout=setTimeout((function(){-1!==i.indexOf(r)&&(i.splice(i.indexOf(r),1),w(e,t))}),v.getRetryIntervalsForType(f.type))}else{if(f.type===C.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;y.error(new S.Z(o[f.type],f.url+" is not available",{request:f,response:u.response})),e.error&&e.error(f,"error",u.response.statusText,u.response),e.complete&&e.complete(f,u.response.statusText)}};f.hasOwnProperty("availabilityTimeComplete")&&!1===f.availabilityTimeComplete&&window.fetch&&"arraybuffer"===f.responseType&&f.type===C.w.MEDIA_SEGMENT_TYPE?((F=fe(m).create({requestModifier:_,lowLatencyThroughputModel:g,boxParser:T})).setup({dashMetrics:E}),L=a.Z.FILE_LOADER_TYPES.FETCH):(F=(0,se.Z)(m).create({requestModifier:_}),L=a.Z.FILE_LOADER_TYPES.XHR);var Z=null,B=_.modifyRequestURL?_.modifyRequestURL(f.url):f.url;if(R.get().streaming.cmcd&&R.get().streaming.cmcd.enabled){var G=R.get().streaming.cmcd.mode;if(G===a.Z.CMCD_MODE_QUERY){var q=function(e){try{var t=[],n=s.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(f);B=Ye.Z.addAditionalQueryParameterToUrl(B,q)}else G===a.Z.CMCD_MODE_HEADER&&(Z=s.getHeaderParameters(f))}var Y=d.getXHRWithCredentialsForType(f.type);if(f.queryParams){var j=Object.keys(f.queryParams).map((function(e){return{key:e,value:f.queryParams[e]}}));B=Ye.Z.addAditionalQueryParameterToUrl(B,j)}f.url=B,u={url:B,method:C.w.GET,withCredentials:Y,request:f,onload:function(){u.response.status>=200&&u.response.status<=299&&(k(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(f,u.response.statusText))},onend:U,onerror:U,progress:function(t){var n=new Date;b&&(b=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(f.firstByteDate=n)),t.lengthComputable&&(f.bytesLoaded=t.loaded,f.bytesTotal=t.total),t.noTrace||(p.push({s:O,d:t.time?t.time:n.getTime()-O.getTime(),b:[t.loaded?t.loaded-M:0]}),O=n,M=t.loaded),P&&(clearTimeout(P),P=null),R.get().streaming.fragmentRequestProgressTimeout>0&&(P=setTimeout((function(){h.warn("Abort request "+u.url+" due to progress timeout"),u.response.onabort=null,u.loader.abort(u),U()}),R.get().streaming.fragmentRequestProgressTimeout)),e.progress&&t&&e.progress(t)},onabort:function(){x(!0),P&&(clearTimeout(P),P=null),e.abort&&e.abort(f)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";h.warn(t)},loader:F,timeout:A,headers:Z};var H=(new Date).getTime();if(isNaN(f.delayLoadingTime)||H>=f.delayLoadingTime)n.push(u),F.load(u);else{var V={httpRequest:u};r.push(V),V.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(V)){r.splice(r.indexOf(V),1);try{D=new Date,O=D,n.push(V.httpRequest),F.load(V.httpRequest)}catch(e){V.httpRequest.onerror()}}}),f.delayLoadingTime-H)}}return t={load:function(e){e.request?w(e,v.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){i.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),i=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==C.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},h=(0,f.Z)(m).getInstance().getLogger(t),n=[],r=[],i=[],s=Ke(m).getInstance(),c=dt(m).getInstance(),g=ht(m).getInstance(),d=(0,pt.Z)(m).getInstance(),mt(p={},C.w.MPD_TYPE,b.DOWNLOAD_ERROR_ID_MANIFEST_CODE),mt(p,C.w.XLINK_EXPANSION_TYPE,b.DOWNLOAD_ERROR_ID_XLINK_CODE),mt(p,C.w.INIT_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),mt(p,C.w.MEDIA_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),mt(p,C.w.INDEX_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),mt(p,C.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),mt(p,C.w.OTHER_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),o=p,t}yt.__dashjs_factory_name="HTTPLoader";var Et=c.Z.getClassFactory(yt);function vt(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return Et},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}vt.__dashjs_factory_name="SchemeLoaderFactory";var _t=c.Z.getSingletonFactory(vt);function Tt(e){e=e||{};var t,n,r=this.context;return t=_t(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}Tt.__dashjs_factory_name="URLLoader";var St=c.Z.getClassFactory(Tt);function bt(e){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bt(e)}function At(e,t){return At=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},At(e,t)}function It(e,t){return!t||"object"!==bt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}var wt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&At(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Rt(t);if(n){var i=Rt(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return It(this,e)});function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).checkForExistenceOnly=!0,t}return i}(p.Z);function Nt(e){e=e||{};var t,n,r=this.context,i=e.eventBus,o=e.events,s=e.urlUtils,u=e.errors,l=e.streamId;return t={checkForExistence:function(e){var t=function(t){i.trigger(o.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new wt(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){i.trigger(o.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){i.trigger(o.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:l}),n.data&&i.trigger(o.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new S.Z(u.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&i.trigger(o.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new S.Z(u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=St(r).create({errHandler:e.errHandler,errors:u,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:s,constants:a.Z,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}Nt.__dashjs_factory_name="FragmentLoader";var Ct=c.Z.getClassFactory(Nt);function Dt(){return{modifyResponseAsync:function(e){return Promise.resolve(e)}}}Dt.__dashjs_factory_name="SegmentResponseModifier";var Ot=c.Z.getSingletonFactory(Dt);function Mt(e){e=e||{};var t,n,r,i=this.context,o=(0,u.Z)(i).getInstance(),s=e.errHandler,c=e.mediaPlayerModel,g=e.dashMetrics,h=(0,f.Z)(i).getInstance(),p=Ot(i).getInstance(),m=e.streamInfo;function y(){return m.id}function E(){for(var e in r)r[e].reset();r={}}function v(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.Z.AUDIO||t.mediaType===a.Z.VIDEO||t.mediaType===a.Z.TEXT&&t.mediaInfo.isFragmented)&&o.trigger(l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&s){var u=function(e,t,n,r){var i=new oe;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,m.id,e.type!==l.Z.FRAGMENT_LOADING_PROGRESS);p.modifyResponseAsync(u).then((function(e){o.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:e,request:t},{streamId:s.id,mediaType:t.mediaType})})).catch((function(e){n.error(e),o.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}))}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=T(i).create({streamInfo:m,type:t,dashMetrics:g,fragmentLoader:Ct(i).create({dashMetrics:g,mediaPlayerModel:c,errHandler:s,requestModifier:(0,X.Z)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:o,events:l.Z,errors:w,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:h,eventBus:o,events:l.Z}),r[t]=n),n},reset:function(){o.off(d.Z.FRAGMENT_LOADING_COMPLETED,v,this),o.off(d.Z.FRAGMENT_LOADING_PROGRESS,v,this),E()}},n=h.getLogger(t),E(),o.on(d.Z.FRAGMENT_LOADING_COMPLETED,v,t),o.on(d.Z.FRAGMENT_LOADING_PROGRESS,v,t),t}Mt.__dashjs_factory_name="FragmentController";var Pt=c.Z.getClassFactory(Mt),Lt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},Ft=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN};function xt(e){var t,n,r=this.context,i=e.streamInfo;function o(e){n.setTrackByIndex(e)}function s(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&o(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var o=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),s=new Lt;if(s.width=Math.floor(a.widthPerTile),s.height=Math.floor(a.heightPerTile),s.x=Math.floor(o%a.tilesHor)*a.widthPerTile,s.y=Math.floor(o/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,a.segmentDuration=NaN;else{var u=Math.floor(e/a.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,H.vi)(e.templateUrl,"Number",n);return r=(0,H.vi)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,H.vi)(r,"Bandwidth",e.bandwidth),(0,H.eR)(r)}(a,u)}t(s)}}},setTrackByIndex:o,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new Ft;return n.mediaType=a.Z.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:s},s(),n=(0,Me.Z)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}xt.__dashjs_factory_name="ThumbnailController";var kt=c.Z.getClassFactory(xt),Ut=n(7417);function Zt(e){var t;e=e||{};var n=[],r=(0,u.Z)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,(function(e){o(e.entry)}),t),t}Zt.__dashjs_factory_name="BlackListController";var Bt=c.Z.getClassFactory(Zt),Gt=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT,a.Z.MUXED,a.Z.IMAGE];function qt(e){e=e||{};var t,n,r,i,s,c,d,g,h,p,m,y,E,v,_,T,b,A,I=this.context,R=(0,u.Z)(I).getInstance(),N=(0,Q.Z)(I).getInstance(),C=e.manifestModel,D=e.mediaPlayerModel,O=e.dashMetrics,M=e.manifestUpdater,P=e.adapter,L=e.timelineConverter,F=e.capabilities,x=e.errHandler,k=e.abrController,U=e.playbackController,Z=e.eventController,B=e.mediaController,G=e.protectionController,q=e.textController,Y=e.videoModel,j=e.streamInfo,H=e.settings;function V(e,t){return new Promise((function(i,o){ne(),p=!0,ie();var s=Y.getElement(),u=[];Gt.forEach((function(t){(t!==a.Z.TEXT||e)&&(t!==a.Z.VIDEO||!s||s&&/^VIDEO$/i.test(s.nodeName))&&u.push(K(t,e))})),Promise.all(u).then((function(){return e=t,new Promise((function(t){var n={},i=r.map((function(t){return t.createBufferSinks(e)}));Promise.all(i).then((function(e){e.forEach((function(e){e&&(n[e.getType()]=e)})),t(n)})).catch((function(){t(n)}))}));var e})).then((function(t){if(p=!1,0===r.length){var a="No streams to play.";x.error(new S.Z(w.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,C.getValue())),n.fatal(a)}else oe();e&&q.createTracks(j),i(t)})).catch((function(e){o(e)}))}))}function K(t,i){var s,u=P.getAllMediaInfoForType(j,t),c=[],f=null;if(!u||0===u.length)return n.info("No "+t+" data."),Promise.resolve();t===a.Z.VIDEO&&(d=!0),t===a.Z.AUDIO&&(g=!0);for(var h=0,p=u.length;h0&&(B.setInitialMediaSettingsForType(t,j),q.addMediaInfosToBuffer(j,t,c)),u=u.filter((function(e){return!e.isEmbedded})),0===u.length)return Promise.resolve();if(t===a.Z.IMAGE)return(y=kt(I).create({streamInfo:j,adapter:P,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:T,eventBus:R,events:l.Z,dashConstants:o.Z,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize(),Promise.resolve();R.trigger(l.Z.STREAM_INITIALIZING,{streamInfo:j,mediaInfo:f}),B.setInitialMediaSettingsForType(t,j);var v=function(t,n){var i=t&&t.length>0?t[0]:null,o=m.getModel(i?i.type:null),s=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=ae(I).create({streamInfo:j,type:s,mimeType:u,timelineConverter:L,adapter:P,manifestModel:C,mediaPlayerModel:D,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:k,playbackController:U,mediaController:B,textController:q,errHandler:x,settings:H,boxParser:_,segmentBlacklistController:E});c.initialize(n,d,l),r.push(c);for(var f=0;f0&&Z.addInlineEvents(e,j.id)}}function oe(){for(var e=r.length,t=h.audio||h.video?new S.Z(w.DATA_UPDATE_FAILED_ERROR_CODE,w.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n0&&e.Representation_asArray[0].ContentProtection)}function pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():te();if(!r||!i)return!1;var a=P.getAdaptationForType(r.index,t,r),o=P.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),f=l.some((function(e){return u.some((function(t){return F.codecRootCompatibleWithCodec(t,e)}))}));return c||f&&s}function me(e){v=e}function ye(){return v}return t={initialize:function(){R.on(l.Z.BUFFERING_COMPLETED,se,t),R.on(l.Z.DATA_UPDATE_COMPLETED,ue,t),R.on(l.Z.INBAND_EVENTS,le,t),G&&(R.on(l.Z.KEY_ERROR,re,t),R.on(l.Z.SERVER_CERTIFICATE_UPDATED,re,t),R.on(l.Z.LICENSE_REQUEST_COMPLETE,re,t),R.on(l.Z.KEY_SYSTEM_SELECTED,re,t),R.on(l.Z.KEY_SESSION_CREATED,re,t),R.on(l.Z.KEY_STATUSES_CHANGED,re,t)),q.initializeForStream(j),R.trigger(l.Z.STREAM_UPDATED,{streamInfo:j})},getStreamId:function(){return j?j.id:null},activate:function(e,t){return new Promise((function(n,r){if(!s)return ye()?(s=!0,R.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:j}),void n(t)):void function(e,t){return V(e,t)}(e,t).then((function(e){s=!0,R.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:j}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:W,getIsActive:function(){return s},getDuration:function(){return j?j.duration:NaN},getStartTime:$,getId:ee,getStreamInfo:te,getHasAudioTrack:function(){return g},getHasVideoTrack:function(){return d},startPreloading:function(e,t){return new Promise((function(i,a){ye()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ee())),me(!0),V(e,t).then((function(){for(var e=0;e0;){var e=A.pop(),t=e.newMediaInfo,r=ce(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),n.push(r.selectMediaInfo(t))}return Promise.all(n)})).then((function(){p=!1,oe(),R.trigger(l.Z.STREAM_UPDATED,{streamInfo:j}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),k&&j&&k.clearDataForStream(j.id),E&&(E.reset(),E=null),X(e),j=null,R.off(l.Z.DATA_UPDATE_COMPLETED,ue,t),R.off(l.Z.BUFFERING_COMPLETED,se,t),R.off(l.Z.INBAND_EVENTS,le,t),G&&(R.off(l.Z.KEY_ERROR,re,t),R.off(l.Z.SERVER_CERTIFICATE_UPDATED,re,t),R.off(l.Z.LICENSE_REQUEST_COMPLETE,re,t),R.off(l.Z.KEY_SYSTEM_SELECTED,re,t),R.off(l.Z.KEY_SESSION_CREATED,re,t),R.off(l.Z.KEY_STATUSES_CHANGED,re,t))},getProcessors:de,setMediaSource:function(e){return new Promise((function(t,i){for(var a=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:null;return pe(e,a.Z.VIDEO,t)&&pe(e,a.Z.AUDIO,t)},isProtectionCompatible:function(e){return!e||ge(a.Z.VIDEO,e)&&ge(a.Z.AUDIO,e)},getPreloaded:ye,getIsEndedEventSignaled:function(){return b},setIsEndedEventSignaled:J,getAdapter:function(){return P},getHasFinishedBuffering:function(){return c},setPreloaded:me,startScheduleControllers:function(){for(var e=r.length,t=0;t4&&i[e].shift()}function I(e,t){if(e&&e.request&&e.request.serviceLocation){var n=e.request.serviceLocation;-1===r[t].all.indexOf(n)&&r[t].all.push(n),r[t].current=n}}function R(){var e=g.getValue(),t=y.getContentSteering(e);return t||(t=p.getServiceDescriptionSettings().contentSteering),t}function N(){return new Promise((function(e){try{var a=R();if(!a||!a.serverUrl)return void e();var u=function(e){var t=e.serverUrl;n&&n.reloadUri&&(t=v.isRelative(n.reloadUri)?v.resolve(n.reloadUri,e.serverUrl):n.reloadUri);var a=[],o=r.baseUrl.all.concat(r.location.all);if(o.length>0){var s=o.map((function(e){var t=function(e){if(!e||!i[e]||0===i[e].length)return-1;var t=i[e].reduce((function(e,t){return e+t}))/i[e].length;return parseInt(t)}(e);return{serviceLocation:e,throughput:t}}));s.sort((function(e,t){return t.throughput-e.throughput}));var u="",l="";s.forEach((function(e,t){0!==t&&(u="".concat(u,","),e.throughput>-1&&(l="".concat(l,","))),u="".concat(u).concat(e.serviceLocation),e.throughput>-1&&(l="".concat(l).concat(e.throughput))})),a.push({key:"_DASH_pathway",value:'"'.concat(u,'"')}),a.push({key:"_DASH_throughput",value:l})}return t=Ye.Z.addAditionalQueryParameterToUrl(t,a)}(a),l=new jt(u);s.load({request:l,success:function(t){!function(e){e&&e[o.Z.CONTENT_STEERING_RESPONSE.VERSION]&&1===parseInt(e[o.Z.CONTENT_STEERING_RESPONSE.VERSION])&&((n=new Ht).version=e[o.Z.CONTENT_STEERING_RESPONSE.VERSION],e[o.Z.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[o.Z.CONTENT_STEERING_RESPONSE.TTL])&&(n.ttl=e[o.Z.CONTENT_STEERING_RESPONSE.TTL]),e[o.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(n.reloadUri=e[o.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[o.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(n.pathwayPriority=e[o.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),e[o.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(n.pathwayClones=e[o.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],n.pathwayClones=n.pathwayClones.filter((function(e){return function(e){return e[o.Z.CONTENT_STEERING_RESPONSE.BASE_ID]&&e[o.Z.CONTENT_STEERING_RESPONSE.ID]&&e[o.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&e[o.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][o.Z.CONTENT_STEERING_RESPONSE.HOST]}(e)}))),O())}(t),m.trigger(d.Z.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:n,url:u}),e()},error:function(r,i,a,o){!function(e,r){try{switch(t.warn("Error fetching data from content steering server",e),r.status){case 410:break;case 429:var i=r&&r.getResponseHeader?r.getResponseHeader("retry-after"):null;null!==i&&(n||(n={}),n.ttl=parseInt(i)),O();break;default:O()}}catch(e){t.error(e)}}(r,o),e(r)},complete:function(){r.baseUrl.all=C(r.baseUrl),r.location.all=C(r.location)}})}catch(t){e(t)}}))}function C(e){return e.all&&0!==e.all.length&&e.current?e.all.filter((function(t){return t===e.current})):[]}function D(e){try{var r=[];return e&&0!==e.length&&n&&n.pathwayClones&&0!==n.pathwayClones.length?(n.pathwayClones.forEach((function(t){var n=e.filter((function(e){return t[o.Z.CONTENT_STEERING_RESPONSE.BASE_ID]===e.serviceLocation})),i=null;if(n&&n.length>0&&(i=n[0]),i){var a=new URL(i.url),s=t[o.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][o.Z.CONTENT_STEERING_RESPONSE.HOST];s=Ye.Z.stringHasProtocol(s)?s:"".concat(a.protocol,"//").concat(s);var u={synthesizedUrl:"".concat(s).concat(a.pathname),serviceLocation:t[o.Z.CONTENT_STEERING_RESPONSE.ID],queryParams:t[o.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][o.Z.CONTENT_STEERING_RESPONSE.PARAMS],reference:i};r.push(u)}})),r):r}catch(e){return t.error(e),[]}}function O(){n&&n.ttl&&!isNaN(n.ttl)&&(a&&clearTimeout(a),a=setTimeout((function(){N()}),1e3*n.ttl))}function M(){a&&clearTimeout(a),a=null}function P(){n=null,i={},r={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},M()}return e={reset:function(){P(),m.off(d.Z.FRAGMENT_LOADING_STARTED,_,e),m.off(d.Z.MANIFEST_LOADING_STARTED,T,e),m.off(d.Z.MANIFEST_LOADING_FINISHED,S,e),m.off(d.Z.THROUGHPUT_MEASUREMENT_STORED,b,e)},setConfig:function(e){e&&(e.adapter&&(y=e.adapter),e.errHandler&&(u=e.errHandler),e.dashMetrics&&(l=e.dashMetrics),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.requestModifier&&(h=e.requestModifier),e.manifestModel&&(g=e.manifestModel),e.serviceDescriptionController&&(p=e.serviceDescriptionController),e.eventBus&&(m=e.eventBus))},loadSteeringData:N,getCurrentSteeringResponseData:function(){return n},shouldQueryBeforeStart:function(){var e=R();return!!e&&e.queryBeforeStart},getSteeringDataFromManifest:R,stopSteeringRequestTimer:M,getSynthesizedBaseUrlElements:function(e){try{return D(e).map((function(e){var t=new Se(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t.dvbPriority=e.reference.dvbPriority,t.dvbWeight=e.reference.dvbWeight,t.availabilityTimeOffset=e.reference.availabilityTimeOffset,t.availabilityTimeComplete=e.reference.availabilityTimeComplete,t}))}catch(e){return t.error(e),[]}},getSynthesizedLocationElements:function(e){try{return D(e).map((function(e){var t=new Pe(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t}))}catch(e){return t.error(e),[]}},initialize:function(){s=St(E).create({errHandler:u,dashMetrics:l,mediaPlayerModel:c,requestModifier:h,errors:w}),m.on(d.Z.FRAGMENT_LOADING_STARTED,_,e),m.on(d.Z.MANIFEST_LOADING_STARTED,T,e),m.on(d.Z.MANIFEST_LOADING_FINISHED,S,e),m.on(d.Z.THROUGHPUT_MEASUREMENT_STORED,b,e)}},t=(0,f.Z)(E).getInstance().getLogger(e),P(),e}Vt.__dashjs_factory_name="ContentSteeringController";var Kt=c.Z.getSingletonFactory(Vt);function zt(){var e,t,n,r=this.context,i=(0,N.Z)(r).getInstance();return e={select:function(e){if(!e||0===e.length)return null;var r=null;return i.get().streaming.applyContentSteering&&(r=function(e){var r=n.getCurrentSteeringResponseData();return r&&r.pathwayPriority&&r.pathwayPriority.length>0?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=null,a=function(){var a=e[r],o=n.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==o&&!t.contains(n[o].serviceLocation))return i=n[o],"break";r+=1};r0&&void 0!==arguments[0]&&arguments[0];s=!0;var t=g.getValue(),n=t.url,r=null,i=p.getPatchLocation(t),a=h.select(i),o=null;if(a&&!e)n=a.url,r=a.serviceLocation,o=a.queryParams;else{var u=R(t),l=h.select(u);l&&(n=l.url,r=l.serviceLocation,o=l.queryParams)}T.isRelative(n)&&(n=T.resolve(n,t.url)),c.load(n,r,o)}function R(e){var t=p.getLocation(e),n=y.getSynthesizedLocationElements(t);return t.concat(n)}function N(e){if(e){if(p.getIsPatch(e)){var r=e;e=g.getValue();var u=p.isPatchValid(e,r),c=u;if(u){var f=p.getPublishTime(e);c=p.applyPatchToManifest(e,r);var d=p.getPublishTime(e);c=f.getTime()!=d.getTime()}if(!c)return t.debug("Patch provided is invalid, performing full manifest refresh"),void I(!0);e.loadedTime=new Date}}else(e=g.getValue()).loadedTime=new Date;if(g.getValue()&&g.getValue().type===o.Z.DYNAMIC&&e.type===o.Z.STATIC)return _.trigger(l.Z.DYNAMIC_TO_STATIC),s=!1,void(a=!0);g.setValue(e);var h=new Date,m=(h.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=p.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),_.trigger(l.Z.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+h+"["+h.getTime()/1e3+"] "),i||A()}function C(){i||(s?A(E.get().streaming.manifestUpdateRetryInterval):I())}function D(e){e.error?e.error.code===w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&m.error(e.error):N(e.manifest)}function O(){i=!1,A()}function M(){(i=!E.get().streaming.scheduling.scheduleWhilePaused)&&b()}function P(){s=!1}return e={initialize:function(){S(),_.on(l.Z.STREAMS_COMPOSED,P,this),_.on(d.Z.PLAYBACK_STARTED,O,this),_.on(d.Z.PLAYBACK_PAUSED,M,this),_.on(l.Z.INTERNAL_MANIFEST_LOADED,D,this)},setManifest:function(e){N(e)},refreshManifest:I,getIsUpdating:function(){return s},setConfig:function(e){e&&(e.manifestModel&&(g=e.manifestModel),e.adapter&&(p=e.adapter),e.manifestLoader&&(c=e.manifestLoader),e.errHandler&&(m=e.errHandler),e.locationSelector&&(h=e.locationSelector),e.settings&&(E=e.settings),e.contentSteeringController&&(y=e.contentSteeringController))},reset:function(){_.off(d.Z.PLAYBACK_STARTED,O,this),_.off(d.Z.PLAYBACK_PAUSED,M,this),_.off(l.Z.STREAMS_COMPOSED,P,this),_.off(l.Z.INTERNAL_MANIFEST_LOADED,D,this),S()}},t=(0,f.Z)(v).getInstance().getLogger(e),h=Wt(v).create(),e}Xt.__dashjs_factory_name="ManifestUpdater";var Qt=c.Z.getClassFactory(Xt);function Jt(){var e,t,n,r,i,a,o,s,c,d,g,h,p,m,y,E,v=this.context,_=(0,u.Z)(v).getInstance(),T=(0,Q.Z)(v).getInstance();function b(){s=[],c=[],d=null,g=null,p=null,h=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function A(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&p&&p.value&&p.schemeIdUri&&!isNaN(h)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(g&&(Date.now()-g)/1e3<30||(s=[],r=!0,I(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function I(e){try{if(e<=0)return void B();var t=Date.now();a[p.schemeIdUri](p.value,(function(n){var r=Date.now(),i=N(t,r,n);s.push(i),I(e-1)}),(function(){B()}))}catch(e){B()}}function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||0;if(!c||0===c.length||t>=c.length)D();else{var n=c[t];if(n)if(a.hasOwnProperty(n.schemeIdUri)){var r=(new Date).getTime();a[n.schemeIdUri](n.value,(function(e){var t=(new Date).getTime(),i=N(r,t,e);p=n,D(i)}),(function(){R(t+1)}))}else R(t+1);else D()}}function N(e,t,n){return n-(t-(t-e)/2)}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?U():Z(t,e)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function P(e){return Date.parse(e)}function L(e,t,n){n()}function F(e,t,n){var r=O(e);isNaN(r)?n():t(r)}function x(e,t,n,r,i){var a,o,s=!1,u=new XMLHttpRequest,l=i?C.w.HEAD:C.w.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){s||(s=!0,c.length?x(e,c.join(" "),n,r,i):r())},o=function(){var t,r;200===u.status&&(t=i?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),s=!0))},T.isRelative(t)){var f=E.resolve();f&&(t=T.resolve(t,f.url))}u.open(l,t),u.timeout=5e3,u.onload=o,u.onloadend=a,u.send()}function k(e,t,n){x(P,e,t,n,!0)}function U(){var e=o.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?Z(!0):Z(!1,t-Date.now())}function Z(e,r){if(isNaN(h)||isNaN(r)||e||function(e){try{var n,r=G(e),a=isNaN(m)?30:m,o=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,u=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*o,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/o,u),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){d=Date.now(),n=!1;var a=isNaN(h);h=r,a&&A(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(p=null,n=!1,y.error(new S.Z(w.TIME_SYNC_FAILED_ERROR_CODE,w.TIME_SYNC_FAILED_ERROR_MESSAGE))),_.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:r}),_.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED)}function B(){if(s&&0!==s.length){var e=s.reduce((function(e,t){return e+t}),0)/s.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),h=e,_.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:h})),r=!1,g=Date.now()}}function G(e){try{if(isNaN(h))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=h-t&&e<=h+t}catch(e){return!0}}return e={initialize:function(){b(),a={"urn:mpeg:dash:utc:http-head:2014":k,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,M),"urn:mpeg:dash:utc:direct:2014":F,"urn:mpeg:dash:utc:http-head:2012":k,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,M),"urn:mpeg:dash:utc:direct:2012":F,"urn:mpeg:dash:utc:http-ntp:2014":L,"urn:mpeg:dash:utc:ntp:2014":L,"urn:mpeg:dash:utc:sntp:2014":L}},attemptSync:function(e,t){c=e,n||(function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(m)?30:m;return!(d&&t&&!isNaN(t))||(Date.now()-d)/1e3>=t}catch(e){return!0}}(t)?(n=!0,R()):_.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(o=e.dashMetrics),e.baseURLController&&(E=e.baseURLController),e.errHandler&&(y=e.errHandler),e.settings&&(i=e.settings))},reset:function(){b(),_.off(l.Z.ATTEMPT_BACKGROUND_SYNC,A,e)}},t=(0,f.Z)(v).getInstance().getLogger(e),_.on(l.Z.ATTEMPT_BACKGROUND_SYNC,A,e),e}Jt.__dashjs_factory_name="TimeSyncController";var $t=c.Z.getSingletonFactory(Jt);$t.HTTP_TIMEOUT_MS=5e3,c.Z.updateSingletonFactory(Jt.__dashjs_factory_name,$t);var en=$t;function tn(){var e,t,n,r,i,a=this.context,o=(0,u.Z)(a).getInstance();return e={attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),"managedMediaSource"===r&&(e.setDisableRemotePlayback(!0),t.addEventListener("startstreaming",(function(){o.trigger(d.Z.MANAGED_MEDIA_SOURCE_START_STREAMING)})),t.addEventListener("endstreaming",(function(){o.trigger(d.Z.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),n},createMediaSource:function(){var e="WebKitMediaSource"in window,n="MediaSource"in window;return"ManagedMediaSource"in window?(t=new ManagedMediaSource,r="managedMediaSource",i.info("Created ManagedMediaSource")):n?(t=new MediaSource,r="mediaSource",i.info("Created MediaSource")):e&&(t=new WebKitMediaSource,i.info("Created WebkitMediaSource")),t},detachMediaSource:function(e){e.setSource(null)},setConfig:function(e){e&&e.settings&&(n=e.settings)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(r!==1/0||n.get().streaming.buffer.mediaSourceDurationInfinity||(r=Math.pow(2,32)),function(e){for(var t=e.sourceBuffers,n=0;n=0&&e0?Math.max(0,i):0,b(r,i,e),b(n,i,e),A(r),A(n),a=e,c=!1}}catch(e){c=!1,t.error(e)}}function b(e,n,r){try{N(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?D(i,d.Z.EVENT_MODE_ON_START):(C(r,a+n,i.calculatedPresentationTime)||function(e){try{var n=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>n}catch(e){return t.error(e),!1}}(i))&&(t.debug("Removing event ".concat(i.id," from period ").concat(i.eventStream.period.id," as it is expired or invalid")),function(e,n){try{var r=n.eventStream.schemeIdUri,i=n.eventStream.period.id,a=n.eventStream.value,o=n.id;e[i][r]=e[i][r].filter((function(e){return a&&e.eventStream.value&&e.eventStream.value!==a||e.id!==o})),0===e[i][r].length&&delete e[i][r]}catch(e){t.error(e)}}(e,i))}}))}catch(e){t.error(e)}}function A(e){try{for(var n in e)e.hasOwnProperty(n)&&0===Object.keys(e[n]).length&&delete e[n]}catch(e){t.error(e)}}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,o=p;t[r]||(t[r]=[]);var s=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));if(-1===s)t[r].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,o=y;else if(n){var u=t[r][s];e.triggeredReceivedEvent=u.triggeredReceivedEvent,e.triggeredStartEvent=u.triggeredStartEvent,t[r][s]=e,o=m}return o}function R(e){try{if(1==e.eventStream.value){var n,r=e.calculatedPresentationTime;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,v.trigger(d.Z.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:n,newManifestValidAfter:NaN},{mode:d.Z.EVENT_MODE_ON_START})}}catch(e){t.error(e)}}function w(e){try{var n=s.getTime();N(e,(function(e){var t=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(!isNaN(t)&&!isNaN(r)){var i=e.calculatedPresentationTime;Math.abs(i-n)<300&&D(e,d.Z.EVENT_MODE_ON_START)}}))}catch(e){t.error(e)}}function N(e,n){try{if(e)for(var r=Object.keys(e),i=0;ir}catch(e){return t.error(e),!1}}function D(e,n){try{var r=s.getTime(),i=e.id;if(n===d.Z.EVENT_MODE_ON_RECEIVE&&!e.triggeredReceivedEvent)return t.debug("Received event ".concat(i)),e.triggeredReceivedEvent=!0,void v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.triggeredStartEvent||(e.eventStream.schemeIdUri===h&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(r)),function(){try{_(),o.refreshManifest()}catch(e){t.error(e)}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(r)),function(e){try{(0,se.Z)(E).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){t.error(e)}}(e.messageData)):(t.debug("Starting event ".concat(i," from period ").concat(e.eventStream.period.id," at ").concat(r)),v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n})),e.triggeredStartEvent=!0)}catch(e){t.error(e)}}return e={addInlineEvents:function(e,r){try{if(_(),n[r]||(n[r]={}),e)for(var i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&h.updateManifestUpdateInfo({currentTime:G.getTime(),buffered:B.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:N.getClientTimeOffset()}),C.length>0&&function(e){0!==e.length?C=C.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===D.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r})):t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")}(e);for(var n=[],r=0,i=e.length;r2&&void 0!==arguments[2]&&arguments[2];function a(){if(Z&&"open"===Z.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),Z.removeEventListener("sourceopen",a),Z.removeEventListener("webkitsourceopen",a),xe();var o=h.getCurrentDVRInfo();p.setSeekable(o.range.start,o.range.end),i?(isNaN(e)||G.seek(e,!0,!0),D.setMediaSource(Z).then((function(){D.initializeForTextWithMediaSource(Z)}))):me(e,n)}}function o(){Z.addEventListener("sourceopen",a,!1),Z.addEventListener("webkitsourceopen",a,!1),r=p.attachMediaSource(B),t.debug("MediaSource attached to element. Waiting on open...")}Z?n?me(e,n):(p.detachMediaSource(B),o()):(Z=p.createMediaSource(),o())}function me(e,t){D.activate(Z,t?W:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&(Q=!0),W=t}isNaN(e)||(oe.trigger(l.Z.SEEK_TARGET,{time:e},{streamId:D.getId()}),G.seek(e,!1,!0),D.startScheduleControllers()),x=!1,oe.trigger(l.Z.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ke()})}))}function ye(e){var t=be(e.seekTime);t&&t!==D?t&&t!==D&&(Ee(),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=D.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){he(t,D,n)})).catch((function(e){R.error(e)}))}(e,t)):(Ee(),function(e){D.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),je(ee.USER_REQUEST_STOP_REASON)}(e)),He($.SEEK_START_REASON)}function Ee(){ve()}function ve(){X&&X.length>0&&(X.forEach((function(e){e.deactivate(!0)})),X=[])}function _e(e){if(e.newMediaInfo.streamInfo.id===D.getId()){if(ve(),J.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&e.oldMediaInfo&&e.oldMediaInfo.codec!==e.newMediaInfo.codec){var t=G.getTime();return D.deactivate(!1),void pe(t,!1,!1)}D.prepareTrackChange(e)}}function Te(e,t){try{return J.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||te)&&(Q&&J.get().streaming.buffer.useChangeTypeForTrackSwitch||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(Z&&!e.getPreloaded()){var n=Te(e,t);n&&e.startPreloading(Z,W).then((function(){X.push(e)}))}}function be(e){if(isNaN(e))return null;for(var t=C.length,n=0;nG.getLiveDelay())&&(V=!1,He($.INITIAL_PLAYOUT_START_REASON),G.play())}e&&e.mediaType&&h.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Re(e){e.streamInfo.id===D.getId()&&e.reason&&e.reason.forceReplace&&ve(),ze(e.streamInfo.id).prepareQualityChange(e)}function we(){if(g.getIsDynamic()&&0!==G.getOriginalLiveDelay()&&D){var e=g.getStreamsInfo();if(e.length>0){var t=e[0].manifestInfo,n=Be(e,t);G.computeAndSetLiveDelay(n,t)}}}function Ne(){if(qe()){var e=B.getPlaybackQuality();e&&h.addDroppedFrames(e)}}function Ce(){t.debug("[onPlaybackStarted]"),!V&&H&&He($.RESUME_FROM_PAUSE_START_REASON),V&&(V=!1),K&&(K=!1,J.get().streaming.applyContentSteering&&!y.shouldQueryBeforeStart()&&y.loadSteeringData()),H=!1}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(H=!0,je(ee.USER_REQUEST_STOP_REASON))}function Oe(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;Z&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),p.signalEndOfStream(Z)):Me()}function Me(){if(D&&D.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||D||null;if(t){var n=t.getStreamInfo();return C.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(D),t=0;t0&&void 0!==arguments[0]?arguments[0]:null,t=e||D||null;if(!t)return null;for(var n=t.getStreamInfo(),r=n.start,i=0,a=-1,o=NaN;i0&&(isNaN(o)||u=0?C[a]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(D.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),he(n,D,NaN)):(t.debug("StreamController no next stream found"),D.setIsEndedEventSignaled(!1)),je(n?ee.END_OF_PERIOD_STOP_REASON:ee.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Pe(),y.stopSteeringRequestTimer())}function xe(e){var t=e||Ke().manifestInfo.duration;p.setDuration(t)}function ke(e){var t=_.getURIFragmentData();if(!t||!t.t)return NaN;var n=$e()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ze(e,t.t,n)}function Ue(e,t){var n=0;return e||(n=$e()[0].getStreamInfo().start),Ze(e,t,n)}function Ze(e,t,n){var r=g.getRegularPeriods()[0],i=t.toString(),a=-1!==i.indexOf("posix:")?"now"===i.substring(6)?Date.now()/1e3:parseFloat(i.substring(6)):NaN;return e&&!isNaN(a)?N.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function Be(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var r=e[0],i=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT].reduce((function(e,t){var n=g.getMediaInfoForType(r,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=g.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=g.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e))return sn(e)}(o=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(n)?n:NaN}catch(e){return NaN}var o}function Ge(e){if(e.error)U=!0,Qe();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;g.updatePeriods(n);var i=g.getUTCTimingSources();!g.getIsDynamic()||i&&0!==i.length||oe.trigger(d.Z.CONFORMANCE_VIOLATION,{level:on.LEVELS.WARNING,event:on.EVENTS.NO_UTC_TIMING_ELEMENT});var a=g.getIsDynamic()?i.concat(j.getUTCTimingSources()):i;r.filterUnsupportedFeatures(n).then((function(){E.initialize(n),m.attemptSync(a,g.getIsDynamic())}))}}function qe(){return!!D&&D.getHasVideoTrack()}function Ye(){return!!D&&D.getHasAudioTrack()}function je(e,t){t=t||new Date,Le().forEach((function(n){n.finalisePlayList(t,e)})),h.addPlayList()}function He(e){h.createPlaylistMetrics(1e3*G.getTime(),e)}function Ve(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",ie.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&J.get().errors.recoverAttempts.mediaErrorDecode>=ie.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=G.getTime();D.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),pe(e,!1,!1)}():(k=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),R.error(new S.Z(e.error.code,n)),Qe())}}function Ke(){return D?D.getStreamInfo():null}function ze(e){for(var t=0,n=C.length;t1&&void 0!==arguments[1]?arguments[1]:NaN;se(),re=t,o.load(e)},loadWithManifest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;ue(),re=t,i.setManifest(e)},getActiveStreamProcessors:Le,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(r=e.capabilitiesFilter),e.manifestLoader&&(o=e.manifestLoader),e.manifestModel&&(c=e.manifestModel),e.mediaPlayerModel&&(Y=e.mediaPlayerModel),e.customParametersModel&&(j=e.customParametersModel),e.protectionController&&(O=e.protectionController),e.adapter&&(g=e.adapter),e.dashMetrics&&(h=e.dashMetrics),e.errHandler&&(R=e.errHandler),e.timelineConverter&&(N=e.timelineConverter),e.videoModel&&(B=e.videoModel),e.playbackController&&(G=e.playbackController),e.serviceDescriptionController&&(q=e.serviceDescriptionController),e.contentSteeringController&&(y=e.contentSteeringController),e.textController&&(M=e.textController),e.abrController&&(T=e.abrController),e.mediaController&&(b=e.mediaController),e.settings&&(J=e.settings),e.baseURLController&&(E=e.baseURLController),e.uriFragmentModel&&(_=e.uriFragmentModel),e.segmentBaseController&&(v=e.segmentBaseController),e.manifestUpdater&&(i=e.manifestUpdater))},setProtectionData:function(e){P=e,O&&O.setProtectionData(P)},getIsStreamSwitchInProgress:function(){return x},switchToVideoElement:function(e){D&&(G.initialize(Ke()),pe(e,!1,!0))},getHasMediaOrInitialisationError:function(){return k||U},getStreams:$e,getActiveStream:function(){return D},getInitialPlayback:function(){return V},getAutoPlay:function(){return L},refreshManifest:function(){i.getIsUpdating()||i.refreshManifest()},reset:Qe},t=(0,f.Z)(ae).getInstance().getLogger(e),m=en(ae).getInstance(),p=nn(ae).getInstance(),I=F(ae).getInstance(),Xe(),e}un.__dashjs_factory_name="StreamController";var ln=c.Z.getSingletonFactory(un);function cn(){var e,t,n,r,i,o,s,c,d,g,h,p,m=this.context,y=(0,u.Z)(m).getInstance();function E(){p.debug("Stopping the gap controller"),i&&(clearInterval(i),i=null),function(){y.off(l.Z.WALLCLOCK_TIME_UPDATED,b,this),y.off(l.Z.INITIAL_STREAM_SWITCH,S,this),y.off(l.Z.PLAYBACK_SEEKING,v,this),y.off(l.Z.BUFFER_REPLACEMENT_STARTED,_,e),y.off(l.Z.TRACK_CHANGE_RENDERED,T,e)}(),i=null,o=NaN,r=0,g=null,h={}}function v(){g&&(clearTimeout(g),g=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==a.Z.VIDEO&&e.mediaType!==a.Z.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){p.error(e)}}function T(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function S(){i||function(){try{i||(p.debug("Starting the gap controller"),i=setInterval((function(){A()&&N(s.getTime())}),100))}catch(e){}}()}function b(){if(A(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=s.getTime();t===e?N(e,!0):(t=e,o=NaN),r=0}}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!c.getActiveStream())return!1;var t=Object.keys(h).some((function(e){return h[e]})),r=!!e&&I();return!t&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!s.isSeeking()||r)&&!s.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function I(){var e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return s.getTime()+n.get().streaming.gaps.threshold>=t}function R(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i0?e.end(i-1):0;t=e.start(n)&&t<=e.end(n))return!0;return!1}function N(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.enableStallFix,a=n.get().streaming.gaps.stallSeek,u=n.get().streaming.gaps.smallGapLimit,l=n.get().streaming.gaps.jumpLargeGaps,f=d.getBufferRange(),h=NaN,m=!1;if(t=R(f,e),!isNaN(t)){var y=f.start(t),E=y-e;E>0&&(E<=u||l)&&(h=y)}var v=s.getTimeToStreamEnd();if(isNaN(h)&&r&&isFinite(v)&&!isNaN(v)&&v0&&o!==h&&h>e&&!g){var _=h-e;if(m){var T=c.getStreamForTime(h),S=T&&!!T.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(h,". Gap duration: ").concat(_)),s.seek(h,!0,S)}else{var b=s.getIsDynamic(),A=t>0?f.end(t-1):e,I=b?1e3*Math.max(0,_-.1):0;g=window.setTimeout((function(){s.seek(h,!0,!0),p.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(A," and ending at ").concat(h,". Jumping by: ").concat(h-A)),g=null}),I)}o=h}}return e={reset:E,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(s=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(d=e.videoModel))},initialize:function(){!function(){y.on(l.Z.WALLCLOCK_TIME_UPDATED,b,this),y.on(l.Z.INITIAL_STREAM_SWITCH,S,this),y.on(l.Z.PLAYBACK_SEEKING,v,this),y.on(l.Z.BUFFER_REPLACEMENT_STARTED,_,e),y.on(l.Z.TRACK_CHANGE_RENDERED,T,e)}()}},p=(0,f.Z)(m).getInstance().getLogger(e),E(),e}cn.__dashjs_factory_name="GapController";var fn=c.Z.getSingletonFactory(cn);function dn(){var e,t,n,r,i,o,c,g,h,p,m=this.context,y=(0,u.Z)(m).getInstance();function E(){t=!1;var e=Ye.Z.parseUserAgent();n=e&&e.browser&&e.browser.name&&"safari"===e.browser.name.toLowerCase()}function v(){t=!1}function _(e){if(e.streamId===o.getActiveStreamInfo().id&&h){var t=c.getLiveDelay();c.getBufferLevel()>t/2&&(h=!1)}}function T(e){e.streamId===o.getActiveStreamInfo().id&&(h=e.state===s.Z.BUFFER_EMPTY)}function S(){g.getCatchupModeEnabled()||r.setPlaybackRate(1)}function b(){c.getIsDynamic()&&g.getCatchupModeEnabled()&&(g.getCatchupPlaybackRates().max>0||g.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{return!(!c.getTime()>0||t)&&(I()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(A())>0||e0}catch(e){return!1}}())}catch(e){return!1}}()&&function(){if(!t&&r){var e,o=r.getPlaybackRate(),s=g.getCatchupPlaybackRates(),u=c.getBufferLevel(),l=A(),f=g.getCatchupMaxDrift();if(!isNaN(f)&&f>0&&l>f)p.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),t=!0,c.seekToCurrentLive(!0,!1);else{var d=c.getCurrentLiveLatency(),m=c.getLiveDelay();e=I()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){var a;if(i0&&(s=1),s}(s,d,m,u);var y=n?.25:.02/(.5/s.max);e&&Math.abs(o-e)>=y&&(p.debug("[CatchupController]: Setting playback rate to ".concat(e)),r.setPlaybackRate(e))}}}()}function A(){return c.getCurrentLiveLatency()-c.getLiveDelay()}function I(){var e=i.get().streaming.liveCatchup.playbackBufferMin;return i.get().streaming.liveCatchup.mode!==a.Z.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.Z.LIVE_CATCHUP_MODE_DEFAULT:a.Z.LIVE_CATCHUP_MODE_LOLP}function R(){g.getCatchupPlaybackRates(!0)}return e={reset:function(){y.off(d.Z.BUFFER_LEVEL_UPDATED,_,e),y.off(d.Z.BUFFER_LEVEL_STATE_CHANGED,T,e),y.off(d.Z.PLAYBACK_PROGRESS,b,e),y.off(d.Z.PLAYBACK_TIME_UPDATED,b,e),y.off(d.Z.PLAYBACK_SEEKED,v,e),y.off(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,S,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.off(d.Z.STREAM_INITIALIZED,R,e),E(),r.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(i=e.settings),e.videoModel&&(r=e.videoModel),e.streamController&&(o=e.streamController),e.playbackController&&(c=e.playbackController),e.mediaPlayerModel&&(g=e.mediaPlayerModel))},initialize:function(){y.on(d.Z.BUFFER_LEVEL_UPDATED,_,e),y.on(d.Z.BUFFER_LEVEL_STATE_CHANGED,T,e),y.on(d.Z.PLAYBACK_PROGRESS,b,e),y.on(d.Z.PLAYBACK_TIME_UPDATED,b,e),y.on(d.Z.PLAYBACK_SEEKED,v,e),y.on(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,S,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.on(d.Z.STREAM_INITIALIZED,R,e),R()}},p=(0,f.Z)(m).getInstance().getLogger(e),E(),e}dn.__dashjs_factory_name="CatchupController";var gn=c.Z.getSingletonFactory(dn),hn=[a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME],pn="video",mn="audio";function yn(){var e,t,n,r,i,s=this.context;function u(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null},n=[]}function l(e,n,i){try{t[e][n]=i/1e3}catch(e){r.error(e)}}return e={getServiceDescriptionSettings:function(){return t},getProducerReferenceTimeOffsets:function(){return n},calculateProducerReferenceTimeOffsets:function(e){try{var t=[];if(e&&e.length>0){var s=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT],u=i.getAvailabilityStartTime()/1e3;e.forEach((function(e){var n=s.reduce((function(t,n){return t.concat(i.getAllMediaInfoForType(e,n))}),[]).reduce((function(t,n){return i.getProducerReferenceTimes(e,n).forEach((function(r){var a=i.getVoRepresentations(n);if(a&&a.length>0&&a[0].adaptation&&a[0].segmentInfoType===o.Z.SEGMENT_TEMPLATE){var s=a[0],l=new Date(r[o.Z.WALL_CLOCK_TIME]).getTime()/1e3-(r[o.Z.PRESENTATION_TIME]/s[o.Z.TIMESCALE]-s[o.Z.PRESENTATION_TIME_OFFSET]+e.start),c=u-l;t.push({id:r[o.Z.ID],to:c})}})),t}),[]);t=t.concat(n)}))}n=t}catch(e){r.error(e),n=[]}},applyServiceDescription:function(e){if(e&&e.serviceDescriptions){var i=e.serviceDescriptions.filter((function(e){return hn.includes(e.schemeIdUri)})),o=e.serviceDescriptions.filter((function(e){return null==e.schemeIdUri})),s=i.length>0?i[i.length-1]:o[o.length-1];s&&(s.latency&&s.latency.target>0&&function(e){var i;if(e.schemeIdUri,a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME,i=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),n.length>0){var o=function(e){var t,r=0,i=n.filter((function(t){return t.id===e.referenceId}));return 0===i.length?(r=n.length>0?n[0].to:0,t=n[0].id||NaN):(r=i[0].to||0,t=i[0].id||NaN),{to:r,id:t}}(i),s=o.to,u=o.id;t.liveDelay=i.liveDelay-s,t.liveCatchup.maxDrift=i.maxDrift,r.debug("\n Found latency properties coming from service description. Applied time offset of ".concat(s," from ProducerReferenceTime element with id ").concat(u,".\n Live Delay: ").concat(i.liveDelay-s,", Live catchup max drift: ").concat(i.maxDrift,"\n "))}else t.liveDelay=i.liveDelay,t.liveCatchup.maxDrift=i.maxDrift,r.debug("Found latency properties coming from service description: Live Delay: ".concat(i.liveDelay,", Live catchup max drift: ").concat(i.maxDrift))}(s),s.playbackRate&&function(e){var n=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,i=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=n,t.liveCatchup.playbackRate.max=i,r.debug("Found latency properties coming from service description: Live catchup min playback rate: ".concat(n)),r.debug("Found latency properties coming from service description: Live catchup max playback rate: ".concat(i))}(s),s.operatingQuality,s.operatingBandwidth&&function(e){if(e&&e.operatingBandwidth&&e.operatingBandwidth.mediaType&&"all"!==e.operatingBandwidth.mediaType){var t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;var n=[];e.operatingBandwidth.mediaType===pn||e.operatingBandwidth.mediaType===mn?n.push(e.operatingBandwidth.mediaType):"any"===e.operatingBandwidth.mediaType&&(n.push(mn),n.push(pn)),n.forEach((function(e){isNaN(t.minBandwidth)||l("minBitrate",e,t.minBandwidth),isNaN(t.maxBandwidth)||l("maxBitrate",e,t.maxBandwidth),isNaN(t.targetBandwidth)||l("initialBitrate",e,t.targetBandwidth)}))}}(s),s.contentSteering&&function(e){t.contentSteering=e.contentSteering}(s))}},reset:function(){u()},setConfig:function(e){e&&e.adapter&&(i=e.adapter)}},r=(0,f.Z)(s).getInstance().getLogger(e),u(),e}yn.__dashjs_factory_name="ServiceDescriptionController";var En=c.Z.getSingletonFactory(yn),vn=n(3973),_n=n.n(vn),Tn=n(3039);function Sn(){var e,t,n,r,i,o,s,c,d=this.context,g=(0,u.Z)(d).getInstance();function h(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,s=e.streamInfo,u=s.id,f=p(i,u);if(n[u]&&n[u][i]&&(n[u][i].current=e,n[u][i].current&&(i!==a.Z.TEXT&&!v(e,f)||i===a.Z.TEXT&&e.isFragmented)&&g.trigger(l.Z.CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:u}),!t)){var d=T(e);if(!d||!n[u][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),o[i]=d,c.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function E(e){return e?i[e]:null}function v(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=JSON.stringify(e.viewpointsWithSchemeIdUri)===JSON.stringify(t.viewpointsWithSchemeIdUri),a=e.lang===t.lang,o=e.codec===t.codec,s=e.roles.toString()===t.roles.toString(),u=JSON.stringify(e.rolesWithSchemeIdUri)===JSON.stringify(t.rolesWithSchemeIdUri),l=e.accessibility.toString()===t.accessibility.toString(),c=JSON.stringify(e.accessibilitiesWithSchemeIdUri)===JSON.stringify(t.accessibilitiesWithSchemeIdUri),f=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString(),d=JSON.stringify(e.audioChannelConfigurationsWithSchemeIdUri)===JSON.stringify(t.audioChannelConfigurationsWithSchemeIdUri);return n&&o&&r&&i&&a&&s&&u&&l&&c&&f&&d}function _(){n={},o={},i={audio:null,video:null,text:null}}function T(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration,codec:e.codec};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}function S(e,t,n){var r=[];return e.forEach((function(e){t(n,e)&&r.push(e)})),0!==r.length?r:e}function b(e,t){try{return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&(0,Tn.extendedFilter)(t.lang,_n()(e.lang)).length>0}catch(e){return!1}}function A(e,t){return void 0===e.index||null===e.index||t.index===e.index}function I(e,t){return!e.viewpoint||e.viewpoint===t.viewpoint}function R(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0];return r||t.type===a.Z.AUDIO&&n}function w(e,t){return e.accessibility?!!t.accessibility.filter((function(t){return t===e.accessibility}))[0]:!t.accessibility.length}function N(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0]}function C(e,t){return!e.codec||e.codec===t.codec}function D(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function O(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)n?(n=t,r=[e]):t===n&&r.push(e)})),r}function P(e,n){if(e===a.Z.TEXT)return n[0];var i,o=r.get().streaming.selectionModeForInitialTrack,u=s.getCustomInitialTrackSelectionFunction();if(u&&"function"==typeof u)i=u(n);else switch(o){case a.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=D(r)),r.length>1&&(r=M(r)),r}(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=D(e);return t.length>1&&(t=M(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_FIRST_TRACK:i=L(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=O(e);return t.length>1&&(t=D(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=M(e);return t.length>1&&(t=D(e)),t}(n);break;default:t.warn("Track selection mode ".concat(o," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=L(n)}return i.length>0?i[0]:n[0]}function L(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=o[e]||E(e),r=h(e,t.id),i=[];n||((n=c.getSavedMediaSettings(e))&&delete n.codec,y(e,n)),r&&0!==r.length&&(n&&(i=S(i=Array.from(r),b,n),i=S(i,A,n),i=S(i,I,n),e===a.Z.AUDIO&&o[e]||(i=S(i,R,n)),i=S(i,w,n),i=S(i,N,n),i=S(i,C,n)),0===i.length?m(P(e,r),!0):i.length>1?m(P(e,i)):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((i=t)===a.Z.AUDIO||i===a.Z.VIDEO||i===a.Z.TEXT||i===a.Z.IMAGE){var i,o,s=e.streamInfo.id;n[s]||(n[s]={audio:{list:[],storeLastSettings:o=r.get().streaming.saveLastMediaSettingsForCurrentStreamingSession,current:null},video:{list:[],storeLastSettings:o,current:null},text:{list:[],storeLastSettings:o,current:null},image:{list:[],storeLastSettings:o,current:null}});for(var u=n[s][t].list,l=0,c=u.length;l2&&void 0!==arguments[2]&&arguments[2];try{var r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(""!==t.lang){var i=_n()(e.lang);i&&(r=(0,Tn.extendedFilter)(t.lang,i).length>0)}}else r=!0;var o=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,u=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],l=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],c=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&o&&s&&(u||t.type===a.Z.AUDIO&&n)&&l&&c}catch(e){return!1}},matchSettingsLang:b,matchSettingsIndex:A,matchSettingsViewPoint:I,matchSettingsRole:R,matchSettingsAccessibility:w,matchSettingsAudioChannelConfig:N,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(a.Z.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(r=e.settings),e.customParametersModel&&(s=e.customParametersModel))},reset:_},t=(0,f.Z)(d).getInstance().getLogger(e),_(),e}Sn.__dashjs_factory_name="MediaController";var bn=c.Z.getSingletonFactory(Sn);c.Z.updateSingletonFactory(Sn.__dashjs_factory_name,bn);var An=bn,In=NaN,Rn=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||In},this.children=[]};function wn(){var e,t,n,r,i=this.context,a=Oe(i).getInstance();function o(e,t,n){var r=s(n);e[t]?a.areEqual(r,e[t].data.baseUrls)||(e[t].data.baseUrls=r,e[t].data.selectedIdx=In):e[t]=new Rn(r)}function s(e){var t=n.getBaseURLsFromElement(e),i=r.getSynthesizedBaseUrlElements(t);return i&&i.length>0&&(t=t.concat(i)),t}function u(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return u(e,t)}))}function l(){t=new Rn}return e={reset:l,update:function(e){!function(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=s(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=In),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){o(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){o(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){o(t.children[r].children[i].children,n,e)}))}))}))}(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){u((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=In)}))},setConfig:function(e){e.adapter&&(n=e.adapter),e.contentSteeringController&&(r=e.contentSteeringController)},getBaseUrls:function(e){return s(e)}},l(),e}wn.__dashjs_factory_name="BaseURLTreeModel";var Nn=c.Z.getClassFactory(wn);function Cn(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvbPriority-t.dvbPriority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvbPriority&&e.dvbPriority&&n[0].dvbPriority===e.dvbPriority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvbWeight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=NaN,a=function(){var a=e[r],o=t.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==o&&!n.contains(t[o].serviceLocation))return i=o,"break";r+=1};r0&&(n=i(r.defaultServiceLocationArray,e.baseUrls))}var a=t.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&a&&a.pathwayPriority&&a.pathwayPriority.length&&(n=i(a.pathwayPriority,e.baseUrls)),n},setConfig:function(e){e.blacklistController&&(n=e.blacklistController),e.contentSteeringController&&(t=e.contentSteeringController)}},t=Kt(r).getInstance(),e}Pn.__dashjs_factory_name="ContentSteeringSelector";var Ln=c.Z.getClassFactory(Pn);function Fn(){var e,t,n,r,i,a,o=this.context,s=(0,u.Z)(o).getInstance(),c=(0,N.Z)(o).getInstance();function f(){t.reset()}return e={chooseSelector:function(e){(0,z.PS)(e,"boolean"),a=e?r:n},select:function(e){if(e){if(c.get().streaming.applyContentSteering){var t=i.selectBaseUrlIndex(e);isNaN(t)||-1===t||(e.selectedIdx=t)}if(!isNaN(e.selectedIdx))return e.baseUrls[e.selectedIdx];var r=a.select(e.baseUrls);return r?(e.selectedIdx=e.baseUrls.indexOf(r),r):(s.trigger(l.Z.URL_RESOLUTION_FAILED,{error:new S.Z(w.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,w.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(a===n&&f()))}},reset:f,setConfig:function(e){e.selector&&(a=e.selector),e.contentSteeringSelector&&(i=e.contentSteeringSelector)}},t=Bt(o).create({updateEventName:l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),n=Mn(o).create({blacklistController:t}),r=Dn(o).create({blacklistController:t}),(i=Ln(o).create()).setConfig({blacklistController:t}),a=n,e}Fn.__dashjs_factory_name="BaseURLSelector";var xn=c.Z.getClassFactory(Fn);function kn(){var e,t,n,r,i,a=this.context,o=(0,u.Z)(a).getInstance(),s=(0,Q.Z)(a).getInstance();function c(e){n.update(e),r.chooseSelector(t.getIsDVB(e)),o.trigger(d.Z.BASE_URLS_UPDATED,{baseUrls:f(e)})}function f(e){return n.getBaseUrls(e)}return e={reset:function(){n.reset(),r.reset()},initialize:function(e){n.setConfig({adapter:t,contentSteeringController:i}),c(e)},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=r.select(t);return n?(s.isRelative(n.url)?e.url=s.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e.queryParams=n.queryParams,e):new Se}),new Se);if(!s.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(r=e.baseURLSelector),e.adapter&&(t=e.adapter),e.contentSteeringController&&(i=e.contentSteeringController)},getBaseUrls:f,update:c},n=Nn(a).create(),r=xn(a).create(),o.on(l.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,(function(e){n.invalidateSelectedIndexes(e.entry)}),e),e}kn.__dashjs_factory_name="BaseURLController";var Un=c.Z.getClassFactory(kn);function Zn(e){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zn(e)}function Bn(e,t){return Bn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bn(e,t)}function Gn(e,t){return!t||"object"!==Zn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qn(e){return qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qn(e)}var Yn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=qn(t);if(n){var i=qn(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return Gn(this,e)});function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=r.call(this)).url=e||null,n.type=t||null,n.mediaType=a.Z.STREAM,n.responseType="",n}return i}(p.Z);function jn(e){e=e||{};var t=this.context,n=(0,u.Z)(t).getInstance(),r=St(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:w});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(l.Z.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new S.Z(w.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,w.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var o=new Yn(e,C.w.XLINK_EXPANSION_TYPE);r.load({request:o,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}jn.__dashjs_factory_name="XlinkLoader";var Hn=c.Z.getClassFactory(jn),Vn=function(e){void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/