12345678910111213141516171819 |
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dashjs=t():e.dashjs=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=125)}([function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.PRODUCER_REFERENCE_TIME="ProducerReferenceTime",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.REPRESENTATION_ASARRAY="Representation_asArray",this.PRODUCERREFERENCETIME_ASARRAY="ProducerReferenceTime_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.SERVICE_DESCRIPTION_OPERATING_QUALITY="OperatingQuality",this.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH="OperatingBandwidth",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId",this.WALL_CLOCK_TIME="wallClockTime",this.PRESENTATION_TIME="presentationTime",this.LABEL="Label",this.GROUP_LABEL="GroupLabel",this.CONTENT_STEERING="ContentSteering",this.CONTENT_STEERING_AS_ARRAY="ContentSteering_asArray",this.DEFAULT_SERVICE_LOCATION="defaultServiceLocation",this.QUERY_BEFORE_START="queryBeforeStart",this.PROXY_SERVER_URL="proxyServerURL",this.CONTENT_STEERING_RESPONSE={VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",SERVICE_LOCATION_PRIORITY:"SERVICE-LOCATION-PRIORITY"}}}])&&r(t.prototype,n),i&&r(t,i),e}());t.a=i},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.CONTENT_STEERING="contentSteering",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},this.FILE_LOADER_TYPES={FETCH:"fetch_loader",XHR:"xhr_loader"}}}])&&r(t.prototype,n),i&&r(t,i),e}());t.a=i},function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=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}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(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 s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){return(u="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})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=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}}();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==u(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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=new(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&&c(e,t)}(n,e);var t=f(n);function n(){return l(this,n),t.apply(this,arguments)}return n}(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&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",e.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",e.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",e.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",e.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",e}return n}(n(18).a)));t.a=g},function(e,t,n){"use strict";var r=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}();t.a=r},function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=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}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(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 s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=new(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&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",e.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",e}return n}(n(18).a));t.a=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[]};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.DVB_REPORTING_TYPE="DVBReporting",i.LICENSE="license",i.CONTENT_STEERING_TYPE="ContentSteering",i.OTHER_TYPE="other"},function(e,t,n){"use strict";var r=n(7),i=n(2),a=n(3),o=1,s=2,u=3,l=4,c=5;function f(e){e=e||{};var t,n,a,f,d=this.context,h=Object(r.a)(d).getInstance(),g=e.settings,p=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[o,this].concat(t))}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function b(e,t){var r="",o=null;n&&(o=(new Date).getTime(),r+="["+(o-f)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){r+=e+" "})),p[e]&&g.get().debug.logLevel>=e&&p[e](r),g&&g.get().debug.dispatchEvent&&h.trigger(i.a.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:v.bind(e),info:_.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[o]=m(window.console.error),p[s]=m(window.console.error),p[u]=m(window.console.warn),p[l]=m(window.console.info),p[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=a.a.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=o,d.LOG_LEVEL_ERROR=s,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,a.a.updateSingletonFactory(f.__dashjs_factory_name,d),t.a=d},function(e,t,n){"use strict";var r=n(3),i=n(4);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.a.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}a.__dashjs_factory_name="EventBus";var o=r.a.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.a.updateSingletonFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";var r=n(3),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){return{quality:void 0===e?-1:e,reason:void 0===t?null:t,priority:function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n)}}a.__dashjs_factory_name="SwitchRequest";var o=r.a.getClassFactory(a);o.NO_CHANGE=-1,o.PRIORITY=i,r.a.updateClassFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors",this.HTTP_REQUEST_DVB_REPORTING_TYPE="DVBReporting"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.a=i},function(e,t,n){"use strict";t.a=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=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}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(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 s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=new(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&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return n}(n(28).a));t.a=u},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return f}));var r=n(33);function i(e,t){for(;e.length<t;)e="0"+e;return e}function a(e){return e?e.split("$$").join("$"):e}function o(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)}function s(e,t,n){var r,a,o,s,u,l,c=t.length,f="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if((o=e.indexOf("%0",r+c))>r&&o<a)switch(s=e.charAt(a-1),u=parseInt(e.substring(o+f,a-1),10),s){case"d":case"i":case"u":l=i(n.toString(),u);break;case"x":l=i(n.toString(16),u);break;case"X":l=i(n.toString(16),u).toUpperCase();break;case"o":l=i(n.toString(8),u);break;default:return e}else l=n;e=e.substring(0,r)+l+e.substring(a+1)}}function u(e,t,n,i,a,o,s,u){var l,c=new r.a;return c.representation=e,c.duration=t,c.presentationStartTime=n,c.mediaStartTime=i,c.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(o,e,s),c.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(o+t,e,s),c.wallStartTime=a.calcWallTimeForSegment(c,s),c.replacementNumber=(l=u,c.representation.startNumber+l),c.index=u,c}function l(e,t,n,r){var i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;var a=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=a&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=a)}return!0}function c(e,t,n,r){var i,a,o;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),o=parseFloat((a+i).toFixed(5));var s=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,o,t,r);return l(e,n,s,t)?s:null}function f(e,t,n,r,i,a,o,c,f,d){var h,g,p=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(p,n),l(e,n,g=u(n,m,h,p,e,h+m,t,f),t)?(g.replacementTime=d||r,o=s(o,"Number",g.replacementNumber),o=s(o,"Time",g.replacementTime),g.media=o,g.mediaRange=c,g):null}},function(e,t,n){"use strict";var r=n(3);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;f(e)&&(n=u),d(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y");e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils";var a=r.a.getSingletonFactory(i);function o(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r<t.length;r++){if(t[r].regex.test(n))return t[r].utils}return e}(i||r);return a&&"function"==typeof a[n]?a[n](r,i):e[n](r,i)}return e=a(n).getInstance(),{registerUrlRegex:function(e,n){t.push({regex:e,utils:n})},parseBaseUrl:function(e){return r("parseBaseUrl",e)},parseOrigin:function(e){return r("parseOrigin",e)},parseScheme:function(e){return r("parseScheme",e)},isRelative:function(e){return r("isRelative",e)},isPathAbsolute:function(e){return r("isPathAbsolute",e)},isSchemeRelative:function(e){return r("isSchemeRelative",e)},isHTTPURL:function(e){return r("isHTTPURL",e)},isHTTPS:function(e){return r("isHTTPS",e)},removeHostname:function(e){return r("removeHostname",e)},resolve:function(e,t){return r("resolve",e,t)}}}o.__dashjs_factory_name="URLUtils";var s=r.a.getSingletonFactory(o);t.a=s},function(e,t,n){"use strict";var r=n(37),i=n.n(r),a=n(38);function o(e){return(o="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"mixin",value:function(t,n,r){var i,a={};if(t)for(var s in n)n.hasOwnProperty(s)&&(i=n[s],s in t&&(t[s]===i||s in a&&a[s]===i)||("object"===o(t[s])&&null!==t[s]?t[s]=e.mixin(t[s],i,r):t[s]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==o(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],o=a.indexOf(": ");o>0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var a=i.a.relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),o=0===a.length?1:0;return a+=r.pathname.substr(r.pathname.lastIndexOf("/")+o,r.pathname.length-1),r.pathname.length<a.length?r.pathname:a}catch(e){return t}}},{key:"parseUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=null===e&&"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";return Object(a.UAParser)(t)}catch(e){return{}}}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.a=u},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(1);function i(e){return(i="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})(e)}function a(e,t){if(i(e)!==t)throw r.a.BAD_ARGUMENT_ERROR}function o(e){if(!(null!==e&&!isNaN(e)&&e%1==0))throw r.a.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},function(e,t,n){"use strict";var r=n(3),i=n(14),a=n(6),o=n(1),s=n(5),u=n(7),l=n(2);function c(e){return(c="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})(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){var e,t,n=this.context,r=Object(u.a)(n).getInstance(),d={"streaming.delay.liveDelay":l.a.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":l.a.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":l.a.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":l.a.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":l.a.SETTING_UPDATED_PLAYBACK_RATE_MAX},h={debug:{logLevel:a.a.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,eventControllerRefreshDelay:100,enableManifestDurationMismatchFix:!0,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeTypeForTrackSwitch:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:o.a.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:o.a.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:o.a.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:o.a.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:2e4,manifestRequestTimeout:1e4,retryIntervals:(e={},f(e,s.a.MPD_TYPE,500),f(e,s.a.XLINK_EXPANSION_TYPE,500),f(e,s.a.MEDIA_SEGMENT_TYPE,1e3),f(e,s.a.INIT_SEGMENT_TYPE,1e3),f(e,s.a.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),f(e,s.a.INDEX_SEGMENT_TYPE,1e3),f(e,s.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),f(e,s.a.LICENSE,1e3),f(e,s.a.OTHER_TYPE,1e3),f(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},f(t,s.a.MPD_TYPE,3),f(t,s.a.XLINK_EXPANSION_TYPE,1),f(t,s.a.MEDIA_SEGMENT_TYPE,3),f(t,s.a.INIT_SEGMENT_TYPE,3),f(t,s.a.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),f(t,s.a.INDEX_SEGMENT_TYPE,3),f(t,s.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),f(t,s.a.LICENSE,3),f(t,s.a.OTHER_TYPE,3),f(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:o.a.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:o.a.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:o.a.CMCD_MODE_QUERY,enabledKeys:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"]}},errors:{recoverAttempts:{mediaErrorDecode:5}}},g=i.a.clone(h);return{get:function(){return g},update:function(e){"object"===c(e)&&function e(t,n,a){for(var o in t)t.hasOwnProperty(o)&&(n.hasOwnProperty(o)?"object"!==c(t[o])||t[o]instanceof Array||null===t[o]?(n[o]=i.a.clone(t[o]),d[a+o]&&r.trigger(d[a+o])):e(t[o],n[o],a.slice()+o+"."):console.error("Settings parameter "+a+o+" is not supported"))}(e,g,"")},reset:function(){g=i.a.clone(h)}}}d.__dashjs_factory_name="Settings";var h=r.a.getSingletonFactory(d);t.a=h},function(e,t,n){"use strict";var r=n(5);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t,n,a;return t=e,(n=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===r.a.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?r.a.INIT_SEGMENT_TYPE:r.a.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&i(t.prototype,n),a&&i(t,a),e}();a.ACTION_DOWNLOAD="download",a.ACTION_COMPLETE="complete",t.a=a},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.a=i},function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=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}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(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 s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=new(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&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return n}(n(18).a));t.a=u},function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var r=n(3);function i(e,t){var n={url:e.url,method:e.method,headers:Object.assign({},e.headers),credentials:e.withCredentials?"include":void 0};return Promise.resolve(t.modifyRequest(n)).then((function(){return Object.assign(e,n,{withCredentials:"include"===n.credentials})}))}function a(){return{modifyRequest:null,modifyRequestURL:function(e){return e},modifyRequestHeader:function(e,t){return t.url,e}}}a.__dashjs_factory_name="RequestModifier",t.a=r.a.getSingletonFactory(a)},function(e,t,n){"use strict";var r=n(3),i=n(17);function a(e){var t,n,r,a,o=(e=e||{}).eventBus,s=e.events,u=e.dashMetrics,l=e.fragmentLoader,c=e.debug,f=e.streamInfo,d=e.type;function h(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,a=n,!isNaN(r.index)&&r.startTime===a.startTime&&r.adaptationIndex===a.adaptationIndex&&r.type===a.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===i.a.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,a})),t)}function g(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function p(e){r=r.filter((function(t){var n=g(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function m(e,t){t<=e+.5||(r=r.filter((function(n){var r=g(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function y(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?g(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function E(e,t){u.addSchedulingInfo(e,t),u.addRequestsQueue(e.mediaType,a,r)}function v(e){e.sender===l&&(a.splice(a.indexOf(e.request),1),e.response&&!e.error&&r.push(e.request),E(e.request,e.error?"failed":"executed"),o.trigger(s.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:f.id,mediaType:d}))}function _(e){e.sender===l&&o.trigger(s.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:f.id,mediaType:d})}function T(e){e.sender===l&&o.trigger(s.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:f.id,mediaType:d})}function b(){r=[],a=[]}return t={getStreamId:function(){return f.id},getType:function(){return d},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var i=function(e){var t;switch(e){case"loading":t=a;break;case"executed":t=r;break;default:t=[]}return t}(t);n=n.concat(function(e,t){if(t.hasOwnProperty("time"))return[y(e,t.time,t.threshold)];return e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(i,e))})),n},isFragmentLoaded:h,isFragmentLoadedOrPending:function(e){var t,n=!1,r=0;if(!(n=h(e)))for(r=0;r<a.length;r++)t=a[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:p,removeExecutedRequestsAfterTime:function(e){r=r.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)m(n,e.start(r)),n=e.end(r);t>0&&m(n,t)}else p()},abortRequests:function(){n.debug("abort requests"),l.abort(),a=[]},executeRequest:function(e){switch(e.action){case i.a.ACTION_DOWNLOAD:E(e,"loading"),a.push(e),function(e){o.trigger(s.FRAGMENT_LOADING_STARTED,{request:e},{streamId:f.id,mediaType:d}),l.load(e)}(e);break;default:n.warn("Unknown request action.")}},reset:function(){o.off(s.LOADING_COMPLETED,v,this),o.off(s.LOADING_DATA_PROGRESS,_,this),o.off(s.LOADING_ABANDONED,T,this),l&&l.reset(),b()},resetInitialSettings:b,addExecutedRequest:function(e){r.push(e)}},n=c.getLogger(t),b(),o.on(s.LOADING_COMPLETED,v,t),o.on(s.LOADING_DATA_PROGRESS,_,t),o.on(s.LOADING_ABANDONED,T,t),t}a.__dashjs_factory_name="FragmentModel";var o=r.a.getClassFactory(a);o.FRAGMENT_MODEL_LOADING="loading",o.FRAGMENT_MODEL_EXECUTED="executed",o.FRAGMENT_MODEL_CANCELED="canceled",o.FRAGMENT_MODEL_FAILED="failed",r.a.updateClassFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";var r=n(3),i=n(48);function a(e){e=e||{};var t,n,r=this.context;return t=Object(i.a)(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()}}}a.__dashjs_factory_name="URLLoader";var o=r.a.getClassFactory(a);t.a=o},function(e,t,n){"use strict";var r=n(6);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,o=t.samples.length;a<o;a++){var s={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(s)}}}}var t,n,r;return t=e,(n=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}])&&i(t.prototype,n),r&&i(t,r),e}(),o=n(3);function s(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),o=0,s=a.length;o<s;o++)(i=n(a[o]))&&r.push(i);return r}function n(e){if(!e)return null;var t=new a(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}s.__dashjs_factory_name="IsoFile";var u=o.a.getClassFactory(s),l=n(25),c=n.n(l);var f=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r};function d(){var e,t,n=this.context;function i(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=c.a.parseBuffer(e),r=u(n).create();return r.setData(t),r}function a(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function o(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:i,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n<i.byteLength;){var u=a(i,n),l=o(i,n+4);if(0===u)break;n+u<=i.byteLength&&(e.indexOf(l)>=0?r=new f(n,!0,u):s=n+u),n+=u}return r||new f(s,!1)},getMediaTimescaleFromMoov:function(e){var t=i(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,a,o,s,u,l,c,f,d,h,g,p,m,y,E=i(e),v=E.getBoxes("moof"),_=E.getBoxes("mfhd");m=E.getBoxes("moof").length,p=_[_.length-1].sequence_number,n=0,o=[];var T=-1,b=-1;for(f=0;f<v.length;f++){var S=v[f],A=S.getChildBoxes("traf");for(l=0;l<A.length;l++){var I=A[l],R=I.getChildBox("tfhd"),w=I.getChildBox("tfdt");a=w.baseMediaDecodeTime;var N=I.getChildBoxes("trun"),C=I.getChildBoxes("subs");for(c=0;c<N.length;c++){var D=N[c];for(n=D.sample_count,g=(R.base_data_offset||0)+(D.data_offset||0),u=0;u<n;u++){t=void 0!==(s=D.samples[u]).sample_duration?s.sample_duration:R.default_sample_duration,r=void 0!==s.sample_size?s.sample_size:R.default_sample_size;var O={dts:a,cts:a+(void 0!==s.sample_composition_time_offset?s.sample_composition_time_offset:0),duration:t,offset:S.offset+g,size:r,subSizes:[r]};if(C)for(d=0;d<C.length;d++){var M=C[d];if(T<M.entry_count-1&&u>b&&(T++,b+=M.entries[T].sample_delta),u==b){O.subSizes=[];var P=M.entries[T];for(h=0;h<P.subsample_count;h++)O.subSizes.push(P.subsamples[h].subsample_size)}}o.push(O),g+=r,a+=t}}y=a-w.baseMediaDecodeTime}}return{sampleList:o,lastSequenceNumber:p,totalDuration:y,numSequences:m}},findInitRange:function(t){var n=null,r=i(t);if(!r)return n;var a=r.getBox("ftyp"),o=r.getBox("moov");return e.debug("Searching for initialization."),o&&o.isComplete&&(n=(a?a.offset:o.offset)+"-"+(o.offset+o.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n<i.byteLength;){var u=a(i,n),l=o(i,n+4);if(0===u)break;n+u<=i.byteLength&&(e.indexOf(l)>=0?r=new f(n,!0,u,l):s=n+u),n+=u}return r||new f(s,!1)}},e=Object(r.a)(n).getInstance().getLogger(t),t}d.__dashjs_factory_name="BoxParser";t.a=o.a.getSingletonFactory(d)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){
- /*! codem-isoboxer v0.3.6 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */
- var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},r.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=r.parseBuffer,t.addBoxProcessor=r.addBoxProcessor,t.createFile=r.createFile,t.createBox=r.createBox,t.createFullBox=r.createFullBox,t.Utils=r.Utils,r.Cursor=function(e){this.offset=void 0===e?0:e};var i=function(e){this._cursor=new r.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};i.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},i.prototype.fetchAll=function(e,t){var n=[];return i._sweep.call(this,e,n,t),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},i._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;i._sweep.call(this.boxes[r],e,t,n)}},i.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},i.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new r.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},a.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},a.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=r.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)n.setUint8(i,t[i]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u&&u[f].run();f=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new g(e,t)),1!==l.length||c||s(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(3),i=n(8),a=n(1),o=n(9);function s(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=Object(i.a)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.a.MISSING_CONFIG_ERROR)}();var s=e.getMediaInfo(),u=e.getMediaType(),l=n.getCurrentBufferState(u),c=e.getScheduleController(),f=e.getAbrController(),d=e.getStreamInfo(),h=d?d.id:null,g=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,p=f.getThroughputHistory(),m=p.getSafeAverageThroughput(u,g),y=p.getAverageLatency(u),E=e.useBufferOccupancyABR();return isNaN(m)||!l||E||f.getAbandonmentStateFor(h,u)!==o.a.ABANDON_LOAD&&(l.state===o.a.BUFFER_LOADED||g)&&(r.quality=f.getQualityForBitrate(s,m,h,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}s.__dashjs_factory_name="ThroughputRule";var u=r.a.getClassFactory(s),l=n(7),c=n(2),f=n(6),d=n(4);function h(e){e=e||{};var t,n,r,s=this.context,u=Object(l.a)(s).getInstance(),h=e.dashMetrics;function g(){(r={})[a.a.VIDEO]={ignoreCount:2},r[a.a.AUDIO]={ignoreCount:2}}function p(){g()}function m(e){isNaN(e.startTime)||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||r[e.mediaType].ignoreCount>0&&r[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=Object(i.a)(s).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!h||!h.hasOwnProperty("getCurrentBufferLevel")||!h.hasOwnProperty("getCurrentBufferState"))throw new Error(a.a.MISSING_CONFIG_ERROR)}();var u=e.getMediaType(),l=h.getCurrentBufferState(u),c=e.getRepresentationInfo().fragmentDuration,f=e.getStreamInfo(),d=f?f.id:null,g=e.getScheduleController(),p=f&&f.manifestInfo&&f.manifestInfo.isDynamic;if(function(e,t){return!e&&r[t].ignoreCount>0}(g.getPlaybackController().getLowLatencyModeEnabled(),u)||!c)return t;if(l&&l.state===o.a.BUFFER_EMPTY)n.debug("["+u+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),E=y.getThroughputHistory(),v=h.getCurrentBufferLevel(u),_=E.getAverageThroughput(u,p),T=E.getAverageLatency(u),b=_*(v/c)*.5;t.quality=y.getQualityForBitrate(m,b,d,T),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){g(),u.off(d.a.PLAYBACK_SEEKING,p,t),u.off(c.a.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=Object(f.a)(s).getInstance().getLogger(t),g(),u.on(d.a.PLAYBACK_SEEKING,p,t),u.on(c.a.BYTES_APPENDED_END_FRAGMENT,m,t),t}h.__dashjs_factory_name="InsufficientBufferRule";var g=r.a.getClassFactory(h);function p(e){e=e||{};var t,n,r,a,o,s=this.context,u=e.mediaPlayerModel,l=e.dashMetrics,c=e.settings;function d(){r={},a={},o=[]}return t={shouldAbandon:function(e){var t=Object(i.a)(s).create(i.a.NO_CHANGE,{name:p.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var f,d,h=e.getMediaInfo(),g=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,E=e.getCurrentRequest();if(!isNaN(E.index)){f=g,d=E.index,r[f]=r[f]||{},r[f][d]=r[f][d]||{};var v=u.getStableBufferTime();if(l.getCurrentBufferLevel(g)>v)return t;var _=r[g][E.index];if(null===_||null===E.firstByteDate||a.hasOwnProperty(_.id))return t;if(void 0===_.firstByteTime&&(o[g]=[],_.firstByteTime=E.firstByteDate.getTime(),_.segmentDuration=E.duration,_.bytesTotal=E.bytesTotal,_.id=E.index),_.bytesLoaded=E.bytesLoaded,_.elapsedTime=(new Date).getTime()-_.firstByteTime,_.bytesLoaded>0&&_.elapsedTime>0&&function(e,t){o[e]=o[e]||[],o[e].push(t)}(g,Math.round(8*_.bytesLoaded/_.elapsedTime)),o[g].length>=5&&_.elapsedTime>500&&_.bytesLoaded<_.bytesTotal){var T=o[g].reduce((function(e,t){return e+t}),0);if(_.measuredBandwidthInKbps=Math.round(T/o[g].length),_.estimatedTimeOfDownload=+(8*_.bytesTotal/_.measuredBandwidthInKbps/1e3).toFixed(2),_.estimatedTimeOfDownload<1.8*_.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!a.hasOwnProperty(_.id)){var b=e.getAbrController(),S=_.bytesTotal-_.bytesLoaded,A=b.getBitrateList(h),I=b.getQualityForBitrate(h,_.measuredBandwidthInKbps*c.get().streaming.abr.bandwidthSafetyFactor,y),R=b.getMinAllowedIndexFor(g,y),w=void 0!==R?Math.max(R,I):I;S>_.bytesTotal*A[w].bitrate/A[b.getQualityFor(g,y)].bitrate&&(t.quality=w,t.reason.throughput=_.measuredBandwidthInKbps,t.reason.fragmentID=_.id,a[_.id]=_,n.debug("["+g+"] frag id",_.id," is asking to abandon and switch to quality to ",w," measured bandwidth was",_.measuredBandwidthInKbps),delete r[g][_.id])}}else _.bytesLoaded===_.bytesTotal&&delete r[g][_.id]}return t},reset:d},n=Object(f.a)(s).getInstance().getLogger(t),d(),t}p.__dashjs_factory_name="AbandonRequestsRule";var m=r.a.getClassFactory(p);function y(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=Object(i.a)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),o=e.getStreamInfo().id;if(a){var s=a.getFrameHistory(o);if(!s||0===s.length)return r;for(var u=0,l=0,c=i.a.NO_CHANGE,f=1;f<s.length;f++)if(s[f]&&(u=s[f].droppedVideoFrames,(l=s[f].totalVideoFrames)>375&&u/l>.15)){c=f-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return Object(i.a)(n).create(c,{droppedFrames:u})}return r}},t=Object(f.a)(n).getInstance().getLogger(e),e}y.__dashjs_factory_name="DroppedFramesRule";var E=r.a.getClassFactory(y);function v(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,a=r?r.getSwitchRequests():[],o=0,s=0,u=0,l=Object(i.a)(n).create(),c=0;c<a.length;c++)if(void 0!==a[c]&&(o+=a[c].drops,s+=a[c].noDrops,u+=a[c].dropSize,o+s>=6&&o/s>.075)){l.quality=c>0&&a[c].drops>0?c-1:c,l.reason={index:l.quality,drops:o,noDrops:s,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(o+s)+" drops: "+o);break}return l}},t=Object(f.a)(n).getInstance().getLogger(e),e}v.__dashjs_factory_name="SwitchHistoryRule";var _=r.a.getClassFactory(v),T=n(5);function b(e){e=e||{};var t,n,r,s=this.context,u=e.dashMetrics,h=e.mediaPlayerModel,g=Object(l.a)(s).getInstance();function p(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function m(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=h.getStableBufferTime(),a=p(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,y(t)):t.state=0,t}function y(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function E(e,t){var n=h.getStableBufferTime();if(e.stableBufferTime!==n){var r=p(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=u.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=10,a*=r.Vp/e.Vp,a+=10,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function v(e,t){return e.Vp*(e.utilities[t]+e.gp)}function _(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var o=e.bitrates[a],s=e.utilities[a],u=e.Vp*(e.gp+(n*s-o*r)/(n-o));i=Math.max(i,u)}return i}function b(e){var t=e.mediaType===a.a.AUDIO?[a.a.AUDIO]:r;for(var n in t)r.hasOwnProperty(n)&&2===r[n].state&&(r[n].placeholderBuffer=0)}function S(){for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];0!==t.state&&(t.state=1,y(t))}}function A(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=r[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,R(t,e.chunk.mediaInfo.type)}}}function I(e){if(e&&e.metric===o.a.HTTP_REQUEST&&e.value&&e.value.type===T.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),R(t,e.mediaType))}}function R(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=u.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=v(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function w(e){if(e){var t=r[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function N(e){if(e){var t=r[e.mediaType];if(t&&0!==t.state){var n,i=u.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?_(t,t.abrQuality):10;var a=Math.max(0,n-i);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function C(){r={}}return t={getMaxIndex:function(e){var t=Object(i.a)(s).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var a=e.getMediaInfo(),o=e.getMediaType(),l=e.getScheduleController(),c=e.getStreamInfo(),f=e.getAbrController(),d=f.getThroughputHistory(),h=c?c.id:null,g=c&&c.manifestInfo&&c.manifestInfo.isDynamic,p=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!p)return t;l.setTimeToLoadDelay(0);var T=function(e){var t=e.getMediaType(),n=r[t];return n?0!==n.state&&E(n,t):(n=m(e),r[t]=n),n}(e);if(0===T.state)return t;var b,S=u.getCurrentBufferLevel(o),A=d.getAverageThroughput(o,g),I=d.getSafeAverageThroughput(o,g),R=d.getAverageLatency(o);if(t.reason.state=T.state,t.reason.throughput=A,t.reason.latency=R,isNaN(A))return t;switch(T.state){case 1:b=f.getQualityForBitrate(a,I,h,R),t.quality=b,t.reason.throughput=I,T.placeholderBuffer=Math.max(0,_(T,b)-S),T.lastQuality=b,!isNaN(T.lastSegmentDurationS)&&S>=T.lastSegmentDurationS&&(T.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,E(e,t)}(T,o),b=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||o>=i)&&(i=o,r=a)}return r}(T,S+T.placeholderBuffer);var w=f.getQualityForBitrate(a,I,h,R);b>T.lastQuality&&b>w&&(b=Math.max(w,T.lastQuality));var N=Math.max(0,S+T.placeholderBuffer-v(T,b));N<=T.placeholderBuffer?(T.placeholderBuffer-=N,N=0):(N-=T.placeholderBuffer,T.placeholderBuffer=0,b<f.getMaxAllowedIndexFor(o,h)?l.setTimeToLoadDelay(1e3*N):N=0),t.quality=b,t.reason.throughput=A,t.reason.latency=R,t.reason.bufferLevel=S,t.reason.placeholderBuffer=T.placeholderBuffer,t.reason.delay=N,T.lastQuality=b;break;default:n.debug("BOLA ABR rule invoked in bad state."),t.quality=f.getQualityForBitrate(a,I,h,R),t.reason.state=T.state,t.reason.throughput=I,t.reason.latency=R,T.state=1,y(T)}return t},reset:function(){C(),g.off(d.a.BUFFER_EMPTY,b,t),g.off(d.a.PLAYBACK_SEEKING,S,t),g.off(d.a.METRIC_ADDED,I,t),g.off(d.a.QUALITY_CHANGE_REQUESTED,w,t),g.off(d.a.FRAGMENT_LOADING_ABANDONED,N,t),g.off(c.a.MEDIA_FRAGMENT_LOADED,A,t)}},n=Object(f.a)(s).getInstance().getLogger(t),C(),g.on(d.a.BUFFER_EMPTY,b,t),g.on(d.a.PLAYBACK_SEEKING,S,t),g.on(d.a.METRIC_ADDED,I,t),g.on(d.a.QUALITY_CHANGE_REQUESTED,w,t),g.on(d.a.FRAGMENT_LOADING_ABANDONED,N,t),g.on(c.a.MEDIA_FRAGMENT_LOADED,A,t),t}b.__dashjs_factory_name="BolaRule";var S=r.a.getClassFactory(b);function A(e){e=e||{};var t,n,r,s,u=this.context,d=e.dashMetrics,h=Object(l.a)(u).getInstance();function g(e){var t={},n=e.getMediaInfo(),i=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=i,t.lastQuality=0,function(e){if(!e||!e.type)return;r[e.type]={},r[e.type].w=[],r[e.type].prev_w=[],r[e.type].Q=0,r[e.type].segment_request_start_s=0,r[e.type].segment_download_finish_s=0,r[e.type].B_target=1.5}(n),p(t),t}function p(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,p(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],i=r[e.chunk.mediaInfo.type];if(t&&0!==t.state){var a=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||a>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=a,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=a,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,v(t,i)}}}function E(e){if(e&&e.metric===o.a.HTTP_REQUEST&&e.value&&e.value.type===T.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),v(t,i))}}function v(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function S(){n={},r={}}return t={getMaxIndex:function(e){var t,o=Object(i.a)(u).create(),l=Math.pow(4,.99),c=Math.max(Math.pow(4,1),l*Math.sqrt(4)),f=e.getMediaInfo(),h=e.getMediaType(),m=f.bitrateList.map((function(e){return e.bandwidth})),y=m.length,E=e.getScheduleController(),v=e.getStreamInfo(),_=e.getAbrController(),T=_.getThroughputHistory(),S=v&&v.manifestInfo&&v.manifestInfo.isDynamic,A=e.useL2AABR(),I=d.getCurrentBufferLevel(h,!0),R=T.getSafeAverageThroughput(h,S),w=T.getAverageThroughput(h,S),N=T.getAverageLatency(h),C=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return o;if(o.reason=o.reason||{},!A||h===a.a.AUDIO)return o;E.setTimeToLoadDelay(0);var D=function(e){var t=e.getMediaType(),r=n[t];return r||(r=g(e),n[t]=r),r}(e);if(0===D.state)return o;var O=r[h];if(!O)return o;if(o.reason.state=D.state,o.reason.throughput=w,o.reason.latency=N,isNaN(w))return o;switch(D.state){case 1:if(t=_.getQualityForBitrate(f,R,v.id,N),o.quality=t,o.reason.throughput=R,D.lastQuality=t,!isNaN(D.lastSegmentDurationS)&&I>=O.B_target){D.state=2,O.Q=l;for(var M=0;M<y;++M)M===D.lastQuality?O.prev_w[M]=1:O.prev_w[M]=0}break;case 2:var P=[],L=d.getCurrentHttpRequest(h).trace.reduce((function(e,t){return e+t.d}),0),x=d.getCurrentHttpRequest(h).trace.reduce((function(e,t){return e+t.b[0]}),0),F=Math.round(8*x/L);F<1&&(F=1);for(var k=D.lastSegmentDurationS,U=1,B=0;B<y;++B)m[B]=m[B]/1e3,C*m[B]>F&&(U=-1),O.w[B]=O.prev_w[B]+U*(k/(2*c))*((O.Q+l)*(C*m[B]/F));O.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),o=0,s=0,u=[],l=0;l<t-1;++l)if((s=((o+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;c<t;++c)u[c]=Math.max(r[c]-s,0);return u}(O.w);for(var G=0;G<y;++G)P[G]=O.w[G]-O.prev_w[G],O.prev_w[G]=O.w[G];O.Q=Math.max(0,O.Q-k+k*C*((b(m,O.prev_w)+b(m,P))/F));for(var j=[],Y=0;Y<y;++Y)j[Y]=Math.abs(m[Y]-b(O.w,m));(t=j.indexOf(Math.min.apply(Math,j)))>D.lastQuality&&m[D.lastQuality+1]<=F&&(t=D.lastQuality+1),m[t]>=F&&(O.Q=2*Math.max(l,O.Q)),o.quality=t,o.reason.throughput=w,o.reason.latency=N,o.reason.bufferLevel=I,D.lastQuality=o.quality;break;default:s.debug("L2A ABR rule invoked in bad state."),o.quality=_.getQualityForBitrate(f,R,v.id,N),o.reason.state=D.state,o.reason.throughput=R,o.reason.latency=N,D.state=1,p(D)}return o},reset:function(){S(),h.off(c.a.PLAYBACK_SEEKING,m,t),h.off(c.a.MEDIA_FRAGMENT_LOADED,y,t),h.off(c.a.METRIC_ADDED,E,t),h.off(c.a.QUALITY_CHANGE_REQUESTED,_,t)}},s=Object(f.a)(u).getInstance().getLogger(t),S(),h.on(c.a.PLAYBACK_SEEKING,m,t),h.on(c.a.MEDIA_FRAGMENT_LOADED,y,t),h.on(c.a.METRIC_ADDED,E,t),h.on(c.a.QUALITY_CHANGE_REQUESTED,_,t),t}A.__dashjs_factory_name="L2ARule";var I=r.a.getClassFactory(A),R="manual_weight_selection",w="random_weight_selection",N="dynamic_weight_selection";function C(){var e,t,n,r,i,a,o,s,u,l=this.context;function c(){n=null,r=1,i=100,a=0,o=null,s=null,u=N}function d(){var e=0;if(n)for(var t=0;t<n.length;t++){var r=n[t];r.state.throughput>e&&(e=r.state.throughput)}return e}function h(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function g(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function p(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=g(i,e);m(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function m(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function y(e,t,n,r,i,a,u){o||(o=s[s.length-1]);var l=e.findWeightVector(t,n,r,i,a,u);null!==l&&-1!==l&&(o=l)}return e={getNextQuality:function(e,l,c,f,g,m,E){var v=c,_=f,T=l,b=function(e){if(!n){n=[];var t=e.bitrateList,i=[];a=t[0].bandwidth,t.forEach((function(e){i.push(e.bandwidth),e.bandwidth<a&&(a=e.bandwidth)})),l=i.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),r=Math.sqrt(l);for(var o=0;o<t.length;o++){var u={qualityIndex:o,bitrate:t[o].bandwidth,state:{throughput:t[o].bandwidth/r,latency:0,rebuffer:0,switch:0}};n.push(u)}s=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*d(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,o=null,s=0;s<n.length;s++){for(var u=n[s],l=null,c=0;c<t.length;c++){var f=h(u,t[c],r);(null===l||f<l)&&(l=f)}(null===o||l>o)&&(a=u,o=l)}t.push(a)}for(var g=null,p=null,m=0;m<t.length;m++){for(var y=0,E=0;E<t.length;E++)m!==E&&(y+=h(t[m],t[E],r));(null===g||y>g)&&(g=y,p=m)}var v=[];v.push(t[p]),t.splice(p,1);for(;t.length>0;){for(var _=null,T=null,b=0;b<t.length;b++){var S=h(v[0],t[b],r);(null===_||S<_)&&(_=S,T=b)}v.push(t[T]),t.splice(T,1)}return v}(n)}var l;return n}(e),S=l/r;S>1&&(S=d()),c/=i,t.debug("getNextQuality called throughput:".concat(S," latency:").concat(c," bufferSize:").concat(f," currentQualityIndex:").concat(m," playbackRate:").concat(g));var A=b[m],I=A.bitrate*E.getSegmentDuration()/T,C=Math.max(0,I-_);if(_-I<E.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(A.bitrate," downloadTime=").concat(I," currentBuffer=").concat(_," rebuffer=").concat(C)),function(e,t){var r=0,i=e;if(n)for(var a=0;a<n.length;a++){var o=n[a];o.bitrate<e.bitrate&&o.bitrate>r&&t>o.bitrate&&(r=o.bitrate,i=o)}return i}(A,T).qualityIndex;switch(u){case R:o=[.4,.4,.4,.4];break;case w:!function(e){o=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return o=n}(e.length,4)}(b);break;case N:y(E,b,v,_,C,T,g);break;default:y(E,b,v,_,C,T,g)}for(var D=null,O=null,M=null,P=0;P<b.length;P++){var L=b[P],x=L.state,F=[x.throughput,x.latency,x.rebuffer,x.switch],k=o.slice(),U=E.getNextBufferWithBitrate(L.bitrate,_,T),B=U<E.getMinBuffer();B&&t.debug("Buffer is low for bitrate=".concat(L.bitrate," downloadTime=").concat(I," currentBuffer=").concat(_," nextBuffer=").concat(U)),(L.bitrate>l-1e4||B)&&L.bitrate!==a&&(k[0]=100);var G=h(F,[S,0,0,0],k);(null===D||G<D)&&(D=G,O=L.qualityIndex,M=L)}var j=Math.abs(A.bitrate-M.bitrate)/r;return p(A,b,[S,c,C,j]),p(M,b,[S,0,0,j]),O},reset:function(){c()}},t=Object(f.a)(l).getInstance().getLogger(e),c(),e}C.__dashjs_factory_name="LearningAbrController";var D=r.a.getClassFactory(C);var O=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0};function M(){var e,t,n,r,i;function a(){t=null,n=null,r=null,i=null}function o(e,t,n,r){var i=new O;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=n||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),i.weights.playbackSpeedPenalty=r||200,i}function s(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var o=i.weights.latencyPenalty[a];if(n<=o.threshold){i.latencyWSum+=o.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),n=e,r=a,i=s},logSegmentMetrics:function(e,n,r,i){t&&s(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,u){var l=null;return n&&r&&i&&(l=o("segment",n,r,i)),l?(s(e,t,a,u,l),l.totalQoe):0},reset:function(){a()}},a(),e}M.__dashjs_factory_name="LoLpQoeEvaluator";var P=r.a.getClassFactory(M);function L(e){var t,n,r,i,a,o=e.targetLatency,s=e.bufferMin,u=e.segmentDuration,l=e.qoeEvaluator;function c(){return u}function f(e,t){var n=c();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return s},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return f(t,e*u/n)},getNextBuffer:f,findWeightVector:function(e,t,i,a,c,d){var h=null,g=null,p=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],a=n[2],y=(n[3],e.bitrate*u/c),E=f(i,y),v=(0===a?10:1/a)*Math.max(1e-5,y-E),_=(0===r?10:1/r)*e.state.latency,T=l.calculateSingleUseQoe(e.bitrate,v,_,d);(null===h||T>h)&&function(e,t,n){if(e>o+n)return!1;return t>=s}(t,E,m)&&(h=T,g=n,p=e.bitrate)}))})),null===g&&null===p&&(g=-1),r=t,g}},i=[.2,.4,.6,.8,1],a=4,n=function e(t,n,r){if(r===n)return t;for(var a=t.length,o=0;o<a;o++)for(var s=t.shift(),u=0;u<i.length;u++)t.push(s.concat(i[u]));return e(t,n,r+1)}(i.map((function(e){return[e]})),a,1),r=0,t}L.__dashjs_factory_name="LoLpWeightSelector";var x=r.a.getClassFactory(L);function F(e){var t,n,r,s,u=(e=e||{}).dashMetrics,l=this.context;return n={getMaxIndex:function(e){try{var n=Object(i.a)(l).create(),c=e.getMediaInfo().type,f=e.getAbrController(),d=e.getStreamInfo(),h=f.getQualityFor(c,d.id),g=e.getMediaInfo(),p=u.getCurrentBufferState(c),m=e.getScheduleController(),y=u.getCurrentBufferLevel(c,!0),E=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,v=m.getPlaybackController(),_=v.getCurrentLiveLatency();if(!e.useLoLPABR()||c===a.a.AUDIO)return n;_||(_=0);var T=v.getPlaybackRate(),b=f.getThroughputHistory().getSafeAverageThroughput(c,E);if(t.debug("Throughput ".concat(Math.round(b)," kbps")),isNaN(b)||!p)return n;if(f.getAbandonmentStateFor(d.id,c)===o.a.ABANDON_LOAD)return n;for(var S=g.bitrateList,A=e.getRepresentationInfo().fragmentDuration,I=S[0].bandwidth/1e3,R=S[S.length-1].bandwidth/1e3,w=0;w<S.length;w++){var N=S[w].bandwidth/1e3;N>R?R=N:N<I&&(I=N)}var C=S[h].bandwidth/1e3,D=u.getCurrentHttpRequest(c,!0),O=(D.tresponse.getTime()-D.trequest.getTime())/1e3,M=O>A?O-A:0;s.setupPerSegmentQoe(A,R,I),s.logSegmentMetrics(C,M,_,T);var P=x(l).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:s});return n.quality=r.getNextQuality(g,1e3*b,_,y,T,h,P),n.reason={throughput:b,latency:_},n.priority=i.a.PRIORITY.STRONG,m.setTimeToLoadDelay(0),n.quality!==h&&console.log("[TgcLearningRule]["+c+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(b),"kbps"),n}catch(e){throw e}},reset:function(){r.reset(),s.reset()}},t=Object(f.a)(l).getInstance().getLogger(n),r=D(l).create(),s=P(l).create(),n}F.__dashjs_factory_name="LoLPRule";var k=r.a.getClassFactory(F);function U(e){e=e||{};var t,n,r=this.context,o=e.mediaPlayerModel,s=e.customParametersModel,l=e.dashMetrics,c=e.settings;function f(e){return e.filter((function(e){return e.quality>i.a.NO_CHANGE}))}function d(e){var t,n,a,o,s,u={},l=null;if(0!==e.length){for(u[i.a.PRIORITY.STRONG]={quality:i.a.NO_CHANGE,reason:null},u[i.a.PRIORITY.WEAK]={quality:i.a.NO_CHANGE,reason:null},u[i.a.PRIORITY.DEFAULT]={quality:i.a.NO_CHANGE,reason:null},t=0,n=e.length;t<n;t+=1)(a=e[t]).quality!==i.a.NO_CHANGE&&(u[a.priority].quality===i.a.NO_CHANGE||u[a.priority].quality>a.quality)&&(u[a.priority].quality=a.quality,u[a.priority].reason=a.reason||null);return u[i.a.PRIORITY.WEAK].quality!==i.a.NO_CHANGE&&(l=u[i.a.PRIORITY.WEAK]),u[i.a.PRIORITY.DEFAULT].quality!==i.a.NO_CHANGE&&(l=u[i.a.PRIORITY.DEFAULT]),u[i.a.PRIORITY.STRONG].quality!==i.a.NO_CHANGE&&(l=u[i.a.PRIORITY.STRONG]),l&&(o=l.quality,s=l.reason),Object(i.a)(r).create(o,s)}}return{initialize:function(){t=[],n=[],c.get().streaming.abr.useDefaultABRRules&&(c.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_L2A?t.push(I(r).create({dashMetrics:l,settings:c})):c.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_LoLP?t.push(k(r).create({dashMetrics:l})):(t.push(S(r).create({dashMetrics:l,mediaPlayerModel:o,settings:c})),t.push(u(r).create({dashMetrics:l})),c.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(g(r).create({dashMetrics:l,settings:c})),c.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(_(r).create()),c.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(E(r).create()),c.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push(m(r).create({dashMetrics:l,mediaPlayerModel:o,settings:c})))),s.getAbrCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&t.push(e.rule(r).create()),"abandonFragmentRules"===e.type&&n.push(e.rule(r).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return d(f(t.map((function(t){return t.getMaxIndex(e)}))))||Object(i.a)(r).create()},getMinSwitchRequest:d,shouldAbandonFragment:function(e,t){return d(f(n.map((function(n){return n.shouldAbandon(e,t)}))))||Object(i.a)(r).create()},getQualitySwitchRules:function(){return t}}}U.__dashjs_factory_name="ABRRulesCollection";var B=r.a.getClassFactory(U);B.QUALITY_SWITCH_RULES="qualitySwitchRules",B.ABANDON_FRAGMENT_RULES="abandonFragmentRules",r.a.updateSingletonFactory(U.__dashjs_factory_name,B);t.a=B},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.a=i},function(e,t,n){"use strict";var r=n(3),i=n(20);function a(e){var t=(e=e||{}).requestModifier;function n(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&t.modifyRequestHeader&&(i=t.modifyRequestHeader(i,{url:e.url})),e.headers)for(var a in e.headers){var o=e.headers[a];o&&i.setRequestHeader(a,o)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i}return{load:function(e){t&&t.modifyRequest?Object(i.b)(e,t).then((function(){return n(e)})):n(e)},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";var o=r.a.getClassFactory(a);t.a=o},function(e,t,n){"use strict";e.exports=n(75)},function(e,t,n){"use strict";t.a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},function(e,t,n){"use strict";var r=n(31),i=n(3),a=n(16),o=n(15),s=n(27),u=n(1);function l(){var e,t,n,i,l,c,f,d,h=this.context,g=Object(a.a)(h).getInstance();function p(){i=[],l=[],c=[],d=[],f=null,t=[]}function m(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function y(e){var t;for(t=0;t<d.length;t++)if(d[t].rulename===e)return t;return-1}function E(e,n){v(e,n);var i=new r.a;i.schemeIdUri=e,i.value=n,t.push(i)}function v(e,n){Object(o.b)(e,"string"),Object(o.b)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getCustomInitialTrackSelectionFunction:function(){return f},setCustomInitialTrackSelectionFunction:function(e){f=e},resetCustomInitialTrackSelectionFunction:function(){f=null},getLicenseResponseFilters:function(){return l},getLicenseRequestFilters:function(){return i},getCustomCapabilitiesFilters:function(){return c},registerCustomCapabilitiesFilter:function(e){c.push(e)},registerLicenseResponseFilter:function(e){l.push(e)},registerLicenseRequestFilter:function(e){i.push(e)},unregisterCustomCapabilitiesFilter:function(e){m(c,e)},unregisterLicenseResponseFilter:function(e){m(l,e)},unregisterLicenseRequestFilter:function(e){m(i,e)},addAbrCustomRule:function(e,t,n){if("string"!=typeof e||e!==s.a.ABANDON_FRAGMENT_RULES&&e!==s.a.QUALITY_SWITCH_RULES||"string"!=typeof t)throw u.a.BAD_ARGUMENT_ERROR;var r=y(t);-1===r?d.push({type:e,rulename:t,rule:n}):(d[r].type=e,d[r].rule=n)},removeAllAbrCustomRule:function(){d=[]},removeAbrCustomRule:function(e){if(e){var t=y(e);-1!==t&&d.splice(t,1)}else d=[]},getAbrCustomRules:function(){return d},addUTCTimingSource:E,removeUTCTimingSource:v,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=g.get().streaming.utcSynchronization.defaultTimingSource;E(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},setConfig:function(){},reset:function(){p()}},n={default:!1},p(),e}l.__dashjs_factory_name="CustomParametersModel",t.a=i.a.getSingletonFactory(l)},function(e,t,n){"use strict";t.a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},function(e,t,n){"use strict";var r=n(1),i=n(0);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}var t,n,r;return t=e,(n=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==i.a.BASE_URL&&this.segmentInfoType!==i.a.SEGMENT_BASE&&!this.indexRange}}])&&a(t.prototype,n),r&&a(t,r),e}();var s=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null};var u=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};u.DEFAULT_ID="defaultId";var l=u;var c=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},f=n(31),d=n(45),h=n(41);var g=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0};var p=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null};var m=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultServiceLocation=null,this.queryBeforeStart=!1,this.proxyServerUrl=null,this.serverUrl=null},y=n(46),E=n(13),v=n(3),_=n(6),T=n(10),b=n(11),S=n(35);function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=R(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function I(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||R(e)||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.")}()}function R(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(){var e,t,n,a,u=this.context,v=Object(E.a)(u).getInstance(),R=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function w(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var n=U(e.Representation_asArray[0]);if(n&&n.length>0&&S.a.indexOf(n[0].schemeIdUri)>=0)return t===r.a.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===r.a.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var a=t===r.a.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var o=e.Representation_asArray[0].codecs;if(a.test(o))return!0}if(e.hasOwnProperty(i.a.MIME_TYPE))return a.test(e.mimeType);if(e.Representation_asArray)for(var s,u=0;u<e.Representation_asArray.length;u++)if((s=e.Representation_asArray[u]).hasOwnProperty(i.a.MIME_TYPE))return a.test(s.mimeType);return!1}function N(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(i.a.SEGMENT_TEMPLATE)||e.hasOwnProperty(i.a.SEGMENT_TIMELINE)||e.hasOwnProperty(i.a.SEGMENT_LIST)||e.hasOwnProperty(i.a.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(i.a.SEGMENT_TEMPLATE)||t.hasOwnProperty(i.a.SEGMENT_TIMELINE)||t.hasOwnProperty(i.a.SEGMENT_LIST)||t.hasOwnProperty(i.a.SEGMENT_BASE))return!0}return!1}function C(e){return w(e,r.a.AUDIO)}function D(e){return w(e,r.a.VIDEO)}function O(e){return w(e,r.a.TEXT)}function M(e){return w(e,r.a.IMAGE)}function P(){return function(e,t){return e.bandwidth-t.bandwidth}}function L(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function x(e,t){return e&&e.Period_asArray&&R(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function F(e){return e&&e.Period_asArray?e.Period_asArray:[]}function k(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.a.DYNAMIC),t}function U(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function B(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function G(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=l.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.a.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function j(e,t,n){var a,o=[];if(!e)return o;for(a=0;a<e.length;a++){var s=new g;if(s.timescale=1,s.representation=t,!e[a].hasOwnProperty(r.a.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");s.schemeIdUri=e[a].schemeIdUri,e[a].hasOwnProperty(i.a.TIMESCALE)&&(s.timescale=e[a].timescale),e[a].hasOwnProperty(i.a.VALUE)&&(s.value=e[a].value),o.push(s),s.period=n}return o}function Y(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var a=new h.a,o=n.__text||n;return v.isRelative(o)&&(r=!0,e.baseUri&&(o=v.resolve(o,e.baseUri))),a.url=o,n.hasOwnProperty(i.a.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=o,n.hasOwnProperty(i.a.DVB_PRIORITY)&&(a.dvb_priority=n[i.a.DVB_PRIORITY]),n.hasOwnProperty(i.a.DVB_WEIGHT)&&(a.dvb_weight=n[i.a.DVB_WEIGHT]),n.hasOwnProperty(i.a.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[i.a.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(i.a.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[i.a.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}})),t}return e={getIsTypeOf:w,getIsText:O,getIsFragmented:N,getProducerReferenceTimesForAdaptation:function(e){var t=e&&e.hasOwnProperty(i.a.PRODUCERREFERENCETIME_ASARRAY)?e[i.a.PRODUCERREFERENCETIME_ASARRAY]:[];(e&&e.hasOwnProperty(i.a.REPRESENTATION_ASARRAY)?e[i.a.REPRESENTATION_ASARRAY]:[]).forEach((function(e){e.hasOwnProperty(i.a.PRODUCERREFERENCETIME_ASARRAY)&&t.push.apply(t,I(e[i.a.PRODUCERREFERENCETIME_ASARRAY]))}));var n=[];return t.forEach((function(e){var t=new p;e.hasOwnProperty(i.a.ID)&&(t[i.a.ID]=e[i.a.ID],e.hasOwnProperty(i.a.WALL_CLOCK_TIME)&&(t[i.a.WALL_CLOCK_TIME]=e[i.a.WALL_CLOCK_TIME],e.hasOwnProperty(i.a.PRESENTATION_TIME)&&(t[i.a.PRESENTATION_TIME]=e[i.a.PRESENTATION_TIME],n.push(t))))})),n},getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(i.a.LANG)&&(t=e.lang),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(i.a.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(i.a.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(i.a.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(i.a.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(i.a.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=x(t,n);return r.length>0&&R(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=x(t,n),i=0;i<r.length;i++){if(Object(y.a)(u).getInstance().areEqual(r[i],e))return i}return-1},getAdaptationForId:function(e,t,n){var r,a,o=x(t,n);for(r=0,a=o.length;r<a;r++)if(o[r].hasOwnProperty(i.a.ID)&&o[r].id===e)return o[r];return null},getAdaptationsForType:function(e,t,n){var r,i,a=x(e,t),o=[];for(r=0,i=a.length;r<i;r++)w(a[r],n)&&o.push(L(a[r]));return o},getRealPeriods:F,getRealPeriodForIndex:function(e,t){var n=F(t);return n.length>0&&R(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=R(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.a.CENC_DEFAULT_KID)?e[i.a.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(i.a.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:k,getId:function(e){return e&&e[i.a.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.a.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.a.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.a.PUBLISH_TIME)?new Date(e[i.a.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=L(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&R(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,a,s=[],u=function(e){if(e&&e.period&&R(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&R(e.index))return L(t.AdaptationSet_asArray[e.index])}}(e);if(u&&u.Representation_asArray){if(e&&e.period&&R(e.period.index)){var l=Y(e.period.mpd.manifest);l&&(n=l[0])}for(var c=0,f=u.Representation_asArray.length;c<f;++c){var d=u.Representation_asArray[c],h=new o;if(h.index=c,h.adaptation=e,d.hasOwnProperty(i.a.ID)&&(h.id=d.id),d.hasOwnProperty(i.a.CODECS)&&(h.codecs=d.codecs),d.hasOwnProperty(i.a.MIME_TYPE)&&(h.mimeType=d[i.a.MIME_TYPE]),d.hasOwnProperty(i.a.CODEC_PRIVATE_DATA)&&(h.codecPrivateData=d.codecPrivateData),d.hasOwnProperty(i.a.BANDWITH)&&(h.bandwidth=d.bandwidth),d.hasOwnProperty(i.a.WIDTH)&&(h.width=d.width),d.hasOwnProperty(i.a.HEIGHT)&&(h.height=d.height),d.hasOwnProperty(i.a.SCAN_TYPE)&&(h.scanType=d.scanType),d.hasOwnProperty(i.a.MAX_PLAYOUT_RATE)&&(h.maxPlayoutRate=d.maxPlayoutRate),d.hasOwnProperty(i.a.SEGMENT_BASE)?(t=d.SegmentBase,h.segmentInfoType=i.a.SEGMENT_BASE):d.hasOwnProperty(i.a.SEGMENT_LIST)?(t=d.SegmentList).hasOwnProperty(i.a.SEGMENT_TIMELINE)?h.segmentInfoType=i.a.SEGMENT_TIMELINE:h.segmentInfoType=i.a.SEGMENT_LIST:d.hasOwnProperty(i.a.SEGMENT_TEMPLATE)?((t=d.SegmentTemplate).hasOwnProperty(i.a.SEGMENT_TIMELINE)?h.segmentInfoType=i.a.SEGMENT_TIMELINE:h.segmentInfoType=i.a.SEGMENT_TEMPLATE,t.hasOwnProperty(i.a.INITIALIZATION_MINUS)&&(h.initialization=t.initialization.split("$Bandwidth$").join(d.bandwidth).split("$RepresentationID$").join(d.id))):h.segmentInfoType=i.a.BASE_URL,h.essentialProperties=U(d),t){if(t.hasOwnProperty(i.a.INITIALIZATION)){var g=t.Initialization;g.hasOwnProperty(i.a.SOURCE_URL)&&(h.initialization=g.sourceURL),g.hasOwnProperty(i.a.RANGE)&&(h.range=g.range)}else O(u)&&N(u)&&u.mimeType&&-1===u.mimeType.indexOf("application/mp4")&&(h.range=0);t.hasOwnProperty(i.a.TIMESCALE)&&(h.timescale=t.timescale),t.hasOwnProperty(i.a.DURATION)?h.segmentDuration=t.duration/h.timescale:d.hasOwnProperty(i.a.SEGMENT_TEMPLATE)&&(t=d.SegmentTemplate).hasOwnProperty(i.a.SEGMENT_TIMELINE)&&(h.segmentDuration=B(t.SegmentTimeline)/h.timescale),t.hasOwnProperty(i.a.MEDIA)&&(h.media=t.media),t.hasOwnProperty(i.a.START_NUMBER)&&(h.startNumber=t.startNumber),t.hasOwnProperty(i.a.INDEX_RANGE)&&(h.indexRange=t.indexRange),t.hasOwnProperty(i.a.PRESENTATION_TIME_OFFSET)&&(h.presentationTimeOffset=t.presentationTimeOffset/h.timescale),t.hasOwnProperty(i.a.AVAILABILITY_TIME_OFFSET)?h.availabilityTimeOffset=t.availabilityTimeOffset:n&&void 0!==n.availabilityTimeOffset&&(h.availabilityTimeOffset=n.availabilityTimeOffset),t.hasOwnProperty(i.a.AVAILABILITY_TIME_COMPLETE)?h.availabilityTimeComplete="false"!==t.availabilityTimeComplete:n&&void 0!==n.availabilityTimeComplete&&(h.availabilityTimeComplete=n.availabilityTimeComplete)}h.MSETimeOffset=(a=void 0,void 0,a=(r=h).presentationTimeOffset,r.adaptation.period.start-a),h.path=[e.period.index,e.index,c],s.push(h)}}return s},getAdaptationsForPeriod:function(e){var n,a,o,u=e&&R(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,l=[];if(u&&u.AdaptationSet_asArray)for(o=0;o<u.AdaptationSet_asArray.length;o++)a=u.AdaptationSet_asArray[o],n=new s,a.hasOwnProperty(i.a.ID)&&(n.id=a.id),n.index=o,n.period=e,w(a,r.a.MUXED)?n.type=r.a.MUXED:C(a)?n.type=r.a.AUDIO:D(a)?n.type=r.a.VIDEO:O(a)?n.type=r.a.TEXT:M(a)?n.type=r.a.IMAGE:t.warn("Unknown Adaptation stream type"),l.push(n);return l},getRegularPeriods:function(e){var a,o,s=!!e&&k(e.manifest),u=[],c=null,f=null,d=null,h=null;for(o=0,a=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;o<a;o++)(f=e.manifest.Period_asArray[o]).hasOwnProperty(i.a.START)?(h=new l).start=f.start:null!==c&&c.hasOwnProperty(i.a.DURATION)&&null!==d?(h=new l).start=parseFloat((d.start+d.duration).toFixed(5)):0!==o||s||((h=new l).start=0),null!==d&&isNaN(d.duration)&&(null!==h?d.duration=parseFloat((h.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==h&&(h.id=G(f,o),h.index=o,h.mpd=e,f.hasOwnProperty(i.a.DURATION)&&(h.duration=f.duration),d&&(d.nextPeriodId=h.id),u.push(h),c=f,d=h),f=null,h=null;return 0===u.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(r.a.MISSING_CONFIG_ERROR)}();var t,i=k(e.mpd.manifest);e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:i?t=Number.POSITIVE_INFINITY:n.error(new T.a(b.a.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e));return t}(d)-d.start).toFixed(5))),u},getMpd:function(e){var t=new c;return e&&(t.manifest=e,e.hasOwnProperty(i.a.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(i.a.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(i.a.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(i.a.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(i.a.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(i.a.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(i.a.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(i.a.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,n,o=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,s=o?o.Period_asArray:null,u=s&&e&&R(e.index)?s[e.index].EventStream_asArray:null,l=[];if(u)for(t=0;t<u.length;t++){var c=new g;if(c.period=e,c.timescale=1,!u[t].hasOwnProperty(r.a.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(c.schemeIdUri=u[t][r.a.SCHEME_ID_URI],u[t].hasOwnProperty(i.a.TIMESCALE)&&(c.timescale=u[t][i.a.TIMESCALE]),u[t].hasOwnProperty(i.a.VALUE)&&(c.value=u[t][i.a.VALUE]),u[t].hasOwnProperty(i.a.PRESENTATION_TIME_OFFSET)&&(c.presentationTimeOffset=u[t][i.a.PRESENTATION_TIME_OFFSET]),n=0;u[t].Event_asArray&&n<u[t].Event_asArray.length;n++){var f=u[t].Event_asArray[n],h=new d.a;h.presentationTime=0,h.eventStream=c,f.hasOwnProperty(i.a.PRESENTATION_TIME)&&(h.presentationTime=f.presentationTime);var p=c.presentationTimeOffset?c.presentationTimeOffset/c.timescale:0;h.calculatedPresentationTime=h.presentationTime/c.timescale+e.start-p,f.hasOwnProperty(i.a.DURATION)&&(h.duration=f.duration/c.timescale),f.hasOwnProperty(i.a.ID)?h.id=f.id:h.id=null,f.Signal&&f.Signal.Binary?h.messageData=a.decodeArray(f.Signal.Binary.toString()):h.messageData=f.messageData||f.__cdata||f.__text,l.push(h)}}return l},getEssentialPropertiesForRepresentation:U,getEventStreamForAdaptationSet:function(e,t,n){var r,i,a;return e&&e.Period_asArray&&t&&t.period&&R(t.period.index)&&(i=e.Period_asArray[t.period.index])&&i.AdaptationSet_asArray&&R(t.index)&&(a=i.AdaptationSet_asArray[t.index])&&(r=a.InbandEventStream_asArray),j(r,null,n)},getEventStreamForRepresentation:function(e,t,n){var r,i,a,o;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&R(t.adaptation.period.index)&&(i=e.Period_asArray[t.adaptation.period.index])&&i.AdaptationSet_asArray&&R(t.adaptation.index)&&(a=i.AdaptationSet_asArray[t.adaptation.index])&&a.Representation_asArray&&R(t.index)&&(o=a.Representation_asArray[t.index])&&(r=o.InbandEventStream_asArray),j(r,t,n)},getUTCTimingSources:function(e){var t=k(e),n=!!e&&e.hasOwnProperty(i.a.AVAILABILITY_START_TIME),a=e?e.UTCTiming_asArray:null,o=[];return(t||n)&&a&&a.forEach((function(e){var t=new f.a;e.hasOwnProperty(r.a.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(i.a.VALUE)&&(t.value=e.value.toString(),o.push(t)))})),o},getBaseURLsFromElement:Y,getRepresentationSortFunction:P,getContentSteering:function(e){if(e&&e.hasOwnProperty(i.a.CONTENT_STEERING_AS_ARRAY)){var t=e[i.a.CONTENT_STEERING_AS_ARRAY][0],n=new m;return n.serverUrl=t.__text,t.hasOwnProperty(i.a.DEFAULT_SERVICE_LOCATION)&&(n.defaultServiceLocation=t[i.a.DEFAULT_SERVICE_LOCATION]),t.hasOwnProperty(i.a.QUERY_BEFORE_START)&&(n.queryBeforeStart="true"===t[i.a.QUERY_BEFORE_START].toLowerCase()),t.hasOwnProperty(i.a.PROXY_SERVER_URL)&&(n.proxyServerUrl=t[i.a.PROXY_SERVER_URL]),n}},getLocation:function(e){if(e&&e.hasOwnProperty(r.a.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(i.a.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(i.a.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(i.a.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(i.a.SERVICE_DESCRIPTION)){var n,r=A(e.ServiceDescription_asArray);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=null,s=null,u=null,l=null,c=null,f=null;for(var d in a)a.hasOwnProperty(d)&&(d===i.a.ID?o=a[d]:d===i.a.SERVICE_DESCRIPTION_SCOPE?s=a[d].schemeIdUri:d===i.a.SERVICE_DESCRIPTION_LATENCY?u={target:parseInt(a[d].target),max:parseInt(a[d].max),min:parseInt(a[d].min),referenceId:parseInt(a[d].referenceId)}:d===i.a.SERVICE_DESCRIPTION_PLAYBACK_RATE?l={max:parseFloat(a[d].max),min:parseFloat(a[d].min)}:d===i.a.SERVICE_DESCRIPTION_OPERATING_QUALITY?c={mediaType:a[d].mediaType,max:parseInt(a[d].max),min:parseInt(a[d].min),target:parseInt(a[d].target),type:a[d].type,maxQualityDifference:parseInt(a[d].maxQualityDifference)}:d===i.a.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH&&(f={mediaType:a[d].mediaType,max:parseInt(a[d].max),min:parseInt(a[d].min),target:parseInt(a[d].target)}));t.push({id:o,schemeIdUri:s,latency:u,playbackRate:l,operatingQuality:c,operatingBandwidth:f})}}catch(e){r.e(e)}finally{r.f()}}return t},getSupplementalProperties:function(e){var t={};if(e&&e.hasOwnProperty(i.a.SUPPLEMENTAL_PROPERTY)){var n,a=A(e.SupplementalProperty_asArray);try{for(a.s();!(n=a.n()).done;){var o=n.value;o.hasOwnProperty(r.a.SCHEME_ID_URI)&&o.hasOwnProperty(i.a.VALUE)&&(t[o[r.a.SCHEME_ID_URI]]=o[i.a.VALUE])}}catch(e){a.e(e)}finally{a.f()}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(a=e.BASE64))}},t=Object(_.a)(u).getInstance().getLogger(e),e}N.__dashjs_factory_name="DashManifestModel";t.a=v.a.getSingletonFactory(N)},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(1),i=n(0),a=n(3);var o=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""},s=n(13),u=n(12),l=n(23),c=n(29),f=n(39),d=n(40),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,n,a,g,p,m,y,E,v=this.context,_=e.adapter,T=e.baseURLController,b=e.streamInfo,S=e.timelineConverter,A=e.debug,I=e.eventBus,R=e.events,w=e.dashConstants,N=Object(s.a)(v).getInstance();function C(e,t){var r=new o;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,o=[],s=0;for(n=0,r=e.segments.length;n<r;n++)i=e.segments[n],(a=Object(u.b)(S,_.getIsDynamic(),t,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,s))&&(o.push(a),a=null,s++);return o}(n,t);t.segments=i,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){var i=null;r.some((function(t){if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=T.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:o}),n&&n(o)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=N.isRelative(e.media)?N.resolve(e.media,T.resolve(e.path).url):e.media;if(!t)return"";return Object(u.c)(t,e.id)}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function D(){n=[],g=-1,p=null}return t={getTracks:function(){return n},addTracks:function(){if(b&&_&&(p=_.getMediaInfoForType(b,r.a.IMAGE))){var e=_.getVoRepresentations(p);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.a.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.a.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.a.SEGMENT_BASE&&C(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:D,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),g=e)},getCurrentTrack:function(){return g<0?null:n[g]},getCurrentTrackIndex:function(){return g},getThumbnailRequestForTime:function(e){for(var t,r=_.getVoRepresentations(p),i=0;i<r.length;i++)if(n[g].id===r[i].id){t=r[i];break}return a.getSegmentRequestForTime(p,t,e)}},D(),y=Object(c.a)(v).create({}),E=Object(l.a)(v).getInstance(),m=Object(d.a)(v).create({events:R,eventBus:I,streamInfo:b,timelineConverter:S,dashConstants:w,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:r.a.IMAGE}),(a=Object(f.a)(v).create({streamInfo:b,type:r.a.IMAGE,timelineConverter:S,segmentsController:m,baseURLController:T,debug:A,eventBus:I,events:R,dashConstants:w,urlUtils:N})).initialize(!!_&&_.getIsDynamic()),t}g.__dashjs_factory_name="ThumbnailTracks";t.b=a.a.getClassFactory(g)},function(e,t,n){"use strict";var r=n(56),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var a=n(49);a.inherits=n(42);var o=n(88),s=n(73);a.inherits(f,o);for(var u=i(s.prototype),l=0;l<u.length;l++){var c=u[l];f.prototype[c]||(f.prototype[c]=s.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),o="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,u=0;u<o;u++)if(i[u]!==a[u]){s=u;break}var l=[];for(u=s;u<i.length;u++)l.push("..");return(l=l.concat(a.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(26))},function(e,t,n){var r;!function(i,a){"use strict";var o="model",s="name",u="type",l="vendor",c="version",f="mobile",d="tablet",h="smarttv",g=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},p=function(e,t){return"string"==typeof e&&-1!==m(t).indexOf(m(e))},m=function(e){return e.toLowerCase()},y=function(e,t){if("string"==typeof e)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),void 0===t?e:e.substring(0,255)},E=function(e,t){for(var n,r,i,a,o,s,u=0;u<t.length&&!o;){var l=t[u],c=t[u+1];for(n=r=0;n<l.length&&!o;)if(o=l[n++].exec(e))for(i=0;i<c.length;i++)s=o[++r],"object"==typeof(a=c[i])&&a.length>0?2===a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3===a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4===a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;u+=2}},v=function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(p(t[n][r],e))return"?"===n?void 0:n}else if(p(t[n],e))return"?"===n?void 0:n;return e},_={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},T={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,c],[/opios[\/ ]+([\w\.]+)/i],[c,[s,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[c,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[s,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[c,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[c,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[c,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],c],[/\bfocus\/([\w\.]+)/i],[c,[s,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[c,[s,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[s,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[s,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[c,[s,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],c],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[s,c],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,"Facebook"],c],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[s,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[s,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,c],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[c,[s,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[c,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[c,v,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[s,c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[s,c]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",m]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",m]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",m]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[o,[l,"Samsung"],[u,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[l,"Samsung"],[u,f]],[/\((ip(?:hone|od)[\w ]*);/i],[o,[l,"Apple"],[u,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[l,"Apple"],[u,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[l,"Huawei"],[u,d]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[o,[l,"Huawei"],[u,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[o,/_/g," "],[l,"Xiaomi"],[u,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[l,"Xiaomi"],[u,d]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[l,"OPPO"],[u,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[l,"Vivo"],[u,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[o,[l,"Realme"],[u,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[o,[l,"Motorola"],[u,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[l,"Motorola"],[u,d]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[l,"LG"],[u,d]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[l,"LG"],[u,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[l,"Lenovo"],[u,d]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[l,"Nokia"],[u,f]],[/(pixel c)\b/i],[o,[l,"Google"],[u,d]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[l,"Google"],[u,f]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[l,"Sony"],[u,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[l,"Sony"],[u,d]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[l,"OnePlus"],[u,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[l,"Amazon"],[u,d]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[l,"Amazon"],[u,f]],[/(playbook);[-\w\),; ]+(rim)/i],[o,l,[u,d]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[l,"BlackBerry"],[u,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[l,"ASUS"],[u,d]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[l,"ASUS"],[u,f]],[/(nexus 9)/i],[o,[l,"HTC"],[u,d]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[l,[o,/_/g," "],[u,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[l,"Acer"],[u,d]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[l,"Meizu"],[u,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[l,"Sharp"],[u,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[l,o,[u,f]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[l,o,[u,d]],[/(surface duo)/i],[o,[l,"Microsoft"],[u,d]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[l,"Fairphone"],[u,f]],[/(u304aa)/i],[o,[l,"AT&T"],[u,f]],[/\bsie-(\w*)/i],[o,[l,"Siemens"],[u,f]],[/\b(rct\w+) b/i],[o,[l,"RCA"],[u,d]],[/\b(venue[\d ]{2,7}) b/i],[o,[l,"Dell"],[u,d]],[/\b(q(?:mv|ta)\w+) b/i],[o,[l,"Verizon"],[u,d]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[l,"Barnes & Noble"],[u,d]],[/\b(tm\d{3}\w+) b/i],[o,[l,"NuVision"],[u,d]],[/\b(k88) b/i],[o,[l,"ZTE"],[u,d]],[/\b(nx\d{3}j) b/i],[o,[l,"ZTE"],[u,f]],[/\b(gen\d{3}) b.+49h/i],[o,[l,"Swiss"],[u,f]],[/\b(zur\d{3}) b/i],[o,[l,"Swiss"],[u,d]],[/\b((zeki)?tb.*\b) b/i],[o,[l,"Zeki"],[u,d]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[l,"Dragon Touch"],o,[u,d]],[/\b(ns-?\w{0,9}) b/i],[o,[l,"Insignia"],[u,d]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[l,"NextBook"],[u,d]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[l,"Voice"],o,[u,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[l,"LvTel"],o,[u,f]],[/\b(ph-1) /i],[o,[l,"Essential"],[u,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[l,"Envizen"],[u,d]],[/\b(trio[-\w\. ]+) b/i],[o,[l,"MachSpeed"],[u,d]],[/\btu_(1491) b/i],[o,[l,"Rotor"],[u,d]],[/(shield[\w ]+) b/i],[o,[l,"Nvidia"],[u,d]],[/(sprint) (\w+)/i],[l,o,[u,f]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[l,"Microsoft"],[u,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[l,"Zebra"],[u,d]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[l,"Zebra"],[u,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[l,o,[u,"console"]],[/droid.+; (shield) bui/i],[o,[l,"Nvidia"],[u,"console"]],[/(playstation [345portablevi]+)/i],[o,[l,"Sony"],[u,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[l,"Microsoft"],[u,"console"]],[/smart-tv.+(samsung)/i],[l,[u,h]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[l,"Samsung"],[u,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[l,"LG"],[u,h]],[/(apple) ?tv/i],[l,[o,"Apple TV"],[u,h]],[/crkey/i],[[o,"Chromecast"],[l,"Google"],[u,h]],[/droid.+aft(\w)( bui|\))/i],[o,[l,"Amazon"],[u,h]],[/\(dtv[\);].+(aquos)/i],[o,[l,"Sharp"],[u,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[l,y],[o,y],[u,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,h]],[/((pebble))app/i],[l,o,[u,"wearable"]],[/droid.+; (glass) \d/i],[o,[l,"Google"],[u,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[o,[l,"Zebra"],[u,"wearable"]],[/(quest( 2)?)/i],[o,[l,"Facebook"],[u,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[l,[u,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[o,[u,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[u,d]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,d]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,f]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[l,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[s,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,c],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[s,[c,v,_]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,"Windows"],[c,v,_]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[c,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,c],[/\(bb(10);/i],[c,[s,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[c,[s,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[s,"Chromium OS"],c],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[s,c],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[s,c]]},b=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof b))return new b(e,t).getResult();var n=e||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(T,t):T;return this.getBrowser=function(){var e,t={};return t[s]=void 0,t[c]=void 0,E.call(t,n,r.browser),t.major="string"==typeof(e=t.version)?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,t},this.getCPU=function(){var e={architecture:void 0};return E.call(e,n,r.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return E.call(e,n,r.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return E.call(e,n,r.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return E.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n="string"==typeof e&&e.length>255?y(e,255):e,this},this.setUA(n),this};b.VERSION="1.0.2",b.BROWSER=g([s,c,"major"]),b.CPU=g(["architecture"]),b.DEVICE=g([o,l,u,"console",f,h,d,"wearable","embedded"]),b.ENGINE=b.OS=g([s,c]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=b),t.UAParser=b):n(54)?void 0===(r=function(){return b}.call(t,n,t,e))||(e.exports=r):void 0!==i&&(i.UAParser=b);var S=void 0!==i&&(i.jQuery||i.Zepto);if(S&&!S.ua){var A=new b;S.ua=A.getResult(),S.ua.get=function(){return A.getUA()},S.ua.set=function(e){A.setUA(e);var t=A.getResult();for(var n in t)S.ua[n]=t[n]}}}("object"==typeof window?window:this)},function(e,t,n){"use strict";var r=n(17),i=n(5),a=n(3),o=n(4),s=n(12),u=n(0);function l(e){var t,n,a,l,c,f=(e=e||{}).eventBus,d=e.debug,h=e.urlUtils,g=e.type,p=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,E=e.baseURLController;function v(){return g}function _(){a=null}function T(e,t,n){var r,i,a=E.resolve(n.path);return a&&t!==a.url&&h.isRelative(t)?(r=a.url,i=a.serviceLocation,t&&(r=h.resolve(t,r))):r=t,!h.isRelative(r)&&(e.url=r,e.serviceLocation=i,!0)}function b(e,t){if(null==t)return null;var n=new r.a,a=t.representation,o=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=Object(s.d)(u,"Number",t.replacementNumber),u=Object(s.d)(u,"Time",t.replacementTime),u=Object(s.d)(u,"Bandwidth",o),u=Object(s.c)(u,a.id),u=Object(s.e)(u),n.mediaType=v(),n.type=i.a.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.availabilityTimeComplete=a.availabilityTimeComplete,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,T(n,u,a)?n:void 0}function S(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var o=m.getSegmentByTime(t,r);return o&&(a=o,n.debug("Index for time "+r+" is "+o.index),i=b(e,o)),i}function A(){n.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){l=e,c=!1,m.initialize(e)},getStreamId:function(){return p.id},getType:v,getStreamInfo:function(){return p},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.a,o=t.adaptation.period,u=o.start;if(a.mediaType=n,a.type=i.a.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+o.duration,t,l),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,T(a,t.initialization,t))return a.url=Object(s.d)(a.url,"Bandwidth",t.bandwidth),a}(e,t,v()):null},getSegmentRequestForTime:S,getCurrentIndex:function(){return a?a.index:-1},getNextSegmentRequest:function(e,t){var r=null;if(!t||!t.segmentInfoType)return null;var i=a?a.index+1:0,o=m.getSegmentByIndex(t,i,a?a.mediaStartTime:-1);if(o)r=b(e,o),a=o;else{if(l&&!c)return n.debug(v()+" No segment found at index: "+i+". Wait for next loop"),null;c=!0}return r},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.a.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.a.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.a.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){_(),f.off(o.a.DYNAMIC_TO_STATIC,A,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?b(e,r):null},getValidTimeCloseToTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;for(var i=n.adaptation.period.start,a=n.adaptation.period.start+n.adaptation.period.duration,o=Math.min(e+r,a),s=Math.max(e-r,i),u=NaN,l=null;o<=a||s>=i;){var c=null,f=null;if(o<=a&&(c=S(t,n,o)),s>=i&&(f=S(t,n,s)),f){u=s,l=f;break}if(c){u=o,l=c;break}o+=r,s-=r}if(l){var d=l.startTime+l.duration;return e>=l.startTime&&d-e>r?e:e<l.startTime?l.startTime+.001:Math.min(d-r,u)}return u}catch(e){return NaN}},getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.duration<e)return NaN;for(var i=Math.min(n.adaptation.period.start+n.adaptation.period.duration,e+30),a=Math.min(e+r,i),o=NaN,s=null;a<=i;){var u=null;if(a<=i&&(u=S(t,n,a)),u){o=a,s=u;break}a+=r}if(s){var l=s.startTime+s.duration;return e>s.startTime&&l-e>r?e:!isNaN(s.startTime)&&e<s.startTime&&o>s.startTime?s.startTime+.001:Math.min(l-r,o)}return o}catch(e){return NaN}}},n=d.getLogger(t),_(),f.on(o.a.DYNAMIC_TO_STATIC,A,t),t}l.__dashjs_factory_name="DashHandler",t.a=a.a.getClassFactory(l)},function(e,t,n){"use strict";var r=n(3),i=n(1),a=n(12);function o(e,t){var n=(e=e||{}).timelineConverter,r=e.dashMetrics;function o(){if(!n)throw new Error(i.a.MISSING_CONFIG_ERROR)}function s(e,t){var n,r,i,a,o,s,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,f=c.SegmentTimeline,d=c.SegmentURL_asArray,h=0,g=-1;l=e.timescale;var p=!1;for(i=0,a=(n=f.S_asArray).length;i<a&&!p;i++){if(s=0,(r=n[i]).hasOwnProperty("r")&&(s=r.r),r.hasOwnProperty("t")&&(h=r.t),s<0)s=u(e,n[i+1],r,l,h/l);for(o=0;o<=s&&!p;o++)(p=t(h,c,d,r,l,++g,i))&&(e.segmentDuration=r.d/l),h+=r.d}}function u(e,t,i,a,o){var s;if(t&&t.hasOwnProperty("t"))s=t.t/a;else try{var u=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var l=r.getCurrentDVRInfo();u=isNaN(l.end)?0:l.end}else u=e.adaptation.period.start+e.adaptation.period.duration;s=n.calcMediaTimeFromPresentationTime(u,e),e.segmentDuration=i.d/a}catch(e){s=0}return Math.max(Math.ceil((s-o)/(i.d/a))-1,0)}return{getSegmentByIndex:function(e,r,i){if(o(),!e)return null;var u=null,l=!1;return s(e,(function(r,o,s,c,f,d,h){if(l||i<0){var g=o.media,p=c.mediaRange;return s&&(g=s[h].media||"",p=s[h].mediaRange),u=Object(a.b)(n,t,e,r,c.d,f,g,p,d,c.tManifest),!0}return r>=i*f-.5*c.d&&(l=!0),!1})),u},getSegmentByTime:function(e,r){if(o(),!e)return null;void 0===r&&(r=null);var i=null,u=n.calcMediaTimeFromPresentationTime(r,e);return s(e,(function(r,o,s,l,c,f,d){var h=parseFloat((u*c).toPrecision(15));if(h<r+l.d&&h>=r){var g=o.media,p=l.mediaRange;return s&&(g=s[d].media||"",p=s[d].mediaRange),i=Object(a.b)(n,t,e,r,l.d,c,g,p,f,l.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,o,s,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,f=0,d=0;for(s=e.timescale,i=(t=l.S_asArray).length,r=0;r<i;r++){if(o=0,(n=t[r]).hasOwnProperty("r")&&(o=n.r),n.hasOwnProperty("t")&&(f=(c=n.t)/s),o<0)o=u(e,t[r+1],n,s,f);for(a=0;a<=o;a++)d++,f=(c+=n.d)/s}return{numberOfSegments:d,mediaTimeOfLastSignaledSegment:f}}}}o.__dashjs_factory_name="TimelineSegmentsGetter";var s=r.a.getClassFactory(o);function u(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.a.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var s=Object(a.a)(n,t,e,i);if(s){s.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var u=o.media;u=Object(a.d)(u,"Number",s.replacementNumber),u=Object(a.d)(u,"Time",s.replacementTime),s.media=u}return s}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}}}u.__dashjs_factory_name="TemplateSegmentsGetter";var l=r.a.getClassFactory(u);function c(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.a.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,s=o.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(i-l,0),f=null;if(c<s){var d=o.SegmentURL_asArray[c];(f=Object(a.a)(n,t,e,i))&&(f.replacementTime=(u+i-1)*e.segmentDuration,f.media=d.media?d.media:"",f.mediaRange=d.mediaRange,f.indexRange=d.indexRange)}return f}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL_asArray.length,t}}}c.__dashjs_factory_name="ListSegmentsGetter";var f=r.a.getClassFactory(c);function d(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.a.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r,i=e.segments?e.segments.length:-1;if(t<i&&(r=e.segments[t])&&r.index===t)return r;for(var a=0;a<i;a++)if((r=e.segments[a])&&r.index===t)return r;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){return n(),r(e,function(e,t){if(!e)return-1;var n,r,i,a,o,s=e.segments,u=s?s.length:null,l=-1;if(s&&u>0)for(o=0;o<u;o++)if(r=s[o],i=r.presentationStartTime,a=r.duration,t+(n=a/2)>=i&&t-n<i+a){l=r.index;break}return l}(e,t))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}}}d.__dashjs_factory_name="SegmentBaseGetter";var h=r.a.getClassFactory(d);function g(e){e=e||{};var t,n,r=this.context,i=e.dashConstants,a=e.type,o=e.segmentBaseController;function u(e){return e?e.segments?n[i.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[i.SEGMENT_TIMELINE]=s(r).create(e,t),n[i.SEGMENT_TEMPLATE]=l(r).create(e,t),n[i.SEGMENT_LIST]=f(r).create(e,t),n[i.SEGMENT_BASE]=h(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():o.getSegmentBaseInitSegment({representation:e,mediaType:a})},updateSegmentData:function(e,t){return t?Promise.resolve():o.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:a})},getSegmentByIndex:function(e,t,n){var r=u(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=u(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=u(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}g.__dashjs_factory_name="SegmentsController";var p=r.a.getClassFactory(g);t.a=p},function(e,t,n){"use strict";var r=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.a=r},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){!function(e){"use strict";var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},c=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};c.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var f=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new c(t,n,r,i,a)};f.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var d=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new f);this.pos=0,this.currPenState=new c};d.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new d);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var g=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};g.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var p=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new g(1,t),new g(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};p.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=c,e.CaptionScreen=h,e.Cea608Parser=p,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(s),s++;o(u,c,e,s)&&a.push([s,c]),s+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,s&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)))}return r}}(t)},function(e,t,n){"use strict";var r=n(7),i=n(4),a=n(19),o=n(3),s=n(16),u=n(1),l=n(5),c=n(34),f=n(14);function d(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g="m",p="a",m="v",y="i",E="c",v="tt",_="k",T="o",b="d",S="s",A="v",I="l";function R(){var e,t,n,o,h,R,w,N,C,D,O=this.context,M=Object(r.a)(O).getInstance(),P=Object(s.a)(O).getInstance();function L(){n={pr:1,nor:null,st:null,sf:null,sid:"".concat(f.a.generateUuid()),cid:null},C={},N={},D={},F()}function x(){F()}function F(){if(R){var e=R.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(w=t.getProcessors())}}}function k(e,t){var n,r={},i=d(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a]&&(r[a]=e[a])}}catch(e){i.e(e)}finally{i.f()}return r}function U(e){var t=P.get().streaming.cmcd.enabledKeys;return e.filter((function(e){return t.includes(e)}))}function B(e){try{return e.type===l.a.MPD_TYPE?((t=G()).ot=g,t):e.type===l.a.MEDIA_SEGMENT_TYPE?(function(e){D.hasOwnProperty(e)||(D[e]=!1);N.hasOwnProperty(e)||(N[e]=!1);C.hasOwnProperty(e)||(C[e]=!1)}(e.mediaType),function(e){var t,r=G(),i=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),a=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),s=function(e){try{return 100*parseInt(o.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),l=function(e){try{var t=n.pr,r=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),c=j(e.mediaType),g=function(e){try{var t=o.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),y=n.pr,_=function(e){if(!w||0===w.length)return;var t,n=d(w);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.getType()===e)return r.probeNextRequest()}}catch(e){n.e(e)}finally{n.f()}}(e.mediaType);e.mediaType===u.a.VIDEO&&(t=m);e.mediaType===u.a.AUDIO&&(t=p);e.mediaType===u.a.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?v:E);var T=P.get().streaming.cmcd.rtp;T||(T=function(e){var t=R.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration,o=j(r);0===o&&(o=500);var s=i.bitrateList[n].bandwidth*a/1e3/(o/t/1e3),u=P.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(P.get().streaming.cmcd.rtpSafetyFactor)?P.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(s*u/100)+1)}(e));r.rtp=T,_&&(e.url!==_.url?r.nor=encodeURIComponent(f.a.getRelativeUrl(e.url,_.url)):_.range&&(r.nrr=_.range));i&&(r.br=i);t&&(r.ot=t);isNaN(a)||(r.d=a);isNaN(s)||(r.mtp=s);isNaN(l)||(r.dl=l);isNaN(c)||(r.bl=c);isNaN(g)||(r.tb=g);isNaN(y)||1===y||(r.pr=y);C[e.mediaType]&&(r.bs=!0,C[e.mediaType]=!1);!N[e.mediaType]&&D[e.mediaType]||(r.su=!0,N[e.mediaType]=!1,D[e.mediaType]=!0);return r}(e)):e.type===l.a.INIT_SEGMENT_TYPE?function(){var e=G();return e.ot=y,e.su=!0,e}():e.type===l.a.OTHER_TYPE||e.type===l.a.XLINK_EXPANSION_TYPE?function(){var e=G();return e.ot=T,e}():e.type===l.a.LICENSE?function(e){var t=G();return t.ot=_,t}():null}catch(e){return null}var t}function G(){var e={},t=P.get().streaming.cmcd.cid?P.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=P.get().streaming.cmcd.sid?P.get().streaming.cmcd.sid:n.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function j(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function Y(e){try{n.pr=e.playbackRate}catch(e){}}function q(t){try{var r=e.getIsDynamic(t.data)?I:A,i=t.protocol&&"MSS"===t.protocol?S:b;n.st="".concat(r),n.sf="".concat(i)}catch(e){}}function H(e){try{e.state&&e.mediaType&&e.state===i.a.BUFFER_EMPTY&&(C[e.mediaType]||(C[e.mediaType]=!0),N[e.mediaType]||(N[e.mediaType]=!0))}catch(e){}}function V(){for(var e in C)C.hasOwnProperty(e)&&(C[e]=!0);for(var t in N)N.hasOwnProperty(t)&&(N[t]=!0)}function K(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){return"v"===r&&1===e[r]||("string"==typeof e[r]&&"ot"!==r&&"sf"!==r&&"st"!==r?t+="".concat(r,"=").concat(JSON.stringify(e[r])):t+="".concat(r,"=").concat(e[r]),i<n-1&&(t+=",")),t}),"");return r=(r=r.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled){var t=B(e),n=K(function(e){try{var t=P.get().streaming.cmcd.enabledKeys;return Object.keys(e).filter((function(e){return t.includes(e)})).reduce((function(t,n){return t[n]=e[n],t}),{})}catch(t){return e}}(t));return M.trigger(a.a.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled){var t=B(e),n=k(t,U(["br","d","ot","tb"])),r=k(t,U(["bl","dl","mtp","nor","nrr","su"])),i=k(t,U(["bs","rtp"])),o=k(t,U(["cid","pr","sf","sid","st","v"])),s={"CMCD-Object":K(n),"CMCD-Request":K(r),"CMCD-Status":K(i),"CMCD-Session":K(o)};return M.trigger(a.a.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:s}),s}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(o=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(R=e.playbackController))},reset:function(){M.off(i.a.PLAYBACK_RATE_CHANGED,Y,this),M.off(i.a.MANIFEST_LOADED,q,this),M.off(i.a.BUFFER_LEVEL_STATE_CHANGED,H,t),M.off(i.a.PLAYBACK_SEEKED,V,t),L()},initialize:function(){M.on(i.a.PLAYBACK_RATE_CHANGED,Y,t),M.on(i.a.MANIFEST_LOADED,q,t),M.on(i.a.BUFFER_LEVEL_STATE_CHANGED,H,t),M.on(i.a.PLAYBACK_SEEKED,V,t),M.on(i.a.PERIOD_SWITCH_COMPLETED,x,t)}},e=Object(c.a)(O).getInstance(),L(),t}R.__dashjs_factory_name="CmcdModel",t.a=o.a.getSingletonFactory(R)},function(e,t,n){"use strict";t.a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},function(e,t,n){"use strict";var r=n(3),i=n(66),a=n.n(i);function o(){return{areEqual:function(e,t){return a()(e,t)}}}o.__dashjs_factory_name="ObjectUtils",t.a=r.a.getSingletonFactory(o)},function(e,t,n){"use strict";t.a=function(e){e=e||{},function(){void 0===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)}();var t=1,n=3,r=4,i=8,a=9;function o(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function s(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function u(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function l(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function c(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function f(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function d(s,h){if(s.nodeType==a){for(var g=new Object,p=s.childNodes,m=0;m<p.length;m++){if((E=p[m]).nodeType==t)if(e.ignoreRoot)g=d(E);else(g={})[v=o(E)]=d(E)}return g}if(s.nodeType==t){(g=new Object).__cnt=0;var y=[];for(p=s.childNodes,m=0;m<p.length;m++){var E,v=o(E=p[m]);if(E.nodeType!=i){var _=h+"."+v;if(f(g,E.nodeType,v,_))if(g.__cnt++,null==g[v]){var T=d(E,_);if("#text"!=v||/[^\s]/.test(T))(b={})[v]=T,y.push(b);g[v]=T,l(g,v,_)}else{null!=g[v]&&(g[v]instanceof Array||(g[v]=[g[v]],l(g,v,_)));var b;T=d(E,_);if("#text"!=v||/[^\s]/.test(T))(b={})[v]=T,y.push(b);g[v][g[v].length]=T}}}g.__children=y;for(var S=o(s),A=0;A<s.attributes.length;A++){var I=s.attributes[A];g.__cnt++;for(var R=I.value,w=0,N=e.matchers.length;w<N;w++){var C=e.matchers[w];C.test(I,S)&&(R=C.converter(I.value))}g[e.attributePrefix+I.name]=R}var D=function(e){return e.prefix}(s);return null!=D&&""!=D&&(g.__cnt++,g.__prefix=D),null!=g["#text"]&&(g.__text=g["#text"],g.__text instanceof Array&&(g.__text=g.__text.join("\n")),e.stripWhitespaces&&(g.__text=g.__text.trim()),delete g["#text"],"property"==e.arrayAccessForm&&delete g["#text_asArray"],g.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?c(t):t}return t}(g.__text,v,h+"."+v)),null!=g["#cdata-section"]&&(g.__cdata=g["#cdata-section"],delete g["#cdata-section"],"property"==e.arrayAccessForm&&delete g["#cdata-section_asArray"]),0==g.__cnt&&"text"==e.emptyNodeForm?g="":1==g.__cnt&&null!=g.__text?g=g.__text:1!=g.__cnt||null==g.__cdata||e.keepCData?g.__cnt>1&&null!=g.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==g.__text||""==g.__text.trim())&&delete g.__text:g=g.__cdata,delete g.__cnt,!e.enableToStringFunc||null==g.__text&&null==g.__cdata||(g.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),g}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o<r.length;o++){var u=r[o],l=t[u];e.escapeMode&&(l=s(l)),a+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?a+='"'+l+'"':a+="'"+l+"'"}return a+=i?"/>":">"}function g(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function p(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function m(e){var t=0;if(e instanceof Object)for(var n in e)p(e,n)||t++;return t}function y(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function E(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function v(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function _(e,t){return""===e?t:e+"."+t}function T(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=h(e[a],t,E(e[a]),!1),i+=b(e[a],_(r,t)),i+=g(e[a],t);return i}function b(e,t){var n="";if(m(e)>0)for(var r in e)if(!p(e,r)&&(""==t||y(e,r,_(t,r)))){var i=e[r],a=E(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=T(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=g(i,r);else{m(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=b(i,_(t,r)),n+=g(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=v(i),n+=g(i,r)}return n+=v(e)}this.parseXmlString=function(e){var t;window.ActiveXObject||window;if(void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?c(e):e},this.xml2json=function(e){return d(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return b(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},function(e,t,n){"use strict";var r=n(3),i=n(29),a=n(16),o=n(1),s=n(20);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){e=e||{};var t,n=this.context,r=e.requestModifier,i=e.lowLatencyThroughputModel,c=e.boxParser,f=Object(a.a)(n).getInstance();function d(e){var n,a=new Date,s=e.request,d=new Headers;if(s.range&&d.append("Range","bytes="+s.range),e.headers)for(var p in e.headers){var m=e.headers[p];m&&d.append(p,m)}s.requestStartDate||(s.requestStartDate=a),r&&r.modifyRequestHeader&&r.modifyRequestHeader({setRequestHeader:function(e,t){d.append(e,t)}},{url:e.url}),"function"==typeof window.AbortController&&(n=new AbortController,e.abortController=n,n.signal.onabort=e.onabort);var y={method:e.method,headers:d,credentials:e.withCredentials?"include":void 0,signal:n?n.signal:void 0},E=f.get().streaming.abr.fetchThroughputCalculationMode,v=Date.now(),_=0;new Promise((function(e){if(E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&i&&(_=i.getThroughputCapacityDelayMS(s,1e3*t.getCurrentBufferLevel(s.mediaType))))return setTimeout(e,_);e()})).then((function(){var n=Date.now();fetch(e.url,y).then((function(r){e.response||(e.response={}),e.response.status=r.status,e.response.statusText=r.statusText,e.response.responseURL=r.url,r.ok||e.onerror();var a,f="",d=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(r.headers.keys());try{for(d.s();!(a=d.n()).done;){var p=a.value;f+=p+": "+r.headers.get(p)+"\r\n"}}catch(e){d.e(e)}finally{d.f()}if(e.response.responseHeaders=f,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var m,y,T=parseInt(r.headers.get("Content-Length"),10),b=0,S=!1,A=new Uint8Array,I=0;if(E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&i){var R=n,w=0,N=u(r.body.tee(),2),C=N[0],D=N[1];m=C.getReader(),y=[],m.read().then((function r(a){var o=a.value,u=a.done;if(w=Date.now(),o&&o.length){var l=w-R,c=o.length;y.push({chunkDownloadTimeRelativeMS:w-n,chunkDownloadDurationMS:l,chunkBytes:c,kbps:Math.round(8*c/(l/1e3)),bufferLevel:t.getCurrentBufferLevel(s.mediaType)})}if(u){var d=w-n,h=y.reduce((function(e,t){return e+t.chunkBytes}),0);return i.addMeasurement(s,d,y,v,_,f),void e.progress({loaded:h,total:h,lengthComputable:!0,time:i.getEstimatedDownloadDurationMS(s),stream:!0})}return R=Date.now(),m.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var O=[],M=[],P=[],L=!0;h(e,(function t(n){var r=n.value;if(n.done){if(A){if(E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null,a=null;E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING?(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n<e.length-1})),r=t.filter((function(e,n){return n<t.length-1}));var i=[];if(n.length>1){for(var a=0,o=0,s=0;s<n.length;s++)if(n[s]&&r[s]){var u=r[s].ts-n[s].ts;if(u>1)i.push(8*r[s].bytes/u);else{0===o&&(o=n[s].ts);var l=r[s].ts-o;l>1?(i.push(8*a/l),a=0,o=0):a+=r[s].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(M,P))&&(a=8*b/i):E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA&&(a=g(O,b)),e.progress({loaded:b,total:isNaN(T)?b:T,lengthComputable:!0,time:a,stream:!0})}e.response.response=A.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){if(A=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(A,r),b+=r.length,O.push({ts:Date.now(),bytes:r.length}),E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&L)c.findLastTopIsoBoxCompleted(["moof"],A,I).found&&(L=!1,M.push({ts:performance.now(),bytes:r.length}));var s=c.findLastTopIsoBoxCompleted(["moov","mdat"],A,I);if(s.found){var u,l=s.lastCompletedOffset+s.size;E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||L||(L=!0,P.push({ts:performance.now(),bytes:A.length})),l===A.length?(u=A,A=new Uint8Array):(u=new Uint8Array(A.subarray(0,l)),A=A.subarray(l)),e.progress({data:u.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=s.lastCompletedOffset,S||(e.progress({lengthComputable:!1,noTrace:!0}),S=!0)}h(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))}function h(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function g(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o<r?o:0}})),n}return null}catch(e){return null}}return{load:function(e){r&&r.modifyRequest?Object(s.b)(e,r).then((function(){return d(e)})):d(e)},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:g,setup:function(e){t=e.dashMetrics}}}f.__dashjs_factory_name="FetchLoader";var d=r.a.getClassFactory(f),h=n(5),g=n(10),p=n(44),m=n(14),y=n(6),E=n(7),v=n(2);function _(){var e,t,n=this.context,r={};function i(){t=Object(y.a)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,o=e.length,s=0;s<o;++s)n+=e[s].chunkDownloadTimeRelativeMS,r+=e[s].bufferLevel,i+=e[s].chunkDownloadTimeRelativeMS*e[s].bufferLevel,a+=e[s].chunkDownloadTimeRelativeMS*e[s].chunkDownloadTimeRelativeMS;return t.m=(i-n*r/o)/(a-n*n/o),t.b=r/o-t.m*n/o,function(e){return t.m*e+t.b}}function o(e){var t,n=!0,r=e.reduce((function(e,t){return e+t.bufferLevelAtSegmentEnd}),0)/e.length;return e.forEach((function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(n=!1),e.bufferLevelAtSegmentEnd/r<.8&&(n=!1),t?t>e.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,o){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var s=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:s&&s.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:o,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(i),u=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS<n.fetchDownloadDurationMS)return n.fetchDownloadDurationMS;if(!s||n.segDurationMS<n.fetchDownloadDurationMS)return.8*n.fetchDownloadDurationMS;if(n.adjustedAvailabilityStartTimeMS<=n.requestTimeMS+n.throughputCapacityDelayMS-n.segDurationMS)return.8*n.fetchDownloadDurationMS;for(var l=n.requestTimeMS+n.throughputCapacityDelayMS-n.adjustedAvailabilityStartTimeMS,c=0,f=0,d=0,h=0;h<n.chunkMeasurements.length;h++){var g=n.chunkMeasurements[h];if(l<f+g.chunkDownloadDurationMS)break;f+=g.chunkDownloadDurationMS,c+=g.chunkBytes,d++}if(l<0&&t.warn("request time was before adjusted availibitly start time"),c&&f&&d>.2*n.chunkMeasurements.length){var p=c/f,m=n.segmentBytes/p;return n.fetchDownloadDurationMS<m?n.fetchDownloadDurationMS*u:m*u}var y=n.bitrate;return n.bitrateList.some((function(e){if(e.bandwidth>n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}_.__dashjs_factory_name="LowLatencyThroughputModel";var T=r.a.getSingletonFactory(_),b=n(32);function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){e=e||{};var t,n,r,s,u,l,c,f,_,A,I=this.context,R=e.errHandler,w=e.dashMetrics,N=e.mediaPlayerModel,C=e.requestModifier,D=e.boxParser,O=e.errors,M=e.requestTimeout||0,P=Object(E.a)(I).getInstance(),L=Object(a.a)(I).getInstance();function x(e,t){var a,p=e.request,y=[],E=!0,T=!0,b=new Date,S=b,A=0,O=null;if(!C||!w||!R)throw new Error("config object is not correct or missing");var F,k=function(e){if(T=!1,p.requestStartDate=b,p.requestEndDate=new Date,p.firstByteDate=p.firstByteDate||b,p.fileLoaderType=O,!p.checkExistenceOnly){var t=a.response?a.response.responseURL:null,n=a.response?a.response.status:null,r=a.response&&a.response.getAllResponseHeaders?a.response.getAllResponseHeaders():a.response?a.response.responseHeaders:[];w.addHttpRequest(p,t,n,r,e?y:null),p.type===h.a.MPD_TYPE&&w.addManifestUpdate(p)}},U=function(){if(-1!==n.indexOf(a)&&(n.splice(n.indexOf(a),1),T))if(k(!1),t>0){try{if(L.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&p.type===h.a.MEDIA_SEGMENT_TYPE)N.getRetryAttemptsForType(h.a.MEDIA_SEGMENT_TYPE)===t&&P.trigger(v.a.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};s.push(r),r.timeout=setTimeout((function(){-1!==s.indexOf(r)&&(s.splice(s.indexOf(r),1),x(e,t))}),N.getRetryIntervalsForType(p.type))}else{if(p.type===h.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;R.error(new g.a(u[p.type],p.url+" is not available",{request:p,response:a.response})),e.error&&e.error(p,"error",a.response.statusText),e.complete&&e.complete(p,a.response.statusText)}};p.hasOwnProperty("availabilityTimeComplete")&&!1===p.availabilityTimeComplete&&window.fetch&&"arraybuffer"===p.responseType&&p.type===h.a.MEDIA_SEGMENT_TYPE?((F=d(I).create({requestModifier:C,lowLatencyThroughputModel:f,boxParser:D})).setup({dashMetrics:w}),O=o.a.FILE_LOADER_TYPES.FETCH):(F=Object(i.a)(I).create({requestModifier:C}),O=o.a.FILE_LOADER_TYPES.XHR);var B=null,G=C.modifyRequestURL?C.modifyRequestURL(p.url):p.url;if(L.get().streaming.cmcd&&L.get().streaming.cmcd.enabled){var j=L.get().streaming.cmcd.mode;if(j===o.a.CMCD_MODE_QUERY){var Y=function(e){try{var t=[],n=l.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(p);G=m.a.addAditionalQueryParameterToUrl(G,Y)}else j===o.a.CMCD_MODE_HEADER&&(B=l.getHeaderParameters(p))}p.url=G;var q=p.checkExistenceOnly?h.a.HEAD:h.a.GET,H=c.getXHRWithCredentialsForType(p.type);a={url:G,method:q,withCredentials:H,request:p,onload:function(){a.response.status>=200&&a.response.status<=299&&(k(!0),e.success&&e.success(a.response.response,a.response.statusText,a.response.responseURL),e.complete&&e.complete(p,a.response.statusText))},onend:U,onerror:U,progress:function(t){var n=new Date;E&&(E=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(p.firstByteDate=n)),t.lengthComputable&&(p.bytesLoaded=t.loaded,p.bytesTotal=t.total),t.noTrace||(y.push({s:S,d:t.time?t.time:n.getTime()-S.getTime(),b:[t.loaded?t.loaded-A:0]}),S=n,A=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(p)},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";_.warn(t)},loader:F,timeout:M,headers:B};var V=(new Date).getTime();if(isNaN(p.delayLoadingTime)||V>=p.delayLoadingTime)n.push(a),F.load(a);else{var K={httpRequest:a};r.push(K),K.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(K)){r.splice(r.indexOf(K),1);try{b=new Date,S=b,n.push(K.httpRequest),F.load(K.httpRequest)}catch(e){K.httpRequest.onerror()}}}),p.delayLoadingTime-V)}}return t={load:function(e){e.request?x(e,N.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){s.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),s=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==h.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},_=Object(y.a)(I).getInstance().getLogger(t),n=[],r=[],s=[],l=Object(p.a)(I).getInstance(),f=T(I).getInstance(),c=Object(b.a)(I).getInstance(),S(A={},h.a.MPD_TYPE,O.DOWNLOAD_ERROR_ID_MANIFEST_CODE),S(A,h.a.XLINK_EXPANSION_TYPE,O.DOWNLOAD_ERROR_ID_XLINK_CODE),S(A,h.a.INIT_SEGMENT_TYPE,O.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),S(A,h.a.MEDIA_SEGMENT_TYPE,O.DOWNLOAD_ERROR_ID_CONTENT_CODE),S(A,h.a.INDEX_SEGMENT_TYPE,O.DOWNLOAD_ERROR_ID_CONTENT_CODE),S(A,h.a.BITSTREAM_SWITCHING_SEGMENT_TYPE,O.DOWNLOAD_ERROR_ID_CONTENT_CODE),S(A,h.a.OTHER_TYPE,O.DOWNLOAD_ERROR_ID_CONTENT_CODE),u=A,t}A.__dashjs_factory_name="HTTPLoader";var I=r.a.getClassFactory(A);function R(){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 I},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}R.__dashjs_factory_name="SchemeLoaderFactory";var w=r.a.getSingletonFactory(R);t.a=w},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(70).Buffer)},function(e,t,n){"use strict";function r(e,t){return function(n,r){var a,o,s,u=i(n,"tag"),l=i(null==r?"*":r,"range"),c=[],f=-1;for(;++f<l.length;)if(a=l[f].toLowerCase(),t||"*"!==a){for(o=-1,s=[];++o<u.length;)if(e(u[o].toLowerCase(),a)){if(!t)return u[o];c.push(u[o])}else s.push(u[o]);u=s}return t?c:void 0}}function i(e,t){var n=e&&"string"==typeof e?[e]:e;if(!n||"object"!=typeof n||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}t.basicFilter=r((function(e,t){return"*"===t||e===t||e.indexOf(t+"-")>-1}),!0),t.extendedFilter=r((function(e,t){var n=e.split("-"),r=t.split("-"),i=0,a=0;if("*"!==r[a]&&n[i]!==r[a])return!1;i++,a++;for(;a<r.length;)if("*"!==r[a]){if(!n[i])return!1;if(n[i]!==r[a]){if(1===n[i].length)return!1;i++}else i++,a++}else a++;return!0}),!0),t.lookup=r((function(e,t){var n,r=t;for(;;){if("*"===r||e===r)return!0;if((n=r.lastIndexOf("-"))<0)return!1;"-"===r.charAt(n-2)&&(n-=2),r=r.slice(0,n)}}))},function(e,t,n){t.generateISD=n(95).generateISD,t.fromXML=n(96).fromXML,t.renderHTML=n(112).render},function(e,t,n){"use strict";var r=n(3),i=n(15);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return Object(i.a)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(i.a)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.a=r.a.getClassFactory(a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return s}));var r=n(3),i=n(35),a=n(1),o=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function s(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:s,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.a.AUDIO&&n!==a.a.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.a.AUDIO||n===a.a.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.a.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a<o.length;a++)if(o[a].codec===r){n=o[a];break}return n?i||n.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}},n=!1,e}u.__dashjs_factory_name="Capabilities",t.a=r.a.getSingletonFactory(u)},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(26))},function(e,t,n){var r=n(70),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";var r=n(43),i=n.n(r),a=n(1),o=n(0),s=n(9),u=n(7),l=n(2),c=n(3),f=n(6),d=n(4);function h(){var e,t,n,r,i,o,c,h,g,p,m,y,E,v,_,T,b,S,A,I,R,w,N,C,D=this.context,O=Object(u.a)(D).getInstance();function M(){F(),v=!1,p=0,m=0,T=0,w=!1,b=!0,S=!1,N=!1,A=NaN,c&&(O.off(l.a.DATA_UPDATE_COMPLETED,Z,e),O.off(l.a.LOADING_PROGRESS,me,e),O.off(l.a.MANIFEST_UPDATED,_e,e),O.off(l.a.STREAMS_COMPOSED,Te,e),O.off(d.a.PLAYBACK_ENDED,ge,e),O.off(d.a.STREAM_INITIALIZING,Ee,e),O.off(d.a.REPRESENTATION_SWITCH,ve,e),O.off(d.a.BUFFER_LEVEL_STATE_CHANGED,ee,e),Q(),c.removeEventListener("canplay",$),c.removeEventListener("canplaythrough",J),c.removeEventListener("play",te),c.removeEventListener("waiting",ne),c.removeEventListener("playing",re),c.removeEventListener("pause",ie),c.removeEventListener("error",pe),c.removeEventListener("seeking",ae),c.removeEventListener("seeked",oe),c.removeEventListener("timeupdate",se),c.removeEventListener("progress",ue),c.removeEventListener("ratechange",le),c.removeEventListener("loadedmetadata",ce),c.removeEventListener("loadeddata",fe),c.removeEventListener("stalled",ye),c.removeEventListener("ended",de),c.removeEventListener("volumechange",he)),g=null,c=null,y=null,E=null}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return parseFloat((L(e)-G()).toFixed(5))}function L(e){var t=e||y;return t.start+t.duration}function x(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y&&c&&c.getElement()?(e&&E&&B(G()),c.play()):v=!0}function F(){y&&c&&c.pause()}function k(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(y&&c){var a=isNaN(A)?c.getTime():A;e!==a&&((I=!0===r)||(A=e),t.info("Requesting seek to time: "+e+(I?" (internal)":"")),E&&i&&B(e),c.setCurrentTime(e,n))}}function U(){if(y&&c&&E){var e=n&&n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}}function B(e){var t=new Date(h.getClientReferenceTime()),n=o.getRegularPeriods()[0],r=h.calcPresentationTimeFromWallTime(t,n);p=r-e}function G(){return y&&c?c.getTime():null}function j(){return y&&c?c.isPaused():null}function Y(){return y&&c?c.isSeeking():null}function q(){return y&&c?c.isStalled():null}function H(){return y&&c?c.getPlaybackRate():null}function V(){return y&&c?c.getEnded():null}function K(){return E}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!j()&&E&&0!==c.getReadyState()&&!Y()&&!w){e||(e=n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO);var r=G(),i=W(r,e),o=!isNaN(i)&&i!==r;o&&!Y()&&(q()||R||1===c.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),k(i,!1,!1))}}function W(e,t){var n=i.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-p,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?S?Math.max(r.end-p,r.start):r.start:e:NaN}function X(){null===g&&(g=setInterval((function(){var e;O.trigger(l.a.WALLCLOCK_TIME_UPDATED,{isDynamic:E,time:new Date}),K()&&(n.addDVRMetric(),j()?(e=Date.now(),(!_||e>_+500)&&(_=e,se())):z())}),C.get().streaming.wallclockTimeUpdateInterval))}function Q(){clearInterval(g),g=null}function Z(e){var t=o.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n)}function $(){O.trigger(l.a.CAN_PLAY)}function J(){O.trigger(l.a.CAN_PLAY_THROUGH)}function ee(e){e.streamId===n.getActiveStreamInfo().id&&(R=e.state===s.a.BUFFER_EMPTY,C.get().streaming.buffer.setStallState&&c.setStallState(e.mediaType,e.state===s.a.BUFFER_EMPTY))}function te(){t.info("Native video element event: play"),z(),X(),O.trigger(l.a.PLAYBACK_STARTED,{startTime:G()})}function ne(){t.info("Native video element event: waiting"),O.trigger(l.a.PLAYBACK_WAITING,{playingTime:G()})}function re(){t.info("Native video element event: playing"),I=!1,O.trigger(l.a.PLAYBACK_PLAYING,{playingTime:G()})}function ie(){t.info("Native video element event: pause"),O.trigger(l.a.PLAYBACK_PAUSED,{ended:V()})}function ae(){if(!I){var e=G();isNaN(A)||A===e||(e=A),A=NaN,t.info("Seeking to: "+e),X(),O.trigger(l.a.PLAYBACK_SEEKING,{seekTime:e,streamId:y.id})}}function oe(){t.info("Native video element event: seeked"),I=!1,O.trigger(l.a.PLAYBACK_SEEKED)}function se(){y&&O.trigger(l.a.PLAYBACK_TIME_UPDATED,{timeToEnd:P(),time:G(),streamId:y.id})}function ue(){O.trigger(l.a.PLAYBACK_PROGRESS,{streamId:y.id})}function le(){var e=H();t.info("Native video element event: ratechange: ",e),O.trigger(l.a.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ce(){t.info("Native video element event: loadedmetadata"),O.trigger(l.a.PLAYBACK_METADATA_LOADED),X()}function fe(){t.info("Native video element event: loadeddata"),O.trigger(l.a.PLAYBACK_LOADED_DATA)}function de(){t.info("Native video element event: ended"),F(),Q();var e=n?n.getActiveStreamInfo():null;e&&O.trigger(l.a.PLAYBACK_ENDED,{isLast:e.isLast})}function he(){O.trigger(l.a.PLAYBACK_VOLUME_CHANGED)}function ge(e){if(g&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:L();c.setCurrentTime(n),F(),Q()}}function pe(e){var t=e.target||e.srcElement;O.trigger(l.a.PLAYBACK_ERROR,{error:t.error})}function me(e){if(!1===e.stream&&S&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>p&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),p=n,m=n)}}function ye(e){O.trigger(l.a.PLAYBACK_STALLED,{e:e})}function Ee(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[a.a.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),S=!0)}function ve(e){var t=n.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.a.VIDEO||e.mediaType===a.a.AUDIO)&&(b=e.currentRepresentation.availabilityTimeComplete,(S=!b)&&!N&&(N=!0))}function _e(){w=!0}function Te(){w=!1}return e={initialize:function(t,n){y=t,!0!==n&&(c.addEventListener("canplay",$),c.addEventListener("canplaythrough",J),c.addEventListener("play",te),c.addEventListener("waiting",ne),c.addEventListener("playing",re),c.addEventListener("pause",ie),c.addEventListener("error",pe),c.addEventListener("seeking",ae),c.addEventListener("seeked",oe),c.addEventListener("timeupdate",se),c.addEventListener("progress",ue),c.addEventListener("ratechange",le),c.addEventListener("loadedmetadata",ce),c.addEventListener("loadeddata",fe),c.addEventListener("stalled",ye),c.addEventListener("ended",de),c.addEventListener("volumechange",he),E=y.manifestInfo.isDynamic,R=!1,I=!1,O.on(l.a.DATA_UPDATE_COMPLETED,Z,e),O.on(l.a.LOADING_PROGRESS,me,e),O.on(l.a.MANIFEST_UPDATED,_e,e),O.on(l.a.STREAMS_COMPOSED,Te,e),O.on(d.a.PLAYBACK_ENDED,ge,e,{priority:u.a.EVENT_PRIORITY_HIGH}),O.on(d.a.STREAM_INITIALIZING,Ee,e),O.on(d.a.REPRESENTATION_SWITCH,ve,e),O.on(d.a.BUFFER_LEVEL_STATE_CHANGED,ee,e),v&&(v=!1,x()))},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.serviceDescriptionController&&(r=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(o=e.adapter),e.videoModel&&(c=e.videoModel),e.timelineConverter&&(h=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:P,getBufferLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null;return n.getActiveStreamProcessors().forEach((function(n){if(!e||0===e.length||-1===e.indexOf(n.getType())){var r=n.getBufferLevel();t=null===t?r:Math.min(t,r)}})),t},getPlaybackStalled:function(){return R},getTime:G,getLowLatencyModeEnabled:function(){return S},getInitialCatchupModeActivated:function(){return N},getIsManifestUpdateInProgress:function(){return w},getPlaybackRate:H,getPlayedRanges:function(){return y&&c?c.getPlayedRanges():null},getEnded:V,getIsDynamic:K,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,t){var n,i,a,s=!isNaN(e)&&isFinite(e)?e:NaN,u=o.getSuggestedPresentationDelay(),l=r.getServiceDescriptionSettings();return n=isNaN(C.get().streaming.delay.liveDelay)?null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(s)?l&&!isNaN(l.liveDelay)&&l.liveDelay>0?l.liveDelay:!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(s)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*y.manifestInfo.minBufferTime:4*s:s*C.get().streaming.delay.liveDelayFragmentCount:C.get().streaming.delay.liveDelay,null!==(a=o.getAvailabilityStartTime())&&(T=a),i=t&&t.dvrWindowSize>0?Math.min(n,t.dvrWindowSize):n,p=i,m=i,i},getLiveDelay:function(){return p},getOriginalLiveDelay:function(){return m},getCurrentLiveLatency:function(){if(!E||isNaN(T))return NaN;var e=G();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*h.getClientTimeOffset();return Math.max(((t-T-1e3*e)/1e3).toFixed(3),0)},play:x,isPaused:j,isStalled:q,pause:F,isSeeking:Y,getStreamEndTime:L,seek:k,seekToOriginalLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=U();if(0!==r){var i=r-(p=m);k(i,e,t,n)}},seekToCurrentLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=U();if(0!==r){var i=r-p;k(i,e,t,n)}},reset:M,updateCurrentTime:z,getAvailabilityStartTime:function(){return T}},t=Object(f.a)(D).getInstance().getLogger(e),M(),e}h.__dashjs_factory_name="PlaybackController";var g=c.a.getSingletonFactory(h),p=n(21),m=n(10),y=n(11),E=n(16),v=n(5);function _(e){var t,n,r,i,o,s,u=this.context,c=Object(E.a)(u).getInstance(),d=e.textController,h=e.eventBus,g=[],p=[],_=!1,T=e.mediaSource,b=null;function S(e){return new Promise((function(t){M((function(){i.changeType&&i.changeType(e),t()}))}))}function A(e){return i=d.getTextSourceBuffer(e),Promise.resolve()}function I(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",D,!1),i.addEventListener("error",O,!1),i.addEventListener("abort",O,!1)}catch(e){s=setInterval(D,50)}else s=setInterval(D,50)}function R(e){return new Promise((function(t){i&&c.get().streaming.buffer.useAppendWindow?M((function(){try{if(!i)return void t();var n=T.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(o.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function w(e){return new Promise((function(t){i?M((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function N(){if(!_&&p.length>0){_=!0;var e=p[0];p.splice(0,1);var t=function(){_=!1,p.length>0&&N.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==v.a.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{b=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),M(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),p.length>0?N():_=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new m.a(t.code,t.message)})}}}function C(){g.length>0&&(i.updating||(g.shift()(),C()))}function D(){i.updating||C()}function O(e){var t,r,i=e.target||{};t=l.a.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:b}||{},h.trigger(t,r,{streamId:o.streamInfo.id,mediaType:n})}function M(e){g.push(e),i.updating||C()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(p.push({data:e,promise:{resolve:r,reject:i},request:n}),M(N.bind(t))):i({chunk:e,error:new m.a(y.a.APPEND_ERROR_CODE,y.a.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?M((function(){try{i.remove(r,a),M((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new m.a(y.a.REMOVE_ERROR_CODE,y.a.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{p=[],"open"===T.readyState?M((function(){try{i&&i.abort(),e()}catch(t){e()}})):i&&i.setTextTrack&&"ended"===T.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{g=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",D,!1),i.removeEventListener("error",O,!1),i.removeEventListener("abort",O,!1)),clearInterval(s)}catch(e){r.error(e)}}(),_=!1,p=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(i))}catch(e){}i=null}b=null},updateTimestampOffset:w,initializeForStreamSwitch:function(e,t,r){n=(o=e).type;var a=o.codec;!function(e){i=e.getBuffer()}(r),I();var s=[];return s.push(new Promise((function(e){M((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))),s.push(R(o.streamInfo)),s.push(S(a)),t&&void 0!==t.MSETimeOffset&&s.push(w(t.MSETimeOffset)),Promise.all(s)},initializeForFirstUse:function(e,t,r){n=(o=t).type;var s=o.codec;try{if(s.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return A(e);i=T.addSourceBuffer(s),I();var u=[];return u.push(R(o.streamInfo)),r&&void 0!==r.MSETimeOffset&&u.push(w(r.MSETimeOffset)),Promise.all(u)}catch(t){return o.type==a.a.TEXT&&!o.isFragmented||-1!==s.indexOf('codecs="stpp')||-1!==s.indexOf('codecs="vtt')?A(e):Promise.reject(t)}},updateAppendWindow:R,changeType:S},r=Object(f.a)(u).getInstance().getLogger(t),t}_.__dashjs_factory_name="SourceBufferSink";var T=c.a.getClassFactory(_);function b(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}b.__dashjs_factory_name="InitCache";var S=c.a.getSingletonFactory(b);function A(e){e=e||{};var t,n,r,i,o,c,h,g,E,_,b,A,I,R,w,N,C,D,O=this.context,M=Object(u.a)(O).getInstance(),P=e.errHandler,L=e.fragmentModel,x=e.representationController,F=e.adapter,k=e.textController,U=e.abrController,B=e.playbackController,G=e.streamInfo,j=e.type,Y=e.settings;function q(e){c=e}function H(e){return F.convertRepresentationToRepresentationInfo(x.getRepresentationForQuality(e))}function V(e,t,n){var r=H(n);return t&&t[j]&&(j===a.a.VIDEO||j===a.a.AUDIO)?E.initializeForStreamSwitch(e,r,t[j]):E.initializeForFirstUse(G,e,r)}function K(e){Y.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",j+"'s init cache"),w.save(e.chunk)),n.debug("Append Init fragment",j," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),W(e.chunk)}function z(e){W(e.chunk,e.request)}function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;E.append(e,t).then((function(e){Q(e)})).catch((function(e){Q(e)})),e.mediaInfo.type===a.a.VIDEO&&ve(l.a.VIDEO_CHUNK_RECEIVED,{chunk:e})}function X(e){if(e&&e.length>0)for(var t=0,r=e.length;t<r;t++)n.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",B.getTime())}function Q(e){if(e.error)return 22===e.error.code&&function(){if(R=!0,o=.8*me(),n.warn("Quota exceeded, Critical Buffer: "+o),o>0){var e=Math.max(.2*o,1),t=o-e,r=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};Y.update(a)}}(),void(22!==e.error.code&&Ee()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),ve(l.a.QUOTA_EXCEEDED,{criticalBufferLevel:o,quotaExceededTime:e.chunk.start}),ue(se())));if(E&&(re(),R=!1,(b=e.chunk)&&b.endFragment)){b&&!isNaN(b.index)&&(h=Math.max(b.index,h),ie());var t=E.getAllBufferRanges();b.segmentType===v.a.MEDIA_SEGMENT_TYPE&&(X(t),J(),function(){if(isNaN(D))return;if(j!==a.a.AUDIO&&j!==a.a.VIDEO)return void(D=NaN);var e=B.getTime(),t=ne(e,0),n=ne(D,0);if(t&&n&&t.start===n.start)return void(D=NaN);var r=x.getCurrentRepresentation().segmentDuration,i=ne(D,r);if(!i)return;Y.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-D)>r?D<=i.end&&B.seek(Math.max(D,i.start),!1,!0):e<i.start&&B.seek(i.start,!1,!0)}()),b&&ve(l.a.BYTES_APPENDED_END_FRAGMENT,{quality:b.quality,startTime:b.start,index:b.index,bufferedRanges:t,segmentType:b.segmentType,mediaType:j})}}function Z(){return new Promise((function(e,t){var n=$();if(!n||0===n.length)return J(),void e();ue(n).then((function(){e()})).catch((function(e){t(e)}))}))}function $(e){var t=[],r=E.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var i=function(e,t){var n=Y.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),a=L.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,i=ye(e),a=G.manifestInfo.duration>=Y.get().streaming.buffer.longFormContentDurationThreshold?Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm:Y.get().streaming.buffer.bufferTimeAtTopQuality,o=isNaN(i)?e:Math.min(i,e+a);if(o>=t.end(t.length-1))return null;var s=L.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];s&&(o=Math.max(s.startTime+s.duration,o));if(Y.get().streaming.buffer.avoidCurrentTimeRangePruning)for(var u=0;u<t.length;u++)if(t.start(u)<=e&&e<=t.end(u)&&t.start(u)<=o&&o<=t.end(u)){var l=o;o=u+1<t.length?t.start(u+1):t.end(u)+1,n.debug("Buffered range ["+t.start(u)+", "+t.end(u)+"] overlaps with targetTime "+e+" and range to be pruned ["+l+", "+r+"], using ["+o+", "+r+"] instead"+(o<r?"":" (no actual pruning)"));break}if(o<t.end(t.length-1))return{start:o,end:r};return null}(e,r);i&&t.push(i),a&&t.push(a)}return t}function J(){(!C||j===a.a.TEXT&&k.isTextEnabled())&&re()}function ee(){ae()}function te(){ae(),D=NaN}function ne(e,t){var n,r,i=E.getAllBufferRanges(),a=0,o=0,s=null,u=null,l=0,c=isNaN(t)?.15:t;if(null!=i){for(r=0,n=i.length;r<n;r++)if(a=i.start(r),o=i.end(r),null===s)l=Math.abs(a-e),(e>=a&&e<o||l<=c)&&(s=a,u=o);else{if(!((l=a-u)<=c))break;u=o}if(null!==s)return{start:s,end:u}}return null}function re(){if(B){var e=Y.get().streaming.gaps.jumpGaps&&!isNaN(Y.get().streaming.gaps.smallGapLimit)?Y.get().streaming.gaps.smallGapLimit:NaN;i=Math.max(function(e,t){var n;return Y.get().streaming.gaps.jumpGaps&&(t=Y.get().streaming.gaps.smallGapLimit),null===(n=ne(e,t))?0:n.end-e}(B.getTime()||0,e),0),ve(l.a.BUFFER_LEVEL_UPDATED,{mediaType:j,bufferLevel:i}),ae()}}function ie(){var e=h>=g-1,t=B.getTimeToStreamEnd(G)-i<1e-5;!e&&!t||r||(pe(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(G.id," and type ").concat(j)))}function ae(){j!==a.a.AUDIO&&j!==a.a.VIDEO||((!B.getLowLatencyModeEnabled()&&i<Y.get().streaming.buffer.stallThreshold||0===i)&&!r?oe(s.a.BUFFER_EMPTY):(r||i>=Y.get().streaming.buffer.stallThreshold||B.getLowLatencyModeEnabled()&&i>0)&&oe(s.a.BUFFER_LOADED))}function oe(e){_===e||e===s.a.BUFFER_EMPTY&&0===B.getTime()||j===a.a.TEXT&&!k.isTextEnabled()||(_=e,ve(l.a.BUFFER_LEVEL_STATE_CHANGED,{state:e}),ve(e===s.a.BUFFER_LOADED?l.a.BUFFER_LOADED:l.a.BUFFER_EMPTY),n.debug(e===s.a.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function se(){var e=[],t=E.getAllBufferRanges();if(!t||0===t.length)return e;var n=B.getTime(),r=Math.max(0,n-Y.get().streaming.buffer.bufferToKeep),i=L.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&B.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},o=0;o<t.length&&t.end(o)<=r;o++)a.end=t.end(o);a.start<a.end&&e.push(a)}return e}function ue(e){return new Promise((function(t,n){if(e&&E&&0!==e.length){var r=[];e.forEach((function(e){r.push(function(e){return new Promise((function(t,n){e.resolve=t,e.reject=n,N.push(e)}))}(e))})),I||le(),Promise.all(r).then((function(){t()})).catch((function(e){n(e)}))}else t()}))}function le(){try{if(0===N.length||!E)return n.debug("Nothing to prune, halt pruning"),N=[],void(I=!1);var e=E.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return n.debug("SourceBuffer is empty (or does not exist), halt pruning"),N=[],void(I=!1);var t=N.shift();n.debug("".concat(j,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),I=!0,B.getTime()<t.end&&pe(!1),E.remove(t).then((function(e){ce(e)})).catch((function(e){ce(e)}))}catch(e){I=!1}}function ce(e){n.debug("onRemoved buffer from:",e.from,"to",e.to),X(E.getAllBufferRanges()),0===N.length&&(I=!1,re()),e.unintended&&(n.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),ve(l.a.SEEK_TARGET,{time:e.from})),I?le():(C?C=!1:re(),ve(l.a.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ee(),quotaExceeded:R}))}function fe(e){return new Promise((function(t){e&&void 0!==e.MSETimeOffset&&E&&E.updateTimestampOffset?E.updateTimestampOffset(e.MSETimeOffset).then((function(){t()})).catch((function(){t()})):t()}))}function de(){return E&&!r?E.updateAppendWindow(G):Promise.resolve()}function he(){++A*(Y.get().streaming.wallclockTimeUpdateInterval/1e3)>=Y.get().streaming.buffer.bufferPruningInterval&&(A=0,E&&j!==a.a.TEXT&&(r||ue(se())))}function ge(){ae()}function pe(e){r!==e&&((r=e)?ve(l.a.BUFFERING_COMPLETED):g=Number.POSITIVE_INFINITY)}function me(){try{var e,t,n=E.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t<e;t++)r+=n.end(t)-n.start(t);return r}catch(e){return 0}}function ye(e){try{var t=e,n=E.getAllBufferRanges();if(!n||0===n.length)return NaN;for(var r=0;t===e&&r<n.length;){var i=n.start(r),a=n.end(r);t>=i&&t<=a&&(t=a),r+=1}return t===e?NaN:t}catch(e){}}function Ee(){var e=me();return isNaN(e)||e<o}function ve(e,t){var n=t||{};M.trigger(e,n,{streamId:G.id,mediaType:j})}function _e(e,t){if(o=Number.POSITIVE_INFINITY,_=void 0,g=Number.POSITIVE_INFINITY,h=0,b=null,r=!1,I=!1,R=!1,i=0,A=0,N=[],D=NaN,E){var n=E;E=null,e||t||n.abort().then((function(){n.reset(t),n=null}))}C=!1}return t={initialize:function(e){q(e),M.on(l.a.INIT_FRAGMENT_LOADED,K,t),M.on(l.a.MEDIA_FRAGMENT_LOADED,z,t),M.on(l.a.WALLCLOCK_TIME_UPDATED,he,t),M.on(d.a.PLAYBACK_PLAYING,te,t),M.on(d.a.PLAYBACK_PROGRESS,J,t),M.on(d.a.PLAYBACK_TIME_UPDATED,J,t),M.on(d.a.PLAYBACK_RATE_CHANGED,ge,t),M.on(d.a.PLAYBACK_STALLED,ee,t)},getStreamId:function(){return G.id},getType:function(){return j},getBufferControllerType:function(){return"BufferController"},createBufferSink:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(r,i){if(w&&e&&c){var a=U.getQualityFor(j,G.id);E=T(O).create({mediaSource:c,textController:k,eventBus:M}),V(e,t,a).then((function(){return fe(H(a))})).then((function(){r(E)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),P.error(new m.a(y.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,y.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+j)),i(e)}))}else r(null)}))},getBuffer:function(){return E},getBufferLevel:function(){return i},getRangeAt:ne,setMediaSource:q,getMediaSource:function(){return c},appendInitSegmentFromCache:function(e){var t=w.extract(G.id,e);return!!t&&(n.info("Append Init fragment",j," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),W(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:pe,getIsPruningInProgress:function(){return I},reset:function(e,t){M.off(l.a.INIT_FRAGMENT_LOADED,K,this),M.off(l.a.MEDIA_FRAGMENT_LOADED,z,this),M.off(l.a.WALLCLOCK_TIME_UPDATED,he,this),M.off(d.a.PLAYBACK_PLAYING,te,this),M.off(d.a.PLAYBACK_PROGRESS,J,this),M.off(d.a.PLAYBACK_TIME_UPDATED,J,this),M.off(d.a.PLAYBACK_RATE_CHANGED,ge,this),M.off(d.a.PLAYBACK_STALLED,ee,this),_e(e,t)},prepareForPlaybackSeek:function(){return r&&pe(!1),E.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){E.abort().then((function(){return de()})).then((function(){return Y.get().streaming.buffer.useChangeTypeForTrackSwitch?E.changeType(e):Promise.resolve()})).then((function(){return Z()})).then((function(){pe(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){de().then((function(){return Y.get().streaming.buffer.useChangeTypeForTrackSwitch?E.changeType(e):Promise.resolve()})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){E.abort().then((function(){return de()})).then((function(){return Z()})).then((function(){pe(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:de,getAllRangesWithSafetyFactor:$,getContinuousBufferTimeForTargetTime:ye,clearBuffers:ue,pruneAllSafely:Z,updateBufferTimestampOffset:fe,setSeekTarget:function(e){D=e},segmentRequestingCompleted:function(e){isNaN(e)||(g=e,ie())}},n=Object(f.a)(O).getInstance().getLogger(t),w=S(O).getInstance(),_e(),t}A.__dashjs_factory_name="BufferController";var I=c.a.getClassFactory(A);function R(e){e=e||{};var t,n,r,i,a,o,s=this.context,c=Object(u.a)(s).getInstance(),f=e.textController,d=e.errHandler,h=e.streamInfo,g=e.type;function p(e){i=e}function E(e){var t,r,i;n!==e&&((n=e)&&(t=l.a.BUFFERING_COMPLETED,i=r||{},c.trigger(t,i,{streamId:h.id,mediaType:g})))}function v(e){e.chunk.bytes&&!n&&(o.save(e.chunk),a.append(e.chunk),E(!0))}return t={initialize:function(e){p(e)},getStreamId:function(){return h.id},getType:function(){return g},getBufferControllerType:function(){return"NotFragmentedTextBufferController"},createBufferSink:function(e){return new Promise((function(t,n){try{(a=T(s).create({mediaSource:i,textController:f,eventBus:c})).initializeForFirstUse(h,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){d.error(new m.a(y.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,y.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+g)),n(e)}}))},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:p,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==o.extract(h.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:E,getIsPruningInProgress:function(){return!1},reset:function(e){c.off(l.a.INIT_FRAGMENT_LOADED,v,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,o=S(s).getInstance(),c.on(l.a.INIT_FRAGMENT_LOADED,v,t),t}R.__dashjs_factory_name="NotFragmentedTextBufferController";var w=c.a.getClassFactory(R);function N(e){e=e||{};var t,n,r,i,o,c,h,g,m,y,E,v,_,T=this.context,b=Object(u.a)(T).getInstance(),S=e.dashMetrics,A=e.mediaPlayerModel,I=e.fragmentModel,R=e.abrController,w=e.playbackController,N=e.textController,C=e.type,D=e.bufferController,O=e.settings;function M(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;c=setTimeout(L,t)}}function P(){c&&(clearTimeout(c),c=null)}function L(){try{if(function(){try{return C===a.a.TEXT&&!N.isTextEnabled()||w.isPaused()&&(!w.getStreamController().getInitialPlayback()||!w.getStreamController().getAutoPlay())&&!O.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return i&&(isNaN(y)||E||(e=n.id,t=R.getMaxAllowedIndexFor(C,e),!(!isNaN(m)&&m==t||(r.info("Top quality "+C+" index has changed from "+m+" to "+t),m=t,0)))||function(){if(!C||!i)return!0;return S.getCurrentBufferLevel(C)<x()}())}catch(e){return!1}var e,t}()){var e=!1;_&&(e=R.checkPlaybackQuality(C,n.id)),e||(v||i.quality!==y||E?(E?(r.debug("Switch track for "+C+", representation id = "+i.id),E=!1):r.debug("Quality has changed, get init request for representationid = "+i.id),b.trigger(l.a.INIT_FRAGMENT_NEEDED,{representationId:i.id,sender:t},{streamId:n.id,mediaType:C}),_=!1,v=!1):(r.debug("Media segment needed for ".concat(C," and stream id ").concat(n.id)),b.trigger(l.a.MEDIA_FRAGMENT_NEEDED,{},{streamId:n.id,mediaType:C}),_=!0))}else M(w.getLowLatencyModeEnabled()?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}catch(e){M(w.getLowLatencyModeEnabled()?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}}function x(){var e=NaN;return C&&i?e=C===a.a.TEXT?function(){try{if(N.isTextEnabled()){if(isNaN(i.fragmentDuration)){var e=S.getCurrentSchedulingInfo(s.a.SCHEDULING_INFO);return e?e.duration:0}return i.fragmentDuration}return 0}catch(e){return 0}}():C===a.a.AUDIO&&h?function(){try{var e=S.getCurrentBufferLevel(a.a.VIDEO);return isNaN(i.fragmentDuration)?e+1:Math.max(e+1,i.fragmentDuration)}catch(e){return 0}}():function(){try{var e=i.mediaInfo.streamInfo;return R.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}():e}function F(){k(!0)}function k(e){if(w&&I){var t=I.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,time:w.getTime(),threshold:0})[0];t&&w.getTime()>=t.startTime&&((!g.mediaInfo||t.mediaInfo.type===g.mediaInfo.type&&t.mediaInfo.id!==g.mediaInfo.id)&&e&&b.trigger(l.a.TRACK_CHANGE_RENDERED,{mediaType:C,oldMediaInfo:g.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===g.quality&&t.adaptationIndex===g.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(C)),b.trigger(l.a.QUALITY_CHANGE_RENDERED,{mediaType:C,oldQuality:g.quality,newQuality:t.quality,streamId:n.id})),g={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function U(e){r.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,r.info("["+C+"] lastInitializedRepresentationInfo changed to "+e.quality)),M(0)}function B(){I.abortRequests(),P()}function G(){O.get().streaming.scheduling.scheduleWhilePaused||M()}function j(e){S.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function Y(){_=!0,o=0,y=NaN,g={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},m=NaN,E=!1,v=!1}return t={initialize:function(e){h=e,b.on(l.a.BYTES_APPENDED_END_FRAGMENT,U,t),b.on(l.a.URL_RESOLUTION_FAILED,B,t),b.on(d.a.PLAYBACK_STARTED,G,t),b.on(d.a.PLAYBACK_RATE_CHANGED,j,t),b.on(d.a.PLAYBACK_TIME_UPDATED,F,t)},getType:function(){return C},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){i=e},setTimeToLoadDelay:function(e){o=e},getTimeToLoadDelay:function(){return o},setSwitchTrack:function(e){E=e},getSwitchStrack:function(){return E},startScheduleTimer:M,clearScheduleTimer:P,reset:function(){b.off(l.a.BYTES_APPENDED_END_FRAGMENT,U,t),b.off(l.a.URL_RESOLUTION_FAILED,B,t),b.off(d.a.PLAYBACK_STARTED,G,t),b.off(d.a.PLAYBACK_RATE_CHANGED,j,t),b.off(d.a.PLAYBACK_TIME_UPDATED,F,t),P(),k(!1),Y(),n=null},getBufferTarget:x,getPlaybackController:function(){return w},setCheckPlaybackQuality:function(e){_=e},setInitSegmentRequired:function(e){v=e}},r=Object(f.a)(T).getInstance().getLogger(t),Y(),n=e.streamInfo,t}N.__dashjs_factory_name="ScheduleController";var C=c.a.getClassFactory(N),D=n(64),O=n(15),M=n(39),P=n(20),L=n(13),x=n(23);function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var k=function e(){F(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};k.INITIAL_PLAYOUT_START_REASON="initial_playout",k.SEEK_START_REASON="seek",k.RESUME_FROM_PAUSE_START_REASON="resume",k.METRICS_COLLECTION_START_REASON="metrics_collection_start";var U=function e(){F(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};U.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",U.REBUFFERING_REASON="rebuffering",U.USER_REQUEST_STOP_REASON="user_request",U.END_OF_PERIOD_STOP_REASON="end_of_period",U.END_OF_CONTENT_STOP_REASON="end_of_content",U.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",U.FAILURE_STOP_REASON="failure";var B=n(40);function G(e){e=e||{};var t,n,r,i,c,d,h,g,E,_,T,b,S,A=this.context,R=Object(u.a)(A).getInstance(),N=e.streamInfo,F=e.type,k=e.errHandler,G=e.mimeType,j=e.timelineConverter,Y=e.adapter,q=e.manifestModel,H=e.mediaPlayerModel,V=e.fragmentModel,K=e.abrController,z=e.playbackController,W=e.mediaController,X=e.textController,Q=e.dashMetrics,Z=e.settings,$=e.boxParser,J=e.segmentBlacklistController;function ee(){return N.id}function te(){return F}function ne(){return Y.getIsTextTrack(g.getData())}function re(){c=[],i=null,S=0,E=!1,_=!1}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(z.getIsManifestUpdateInProgress())le();else if((!ne()||X.isTextEnabled())&&d&&e.representationId&&!d.appendInitSegmentFromCache(e.representationId)){var n=g.getCurrentRepresentation();if(0===n.range)return void ae();var r=T?T.getInitRequest(i,n):null;r?V.executeRequest(r):t&&(h.setInitSegmentRequired(!0),le())}}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(z.getIsManifestUpdateInProgress()||d.getIsPruningInProgress())le();else{var n=ue();n?(E=!1,oe(n)):se(t)}}function oe(e){isNaN(e.startTime+e.duration)||(S=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+h.getTimeToLoadDelay(),h.setTimeToLoadDelay(0),!function(e){var t=e.url;e.range&&(t=t.concat("_",e.range));return J.contains(t)}(e)?(n.debug("Next fragment request url for stream id ".concat(N.id," and media type ").concat(F," is ").concat(e.url)),V.executeRequest(e)):(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(N.id," and media type ").concat(F," is on the ignore list and will be skipped")),le())}function se(e){var t,a=g.getCurrentRepresentation();if(Z.get().streaming.gaps.enableSeekFix&&(E||0===z.getTime())&&(r?r&&a.segmentInfoType===o.a.SEGMENT_TIMELINE&&(t=T.getValidTimeAheadOfTargetTime(S,i,a,Z.get().streaming.gaps.threshold)):t=T.getValidTimeAheadOfTargetTime(S,i,a,Z.get().streaming.gaps.threshold),!isNaN(t)&&t!==S))return void(z.isSeeking()||0===z.getTime()?(n.warn("Adjusting playback time ".concat(t," because of gap in the manifest. Seeking by ").concat(t-S)),z.seek(t,!1,!1)):(n.warn("Adjusting buffering time ".concat(t," because of gap in the manifest. Adjusting time by ").concat(t-S)),Ce(t),e&&le()));if(T.isLastSegmentRequested(a,S)){var s=T.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(N.id," has finished")),R.trigger(l.a.STREAM_REQUESTING_COMPLETED,{segmentIndex:s},{streamId:N.id,mediaType:F}),d.segmentRequestingCompleted(s),void h.clearScheduleTimer()}e&&le()}function ue(){var e,t=Se();if(isNaN(S)||te()===a.a.TEXT&&!X.isTextEnabled())return null;var n=E;if(T){var r=g&&t?g.getRepresentationForQuality(t.quality):null;e=n?T.getSegmentRequestForTime(i,r,S):T.getNextSegmentRequest(i,r)}return e}function le(){h.startScheduleTimer(z.getLowLatencyModeEnabled()?Z.get().streaming.scheduling.lowLatencyTimeout:Z.get().streaming.scheduling.defaultTimeout)}function ce(e){e.error||(h.setCurrentRepresentation(Y.convertRepresentationToRepresentationInfo(e.currentRepresentation)),d.getIsBufferingCompleted()||d.updateBufferTimestampOffset(e.currentRepresentation))}function fe(e){Q.addBufferState(F,e.state,h.getBufferTarget()),e.state!==s.a.BUFFER_EMPTY||z.isSeeking()||(n.info("Buffer is empty! Stalling!"),Q.pushPlayListTraceMetrics(new Date,U.REBUFFERING_REASON))}function de(e){V.syncExecutedRequestsWithBufferedRange(d.getBuffer().getAllBufferRanges(),N.duration),e.quotaExceeded&&e.from>z.getTime()&&Ce(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&h.startScheduleTimer()}function he(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),J.add(t)}}function ge(){we(),_=!1}function pe(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),z.isSeeking()||h.getSwitchStrack()||_||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?h.setInitSegmentRequired(!0):Ce(e.request.startTime+e.request.duration/2),h.startScheduleTimer(0))}function me(e){n.info("OnFragmentLoadingCompleted for stream id "+N.id+" and media type "+F+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ne()&&h.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){if(n.info("Fragment loading completed with an error"),!e||!e.request||!e.request.type)return;e.request.type===v.a.INIT_SEGMENT_TYPE?ie({representationId:e.request.representationId,sender:{}},!1):e.request.type===v.a.MEDIA_SEGMENT_TYPE&&(Ce(e.request.startTime+e.request.duration/2),ae({},!1))}(e)}function ye(){Ce(z.getTime()),be().startScheduleTimer()}function Ee(e){var t=e.currentTrackInfo;if(t){var n=c.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&Te(n).then((function(){d.setIsBufferingCompleted(!1),Ce(z.getTime()),h.setInitSegmentRequired(!0),h.startScheduleTimer()}))}}function ve(e){Ce(e.quotaExceededTime),h.clearScheduleTimer()}function _e(){return d?d.getBuffer():null}function Te(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=Y.getRealAdaptation(N,i),n=Y.getVoRepresentations(i);if(g){var o,s=g.getData(),u=K.getMaxAllowedIndexFor(F,N.id),l=K.getMinAllowedIndexFor(F,N.id),c=null;return null!==s&&s.id===t.id||F===a.a.TEXT?o=K.getQualityFor(F,N.id):(c=K.getThroughputHistory().getAverageThroughput(F,r)||K.getInitialBitrateFor(F,N.id),o=K.getQualityForBitrate(i,c,N.id)),void 0!==l&&o<l&&(o=l),o>u&&(o=u),g.updateData(t,n,F,i.isFragmented,o)}return Promise.resolve()}function be(){return h}function Se(e){var t;return void 0!==e?(Object(O.a)(e),t=g?g.getRepresentationForQuality(e):null):t=g?g.getCurrentRepresentation():null,Y.convertRepresentationToRepresentationInfo(t)}function Ae(){return!!d&&d.getIsBufferingCompleted()}function Ie(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Se(r),a=g&&i?g.getRepresentationForQuality(i.quality):null;if(i&&a){var o=Y.getEventsFor(i.mediaInfo,null,N),s=Y.getEventsFor(i,a,N);if(o&&o.length>0||s&&s.length>0){var u=function(e,t,n,r){try{for(var i={},a=[],o=n.concat(r),s=0,u=o.length;s<u;s++)i[o[s].schemeIdUri+"/"+o[s].value]=o[s];var l=Object(x.a)(A).getInstance().parse(e),c=l.getBoxes("emsg");if(!c||0===c.length)return a;for(var f=l.getBox("sidx"),d=!f||isNaN(f.earliest_presentation_time)||isNaN(f.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:f.earliest_presentation_time/f.timescale,h=Math.max(d,0),p=g.getCurrentRepresentation(),m=0,y=c.length;m<y;m++){var E=Y.getEvent(c[m],i,h,p);E&&a.push(E)}return a}catch(e){return[]}}(n,V.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,quality:r,index:t.index})[0],o,s);R.trigger(l.a.INBAND_EVENTS,{events:u},{streamId:N.id})}}}function Re(){var e=z.getTime();Z.get().streaming.buffer.flushBufferAtTrackSwitch&&z.seek(e+.001,!1,!0),Ce(e),d.setSeekTarget(e),h.startScheduleTimer()}function we(){var e=z.getTime(),t=d.getContinuousBufferTimeForTargetTime(e);Ce(isNaN(t)?e:t),h.startScheduleTimer()}function Ne(e){e&&!isNaN(e.time)&&(Ce(e.time),d.setSeekTarget(e.time))}function Ce(e){S=e,E=!0}return t={initialize:function(n,i,s){b=Object(B.a)(A).create({events:l.a,eventBus:R,streamInfo:N,timelineConverter:j,dashConstants:o.a,segmentBaseController:e.segmentBaseController,type:F}),T=Object(M.a)(A).create({streamInfo:N,type:F,timelineConverter:j,dashMetrics:Q,mediaPlayerModel:H,baseURLController:e.baseURLController,errHandler:k,segmentsController:b,settings:Z,boxParser:$,events:l.a,eventBus:R,errors:y.a,debug:Object(f.a)(A).getInstance(),requestModifier:Object(P.a)(A).getInstance(),dashConstants:o.a,constants:a.a,urlUtils:Object(L.a)(A).getInstance()}),r=N.manifestInfo.isDynamic,T.initialize(r),K.registerStreamType(F,t),g=Object(D.a)(A).create({streamInfo:N,type:F,abrController:K,dashMetrics:Q,playbackController:z,timelineConverter:j,dashConstants:o.a,events:l.a,eventBus:R,errors:y.a,isDynamic:r,segmentsController:b}),(d=function(e,t){var n=null;if(!e)return k.error(new m.a(y.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,y.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null;n=e!==a.a.TEXT||t?I(A).create({streamInfo:N,type:e,mediaPlayerModel:H,manifestModel:q,fragmentModel:V,errHandler:k,mediaController:W,representationController:g,adapter:Y,textController:X,abrController:K,playbackController:z,settings:Z}):w(A).create({streamInfo:N,type:e,mimeType:G,fragmentModel:V,textController:X,errHandler:k,settings:Z});return n}(F,s))&&d.initialize(n),(h=C(A).create({streamInfo:N,type:F,mimeType:G,adapter:Y,dashMetrics:Q,mediaPlayerModel:H,fragmentModel:V,abrController:K,playbackController:z,textController:X,mediaController:W,bufferController:d,settings:Z})).initialize(i),S=0,E=!1},getStreamId:ee,getType:te,isUpdating:function(){return!!g&&g.isUpdating()},getBufferController:function(){return d},getFragmentModel:function(){return V},getScheduleController:be,getRepresentationController:function(){return g},getRepresentationInfo:Se,getBufferLevel:function(){return d?d.getBufferLevel():0},isBufferingCompleted:Ae,createBufferSinks:function(e){var t=_e();return t?Promise.resolve(t):d?d.createBufferSink(i,e):Promise.resolve(null)},updateStreamInfo:function(e){return N=e,Ae()?Promise.resolve():d.updateAppendWindow()},getStreamInfo:function(){return N},selectMediaInfo:Te,clearMediaInfoArray:function(){c=[]},addMediaInfo:function(e){-1===c.indexOf(e)&&c.push(e)},prepareTrackSwitch:function(){return new Promise((function(e){n.debug("Preparing track switch for type ".concat(F));var t=F===a.a.TEXT||Z.get().streaming.trackSwitchMode[F]===a.a.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&z.getTimeToStreamEnd(N)>Z.get().streaming.buffer.stallThreshold;if(d.getIsBufferingCompleted()&&!t)return d.prepareForNonReplacementTrackSwitch(i.codec).then((function(){R.trigger(l.a.BUFFERING_COMPLETED,{},{streamId:N.id,mediaType:F})})).catch((function(){R.trigger(l.a.BUFFERING_COMPLETED,{},{streamId:N.id,mediaType:F})})),void e();h.clearScheduleTimer(),h.setSwitchTrack(!0),t?(R.trigger(l.a.BUFFER_REPLACEMENT_STARTED,{mediaType:F,streamId:N.id},{mediaType:F,streamId:N.id}),V.abortRequests(),d.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=Se();return d.updateBufferTimestampOffset(e)})).then((function(){Re(),e()})).catch((function(){Re(),e()}))):d.prepareForNonReplacementTrackSwitch(i.codec).then((function(){we(),e()})).catch((function(){we(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(F));var t=e.newQuality;_=!0,h.clearScheduleTimer();var r=Se(t);h.setCurrentRepresentation(r),g.prepareQualityChange(t),V.abortRequests(),d.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(R.trigger(l.a.BUFFER_REPLACEMENT_STARTED,{mediaType:F,streamId:N.id},{mediaType:F,streamId:N.id}),d.prepareForReplacementQualitySwitch().then((function(){Re(),_=!1})).catch((function(){Re(),_=!1}))):Z.get().streaming.buffer.fastSwitchEnabled?function(e){var t=z.getTime(),n=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration),r=V.getRequests({state:p.a.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ne()){var i=d.getBufferLevel(),a=K.getAbandonmentStateFor(N.id,F);if(r.quality<e.quality&&i>=n&&a!==s.a.ABANDON_LOAD)Ce(t+n),h.setCheckPlaybackQuality(!1),h.startScheduleTimer();else ge()}else h.startScheduleTimer();_=!1}(r):ge(),Q.pushPlayListTraceMetrics(new Date,U.REPRESENTATION_SWITCH_STOP_REASON),Q.createPlaylistTraceMetrics(r.id,1e3*z.getTime(),z.getPlaybackRate())}))},getMediaInfo:function(){return i},getMediaSource:function(){return d.getMediaSource()},setMediaSource:function(e){d.setMediaSource(e)},getBuffer:_e,setExplicitBufferingTime:Ce,finalisePlayList:function(e,t){Q.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Se(),t=g&&e?g.getRepresentationForQuality(e.quality):null;return T.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){h.clearScheduleTimer(),V.abortRequests(),d.prepareForPlaybackSeek().then((function(){var t=d.getAllRangesWithSafetyFactor(e.seekTime);return d.clearBuffers(t)})).then((function(){var n=d.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(n)&&!isNaN(N.duration)&&isFinite(N.duration)&&n>=N.start+N.duration)d.setIsBufferingCompleted(!0),t();else{var r=isNaN(n)?e.seekTime:n;Ce(r),d.setSeekTarget(r);var i=[];i.push(d.updateAppendWindow());var a=Se();i.push(d.updateBufferTimestampOffset(a)),Promise.all(i).then((function(){h.setInitSegmentRequired(!0),h.setCheckPlaybackQuality(!1),h.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{h.clearScheduleTimer(),V.abortRequests(),d.prepareForPlaybackSeek().then((function(){return d.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){T&&T.reset(),d&&(d.reset(e,n),d=null),h&&(h.reset(),h=null),g&&(g.reset(),g=null),b&&(b=null),K&&K.unRegisterStreamType(ee(),F),R.off(l.a.DATA_UPDATE_COMPLETED,ce,t),R.off(l.a.INIT_FRAGMENT_NEEDED,ie,t),R.off(l.a.MEDIA_FRAGMENT_NEEDED,ae,t),R.off(l.a.MEDIA_FRAGMENT_LOADED,Ie,t),R.off(l.a.BUFFER_LEVEL_STATE_CHANGED,fe,t),R.off(l.a.BUFFER_CLEARED,de,t),R.off(l.a.SEEK_TARGET,Ne,t),R.off(l.a.FRAGMENT_LOADING_ABANDONED,pe,t),R.off(l.a.FRAGMENT_LOADING_COMPLETED,me,t),R.off(l.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),R.off(l.a.SET_NON_FRAGMENTED_TEXT,Ee,t),R.off(l.a.QUOTA_EXCEEDED,ve,t),R.off(l.a.SOURCE_BUFFER_ERROR,he,t),re(),F=null,N=null}},n=Object(f.a)(A).getInstance().getLogger(t),re(),R.on(l.a.DATA_UPDATE_COMPLETED,ce,t,{priority:u.a.EVENT_PRIORITY_HIGH}),R.on(l.a.INIT_FRAGMENT_NEEDED,ie,t),R.on(l.a.MEDIA_FRAGMENT_NEEDED,ae,t),R.on(l.a.MEDIA_FRAGMENT_LOADED,Ie,t),R.on(l.a.BUFFER_LEVEL_STATE_CHANGED,fe,t),R.on(l.a.BUFFER_CLEARED,de,t),R.on(l.a.SEEK_TARGET,Ne,t),R.on(l.a.FRAGMENT_LOADING_ABANDONED,pe,t),R.on(l.a.FRAGMENT_LOADING_COMPLETED,me,t),R.on(l.a.QUOTA_EXCEEDED,ve,t),R.on(l.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),R.on(l.a.SET_NON_FRAGMENTED_TEXT,Ee,t),R.on(l.a.SOURCE_BUFFER_ERROR,he,t),t}G.__dashjs_factory_name="StreamProcessor";var j=c.a.getClassFactory(G),Y=n(65),q=n(68);function H(e){e=e||{};var t,n,r,i=this.context,o=Object(u.a)(i).getInstance(),s=e.errHandler,c=e.mediaPlayerModel,h=e.dashMetrics,g=Object(f.a)(i).getInstance(),m=e.streamInfo;function E(){return m.id}function v(){for(var e in r)r[e].reset();r={}}function _(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.a.AUDIO||t.mediaType===a.a.VIDEO||t.mediaType===a.a.TEXT&&t.mediaInfo.isFragmented)&&o.trigger(l.a.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&s){var u=function(e,t,n,r){var i=new Y.a;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.a.FRAGMENT_LOADING_PROGRESS);o.trigger(i?l.a.INIT_FRAGMENT_LOADED:l.a.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:E,getModel:function(t){var n=r[t];return n||(n=Object(p.a)(i).create({streamInfo:m,type:t,dashMetrics:h,fragmentLoader:Object(q.a)(i).create({dashMetrics:h,mediaPlayerModel:c,errHandler:s,requestModifier:Object(P.a)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:o,events:l.a,errors:y.a,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:E()}),debug:g,eventBus:o,events:l.a}),r[t]=n),n},reset:function(){o.off(d.a.FRAGMENT_LOADING_COMPLETED,_,this),o.off(d.a.FRAGMENT_LOADING_PROGRESS,_,this),v()}},n=g.getLogger(t),v(),o.on(d.a.FRAGMENT_LOADING_COMPLETED,_,t),o.on(d.a.FRAGMENT_LOADING_PROGRESS,_,t),t}H.__dashjs_factory_name="FragmentController";var V=c.a.getClassFactory(H);var K=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},z=n(35);var W=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},X=n(12);function Q(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 K;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=Object(X.d)(e.templateUrl,"Number",n);return r=Object(X.d)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=Object(X.d)(r,"Bandwidth",e.bandwidth),Object(X.e)(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 W;return n.mediaType=a.a.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:s},s(),n=Object(z.b)(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}Q.__dashjs_factory_name="ThumbnailController";var Z=c.a.getClassFactory(Q);function $(e){var t;e=e||{};var n=[],r=Object(u.a)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}function s(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,s,t),t}$.__dashjs_factory_name="BlackListController";var J=c.a.getClassFactory($),ee=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT,a.a.MUXED,a.a.IMAGE];function te(e){e=e||{};var t,n,r,i,s,c,d,h,g,p,E,v,_,T,b,S,A,I,R=this.context,w=Object(u.a)(R).getInstance(),N=Object(L.a)(R).getInstance(),C=e.manifestModel,D=e.mediaPlayerModel,O=e.dashMetrics,M=e.manifestUpdater,P=e.adapter,F=e.timelineConverter,k=e.capabilities,U=e.errHandler,B=e.abrController,G=e.playbackController,Y=e.eventController,q=e.mediaController,H=e.protectionController,K=e.textController,z=e.videoModel,W=e.streamInfo,X=e.settings;function Q(t,i){return new Promise((function(s,u){se(),p=!0,le();var c,f=z.getElement();ee.forEach((function(i){(i!==a.a.VIDEO||!f||f&&/^VIDEO$/i.test(f.nodeName))&&function(t,i){var s,u=P.getAllMediaInfoForType(W,t),c=[],f=null;if(!u||0===u.length)return void n.info("No "+t+" data.");t===a.a.VIDEO&&(d=!0);t===a.a.AUDIO&&(h=!0);for(var g=0,p=u.length;g<p;g++)f=u[g],t===a.a.TEXT&&f.isEmbedded&&(K.addEmbeddedTrack(W,f),c.push(f)),$(f)&&q.addTrack(f);c.length>0&&(q.setInitialMediaSettingsForType(t,W),K.addMediaInfosToBuffer(W,t,c));if(0===(u=u.filter((function(e){return!e.isEmbedded}))).length)return;if(t===a.a.IMAGE)return void(v=Z(R).create({streamInfo:W,adapter:P,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:S,eventBus:w,events:l.a,dashConstants:o.a,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize();w.trigger(l.a.STREAM_INITIALIZING,{streamInfo:W,mediaInfo:f}),q.setInitialMediaSettingsForType(t,W);var m=function(t,n){var i=t&&t.length>0?t[0]:null,o=E.getModel(i?i.type:null),s=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=j(R).create({streamInfo:W,type:s,mimeType:u,timelineConverter:F,adapter:P,manifestModel:C,mediaPlayerModel:D,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:B,playbackController:G,mediaController:q,textController:K,errHandler:U,settings:X,boxParser:b,segmentBlacklistController:_});c.initialize(n,d,l),r.push(c);for(var f=0;f<t.length;f++)c.addMediaInfo(t[f]);s===a.a.TEXT&&K.addMediaInfosToBuffer(W,s,t,o);return c}(u,i);(s=q.getCurrentTrackFor(t,W.id))&&(B.updateTopQualityIndex(s),m.selectMediaInfo(t===a.a.TEXT&&s.isEmbedded?u[0]:s))}(i,t)})),(c=i,new Promise((function(e){var t={},n=r.map((function(e){return e.createBufferSinks(c)}));Promise.all(n).then((function(n){n.forEach((function(e){e&&(t[e.getType()]=e)})),e(t)})).catch((function(){e(t)}))}))).then((function(e){if(p=!1,0===r.length){var t="No streams to play.";U.error(new m.a(y.a.MANIFEST_ERROR_ID_NOSTREAMS_CODE,t,C.getValue())),n.fatal(t)}else ce();K.createTracks(W),s(e)})).catch((function(e){u(e)}))}))}function $(e){var t,r=e?e.type:null;return r===a.a.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",n.fatal(t),U.error(new m.a(y.a.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,C.getValue())),!1):r===a.a.TEXT||r===a.a.IMAGE||(!(e.contentProtection&&!k.supportsEncryptedMedia())||(U.error(new m.a(y.a.CAPABILITY_MEDIAKEYS_ERROR_CODE,y.a.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),!1))}function te(e){for(var t=r?r.length:0,n=0;n<t;n++){var i=r[n].getFragmentModel();i.abortRequests(),i.resetInitialSettings(),r[n].reset(!1,e)}K&&K.deactivateStream(W),r=[],s=!1,c=!1,_e(!1),re(!1),w.trigger(l.a.STREAM_DEACTIVATED,{streamInfo:W})}function ne(e){te(e),i=!1,d=!1,h=!1,g={},p=!1,A=!1,I=[]}function re(e){A=e}function ie(){return W?W.start:NaN}function ae(){return W?W.id:null}function oe(){return W}function se(){if(!z||!B)throw new Error(a.a.MISSING_CONFIG_ERROR)}function ue(e){e.error&&(U.error(e.error),n.fatal(e.error.message))}function le(){if(Y){var e=P.getEventsFor(W);e&&e.length>0&&Y.addInlineEvents(e,W.id)}}function ce(){for(var e=r.length,t=!!g.audio||!!g.video?new m.a(y.a.DATA_UPDATE_FAILED_ERROR_CODE,y.a.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(r[n].isUpdating()||p)return;if(H){H.clearMediaInfoArray();for(var o=0;o<e&&r[o];o++){var s=r[o].getType(),u=r[o].getMediaInfo();if(s===a.a.AUDIO||s===a.a.VIDEO||s===a.a.TEXT&&u.isFragmented){var c=r[o].getMediaInfo();c&&H.initializeForMedia(c)}}H.handleKeySystemFromManifest()}t?U.error(t):i||(i=!0,z.waitForReadyState(a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){w.trigger(l.a.STREAM_INITIALIZED,{streamInfo:W})})))}function fe(){var e=me(),t=e.length;if(0!==t){for(var r=0;r<t;r++)if(!e[r].isBufferingCompleted()&&(e[r].getType()===a.a.AUDIO||e[r].getType()===a.a.VIDEO))return void n.debug("onBufferingCompleted - One streamProcessor has finished but",e[r].getType(),"one is not buffering completed");n.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),c=!0,w.trigger(l.a.STREAM_BUFFERING_COMPLETED,{streamInfo:W},{streamInfo:W})}else n.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function de(e){g[e.mediaType]=e.error,ce()}function he(e){Y&&Y.addInbandEvents(e.events,W.id)}function ge(e){return e&&e.type?pe(e.type):null}function pe(e){return e?me().filter((function(t){return t.getType()===e}))[0]:null}function me(){for(var e,t,n=[],i=0;i<r.length;i++)(e=(t=r[i]).getType())!==a.a.AUDIO&&e!==a.a.VIDEO&&e!==a.a.TEXT||n.push(t);return n}function ye(e,t){var n=oe(),r=t.getStreamInfo();if(!r||!n)return!0;var i=P.getAdaptationForType(r.index,e,r),a=P.getAdaptationForType(n.index,e,n);return i&&a?!(!Ee(a)&&Ee(i)):!i&&!a}function Ee(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function ve(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():oe();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 k.codecRootCompatibleWithCodec(t,e)}))}));return c||f&&s}function _e(e){T=e}function Te(){return T}return t={initialize:function(){w.on(l.a.BUFFERING_COMPLETED,fe,t),w.on(l.a.DATA_UPDATE_COMPLETED,de,t),w.on(l.a.INBAND_EVENTS,he,t),H&&(w.on(l.a.KEY_ERROR,ue,t),w.on(l.a.SERVER_CERTIFICATE_UPDATED,ue,t),w.on(l.a.LICENSE_REQUEST_COMPLETE,ue,t),w.on(l.a.KEY_SYSTEM_SELECTED,ue,t),w.on(l.a.KEY_SESSION_CREATED,ue,t),w.on(l.a.KEY_STATUSES_CHANGED,ue,t)),K.initializeForStream(W),w.trigger(l.a.STREAM_UPDATED,{streamInfo:W})},getStreamId:function(){return W?W.id:null},activate:function(e,t){return new Promise((function(n,r){if(!s)return Te()?(s=!0,w.trigger(l.a.STREAM_ACTIVATED,{streamInfo:W}),void n(t)):void function(e,t){return Q(e,t)}(e,t).then((function(e){s=!0,w.trigger(l.a.STREAM_ACTIVATED,{streamInfo:W}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:te,getIsActive:function(){return s},getDuration:function(){return W?W.duration:NaN},getStartTime:ie,getId:ae,getStreamInfo:oe,getHasAudioTrack:function(){return h},getHasVideoTrack:function(){return d},startPreloading:function(e,t){return new Promise((function(i,a){Te()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ae())),_e(!0),Q(e,t).then((function(){for(var e=0;e<r.length&&r[e];e++)r[e].setExplicitBufferingTime(ie()),r[e].getScheduleController().startScheduleTimer();i()})).catch((function(){_e(!1),a()})))}))},getThumbnailController:function(){return v},getBitrateListFor:function(e){if(se(),e===a.a.IMAGE)return v?v.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<r.length;n++)if((t=r[n]).getType()===e)return t.getMediaInfo();return null}(e);return B.getBitrateList(t)},updateData:function(e){return new Promise((function(t){p=!0,W=e,Y&&le();for(var n=[],i=0,a=r.length;i<a;i++){var o=r[i],s=o.getMediaInfo();n.push(o.updateStreamInfo(W));var u=P.getAllMediaInfoForType(W,o.getType());if(u){o.clearMediaInfoArray();for(var c=0;c<u.length;c++){var f=u[c];o.addMediaInfo(u[c]),P.areMediaInfosEqual(s,f)&&(B.updateTopQualityIndex(f),n.push(o.selectMediaInfo(f)))}}}Promise.all(n).then((function(){for(n=[];I.length>0;){var e=I.pop(),t=e.newMediaInfo,r=ge(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){p=!1,ce(),w.trigger(l.a.STREAM_UPDATED,{streamInfo:W}),t()}))}))},reset:function(e){E&&(E.reset(),E=null),B&&W&&B.clearDataForStream(W.id),_&&(_.reset(),_=null),ne(e),W=null,w.off(l.a.DATA_UPDATE_COMPLETED,de,t),w.off(l.a.BUFFERING_COMPLETED,fe,t),w.off(l.a.INBAND_EVENTS,he,t),H&&(w.off(l.a.KEY_ERROR,ue,t),w.off(l.a.SERVER_CERTIFICATE_UPDATED,ue,t),w.off(l.a.LICENSE_REQUEST_COMPLETE,ue,t),w.off(l.a.KEY_SYSTEM_SELECTED,ue,t),w.off(l.a.KEY_SESSION_CREATED,ue,t),w.off(l.a.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t<r.length;)$(r[t].getMediaInfo())?(r[t].setMediaSource(e),t++):(r[t].reset(),r.splice(t,1));if(0===r.length){var i="No streams to play.";U.error(new m.a(y.a.MANIFEST_ERROR_ID_NOSTREAMS_CODE,i+"nostreams",C.getValue())),n.fatal(i)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ve(e,a.a.VIDEO,t)&&ve(e,a.a.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(a.a.VIDEO,e)&&ye(a.a.AUDIO,e)},getPreloaded:Te,getIsEndedEventSignaled:function(){return A},setIsEndedEventSignaled:re,getAdapter:function(){return P},getHasFinishedBuffering:function(){return c},setPreloaded:_e,startScheduleControllers:function(){for(var e=r.length,t=0;t<e&&r[t];t++)r[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(s&&W){c=!1;var t=e.newMediaInfo,r=C.getValue();P.setCurrentMediaInfo(W.id,t.type,t);var i=ge(t);if(i){var o=G.getTime();n.info("Stream - Process track changed at current time "+o),r.refreshManifestOnSwitchTrack?(I.push(e),M.getIsUpdating()||(n.debug("Stream - Refreshing manifest for switch track"),M.refreshManifest())):i.selectMediaInfo(t).then((function(){t.type!==a.a.VIDEO&&t.type!==a.a.AUDIO||B.updateTopQualityIndex(t),i.prepareTrackSwitch()}))}}},prepareQualityChange:function(e){var t=pe(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{S=Object(f.a)(R).getInstance(),n=S.getLogger(t),ne(),b=Object(x.a)(R).getInstance(),_=J(R).create({updateEventName:l.a.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.a.SEGMENT_LOCATION_BLACKLIST_ADD}),E=V(R).create({streamInfo:W,mediaPlayerModel:D,dashMetrics:O,errHandler:U,settings:X,boxParser:b,dashConstants:o.a,urlUtils:N})}catch(e){throw e}}(),t}te.__dashjs_factory_name="Stream";var ne=c.a.getClassFactory(te);function re(){var e,t,n,r,i,a,s,c,h,g,p,m,E=this.context,v=Object(u.a)(E).getInstance(),_=Object(L.a)(E).getInstance();function T(){n=NaN,s=!1,i=!0,a=!1,b()}function b(){null!==r&&(clearTimeout(r),r=null)}function S(e){b(),a||(isNaN(e)&&!isNaN(n)&&(e=1e3*n),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),r=setTimeout(R,e)))}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];s=!0;var t=h.getValue(),n=t.url,r=g.getPatchLocation(t),i=g.getLocation(t);r&&!e?n=r:i&&(n=i),_.isRelative(n)&&(n=_.resolve(n,t.url)),c.load(n)}function I(e){if(e){if(g.getIsPatch(e)){var r=e;e=h.getValue();var u=g.isPatchValid(e,r),c=u;if(u){var f=g.getPublishTime(e);c=g.applyPatchToManifest(e,r);var d=g.getPublishTime(e);c=f.getTime()!=d.getTime()}if(!c)return t.debug("Patch provided is invalid, performing full manifest refresh"),void A(!0);e.loadedTime=new Date}}else(e=h.getValue()).loadedTime=new Date;if(h.getValue()&&h.getValue().type===o.a.DYNAMIC&&e.type===o.a.STATIC)return v.trigger(l.a.DYNAMIC_TO_STATIC),s=!1,void(a=!0);h.setValue(e);var p=new Date,m=(p.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=g.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),v.trigger(l.a.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+p+"["+p.getTime()/1e3+"] "),i||S()}function R(){i||(s?S(m.get().streaming.manifestUpdateRetryInterval):A())}function w(e){e.error?e.error.code===y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&p.error(e.error):I(e.manifest)}function N(){i=!1,S()}function C(){(i=!m.get().streaming.scheduling.scheduleWhilePaused)&&b()}function D(){s=!1}return e={initialize:function(){T(),v.on(l.a.STREAMS_COMPOSED,D,this),v.on(d.a.PLAYBACK_STARTED,N,this),v.on(d.a.PLAYBACK_PAUSED,C,this),v.on(l.a.INTERNAL_MANIFEST_LOADED,w,this)},setManifest:function(e){I(e)},refreshManifest:A,getIsUpdating:function(){return s},setConfig:function(e){e&&(e.manifestModel&&(h=e.manifestModel),e.adapter&&(g=e.adapter),e.manifestLoader&&(c=e.manifestLoader),e.errHandler&&(p=e.errHandler),e.settings&&(m=e.settings))},reset:function(){v.off(d.a.PLAYBACK_STARTED,N,this),v.off(d.a.PLAYBACK_PAUSED,C,this),v.off(l.a.STREAMS_COMPOSED,D,this),v.off(l.a.INTERNAL_MANIFEST_LOADED,w,this),T()}},t=Object(f.a)(E).getInstance().getLogger(e),e}re.__dashjs_factory_name="ManifestUpdater";var ie=c.a.getClassFactory(re);function ae(){var e,t,n,r,i,a,o,s,c,d,h,g,p,E,_,T,b=this.context,S=Object(u.a)(b).getInstance(),A=Object(L.a)(b).getInstance();function I(){s=[],c=[],d=null,h=null,p=null,g=NaN,n=!1,r=!1,E=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function R(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&p&&p.value&&p.schemeIdUri&&!isNaN(g)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(h&&(Date.now()-h)/1e3<30||(s=[],r=!0,function e(t){try{if(t<=0)return void B();var n=Date.now();a[p.schemeIdUri](p.value,(function(r){var i=Date.now(),a=w(n,i,r);s.push(a),e(t-1)}),(function(){B()}))}catch(e){B()}}(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function w(e,t,n){return n-(t-(t-e)/2)}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?k():U(t,e)}function C(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 D(e){return Date.parse(e)}function O(e){return Date.parse(e)}function M(e,t,n){n()}function P(e,t,n){var r=C(e);isNaN(r)?n():t(r)}function x(e,t,n,r,i){var a,o,s=!1,u=new XMLHttpRequest,l=i?v.a.HEAD:v.a.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))},A.isRelative(t)){var f=T.resolve();f&&(t=A.resolve(t,f.url))}u.open(l,t),u.timeout=5e3,u.onload=o,u.onloadend=a,u.send()}function F(e,t,n){x(O,e,t,n,!0)}function k(){var e=o.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?U(!0):U(!1,t-Date.now())}function U(e,r){if(isNaN(g)||isNaN(r)||e||function(e){try{var n,r=G(e),a=isNaN(E)?30:E,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))),E=n}catch(e){}}(r),!e&&!isNaN(r)){d=Date.now(),n=!1;var a=isNaN(g);g=r,a&&R(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(p=null,n=!1,_.error(new m.a(y.a.TIME_SYNC_FAILED_ERROR_CODE,y.a.TIME_SYNC_FAILED_ERROR_MESSAGE))),S.trigger(l.a.UPDATE_TIME_SYNC_OFFSET,{offset:r}),S.trigger(l.a.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)),g=e,S.trigger(l.a.UPDATE_TIME_SYNC_OFFSET,{offset:g})),r=!1,h=Date.now()}}function G(e){try{if(isNaN(g))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=g-t&&e<=g+t}catch(e){return!0}}return e={initialize:function(){I(),a={"urn:mpeg:dash:utc:http-head:2014":F,"urn:mpeg:dash:utc:http-xsdate:2014":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":x.bind(null,D),"urn:mpeg:dash:utc:direct:2014":P,"urn:mpeg:dash:utc:http-head:2012":F,"urn:mpeg:dash:utc:http-xsdate:2012":x.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":x.bind(null,D),"urn:mpeg:dash:utc:direct:2012":P,"urn:mpeg:dash:utc:http-ntp:2014":M,"urn:mpeg:dash:utc:ntp:2014":M,"urn:mpeg:dash:utc:sntp:2014":M}},attemptSync:function(e,t){c=e,n||(!function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(E)?30:E;return!(d&&t&&!isNaN(t))||(Date.now()-d)/1e3>=t}catch(e){return!0}}(t)?S.trigger(l.a.TIME_SYNCHRONIZATION_COMPLETED):(n=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!c||0===c.length||n>=c.length)return void N();var r=c[n];if(r)if(a.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();a[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=w(i,t,e);p=r,N(n)}),(function(){e(n+1)}))}else e(n+1);else N()}()))},setConfig:function(e){e&&(e.dashMetrics&&(o=e.dashMetrics),e.baseURLController&&(T=e.baseURLController),e.errHandler&&(_=e.errHandler),e.settings&&(i=e.settings))},reset:function(){I(),S.off(l.a.ATTEMPT_BACKGROUND_SYNC,R,e)}},t=Object(f.a)(b).getInstance().getLogger(e),S.on(l.a.ATTEMPT_BACKGROUND_SYNC,R,e),e}ae.__dashjs_factory_name="TimeSyncController";var oe=c.a.getSingletonFactory(ae);oe.HTTP_TIMEOUT_MS=5e3,c.a.updateSingletonFactory(ae.__dashjs_factory_name,oe);var se=oe;function ue(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(t)?(n.info("Set MediaSource duration:"+r),t.duration=r):setTimeout(e.bind(null,r),50)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,r=0;r<t.length;r++){if(t[r].updating)return;if(0===t[r].buffered.length)return}n.info("call to mediaSource endOfStream"),e.endOfStream()}}},n=Object(f.a)(r).getInstance().getLogger(e),e}ue.__dashjs_factory_name="MediaSourceController";var le=c.a.getSingletonFactory(ue),ce=n(29);function fe(){var e,t,n,r,i,a,o,s,l,c,h,g="discarded",p="updated",m="added",y=this.context,E=Object(u.a)(y).getInstance();function v(){if(!o||!s)throw new Error("setConfig function has to be called previously")}function _(){h=!1,n={},r={},i=null,c=!1,a=Date.now()/1e3}function T(){try{null!==i&&h&&(clearInterval(i),i=null,h=!1,function(){try{w(r),w(n)}catch(e){t.error(e)}}())}catch(e){throw e}}function b(){try{if(!c){c=!0;var e=s.getTime(),i=e-a;i=a>0?Math.max(0,i):0,S(r,i,e),S(n,i,e),A(r),A(n),a=e,c=!1}}catch(e){c=!1,t.error(e)}}function S(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.a.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=g;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=m;else if(n){var u=t[r][s];e.triggeredReceivedEvent=u.triggeredReceivedEvent,e.triggeredStartEvent=u.triggeredStartEvent,t[r][s]=e,o=p}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,E.trigger(d.a.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:n,newManifestValidAfter:NaN},{mode:d.a.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.a.EVENT_MODE_ON_START)}}))}catch(e){t.error(e)}}function N(e,n){try{if(e)for(var r=Object.keys(e),i=0;i<r.length;i++)for(var a=e[r[i]],o=Object.keys(a),s=0;s<o.length;s++){a[o[s]].forEach((function(e){void 0!==e&&n(e)}))}}catch(e){t.error(e)}}function C(e,n,r){try{return e-n>r}catch(e){return t.error(e),!1}}function D(e,n){try{var r=s.getTime(),i=e.id;if(n===d.a.EVENT_MODE_ON_RECEIVE&&!e.triggeredReceivedEvent)return t.debug("Received event ".concat(i)),e.triggeredReceivedEvent=!0,void E.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.triggeredStartEvent||("urn:mpeg:dash:event:2012"===e.eventStream.schemeIdUri&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(r)),function(){try{v(),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{Object(ce.a)(y).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)),E.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n})),e.triggeredStartEvent=!0)}catch(e){t.error(e)}}return e={addInlineEvents:function(e,r){try{if(v(),n[r]||(n[r]={}),e)for(var i=0;i<e.length;i++){var a=e[i];if(!C(s.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)){var o=I(a,n[r],!0);o===m?(t.debug("Added inline event with id ".concat(a.id," from period ").concat(r)),D(a,d.a.EVENT_MODE_ON_RECEIVE)):o===p&&t.debug("Updated inline event with id ".concat(a.id," from period ").concat(r))}}}catch(e){throw e}},addInbandEvents:function(e,n){try{v(),r[n]||(r[n]={});for(var i=0;i<e.length;i++){var a=e[i];if(!C(s.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime))I(a,r[n],!1)===m?("urn:mpeg:dash:event:2012"===a.eventStream.schemeIdUri&&R(a),t.debug("Added inband event with id ".concat(a.id," from period ").concat(n)),D(a,d.a.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(a.eventStream.schemeIdUri,", value ").concat(a.eventStream.value,", period id ").concat(n," and event id ").concat(a.id," was ignored because it has been added before."))}b()}catch(e){throw e}},getInbandEvents:function(){return r},getInlineEvents:function(){return n},start:function(){try{v(),t.debug("Start Event Controller");var e=l.get().streaming.eventControllerRefreshDelay;h||isNaN(e)||(h=!0,i=setInterval(b,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(o=e.manifestUpdater),e.playbackController&&(s=e.playbackController),e.settings&&(l=e.settings)}catch(e){throw e}},reset:function(){T(),_()}},t=Object(f.a)(y).getInstance().getLogger(e),_(),e}fe.__dashjs_factory_name="EventController";var de=c.a.getSingletonFactory(fe),he={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}};function ge(e){return function(e){if(Array.isArray(e))return pe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e)||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.")}()}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function me(){var e,t,n,r,i,o,c,h,g,p,E,v,_,T,b,A,I,R,w,N,C,D,O,M,P,x,F,B,G,j,Y,q,H,V,K,z,W,X,Q,Z,$,J,ee,te,re,ae,oe,ue,ce,fe=this.context,pe=Object(u.a)(fe).getInstance();function me(){if(!(o&&o.hasOwnProperty("load")&&D&&D.hasOwnProperty("initialize")&&D.hasOwnProperty("reset")&&D.hasOwnProperty("getClientTimeOffset")&&c&&C&&g&&V))throw new Error(a.a.MISSING_CONFIG_ERROR)}function ye(){if(!i||!i.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}function Ee(){!function(){try{var e=h.getStreamsInfo();if(!M&&0===e.length)throw new Error("There are no periods in the MPD");M&&e.length>0&&g.updateManifestUpdateInfo({currentTime:V.getTime(),buffered:H.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:D.getClientTimeOffset()}),O.length>0&&function(e){if(0===e.length)return void t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.");O=O.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===M.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r}))}(e);for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(_e(a)),g.addManifestUpdateStreamInfo(a)}Promise.all(n).then((function(){return re.get().streaming.applyContentSteering&&!M&&v.shouldQueryBeforeStart()?v.loadSteeringData():Promise.resolve()})).then((function(){M||function e(n){Oe();var r=g.getCurrentDVRInfo().range;if(r.end<r.start){oe&&clearTimeout(oe);var i=Math.min(1e3*(-1*(r.end-r.start)+2),2147483647);return t.debug("Waiting for ".concat(i," ms before playback can start")),pe.trigger(l.a.AST_IN_FUTURE,{delay:i}),void(oe=setTimeout((function(){e(n)}),i))}re.get().streaming.applyProducerReferenceTime&&K.calculateProducerReferenceTimeOffsets(n);var a=n[0].manifestInfo;re.get().streaming.applyServiceDescription&&K.applyServiceDescription(a);if(h.getIsDynamic()){var o=ze(n,a);V.computeAndSetLiveDelay(o,a)}var s=function(){var e;if(h.getIsDynamic()){var n=g.getCurrentDVRInfo(),r=n&&n.range?n.range.end:0;e=r-V.getOriginalLiveDelay();var i=n?n.range:null;if(i){if(isNaN(ue)&&-1===ue.toString().indexOf("posix:")){var a=He(!0);isNaN(a)||(t.info("Start time from URI parameters: ".concat(a)),e=Math.min(e,a))}else{t.info("Start time provided by the app: ".concat(ue));var o=Ve(!0,ue);isNaN(o)||(e=Math.min(e,o))}var s=re.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(e,i.start+s)}}else{var u=ot()[0].getStreamInfo();if(e=u.start,isNaN(ue)){var l=He(!1);isNaN(l)||(t.info("Start time from URI parameters: ".concat(l)),e=Math.max(e,l))}else{t.info("Start time provided by the app: ".concat(ue));var c=Ve(!1,ue);isNaN(c)||(e=Math.max(e,c))}}return e}(),u=De(s),c=null!==u?u:O[0];pe.trigger(l.a.INITIAL_STREAM_SWITCH,{startTime:s}),Te(c,null,s),$||($=setInterval((function(){!G&&V.getTimeToStreamEnd()<=0&&!V.isSeeking()&&pe.trigger(l.a.PLAYBACK_ENDED,{isLast:et().isLast})}),200))}(e),pe.trigger(l.a.STREAMS_COMPOSED),Be()})).catch((function(e){throw e}))}catch(e){C.error(new m.a(y.a.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+" nostreamscomposed",c.getValue())),Y=!0,it()}}()}function ve(){ae=!0}function _e(e){var t=tt(e.id);return t?t.updateData(e):(t=ne(fe).create({manifestModel:c,mediaPlayerModel:z,dashMetrics:g,manifestUpdater:i,adapter:h,timelineConverter:D,capabilities:n,capabilitiesFilter:r,errHandler:C,baseURLController:_,segmentBaseController:T,textController:x,abrController:A,playbackController:V,eventController:R,mediaController:I,protectionController:P,videoModel:H,streamInfo:e,settings:re}),O.push(t),t.initialize(),Promise.resolve())}function Te(e,n,r){try{if(G||!e||n===e&&e.getIsActive())return;G=!0,pe.trigger(l.a.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;M=e,n&&(i=Ne(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(V.getTime(),". Seamless period switch is set to ").concat(i)),ee=ee.filter((function(e){return e.getId()!==M.getId()})),V.initialize(et(),!!n),H.getElement()&&be(r,i)}catch(e){G=!1}}function be(e,n){var r;function i(){if(q&&"open"===q.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),q.removeEventListener("sourceopen",i),q.removeEventListener("webkitsourceopen",i),qe();var a=g.getCurrentDVRInfo();p.setSeekable(a.range.start,a.range.end),Se(e,n)}}function a(){q.addEventListener("sourceopen",i,!1),q.addEventListener("webkitsourceopen",i,!1),r=p.attachMediaSource(H),t.debug("MediaSource attached to element. Waiting on open...")}q?n?Se(e,n):(p.detachMediaSource(H),a()):(q=p.createMediaSource(),a())}function Se(e,t){M.activate(q,t?J:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&(te=!0),J=t}isNaN(e)||(pe.trigger(l.a.SEEK_TARGET,{time:e},{streamId:M.getId()}),V.seek(e,!1,!0),M.startScheduleControllers()),G=!1,pe.trigger(l.a.PERIOD_SWITCH_COMPLETED,{toStreamInfo:et()})}))}function Ae(e){var t=V.getTime(),n=e.seekTime,r=De(n);r&&r!==M?r&&r!==M&&(Ie(t,n,r),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=M.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){Te(t,M,n)})).catch((function(e){C.error(e)}))}(e,r)):(Ie(t,n),function(e){M.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),Ze(U.USER_REQUEST_STOP_REASON)}(e)),$e(k.SEEK_START_REASON)}function Ie(e,t){Re()}function Re(){ee&&ee.length>0&&(ee.forEach((function(e){e.deactivate(!0)})),ee=[])}function we(e){e.newMediaInfo.streamInfo.id===M.getId()&&(Re(),M.prepareTrackChange(e))}function Ne(e,t){try{return re.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||ae)&&(te||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(q&&!e.getPreloaded()){var n=Ne(e,t);n&&e.startPreloading(q,J).then((function(){ee.push(e)}))}}function De(e){if(isNaN(e))return null;for(var t=O.length,n=0;n<t;n++){var r=O[n];if(e<parseFloat((r.getStartTime()+r.getDuration()).toFixed(5)))return r}return null}function Oe(){try{var e=h.getIsDynamic(),t=h.getStreamsInfo()[0].manifestInfo,n=V.getTime(),r=D.calcTimeShiftBufferWindow(O,e),i=je();if(void 0===r.start||void 0===r.end)return;i&&0!==i.length?i.forEach((function(e){g.addDVRInfo(e.getType(),n,t,r)})):g.addDVRInfo(a.a.VIDEO,n,t,r)}catch(e){}}function Me(e){if(Q&&B){var t=z.getInitialBufferLevel(),n=[a.a.TEXT];(isNaN(t)||t<=V.getBufferLevel(n)||h.getIsDynamic()&&t>V.getLiveDelay())&&(Q=!1,$e(k.INITIAL_PLAYOUT_START_REASON),V.play())}e&&e.mediaType&&g.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Pe(e){e.streamInfo.id===M.getId()&&e.reason&&e.reason.forceReplace&&Re(),tt(e.streamInfo.id).prepareQualityChange(e)}function Le(){if(h.getIsDynamic()&&0!==V.getOriginalLiveDelay()){var e=h.getStreamsInfo();if(e.length>0){var t=e[0].manifestInfo,n=ze(e,t);V.computeAndSetLiveDelay(n,t)}}}function xe(){if(Xe()){var e=H.getPlaybackQuality();e&&g.addDroppedFrames(e)}}function Fe(){t.debug("[onPlaybackStarted]"),!Q&&X&&$e(k.RESUME_FROM_PAUSE_START_REASON),Q&&(Q=!1),Z&&(Z=!1,re.get().streaming.applyContentSteering&&!v.shouldQueryBeforeStart()&&v.loadSteeringData()),X=!1}function ke(e){t.debug("[onPlaybackPaused]"),e.ended||(X=!0,Ze(U.USER_REQUEST_STOP_REASON))}function Ue(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;q&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),p.signalEndOfStream(q)):Be()}function Be(){if(M&&M.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||(M||null);if(t){var n=t.getStreamInfo();return O.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(M),t=0;t<e.length;){var n=e[t],r=0===t?M:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&q&&Ce(n,r),t+=1}}function Ge(){$&&(clearInterval($),$=null)}function je(){return M?M.getProcessors():[]}function Ye(e){if(M&&!M.getIsEndedEventSignaled()){M.setIsEndedEventSignaled(!0);var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||(M||null);if(!t)return null;var n=t.getStreamInfo(),r=n.start,i=0,a=-1,o=NaN;for(;i<O.length;){var s=O[i],u=s.getStreamInfo(),l=u.start-r;l>0&&(isNaN(o)||l<o)&&n.id!==u.id&&(o=l,a=i),i+=1}if(a>=0)return O[a];return null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(M.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),Te(n,M,NaN)):(t.debug("StreamController no next stream found"),M.setIsEndedEventSignaled(!1)),Ze(n?U.END_OF_PERIOD_STOP_REASON:U.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Ge(),v.stopSteeringRequestTimer())}function qe(e){var t=e||et().manifestInfo.duration;p.setDuration(t)}function He(e){var t=b.getURIFragmentData();if(!t||!t.t)return NaN;var n=ot()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ke(e,t.t,n)}function Ve(e,t){var n=0;e||(n=ot()[0].getStreamInfo().start);return Ke(e,t,n)}function Ke(e,t,n){var r=h.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)?D.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function ze(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.a.VIDEO,a.a.AUDIO,a.a.TEXT].reduce((function(e,t){var n=h.getMediaInfoForType(r,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=h.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=h.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,ge(i))}return isFinite(n)?n:NaN}catch(e){return NaN}}function We(e){if(e.error)Y=!0,it();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;h.updatePeriods(n);var i=h.getUTCTimingSources();!h.getIsDynamic()||i&&0!==i.length||pe.trigger(d.a.CONFORMANCE_VIOLATION,{level:he.LEVELS.WARNING,event:he.EVENTS.NO_UTC_TIMING_ELEMENT});var a=h.getIsDynamic()?i.concat(W.getUTCTimingSources()):i,o=N.isHTTPS(e.manifest.url);a.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===re.get().streaming.utcSynchronization.defaultTimingSource.value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(o?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),o?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),r.filterUnsupportedFeatures(n).then((function(){_.initialize(n),E.attemptSync(a,h.getIsDynamic())}))}}function Xe(){return!!M&&M.getHasVideoTrack()}function Qe(){return!!M&&M.getHasAudioTrack()}function Ze(e,t){t=t||new Date,je().forEach((function(n){n.finalisePlayList(t,e)})),g.addPlayList()}function $e(e){g.createPlaylistMetrics(1e3*V.getTime(),e)}function Je(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",ce.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&&re.get().errors.recoverAttempts.mediaErrorDecode>=ce.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=V.getTime();M.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),be(e,!1)}():(j=!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),C.error(new m.a(e.error.code,n)),it())}}function et(){return M?M.getStreamInfo():null}function tt(e){for(var t=0,n=O.length;t<n;t++)if(O[t].getId()===e)return O[t];return null}function nt(e){isNaN(e.newDuration)||qe(e.newDuration)}function rt(){O=[],ue=NaN,P=null,G=!1,M=null,j=!1,Y=!1,Q=!0,Z=!0,X=!1,B=!0,$=null,ae=!1,te=!1,ee=[],oe=null,ce={counts:{mediaErrorDecode:0}}}function it(){me(),E.reset(),Ze(j||Y?U.FAILURE_STOP_REASON:U.USER_REQUEST_STOP_REASON);for(var t=0,n=O?O.length:0;t<n;t++){O[t].reset(j)}pe.off(d.a.PLAYBACK_TIME_UPDATED,xe,e),pe.off(d.a.PLAYBACK_SEEKING,Ae,e),pe.off(d.a.PLAYBACK_ERROR,Je,e),pe.off(d.a.PLAYBACK_STARTED,Fe,e),pe.off(d.a.PLAYBACK_PAUSED,ke,e),pe.off(d.a.PLAYBACK_ENDED,Ye,e),pe.off(d.a.METRIC_ADDED,at,e),pe.off(d.a.MANIFEST_VALIDITY_CHANGED,nt,e),pe.off(d.a.BUFFER_LEVEL_UPDATED,Me,e),pe.off(d.a.QUALITY_CHANGE_REQUESTED,Pe,e),l.a.KEY_SESSION_UPDATED&&pe.off(l.a.KEY_SESSION_UPDATED,ve,e),pe.off(l.a.MANIFEST_UPDATED,We,e),pe.off(l.a.STREAM_BUFFERING_COMPLETED,Ue,e),pe.off(l.a.TIME_SYNCHRONIZATION_COMPLETED,Ee,e),pe.off(l.a.CURRENT_TRACK_CHANGED,we,e),pe.off(l.a.SETTING_UPDATED_LIVE_DELAY,Le,e),pe.off(l.a.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Le,e),_.reset(),i.reset(),R.reset(),g.clearAllCurrentMetrics(),c.setValue(null),o.reset(),D.reset(),w.reset(),q&&(p.detachMediaSource(H),q=null),H=null,P&&(P=null,F=null,c.getValue()&&pe.trigger(l.a.PROTECTION_DESTROYED,{data:c.getValue().url})),Ge(),pe.trigger(l.a.STREAM_TEARDOWN_COMPLETE),rt()}function at(e){if(e.metric===s.a.DVR_INFO){var t=Qe()?a.a.AUDIO:a.a.VIDEO;e.mediaType===t&&p.setSeekable(e.value.range.start,e.value.range.end)}}function ot(){return O}return e={initialize:function(t,n){me(),B=t,F=n,D.initialize(),(i=ie(fe).create()).setConfig({manifestModel:c,adapter:h,manifestLoader:o,errHandler:C,settings:re}),i.initialize(),(R=de(fe).getInstance()).setConfig({manifestUpdater:i,playbackController:V,settings:re}),R.start(),E.setConfig({dashMetrics:g,baseURLController:_,errHandler:C,settings:re}),E.initialize(),P&&(pe.trigger(l.a.PROTECTION_CREATED,{controller:P}),P.setMediaElement(H.getElement()),F&&P.setProtectionData(F)),function(){pe.on(d.a.PLAYBACK_TIME_UPDATED,xe,e),pe.on(d.a.PLAYBACK_SEEKING,Ae,e),pe.on(d.a.PLAYBACK_ERROR,Je,e),pe.on(d.a.PLAYBACK_STARTED,Fe,e),pe.on(d.a.PLAYBACK_PAUSED,ke,e),pe.on(d.a.PLAYBACK_ENDED,Ye,e),pe.on(d.a.METRIC_ADDED,at,e),pe.on(d.a.MANIFEST_VALIDITY_CHANGED,nt,e),pe.on(d.a.BUFFER_LEVEL_UPDATED,Me,e),pe.on(d.a.QUALITY_CHANGE_REQUESTED,Pe,e),l.a.KEY_SESSION_UPDATED&&pe.on(l.a.KEY_SESSION_UPDATED,ve,e);pe.on(l.a.MANIFEST_UPDATED,We,e),pe.on(l.a.STREAM_BUFFERING_COMPLETED,Ue,e),pe.on(l.a.TIME_SYNCHRONIZATION_COMPLETED,Ee,e),pe.on(l.a.CURRENT_TRACK_CHANGED,we,e),pe.on(l.a.SETTING_UPDATED_LIVE_DELAY,Le,e),pe.on(l.a.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Le,e)}()},getActiveStreamInfo:et,addDVRMetric:Oe,hasVideoTrack:Xe,hasAudioTrack:Qe,getStreamById:tt,getStreamForTime:De,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,o=0;o<O.length;o++){if(i=(n=O[o]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;me(),ue=t,o.load(e)},loadWithManifest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;ye(),ue=t,i.setManifest(e)},getActiveStreamProcessors:je,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&&(z=e.mediaPlayerModel),e.customParametersModel&&(W=e.customParametersModel),e.protectionController&&(P=e.protectionController),e.adapter&&(h=e.adapter),e.dashMetrics&&(g=e.dashMetrics),e.errHandler&&(C=e.errHandler),e.timelineConverter&&(D=e.timelineConverter),e.videoModel&&(H=e.videoModel),e.playbackController&&(V=e.playbackController),e.serviceDescriptionController&&(K=e.serviceDescriptionController),e.contentSteeringController&&(v=e.contentSteeringController),e.textController&&(x=e.textController),e.abrController&&(A=e.abrController),e.mediaController&&(I=e.mediaController),e.settings&&(re=e.settings),e.baseURLController&&(_=e.baseURLController),e.uriFragmentModel&&(b=e.uriFragmentModel),e.segmentBaseController&&(T=e.segmentBaseController))},setProtectionData:function(e){F=e,P&&P.setProtectionData(F)},getIsStreamSwitchInProgress:function(){return G},switchToVideoElement:function(e){M&&(V.initialize(et()),be(e,!1))},getHasMediaOrInitialisationError:function(){return j||Y},getStreams:ot,getActiveStream:function(){return M},getInitialPlayback:function(){return Q},getAutoPlay:function(){return B},reset:it},t=Object(f.a)(fe).getInstance().getLogger(e),E=se(fe).getInstance(),p=le(fe).getInstance(),w=S(fe).getInstance(),N=Object(L.a)(fe).getInstance(),rt(),e}me.__dashjs_factory_name="StreamController";var ye=c.a.getSingletonFactory(me);function Ee(){var e,t,n,r,i,o,s,c,d,h,g,p,m=this.context,y=Object(u.a)(m).getInstance();function E(){p.debug("Stopping the gap controller"),i&&(clearInterval(i),i=null),function(){y.off(l.a.WALLCLOCK_TIME_UPDATED,S,this),y.off(l.a.INITIAL_STREAM_SWITCH,b,this),y.off(l.a.PLAYBACK_SEEKING,v,this),y.off(l.a.BUFFER_REPLACEMENT_STARTED,_,e),y.off(l.a.TRACK_CHANGE_RENDERED,T,e)}(),i=null,o=NaN,r=0,h=null,g={}}function v(){h&&(clearTimeout(h),h=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==a.a.VIDEO&&e.mediaType!==a.a.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(g[e.mediaType]=!0)}catch(e){p.error(e)}}function T(e){e&&e.mediaType&&(g[e.mediaType]=!1)}function b(){i||function(){try{i||(p.debug("Starting the gap controller"),i=setInterval((function(){A()&&N(s.getTime())}),100))}catch(e){}}()}function S(){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(g).some((function(e){return g[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)&&i<e.length;){var a=i>0?e.end(i-1):0;t<e.start(i)&&a-t<n.get().streaming.gaps.threshold&&(r=i),i+=1}return r}catch(e){return null}}function w(e,t){for(var n=0,r=e.length;n<r;n++)if(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(),g=NaN,m=!1;if(t=R(f,e),!isNaN(t)){var y=f.start(t),E=y-e;E>0&&(E<=u||l)&&(g=y)}var v=s.getTimeToStreamEnd();if(isNaN(g)&&r&&isFinite(v)&&!isNaN(v)&&v<u&&(g=parseFloat(s.getStreamEndTime().toFixed(5)),m=!0),i&&isNaN(g)&&r&&isNaN(t)&&w(f,e)&&(0===a?(p.warn("Toggle play pause to break stall"),d.pause(),d.play()):(p.warn("Jumping ".concat(a,"s to break stall")),g=e+a)),g>0&&o!==g&&g>e&&!h){var _=g-e;if(m){var T=c.getStreamForTime(g),b=T&&!!T.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(g,". Gap duration: ").concat(_)),s.seek(g,!0,b)}else{var S=s.getIsDynamic(),A=t>0?f.end(t-1):e,I=S?1e3*Math.max(0,_-.1):0;h=window.setTimeout((function(){s.seek(g,!0,!0),p.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(A," and ending at ").concat(g,". Jumping by: ").concat(g-A)),h=null}),I)}o=g}}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.a.WALLCLOCK_TIME_UPDATED,S,this),y.on(l.a.INITIAL_STREAM_SWITCH,b,this),y.on(l.a.PLAYBACK_SEEKING,v,this),y.on(l.a.BUFFER_REPLACEMENT_STARTED,_,e),y.on(l.a.TRACK_CHANGE_RENDERED,T,e)}()}},p=Object(f.a)(m).getInstance().getLogger(e),E(),e}Ee.__dashjs_factory_name="GapController";var ve=c.a.getSingletonFactory(Ee),_e=n(14);function Te(){var e,t,n,r,i,o,c,h,g,p,m=this.context,y=Object(u.a)(m).getInstance();function E(){t=!1;var e=_e.a.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&&g){var t=c.getLiveDelay();c.getBufferLevel()>t/2&&(g=!1)}}function T(e){e.streamId===o.getActiveStreamInfo().id&&(g=e.state===s.a.BUFFER_EMPTY)}function b(){h.getCatchupModeEnabled()||r.setPlaybackRate(1)}function S(){c.getIsDynamic()&&h.getCatchupModeEnabled()&&(h.getCatchupPlaybackRates().max>0||h.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{if(!c.getTime()>0||t)return!1;if(I()===a.a.LIVE_CATCHUP_MODE_LOLP){var e=c.getBufferLevel(),n=i.get().streaming.liveCatchup.playbackBufferMin;return function(e,t){try{return Math.abs(A())>0||e<t}catch(e){return!1}}(e,n)}return function(){try{return Math.abs(A())>0}catch(e){return!1}}()}catch(e){return!1}}()&&function(){if(t)return;if(r){var e,o=r.getPlaybackRate(),s=h.getCatchupPlaybackRates(),u=c.getBufferLevel(),l=A(),f=h.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();if(I()===a.a.LIVE_CATCHUP_MODE_LOLP){var y=i.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,r,i){var a;if(i<r){var o=Math.abs(e.min),s=5*(i-r),u=2*o/(1+Math.pow(Math.E,-s));a=1-o+u,p.debug("[LoL+ playback control_buffer-based] bufferLevel: "+i+", newRate: "+a)}else{var l=e.max;if(Math.abs(t-n)<=.02*n)a=1;else{var c=5*(t-n),f=2*l/(1+Math.pow(Math.E,-c));a=1-l+f}p.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+a)}return a}(s,d,m,y,u)}else e=function(e,t,n,r){if(g)return 1;var i=t-n,a=i<0?Math.abs(e.min):e.max,o=5*i,s=2*a/(1+Math.pow(Math.E,-o)),u=1-a+s;c.getPlaybackStalled()&&r<=n/2&&i>0&&(u=1);return u}(s,d,m,u);var E=n?.25:.02/(.5/s.max);e&&Math.abs(o-e)>=E&&(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.a.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.a.LIVE_CATCHUP_MODE_DEFAULT:a.a.LIVE_CATCHUP_MODE_LOLP}function R(){h.getCatchupPlaybackRates(!0)}return e={reset:function(){y.off(d.a.BUFFER_LEVEL_UPDATED,_,e),y.off(d.a.BUFFER_LEVEL_STATE_CHANGED,T,e),y.off(d.a.PLAYBACK_PROGRESS,S,e),y.off(d.a.PLAYBACK_TIME_UPDATED,S,e),y.off(d.a.PLAYBACK_SEEKED,S,e),y.off(l.a.SETTING_UPDATED_CATCHUP_ENABLED,b,e),y.off(l.a.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.off(l.a.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.off(d.a.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&&(h=e.mediaPlayerModel))},initialize:function(){y.on(d.a.BUFFER_LEVEL_UPDATED,_,e),y.on(d.a.BUFFER_LEVEL_STATE_CHANGED,T,e),y.on(d.a.PLAYBACK_PROGRESS,S,e),y.on(d.a.PLAYBACK_TIME_UPDATED,S,e),y.on(d.a.PLAYBACK_SEEKED,v,e),y.on(l.a.SETTING_UPDATED_CATCHUP_ENABLED,b,e),y.on(l.a.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.on(l.a.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.on(d.a.STREAM_INITIALIZED,R,e),R()}},p=Object(f.a)(m).getInstance().getLogger(e),E(),e}Te.__dashjs_factory_name="CatchupController";var be=c.a.getSingletonFactory(Te),Se=[a.a.SERVICE_DESCRIPTION_DVB_LL_SCHEME],Ae="video",Ie="audio",Re="any",we="all";function Ne(){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:{}},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.a.VIDEO,a.a.AUDIO,a.a.TEXT],u=i.getAvailabilityStartTime()/1e3;e.forEach((function(e){var n=s.reduce((function(t,n){return t=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.a.SEGMENT_TEMPLATE){var s=a[0],l=new Date(r[o.a.WALL_CLOCK_TIME]).getTime()/1e3-(r[o.a.PRESENTATION_TIME]/s[o.a.TIMESCALE]-s[o.a.PRESENTATION_TIME_OFFSET]+e.start),c=u-l;t.push({id:r[o.a.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 Se.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;i=e.schemeIdUri===a.a.SERVICE_DESCRIPTION_DVB_LL_SCHEME?function(e){var t=e.latency.target/1e3,n=!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,r=e.latency.referenceId||NaN;return{liveDelay:t,maxDrift:n,referenceId:r}}(e):function(e){var t=e.latency.target/1e3,n=!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,r=e.latency.referenceId||NaN;return{liveDelay:t,maxDrift:n,referenceId:r}}(e);if(n.length>0){var o=function(e){var t,r=0,i=n.filter((function(t){return t.id===e.referenceId}));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);return{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||e.operatingBandwidth.mediaType===we)return;var t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;var n=[];e.operatingBandwidth.mediaType===Ae||e.operatingBandwidth.mediaType===Ie?n.push(e.operatingBandwidth.mediaType):e.operatingBandwidth.mediaType===Re&&(n.push(Ie),n.push(Ae));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))}},reset:function(){u()},setConfig:function(e){e&&e.adapter&&(i=e.adapter)}},r=Object(f.a)(s).getInstance().getLogger(e),u(),e}Ne.__dashjs_factory_name="ServiceDescriptionController";var Ce=c.a.getSingletonFactory(Ne),De=n(22);var Oe=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||null,this.type=v.a.CONTENT_STEERING_TYPE,this.responseType="json"};var Me=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.version=null,this.ttl=300,this.reloadUri=null,this.serviceLocationPriority=[]},Pe="_DASH_throughput",Le="_DASH_pathway",xe="url";function Fe(){var e,t,n,r,i,s,u,c,h,g,p,m,E,v,_,T=this.context,b=Object(L.a)(T).getInstance();function S(e){e&&e.toStreamInfo&&(r=e.toStreamInfo)}function A(e){e&&e.request&&e.request.serviceLocation&&(i=e.request.serviceLocation)}function I(){var e=p.getValue();return _.getContentSteering(e)}function R(){return new Promise((function(e){try{var s=I();if(!s||!s.serverUrl)return void e();var l=function(e){var t=e.proxyServerUrl?e.proxyServerUrl:e.serverUrl;n&&n.reloadUri&&(t=b.isRelative(n.reloadUri)?b.resolve(n.reloadUri,e.serverUrl):n.reloadUri);var o=[];if(r){var s=_.getIsDynamic(),u=_.getAllMediaInfoForType(r,a.a.VIDEO).length>0?a.a.VIDEO:a.a.AUDIO,l=E.getThroughputHistory(),c=l?l.getAverageThroughput(u,s):NaN;isNaN(c)||o.push({key:Pe,value:1e3*c})}i&&o.push({key:Le,value:i});e.proxyServerUrl&&e.proxyServerUrl===t&&e.serverUrl&&o.push({key:xe,value:encodeURI(e.serverUrl)});return t=_e.a.addAditionalQueryParameterToUrl(t,o)}(s),c=new Oe(l);u.load({request:c,success:function(t){!function(e){if(!e||!e[o.a.CONTENT_STEERING_RESPONSE.VERSION]||1!==parseInt(e[o.a.CONTENT_STEERING_RESPONSE.VERSION]))return;(n=new Me).version=e[o.a.CONTENT_STEERING_RESPONSE.VERSION],e[o.a.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[o.a.CONTENT_STEERING_RESPONSE.TTL])&&(n.ttl=e[o.a.CONTENT_STEERING_RESPONSE.TTL]);e[o.a.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(n.reloadUri=e[o.a.CONTENT_STEERING_RESPONSE.RELOAD_URI]);e[o.a.CONTENT_STEERING_RESPONSE.SERVICE_LOCATION_PRIORITY]&&(n.serviceLocationPriority=e[o.a.CONTENT_STEERING_RESPONSE.SERVICE_LOCATION_PRIORITY]);w()}(t),v.trigger(d.a.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:n,url:l}),e()},error:function(n){!function(e){t.warn("Error fetching data from content steering server",e),w()}(n),e(n)}})}catch(t){e(t)}}))}function w(){n&&n.ttl&&!isNaN(n.ttl)&&(s&&clearTimeout(s),s=setTimeout((function(){R()}),1e3*n.ttl))}function N(){s&&clearTimeout(s),s=null}function C(){n=null,r=null,i=null,N()}return e={reset:function(){C(),v.off(d.a.PERIOD_SWITCH_COMPLETED,S,e),v.off(l.a.FRAGMENT_LOADING_STARTED,A,e)},setConfig:function(e){e&&(e.adapter&&(_=e.adapter),e.errHandler&&(c=e.errHandler),e.dashMetrics&&(h=e.dashMetrics),e.mediaPlayerModel&&(g=e.mediaPlayerModel),e.requestModifier&&(m=e.requestModifier),e.manifestModel&&(p=e.manifestModel),e.abrController&&(E=e.abrController),e.eventBus&&(v=e.eventBus))},loadSteeringData:R,getCurrentSteeringResponseData:function(){return n},shouldQueryBeforeStart:function(){var e=I();return e&&e.queryBeforeStart},getSteeringDataFromManifest:I,stopSteeringRequestTimer:N,initialize:function(){u=Object(De.a)(T).create({errHandler:c,dashMetrics:h,mediaPlayerModel:g,requestModifier:m,errors:y.a}),v.on(d.a.PERIOD_SWITCH_COMPLETED,S,e),v.on(l.a.FRAGMENT_LOADING_STARTED,A,e)}},t=Object(f.a)(T).getInstance().getLogger(e),C(),e}Fe.__dashjs_factory_name="ContentSteeringController";var ke=c.a.getSingletonFactory(Fe),Ue=n(30),Be=n.n(Ue),Ge=n(50);function je(){var e,t,n,r,i,o,s,c,d=this.context,h=Object(u.a)(d).getInstance();function g(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.a.TEXT&&!v(e,f)||i===a.a.TEXT&&e.isFragmented)&&h.trigger(l.a.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=e.lang===t.lang,a=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),s=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&o&&s&&u}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};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 b(e,t,n){var r=[];return e.forEach((function(e){t(n,e)&&r.push(e)})),0!==r.length?r:e}function S(e,t){return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&Object(Ge.extendedFilter)(t.lang,Be()(e.lang)).length>0}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.a.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){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 D(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 O(e){var t,n=0,r=[];return e.forEach((function(e){(t=e.representationCount)>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function M(e,n){if(e===a.a.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.a.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t=(n=e,r=0,i=[],n.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>r?(r=e.selectionPriority,i=[e]):e.selectionPriority===r&&i.push(e))})),i);var n,r,i;t.length>1&&(t=C(t));t.length>1&&(t=O(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=C(e);t.length>1&&(t=O(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_FIRST_TRACK:i=P(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=D(e);t.length>1&&(t=C(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=O(e);t.length>1&&(t=C(e));return t}(n);break;default:t.warn("Track selection mode ".concat(o," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=P(n)}return i.length>0?i[0]:n[0]}function P(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=o[e]||E(e),r=g(e,t.id),i=[];n||y(e,n=c.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&(i=b(i=Array.from(r),S,n),i=b(i,A,n),i=b(i,I,n),e===a.a.AUDIO&&o[e]||(i=b(i,R,n)),i=b(i,w,n),i=b(i,N,n)),0===i.length?m(M(e,r),!0):i.length>1?m(M(e,i,o[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((r=t)===a.a.AUDIO||r===a.a.VIDEO||r===a.a.TEXT||r===a.a.IMAGE){var r,i=e.streamInfo.id;n[i]||(n[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var o=n[i][t].list,s=0,u=o.length;s<u;++s)if(v(o[s],e))return;o.push(e)}}},getTracksFor:g,getCurrentTrackFor:p,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,r=e.streamInfo.id;return n[r]&&n[r][t]&&v(n[r][t].current,e)},setTrack:m,selectInitialTrack:M,setInitialSettings:y,getInitialSettings:E,getTracksWithHighestBitrate:C,getTracksWithHighestEfficiency:D,getTracksWithWidestRange:O,isTracksEqual:v,matchSettings:function(e,t){var n=arguments.length>2&&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=Be()(e.lang);i&&(r=Object(Ge.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.a.AUDIO&&n)&&l&&c}catch(e){return!1}},matchSettingsLang:S,matchSettingsIndex:A,matchSettingsViewPoint:I,matchSettingsRole:R,matchSettingsAccessibility:w,matchSettingsAudioChannelConfig:N,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(a.a.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(r=e.settings),e.customParametersModel&&(s=e.customParametersModel))},reset:_},t=Object(f.a)(d).getInstance().getLogger(e),_(),e}je.__dashjs_factory_name="MediaController";var Ye=c.a.getSingletonFactory(je);c.a.updateSingletonFactory(je.__dashjs_factory_name,Ye);var qe=Ye,He=n(46);var Ve=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||NaN},this.children=[]};function Ke(){var e,t,n,r=this.context,i=Object(He.a)(r).getInstance();function a(e,t,r){var a=n.getBaseURLsFromElement(r);e[t]?i.areEqual(a,e[t].data.baseUrls)||(e[t].data.baseUrls=a,e[t].data.selectedIdx=NaN):e[t]=new Ve(a)}function o(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);i.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=NaN),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){a(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){a(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){a(t.children[r].children[i].children,n,e)}))}))}))}function s(){t=new Ve}return e={reset:s,update:function(e){o(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){!function e(n,r){var i=r||t;n(i.data),i.children&&i.children.forEach((function(t){return e(n,t)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},s(),e}Ke.__dashjs_factory_name="BaseURLTreeModel";var ze=c.a.getClassFactory(Ke);function We(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.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t<e)}))),n[a]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}We.__dashjs_factory_name="DVBSelector";var Xe=c.a.getClassFactory(We);function Qe(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n,r=0;return e&&e.some((function(e,n){return r=n,!t.contains(e.serviceLocation)}))&&(n=e[r]),n}}}Qe.__dashjs_factory_name="BasicSelector";var Ze=c.a.getClassFactory(Qe);function $e(){var e,t,n,r=this.context;function i(){for(var e=arguments.length>0&&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};r<e.length;){var o=a();if("break"===o)break}return i}return e={selectBaseUrlIndex:function(e){var n=NaN;if(isNaN(e.selectedIdx)){var r=t.getSteeringDataFromManifest();r&&r.defaultServiceLocation&&(n=i([r.defaultServiceLocation],e.baseUrls))}var a=t.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&a&&a.serviceLocationPriority&&a.serviceLocationPriority.length&&(n=i(a.serviceLocationPriority,e.baseUrls)),n},setConfig:function(e){e.blacklistController&&(n=e.blacklistController),e.contentSteeringController&&(t=e.contentSteeringController)}},t=ke(r).getInstance(),e}$e.__dashjs_factory_name="ContentSteeringSelector";var Je=c.a.getClassFactory($e);function et(){var e,t,n,r,i,a,o=this.context,s=Object(u.a)(o).getInstance(),c=Object(E.a)(o).getInstance();function f(){t.reset()}return e={chooseSelector:function(e){Object(O.b)(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.a.URL_RESOLUTION_FAILED,{error:new m.a(y.a.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,y.a.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=J(o).create({updateEventName:l.a.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:l.a.SERVICE_LOCATION_BLACKLIST_ADD}),n=Ze(o).create({blacklistController:t}),r=Xe(o).create({blacklistController:t}),(i=Je(o).create()).setConfig({blacklistController:t}),a=n,e}et.__dashjs_factory_name="BaseURLSelector";var tt=c.a.getClassFactory(et),nt=n(41);function rt(){var e,t,n,r,i=this.context,a=Object(u.a)(i).getInstance(),o=Object(L.a)(i).getInstance();function s(e){n.invalidateSelectedIndexes(e.entry)}return e={reset:function(){n.reset(),r.reset()},initialize:function(e){var i;n.setConfig({adapter:t}),i=e,n.update(i),r.chooseSelector(t.getIsDVB(i))},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=r.select(t);return n?(o.isRelative(n.url)?e.url=o.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new nt.a}),new nt.a);if(!o.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(r=e.baseURLSelector),e.adapter&&(t=e.adapter)}},n=ze(i).create(),r=tt(i).create(),a.on(l.a.SERVICE_LOCATION_BLACKLIST_CHANGED,s,e),e}rt.__dashjs_factory_name="BaseURLController";var it=c.a.getClassFactory(rt),at=n(17);function ot(e){return(ot="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})(e)}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ut(e){var t=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}}();return function(){var n,r=ct(e);if(t){var i=ct(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return lt(this,n)}}function lt(e,t){return!t||"object"!==ot(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 ct(e){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ft=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&&st(e,t)}(n,e);var t=ut(n);function n(e,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(i=t.call(this)).url=e||null,i.type=r||null,i.mediaType=a.a.STREAM,i.responseType="",i}return n}(at.a);function dt(e){e=e||{};var t=this.context,n=Object(u.a)(t).getInstance(),r=Object(De.a)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:y.a});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(l.a.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new m.a(y.a.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,y.a.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var o=new ft(e,v.a.XLINK_EXPANSION_TYPE);r.load({request:o,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}dt.__dashjs_factory_name="XlinkLoader";var ht=c.a.getClassFactory(dt),gt=n(47);function pt(e){e=e||{};var t,n,r,i,a,s,c=this.context,f=Object(u.a)(c).getInstance(),d=Object(L.a)(c).getInstance();function h(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&p(a);for(var o=0;o<a.elements.length;o++)r=a.elements[o],i=d.isHTTPURL(r.url)?r.url:r.originalContent.BaseURL+r.url,s.load(i,r,a)}function g(e){var t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){var i=0;0===t.resolvedContent.indexOf("<?xml")&&(i=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,i)+"<response>"+t.resolvedContent.substr(i)+"</response>",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(n)&&p(n)}function p(e){var t,n,a=[];if(function(e){var t,n,a,o,s,u,l=[];for(o=e.elements.length-1;o>=0;o--){if(t=e.elements[o],n=t.type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(s=0;s<t.resolvedContent[n].length;s++)a=t.resolvedContent[n][s],l.push(a)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],l.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),u=0;u<l.length;u++)t.parentElement[n].splice(t.index+u,0,l[u]);l=[]}e.elements.length>0&&r.run(i)}(e),"onActuate"===e.resolveType&&f.trigger(l.a.XLINK_READY,{manifest:i}),"onLoad"===e.resolveType)switch(e.type){case o.a.PERIOD:for(t=0;t<i[o.a.PERIOD+"_asArray"].length;t++)(n=i[o.a.PERIOD+"_asArray"][t]).hasOwnProperty(o.a.ADAPTATION_SET+"_asArray")&&(a=a.concat(m(n[o.a.ADAPTATION_SET+"_asArray"],n,o.a.ADAPTATION_SET,"onLoad"))),n.hasOwnProperty(o.a.EVENT_STREAM+"_asArray")&&(a=a.concat(m(n[o.a.EVENT_STREAM+"_asArray"],n,o.a.EVENT_STREAM,"onLoad")));h(a,o.a.ADAPTATION_SET,"onLoad");break;case o.a.ADAPTATION_SET:f.trigger(l.a.XLINK_READY,{manifest:i})}}function m(e,t,n,r){var i,a,o,s=[];for(a=e.length-1;a>=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)(i=e[a]).hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(o=y(i["xlink:href"],t,n,a,r,i),s.push(o));return s}function y(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return t={resolveManifestOnLoad:function(e){a=new gt.a({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:n}),(i=e).Period_asArray?h(m(i.Period_asArray,i,o.a.PERIOD,"onLoad"),o.a.PERIOD,"onLoad"):f.trigger(l.a.XLINK_READY,{manifest:i})},setMatchers:function(e){e&&(n=e)},setIron:function(e){e&&(r=e)},reset:function(){f.off(l.a.XLINK_ELEMENT_LOADED,g,t),s&&(s.reset(),s=null)}},f.on(l.a.XLINK_ELEMENT_LOADED,g,t),s=ht(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}pt.__dashjs_factory_name="XlinkController";var mt=c.a.getClassFactory(pt),yt=n(67);function Et(e){e=e||{};var t,n,r,i,s,c=this.context,f=e.debug,d=e.settings,h=Object(u.a)(c).getInstance(),g=Object(L.a)(c).getInstance(),p=e.mssHandler,E=e.errHandler;function _(e){h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return t={load:function(e){var t=new ft(e,v.a.MPD_TYPE);r.load({request:t,success:function(t,r,o){var u,E,v;if(i)if(o&&o!==e?(E=g.parseBaseUrl(o),u=o):(g.isRelative(e)&&(e=g.resolve(e,window.location.href)),E=g.parseBaseUrl(e)),"No Content"!=r)if(null===s&&(s=function(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(p&&(t=p.createMssParser(),p.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(yt.a)(c).create({debug:f}):t}(t)),null!==s){i.setMatchers(s.getMatchers()),i.setIron(s.getIron());try{v=s.parse(t)}catch(t){return void h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new m.a(y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}if(v){if(v.url=u||e,v.originalUrl||(v.originalUrl=v.url),v.hasOwnProperty(a.a.LOCATION)&&(E=g.parseBaseUrl(v.Location_asArray[0]),n.debug("BaseURI set by Location to: "+E)),d&&d.get().streaming.enableManifestDurationMismatchFix&&v.mediaPresentationDuration&&v.Period_asArray.length>1){var _=v.Period_asArray.reduce((function(e,t){return e+t.duration}),0);!isNaN(_)&&v.mediaPresentationDuration>_&&(n.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),v.mediaPresentationDuration=_)}v.baseUri=E,v.loadedTime=new Date,i.resolveManifestOnLoad(v),h.trigger(l.a.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})}else h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new m.a(y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new m.a(y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,y.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){h.trigger(l.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new m.a(y.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,y.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){h.off(l.a.XLINK_READY,_,t),p&&p.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=f.getLogger(t),h.on(l.a.XLINK_READY,_,t),r=Object(De.a)(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:g,constants:a.a,dashConstants:o.a,errors:y.a,requestTimeout:e.settings.get().streaming.manifestRequestTimeout}),i=mt(c).create({errHandler:E,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),s=null,t}Et.__dashjs_factory_name="ManifestLoader";var vt=c.a.getClassFactory(Et);function _t(){var e=this.context,t=Object(u.a)(e).getInstance();return{error:function(e){t.trigger(l.a.ERROR,{error:e})}}}_t.__dashjs_factory_name="ErrorHandler";var Tt=c.a.getSingletonFactory(_t),bt=n(53);function St(){var e,t,n,r,i,o,s=this.context,c=Object(u.a)(s).getInstance();function d(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var s=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&s.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var s=[],u=[];e.Representation_asArray.forEach((function(i,o){var l=t.getCodec(e,o,!1),c=function(e,t,n){switch(e){case a.a.VIDEO:return function(e,t){var n=e.width||null,r=e.height||null,i=e.frameRate||null,a=e.bandwidth||null;return{codec:t,width:n,height:r,framerate:i,bitrate:a}}(t,n);case a.a.AUDIO:return function(e,t){var n=e.audioSamplingRate||null,r=e.bandwidth||null;return{codec:t,bitrate:r,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),s.push(n.supportsCodec(c,r))})),Promise.all(s).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||o.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(s).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||(c.trigger(l.a.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),o.warn("AdaptationSet has been removed because of no supported Representation")),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings),e.customParametersModel&&(i=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise((function(s){var u=[];u.push(d(a.a.VIDEO,e)),u.push(d(a.a.AUDIO,e)),Promise.all(u).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){if(!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i<r.length;){if(!n.supportsEssentialProperty(r[i]))return o.debug("[Stream] EssentialProperty not supported: "+r[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),function(e){var t=i.getCustomCapabilitiesFilters();if(!t||0===t.length||!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!t.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),s()})).catch((function(){s()}))}))}},o=Object(f.a)(s).getInstance().getLogger(e),e}St.__dashjs_factory_name="CapabilitiesFilter";var At=c.a.getSingletonFactory(St);var It=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function Rt(){var e;return{initialize:function(t){if(e=new It,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i<a;++i){var o=r[i],s=o.indexOf("=");if(-1!==s){var u=o.substring(0,s);e.hasOwnProperty(u)&&(e[u]=o.substr(s+1))}}},getURIFragmentData:function(){return e}}}Rt.__dashjs_factory_name="URIFragmentModel";var wt=c.a.getSingletonFactory(Rt);function Nt(){var e,t=this.context,n=Object(u.a)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&n.trigger(l.a.MANIFEST_LOADED,{data:t})}}}Nt.__dashjs_factory_name="ManifestModel";var Ct=c.a.getSingletonFactory(Nt);function Dt(){var e,t,n,r,i=this.context,a=Object(E.a)(i).getInstance();function o(e,n){return isNaN(e)?0:e>0?(n&&t.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e<-.5?(n&&t.warn("Supplied minimum playback rate is out of range and will be limited to ".concat(-.5,": ").concat(-50,"% playback speed.")),-.5):e}function s(e,n){return isNaN(e)?0:e<0?(n&&t.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e>1?(n&&t.warn("Supplied maximum playback rate is out of range and will be limited to ".concat(1,": ").concat(200,"% playback speed.")),1):e}function u(){var e=a.get().streaming.buffer.stableBufferTime>0?a.get().streaming.buffer.stableBufferTime:a.get().streaming.buffer.fastSwitchEnabled?20:12,t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}return e={getCatchupMaxDrift:function(){if(!isNaN(a.get().streaming.liveCatchup.maxDrift)&&a.get().streaming.liveCatchup.maxDrift>0)return a.get().streaming.liveCatchup.maxDrift;var e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==a.get().streaming.liveCatchup.enabled?a.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getStableBufferTime:u,getInitialBufferLevel:function(){var e=a.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(u(),e)},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryAttempts[e]*t:a.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(a.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:a.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getCatchupPlaybackRates:function(e){var t=a.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:o(t.min,e),max:s(t.max,e)};var n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){var i=n.liveCatchup.playbackRate;return{min:o(i.min,e),max:s(i.max,e)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(e,t){try{var n=a.get().streaming.abr[e][t];if(!isNaN(n)&&-1!==n)return n;var i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch(e){return-1}},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)},reset:function(){}},t=Object(f.a)(i).getInstance().getLogger(e),e}Dt.__dashjs_factory_name="MediaPlayerModel";var Ot=c.a.getSingletonFactory(Dt),Mt=n(27);function Pt(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}Pt.__dashjs_factory_name="RulesContext";var Lt=c.a.getClassFactory(Pt),xt=n(8);function Ft(){var e=[],t=[];return{push:function(n){n.newValue===xt.a.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,o=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:i,dropSize:a}),t.length>8){var s=t.shift();e[s.idx].drops-=s.drop,e[s.idx].dropSize-=s.dropSize,e[s.idx].noDrops-=s.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}Ft.__dashjs_factory_name="SwitchRequestHistory";var kt=c.a.getClassFactory(Ft);function Ut(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var o=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,s=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=o-t[r];t[r]=o;var l=s-n[r];n[r]=s;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}Ut.__dashjs_factory_name="DroppedFramesHistory";var Bt=c.a.getClassFactory(Ut);function Gt(e){var t,n,r,i,o,s=(e=e||{}).settings;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return s.get().streaming.abr.movingAverageMethod!==a.a.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var s=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),u=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,u):function(e,r,i){var a=function(e,r,i){var a,o;if(e?(a=t[r],o=i?3:4):(a=n[r],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s<o;++s){var u=a[a.length-s]/a[a.length-s-1];if((u>=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,r,i),o=(e?t:n)[r];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},n={},r={},i={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var d=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,g=l.trace.reduce((function(e,t){return e+t.b[0]}),0),p=0,m=0;if(0!==(p=l._fileLoaderType&&l._fileLoaderType===a.a.FILE_LOADER_TYPES.FETCH?l.trace.reduce((function(e,t){return e+t.d}),0):c?h:d+h)&&(m=Math.round(8*g/p)),f(e),function(e,t,n){return e===a.a.VIDEO?n<s.get().streaming.cacheLoadThresholds[a.a.VIDEO]:e===a.a.AUDIO?n<s.get().streaming.cacheLoadThresholds[a.a.AUDIO]:void 0}(e,0,h)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),n[e].push(d),n[e].length>20&&n[e].shift(),u(r[e],m,.001*h,o.throughputHalfLife),u(i[e],d,1,o.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var n=c(e,t);return isNaN(n)||(n*=s.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return l(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),h}Gt.__dashjs_factory_name="ThroughputHistory";var jt=c.a.getClassFactory(Gt);function Yt(){var e,t,n,r,i,o,c,h,g,m,y,E,_,T,b,S,A,I,R,w,N,C,D,M,P,L,x=this.context,F=Object(f.a)(x).getInstance(),k=Object(u.a)(x).getInstance();function U(){i={},o={},h={},c={},R={},C={},D={},M={},void 0===m&&(m=!1),w&&w.reset(),I=void 0,w=void 0,N=void 0,clearTimeout(g),g=null}function B(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&c[a]&&L.get().streaming.abr.autoSwitchBitrate[i]){var o=c[a][i];if(o){var u=Lt(x).create({abrController:e,streamProcessor:o,currentRequest:t.request,useBufferOccupancyABR:C[i],useL2AABR:D[i],useLoLPABR:M[i],videoModel:T}),l=n.shouldAbandonFragment(u,a);if(l.quality>xt.a.NO_CHANGE)o.getFragmentModel().getRequests({state:p.a.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h[a][i].state=s.a.ABANDON_LOAD,R[a][i].reset(),R[a][i].push({oldValue:H(i,a),newValue:l.quality,confidence:1,reason:l.reason}),V(i,r.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(g),g=setTimeout((function(){h[a][i].state=s.a.ALLOW_LOAD,g=null}),L.get().streaming.abandonLoadTimeout))}}}function G(e){e.mediaType===a.a.VIDEO&&(void 0!==I&&w.push(e.streamId,I,T.getPlaybackQuality()),I=e.newQuality)}function j(e){var n,r;e.metric!==s.a.HTTP_REQUEST||!e.value||e.value.type!==v.a.MEDIA_SEGMENT_TYPE||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||N.push(e.mediaType,e.value,L.get().streaming.abr.useDeadTimeLatency),e.metric!==s.a.BUFFER_LEVEL||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||(n=e.mediaType,r=.001*e.value.level,L.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_DYNAMIC&&function(e,n){try{var r=b.getStableBufferTime(),i=r,a=.5*r,o=C[e],s=n>(o?a:i);C[e]=s,s!==o&&(s?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}catch(e){t.error(e)}}(n,r))}function Y(e,t){try{return i[t]=i[t]||{},i[t].hasOwnProperty(e)||(i[t][e]=0),function(e,t,n){if(t!==a.a.VIDEO||!L.get().streaming.abr.limitBitrateByPortal||!c[n]||!c[n][t])return e;m||Q();var r=c[n][t].getStreamInfo(),i=_.getAdaptationForType(r.index,t,r).Representation_asArray,o=e;if(y>0&&E>0){for(;o>0&&i[o]&&y<i[o].width&&y-i[o-1].width<i[o].width-y;)o-=1;for(;o<i.length-1&&i[o].width===i[o+1].width;)o+=1}return o}(function(e,t,n){var r=i[n][t],a=L.get().streaming.abr.maxRepresentationRatio[t];if(isNaN(a)||a>=1||a<0)return e;return Math.min(e,Math.round(r*a))}(function(e,t){var n=i[t][e],r=n;if(!c[t]||!c[t][e])return r;var a=q(e,t);void 0!==a&&(r=Math.max(n,a));var o=function(e,t){try{var n=b.getAbrBitrateParameter("maxBitrate",e);return n>-1?z(c[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);void 0!==o&&(r=Math.min(r,o));return r}(e,t),e,t),e,t)}catch(e){return}}function q(e,t){try{return function(e,t){try{var n=b.getAbrBitrateParameter("minBitrate",e);if(n>-1){var r=c[t][e].getMediaInfo(),i=X(r),a=z(r,n,t);return i[a]&&a<i.length-1&&i[a].bitrate<1e3*n&&a++,a}return}catch(e){return}}(e,t)}catch(e){return}}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{if(t||(t=r.getActiveStreamInfo().id),e&&c[t]&&c[t][e])if(t)return o[t]=o[t]||{},o[t].hasOwnProperty(e)||(o[t][e]=0),o[t][e];return 0}catch(e){return 0}}function V(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=H(e,i);Object(O.a)(n);var o=Y(e,i);n!==a&&n>=0&&n<=o&&K(e,a,n,o,r,i)}}function K(e,n,r,i,a,s){if(e&&c[s]&&c[s][e]){var u=c[s][e].getStreamInfo(),f=u&&u.manifestInfo&&u.manifestInfo.isDynamic,d=P.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+d+") "+(a?JSON.stringify(a):".")),o[s]=o[s]||{},o[s][e]=r;var h=function(e,t,n){if(t&&c&&c[e]&&c[e][t]){var r=X(c[e][t].getMediaInfo());return r[n]?r[n]:null}return null}(s,e,r);k.trigger(l.a.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:u,bitrateInfo:h,maxIdx:i,mediaType:e},{streamId:u.id,mediaType:e});var g=N.getAverageThroughput(e,f);isNaN(g)||A.setSavedBitrateSettings(e,g)}}function z(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?c[n][e.type].getRepresentationInfo():null;if(L.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;var o=r/a;t*=1-o}for(var s=X(e),u=s.length-1;u>=0;u--){var l=s[u];if(1e3*t>=l.bitrate)return u}return 0}function X(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a<o;a++)(n=new W).mediaType=i,n.qualityIndex=a,n.bitrate=r[a].bandwidth,n.width=r[a].width,n.height=r[a].height,n.scanType=r[a].scanType,t.push(n);return t}function Q(){if(T){var e=L.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;y=T.getClientWidth()*e,E=T.getClientHeight()*e}}return e={initialize:function(){w=Bt(x).create(),N=jt(x).create({settings:L}),(n=Object(Mt.a)(x).create({dashMetrics:P,customParametersModel:S,mediaPlayerModel:b,settings:L})).initialize(),k.on(d.a.QUALITY_CHANGE_RENDERED,G,e),k.on(d.a.METRIC_ADDED,j,e),k.on(l.a.LOADING_PROGRESS,B,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=H(a.a.AUDIO,t),r=H(a.a.VIDEO,t);return n===Y(a.a.AUDIO,t)&&r===Y(a.a.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return i[n]=i[n]||{},i[n][t]=r,r},clearDataForStream:function(e){w&&w.clearForStream(e),c[e]&&delete c[e],R[e]&&delete R[e],h[e]&&delete h[e]},getThroughputHistory:function(){return N},getBitrateList:X,getQualityForBitrate:z,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&c&&c[t]&&c[t][e]){var n=Y(e,t),i=X(c[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:q,getMaxAllowedIndexFor:Y,getInitialBitrateFor:function(e,t){if(function(){if(!A||!A.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.a.MISSING_CONFIG_ERROR)}(),e===a.a.TEXT)return NaN;var n=A.getSavedBitrateSettings(e),r=b.getAbrBitrateParameter("initialBitrate",e),i=L.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var o=c[t][e].getStreamInfo(),s=_.getAdaptationForType(o.index,e,o).Representation_asArray;if(Array.isArray(s))r=s[Math.max(Math.round(s.length*i)-1,0)].bandwidth/1e3;else r=0}else r=isNaN(n)?e===a.a.VIDEO?1e3:100:n;return r},getQualityFor:H,getAbandonmentStateFor:function(e,t){return h[e]&&h[e][t]?h[e][t].state:null},setPlaybackQuality:V,checkPlaybackQuality:function(t,r){try{if(!(t&&c&&c[r]&&c[r][t]))return!1;if(w){var i=T.getPlaybackQuality();i&&w.push(r,I,i)}if(!L.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=H(t,r),o=Lt(x).create({abrController:e,switchHistory:R[r][t],droppedFramesHistory:w,streamProcessor:c[r][t],currentValue:a,useBufferOccupancyABR:C[t],useL2AABR:D[t],useLoLPABR:M[t],videoModel:T}),u=q(t,r),l=Y(t,r),f=n.getMaxQuality(o),d=f.quality;return void 0!==u&&(d>xt.a.NO_CHANGE?d:a)<u&&(d=u),d>l&&(d=l),R[r][t].push({oldValue:a,newValue:d}),d>xt.a.NO_CHANGE&&d!==a&&(h[r][t].state===s.a.ALLOW_LOAD||d<a)&&(K(t,a,d,l,f.reason,r),!0)}catch(e){return!1}},setElementSize:Q,setWindowResizeEventCalled:function(e){m=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;c[n]||(c[n]={}),R[n]||(R[n]={}),h[n]||(h[n]={}),R[n][e]=kt(x).create(),c[n][e]=t,h[n][e]={},h[n][e].state=s.a.ALLOW_LOAD,function(e){var t=L.get().streaming.abr.ABRStrategy;t===a.a.ABR_STRATEGY_L2A?(C[e]=!1,M[e]=!1,D[e]=!0):t===a.a.ABR_STRATEGY_LoLP?(C[e]=!1,M[e]=!0,D[e]=!1):t===a.a.ABR_STRATEGY_BOLA?(C[e]=!0,M[e]=!1,D[e]=!1):t===a.a.ABR_STRATEGY_THROUGHPUT?(C[e]=!1,M[e]=!1,D[e]=!1):t===a.a.ABR_STRATEGY_DYNAMIC&&(C[e]=!(!C||!C[e])&&C[e],M[e]=!1,D[e]=!1)}(e),e===a.a.VIDEO&&Q()},unRegisterStreamType:function(e,t){try{c[e]&&c[e][t]&&delete c[e][t],R[e]&&R[e][t]&&delete R[e][t],h[e]&&h[e][t]&&delete h[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.domStorage&&(A=e.domStorage),e.mediaPlayerModel&&(b=e.mediaPlayerModel),e.customParametersModel&&(S=e.customParametersModel),e.dashMetrics&&(P=e.dashMetrics),e.adapter&&(_=e.adapter),e.videoModel&&(T=e.videoModel),e.settings&&(L=e.settings))},reset:function(){U(),k.off(l.a.LOADING_PROGRESS,B,e),k.off(d.a.QUALITY_CHANGE_RENDERED,G,e),k.off(d.a.METRIC_ADDED,j,e),n&&n.reset()}},t=F.getLogger(e),U(),e}Yt.__dashjs_factory_name="AbrController";var qt=c.a.getSingletonFactory(Yt);qt.QUALITY_DEFAULT=0,c.a.updateSingletonFactory(Yt.__dashjs_factory_name,qt);var Ht=qt,Vt=n(48),Kt=new Map([[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function zt(){var e,t,n,r,i,o=this.context,s=Object(u.a)(o).getInstance(),c=[];function d(){n&&(n.playbackRate=1,n.removeEventListener("canplay",d))}function h(){return c.length>0}function g(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function p(e,t){n&&n.addEventListener(e,t)}function m(e,t){n&&n.removeEventListener(e,t)}function y(){return n?n.readyState:NaN}function E(){return n?n.buffered:null}function v(e,t,r,i,a){if(n)for(var o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}function _(e,t){e===a.a.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||y()>=e?t():function(e,t){p(e,(function n(){m(e,n),t(e)}))}(Kt.get(e),t)}return e={initialize:function(){s.on(l.a.PLAYBACK_PLAYING,g,this)},setCurrentTime:function(e,t){r=e,_(a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n){if(n.currentTime===r)return void(r=NaN);try{r=t?function(e){var t=E(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),o=t.end(i),s=Math.abs(a-e),u=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),u<r&&(r=u,n=o)}return n}(r):r,n.currentTime=r,r=NaN}catch(e){0===n.readyState&&e.code===e.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=r,r=NaN}),400)}}}))},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&s.trigger(l.a.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:h,isSeeking:function(){return n?n.seeking||!isNaN(r):null},getTime:function(){return n?isNaN(r)?n.currentTime:r:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n&&(!t&&n.readyState<=2&&e>0?n.addEventListener("canplay",d):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){if(null===e||!n||n.seeking||-1!==c.indexOf(e))return;c.push(e)}(e):function(e){var t=c.indexOf(e);if(null===e)return;-1!==t&&c.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return i},setTTMLRenderingDiv:function(e){(i=e).style.position="absolute",i.style.display="flex",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.top=0,i.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:p,removeEventListener:m,getReadyState:y,getBufferRange:E,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:v,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=v(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},waitForReadyState:_,reset:function(){s.off(l.a.PLAYBACK_PLAYING,g,this)}},t=Object(f.a)(o).getInstance().getLogger(e),r=NaN,e}zt.__dashjs_factory_name="VideoModel";var Wt=c.a.getSingletonFactory(zt),Xt=n(44),Qt=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}];function Zt(e){e=e||{};var t,n,r,i=this.context,o=e.settings;function s(e){if(void 0!==r)return r;r=!1;var t;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function u(){return 6e5*Math.round((new Date).getTime()/6e5)}function l(e,t){return s(e)&&o.get().streaming[t+"CachingInfo"].enabled}function c(){if(!o)throw new Error(a.a.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){if(c(),!o.get().streaming.lastBitrateCachingInfo.enabled)return NaN;var t=NaN;if(l("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=o.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(l("localStorage","lastBitrate")&&t){var r="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){if(c(),!o.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;var t=null;if(l("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=o.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(l("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:u()}))}catch(e){n.error(e.message)}}}},n=Object(f.a)(i).getInstance().getLogger(t),s("localStorage")&&Qt.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}Zt.__dashjs_factory_name="DOMStorage";var $t=c.a.getSingletonFactory(Zt),Jt=n(59),en=n(33);function tn(){var e,t,n,r,i,a,o,s,u,l,c,f,d,h=this.context;function g(e,t,n){n({segments:e,representation:t,error:e?void 0:new m.a(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function p(e){if(e.url){var t=new at.a;return t.setInfo(e),t}}return e={setConfig:function(s){s.baseURLController&&(d=s.baseURLController),s.dashMetrics&&(a=s.dashMetrics),s.mediaPlayerModel&&(o=s.mediaPlayerModel),s.errHandler&&(n=s.errHandler),s.boxParser&&(r=s.boxParser),s.debug&&(t=s.debug.getLogger(e)),s.requestModifier&&(i=s.requestModifier),s.errors&&(u=s.errors),s.urlUtils&&(f=s.urlUtils),s.constants&&(l=s.constants),s.dashConstants&&(c=s.dashConstants)},initialize:function(){s=Object(De.a)(h).create({errHandler:n,dashMetrics:a,mediaPlayerModel:o,requestModifier:i,boxParser:r,errors:u,urlUtils:f,constants:l,dashConstants:c})},loadInitialization:function(e,n){return new Promise((function(i){!function e(n,i,a,o){var u=null,l=n?d.resolve(n.path):null,c=o||{init:!0,url:l?l.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:i};t.debug("Start searching for initialization.");var f=p(c),h=function(t){if(c.bytesLoaded=c.range.end,!(u=r.findInitRange(t)))return c.range.end=c.bytesLoaded+c.bytesToLoad,e(n,i,a,c);n.range=u,a(n)};s.load({request:f,success:h,error:function(){a(n)}}),t.debug("Perform init search: "+c.url)}(e,n,i)}))},loadSegments:function(e,n,i){return new Promise((function(a){!function e(n,i,a,o,u,l){if(a&&(void 0===a.start||void 0===a.end)){var c=a?a.toString().split("-"):null;a=c?{start:parseFloat(c[0]),end:parseFloat(c[1])}:null}u=u||g;var f=null,h=null,m=!!a,y=n?d.resolve(n.path):null,E={init:!1,url:y?y.url:void 0,range:m?a:{start:0,end:1500},searching:!m,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:i},v=p(E),_=function(a){var s=E.bytesToLoad,l=a.byteLength;if(E.bytesLoaded=E.range.end-E.range.start,f=r.parse(a),(h=f.getBox("sidx"))&&h.isComplete){var c,d,g=h.references;if(null!=g&&g.length>0&&(c=1===g[0].reference_type),c){var p,m,y,v;t.debug("Initiate multiple SIDX load."),E.range.end=E.range.start+h.size;var _=[],T=0,b=(h.offset||E.range.start)+h.size,S=function(e){e?(_=_.concat(e),++T>=m&&(_.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),u(_,n,o))):u(null,n,o)};for(p=0,m=g.length;p<m;p++)y=b,v=b+g[p].referenced_size-1,b+=g[p].referenced_size,e(n,i,{start:y,end:v},o,S,E)}else t.debug("Parsing segments from SIDX. representation "+i+" - id: "+n.id+" for range : "+E.range.start+" - "+E.range.end),d=function(e,t){for(var n,r,i,a,o=e.references,s=o.length,u=e.timescale,l=e.earliest_presentation_time,c=t.range.start+e.offset+e.first_offset+e.size,f=[],d=0;d<s;d++)i=o[d].subsegment_duration,a=o[d].referenced_size,(n=new en.a).duration=i,n.startTime=l,n.timescale=u,r=c+a-1,n.mediaRange=c+"-"+r,f.push(n),l+=i,c+=a;return f}(h,E),u(d,n,o)}else{if(h)E.range.start=h.offset||E.range.start,E.range.end=E.range.start+(h.size||s);else{if(l<E.bytesLoaded)return void u(null,n,o);var A=f.getLastBox();A&&A.size?(E.range.start=A.offset+A.size,E.range.end=E.range.start+s):E.range.end+=s}e(n,i,E.range,o,null,E)}};s.load({request:v,success:_,error:function(){u(null,n,o)}}),t.debug("Perform SIDX load for type ".concat(i," : ").concat(E.url," with range ").concat(E.range.start," - ").concat(E.range.end))}(e,n,i,a)}))},reset:function(){s&&(s.abort(),s=null)}}}tn.__dashjs_factory_name="SegmentBaseLoader";var nn=c.a.getSingletonFactory(tn);function rn(e){var t;e=e||{};var n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u<a;u+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n,o=i(e,t);return o&&(n=a(),r+=n),o},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}}}rn.__dashjs_factory_name="EBMLParser";var an=c.a.getClassFactory(rn);function on(){var e,t,n,r,i,o,s,u,l,c,f=this.context;function d(e,r,i,a){var o,s,u,l,c,d,h,g;for(u=[],c=0,d=(s=function(e){var t,r,i=[],a=an(f).create({data:e});for(a.consumeTagAndSize(n.Segment.Cues);a.moreData()&&a.consumeTagAndSize(n.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=a.parseTag(n.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];a.moreData()&&a.consumeTag(n.Segment.Cues.CuePoint.CueTrackPositions,!0);){var o=a.getMatroskaCodedNum(),s=a.getPos();if((r={}).Track=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===r.Track)throw new Error("Cue track cannot be 0");r.ClusterPosition=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(r),a.setPos(s+o)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(t)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e)).length;c<d;c+=1)l=new en.a,o=0,o=c<s.length-1?s[c+1].CueTime-s[c].CueTime:a-s[c].CueTime,l.duration=o,l.startTime=s[c].CueTime,l.timescale=1e3,h=s[c].CueTracks[0].ClusterPosition+r,g=c<s.length-1?s[c+1].CueTracks[0].ClusterPosition+r-1:i-1,l.mediaRange=h+"-"+g,u.push(l);return t.debug("Parsed cues: "+u.length+" cues."),u}function h(e){var t=new at.a;return t.setInfo(e),t}return e={setConfig:function(n){if(!(n.baseURLController&&n.dashMetrics&&n.mediaPlayerModel&&n.errHandler))throw new Error(a.a.MISSING_CONFIG_ERROR);c=n.baseURLController,o=n.dashMetrics,s=n.mediaPlayerModel,r=n.errHandler,l=n.errors,t=n.debug.getLogger(e),i=n.requestModifier},initialize:function(){u=Object(De.a)(f).create({errHandler:r,dashMetrics:o,mediaPlayerModel:s,requestModifier:i,errors:l})},loadInitialization:function(e,n){return new Promise((function(r){var i=null,a=e?c.resolve(e.path):null,o=e?e.range.split("-"):null,s={range:{start:o?parseFloat(o[0]):null,end:o?parseFloat(o[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:n};t.info("Start loading initialization."),i=h(s);u.load({request:i,success:function(){r(e)},error:function(){r(e)}}),t.debug("Perform init load: "+s.url)}))},loadSegments:function(e,r,i){return new Promise((function(a){var o=null,s=e?c.resolve(e.path):null,g=s?s.url:void 0;o=h({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:o,url:g,init:!1,mediaType:r}),t.debug("Parsing ebml header");u.load({request:o,success:function(r){!function(e,r,i,a){if(e&&0!==e.byteLength){var o,s,l,c,g=an(f).create({data:e}),p=i?i.split("-"):null,m=null,y={url:r,range:{start:p?parseFloat(p[0]):null,end:p?parseFloat(p[1]):null},request:m};for(t.debug("Parse EBML header: "+y.url),g.skipOverElement(n.EBML),g.consumeTag(n.Segment),l=g.getMatroskaCodedNum(),l+=g.getPos(),c=g.getPos();g.moreData()&&!g.consumeTagAndSize(n.Segment.Info,!0);)if(!(g.skipOverElement(n.Segment.SeekHead,!0)||g.skipOverElement(n.Segment.Tracks,!0)||g.skipOverElement(n.Segment.Cues,!0)||g.skipOverElement(n.Void,!0)))throw new Error("no valid top level element found");for(;void 0===o;){var E=g.getMatroskaCodedNum(!0),v=g.getMatroskaCodedNum();switch(E){case n.Segment.Info.Duration.tag:o=g[n.Segment.Info.Duration.parse](v);break;default:g.setPos(g.getPos()+v)}}m=h(y);u.load({request:m,success:function(e){s=d(e,c,l,o),a(s)},error:function(){t.error("Download Error: Cues "+y.url),a(null)}}),t.debug("Perform cues load: "+y.url+" bytes="+y.range.start+"-"+y.range.end)}else a(null)}(r,g,i,(function(t){a({segments:t,representation:e,error:t?void 0:new m.a(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){a({representation:e,error:new m.a(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){u&&(u.abort(),u=null)}},n={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}on.__dashjs_factory_name="WebmSegmentBaseLoader";var sn=c.a.getSingletonFactory(on);function un(e){e=e||{};var t,n,r,i=this.context,a=e.eventBus,o=e.events,s=e.dashMetrics,u=e.mediaPlayerModel,l=e.errHandler,c=e.baseURLController,f=e.debug,d=e.boxParser,h=e.requestModifier,g=e.errors;function p(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){n.initialize(),r.initialize()},getSegmentBaseInitSegment:function(e){return p(e.representation.mimeType)?r.loadInitialization(e.representation,e.mediaType):n.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return p(e.mimeType)?r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){n.reset(),r.reset()}},n=nn(i).getInstance(),r=sn(i).getInstance(),n.setConfig({baseURLController:c,dashMetrics:s,mediaPlayerModel:u,errHandler:l,eventBus:a,events:o,errors:g,debug:f,boxParser:d,requestModifier:h}),r.setConfig({baseURLController:c,dashMetrics:s,mediaPlayerModel:u,errHandler:l,eventBus:a,events:o,errors:g,debug:f,requestModifier:h}),t}un.__dashjs_factory_name="SegmentBaseController";var ln=c.a.getSingletonFactory(un);var cn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null};var fn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1,this.supplementalProperties={}};var dn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0};var hn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null},gn=n(45),pn=n(34);function mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var yn=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}var t,n,r;return t=e,(n=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var o=this.path[i];if(a=o.name,i!==this.path.length-1||!a.startsWith("@")){var s=n[a+"_asArray"]||[];0===s.length&&n[a]&&s.push(n[a]),o.position?r=s[o.position]||null:o.attribute?function(){var e=o.attribute;r=s.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=s[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}])&&mn(t.prototype,n),r&&mn(t,r),e}();function En(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var vn=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}var t,n,r;return t=e,(n=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&En(t.prototype,n),r&&En(t,r),e}();function _n(){var e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(o.a.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(o.a.PUBLISH_TIME)?new Date(e[o.a.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(o.a.ORIGINAL_PUBLISH_TIME)?new Date(e[o.a.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[o.a.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: ".concat(n)),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(r.type,"=").concat(r.__text)),null;i="".concat(i,"/").concat(r.type)}var a=new yn(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: ".concat(n," - ").concat(i)),null;var o=null;a.findsAttribute()?o=r.__text||"":"remove"!==n&&(o=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var s=new vn(n,a,o);return"add"===n&&(s.position=r.pos),s})).filter((function(e){return!!e})):[]}},t=Object(f.a)(n).getInstance().getLogger(e),e}_n.__dashjs_factory_name="PatchManifestModel";var Tn=c.a.getSingletonFactory(_n);function bn(){var e,t,n,r,i,a,s,u=this.context;function l(e,n,a){var s,u=t.getAdaptationsForType(r[0].mpd.manifest,e,n);if(!u||0===u.length)return null;if(u.length>1&&a){var l=d(a,n);if(i[a.id]&&i[a.id][n])for(var f=0,h=u.length;f<h;f++)if(c(i[a.id][n],l[f]))return u[f];for(var g=0,p=u.length;g<p;g++)if(s=u[g],t.getRolesForAdaptation(s).filter((function(e){return e.value===o.a.MAIN}))[0])return u[g]}return u[0]}function c(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.codec===t.codec,i=e.viewpoint===t.viewpoint,a=e.lang===t.lang,o=e.roles.toString()===t.roles.toString(),s=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s&&u}function f(e,n,r,i,o,s){var u,l,c,f,d,h,g=[];if(!i||0===i.length)return[];var p=t.getAdaptationsForPeriod(n);for(f=0,h=i.length;f<h;f++)if(u=i[f],l=v(p[c=t.getIndexForAdaptation(u,e,r.index)]),s){var m=l.accessibility.length;for(d=0;d<m;d++)if(l){var y=l.accessibility[d];if(0===y.indexOf("cea-608:")){var E=y.substring(8).split(";");if("CC"===E[0].substring(0,2))for(d=0;d<E.length;d++)l||(l=v.call(this,p[c])),_(l,E[d].substring(0,3),E[d].substring(4)),g.push(l),l=null;else for(d=0;d<E.length;d++)l||(l=v.call(this,p[c])),_(l,"CC"+(d+1),E[d]),g.push(l),l=null}else 0===y.indexOf("cea-608")&&(_(l,a.CC1,"eng"),g.push(l),l=null)}}else o===a.IMAGE?(l.type=a.IMAGE,g.push(l),l=null):l&&g.push(l);return g}function d(e,n,i){var o=r,s=i,u=[];if(s)b(),o=h(s);else{if(!(r.length>0))return u;s=r[0].mpd.manifest}var l=E(e,o),c=t.getAdaptationsForType(s,e?e.index:null,n);return u=f(s,l,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(s,e?e.index:null,a.VIDEO),u=u.concat(f(s,l,e,c,n,!0))),u}function h(e){var n=g(e);return t.getRegularPeriods(n)}function g(e){var n=m(e);return t.getMpd(n)}function p(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=E(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function E(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function v(e){if(!e)return null;var n,r=new fn,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=T(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==s&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection){var a=r.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(a.length){var o=a[0];r.contentProtection.forEach((function(e){e.keyId=o}))}}return r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function _(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=Be()(n),e.roles=["caption"]}function T(e){var n,r,i=new dn;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new hn).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function b(){if(!a)throw new Error("setConfig function has to be called previously")}function S(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function A(e,t,n){var r,i,a,o,s;if(e)for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)for(a=r[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(i=a[s]).id)return n?s:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=A(S(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=A(e,t,!0);return null!==n?n:-1}(S(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i,a,o;if(!e||!n)return-1;for(i=e.AdaptationSet_asArray,o=0;o<i.length;o+=1)if(r=i[o],a=r.Representation_asArray,t.getIsTypeOf(r,n))return a.length;return-1}(S(n),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var n=new cn,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(i),n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=v(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(b(),i=h(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a<t;a++)n.push(T(i[a]))}return n},getMediaInfoForType:function(e,n){if(0===r.length||!e)return null;var i=E(e,r);if(!i)return null;var a=t.getAdaptationsForPeriod(i),o=l(e.index,n,e);return o?v(a[t.getIndexForAdaptation(o,r[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:d,getAdaptationForType:l,getRealAdaptation:function(e,n){var i,a,o=E(e,r);return i=n?n.id:null,r.length>0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a},getProducerReferenceTimes:function(e,n){var i,a,o=E(e,r);return i=n?n.id:null,r.length>0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a?t.getProducerReferenceTimesForAdaptation(a):[]},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n,i){var a=[];if(r.length>0){var o=r[0].mpd.manifest;if(e instanceof dn){var s=E(e,r);a=t.getEventsForPeriod(s)}else if(e instanceof fn){var u=E(i,r);a=t.getEventStreamForAdaptationSet(o,y(e),u)}else if(e instanceof cn){var l=E(i,r);a=t.getEventStreamForRepresentation(o,n,l)}}return a},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o,s=new gn.a,u=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/u;o=0===e.version?l+n-f+d:l-f+d;var h=e.event_duration/u,g=e.id,p=e.message_data;return s.eventStream=c,s.eventStream.value=a,s.eventStream.timescale=u,s.duration=h,s.id=g,s.calculatedPresentationTime=o,s.messageData=p,s.presentationTimeDelta=d,s}catch(e){return null}},getMpd:g,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(s=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;b(),r=h(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=g(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:h,getContentSteering:function(e){return t.getContentSteering(e)},getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()<s.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var o=(i[r+"_asArray"]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=o)){var u=i[r+"_asArray"];u.splice(o,1),u.length>1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:p},t=Object(pn.a)(u).getInstance(),n=Tn(u).getInstance(),p(),e}bn.__dashjs_factory_name="DashAdapter";var Sn=c.a.getSingletonFactory(bn);function An(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var In=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"round10",value:function(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}],(n=null)&&An(t.prototype,n),r&&An(t,r),e}();var Rn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]};var wn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null};var Nn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null};var Cn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=s.a.BUFFER_EMPTY};var Dn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null};var On=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null};function Mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pn=function e(){Mn(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},Ln=function e(){Mn(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},xn=function e(){Mn(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null};var Fn=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.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null};var kn=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]};function Un(e){var t,n,r=(e=e||{}).settings,i=this.context,o=Object(u.a)(i).getInstance();function c(){o.trigger(l.a.METRICS_CHANGED)}function f(e){o.trigger(l.a.METRIC_CHANGED,{mediaType:e}),c()}function d(e,t,n){o.trigger(l.a.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),f(e)}function h(e,t,n){o.trigger(l.a.METRIC_ADDED,{mediaType:e,metric:t,value:n}),f(e)}function g(e,t){var r=null;return e?(n.hasOwnProperty(e)?r=n[e]:t||(r=new Rn,n[e]=r),r):r}function p(e,t,n){var i=g(e);null!==i&&(i[t].push(n),i[t].length>r.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){p(e,t,n),h(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],f(e)},clearAllCurrentMetrics:function(){n={},c()},getMetricsFor:g,addHttpRequest:function e(t,n,r,i,a,o,u,l,c,f,d,h,g,p,y,E){var _=new v.a;o&&o!==i&&(e(t,null,r,i,a,null,null,l,c,null,null,null,g,null,null,E),_.actualurl=o),_.tcpid=n,_.type=r,_.url=i,_.range=l,_.trequest=c,_.tresponse=f,_.responsecode=h,_._tfinish=d,_._stream=t,_._mediaduration=g,_._quality=a,_._responseHeaders=p,_._serviceLocation=u,_._fileLoaderType=E,y?y.forEach((function(e){!function(e,t,n,r){var i=new v.b;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(_,e.s,e.d,e.b)})):(delete _.interval,delete _.trace),m(t,s.a.HTTP_REQUEST,_)},addRepresentationSwitch:function(e,t,n,r,i){var a=new wn;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,s.a.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new Nn;r.t=t,r.level=n,m(e,s.a.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new Cn;r.target=n,r.state=t,m(e,s.a.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new Dn;i.time=t,i.range=r,i.manifestInfo=n,m(e,s.a.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new On,r=g(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,s.a.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,u,l){var c=new Fn;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=o,c.range=u,c.state=l,m(e,s.a.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new kn;r.loadingRequests=t,r.executedRequests=n,g(e).RequestsQueue=r,h(e,s.a.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,o,u,l,c,f){var d=new Pn;d.mediaType=e,d.type=t,d.requestTime=n,d.fetchTime=r,d.availabilityStartTime=i,d.presentationStartTime=o,d.clientTimeOffset=u,d.currentTime=l,d.buffered=c,d.latency=f,p(a.a.STREAM,s.a.MANIFEST_UPDATE,d),h(e,s.a.MANIFEST_UPDATE,d)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];d(e.mediaType,s.a.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new Ln;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),d(e.mediaType,s.a.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,u){if(e&&e.representationInfo){var l=new xn;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=u,l.presentationTimeOffset=a,e.representationInfo.push(l),d(e.mediaType,s.a.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.a.STREAM,s.a.PLAY_LIST,e)},addDVBErrors:function(e){m(a.a.STREAM,s.a.DVB_ERRORS,e)}},n={},t}Un.__dashjs_factory_name="MetricsModel";var Bn=c.a.getSingletonFactory(Un);function Gn(e){e=e||{};var t,n,r,i,o=this.context,u=e.metricsModel;function l(e){var t=u.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=u.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function f(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return f(u.getMetricsFor(e,!0),s.a.TRACK_SWITCH)},getCurrentBufferState:function(e){return f(u.getMetricsFor(e,!0),s.a.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=f(u.getMetricsFor(e,!0),s.a.BUFFER_LEVEL);return t?In.round10(t.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:c,getCurrentDroppedFrames:function(){return f(u.getMetricsFor(a.a.VIDEO,!0),s.a.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return f(u.getMetricsFor(e,!0),s.a.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return f(e?u.getMetricsFor(e,!0):u.getMetricsFor(a.a.VIDEO,!0)||u.getMetricsFor(a.a.AUDIO,!0),s.a.DVR_INFO)},getCurrentManifestUpdate:function(){return f(u.getMetricsFor(a.a.STREAM),s.a.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=l(e);r&&(n=_e.a.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.a.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===v.a.MPD_TYPE){i=_e.a.parseHttpHeaders(n._responseHeaders);break}var o=i[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){u.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){u.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();u.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();u.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();u.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){u.addManifestUpdate(a.a.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){u.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i,e.fileLoaderType)},addSchedulingInfo:function(e,t){u.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){u.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){u.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){u.addBufferState(e,t,n)},addDroppedFrames:function(e){u.addDroppedFrames(a.a.VIDEO,e)},addPlayList:function(){i&&(u.addPlayList(i),i=null)},addDVBErrors:function(e){u.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new k).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new U).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,o=e.getTime()-a.getTime();r.duration=o,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){u.clearAllCurrentMetrics()}},u=u||Bn(o).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}Gn.__dashjs_factory_name="DashMetrics";var jn=c.a.getSingletonFactory(Gn);function Yn(){var e,t,n,r,i=this.context,s=Object(u.a)(i).getInstance(),c=Object(E.a)(i).getInstance();function f(e){r=e}function h(e,t,n,r){var i,a=t.adaptation.period.mpd,o=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var s=t.availabilityTimeOffset;i=new Date(o.getTime()+1e3*(e-s))}else i=o;return i}function g(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function p(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=g(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),s=r.getMediaInfoForType(e.getStreamInfo(),a.a.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.a.AUDIO),u=r.getVoRepresentations(s)[0],l={start:NaN,end:NaN};if(u)if(u.segmentInfoType===o.a.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],s=t.getRepresentationFor(e.index,o),u=s.SegmentTemplate.SegmentTimeline,l=s.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=p(c[0].t/l,e),i=0,a=c.length;i<a;i++)n=c[i],r=0,n.hasOwnProperty("r")&&(r=n.r),d+=n.d*(1+r);return f.end=p((c[0].t+d)/l,e),f}(u);else{var c=u.adaptation.period;l.start=c.start,l.end=Math.max(i,c.start+c.duration)}!isNaN(l.start)&&(isNaN(n.start)||n.start>l.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end<l.end)&&(n.end=l.end)})),n.end=Math.min(i,n.end);var s=v(e,n.end,!0);return n.end=isNaN(s)?n.end:s,n.start=r&&r.mpd&&r.mpd.timeShiftBufferDepth&&!isNaN(r.mpd.timeShiftBufferDepth)&&!isNaN(n.end)?Math.max(n.end-r.mpd.timeShiftBufferDepth,n.start):n.start,n.start=v(e,n.start),{range:n,now:i}}function y(e,t){n=e-t.end}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r<e.length;){var o=e[r].getStreamInfo();o.start<=t&&(!isFinite(o.duration)||o.start+o.duration>=t)?(a=t,i=!0):!n&&o.start>t&&(isNaN(a)||o.start<a)?a=o.start:n&&o.start+o.duration<t&&(isNaN(a)||o.start+o.duration>a)&&(a=o.start+o.duration),r+=1}return a}catch(e){return t}}function _(e){void 0===e.offset||isNaN(e.offset)||f(e.offset/1e3)}function T(){r=0,n=0}function b(){s.off(l.a.UPDATE_TIME_SYNC_OFFSET,_,this),T()}return e={initialize:function(){T(),s.on(l.a.UPDATE_TIME_SYNC_OFFSET,_,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:f,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return h(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return h(e,t,n,!0)},calcPresentationTimeFromWallTime:g,calcPresentationTimeFromMediaTime:p,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(c.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var n=m(e);return y(n.now,n.range),n.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var n=e[0].getAdapter().getRegularPeriods()[0],r=g(new Date,n),i=n.mpd.timeShiftBufferDepth,a=isNaN(i)?0:r-i;t.start=v(e,a),t.end=!isNaN(t.start)&&r<t.start?r:v(e,r,!0),!isNaN(i)&&t.end<r-i&&(t.end=NaN);if(c.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var o=m(e);if(o.range.end<t.start)return s.trigger(d.a.CONFORMANCE_VIOLATION,{level:he.LEVELS.WARNING,event:he.EVENTS.INVALID_DVR_WINDOW}),y(o.now,o.range),o.range}return t}(e)},reset:b},t=Object(pn.a)(i).getInstance(),b(),e}Yn.__dashjs_factory_name="TimelineConverter";var qn=c.a.getSingletonFactory(Yn),Hn=n(60),Vn=n.n(Hn),Kn=n(25),zn=n.n(Kn);function Wn(e){return(Wn="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})(e)}function Xn(e,t){return(Xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qn(e){var t=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}}();return function(){var n,r=$n(e);if(t){var i=$n(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Zn(this,n)}}function Zn(e,t){return!t||"object"!==Wn(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 $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Jn=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&&Xn(e,t)}(n,e);var t=Qn(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return n}(fn),er=n(52);function tr(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n){t+=e[n].uchar}return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function o(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,s,u,l){var c,f,d=null,h=!1,g=-1,p={start:s,end:u,spans:[]},m="style_cea608_white_black",y={},E={},v=[];for(c=0;c<15;++c){var _=l.rows[c],T="",b=null;if(!1===_.isEmpty()){var S=t(_.chars);null===d&&(d={x:S,y1:c,y2:c+1,p:[]}),S!==g&&h&&(d.p.push(p),p={start:s,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(v.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d={x:S,y1:c,y2:c+1,p:[]});for(var A=0;A<_.chars.length;++A){var I=_.chars[A],R=I.penState;if(null===b||!R.equals(b)){T.trim().length>0&&(p.spans.push({name:m,line:T,row:c}),T="");var w="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(w+="_underline"),R.italics&&(w+="_italics"),E.hasOwnProperty(w)||(E[w]=JSON.parse(JSON.stringify(R))),b=R,m=w}T+=I.uchar}T.trim().length>0&&p.spans.push({name:m,line:T,row:c}),h=!0,g=S}else h=!1,g=-1,d&&(d.p.push(p),p={start:s,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(v.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(p),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(v.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var N=[];for(c=0;c<v.length;++c){var C=v[c],D="sub_cea608_"+e++,O=document.createElement("div");O.id=D;var M=n(C);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+M;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var x=0;x<C.p.length;++x){var F=C.p[x],k=0;for(f=0;f<F.spans.length;++f){var U=F.spans[f];if(U.line.length>0){if(0!==f&&k!=U.row){var B=document.createElement("br");B.className="lineBreak",L.appendChild(B)}var G=!1;k===U.row&&(G=!0),k=U.row;var j=E[U.name],Y=document.createElement("span");Y.className="spanPadding "+U.name+" customSpanColor",Y.style.cssText=i(r,j),0!==f&&G?f===F.spans.length-1?Y.textContent=o(U.line):Y.textContent=U.line:F.spans.length>1&&f<F.spans.length-1&&U.row===F.spans[f+1].row?Y.textContent=a(U.line):Y.textContent=U.line.trim(),L.appendChild(Y)}}}P.appendChild(L),O.appendChild(P);var q={bodyStyle:["%",90]};for(var H in E)E.hasOwnProperty(H)&&(q[H]=["%",90]);N.push({type:"html",start:s,end:u,cueHTMLElement:O,cueID:D,cellResolution:[32,15],isFromCEA608:!0,fontSize:q,lineHeight:{},linePadding:{}})}return N}}}tr.__dashjs_factory_name="EmbeddedTextHtmlRender";var nr=c.a.getSingletonFactory(tr);function rr(e){var t,n,r,o,s,c,d,h,g,p,E,_,T,b,S,A,I=e.errHandler,R=e.manifestModel,w=e.mediaController,N=e.videoModel,C=e.textTracks,D=e.vttParser,O=e.ttmlParser,M=e.streamInfo,P=this.context,L=Object(u.a)(P).getInstance(),F=!1;function k(){c=null,h=NaN,g=[],p=null,d=!1,s=[],o=null}function U(e){var t=new Jn;for(var n in e)t[n]=e[n];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;_.length>1&&e.isEmbedded?t=e.id&&e.id===a.a.CC1:1===_.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===_.length&&(t=e.index===s[0].index);return t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.a.STPP)>=0||e.mimeType&&e.mimeType.search(a.a.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n=n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),C.addTextTrack(t)}function B(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&j(t.bytes,t)}function G(e){E=e}function j(e,s){var u=s.mediaInfo,l=u.type,f=u.mimeType,g=u.codec||f;g?-1!==u.codec.indexOf("application/mp4")?function(e,i,s){var u,l;if("InitializationSegment"===i.segmentType)d=!0,h=r.getMediaTimescaleFromMoov(e);else{if(!d)return;l=r.getSamplesInfo(e),(u=l.sampleList).length>0&&(p=u[0].cts-i.start*h),s.search(a.a.STPP)>=0?function(e,r,i){var s,u;for(o=null!==o?o:H(i),s=0;s<r.length;s++){var l=r[s],f=l.cts,d=q(),g=d+f/h,p=g+l.duration/h;t.buffered.add(g,p);var m=new DataView(e,l.offset,l.subSizes[0]),y=zn.a.Utils.dataViewToString(m,a.a.UTF8),v=[],_=l.offset+l.subSizes[0];for(u=1;u<l.subSizes.length;u++){var T=new Uint8Array(e,_,l.subSizes[u]),b=String.fromCharCode.apply(null,T);v.push(b),_+=l.subSizes[u]}try{var S=R.getValue().ttmlTimeIsRelative?f/h:0,A=o.parse(y,S,f/h,(f+l.duration)/h,v);C.addCaptions(E,d,A)}catch(e){c.removeExecutedRequestsBeforeTime(),this.remove(),n.error("TTML parser error: "+e.message)}}}(e,u,s):function(e,r){var i,a,o,s=[];for(i=0;i<r.length;i++){var u=r[i];u.cts-=p;var l=q()+u.cts/h,c=l+u.duration/h;t.buffered.add(l,c);var f=e.slice(u.offset,u.offset+u.size),d=zn.a.parseBuffer(f);for(a=0;a<d.boxes.length;a++){var g=d.boxes[a];if(n.debug("VTT box1: "+g.type),"vtte"!==g.type&&"vttc"===g.type)for(n.debug("VTT vttc boxes.length = "+g.boxes.length),o=0;o<g.boxes.length;o++){var m=g.boxes[o];if(n.debug("VTT box2: "+m.type),"payl"===m.type){var y=m.cue_text;n.debug("VTT cue_text = "+y);var v=u.cts/h,_=(u.cts+u.duration)/h;s.push({start:v,end:_,data:y,styles:{}}),n.debug("VTT "+v+"-"+_+" : "+y)}}}}s.length>0&&C.addCaptions(E,0,s)}(e,u)}}(e,s,g):l===a.a.VIDEO?function(e,t){var a,o;if(t.segmentType===v.a.INIT_SEGMENT_TYPE)0===T&&(T=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===v.a.MEDIA_SEGMENT_TYPE){if(0===T)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(o=r.getSamplesInfo(e)).lastSequenceNumber;if(S[0]||S[1]||function(){for(var e,t=0;t<_.length;t++){if(-1===(e=C.getTrackIdxForId(_[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=Y(e);S[t]=new i.a.Cea608Parser(t+1,{newCue:r},null)}}(),T){if(null!==b&&s!==b+o.numSequences)for(a=0;a<S.length;a++)S[a]&&S[a].reset();for(var u=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),a=0;a<t.length;a++)for(var o=t[a],s=i.a.findCea608Nalus(r,o.offset,o.size),u=null,l=0,c=0;c<s.length;c++)for(var f=i.a.extractCea608DataFromRange(r,s[c]),d=0;d<2;d++)if(f[d].length>0){o.cts!==u?l=0:l+=1;var h=q();n.fields[d].push([o.cts+h*T,f[d],l]),u=o.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,o.sampleList),l=0;l<S.length;l++){var c=u.fields[l],f=S[l];if(f)for(a=0;a<c.length;a++)f.addData(c[a][0]/T,c[a][1])}b=s}}}(e,s):function(e,n,r){var i,o,s=new DataView(e,0,e.byteLength);o=zn.a.Utils.dataViewToString(s,a.a.UTF8);try{i=H(r).parse(o,0),C.addCaptions(C.getCurrentTrackIdx(),0,i),t.buffered&&t.buffered.add(n.start,n.end)}catch(e){I.error(new m.a(y.a.TIMED_TEXT_ERROR_ID_PARSE_CODE,y.a.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,o))}}(e,s,g):n.error("No text type defined")}function Y(e){return function(t,n,r){var i;i=N.getTTMLRenderingDiv()?A.createHTMLCaptionsFromScreen(N.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}],i&&C.addCaptions(e,0,i)}}function q(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function H(e){var t;return e.search(a.a.VTT)>=0?t=D:(e.search(a.a.TTML)>=0||e.search(a.a.STPP)>=0)&&(t=O),t}function V(e){_.forEach((function(t){var n=C.getTrackIdxForId(t.id);n>=0&&C.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){F||(_=[],E=null,T=0,S=[],b=null,F=!0,A=nr(P).getInstance(),L.on(l.a.VIDEO_CHUNK_RECEIVED,B,t),L.on(l.a.BUFFER_CLEARED,V,t))},addMediaInfos:function(e,n,r){if(s=s.concat(n),e===a.a.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){c=r,t.buffered=Object(er.a)(P).create(),g=w.getTracksFor(a.a.TEXT,M.id).filter((function(e){return e.isFragmented}));for(var i=w.getCurrentTrackFor(a.a.TEXT,M.id),o=0;o<g.length;o++)if(g[o]===i){G(o);break}}for(var u=0;u<n.length;u++)U(n[u])},resetMediaInfos:function(){s=[]},getStreamId:function(){return M.id},append:j,abort:function(){},addEmbeddedTrack:function(e){if(F&&e)if(e.id===a.a.CC1||e.id===a.a.CC3){for(var t=0;t<_.length;t++)if(_[t].id===e.id)return;_.push(e)}else n.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){L.off(l.a.VIDEO_CHUNK_RECEIVED,B,t),L.off(l.a.BUFFER_CLEARED,V,t),C&&C.deleteAllTextTracks(),F=!1,_=[],S=[null,null],b=null},getConfig:function(){return{fragmentModel:c,fragmentedTracks:g,videoModel:N}},setCurrentFragmentedTrackIdx:G,remove:function(e,n){void 0===e&&e===n&&(e=t.buffered.start(0),n=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,n),C.deleteCuesFromTrackIdx(E,e,n)},reset:function(){k(),s=[],r=null}},n=Object(f.a)(P).getInstance().getLogger(t),r=Object(x.a)(P).getInstance(),k(),t}rr.__dashjs_factory_name="TextSourceBuffer";var ir=c.a.getClassFactory(rr),ar=n(51);function or(e){var t,n,r,i,o,s,c,h,g,p,m,y,E,v,_,T,b,S=this.context,A=Object(u.a)(S).getInstance(),I=e.videoModel,R=e.streamInfo;function w(e,t,n,r,i,a){var o=0,s=0;e/t>n/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,f=0;return o/s>i?(f=s,c=s*i):(c=o,f=o/i),u=(e-c)/2,l=(t-f)/2,a?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function N(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),s=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var u=i/a,l=!1;e.isFromCEA608&&(u=3.5/3,l=!0);var f=w.call(this,n,r,i,a,u,l),y=f.w,_=f.h,b=f.x,S=f.y;if(y!=g||_!=p||b!=c||S!=h||t){if(c=b+s,h=S+o,g=y,p=_,m){var R=m.style;R&&(R.left=c+"px",R.top=h+"px",R.width=g+"px",R.height=p+"px",R.zIndex=E&&document[E]||v?T:null,A.trigger(d.a.CAPTION_CONTAINER_RESIZE))}var N=e.activeCues;if(N)for(var C=N.length,D=0;D<C;++D){var O=N[D];O.scaleCue(O)}}}}function C(e){var t,n,r,i,a,o=g,s=p;if(e.cellResolution){var u=[o/e.cellResolution[0],s/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){n=(e.linePadding[t]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),c=0;c<l.length;c++)l[c].style.cssText=l[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n),l[c].style.cssText=l[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?r=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(r=e.fontSize[t][1]),n=(r*u[1]).toString(),a="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var f=0;f<a.length;f++)a[f].style.cssText=a[f].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?i=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(i=e.lineHeight[t][1]),n=(i*u[1]).toString(),a=document.getElementsByClassName(t);for(var d=0;d<a.length;d++)a[d].style.cssText=a[d].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&m.removeChild(h),D(e)}}function D(e){if(m){var t=document.createElement("div");m.appendChild(t),_=Object(ar.renderHTML)(e.isd,t,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var o=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[o]}return null}),m.clientHeight,m.clientWidth,!1,(function(e){n.info("renderCaption :",e)}),_,!0),t.id=e.cueID,A.trigger(d.a.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:s})}}function O(e,t,i){var o=M(e),u=this;if(o&&Array.isArray(i)&&0!==i.length)for(var l=0;l<i.length;l++){var f=void 0,y=i[l];if(o.cellResolution=y.cellResolution,o.isFromCEA608=y.isFromCEA608,"html"!==y.type||!m||isNaN(y.start)||isNaN(y.end)){if(y.data&&!isNaN(y.start)&&!isNaN(y.end)){if(f=new r(y.start-t,y.end-t,y.data),y.styles)try{void 0!==y.styles.align&&"align"in f&&(f.align=y.styles.align),void 0!==y.styles.line&&"line"in f&&(f.line=y.styles.line),void 0!==y.styles.position&&"position"in f&&(f.position=y.styles.position),void 0!==y.styles.size&&"size"in f&&(f.size=y.styles.size)}catch(e){n.error(e)}f.onenter=function(){o.mode===a.a.TEXT_SHOWING&&A.trigger(d.a.CAPTION_RENDERED,{currentTrackIdx:s})}}}else(f=new r(y.start+t,y.end+t,"")).cueHTMLElement=y.cueHTMLElement,f.isd=y.isd,f.images=y.images,f.embeddedImages=y.embeddedImages,f.cueID=y.cueID,f.scaleCue=C.bind(u),f.cellResolution=y.cellResolution,f.lineHeight=y.lineHeight,f.linePadding=y.linePadding,f.fontSize=y.fontSize,m.style.left=c+"px",m.style.top=h+"px",m.style.width=g+"px",m.style.height=p+"px",f.onenter=function(){o.mode===a.a.TEXT_SHOWING&&(this.isd?(D(this),n.debug("Cue enter id:"+this.cueID)):(m.appendChild(this.cueHTMLElement),C.call(u,this),A.trigger(d.a.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:s})))},f.onexit=function(){if(m)for(var e=m.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(n.debug("Cue exit id:"+e[t].id),m.removeChild(e[t]),--t)};try{f?x(o,f)||o.addCue(f):n.error("impossible to display subtitles.")}catch(e){throw k(o),o.addCue(f),e}}}function M(e){return e>=0&&i[e]?I.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function P(e){var t=this;if(e!==s){var n=M(s=e);L.call(this,n),y&&(clearInterval(y),y=null),n&&"html"===n.renderingType&&(N.call(this,n,!0),window.ResizeObserver?(b=new window.ResizeObserver((function(){N.call(t,n,!0)}))).observe(I.getElement()):y=setInterval(N.bind(this,n),500))}}function L(e){G.call(this),e&&"html"===e.renderingType?U.call(this):B.call(this)}function x(e,t){if(!e.cues)return!1;for(var n=0;n<e.cues.length;n++)if(e.cues[n].startTime===t.startTime&&e.cues[n].endTime===t.endTime)return!0;return!1}function F(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function k(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.cues)for(var i=e.cues,a=i.length-1,o=a;o>=0;o--)F(i[o],t,n,r)&&(i[o].onexit&&i[o].onexit(),e.removeCue(i[o]))}function U(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function B(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function G(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],o=[],s=-1,c=0,h=0,g=0,p=0,m=null,y=null,v=!1,T=2147483647,_=null,void 0!==document.fullscreenElement?E="fullscreenElement":void 0!==document.webkitIsFullScreen?E="webkitIsFullScreen":document.msFullscreenElement?E="msFullscreenElement":document.mozFullScreen&&(E="mozFullScreen"))},getStreamId:function(){return R.id},addTextTrack:function(e){i.push(e)},addCaptions:O,createTracks:function(){i.sort((function(e,t){return e.index-t.index})),m=I.getTTMLRenderingDiv();for(var e,t,n,r,u,c,f=-1,h=0;h<i.length;h++){var g=(e=i[h],t=void 0,n=void 0,r=void 0,u=void 0,c=void 0,t=e.kind,n=void 0!==e.id?e.id:e.lang,r=e.lang,u=e.isTTML,c=e.isEmbedded,I.addTextTrack(t,n,r,u,c));o.push(g),i[h].defaultTrack&&(g.default=!0,f=h);var p=M(h);p&&(p.mode=a.a.TEXT_SHOWING,m&&(i[h].isTTML||i[h].isEmbedded)?p.renderingType="html":p.renderingType="default"),O(h,0,i[h].captionData),A.trigger(d.a.TEXT_TRACK_ADDED)}if(P.call(this,f),f>=0){A.on(d.a.PLAYBACK_METADATA_LOADED,(function e(){var t=M(f);t&&"html"===t.renderingType&&N.call(this,t,!0),A.off(d.a.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var y=0;y<i.length;y++){var E=M(y);E&&(E.mode=y===f?a.a.TEXT_SHOWING:a.a.TEXT_HIDDEN)}}A.trigger(l.a.TEXT_TRACKS_QUEUE_INITIALIZED,{index:s,tracks:i,streamId:R.id})},getCurrentTrackIdx:function(){return s},setCurrentTrackIdx:P,getTrackIdxForId:function(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return i[s]},setModeForTrackIdx:function(e,t){var n=M(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=M(e);r&&k(r,t,n)},deleteAllTextTracks:function(){for(var e=o?o.length:0,t=0;t<e;t++){var n=M(t);n&&k.call(this,n,R.start,R.start+R.duration,!1)}o=[],i=[],y&&(clearInterval(y),y=null),b&&I&&(b.unobserve(I.getElement()),b=null),s=-1,G.call(this)},deleteTextTrack:function(e){I.removeChild(o[e]),o.splice(e,1)}},n=Object(f.a)(S).getInstance().getLogger(t),t}or.__dashjs_factory_name="TextTracks";var sr=c.a.getClassFactory(or);function ur(){var e,t,n,r,i,a,o=this.context;function s(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){var t=e.split(r),n=t[1].split(a);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:l(n)}}function l(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",o="";""!==e[i]&&i<e.length;)i++;if((n=i-t)>1)for(var s=0;s<n;s++){if((o=e[t+s]).match(r)){a="";break}a+=o,s!==n-1&&(a+="\n")}else(o=e[t]).match(r)||(a=o);return a}return e={parse:function(e){var a,o,l=[];if(!e)return l;a=(e=e.split(n)).length,o=-1;for(var f=0;f<a;f++){var d=e[f];if(d.length>0&&"WEBVTT"!==d&&d.match(r)){var h=u(d),g=h.cuePoints,p=h.styles,m=c(e,f+1),y=s(g[0].replace(i,"")),E=s(g[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=o&&E>y?""!==m?(o=y,l.push({start:y,end:E,data:m,styles:p})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return l}},t=Object(f.a)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}ur.__dashjs_factory_name="VTTParser";var lr=c.a.getSingletonFactory(ur);function cr(){var e,t,n=this.context,r=Object(u.a)(n).getInstance(),i=0;return e={parse:function(e,n,a,o,s){var u,c,f,h="",g=[],p={},m={},y="",E="",v={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(d.a.CONFORMANCE_VIOLATION,{level:he.LEVELS.ERROR,event:he.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=E.trim()),E="",y=""},onText:function(e){y&&(E+=e)}};if(!e)throw h="no ttml data to parse",new Error(h);p.data=e,r.trigger(l.a.TTML_TO_PARSE,p);var _=Object(ar.fromXML)(p.data,(function(e){h=e}),v);r.trigger(l.a.TTML_PARSED,{ttmlString:p.data,ttmlDoc:_});var T,b=_.getMediaTimeEvents();for(f=0;f<b.length;f++){var S=Object(ar.generateISD)(_,b[f],(function(e){h=e}));S.contents.some((function(e){return e.contents.length}))&&(u=b[f]+n<a?a:b[f]+n)<(c=b[f+1]+n>o?o:b[f+1]+n)&&g.push({start:u,end:c,type:"html",cueID:(T=void 0,T="cue_TTML_"+i,i++,T),isd:S,images:s,embeddedImages:m})}if(""!==h)throw t.error(h),new Error(h);return g}},t=Object(f.a)(n).getInstance().getLogger(e),e}cr.__dashjs_factory_name="TTMLParser";var fr=c.a.getSingletonFactory(cr);function dr(e){var t,n,r,i,o,s,c,f,h,g,p,m=this.context,y=e.adapter,E=e.errHandler,v=e.manifestModel,_=e.mediaController,T=e.videoModel,b=e.settings;function S(e){var t=e.tracks,r=e.index,i=e.streamId;if(!1===b.get().streaming.text.defaultEnabled&&!A()||p)I(i,-1);else{var o=_.getCurrentTrackFor(a.a.TEXT,i);if(o){var s={lang:o.lang,role:o.roles[0],index:o.index,codec:o.codec,accessibility:o.accessibility[0]};t.some((function(e,t){if(_.matchSettings(s,e))return I(i,t),r=t,!0}))}f=!1}n[i].lastEnabledIndex=r,c.trigger(d.a.TEXT_TRACKS_ADDED,{enabled:A(),index:r,tracks:t,streamId:i}),g=!0}function A(){var e=!0;return f&&!h&&(e=!1),e}function I(e,t){(f=-1===t)&&_&&_.saveTextSettingsDisabled();var n=R(e);if(n!==t&&i[e]){i[e].setModeForTrackIdx(n,a.a.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),i[e].setModeForTrackIdx(t,a.a.TEXT_SHOWING);var o=i[e].getCurrentTrackInfo();o&&o.isFragmented&&!o.isEmbedded?function(e,t,n){if(!r[e])return;for(var o=r[e].getConfig().fragmentedTracks,s=0;s<o.length;s++){var u=o[s];if(t.lang===u.lang&&(u.id?t.id===u.id:t.index===u.index)){var f=_.getCurrentTrackFor(a.a.TEXT,e);(u.id?f.id!==u.id:f.index!==u.index)?(i[e].deleteCuesFromTrackIdx(n),r[e].setCurrentFragmentedTrackIdx(s)):-1===n&&c.trigger(l.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:a.a.TEXT})}}}(e,o,n):o&&!o.isFragmented&&function(e,t){c.trigger(l.a.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:a.a.TEXT})}(e,o),_.setTrack(o)}}function R(e){return i[e].getCurrentTrackIdx()}function w(){r={},i={},n={},f=!0,g=!1,p=!1}return t={deactivateStream:function(e){if(e){var t=e.id;r[t]&&r[t].resetMediaInfos(),i[t]&&i[t].deleteAllTextTracks()}},initialize:function(){c.on(l.a.TEXT_TRACKS_QUEUE_INITIALIZED,S,t)},initializeForStream:function(e){var t=e.id,a=sr(m).create({videoModel:T,streamInfo:e});a.initialize(),i[t]=a;var u=ir(m).create({errHandler:E,adapter:y,manifestModel:v,mediaController:_,videoModel:T,textTracks:a,vttParser:o,ttmlParser:s,streamInfo:e});u.initialize(),r[t]=u,n[t]={},n[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;i[t]&&i[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(r&&r[t])return r[t]},getAllTracksAreDisabled:function(){return f},addEmbeddedTrack:function(e,t){var n=e.id;r[n]&&r[n].addEmbeddedTrack(t)},enableText:function(e,t){Object(O.b)(t,"boolean"),A()!==t&&(t&&I(e,n[e].lastEnabledIndex),t||(n[e].lastEnabledIndex=R(e),g?I(e,-1):p=!0))},isTextEnabled:A,setTextTrack:I,getCurrentTrackIdx:R,enableForcedTextStreaming:function(e){Object(O.b)(e,"boolean"),h=e},addMediaInfosToBuffer:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){w(),c.off(l.a.TEXT_TRACKS_QUEUE_INITIALIZED,S,t),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},h=!1,g=!1,p=!1,o=lr(m).getInstance(),s=fr(m).getInstance(),c=Object(u.a)(m).getInstance(),w(),t}dr.__dashjs_factory_name="TextController";var hr=c.a.getClassFactory(dr),gr=n(32);function pr(){var e,t,n,r,h,p,_,T,b,S,A,I,R,w,N,C,D,M,F,k,U,B,G,j,Y,q,H,V,K,z,W,X,Q,Z,$,J,ee,te="You must first call initialize() and set a source before calling this method",ne="You must first call initialize() and set a valid source and view before calling this method",re="You must first call attachView() to set the video element before calling this method",ae=this.context,oe=Object(u.a)(ae).getInstance(),se=Object(E.a)(ae).getInstance(),ue=Object(f.a)(ae).getInstance({settings:se});function le(){Re(null),Ae(null),r=null,R&&(R.reset(),R=null),w&&(w.reset(),w=null),F&&F.reset(),se.reset(),C&&(C.reset(),C=null)}function ce(){return!!n&&!!Z.getElement()}function fe(){return Object(Jt.a)()}function de(){if(!_)throw ne;return H.isPaused()}function he(){if(!_)throw ne;return H.getIsDynamic()}function ge(e){var t=j&&j.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=W.getCurrentDVRInfo(t);if(!n)return 0;var r=H.getOriginalLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function pe(e){if(!_)throw ne;var t=Se().currentTime;if(void 0!==e)t=j.getTimeRelativeToStreamId(t,e);else if(H.getIsDynamic()){var n=j&&j.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,r=W.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function me(){if(!_)throw ne;var e=Se().duration;if(H.getIsDynamic()){var t=j&&j.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=W.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function Ee(e){Object(O.b)(e,"boolean"),T=e}function _e(){F.restoreDefaultUTCTimingSources()}function Te(){return W}function Se(){if(!Z.getElement())throw re;return Z.getElement()}function Ae(e){if(!h)throw"MediaPlayer not initialized!";Z.setElement(e),e&&(Me(),function(){if(w)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(ae).create();w=t.createMetricsReporting({debug:ue,eventBus:oe,mediaElement:Se(),adapter:D,dashMetrics:W,mediaPlayerModel:M,events:l.a,constants:a.a,metricsConstants:s.a})}}(),function(){if(N)return;var e=dashjs.MssHandler;"function"==typeof e&&(y.a.extend(e.errors),N=e(ae).create({eventBus:oe,mediaPlayerModel:M,dashMetrics:W,manifestModel:X,playbackController:H,streamController:j,protectionController:R,baseURLController:U,errHandler:k,events:l.a,constants:a.a,debug:ue,initSegmentType:v.a.INIT_SEGMENT_TYPE,BASE64:Vn.a,ISOBoxer:zn.a,settings:se}))}(),j&&j.switchToVideoElement()),_&&Ne(),xe()}function Ie(e){if(!p)throw te;var t=j.getActiveStreamInfo();return t?I.getTracksFor(e,t.id):[]}function Re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!h)throw"MediaPlayer not initialized!";"string"==typeof e&&$.initialize(e),n=e,(p||_)&&Ne(),ce()&&xe(t)}function we(){if(!p)throw te;var e=j.getActiveStreamInfo();return e?j.getStreamById(e.id):null}function Ne(){_=!1,p=!1,D.reset(),j.reset(),q.reset(),z.reset(),H.reset(),V.reset(),K.reset(),b.reset(),I.reset(),ee.reset(),R&&(se.get().streaming.protection.keepProtectionMediaKeys?R.stop():(R.reset(),R=null,Me())),Y.reset(),Q.reset()}function De(){var e=Oe();j||(j=ye(ae).getInstance()),Y||(Y=hr(ae).create({errHandler:k,manifestModel:X,adapter:D,mediaController:I,videoModel:Z,settings:se})),G.setConfig({capabilities:B,customParametersModel:F,adapter:D,settings:se,manifestModel:X,errHandler:k}),j.setConfig({capabilities:B,capabilitiesFilter:G,manifestLoader:e,manifestModel:X,mediaPlayerModel:M,customParametersModel:F,protectionController:R,textController:Y,adapter:D,dashMetrics:W,errHandler:k,timelineConverter:A,videoModel:Z,playbackController:H,serviceDescriptionController:V,contentSteeringController:K,abrController:b,mediaController:I,settings:se,baseURLController:U,uriFragmentModel:$,segmentBaseController:ee}),q.setConfig({settings:se,playbackController:H,streamController:j,videoModel:Z,timelineConverter:A,adapter:D}),H.setConfig({streamController:j,serviceDescriptionController:V,dashMetrics:W,adapter:D,videoModel:Z,timelineConverter:A,settings:se}),z.setConfig({streamController:j,playbackController:H,mediaPlayerModel:M,videoModel:Z,settings:se}),b.setConfig({streamController:j,domStorage:J,mediaPlayerModel:M,customParametersModel:F,dashMetrics:W,adapter:D,videoModel:Z,settings:se}),Q.setConfig({abrController:b,dashMetrics:W,playbackController:H}),K.setConfig({adapter:D,errHandler:k,dashMetrics:W,mediaPlayerModel:M,manifestModel:X,abrController:b,eventBus:oe,requestModifier:Object(P.a)(ae).getInstance()}),b.initialize(),j.initialize(T,r),Y.initialize(),q.initialize(),z.initialize(),Q.initialize(),K.initialize(),ee.initialize()}function Oe(){return vt(ae).create({debug:ue,errHandler:k,dashMetrics:W,mediaPlayerModel:M,requestModifier:Object(P.a)(ae).getInstance(),mssHandler:N,settings:se})}function Me(){if(R)return R;var e=dashjs.Protection;if("function"==typeof e){var t=e(ae).create();return l.a.extend(e.events),d.a.extend(e.events,{publicOnly:!0}),y.a.extend(e.errors),B||(B=Object(bt.a)(ae).getInstance()),R=t.createProtectionSystem({debug:ue,errHandler:k,videoModel:Z,customParametersModel:F,capabilities:B,eventBus:oe,events:l.a,BASE64:Vn.a,constants:a.a,cmcdModel:Q,settings:se})}return null}function Pe(){if(!h)throw"MediaPlayer not initialized!";if(C)return C;var e=dashjs.OfflineController;if("function"==typeof e){l.a.extend(e.events),d.a.extend(e.events,{publicOnly:!0}),y.a.extend(e.errors);var t=Oe(),n=ie(ae).create();return n.setConfig({manifestModel:X,adapter:D,manifestLoader:t,errHandler:k}),C=e(ae).create({debug:ue,manifestUpdater:n,baseURLController:U,manifestLoader:t,manifestModel:X,mediaPlayerModel:M,abrController:b,playbackController:H,adapter:D,errHandler:k,dashMetrics:W,timelineConverter:A,segmentBaseController:ee,schemeLoaderFactory:S,eventBus:oe,events:l.a,errors:y.a,constants:a.a,settings:se,dashConstants:o.a,urlUtils:Object(L.a)(ae).getInstance()})}return null}function Le(e){var t=j&&j.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=W.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function xe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;C&&C.resetRecords(),!p&&n&&(p=!0,t.info("Streaming Initialized"),De(),"string"==typeof n?j.load(n,e):j.loadWithManifest(n,e)),!_&&ce()&&(_=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;B||(B=Object(bt.a)(ae).getInstance()).setConfig({settings:se}),k||(k=Tt(ae).getInstance()),B.supportsMediaSource()?(h||(h=!0,A=qn(ae).getInstance(),b||(b=Ht(ae).getInstance()).setConfig({settings:se}),S||(S=Object(Vt.a)(ae).getInstance()),H||(H=g(ae).getInstance()),I||(I=qe(ae).getInstance()),j||(j=ye(ae).getInstance()),q||(q=ve(ae).getInstance()),z||(z=be(ae).getInstance()),V||(V=Ce(ae).getInstance()),K||(K=ke(ae).getInstance()),G||(G=At(ae).getInstance()),D=Sn(ae).getInstance(),X=Ct(ae).getInstance(),Q=Object(Xt.a)(ae).getInstance(),W=jn(ae).getInstance({settings:se}),J=$t(ae).getInstance({settings:se}),D.setConfig({constants:a.a,cea608parser:i.a,errHandler:k,BASE64:Vn.a}),U||(U=it(ae).create()),U.setConfig({adapter:D}),V.setConfig({adapter:D}),ee||(ee=ln(ae).getInstance({dashMetrics:W,mediaPlayerModel:M,errHandler:k,baseURLController:U,events:l.a,eventBus:oe,debug:ue,boxParser:Object(x.a)(ae).getInstance(),requestModifier:Object(P.a)(ae).getInstance(),errors:y.a})),I.setConfig({domStorage:J,settings:se,customParametersModel:F}),M.setConfig({playbackController:H,serviceDescriptionController:V}),_e(),Ee(void 0===r||r),Pe()),e&&Ae(e),n&&Re(n,o),t.info("[dash.js "+fe()+"] MediaPlayer has been initialized")):k.error(new m.a(y.a.CAPABILITY_MEDIASOURCE_ERROR_CODE,y.a.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(B=e.capabilities),e.capabilitiesFilter&&(G=e.capabilitiesFilter),e.streamController&&(j=e.streamController),e.textController&&(Y=e.textController),e.gapController&&(q=e.gapController),e.playbackController&&(H=e.playbackController),e.serviceDescriptionController&&(V=e.serviceDescriptionController),e.contentSteeringController&&(K=e.contentSteeringController),e.catchupController&&(z=e.catchupController),e.mediaPlayerModel&&(M=e.mediaPlayerModel),e.customParametersModel&&(F=e.customParametersModel),e.abrController&&(b=e.abrController),e.schemeLoaderFactory&&(S=e.schemeLoaderFactory),e.mediaController&&(I=e.mediaController),e.settings&&(se=e.settings))},on:function(e,t,n,r){oe.on(e,t,n,r)},off:function(e,t,n){oe.off(e,t,n)},extend:function(e,t,n){c.a.extend(e,t,n,ae)},attachView:Ae,attachSource:Re,isReady:ce,play:function(){if(!_)throw ne;(!T||de()&&_)&&H.play(!0)},isPaused:de,pause:function(){if(!_)throw ne;H.pause()},isSeeking:function(){if(!_)throw ne;return H.isSeeking()},isDynamic:he,getLowLatencyModeEnabled:function(){if(!_)throw ne;return H.getLowLatencyModeEnabled()},seek:function(e){if(!_)throw ne;if(Object(O.b)(e,"number"),isNaN(e))throw a.a.BAD_ARGUMENT_ERROR;var t=H.getIsDynamic()?ge(e):e,n=Se();!H.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),H.seek(t,!1,!1,!0)},seekToOriginalLive:function(){_&&he()&&H.seekToOriginalLive()},setPlaybackRate:function(e){Se().playbackRate=e},getPlaybackRate:function(){return Se().playbackRate},setMute:function(e){Object(O.b)(e,"boolean"),Se().muted=e},isMuted:function(){return Se().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.a.BAD_ARGUMENT_ERROR;Se().volume=e},getVolume:function(){return Se().volume},time:pe,duration:me,timeAsUTC:function(){if(!_)throw ne;return pe()<0?NaN:Le(pe())},durationAsUTC:function(){if(!_)throw ne;return Le(me())},getActiveStream:we,getDVRWindowSize:function(){var e=j&&j.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,t=W.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:ge,getTargetLiveDelay:function(){if(!_)throw ne;return H.getOriginalLiveDelay()},convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:fe,getDebug:function(){return ue},getBufferLength:function(e){var n=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT];if(e){if(-1!==n.indexOf(e)){var r=Te().getCurrentBufferLevel(e);return r||NaN}return t.warn("getBufferLength requested for invalid type"),NaN}var i=n.map((function(e){return Ie(e).length>0?Te().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return i===Number.MAX_VALUE?NaN:i},getTTMLRenderingDiv:function(){return Z?Z.getTTMLRenderingDiv():null},getVideoElement:Se,getSource:function(){if(!n)throw"You must first call attachSource() with a valid source before calling this method";return n},updateSource:function(e){n=e,j.load(n)},getCurrentLiveLatency:function(){if(!h)throw"MediaPlayer not initialized!";return _?H.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!p)throw te;return b.getTopBitrateInfoFor(e)},setAutoPlay:Ee,getAutoPlay:function(){return T},getDashMetrics:Te,getQualityFor:function(e){if(!p)throw te;if(e===a.a.IMAGE){var t=we();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return b.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!p)throw te;if(e===a.a.IMAGE){var r=we();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}b.setPlaybackQuality(e,j.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){b.setElementSize(),b.setWindowResizeEventCalled(!0)},enableText:function(e){var t=j.getActiveStreamInfo();return!(!t||!Y)&&Y.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!j.getActiveStreamInfo()||!Y)&&Y.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=j.getActiveStreamInfo();return!(!e||!Y)&&Y.isTextEnabled(e)},setTextTrack:function(e){if(!_)throw ne;var t=j.getActiveStreamInfo();t&&Y&&Y.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!p)throw te;var t=we();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!p)throw te;return D.getStreamsInfo(e)},getTracksFor:Ie,getTracksForTypeFromManifest:function(e,t,n){if(!p)throw te;return(n=n||D.getStreamsInfo(t,1)[0])?D.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!p)throw te;var t=j.getActiveStreamInfo();return I.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!h)throw"MediaPlayer not initialized!";I.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!h)throw"MediaPlayer not initialized!";return I.getInitialSettings(e)},setCurrentTrack:function(e){if(!p)throw te;I.setTrack(e)},addABRCustomRule:function(e,t,n){F.addAbrCustomRule(e,t,n)},removeABRCustomRule:function(e){F.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){F.removeAllAbrCustomRule()},getABRCustomRules:function(){return F.getAbrCustomRules()},getAverageThroughput:function(e){var t=b.getThroughputHistory(),n=H.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Oe(),r=this;oe.on(l.a.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),oe.off(l.a.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),$.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){F.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){F.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){F.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:_e,setXHRWithCredentialsForType:function(e,t){F.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return F.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Me()},attachProtectionController:function(e){R=e},setProtectionData:function(e){r=e,j&&j.setProtectionData(r)},registerLicenseRequestFilter:function(e){F.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){F.registerLicenseResponseFilter(e)},unregisterLicenseRequestFilter:function(e){F.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){F.unregisterLicenseResponseFilter(e)},registerCustomCapabilitiesFilter:function(e){F.registerCustomCapabilitiesFilter(e)},unregisterCustomCapabilitiesFilter:function(e){F.unregisterCustomCapabilitiesFilter(e)},setCustomInitialTrackSelectionFunction:function(e){F.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){F.resetCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!Z.getElement())throw re;Z.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=j.getActiveStreamInfo();if(e&&Y)return Y.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=H.getIsDynamic()?ge(e):e,r=j.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)}else t(null)}},getDashAdapter:function(){return D},getOfflineController:function(){return Pe()},triggerSteeringRequest:function(){if(K)return K.loadSteeringData()},getCurrentSteeringResponseData:function(){if(K)return K.getCurrentSteeringResponseData()},getSettings:function(){return se.get()},updateSettings:function(e){se.update(e)},resetSettings:function(){se.reset()},reset:le,destroy:function(){le(),c.a.deleteSingletonInstances(ae)}},t=ue.getLogger(e),h=!1,_=!1,p=!1,T=!0,R=null,C=null,r=null,D=null,ee=null,l.a.extend(d.a),M=Ot(ae).getInstance(),F=Object(gr.a)(ae).getInstance(),Z=Wt(ae).getInstance(),$=wt(ae).getInstance(),e}pr.__dashjs_factory_name="MediaPlayer";var mr=c.a.getClassFactory(pr);mr.events=d.a,mr.errors=y.a,c.a.updateClassFactory(pr.__dashjs_factory_name,mr);t.a=mr},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));function r(){return"4.5.1"}},function(e,t,n){var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},f={};r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t<r.length;++t)e[r.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},l={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},f.decodeArray=function(e){var t=u(e);return new Uint8Array(t)},f.encodeASCII=function(e){var t=l.encode(e);return i(t)},f.decodeASCII=function(e){var t=u(e);return l.decode(t)},f.encode=function(e){var t=c.encode(e);return i(t)},f.decode=function(e){var t=u(e);return c.decode(t)},t.decode=f.decode,t.decodeArray=f.decodeArray,t.encode=f.encode,t.encodeASCII=f.encodeASCII},,function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}},function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},function(e,t,n){"use strict";var r=n(1),i=n(3),a=n(4),o=n(12);function s(e){var t,n,i,s,u,l=(e=e||{}).eventBus,c=e.events,f=e.abrController,d=e.dashMetrics,h=e.playbackController,g=e.timelineConverter,p=e.type,m=e.streamInfo,y=e.dashConstants,E=e.segmentsController,v=e.isDynamic;function _(){return p}function T(){if(!(f&&d&&h&&g))throw new Error(r.a.MISSING_CONFIG_ERROR)}function b(){return i}function S(){return u}function A(){n=null,i=!0,s=[]}function I(e){return new Promise((function(t,n){var r=e.hasInitialization(),i=e.hasSegments(),a=[];a.push(E.updateInitData(e,r)),a.push(E.updateSegmentData(e,i)),Promise.all(a).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){if(!t||t.error||!t.representation)return e;return t.representation}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(!t||t.error)return;var n,r,i,a,s=t.segments,u=[],l=0;for(n=0,r=s?s.length:0;n<r;n++)i=s[n],(a=Object(o.b)(g,v,e,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,l))&&(u.push(a),a=null,l++);u.length>0&&(e.segments=u);return e}(e,n[1])),(r=e).mediaFinishedInformation=E.getMediaFinishedInformation(r),function(e){if(!b())return;var t,n=d.getCurrentManifestUpdate(),r=!1;if(n){for(var i=0;i<n.representationInfo.length;i++)if((t=n.representationInfo[i]).index===e.index&&t.mediaType===_()){r=!0;break}r||d.addManifestUpdateRepresentationInfo(e,_())}if(function(){for(var e=0,t=s.length;e<t;e++){var n=s[e].segmentInfoType;if(!s[e].hasInitialization()||(n===y.SEGMENT_BASE||n===y.BASE_URL)&&!s[e].segments)return!1}return!0}()){f.setPlaybackQuality(p,m,(o=u,s.indexOf(o)));var a=d.getCurrentDVRInfo(p);a&&d.updateManifestUpdateInfo({latency:a.range.end-h.getTime()}),d.getCurrentRepresentationSwitch(S().adaptation.type)||R(),N()}var o}(e),t()})).catch((function(e){n(e)}))}))}function R(){T();var e=new Date,t=S(),n=1e3*h.getTime();t&&d.addRepresentationSwitch(t.adaptation.type,e,n,t.id),l.trigger(a.a.REPRESENTATION_SWITCH,{mediaType:p,streamId:m.id,currentRepresentation:t,numberOfRepresentations:s.length},{streamId:m.id,mediaType:p})}function w(e){return null==e||e>=s.length?null:s[e]}function N(e){i=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:u,error:e},{streamId:m.id,mediaType:p})}function C(e){u=e}function D(e){if(e.newDuration){var t=S();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return t={getStreamId:function(){return m.id},getType:_,getData:function(){return n},isUpdating:b,updateData:function(e,t,a,o,u){if(T(),i=!0,s=t,C(w(u)),n=e,a!==r.a.VIDEO&&a!==r.a.AUDIO&&(a!==r.a.TEXT||!o))return N(),Promise.resolve();for(var l=[],c=0,f=s.length;c<f;c++){var d=s[c];l.push(I(d))}return Promise.all(l)},getCurrentRepresentation:S,getRepresentationForQuality:w,prepareQualityChange:function(e){C(w(e)),R()},reset:function(){l.off(a.a.MANIFEST_VALIDITY_CHANGED,D,t),A()}},A(),l.on(a.a.MANIFEST_VALIDITY_CHANGED,D,t),t}s.__dashjs_factory_name="RepresentationController",t.a=i.a.getClassFactory(s)},function(e,t,n){"use strict";t.a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},function(e,t,n){"use strict";var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var o,s,u,l=r(t),c=r(n);if(l&&c){if((s=t.length)!=n.length)return!1;for(o=s;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(l!=c)return!1;var f=t instanceof Date,d=n instanceof Date;if(f!=d)return!1;if(f&&d)return t.getTime()==n.getTime();var h=t instanceof RegExp,g=n instanceof RegExp;if(h!=g)return!1;if(h&&g)return t.toString()==n.toString();var p=i(t);if((s=p.length)!==i(n).length)return!1;for(o=s;0!=o--;)if(!a.call(n,p[o]))return!1;for(o=s;0!=o--;)if(!e(t[u=p[o]],n[u]))return!1;return!0}return t!=t&&n!=n}},function(e,t,n){"use strict";var r=n(3);function i(e){return(i="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})(e)}function a(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var a=0,o=e.length;a<o;++a){var s=e[a];if(n[s.name])if(r[s.name]){if(s.merge){var u=n[s.name],l=r[s.name];"object"===i(u)&&"object"===i(l)?t(u,l):r[s.name]=u+l}}else r[s.name]=n[s.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var o=e.children[i],s=t[o.name+"_asArray"];if(s)for(var u=0,l=s.length;u<l;++u){var c=s[u];n(e.properties,t,c),r(o,c)}}}return{run:function(t){if(null===t||"object"!==i(t))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,a=t.Period_asArray,o=0,s=a.length;o<s;++o){var u=a[o];if(r(n,u),"adaptationset"in e){var l=u.AdaptationSet_asArray;if(l)for(var c=e.adaptationset,f=0,d=l.length;f<d;++f)r(c,l[f])}}return t}}}a.__dashjs_factory_name="ObjectIron";var o=r.a.getClassFactory(a),s=n(47);function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}var t,n,r;return t=e,(n=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&u(t.prototype,n),r&&u(t,r),e}(),c=n(0);function f(e){return(f="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})(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=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}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}function p(e,t){return!t||"object"!==f(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 m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=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&&h(e,t)}(n,e);var t=g(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e,t){var n,r=(d(n={},c.a.MPD,[c.a.ID,c.a.PROFILES]),d(n,c.a.PERIOD,[c.a.ID]),d(n,c.a.BASE_URL,[c.a.SERVICE_LOCATION,c.a.BYTE_RANGE]),d(n,c.a.SEGMENT_BASE,[c.a.INDEX_RANGE]),d(n,c.a.INITIALIZATION,[c.a.RANGE]),d(n,c.a.REPRESENTATION_INDEX,[c.a.RANGE]),d(n,c.a.SEGMENT_LIST,[c.a.INDEX_RANGE]),d(n,c.a.BITSTREAM_SWITCHING,[c.a.RANGE]),d(n,c.a.SEGMENT_URL,[c.a.MEDIA_RANGE,c.a.INDEX_RANGE]),d(n,c.a.SEGMENT_TEMPLATE,[c.a.INDEX_RANGE,c.a.MEDIA,c.a.INDEX,c.a.INITIALIZATION_MINUS,c.a.BITSTREAM_SWITCHING_MINUS]),d(n,c.a.ASSET_IDENTIFIER,[c.a.VALUE,c.a.ID]),d(n,c.a.EVENT_STREAM,[c.a.VALUE]),d(n,c.a.ADAPTATION_SET,[c.a.PROFILES,c.a.MIME_TYPE,c.a.SEGMENT_PROFILES,c.a.CODECS,c.a.CONTENT_TYPE]),d(n,c.a.FRAME_PACKING,[c.a.VALUE,c.a.ID]),d(n,c.a.AUDIO_CHANNEL_CONFIGURATION,[c.a.VALUE,c.a.ID]),d(n,c.a.CONTENT_PROTECTION,[c.a.VALUE,c.a.ID]),d(n,c.a.ESSENTIAL_PROPERTY,[c.a.VALUE,c.a.ID]),d(n,c.a.SUPPLEMENTAL_PROPERTY,[c.a.VALUE,c.a.ID]),d(n,c.a.INBAND_EVENT_STREAM,[c.a.VALUE,c.a.ID]),d(n,c.a.ACCESSIBILITY,[c.a.VALUE,c.a.ID]),d(n,c.a.ROLE,[c.a.VALUE,c.a.ID]),d(n,c.a.RATING,[c.a.VALUE,c.a.ID]),d(n,c.a.VIEWPOINT,[c.a.VALUE,c.a.ID]),d(n,c.a.CONTENT_COMPONENT,[c.a.CONTENT_TYPE]),d(n,c.a.REPRESENTATION,[c.a.ID,c.a.DEPENDENCY_ID,c.a.MEDIA_STREAM_STRUCTURE_ID]),d(n,c.a.SUBSET,[c.a.ID]),d(n,c.a.METRICS,[c.a.METRICS_MINUS]),d(n,c.a.REPORTING,[c.a.VALUE,c.a.ID]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return String(e)}))}return n}(l),E=n(1);function v(e){return(v="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})(e)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){var t=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}}();return function(){var n,r=S(e);if(t){var i=S(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==v(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 S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,I=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&&_(e,t)}(n,e);var t=T(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){for(var t=[c.a.MIN_BUFFER_TIME,c.a.MEDIA_PRESENTATION_DURATION,c.a.MINIMUM_UPDATE_PERIOD,c.a.TIMESHIFT_BUFFER_DEPTH,c.a.MAX_SEGMENT_DURATION,c.a.MAX_SUBSEGMENT_DURATION,c.a.SUGGESTED_PRESENTATION_DELAY,c.a.START,E.a.START_TIME,c.a.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return A.test(e.value);return!1}),(function(e){var t=A.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}return n}(l);function R(e){return(R="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})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t=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}}();return function(){var n,r=D(e);if(t){var i=D(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return C(this,n)}}function C(e,t){return!t||"object"!==R(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 D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=/^([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}))?/,M=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&&w(e,t)}(n,e);var t=N(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return O.test(e.value)}),(function(e){var t,n=O.exec(e);if(t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]){var r=60*parseInt(n[9],10)+parseInt(n[10],10);t+=("+"===n[8]?-1:1)*r*60*1e3}return new Date(t)}))}return n}(l);function P(e){return(P="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})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=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}}();return function(){var n,r=k(e);if(t){var i=k(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return F(this,n)}}function F(e,t){return!t||"object"!==P(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 k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var U=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,B=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&&L(e,t)}(n,e);var t=x(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return U.test(e.value)}),(function(e){return parseFloat(e)}))}return n}(l),G=n(30),j=n.n(G);function Y(e){return(Y="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})(e)}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function V(e){var t=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}}();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return K(this,n)}}function K(e,t){return!t||"object"!==Y(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 z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var W=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&&H(e,t)}(n,e);var t=V(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e,t){var n,r=(q(n={},c.a.ADAPTATION_SET,[c.a.LANG]),q(n,c.a.REPRESENTATION,[c.a.LANG]),q(n,c.a.CONTENT_COMPONENT,[c.a.LANG]),q(n,c.a.LABEL,[c.a.LANG]),q(n,c.a.GROUP_LABEL,[c.a.LANG]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){var t=j()(e);return void 0!==t?t:String(e)}))}return n}(l);function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Q=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n;this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}var t,n,r;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&X(t.prototype,n),r&&X(t,r),e}();function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var $=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new Q(e))}))}var t,n,r;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&Z(t.prototype,n),r&&Z(t,r),e}();function J(e){return(J="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})(e)}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=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}}();return function(){var n,r=re(e);if(t){var i=re(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ne(this,n)}}function ne(e,t){return!t||"object"!==J(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 re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ie=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&&ee(e,t)}(n,e);var t=te(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[c.a.PROFILES,c.a.WIDTH,c.a.HEIGHT,c.a.SAR,c.a.FRAMERATE,c.a.AUDIO_SAMPLING_RATE,c.a.MIME_TYPE,c.a.SEGMENT_PROFILES,c.a.CODECS,c.a.MAXIMUM_SAP_PERIOD,c.a.START_WITH_SAP,c.a.MAX_PLAYOUT_RATE,c.a.CODING_DEPENDENCY,c.a.SCAN_TYPE,c.a.FRAME_PACKING,c.a.AUDIO_CHANNEL_CONFIGURATION,c.a.CONTENT_PROTECTION,c.a.ESSENTIAL_PROPERTY,c.a.SUPPLEMENTAL_PROPERTY,c.a.INBAND_EVENT_STREAM];return t.call(this,c.a.ADAPTATION_SET,e,[new $(c.a.REPRESENTATION,e,[new $(c.a.SUB_REPRESENTATION,e)])])}return n}($);function ae(e){return(ae="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})(e)}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function se(e){var t=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}}();return function(){var n,r=le(e);if(t){var i=le(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ue(this,n)}}function ue(e,t){return!t||"object"!==ae(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 le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ce=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&&oe(e,t)}(n,e);var t=se(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[c.a.SEGMENT_BASE,c.a.SEGMENT_TEMPLATE,c.a.SEGMENT_LIST];return t.call(this,c.a.PERIOD,e,[new $(c.a.ADAPTATION_SET,e,[new $(c.a.REPRESENTATION,e)])])}return n}($);function fe(e){e=e||{};var t,n,r,i,a,u=this.context,l=e.debug;return t={parse:function(e){var t,r=window.performance.now();if(!(t=i.xml_str2json(e)))throw new Error("parsing the manifest failed");var o=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return a.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return a.run(e)}))):(t=t.MPD,a.run(t));var s=window.performance.now();return n.info("Parsing complete: ( xml2json: "+(o-r).toPrecision(3)+"ms, objectiron: "+(s-o).toPrecision(3)+"ms, total: "+((s-r)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return r},getIron:function(){return a}},n=l.getLogger(t),r=[new I,new M,new B,new W,new y],i=new s.a({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:r}),a=o(u).create({adaptationset:new ie,period:new ce}),t}fe.__dashjs_factory_name="DashParser";t.a=r.a.getClassFactory(fe)},function(e,t,n){"use strict";var r=n(1),i=n(22);function a(e){return(a="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})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=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}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==a(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 l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=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&&o(e,t)}(n,e);var t=s(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).checkForExistenceOnly=!0,r}return n}(n(17).a),f=n(10),d=n(3);function h(e){e=e||{};var t,n,a=this.context,o=e.eventBus,s=e.events,u=e.urlUtils,l=e.errors,d=e.streamId;return t={checkForExistence:function(e){var t=function(t){o.trigger(s.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new c(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){o.trigger(s.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){o.trigger(s.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:d}),n.data&&o.trigger(s.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 f.a(l.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&o.trigger(s.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new f.a(l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=Object(i.a)(a).create({errHandler:e.errHandler,errors:l,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:u,constants:r.a,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}h.__dashjs_factory_name="FragmentLoader";t.a=d.a.getClassFactory(h)},function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,o;if("auto"===r)a=1;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)o=1;else if("%"===r.w.unit)o=r.w.value/100;else{if("px"!==r.w.unit)return null;o=r.w.value/e.pxDimensions.w}return{h:a,w:o}})),new r(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var r in t)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,n,r,i,a){var o;if("%"===i.unit)o=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value/100:i.value/100/t.cellResolution.h;else if("em"===i.unit)o=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value:i.value/t.cellResolution.h;else if("c"===i.unit)o=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;o=i.value/t.pxDimensions.h}return o})),new r(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,n,r,i,a){var o;if("normal"===i)o=i;else if("%"===i.unit)o=r.styleAttrs[e.byName.fontSize.qname]*i.value/100;else if("em"===i.unit)o=r.styleAttrs[e.byName.fontSize.qname]*i.value;else if("c"===i.unit)o=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;o=i.value/t.pxDimensions.h}return o})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,o;if("auto"===r)a=0;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)o=0;else if("%"===r.w.unit)o=r.w.value/100;else{if("px"!==r.w.unit)return null;o=r.w.value/e.pxDimensions.w}return{h:a,w:o}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,n,r,i,a){var o;if(1===i.length)o=[i[0],i[0],i[0],i[0]];else if(2===i.length)o=[i[0],i[1],i[0],i[1]];else if(3===i.length)o=[i[0],i[1],i[2],i[1]];else{if(4!==i.length)return null;o=[i[0],i[1],i[2],i[3]]}var s=r.styleAttrs[e.byName.writingMode.qname];if("lrtb"===s||"lr"===s)o=[o[0],o[3],o[2],o[1]];else if("rltb"===s||"rl"===s)o=[o[0],o[1],o[2],o[3]];else if("tblr"===s)o=[o[3],o[0],o[1],o[2]];else{if("tbrl"!==s&&"tb"!==s)return null;o=[o[3],o[2],o[1],o[0]]}var u=[];for(var l in o)if(0===o[l].value)u[l]=0;else if("%"===o[l].unit)u[l]="0"===l||"2"===l?r.styleAttrs[e.byName.extent.qname].h*o[l].value/100:r.styleAttrs[e.byName.extent.qname].w*o[l].value/100;else if("em"===o[l].unit)u[l]=r.styleAttrs[e.byName.fontSize.qname]*o[l].value;else if("c"===o[l].unit)u[l]=o[l].value/t.cellResolution.h;else{if("px"!==o[l].unit)return null;u[l]="0"===l||"2"===l?o[l].value/t.pxDimensions.h:o[l].value/t.pxDimensions.w}return u})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,n,r,i,a){if("none"===i)return i;var o={};if(null===i.color?o.color=r.styleAttrs[e.byName.color.qname]:o.color=i.color,"%"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value/100;else if("em"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value;else if("c"===i.thickness.unit)o.thickness=i.thickness.value/t.cellResolution.h;else{if("px"!==i.thickness.unit)return null;o.thickness=i.thickness.value/t.pxDimensions.h}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,r,i){return"c"===r.unit?r.value/e.cellResolution.h:null})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(55):imscNames,"undefined"==typeof imscUtils?n(86):imscUtils)},function(e,t,n){"use strict";(function(e){
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <http://feross.org>
- * @license MIT
- */
- var r=n(98),i=n(99),a=n(87);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|g(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return w(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(l(e,a+d)!==l(t,d)){f=!1;break}if(f)return a}return-1}function v(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function _(e,t,n,r){return Y(G(t,e.length-n),e,n,r)}function T(e,t,n,r){return Y(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return T(e,t,n,r)}function S(e,t,n,r){return Y(j(t),e,n,r)}function A(e,t,n,r){return Y(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?R(this,0,e):p.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),f=0;f<s;++f)if(l[f]!==c[f]){a=l[f],o=c[f];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=B(e[a]);return i}function D(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function x(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,a){return a||x(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function k(e,t,n,r,a){return a||x(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return k(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return k(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=u.isBuffer(e)?e:G(new u(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function j(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(24))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):m(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=m(u,l);for(n=0;n<l;++n)a(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return g(this,e,!0)},s.prototype.rawListeners=function(e){return g(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(88)).Stream=t,t.Readable=t,t.Writable=n(73),t.Duplex=n(36),t.Transform=n(91),t.PassThrough=n(107)},function(e,t,n){"use strict";(function(t,r,i){var a=n(56);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=E;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;E.WritableState=y;var l=n(49);l.inherits=n(42);var c={deprecate:n(106)},f=n(89),d=n(57).Buffer,h=i.Uint8Array||function(){};var g,p=n(90);function m(){}function y(e,t){s=s||n(36),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),A(e,t))}(e,n,r,t,i);else{var o=b(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?u(_,e,n,o,i):_(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function E(e){if(s=s||n(36),!(g.call(E,this)||this instanceof s))return new E(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function v(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),A(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,v(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,f=n.callback;if(v(e,t,!1,t.objectMode?1:l.length,l,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=b(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(E,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(g=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!g.call(this,e)||this===E&&(e&&e._writableState instanceof y)}})):g=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,r,i,a);return u}(this,i,s,e,t,n)),o},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||T(this,e))},E.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=p.destroy,E.prototype._undestroy=p.undestroy,E.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(26),n(104).setImmediate,n(24))},function(e,t,n){"use strict";var r=n(57).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";var r=n(76),i=n(50),a=n(82),o=n(83),s=n(84),u=n(85);e.exports=function(e,t){var n,c=t||{},m=r.parse(String(e||"").toLowerCase(),c),y=r.stringify(m),E=-1;if(!y)return y;for(;++E<a.length;)i.extendedFilter(y,a[E].from).length&&(d(m,a[E].from,a[E].to),y=r.stringify(m));E=-1;for(;++E<o.length;)h(m,o[E].from.field,o[E].from.value)&&g(m,o[E].to.field,o[E].to.value);y=r.stringify(Object.assign({},m,f)),E=-1;for(;++E<s.length;)y===s[E]&&(d(m,s[E],s[E].split("-").slice(0,-1).join("-")),y=r.stringify(Object.assign({},m,f)));if(m.extensions.sort(p),c.warning)for(n in u)l.call(u[n],m[n])&&c.warning("Deprecated "+n+" `"+m[n]+"`, expected one of `"+u[n][m[n]].join("`, `")+"`",null,7);m.script&&(m.script=m.script.charAt(0).toUpperCase()+m.script.slice(1));m.region&&(m.region=m.region.toUpperCase());return r.stringify(m)};var l={}.hasOwnProperty,c=new Intl.Collator,f={variants:[],extensions:[],privateuse:[],irregular:null,regular:null};function d(e,t,n){var i,a=r.parse(t),o=r.parse(n),s=[];for(i in a)a[i]&&a[i].length&&h(e,i,a[i])&&s.push(i);for(i in o)o[i]&&o[i].length&&(s.indexOf(i)>-1||!e[i]||!e[i].length)&&g(e,i,o[i])}function h(e,t,n){var r,i,a,o,s=!1;if(n){if(i=r=e[t],r&&"object"==typeof r)for(i=[],a=-1;++a<r.length;)o=r[a],n.indexOf(o)<0?i.push(o):s=!0;else r===n&&(i=null,s=!0);e[t]=i}return s}function g(e,t,n){var r,i,a,o=e[t];if(o&&"object"==typeof o)for(r=[].concat(n),i=-1;++i<r.length;)a=r[i],o.indexOf(a)<0&&o.push(a);else e[t]=n}function p(e,t){return c.compare(e.singleton,t.singleton)}},function(e,t,n){"use strict";t.parse=n(77),t.stringify=n(81)},function(e,t,n){"use strict";var r=n(78),i=n(62),a=n(63),o=n(79),s=n(80);e.exports=function e(t,n){var l,c,f,d=n||{},h={language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null},g=String(t),p=g.toLowerCase(),m=0;if(null==t)throw new Error("Expected string, got `"+t+"`");if(u.call(s,p))return(null==d.normalize||d.normalize)&&s[p]?e(s[p]):(h[-1===o.indexOf(p)?"irregular":"regular"]=g,h);for(;i(p.charCodeAt(m))&&m<9;)m++;if(m>1&&m<9){if(h.language=g.slice(0,m),m<4)for(c=0;45===p.charCodeAt(m)&&i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&i(p.charCodeAt(m+3))&&!i(p.charCodeAt(m+4));){if(c>2)return y(m,3,"Too many extended language subtags, expected at most 3 subtags");h.extendedLanguageSubtags.push(g.slice(m+1,m+4)),m+=4,c++}for(45===p.charCodeAt(m)&&i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&i(p.charCodeAt(m+3))&&i(p.charCodeAt(m+4))&&!i(p.charCodeAt(m+5))&&(h.script=g.slice(m+1,m+5),m+=5),45===p.charCodeAt(m)&&(i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&!i(p.charCodeAt(m+3))?(h.region=g.slice(m+1,m+3),m+=3):a(p.charCodeAt(m+1))&&a(p.charCodeAt(m+2))&&a(p.charCodeAt(m+3))&&!a(p.charCodeAt(m+4))&&(h.region=g.slice(m+1,m+4),m+=4));45===p.charCodeAt(m);){for(f=l=m+1;r(p.charCodeAt(f));){if(f-l>7)return y(f,1,"Too long variant, expected at most 8 characters");f++}if(!(f-l>4||f-l>3&&a(p.charCodeAt(l))))break;h.variants.push(g.slice(l,f)),m=f}for(;45===p.charCodeAt(m)&&120!==p.charCodeAt(m+1)&&r(p.charCodeAt(m+1))&&45===p.charCodeAt(m+2)&&r(p.charCodeAt(m+3));){for(f=m+2,c=0;45===p.charCodeAt(f)&&r(p.charCodeAt(f+1))&&r(p.charCodeAt(f+2));)for(f=(l=f+1)+2,c++;r(p.charCodeAt(f));){if(f-l>7)return y(f,2,"Too long extension, expected at most 8 characters");f++}if(!c)return y(f,4,"Empty extension, extensions must have at least 2 characters of content");h.extensions.push({singleton:g.charAt(m+1),extensions:g.slice(m+3,f).split("-")}),m=f}}else m=0;if(0===m&&120===p.charCodeAt(m)||45===p.charCodeAt(m)&&120===p.charCodeAt(m+1))for(f=m=m?m+2:1;45===p.charCodeAt(f)&&r(p.charCodeAt(f+1));){for(f=l=m+1;r(p.charCodeAt(f));){if(f-l>7)return y(f,5,"Too long private-use area, expected at most 8 characters");f++}h.privateuse.push(g.slice(m+1,f)),m=f}if(m!==g.length)return y(m,6,"Found superfluous content after tag");return h;function y(e,t,n){return d.warning&&d.warning(n,t,e),d.forgiving?h:{language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null}}};var u={}.hasOwnProperty},function(e,t,n){"use strict";var r=n(62),i=n(63);e.exports=function(e){return r(e)||i(e)}},function(e){e.exports=JSON.parse('["art-lojban","cel-gaulish","no-bok","no-nyn","zh-guoyu","zh-hakka","zh-min","zh-min-nan","zh-xiang"]')},function(e){e.exports=JSON.parse('{"en-gb-oed":"en-GB-oxendict","i-ami":"ami","i-bnn":"bnn","i-default":null,"i-enochian":null,"i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-mingo":null,"i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","sgn-be-fr":"sfb","sgn-be-nl":"vgt","sgn-ch-de":"sgg","art-lojban":"jbo","cel-gaulish":null,"no-bok":"nb","no-nyn":"nn","zh-guoyu":"cmn","zh-hakka":"hak","zh-min":null,"zh-min-nan":"nan","zh-xiang":"hsn"}')},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,i=e||{},a=[];if(i.irregular||i.regular)return i.irregular||i.regular;if(i.language)for(a=a.concat(i.language,i.extendedLanguageSubtags||[],i.script||[],i.region||[],i.variants||[]),t=i.extensions||[],n=-1;++n<t.length;)(r=t[n]).singleton&&r.extensions&&r.extensions.length&&(a=a.concat(r.singleton,r.extensions));i.privateuse&&i.privateuse.length&&(a=a.concat("x",i.privateuse));return a.join("-")}},function(e){e.exports=JSON.parse('[{"from":"in","to":"id"},{"from":"iw","to":"he"},{"from":"ji","to":"yi"},{"from":"jw","to":"jv"},{"from":"mo","to":"ro"},{"from":"scc","to":"sr"},{"from":"scr","to":"hr"},{"from":"aam","to":"aas"},{"from":"adp","to":"dz"},{"from":"aue","to":"ktz"},{"from":"ayx","to":"nun"},{"from":"bgm","to":"bcg"},{"from":"bjd","to":"drl"},{"from":"ccq","to":"rki"},{"from":"cjr","to":"mom"},{"from":"cka","to":"cmr"},{"from":"cmk","to":"xch"},{"from":"coy","to":"pij"},{"from":"cqu","to":"quh"},{"from":"drh","to":"mn"},{"from":"drw","to":"fa-af"},{"from":"gav","to":"dev"},{"from":"gfx","to":"vaj"},{"from":"ggn","to":"gvr"},{"from":"gti","to":"nyc"},{"from":"guv","to":"duz"},{"from":"hrr","to":"jal"},{"from":"ibi","to":"opa"},{"from":"ilw","to":"gal"},{"from":"jeg","to":"oyb"},{"from":"kgc","to":"tdf"},{"from":"kgh","to":"kml"},{"from":"koj","to":"kwv"},{"from":"krm","to":"bmf"},{"from":"ktr","to":"dtp"},{"from":"kvs","to":"gdj"},{"from":"kwq","to":"yam"},{"from":"kxe","to":"tvd"},{"from":"kzj","to":"dtp"},{"from":"kzt","to":"dtp"},{"from":"lii","to":"raq"},{"from":"lmm","to":"rmx"},{"from":"meg","to":"cir"},{"from":"mst","to":"mry"},{"from":"mwj","to":"vaj"},{"from":"myt","to":"mry"},{"from":"nad","to":"xny"},{"from":"ncp","to":"kdz"},{"from":"nnx","to":"ngv"},{"from":"nts","to":"pij"},{"from":"oun","to":"vaj"},{"from":"pcr","to":"adx"},{"from":"pmc","to":"huw"},{"from":"pmu","to":"phr"},{"from":"ppa","to":"bfy"},{"from":"ppr","to":"lcq"},{"from":"pry","to":"prt"},{"from":"puz","to":"pub"},{"from":"sca","to":"hle"},{"from":"skk","to":"oyb"},{"from":"tdu","to":"dtp"},{"from":"thc","to":"tpo"},{"from":"thx","to":"oyb"},{"from":"tie","to":"ras"},{"from":"tkk","to":"twm"},{"from":"tlw","to":"weo"},{"from":"tmp","to":"tyj"},{"from":"tne","to":"kak"},{"from":"tnf","to":"fa-af"},{"from":"tsf","to":"taj"},{"from":"uok","to":"ema"},{"from":"xba","to":"cax"},{"from":"xia","to":"acn"},{"from":"xkh","to":"waw"},{"from":"xsj","to":"suj"},{"from":"ybd","to":"rki"},{"from":"yma","to":"lrr"},{"from":"ymt","to":"mtm"},{"from":"yos","to":"zom"},{"from":"yuu","to":"yug"},{"from":"asd","to":"snz"},{"from":"dit","to":"dif"},{"from":"llo","to":"ngt"},{"from":"myd","to":"aog"},{"from":"nns","to":"nbr"},{"from":"sgn-br","to":"bzs"},{"from":"sgn-co","to":"csn"},{"from":"sgn-de","to":"gsg"},{"from":"sgn-dk","to":"dsl"},{"from":"sgn-fr","to":"fsl"},{"from":"sgn-gb","to":"bfi"},{"from":"sgn-gr","to":"gss"},{"from":"sgn-ie","to":"isg"},{"from":"sgn-it","to":"ise"},{"from":"sgn-jp","to":"jsl"},{"from":"sgn-mx","to":"mfs"},{"from":"sgn-ni","to":"ncs"},{"from":"sgn-nl","to":"dse"},{"from":"sgn-no","to":"nsi"},{"from":"sgn-pt","to":"psr"},{"from":"sgn-se","to":"swl"},{"from":"sgn-us","to":"ase"},{"from":"sgn-za","to":"sfs"},{"from":"no-bokmal","to":"nb"},{"from":"no-nynorsk","to":"nn"},{"from":"aa-saaho","to":"ssy"},{"from":"sh","to":"sr-latn"},{"from":"cnr","to":"sr-me"},{"from":"no","to":"nb"},{"from":"tl","to":"fil"},{"from":"az-az","to":"az-latn-az"},{"from":"bs-ba","to":"bs-latn-ba"},{"from":"ha-latn-gh","to":"ha-gh"},{"from":"ha-latn-ne","to":"ha-ne"},{"from":"ha-latn-ng","to":"ha-ng"},{"from":"kk-cyrl-kz","to":"kk-kz"},{"from":"ky-cyrl-kg","to":"ky-kg"},{"from":"ks-arab-in","to":"ks-in"},{"from":"mn-cyrl-mn","to":"mn-mn"},{"from":"ms-latn-bn","to":"ms-bn"},{"from":"ms-latn-my","to":"ms-my"},{"from":"ms-latn-sg","to":"ms-sg"},{"from":"pa-in","to":"pa-guru-in"},{"from":"pa-pk","to":"pa-arab-pk"},{"from":"shi-ma","to":"shi-tfng-ma"},{"from":"sr-ba","to":"sr-cyrl-ba"},{"from":"sr-me","to":"sr-latn-me"},{"from":"sr-rs","to":"sr-cyrl-rs"},{"from":"sr-xk","to":"sr-cyrl-xk"},{"from":"tzm-latn-ma","to":"tzm-ma"},{"from":"ug-arab-cn","to":"ug-cn"},{"from":"uz-af","to":"uz-arab-af"},{"from":"uz-uz","to":"uz-latn-uz"},{"from":"vai-lr","to":"vai-vaii-lr"},{"from":"yue-cn","to":"yue-hans-cn"},{"from":"yue-hk","to":"yue-hant-hk"},{"from":"zh-cn","to":"zh-hans-cn"},{"from":"zh-hk","to":"zh-hant-hk"},{"from":"zh-mo","to":"zh-hant-mo"},{"from":"zh-sg","to":"zh-hans-sg"},{"from":"zh-tw","to":"zh-hant-tw"},{"from":"aju","to":"jrb"},{"from":"als","to":"sq"},{"from":"arb","to":"ar"},{"from":"ayr","to":"ay"},{"from":"azj","to":"az"},{"from":"bcc","to":"bal"},{"from":"bcl","to":"bik"},{"from":"bxk","to":"luy"},{"from":"bxr","to":"bua"},{"from":"cld","to":"syr"},{"from":"cmn","to":"zh"},{"from":"cwd","to":"cr"},{"from":"dgo","to":"doi"},{"from":"dhd","to":"mwr"},{"from":"dik","to":"din"},{"from":"diq","to":"zza"},{"from":"lbk","to":"bnc"},{"from":"ekk","to":"et"},{"from":"emk","to":"man"},{"from":"esk","to":"ik"},{"from":"fat","to":"ak"},{"from":"fuc","to":"ff"},{"from":"gaz","to":"om"},{"from":"gbo","to":"grb"},{"from":"gno","to":"gon"},{"from":"gug","to":"gn"},{"from":"gya","to":"gba"},{"from":"hdn","to":"hai"},{"from":"hea","to":"hmn"},{"from":"ike","to":"iu"},{"from":"kmr","to":"ku"},{"from":"knc","to":"kr"},{"from":"kng","to":"kg"},{"from":"knn","to":"kok"},{"from":"kpv","to":"kv"},{"from":"lvs","to":"lv"},{"from":"mhr","to":"chm"},{"from":"mup","to":"raj"},{"from":"khk","to":"mn"},{"from":"npi","to":"ne"},{"from":"ojg","to":"oj"},{"from":"ory","to":"or"},{"from":"pbu","to":"ps"},{"from":"pes","to":"fa"},{"from":"plt","to":"mg"},{"from":"pnb","to":"lah"},{"from":"quz","to":"qu"},{"from":"rmy","to":"rom"},{"from":"spy","to":"kln"},{"from":"src","to":"sc"},{"from":"swh","to":"sw"},{"from":"ttq","to":"tmh"},{"from":"tw","to":"ak"},{"from":"umu","to":"del"},{"from":"uzn","to":"uz"},{"from":"xpe","to":"kpe"},{"from":"xsl","to":"den"},{"from":"ydd","to":"yi"},{"from":"zai","to":"zap"},{"from":"zsm","to":"ms"},{"from":"zyb","to":"za"},{"from":"him","to":"srx"},{"from":"mnk","to":"man"},{"from":"bh","to":"bho"},{"from":"prs","to":"fa-af"},{"from":"swc","to":"sw-cd"},{"from":"aar","to":"aa"},{"from":"abk","to":"ab"},{"from":"ave","to":"ae"},{"from":"afr","to":"af"},{"from":"aka","to":"ak"},{"from":"amh","to":"am"},{"from":"arg","to":"an"},{"from":"ara","to":"ar"},{"from":"asm","to":"as"},{"from":"ava","to":"av"},{"from":"aym","to":"ay"},{"from":"aze","to":"az"},{"from":"bak","to":"ba"},{"from":"bel","to":"be"},{"from":"bul","to":"bg"},{"from":"bih","to":"bho"},{"from":"bis","to":"bi"},{"from":"bam","to":"bm"},{"from":"ben","to":"bn"},{"from":"bod","to":"bo"},{"from":"bre","to":"br"},{"from":"bos","to":"bs"},{"from":"cat","to":"ca"},{"from":"che","to":"ce"},{"from":"cha","to":"ch"},{"from":"cos","to":"co"},{"from":"cre","to":"cr"},{"from":"ces","to":"cs"},{"from":"chu","to":"cu"},{"from":"chv","to":"cv"},{"from":"cym","to":"cy"},{"from":"dan","to":"da"},{"from":"deu","to":"de"},{"from":"div","to":"dv"},{"from":"dzo","to":"dz"},{"from":"ewe","to":"ee"},{"from":"ell","to":"el"},{"from":"eng","to":"en"},{"from":"epo","to":"eo"},{"from":"spa","to":"es"},{"from":"est","to":"et"},{"from":"eus","to":"eu"},{"from":"fas","to":"fa"},{"from":"ful","to":"ff"},{"from":"fin","to":"fi"},{"from":"fij","to":"fj"},{"from":"fao","to":"fo"},{"from":"fra","to":"fr"},{"from":"fry","to":"fy"},{"from":"gle","to":"ga"},{"from":"gla","to":"gd"},{"from":"glg","to":"gl"},{"from":"grn","to":"gn"},{"from":"guj","to":"gu"},{"from":"glv","to":"gv"},{"from":"hau","to":"ha"},{"from":"heb","to":"he"},{"from":"hin","to":"hi"},{"from":"hmo","to":"ho"},{"from":"hrv","to":"hr"},{"from":"hat","to":"ht"},{"from":"hun","to":"hu"},{"from":"hye","to":"hy"},{"from":"her","to":"hz"},{"from":"ina","to":"ia"},{"from":"ind","to":"id"},{"from":"ile","to":"ie"},{"from":"ibo","to":"ig"},{"from":"iii","to":"ii"},{"from":"ipk","to":"ik"},{"from":"ido","to":"io"},{"from":"isl","to":"is"},{"from":"ita","to":"it"},{"from":"iku","to":"iu"},{"from":"jpn","to":"ja"},{"from":"jav","to":"jv"},{"from":"kat","to":"ka"},{"from":"kon","to":"kg"},{"from":"kik","to":"ki"},{"from":"kua","to":"kj"},{"from":"kaz","to":"kk"},{"from":"kal","to":"kl"},{"from":"khm","to":"km"},{"from":"kan","to":"kn"},{"from":"kor","to":"ko"},{"from":"kau","to":"kr"},{"from":"kas","to":"ks"},{"from":"kur","to":"ku"},{"from":"kom","to":"kv"},{"from":"cor","to":"kw"},{"from":"kir","to":"ky"},{"from":"lat","to":"la"},{"from":"ltz","to":"lb"},{"from":"lug","to":"lg"},{"from":"lim","to":"li"},{"from":"lin","to":"ln"},{"from":"lao","to":"lo"},{"from":"lit","to":"lt"},{"from":"lub","to":"lu"},{"from":"lav","to":"lv"},{"from":"mlg","to":"mg"},{"from":"mah","to":"mh"},{"from":"mri","to":"mi"},{"from":"mkd","to":"mk"},{"from":"mal","to":"ml"},{"from":"mon","to":"mn"},{"from":"mol","to":"ro"},{"from":"mar","to":"mr"},{"from":"msa","to":"ms"},{"from":"mlt","to":"mt"},{"from":"mya","to":"my"},{"from":"nau","to":"na"},{"from":"nob","to":"nb"},{"from":"nde","to":"nd"},{"from":"nep","to":"ne"},{"from":"ndo","to":"ng"},{"from":"nld","to":"nl"},{"from":"nno","to":"nn"},{"from":"nor","to":"nb"},{"from":"nbl","to":"nr"},{"from":"nav","to":"nv"},{"from":"nya","to":"ny"},{"from":"oci","to":"oc"},{"from":"oji","to":"oj"},{"from":"orm","to":"om"},{"from":"ori","to":"or"},{"from":"oss","to":"os"},{"from":"pan","to":"pa"},{"from":"pli","to":"pi"},{"from":"pol","to":"pl"},{"from":"pus","to":"ps"},{"from":"por","to":"pt"},{"from":"que","to":"qu"},{"from":"roh","to":"rm"},{"from":"run","to":"rn"},{"from":"ron","to":"ro"},{"from":"rus","to":"ru"},{"from":"kin","to":"rw"},{"from":"san","to":"sa"},{"from":"srd","to":"sc"},{"from":"snd","to":"sd"},{"from":"sme","to":"se"},{"from":"sag","to":"sg"},{"from":"hbs","to":"sr-latn"},{"from":"sin","to":"si"},{"from":"slk","to":"sk"},{"from":"slv","to":"sl"},{"from":"smo","to":"sm"},{"from":"sna","to":"sn"},{"from":"som","to":"so"},{"from":"sqi","to":"sq"},{"from":"srp","to":"sr"},{"from":"ssw","to":"ss"},{"from":"sot","to":"st"},{"from":"sun","to":"su"},{"from":"swe","to":"sv"},{"from":"swa","to":"sw"},{"from":"tam","to":"ta"},{"from":"tel","to":"te"},{"from":"tgk","to":"tg"},{"from":"tha","to":"th"},{"from":"tir","to":"ti"},{"from":"tuk","to":"tk"},{"from":"tgl","to":"fil"},{"from":"tsn","to":"tn"},{"from":"ton","to":"to"},{"from":"tur","to":"tr"},{"from":"tso","to":"ts"},{"from":"tat","to":"tt"},{"from":"twi","to":"ak"},{"from":"tah","to":"ty"},{"from":"uig","to":"ug"},{"from":"ukr","to":"uk"},{"from":"urd","to":"ur"},{"from":"uzb","to":"uz"},{"from":"ven","to":"ve"},{"from":"vie","to":"vi"},{"from":"vol","to":"vo"},{"from":"wln","to":"wa"},{"from":"wol","to":"wo"},{"from":"xho","to":"xh"},{"from":"yid","to":"yi"},{"from":"yor","to":"yo"},{"from":"zha","to":"za"},{"from":"zho","to":"zh"},{"from":"zul","to":"zu"},{"from":"alb","to":"sq"},{"from":"arm","to":"hy"},{"from":"baq","to":"eu"},{"from":"bur","to":"my"},{"from":"chi","to":"zh"},{"from":"cze","to":"cs"},{"from":"dut","to":"nl"},{"from":"fre","to":"fr"},{"from":"geo","to":"ka"},{"from":"ger","to":"de"},{"from":"gre","to":"el"},{"from":"ice","to":"is"},{"from":"mac","to":"mk"},{"from":"mao","to":"mi"},{"from":"may","to":"ms"},{"from":"per","to":"fa"},{"from":"rum","to":"ro"},{"from":"slo","to":"sk"},{"from":"tib","to":"bo"},{"from":"wel","to":"cy"}]')},function(e){e.exports=JSON.parse('[{"from":{"field":"script","value":"qaai"},"to":{"field":"script","value":"zinh"}},{"from":{"field":"region","value":"bu"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"ct"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"dd"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"dy"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"fx"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"hv"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"jt"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"mi"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"nh"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"nq"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"pu"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"pz"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"qu"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"rh"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"tp"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"uk"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"vd"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"wk"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"yd"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"zr"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"230"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"280"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"736"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"886"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"958"},"to":{"field":"region","value":"aa"}},{"from":{"field":"region","value":"020"},"to":{"field":"region","value":"ad"}},{"from":{"field":"region","value":"784"},"to":{"field":"region","value":"ae"}},{"from":{"field":"region","value":"004"},"to":{"field":"region","value":"af"}},{"from":{"field":"region","value":"028"},"to":{"field":"region","value":"ag"}},{"from":{"field":"region","value":"660"},"to":{"field":"region","value":"ai"}},{"from":{"field":"region","value":"008"},"to":{"field":"region","value":"al"}},{"from":{"field":"region","value":"051"},"to":{"field":"region","value":"am"}},{"from":{"field":"region","value":"024"},"to":{"field":"region","value":"ao"}},{"from":{"field":"region","value":"010"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"032"},"to":{"field":"region","value":"ar"}},{"from":{"field":"region","value":"016"},"to":{"field":"region","value":"as"}},{"from":{"field":"region","value":"040"},"to":{"field":"region","value":"at"}},{"from":{"field":"region","value":"036"},"to":{"field":"region","value":"au"}},{"from":{"field":"region","value":"533"},"to":{"field":"region","value":"aw"}},{"from":{"field":"region","value":"248"},"to":{"field":"region","value":"ax"}},{"from":{"field":"region","value":"031"},"to":{"field":"region","value":"az"}},{"from":{"field":"region","value":"070"},"to":{"field":"region","value":"ba"}},{"from":{"field":"region","value":"052"},"to":{"field":"region","value":"bb"}},{"from":{"field":"region","value":"050"},"to":{"field":"region","value":"bd"}},{"from":{"field":"region","value":"056"},"to":{"field":"region","value":"be"}},{"from":{"field":"region","value":"854"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"100"},"to":{"field":"region","value":"bg"}},{"from":{"field":"region","value":"048"},"to":{"field":"region","value":"bh"}},{"from":{"field":"region","value":"108"},"to":{"field":"region","value":"bi"}},{"from":{"field":"region","value":"204"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"652"},"to":{"field":"region","value":"bl"}},{"from":{"field":"region","value":"060"},"to":{"field":"region","value":"bm"}},{"from":{"field":"region","value":"096"},"to":{"field":"region","value":"bn"}},{"from":{"field":"region","value":"068"},"to":{"field":"region","value":"bo"}},{"from":{"field":"region","value":"535"},"to":{"field":"region","value":"bq"}},{"from":{"field":"region","value":"076"},"to":{"field":"region","value":"br"}},{"from":{"field":"region","value":"044"},"to":{"field":"region","value":"bs"}},{"from":{"field":"region","value":"064"},"to":{"field":"region","value":"bt"}},{"from":{"field":"region","value":"104"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"074"},"to":{"field":"region","value":"bv"}},{"from":{"field":"region","value":"072"},"to":{"field":"region","value":"bw"}},{"from":{"field":"region","value":"112"},"to":{"field":"region","value":"by"}},{"from":{"field":"region","value":"084"},"to":{"field":"region","value":"bz"}},{"from":{"field":"region","value":"124"},"to":{"field":"region","value":"ca"}},{"from":{"field":"region","value":"166"},"to":{"field":"region","value":"cc"}},{"from":{"field":"region","value":"180"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"140"},"to":{"field":"region","value":"cf"}},{"from":{"field":"region","value":"178"},"to":{"field":"region","value":"cg"}},{"from":{"field":"region","value":"756"},"to":{"field":"region","value":"ch"}},{"from":{"field":"region","value":"384"},"to":{"field":"region","value":"ci"}},{"from":{"field":"region","value":"184"},"to":{"field":"region","value":"ck"}},{"from":{"field":"region","value":"152"},"to":{"field":"region","value":"cl"}},{"from":{"field":"region","value":"120"},"to":{"field":"region","value":"cm"}},{"from":{"field":"region","value":"156"},"to":{"field":"region","value":"cn"}},{"from":{"field":"region","value":"170"},"to":{"field":"region","value":"co"}},{"from":{"field":"region","value":"188"},"to":{"field":"region","value":"cr"}},{"from":{"field":"region","value":"192"},"to":{"field":"region","value":"cu"}},{"from":{"field":"region","value":"132"},"to":{"field":"region","value":"cv"}},{"from":{"field":"region","value":"531"},"to":{"field":"region","value":"cw"}},{"from":{"field":"region","value":"162"},"to":{"field":"region","value":"cx"}},{"from":{"field":"region","value":"196"},"to":{"field":"region","value":"cy"}},{"from":{"field":"region","value":"203"},"to":{"field":"region","value":"cz"}},{"from":{"field":"region","value":"278"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"276"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"262"},"to":{"field":"region","value":"dj"}},{"from":{"field":"region","value":"208"},"to":{"field":"region","value":"dk"}},{"from":{"field":"region","value":"212"},"to":{"field":"region","value":"dm"}},{"from":{"field":"region","value":"214"},"to":{"field":"region","value":"do"}},{"from":{"field":"region","value":"012"},"to":{"field":"region","value":"dz"}},{"from":{"field":"region","value":"218"},"to":{"field":"region","value":"ec"}},{"from":{"field":"region","value":"233"},"to":{"field":"region","value":"ee"}},{"from":{"field":"region","value":"818"},"to":{"field":"region","value":"eg"}},{"from":{"field":"region","value":"732"},"to":{"field":"region","value":"eh"}},{"from":{"field":"region","value":"232"},"to":{"field":"region","value":"er"}},{"from":{"field":"region","value":"724"},"to":{"field":"region","value":"es"}},{"from":{"field":"region","value":"231"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"246"},"to":{"field":"region","value":"fi"}},{"from":{"field":"region","value":"242"},"to":{"field":"region","value":"fj"}},{"from":{"field":"region","value":"238"},"to":{"field":"region","value":"fk"}},{"from":{"field":"region","value":"583"},"to":{"field":"region","value":"fm"}},{"from":{"field":"region","value":"234"},"to":{"field":"region","value":"fo"}},{"from":{"field":"region","value":"250"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"249"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"266"},"to":{"field":"region","value":"ga"}},{"from":{"field":"region","value":"826"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"308"},"to":{"field":"region","value":"gd"}},{"from":{"field":"region","value":"268"},"to":{"field":"region","value":"ge"}},{"from":{"field":"region","value":"254"},"to":{"field":"region","value":"gf"}},{"from":{"field":"region","value":"831"},"to":{"field":"region","value":"gg"}},{"from":{"field":"region","value":"288"},"to":{"field":"region","value":"gh"}},{"from":{"field":"region","value":"292"},"to":{"field":"region","value":"gi"}},{"from":{"field":"region","value":"304"},"to":{"field":"region","value":"gl"}},{"from":{"field":"region","value":"270"},"to":{"field":"region","value":"gm"}},{"from":{"field":"region","value":"324"},"to":{"field":"region","value":"gn"}},{"from":{"field":"region","value":"312"},"to":{"field":"region","value":"gp"}},{"from":{"field":"region","value":"226"},"to":{"field":"region","value":"gq"}},{"from":{"field":"region","value":"300"},"to":{"field":"region","value":"gr"}},{"from":{"field":"region","value":"239"},"to":{"field":"region","value":"gs"}},{"from":{"field":"region","value":"320"},"to":{"field":"region","value":"gt"}},{"from":{"field":"region","value":"316"},"to":{"field":"region","value":"gu"}},{"from":{"field":"region","value":"624"},"to":{"field":"region","value":"gw"}},{"from":{"field":"region","value":"328"},"to":{"field":"region","value":"gy"}},{"from":{"field":"region","value":"344"},"to":{"field":"region","value":"hk"}},{"from":{"field":"region","value":"334"},"to":{"field":"region","value":"hm"}},{"from":{"field":"region","value":"340"},"to":{"field":"region","value":"hn"}},{"from":{"field":"region","value":"191"},"to":{"field":"region","value":"hr"}},{"from":{"field":"region","value":"332"},"to":{"field":"region","value":"ht"}},{"from":{"field":"region","value":"348"},"to":{"field":"region","value":"hu"}},{"from":{"field":"region","value":"360"},"to":{"field":"region","value":"id"}},{"from":{"field":"region","value":"372"},"to":{"field":"region","value":"ie"}},{"from":{"field":"region","value":"376"},"to":{"field":"region","value":"il"}},{"from":{"field":"region","value":"833"},"to":{"field":"region","value":"im"}},{"from":{"field":"region","value":"356"},"to":{"field":"region","value":"in"}},{"from":{"field":"region","value":"086"},"to":{"field":"region","value":"io"}},{"from":{"field":"region","value":"368"},"to":{"field":"region","value":"iq"}},{"from":{"field":"region","value":"364"},"to":{"field":"region","value":"ir"}},{"from":{"field":"region","value":"352"},"to":{"field":"region","value":"is"}},{"from":{"field":"region","value":"380"},"to":{"field":"region","value":"it"}},{"from":{"field":"region","value":"832"},"to":{"field":"region","value":"je"}},{"from":{"field":"region","value":"388"},"to":{"field":"region","value":"jm"}},{"from":{"field":"region","value":"400"},"to":{"field":"region","value":"jo"}},{"from":{"field":"region","value":"392"},"to":{"field":"region","value":"jp"}},{"from":{"field":"region","value":"404"},"to":{"field":"region","value":"ke"}},{"from":{"field":"region","value":"417"},"to":{"field":"region","value":"kg"}},{"from":{"field":"region","value":"116"},"to":{"field":"region","value":"kh"}},{"from":{"field":"region","value":"296"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"174"},"to":{"field":"region","value":"km"}},{"from":{"field":"region","value":"659"},"to":{"field":"region","value":"kn"}},{"from":{"field":"region","value":"408"},"to":{"field":"region","value":"kp"}},{"from":{"field":"region","value":"410"},"to":{"field":"region","value":"kr"}},{"from":{"field":"region","value":"414"},"to":{"field":"region","value":"kw"}},{"from":{"field":"region","value":"136"},"to":{"field":"region","value":"ky"}},{"from":{"field":"region","value":"398"},"to":{"field":"region","value":"kz"}},{"from":{"field":"region","value":"418"},"to":{"field":"region","value":"la"}},{"from":{"field":"region","value":"422"},"to":{"field":"region","value":"lb"}},{"from":{"field":"region","value":"662"},"to":{"field":"region","value":"lc"}},{"from":{"field":"region","value":"438"},"to":{"field":"region","value":"li"}},{"from":{"field":"region","value":"144"},"to":{"field":"region","value":"lk"}},{"from":{"field":"region","value":"430"},"to":{"field":"region","value":"lr"}},{"from":{"field":"region","value":"426"},"to":{"field":"region","value":"ls"}},{"from":{"field":"region","value":"440"},"to":{"field":"region","value":"lt"}},{"from":{"field":"region","value":"442"},"to":{"field":"region","value":"lu"}},{"from":{"field":"region","value":"428"},"to":{"field":"region","value":"lv"}},{"from":{"field":"region","value":"434"},"to":{"field":"region","value":"ly"}},{"from":{"field":"region","value":"504"},"to":{"field":"region","value":"ma"}},{"from":{"field":"region","value":"492"},"to":{"field":"region","value":"mc"}},{"from":{"field":"region","value":"498"},"to":{"field":"region","value":"md"}},{"from":{"field":"region","value":"499"},"to":{"field":"region","value":"me"}},{"from":{"field":"region","value":"663"},"to":{"field":"region","value":"mf"}},{"from":{"field":"region","value":"450"},"to":{"field":"region","value":"mg"}},{"from":{"field":"region","value":"584"},"to":{"field":"region","value":"mh"}},{"from":{"field":"region","value":"807"},"to":{"field":"region","value":"mk"}},{"from":{"field":"region","value":"466"},"to":{"field":"region","value":"ml"}},{"from":{"field":"region","value":"496"},"to":{"field":"region","value":"mn"}},{"from":{"field":"region","value":"446"},"to":{"field":"region","value":"mo"}},{"from":{"field":"region","value":"580"},"to":{"field":"region","value":"mp"}},{"from":{"field":"region","value":"474"},"to":{"field":"region","value":"mq"}},{"from":{"field":"region","value":"478"},"to":{"field":"region","value":"mr"}},{"from":{"field":"region","value":"500"},"to":{"field":"region","value":"ms"}},{"from":{"field":"region","value":"470"},"to":{"field":"region","value":"mt"}},{"from":{"field":"region","value":"480"},"to":{"field":"region","value":"mu"}},{"from":{"field":"region","value":"462"},"to":{"field":"region","value":"mv"}},{"from":{"field":"region","value":"454"},"to":{"field":"region","value":"mw"}},{"from":{"field":"region","value":"484"},"to":{"field":"region","value":"mx"}},{"from":{"field":"region","value":"458"},"to":{"field":"region","value":"my"}},{"from":{"field":"region","value":"508"},"to":{"field":"region","value":"mz"}},{"from":{"field":"region","value":"516"},"to":{"field":"region","value":"na"}},{"from":{"field":"region","value":"540"},"to":{"field":"region","value":"nc"}},{"from":{"field":"region","value":"562"},"to":{"field":"region","value":"ne"}},{"from":{"field":"region","value":"574"},"to":{"field":"region","value":"nf"}},{"from":{"field":"region","value":"566"},"to":{"field":"region","value":"ng"}},{"from":{"field":"region","value":"558"},"to":{"field":"region","value":"ni"}},{"from":{"field":"region","value":"528"},"to":{"field":"region","value":"nl"}},{"from":{"field":"region","value":"578"},"to":{"field":"region","value":"no"}},{"from":{"field":"region","value":"524"},"to":{"field":"region","value":"np"}},{"from":{"field":"region","value":"520"},"to":{"field":"region","value":"nr"}},{"from":{"field":"region","value":"570"},"to":{"field":"region","value":"nu"}},{"from":{"field":"region","value":"554"},"to":{"field":"region","value":"nz"}},{"from":{"field":"region","value":"512"},"to":{"field":"region","value":"om"}},{"from":{"field":"region","value":"591"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"604"},"to":{"field":"region","value":"pe"}},{"from":{"field":"region","value":"258"},"to":{"field":"region","value":"pf"}},{"from":{"field":"region","value":"598"},"to":{"field":"region","value":"pg"}},{"from":{"field":"region","value":"608"},"to":{"field":"region","value":"ph"}},{"from":{"field":"region","value":"586"},"to":{"field":"region","value":"pk"}},{"from":{"field":"region","value":"616"},"to":{"field":"region","value":"pl"}},{"from":{"field":"region","value":"666"},"to":{"field":"region","value":"pm"}},{"from":{"field":"region","value":"612"},"to":{"field":"region","value":"pn"}},{"from":{"field":"region","value":"630"},"to":{"field":"region","value":"pr"}},{"from":{"field":"region","value":"275"},"to":{"field":"region","value":"ps"}},{"from":{"field":"region","value":"620"},"to":{"field":"region","value":"pt"}},{"from":{"field":"region","value":"585"},"to":{"field":"region","value":"pw"}},{"from":{"field":"region","value":"600"},"to":{"field":"region","value":"py"}},{"from":{"field":"region","value":"634"},"to":{"field":"region","value":"qa"}},{"from":{"field":"region","value":"959"},"to":{"field":"region","value":"qm"}},{"from":{"field":"region","value":"960"},"to":{"field":"region","value":"qn"}},{"from":{"field":"region","value":"962"},"to":{"field":"region","value":"qp"}},{"from":{"field":"region","value":"963"},"to":{"field":"region","value":"qq"}},{"from":{"field":"region","value":"964"},"to":{"field":"region","value":"qr"}},{"from":{"field":"region","value":"965"},"to":{"field":"region","value":"qs"}},{"from":{"field":"region","value":"966"},"to":{"field":"region","value":"qt"}},{"from":{"field":"region","value":"967"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"968"},"to":{"field":"region","value":"qv"}},{"from":{"field":"region","value":"969"},"to":{"field":"region","value":"qw"}},{"from":{"field":"region","value":"970"},"to":{"field":"region","value":"qx"}},{"from":{"field":"region","value":"971"},"to":{"field":"region","value":"qy"}},{"from":{"field":"region","value":"972"},"to":{"field":"region","value":"qz"}},{"from":{"field":"region","value":"638"},"to":{"field":"region","value":"re"}},{"from":{"field":"region","value":"642"},"to":{"field":"region","value":"ro"}},{"from":{"field":"region","value":"688"},"to":{"field":"region","value":"rs"}},{"from":{"field":"region","value":"643"},"to":{"field":"region","value":"ru"}},{"from":{"field":"region","value":"646"},"to":{"field":"region","value":"rw"}},{"from":{"field":"region","value":"682"},"to":{"field":"region","value":"sa"}},{"from":{"field":"region","value":"090"},"to":{"field":"region","value":"sb"}},{"from":{"field":"region","value":"690"},"to":{"field":"region","value":"sc"}},{"from":{"field":"region","value":"729"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"752"},"to":{"field":"region","value":"se"}},{"from":{"field":"region","value":"702"},"to":{"field":"region","value":"sg"}},{"from":{"field":"region","value":"654"},"to":{"field":"region","value":"sh"}},{"from":{"field":"region","value":"705"},"to":{"field":"region","value":"si"}},{"from":{"field":"region","value":"744"},"to":{"field":"region","value":"sj"}},{"from":{"field":"region","value":"703"},"to":{"field":"region","value":"sk"}},{"from":{"field":"region","value":"694"},"to":{"field":"region","value":"sl"}},{"from":{"field":"region","value":"674"},"to":{"field":"region","value":"sm"}},{"from":{"field":"region","value":"686"},"to":{"field":"region","value":"sn"}},{"from":{"field":"region","value":"706"},"to":{"field":"region","value":"so"}},{"from":{"field":"region","value":"740"},"to":{"field":"region","value":"sr"}},{"from":{"field":"region","value":"728"},"to":{"field":"region","value":"ss"}},{"from":{"field":"region","value":"678"},"to":{"field":"region","value":"st"}},{"from":{"field":"region","value":"222"},"to":{"field":"region","value":"sv"}},{"from":{"field":"region","value":"534"},"to":{"field":"region","value":"sx"}},{"from":{"field":"region","value":"760"},"to":{"field":"region","value":"sy"}},{"from":{"field":"region","value":"748"},"to":{"field":"region","value":"sz"}},{"from":{"field":"region","value":"796"},"to":{"field":"region","value":"tc"}},{"from":{"field":"region","value":"148"},"to":{"field":"region","value":"td"}},{"from":{"field":"region","value":"260"},"to":{"field":"region","value":"tf"}},{"from":{"field":"region","value":"768"},"to":{"field":"region","value":"tg"}},{"from":{"field":"region","value":"764"},"to":{"field":"region","value":"th"}},{"from":{"field":"region","value":"762"},"to":{"field":"region","value":"tj"}},{"from":{"field":"region","value":"772"},"to":{"field":"region","value":"tk"}},{"from":{"field":"region","value":"626"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"795"},"to":{"field":"region","value":"tm"}},{"from":{"field":"region","value":"788"},"to":{"field":"region","value":"tn"}},{"from":{"field":"region","value":"776"},"to":{"field":"region","value":"to"}},{"from":{"field":"region","value":"792"},"to":{"field":"region","value":"tr"}},{"from":{"field":"region","value":"780"},"to":{"field":"region","value":"tt"}},{"from":{"field":"region","value":"798"},"to":{"field":"region","value":"tv"}},{"from":{"field":"region","value":"158"},"to":{"field":"region","value":"tw"}},{"from":{"field":"region","value":"834"},"to":{"field":"region","value":"tz"}},{"from":{"field":"region","value":"804"},"to":{"field":"region","value":"ua"}},{"from":{"field":"region","value":"800"},"to":{"field":"region","value":"ug"}},{"from":{"field":"region","value":"581"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"840"},"to":{"field":"region","value":"us"}},{"from":{"field":"region","value":"858"},"to":{"field":"region","value":"uy"}},{"from":{"field":"region","value":"860"},"to":{"field":"region","value":"uz"}},{"from":{"field":"region","value":"336"},"to":{"field":"region","value":"va"}},{"from":{"field":"region","value":"670"},"to":{"field":"region","value":"vc"}},{"from":{"field":"region","value":"862"},"to":{"field":"region","value":"ve"}},{"from":{"field":"region","value":"092"},"to":{"field":"region","value":"vg"}},{"from":{"field":"region","value":"850"},"to":{"field":"region","value":"vi"}},{"from":{"field":"region","value":"704"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"548"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"876"},"to":{"field":"region","value":"wf"}},{"from":{"field":"region","value":"882"},"to":{"field":"region","value":"ws"}},{"from":{"field":"region","value":"973"},"to":{"field":"region","value":"xa"}},{"from":{"field":"region","value":"974"},"to":{"field":"region","value":"xb"}},{"from":{"field":"region","value":"975"},"to":{"field":"region","value":"xc"}},{"from":{"field":"region","value":"976"},"to":{"field":"region","value":"xd"}},{"from":{"field":"region","value":"977"},"to":{"field":"region","value":"xe"}},{"from":{"field":"region","value":"978"},"to":{"field":"region","value":"xf"}},{"from":{"field":"region","value":"979"},"to":{"field":"region","value":"xg"}},{"from":{"field":"region","value":"980"},"to":{"field":"region","value":"xh"}},{"from":{"field":"region","value":"981"},"to":{"field":"region","value":"xi"}},{"from":{"field":"region","value":"982"},"to":{"field":"region","value":"xj"}},{"from":{"field":"region","value":"983"},"to":{"field":"region","value":"xk"}},{"from":{"field":"region","value":"984"},"to":{"field":"region","value":"xl"}},{"from":{"field":"region","value":"985"},"to":{"field":"region","value":"xm"}},{"from":{"field":"region","value":"986"},"to":{"field":"region","value":"xn"}},{"from":{"field":"region","value":"987"},"to":{"field":"region","value":"xo"}},{"from":{"field":"region","value":"988"},"to":{"field":"region","value":"xp"}},{"from":{"field":"region","value":"989"},"to":{"field":"region","value":"xq"}},{"from":{"field":"region","value":"990"},"to":{"field":"region","value":"xr"}},{"from":{"field":"region","value":"991"},"to":{"field":"region","value":"xs"}},{"from":{"field":"region","value":"992"},"to":{"field":"region","value":"xt"}},{"from":{"field":"region","value":"993"},"to":{"field":"region","value":"xu"}},{"from":{"field":"region","value":"994"},"to":{"field":"region","value":"xv"}},{"from":{"field":"region","value":"995"},"to":{"field":"region","value":"xw"}},{"from":{"field":"region","value":"996"},"to":{"field":"region","value":"xx"}},{"from":{"field":"region","value":"997"},"to":{"field":"region","value":"xy"}},{"from":{"field":"region","value":"998"},"to":{"field":"region","value":"xz"}},{"from":{"field":"region","value":"720"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"887"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"175"},"to":{"field":"region","value":"yt"}},{"from":{"field":"region","value":"710"},"to":{"field":"region","value":"za"}},{"from":{"field":"region","value":"894"},"to":{"field":"region","value":"zm"}},{"from":{"field":"region","value":"716"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"999"},"to":{"field":"region","value":"zz"}},{"from":{"field":"variants","value":"aaland"},"to":{"field":"region","value":"ax"}},{"from":{"field":"variants","value":"polytoni"},"to":{"field":"variants","value":"polyton"}},{"from":{"field":"variants","value":"heploc"},"to":{"field":"variants","value":"alalc97"}},{"from":{"field":"variants","value":"arevela"},"to":{"field":"language","value":"hy"}},{"from":{"field":"variants","value":"arevmda"},"to":{"field":"language","value":"hyw"}}]')},function(e){e.exports=JSON.parse('["mni-beng-in","mni-mtei-in","sat-deva-in","sat-olck-in","shi-latn-ma","shi-tfng-ma","vai-latn-lr","vai-vaii-lr","yue-hans-cn","yue-hant-hk","az-arab-ir","az-cyrl-az","az-latn-az","bm-nkoo-ml","bs-cyrl-ba","bs-latn-ba","en-dsrt-us","ff-adlm-gn","ff-latn-sn","ha-arab-ng","hi-latn-in","iu-latn-ca","ks-arab-in","ks-deva-in","mn-mong-cn","ms-arab-my","pa-arab-pk","pa-guru-in","sd-arab-pk","sd-deva-in","sr-cyrl-rs","sr-latn-rs","su-latn-id","uz-arab-af","uz-cyrl-uz","uz-latn-uz","zh-hans-cn","zh-hant-tw","mni-beng","sat-olck","shi-tfng","vai-vaii","yue-hant","az-latn","bs-latn","ff-latn","jbo-001","ks-arab","pa-guru","prg-001","sd-arab","sr-cyrl","su-latn","uz-latn","zh-hans","agq-cm","ar-001","arn-cl","asa-tz","ast-es","bas-cm","bem-zm","bez-tz","bgn-pk","blt-vn","brx-in","bss-cm","byn-er","cad-us","cch-ng","ccp-bd","ceb-ph","cgg-ug","chr-us","cic-us","ckb-iq","dav-ke","dje-ne","doi-in","dsb-de","dua-cm","dyo-sn","ebu-ke","eo-001","ewo-cm","fil-ph","fur-it","gaa-gh","gez-et","gsw-ch","guz-ke","haw-us","hsb-de","ia-001","ife-tg","io-001","jgo-cm","jmc-tz","kab-dz","kaj-ng","kam-ke","kcg-ng","kde-tz","kea-cv","ken-cm","khq-ml","kkj-cm","kln-ke","kok-in","kpe-lr","ksb-tz","ksf-cm","ksh-de","lag-tz","lkt-us","lrc-ir","luo-ke","luy-ke","mai-in","mas-ke","mer-ke","mfe-mu","mgh-mz","mgo-cm","moh-ca","mua-cm","mus-us","myv-ru","mzn-ir","naq-na","nds-de","nmg-cm","nnh-cm","nqo-gn","nso-za","nus-ss","nyn-ug","osa-us","pcm-ng","quc-gt","rof-tz","rwk-tz","sah-ru","saq-ke","sbp-tz","scn-it","sdh-ir","seh-mz","ses-ml","sid-et","sma-se","smj-se","smn-fi","sms-fi","ssy-er","syr-iq","szl-pl","teo-ug","tig-er","trv-tw","trw-pk","twq-ne","tzm-ma","vo-001","vun-tz","wae-ch","wal-et","wbp-au","xog-ug","yav-cm","yi-001","zgh-ma","aa-et","af-za","ak-gh","am-et","an-es","as-in","ba-ru","be-by","bg-bg","bm-ml","bn-bd","bo-cn","br-fr","ca-es","ce-ru","co-fr","cs-cz","cu-ru","cv-ru","cy-gb","da-dk","de-de","dv-mv","dz-bt","ee-gh","el-gr","en-us","es-es","et-ee","eu-es","fa-ir","fi-fi","fo-fo","fr-fr","fy-nl","ga-ie","gd-gb","gl-es","gn-py","gu-in","gv-im","ha-ng","he-il","hi-in","hr-hr","hu-hu","hy-am","id-id","ig-ng","ii-cn","is-is","it-it","iu-ca","ja-jp","jv-id","ka-ge","ki-ke","kk-kz","kl-gl","km-kh","kn-in","ko-kr","ku-tr","kw-gb","ky-kg","lb-lu","lg-ug","ln-cd","lo-la","lt-lt","lu-cd","lv-lv","mg-mg","mi-nz","mk-mk","ml-in","mn-mn","mr-in","ms-my","mt-mt","my-mm","nb-no","nd-zw","ne-np","nl-nl","nn-no","nr-za","nv-us","ny-mw","oc-fr","om-et","or-in","os-ge","pl-pl","ps-af","pt-br","qu-pe","rm-ch","rn-bi","ro-ro","ru-ru","rw-rw","sa-in","sc-it","se-no","sg-cf","si-lk","sk-sk","sl-si","sn-zw","so-so","sq-al","ss-za","st-za","sv-se","sw-tz","ta-in","te-in","tg-tj","th-th","ti-et","tk-tm","tn-za","to-to","tr-tr","ts-za","tt-ru","ug-cn","uk-ua","ur-pk","ve-za","vi-vn","wa-be","wo-sn","xh-za","yo-ng","zu-za"]')},function(e){e.exports=JSON.parse('{"region":{"172":["ru","am","az","by","ge","kg","kz","md","tj","tm","ua","uz"],"200":["cz","sk"],"530":["cw","sx","bq"],"532":["cw","sx","bq"],"536":["sa","iq"],"582":["fm","mh","mp","pw"],"810":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"830":["je","gg"],"890":["rs","me","si","hr","mk","ba"],"891":["rs","me"],"an":["cw","sx","bq"],"cs":["rs","me"],"fq":["aq","tf"],"nt":["sa","iq"],"pc":["fm","mh","mp","pw"],"su":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yu":["rs","me"],"062":["034","143"],"ant":["cw","sx","bq"],"scg":["rs","me"],"ntz":["sa","iq"],"sun":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yug":["rs","me"]}}')},function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(t)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(56);e.exports=v;var a,o=n(87);v.ReadableState=E;n(71).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(89),l=n(57).Buffer,c=t.Uint8Array||function(){};var f=n(49);f.inherits=n(42);var d=n(101),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var g,p=n(102),m=n(90);f.inherits(v,u);var y=["error","close","destroy","pause","resume"];function E(e,t){e=e||{};var r=t instanceof(a=a||n(36));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||(g=n(74).StringDecoder),this.decoder=new g(e.encoding),this.encoding=e.encoding)}function v(e){if(a=a||n(36),!(this instanceof v))return new v(e);this._readableState=new E(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,o)):(i||(a=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):I(e,o)):T(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function T(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),I(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},v.prototype.unshift=function(e){return _(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return g||(g=n(74).StringDecoder),this._readableState.decoder=new g(e),this._readableState.encoding=e,this};function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),C(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function w(e){h("readable nexttick read 0"),e.read(0)}function N(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}v.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):S(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(n,t))),null===(r=e>0?D(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:v;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",E),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",p),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",f);var d=!1;var g=!1;function p(t){h("ondata"),g=!1,!1!==e.write(t)||g||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==P(a.pipes,e))&&!d&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,g=!0),n.pause())}function m(t){h("onerror",t),v(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",E),v()}function E(){h("onfinish"),e.removeListener("close",y),v()}function v(){h("unpipe"),n.unpipe(e)}return n.on("data",p),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",y),e.once("finish",E),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=P(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},v.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):i.nextTick(w,this))}return n},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),this},v.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<y.length;a++)e.on(y[a],this.emit.bind(this,y[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=D}).call(this,n(24),n(26))},function(e,t,n){e.exports=n(71).EventEmitter},function(e,t,n){"use strict";var r=n(56);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";e.exports=o;var r=n(36),i=n(49);function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(42),i.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,a;return t=e,a=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[o=o.toLowerCase()]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,r=null;n<e.length&&!r;){var a=e[n];if(a&&a.contentProtection&&a.contentProtection.length>0){var o=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(o&&o.length>0)for(var s=0;s<o.length&&!r;){for(var u=o[s],l=0;l<i.attributes.length&&!r;){for(var c=0,f=i.attributes[l];c<i.prefixes.length&&!r;){var d=i.prefixes[c];u[f]&&u[f].__prefix&&u[f].__prefix===d&&u[f].__text&&(r=u[f].__text),c+=1}l+=1}s+=1}}n+=1}return r}catch(e){return null}}}],(n=null)&&r(t.prototype,n),a&&r(t,a),e}();var o=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n};var s=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a};function u(e){return(u="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})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=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}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function f(e,t){return!t||"object"!==u(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 d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=new(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&&l(e,t)}(n,e);var t=c(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return n}(n(28).a)),g=n(10);var p=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u};var m=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r},y=n(5),E=n(14),v=n(1),_=n(3);function T(e){return(T="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})(e)}function b(e){var t,n,r,i,u,l,c,f,d,_,b,S=(e=e||{}).protectionKeyController,A=e.protectionModel,I=e.eventBus,R=e.events,w=e.debug,N=e.BASE64,C=e.constants,D=[],O=e.cmcdModel,M=e.settings,P=e.customParametersModel;function L(){if(!(I&&I.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function x(e,t){f||d?f&&F():function(e,t){if(!d){d=!0;var r,i=[];e=e.sort((function(t,n){return(u&&u[t.ks.systemString]&&u[t.ks.systemString].priority>=0?u[t.ks.systemString].priority:e.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:e.length)}));for(var a=0;a<e.length;a++){var o=q(e[a]);i.push({ks:e[a].ks,configs:[o],protData:e[a].protData})}A.requestKeySystemAccess(i).then((function(e){var t=(r=e.data).mksa&&r.mksa.selectedSystemString?r.mksa.selectedSystemString:r.keySystem.systemString;return n.info("DRM: KeySystem Access Granted for system string ("+t+")! Selecting key system..."),A.selectKeySystem(r)})).then((function(e){if(f=e,d=!1,A){I.trigger(R.KEY_SYSTEM_SELECTED,{data:r});var t=G(f);t&&t.serverCertificate&&t.serverCertificate.length>0&&A.setServerCertificate(N.decodeArray(t.serverCertificate).buffer),F()}})).catch((function(e){f=null,d=!1,t||I.trigger(R.KEY_SYSTEM_SELECTED,{data:null,error:new g.a(h.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,h.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}}(e,t)}function F(){for(var e,t=0;t<r.length;t++)for(e=0;e<r[t].length;e++)if(f===r[t][e].ks){k(r[t][e]);break}r=[]}function k(e){if(S.isClearKey(f)&&e.protData&&e.protData.hasOwnProperty("clearkeys")&&0!==Object.keys(e.protData.clearkeys).length){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?U(e):null!==e.initData&&B(e)}function U(e){L(),A.loadKeySession(e)}function B(e){var t=a.getPSSHForKeySystem(f,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=A.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(j(t))return;try{e.initData=t,A.createKeySession(e)}catch(e){I.trigger(R.KEY_SESSION_CREATED,{data:null,error:new g.a(h.KEY_SESSION_CREATED_ERROR_CODE,h.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?A.createKeySession(e):I.trigger(R.KEY_SESSION_CREATED,{data:null,error:new g.a(h.KEY_SESSION_CREATED_ERROR_CODE,h.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(f?f.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function G(e){if(e){var t=e.systemString;if(u)return t in u?u[t]:null}return null}function j(e){if(!e)return!1;try{for(var t=A.getAllInitData(),r=0;r<t.length;r++)if(S.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function Y(e){L(),e?(A.setMediaElement(e),I.on(R.NEED_KEY,Z,t)):null===e&&(A.setMediaElement(e),I.off(R.NEED_KEY,Z,t))}function q(e){var t=e.protData,n=[],r=[],a=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:c,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:c,l=e.sessionType,f=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return i.forEach((function(e){e.type===C.AUDIO?n.push(new o(e.codec,a)):e.type===C.VIDEO&&r.push(new o(e.codec,u))})),new s(n,r,f,d,[l])}function H(e){e.error?I.trigger(R.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function V(e){n.debug("DRM: onKeyMessage");var t=e.data;I.trigger(R.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",o=t.message,s=t.sessionToken,u=G(f),l=S.getLicenseServerModelInstance(f,u,r),c={sessionToken:s,messageType:r};if(o&&0!==o.byteLength){if(!l)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+s.getSessionId()),void K(c);if(S.isClearKey(f)){var d=S.processClearKeyLicenseRequest(f,u,o);if(d&&d.keyPairs&&d.keyPairs.length>0)return n.debug("DRM: ClearKey license request handled by application!"),K(c),void A.updateKeySession(s,d)}!function(e,t,r){var o=e.sessionToken,s=e.messageType?e.messageType:"license-request",u={sessionToken:o,messageType:s},l=f?f.systemString:null,c=function(e,t,n,r,o){var s=null,u=r.message;if(e&&e.serverURL){var l=e.serverURL;"string"==typeof l&&""!==l?s=l:"object"===T(l)&&l.hasOwnProperty(t)&&(s=l[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=a.getLicenseServerUrlFromMediaInfo(i,f.schemeIdURI))&&!S.isClearKey(f)){var c=a.getPSSHData(n.initData);(s=f.getLicenseServerURLFromInitData(c))||(s=r.laURL)}return s=o.getServerURLFromMessage(s,u,t)}(r,s,o,e,t);if(!c)return void K(u,new g.a(h.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,h.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));var d={},w=!1;r&&W(d,r.httpRequestHeaders);var N=e.message,C=f.getRequestHeadersFromMessage(N);W(d,C),Object.keys(d).forEach((function(e){"authorization"===e.toLowerCase()&&(w=!0)})),r&&"boolean"==typeof r.withCredentials&&(w=r.withCredentials);var D=function(e){if(A)if(e.status>=200&&e.status<=299){var n=E.a.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),r=new m(e.responseURL,n,e.response);Q(P.getLicenseResponseFilters(),r).then((function(){var n=t.getLicenseMessage(r.data,l,s);null!==n?(K(u),A.updateKeySession(o,n)):X(e,u,l,s,t)}))}else X(e,u,l,s,t)},L=function(e){K(u,new g.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},x=function(e){K(u,new g.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},F=f.getLicenseRequestFromMessage(N),k=t.getHTTPMethod(s),U=t.getResponseType(l,s),B=r&&!isNaN(r.httpTimeout)?r.httpTimeout:8e3,G=o.getSessionId()||null,j=new p(c,k,U,d,w,s,G,F),Y=isNaN(M.get().streaming.retryAttempts[y.a.LICENSE])?3:M.get().streaming.retryAttempts[y.a.LICENSE];Q(P.getLicenseRequestFilters(),j).then((function(){!function e(t,r,i,a,o,s){var u=new XMLHttpRequest;if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){if(M.get().streaming.cmcd.mode===v.a.CMCD_MODE_QUERY){var l=O.getQueryParameter({url:t.url,type:y.a.LICENSE});l&&(t.url=E.a.addAditionalQueryParameterToUrl(t.url,[l]))}}u.open(t.method,t.url,!0),u.responseType=t.responseType,u.withCredentials=t.withCredentials,i>0&&(u.timeout=i);for(var c in t.headers)u.setRequestHeader(c,t.headers[c]);if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){if(M.get().streaming.cmcd.mode===v.a.CMCD_MODE_HEADER){var f=O.getHeaderParameters({url:t.url,type:y.a.LICENSE});if(f)for(var d in f){var h=f[d];h&&u.setRequestHeader(d,h)}}}var g=function(){r--;var n=isNaN(M.get().streaming.retryIntervals[y.a.LICENSE])?1e3:M.get().streaming.retryIntervals[y.a.LICENSE];b=setTimeout((function(){e(t,r,i,a,o,s)}),n)};u.onload=function(){_=null,this.status>=200&&this.status<=299||r<=0?a(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+r),g())},u.ontimeout=u.onerror=function(){_=null,r<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+r),g())},u.onabort=function(){o(this)},I.trigger(R.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),_=u,u.send(t.data)}(j,Y,B,D,L,x)}))}(t,l,u)}else K(c,new g.a(h.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,h.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function K(e,t){I.trigger(R.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function z(){_&&(_.onloadend=_.onerror=_.onprogress=void 0,_.abort(),_=null),b&&(clearTimeout(b),b=null)}function W(e,t){if(t)for(var n in t)e[n]=t[n]}function X(e,t,n,r,i){var a="NONE",o=null;e.response&&(a=i.getErrorResponse(e.response,n,r),o={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),K(t,new g.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+a,o))}function Q(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function Z(e,t){if(!M.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===i.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void D.push(setTimeout((function(){Z(e,t)}),500));var o=e.key.initData;if(ArrayBuffer.isView(o)&&(o=o.buffer),f){var s=a.getPSSHForKeySystem(f,o);if(s&&j(s))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(o)));var c=S.getSupportedKeySystemsFromSegmentPssh(o,u,l);if(0===c.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");!function(e){r.push(e),x(e,!1)}(c)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");L(),i.push(e)},clearMediaInfoArray:function(){i=[]},handleKeySystemFromManifest:function(){if(i&&0!==i.length){var e=[];i.forEach((function(t){var n=S.getSupportedKeySystemsFromContentProtection(t.contentProtection,u,l);n.length>0&&(0===e.length&&(e=n),r.push(n))})),e&&e.length>0&&x(e,!0)}},createKeySession:B,loadKeySession:U,removeKeySession:function(e){L(),A.removeKeySession(e)},closeKeySession:function(e){L(),A.closeKeySession(e)},setServerCertificate:function(e){L(),A.setServerCertificate(e)},setMediaElement:Y,setSessionType:function(e){l=e},setRobustnessLevel:function(e){c=e},setProtectionData:function(e){u=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return L(),S.getSupportedKeySystemsFromContentProtection(e,u,l)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},stop:function(){z(),A&&A.stop()},reset:function(){I.off(R.INTERNAL_KEY_MESSAGE,V,t),I.off(R.INTERNAL_KEY_STATUS_CHANGED,H,t),L(),z(),Y(null),f=null,d=!1,A&&(A.reset(),A=null),D.forEach((function(e){return clearTimeout(e)})),D=[],i=[],r=[]}},n=w.getLogger(t),r=[],i=[],l="temporary",c="",_=null,b=null,I.on(R.INTERNAL_KEY_MESSAGE,V,t),I.on(R.INTERNAL_KEY_STATUS_CHANGED,H,t),t}b.__dashjs_factory_name="ProtectionController";var S=_.a.getClassFactory(b);var A=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var R=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t,n,r;return t=e,(n=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=i.charCodeAt(e);return o}}])&&I(t.prototype,n),r&&I(t,r),e}();function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var N=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING="com.microsoft.playready.recommendation",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&w(t.prototype,n),r&&w(t,r),e}()),C="e2719d58-a985-b3c9-781a-b030af78d30e",D=N.CLEARKEY_KEYSTEM_STRING;function O(e){var t=(e=e||{}).BASE64;return{uuid:C,schemeIdURI:"urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e",systemString:D,getInitData:function(e,n){try{var r=a.parseInitDataFromContentProtection(e,t);if(!r&&n){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],a=0;a<r.kids.length;a++){var o=r.kids[a],s=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!s)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");i.push(new A(o,s))}n=new R(i)}return n}}}O.__dashjs_factory_name="KeySystemClearKey";var M=dashjs.FactoryMaker.getSingletonFactory(O),P=N.CLEARKEY_KEYSTEM_STRING;function L(e){var t,n=e.BASE64,r=e.debug.getLogger(t);return t={uuid:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:P,getInitData:function(e){return a.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[],o=0;o<i.kids.length;o++){var s=i.kids[o],u=e.clearkeys&&e.clearkeys.hasOwnProperty(s)?e.clearkeys[s]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+s+") is not known!");a.push(new A(s,u))}n=new R(a),r.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}L.__dashjs_factory_name="KeySystemW3CClearKey";var x=dashjs.FactoryMaker.getSingletonFactory(L),F=N.WIDEVINE_KEYSTEM_STRING;function k(e){var t=(e=e||{}).BASE64;return{uuid:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:F,getInitData:function(e){return a.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}k.__dashjs_factory_name="KeySystemWidevine";var U=dashjs.FactoryMaker.getSingletonFactory(k),B=N.PLAYREADY_KEYSTEM_STRING;function G(e){var t="utf-16",n=(e=e||{}).BASE64,r=e.settings;function i(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:"9a04f079-9840-4286-ab92-e65be0885f95",schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:B,getInitData:function(e){var t,r,o,s,u,l=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),f=0,d=null;if(i(),!e)return null;if("pssh"in e)return a.parseInitDataFromContentProtection(e,n);if("pro"in e)d=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;d=n.decodeArray(e.prheader.__text)}return t=d.length,r=4+l.length+c.length+4+t,o=new ArrayBuffer(r),s=new Uint8Array(o),(u=new DataView(o)).setUint32(f,r),f+=4,s.set(l,f),f+=l.length,s.set(c,f),f+=c.length,u.setUint32(f,t),f+=4,s.set(d,f),f+=t,s.buffer},getRequestHeadersFromMessage:function(e){var n,i,a={},o=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return a["Content-Type"]="text/xml; charset=utf-8",a;var s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,s);for(var u=(i=o.parseFromString(n,"application/xml")).getElementsByTagName("name"),l=i.getElementsByTagName("value"),c=0;c<u.length;c++)a[u[c].childNodes[0].nodeValue]=l[c].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){var a=null,o=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return e;var s="utf-16"===t?new Uint16Array(e):new Uint8Array(e);i();var u=String.fromCharCode.apply(null,s),l=o.parseFromString(u,"application/xml");if(!l.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var c=l.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return c&&(a=n.decode(c)),a},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var o=t.getUint16(r,!0);r+=2;var s=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+s),l=String.fromCharCode.apply(null,new Uint16Array(u)),c=i.parseFromString(l,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var f=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(f)return f}if(c.getElementsByTagName("LUI_URL")[0]){var d=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(d)return d}}else r+=s}return null},getCDMData:function(e){var t,r,a,o;if(i(),!e)return null;for(t=[],o=0;o<e.length;++o)t.push(e.charCodeAt(o)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=n.encode(t),r='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),a=[],o=0;o<r.length;++o)a.push(r.charCodeAt(o)),a.push(0);return new Uint8Array(a).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}G.__dashjs_factory_name="KeySystemPlayReady";var j=dashjs.FactoryMaker.getSingletonFactory(G);function Y(e){var t=(e=e||{}).BASE64,n={};return n[N.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[N.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}Y.__dashjs_factory_name="DRMToday";var q=dashjs.FactoryMaker.getSingletonFactory(Y);function H(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(o?o.getElementsByTagNameNS(e,"Fault")[0]:null)return null}return n}function r(n){var r="",i="",a="",o=-1,s=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),c=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,f=c?c.getElementsByTagNameNS(e,"Body")[0]:null,d=f?f.getElementsByTagNameNS(e,"Fault")[0]:null,h=d?d.getElementsByTagName("detail")[0]:null,g=h?h.getElementsByTagName("Exception")[0]:null,p=null;if(null===d)return u;r=(p=d.getElementsByTagName("faultstring")[0].firstChild)?p.nodeValue:null,null!==g&&(i=(p=g.getElementsByTagName("StatusCode")[0])?p.firstChild.nodeValue:null,o=(a=(p=g.getElementsByTagName("Message")[0])?p.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var m="code: ".concat(i,", name: ").concat(r);return a&&(m+=", message: ".concat(a)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}H.__dashjs_factory_name="PlayReady";var V=dashjs.FactoryMaker.getSingletonFactory(H);function K(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}K.__dashjs_factory_name="Widevine";var z=dashjs.FactoryMaker.getSingletonFactory(K);function W(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new A(i,a))}return new R(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}W.__dashjs_factory_name="ClearKey";var X=dashjs.FactoryMaker.getSingletonFactory(W);function Q(){var e,t,n,r,i,o,s,u,l=this.context;function c(e,t){return t&&e in t?t[e]:null}function f(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function d(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;r=[],e=j(l).getInstance({BASE64:i,settings:o}),r.push(e),e=U(l).getInstance({BASE64:i}),r.push(e),e=M(l).getInstance({BASE64:i}),r.push(e),s=e,e=x(l).getInstance({BASE64:i,debug:t}),r.push(e),u=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var a=r[i];a.hasOwnProperty("init")&&a.init((t=a.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===s||e===u},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return r},setKeySystems:function(e){r=e},getKeySystemBySystemString:function(e){for(var t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var i,o,s,u,l=[];if(e){var h=a.findCencContentProtection(e);for(s=0;s<r.length;++s){var g=c((o=r[s]).systemString,t);for(u=0;u<e.length;++u)if((i=e[u]).schemeIdUri.toLowerCase()===o.schemeIdURI){var p=o.getInitData(i,h);l.push({ks:r[s],keyId:i.keyId,initData:p,protData:g,cdmData:o.getCDMData(g?g.cdmData:null),sessionId:f(g,i),sessionType:d(g,n)})}}}return l},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var i,o=[],s=a.parsePSSHList(e),u=0;u<r.length;++u){var l=c((i=r[u]).systemString,t);i.uuid in s&&o.push({ks:i,initData:s[i.uuid],protData:l,cdmData:i.getCDMData(l?l.cdmData:null),sessionId:f(l),sessionType:d(l,n)})}return o},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=q(l).getInstance({BASE64:i}):e.systemString===N.WIDEVINE_KEYSTEM_STRING?r=z(l).getInstance():e.systemString===N.PLAYREADY_KEYSTEM_STRING?r=V(l).getInstance():e.systemString===N.CLEARKEY_KEYSTEM_STRING&&(r=X(l).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(i=r.BASE64),r.settings&&(o=r.settings))}}}Q.__dashjs_factory_name="ProtectionKeyController";var Z=dashjs.FactoryMaker.getSingletonFactory(Q);function $(e){return($="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})(e)}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(e){var t=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}}();return function(){var n,r=ne(e);if(t){var i=ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return te(this,n)}}function te(e,t){return!t||"object"!==$(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 ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var re=new(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&&J(e,t)}(n,e);var t=ee(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return n}(n(18).a));var ie=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n};var ae=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"};var oe=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},se={};function ue(e){e=e||{};var t,n,r,i,a,o,s,u,l=this.context,c=e.eventBus,f=e.events,d=e.debug;function p(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function m(e){for(var t=0;t<o.length;t++)if(o[t]===e){o.splice(t,1);break}}function y(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function E(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":c.trigger(f.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=y(arguments);switch(e.status){case"expired":c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,{error:new g.a(h.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,h.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;c.trigger(f.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=y(arguments);"usable"===e.status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){m(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),c.trigger(f.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),o.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<o.length;t++)o[t].initData&&e.push(o[t].initData);return e},getSessions:function(){return o},requestKeySystemAccess:function(e){return new Promise((function(t,r){!function e(t,r,i,a){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var o="Insecure origins are not allowed";return c.trigger(f.KEY_SYSTEM_ACCESS_COMPLETE,{error:o}),void a({error:o})}var s=t[r].protData&&t[r].protData.systemStringPriority?t[r].protData.systemStringPriority:null,u=t[r].configs,l=t[r].ks,d=l.systemString;(function(e,t){return new Promise((function(r,i){!function e(t,r,i,a,o){var s=t[i];n.debug("Requesting key system access for system string ".concat(s)),navigator.requestMediaKeySystemAccess(s,r).then((function(e){e.selectedSystemString=s,a(e)})).catch((function(n){i+1<t.length?e(t,r,i+1,a,o):o(n)}))}(e,t,0,r,i)}))})(s||(se[d]?se[d]:[d]),u).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,n=new oe(l,t);n.mksa=e,c.trigger(f.KEY_SYSTEM_ACCESS_COMPLETE,{data:n}),i({data:n})})).catch((function(n){if(r+1<t.length)e(t,r+1,i,a);else{c.trigger(f.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+n.message}),a({error:"Key system access denied! "+n.message})}}))}(e,0,t,r)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return r=e.keySystem,a=t,i?i.setMediaKeys(a):Promise.resolve()})).then((function(){t(r)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){i!==e&&(i&&(i.removeEventListener("encrypted",s),i.setMediaKeys&&i.setMediaKeys(null)),(i=e)&&(i.addEventListener("encrypted",s),i.setMediaKeys&&a&&i.setMediaKeys(a)))},setServerCertificate:function(e){if(!r||!a)throw new Error("Can not set server certificate until you have selected a key system");a.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),c.trigger(f.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){c.trigger(f.SERVER_CERTIFICATE_UPDATED,{error:new g.a(h.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,h.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!r||!a)throw new Error("Can not create sessions until you have selected a key system");var t=a.createSession(e.sessionType),i=E(t,e),o=r.systemString===N.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?N.INITIALIZATION_DATA_TYPE_KEYIDS:N.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(o,e.initData).then((function(){n.debug("DRM: Session created. SessionID = "+i.getSessionId()),c.trigger(f.KEY_SESSION_CREATED,{data:i})})).catch((function(e){m(i),c.trigger(f.KEY_SESSION_CREATED,{data:null,error:new g.a(h.KEY_SESSION_CREATED_ERROR_CODE,h.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;u.isClearKey(r)&&(t=t.toJWK()),n.update(t).then((function(){c.trigger(f.KEY_SESSION_UPDATED)})).catch((function(t){c.trigger(f.KEY_ERROR,{error:new g.a(h.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!r||!a)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,i=0;i<o.length;i++)if(t===o[i].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var s=a.createSession(e.sessionType),u=E(s,e);s.load(t).then((function(e){e?(n.debug("DRM: Session loaded. SessionID = "+u.getSessionId()),c.trigger(f.KEY_SESSION_CREATED,{data:u})):(m(u),c.trigger(f.KEY_SESSION_CREATED,{data:null,error:new g.a(h.KEY_SESSION_CREATED_ERROR_CODE,h.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){m(u),c.trigger(f.KEY_SESSION_CREATED,{data:null,error:new g.a(h.KEY_SESSION_CREATED_ERROR_CODE,h.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed. SessionID = "+e.getSessionId()),c.trigger(f.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){c.trigger(f.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){p(e).catch((function(t){m(e),c.trigger(f.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<o.length;t++)(e=o[t]).getUsable()||p(e).catch((function(){m(e)}))},reset:function(){var e,t=o.length;0!==t?function(){for(var n=function(e){m(e),0===o.length&&(i?(i.removeEventListener("encrypted",s),i.setMediaKeys(null).then((function(){c.trigger(f.TEARDOWN_COMPLETE)}))):c.trigger(f.TEARDOWN_COMPLETE))},r=0;r<t;r++)!function(t){e.session.closed.then((function(){n(t)})),p(e).catch((function(){n(t)}))}(e=o[r])}():c.trigger(f.TEARDOWN_COMPLETE)}},n=d.getLogger(t),r=null,i=null,a=null,o=[],u=Z(l).getInstance(),s={handleEvent:function(e){switch(e.type){case"encrypted":if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;c.trigger(f.NEED_KEY,{key:new ie(t,e.initDataType)})}}}},t}se[N.PLAYREADY_KEYSTEM_STRING]=[N.PLAYREADY_KEYSTEM_STRING,N.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],se[N.WIDEVINE_KEYSTEM_STRING]=[N.WIDEVINE_KEYSTEM_STRING],se[N.CLEARKEY_KEYSTEM_STRING]=[N.CLEARKEY_KEYSTEM_STRING],ue.__dashjs_factory_name="ProtectionModel_21Jan2015";var le=dashjs.FactoryMaker.getClassFactory(ue);function ce(e){e=e||{};var t,n,r,i,a,o,u,l,c,f=this.context,d=e.eventBus,p=e.events,m=e.debug,y=e.api;function E(){try{for(var e=0;e<u.length;e++)v(u[e]);r&&r.removeEventListener(y.needkey,l),d.trigger(p.TEARDOWN_COMPLETE)}catch(e){d.trigger(p.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function v(e){var t=e.session;t.removeEventListener(y.error,e),t.removeEventListener(y.message,e),t.removeEventListener(y.ready,e),t.removeEventListener(y.close,e);for(var n=0;n<u.length;n++)if(u[n]===e){u.splice(n,1);break}t[y.release]()}function _(){var e=null,t=function(){r.removeEventListener("loadedmetadata",e),r[y.setMediaKeys](a),d.trigger(p.VIDEO_ELEMENT_SELECTED)};r.readyState>=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<u.length;t++)e.push(u[t].initData);return e},getSessions:function(){return u},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,o=e[i].configs,u=null,l=null,f=0;f<o.length;f++){var h=o[f].audioCapabilities,g=o[f].videoCapabilities;if(h&&0!==h.length){u=[];for(var m=0;m<h.length;m++)window[y.MediaKeys].isTypeSupported(a,h[m].contentType)&&u.push(h[m])}if(g&&0!==g.length){l=[];for(var E=0;E<g.length;E++)window[y.MediaKeys].isTypeSupported(a,g[E].contentType)&&l.push(g[E])}if(!(!u&&!l||u&&0===u.length||l&&0===l.length)){r=!0;var v=new s(u,l),_=c.getKeySystemBySystemString(a),T=new oe(_,v);d.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{data:T}),t({data:T});break}}if(!r){var b="Key system access denied! -- No valid audio/video content configurations detected!";d.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),n({error:b})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{a=e.mediaKeys=new window[y.MediaKeys](e.keySystem.systemString),i=e.keySystem,o=e,r&&_(),t(i)}catch(e){n({error:"Error selecting keys system ("+i.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){r!==e&&(r&&r.removeEventListener(y.needkey,l),(r=e)&&(r.addEventListener(y.needkey,l),a&&_()))},createKeySession:function(e){if(!i||!a||!o)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(o.ksConfiguration.videoCapabilities&&o.ksConfiguration.videoCapabilities.length>0&&(t=o.ksConfiguration.videoCapabilities[0]),null===t&&o.ksConfiguration.audioCapabilities&&o.ksConfiguration.audioCapabilities.length>0&&(t=o.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,s=a.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:d.trigger(p.KEY_ERROR,{error:new g.a(h.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;d.trigger(p.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),d.trigger(p.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),d.trigger(p.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(s,e);s.addEventListener(y.error,l),s.addEventListener(y.message,l),s.addEventListener(y.ready,l),s.addEventListener(y.close,l),u.push(l),n.debug("DRM: Session created. SessionID = "+l.getSessionId()),d.trigger(p.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){var n=e.session;c.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),d.trigger(p.KEY_SESSION_UPDATED)},closeKeySession:v,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},n=m.getLogger(t),r=null,i=null,a=null,o=null,u=[],c=Z(f).getInstance(),l={handleEvent:function(e){switch(e.type){case y.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;d.trigger(p.NEED_KEY,{key:new ie(t,"cenc")})}}}},t}ce.__dashjs_factory_name="ProtectionModel_3Feb2014";var fe=dashjs.FactoryMaker.getClassFactory(ce);function de(e){e=e||{};var t,n,r,i,a,o,u,l,c,f=this.context,d=e.eventBus,p=e.events,m=e.debug,y=e.api,E=e.errHandler;function v(){r&&b();for(var e=0;e<u.length;e++)_(u[e]);d.trigger(p.TEARDOWN_COMPLETE)}function _(e){try{r[y.cancelKeyRequest](i.systemString,e.sessionId)}catch(t){d.trigger(p.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function T(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function b(){r.removeEventListener(y.keyerror,c),r.removeEventListener(y.needkey,c),r.removeEventListener(y.keymessage,c),r.removeEventListener(y.keyadded,c)}return t={getAllInitData:function(){for(var e=[],t=0;t<o.length;t++)e.push(o[t].initData);for(var n=0;n<u.length;n++)e.push(u[n].initData);return e},getSessions:function(){return u.concat(o)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var i=r;i||(i=document.createElement("video"));for(var o=!1,u=0;u<e.length;u++)for(var l=e[u].ks.systemString,c=e[u].configs,f=null,h=0;h<c.length;h++){var g=c[h].videoCapabilities;if(g&&0!==g.length){f=[];for(var m=0;m<g.length;m++)""!==i.canPlayType(g[m].contentType,l)&&f.push(g[m])}if(f&&(!f||0!==f.length)){o=!0;var y=new s(null,f),E=a.getKeySystemBySystemString(l),v=new oe(E,y);d.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{data:v}),t({data:v});break}}if(!o){var _="Key system access denied! -- No valid audio/video content configurations detected!";d.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{error:_}),n({error:_})}}))},selectKeySystem:function(e){return i=e.keySystem,Promise.resolve(i)},setMediaElement:function(e){if(r!==e){if(r){b();for(var t=0;t<u.length;t++)_(u[t]);u=[]}(r=e)&&(r.addEventListener(y.keyerror,c),r.addEventListener(y.needkey,c),r.addEventListener(y.keymessage,c),r.addEventListener(y.keyadded,c),d.trigger(p.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!i)throw new Error("Can not create sessions until you have selected a key system");if(l||0===u.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return o.push(t),r[y.generateKeyRequest](i.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(a.isClearKey(i))for(var o=0;o<t.keyPairs.length;o++)r[y.addKey](i.systemString,t.keyPairs[o].key,t.keyPairs[o].keyID,n);else r[y.addKey](i.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);d.trigger(p.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:v,reset:v},n=m.getLogger(t),r=null,i=null,o=[],u=[],a=Z(f).getInstance(),c={handleEvent:function(e){var t=null;switch(e.type){case y.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;d.trigger(p.NEED_KEY,{key:new ie(r,"cenc")});break;case y.keyerror:if((t=T(u,e.sessionId))||(t=T(o,e.sessionId)),t){var i=h.MEDIA_KEYERR_CODE,a="";switch(e.errorCode.code){case 1:i=h.MEDIA_KEYERR_UNKNOWN_CODE,a+="MEDIA_KEYERR_UNKNOWN - "+h.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=h.MEDIA_KEYERR_CLIENT_CODE,a+="MEDIA_KEYERR_CLIENT - "+h.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=h.MEDIA_KEYERR_SERVICE_CODE,a+="MEDIA_KEYERR_SERVICE - "+h.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=h.MEDIA_KEYERR_OUTPUT_CODE,a+="MEDIA_KEYERR_OUTPUT - "+h.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=h.MEDIA_KEYERR_HARDWARECHANGE_CODE,a+="MEDIA_KEYERR_HARDWARECHANGE - "+h.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=h.MEDIA_KEYERR_DOMAIN_CODE,a+="MEDIA_KEYERR_DOMAIN - "+h.MEDIA_KEYERR_DOMAIN_MESSAGE}a+=" System Code = "+e.systemCode,d.trigger(p.KEY_ERROR,{error:new g.a(i,a,t)})}else n.error("No session token found for key error");break;case y.keyadded:(t=T(u,e.sessionId))||(t=T(o,e.sessionId)),t?(n.debug("DRM: Key added."),d.trigger(p.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case y.keymessage:if((l=null!==e.sessionId&&void 0!==e.sessionId)?!(t=T(u,e.sessionId))&&o.length>0&&(t=o.shift(),u.push(t),t.sessionId=e.sessionId,d.trigger(p.KEY_SESSION_CREATED,{data:t})):o.length>0&&(t=o.shift(),u.push(t),0!==o.length&&E.error(new g.a(h.MEDIA_KEY_MESSAGE_ERROR_CODE,h.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var s=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=s,d.trigger(p.INTERNAL_KEY_MESSAGE,{data:new ae(t,s,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}de.__dashjs_factory_name="ProtectionModel_01b";var he=dashjs.FactoryMaker.getClassFactory(de),ge=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],pe=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function me(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,a=Z(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),a.initialize();var o=function(r){var i=r.debug,a=i.getLogger(e),o=r.eventBus,s=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&void 0===u.onencrypted||u&&void 0===u.mediaKeys?n(u,pe)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),fe(t).create({debug:i,eventBus:o,events:r.events,api:n(u,pe)})):n(u,ge)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),he(t).create({debug:i,eventBus:o,errHandler:s,events:r.events,api:n(u,ge)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),le(t).create({debug:i,eventBus:o,events:r.events}))}(r);return!i&&o&&(i=S(t).create({protectionModel:o,protectionKeyController:a,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,customParametersModel:r.customParametersModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}me.__dashjs_factory_name="Protection";var ye=dashjs.FactoryMaker.getClassFactory(me);ye.events=re,ye.errors=h,dashjs.FactoryMaker.updateClassFactory(me.__dashjs_factory_name,ye);t.default=ye},function(e,t,n){"use strict";n.r(t);var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00";var i=r,a=n(19);function o(e){var t,n,r=(e=e||{}).eventBus,o=e.dashMetrics,s=e.metricsConstants,u=e.events;function l(e){var t=new i;if(n){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),o.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function f(e){l({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function d(){l({errorcode:i.BECAME_REPORTER})}function h(e){switch(e.metric){case s.HTTP_REQUEST:(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function g(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){r.on(u.MANIFEST_UPDATED,c,t),r.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.on(u.METRIC_ADDED,h,t),r.on(u.METRIC_UPDATED,h,t),r.on(u.PLAYBACK_ERROR,g,t),r.on(a.a.BECAME_REPORTING_PLAYER,d,t)},reset:function(){r.off(u.MANIFEST_UPDATED,c,t),r.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.off(u.METRIC_ADDED,h,t),r.off(u.METRIC_UPDATED,h,t),r.off(u.PLAYBACK_ERROR,g,t),r.off(a.a.BECAME_REPORTING_PLAYER,d,t)}}}o.__dashjs_factory_name="DVBErrorsTranslator";var s=dashjs.FactoryMaker.getSingletonFactory(o),u=n(52);function l(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i<t;i+=1){var o=n.start(i),s=n.end(i);if(o<=e&&e<s)return!0}return!1}},n=Object(u.a)(i).create(),t}l.__dashjs_factory_name="RangeController";var c=dashjs.FactoryMaker.getClassFactory(l);function f(){return{serialise:function e(t){var n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(null==(r=t[n])&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))})),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}f.__dashjs_factory_name="MetricSerialiser";var d=dashjs.FactoryMaker.getSingletonFactory(f);function h(){var e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1;function o(){r&&(e||(e=new i(10)),r.getRandomValues(e),t=0)}return n={random:function(n,i){var s;return n||(n=0),i||(i=1),r?(t===e.length&&o(),s=e[t]/a,t+=1):s=Math.random(),s*(i-n)+n}},o(),n}h.__dashjs_factory_name="RNG";var g=dashjs.FactoryMaker.getSingletonFactory(h),p=n(32);function m(e){var t;e=e||{};var n,r,i,a,o,s,u,l=this.context,c=[],f=e.metricsConstants;function h(){a=!1,o=!1,s=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&u.isEnabled()&&t.forEach((function(t){var i=n.serialise(t);e!==f.DVB_ERRORS&&(i="metricname=".concat(e,"&").concat(i)),function(e,t,n){var i=new XMLHttpRequest;i.withCredentials=r.getXHRWithCredentialsForType(f.HTTP_REQUEST_DVB_REPORTING_TYPE);var a=function(){var e=c.indexOf(i);-1!==e&&(c.splice(e,1),i.status>=200&&i.status<300?t&&t():n&&n())};c.push(i);try{i.open("GET",e),i.onloadend=a,i.onerror=a,i.send()}catch(e){i.onerror()}}(i="".concat(s,"?").concat(i),null,(function(){o=!1}))}))},initialize:function(e,t){var n;if(u=t,!(s=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");a||((n=e.dvb_probability)&&(1e3===n||n/1e3>=i.random())&&(o=!0),a=!0)},reset:function(){h()}},n=d(l).getInstance(),i=g(l).getInstance(),r=Object(p.a)(l).getInstance(),h(),t}m.__dashjs_factory_name="DVBReporting";var y=dashjs.FactoryMaker.getClassFactory(m);function E(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":y},r=this.context,i=e.debug?e.debug.getLogger(t):{},a=e.metricsConstants,o=e.mediaPlayerModel||{};return t={create:function(e,t){var s;try{(s=n[e.schemeIdUri](r).create({metricsConstants:a,mediaPlayerModel:o})).initialize(e,t)}catch(t){s=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return s},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}E.__dashjs_factory_name="ReportingFactory";var v=dashjs.FactoryMaker.getSingletonFactory(E);function _(e){var t=[],n=v(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}_.__dashjs_factory_name="ReportingController";var T=dashjs.FactoryMaker.getClassFactory(_);function b(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}b.__dashjs_factory_name="HandlerHelpers";var S=dashjs.FactoryMaker.getSingletonFactory(b);function A(e){var t,n,r,i,a;e=e||{};var o=this.context,s=S(o).getInstance(),u=[],l=e.metricsConstants;function c(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&a!==e.t&&(a=e.t,t.report(r,e))}return{initialize:function(e,a,o){a&&(n=s.validateN(o),t=a,r=s.reconstructFullMetricName(e,o),i=setInterval(c,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,a=null},handleNewMetric:function(e,t,n){e===l.BUFFER_LEVEL&&(u[n]=t)}}}A.__dashjs_factory_name="BufferLevelHandler";var I=dashjs.FactoryMaker.getClassFactory(A);var R=dashjs.FactoryMaker.getClassFactory((function(e){var t,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(a.a.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(a.a.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(a.a.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}}));function w(e){var t,n,r,i,a;e=e||{};var o=[],s=S(this.context).getInstance(),u=e.metricsConstants;function l(){var e=o;e.length&&t&&t.report(i,e),o=[]}return{initialize:function(e,o,u,c){o&&(n=s.validateN(u),t=o,c&&c.length&&(r=c),i=s.reconstructFullMetricName(e,u,c),a=setInterval(l,n))},reset:function(){clearInterval(a),a=null,n=null,r=null,o=[],t=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(r&&r!==t.type||o.push(t))}}}w.__dashjs_factory_name="HttpListHandler";var N=dashjs.FactoryMaker.getClassFactory(w);function C(){var e,t;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}C.__dashjs_factory_name="GenericMetricHandler";var D=dashjs.FactoryMaker.getClassFactory(C);function O(e){var t,n=(e=e||{}).debug?e.debug.getLogger(t):{},r=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,i=this.context,a={BufferLevel:I,DVBErrors:R,HttpList:N,PlayList:D,RepSwitchList:D,TcpList:D};return t={create:function(t,o){var s,u=t.match(r);if(u){try{(s=a[u[1]](i).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(u[1],o,u[3],u[5])}catch(e){s=null,n.error("MetricsHandlerFactory: Could not create handler for type ".concat(u[1]," with args ").concat(u[3],", ").concat(u[5]," (").concat(e.message,")"))}return s}},register:function(e,t){a[e]=t},unregister:function(e){delete a[e]}}}O.__dashjs_factory_name="MetricsHandlerFactory";var M=dashjs.FactoryMaker.getSingletonFactory(O);function P(e){e=e||{};var t,n=[],r=this.context,i=e.eventBus,a=e.events,o=M(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function s(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=i[t+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete i[t+1])}(a=o.create(e,r))&&n.push(a)})),i.on(a.METRIC_ADDED,s,t),i.on(a.METRIC_UPDATED,s,t)},reset:function(){i.off(a.METRIC_ADDED,s,t),i.off(a.METRIC_UPDATED,s,t),n.forEach((function(e){return e.reset()})),n=[]}}}P.__dashjs_factory_name="MetricsHandlersController";var L=dashjs.FactoryMaker.getClassFactory(P);function x(e){var t,n,r;e=e||{};var i=this.context;function a(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return{initialize:function(o){try{(r=c(i).create({mediaElement:e.mediaElement})).initialize(o.Range),(n=T(i).create({debug:e.debug,metricsConstants:e.metricsConstants,mediaPlayerModel:e.mediaPlayerModel})).initialize(o.Reporting,r),(t=L(i).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(o.metrics,n)}catch(e){throw a(),e}},reset:a}}x.__dashjs_factory_name="MetricsController";var F=dashjs.FactoryMaker.getClassFactory(x);var k=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]};var U=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1};var B=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3};function G(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var r=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(i){var a=new k,o=t.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range_asArray&&i.Range_asArray.forEach((function(r){var i=new U;i.starttime=function(e,r,i){var a,o,s=0;return r?s=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(s=a[0].start),o=s,i&&i.hasOwnProperty(n.START_TIME)&&(o+=i.starttime),o}(e,o,r),r.hasOwnProperty("duration")?i.duration=r.duration:i.duration=t.getDuration(e),i._useWallClockTime=o,a.Range.push(i)})),i.Reporting_asArray&&(i.Reporting_asArray.forEach((function(e){var t=new B;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),a.Reporting.push(t))})),r.push(a)))})),r}}}G.__dashjs_factory_name="ManifestParsing";var j=dashjs.FactoryMaker.getSingletonFactory(G);function Y(e){var t;e=e||{};var n={},r=this.context,i=e.eventBus,o=e.events;function s(t){if(!t.error){var o=Object.keys(n);j(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))o.splice(i,1);else try{var a=F(r).create(e);a.initialize(t),n[i]=a}catch(e){}})),o.forEach((function(e){n[e].reset(),delete n[e]})),i.trigger(a.a.METRICS_INITIALISATION_COMPLETE)}}function u(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){i.off(o.MANIFEST_UPDATED,s,t),i.off(o.STREAM_TEARDOWN_COMPLETE,u,t)}},i.on(o.MANIFEST_UPDATED,s,t),i.on(o.STREAM_TEARDOWN_COMPLETE,u,t),t}Y.__dashjs_factory_name="MetricsCollectionController";var q=dashjs.FactoryMaker.getClassFactory(Y);function H(){var e=this.context;return{createMetricsReporting:function(t){return s(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialise(),q(e).create(t)},getReportingFactory:function(){return v(e).getInstance()},getMetricsHandlerFactory:function(){return M(e).getInstance()}}}H.__dashjs_factory_name="MetricsReporting";var V=dashjs.FactoryMaker.getClassFactory(H);V.events=a.a,dashjs.FactoryMaker.updateClassFactory(H.__dashjs_factory_name,V);t.default=V},function(e,t,n){"use strict";n.r(t),function(e){var r=n(58);n.d(t,"MediaPlayer",(function(){return r.a}));var i=n(3);n.d(t,"FactoryMaker",(function(){return i.a}));var a=n(6);n.d(t,"Debug",(function(){return a.a}));var o=n(59),s=(n(113),"undefined"!=typeof window&&window||e),u=s.dashjs;u||(u=s.dashjs={}),u.MediaPlayer=r.a,u.FactoryMaker=i.a,u.Debug=a.a,u.Version=Object(o.a)(),t.default=u}.call(this,n(24))},function(e,t,n){!function(e,t,n){function r(e,t,i,s,u,l,c,f,d){if(t<c.begin||t>=c.end)return null;var h="regionID"in c&&""!==c.regionID?c.regionID:l;if(null!==u&&h!==i.id&&(!("contents"in c)||"contents"in c&&0===c.contents.length||""!==h))return null;var g=new a(c);for(var p in c.sets)t<c.sets[p].begin||t>=c.sets[p].end||(g.styleAttrs[c.sets[p].qname]=c.sets[p].value);var m,y={};for(var E in g.styleAttrs)if(y[E]=!0,E===n.byName.writingMode.qname&&!(n.byName.direction.qname in g.styleAttrs)){var v=g.styleAttrs[E];"lrtb"===v||"lr"===v?g.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==v&&"rl"!==v||(g.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==u)for(var _ in n.all){var T=n.all[_];if(T.qname===n.byName.textDecoration.qname){var b=u.styleAttrs[T.qname],S=g.styleAttrs[T.qname],A=[];void 0===S?A=b:-1===S.indexOf("none")?((-1===S.indexOf("noUnderline")&&-1!==b.indexOf("underline")||-1!==S.indexOf("underline"))&&A.push("underline"),(-1===S.indexOf("noLineThrough")&&-1!==b.indexOf("lineThrough")||-1!==S.indexOf("lineThrough"))&&A.push("lineThrough"),(-1===S.indexOf("noOverline")&&-1!==b.indexOf("overline")||-1!==S.indexOf("overline"))&&A.push("overline")):A.push("none"),g.styleAttrs[T.qname]=A}else T.inherit&&T.qname in u.styleAttrs&&!(T.qname in g.styleAttrs)&&(g.styleAttrs[T.qname]=u.styleAttrs[T.qname])}for(var I in n.all){var R=n.all[I];R.qname in g.styleAttrs||("region"===g.kind||!1===R.inherit&&null!==R.initial)&&(g.styleAttrs[R.qname]=R.parse(R.initial),y[R.qname]=!0)}for(var w in n.all){var N=n.all[w];if(N.qname in y&&null!==N.compute){var C=N.compute(e,u,g,g.styleAttrs[N.qname],d);null!==C?g.styleAttrs[N.qname]=C:o(f,"Style '"+N.qname+"' on element '"+g.kind+"' cannot be computed")}}if("none"===g.styleAttrs[n.byName.display.qname])return null;for(var D in null===u?m=null===s?[]:[s]:"contents"in c&&(m=c.contents),m){var O=r(e,t,i,s,g,h,m[D],f,d);null!==O&&g.contents.push(O.element)}for(var M in g.styleAttrs){-1===n.byQName[M].applies.indexOf(g.kind)&&delete g.styleAttrs[M]}if("span"===g.kind&&g.text&&"default"===g.space){var P=g.text.replace(/\s+/g," ");g.text=P}if("p"===g.kind){var L=[];!function e(t,n){if("contents"in t)for(var r in t.contents)e(t.contents[r],n);else n.push(t)}(g,L);for(var x=0,F="after_br",k=0;;)if("after_br"===F)x>=L.length||"br"===L[x].kind?(F="before_br",k=x,x--):("preserve"!==L[x].space&&(L[x].text=L[x].text.replace(/^\s+/g,"")),L[x].text.length>0?(F="looking_br",x++):L.splice(x,1));else if("before_br"===F)if(x<0||"br"===L[x].kind){if(F="after_br",(x=k+1)>=L.length)break}else if("preserve"!==L[x].space&&(L[x].text=L[x].text.replace(/\s+$/g,"")),L[x].text.length>0){if(F="after_br",(x=k+1)>=L.length)break}else L.splice(x,1),x--;else x>=L.length||"br"===L[x].kind?(F="before_br",k=x,x--):x++;!function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(g)}return"div"===g.kind&&n.byName.backgroundImage.qname in g.styleAttrs||"br"===g.kind||"contents"in g&&g.contents.length>0||"span"===g.kind&&null!==g.text||"region"===g.kind&&"always"===g.styleAttrs[n.byName.showBackground.qname]?{region_id:h,element:g}:null}function i(e){this.contents=[],this.aspectRatio=e.aspectRatio}function a(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function o(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,n){var a=new i(e),o={};for(var s in e.head.layout.regions){var u=r(e,t,e.head.layout.regions[s],e.body,null,"",e.head.layout.regions[s],n,o);null!==u&&a.contents.push(u.element)}return a}}(t,"undefined"==typeof imscNames?n(55):imscNames,"undefined"==typeof imscStyles?n(69):imscStyles)},function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function h(e){this.id=e}function g(e){this.regionID=e}function p(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function v(){d.call(this,"body")}function _(){d.call(this,"div")}function T(){d.call(this,"p")}function b(){d.call(this,"span")}function S(){d.call(this,"span")}function A(){d.call(this,"br")}function I(){}function R(){}function w(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function N(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function C(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&x(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):F(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function D(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function M(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(M(e,e.styles[r],n),L(e.styles[r].styleAttrs,t.styleAttrs)):F(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?L(e.styles[a].styleAttrs,n):F(r,"Non-existant style id referenced")}}function L(e,t){for(var n in e)n in t||(t[n]=e[n])}function x(e,t){if(e&&e.warn&&e.warn(t))throw t}function F(e,t){if(e&&e.error&&e.error(t))throw t}function k(e,t){throw e&&e.fatal&&e.fatal(t),t}function U(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var d=t.parser(!0,{xmlns:!0}),h=[],g=[],p=[],m=0,y=null;d.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)M(h[0],h[0].styles[t],r);else if(h[0]instanceof T||h[0]instanceof b){if(h[0].contents.length>1){var a,s=[h[0].contents[0]];for(a=1;a<h[0].contents.length;a++)h[0].contents[a]instanceof S&&s[s.length-1]instanceof S?s[s.length-1].text+=h[0].contents[a].text:s.push(h[0].contents[a]);h[0].contents=s}h[0]instanceof b&&1===h[0].contents.length&&h[0].contents[0]instanceof S&&(h[0].text=h[0].contents[0].text,delete h[0].contents)}else h[0]instanceof o&&(h[0].node.uri===n.ns_tt&&"metadata"===h[0].node.local?m--:m>0&&i&&"onCloseTag"in i&&i.onCloseTag());p.shift(),g.shift(),h.shift()},d.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof b||h[0]instanceof T){var t=new S;t.initFromText(y,h[0],e,p[0],r),h[0].contents.push(t)}else h[0]instanceof o&&m>0&&i&&"onText"in i&&i.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?p.unshift(t.value):0===p.length?p.unshift("default"):p.unshift(p[0]);var a=e.attributes["xml:lang"];if(a?g.unshift(a.value):0===g.length?g.unshift(""):g.unshift(g[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&k(r,"Two <tt> elements at ("+this.line+","+this.column+")"),(y=new s).initFromNode(e,r),h.unshift(y);else if("head"===e.local)h[0]instanceof s||k(r,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==y.head&&k("Second <head> element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||k(r,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==y.head.styling&&k("Second <styling> element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var d;h[0]instanceof l?((d=new c).initFromNode(e,r),d.id?y.head.styling.styles[d.id]=d:F(r,"<style> element missing @id attribute"),h.unshift(d)):h[0]instanceof I?((d=new c).initFromNode(e,r),L(d.styleAttrs,h[0].styleAttrs),h.unshift(d)):k(r,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("layout"===e.local)h[0]instanceof u||k(r,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==y.head.layout&&k(r,"Second <layout> element at "+this.line+","+this.column+")"),y.head.layout=new f,h.unshift(y.head.layout);else if("region"===e.local){h[0]instanceof f||k(r,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var E=new I;E.initFromNode(y,e,r),!E.id||E.id in y.head.layout.regions?F(r,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):y.head.layout.regions[E.id]=E,h.unshift(E)}else if("body"===e.local){h[0]instanceof s||k(r,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==y.body&&k(r,"Second <body> element at "+this.line+","+this.column+")");var S=new v;S.initFromNode(y,e,r),y.body=S,h.unshift(S)}else if("div"===e.local){h[0]instanceof _||h[0]instanceof v||k(r,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var w=new _;w.initFromNode(y,h[0],e,r),h[0].contents.push(w),h.unshift(w)}else if("p"===e.local){h[0]instanceof _||k(r,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var N=new T;N.initFromNode(y,h[0],e,r),h[0].contents.push(N),h.unshift(N)}else if("span"===e.local){h[0]instanceof b||h[0]instanceof T||k(r,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var C=new b;C.initFromNode(y,h[0],e,p[0],r),h[0].contents.push(C),h.unshift(C)}else if("br"===e.local){h[0]instanceof b||h[0]instanceof T||k(r,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var D=new A;D.initFromNode(y,h[0],e,r),h[0].contents.push(D),h.unshift(D)}else if("set"===e.local){h[0]instanceof b||h[0]instanceof T||h[0]instanceof _||h[0]instanceof v||h[0]instanceof I||h[0]instanceof A||k(r,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var O=new R;O.initFromNode(y,h[0],e,r),h[0].sets.push(O),h.unshift(O)}else h.unshift(new o(e));else h.unshift(new o(e));if(h[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)m++;else if(m>0&&i&&"onOpenTag"in i){var M=[];for(var P in e.attributes)M[e.attributes[P].uri+" "+e.attributes[P].local]={uri:e.attributes[P].uri,local:e.attributes[P].local,value:e.attributes[P].value};i.onOpenTag(e.uri,e.local,M)}},d.write(e).close(),null!==y.head?delete y.head.styling:y.head=new u,null===y.head.layout&&(y.head.layout=new f);var E=!1;for(var w in y.head.layout.regions){E=!0;break}if(!E){var N=I.prototype.createDefaultRegion();y.head.layout.regions[N.id]=N}for(var C in y.head.layout.regions)a(y,y.head.layout.regions[C],null,null);return y.body&&a(y,y.body,null,null),y},s.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var r=D(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):x(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,t);var r=function(e,t){var r,i=D(e,n.ns_ttp,"frameRate"),a=30;if(null!==i){null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):x(t,"Malformed frame rate attribute (using initial value instead)")}var o=D(e,n.ns_ttp,"frameRateMultiplier"),s=1;if(null!==o){null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):x(t,"Malformed frame rate multiplier attribute (using initial value instead)")}var u=s*a,l=1,c=D(e,n.ns_ttp,"tickRate");if(null===c)null!==i&&(l=u);else{null!==(r=/(\d+)/.exec(c))?l=parseInt(r[1]):x(t,"Malformed tick rate attribute (using initial value instead)")}return{effectiveFrameRate:u,tickRate:l}}(e,t);this.effectiveFrameRate=r.effectiveFrameRate,this.tickRate=r.tickRate,this.aspectRatio=function(e,t){var r=D(e,n.ns_ittp,"aspectRatio"),i=null;if(null!==r){var a=/(\d+) (\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:F(t,"Illegal aspectRatio values (ignoring)")}else F(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,t);var a=D(e,n.ns_ttp,"timeBase");null!==a&&"media"!==a&&k(t,"Unsupported time base");var o=function(e,t){var r=D(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return x(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);if(!s||!o)return x(t,"Malformed extent values (ignoring)"),null;return{h:s,w:o}}(e,t);null===o?this.pxDimensions={h:480,w:640}:("px"===o.h.unit&&"px"===o.w.unit||k(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:o.h.value,w:o.w.value})},s.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=U(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=U(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},s.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},s.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=w(e),this.styleAttrs=C(e,t),this.styleRefs=N(e)},h.prototype.initFromNode=function(e,t,n,r){this.id=w(n)},g.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},p.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=C(n,r),null!==e.head&&null!==e.head.styling&&P(e.head.styling,N(n),this.styleAttrs,r)},m.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},E.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=O(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&x(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=O(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&x(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;n&&"end"in n.attributes&&null===(o=O(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&x(r,"Malformed end value (ignoring)");return{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(F(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},v.prototype.initFromNode=function(e,t,n){p.prototype.initFromNode.call(this,e,null,t,n),E.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),g.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n)},_.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),g.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},T.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),g.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},b.prototype.initFromNode=function(e,t,n,r,i){p.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),g.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.space=r},S.prototype.initFromText=function(e,t,n,r,i){E.prototype.initFromNode.call(this,e,t,null,i),this.text=n,this.space=r},A.prototype.initFromNode=function(e,t,n,r){g.prototype.initFromNode.call(this,e,t,n,r),E.prototype.initFromNode.call(this,e,t,n,r)},I.prototype.createDefaultRegion=function(){var e=new I;return h.call(e,""),p.call(e,{}),m.call(e,[]),E.call(e,0,Number.POSITIVE_INFINITY,null),e},I.prototype.initFromNode=function(e,t,n){h.prototype.initFromNode.call(this,e,null,t,n),p.prototype.initFromNode.call(this,e,null,t,n),E.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&P(e.head.styling,N(t),this.styleAttrs,n)},R.prototype.initFromNode=function(e,t,n,r){E.prototype.initFromNode.call(this,e,t,n,r);var i=C(n,r);for(var a in this.qname=null,this.value=null,i){if(this.qname){F(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(97):sax,"undefined"==typeof imscNames?n(55):imscNames,"undefined"==typeof imscStyles?n(69):imscStyles,"undefined"==typeof imscUtils?n(86):imscUtils)},function(e,t,n){(function(e){!function(t){t.parser=function(e,t){return new a(e,t)},t.SAXParser=a,t.SAXStream=s,t.createStream=function(e,t){return new s(e,t)},t.MAX_BUFFER_LENGTH=65536;var r,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,n){if(!(this instanceof a))return new a(e,n);!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=t.MAX_BUFFER_LENGTH,this.opt=n||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!e,this.noscript=!(!e&&!this.opt.noscript),this.state=I.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(g)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),w(this,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),a.prototype={end:function(){M(this)},write:function(e){if(this.error)throw this.error;if(this.closed)return O(this,"Cannot write after close. Assign an onready handler.");if(null===e)return M(this);"object"==typeof e&&(e=e.toString());var n=0,r="";for(;r=j(e,n++),this.c=r,r;)switch(this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++),this.state){case I.BEGIN:if(this.state=I.BEGIN_WHITESPACE,"\ufeff"===r)continue;G(this,r);continue;case I.BEGIN_WHITESPACE:G(this,r);continue;case I.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=n-1;r&&"<"!==r&&"&"!==r;)(r=j(e,n++))&&this.trackPosition&&(this.position++,"\n"===r?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(a,n-1)}"<"!==r||this.sawRoot&&this.closedRoot&&!this.strict?(!T(u,r)||this.sawRoot&&!this.closedRoot||P(this,"Text data outside of root node."),"&"===r?this.state=I.TEXT_ENTITY:this.textNode+=r):(this.state=I.OPEN_WAKA,this.startTagPosition=this.position);continue;case I.SCRIPT:"<"===r?this.state=I.SCRIPT_ENDING:this.script+=r;continue;case I.SCRIPT_ENDING:"/"===r?this.state=I.CLOSE_TAG:(this.script+="<"+r,this.state=I.SCRIPT);continue;case I.OPEN_WAKA:if("!"===r)this.state=I.SGML_DECL,this.sgmlDecl="";else if(_(u,r));else if(_(p,r))this.state=I.OPEN_TAG,this.tagName=r;else if("/"===r)this.state=I.CLOSE_TAG,this.tagName="";else if("?"===r)this.state=I.PROC_INST,this.procInstName=this.procInstBody="";else{if(P(this,"Unencoded <"),this.startTagPosition+1<this.position){var o=this.position-this.startTagPosition;r=new Array(o).join(" ")+r}this.textNode+="<"+r,this.state=I.TEXT}continue;case I.SGML_DECL:"[CDATA["===(this.sgmlDecl+r).toUpperCase()?(N(this,"onopencdata"),this.state=I.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+r==="--"?(this.state=I.COMMENT,this.comment="",this.sgmlDecl=""):"DOCTYPE"===(this.sgmlDecl+r).toUpperCase()?(this.state=I.DOCTYPE,(this.doctype||this.sawRoot)&&P(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===r?(N(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=I.TEXT):_(f,r)?(this.state=I.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case I.SGML_DECL_QUOTED:r===this.q&&(this.state=I.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case I.DOCTYPE:">"===r?(this.state=I.TEXT,N(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=I.DOCTYPE_DTD:_(f,r)&&(this.state=I.DOCTYPE_QUOTED,this.q=r));continue;case I.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=I.DOCTYPE:_(f,r)&&(this.state=I.DOCTYPE_DTD_QUOTED,this.q=r);continue;case I.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=I.DOCTYPE_DTD,this.q="");continue;case I.COMMENT:"-"===r?this.state=I.COMMENT_ENDING:this.comment+=r;continue;case I.COMMENT_ENDING:"-"===r?(this.state=I.COMMENT_ENDED,this.comment=D(this.opt,this.comment),this.comment&&N(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=I.COMMENT);continue;case I.COMMENT_ENDED:">"!==r?(P(this,"Malformed comment"),this.comment+="--"+r,this.state=I.COMMENT):this.state=I.TEXT;continue;case I.CDATA:"]"===r?this.state=I.CDATA_ENDING:this.cdata+=r;continue;case I.CDATA_ENDING:"]"===r?this.state=I.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=I.CDATA);continue;case I.CDATA_ENDING_2:">"===r?(this.cdata&&N(this,"oncdata",this.cdata),N(this,"onclosecdata"),this.cdata="",this.state=I.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=I.CDATA);continue;case I.PROC_INST:"?"===r?this.state=I.PROC_INST_ENDING:_(u,r)?this.state=I.PROC_INST_BODY:this.procInstName+=r;continue;case I.PROC_INST_BODY:if(!this.procInstBody&&_(u,r))continue;"?"===r?this.state=I.PROC_INST_ENDING:this.procInstBody+=r;continue;case I.PROC_INST_ENDING:">"===r?(N(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=I.TEXT):(this.procInstBody+="?"+r,this.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:_(m,r)?this.tagName+=r:(L(this),">"===r?k(this):"/"===r?this.state=I.OPEN_TAG_SLASH:(T(u,r)&&P(this,"Invalid character in tag name"),this.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:">"===r?(k(this,!0),U(this)):(P(this,"Forward-slash in opening tag not followed by >"),this.state=I.ATTRIB);continue;case I.ATTRIB:if(_(u,r))continue;">"===r?k(this):"/"===r?this.state=I.OPEN_TAG_SLASH:_(p,r)?(this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):P(this,"Invalid attribute name");continue;case I.ATTRIB_NAME:"="===r?this.state=I.ATTRIB_VALUE:">"===r?(P(this,"Attribute without value"),this.attribValue=this.attribName,F(this),k(this)):_(u,r)?this.state=I.ATTRIB_NAME_SAW_WHITE:_(m,r)?this.attribName+=r:P(this,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=I.ATTRIB_VALUE;else{if(_(u,r))continue;P(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",N(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?k(this):_(p,r)?(this.attribName=r,this.state=I.ATTRIB_NAME):(P(this,"Invalid attribute name"),this.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(_(u,r))continue;_(f,r)?(this.q=r,this.state=I.ATTRIB_VALUE_QUOTED):(P(this,"Unquoted attribute value"),this.state=I.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case I.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}F(this),this.q="",this.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:_(u,r)?this.state=I.ATTRIB:">"===r?k(this):"/"===r?this.state=I.OPEN_TAG_SLASH:_(p,r)?(P(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=I.ATTRIB_NAME):P(this,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(T(d,r)){"&"===r?this.state=I.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}F(this),">"===r?k(this):this.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(this.tagName)">"===r?U(this):_(m,r)?this.tagName+=r:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=I.SCRIPT):(T(u,r)&&P(this,"Invalid tagname in closing tag"),this.state=I.CLOSE_TAG_SAW_WHITE);else{if(_(u,r))continue;T(p,r)?this.script?(this.script+="</"+r,this.state=I.SCRIPT):P(this,"Invalid tagname in closing tag."):this.tagName=r}continue;case I.CLOSE_TAG_SAW_WHITE:if(_(u,r))continue;">"===r?U(this):P(this,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var s,l;switch(this.state){case I.TEXT_ENTITY:s=I.TEXT,l="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:s=I.ATTRIB_VALUE_QUOTED,l="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:s=I.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===r?(this[l]+=B(this),this.entity="",this.state=s):_(this.entity.length?E:y,r)?this.entity+=r:(P(this,"Invalid character in entity name"),this[l]+="&"+this.entity+r,this.entity="",this.state=s);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,a=0,o=i.length;a<o;a++){var s=e[i[a]].length;if(s>n)switch(i[a]){case"textNode":C(e);break;case"cdata":N(e,"oncdata",e.cdata),e.cdata="";break;case"script":N(e,"onscript",e.script),e.script="";break;default:O(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,s)}var u=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=u+e.position}(this);return this}
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;C(e=this),""!==e.cdata&&(N(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(N(e,"onscript",e.script),e.script="")}};try{r=n(100).Stream}catch(e){r=function(){}}var o=t.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(r.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var r=n(74).StringDecoder;this._decoder=new r("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===o.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="\r\n\t ",l="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",f="'\"",d=u+">",h="http://www.w3.org/XML/1998/namespace",g={xml:h,xmlns:"http://www.w3.org/2000/xmlns/"};u=v(u),l=v(l),c=v(c);var p=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function v(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function _(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function T(e,t){return!_(e,t)}f=v(f),d=v(d);var b,S,A,I=0;for(var R in t.STATE={BEGIN:I++,BEGIN_WHITESPACE:I++,TEXT:I++,TEXT_ENTITY:I++,OPEN_WAKA:I++,SGML_DECL:I++,SGML_DECL_QUOTED:I++,DOCTYPE:I++,DOCTYPE_QUOTED:I++,DOCTYPE_DTD:I++,DOCTYPE_DTD_QUOTED:I++,COMMENT_STARTING:I++,COMMENT:I++,COMMENT_ENDING:I++,COMMENT_ENDED:I++,CDATA:I++,CDATA_ENDING:I++,CDATA_ENDING_2:I++,PROC_INST:I++,PROC_INST_BODY:I++,PROC_INST_ENDING:I++,OPEN_TAG:I++,OPEN_TAG_SLASH:I++,ATTRIB:I++,ATTRIB_NAME:I++,ATTRIB_NAME_SAW_WHITE:I++,ATTRIB_VALUE:I++,ATTRIB_VALUE_QUOTED:I++,ATTRIB_VALUE_CLOSED:I++,ATTRIB_VALUE_UNQUOTED:I++,ATTRIB_VALUE_ENTITY_Q:I++,ATTRIB_VALUE_ENTITY_U:I++,CLOSE_TAG:I++,CLOSE_TAG_SAW_WHITE:I++,SCRIPT:I++,SCRIPT_ENDING:I++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[R]]=R;function w(e,t,n){e[t]&&e[t](n)}function N(e,t,n){e.textNode&&C(e),w(e,t,n)}function C(e){e.textNode=D(e.opt,e.textNode),e.textNode&&w(e,"ontext",e.textNode),e.textNode=""}function D(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function O(e,t){return C(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,w(e,"onerror",t),e}function M(e){return e.sawRoot&&!e.closedRoot&&P(e,"Unclosed root tag"),e.state!==I.BEGIN&&e.state!==I.BEGIN_WHITESPACE&&e.state!==I.TEXT&&O(e,"Unexpected end"),C(e),e.c="",e.closed=!0,w(e,"onend"),a.call(e,e.strict,e.opt),e}function P(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&O(e,t)}function L(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,N(e,"onopentagstart",n)}function x(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function F(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=x(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==h)P(e,"xml: prefix must be bound to "+h+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)P(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,N(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function k(e,t){if(e.opt.xmlns){var n=e.tag,r=x(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(P(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){N(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],u=s[0],l=s[1],c=x(u,!0),f=c.prefix,d=c.local,h=""===f?"":n.ns[f]||"",g={name:u,value:l,prefix:f,local:d,uri:h};f&&"xmlns"!==f&&!h&&(P(e,"Unbound namespace prefix: "+JSON.stringify(f)),g.uri=f),e.tag.attributes[u]=g,N(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),N(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=I.TEXT:e.state=I.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function U(e){if(!e.tagName)return P(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=I.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=I.SCRIPT);N(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;P(e,"Unexpected close tag")}if(t<0)return P(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=I.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,N(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];N(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=I.TEXT}function B(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(P(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=I.OPEN_WAKA,e.startTagPosition=e.position):T(u,t)&&(P(e,"Non-whitespace before first tag."),e.textNode=t,e.state=I.TEXT)}function j(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}I=t.STATE,String.fromCodePoint||(b=String.fromCharCode,S=Math.floor,A=function(){var e,t,n=16384,r=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||S(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===a||r.length>n)&&(o+=b.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)}).call(this,n(70).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],o=n[1],s=new a(function(e,t,n){return 3*(t+n)/4-n}(0,r,o)),u=0,c=o>0?r-4:r,f=0;f<c;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===o&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t);1===o&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(c(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,g=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=g,o/=256,l-=8);e[n+h-g]|=128*p}},function(e,t,n){e.exports=i;var r=n(71).EventEmitter;function i(){r.call(this)}n(42)(i,r),i.Readable=n(72),i.Writable=n(108),i.Duplex=n(109),i.Transform=n(110),i.PassThrough=n(111),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(57).Buffer,i=n(103);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,a=r.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=a,i=s,t.copy(n,i),s+=o.data.length,o=o.next;return a},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(105),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(24))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,l={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){g(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){g(e.data)},r=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){g(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(g,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&g(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},d.clearImmediate=h}function h(e){delete l[e]}function g(e){if(c)setTimeout(g,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(24),n(26))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(24))},function(e,t,n){"use strict";e.exports=a;var r=n(91),i=n(49);function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n(42),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(73)},function(e,t,n){e.exports=n(36)},function(e,t,n){e.exports=n(72).Transform},function(e,t,n){e.exports=n(72).PassThrough},function(e,t,n){!function(e,t,n){function r(e,t,s){var l;if("region"===s.kind?(l=document.createElement("div")).style.position="absolute":"body"===s.kind||"div"===s.kind?l=document.createElement("div"):"p"===s.kind?l=document.createElement("p"):"span"===s.kind?l=document.createElement("span"):"br"===s.kind&&(l=document.createElement("br")),l){for(var c in l.style.margin="0",u){var f=u[c],d=s.styleAttrs[f.qname];void 0!==d&&null!==f.map&&f.map(e,l,s,d)}var h=l;if("region"===s.kind){var g=s.styleAttrs[n.byName.writingMode.qname];"lrtb"===g||"lr"===g?(e.ipd="lr",e.bpd="tb"):"rltb"===g||"rl"===g?(e.ipd="rl",e.bpd="tb"):"tblr"===g?(e.ipd="tb",e.bpd="lr"):"tbrl"!==g&&"tb"!==g||(e.ipd="tb",e.bpd="rl")}var p=s.styleAttrs[n.byName.linePadding.qname];if(p&&p>0){var m=Math.ceil(p*e.h)+"px";"tb"===e.bpd?(h.style.paddingLeft=m,h.style.paddingRight=m):(h.style.paddingTop=m,h.style.paddingBottom=m),e.lp=p}var y=s.styleAttrs[n.byName.multiRowAlign.qname];if(y&&"auto"!==y){var E=document.createElement("span");E.style.display="inline-block",E.style.textAlign=y,l.appendChild(E),h=E,e.mra=y}if(s.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===s.kind&&s.text)if(e.lp||e.mra||e.flg)for(var v="",_=0;_<s.text.length;_++){v+=s.text.charAt(_);var T=s.text.charCodeAt(_);if(T<55296||T>56319||_===s.text.length){var b=document.createElement("span");b.textContent=v,l.appendChild(b),v=""}}else l.textContent=s.text;for(var S in t.appendChild(l),s.contents)r(e,h,s.contents[S]);var A=[];if((e.lp||e.mra||e.flg)&&"p"===s.kind&&(o(e,h,A,null),e.mra&&(!function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(A),e.mra=null),e.lp&&(!function(e,t,n){for(var r in e){var i=e[r].elements.length,a=e[r].elements[e[r].start_elem],o=e[r].elements[e[r].end_elem],s=Math.ceil(t)+"px",u="-"+Math.ceil(t)+"px";0!==i&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=s,a.node.style.marginLeft=u):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=s,a.node.style.marginRight=u):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=s,a.node.style.marginTop=u),"lr"===n.ipd?(o.node.style.borderRightColor=o.bgcolor||"#00000000",o.node.style.borderRightStyle="solid",o.node.style.borderRightWidth=s,o.node.style.marginRight=u):"rl"===n.ipd?(o.node.style.borderLeftColor=o.bgcolor||"#00000000",o.node.style.borderLeftStyle="solid",o.node.style.borderLeftWidth=s,o.node.style.marginLeft=u):"tb"===n.ipd&&(o.node.style.borderBottomColor=o.bgcolor||"#00000000",o.node.style.borderBottomStyle="solid",o.node.style.borderBottomWidth=s,o.node.style.marginBottom=u))}}(A,e.lp*e.h,e),e.lp=null),e.flg)){var I=a(h.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var o,s,u;if(o=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2,a>0)for(var l=0;l<e[a-1].elements.length;l++)null!==e[a-1].elements[l].bgcolor&&(u=e[a-1].elements[l],i*(u.after-o)<0&&(s=Math.ceil(Math.abs(o-u.after))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingRight=s:"rl"===r.bpd?u.node.style.paddingLeft=s:"tb"===r.bpd&&(u.node.style.paddingBottom=s)));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(u=e[a].elements[c]).bgcolor&&i*(u.before-o)>0&&(s=Math.ceil(Math.abs(u.before-o))+"px",u.node.style.backgroundColor=u.bgcolor,"lr"===r.bpd?u.node.style.paddingLeft=s:"rl"===r.bpd?u.node.style.paddingRight=s:"tb"===r.bpd&&(u.node.style.paddingTop=s))}}(A,I.before,I.after,e),e.flg=null}if("region"===s.kind&&(o(e,h,A),"tb"===e.bpd&&e.enableRollUp&&s.contents.length>0&&"after"===s.styleAttrs[n.byName.displayAlign.qname])){var R=new i(""===s.id?"_":s.id,A);if(e.currentISDState[R.id]=R,e.previousISDState&&R.id in e.previousISDState&&e.previousISDState[R.id].plist.length>0&&R.plist.length>1&&R.plist[R.plist.length-2].text===e.previousISDState[R.id].plist[e.previousISDState[R.id].plist.length-1].text){var w=l.firstElementChild,N=R.plist[R.plist.length-1].after-R.plist[R.plist.length-1].before;w.style.bottom="-"+N+"px",w.style.transition="transform 0.4s",w.style.position="relative",w.style.transform="translateY(-"+N+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+s.kind)}function i(e,t){this.id=e,this.plist=t}function a(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function o(e,t,n,r){var i,s,u,l,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName){var f=t.getBoundingClientRect();if(0===f.height||0===f.width)return;var d=a(f,e);if(0!==n.length&&(i=d.before,s=d.after,u=n[n.length-1].before,l=n[n.length-1].after,s<l&&i>u||l<=s&&u>=i)){var h=Math.sign(d.after-d.before),g=Math.sign(d.end-d.start);h*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),h*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),g*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),g*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var p=t.firstChild;p;)p.nodeType===Node.ELEMENT_NODE&&o(e,p,n,c),p=p.nextSibling}function s(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,o,s,u,l){var c=i||t.clientHeight,f=a||t.clientWidth;if(null!==e.aspectRatio){var d=c*e.aspectRatio;d>f?c=Math.round(f/e.aspectRatio):f=d}var h=document.createElement("div");h.style.position="relative",h.style.width=f+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:c,w:f,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var p in t.appendChild(h),e.contents)r(g,h,e.contents[p]);return g.currentISDState};var u=[new s("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new s("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new s("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new s("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new s("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new s("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h*e.h,e.regionW=r.w*e.w;var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=(o[0]+o[2])*e.h,a=(o[1]+o[3])*e.w),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new s("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){var i=[];for(var a in r)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);t.style.fontFamily=i.join(",")})),new s("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r*e.h+"px"})),new s("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new s("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new s("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r*e.h+"px"})),new s("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new s("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h*e.h+"px",t.style.left=r.w*e.w+"px"})),new s("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new s("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0]*e.h+"px",i[1]=r[3]*e.w+"px",i[2]=r[2]*e.h+"px",i[3]=r[1]*e.w+"px",t.style.padding=i.join(" ")})),new s("http://www.w3.org/ns/ttml#styling showBackground",null),new s("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,r,i){var a,o=r.styleAttrs[n.byName.direction.qname];a="start"===i?"rtl"===o?"right":"left":"end"===i?"rtl"===o?"left":"right":i,t.style.textAlign=a})),new s("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new s("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){t.style.textShadow="none"===r?"":"rgba("+r.color[0].toString()+","+r.color[1].toString()+","+r.color[2].toString()+","+(r.color[3]/255).toString()+") 0px 0px "+r.thickness*e.h+"px"})),new s("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new s("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new s("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new s("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new s("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new s("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",(function(e,t,n,r){if(null!==e.imgResolver&&null!==r){var i=document.createElement("img"),a=e.imgResolver(r,i);a&&(i.src=a),i.height=e.regionH,i.width=e.regionW,t.appendChild(i)}})),new s("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],l={};for(var c in u)l[u[c].qname]=u[c]}(t,"undefined"==typeof imscNames?n(55):imscNames,"undefined"==typeof imscStyles?n(69):imscStyles)},function(e,t,n){"use strict";e.exports=n(114).polyfill()},function(e,t,n){(function(t,n){
- /*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
- * @version v4.2.8+1e68dce6
- */var r;r=function(){"use strict";function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){g[i]=e,g[i+1]=t,2===(i+=2)&&(o?o(p):_())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(p,1)}}var g=new Array(1e3);function p(){for(var e=0;e<i;e+=2)(0,g[e])(g[e+1]),g[e]=void 0,g[e+1]=void 0;i=0}var m,y,E,v,_=void 0;function T(e,t){var n=this,r=new this.constructor(A);void 0===r[S]&&L(r);var i=n._state;if(i){var a=arguments[i-1];s((function(){return M(i,r,a,n._result)}))}else D(n,r,e,t);return r}function b(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(A);return R(t,e),t}f?_=function(){return t.nextTick(p)}:c?(y=0,E=new c(p),v=document.createTextNode(""),E.observe(v,{characterData:!0}),_=function(){v.data=y=++y%2}):d?((m=new MessageChannel).port1.onmessage=p,_=function(){return m.port2.postMessage(0)}):_=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(p)}:h()}catch(e){return h()}}():h();var S=Math.random().toString(36).substring(2);function A(){}function I(t,n,r){n.constructor===t.constructor&&r===T&&n.constructor.resolve===b?function(e,t){1===t._state?N(e,t._result):2===t._state?C(e,t._result):D(t,void 0,(function(t){return R(e,t)}),(function(t){return C(e,t)}))}(t,n):void 0===r?N(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?R(e,n):N(e,n))}),(function(t){r||(r=!0,C(e,t))}),e._label);!r&&i&&(r=!0,C(e,i))}),e)}(t,n,r):N(t,n)}function R(e,t){if(e===t)C(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)N(e,t);else{var n=void 0;try{n=t.then}catch(t){return void C(e,t)}I(e,t,n)}var r,i}function w(e){e._onerror&&e._onerror(e._result),O(e)}function N(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(O,e))}function C(e,t){void 0===e._state&&(e._state=2,e._result=t,s(w,e))}function D(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+1]=n,i[a+2]=r,0===a&&e._state&&s(O,e)}function O(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,o=0;o<t.length;o+=3)r=t[o],i=t[o+n],r?M(n,r,i,a):i(a);e._subscribers.length=0}}function M(t,n,r,i){var a=e(r),o=void 0,s=void 0,u=!0;if(a){try{o=r(i)}catch(e){u=!1,s=e}if(n===o)return void C(n,new TypeError("A promises callback cannot return that same promise."))}else o=i;void 0!==n._state||(a&&u?R(n,o):!1===u?C(n,s):1===t?N(n,o):2===t&&C(n,o))}var P=0;function L(e){e[S]=P++,e._state=void 0,e._result=void 0,e._subscribers=[]}var x=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[S]||L(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&N(this.promise,this._result))):C(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===b){var i=void 0,a=void 0,o=!1;try{i=e.then}catch(e){o=!0,a=e}if(i===T&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===F){var s=new n(A);o?C(s,a):I(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?C(r,n):this._result[t]=n),0===this._remaining&&N(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;D(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),F=function(){function t(e){this[S]=P++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){R(e,t)}),(function(t){C(e,t)}))}catch(t){C(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return F.prototype.then=T,F.all=function(e){return new x(this,e).promise},F.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},F.resolve=b,F.reject=function(e){var t=new this(A);return C(t,e),t},F._setScheduler=function(e){o=e},F._setAsap=function(e){s=e},F._asap=s,F.polyfill=function(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=F},F.Promise=F,F},e.exports=r()}).call(this,n(26),n(24))},,,,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"MediaPlayer",(function(){return r.MediaPlayer})),n.d(t,"Protection",(function(){return o.default})),n.d(t,"MetricsReporting",(function(){return a.default})),n.d(t,"MediaPlayerFactory",(function(){return c})),n.d(t,"Debug",(function(){return f.a})),n.d(t,"supportsMediaSource",(function(){return i.b}));var r=n(94),i=n(53),a=n(93),o=n(92),s=n(58);var u,l=function(){var e;function t(t,n,r){if(!t||!/^VIDEO$/i.test(t.nodeName))return null;if(t._dashjs_player)return t._dashjs_player;var i,a=t.id||t.name||"video element";if(!(n=n||[].slice.call(t.querySelectorAll("source")).filter((function(e){return"application/dash+xml"==e.type}))[0])&&t.src)(n=document.createElement("source")).src=t.src;else if(!n&&!t.src)return null;return r=r||{},(i=Object(s.a)(r).create()).initialize(t,n.src,t.autoplay),e||(e=i.getDebug().getLogger()),e.debug("Converted "+a+" to dash.js player and added content: "+n.src),t._dashjs_player=i,i}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:t,createAll:function(e,r){var i=[];e=e||"[data-dashjs-player]";for(var a=(r=r||document).querySelectorAll(e),o=0;o<a.length;o++){var s=t(a[o],null);i.push(s)}for(var u=r.querySelectorAll('source[type="application/dash+xml"]'),l=0;l<u.length;l++){var c=t(n(u[l]),null);i.push(c)}return i}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?l.createAll():u=window.setInterval((function(){window.dashjs&&(window.clearInterval(u),l.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),l.createAll()})));var c=l,f=n(6);dashjs.Protection=o.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=c,dashjs.Debug=f.a,dashjs.supportsMediaSource=i.b;t.default=dashjs}]).default}));
- //# sourceMappingURL=dash.all.min.js.map
|