oblecto 0.2.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Oblecto-Web/dist/web/index.html +24 -3
- package/Oblecto-Web/dist/web/static/index-C-JsqHHk.css +1 -0
- package/Oblecto-Web/dist/web/static/index-DSZgpOOu.js +576 -0
- package/README.md +43 -7
- package/dist/bin/oblecto.js +12468 -61
- package/dist/index.js +10676 -6
- package/package.json +67 -39
- package/res/AGENTS.md +8 -0
- package/res/config.json +29 -7
- package/Oblecto-Web/dist/web/static/css/app.ef5965dbd50e69a7544e200a3f21fbaf.css +0 -1
- package/Oblecto-Web/dist/web/static/css/app.ef5965dbd50e69a7544e200a3f21fbaf.css.map +0 -1
- package/Oblecto-Web/dist/web/static/js/app.1352bf3c311f0e7ab716.js +0 -7150
- package/Oblecto-Web/dist/web/static/js/app.1352bf3c311f0e7ab716.js.map +0 -1
- package/Oblecto-Web/dist/web/static/js/manifest.b8404c3e329d75bb51fd.js +0 -154
- package/Oblecto-Web/dist/web/static/js/manifest.b8404c3e329d75bb51fd.js.map +0 -1
- package/Oblecto-Web/dist/web/static/js/vendor.521641a02e42750ba5a7.js +0 -32455
- package/Oblecto-Web/dist/web/static/js/vendor.521641a02e42750ba5a7.js.map +0 -1
- package/dist/bin/oblecto.d.ts +0 -2
- package/dist/bin/scripts/adduser.d.ts +0 -2
- package/dist/bin/scripts/adduser.js +0 -50
- package/dist/bin/scripts/changepassword.d.ts +0 -2
- package/dist/bin/scripts/changepassword.js +0 -48
- package/dist/bin/scripts/deluser.d.ts +0 -2
- package/dist/bin/scripts/deluser.js +0 -34
- package/dist/bin/scripts/helpers/argumentError.d.ts +0 -2
- package/dist/bin/scripts/helpers/argumentError.js +0 -12
- package/dist/bin/scripts/helpers/generateAssetDirectories.d.ts +0 -1
- package/dist/bin/scripts/helpers/generateAssetDirectories.js +0 -37
- package/dist/bin/scripts/init/assets.d.ts +0 -2
- package/dist/bin/scripts/init/assets.js +0 -24
- package/dist/bin/scripts/init/database.d.ts +0 -2
- package/dist/bin/scripts/init/database.js +0 -21
- package/dist/bin/scripts/init/general.d.ts +0 -2
- package/dist/bin/scripts/init/general.js +0 -54
- package/dist/bin/scripts/init/index.d.ts +0 -2
- package/dist/bin/scripts/init/index.js +0 -26
- package/dist/bin/scripts/removepassword.d.ts +0 -2
- package/dist/bin/scripts/removepassword.js +0 -42
- package/dist/config.d.ts +0 -7
- package/dist/config.js +0 -45
- package/dist/core/graphical.d.ts +0 -17
- package/dist/core/graphical.js +0 -179
- package/dist/core/index.d.ts +0 -9
- package/dist/core/index.js +0 -24
- package/dist/index.d.ts +0 -1
- package/dist/lib/artwork/ArtworkScaler.d.ts +0 -5
- package/dist/lib/artwork/ArtworkScaler.js +0 -31
- package/dist/lib/artwork/ArtworkUtils.d.ts +0 -8
- package/dist/lib/artwork/ArtworkUtils.js +0 -35
- package/dist/lib/artwork/movies/AggregateMovieArtworkRetriever.d.ts +0 -8
- package/dist/lib/artwork/movies/AggregateMovieArtworkRetriever.js +0 -58
- package/dist/lib/artwork/movies/MovieArtworkCollector.d.ts +0 -35
- package/dist/lib/artwork/movies/MovieArtworkCollector.js +0 -93
- package/dist/lib/artwork/movies/MovieArtworkDownloader.d.ts +0 -8
- package/dist/lib/artwork/movies/MovieArtworkDownloader.js +0 -65
- package/dist/lib/artwork/movies/artworkRetrievers/FanarttvMovieArtworkRetriever.d.ts +0 -6
- package/dist/lib/artwork/movies/artworkRetrievers/FanarttvMovieArtworkRetriever.js +0 -57
- package/dist/lib/artwork/movies/artworkRetrievers/TmdbMovieArtworkRetriever.d.ts +0 -6
- package/dist/lib/artwork/movies/artworkRetrievers/TmdbMovieArtworkRetriever.js +0 -47
- package/dist/lib/artwork/series/AggregateSeriesArtworkRetriever.d.ts +0 -8
- package/dist/lib/artwork/series/AggregateSeriesArtworkRetriever.js +0 -58
- package/dist/lib/artwork/series/SeriesArtworkCollector.d.ts +0 -37
- package/dist/lib/artwork/series/SeriesArtworkCollector.js +0 -95
- package/dist/lib/artwork/series/SeriesArtworkDownloader.d.ts +0 -8
- package/dist/lib/artwork/series/SeriesArtworkDownloader.js +0 -62
- package/dist/lib/artwork/series/artworkRetrievers/FanarttvSeriesArtworkRetriever.d.ts +0 -6
- package/dist/lib/artwork/series/artworkRetrievers/FanarttvSeriesArtworkRetriever.js +0 -44
- package/dist/lib/artwork/series/artworkRetrievers/TmdbSeriesArtworkRetriever.d.ts +0 -16
- package/dist/lib/artwork/series/artworkRetrievers/TmdbSeriesArtworkRetriever.js +0 -64
- package/dist/lib/artwork/series/artworkRetrievers/TvdbSeriesArtworkRetriever.d.ts +0 -16
- package/dist/lib/artwork/series/artworkRetrievers/TvdbSeriesArtworkRetriever.js +0 -51
- package/dist/lib/cleaners/FileCleaner.d.ts +0 -6
- package/dist/lib/cleaners/FileCleaner.js +0 -68
- package/dist/lib/cleaners/MovieCleaner.d.ts +0 -8
- package/dist/lib/cleaners/MovieCleaner.js +0 -48
- package/dist/lib/cleaners/SeriesCleaner.d.ts +0 -10
- package/dist/lib/cleaners/SeriesCleaner.js +0 -88
- package/dist/lib/common/AggregateIdentifier.d.ts +0 -9
- package/dist/lib/common/AggregateIdentifier.js +0 -57
- package/dist/lib/common/AggregateUpdateRetriever.d.ts +0 -5
- package/dist/lib/common/AggregateUpdateRetriever.js +0 -46
- package/dist/lib/downloader/index.d.ts +0 -6
- package/dist/lib/downloader/index.js +0 -83
- package/dist/lib/errors/DebugExtendableError.d.ts +0 -5
- package/dist/lib/errors/DebugExtendableError.js +0 -20
- package/dist/lib/errors/ExtendableError.d.ts +0 -3
- package/dist/lib/errors/ExtendableError.js +0 -22
- package/dist/lib/errors/FileExistsError.d.ts +0 -4
- package/dist/lib/errors/FileExistsError.js +0 -14
- package/dist/lib/errors/IdentificationError.d.ts +0 -4
- package/dist/lib/errors/IdentificationError.js +0 -14
- package/dist/lib/errors/InfoExtendableError.d.ts +0 -5
- package/dist/lib/errors/InfoExtendableError.js +0 -20
- package/dist/lib/errors/VideoAnalysisError.d.ts +0 -4
- package/dist/lib/errors/VideoAnalysisError.js +0 -14
- package/dist/lib/errors/VideoIdentificationError.d.ts +0 -4
- package/dist/lib/errors/VideoIdentificationError.js +0 -9
- package/dist/lib/errors/WarnExtendableError.d.ts +0 -5
- package/dist/lib/errors/WarnExtendableError.js +0 -20
- package/dist/lib/federation/client/FederationClient.d.ts +0 -31
- package/dist/lib/federation/client/FederationClient.js +0 -127
- package/dist/lib/federation/client/FederationClientController.d.ts +0 -9
- package/dist/lib/federation/client/FederationClientController.js +0 -45
- package/dist/lib/federation/client/FederationDataClient.d.ts +0 -11
- package/dist/lib/federation/client/FederationDataClient.js +0 -56
- package/dist/lib/federation/client/FederationMediaClient.d.ts +0 -12
- package/dist/lib/federation/client/FederationMediaClient.js +0 -70
- package/dist/lib/federation/server/FederationController.d.ts +0 -10
- package/dist/lib/federation/server/FederationController.js +0 -32
- package/dist/lib/federation/server/FederationDataServer.d.ts +0 -4
- package/dist/lib/federation/server/FederationDataServer.js +0 -22
- package/dist/lib/federation/server/FederationDataServerConnection.d.ts +0 -8
- package/dist/lib/federation/server/FederationDataServerConnection.js +0 -96
- package/dist/lib/federation/server/FederationMediaServer.d.ts +0 -4
- package/dist/lib/federation/server/FederationMediaServer.js +0 -22
- package/dist/lib/federation/server/FederationMediaServerConnection.d.ts +0 -11
- package/dist/lib/federation/server/FederationMediaServerConnection.js +0 -83
- package/dist/lib/federation/server/FederationServer.d.ts +0 -11
- package/dist/lib/federation/server/FederationServer.js +0 -40
- package/dist/lib/federation/server/FederationServerConnection.d.ts +0 -18
- package/dist/lib/federation/server/FederationServerConnection.js +0 -97
- package/dist/lib/federationindexer/FederationEpisodeIndexer.d.ts +0 -5
- package/dist/lib/federationindexer/FederationEpisodeIndexer.js +0 -65
- package/dist/lib/federationindexer/FederationMovieIndexer.d.ts +0 -5
- package/dist/lib/federationindexer/FederationMovieIndexer.js +0 -48
- package/dist/lib/federationv2/federationController/index.js +0 -13
- package/dist/lib/indexers/MediaIdentifier.d.ts +0 -5
- package/dist/lib/indexers/MediaIdentifier.js +0 -15
- package/dist/lib/indexers/files/FileIndexer.d.ts +0 -10
- package/dist/lib/indexers/files/FileIndexer.js +0 -103
- package/dist/lib/indexers/movies/MovieCollector.d.ts +0 -25
- package/dist/lib/indexers/movies/MovieCollector.js +0 -65
- package/dist/lib/indexers/movies/MovieIdentifier.d.ts +0 -10
- package/dist/lib/indexers/movies/MovieIdentifier.js +0 -22
- package/dist/lib/indexers/movies/MovieIndexer.d.ts +0 -11
- package/dist/lib/indexers/movies/MovieIndexer.js +0 -64
- package/dist/lib/indexers/movies/identifiers/TmdbMovieidentifier.d.ts +0 -4
- package/dist/lib/indexers/movies/identifiers/TmdbMovieidentifier.js +0 -52
- package/dist/lib/indexers/series/EpisodeIdentifier.d.ts +0 -12
- package/dist/lib/indexers/series/EpisodeIdentifier.js +0 -25
- package/dist/lib/indexers/series/SeriesCollector.d.ts +0 -25
- package/dist/lib/indexers/series/SeriesCollector.js +0 -69
- package/dist/lib/indexers/series/SeriesIdentifer.d.ts +0 -11
- package/dist/lib/indexers/series/SeriesIdentifer.js +0 -24
- package/dist/lib/indexers/series/SeriesIndexer.d.ts +0 -11
- package/dist/lib/indexers/series/SeriesIndexer.js +0 -140
- package/dist/lib/indexers/series/identifiers/TmdbEpisodeIdentifier.d.ts +0 -4
- package/dist/lib/indexers/series/identifiers/TmdbEpisodeIdentifier.js +0 -48
- package/dist/lib/indexers/series/identifiers/TmdbSeriesIdentifier.d.ts +0 -6
- package/dist/lib/indexers/series/identifiers/TmdbSeriesIdentifier.js +0 -90
- package/dist/lib/indexers/series/identifiers/TvdbEpisodeIdentifier.d.ts +0 -7
- package/dist/lib/indexers/series/identifiers/TvdbEpisodeIdentifier.js +0 -87
- package/dist/lib/indexers/series/identifiers/TvdbSeriesIdentifier.d.ts +0 -10
- package/dist/lib/indexers/series/identifiers/TvdbSeriesIdentifier.js +0 -82
- package/dist/lib/oblecto/index.d.ts +0 -68
- package/dist/lib/oblecto/index.js +0 -125
- package/dist/lib/queue/index.d.ts +0 -32
- package/dist/lib/queue/index.js +0 -96
- package/dist/lib/realtime/RealtimeClient.d.ts +0 -27
- package/dist/lib/realtime/RealtimeClient.js +0 -137
- package/dist/lib/realtime/RealtimeController.d.ts +0 -12
- package/dist/lib/realtime/RealtimeController.js +0 -50
- package/dist/lib/redisQueue/index.js +0 -109
- package/dist/lib/sets/tv/MovieSetCollector.d.ts +0 -6
- package/dist/lib/sets/tv/MovieSetCollector.js +0 -49
- package/dist/lib/streamSessions/StreamSession.d.ts +0 -41
- package/dist/lib/streamSessions/StreamSession.js +0 -146
- package/dist/lib/streamSessions/StreamSessionController.d.ts +0 -19
- package/dist/lib/streamSessions/StreamSessionController.js +0 -78
- package/dist/lib/streamSessions/StreamSessionTypes/DirectHttpStreamSession.d.ts +0 -5
- package/dist/lib/streamSessions/StreamSessionTypes/DirectHttpStreamSession.js +0 -116
- package/dist/lib/streamSessions/StreamSessionTypes/DirectStreamSession.d.ts +0 -5
- package/dist/lib/streamSessions/StreamSessionTypes/DirectStreamSession.js +0 -41
- package/dist/lib/streamSessions/StreamSessionTypes/HLSStreamer.d.ts +0 -15
- package/dist/lib/streamSessions/StreamSessionTypes/HLSStreamer.js +0 -148
- package/dist/lib/streamSessions/StreamSessionTypes/RecodeFederationStreamSession.d.ts +0 -9
- package/dist/lib/streamSessions/StreamSessionTypes/RecodeFederationStreamSession.js +0 -72
- package/dist/lib/streamSessions/StreamSessionTypes/RecodeStreamSession.d.ts +0 -6
- package/dist/lib/streamSessions/StreamSessionTypes/RecodeStreamSession.js +0 -96
- package/dist/lib/updaters/files/FileUpdateCollector.d.ts +0 -20
- package/dist/lib/updaters/files/FileUpdateCollector.js +0 -44
- package/dist/lib/updaters/files/FileUpdater.d.ts +0 -49
- package/dist/lib/updaters/files/FileUpdater.js +0 -194
- package/dist/lib/updaters/movies/MovieUpdateCollector.d.ts +0 -20
- package/dist/lib/updaters/movies/MovieUpdateCollector.js +0 -48
- package/dist/lib/updaters/movies/MovieUpdater.d.ts +0 -12
- package/dist/lib/updaters/movies/MovieUpdater.js +0 -49
- package/dist/lib/updaters/movies/informationRetrievers/TmdbMovieRetriever.d.ts +0 -20
- package/dist/lib/updaters/movies/informationRetrievers/TmdbMovieRetriever.js +0 -45
- package/dist/lib/updaters/series/SeriesUpdateCollector.d.ts +0 -37
- package/dist/lib/updaters/series/SeriesUpdateCollector.js +0 -79
- package/dist/lib/updaters/series/SeriesUpdater.d.ts +0 -22
- package/dist/lib/updaters/series/SeriesUpdater.js +0 -84
- package/dist/lib/updaters/series/informationRetrievers/TmdbEpisodeRetriever.d.ts +0 -11
- package/dist/lib/updaters/series/informationRetrievers/TmdbEpisodeRetriever.js +0 -70
- package/dist/lib/updaters/series/informationRetrievers/TmdbSeriesRetriever.d.ts +0 -21
- package/dist/lib/updaters/series/informationRetrievers/TmdbSeriesRetriever.js +0 -68
- package/dist/lib/updaters/series/informationRetrievers/TvdbEpisodeRetriever.d.ts +0 -5
- package/dist/lib/updaters/series/informationRetrievers/TvdbEpisodeRetriever.js +0 -38
- package/dist/lib/updaters/series/informationRetrievers/TvdbSeriesRetriever.d.ts +0 -21
- package/dist/lib/updaters/series/informationRetrievers/TvdbSeriesRetriever.js +0 -50
- package/dist/models/episode.d.ts +0 -76
- package/dist/models/episode.js +0 -62
- package/dist/models/episodeFiles.d.ts +0 -5
- package/dist/models/episodeFiles.js +0 -14
- package/dist/models/file.d.ts +0 -26
- package/dist/models/file.js +0 -32
- package/dist/models/movie.d.ts +0 -30
- package/dist/models/movie.js +0 -36
- package/dist/models/movieFiles.d.ts +0 -5
- package/dist/models/movieFiles.js +0 -14
- package/dist/models/movieSet.d.ts +0 -20
- package/dist/models/movieSet.js +0 -26
- package/dist/models/series.d.ts +0 -59
- package/dist/models/series.js +0 -50
- package/dist/models/seriesSet.d.ts +0 -9
- package/dist/models/seriesSet.js +0 -17
- package/dist/models/stream.d.ts +0 -73
- package/dist/models/stream.js +0 -81
- package/dist/models/trackEpisode.d.ts +0 -9
- package/dist/models/trackEpisode.js +0 -17
- package/dist/models/trackMovie.d.ts +0 -9
- package/dist/models/trackMovie.js +0 -17
- package/dist/models/user.d.ts +0 -19
- package/dist/models/user.js +0 -26
- package/dist/submodules/REST/index.d.ts +0 -9
- package/dist/submodules/REST/index.js +0 -59
- package/dist/submodules/REST/middleware/auth.d.ts +0 -5
- package/dist/submodules/REST/middleware/auth.js +0 -28
- package/dist/submodules/REST/routes/auth.d.ts +0 -2
- package/dist/submodules/REST/routes/auth.js +0 -48
- package/dist/submodules/REST/routes/clients.d.ts +0 -2
- package/dist/submodules/REST/routes/clients.js +0 -54
- package/dist/submodules/REST/routes/episodes.d.ts +0 -2
- package/dist/submodules/REST/routes/episodes.js +0 -275
- package/dist/submodules/REST/routes/files.d.ts +0 -2
- package/dist/submodules/REST/routes/files.js +0 -53
- package/dist/submodules/REST/routes/index.d.ts +0 -2
- package/dist/submodules/REST/routes/index.js +0 -49
- package/dist/submodules/REST/routes/movies.d.ts +0 -2
- package/dist/submodules/REST/routes/movies.js +0 -303
- package/dist/submodules/REST/routes/sets.d.ts +0 -2
- package/dist/submodules/REST/routes/sets.js +0 -35
- package/dist/submodules/REST/routes/settings/index.d.ts +0 -2
- package/dist/submodules/REST/routes/settings/index.js +0 -22
- package/dist/submodules/REST/routes/settings/maintenance.d.ts +0 -2
- package/dist/submodules/REST/routes/settings/maintenance.js +0 -87
- package/dist/submodules/REST/routes/settings/misc.d.ts +0 -2
- package/dist/submodules/REST/routes/settings/misc.js +0 -38
- package/dist/submodules/REST/routes/settings/sources.d.ts +0 -2
- package/dist/submodules/REST/routes/settings/sources.js +0 -61
- package/dist/submodules/REST/routes/streaming.js +0 -91
- package/dist/submodules/REST/routes/tvshows.d.ts +0 -2
- package/dist/submodules/REST/routes/tvshows.js +0 -137
- package/dist/submodules/REST/routes/users.d.ts +0 -2
- package/dist/submodules/REST/routes/users.js +0 -107
- package/dist/submodules/REST/routes/web.d.ts +0 -2
- package/dist/submodules/REST/routes/web.js +0 -43
- package/dist/submodules/axiosTimeout.d.ts +0 -1
- package/dist/submodules/axiosTimeout.js +0 -31
- package/dist/submodules/database.d.ts +0 -1
- package/dist/submodules/database.js +0 -180
- package/dist/submodules/ffmpeg.d.ts +0 -1
- package/dist/submodules/ffmpeg.js +0 -23
- package/dist/submodules/ffprobe.d.ts +0 -1
- package/dist/submodules/ffprobe.js +0 -22
- package/dist/submodules/guessit.d.ts +0 -5
- package/dist/submodules/guessit.js +0 -48
- package/dist/submodules/logger/index.d.ts +0 -7
- package/dist/submodules/logger/index.js +0 -43
- package/dist/submodules/promiseTimeout.d.ts +0 -1
- package/dist/submodules/promiseTimeout.js +0 -28
- package/dist/submodules/zeroconf.js +0 -19
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
var cx=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var nG=cx((hd,Jn)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var ux={};/*!
|
|
2
|
+
* Vue.js v2.7.16
|
|
3
|
+
* (c) 2014-2023 Evan You
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/var Rt=Object.freeze({}),Ae=Array.isArray;function ge(s){return s==null}function W(s){return s!=null}function at(s){return s===!0}function fx(s){return s===!1}function ya(s){return typeof s=="string"||typeof s=="number"||typeof s=="symbol"||typeof s=="boolean"}function je(s){return typeof s=="function"}function Pt(s){return s!==null&&typeof s=="object"}var pd=Object.prototype.toString;function Ut(s){return pd.call(s)==="[object Object]"}function dx(s){return pd.call(s)==="[object RegExp]"}function ev(s){var e=parseFloat(String(s));return e>=0&&Math.floor(e)===e&&isFinite(s)}function Wu(s){return W(s)&&typeof s.then=="function"&&typeof s.catch=="function"}function hx(s){return s==null?"":Array.isArray(s)||Ut(s)&&s.toString===pd?JSON.stringify(s,px,2):String(s)}function px(s,e){return e&&e.__v_isRef?e.value:e}function Zn(s){var e=parseFloat(s);return isNaN(e)?s:e}function Os(s,e){for(var t=Object.create(null),i=s.split(","),r=0;r<i.length;r++)t[i[r]]=!0;return e?function(n){return t[n.toLowerCase()]}:function(n){return t[n]}}Os("slot,component",!0);var mx=Os("key,ref,slot,slot-scope,is");function Zi(s,e){var t=s.length;if(t){if(e===s[t-1]){s.length=t-1;return}var i=s.indexOf(e);if(i>-1)return s.splice(i,1)}}var gx=Object.prototype.hasOwnProperty;function Bt(s,e){return gx.call(s,e)}function Ar(s){var e=Object.create(null);return function(i){var r=e[i];return r||(e[i]=s(i))}}var vx=/-(\w)/g,yr=Ar(function(s){return s.replace(vx,function(e,t){return t?t.toUpperCase():""})}),yx=Ar(function(s){return s.charAt(0).toUpperCase()+s.slice(1)}),bx=/\B([A-Z])/g,ba=Ar(function(s){return s.replace(bx,"-$1").toLowerCase()});function Sx(s,e){function t(i){var r=arguments.length;return r?r>1?s.apply(e,arguments):s.call(e,i):s.call(e)}return t._length=s.length,t}function Ex(s,e){return s.bind(e)}var tv=Function.prototype.bind?Ex:Sx;function zu(s,e){e=e||0;for(var t=s.length-e,i=new Array(t);t--;)i[t]=s[t+e];return i}function Je(s,e){for(var t in e)s[t]=e[t];return s}function sv(s){for(var e={},t=0;t<s.length;t++)s[t]&&Je(e,s[t]);return e}function rt(s,e,t){}var Ua=function(s,e,t){return!1},iv=function(s){return s};function br(s,e){if(s===e)return!0;var t=Pt(s),i=Pt(e);if(t&&i)try{var r=Array.isArray(s),n=Array.isArray(e);if(r&&n)return s.length===e.length&&s.every(function(l,c){return br(l,e[c])});if(s instanceof Date&&e instanceof Date)return s.getTime()===e.getTime();if(!r&&!n){var a=Object.keys(s),o=Object.keys(e);return a.length===o.length&&a.every(function(l){return br(s[l],e[l])})}else return!1}catch{return!1}else return!t&&!i?String(s)===String(e):!1}function rv(s,e){for(var t=0;t<s.length;t++)if(br(s[t],e))return t;return-1}function Xo(s){var e=!1;return function(){e||(e=!0,s.apply(this,arguments))}}function Qu(s,e){return s===e?s===0&&1/s!==1/e:s===s||e===e}var mp="data-server-rendered",Hl=["component","directive","filter"],nv=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],vs={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Ua,isReservedAttr:Ua,isUnknownElement:Ua,getTagNamespace:rt,parsePlatformTagName:iv,mustUseProp:Ua,async:!0,_lifecycleHooks:nv},_x=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function av(s){var e=(s+"").charCodeAt(0);return e===36||e===95}function pt(s,e,t,i){Object.defineProperty(s,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}var xx=new RegExp("[^".concat(_x.source,".$_\\d]"));function Ax(s){if(!xx.test(s)){var e=s.split(".");return function(t){for(var i=0;i<e.length;i++){if(!t)return;t=t[e[i]]}return t}}}var Tx="__proto__"in{},Xt=typeof window<"u",ys=Xt&&window.navigator.userAgent.toLowerCase(),hn=ys&&/msie|trident/.test(ys),pn=ys&&ys.indexOf("msie 9.0")>0,ov=ys&&ys.indexOf("edge/")>0;ys&&ys.indexOf("android")>0;var wx=ys&&/iphone|ipad|ipod|ios/.test(ys),gp=ys&&ys.match(/firefox\/(\d+)/),qu={}.watch,lv=!1;if(Xt)try{var vp={};Object.defineProperty(vp,"passive",{get:function(){lv=!0}}),window.addEventListener("test-passive",null,vp)}catch{}var Ga,er=function(){return Ga===void 0&&(!Xt&&typeof global<"u"?Ga=global.process&&ux.VUE_ENV==="server":Ga=!1),Ga},Jo=Xt&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function qr(s){return typeof s=="function"&&/native code/.test(s.toString())}var Sa=typeof Symbol<"u"&&qr(Symbol)&&typeof Reflect<"u"&&qr(Reflect.ownKeys),ea;typeof Set<"u"&&qr(Set)?ea=Set:ea=function(){function s(){this.set=Object.create(null)}return s.prototype.has=function(e){return this.set[e]===!0},s.prototype.add=function(e){this.set[e]=!0},s.prototype.clear=function(){this.set=Object.create(null)},s}();var ut=null;function Cx(){return ut&&{proxy:ut}}function Wi(s){s===void 0&&(s=null),s||ut&&ut._scope.off(),ut=s,s&&s._scope.on()}var ls=function(){function s(e,t,i,r,n,a,o,l){this.tag=e,this.data=t,this.children=i,this.text=r,this.elm=n,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=l,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(s.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),s}(),fr=function(s){s===void 0&&(s="");var e=new ls;return e.text=s,e.isComment=!0,e};function Vr(s){return new ls(void 0,void 0,void 0,String(s))}function Xu(s){var e=new ls(s.tag,s.data,s.children&&s.children.slice(),s.text,s.elm,s.context,s.componentOptions,s.asyncFactory);return e.ns=s.ns,e.isStatic=s.isStatic,e.key=s.key,e.isComment=s.isComment,e.fnContext=s.fnContext,e.fnOptions=s.fnOptions,e.fnScopeId=s.fnScopeId,e.asyncMeta=s.asyncMeta,e.isCloned=!0,e}var Lx=0,bo=[],Ix=function(){for(var s=0;s<bo.length;s++){var e=bo[s];e.subs=e.subs.filter(function(t){return t}),e._pending=!1}bo.length=0},qs=function(){function s(){this._pending=!1,this.id=Lx++,this.subs=[]}return s.prototype.addSub=function(e){this.subs.push(e)},s.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,bo.push(this))},s.prototype.depend=function(e){s.target&&s.target.addDep(this)},s.prototype.notify=function(e){for(var t=this.subs.filter(function(a){return a}),i=0,r=t.length;i<r;i++){var n=t[i];n.update()}},s}();qs.target=null;var So=[];function mn(s){So.push(s),qs.target=s}function gn(){So.pop(),qs.target=So[So.length-1]}var cv=Array.prototype,Zo=Object.create(cv),Rx=["push","pop","shift","unshift","splice","sort","reverse"];Rx.forEach(function(s){var e=cv[s];pt(Zo,s,function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var n=e.apply(this,i),a=this.__ob__,o;switch(s){case"push":case"unshift":o=i;break;case"splice":o=i.slice(2);break}return o&&a.observeArray(o),a.dep.notify(),n})});var yp=Object.getOwnPropertyNames(Zo),uv={},md=!0;function zi(s){md=s}var Dx={notify:rt,depend:rt,addSub:rt,removeSub:rt},bp=function(){function s(e,t,i){if(t===void 0&&(t=!1),i===void 0&&(i=!1),this.value=e,this.shallow=t,this.mock=i,this.dep=i?Dx:new qs,this.vmCount=0,pt(e,"__ob__",this),Ae(e)){if(!i)if(Tx)e.__proto__=Zo;else for(var r=0,n=yp.length;r<n;r++){var a=yp[r];pt(e,a,Zo[a])}t||this.observeArray(e)}else for(var o=Object.keys(e),r=0;r<o.length;r++){var a=o[r];Qi(e,a,uv,void 0,t,i)}}return s.prototype.observeArray=function(e){for(var t=0,i=e.length;t<i;t++)yi(e[t],!1,this.mock)},s}();function yi(s,e,t){if(s&&Bt(s,"__ob__")&&s.__ob__ instanceof bp)return s.__ob__;if(md&&(t||!er())&&(Ae(s)||Ut(s))&&Object.isExtensible(s)&&!s.__v_skip&&!Lt(s)&&!(s instanceof ls))return new bp(s,e,t)}function Qi(s,e,t,i,r,n,a){a===void 0&&(a=!1);var o=new qs,l=Object.getOwnPropertyDescriptor(s,e);if(!(l&&l.configurable===!1)){var c=l&&l.get,u=l&&l.set;(!c||u)&&(t===uv||arguments.length===2)&&(t=s[e]);var f=r?t&&t.__ob__:yi(t,!1,n);return Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:function(){var h=c?c.call(s):t;return qs.target&&(o.depend(),f&&(f.dep.depend(),Ae(h)&&fv(h))),Lt(h)&&!r?h.value:h},set:function(h){var p=c?c.call(s):t;if(Qu(p,h)){if(u)u.call(s,h);else{if(c)return;if(!r&&Lt(p)&&!Lt(h)){p.value=h;return}else t=h}f=r?h&&h.__ob__:yi(h,!1,n),o.notify()}}}),o}}function Yl(s,e,t){if(!Tr(s)){var i=s.__ob__;return Ae(s)&&ev(e)?(s.length=Math.max(s.length,e),s.splice(e,1,t),i&&!i.shallow&&i.mock&&yi(t,!1,!0),t):e in s&&!(e in Object.prototype)?(s[e]=t,t):s._isVue||i&&i.vmCount?t:i?(Qi(i.value,e,t,void 0,i.shallow,i.mock),i.dep.notify(),t):(s[e]=t,t)}}function gd(s,e){if(Ae(s)&&ev(e)){s.splice(e,1);return}var t=s.__ob__;s._isVue||t&&t.vmCount||Tr(s)||Bt(s,e)&&(delete s[e],t&&t.dep.notify())}function fv(s){for(var e=void 0,t=0,i=s.length;t<i;t++)e=s[t],e&&e.__ob__&&e.__ob__.dep.depend(),Ae(e)&&fv(e)}function kx(s){return dv(s,!1),s}function vd(s){return dv(s,!0),pt(s,"__v_isShallow",!0),s}function dv(s,e){Tr(s)||yi(s,e,er())}function dr(s){return Tr(s)?dr(s.__v_raw):!!(s&&s.__ob__)}function el(s){return!!(s&&s.__v_isShallow)}function Tr(s){return!!(s&&s.__v_isReadonly)}function Px(s){return dr(s)||Tr(s)}function hv(s){var e=s&&s.__v_raw;return e?hv(e):s}function Ox(s){return Object.isExtensible(s)&&pt(s,"__v_skip",!0),s}var Ea="__v_isRef";function Lt(s){return!!(s&&s.__v_isRef===!0)}function Mx(s){return pv(s,!1)}function Nx(s){return pv(s,!0)}function pv(s,e){if(Lt(s))return s;var t={};return pt(t,Ea,!0),pt(t,"__v_isShallow",e),pt(t,"dep",Qi(t,"value",s,null,e,er())),t}function Fx(s){s.dep&&s.dep.notify()}function $x(s){return Lt(s)?s.value:s}function Bx(s){if(dr(s))return s;for(var e={},t=Object.keys(s),i=0;i<t.length;i++)tl(e,s,t[i]);return e}function tl(s,e,t){Object.defineProperty(s,t,{enumerable:!0,configurable:!0,get:function(){var i=e[t];if(Lt(i))return i.value;var r=i&&i.__ob__;return r&&r.dep.depend(),i},set:function(i){var r=e[t];Lt(r)&&!Lt(i)?r.value=i:e[t]=i}})}function Ux(s){var e=new qs,t=s(function(){e.depend()},function(){e.notify()}),i=t.get,r=t.set,n={get value(){return i()},set value(a){r(a)}};return pt(n,Ea,!0),n}function Gx(s){var e=Ae(s)?new Array(s.length):{};for(var t in s)e[t]=mv(s,t);return e}function mv(s,e,t){var i=s[e];if(Lt(i))return i;var r={get value(){var n=s[e];return n===void 0?t:n},set value(n){s[e]=n}};return pt(r,Ea,!0),r}var Hx="__v_rawToReadonly",Yx="__v_rawToShallowReadonly";function gv(s){return vv(s,!1)}function vv(s,e){if(!Ut(s)||Tr(s))return s;var t=e?Yx:Hx,i=s[t];if(i)return i;var r=Object.create(Object.getPrototypeOf(s));pt(s,t,r),pt(r,"__v_isReadonly",!0),pt(r,"__v_raw",s),Lt(s)&&pt(r,Ea,!0),(e||el(s))&&pt(r,"__v_isShallow",!0);for(var n=Object.keys(s),a=0;a<n.length;a++)jx(r,s,n[a],e);return r}function jx(s,e,t,i){Object.defineProperty(s,t,{enumerable:!0,configurable:!0,get:function(){var r=e[t];return i||!Ut(r)?r:gv(r)},set:function(){}})}function Vx(s){return vv(s,!0)}function Kx(s,e){var t,i,r=je(s);r?(t=s,i=rt):(t=s.get,i=s.set);var n=er()?null:new _a(ut,t,rt,{lazy:!0}),a={effect:n,get value(){return n?(n.dirty&&n.evaluate(),qs.target&&n.depend(),n.value):t()},set value(o){i(o)}};return pt(a,Ea,!0),pt(a,"__v_isReadonly",r),a}var jl="watcher",Sp="".concat(jl," callback"),Ep="".concat(jl," getter"),Wx="".concat(jl," cleanup");function zx(s,e){return Vl(s,null,e)}function yv(s,e){return Vl(s,null,{flush:"post"})}function Qx(s,e){return Vl(s,null,{flush:"sync"})}var _p={};function qx(s,e,t){return Vl(s,e,t)}function Vl(s,e,t){var i=t===void 0?Rt:t,r=i.immediate,n=i.deep,a=i.flush,o=a===void 0?"pre":a;i.onTrack,i.onTrigger;var l=ut,c=function(y,E,w){w===void 0&&(w=null);var T=bi(y,null,w,l,E);return n&&T&&T.__ob__&&T.__ob__.dep.depend(),T},u,f=!1,d=!1;if(Lt(s)?(u=function(){return s.value},f=el(s)):dr(s)?(u=function(){return s.__ob__.dep.depend(),s},n=!0):Ae(s)?(d=!0,f=s.some(function(y){return dr(y)||el(y)}),u=function(){return s.map(function(y){if(Lt(y))return y.value;if(dr(y))return y.__ob__.dep.depend(),an(y);if(je(y))return c(y,Ep)})}):je(s)?e?u=function(){return c(s,Ep)}:u=function(){if(!(l&&l._isDestroyed))return p&&p(),c(s,jl,[g])}:u=rt,e&&n){var h=u;u=function(){return an(h())}}var p,g=function(y){p=m.onStop=function(){c(y,Wx)}};if(er())return g=rt,e?r&&c(e,Sp,[u(),d?[]:void 0,g]):u(),rt;var m=new _a(ut,u,rt,{lazy:!0});m.noRecurse=!e;var v=d?[]:_p;return m.run=function(){if(m.active)if(e){var y=m.get();(n||f||(d?y.some(function(E,w){return Qu(E,v[w])}):Qu(y,v)))&&(p&&p(),c(e,Sp,[y,v===_p?void 0:v,g]),v=y)}else m.get()},o==="sync"?m.update=m.run:o==="post"?(m.post=!0,m.update=function(){return nf(m)}):m.update=function(){if(l&&l===ut&&!l._isMounted){var y=l._preWatchers||(l._preWatchers=[]);y.indexOf(m)<0&&y.push(m)}else nf(m)},e?r?m.run():v=m.get():o==="post"&&l?l.$once("hook:mounted",function(){return m.get()}):m.get(),function(){m.teardown()}}var It,yd=function(){function s(e){e===void 0&&(e=!1),this.detached=e,this.active=!0,this.effects=[],this.cleanups=[],this.parent=It,!e&&It&&(this.index=(It.scopes||(It.scopes=[])).push(this)-1)}return s.prototype.run=function(e){if(this.active){var t=It;try{return It=this,e()}finally{It=t}}},s.prototype.on=function(){It=this},s.prototype.off=function(){It=this.parent},s.prototype.stop=function(e){if(this.active){var t=void 0,i=void 0;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].teardown();for(t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this.active=!1}},s}();function Xx(s){return new yd(s)}function Jx(s,e){e===void 0&&(e=It),e&&e.active&&e.effects.push(s)}function bv(){return It}function Zx(s){It&&It.cleanups.push(s)}function eA(s,e){ut&&(Sv(ut)[s]=e)}function Sv(s){var e=s._provided,t=s.$parent&&s.$parent._provided;return t===e?s._provided=Object.create(t):e}function tA(s,e,t){t===void 0&&(t=!1);var i=ut;if(i){var r=i.$parent&&i.$parent._provided;if(r&&s in r)return r[s];if(arguments.length>1)return t&&je(e)?e.call(i):e}}var xp=Ar(function(s){var e=s.charAt(0)==="&";s=e?s.slice(1):s;var t=s.charAt(0)==="~";s=t?s.slice(1):s;var i=s.charAt(0)==="!";return s=i?s.slice(1):s,{name:s,once:t,capture:i,passive:e}});function Ju(s,e){function t(){var i=t.fns;if(Ae(i))for(var r=i.slice(),n=0;n<r.length;n++)bi(r[n],null,arguments,e,"v-on handler");else return bi(i,null,arguments,e,"v-on handler")}return t.fns=s,t}function Ev(s,e,t,i,r,n){var a,o,l,c;for(a in s)o=s[a],l=e[a],c=xp(a),ge(o)||(ge(l)?(ge(o.fns)&&(o=s[a]=Ju(o,n)),at(c.once)&&(o=s[a]=r(c.name,o,c.capture)),t(c.name,o,c.capture,c.passive,c.params)):o!==l&&(l.fns=o,s[a]=l));for(a in e)ge(s[a])&&(c=xp(a),i(c.name,e[a],c.capture))}function Ni(s,e,t){s instanceof ls&&(s=s.data.hook||(s.data.hook={}));var i,r=s[e];function n(){t.apply(this,arguments),Zi(i.fns,n)}ge(r)?i=Ju([n]):W(r.fns)&&at(r.merged)?(i=r,i.fns.push(n)):i=Ju([r,n]),i.merged=!0,s[e]=i}function sA(s,e,t){var i=e.options.props;if(!ge(i)){var r={},n=s.attrs,a=s.props;if(W(n)||W(a))for(var o in i){var l=ba(o);Ap(r,a,o,l,!0)||Ap(r,n,o,l,!1)}return r}}function Ap(s,e,t,i,r){if(W(e)){if(Bt(e,t))return s[t]=e[t],r||delete e[t],!0;if(Bt(e,i))return s[t]=e[i],r||delete e[i],!0}return!1}function iA(s){for(var e=0;e<s.length;e++)if(Ae(s[e]))return Array.prototype.concat.apply([],s);return s}function bd(s){return ya(s)?[Vr(s)]:Ae(s)?_v(s):void 0}function Dn(s){return W(s)&&W(s.text)&&fx(s.isComment)}function _v(s,e){var t=[],i,r,n,a;for(i=0;i<s.length;i++)r=s[i],!(ge(r)||typeof r=="boolean")&&(n=t.length-1,a=t[n],Ae(r)?r.length>0&&(r=_v(r,"".concat(e||"","_").concat(i)),Dn(r[0])&&Dn(a)&&(t[n]=Vr(a.text+r[0].text),r.shift()),t.push.apply(t,r)):ya(r)?Dn(a)?t[n]=Vr(a.text+r):r!==""&&t.push(Vr(r)):Dn(r)&&Dn(a)?t[n]=Vr(a.text+r.text):(at(s._isVList)&&W(r.tag)&&ge(r.key)&&W(e)&&(r.key="__vlist".concat(e,"_").concat(i,"__")),t.push(r)));return t}function rA(s,e){var t=null,i,r,n,a;if(Ae(s)||typeof s=="string")for(t=new Array(s.length),i=0,r=s.length;i<r;i++)t[i]=e(s[i],i);else if(typeof s=="number")for(t=new Array(s),i=0;i<s;i++)t[i]=e(i+1,i);else if(Pt(s))if(Sa&&s[Symbol.iterator]){t=[];for(var o=s[Symbol.iterator](),l=o.next();!l.done;)t.push(e(l.value,t.length)),l=o.next()}else for(n=Object.keys(s),t=new Array(n.length),i=0,r=n.length;i<r;i++)a=n[i],t[i]=e(s[a],a,i);return W(t)||(t=[]),t._isVList=!0,t}function nA(s,e,t,i){var r=this.$scopedSlots[s],n;r?(t=t||{},i&&(t=Je(Je({},i),t)),n=r(t)||(je(e)?e():e)):n=this.$slots[s]||(je(e)?e():e);var a=t&&t.slot;return a?this.$createElement("template",{slot:a},n):n}function aA(s){return nl(this.$options,"filters",s)||iv}function Tp(s,e){return Ae(s)?s.indexOf(e)===-1:s!==e}function oA(s,e,t,i,r){var n=vs.keyCodes[e]||t;return r&&i&&!vs.keyCodes[e]?Tp(r,i):n?Tp(n,s):i?ba(i)!==e:s===void 0}function lA(s,e,t,i,r){if(t&&Pt(t)){Ae(t)&&(t=sv(t));var n=void 0,a=function(l){if(l==="class"||l==="style"||mx(l))n=s;else{var c=s.attrs&&s.attrs.type;n=i||vs.mustUseProp(e,c,l)?s.domProps||(s.domProps={}):s.attrs||(s.attrs={})}var u=yr(l),f=ba(l);if(!(u in n)&&!(f in n)&&(n[l]=t[l],r)){var d=s.on||(s.on={});d["update:".concat(l)]=function(h){t[l]=h}}};for(var o in t)a(o)}return s}function cA(s,e){var t=this._staticTrees||(this._staticTrees=[]),i=t[s];return i&&!e||(i=t[s]=this.$options.staticRenderFns[s].call(this._renderProxy,this._c,this),xv(i,"__static__".concat(s),!1)),i}function uA(s,e,t){return xv(s,"__once__".concat(e).concat(t?"_".concat(t):""),!0),s}function xv(s,e,t){if(Ae(s))for(var i=0;i<s.length;i++)s[i]&&typeof s[i]!="string"&&wp(s[i],"".concat(e,"_").concat(i),t);else wp(s,e,t)}function wp(s,e,t){s.isStatic=!0,s.key=e,s.isOnce=t}function fA(s,e){if(e&&Ut(e)){var t=s.on=s.on?Je({},s.on):{};for(var i in e){var r=t[i],n=e[i];t[i]=r?[].concat(r,n):n}}return s}function Av(s,e,t,i){e=e||{$stable:!t};for(var r=0;r<s.length;r++){var n=s[r];Ae(n)?Av(n,e,t):n&&(n.proxy&&(n.fn.proxy=!0),e[n.key]=n.fn)}return i&&(e.$key=i),e}function dA(s,e){for(var t=0;t<e.length;t+=2){var i=e[t];typeof i=="string"&&i&&(s[e[t]]=e[t+1])}return s}function hA(s,e){return typeof s=="string"?e+s:s}function Tv(s){s._o=uA,s._n=Zn,s._s=hx,s._l=rA,s._t=nA,s._q=br,s._i=rv,s._m=cA,s._f=aA,s._k=oA,s._b=lA,s._v=Vr,s._e=fr,s._u=Av,s._g=fA,s._d=dA,s._p=hA}function Sd(s,e){if(!s||!s.length)return{};for(var t={},i=0,r=s.length;i<r;i++){var n=s[i],a=n.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,(n.context===e||n.fnContext===e)&&a&&a.slot!=null){var o=a.slot,l=t[o]||(t[o]=[]);n.tag==="template"?l.push.apply(l,n.children||[]):l.push(n)}else(t.default||(t.default=[])).push(n)}for(var c in t)t[c].every(pA)&&delete t[c];return t}function pA(s){return s.isComment&&!s.asyncFactory||s.text===" "}function ta(s){return s.isComment&&s.asyncFactory}function jn(s,e,t,i){var r,n=Object.keys(t).length>0,a=e?!!e.$stable:!n,o=e&&e.$key;if(!e)r={};else{if(e._normalized)return e._normalized;if(a&&i&&i!==Rt&&o===i.$key&&!n&&!i.$hasNormal)return i;r={};for(var l in e)e[l]&&l[0]!=="$"&&(r[l]=mA(s,t,l,e[l]))}for(var c in t)c in r||(r[c]=gA(t,c));return e&&Object.isExtensible(e)&&(e._normalized=r),pt(r,"$stable",a),pt(r,"$key",o),pt(r,"$hasNormal",n),r}function mA(s,e,t,i){var r=function(){var n=ut;Wi(s);var a=arguments.length?i.apply(null,arguments):i({});a=a&&typeof a=="object"&&!Ae(a)?[a]:bd(a);var o=a&&a[0];return Wi(n),a&&(!o||a.length===1&&o.isComment&&!ta(o))?void 0:a};return i.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function gA(s,e){return function(){return s[e]}}function vA(s){var e=s.$options,t=e.setup;if(t){var i=s._setupContext=wv(s);Wi(s),mn();var r=bi(t,null,[s._props||vd({}),i],s,"setup");if(gn(),Wi(),je(r))e.render=r;else if(Pt(r))if(s._setupState=r,r.__sfc){var a=s._setupProxy={};for(var n in r)n!=="__sfc"&&tl(a,r,n)}else for(var n in r)av(n)||tl(s,r,n)}}function wv(s){return{get attrs(){if(!s._attrsProxy){var e=s._attrsProxy={};pt(e,"_v_attr_proxy",!0),sl(e,s.$attrs,Rt,s,"$attrs")}return s._attrsProxy},get listeners(){if(!s._listenersProxy){var e=s._listenersProxy={};sl(e,s.$listeners,Rt,s,"$listeners")}return s._listenersProxy},get slots(){return bA(s)},emit:tv(s.$emit,s),expose:function(e){e&&Object.keys(e).forEach(function(t){return tl(s,e,t)})}}}function sl(s,e,t,i,r){var n=!1;for(var a in e)a in s?e[a]!==t[a]&&(n=!0):(n=!0,yA(s,a,i,r));for(var a in s)a in e||(n=!0,delete s[a]);return n}function yA(s,e,t,i){Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:function(){return t[i][e]}})}function bA(s){return s._slotsProxy||Cv(s._slotsProxy={},s.$scopedSlots),s._slotsProxy}function Cv(s,e){for(var t in e)s[t]=e[t];for(var t in s)t in e||delete s[t]}function SA(){return Ed().slots}function EA(){return Ed().attrs}function _A(){return Ed().listeners}function Ed(){var s=ut;return s._setupContext||(s._setupContext=wv(s))}function xA(s,e){var t=Ae(s)?s.reduce(function(n,a){return n[a]={},n},{}):s;for(var i in e){var r=t[i];r?Ae(r)||je(r)?t[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(t[i]={default:e[i]})}return t}function AA(s){s._vnode=null,s._staticTrees=null;var e=s.$options,t=s.$vnode=e._parentVnode,i=t&&t.context;s.$slots=Sd(e._renderChildren,i),s.$scopedSlots=t?jn(s.$parent,t.data.scopedSlots,s.$slots):Rt,s._c=function(n,a,o,l){return sa(s,n,a,o,l,!1)},s.$createElement=function(n,a,o,l){return sa(s,n,a,o,l,!0)};var r=t&&t.data;Qi(s,"$attrs",r&&r.attrs||Rt,null,!0),Qi(s,"$listeners",e._parentListeners||Rt,null,!0)}var Eo=null;function TA(s){Tv(s.prototype),s.prototype.$nextTick=function(e){return Kl(e,this)},s.prototype._render=function(){var e=this,t=e.$options,i=t.render,r=t._parentVnode;r&&e._isMounted&&(e.$scopedSlots=jn(e.$parent,r.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Cv(e._slotsProxy,e.$scopedSlots)),e.$vnode=r;var n=ut,a=Eo,o;try{Wi(e),Eo=e,o=i.call(e._renderProxy,e.$createElement)}catch(l){Sr(l,e,"render"),o=e._vnode}finally{Eo=a,Wi(n)}return Ae(o)&&o.length===1&&(o=o[0]),o instanceof ls||(o=fr()),o.parent=r,o}}function $c(s,e){return(s.__esModule||Sa&&s[Symbol.toStringTag]==="Module")&&(s=s.default),Pt(s)?e.extend(s):s}function wA(s,e,t,i,r){var n=fr();return n.asyncFactory=s,n.asyncMeta={data:e,context:t,children:i,tag:r},n}function CA(s,e){if(at(s.error)&&W(s.errorComp))return s.errorComp;if(W(s.resolved))return s.resolved;var t=Eo;if(t&&W(s.owners)&&s.owners.indexOf(t)===-1&&s.owners.push(t),at(s.loading)&&W(s.loadingComp))return s.loadingComp;if(t&&!W(s.owners)){var i=s.owners=[t],r=!0,n=null,a=null;t.$on("hook:destroyed",function(){return Zi(i,t)});var o=function(f){for(var d=0,h=i.length;d<h;d++)i[d].$forceUpdate();f&&(i.length=0,n!==null&&(clearTimeout(n),n=null),a!==null&&(clearTimeout(a),a=null))},l=Xo(function(f){s.resolved=$c(f,e),r?i.length=0:o(!0)}),c=Xo(function(f){W(s.errorComp)&&(s.error=!0,o(!0))}),u=s(l,c);return Pt(u)&&(Wu(u)?ge(s.resolved)&&u.then(l,c):Wu(u.component)&&(u.component.then(l,c),W(u.error)&&(s.errorComp=$c(u.error,e)),W(u.loading)&&(s.loadingComp=$c(u.loading,e),u.delay===0?s.loading=!0:n=setTimeout(function(){n=null,ge(s.resolved)&&ge(s.error)&&(s.loading=!0,o(!1))},u.delay||200)),W(u.timeout)&&(a=setTimeout(function(){a=null,ge(s.resolved)&&c(null)},u.timeout)))),r=!1,s.loading?s.loadingComp:s.resolved}}function Lv(s){if(Ae(s))for(var e=0;e<s.length;e++){var t=s[e];if(W(t)&&(W(t.componentOptions)||ta(t)))return t}}var LA=1,Iv=2;function sa(s,e,t,i,r,n){return(Ae(t)||ya(t))&&(r=i,i=t,t=void 0),at(n)&&(r=Iv),IA(s,e,t,i,r)}function IA(s,e,t,i,r){if(W(t)&&W(t.__ob__)||(W(t)&&W(t.is)&&(e=t.is),!e))return fr();Ae(i)&&je(i[0])&&(t=t||{},t.scopedSlots={default:i[0]},i.length=0),r===Iv?i=bd(i):r===LA&&(i=iA(i));var n,a;if(typeof e=="string"){var o=void 0;a=s.$vnode&&s.$vnode.ns||vs.getTagNamespace(e),vs.isReservedTag(e)?n=new ls(vs.parsePlatformTagName(e),t,i,void 0,void 0,s):(!t||!t.pre)&&W(o=nl(s.$options,"components",e))?n=Op(o,t,s,i,e):n=new ls(e,t,i,void 0,void 0,s)}else n=Op(e,t,s,i);return Ae(n)?n:W(n)?(W(a)&&Rv(n,a),W(t)&&RA(t),n):fr()}function Rv(s,e,t){if(s.ns=e,s.tag==="foreignObject"&&(e=void 0,t=!0),W(s.children))for(var i=0,r=s.children.length;i<r;i++){var n=s.children[i];W(n.tag)&&(ge(n.ns)||at(t)&&n.tag!=="svg")&&Rv(n,e,t)}}function RA(s){Pt(s.style)&&an(s.style),Pt(s.class)&&an(s.class)}function DA(s,e,t){return sa(ut,s,e,t,2,!0)}function Sr(s,e,t){mn();try{if(e)for(var i=e;i=i.$parent;){var r=i.$options.errorCaptured;if(r)for(var n=0;n<r.length;n++)try{var a=r[n].call(i,s,e,t)===!1;if(a)return}catch(o){Cp(o,i,"errorCaptured hook")}}Cp(s,e,t)}finally{gn()}}function bi(s,e,t,i,r){var n;try{n=t?s.apply(e,t):s.call(e),n&&!n._isVue&&Wu(n)&&!n._handled&&(n.catch(function(a){return Sr(a,i,r+" (Promise/async)")}),n._handled=!0)}catch(a){Sr(a,i,r)}return n}function Cp(s,e,t){if(vs.errorHandler)try{return vs.errorHandler.call(null,s,e,t)}catch(i){i!==s&&Lp(i)}Lp(s)}function Lp(s,e,t){if(Xt&&typeof console<"u")console.error(s);else throw s}var Zu=!1,ef=[],tf=!1;function Ha(){tf=!1;var s=ef.slice(0);ef.length=0;for(var e=0;e<s.length;e++)s[e]()}var Bn;if(typeof Promise<"u"&&qr(Promise)){var kA=Promise.resolve();Bn=function(){kA.then(Ha),wx&&setTimeout(rt)},Zu=!0}else if(!hn&&typeof MutationObserver<"u"&&(qr(MutationObserver)||MutationObserver.toString()==="[object MutationObserverConstructor]")){var Ya=1,PA=new MutationObserver(Ha),Ip=document.createTextNode(String(Ya));PA.observe(Ip,{characterData:!0}),Bn=function(){Ya=(Ya+1)%2,Ip.data=String(Ya)},Zu=!0}else typeof setImmediate<"u"&&qr(setImmediate)?Bn=function(){setImmediate(Ha)}:Bn=function(){setTimeout(Ha,0)};function Kl(s,e){var t;if(ef.push(function(){if(s)try{s.call(e)}catch(i){Sr(i,e,"nextTick")}else t&&t(e)}),tf||(tf=!0,Bn()),!s&&typeof Promise<"u")return new Promise(function(i){t=i})}function OA(s){s===void 0&&(s="$style");{if(!ut)return Rt;var e=ut[s];return e||Rt}}function MA(s){if(Xt){var e=ut;e&&yv(function(){var t=e.$el,i=s(e,e._setupProxy);if(t&&t.nodeType===1){var r=t.style;for(var n in i)r.setProperty("--".concat(n),i[n])}})}}function NA(s){je(s)&&(s={loader:s});var e=s.loader,t=s.loadingComponent,i=s.errorComponent,r=s.delay,n=r===void 0?200:r,a=s.timeout;s.suspensible;var o=s.onError,l=null,c=0,u=function(){return c++,l=null,f()},f=function(){var d;return l||(d=l=e().catch(function(h){if(h=h instanceof Error?h:new Error(String(h)),o)return new Promise(function(p,g){var m=function(){return p(u())},v=function(){return g(h)};o(h,m,v,c+1)});throw h}).then(function(h){return d!==l&&l?l:(h&&(h.__esModule||h[Symbol.toStringTag]==="Module")&&(h=h.default),h)}))};return function(){var d=f();return{component:d,delay:n,timeout:a,error:i,loading:t}}}function Ss(s){return function(e,t){if(t===void 0&&(t=ut),!!t)return FA(t,s,e)}}function FA(s,e,t){var i=s.$options;i[e]=$v(i[e],t)}var $A=Ss("beforeMount"),BA=Ss("mounted"),UA=Ss("beforeUpdate"),GA=Ss("updated"),HA=Ss("beforeDestroy"),YA=Ss("destroyed"),jA=Ss("activated"),VA=Ss("deactivated"),KA=Ss("serverPrefetch"),WA=Ss("renderTracked"),zA=Ss("renderTriggered"),QA=Ss("errorCaptured");function qA(s,e){e===void 0&&(e=ut),QA(s,e)}var Dv="2.7.16";function XA(s){return s}var Rp=new ea;function an(s){return _o(s,Rp),Rp.clear(),s}function _o(s,e){var t,i,r=Ae(s);if(!(!r&&!Pt(s)||s.__v_skip||Object.isFrozen(s)||s instanceof ls)){if(s.__ob__){var n=s.__ob__.dep.id;if(e.has(n))return;e.add(n)}if(r)for(t=s.length;t--;)_o(s[t],e);else if(Lt(s))_o(s.value,e);else for(i=Object.keys(s),t=i.length;t--;)_o(s[i[t]],e)}}var JA=0,_a=function(){function s(e,t,i,r,n){Jx(this,It&&!It._vm?It:e?e._scope:void 0),(this.vm=e)&&n&&(e._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=i,this.id=++JA,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ea,this.newDepIds=new ea,this.expression="",je(t)?this.getter=t:(this.getter=Ax(t),this.getter||(this.getter=rt)),this.value=this.lazy?void 0:this.get()}return s.prototype.get=function(){mn(this);var e,t=this.vm;try{e=this.getter.call(t,t)}catch(i){if(this.user)Sr(i,t,'getter for watcher "'.concat(this.expression,'"'));else throw i}finally{this.deep&&an(e),gn(),this.cleanupDeps()}return e},s.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},s.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var i=this.depIds;this.depIds=this.newDepIds,this.newDepIds=i,this.newDepIds.clear(),i=this.deps,this.deps=this.newDeps,this.newDeps=i,this.newDeps.length=0},s.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():nf(this)},s.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||Pt(e)||this.deep){var t=this.value;if(this.value=e,this.user){var i='callback for watcher "'.concat(this.expression,'"');bi(this.cb,this.vm,[e,t],this.vm,i)}else this.cb.call(this.vm,e,t)}}},s.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},s.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},s.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&Zi(this.vm._scope.effects,this),this.active){for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},s}();function ZA(s){s._events=Object.create(null),s._hasHookEvent=!1;var e=s.$options._parentListeners;e&&kv(s,e)}var ia;function e1(s,e){ia.$on(s,e)}function t1(s,e){ia.$off(s,e)}function s1(s,e){var t=ia;return function i(){var r=e.apply(null,arguments);r!==null&&t.$off(s,i)}}function kv(s,e,t){ia=s,Ev(e,t||{},e1,t1,s1,s),ia=void 0}function i1(s){var e=/^hook:/;s.prototype.$on=function(t,i){var r=this;if(Ae(t))for(var n=0,a=t.length;n<a;n++)r.$on(t[n],i);else(r._events[t]||(r._events[t]=[])).push(i),e.test(t)&&(r._hasHookEvent=!0);return r},s.prototype.$once=function(t,i){var r=this;function n(){r.$off(t,n),i.apply(r,arguments)}return n.fn=i,r.$on(t,n),r},s.prototype.$off=function(t,i){var r=this;if(!arguments.length)return r._events=Object.create(null),r;if(Ae(t)){for(var n=0,a=t.length;n<a;n++)r.$off(t[n],i);return r}var o=r._events[t];if(!o)return r;if(!i)return r._events[t]=null,r;for(var l,c=o.length;c--;)if(l=o[c],l===i||l.fn===i){o.splice(c,1);break}return r},s.prototype.$emit=function(t){var i=this,r=i._events[t];if(r){r=r.length>1?zu(r):r;for(var n=zu(arguments,1),a='event handler for "'.concat(t,'"'),o=0,l=r.length;o<l;o++)bi(r[o],i,n,i,a)}return i}}var hr=null;function Pv(s){var e=hr;return hr=s,function(){hr=e}}function r1(s){var e=s.$options,t=e.parent;if(t&&!e.abstract){for(;t.$options.abstract&&t.$parent;)t=t.$parent;t.$children.push(s)}s.$parent=t,s.$root=t?t.$root:s,s.$children=[],s.$refs={},s._provided=t?t._provided:Object.create(null),s._watcher=null,s._inactive=null,s._directInactive=!1,s._isMounted=!1,s._isDestroyed=!1,s._isBeingDestroyed=!1}function n1(s){s.prototype._update=function(e,t){var i=this,r=i.$el,n=i._vnode,a=Pv(i);i._vnode=e,n?i.$el=i.__patch__(n,e):i.$el=i.__patch__(i.$el,e,t,!1),a(),r&&(r.__vue__=null),i.$el&&(i.$el.__vue__=i);for(var o=i;o&&o.$vnode&&o.$parent&&o.$vnode===o.$parent._vnode;)o.$parent.$el=o.$el,o=o.$parent},s.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},s.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Ds(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;t&&!t._isBeingDestroyed&&!e.$options.abstract&&Zi(t.$children,e),e._scope.stop(),e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Ds(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function a1(s,e,t){s.$el=e,s.$options.render||(s.$options.render=fr),Ds(s,"beforeMount");var i;i=function(){s._update(s._render(),t)};var r={before:function(){s._isMounted&&!s._isDestroyed&&Ds(s,"beforeUpdate")}};new _a(s,i,rt,r,!0),t=!1;var n=s._preWatchers;if(n)for(var a=0;a<n.length;a++)n[a].run();return s.$vnode==null&&(s._isMounted=!0,Ds(s,"mounted")),s}function o1(s,e,t,i,r){var n=i.data.scopedSlots,a=s.$scopedSlots,o=!!(n&&!n.$stable||a!==Rt&&!a.$stable||n&&s.$scopedSlots.$key!==n.$key||!n&&s.$scopedSlots.$key),l=!!(r||s.$options._renderChildren||o),c=s.$vnode;s.$options._parentVnode=i,s.$vnode=i,s._vnode&&(s._vnode.parent=i),s.$options._renderChildren=r;var u=i.data.attrs||Rt;s._attrsProxy&&sl(s._attrsProxy,u,c.data&&c.data.attrs||Rt,s,"$attrs")&&(l=!0),s.$attrs=u,t=t||Rt;var f=s.$options._parentListeners;if(s._listenersProxy&&sl(s._listenersProxy,t,f||Rt,s,"$listeners"),s.$listeners=s.$options._parentListeners=t,kv(s,t,f),e&&s.$options.props){zi(!1);for(var d=s._props,h=s.$options._propKeys||[],p=0;p<h.length;p++){var g=h[p],m=s.$options.props;d[g]=Cd(g,m,e,s)}zi(!0),s.$options.propsData=e}l&&(s.$slots=Sd(r,i.context),s.$forceUpdate())}function Ov(s){for(;s&&(s=s.$parent);)if(s._inactive)return!0;return!1}function _d(s,e){if(e){if(s._directInactive=!1,Ov(s))return}else if(s._directInactive)return;if(s._inactive||s._inactive===null){s._inactive=!1;for(var t=0;t<s.$children.length;t++)_d(s.$children[t]);Ds(s,"activated")}}function Mv(s,e){if(!(e&&(s._directInactive=!0,Ov(s)))&&!s._inactive){s._inactive=!0;for(var t=0;t<s.$children.length;t++)Mv(s.$children[t]);Ds(s,"deactivated")}}function Ds(s,e,t,i){i===void 0&&(i=!0),mn();var r=ut,n=bv();i&&Wi(s);var a=s.$options[e],o="".concat(e," hook");if(a)for(var l=0,c=a.length;l<c;l++)bi(a[l],s,null,s,o);s._hasHookEvent&&s.$emit("hook:"+e),i&&(Wi(r),n&&n.on()),gn()}var hi=[],xd=[],il={},sf=!1,Ad=!1,Kr=0;function l1(){Kr=hi.length=xd.length=0,il={},sf=Ad=!1}var Nv=0,rf=Date.now;if(Xt&&!hn){var Bc=window.performance;Bc&&typeof Bc.now=="function"&&rf()>document.createEvent("Event").timeStamp&&(rf=function(){return Bc.now()})}var c1=function(s,e){if(s.post){if(!e.post)return 1}else if(e.post)return-1;return s.id-e.id};function u1(){Nv=rf(),Ad=!0;var s,e;for(hi.sort(c1),Kr=0;Kr<hi.length;Kr++)s=hi[Kr],s.before&&s.before(),e=s.id,il[e]=null,s.run();var t=xd.slice(),i=hi.slice();l1(),h1(t),f1(i),Ix(),Jo&&vs.devtools&&Jo.emit("flush")}function f1(s){for(var e=s.length;e--;){var t=s[e],i=t.vm;i&&i._watcher===t&&i._isMounted&&!i._isDestroyed&&Ds(i,"updated")}}function d1(s){s._inactive=!1,xd.push(s)}function h1(s){for(var e=0;e<s.length;e++)s[e]._inactive=!0,_d(s[e],!0)}function nf(s){var e=s.id;if(il[e]==null&&!(s===qs.target&&s.noRecurse)){if(il[e]=!0,!Ad)hi.push(s);else{for(var t=hi.length-1;t>Kr&&hi[t].id>s.id;)t--;hi.splice(t+1,0,s)}sf||(sf=!0,Kl(u1))}}function p1(s){var e=s.$options.provide;if(e){var t=je(e)?e.call(s):e;if(!Pt(t))return;for(var i=Sv(s),r=Sa?Reflect.ownKeys(t):Object.keys(t),n=0;n<r.length;n++){var a=r[n];Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(t,a))}}}function m1(s){var e=Fv(s.$options.inject,s);e&&(zi(!1),Object.keys(e).forEach(function(t){Qi(s,t,e[t])}),zi(!0))}function Fv(s,e){if(s){for(var t=Object.create(null),i=Sa?Reflect.ownKeys(s):Object.keys(s),r=0;r<i.length;r++){var n=i[r];if(n!=="__ob__"){var a=s[n].from;if(a in e._provided)t[n]=e._provided[a];else if("default"in s[n]){var o=s[n].default;t[n]=je(o)?o.call(e):o}}}return t}}function Td(s,e,t,i,r){var n=this,a=r.options,o;Bt(i,"_uid")?(o=Object.create(i),o._original=i):(o=i,i=i._original);var l=at(a._compiled),c=!l;this.data=s,this.props=e,this.children=t,this.parent=i,this.listeners=s.on||Rt,this.injections=Fv(a.inject,i),this.slots=function(){return n.$slots||jn(i,s.scopedSlots,n.$slots=Sd(t,i)),n.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return jn(i,s.scopedSlots,this.slots())}}),l&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=jn(i,s.scopedSlots,this.$slots)),a._scopeId?this._c=function(u,f,d,h){var p=sa(o,u,f,d,h,c);return p&&!Ae(p)&&(p.fnScopeId=a._scopeId,p.fnContext=i),p}:this._c=function(u,f,d,h){return sa(o,u,f,d,h,c)}}Tv(Td.prototype);function g1(s,e,t,i,r){var n=s.options,a={},o=n.props;if(W(o))for(var l in o)a[l]=Cd(l,o,e||Rt);else W(t.attrs)&&kp(a,t.attrs),W(t.props)&&kp(a,t.props);var c=new Td(t,a,r,i,s),u=n.render.call(null,c._c,c);if(u instanceof ls)return Dp(u,t,c.parent,n);if(Ae(u)){for(var f=bd(u)||[],d=new Array(f.length),h=0;h<f.length;h++)d[h]=Dp(f[h],t,c.parent,n);return d}}function Dp(s,e,t,i,r){var n=Xu(s);return n.fnContext=t,n.fnOptions=i,e.slot&&((n.data||(n.data={})).slot=e.slot),n}function kp(s,e){for(var t in e)s[yr(t)]=e[t]}function rl(s){return s.name||s.__name||s._componentTag}var wd={init:function(s,e){if(s.componentInstance&&!s.componentInstance._isDestroyed&&s.data.keepAlive){var t=s;wd.prepatch(t,t)}else{var i=s.componentInstance=v1(s,hr);i.$mount(e?s.elm:void 0,e)}},prepatch:function(s,e){var t=e.componentOptions,i=e.componentInstance=s.componentInstance;o1(i,t.propsData,t.listeners,e,t.children)},insert:function(s){var e=s.context,t=s.componentInstance;t._isMounted||(t._isMounted=!0,Ds(t,"mounted")),s.data.keepAlive&&(e._isMounted?d1(t):_d(t,!0))},destroy:function(s){var e=s.componentInstance;e._isDestroyed||(s.data.keepAlive?Mv(e,!0):e.$destroy())}},Pp=Object.keys(wd);function Op(s,e,t,i,r){if(!ge(s)){var n=t.$options._base;if(Pt(s)&&(s=n.extend(s)),typeof s=="function"){var a;if(ge(s.cid)&&(a=s,s=CA(a,n),s===void 0))return wA(a,e,t,i,r);e=e||{},Id(s),W(e.model)&&S1(s.options,e);var o=sA(e,s);if(at(s.options.functional))return g1(s,o,e,t,i);var l=e.on;if(e.on=e.nativeOn,at(s.options.abstract)){var c=e.slot;e={},c&&(e.slot=c)}y1(e);var u=rl(s.options)||r,f=new ls("vue-component-".concat(s.cid).concat(u?"-".concat(u):""),e,void 0,void 0,void 0,t,{Ctor:s,propsData:o,listeners:l,tag:r,children:i},a);return f}}}function v1(s,e){var t={_isComponent:!0,_parentVnode:s,parent:e},i=s.data.inlineTemplate;return W(i)&&(t.render=i.render,t.staticRenderFns=i.staticRenderFns),new s.componentOptions.Ctor(t)}function y1(s){for(var e=s.hook||(s.hook={}),t=0;t<Pp.length;t++){var i=Pp[t],r=e[i],n=wd[i];r!==n&&!(r&&r._merged)&&(e[i]=r?b1(n,r):n)}}function b1(s,e){var t=function(i,r){s(i,r),e(i,r)};return t._merged=!0,t}function S1(s,e){var t=s.model&&s.model.prop||"value",i=s.model&&s.model.event||"input";(e.attrs||(e.attrs={}))[t]=e.model.value;var r=e.on||(e.on={}),n=r[i],a=e.model.callback;W(n)?(Ae(n)?n.indexOf(a)===-1:n!==a)&&(r[i]=[a].concat(n)):r[i]=a}var E1=rt,Ws=vs.optionMergeStrategies;function ra(s,e,t){if(t===void 0&&(t=!0),!e)return s;for(var i,r,n,a=Sa?Reflect.ownKeys(e):Object.keys(e),o=0;o<a.length;o++)i=a[o],i!=="__ob__"&&(r=s[i],n=e[i],!t||!Bt(s,i)?Yl(s,i,n):r!==n&&Ut(r)&&Ut(n)&&ra(r,n));return s}function Mp(s,e,t){return t?function(){var r=je(e)?e.call(t,t):e,n=je(s)?s.call(t,t):s;return r?ra(r,n):n}:e?s?function(){return ra(je(e)?e.call(this,this):e,je(s)?s.call(this,this):s)}:e:s}Ws.data=function(s,e,t){return t?Mp(s,e,t):e&&typeof e!="function"?s:Mp(s,e)};function $v(s,e){var t=e?s?s.concat(e):Ae(e)?e:[e]:s;return t&&_1(t)}function _1(s){for(var e=[],t=0;t<s.length;t++)e.indexOf(s[t])===-1&&e.push(s[t]);return e}nv.forEach(function(s){Ws[s]=$v});function x1(s,e,t,i){var r=Object.create(s||null);return e?Je(r,e):r}Hl.forEach(function(s){Ws[s+"s"]=x1});Ws.watch=function(s,e,t,i){if(s===qu&&(s=void 0),e===qu&&(e=void 0),!e)return Object.create(s||null);if(!s)return e;var r={};Je(r,s);for(var n in e){var a=r[n],o=e[n];a&&!Ae(a)&&(a=[a]),r[n]=a?a.concat(o):Ae(o)?o:[o]}return r};Ws.props=Ws.methods=Ws.inject=Ws.computed=function(s,e,t,i){if(!s)return e;var r=Object.create(null);return Je(r,s),e&&Je(r,e),r};Ws.provide=function(s,e){return s?function(){var t=Object.create(null);return ra(t,je(s)?s.call(this):s),e&&ra(t,je(e)?e.call(this):e,!1),t}:e};var A1=function(s,e){return e===void 0?s:e};function T1(s,e){var t=s.props;if(t){var i={},r,n,a;if(Ae(t))for(r=t.length;r--;)n=t[r],typeof n=="string"&&(a=yr(n),i[a]={type:null});else if(Ut(t))for(var o in t)n=t[o],a=yr(o),i[a]=Ut(n)?n:{type:n};s.props=i}}function w1(s,e){var t=s.inject;if(t){var i=s.inject={};if(Ae(t))for(var r=0;r<t.length;r++)i[t[r]]={from:t[r]};else if(Ut(t))for(var n in t){var a=t[n];i[n]=Ut(a)?Je({from:n},a):{from:a}}}}function C1(s){var e=s.directives;if(e)for(var t in e){var i=e[t];je(i)&&(e[t]={bind:i,update:i})}}function Er(s,e,t){if(je(e)&&(e=e.options),T1(e),w1(e),C1(e),!e._base&&(e.extends&&(s=Er(s,e.extends,t)),e.mixins))for(var i=0,r=e.mixins.length;i<r;i++)s=Er(s,e.mixins[i],t);var n={},a;for(a in s)o(a);for(a in e)Bt(s,a)||o(a);function o(l){var c=Ws[l]||A1;n[l]=c(s[l],e[l],t,l)}return n}function nl(s,e,t,i){if(typeof t=="string"){var r=s[e];if(Bt(r,t))return r[t];var n=yr(t);if(Bt(r,n))return r[n];var a=yx(n);if(Bt(r,a))return r[a];var o=r[t]||r[n]||r[a];return o}}function Cd(s,e,t,i){var r=e[s],n=!Bt(t,s),a=t[s],o=Fp(Boolean,r.type);if(o>-1){if(n&&!Bt(r,"default"))a=!1;else if(a===""||a===ba(s)){var l=Fp(String,r.type);(l<0||o<l)&&(a=!0)}}if(a===void 0){a=L1(i,r,s);var c=md;zi(!0),yi(a),zi(c)}return a}function L1(s,e,t){if(Bt(e,"default")){var i=e.default;return s&&s.$options.propsData&&s.$options.propsData[t]===void 0&&s._props[t]!==void 0?s._props[t]:je(i)&&af(e.type)!=="Function"?i.call(s):i}}var I1=/^\s*function (\w+)/;function af(s){var e=s&&s.toString().match(I1);return e?e[1]:""}function Np(s,e){return af(s)===af(e)}function Fp(s,e){if(!Ae(e))return Np(e,s)?0:-1;for(var t=0,i=e.length;t<i;t++)if(Np(e[t],s))return t;return-1}var Mi={enumerable:!0,configurable:!0,get:rt,set:rt};function Ld(s,e,t){Mi.get=function(){return this[e][t]},Mi.set=function(r){this[e][t]=r},Object.defineProperty(s,t,Mi)}function R1(s){var e=s.$options;if(e.props&&D1(s,e.props),vA(s),e.methods&&N1(s,e.methods),e.data)k1(s);else{var t=yi(s._data={});t&&t.vmCount++}e.computed&&M1(s,e.computed),e.watch&&e.watch!==qu&&F1(s,e.watch)}function D1(s,e){var t=s.$options.propsData||{},i=s._props=vd({}),r=s.$options._propKeys=[],n=!s.$parent;n||zi(!1);var a=function(l){r.push(l);var c=Cd(l,e,t,s);Qi(i,l,c,void 0,!0),l in s||Ld(s,"_props",l)};for(var o in e)a(o);zi(!0)}function k1(s){var e=s.$options.data;e=s._data=je(e)?P1(e,s):e||{},Ut(e)||(e={});var t=Object.keys(e),i=s.$options.props;s.$options.methods;for(var r=t.length;r--;){var n=t[r];i&&Bt(i,n)||av(n)||Ld(s,"_data",n)}var a=yi(e);a&&a.vmCount++}function P1(s,e){mn();try{return s.call(e,e)}catch(t){return Sr(t,e,"data()"),{}}finally{gn()}}var O1={lazy:!0};function M1(s,e){var t=s._computedWatchers=Object.create(null),i=er();for(var r in e){var n=e[r],a=je(n)?n:n.get;i||(t[r]=new _a(s,a||rt,rt,O1)),r in s||Bv(s,r,n)}}function Bv(s,e,t){var i=!er();je(t)?(Mi.get=i?$p(e):Bp(t),Mi.set=rt):(Mi.get=t.get?i&&t.cache!==!1?$p(e):Bp(t.get):rt,Mi.set=t.set||rt),Object.defineProperty(s,e,Mi)}function $p(s){return function(){var t=this._computedWatchers&&this._computedWatchers[s];if(t)return t.dirty&&t.evaluate(),qs.target&&t.depend(),t.value}}function Bp(s){return function(){return s.call(this,this)}}function N1(s,e){s.$options.props;for(var t in e)s[t]=typeof e[t]!="function"?rt:tv(e[t],s)}function F1(s,e){for(var t in e){var i=e[t];if(Ae(i))for(var r=0;r<i.length;r++)of(s,t,i[r]);else of(s,t,i)}}function of(s,e,t,i){return Ut(t)&&(i=t,t=t.handler),typeof t=="string"&&(t=s[t]),s.$watch(e,t,i)}function $1(s){var e={};e.get=function(){return this._data};var t={};t.get=function(){return this._props},Object.defineProperty(s.prototype,"$data",e),Object.defineProperty(s.prototype,"$props",t),s.prototype.$set=Yl,s.prototype.$delete=gd,s.prototype.$watch=function(i,r,n){var a=this;if(Ut(r))return of(a,i,r,n);n=n||{},n.user=!0;var o=new _a(a,i,r,n);if(n.immediate){var l='callback for immediate watcher "'.concat(o.expression,'"');mn(),bi(r,a,[o.value],a,l),gn()}return function(){o.teardown()}}}var B1=0;function U1(s){s.prototype._init=function(e){var t=this;t._uid=B1++,t._isVue=!0,t.__v_skip=!0,t._scope=new yd(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?G1(t,e):t.$options=Er(Id(t.constructor),e||{},t),t._renderProxy=t,t._self=t,r1(t),ZA(t),AA(t),Ds(t,"beforeCreate",void 0,!1),m1(t),R1(t),p1(t),Ds(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function G1(s,e){var t=s.$options=Object.create(s.constructor.options),i=e._parentVnode;t.parent=e.parent,t._parentVnode=i;var r=i.componentOptions;t.propsData=r.propsData,t._parentListeners=r.listeners,t._renderChildren=r.children,t._componentTag=r.tag,e.render&&(t.render=e.render,t.staticRenderFns=e.staticRenderFns)}function Id(s){var e=s.options;if(s.super){var t=Id(s.super),i=s.superOptions;if(t!==i){s.superOptions=t;var r=H1(s);r&&Je(s.extendOptions,r),e=s.options=Er(t,s.extendOptions),e.name&&(e.components[e.name]=s)}}return e}function H1(s){var e,t=s.options,i=s.sealedOptions;for(var r in t)t[r]!==i[r]&&(e||(e={}),e[r]=t[r]);return e}function Ce(s){this._init(s)}U1(Ce);$1(Ce);i1(Ce);n1(Ce);TA(Ce);function Y1(s){s.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var i=zu(arguments,1);return i.unshift(this),je(e.install)?e.install.apply(e,i):je(e)&&e.apply(null,i),t.push(e),this}}function j1(s){s.mixin=function(e){return this.options=Er(this.options,e),this}}function V1(s){s.cid=0;var e=1;s.extend=function(t){t=t||{};var i=this,r=i.cid,n=t._Ctor||(t._Ctor={});if(n[r])return n[r];var a=rl(t)||rl(i.options),o=function(c){this._init(c)};return o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.cid=e++,o.options=Er(i.options,t),o.super=i,o.options.props&&K1(o),o.options.computed&&W1(o),o.extend=i.extend,o.mixin=i.mixin,o.use=i.use,Hl.forEach(function(l){o[l]=i[l]}),a&&(o.options.components[a]=o),o.superOptions=i.options,o.extendOptions=t,o.sealedOptions=Je({},o.options),n[r]=o,o}}function K1(s){var e=s.options.props;for(var t in e)Ld(s.prototype,"_props",t)}function W1(s){var e=s.options.computed;for(var t in e)Bv(s.prototype,t,e[t])}function z1(s){Hl.forEach(function(e){s[e]=function(t,i){return i?(e==="component"&&Ut(i)&&(i.name=i.name||t,i=this.options._base.extend(i)),e==="directive"&&je(i)&&(i={bind:i,update:i}),this.options[e+"s"][t]=i,i):this.options[e+"s"][t]}})}function Up(s){return s&&(rl(s.Ctor.options)||s.tag)}function ja(s,e){return Ae(s)?s.indexOf(e)>-1:typeof s=="string"?s.split(",").indexOf(e)>-1:dx(s)?s.test(e):!1}function Gp(s,e){var t=s.cache,i=s.keys,r=s._vnode,n=s.$vnode;for(var a in t){var o=t[a];if(o){var l=o.name;l&&!e(l)&&lf(t,a,i,r)}}n.componentOptions.children=void 0}function lf(s,e,t,i){var r=s[e];r&&(!i||r.tag!==i.tag)&&r.componentInstance.$destroy(),s[e]=null,Zi(t,e)}var Hp=[String,RegExp,Array],Q1={name:"keep-alive",abstract:!0,props:{include:Hp,exclude:Hp,max:[String,Number]},methods:{cacheVNode:function(){var s=this,e=s.cache,t=s.keys,i=s.vnodeToCache,r=s.keyToCache;if(i){var n=i.tag,a=i.componentInstance,o=i.componentOptions;e[r]={name:Up(o),tag:n,componentInstance:a},t.push(r),this.max&&t.length>parseInt(this.max)&&lf(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var s in this.cache)lf(this.cache,s,this.keys)},mounted:function(){var s=this;this.cacheVNode(),this.$watch("include",function(e){Gp(s,function(t){return ja(e,t)})}),this.$watch("exclude",function(e){Gp(s,function(t){return!ja(e,t)})})},updated:function(){this.cacheVNode()},render:function(){var s=this.$slots.default,e=Lv(s),t=e&&e.componentOptions;if(t){var i=Up(t),r=this,n=r.include,a=r.exclude;if(n&&(!i||!ja(n,i))||a&&i&&ja(a,i))return e;var o=this,l=o.cache,c=o.keys,u=e.key==null?t.Ctor.cid+(t.tag?"::".concat(t.tag):""):e.key;l[u]?(e.componentInstance=l[u].componentInstance,Zi(c,u),c.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||s&&s[0]}},q1={KeepAlive:Q1};function X1(s){var e={};e.get=function(){return vs},Object.defineProperty(s,"config",e),s.util={warn:E1,extend:Je,mergeOptions:Er,defineReactive:Qi},s.set=Yl,s.delete=gd,s.nextTick=Kl,s.observable=function(t){return yi(t),t},s.options=Object.create(null),Hl.forEach(function(t){s.options[t+"s"]=Object.create(null)}),s.options._base=s,Je(s.options.components,q1),Y1(s),j1(s),V1(s),z1(s)}X1(Ce);Object.defineProperty(Ce.prototype,"$isServer",{get:er});Object.defineProperty(Ce.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}});Object.defineProperty(Ce,"FunctionalRenderContext",{value:Td});Ce.version=Dv;var J1=Os("style,class"),Z1=Os("input,textarea,option,select,progress"),eT=function(s,e,t){return t==="value"&&Z1(s)&&e!=="button"||t==="selected"&&s==="option"||t==="checked"&&s==="input"||t==="muted"&&s==="video"},Uv=Os("contenteditable,draggable,spellcheck"),tT=Os("events,caret,typing,plaintext-only"),sT=function(s,e){return al(e)||e==="false"?"false":s==="contenteditable"&&tT(e)?e:"true"},iT=Os("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),cf="http://www.w3.org/1999/xlink",Rd=function(s){return s.charAt(5)===":"&&s.slice(0,5)==="xlink"},Gv=function(s){return Rd(s)?s.slice(6,s.length):""},al=function(s){return s==null||s===!1};function rT(s){for(var e=s.data,t=s,i=s;W(i.componentInstance);)i=i.componentInstance._vnode,i&&i.data&&(e=Yp(i.data,e));for(;W(t=t.parent);)t&&t.data&&(e=Yp(e,t.data));return nT(e.staticClass,e.class)}function Yp(s,e){return{staticClass:Dd(s.staticClass,e.staticClass),class:W(s.class)?[s.class,e.class]:e.class}}function nT(s,e){return W(s)||W(e)?Dd(s,kd(e)):""}function Dd(s,e){return s?e?s+" "+e:s:e||""}function kd(s){return Array.isArray(s)?aT(s):Pt(s)?oT(s):typeof s=="string"?s:""}function aT(s){for(var e="",t,i=0,r=s.length;i<r;i++)W(t=kd(s[i]))&&t!==""&&(e&&(e+=" "),e+=t);return e}function oT(s){var e="";for(var t in s)s[t]&&(e&&(e+=" "),e+=t);return e}var lT={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},cT=Os("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Pd=Os("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Hv=function(s){return cT(s)||Pd(s)};function uT(s){if(Pd(s))return"svg";if(s==="math")return"math"}var Va=Object.create(null);function fT(s){if(!Xt)return!0;if(Hv(s))return!1;if(s=s.toLowerCase(),Va[s]!=null)return Va[s];var e=document.createElement(s);return s.indexOf("-")>-1?Va[s]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Va[s]=/HTMLUnknownElement/.test(e.toString())}var uf=Os("text,number,password,search,email,tel,url");function dT(s){if(typeof s=="string"){var e=document.querySelector(s);return e||document.createElement("div")}else return s}function hT(s,e){var t=document.createElement(s);return s!=="select"||e.data&&e.data.attrs&&e.data.attrs.multiple!==void 0&&t.setAttribute("multiple","multiple"),t}function pT(s,e){return document.createElementNS(lT[s],e)}function mT(s){return document.createTextNode(s)}function gT(s){return document.createComment(s)}function vT(s,e,t){s.insertBefore(e,t)}function yT(s,e){s.removeChild(e)}function bT(s,e){s.appendChild(e)}function ST(s){return s.parentNode}function ET(s){return s.nextSibling}function _T(s){return s.tagName}function xT(s,e){s.textContent=e}function AT(s,e){s.setAttribute(e,"")}var TT=Object.freeze({__proto__:null,createElement:hT,createElementNS:pT,createTextNode:mT,createComment:gT,insertBefore:vT,removeChild:yT,appendChild:bT,parentNode:ST,nextSibling:ET,tagName:_T,setTextContent:xT,setStyleScope:AT}),wT={create:function(s,e){Wr(e)},update:function(s,e){s.data.ref!==e.data.ref&&(Wr(s,!0),Wr(e))},destroy:function(s){Wr(s,!0)}};function Wr(s,e){var t=s.data.ref;if(W(t)){var i=s.context,r=s.componentInstance||s.elm,n=e?null:r,a=e?void 0:r;if(je(t)){bi(t,i,[n],i,"template ref function");return}var o=s.data.refInFor,l=typeof t=="string"||typeof t=="number",c=Lt(t),u=i.$refs;if(l||c){if(o){var f=l?u[t]:t.value;e?Ae(f)&&Zi(f,r):Ae(f)?f.includes(r)||f.push(r):l?(u[t]=[r],jp(i,t,u[t])):t.value=[r]}else if(l){if(e&&u[t]!==r)return;u[t]=a,jp(i,t,n)}else if(c){if(e&&t.value!==r)return;t.value=n}}}}function jp(s,e,t){var i=s._setupState;i&&Bt(i,e)&&(Lt(i[e])?i[e].value=t:i[e]=t)}var Fi=new ls("",{},[]),kn=["create","activate","update","remove","destroy"];function rr(s,e){return s.key===e.key&&s.asyncFactory===e.asyncFactory&&(s.tag===e.tag&&s.isComment===e.isComment&&W(s.data)===W(e.data)&&CT(s,e)||at(s.isAsyncPlaceholder)&&ge(e.asyncFactory.error))}function CT(s,e){if(s.tag!=="input")return!0;var t,i=W(t=s.data)&&W(t=t.attrs)&&t.type,r=W(t=e.data)&&W(t=t.attrs)&&t.type;return i===r||uf(i)&&uf(r)}function LT(s,e,t){var i,r,n={};for(i=e;i<=t;++i)r=s[i].key,W(r)&&(n[r]=i);return n}function IT(s){var e,t,i={},r=s.modules,n=s.nodeOps;for(e=0;e<kn.length;++e)for(i[kn[e]]=[],t=0;t<r.length;++t)W(r[t][kn[e]])&&i[kn[e]].push(r[t][kn[e]]);function a(L){return new ls(n.tagName(L).toLowerCase(),{},[],void 0,L)}function o(L,R){function B(){--B.listeners===0&&l(L)}return B.listeners=R,B}function l(L){var R=n.parentNode(L);W(R)&&n.removeChild(R,L)}function c(L,R,B,S,A,I,D){if(W(L.elm)&&W(I)&&(L=I[D]=Xu(L)),L.isRootInsert=!A,!u(L,R,B,S)){var O=L.data,H=L.children,N=L.tag;W(N)?(L.elm=L.ns?n.createElementNS(L.ns,N):n.createElement(N,L),v(L),p(L,H,R),W(O)&&m(L,R),h(B,L.elm,S)):at(L.isComment)?(L.elm=n.createComment(L.text),h(B,L.elm,S)):(L.elm=n.createTextNode(L.text),h(B,L.elm,S))}}function u(L,R,B,S){var A=L.data;if(W(A)){var I=W(L.componentInstance)&&A.keepAlive;if(W(A=A.hook)&&W(A=A.init)&&A(L,!1),W(L.componentInstance))return f(L,R),h(B,L.elm,S),at(I)&&d(L,R,B,S),!0}}function f(L,R){W(L.data.pendingInsert)&&(R.push.apply(R,L.data.pendingInsert),L.data.pendingInsert=null),L.elm=L.componentInstance.$el,g(L)?(m(L,R),v(L)):(Wr(L),R.push(L))}function d(L,R,B,S){for(var A,I=L;I.componentInstance;)if(I=I.componentInstance._vnode,W(A=I.data)&&W(A=A.transition)){for(A=0;A<i.activate.length;++A)i.activate[A](Fi,I);R.push(I);break}h(B,L.elm,S)}function h(L,R,B){W(L)&&(W(B)?n.parentNode(B)===L&&n.insertBefore(L,R,B):n.appendChild(L,R))}function p(L,R,B){if(Ae(R))for(var S=0;S<R.length;++S)c(R[S],B,L.elm,null,!0,R,S);else ya(L.text)&&n.appendChild(L.elm,n.createTextNode(String(L.text)))}function g(L){for(;L.componentInstance;)L=L.componentInstance._vnode;return W(L.tag)}function m(L,R){for(var B=0;B<i.create.length;++B)i.create[B](Fi,L);e=L.data.hook,W(e)&&(W(e.create)&&e.create(Fi,L),W(e.insert)&&R.push(L))}function v(L){var R;if(W(R=L.fnScopeId))n.setStyleScope(L.elm,R);else for(var B=L;B;)W(R=B.context)&&W(R=R.$options._scopeId)&&n.setStyleScope(L.elm,R),B=B.parent;W(R=hr)&&R!==L.context&&R!==L.fnContext&&W(R=R.$options._scopeId)&&n.setStyleScope(L.elm,R)}function y(L,R,B,S,A,I){for(;S<=A;++S)c(B[S],I,L,R,!1,B,S)}function E(L){var R,B,S=L.data;if(W(S))for(W(R=S.hook)&&W(R=R.destroy)&&R(L),R=0;R<i.destroy.length;++R)i.destroy[R](L);if(W(R=L.children))for(B=0;B<L.children.length;++B)E(L.children[B])}function w(L,R,B){for(;R<=B;++R){var S=L[R];W(S)&&(W(S.tag)?(T(S),E(S)):l(S.elm))}}function T(L,R){if(W(R)||W(L.data)){var B,S=i.remove.length+1;for(W(R)?R.listeners+=S:R=o(L.elm,S),W(B=L.componentInstance)&&W(B=B._vnode)&&W(B.data)&&T(B,R),B=0;B<i.remove.length;++B)i.remove[B](L,R);W(B=L.data.hook)&&W(B=B.remove)?B(L,R):R()}else l(L.elm)}function $(L,R,B,S,A){for(var I=0,D=0,O=R.length-1,H=R[0],N=R[O],P=B.length-1,Y=B[0],z=B[P],J,x,F,G,Q=!A;I<=O&&D<=P;)ge(H)?H=R[++I]:ge(N)?N=R[--O]:rr(H,Y)?(M(H,Y,S,B,D),H=R[++I],Y=B[++D]):rr(N,z)?(M(N,z,S,B,P),N=R[--O],z=B[--P]):rr(H,z)?(M(H,z,S,B,P),Q&&n.insertBefore(L,H.elm,n.nextSibling(N.elm)),H=R[++I],z=B[--P]):rr(N,Y)?(M(N,Y,S,B,D),Q&&n.insertBefore(L,N.elm,H.elm),N=R[--O],Y=B[++D]):(ge(J)&&(J=LT(R,I,O)),x=W(Y.key)?J[Y.key]:k(Y,R,I,O),ge(x)?c(Y,S,L,H.elm,!1,B,D):(F=R[x],rr(F,Y)?(M(F,Y,S,B,D),R[x]=void 0,Q&&n.insertBefore(L,F.elm,H.elm)):c(Y,S,L,H.elm,!1,B,D)),Y=B[++D]);I>O?(G=ge(B[P+1])?null:B[P+1].elm,y(L,G,B,D,P,S)):D>P&&w(R,I,O)}function k(L,R,B,S){for(var A=B;A<S;A++){var I=R[A];if(W(I)&&rr(L,I))return A}}function M(L,R,B,S,A,I){if(L!==R){W(R.elm)&&W(S)&&(R=S[A]=Xu(R));var D=R.elm=L.elm;if(at(L.isAsyncPlaceholder)){W(R.asyncFactory.resolved)?U(L.elm,R,B):R.isAsyncPlaceholder=!0;return}if(at(R.isStatic)&&at(L.isStatic)&&R.key===L.key&&(at(R.isCloned)||at(R.isOnce))){R.componentInstance=L.componentInstance;return}var O,H=R.data;W(H)&&W(O=H.hook)&&W(O=O.prepatch)&&O(L,R);var N=L.children,P=R.children;if(W(H)&&g(R)){for(O=0;O<i.update.length;++O)i.update[O](L,R);W(O=H.hook)&&W(O=O.update)&&O(L,R)}ge(R.text)?W(N)&&W(P)?N!==P&&$(D,N,P,B,I):W(P)?(W(L.text)&&n.setTextContent(D,""),y(D,null,P,0,P.length-1,B)):W(N)?w(N,0,N.length-1):W(L.text)&&n.setTextContent(D,""):L.text!==R.text&&n.setTextContent(D,R.text),W(H)&&W(O=H.hook)&&W(O=O.postpatch)&&O(L,R)}}function _(L,R,B){if(at(B)&&W(L.parent))L.parent.data.pendingInsert=R;else for(var S=0;S<R.length;++S)R[S].data.hook.insert(R[S])}var C=Os("attrs,class,staticClass,staticStyle,key");function U(L,R,B,S){var A,I=R.tag,D=R.data,O=R.children;if(S=S||D&&D.pre,R.elm=L,at(R.isComment)&&W(R.asyncFactory))return R.isAsyncPlaceholder=!0,!0;if(W(D)&&(W(A=D.hook)&&W(A=A.init)&&A(R,!0),W(A=R.componentInstance)))return f(R,B),!0;if(W(I)){if(W(O))if(!L.hasChildNodes())p(R,O,B);else if(W(A=D)&&W(A=A.domProps)&&W(A=A.innerHTML)){if(A!==L.innerHTML)return!1}else{for(var H=!0,N=L.firstChild,P=0;P<O.length;P++){if(!N||!U(N,O[P],B,S)){H=!1;break}N=N.nextSibling}if(!H||N)return!1}if(W(D)){var Y=!1;for(var z in D)if(!C(z)){Y=!0,m(R,B);break}!Y&&D.class&&an(D.class)}}else L.data!==R.text&&(L.data=R.text);return!0}return function(R,B,S,A){if(ge(B)){W(R)&&E(R);return}var I=!1,D=[];if(ge(R))I=!0,c(B,D);else{var O=W(R.nodeType);if(!O&&rr(R,B))M(R,B,D,null,null,A);else{if(O){if(R.nodeType===1&&R.hasAttribute(mp)&&(R.removeAttribute(mp),S=!0),at(S)&&U(R,B,D))return _(B,D,!0),R;R=a(R)}var H=R.elm,N=n.parentNode(H);if(c(B,D,H._leaveCb?null:N,n.nextSibling(H)),W(B.parent))for(var P=B.parent,Y=g(B);P;){for(var z=0;z<i.destroy.length;++z)i.destroy[z](P);if(P.elm=B.elm,Y){for(var J=0;J<i.create.length;++J)i.create[J](Fi,P);var x=P.data.hook.insert;if(x.merged)for(var F=x.fns.slice(1),G=0;G<F.length;G++)F[G]()}else Wr(P);P=P.parent}W(N)?w([R],0,0):W(R.tag)&&E(R)}}return _(B,D,I),B.elm}}var RT={create:Uc,update:Uc,destroy:function(e){Uc(e,Fi)}};function Uc(s,e){(s.data.directives||e.data.directives)&&DT(s,e)}function DT(s,e){var t=s===Fi,i=e===Fi,r=Vp(s.data.directives,s.context),n=Vp(e.data.directives,e.context),a=[],o=[],l,c,u;for(l in n)c=r[l],u=n[l],c?(u.oldValue=c.value,u.oldArg=c.arg,Pn(u,"update",e,s),u.def&&u.def.componentUpdated&&o.push(u)):(Pn(u,"bind",e,s),u.def&&u.def.inserted&&a.push(u));if(a.length){var f=function(){for(var d=0;d<a.length;d++)Pn(a[d],"inserted",e,s)};t?Ni(e,"insert",f):f()}if(o.length&&Ni(e,"postpatch",function(){for(var d=0;d<o.length;d++)Pn(o[d],"componentUpdated",e,s)}),!t)for(l in r)n[l]||Pn(r[l],"unbind",s,s,i)}var kT=Object.create(null);function Vp(s,e){var t=Object.create(null);if(!s)return t;var i,r;for(i=0;i<s.length;i++){if(r=s[i],r.modifiers||(r.modifiers=kT),t[PT(r)]=r,e._setupState&&e._setupState.__sfc){var n=r.def||nl(e,"_setupState","v-"+r.name);typeof n=="function"?r.def={bind:n,update:n}:r.def=n}r.def=r.def||nl(e.$options,"directives",r.name)}return t}function PT(s){return s.rawName||"".concat(s.name,".").concat(Object.keys(s.modifiers||{}).join("."))}function Pn(s,e,t,i,r){var n=s.def&&s.def[e];if(n)try{n(t.elm,s,t,i,r)}catch(a){Sr(a,t.context,"directive ".concat(s.name," ").concat(e," hook"))}}var OT=[wT,RT];function Kp(s,e){var t=e.componentOptions;if(!(W(t)&&t.Ctor.options.inheritAttrs===!1)&&!(ge(s.data.attrs)&&ge(e.data.attrs))){var i,r,n,a=e.elm,o=s.data.attrs||{},l=e.data.attrs||{};(W(l.__ob__)||at(l._v_attr_proxy))&&(l=e.data.attrs=Je({},l));for(i in l)r=l[i],n=o[i],n!==r&&Wp(a,i,r,e.data.pre);(hn||ov)&&l.value!==o.value&&Wp(a,"value",l.value);for(i in o)ge(l[i])&&(Rd(i)?a.removeAttributeNS(cf,Gv(i)):Uv(i)||a.removeAttribute(i))}}function Wp(s,e,t,i){i||s.tagName.indexOf("-")>-1?zp(s,e,t):iT(e)?al(t)?s.removeAttribute(e):(t=e==="allowfullscreen"&&s.tagName==="EMBED"?"true":e,s.setAttribute(e,t)):Uv(e)?s.setAttribute(e,sT(e,t)):Rd(e)?al(t)?s.removeAttributeNS(cf,Gv(e)):s.setAttributeNS(cf,e,t):zp(s,e,t)}function zp(s,e,t){if(al(t))s.removeAttribute(e);else{if(hn&&!pn&&s.tagName==="TEXTAREA"&&e==="placeholder"&&t!==""&&!s.__ieph){var i=function(r){r.stopImmediatePropagation(),s.removeEventListener("input",i)};s.addEventListener("input",i),s.__ieph=!0}s.setAttribute(e,t)}}var MT={create:Kp,update:Kp};function Qp(s,e){var t=e.elm,i=e.data,r=s.data;if(!(ge(i.staticClass)&&ge(i.class)&&(ge(r)||ge(r.staticClass)&&ge(r.class)))){var n=rT(e),a=t._transitionClasses;W(a)&&(n=Dd(n,kd(a))),n!==t._prevClass&&(t.setAttribute("class",n),t._prevClass=n)}}var NT={create:Qp,update:Qp},Gc="__r",Hc="__c";function FT(s){if(W(s[Gc])){var e=hn?"change":"input";s[e]=[].concat(s[Gc],s[e]||[]),delete s[Gc]}W(s[Hc])&&(s.change=[].concat(s[Hc],s.change||[]),delete s[Hc])}var na;function $T(s,e,t){var i=na;return function r(){var n=e.apply(null,arguments);n!==null&&Yv(s,r,t,i)}}var BT=Zu&&!(gp&&Number(gp[1])<=53);function UT(s,e,t,i){if(BT){var r=Nv,n=e;e=n._wrapper=function(a){if(a.target===a.currentTarget||a.timeStamp>=r||a.timeStamp<=0||a.target.ownerDocument!==document)return n.apply(this,arguments)}}na.addEventListener(s,e,lv?{capture:t,passive:i}:t)}function Yv(s,e,t,i){(i||na).removeEventListener(s,e._wrapper||e,t)}function Yc(s,e){if(!(ge(s.data.on)&&ge(e.data.on))){var t=e.data.on||{},i=s.data.on||{};na=e.elm||s.elm,FT(t),Ev(t,i,UT,Yv,$T,e.context),na=void 0}}var GT={create:Yc,update:Yc,destroy:function(s){return Yc(s,Fi)}},Ka;function qp(s,e){if(!(ge(s.data.domProps)&&ge(e.data.domProps))){var t,i,r=e.elm,n=s.data.domProps||{},a=e.data.domProps||{};(W(a.__ob__)||at(a._v_attr_proxy))&&(a=e.data.domProps=Je({},a));for(t in n)t in a||(r[t]="");for(t in a){if(i=a[t],t==="textContent"||t==="innerHTML"){if(e.children&&(e.children.length=0),i===n[t])continue;r.childNodes.length===1&&r.removeChild(r.childNodes[0])}if(t==="value"&&r.tagName!=="PROGRESS"){r._value=i;var o=ge(i)?"":String(i);HT(r,o)&&(r.value=o)}else if(t==="innerHTML"&&Pd(r.tagName)&&ge(r.innerHTML)){Ka=Ka||document.createElement("div"),Ka.innerHTML="<svg>".concat(i,"</svg>");for(var l=Ka.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;l.firstChild;)r.appendChild(l.firstChild)}else if(i!==n[t])try{r[t]=i}catch{}}}}function HT(s,e){return!s.composing&&(s.tagName==="OPTION"||YT(s,e)||jT(s,e))}function YT(s,e){var t=!0;try{t=document.activeElement!==s}catch{}return t&&s.value!==e}function jT(s,e){var t=s.value,i=s._vModifiers;if(W(i)){if(i.number)return Zn(t)!==Zn(e);if(i.trim)return t.trim()!==e.trim()}return t!==e}var VT={create:qp,update:qp},KT=Ar(function(s){var e={},t=/;(?![^(]*\))/g,i=/:(.+)/;return s.split(t).forEach(function(r){if(r){var n=r.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e});function jc(s){var e=jv(s.style);return s.staticStyle?Je(s.staticStyle,e):e}function jv(s){return Array.isArray(s)?sv(s):typeof s=="string"?KT(s):s}function WT(s,e){for(var t={},i,r=s;r.componentInstance;)r=r.componentInstance._vnode,r&&r.data&&(i=jc(r.data))&&Je(t,i);(i=jc(s.data))&&Je(t,i);for(var n=s;n=n.parent;)n.data&&(i=jc(n.data))&&Je(t,i);return t}var zT=/^--/,Xp=/\s*!important$/,Jp=function(s,e,t){if(zT.test(e))s.style.setProperty(e,t);else if(Xp.test(t))s.style.setProperty(ba(e),t.replace(Xp,""),"important");else{var i=QT(e);if(Array.isArray(t))for(var r=0,n=t.length;r<n;r++)s.style[i]=t[r];else s.style[i]=t}},Zp=["Webkit","Moz","ms"],Wa,QT=Ar(function(s){if(Wa=Wa||document.createElement("div").style,s=yr(s),s!=="filter"&&s in Wa)return s;for(var e=s.charAt(0).toUpperCase()+s.slice(1),t=0;t<Zp.length;t++){var i=Zp[t]+e;if(i in Wa)return i}});function em(s,e){var t=e.data,i=s.data;if(!(ge(t.staticStyle)&&ge(t.style)&&ge(i.staticStyle)&&ge(i.style))){var r,n,a=e.elm,o=i.staticStyle,l=i.normalizedStyle||i.style||{},c=o||l,u=jv(e.data.style)||{};e.data.normalizedStyle=W(u.__ob__)?Je({},u):u;var f=WT(e);for(n in c)ge(f[n])&&Jp(a,n,"");for(n in f)r=f[n],Jp(a,n,r??"")}}var qT={create:em,update:em},Vv=/\s+/;function Kv(s,e){if(!(!e||!(e=e.trim())))if(s.classList)e.indexOf(" ")>-1?e.split(Vv).forEach(function(i){return s.classList.add(i)}):s.classList.add(e);else{var t=" ".concat(s.getAttribute("class")||""," ");t.indexOf(" "+e+" ")<0&&s.setAttribute("class",(t+e).trim())}}function Wv(s,e){if(!(!e||!(e=e.trim())))if(s.classList)e.indexOf(" ")>-1?e.split(Vv).forEach(function(r){return s.classList.remove(r)}):s.classList.remove(e),s.classList.length||s.removeAttribute("class");else{for(var t=" ".concat(s.getAttribute("class")||""," "),i=" "+e+" ";t.indexOf(i)>=0;)t=t.replace(i," ");t=t.trim(),t?s.setAttribute("class",t):s.removeAttribute("class")}}function zv(s){if(s){if(typeof s=="object"){var e={};return s.css!==!1&&Je(e,tm(s.name||"v")),Je(e,s),e}else if(typeof s=="string")return tm(s)}}var tm=Ar(function(s){return{enterClass:"".concat(s,"-enter"),enterToClass:"".concat(s,"-enter-to"),enterActiveClass:"".concat(s,"-enter-active"),leaveClass:"".concat(s,"-leave"),leaveToClass:"".concat(s,"-leave-to"),leaveActiveClass:"".concat(s,"-leave-active")}}),Qv=Xt&&!pn,Hr="transition",Vc="animation",xo="transition",ol="transitionend",ff="animation",qv="animationend";Qv&&(window.ontransitionend===void 0&&window.onwebkittransitionend!==void 0&&(xo="WebkitTransition",ol="webkitTransitionEnd"),window.onanimationend===void 0&&window.onwebkitanimationend!==void 0&&(ff="WebkitAnimation",qv="webkitAnimationEnd"));var sm=Xt?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(s){return s()};function Xv(s){sm(function(){sm(s)})}function pr(s,e){var t=s._transitionClasses||(s._transitionClasses=[]);t.indexOf(e)<0&&(t.push(e),Kv(s,e))}function pi(s,e){s._transitionClasses&&Zi(s._transitionClasses,e),Wv(s,e)}function Jv(s,e,t){var i=Zv(s,e),r=i.type,n=i.timeout,a=i.propCount;if(!r)return t();var o=r===Hr?ol:qv,l=0,c=function(){s.removeEventListener(o,u),t()},u=function(f){f.target===s&&++l>=a&&c()};setTimeout(function(){l<a&&c()},n+1),s.addEventListener(o,u)}var XT=/\b(transform|all)(,|$)/;function Zv(s,e){var t=window.getComputedStyle(s),i=(t[xo+"Delay"]||"").split(", "),r=(t[xo+"Duration"]||"").split(", "),n=im(i,r),a=(t[ff+"Delay"]||"").split(", "),o=(t[ff+"Duration"]||"").split(", "),l=im(a,o),c,u=0,f=0;e===Hr?n>0&&(c=Hr,u=n,f=r.length):e===Vc?l>0&&(c=Vc,u=l,f=o.length):(u=Math.max(n,l),c=u>0?n>l?Hr:Vc:null,f=c?c===Hr?r.length:o.length:0);var d=c===Hr&&XT.test(t[xo+"Property"]);return{type:c,timeout:u,propCount:f,hasTransform:d}}function im(s,e){for(;s.length<e.length;)s=s.concat(s);return Math.max.apply(null,e.map(function(t,i){return rm(t)+rm(s[i])}))}function rm(s){return Number(s.slice(0,-1).replace(",","."))*1e3}function df(s,e){var t=s.elm;W(t._leaveCb)&&(t._leaveCb.cancelled=!0,t._leaveCb());var i=zv(s.data.transition);if(!ge(i)&&!(W(t._enterCb)||t.nodeType!==1)){for(var r=i.css,n=i.type,a=i.enterClass,o=i.enterToClass,l=i.enterActiveClass,c=i.appearClass,u=i.appearToClass,f=i.appearActiveClass,d=i.beforeEnter,h=i.enter,p=i.afterEnter,g=i.enterCancelled,m=i.beforeAppear,v=i.appear,y=i.afterAppear,E=i.appearCancelled,w=i.duration,T=hr,$=hr.$vnode;$&&$.parent;)T=$.context,$=$.parent;var k=!T._isMounted||!s.isRootInsert;if(!(k&&!v&&v!=="")){var M=k&&c?c:a,_=k&&f?f:l,C=k&&u?u:o,U=k&&m||d,L=k&&je(v)?v:h,R=k&&y||p,B=k&&E||g,S=Zn(Pt(w)?w.enter:w),A=r!==!1&&!pn,I=Od(L),D=t._enterCb=Xo(function(){A&&(pi(t,C),pi(t,_)),D.cancelled?(A&&pi(t,M),B&&B(t)):R&&R(t),t._enterCb=null});s.data.show||Ni(s,"insert",function(){var O=t.parentNode,H=O&&O._pending&&O._pending[s.key];H&&H.tag===s.tag&&H.elm._leaveCb&&H.elm._leaveCb(),L&&L(t,D)}),U&&U(t),A&&(pr(t,M),pr(t,_),Xv(function(){pi(t,M),D.cancelled||(pr(t,C),I||(ty(S)?setTimeout(D,S):Jv(t,n,D)))})),s.data.show&&(e&&e(),L&&L(t,D)),!A&&!I&&D()}}}function ey(s,e){var t=s.elm;W(t._enterCb)&&(t._enterCb.cancelled=!0,t._enterCb());var i=zv(s.data.transition);if(ge(i)||t.nodeType!==1)return e();if(W(t._leaveCb))return;var r=i.css,n=i.type,a=i.leaveClass,o=i.leaveToClass,l=i.leaveActiveClass,c=i.beforeLeave,u=i.leave,f=i.afterLeave,d=i.leaveCancelled,h=i.delayLeave,p=i.duration,g=r!==!1&&!pn,m=Od(u),v=Zn(Pt(p)?p.leave:p),y=t._leaveCb=Xo(function(){t.parentNode&&t.parentNode._pending&&(t.parentNode._pending[s.key]=null),g&&(pi(t,o),pi(t,l)),y.cancelled?(g&&pi(t,a),d&&d(t)):(e(),f&&f(t)),t._leaveCb=null});h?h(E):E();function E(){y.cancelled||(!s.data.show&&t.parentNode&&((t.parentNode._pending||(t.parentNode._pending={}))[s.key]=s),c&&c(t),g&&(pr(t,a),pr(t,l),Xv(function(){pi(t,a),y.cancelled||(pr(t,o),m||(ty(v)?setTimeout(y,v):Jv(t,n,y)))})),u&&u(t,y),!g&&!m&&y())}}function ty(s){return typeof s=="number"&&!isNaN(s)}function Od(s){if(ge(s))return!1;var e=s.fns;return W(e)?Od(Array.isArray(e)?e[0]:e):(s._length||s.length)>1}function nm(s,e){e.data.show!==!0&&df(e)}var JT=Xt?{create:nm,activate:nm,remove:function(s,e){s.data.show!==!0?ey(s,e):e()}}:{},ZT=[MT,NT,GT,VT,qT,JT],ew=ZT.concat(OT),tw=IT({nodeOps:TT,modules:ew});pn&&document.addEventListener("selectionchange",function(){var s=document.activeElement;s&&s.vmodel&&Md(s,"input")});var sy={inserted:function(s,e,t,i){t.tag==="select"?(i.elm&&!i.elm._vOptions?Ni(t,"postpatch",function(){sy.componentUpdated(s,e,t)}):am(s,e,t.context),s._vOptions=[].map.call(s.options,ll)):(t.tag==="textarea"||uf(s.type))&&(s._vModifiers=e.modifiers,e.modifiers.lazy||(s.addEventListener("compositionstart",sw),s.addEventListener("compositionend",cm),s.addEventListener("change",cm),pn&&(s.vmodel=!0)))},componentUpdated:function(s,e,t){if(t.tag==="select"){am(s,e,t.context);var i=s._vOptions,r=s._vOptions=[].map.call(s.options,ll);if(r.some(function(a,o){return!br(a,i[o])})){var n=s.multiple?e.value.some(function(a){return lm(a,r)}):e.value!==e.oldValue&&lm(e.value,r);n&&Md(s,"change")}}}};function am(s,e,t){om(s,e),(hn||ov)&&setTimeout(function(){om(s,e)},0)}function om(s,e,t){var i=e.value,r=s.multiple;if(!(r&&!Array.isArray(i))){for(var n,a,o=0,l=s.options.length;o<l;o++)if(a=s.options[o],r)n=rv(i,ll(a))>-1,a.selected!==n&&(a.selected=n);else if(br(ll(a),i)){s.selectedIndex!==o&&(s.selectedIndex=o);return}r||(s.selectedIndex=-1)}}function lm(s,e){return e.every(function(t){return!br(t,s)})}function ll(s){return"_value"in s?s._value:s.value}function sw(s){s.target.composing=!0}function cm(s){s.target.composing&&(s.target.composing=!1,Md(s.target,"input"))}function Md(s,e){var t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),s.dispatchEvent(t)}function hf(s){return s.componentInstance&&(!s.data||!s.data.transition)?hf(s.componentInstance._vnode):s}var iw={bind:function(s,e,t){var i=e.value;t=hf(t);var r=t.data&&t.data.transition,n=s.__vOriginalDisplay=s.style.display==="none"?"":s.style.display;i&&r?(t.data.show=!0,df(t,function(){s.style.display=n})):s.style.display=i?n:"none"},update:function(s,e,t){var i=e.value,r=e.oldValue;if(!i!=!r){t=hf(t);var n=t.data&&t.data.transition;n?(t.data.show=!0,i?df(t,function(){s.style.display=s.__vOriginalDisplay}):ey(t,function(){s.style.display="none"})):s.style.display=i?s.__vOriginalDisplay:"none"}},unbind:function(s,e,t,i,r){r||(s.style.display=s.__vOriginalDisplay)}},rw={model:sy,show:iw},iy={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function pf(s){var e=s&&s.componentOptions;return e&&e.Ctor.options.abstract?pf(Lv(e.children)):s}function ry(s){var e={},t=s.$options;for(var i in t.propsData)e[i]=s[i];var r=t._parentListeners;for(var i in r)e[yr(i)]=r[i];return e}function um(s,e){if(/\d-keep-alive$/.test(e.tag))return s("keep-alive",{props:e.componentOptions.propsData})}function nw(s){for(;s=s.parent;)if(s.data.transition)return!0}function aw(s,e){return e.key===s.key&&e.tag===s.tag}var ow=function(s){return s.tag||ta(s)},lw=function(s){return s.name==="show"},cw={name:"transition",props:iy,abstract:!0,render:function(s){var e=this,t=this.$slots.default;if(t&&(t=t.filter(ow),!!t.length)){var i=this.mode,r=t[0];if(nw(this.$vnode))return r;var n=pf(r);if(!n)return r;if(this._leaving)return um(s,r);var a="__transition-".concat(this._uid,"-");n.key=n.key==null?n.isComment?a+"comment":a+n.tag:ya(n.key)?String(n.key).indexOf(a)===0?n.key:a+n.key:n.key;var o=(n.data||(n.data={})).transition=ry(this),l=this._vnode,c=pf(l);if(n.data.directives&&n.data.directives.some(lw)&&(n.data.show=!0),c&&c.data&&!aw(n,c)&&!ta(c)&&!(c.componentInstance&&c.componentInstance._vnode.isComment)){var u=c.data.transition=Je({},o);if(i==="out-in")return this._leaving=!0,Ni(u,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),um(s,r);if(i==="in-out"){if(ta(n))return l;var f,d=function(){f()};Ni(o,"afterEnter",d),Ni(o,"enterCancelled",d),Ni(u,"delayLeave",function(h){f=h})}}return r}}},ny=Je({tag:String,moveClass:String},iy);delete ny.mode;var uw={props:ny,beforeMount:function(){var s=this,e=this._update;this._update=function(t,i){var r=Pv(s);s.__patch__(s._vnode,s.kept,!1,!0),s._vnode=s.kept,r(),e.call(s,t,i)}},render:function(s){for(var e=this.tag||this.$vnode.data.tag||"span",t=Object.create(null),i=this.prevChildren=this.children,r=this.$slots.default||[],n=this.children=[],a=ry(this),o=0;o<r.length;o++){var l=r[o];l.tag&&l.key!=null&&String(l.key).indexOf("__vlist")!==0&&(n.push(l),t[l.key]=l,(l.data||(l.data={})).transition=a)}if(i){for(var c=[],u=[],o=0;o<i.length;o++){var l=i[o];l.data.transition=a,l.data.pos=l.elm.getBoundingClientRect(),t[l.key]?c.push(l):u.push(l)}this.kept=s(e,null,c),this.removed=u}return s(e,null,n)},updated:function(){var s=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";!s.length||!this.hasMove(s[0].elm,e)||(s.forEach(fw),s.forEach(dw),s.forEach(hw),this._reflow=document.body.offsetHeight,s.forEach(function(t){if(t.data.moved){var i=t.elm,r=i.style;pr(i,e),r.transform=r.WebkitTransform=r.transitionDuration="",i.addEventListener(ol,i._moveCb=function n(a){a&&a.target!==i||(!a||/transform$/.test(a.propertyName))&&(i.removeEventListener(ol,n),i._moveCb=null,pi(i,e))})}}))},methods:{hasMove:function(s,e){if(!Qv)return!1;if(this._hasMove)return this._hasMove;var t=s.cloneNode();s._transitionClasses&&s._transitionClasses.forEach(function(r){Wv(t,r)}),Kv(t,e),t.style.display="none",this.$el.appendChild(t);var i=Zv(t);return this.$el.removeChild(t),this._hasMove=i.hasTransform}}};function fw(s){s.elm._moveCb&&s.elm._moveCb(),s.elm._enterCb&&s.elm._enterCb()}function dw(s){s.data.newPos=s.elm.getBoundingClientRect()}function hw(s){var e=s.data.pos,t=s.data.newPos,i=e.left-t.left,r=e.top-t.top;if(i||r){s.data.moved=!0;var n=s.elm.style;n.transform=n.WebkitTransform="translate(".concat(i,"px,").concat(r,"px)"),n.transitionDuration="0s"}}var pw={Transition:cw,TransitionGroup:uw};Ce.config.mustUseProp=eT;Ce.config.isReservedTag=Hv;Ce.config.isReservedAttr=J1;Ce.config.getTagNamespace=uT;Ce.config.isUnknownElement=fT;Je(Ce.options.directives,rw);Je(Ce.options.components,pw);Ce.prototype.__patch__=Xt?tw:rt;Ce.prototype.$mount=function(s,e){return s=s&&Xt?dT(s):void 0,a1(this,s,e)};Xt&&setTimeout(function(){vs.devtools&&Jo&&Jo.emit("init",Ce)},0);const mw=Object.freeze(Object.defineProperty({__proto__:null,EffectScope:yd,computed:Kx,customRef:Ux,default:Ce,defineAsyncComponent:NA,defineComponent:XA,del:gd,effectScope:Xx,getCurrentInstance:Cx,getCurrentScope:bv,h:DA,inject:tA,isProxy:Px,isReactive:dr,isReadonly:Tr,isRef:Lt,isShallow:el,markRaw:Ox,mergeDefaults:xA,nextTick:Kl,onActivated:jA,onBeforeMount:$A,onBeforeUnmount:HA,onBeforeUpdate:UA,onDeactivated:VA,onErrorCaptured:qA,onMounted:BA,onRenderTracked:WA,onRenderTriggered:zA,onScopeDispose:Zx,onServerPrefetch:KA,onUnmounted:YA,onUpdated:GA,provide:eA,proxyRefs:Bx,reactive:kx,readonly:gv,ref:Mx,set:Yl,shallowReactive:vd,shallowReadonly:Vx,shallowRef:Nx,toRaw:hv,toRef:mv,toRefs:Gx,triggerRef:Fx,unref:$x,useAttrs:EA,useCssModule:OA,useCssVars:MA,useListeners:_A,useSlots:SA,version:Dv,watch:qx,watchEffect:zx,watchPostEffect:yv,watchSyncEffect:Qx},Symbol.toStringTag,{value:"Module"}));/*!
|
|
6
|
+
* vuex v3.6.2
|
|
7
|
+
* (c) 2021 Evan You
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/function gw(s){var e=Number(s.version.split(".")[0]);if(e>=2)s.mixin({beforeCreate:i});else{var t=s.prototype._init;s.prototype._init=function(r){r===void 0&&(r={}),r.init=r.init?[i].concat(r.init):i,t.call(this,r)}}function i(){var r=this.$options;r.store?this.$store=typeof r.store=="function"?r.store():r.store:r.parent&&r.parent.$store&&(this.$store=r.parent.$store)}}var vw=typeof window<"u"?window:typeof global<"u"?global:{},kr=vw.__VUE_DEVTOOLS_GLOBAL_HOOK__;function yw(s){kr&&(s._devtoolHook=kr,kr.emit("vuex:init",s),kr.on("vuex:travel-to-state",function(e){s.replaceState(e)}),s.subscribe(function(e,t){kr.emit("vuex:mutation",e,t)},{prepend:!0}),s.subscribeAction(function(e,t){kr.emit("vuex:action",e,t)},{prepend:!0}))}function bw(s,e){return s.filter(e)[0]}function mf(s,e){if(e===void 0&&(e=[]),s===null||typeof s!="object")return s;var t=bw(e,function(r){return r.original===s});if(t)return t.copy;var i=Array.isArray(s)?[]:{};return e.push({original:s,copy:i}),Object.keys(s).forEach(function(r){i[r]=mf(s[r],e)}),i}function vn(s,e){Object.keys(s).forEach(function(t){return e(s[t],t)})}function ay(s){return s!==null&&typeof s=="object"}function Sw(s){return s&&typeof s.then=="function"}function Ew(s,e){return function(){return s(e)}}var Ms=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var i=e.state;this.state=(typeof i=="function"?i():i)||{}},oy={namespaced:{configurable:!0}};oy.namespaced.get=function(){return!!this._rawModule.namespaced};Ms.prototype.addChild=function(e,t){this._children[e]=t};Ms.prototype.removeChild=function(e){delete this._children[e]};Ms.prototype.getChild=function(e){return this._children[e]};Ms.prototype.hasChild=function(e){return e in this._children};Ms.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};Ms.prototype.forEachChild=function(e){vn(this._children,e)};Ms.prototype.forEachGetter=function(e){this._rawModule.getters&&vn(this._rawModule.getters,e)};Ms.prototype.forEachAction=function(e){this._rawModule.actions&&vn(this._rawModule.actions,e)};Ms.prototype.forEachMutation=function(e){this._rawModule.mutations&&vn(this._rawModule.mutations,e)};Object.defineProperties(Ms.prototype,oy);var wr=function(e){this.register([],e,!1)};wr.prototype.get=function(e){return e.reduce(function(t,i){return t.getChild(i)},this.root)};wr.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(i,r){return t=t.getChild(r),i+(t.namespaced?r+"/":"")},"")};wr.prototype.update=function(e){ly([],this.root,e)};wr.prototype.register=function(e,t,i){var r=this;i===void 0&&(i=!0);var n=new Ms(t,i);if(e.length===0)this.root=n;else{var a=this.get(e.slice(0,-1));a.addChild(e[e.length-1],n)}t.modules&&vn(t.modules,function(o,l){r.register(e.concat(l),o,i)})};wr.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),i=e[e.length-1],r=t.getChild(i);r&&r.runtime&&t.removeChild(i)};wr.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),i=e[e.length-1];return t?t.hasChild(i):!1};function ly(s,e,t){if(e.update(t),t.modules)for(var i in t.modules){if(!e.getChild(i))return;ly(s.concat(i),e.getChild(i),t.modules[i])}}var Wt,cs=function(e){var t=this;e===void 0&&(e={}),!Wt&&typeof window<"u"&&window.Vue&&fy(window.Vue);var i=e.plugins;i===void 0&&(i=[]);var r=e.strict;r===void 0&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new wr(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Wt,this._makeLocalGettersCache=Object.create(null);var n=this,a=this,o=a.dispatch,l=a.commit;this.dispatch=function(d,h){return o.call(n,d,h)},this.commit=function(d,h,p){return l.call(n,d,h,p)},this.strict=r;var c=this._modules.root.state;Wl(this,c,[],this._modules.root),Fd(this,c),i.forEach(function(f){return f(t)});var u=e.devtools!==void 0?e.devtools:Wt.config.devtools;u&&yw(this)},Nd={state:{configurable:!0}};Nd.state.get=function(){return this._vm._data.$$state};Nd.state.set=function(s){};cs.prototype.commit=function(e,t,i){var r=this,n=cl(e,t,i),a=n.type,o=n.payload,l={type:a,payload:o},c=this._mutations[a];c&&(this._withCommit(function(){c.forEach(function(f){f(o)})}),this._subscribers.slice().forEach(function(u){return u(l,r.state)}))};cs.prototype.dispatch=function(e,t){var i=this,r=cl(e,t),n=r.type,a=r.payload,o={type:n,payload:a},l=this._actions[n];if(l){try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(o,i.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(u){return u(a)})):l[0](a);return new Promise(function(u,f){c.then(function(d){try{i._actionSubscribers.filter(function(h){return h.after}).forEach(function(h){return h.after(o,i.state)})}catch{}u(d)},function(d){try{i._actionSubscribers.filter(function(h){return h.error}).forEach(function(h){return h.error(o,i.state,d)})}catch{}f(d)})})}};cs.prototype.subscribe=function(e,t){return cy(e,this._subscribers,t)};cs.prototype.subscribeAction=function(e,t){var i=typeof e=="function"?{before:e}:e;return cy(i,this._actionSubscribers,t)};cs.prototype.watch=function(e,t,i){var r=this;return this._watcherVM.$watch(function(){return e(r.state,r.getters)},t,i)};cs.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm._data.$$state=e})};cs.prototype.registerModule=function(e,t,i){i===void 0&&(i={}),typeof e=="string"&&(e=[e]),this._modules.register(e,t),Wl(this,this.state,e,this._modules.get(e),i.preserveState),Fd(this,this.state)};cs.prototype.unregisterModule=function(e){var t=this;typeof e=="string"&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var i=$d(t.state,e.slice(0,-1));Wt.delete(i,e[e.length-1])}),uy(this)};cs.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),this._modules.isRegistered(e)};cs.prototype.hotUpdate=function(e){this._modules.update(e),uy(this,!0)};cs.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t};Object.defineProperties(cs.prototype,Nd);function cy(s,e,t){return e.indexOf(s)<0&&(t&&t.prepend?e.unshift(s):e.push(s)),function(){var i=e.indexOf(s);i>-1&&e.splice(i,1)}}function uy(s,e){s._actions=Object.create(null),s._mutations=Object.create(null),s._wrappedGetters=Object.create(null),s._modulesNamespaceMap=Object.create(null);var t=s.state;Wl(s,t,[],s._modules.root,!0),Fd(s,t,e)}function Fd(s,e,t){var i=s._vm;s.getters={},s._makeLocalGettersCache=Object.create(null);var r=s._wrappedGetters,n={};vn(r,function(o,l){n[l]=Ew(o,s),Object.defineProperty(s.getters,l,{get:function(){return s._vm[l]},enumerable:!0})});var a=Wt.config.silent;Wt.config.silent=!0,s._vm=new Wt({data:{$$state:e},computed:n}),Wt.config.silent=a,s.strict&&Cw(s),i&&(t&&s._withCommit(function(){i._data.$$state=null}),Wt.nextTick(function(){return i.$destroy()}))}function Wl(s,e,t,i,r){var n=!t.length,a=s._modules.getNamespace(t);if(i.namespaced&&(s._modulesNamespaceMap[a],s._modulesNamespaceMap[a]=i),!n&&!r){var o=$d(e,t.slice(0,-1)),l=t[t.length-1];s._withCommit(function(){Wt.set(o,l,i.state)})}var c=i.context=_w(s,a,t);i.forEachMutation(function(u,f){var d=a+f;Aw(s,d,u,c)}),i.forEachAction(function(u,f){var d=u.root?f:a+f,h=u.handler||u;Tw(s,d,h,c)}),i.forEachGetter(function(u,f){var d=a+f;ww(s,d,u,c)}),i.forEachChild(function(u,f){Wl(s,e,t.concat(f),u,r)})}function _w(s,e,t){var i=e==="",r={dispatch:i?s.dispatch:function(n,a,o){var l=cl(n,a,o),c=l.payload,u=l.options,f=l.type;return(!u||!u.root)&&(f=e+f),s.dispatch(f,c)},commit:i?s.commit:function(n,a,o){var l=cl(n,a,o),c=l.payload,u=l.options,f=l.type;(!u||!u.root)&&(f=e+f),s.commit(f,c,u)}};return Object.defineProperties(r,{getters:{get:i?function(){return s.getters}:function(){return xw(s,e)}},state:{get:function(){return $d(s.state,t)}}}),r}function xw(s,e){if(!s._makeLocalGettersCache[e]){var t={},i=e.length;Object.keys(s.getters).forEach(function(r){if(r.slice(0,i)===e){var n=r.slice(i);Object.defineProperty(t,n,{get:function(){return s.getters[r]},enumerable:!0})}}),s._makeLocalGettersCache[e]=t}return s._makeLocalGettersCache[e]}function Aw(s,e,t,i){var r=s._mutations[e]||(s._mutations[e]=[]);r.push(function(a){t.call(s,i.state,a)})}function Tw(s,e,t,i){var r=s._actions[e]||(s._actions[e]=[]);r.push(function(a){var o=t.call(s,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:s.getters,rootState:s.state},a);return Sw(o)||(o=Promise.resolve(o)),s._devtoolHook?o.catch(function(l){throw s._devtoolHook.emit("vuex:error",l),l}):o})}function ww(s,e,t,i){s._wrappedGetters[e]||(s._wrappedGetters[e]=function(n){return t(i.state,i.getters,n.state,n.getters)})}function Cw(s){s._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function $d(s,e){return e.reduce(function(t,i){return t[i]},s)}function cl(s,e,t){return ay(s)&&s.type&&(t=e,e=s,s=s.type),{type:s,payload:e,options:t}}function fy(s){Wt&&s===Wt||(Wt=s,gw(Wt))}var xt=Xl(function(s,e){var t={};return ql(e).forEach(function(i){var r=i.key,n=i.val;t[r]=function(){var o=this.$store.state,l=this.$store.getters;if(s){var c=Jl(this.$store,"mapState",s);if(!c)return;o=c.context.state,l=c.context.getters}return typeof n=="function"?n.call(this,o,l):o[n]},t[r].vuex=!0}),t}),zl=Xl(function(s,e){var t={};return ql(e).forEach(function(i){var r=i.key,n=i.val;t[r]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var c=this.$store.commit;if(s){var u=Jl(this.$store,"mapMutations",s);if(!u)return;c=u.context.commit}return typeof n=="function"?n.apply(this,[c].concat(o)):c.apply(this.$store,[n].concat(o))}}),t}),dy=Xl(function(s,e){var t={};return ql(e).forEach(function(i){var r=i.key,n=i.val;n=s+n,t[r]=function(){if(!(s&&!Jl(this.$store,"mapGetters",s)))return this.$store.getters[n]},t[r].vuex=!0}),t}),Ql=Xl(function(s,e){var t={};return ql(e).forEach(function(i){var r=i.key,n=i.val;t[r]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var c=this.$store.dispatch;if(s){var u=Jl(this.$store,"mapActions",s);if(!u)return;c=u.context.dispatch}return typeof n=="function"?n.apply(this,[c].concat(o)):c.apply(this.$store,[n].concat(o))}}),t}),Lw=function(s){return{mapState:xt.bind(null,s),mapGetters:dy.bind(null,s),mapMutations:zl.bind(null,s),mapActions:Ql.bind(null,s)}};function ql(s){return Iw(s)?Array.isArray(s)?s.map(function(e){return{key:e,val:e}}):Object.keys(s).map(function(e){return{key:e,val:s[e]}}):[]}function Iw(s){return Array.isArray(s)||ay(s)}function Xl(s){return function(e,t){return typeof e!="string"?(t=e,e=""):e.charAt(e.length-1)!=="/"&&(e+="/"),s(e,t)}}function Jl(s,e,t){var i=s._modulesNamespaceMap[t];return i}function Rw(s){s===void 0&&(s={});var e=s.collapsed;e===void 0&&(e=!0);var t=s.filter;t===void 0&&(t=function(u,f,d){return!0});var i=s.transformer;i===void 0&&(i=function(u){return u});var r=s.mutationTransformer;r===void 0&&(r=function(u){return u});var n=s.actionFilter;n===void 0&&(n=function(u,f){return!0});var a=s.actionTransformer;a===void 0&&(a=function(u){return u});var o=s.logMutations;o===void 0&&(o=!0);var l=s.logActions;l===void 0&&(l=!0);var c=s.logger;return c===void 0&&(c=console),function(u){var f=mf(u.state);typeof c>"u"||(o&&u.subscribe(function(d,h){var p=mf(h);if(t(d,f,p)){var g=hm(),m=r(d),v="mutation "+d.type+g;fm(c,v,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",i(f)),c.log("%c mutation","color: #03A9F4; font-weight: bold",m),c.log("%c next state","color: #4CAF50; font-weight: bold",i(p)),dm(c)}f=p}),l&&u.subscribeAction(function(d,h){if(n(d,h)){var p=hm(),g=a(d),m="action "+d.type+p;fm(c,m,e),c.log("%c action","color: #03A9F4; font-weight: bold",g),dm(c)}}))}}function fm(s,e,t){var i=t?s.groupCollapsed:s.group;try{i.call(s,e)}catch{s.log(e)}}function dm(s){try{s.groupEnd()}catch{s.log("—— log end ——")}}function hm(){var s=new Date;return" @ "+za(s.getHours(),2)+":"+za(s.getMinutes(),2)+":"+za(s.getSeconds(),2)+"."+za(s.getMilliseconds(),3)}function Dw(s,e){return new Array(e+1).join(s)}function za(s,e){return Dw("0",e-s.toString().length)+s}var hy={Store:cs,install:fy,version:"3.6.2",mapState:xt,mapMutations:zl,mapGetters:dy,mapActions:Ql,createNamespacedHelpers:Lw,createLogger:Rw},Vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function py(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return s[i]}})}),t}var gf={exports:{}};/*!
|
|
10
|
+
* Font Awesome Free 5.0.13 by @fontawesome - https://fontawesome.com
|
|
11
|
+
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
12
|
+
*/var pm=function(){},Bd={},my={},gy=null,vy={mark:pm,measure:pm};try{typeof window<"u"&&(Bd=window),typeof document<"u"&&(my=document),typeof MutationObserver<"u"&&(gy=MutationObserver),typeof performance<"u"&&(vy=performance)}catch{}var kw=Bd.navigator||{},mm=kw.userAgent,gm=mm===void 0?"":mm,qi=Bd,Ct=my,vm=gy,Qa=vy,Pw=!!qi.document,si=!!Ct.documentElement&&!!Ct.head&&typeof Ct.addEventListener=="function"&&typeof Ct.createElement=="function",yy=~gm.indexOf("MSIE")||~gm.indexOf("Trident/"),Si="___FONT_AWESOME___",vf=16,by="fa",Sy="svg-inline--fa",on="data-fa-i2svg",Kc="data-fa-pseudo-element",ym="fontawesome-i2svg",Ey=function(){try{return!0}catch{return!1}}(),_y=[1,2,3,4,5,6,7,8,9,10],Ow=_y.concat([11,12,13,14,15,16,17,18,19,20]),Mw=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Nw=["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(_y.map(function(s){return s+"x"})).concat(Ow.map(function(s){return"w-"+s})),Fw=function(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")},$w=function(){function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}}(),Fe=Object.assign||function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},xy=function(s){if(Array.isArray(s)){for(var e=0,t=Array(s.length);e<s.length;e++)t[e]=s[e];return t}else return Array.from(s)},Ay=qi.FontAwesomeConfig||{},Bw=Object.keys(Ay),yf=Fe({familyPrefix:by,replacementClass:Sy,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},Ay);yf.autoReplaceSvg||(yf.observeMutations=!1);var Ue=Fe({},yf);qi.FontAwesomeConfig=Ue;function Ty(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.asNewDefault,i=t===void 0?!1:t,r=Object.keys(Ue),n=i?function(a){return~r.indexOf(a)&&!~Bw.indexOf(a)}:function(a){return~r.indexOf(a)};Object.keys(s).forEach(function(a){n(a)&&(Ue[a]=s[a])})}function Uw(s){Ty({autoReplaceSvg:s,observeMutations:s})}var Ei=qi||{};Ei[Si]||(Ei[Si]={});Ei[Si].styles||(Ei[Si].styles={});Ei[Si].hooks||(Ei[Si].hooks={});Ei[Si].shims||(Ei[Si].shims=[]);var Ft=Ei[Si],wy=[],Gw=function s(){Ct.removeEventListener("DOMContentLoaded",s),ul=1,wy.map(function(e){return e()})},ul=!1;si&&(ul=(Ct.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Ct.readyState),ul||Ct.addEventListener("DOMContentLoaded",Gw));var Hw=function(s){si&&(ul?setTimeout(s,0):wy.push(s))},Pr=vf,$i={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Yw(s){return~Nw.indexOf(s)}function jw(s){try{s()}catch(e){if(!Ey)throw e}}function Cy(s){if(!(!s||!si)){var e=Ct.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=s;for(var t=Ct.head.childNodes,i=null,r=t.length-1;r>-1;r--){var n=t[r],a=(n.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(i=n)}return Ct.head.insertBefore(e,i),s}}var bm=0;function aa(){return bm++,bm}function ln(s){for(var e=[],t=(s||[]).length>>>0;t--;)e[t]=s[t];return e}function Ud(s){return s.classList?ln(s.classList):(s.getAttribute("class")||"").split(" ").filter(function(e){return e})}function Vw(s,e){var t=e.split("-"),i=t[0],r=t.slice(1).join("-");return i===s&&r!==""&&!Yw(r)?r:null}function Ly(s){return(""+s).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Kw(s){return Object.keys(s||{}).reduce(function(e,t){return e+(t+'="'+Ly(s[t])+'" ')},"").trim()}function Gd(s){return Object.keys(s||{}).reduce(function(e,t){return e+(t+": "+s[t]+";")},"")}function Hd(s){return s.size!==$i.size||s.x!==$i.x||s.y!==$i.y||s.rotate!==$i.rotate||s.flipX||s.flipY}function Iy(s){var e=s.transform,t=s.containerWidth,i=s.iconWidth,r={transform:"translate("+t/2+" 256)"},n="translate("+e.x*32+", "+e.y*32+") ",a="scale("+e.size/16*(e.flipX?-1:1)+", "+e.size/16*(e.flipY?-1:1)+") ",o="rotate("+e.rotate+" 0 0)",l={transform:n+" "+a+" "+o},c={transform:"translate("+i/2*-1+" -256)"};return{outer:r,inner:l,path:c}}function Ww(s){var e=s.transform,t=s.width,i=t===void 0?vf:t,r=s.height,n=r===void 0?vf:r,a="";return yy?a+="translate("+(e.x/Pr-i/2)+"em, "+(e.y/Pr-n/2)+"em) ":a+="translate(calc(-50% + "+e.x/Pr+"em), calc(-50% + "+e.y/Pr+"em)) ",a+="scale("+e.size/Pr*(e.flipX?-1:1)+", "+e.size/Pr*(e.flipY?-1:1)+") ",a+="rotate("+e.rotate+"deg) ",a}var Wc={x:0,y:0,width:"100%",height:"100%"},zw=function(s){var e=s.children,t=s.attributes,i=s.main,r=s.mask,n=s.transform,a=i.width,o=i.icon,l=r.width,c=r.icon,u=Iy({transform:n,containerWidth:l,iconWidth:a}),f={tag:"rect",attributes:Fe({},Wc,{fill:"white"})},d={tag:"g",attributes:Fe({},u.inner),children:[{tag:"path",attributes:Fe({},o.attributes,u.path,{fill:"black"})}]},h={tag:"g",attributes:Fe({},u.outer),children:[d]},p="mask-"+aa(),g="clip-"+aa(),m={tag:"mask",attributes:Fe({},Wc,{id:p,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,h]},v={tag:"defs",children:[{tag:"clipPath",attributes:{id:g},children:[c]},m]};return e.push(v,{tag:"rect",attributes:Fe({fill:"currentColor","clip-path":"url(#"+g+")",mask:"url(#"+p+")"},Wc)}),{children:e,attributes:t}},Qw=function(s){var e=s.children,t=s.attributes,i=s.main,r=s.transform,n=s.styles,a=Gd(n);if(a.length>0&&(t.style=a),Hd(r)){var o=Iy({transform:r,containerWidth:i.width,iconWidth:i.width});e.push({tag:"g",attributes:Fe({},o.outer),children:[{tag:"g",attributes:Fe({},o.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:Fe({},i.icon.attributes,o.path)}]}]})}else e.push(i.icon);return{children:e,attributes:t}},qw=function(s){var e=s.children,t=s.main,i=s.mask,r=s.attributes,n=s.styles,a=s.transform;if(Hd(a)&&t.found&&!i.found){var o=t.width,l=t.height,c={x:o/l/2,y:.5};r.style=Gd(Fe({},n,{"transform-origin":c.x+a.x/16+"em "+(c.y+a.y/16)+"em"}))}return[{tag:"svg",attributes:r,children:e}]},Xw=function(s){var e=s.prefix,t=s.iconName,i=s.children,r=s.attributes,n=s.symbol,a=n===!0?e+"-"+Ue.familyPrefix+"-"+t:n;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Fe({},r,{id:a}),children:i}]}]};function Ry(s){var e=s.icons,t=e.main,i=e.mask,r=s.prefix,n=s.iconName,a=s.transform,o=s.symbol,l=s.title,c=s.extra,u=s.watchable,f=u===void 0?!1:u,d=i.found?i:t,h=d.width,p=d.height,g="fa-w-"+Math.ceil(h/p*16),m=[Ue.replacementClass,n?Ue.familyPrefix+"-"+n:"",g].concat(c.classes).join(" "),v={children:[],attributes:Fe({},c.attributes,{"data-prefix":r,"data-icon":n,class:m,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+h+" "+p})};f&&(v.attributes[on]=""),l&&v.children.push({tag:"title",attributes:{id:v.attributes["aria-labelledby"]||"title-"+aa()},children:[l]});var y=Fe({},v,{prefix:r,iconName:n,main:t,mask:i,transform:a,symbol:o,styles:c.styles}),E=i.found&&t.found?zw(y):Qw(y),w=E.children,T=E.attributes;return y.children=w,y.attributes=T,o?Xw(y):qw(y)}function Dy(s){var e=s.content,t=s.width,i=s.height,r=s.transform,n=s.title,a=s.extra,o=s.watchable,l=o===void 0?!1:o,c=Fe({},a.attributes,n?{title:n}:{},{class:a.classes.join(" ")});l&&(c[on]="");var u=Fe({},a.styles);Hd(r)&&(u.transform=Ww({transform:r,width:t,height:i}),u["-webkit-transform"]=u.transform);var f=Gd(u);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[e]}),n&&d.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),d}var Sm=function(){},bf=Ue.measurePerformance&&Qa&&Qa.mark&&Qa.measure?Qa:{mark:Sm,measure:Sm},Un='FA "5.0.13"',Jw=function(e){return bf.mark(Un+" "+e+" begins"),function(){return ky(e)}},ky=function(e){bf.mark(Un+" "+e+" ends"),bf.measure(Un+" "+e,Un+" "+e+" begins",Un+" "+e+" ends")},Yd={begin:Jw,end:ky},zc=function(e,t,i,r){var n=Object.keys(e),a=n.length,o=t,l,c,u;for(i===void 0?(l=1,u=e[n[0]]):(l=0,u=i);l<a;l++)c=n[l],u=o(u,e[c],c,e);return u},Em=Ft.styles,Zw=Ft.shims,Py={},Oy={},My={},Sf=function(){var e=function(r){return zc(Em,function(n,a,o){return n[o]=zc(a,r,{}),n},{})};Py=e(function(i,r,n){return i[r[3]]=n,i}),Oy=e(function(i,r,n){var a=r[2];return i[n]=n,a.forEach(function(o){i[o]=n}),i});var t="far"in Em;My=zc(Zw,function(i,r){var n=r[0],a=r[1],o=r[2];return a==="far"&&!t&&(a="fas"),i[n]={prefix:a,iconName:o},i},{})};Sf();function eC(s,e){return Py[s][e]}function tC(s,e){return Oy[s][e]}function sC(s){return My[s]||{prefix:null,iconName:null}}var iC=Ft.styles,Ny=function(){return{prefix:null,iconName:null,rest:[]}};function jd(s){return s.reduce(function(e,t){var i=Vw(Ue.familyPrefix,t);if(iC[t])e.prefix=t;else if(i){var r=e.prefix==="fa"?sC(i):{};e.iconName=r.iconName||i,e.prefix=r.prefix||e.prefix}else t!==Ue.replacementClass&&t.indexOf("fa-w-")!==0&&e.rest.push(t);return e},Ny())}function _m(s,e,t){if(s&&s[e]&&s[e][t])return{prefix:e,iconName:t,icon:s[e][t]}}function fl(s){var e=s.tag,t=s.attributes,i=t===void 0?{}:t,r=s.children,n=r===void 0?[]:r;return typeof s=="string"?Ly(s):"<"+e+" "+Kw(i)+">"+n.map(fl).join("")+"</"+e+">"}var rC=function(){};function xm(s){var e=s.getAttribute?s.getAttribute(on):null;return typeof e=="string"}function nC(){if(Ue.autoReplaceSvg===!0)return Ao.replace;var s=Ao[Ue.autoReplaceSvg];return s||Ao.replace}var Ao={replace:function(e){var t=e[0],i=e[1],r=i.map(function(a){return fl(a)}).join(`
|
|
13
|
+
`);if(t.parentNode&&t.outerHTML)t.outerHTML=r+(Ue.keepOriginalSource&&t.tagName.toLowerCase()!=="svg"?"<!-- "+t.outerHTML+" -->":"");else if(t.parentNode){var n=document.createElement("span");t.parentNode.replaceChild(n,t),n.outerHTML=r}},nest:function(e){var t=e[0],i=e[1];if(~Ud(t).indexOf(Ue.replacementClass))return Ao.replace(e);var r=new RegExp(Ue.familyPrefix+"-.*");delete i[0].attributes.style;var n=i[0].attributes.class.split(" ").reduce(function(o,l){return l===Ue.replacementClass||l.match(r)?o.toSvg.push(l):o.toNode.push(l),o},{toNode:[],toSvg:[]});i[0].attributes.class=n.toSvg.join(" ");var a=i.map(function(o){return fl(o)}).join(`
|
|
14
|
+
`);t.setAttribute("class",n.toNode.join(" ")),t.setAttribute(on,""),t.innerHTML=a}};function Fy(s,e){var t=typeof e=="function"?e:rC;if(s.length===0)t();else{var i=qi.requestAnimationFrame||function(r){return r()};i(function(){var r=nC(),n=Yd.begin("mutate");s.map(r),n(),t()})}}var Ef=!1;function aC(s){Ef=!0,s(),Ef=!1}var dl=null;function oC(s){if(vm){var e=s.treeCallback,t=s.nodeCallback,i=s.pseudoElementsCallback;dl=new vm(function(r){Ef||ln(r).forEach(function(n){if(n.type==="childList"&&n.addedNodes.length>0&&!xm(n.addedNodes[0])&&(Ue.searchPseudoElements&&i(n.target),e(n.target)),n.type==="attributes"&&n.target.parentNode&&Ue.searchPseudoElements&&i(n.target.parentNode),n.type==="attributes"&&xm(n.target)&&~Mw.indexOf(n.attributeName))if(n.attributeName==="class"){var a=jd(Ud(n.target)),o=a.prefix,l=a.iconName;o&&n.target.setAttribute("data-prefix",o),l&&n.target.setAttribute("data-icon",l)}else t(n.target)})}),si&&dl.observe(Ct.getElementsByTagName("body")[0],{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function lC(){dl&&dl.disconnect()}var cC=function(s){var e=s.getAttribute("style"),t=[];return e&&(t=e.split(";").reduce(function(i,r){var n=r.split(":"),a=n[0],o=n.slice(1);return a&&o.length>0&&(i[a]=o.join(":").trim()),i},{})),t};function uC(s){for(var e="",t=0;t<s.length;t++){var i=s.charCodeAt(t).toString(16);e+=("000"+i).slice(-4)}return e}var fC=function(s){var e=s.getAttribute("data-prefix"),t=s.getAttribute("data-icon"),i=s.innerText!==void 0?s.innerText.trim():"",r=jd(Ud(s));return e&&t&&(r.prefix=e,r.iconName=t),r.prefix&&i.length>1?r.iconName=tC(r.prefix,s.innerText):r.prefix&&i.length===1&&(r.iconName=eC(r.prefix,uC(s.innerText))),r},$y=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce(function(i,r){var n=r.toLowerCase().split("-"),a=n[0],o=n.slice(1).join("-");if(a&&o==="h")return i.flipX=!0,i;if(a&&o==="v")return i.flipY=!0,i;if(o=parseFloat(o),isNaN(o))return i;switch(a){case"grow":i.size=i.size+o;break;case"shrink":i.size=i.size-o;break;case"left":i.x=i.x-o;break;case"right":i.x=i.x+o;break;case"up":i.y=i.y-o;break;case"down":i.y=i.y+o;break;case"rotate":i.rotate=i.rotate+o;break}return i},t):t},dC=function(s){return $y(s.getAttribute("data-fa-transform"))},hC=function(s){var e=s.getAttribute("data-fa-symbol");return e===null?!1:e===""?!0:e},pC=function(s){var e=ln(s.attributes).reduce(function(i,r){return i.name!=="class"&&i.name!=="style"&&(i[r.name]=r.value),i},{}),t=s.getAttribute("title");return Ue.autoA11y&&(t?e["aria-labelledby"]=Ue.replacementClass+"-title-"+aa():e["aria-hidden"]="true"),e},mC=function(s){var e=s.getAttribute("data-fa-mask");return e?jd(e.split(" ").map(function(t){return t.trim()})):Ny()};function gC(s){var e=fC(s),t=e.iconName,i=e.prefix,r=e.rest,n=cC(s),a=dC(s),o=hC(s),l=pC(s),c=mC(s);return{iconName:t,title:s.getAttribute("title"),prefix:i,transform:a,symbol:o,mask:c,extra:{classes:r,styles:n,attributes:l}}}function oa(s){this.name="MissingIcon",this.message=s||"Icon unavailable",this.stack=new Error().stack}oa.prototype=Object.create(Error.prototype);oa.prototype.constructor=oa;var Zl={fill:"currentColor"},By={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},vC={tag:"path",attributes:Fe({},Zl,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},Vd=Fe({},By,{attributeName:"opacity"}),yC={tag:"circle",attributes:Fe({},Zl,{cx:"256",cy:"364",r:"28"}),children:[{tag:"animate",attributes:Fe({},By,{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Fe({},Vd,{values:"1;0;1;1;0;1;"})}]},bC={tag:"path",attributes:Fe({},Zl,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:[{tag:"animate",attributes:Fe({},Vd,{values:"1;0;0;0;0;1;"})}]},SC={tag:"path",attributes:Fe({},Zl,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Fe({},Vd,{values:"0;0;1;1;0;0;"})}]},EC={tag:"g",children:[vC,yC,bC,SC]},To=Ft.styles,Uy="fa-layers-text",_C=/Font Awesome 5 (Solid|Regular|Light|Brands)/,xC={Solid:"fas",Regular:"far",Light:"fal",Brands:"fab"};function Am(s,e){var t={found:!1,width:512,height:512,icon:EC};if(s&&e&&To[e]&&To[e][s]){var i=To[e][s],r=i[0],n=i[1],a=i.slice(4);t={found:!0,width:r,height:n,icon:{tag:"path",attributes:{fill:"currentColor",d:a[0]}}}}else if(s&&e&&!Ue.showMissingIcons)throw new oa("Icon is missing for prefix "+e+" with icon name "+s);return t}function AC(s,e){var t=e.iconName,i=e.title,r=e.prefix,n=e.transform,a=e.symbol,o=e.mask,l=e.extra;return[s,Ry({icons:{main:Am(t,r),mask:Am(o.iconName,o.prefix)},prefix:r,iconName:t,transform:n,symbol:a,title:i,extra:l,watchable:!0})]}function TC(s,e){var t=e.title,i=e.transform,r=e.extra,n=null,a=null;if(yy){var o=parseInt(getComputedStyle(s).fontSize,10),l=s.getBoundingClientRect();n=l.width/o,a=l.height/o}return Ue.autoA11y&&!t&&(r.attributes["aria-hidden"]="true"),[s,Dy({content:s.innerHTML,width:n,height:a,transform:i,title:t,extra:r,watchable:!0})]}function Gy(s){var e=gC(s);return~e.extra.classes.indexOf(Uy)?TC(s,e):AC(s,e)}function Tm(s){typeof s.remove=="function"?s.remove():s&&s.parentNode&&s.parentNode.removeChild(s)}function Hy(s){if(si){var e=Yd.begin("searchPseudoElements");aC(function(){ln(s.querySelectorAll("*")).forEach(function(t){[":before",":after"].forEach(function(i){var r=qi.getComputedStyle(t,i),n=r.getPropertyValue("font-family").match(_C),a=ln(t.children),o=a.filter(function(u){return u.getAttribute(Kc)===i})[0];if(o&&(o.nextSibling&&o.nextSibling.textContent.indexOf(Kc)>-1&&Tm(o.nextSibling),Tm(o),o=null),n&&!o){var l=r.getPropertyValue("content"),c=Ct.createElement("i");c.setAttribute("class",""+xC[n[1]]),c.setAttribute(Kc,i),c.innerText=l.length===3?l.substr(1,1):l,i===":before"?t.insertBefore(c,t.firstChild):t.appendChild(c)}})})}),e()}}function Yy(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(si){var t=Ct.documentElement.classList,i=function(f){return t.add(ym+"-"+f)},r=function(f){return t.remove(ym+"-"+f)},n=Object.keys(To),a=["."+Uy+":not(["+on+"])"].concat(n.map(function(u){return"."+u+":not(["+on+"])"})).join(", ");if(a.length!==0){var o=ln(s.querySelectorAll(a));if(o.length>0)i("pending"),r("complete");else return;var l=Yd.begin("onTree"),c=o.reduce(function(u,f){try{var d=Gy(f);d&&u.push(d)}catch(h){Ey||h instanceof oa&&console.error(h)}return u},[]);l(),Fy(c,function(){i("active"),i("complete"),r("pending"),typeof e=="function"&&e()})}}}function wC(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,t=Gy(s);t&&Fy([t],e)}var CC=`svg:not(:root).svg-inline--fa {
|
|
15
|
+
overflow: visible; }
|
|
16
|
+
|
|
17
|
+
.svg-inline--fa {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
font-size: inherit;
|
|
20
|
+
height: 1em;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
vertical-align: -.125em; }
|
|
23
|
+
.svg-inline--fa.fa-lg {
|
|
24
|
+
vertical-align: -.225em; }
|
|
25
|
+
.svg-inline--fa.fa-w-1 {
|
|
26
|
+
width: 0.0625em; }
|
|
27
|
+
.svg-inline--fa.fa-w-2 {
|
|
28
|
+
width: 0.125em; }
|
|
29
|
+
.svg-inline--fa.fa-w-3 {
|
|
30
|
+
width: 0.1875em; }
|
|
31
|
+
.svg-inline--fa.fa-w-4 {
|
|
32
|
+
width: 0.25em; }
|
|
33
|
+
.svg-inline--fa.fa-w-5 {
|
|
34
|
+
width: 0.3125em; }
|
|
35
|
+
.svg-inline--fa.fa-w-6 {
|
|
36
|
+
width: 0.375em; }
|
|
37
|
+
.svg-inline--fa.fa-w-7 {
|
|
38
|
+
width: 0.4375em; }
|
|
39
|
+
.svg-inline--fa.fa-w-8 {
|
|
40
|
+
width: 0.5em; }
|
|
41
|
+
.svg-inline--fa.fa-w-9 {
|
|
42
|
+
width: 0.5625em; }
|
|
43
|
+
.svg-inline--fa.fa-w-10 {
|
|
44
|
+
width: 0.625em; }
|
|
45
|
+
.svg-inline--fa.fa-w-11 {
|
|
46
|
+
width: 0.6875em; }
|
|
47
|
+
.svg-inline--fa.fa-w-12 {
|
|
48
|
+
width: 0.75em; }
|
|
49
|
+
.svg-inline--fa.fa-w-13 {
|
|
50
|
+
width: 0.8125em; }
|
|
51
|
+
.svg-inline--fa.fa-w-14 {
|
|
52
|
+
width: 0.875em; }
|
|
53
|
+
.svg-inline--fa.fa-w-15 {
|
|
54
|
+
width: 0.9375em; }
|
|
55
|
+
.svg-inline--fa.fa-w-16 {
|
|
56
|
+
width: 1em; }
|
|
57
|
+
.svg-inline--fa.fa-w-17 {
|
|
58
|
+
width: 1.0625em; }
|
|
59
|
+
.svg-inline--fa.fa-w-18 {
|
|
60
|
+
width: 1.125em; }
|
|
61
|
+
.svg-inline--fa.fa-w-19 {
|
|
62
|
+
width: 1.1875em; }
|
|
63
|
+
.svg-inline--fa.fa-w-20 {
|
|
64
|
+
width: 1.25em; }
|
|
65
|
+
.svg-inline--fa.fa-pull-left {
|
|
66
|
+
margin-right: .3em;
|
|
67
|
+
width: auto; }
|
|
68
|
+
.svg-inline--fa.fa-pull-right {
|
|
69
|
+
margin-left: .3em;
|
|
70
|
+
width: auto; }
|
|
71
|
+
.svg-inline--fa.fa-border {
|
|
72
|
+
height: 1.5em; }
|
|
73
|
+
.svg-inline--fa.fa-li {
|
|
74
|
+
width: 2em; }
|
|
75
|
+
.svg-inline--fa.fa-fw {
|
|
76
|
+
width: 1.25em; }
|
|
77
|
+
|
|
78
|
+
.fa-layers svg.svg-inline--fa {
|
|
79
|
+
bottom: 0;
|
|
80
|
+
left: 0;
|
|
81
|
+
margin: auto;
|
|
82
|
+
position: absolute;
|
|
83
|
+
right: 0;
|
|
84
|
+
top: 0; }
|
|
85
|
+
|
|
86
|
+
.fa-layers {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
height: 1em;
|
|
89
|
+
position: relative;
|
|
90
|
+
text-align: center;
|
|
91
|
+
vertical-align: -.125em;
|
|
92
|
+
width: 1em; }
|
|
93
|
+
.fa-layers svg.svg-inline--fa {
|
|
94
|
+
-webkit-transform-origin: center center;
|
|
95
|
+
transform-origin: center center; }
|
|
96
|
+
|
|
97
|
+
.fa-layers-text, .fa-layers-counter {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
position: absolute;
|
|
100
|
+
text-align: center; }
|
|
101
|
+
|
|
102
|
+
.fa-layers-text {
|
|
103
|
+
left: 50%;
|
|
104
|
+
top: 50%;
|
|
105
|
+
-webkit-transform: translate(-50%, -50%);
|
|
106
|
+
transform: translate(-50%, -50%);
|
|
107
|
+
-webkit-transform-origin: center center;
|
|
108
|
+
transform-origin: center center; }
|
|
109
|
+
|
|
110
|
+
.fa-layers-counter {
|
|
111
|
+
background-color: #ff253a;
|
|
112
|
+
border-radius: 1em;
|
|
113
|
+
-webkit-box-sizing: border-box;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
color: #fff;
|
|
116
|
+
height: 1.5em;
|
|
117
|
+
line-height: 1;
|
|
118
|
+
max-width: 5em;
|
|
119
|
+
min-width: 1.5em;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
padding: .25em;
|
|
122
|
+
right: 0;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
top: 0;
|
|
125
|
+
-webkit-transform: scale(0.25);
|
|
126
|
+
transform: scale(0.25);
|
|
127
|
+
-webkit-transform-origin: top right;
|
|
128
|
+
transform-origin: top right; }
|
|
129
|
+
|
|
130
|
+
.fa-layers-bottom-right {
|
|
131
|
+
bottom: 0;
|
|
132
|
+
right: 0;
|
|
133
|
+
top: auto;
|
|
134
|
+
-webkit-transform: scale(0.25);
|
|
135
|
+
transform: scale(0.25);
|
|
136
|
+
-webkit-transform-origin: bottom right;
|
|
137
|
+
transform-origin: bottom right; }
|
|
138
|
+
|
|
139
|
+
.fa-layers-bottom-left {
|
|
140
|
+
bottom: 0;
|
|
141
|
+
left: 0;
|
|
142
|
+
right: auto;
|
|
143
|
+
top: auto;
|
|
144
|
+
-webkit-transform: scale(0.25);
|
|
145
|
+
transform: scale(0.25);
|
|
146
|
+
-webkit-transform-origin: bottom left;
|
|
147
|
+
transform-origin: bottom left; }
|
|
148
|
+
|
|
149
|
+
.fa-layers-top-right {
|
|
150
|
+
right: 0;
|
|
151
|
+
top: 0;
|
|
152
|
+
-webkit-transform: scale(0.25);
|
|
153
|
+
transform: scale(0.25);
|
|
154
|
+
-webkit-transform-origin: top right;
|
|
155
|
+
transform-origin: top right; }
|
|
156
|
+
|
|
157
|
+
.fa-layers-top-left {
|
|
158
|
+
left: 0;
|
|
159
|
+
right: auto;
|
|
160
|
+
top: 0;
|
|
161
|
+
-webkit-transform: scale(0.25);
|
|
162
|
+
transform: scale(0.25);
|
|
163
|
+
-webkit-transform-origin: top left;
|
|
164
|
+
transform-origin: top left; }
|
|
165
|
+
|
|
166
|
+
.fa-lg {
|
|
167
|
+
font-size: 1.33333em;
|
|
168
|
+
line-height: 0.75em;
|
|
169
|
+
vertical-align: -.0667em; }
|
|
170
|
+
|
|
171
|
+
.fa-xs {
|
|
172
|
+
font-size: .75em; }
|
|
173
|
+
|
|
174
|
+
.fa-sm {
|
|
175
|
+
font-size: .875em; }
|
|
176
|
+
|
|
177
|
+
.fa-1x {
|
|
178
|
+
font-size: 1em; }
|
|
179
|
+
|
|
180
|
+
.fa-2x {
|
|
181
|
+
font-size: 2em; }
|
|
182
|
+
|
|
183
|
+
.fa-3x {
|
|
184
|
+
font-size: 3em; }
|
|
185
|
+
|
|
186
|
+
.fa-4x {
|
|
187
|
+
font-size: 4em; }
|
|
188
|
+
|
|
189
|
+
.fa-5x {
|
|
190
|
+
font-size: 5em; }
|
|
191
|
+
|
|
192
|
+
.fa-6x {
|
|
193
|
+
font-size: 6em; }
|
|
194
|
+
|
|
195
|
+
.fa-7x {
|
|
196
|
+
font-size: 7em; }
|
|
197
|
+
|
|
198
|
+
.fa-8x {
|
|
199
|
+
font-size: 8em; }
|
|
200
|
+
|
|
201
|
+
.fa-9x {
|
|
202
|
+
font-size: 9em; }
|
|
203
|
+
|
|
204
|
+
.fa-10x {
|
|
205
|
+
font-size: 10em; }
|
|
206
|
+
|
|
207
|
+
.fa-fw {
|
|
208
|
+
text-align: center;
|
|
209
|
+
width: 1.25em; }
|
|
210
|
+
|
|
211
|
+
.fa-ul {
|
|
212
|
+
list-style-type: none;
|
|
213
|
+
margin-left: 2.5em;
|
|
214
|
+
padding-left: 0; }
|
|
215
|
+
.fa-ul > li {
|
|
216
|
+
position: relative; }
|
|
217
|
+
|
|
218
|
+
.fa-li {
|
|
219
|
+
left: -2em;
|
|
220
|
+
position: absolute;
|
|
221
|
+
text-align: center;
|
|
222
|
+
width: 2em;
|
|
223
|
+
line-height: inherit; }
|
|
224
|
+
|
|
225
|
+
.fa-border {
|
|
226
|
+
border: solid 0.08em #eee;
|
|
227
|
+
border-radius: .1em;
|
|
228
|
+
padding: .2em .25em .15em; }
|
|
229
|
+
|
|
230
|
+
.fa-pull-left {
|
|
231
|
+
float: left; }
|
|
232
|
+
|
|
233
|
+
.fa-pull-right {
|
|
234
|
+
float: right; }
|
|
235
|
+
|
|
236
|
+
.fa.fa-pull-left,
|
|
237
|
+
.fas.fa-pull-left,
|
|
238
|
+
.far.fa-pull-left,
|
|
239
|
+
.fal.fa-pull-left,
|
|
240
|
+
.fab.fa-pull-left {
|
|
241
|
+
margin-right: .3em; }
|
|
242
|
+
|
|
243
|
+
.fa.fa-pull-right,
|
|
244
|
+
.fas.fa-pull-right,
|
|
245
|
+
.far.fa-pull-right,
|
|
246
|
+
.fal.fa-pull-right,
|
|
247
|
+
.fab.fa-pull-right {
|
|
248
|
+
margin-left: .3em; }
|
|
249
|
+
|
|
250
|
+
.fa-spin {
|
|
251
|
+
-webkit-animation: fa-spin 2s infinite linear;
|
|
252
|
+
animation: fa-spin 2s infinite linear; }
|
|
253
|
+
|
|
254
|
+
.fa-pulse {
|
|
255
|
+
-webkit-animation: fa-spin 1s infinite steps(8);
|
|
256
|
+
animation: fa-spin 1s infinite steps(8); }
|
|
257
|
+
|
|
258
|
+
@-webkit-keyframes fa-spin {
|
|
259
|
+
0% {
|
|
260
|
+
-webkit-transform: rotate(0deg);
|
|
261
|
+
transform: rotate(0deg); }
|
|
262
|
+
100% {
|
|
263
|
+
-webkit-transform: rotate(360deg);
|
|
264
|
+
transform: rotate(360deg); } }
|
|
265
|
+
|
|
266
|
+
@keyframes fa-spin {
|
|
267
|
+
0% {
|
|
268
|
+
-webkit-transform: rotate(0deg);
|
|
269
|
+
transform: rotate(0deg); }
|
|
270
|
+
100% {
|
|
271
|
+
-webkit-transform: rotate(360deg);
|
|
272
|
+
transform: rotate(360deg); } }
|
|
273
|
+
|
|
274
|
+
.fa-rotate-90 {
|
|
275
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
|
|
276
|
+
-webkit-transform: rotate(90deg);
|
|
277
|
+
transform: rotate(90deg); }
|
|
278
|
+
|
|
279
|
+
.fa-rotate-180 {
|
|
280
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
|
|
281
|
+
-webkit-transform: rotate(180deg);
|
|
282
|
+
transform: rotate(180deg); }
|
|
283
|
+
|
|
284
|
+
.fa-rotate-270 {
|
|
285
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
|
|
286
|
+
-webkit-transform: rotate(270deg);
|
|
287
|
+
transform: rotate(270deg); }
|
|
288
|
+
|
|
289
|
+
.fa-flip-horizontal {
|
|
290
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
|
|
291
|
+
-webkit-transform: scale(-1, 1);
|
|
292
|
+
transform: scale(-1, 1); }
|
|
293
|
+
|
|
294
|
+
.fa-flip-vertical {
|
|
295
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
|
|
296
|
+
-webkit-transform: scale(1, -1);
|
|
297
|
+
transform: scale(1, -1); }
|
|
298
|
+
|
|
299
|
+
.fa-flip-horizontal.fa-flip-vertical {
|
|
300
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
|
|
301
|
+
-webkit-transform: scale(-1, -1);
|
|
302
|
+
transform: scale(-1, -1); }
|
|
303
|
+
|
|
304
|
+
:root .fa-rotate-90,
|
|
305
|
+
:root .fa-rotate-180,
|
|
306
|
+
:root .fa-rotate-270,
|
|
307
|
+
:root .fa-flip-horizontal,
|
|
308
|
+
:root .fa-flip-vertical {
|
|
309
|
+
-webkit-filter: none;
|
|
310
|
+
filter: none; }
|
|
311
|
+
|
|
312
|
+
.fa-stack {
|
|
313
|
+
display: inline-block;
|
|
314
|
+
height: 2em;
|
|
315
|
+
position: relative;
|
|
316
|
+
width: 2em; }
|
|
317
|
+
|
|
318
|
+
.fa-stack-1x,
|
|
319
|
+
.fa-stack-2x {
|
|
320
|
+
bottom: 0;
|
|
321
|
+
left: 0;
|
|
322
|
+
margin: auto;
|
|
323
|
+
position: absolute;
|
|
324
|
+
right: 0;
|
|
325
|
+
top: 0; }
|
|
326
|
+
|
|
327
|
+
.svg-inline--fa.fa-stack-1x {
|
|
328
|
+
height: 1em;
|
|
329
|
+
width: 1em; }
|
|
330
|
+
|
|
331
|
+
.svg-inline--fa.fa-stack-2x {
|
|
332
|
+
height: 2em;
|
|
333
|
+
width: 2em; }
|
|
334
|
+
|
|
335
|
+
.fa-inverse {
|
|
336
|
+
color: #fff; }
|
|
337
|
+
|
|
338
|
+
.sr-only {
|
|
339
|
+
border: 0;
|
|
340
|
+
clip: rect(0, 0, 0, 0);
|
|
341
|
+
height: 1px;
|
|
342
|
+
margin: -1px;
|
|
343
|
+
overflow: hidden;
|
|
344
|
+
padding: 0;
|
|
345
|
+
position: absolute;
|
|
346
|
+
width: 1px; }
|
|
347
|
+
|
|
348
|
+
.sr-only-focusable:active, .sr-only-focusable:focus {
|
|
349
|
+
clip: auto;
|
|
350
|
+
height: auto;
|
|
351
|
+
margin: 0;
|
|
352
|
+
overflow: visible;
|
|
353
|
+
position: static;
|
|
354
|
+
width: auto; }
|
|
355
|
+
`,_f=function(){var s=by,e=Sy,t=Ue.familyPrefix,i=Ue.replacementClass,r=CC;if(t!==s||i!==e){var n=new RegExp("\\."+s+"\\-","g"),a=new RegExp("\\."+e,"g");r=r.replace(n,"."+t+"-").replace(a,"."+i)}return r};function jy(s,e){var t=Object.keys(e).reduce(function(i,r){var n=e[r],a=!!n.icon;return a?i[n.iconName]=n.icon:i[r]=n,i},{});typeof Ft.hooks.addPack=="function"?Ft.hooks.addPack(s,t):Ft.styles[s]=Fe({},Ft.styles[s]||{},t),s==="fas"&&jy("fa",e)}var LC=function(){function s(){Fw(this,s),this.definitions={}}return $w(s,[{key:"add",value:function(){for(var t=this,i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];var a=r.reduce(this._pullDefinitions,{});Object.keys(a).forEach(function(o){t.definitions[o]=Fe({},t.definitions[o]||{},a[o]),jy(o,a[o])})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(t,i){var r=i.prefix&&i.iconName&&i.icon?{0:i}:i;return Object.keys(r).map(function(n){var a=r[n],o=a.prefix,l=a.iconName,c=a.icon;t[o]||(t[o]={}),t[o][l]=c}),t}}]),s}();function wm(s){var e=s[0],t=s[1],i=s.slice(4);return{found:!0,width:e,height:t,icon:{tag:"path",attributes:{fill:"currentColor",d:i[0]}}}}var Cm=!1;function ec(){Ue.autoAddCss&&(Cm||Cy(_f()),Cm=!0)}function Kd(s,e){return Object.defineProperty(s,"abstract",{get:e}),Object.defineProperty(s,"html",{get:function(){return s.abstract.map(function(i){return fl(i)})}}),Object.defineProperty(s,"node",{get:function(){if(si){var i=Ct.createElement("div");return i.innerHTML=s.html,i.children}}}),s}function hl(s){var e=s.prefix,t=e===void 0?"fa":e,i=s.iconName;if(i)return _m(Wd.definitions,t,i)||_m(Ft.styles,t,i)}function IC(s){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:hl(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:hl(r||{})),s(i,Fe({},t,{mask:r}))}}var Wd=new LC,Vy=function(){Uw(!1),lC()},Ky={i2svg:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(si){ec();var t=e.node,i=t===void 0?Ct:t,r=e.callback,n=r===void 0?function(){}:r;Ue.searchPseudoElements&&Hy(i),Yy(i,n)}},css:_f,insertCss:function(){Cy(_f())}},Wy={transform:function(e){return $y(e)}},zy=IC(function(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,i=t===void 0?$i:t,r=e.symbol,n=r===void 0?!1:r,a=e.mask,o=a===void 0?null:a,l=e.title,c=l===void 0?null:l,u=e.classes,f=u===void 0?[]:u,d=e.attributes,h=d===void 0?{}:d,p=e.styles,g=p===void 0?{}:p;if(s){var m=s.prefix,v=s.iconName,y=s.icon;return Kd(Fe({type:"icon"},s),function(){return ec(),Ue.autoA11y&&(c?h["aria-labelledby"]=Ue.replacementClass+"-title-"+aa():h["aria-hidden"]="true"),Ry({icons:{main:wm(y),mask:o?wm(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:m,iconName:v,transform:Fe({},$i,i),symbol:n,title:c,extra:{attributes:h,styles:g,classes:f}})})}}),Qy=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.transform,r=i===void 0?$i:i,n=t.title,a=n===void 0?null:n,o=t.classes,l=o===void 0?[]:o,c=t.attributes,u=c===void 0?{}:c,f=t.styles,d=f===void 0?{}:f;return Kd({type:"text",content:e},function(){return ec(),Dy({content:e,transform:Fe({},$i,r),title:a,extra:{attributes:u,styles:d,classes:[Ue.familyPrefix+"-layers-text"].concat(xy(l))}})})},qy=function(e){return Kd({type:"layer"},function(){ec();var t=[];return e(function(i){Array.isArray(i)?i.map(function(r){t=t.concat(r.abstract)}):t=t.concat(i.abstract)}),[{tag:"span",attributes:{class:Ue.familyPrefix+"-layers"},children:t}]})},Gt={noAuto:Vy,dom:Ky,library:Wd,parse:Wy,findIconDefinition:hl,icon:zy,text:Qy,layer:qy},Qc=function(){si&&Ue.autoReplaceSvg&&Gt.dom.i2svg({node:Ct})};function RC(){Pw&&(qi.FontAwesome||(qi.FontAwesome=Gt),Hw(function(){Object.keys(Ft.styles).length>0&&Qc(),Ue.observeMutations&&typeof MutationObserver=="function"&&oC({treeCallback:Yy,nodeCallback:wC,pseudoElementsCallback:Hy})})),Ft.hooks=Fe({},Ft.hooks,{addPack:function(e,t){Ft.styles[e]=Fe({},Ft.styles[e]||{},t),Sf(),Qc()},addShims:function(e){var t;(t=Ft.shims).push.apply(t,xy(e)),Sf(),Qc()}})}Object.defineProperty(Gt,"config",{get:function(){return Ue},set:function(e){Ty(e)}});si&&jw(RC);var DC=Gt.config;const kC=Object.freeze(Object.defineProperty({__proto__:null,config:DC,default:Gt,dom:Ky,findIconDefinition:hl,icon:zy,layer:qy,library:Wd,noAuto:Vy,parse:Wy,text:Qy},Symbol.toStringTag,{value:"Module"})),PC=py(kC);(function(s,e){(function(t,i){i(e,PC)})(Vn,function(t,i){i=i&&i.hasOwnProperty("default")?i.default:i;var r=typeof window<"u"?window:typeof Vn<"u"?Vn:typeof self<"u"?self:{};function n(_,C){return C={exports:{}},_(C,C.exports),C.exports}var a=n(function(_){(function(C){var U=function(x,F,G){if(!D(F)||H(F)||N(F)||P(F)||I(F))return F;var Q,ee=0,ae=0;if(O(F))for(Q=[],ae=F.length;ee<ae;ee++)Q.push(U(x,F[ee],G));else{Q={};for(var de in F)Object.prototype.hasOwnProperty.call(F,de)&&(Q[x(de,G)]=U(x,F[de],G))}return Q},L=function(x,F){F=F||{};var G=F.separator||"_",Q=F.split||/(?=[A-Z])/;return x.split(Q).join(G)},R=function(x){return Y(x)?x:(x=x.replace(/[\-_\s]+(.)?/g,function(F,G){return G?G.toUpperCase():""}),x.substr(0,1).toLowerCase()+x.substr(1))},B=function(x){var F=R(x);return F.substr(0,1).toUpperCase()+F.substr(1)},S=function(x,F){return L(x,F).toLowerCase()},A=Object.prototype.toString,I=function(x){return typeof x=="function"},D=function(x){return x===Object(x)},O=function(x){return A.call(x)=="[object Array]"},H=function(x){return A.call(x)=="[object Date]"},N=function(x){return A.call(x)=="[object RegExp]"},P=function(x){return A.call(x)=="[object Boolean]"},Y=function(x){return x=x-0,x===x},z=function(x,F){var G=F&&"process"in F?F.process:F;return typeof G!="function"?x:function(Q,ee){return G(Q,x,ee)}},J={camelize:R,decamelize:S,pascalize:B,depascalize:S,camelizeKeys:function(x,F){return U(z(R,F),x)},decamelizeKeys:function(x,F){return U(z(S,F),x,F)},pascalizeKeys:function(x,F){return U(z(B,F),x)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};_.exports?_.exports=J:C.humps=J})(r)}),o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},l=function(_,C,U){return C in _?Object.defineProperty(_,C,{value:U,enumerable:!0,configurable:!0,writable:!0}):_[C]=U,_},c=Object.assign||function(_){for(var C=1;C<arguments.length;C++){var U=arguments[C];for(var L in U)Object.prototype.hasOwnProperty.call(U,L)&&(_[L]=U[L])}return _},u=function(_,C){var U={};for(var L in _)C.indexOf(L)>=0||Object.prototype.hasOwnProperty.call(_,L)&&(U[L]=_[L]);return U},f=function(_){if(Array.isArray(_)){for(var C=0,U=Array(_.length);C<_.length;C++)U[C]=_[C];return U}else return Array.from(_)};function d(_){return _.split(";").map(function(C){return C.trim()}).filter(function(C){return C}).reduce(function(C,U){var L=U.indexOf(":"),R=a.camelize(U.slice(0,L)),B=U.slice(L+1).trim();return C[R]=B,C},{})}function h(_){return _.split(/\s+/).reduce(function(C,U){return C[U]=!0,C},{})}function p(){for(var _=arguments.length,C=Array(_),U=0;U<_;U++)C[U]=arguments[U];return C.reduce(function(L,R){return Array.isArray(R)?L=L.concat(R):L.push(R),L},[])}function g(_,C){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},R=(C.children||[]).map(g.bind(null,_)),B=Object.keys(C.attributes||{}).reduce(function(P,Y){var z=C.attributes[Y];switch(Y){case"class":P.class=h(z);break;case"style":P.style=d(z);break;default:P.attrs[Y]=z}return P},{class:{},style:{},attrs:{}}),S=L.class,A=S===void 0?{}:S,I=L.style,D=I===void 0?{}:I,O=L.attrs,H=O===void 0?{}:O,N=u(L,["class","style","attrs"]);return typeof C=="string"?C:_(C.tag,c({class:p(B.class,A),style:c({},B.style,D),attrs:c({},B.attrs,H)},N,{props:U}),R)}var m=!1;try{m=!0}catch{}var v=function(){if(!m&&console&&typeof console.error=="function"){var _;(_=console).error.apply(_,arguments)}};function y(_,C){return Array.isArray(C)&&C.length>0||!Array.isArray(C)&&C?l({},_,C):{}}function E(_){var C,U=(C={"fa-spin":_.spin,"fa-pulse":_.pulse,"fa-fw":_.fixedWidth,"fa-border":_.border,"fa-li":_.listItem,"fa-flip-horizontal":_.flip==="horizontal"||_.flip==="both","fa-flip-vertical":_.flip==="vertical"||_.flip==="both"},l(C,"fa-"+_.size,_.size!==null),l(C,"fa-rotate-"+_.rotation,_.rotation!==null),l(C,"fa-pull-"+_.pull,_.pull!==null),C);return Object.keys(U).map(function(L){return U[L]?L:null}).filter(function(L){return L})}function w(_,C){var U=(_||"").length===0?[]:[_];return U.concat(C).join(" ")}function T(_){if(_===null)return null;if((typeof _>"u"?"undefined":o(_))==="object"&&_.prefix&&_.iconName)return _;if(Array.isArray(_)&&_.length===2)return{prefix:_[0],iconName:_[1]};if(typeof _=="string")return{prefix:"fas",iconName:_}}var $={name:"FontAwesomeIcon",functional:!0,props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:String,default:null,validator:function(C){return["horizontal","vertical","both"].indexOf(C)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(C){return["right","left"].indexOf(C)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:Number,default:null,validator:function(C){return[90,180,270].indexOf(C)>-1}},size:{type:String,default:null,validator:function(C){return["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(C)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1}},render:function(C,U){var L=U.props,R=L.icon,B=L.mask,S=L.symbol,A=T(R),I=y("classes",E(L)),D=y("transform",typeof L.transform=="string"?i.parse.transform(L.transform):L.transform),O=y("mask",T(B)),H=i.icon(A,c({},I,D,O,{symbol:S}));if(!H)return v("Could not find one or more icon(s)",A,O);var N=H.abstract,P=g.bind(null,C);return P(N[0],{},U.data)}},k={name:"FontAwesomeLayers",functional:!0,props:{fixedWidth:{type:Boolean,default:!1}},render:function(C,U){var L=i.config.familyPrefix,R=U.data.staticClass,B=[L+"-layers"].concat(f(U.props.fixedWidth?[L+"-fw"]:[]));return C("div",c({},U.data,{staticClass:w(R,B)}),U.children)}},M={name:"FontAwesomeLayersText",functional:!0,props:{value:{type:String,default:""},transform:{type:[String,Object],default:null}},render:function(C,U){var L=U.props,R=y("transform",typeof L.transform=="string"?i.parse.transform(L.transform):L.transform),B=i.text(L.value,c({},R)),S=B.abstract,A=g.bind(null,C);return A(S[0],{},U.data)}};i.noAuto(),t.default=$,t.FontAwesomeIcon=$,t.FontAwesomeLayers=k,t.FontAwesomeLayersText=M,Object.defineProperty(t,"__esModule",{value:!0})})})(gf,gf.exports);var OC=gf.exports;const Jt=Oe(OC);var MC={prefix:"fas",iconName:"cog",icon:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"]};const Xy=Oe(MC);var NC={prefix:"fas",iconName:"search",icon:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"]};const FC=Oe(NC);var $C={prefix:"fas",iconName:"sign-out-alt",icon:[512,512,[],"f2f5","M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"]};const BC=Oe($C);var UC={prefix:"fas",iconName:"broadcast-tower",icon:[640,512,[],"f519","M150.94 192h33.73c11.01 0 18.61-10.83 14.86-21.18-4.93-13.58-7.55-27.98-7.55-42.82s2.62-29.24 7.55-42.82C203.29 74.83 195.68 64 184.67 64h-33.73c-7.01 0-13.46 4.49-15.41 11.23C130.64 92.21 128 109.88 128 128c0 18.12 2.64 35.79 7.54 52.76 1.94 6.74 8.39 11.24 15.4 11.24zM89.92 23.34C95.56 12.72 87.97 0 75.96 0H40.63c-6.27 0-12.14 3.59-14.74 9.31C9.4 45.54 0 85.65 0 128c0 24.75 3.12 68.33 26.69 118.86 2.62 5.63 8.42 9.14 14.61 9.14h34.84c12.02 0 19.61-12.74 13.95-23.37-49.78-93.32-16.71-178.15-.17-209.29zM614.06 9.29C611.46 3.58 605.6 0 599.33 0h-35.42c-11.98 0-19.66 12.66-14.02 23.25 18.27 34.29 48.42 119.42.28 209.23-5.72 10.68 1.8 23.52 13.91 23.52h35.23c6.27 0 12.13-3.58 14.73-9.29C630.57 210.48 640 170.36 640 128s-9.42-82.48-25.94-118.71zM489.06 64h-33.73c-11.01 0-18.61 10.83-14.86 21.18 4.93 13.58 7.55 27.98 7.55 42.82s-2.62 29.24-7.55 42.82c-3.76 10.35 3.85 21.18 14.86 21.18h33.73c7.02 0 13.46-4.49 15.41-11.24 4.9-16.97 7.53-34.64 7.53-52.76 0-18.12-2.64-35.79-7.54-52.76-1.94-6.75-8.39-11.24-15.4-11.24zm-116.3 100.12c7.05-10.29 11.2-22.71 11.2-36.12 0-35.35-28.63-64-63.96-64-35.32 0-63.96 28.65-63.96 64 0 13.41 4.15 25.83 11.2 36.12l-130.5 313.41c-3.4 8.15.46 17.52 8.61 20.92l29.51 12.31c8.15 3.4 17.52-.46 20.91-8.61L244.96 384h150.07l49.2 118.15c3.4 8.16 12.76 12.01 20.91 8.61l29.51-12.31c8.15-3.4 12-12.77 8.61-20.92l-130.5-313.41zM271.62 320L320 203.81 368.38 320h-96.76z"]};const GC=Oe(UC);function ve(s,e,t,i,r,n,a,o){var l=typeof s=="function"?s.options:s;return e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),n&&(l._scopeId="data-v-"+n),{exports:s,options:l}}const HC={name:"NavBar",components:{FontAwesomeIcon:Jt},data(){return{searchText:""}},computed:{iconSettings(){return Xy},iconLogout(){return BC},iconSearch(){return FC},iconRemote(){return GC},...xt(["host"])},methods:{search:function(s){this.$router.push({name:"Search",params:{search:this.searchText}})},changeRemote:function(s){s.preventDefault(),this.$modal.show("ChangeRemoteDialog")},logout:function(s){this.$socket.disconnect(),this.$store.dispatch("logout")}}};var YC=function(){var e=this,t=e._self._c;return t("nav",{staticClass:"nav-bar"},[t("div",{staticClass:"container"},[t("div",{staticClass:"nav-left"},[t("div",{staticClass:"brand"},[t("router-link",{staticClass:"brand-link",attrs:{to:{name:"Main"}}},[t("img",{attrs:{src:e.host+"/web/logo.png",alt:""}})])],1),t("div",{staticClass:"links"},[t("router-link",{staticClass:"nav-link",attrs:{to:{name:"Series"}}},[e._v(" Series ")]),t("router-link",{staticClass:"nav-link",attrs:{to:{name:"Movies"}}},[e._v(" Movies ")])],1)]),t("div",{staticClass:"search"},[t("form",{staticClass:"search",attrs:{id:"search-form",action:""},on:{submit:function(i){return i.preventDefault(),e.search.apply(null,arguments)}}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"input-text",attrs:{id:"search-input",type:"text"},domProps:{value:e.searchText},on:{input:function(i){i.target.composing||(e.searchText=i.target.value)}}}),t("button",{attrs:{type:"submit"}},[t("FontAwesomeIcon",{attrs:{icon:e.iconSearch}})],1)])]),t("div",{staticClass:"nav-right"},[t("router-link",{staticClass:"nav-link",attrs:{to:{name:"SettingsHome"}}},[t("FontAwesomeIcon",{attrs:{icon:e.iconSettings}})],1),t("a",{staticClass:"nav-link",on:{click:e.changeRemote}},[t("FontAwesomeIcon",{attrs:{icon:e.iconRemote}})],1),t("a",{staticClass:"nav-link",on:{click:e.logout}},[t("FontAwesomeIcon",{attrs:{icon:e.iconLogout}})],1)],1)])])},jC=[],VC=ve(HC,YC,jC,!1,null,"a7dcf1cb");const KC=VC.exports,Xs=Object.create(null);Xs.open="0";Xs.close="1";Xs.ping="2";Xs.pong="3";Xs.message="4";Xs.upgrade="5";Xs.noop="6";const wo=Object.create(null);Object.keys(Xs).forEach(s=>{wo[Xs[s]]=s});const xf={type:"error",data:"parser error"},Jy=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Zy=typeof ArrayBuffer=="function",eb=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,zd=({type:s,data:e},t,i)=>Jy&&e instanceof Blob?t?i(e):Lm(e,i):Zy&&(e instanceof ArrayBuffer||eb(e))?t?i(e):Lm(new Blob([e]),i):i(Xs[s]+(e||"")),Lm=(s,e)=>{const t=new FileReader;return t.onload=function(){const i=t.result.split(",")[1];e("b"+(i||""))},t.readAsDataURL(s)};function Im(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let qc;function WC(s,e){if(Jy&&s.data instanceof Blob)return s.data.arrayBuffer().then(Im).then(e);if(Zy&&(s.data instanceof ArrayBuffer||eb(s.data)))return e(Im(s.data));zd(s,!1,t=>{qc||(qc=new TextEncoder),e(qc.encode(t))})}const Rm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Rm.length;s++)Gn[Rm.charCodeAt(s)]=s;const zC=s=>{let e=s.length*.75,t=s.length,i,r=0,n,a,o,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(i=0;i<t;i+=4)n=Gn[s.charCodeAt(i)],a=Gn[s.charCodeAt(i+1)],o=Gn[s.charCodeAt(i+2)],l=Gn[s.charCodeAt(i+3)],u[r++]=n<<2|a>>4,u[r++]=(a&15)<<4|o>>2,u[r++]=(o&3)<<6|l&63;return c},QC=typeof ArrayBuffer=="function",Qd=(s,e)=>{if(typeof s!="string")return{type:"message",data:tb(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:qC(s.substring(1),e)}:wo[t]?s.length>1?{type:wo[t],data:s.substring(1)}:{type:wo[t]}:xf},qC=(s,e)=>{if(QC){const t=zC(s);return tb(t,e)}else return{base64:!0,data:s}},tb=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},sb="",XC=(s,e)=>{const t=s.length,i=new Array(t);let r=0;s.forEach((n,a)=>{zd(n,!1,o=>{i[a]=o,++r===t&&e(i.join(sb))})})},JC=(s,e)=>{const t=s.split(sb),i=[];for(let r=0;r<t.length;r++){const n=Qd(t[r],e);if(i.push(n),n.type==="error")break}return i};function ZC(){return new TransformStream({transform(s,e){WC(s,t=>{const i=t.length;let r;if(i<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,i);else if(i<65536){r=new Uint8Array(3);const n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,i)}else{r=new Uint8Array(9);const n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(i))}s.data&&typeof s.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}let Xc;function qa(s){return s.reduce((e,t)=>e+t.length,0)}function Xa(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let i=0;for(let r=0;r<e;r++)t[r]=s[0][i++],i===s[0].length&&(s.shift(),i=0);return s.length&&i<s[0].length&&(s[0]=s[0].slice(i)),t}function eL(s,e){Xc||(Xc=new TextDecoder);const t=[];let i=0,r=-1,n=!1;return new TransformStream({transform(a,o){for(t.push(a);;){if(i===0){if(qa(t)<1)break;const l=Xa(t,1);n=(l[0]&128)===128,r=l[0]&127,r<126?i=3:r===126?i=1:i=2}else if(i===1){if(qa(t)<2)break;const l=Xa(t,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),i=3}else if(i===2){if(qa(t)<8)break;const l=Xa(t,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){o.enqueue(xf);break}r=u*Math.pow(2,32)+c.getUint32(4),i=3}else{if(qa(t)<r)break;const l=Xa(t,r);o.enqueue(Qd(n?l:Xc.decode(l),e)),i=0}if(r===0||r>s){o.enqueue(xf);break}}}})}const ib=4;function mt(s){if(s)return tL(s)}function tL(s){for(var e in mt.prototype)s[e]=mt.prototype[e];return s}mt.prototype.on=mt.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};mt.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var i,r=0;r<t.length;r++)if(i=t[r],i===e||i.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+s],this};mt.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,r=t.length;i<r;++i)t[i].apply(this,e)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};mt.prototype.hasListeners=function(s){return!!this.listeners(s).length};const tc=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ms=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),sL="arraybuffer";function rb(s,...e){return e.reduce((t,i)=>(s.hasOwnProperty(i)&&(t[i]=s[i]),t),{})}const iL=ms.setTimeout,rL=ms.clearTimeout;function sc(s,e){e.useNativeTimers?(s.setTimeoutFn=iL.bind(ms),s.clearTimeoutFn=rL.bind(ms)):(s.setTimeoutFn=ms.setTimeout.bind(ms),s.clearTimeoutFn=ms.clearTimeout.bind(ms))}const nL=1.33;function aL(s){return typeof s=="string"?oL(s):Math.ceil((s.byteLength||s.size)*nL)}function oL(s){let e=0,t=0;for(let i=0,r=s.length;i<r;i++)e=s.charCodeAt(i),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(i++,t+=4);return t}function nb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function lL(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function cL(s){let e={},t=s.split("&");for(let i=0,r=t.length;i<r;i++){let n=t[i].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}class uL extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}}class qd extends mt{constructor(e){super(),this.writable=!1,sc(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,i){return super.emitReserved("error",new uL(e,t,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Qd(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=lL(e);return t.length?"?"+t:""}}class fL extends qd{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};JC(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,XC(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=nb()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ab=!1;try{ab=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dL=ab;function hL(){}class pL extends fL{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let i=location.port;i||(i=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}}doWrite(e,t){const i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}}let Xr=class Co extends mt{constructor(e,t,i){super(),this.createRequest=e,sc(this,i),this._opts=i,this._method=i.method||"GET",this._uri=t,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var e;const t=rb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const i=this._xhr=this.createRequest(t);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&i.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var r;i.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=Co.requestsCount++,Co.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hL,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Co.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Xr.requestsCount=0;Xr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Dm);else if(typeof addEventListener=="function"){const s="onpagehide"in ms?"pagehide":"unload";addEventListener(s,Dm,!1)}}function Dm(){for(let s in Xr.requests)Xr.requests.hasOwnProperty(s)&&Xr.requests[s].abort()}const mL=function(){const s=ob({xdomain:!1});return s&&s.responseType!==null}();class gL extends pL{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=mL&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Xr(ob,this.uri(),e)}}function ob(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||dL))return new XMLHttpRequest}catch{}if(!e)try{return new ms[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lb=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vL extends qd{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,i=lb?{}:rb(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,i)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const i=e[t],r=t===e.length-1;zd(i,this.supportsBinary,n=>{try{this.doWrite(i,n)}catch{}r&&tc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=nb()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Jc=ms.WebSocket||ms.MozWebSocket;class yL extends vL{createSocket(e,t,i){return lb?new Jc(e,t,i):t?new Jc(e,t):new Jc(e)}doWrite(e,t){this.ws.send(t)}}class bL extends qd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=eL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=e.readable.pipeThrough(t).getReader(),r=ZC();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const n=()=>{i.read().then(({done:o,value:l})=>{o||(this.onPacket(l),n())}).catch(o=>{})};n();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const i=e[t],r=t===e.length-1;this._writer.write(i).then(()=>{r&&tc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const SL={websocket:yL,webtransport:bL,polling:gL},EL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,_L=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Af(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),i=s.indexOf("]");t!=-1&&i!=-1&&(s=s.substring(0,t)+s.substring(t,i).replace(/:/g,";")+s.substring(i,s.length));let r=EL.exec(s||""),n={},a=14;for(;a--;)n[_L[a]]=r[a]||"";return t!=-1&&i!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=xL(n,n.path),n.queryKey=AL(n,n.query),n}function xL(s,e){const t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function AL(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,r,n){r&&(t[r]=n)}),t}const Tf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Lo=[];Tf&&addEventListener("offline",()=>{Lo.forEach(s=>s())},!1);class Gi extends mt{constructor(e,t){if(super(),this.binaryType=sL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const i=Af(e);t.hostname=i.host,t.secure=i.protocol==="https"||i.protocol==="wss",t.port=i.port,i.query&&(t.query=i.query)}else t.host&&(t.hostname=Af(t.host).host);sc(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(i=>{const r=i.prototype.name;this.transports.push(r),this._transportsByName[r]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cL(this.opts.query)),Tf&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ib,t.transport=e,this.id&&(t.sid=this.id);const i=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Gi.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Gi.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i<this.writeBuffer.length;i++){const r=this.writeBuffer[i].data;if(r&&(t+=aL(r)),i>0&&t>this._maxPayload)return this.writeBuffer.slice(0,i);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,tc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,i){return this._sendPacket("message",e,t,i),this}send(e,t,i){return this._sendPacket("message",e,t,i),this}_sendPacket(e,t,i,r){if(typeof t=="function"&&(r=t,t=void 0),typeof i=="function"&&(r=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const n={type:e,data:t,options:i};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}_onError(e){if(Gi.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const i=Lo.indexOf(this._offlineEventListener);i!==-1&&Lo.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Gi.protocol=ib;class TL extends Gi{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),i=!1;Gi.priorWebsocketSuccess=!1;const r=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!i)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Gi.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=t.name,this.emitReserved("upgradeError",d)}}))};function n(){i||(i=!0,u(),t.close(),t=null)}const a=f=>{const d=new Error("probe error: "+f);d.transport=t.name,n(),this.emitReserved("upgradeError",d)};function o(){a("transport closed")}function l(){a("socket closed")}function c(f){t&&f.name!==t.name&&n()}const u=()=>{t.removeListener("open",r),t.removeListener("error",a),t.removeListener("close",o),this.off("close",l),this.off("upgrading",c)};t.once("open",r),t.once("error",a),t.once("close",o),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{i||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let i=0;i<e.length;i++)~this.transports.indexOf(e[i])&&t.push(e[i]);return t}}let wL=class extends TL{constructor(e,t={}){const i=typeof e=="object"?e:t;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(r=>SL[r]).filter(r=>!!r)),super(e,i)}};function CL(s,e="",t){let i=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),i=Af(s)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const n=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+e,i.href=i.protocol+"://"+n+(t&&t.port===i.port?"":":"+i.port),i}const LL=typeof ArrayBuffer=="function",IL=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,cb=Object.prototype.toString,RL=typeof Blob=="function"||typeof Blob<"u"&&cb.call(Blob)==="[object BlobConstructor]",DL=typeof File=="function"||typeof File<"u"&&cb.call(File)==="[object FileConstructor]";function Xd(s){return LL&&(s instanceof ArrayBuffer||IL(s))||RL&&s instanceof Blob||DL&&s instanceof File}function Io(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,i=s.length;t<i;t++)if(Io(s[t]))return!0;return!1}if(Xd(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Io(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&Io(s[t]))return!0;return!1}function kL(s){const e=[],t=s.data,i=s;return i.data=wf(t,e),i.attachments=e.length,{packet:i,buffers:e}}function wf(s,e){if(!s)return s;if(Xd(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let i=0;i<s.length;i++)t[i]=wf(s[i],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=wf(s[i],e));return t}return s}function PL(s,e){return s.data=Cf(s.data,e),delete s.attachments,s}function Cf(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=Cf(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=Cf(s[t],e));return s}const ub=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],OL=5;var Le;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(Le||(Le={}));class ML{constructor(e){this.replacer=e}encode(e){return(e.type===Le.EVENT||e.type===Le.ACK)&&Io(e)?this.encodeAsBinary({type:e.type===Le.EVENT?Le.BINARY_EVENT:Le.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Le.BINARY_EVENT||e.type===Le.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=kL(e),i=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(i),r}}class Jd extends mt{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const i=t.type===Le.BINARY_EVENT;i||t.type===Le.BINARY_ACK?(t.type=i?Le.EVENT:Le.ACK,this.reconstructor=new NL(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Xd(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const i={type:Number(e.charAt(0))};if(Le[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===Le.BINARY_EVENT||i.type===Le.BINARY_ACK){const n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const a=e.substring(n,t);if(a!=Number(a)||e.charAt(t)!=="-")throw new Error("Illegal attachments");i.attachments=Number(a)}if(e.charAt(t+1)==="/"){const n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););i.nsp=e.substring(n,t)}else i.nsp="/";const r=e.charAt(t+1);if(r!==""&&Number(r)==r){const n=t+1;for(;++t;){const a=e.charAt(t);if(a==null||Number(a)!=a){--t;break}if(t===e.length)break}i.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(Jd.isPayloadValid(i.type,n))i.data=n;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Le.CONNECT:return pl(t);case Le.DISCONNECT:return t===void 0;case Le.CONNECT_ERROR:return typeof t=="string"||pl(t);case Le.EVENT:case Le.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&ub.indexOf(t[0])===-1);case Le.ACK:case Le.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class NL{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=PL(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function FL(s){return typeof s=="string"}const $L=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function BL(s){return s===void 0||$L(s)}function pl(s){return Object.prototype.toString.call(s)==="[object Object]"}function UL(s,e){switch(s){case Le.CONNECT:return e===void 0||pl(e);case Le.DISCONNECT:return e===void 0;case Le.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&ub.indexOf(e[0])===-1);case Le.ACK:return Array.isArray(e);case Le.CONNECT_ERROR:return typeof e=="string"||pl(e);default:return!1}}function GL(s){return FL(s.nsp)&&BL(s.id)&&UL(s.type,s.data)}const HL=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Jd,Encoder:ML,get PacketType(){return Le},isPacketValid:GL,protocol:OL},Symbol.toStringTag,{value:"Module"}));function Ls(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const YL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class fb extends mt{constructor(e,t,i){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ls(e,"open",this.onopen.bind(this)),Ls(e,"packet",this.onpacket.bind(this)),Ls(e,"error",this.onerror.bind(this)),Ls(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var i,r,n;if(YL.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const a={type:Le.EVENT,data:t};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const u=this.ids++,f=t.pop();this._registerAckCallback(u,f),a.id=u}const o=(r=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||r===void 0?void 0:r.writable,l=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,t){var i;const r=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}const n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},r),a=(...o)=>{this.io.clearTimeoutFn(n),t.apply(this,o)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...t){return new Promise((i,r)=>{const n=(a,o)=>a?r(a):i(o);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...n)=>(this._queue[0],r!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...n)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){const i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Le.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Le.EVENT:case Le.BINARY_EVENT:this.onevent(e);break;case Le.ACK:case Le.BINARY_ACK:this.onack(e);break;case Le.DISCONNECT:this.ondisconnect();break;case Le.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const i of t)i.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let i=!1;return function(...r){i||(i=!0,t.packet({type:Le.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const i of t)i.apply(this,e.data)}}}function yn(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}yn.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=Math.floor(e*10)&1?s+t:s-t}return Math.min(s,this.max)|0};yn.prototype.reset=function(){this.attempts=0};yn.prototype.setMin=function(s){this.ms=s};yn.prototype.setMax=function(s){this.max=s};yn.prototype.setJitter=function(s){this.jitter=s};class Lf extends mt{constructor(e,t){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,sc(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new yn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||HL;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new wL(this.uri,this.opts);const t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const r=Ls(t,"open",function(){i.onopen(),e&&e()}),n=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},a=Ls(t,"error",n);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),t.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ls(e,"ping",this.onping.bind(this)),Ls(e,"data",this.ondata.bind(this)),Ls(e,"error",this.onerror.bind(this)),Ls(e,"close",this.onclose.bind(this)),Ls(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){tc(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new fb(this,e,t),this.nsps[e]=i),i}_destroy(e){const t=Object.keys(this.nsps);for(const i of t)if(this.nsps[i].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let i=0;i<t.length;i++)this.engine.write(t[i],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var i;this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const On={};function Ro(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=CL(s,e.path||"/socket.io"),i=t.source,r=t.id,n=t.path,a=On[r]&&n in On[r].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let l;return o?l=new Lf(i,e):(On[r]||(On[r]=new Lf(i,e)),l=On[r]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Ro,{Manager:Lf,Socket:fb,io:Ro,connect:Ro});var Zd={exports:{}},db=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},jL=db,bn=Object.prototype.toString;function hb(s){return bn.call(s)==="[object Array]"}function If(s){return typeof s>"u"}function VL(s){return s!==null&&!If(s)&&s.constructor!==null&&!If(s.constructor)&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function KL(s){return bn.call(s)==="[object ArrayBuffer]"}function WL(s){return typeof FormData<"u"&&s instanceof FormData}function zL(s){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&s.buffer instanceof ArrayBuffer,e}function QL(s){return typeof s=="string"}function qL(s){return typeof s=="number"}function pb(s){return s!==null&&typeof s=="object"}function XL(s){return bn.call(s)==="[object Date]"}function JL(s){return bn.call(s)==="[object File]"}function ZL(s){return bn.call(s)==="[object Blob]"}function mb(s){return bn.call(s)==="[object Function]"}function eI(s){return pb(s)&&mb(s.pipe)}function tI(s){return typeof URLSearchParams<"u"&&s instanceof URLSearchParams}function sI(s){return s.replace(/^\s*/,"").replace(/\s*$/,"")}function iI(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function ic(s,e){if(!(s===null||typeof s>"u"))if(typeof s!="object"&&(s=[s]),hb(s))for(var t=0,i=s.length;t<i;t++)e.call(null,s[t],t,s);else for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.call(null,s[r],r,s)}function gb(){var s={};function e(r,n){typeof s[n]=="object"&&typeof r=="object"?s[n]=gb(s[n],r):s[n]=r}for(var t=0,i=arguments.length;t<i;t++)ic(arguments[t],e);return s}function Rf(){var s={};function e(r,n){typeof s[n]=="object"&&typeof r=="object"?s[n]=Rf(s[n],r):typeof r=="object"?s[n]=Rf({},r):s[n]=r}for(var t=0,i=arguments.length;t<i;t++)ic(arguments[t],e);return s}function rI(s,e,t){return ic(e,function(r,n){t&&typeof r=="function"?s[n]=jL(r,t):s[n]=r}),s}var us={isArray:hb,isArrayBuffer:KL,isBuffer:VL,isFormData:WL,isArrayBufferView:zL,isString:QL,isNumber:qL,isObject:pb,isUndefined:If,isDate:XL,isFile:JL,isBlob:ZL,isFunction:mb,isStream:eI,isURLSearchParams:tI,isStandardBrowserEnv:iI,forEach:ic,merge:gb,deepMerge:Rf,extend:rI,trim:sI},Or=us;function km(s){return encodeURIComponent(s).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var vb=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(Or.isURLSearchParams(t))r=t.toString();else{var n=[];Or.forEach(t,function(l,c){l===null||typeof l>"u"||(Or.isArray(l)?c=c+"[]":l=[l],Or.forEach(l,function(f){Or.isDate(f)?f=f.toISOString():Or.isObject(f)&&(f=JSON.stringify(f)),n.push(km(c)+"="+km(f))}))}),r=n.join("&")}if(r){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e},nI=us;function rc(){this.handlers=[]}rc.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1};rc.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};rc.prototype.forEach=function(e){nI.forEach(this.handlers,function(i){i!==null&&e(i)})};var aI=rc,oI=us,lI=function(e,t,i){return oI.forEach(i,function(n){e=n(e,t)}),e},Zc,Pm;function yb(){return Pm||(Pm=1,Zc=function(e){return!!(e&&e.__CANCEL__)}),Zc}var cI=us,uI=function(e,t){cI.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})},eu,Om;function fI(){return Om||(Om=1,eu=function(e,t,i,r,n){return e.config=t,i&&(e.code=i),e.request=r,e.response=n,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}),eu}var tu,Mm;function bb(){if(Mm)return tu;Mm=1;var s=fI();return tu=function(t,i,r,n,a){var o=new Error(t);return s(o,i,r,n,a)},tu}var su,Nm;function dI(){if(Nm)return su;Nm=1;var s=bb();return su=function(t,i,r){var n=r.config.validateStatus;!n||n(r.status)?t(r):i(s("Request failed with status code "+r.status,r.config,null,r.request,r))},su}var iu,Fm;function hI(){return Fm||(Fm=1,iu=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}),iu}var ru,$m;function pI(){return $m||($m=1,ru=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),ru}var nu,Bm;function mI(){if(Bm)return nu;Bm=1;var s=hI(),e=pI();return nu=function(i,r){return i&&!s(r)?e(i,r):r},nu}var au,Um;function gI(){if(Um)return au;Um=1;var s=us,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return au=function(i){var r={},n,a,o;return i&&s.forEach(i.split(`
|
|
356
|
+
`),function(c){if(o=c.indexOf(":"),n=s.trim(c.substr(0,o)).toLowerCase(),a=s.trim(c.substr(o+1)),n){if(r[n]&&e.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([a]):r[n]=r[n]?r[n]+", "+a:a}}),r},au}var ou,Gm;function vI(){if(Gm)return ou;Gm=1;var s=us;return ou=s.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),r;function n(a){var o=a;return t&&(i.setAttribute("href",o),o=i.href),i.setAttribute("href",o),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=n(window.location.href),function(o){var l=s.isString(o)?n(o):o;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),ou}var lu,Hm;function yI(){if(Hm)return lu;Hm=1;var s=us;return lu=s.isStandardBrowserEnv()?function(){return{write:function(i,r,n,a,o,l){var c=[];c.push(i+"="+encodeURIComponent(r)),s.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),s.isString(a)&&c.push("path="+a),s.isString(o)&&c.push("domain="+o),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(i){var r=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),lu}var cu,Ym;function jm(){if(Ym)return cu;Ym=1;var s=us,e=dI(),t=vb,i=mI(),r=gI(),n=vI(),a=bb();return cu=function(l){return new Promise(function(u,f){var d=l.data,h=l.headers;s.isFormData(d)&&delete h["Content-Type"];var p=new XMLHttpRequest;if(l.auth){var g=l.auth.username||"",m=l.auth.password||"";h.Authorization="Basic "+btoa(g+":"+m)}var v=i(l.baseURL,l.url);if(p.open(l.method.toUpperCase(),t(v,l.params,l.paramsSerializer),!0),p.timeout=l.timeout,p.onreadystatechange=function(){if(!(!p||p.readyState!==4)&&!(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0))){var T="getAllResponseHeaders"in p?r(p.getAllResponseHeaders()):null,$=!l.responseType||l.responseType==="text"?p.responseText:p.response,k={data:$,status:p.status,statusText:p.statusText,headers:T,config:l,request:p};e(u,f,k),p=null}},p.onabort=function(){p&&(f(a("Request aborted",l,"ECONNABORTED",p)),p=null)},p.onerror=function(){f(a("Network Error",l,null,p)),p=null},p.ontimeout=function(){var T="timeout of "+l.timeout+"ms exceeded";l.timeoutErrorMessage&&(T=l.timeoutErrorMessage),f(a(T,l,"ECONNABORTED",p)),p=null},s.isStandardBrowserEnv()){var y=yI(),E=(l.withCredentials||n(v))&&l.xsrfCookieName?y.read(l.xsrfCookieName):void 0;E&&(h[l.xsrfHeaderName]=E)}if("setRequestHeader"in p&&s.forEach(h,function(T,$){typeof d>"u"&&$.toLowerCase()==="content-type"?delete h[$]:p.setRequestHeader($,T)}),s.isUndefined(l.withCredentials)||(p.withCredentials=!!l.withCredentials),l.responseType)try{p.responseType=l.responseType}catch(w){if(l.responseType!=="json")throw w}typeof l.onDownloadProgress=="function"&&p.addEventListener("progress",l.onDownloadProgress),typeof l.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",l.onUploadProgress),l.cancelToken&&l.cancelToken.promise.then(function(T){p&&(p.abort(),f(T),p=null)}),d===void 0&&(d=null),p.send(d)})},cu}var Kt=us,Vm=uI,bI={"Content-Type":"application/x-www-form-urlencoded"};function Km(s,e){!Kt.isUndefined(s)&&Kt.isUndefined(s["Content-Type"])&&(s["Content-Type"]=e)}function SI(){var s;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(s=jm()),s}var nc={adapter:SI(),transformRequest:[function(e,t){return Vm(t,"Accept"),Vm(t,"Content-Type"),Kt.isFormData(e)||Kt.isArrayBuffer(e)||Kt.isBuffer(e)||Kt.isStream(e)||Kt.isFile(e)||Kt.isBlob(e)?e:Kt.isArrayBufferView(e)?e.buffer:Kt.isURLSearchParams(e)?(Km(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Kt.isObject(e)?(Km(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};nc.headers={common:{Accept:"application/json, text/plain, */*"}};Kt.forEach(["delete","get","head"],function(e){nc.headers[e]={}});Kt.forEach(["post","put","patch"],function(e){nc.headers[e]=Kt.merge(bI)});var Sb=nc,Wm=us,uu=lI,EI=yb(),_I=Sb;function fu(s){s.cancelToken&&s.cancelToken.throwIfRequested()}var xI=function(e){fu(e),e.headers=e.headers||{},e.data=uu(e.data,e.headers,e.transformRequest),e.headers=Wm.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Wm.forEach(["delete","get","head","post","put","patch","common"],function(r){delete e.headers[r]});var t=e.adapter||_I.adapter;return t(e).then(function(r){return fu(e),r.data=uu(r.data,r.headers,e.transformResponse),r},function(r){return EI(r)||(fu(e),r&&r.response&&(r.response.data=uu(r.response.data,r.response.headers,e.transformResponse))),Promise.reject(r)})},Ri=us,Eb=function(e,t){t=t||{};var i={},r=["url","method","params","data"],n=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];Ri.forEach(r,function(u){typeof t[u]<"u"&&(i[u]=t[u])}),Ri.forEach(n,function(u){Ri.isObject(t[u])?i[u]=Ri.deepMerge(e[u],t[u]):typeof t[u]<"u"?i[u]=t[u]:Ri.isObject(e[u])?i[u]=Ri.deepMerge(e[u]):typeof e[u]<"u"&&(i[u]=e[u])}),Ri.forEach(a,function(u){typeof t[u]<"u"?i[u]=t[u]:typeof e[u]<"u"&&(i[u]=e[u])});var o=r.concat(n).concat(a),l=Object.keys(t).filter(function(u){return o.indexOf(u)===-1});return Ri.forEach(l,function(u){typeof t[u]<"u"?i[u]=t[u]:typeof e[u]<"u"&&(i[u]=e[u])}),i},ml=us,AI=vb,zm=aI,TI=xI,_b=Eb;function xa(s){this.defaults=s,this.interceptors={request:new zm,response:new zm}}xa.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=_b(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[TI,void 0],i=Promise.resolve(e);for(this.interceptors.request.forEach(function(n){t.unshift(n.fulfilled,n.rejected)}),this.interceptors.response.forEach(function(n){t.push(n.fulfilled,n.rejected)});t.length;)i=i.then(t.shift(),t.shift());return i};xa.prototype.getUri=function(e){return e=_b(this.defaults,e),AI(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};ml.forEach(["delete","get","head","options"],function(e){xa.prototype[e]=function(t,i){return this.request(ml.merge(i||{},{method:e,url:t}))}});ml.forEach(["post","put","patch"],function(e){xa.prototype[e]=function(t,i,r){return this.request(ml.merge(r||{},{method:e,url:t,data:i}))}});var wI=xa,du,Qm;function xb(){if(Qm)return du;Qm=1;function s(e){this.message=e}return s.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},s.prototype.__CANCEL__=!0,du=s,du}var hu,qm;function CI(){if(qm)return hu;qm=1;var s=xb();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(a){i=a});var r=this;t(function(a){r.reason||(r.reason=new s(a),i(r.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var i,r=new e(function(a){i=a});return{token:r,cancel:i}},hu=e,hu}var pu,Xm;function LI(){return Xm||(Xm=1,pu=function(e){return function(i){return e.apply(null,i)}}),pu}var Jm=us,II=db,Do=wI,RI=Eb,DI=Sb;function Ab(s){var e=new Do(s),t=II(Do.prototype.request,e);return Jm.extend(t,Do.prototype,e),Jm.extend(t,e),t}var Js=Ab(DI);Js.Axios=Do;Js.create=function(e){return Ab(RI(Js.defaults,e))};Js.Cancel=xb();Js.CancelToken=CI();Js.isCancel=yb();Js.all=function(e){return Promise.all(e)};Js.spread=LI();Zd.exports=Js;Zd.exports.default=Js;var kI=Zd.exports,PI=kI;const OI=Oe(PI);class MI{constructor(e){this.oblectoSession=e}async getLists(){return(await this.oblectoSession.axios.get("/movies/lists")).data}async getList(e,t,i,r){return(await this.oblectoSession.axios.get(`/movies/list/${e}`,{params:{order:t,page:r,count:i}})).data}async getInfo(e){return(await this.oblectoSession.axios.get(`/movie/${e}/info`)).data}async search(e){return(await this.oblectoSession.axios.get(`/movies/search/${e}`)).data}async getPoster(e,t,i={}){return(await this.oblectoSession.axios.get(`/movie/${e}/poster`,{...i,params:{size:t,...i.params||{}}})).data}async uploadPoster(e,t,i={}){let r=t;return typeof FormData<"u"&&!(t instanceof FormData)&&(r=new FormData,r.append("file",t)),(await this.oblectoSession.axios.put(`/movie/${e}/poster`,r,i)).data}async getFanart(e,t,i={}){return(await this.oblectoSession.axios.get(`/movie/${e}/fanart`,{...i,params:{size:t,...i.params||{}}})).data}async uploadFanart(e,t,i={}){let r=t;return typeof FormData<"u"&&!(t instanceof FormData)&&(r=new FormData,r.append("file",t)),(await this.oblectoSession.axios.put(`/movie/${e}/fanart`,r,i)).data}async getSets(){return(await this.oblectoSession.axios.get("/movies/sets")).data}async getSet(e,t,i,r){return(await this.oblectoSession.axios.get(`/movies/set/${e}`,{params:{order:t,page:r,count:i}})).data}async getMovieSets(e){return(await this.oblectoSession.axios.get(`/movie/${e}/sets`)).data}async addMovieToSet(e,t){return(await this.oblectoSession.axios.put(`/movie/${e}/sets`,{setId:t})).data}async getWatching(){return(await this.oblectoSession.axios.get("/movies/watching")).data}async play(e){return(await this.oblectoSession.axios.get(`/movie/${e}/play`)).data}}class NI{constructor(e){this.oblectoSession=e}async getLists(){return(await this.oblectoSession.axios.get("/series/lists")).data}async getList(e,t,i,r){return(await this.oblectoSession.axios.get(`/series/list/${e}`,{params:{order:t,page:r,count:i}})).data}async getSets(){return(await this.oblectoSession.axios.get("/series/sets")).data}async getSet(e,t,i,r){return(await this.oblectoSession.axios.get(`/series/set/${e}`,{params:{order:t,page:r,count:i}})).data}async getInfo(e){return(await this.oblectoSession.axios.get(`/series/${e}/info`)).data}async getEpisodes(e){return(await this.oblectoSession.axios.get(`/series/${e}/episodes`)).data}async search(e){return(await this.oblectoSession.axios.get(`/shows/search/${e}`)).data}async getPoster(e,t,i={}){return(await this.oblectoSession.axios.get(`/series/${e}/poster`,{...i,params:{size:t,...i.params||{}}})).data}async uploadPoster(e,t,i={}){let r=t;return typeof FormData<"u"&&!(t instanceof FormData)&&(r=new FormData,r.append("file",t)),(await this.oblectoSession.axios.put(`/series/${e}/poster`,r,i)).data}async indexSeries(e){return(await this.oblectoSession.axios.get(`/series/${e}/index`)).data}}class FI{constructor(e){this.oblectoSession=e}async getList(e,t,i,r){return(await this.oblectoSession.axios.get(`/episodes/list/${e}`,{params:{order:t,page:r,count:i}})).data}async getInfo(e){return(await this.oblectoSession.axios.get(`/episode/${e}/info`)).data}async getNext(e){return(await this.oblectoSession.axios.get(`/episode/${e}/next`)).data}async search(e){return(await this.oblectoSession.axios.get(`/episodes/search/${e}`)).data}async getBanner(e,t,i={}){return(await this.oblectoSession.axios.get(`/episode/${e}/banner`,{...i,params:{size:t,...i.params||{}}})).data}async uploadBanner(e,t,i={}){let r=t;return typeof FormData<"u"&&!(t instanceof FormData)&&(r=new FormData,r.append("file",t)),(await this.oblectoSession.axios.put(`/episode/${e}/banner`,r,i)).data}async getSets(){return(await this.oblectoSession.axios.get("/episodes/sets")).data}async getSet(e,t,i,r){return(await this.oblectoSession.axios.get(`/episodes/set/${e}`,{params:{order:t,page:r,count:i}})).data}async getWatching(){return(await this.oblectoSession.axios.get("/episodes/watching")).data}async getNextUp(){return(await this.oblectoSession.axios.get("/episodes/next")).data}async play(e){return(await this.oblectoSession.axios.get(`/episode/${e}/play`)).data}}let $I=class{constructor(e){this.oblectoSession=e}async getUsers(){return(await this.oblectoSession.axios.get("/users")).data}async getUser(e){return(await this.oblectoSession.axios.get(`/user/${e}`)).data}async updateUser(e,t){return(await this.oblectoSession.axios.put(`/user/${e}`,t)).data}async createUser(e,t,i,r){return(await this.oblectoSession.axios.post("/user",{username:e,password:t,name:i,email:r})).data}async deleteUser(e){return(await this.oblectoSession.axios.delete(`/user/${e}`)).data}};class BI{constructor(e){this.oblectoSession=e}async getAll(){return(await this.oblectoSession.axios.get("/api/v1/settings")).data}async update(e){return(await this.oblectoSession.axios.patch("/api/v1/settings",e)).data}async getSection(e){return(await this.oblectoSession.axios.get(`/api/v1/settings/${e}`)).data}async updateSection(e,t){return(await this.oblectoSession.axios.patch(`/api/v1/settings/${e}`,t)).data}}class UI{constructor(e){this.oblectoSession=e}async listLibraries(){return(await this.oblectoSession.axios.get("/api/v1/libraries")).data}async getLibraryPaths(e){return(await this.oblectoSession.axios.get(`/api/v1/libraries/${e}`)).data}async updateLibraryConfig(e,t){return(await this.oblectoSession.axios.patch(`/api/v1/libraries/${e}`,t)).data}async addPath(e,t){return(await this.oblectoSession.axios.post(`/api/v1/libraries/${e}/paths`,{path:t})).data}async removePath(e,t){return(await this.oblectoSession.axios.delete(`/api/v1/libraries/${e}/paths`,{data:{path:t}})).data}}class GI{constructor(e){this.oblectoSession=e}async triggerMaintenance(e,t){return(await this.oblectoSession.axios.post("/api/v1/system/maintenance",{action:e,target:t})).data}async triggerImport(e,t){return(await this.oblectoSession.axios.post("/api/v1/system/imports",{source:e,type:t})).data}async getInfo(){return(await this.oblectoSession.axios.get("/api/v1/system/info")).data}async getCapabilities(){return(await this.oblectoSession.axios.get("/api/v1/system/capabilities")).data}}class HI{constructor(e){this.oblectoSession=e}async getDuplicates(){return(await this.oblectoSession.axios.get("/files/duplicates")).data}async getProblematic(){return(await this.oblectoSession.axios.get("/files/problematic")).data}async retryFile(e){return(await this.oblectoSession.axios.post(`/files/${e}/retry`)).data}}class YI{constructor(e){this.oblectoSession=e}async create(e,t={}){return(await this.oblectoSession.axios.get(`/session/create/${e}`,{params:t})).data}async stream(e,t={},i={}){return(await this.oblectoSession.axios.get(`/session/stream/${e}`,{...i,params:t})).data}getStreamUrl(e,t={}){let i=this.oblectoSession.axios.defaults.baseURL||"",r=new URLSearchParams(t).toString(),n=`${i}/session/stream/${e}`;return r?`${n}?${r}`:n}async getHlsSegment(e,t,i={}){return(await this.oblectoSession.axios.get(`/HLS/${e}/segment/${t}`,i)).data}}class jI{constructor(e){this.oblectoSession=e}async getClients(){return(await this.oblectoSession.axios.get("/clients")).data}async playback(e,t,i){return(await this.oblectoSession.axios.post(`/client/${e}/playback`,{type:t,id:i,clientId:e})).data}}class VI{constructor(e){this.oblectoSession=e}async createMovieSet(e){return(await this.oblectoSession.axios.post("/set/movie",e)).data}async createSeriesSet(e){return(await this.oblectoSession.axios.post("/set/series",e)).data}async deleteMovieSet(e){return(await this.oblectoSession.axios.delete(`/set/movie/${e}`)).data}async deleteSeriesSet(e){return(await this.oblectoSession.axios.delete(`/set/series/${e}`)).data}}class KI{constructor(e){this.oblectoSession=e}async getSessions(){return(await this.oblectoSession.axios.get("/api/v1/status/sessions")).data}async getClients(){return(await this.oblectoSession.axios.get("/api/v1/status/clients")).data}async getSeedboxStatus(){return(await this.oblectoSession.axios.get("/api/v1/status/seedbox")).data}}class WI{constructor(e){this.axios=OI.create({baseURL:e,timeout:1e3}),this.movieLibrary=new MI(this),this.seriesLibrary=new NI(this),this.episodeLibrary=new FI(this),this.userManager=new $I(this),this.settings=new BI(this),this.libraries=new UI(this),this.system=new GI(this),this.files=new HI(this),this.sessions=new YI(this),this.remotes=new jI(this),this.sets=new VI(this),this.status=new KI(this)}async getSessionToken(e,t){return(await this.axios.post("/auth/login",{username:e,password:t})).data.accessToken}async authenticate(e,t){this.username=e,this.accessToken=await this.getSessionToken(e,t),this.axios.defaults.headers.common={Authorization:`bearer ${this.accessToken}`}}}let Tb=window.location.protocol+"//"+window.location.hostname;window.location.port&&(Tb=window.location.protocol+"//"+window.location.hostname+":"+window.location.port);const ie=new WI(Tb);let ws=null,Ja=0;function wb(s,e=ie.axios.defaults.baseURL){return ws&&ws.close(),ws=Ro(e),Ce.prototype.$socket=ws,Ja=0,ws.on("connect_error",()=>{Ja++,Ja===1&&s.$notify({group:"system",title:"Connection failed",text:"Failed to connect to the Oblecto web socket server. Is the server online?",type:"error"})}),ws.on("connect",()=>{Ja=0,s.$notify({group:"system",title:"Connection to Oblecto succeeded",text:"Client has successfully connected to the Oblecto websocket interface!",type:"success"}),ie.accessToken&&(ws.emit("authenticate",{token:ie.accessToken}),s.$notify({group:"system",title:"Authentication success",text:"Socket interface has been authenticated",type:"success"}),s.$store.dispatch("updateAll"))}),ws.on("indexer",t=>{t.event==="added"&&s.$store.dispatch("updateAll")}),ws.on("play",t=>{t.episodeId&&s.$store.dispatch("playEpisodeLocal",t.episodeId),t.movieId&&s.$store.dispatch("playMovieLocal",t.movieId)}),ws}function zI(s,e){return wb(s,e)}function gl(){return ws}const QI={name:"Episode",props:{subtitle:{type:String,required:!1},inside:{type:Boolean,required:!1,default:!1},episode:{required:!0,default:!1}},data(){return{progress:0,loaded:!1,bannerUrl:"",bannerLoaded:!1}},watch:{episode:async function(s,e){this.episode.TrackEpisodes[0]&&(this.progress=this.episode.TrackEpisodes[0].progress)}},created(){this.episode.TrackEpisodes[0]&&(this.progress=this.episode.TrackEpisodes[0].progress);const s=new Image;s.src=this.host+"/episode/"+this.episode.id+"/banner",s.onload=()=>{this.bannerUrl=s.src,this.bannerLoaded=!0},s.onerror=()=>{this.posterLoaded=!0},gl().on("client-episode-progress",this.handleEpisodeProgress)},mounted(){},beforeUnmount(){gl().off("client-episode-progress",this.handleEpisodeProgress)},computed:{...xt(["host"])},methods:{handleEpisodeProgress:function(s){s.episodeId===this.episode.id&&(this.episode.TrackEpisodes[0]=s,this.progress=s.progress)},playEpisode:function(s){s.preventDefault(),this.$store.dispatch("playEpisode",this.episode.id)},openEpisodeDialog:function(s){this.$modal.show("EpisodeDialog",{episode:this.episode})},viewEpisodeInfo:function(s){this.$router.push({name:"EpisodeInfo",params:{episodeId:this.episode.id}})}}};var qI=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"slide-fade",appear:""}},[t("div",{staticClass:"episode"},[t("div",{staticClass:"episode-poster",style:{backgroundImage:"url("+e.bannerUrl+")"}},[t("a",{staticClass:"play",on:{click:e.playEpisode}},[t("i",{staticClass:"fa fa-play",attrs:{"aria-hidden":"true"}})]),e.inside?t("div",{staticClass:"title",attrs:{title:e.episode.episodeName}},[e._v(" "+e._s(e.episode.episodeName)+" ")]):e._e(),e.progress?t("div",{staticClass:"progress",style:{width:e.progress*100+"%"}}):e._e(),t("div",{staticClass:"actions"},[t("a",{staticClass:"action-item",attrs:{title:"Options"},on:{click:e.openEpisodeDialog}},[t("i",{staticClass:"fa fa-info",attrs:{"aria-hidden":"true"}})]),t("a",{staticClass:"action-item",attrs:{title:"Info"},on:{click:e.viewEpisodeInfo}},[t("i",{staticClass:"fa fa-eye",attrs:{"aria-hidden":"true"}})])])]),e.inside?e._e():t("div",{staticClass:"title",attrs:{title:e.episode.episodeName}},[e._v(" "+e._s(e.episode.episodeName)+" ")]),e.subtitle&&!e.inside?t("div",{staticClass:"subtitle"},[e._v(" "+e._s(e.subtitle)+" ")]):e._e()])])},XI=[],JI=ve(QI,qI,XI,!1,null,"7182ce73");const ZI=JI.exports;var Cb={exports:{}};/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */(function(s){/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */(function(e){if(e.jQuery)return;var t=function(u,f){return new t.fn.init(u,f)};t.isWindow=function(u){return u&&u===u.window},t.type=function(u){return u?typeof u=="object"||typeof u=="function"?n[o.call(u)]||"object":typeof u:u+""},t.isArray=Array.isArray||function(u){return t.type(u)==="array"};function i(u){var f=u.length,d=t.type(u);return d==="function"||t.isWindow(u)?!1:u.nodeType===1&&f?!0:d==="array"||f===0||typeof f=="number"&&f>0&&f-1 in u}t.isPlainObject=function(u){var f;if(!u||t.type(u)!=="object"||u.nodeType||t.isWindow(u))return!1;try{if(u.constructor&&!a.call(u,"constructor")&&!a.call(u.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(f in u);return f===void 0||a.call(u,f)},t.each=function(u,f,d){var h,p=0,g=u.length,m=i(u);if(d){if(m)for(;p<g&&(h=f.apply(u[p],d),h!==!1);p++);else for(p in u)if(u.hasOwnProperty(p)&&(h=f.apply(u[p],d),h===!1))break}else if(m)for(;p<g&&(h=f.call(u[p],p,u[p]),h!==!1);p++);else for(p in u)if(u.hasOwnProperty(p)&&(h=f.call(u[p],p,u[p]),h===!1))break;return u},t.data=function(u,f,d){if(d===void 0){var h=u[t.expando],p=h&&r[h];if(f===void 0)return p;if(p&&f in p)return p[f]}else if(f!==void 0){var g=u[t.expando]||(u[t.expando]=++t.uuid);return r[g]=r[g]||{},r[g][f]=d,d}},t.removeData=function(u,f){var d=u[t.expando],h=d&&r[d];h&&(f?t.each(f,function(p,g){delete h[g]}):delete r[d])},t.extend=function(){var u,f,d,h,p,g,m=arguments[0]||{},v=1,y=arguments.length,E=!1;for(typeof m=="boolean"&&(E=m,m=arguments[v]||{},v++),typeof m!="object"&&t.type(m)!=="function"&&(m={}),v===y&&(m=this,v--);v<y;v++)if(p=arguments[v])for(h in p)p.hasOwnProperty(h)&&(u=m[h],d=p[h],m!==d&&(E&&d&&(t.isPlainObject(d)||(f=t.isArray(d)))?(f?(f=!1,g=u&&t.isArray(u)?u:[]):g=u&&t.isPlainObject(u)?u:{},m[h]=t.extend(E,g,d)):d!==void 0&&(m[h]=d)));return m},t.queue=function(u,f,d){function h(g,m){var v=m||[];return g&&(i(Object(g))?function(y,E){for(var w=+E.length,T=0,$=y.length;T<w;)y[$++]=E[T++];if(w!==w)for(;E[T]!==void 0;)y[$++]=E[T++];return y.length=$,y}(v,typeof g=="string"?[g]:g):[].push.call(v,g)),v}if(u){f=(f||"fx")+"queue";var p=t.data(u,f);return d?(!p||t.isArray(d)?p=t.data(u,f,h(d)):p.push(d),p):p||[]}},t.dequeue=function(u,f){t.each(u.nodeType?[u]:u,function(d,h){f=f||"fx";var p=t.queue(h,f),g=p.shift();g==="inprogress"&&(g=p.shift()),g&&(f==="fx"&&p.unshift("inprogress"),g.call(h,function(){t.dequeue(h,f)}))})},t.fn=t.prototype={init:function(u){if(u.nodeType)return this[0]=u,this;throw new Error("Not a DOM node.")},offset:function(){var u=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:u.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:u.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function u(g){for(var m=g.offsetParent;m&&m.nodeName.toLowerCase()!=="html"&&m.style&&m.style.position.toLowerCase()==="static";)m=m.offsetParent;return m||document}var f=this[0],d=u(f),h=this.offset(),p=/^(?:body|html)$/i.test(d.nodeName)?{top:0,left:0}:t(d).offset();return h.top-=parseFloat(f.style.marginTop)||0,h.left-=parseFloat(f.style.marginLeft)||0,d.style&&(p.top+=parseFloat(d.style.borderTopWidth)||0,p.left+=parseFloat(d.style.borderLeftWidth)||0),{top:h.top-p.top,left:h.left-p.left}}};var r={};t.expando="velocity"+new Date().getTime(),t.uuid=0;for(var n={},a=n.hasOwnProperty,o=n.toString,l="Boolean Number String Function Array Date RegExp Object Error".split(" "),c=0;c<l.length;c++)n["[object "+l[c]+"]"]=l[c].toLowerCase();t.fn.init.prototype=t.fn,e.Velocity={Utilities:t}})(window),function(e){s.exports=e()}(function(){return function(e,t,i,r){var n=function(){if(i.documentMode)return i.documentMode;for(var S=7;S>4;S--){var A=i.createElement("div");if(A.innerHTML="<!--[if IE "+S+"]><span></span><![endif]-->",A.getElementsByTagName("span").length)return A=null,S}return r}(),a=function(){var S=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(A){var I=new Date().getTime(),D;return D=Math.max(0,16-(I-S)),S=I+D,setTimeout(function(){A(I+D)},D)}}(),o=function(){var S=t.performance||{};if(typeof S.now!="function"){var A=S.timing&&S.timing.navigationStart?S.timing.navigationStart:new Date().getTime();S.now=function(){return new Date().getTime()-A}}return S}();function l(S){for(var A=-1,I=S?S.length:0,D=[];++A<I;){var O=S[A];O&&D.push(O)}return D}var c=function(){var S=Array.prototype.slice;try{return S.call(i.documentElement),S}catch{return function(I,D){var O=this.length;if(typeof I!="number"&&(I=0),typeof D!="number"&&(D=O),this.slice)return S.call(this,I,D);var H,N=[],P=I>=0?I:Math.max(0,O+I),Y=D<0?O+D:Math.min(D,O),z=Y-P;if(z>0)if(N=new Array(z),this.charAt)for(H=0;H<z;H++)N[H]=this.charAt(P+H);else for(H=0;H<z;H++)N[H]=this[P+H];return N}}}(),u=function(){return Array.prototype.includes?function(S,A){return S.includes(A)}:Array.prototype.indexOf?function(S,A){return S.indexOf(A)>=0}:function(S,A){for(var I=0;I<S.length;I++)if(S[I]===A)return!0;return!1}};function f(S){return d.isWrapped(S)?S=c.call(S):d.isNode(S)&&(S=[S]),S}var d={isNumber:function(S){return typeof S=="number"},isString:function(S){return typeof S=="string"},isArray:Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"},isFunction:function(S){return Object.prototype.toString.call(S)==="[object Function]"},isNode:function(S){return S&&S.nodeType},isWrapped:function(S){return S&&S!==t&&d.isNumber(S.length)&&!d.isString(S)&&!d.isFunction(S)&&!d.isNode(S)&&(S.length===0||d.isNode(S[0]))},isSVG:function(S){return t.SVGElement&&S instanceof t.SVGElement},isEmptyObject:function(S){for(var A in S)if(S.hasOwnProperty(A))return!1;return!0}},h,p=!1;if(e.fn&&e.fn.jquery?(h=e,p=!0):h=t.Velocity.Utilities,n<=8&&!p)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(n<=7){jQuery.fn.velocity=jQuery.fn.animate;return}var g=400,m="swing",v={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t.navigator.userAgent),isAndroid:/Android/i.test(t.navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(t.navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(t.navigator.userAgent),prefixElement:i.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:h,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:g,easing:m,begin:r,complete:r,progress:r,display:r,visibility:r,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(S){h.data(S,"velocity",{isSVG:d.isSVG(S),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:5,patch:2},debug:!1,timestamp:!0,pauseAll:function(S){var A=new Date().getTime();h.each(v.State.calls,function(I,D){if(D){if(S!==r&&(D[2].queue!==S||D[2].queue===!1))return!0;D[5]={resume:!1}}}),h.each(v.State.delayedElements,function(I,D){D&&E(D,A)})},resumeAll:function(S){new Date().getTime(),h.each(v.State.calls,function(A,I){if(I){if(S!==r&&(I[2].queue!==S||I[2].queue===!1))return!0;I[5]&&(I[5].resume=!0)}}),h.each(v.State.delayedElements,function(A,I){I&&w(I)})}};t.pageYOffset!==r?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=i.documentElement||i.body.parentNode||i.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");function y(S){var A=h.data(S,"velocity");return A===null?r:A}function E(S,A){var I=y(S);I&&I.delayTimer&&!I.delayPaused&&(I.delayRemaining=I.delay-A+I.delayBegin,I.delayPaused=!0,clearTimeout(I.delayTimer.setTimeout))}function w(S,A){var I=y(S);I&&I.delayTimer&&I.delayPaused&&(I.delayPaused=!1,I.delayTimer.setTimeout=setTimeout(I.delayTimer.next,I.delayRemaining))}function T(S){return function(A){return Math.round(A*S)*(1/S)}}function $(S,A,I,D){var O=4,H=.001,N=1e-7,P=10,Y=11,z=1/(Y-1),J="Float32Array"in t;if(arguments.length!==4)return!1;for(var x=0;x<4;++x)if(typeof arguments[x]!="number"||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;S=Math.min(S,1),I=Math.min(I,1),S=Math.max(S,0),I=Math.max(I,0);var F=J?new Float32Array(Y):new Array(Y);function G(Z,se){return 1-3*se+3*Z}function Q(Z,se){return 3*se-6*Z}function ee(Z){return 3*Z}function ae(Z,se,X){return((G(se,X)*Z+Q(se,X))*Z+ee(se))*Z}function de(Z,se,X){return 3*G(se,X)*Z*Z+2*Q(se,X)*Z+ee(se)}function ye(Z,se){for(var X=0;X<O;++X){var Re=de(se,S,I);if(Re===0)return se;var Ne=ae(se,S,I)-Z;se-=Ne/Re}return se}function pe(){for(var Z=0;Z<Y;++Z)F[Z]=ae(Z*z,S,I)}function le(Z,se,X){var Re,Ne,Ve=0;do Ne=se+(X-se)/2,Re=ae(Ne,S,I)-Z,Re>0?X=Ne:se=Ne;while(Math.abs(Re)>N&&++Ve<P);return Ne}function ne(Z){for(var se=0,X=1,Re=Y-1;X!==Re&&F[X]<=Z;++X)se+=z;--X;var Ne=(Z-F[X])/(F[X+1]-F[X]),Ve=se+Ne*z,bt=de(Ve,S,I);return bt>=H?ye(Z,Ve):bt===0?Ve:le(Z,se,se+z)}var Se=!1;function Be(){Se=!0,(S!==A||I!==D)&&pe()}var Ye=function(Z){return Se||Be(),S===A&&I===D?Z:Z===0?0:Z===1?1:ae(ne(Z),A,D)};Ye.getControlPoints=function(){return[{x:S,y:A},{x:I,y:D}]};var Pe="generateBezier("+[S,A,I,D]+")";return Ye.toString=function(){return Pe},Ye}var k=function(){function S(D){return-D.tension*D.x-D.friction*D.v}function A(D,O,H){var N={x:D.x+H.dx*O,v:D.v+H.dv*O,tension:D.tension,friction:D.friction};return{dx:N.v,dv:S(N)}}function I(D,O){var H={dx:D.v,dv:S(D)},N=A(D,O*.5,H),P=A(D,O*.5,N),Y=A(D,O,P),z=1/6*(H.dx+2*(N.dx+P.dx)+Y.dx),J=1/6*(H.dv+2*(N.dv+P.dv)+Y.dv);return D.x=D.x+z*O,D.v=D.v+J*O,D}return function D(O,H,N){var P={x:-1,v:0,tension:null,friction:null},Y=[0],z=0,J=1/1e4,x=16/1e3,F,G,Q;for(O=parseFloat(O)||500,H=parseFloat(H)||20,N=N||null,P.tension=O,P.friction=H,F=N!==null,F?(z=D(O,H),G=z/N*x):G=x;Q=I(Q||P,G),Y.push(1+Q.x),z+=16,Math.abs(Q.x)>J&&Math.abs(Q.v)>J;);return F?function(ee){return Y[ee*(Y.length-1)|0]}:z}}();v.Easings={linear:function(S){return S},swing:function(S){return .5-Math.cos(S*Math.PI)/2},spring:function(S){return 1-Math.cos(S*4.5*Math.PI)*Math.exp(-S*6)}},h.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(S,A){v.Easings[A[0]]=$.apply(null,A[1])});function M(S,A){var I=S;return d.isString(S)?v.Easings[S]||(I=!1):d.isArray(S)&&S.length===1?I=T.apply(null,S):d.isArray(S)&&S.length===2?I=k.apply(null,S.concat([A])):d.isArray(S)&&S.length===4?I=$.apply(null,S):I=!1,I===!1&&(v.Easings[v.defaults.easing]?I=v.defaults.easing:I=m),I}var _=v.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/ig},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var S=0;S<_.Lists.colors.length;S++){var A=_.Lists.colors[S]==="color"?"0 0 0 1":"255 255 255 1";_.Hooks.templates[_.Lists.colors[S]]=["Red Green Blue Alpha",A]}var I,D,O;if(n){for(I in _.Hooks.templates)if(_.Hooks.templates.hasOwnProperty(I)){D=_.Hooks.templates[I],O=D[0].split(" ");var H=D[1].match(_.RegEx.valueSplit);O[0]==="Color"&&(O.push(O.shift()),H.push(H.shift()),_.Hooks.templates[I]=[O.join(" "),H.join(" ")])}}for(I in _.Hooks.templates)if(_.Hooks.templates.hasOwnProperty(I)){D=_.Hooks.templates[I],O=D[0].split(" ");for(var N in O)if(O.hasOwnProperty(N)){var P=I+O[N],Y=N;_.Hooks.registered[P]=[I,Y]}}},getRoot:function(S){var A=_.Hooks.registered[S];return A?A[0]:S},getUnit:function(S,A){var I=(S.substr(A||0,5).match(/^[a-z%]+/)||[])[0]||"";return I&&u(_.Lists.units)?I:""},fixColors:function(S){return S.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,function(A,I,D){return _.Lists.colorNames.hasOwnProperty(D)?(I||"rgba(")+_.Lists.colorNames[D]+(I?"":",1)"):I+D})},cleanRootPropertyValue:function(S,A){return _.RegEx.valueUnwrap.test(A)&&(A=A.match(_.RegEx.valueUnwrap)[1]),_.Values.isCSSNullValue(A)&&(A=_.Hooks.templates[S][1]),A},extractValue:function(S,A){var I=_.Hooks.registered[S];if(I){var D=I[0],O=I[1];return A=_.Hooks.cleanRootPropertyValue(D,A),A.toString().match(_.RegEx.valueSplit)[O]}else return A},injectValue:function(S,A,I){var D=_.Hooks.registered[S];if(D){var O=D[0],H=D[1],N,P;return I=_.Hooks.cleanRootPropertyValue(O,I),N=I.toString().match(_.RegEx.valueSplit),N[H]=A,P=N.join(" "),P}else return I}},Normalizations:{registered:{clip:function(S,A,I){switch(S){case"name":return"clip";case"extract":var D;return _.RegEx.wrappedValueAlreadyExtracted.test(I)?D=I:(D=I.toString().match(_.RegEx.valueUnwrap),D=D?D[1].replace(/,(\s+)?/g," "):I),D;case"inject":return"rect("+I+")"}},blur:function(S,A,I){switch(S){case"name":return v.State.isFirefox?"filter":"-webkit-filter";case"extract":var D=parseFloat(I);if(!(D||D===0)){var O=I.toString().match(/blur\(([0-9]+[A-z]+)\)/i);O?D=O[1]:D=0}return D;case"inject":return parseFloat(I)?"blur("+I+")":"none"}},opacity:function(S,A,I){if(n<=8)switch(S){case"name":return"filter";case"extract":var D=I.toString().match(/alpha\(opacity=(.*)\)/i);return D?I=D[1]/100:I=1,I;case"inject":return A.style.zoom=1,parseFloat(I)>=1?"":"alpha(opacity="+parseInt(parseFloat(I)*100,10)+")"}else switch(S){case"name":return"opacity";case"extract":return I;case"inject":return I}}},register:function(){(!n||n>9)&&!v.State.isGingerbread&&(_.Lists.transformsBase=_.Lists.transformsBase.concat(_.Lists.transforms3D));for(var S=0;S<_.Lists.transformsBase.length;S++)(function(){var O=_.Lists.transformsBase[S];_.Normalizations.registered[O]=function(H,N,P){switch(H){case"name":return"transform";case"extract":return y(N)===r||y(N).transformCache[O]===r?/^scale/i.test(O)?1:0:y(N).transformCache[O].replace(/[()]/g,"");case"inject":var Y=!1;switch(O.substr(0,O.length-1)){case"translate":Y=!/(%|px|em|rem|vw|vh|\d)$/i.test(P);break;case"scal":case"scale":v.State.isAndroid&&y(N).transformCache[O]===r&&P<1&&(P=1),Y=!/(\d)$/i.test(P);break;case"skew":Y=!/(deg|\d)$/i.test(P);break;case"rotate":Y=!/(deg|\d)$/i.test(P);break}return Y||(y(N).transformCache[O]="("+P+")"),y(N).transformCache[O]}}})();for(var A=0;A<_.Lists.colors.length;A++)(function(){var O=_.Lists.colors[A];_.Normalizations.registered[O]=function(H,N,P){switch(H){case"name":return O;case"extract":var Y;if(_.RegEx.wrappedValueAlreadyExtracted.test(P))Y=P;else{var z,J={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(P)?J[P]!==r?z=J[P]:z=J.black:_.RegEx.isHex.test(P)?z="rgb("+_.Values.hexToRgb(P).join(" ")+")":/^rgba?\(/i.test(P)||(z=J.black),Y=(z||P).toString().match(_.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!n||n>8)&&Y.split(" ").length===3&&(Y+=" 1"),Y;case"inject":return/^rgb/.test(P)?P:(n<=8?P.split(" ").length===4&&(P=P.split(/\s+/).slice(0,3).join(" ")):P.split(" ").length===3&&(P+=" 1"),(n<=8?"rgb":"rgba")+"("+P.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}})();function I(O,H,N){var P=_.getPropertyValue(H,"boxSizing").toString().toLowerCase()==="border-box";if(P===(N||!1)){var Y,z,J=0,x=O==="width"?["Left","Right"]:["Top","Bottom"],F=["padding"+x[0],"padding"+x[1],"border"+x[0]+"Width","border"+x[1]+"Width"];for(Y=0;Y<F.length;Y++)z=parseFloat(_.getPropertyValue(H,F[Y])),isNaN(z)||(J+=z);return N?-J:J}return 0}function D(O,H){return function(N,P,Y){switch(N){case"name":return O;case"extract":return parseFloat(Y)+I(O,P,H);case"inject":return parseFloat(Y)-I(O,P,H)+"px"}}}_.Normalizations.registered.innerWidth=D("width",!0),_.Normalizations.registered.innerHeight=D("height",!0),_.Normalizations.registered.outerWidth=D("width"),_.Normalizations.registered.outerHeight=D("height")}},Names:{camelCase:function(S){return S.replace(/-(\w)/g,function(A,I){return I.toUpperCase()})},SVGAttribute:function(S){var A="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||v.State.isAndroid&&!v.State.isChrome)&&(A+="|transform"),new RegExp("^("+A+")$","i").test(S)},prefixCheck:function(S){if(v.State.prefixMatches[S])return[v.State.prefixMatches[S],!0];for(var A=["","Webkit","Moz","ms","O"],I=0,D=A.length;I<D;I++){var O;if(I===0?O=S:O=A[I]+S.replace(/^\w/,function(H){return H.toUpperCase()}),d.isString(v.State.prefixElement.style[O]))return v.State.prefixMatches[S]=O,[O,!0]}return[S,!1]}},Values:{hexToRgb:function(S){var A=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D;return S=S.replace(A,function(O,H,N,P){return H+H+N+N+P+P}),D=I.exec(S),D?[parseInt(D[1],16),parseInt(D[2],16),parseInt(D[3],16)]:[0,0,0]},isCSSNullValue:function(S){return!S||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(S)},getUnitType:function(S){return/^(rotate|skew)/i.test(S)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(S)?"":"px"},getDisplayType:function(S){var A=S&&S.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(A)?"inline":/^(li)$/i.test(A)?"list-item":/^(tr)$/i.test(A)?"table-row":/^(table)$/i.test(A)?"table":/^(tbody)$/i.test(A)?"table-row-group":"block"},addClass:function(S,A){if(S)if(S.classList)S.classList.add(A);else if(d.isString(S.className))S.className+=(S.className.length?" ":"")+A;else{var I=S.getAttribute(n<=7?"className":"class")||"";S.setAttribute("class",I+(I?" ":"")+A)}},removeClass:function(S,A){if(S)if(S.classList)S.classList.remove(A);else if(d.isString(S.className))S.className=S.className.toString().replace(new RegExp("(^|\\s)"+A.split(" ").join("|")+"(\\s|$)","gi")," ");else{var I=S.getAttribute(n<=7?"className":"class")||"";S.setAttribute("class",I.replace(new RegExp("(^|s)"+A.split(" ").join("|")+"(s|$)","gi")," "))}}},getPropertyValue:function(S,A,I,D){function O(x,F){var G=0;if(n<=8)G=h.css(x,F);else{var Q=!1;/^(width|height)$/.test(F)&&_.getPropertyValue(x,"display")===0&&(Q=!0,_.setPropertyValue(x,"display",_.Values.getDisplayType(x)));var ee=function(){Q&&_.setPropertyValue(x,"display","none")};if(!D){if(F==="height"&&_.getPropertyValue(x,"boxSizing").toString().toLowerCase()!=="border-box"){var ae=x.offsetHeight-(parseFloat(_.getPropertyValue(x,"borderTopWidth"))||0)-(parseFloat(_.getPropertyValue(x,"borderBottomWidth"))||0)-(parseFloat(_.getPropertyValue(x,"paddingTop"))||0)-(parseFloat(_.getPropertyValue(x,"paddingBottom"))||0);return ee(),ae}else if(F==="width"&&_.getPropertyValue(x,"boxSizing").toString().toLowerCase()!=="border-box"){var de=x.offsetWidth-(parseFloat(_.getPropertyValue(x,"borderLeftWidth"))||0)-(parseFloat(_.getPropertyValue(x,"borderRightWidth"))||0)-(parseFloat(_.getPropertyValue(x,"paddingLeft"))||0)-(parseFloat(_.getPropertyValue(x,"paddingRight"))||0);return ee(),de}}var ye;y(x)===r?ye=t.getComputedStyle(x,null):y(x).computedStyle?ye=y(x).computedStyle:ye=y(x).computedStyle=t.getComputedStyle(x,null),F==="borderColor"&&(F="borderTopColor"),n===9&&F==="filter"?G=ye.getPropertyValue(F):G=ye[F],(G===""||G===null)&&(G=x.style[F]),ee()}if(G==="auto"&&/^(top|right|bottom|left)$/i.test(F)){var pe=O(x,"position");(pe==="fixed"||pe==="absolute"&&/top|left/i.test(F))&&(G=h(x).position()[F]+"px")}return G}var H;if(_.Hooks.registered[A]){var N=A,P=_.Hooks.getRoot(N);I===r&&(I=_.getPropertyValue(S,_.Names.prefixCheck(P)[0])),_.Normalizations.registered[P]&&(I=_.Normalizations.registered[P]("extract",S,I)),H=_.Hooks.extractValue(N,I)}else if(_.Normalizations.registered[A]){var Y,z;Y=_.Normalizations.registered[A]("name",S),Y!=="transform"&&(z=O(S,_.Names.prefixCheck(Y)[0]),_.Values.isCSSNullValue(z)&&_.Hooks.templates[A]&&(z=_.Hooks.templates[A][1])),H=_.Normalizations.registered[A]("extract",S,z)}if(!/^[\d-]/.test(H)){var J=y(S);if(J&&J.isSVG&&_.Names.SVGAttribute(A))if(/^(height|width)$/i.test(A))try{H=S.getBBox()[A]}catch{H=0}else H=S.getAttribute(A);else H=O(S,_.Names.prefixCheck(A)[0])}return _.Values.isCSSNullValue(H)&&(H=0),v.debug>=2&&console.log("Get "+A+": "+H),H},setPropertyValue:function(S,A,I,D,O){var H=A;if(A==="scroll")O.container?O.container["scroll"+O.direction]=I:O.direction==="Left"?t.scrollTo(I,O.alternateValue):t.scrollTo(O.alternateValue,I);else if(_.Normalizations.registered[A]&&_.Normalizations.registered[A]("name",S)==="transform")_.Normalizations.registered[A]("inject",S,I),H="transform",I=y(S).transformCache[A];else{if(_.Hooks.registered[A]){var N=A,P=_.Hooks.getRoot(A);D=D||_.getPropertyValue(S,P),I=_.Hooks.injectValue(N,I,D),A=P}if(_.Normalizations.registered[A]&&(I=_.Normalizations.registered[A]("inject",S,I),A=_.Normalizations.registered[A]("name",S)),H=_.Names.prefixCheck(A)[0],n<=8)try{S.style[H]=I}catch{v.debug&&console.log("Browser does not support ["+I+"] for ["+H+"]")}else{var Y=y(S);Y&&Y.isSVG&&_.Names.SVGAttribute(A)?S.setAttribute(A,I):S.style[H]=I}v.debug>=2&&console.log("Set "+A+" ("+H+"): "+I)}return[H,I]},flushTransformCache:function(S){var A="",I=y(S);if((n||v.State.isAndroid&&!v.State.isChrome)&&I&&I.isSVG){var D=function(P){return parseFloat(_.getPropertyValue(S,P))},O={translate:[D("translateX"),D("translateY")],skewX:[D("skewX")],skewY:[D("skewY")],scale:D("scale")!==1?[D("scale"),D("scale")]:[D("scaleX"),D("scaleY")],rotate:[D("rotateZ"),0,0]};h.each(y(S).transformCache,function(P){/^translate/i.test(P)?P="translate":/^scale/i.test(P)?P="scale":/^rotate/i.test(P)&&(P="rotate"),O[P]&&(A+=P+"("+O[P].join(" ")+") ",delete O[P])})}else{var H,N;h.each(y(S).transformCache,function(P){if(H=y(S).transformCache[P],P==="transformPerspective")return N=H,!0;n===9&&P==="rotateZ"&&(P="rotate"),A+=P+H+" "}),N&&(A="perspective"+N+" "+A)}_.setPropertyValue(S,"transform",A)}};_.Hooks.register(),_.Normalizations.register(),v.hook=function(S,A,I){var D;return S=f(S),h.each(S,function(O,H){if(y(H)===r&&v.init(H),I===r)D===r&&(D=_.getPropertyValue(H,A));else{var N=_.setPropertyValue(H,A,I);N[0]==="transform"&&v.CSS.flushTransformCache(H),D=N}}),D};var C=function(){var S;function A(){return D?z.promise||null:O}var I=arguments[0]&&(arguments[0].p||h.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||d.isString(arguments[0].properties)),D,O,H,N,P,Y;d.isWrapped(this)?(D=!1,H=0,N=this,O=this):(D=!0,H=1,N=I?arguments[0].elements||arguments[0].e:arguments[0]);var z={promise:null,resolver:null,rejecter:null};if(D&&v.Promise&&(z.promise=new v.Promise(function(Z,se){z.resolver=Z,z.rejecter=se})),I?(P=arguments[0].properties||arguments[0].p,Y=arguments[0].options||arguments[0].o):(P=arguments[H],Y=arguments[H+1]),N=f(N),!N){z.promise&&(!P||!Y||Y.promiseRejectEmpty!==!1?z.rejecter():z.resolver());return}var J=N.length,x=0;if(!/^(stop|finish|finishAll|pause|resume)$/i.test(P)&&!h.isPlainObject(Y)){var F=H+1;Y={};for(var G=F;G<arguments.length;G++)!d.isArray(arguments[G])&&(/^(fast|normal|slow)$/i.test(arguments[G])||/^\d/.test(arguments[G]))?Y.duration=arguments[G]:d.isString(arguments[G])||d.isArray(arguments[G])?Y.easing=arguments[G]:d.isFunction(arguments[G])&&(Y.complete=arguments[G])}var Q;switch(P){case"scroll":Q="scroll";break;case"reverse":Q="reverse";break;case"pause":var ee=new Date().getTime();return h.each(N,function(Z,se){E(se,ee)}),h.each(v.State.calls,function(Z,se){var X=!1;se&&h.each(se[1],function(Re,Ne){var Ve=Y===r?"":Y;if(Ve!==!0&&se[2].queue!==Ve&&!(Y===r&&se[2].queue===!1))return!0;if(h.each(N,function(bt,Ht){if(Ht===Ne)return se[5]={resume:!1},X=!0,!1}),X)return!1})}),A();case"resume":return h.each(N,function(Z,se){w(se)}),h.each(v.State.calls,function(Z,se){var X=!1;se&&h.each(se[1],function(Re,Ne){var Ve=Y===r?"":Y;if(Ve!==!0&&se[2].queue!==Ve&&!(Y===r&&se[2].queue===!1)||!se[5])return!0;if(h.each(N,function(bt,Ht){if(Ht===Ne)return se[5].resume=!0,X=!0,!1}),X)return!1})}),A();case"finish":case"finishAll":case"stop":h.each(N,function(Z,se){y(se)&&y(se).delayTimer&&(clearTimeout(y(se).delayTimer.setTimeout),y(se).delayTimer.next&&y(se).delayTimer.next(),delete y(se).delayTimer),P==="finishAll"&&(Y===!0||d.isString(Y))&&(h.each(h.queue(se,d.isString(Y)?Y:""),function(X,Re){d.isFunction(Re)&&Re()}),h.queue(se,d.isString(Y)?Y:"",[]))});var ae=[];return h.each(v.State.calls,function(Z,se){se&&h.each(se[1],function(X,Re){var Ne=Y===r?"":Y;if(Ne!==!0&&se[2].queue!==Ne&&!(Y===r&&se[2].queue===!1))return!0;h.each(N,function(Ve,bt){if(bt===Re)if((Y===!0||d.isString(Y))&&(h.each(h.queue(bt,d.isString(Y)?Y:""),function(As,Te){d.isFunction(Te)&&Te(null,!0)}),h.queue(bt,d.isString(Y)?Y:"",[])),P==="stop"){var Ht=y(bt);Ht&&Ht.tweensContainer&&(Ne===!0||Ne==="")&&h.each(Ht.tweensContainer,function(As,Te){Te.endValue=Te.currentValue}),ae.push(Z)}else(P==="finish"||P==="finishAll")&&(se[2].duration=1)})})}),P==="stop"&&(h.each(ae,function(Z,se){B(se,!0)}),z.promise&&z.resolver(N)),A();default:if(h.isPlainObject(P)&&!d.isEmptyObject(P))Q="start";else if(d.isString(P)&&v.Redirects[P]){S=h.extend({},Y);var de=S.duration,ye=S.delay||0;return S.backwards===!0&&(N=h.extend(!0,[],N).reverse()),h.each(N,function(Z,se){parseFloat(S.stagger)?S.delay=ye+parseFloat(S.stagger)*Z:d.isFunction(S.stagger)&&(S.delay=ye+S.stagger.call(se,Z,J)),S.drag&&(S.duration=parseFloat(de)||(/^(callout|transition)/.test(P)?1e3:g),S.duration=Math.max(S.duration*(S.backwards?1-Z/J:(Z+1)/J),S.duration*.75,200)),v.Redirects[P].call(se,se,S||{},Z,J,N,z.promise?z:r)}),A()}else{var pe="Velocity: First argument ("+P+") was not a property map, a known action, or a registered redirect. Aborting.";return z.promise?z.rejecter(new Error(pe)):t.console&&console.log(pe),A()}}var le={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},ne=[];function Se(Z,se){var X=h.extend({},v.defaults,Y),Re={},Ne;switch(y(Z)===r&&v.init(Z),parseFloat(X.delay)&&X.queue!==!1&&h.queue(Z,X.queue,function(As,Te){if(Te===!0)return!0;v.velocityQueueEntryFlag=!0;var Ze=v.State.delayedElements.count++;v.State.delayedElements[Ze]=Z;var wi=function(Na){return function(){v.State.delayedElements[Na]=!1,As()}}(Ze);y(Z).delayBegin=new Date().getTime(),y(Z).delay=parseFloat(X.delay),y(Z).delayTimer={setTimeout:setTimeout(As,parseFloat(X.delay)),next:wi}}),X.duration.toString().toLowerCase()){case"fast":X.duration=200;break;case"normal":X.duration=g;break;case"slow":X.duration=600;break;default:X.duration=parseFloat(X.duration)||1}v.mock!==!1&&(v.mock===!0?X.duration=X.delay=1:(X.duration*=parseFloat(v.mock)||1,X.delay*=parseFloat(v.mock)||1)),X.easing=M(X.easing,X.duration),X.begin&&!d.isFunction(X.begin)&&(X.begin=null),X.progress&&!d.isFunction(X.progress)&&(X.progress=null),X.complete&&!d.isFunction(X.complete)&&(X.complete=null),X.display!==r&&X.display!==null&&(X.display=X.display.toString().toLowerCase(),X.display==="auto"&&(X.display=v.CSS.Values.getDisplayType(Z))),X.visibility!==r&&X.visibility!==null&&(X.visibility=X.visibility.toString().toLowerCase()),X.mobileHA=X.mobileHA&&v.State.isMobile&&!v.State.isGingerbread;function Ve(As){var Te,Ze;if(X.begin&&x===0)try{X.begin.call(N,N)}catch(Ee){setTimeout(function(){throw Ee},1)}if(Q==="scroll"){var wi=/^x$/i.test(X.axis)?"Left":"Top",Na=parseFloat(X.offset)||0,Tn,ip,Dc;X.container?d.isWrapped(X.container)||d.isNode(X.container)?(X.container=X.container[0]||X.container,Tn=X.container["scroll"+wi],Dc=Tn+h(Z).position()[wi.toLowerCase()]+Na):X.container=null:(Tn=v.State.scrollAnchor[v.State["scrollProperty"+wi]],ip=v.State.scrollAnchor[v.State["scrollProperty"+(wi==="Left"?"Top":"Left")]],Dc=h(Z).offset()[wi.toLowerCase()]+Na),Re={scroll:{rootPropertyValue:!1,startValue:Tn,currentValue:Tn,endValue:Dc,unitType:"",easing:X.easing,scrollData:{container:X.container,direction:wi,alternateValue:ip}},element:Z},v.debug&&console.log("tweensContainer (scroll): ",Re.scroll,Z)}else if(Q==="reverse"){if(Te=y(Z),!Te)return;if(Te.tweensContainer){Te.opts.display==="none"&&(Te.opts.display="auto"),Te.opts.visibility==="hidden"&&(Te.opts.visibility="visible"),Te.opts.loop=!1,Te.opts.begin=null,Te.opts.complete=null,Y.easing||delete X.easing,Y.duration||delete X.duration,X=h.extend({},Te.opts,X),Ze=h.extend(!0,{},Te?Te.tweensContainer:null);for(var Bs in Ze)if(Ze.hasOwnProperty(Bs)&&Bs!=="element"){var ix=Ze[Bs].startValue;Ze[Bs].startValue=Ze[Bs].currentValue=Ze[Bs].endValue,Ze[Bs].endValue=ix,d.isEmptyObject(Y)||(Ze[Bs].easing=X.easing),v.debug&&console.log("reverse tweensContainer ("+Bs+"): "+JSON.stringify(Ze[Bs]),Z)}Re=Ze}else{h.dequeue(Z,X.queue);return}}else if(Q==="start"){Te=y(Z),Te&&Te.tweensContainer&&Te.isAnimating===!0&&(Ze=Te.tweensContainer);var rx=function(Ee,Ir){var Yt,Us,_e;return d.isFunction(Ee)&&(Ee=Ee.call(Z,se,J)),d.isArray(Ee)?(Yt=Ee[0],!d.isArray(Ee[1])&&/^[\d-]/.test(Ee[1])||d.isFunction(Ee[1])||_.RegEx.isHex.test(Ee[1])?_e=Ee[1]:d.isString(Ee[1])&&!_.RegEx.isHex.test(Ee[1])&&v.Easings[Ee[1]]||d.isArray(Ee[1])?(Us=Ir?Ee[1]:M(Ee[1],X.duration),_e=Ee[2]):_e=Ee[1]||Ee[2]):Yt=Ee,Ir||(Us=Us||X.easing),d.isFunction(Yt)&&(Yt=Yt.call(Z,se,J)),d.isFunction(_e)&&(_e=_e.call(Z,se,J)),[Yt||0,Us,_e]},rp=function(Ee,Ir){var Yt=_.Hooks.getRoot(Ee),Us=!1,_e=Ir[0],ax=Ir[1],Me=Ir[2],ds;if((!Te||!Te.isSVG)&&Yt!=="tween"&&_.Names.prefixCheck(Yt)[1]===!1&&_.Normalizations.registered[Yt]===r){v.debug&&console.log("Skipping ["+Yt+"] due to a lack of browser support.");return}(X.display!==r&&X.display!==null&&X.display!=="none"||X.visibility!==r&&X.visibility!=="hidden")&&/opacity|filter/.test(Ee)&&!Me&&_e!==0&&(Me=0),X._cacheValues&&Ze&&Ze[Ee]?(Me===r&&(Me=Ze[Ee].endValue+Ze[Ee].unitType),Us=Te.rootPropertyValueCache[Yt]):_.Hooks.registered[Ee]?Me===r?(Us=_.getPropertyValue(Z,Yt),Me=_.getPropertyValue(Z,Ee,Us)):Us=_.Hooks.templates[Yt][1]:Me===r&&(Me=_.getPropertyValue(Z,Ee));var Rr,hs,sr,Oc=!1,fp=function(es,Rn){var Dr,Ii;return Ii=(Rn||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(ts){return Dr=ts,""}),Dr||(Dr=_.Values.getUnitType(es)),[Ii,Dr]};if(Me!==_e&&d.isString(Me)&&d.isString(_e)){ds="";var Ci=0,Li=0,ni=[],Cn=[],Zt=0,Nt=0,ai=0;for(Me=_.Hooks.fixColors(Me),_e=_.Hooks.fixColors(_e);Ci<Me.length&&Li<_e.length;){var lt=Me[Ci],ir=_e[Li];if(/[\d\.-]/.test(lt)&&/[\d\.-]/.test(ir)){for(var Ln=lt,$a=ir,dp=".",hp=".";++Ci<Me.length;){if(lt=Me[Ci],lt===dp)dp="..";else if(!/\d/.test(lt))break;Ln+=lt}for(;++Li<_e.length;){if(ir=_e[Li],ir===hp)hp="..";else if(!/\d/.test(ir))break;$a+=ir}var In=_.Hooks.getUnit(Me,Ci),Mc=_.Hooks.getUnit(_e,Li);if(Ci+=In.length,Li+=Mc.length,In===Mc)Ln===$a?ds+=Ln+In:(ds+="{"+ni.length+(Nt?"!":"")+"}"+In,ni.push(parseFloat(Ln)),Cn.push(parseFloat($a)));else{var Ba=parseFloat(Ln),Nc=parseFloat($a);ds+=(Zt<5?"calc":"")+"("+(Ba?"{"+ni.length+(Nt?"!":"")+"}":"0")+In+" + "+(Nc?"{"+(ni.length+(Ba?1:0))+(Nt?"!":"")+"}":"0")+Mc+")",Ba&&(ni.push(Ba),Cn.push(0)),Nc&&(ni.push(0),Cn.push(Nc))}}else if(lt===ir)ds+=lt,Ci++,Li++,Zt===0&<==="c"||Zt===1&<==="a"||Zt===2&<==="l"||Zt===3&<==="c"||Zt>=4&<==="("?Zt++:(Zt&&Zt<5||Zt>=4&<===")"&&--Zt<5)&&(Zt=0),Nt===0&<==="r"||Nt===1&<==="g"||Nt===2&<==="b"||Nt===3&<==="a"||Nt>=3&<==="("?(Nt===3&<==="a"&&(ai=1),Nt++):ai&<===","?++ai>3&&(Nt=ai=0):(ai&&Nt<(ai?5:4)||Nt>=(ai?4:3)&<===")"&&--Nt<(ai?5:4))&&(Nt=ai=0);else{Zt=0;break}}(Ci!==Me.length||Li!==_e.length)&&(v.debug&&console.error('Trying to pattern match mis-matched strings ["'+_e+'", "'+Me+'"]'),ds=r),ds&&(ni.length?(v.debug&&console.log('Pattern found "'+ds+'" -> ',ni,Cn,"["+Me+","+_e+"]"),Me=ni,_e=Cn,hs=sr=""):ds=r)}ds||(Rr=fp(Ee,Me),Me=Rr[0],sr=Rr[1],Rr=fp(Ee,_e),_e=Rr[0].replace(/^([+-\/*])=/,function(es,Rn){return Oc=Rn,""}),hs=Rr[1],Me=parseFloat(Me)||0,_e=parseFloat(_e)||0,hs==="%"&&(/^(fontSize|lineHeight)$/.test(Ee)?(_e=_e/100,hs="em"):/^scale/.test(Ee)?(_e=_e/100,hs=""):/(Red|Green|Blue)$/i.test(Ee)&&(_e=_e/100*255,hs="")));var ox=function(){var es={myParent:Z.parentNode||i.body,position:_.getPropertyValue(Z,"position"),fontSize:_.getPropertyValue(Z,"fontSize")},Rn=es.position===le.lastPosition&&es.myParent===le.lastParent,Dr=es.fontSize===le.lastFontSize;le.lastParent=es.myParent,le.lastPosition=es.position,le.lastFontSize=es.fontSize;var Ii=100,ts={};if(!Dr||!Rn){var ps=Te&&Te.isSVG?i.createElementNS("http://www.w3.org/2000/svg","rect"):i.createElement("div");v.init(ps),es.myParent.appendChild(ps),h.each(["overflow","overflowX","overflowY"],function(lx,Fc){v.CSS.setPropertyValue(ps,Fc,"hidden")}),v.CSS.setPropertyValue(ps,"position",es.position),v.CSS.setPropertyValue(ps,"fontSize",es.fontSize),v.CSS.setPropertyValue(ps,"boxSizing","content-box"),h.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(lx,Fc){v.CSS.setPropertyValue(ps,Fc,Ii+"%")}),v.CSS.setPropertyValue(ps,"paddingLeft",Ii+"em"),ts.percentToPxWidth=le.lastPercentToPxWidth=(parseFloat(_.getPropertyValue(ps,"width",null,!0))||1)/Ii,ts.percentToPxHeight=le.lastPercentToPxHeight=(parseFloat(_.getPropertyValue(ps,"height",null,!0))||1)/Ii,ts.emToPx=le.lastEmToPx=(parseFloat(_.getPropertyValue(ps,"paddingLeft"))||1)/Ii,es.myParent.removeChild(ps)}else ts.emToPx=le.lastEmToPx,ts.percentToPxWidth=le.lastPercentToPxWidth,ts.percentToPxHeight=le.lastPercentToPxHeight;return le.remToPx===null&&(le.remToPx=parseFloat(_.getPropertyValue(i.body,"fontSize"))||16),le.vwToPx===null&&(le.vwToPx=parseFloat(t.innerWidth)/100,le.vhToPx=parseFloat(t.innerHeight)/100),ts.remToPx=le.remToPx,ts.vwToPx=le.vwToPx,ts.vhToPx=le.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(ts),Z),ts};if(/[\/*]/.test(Oc))hs=sr;else if(sr!==hs&&Me!==0)if(_e===0)hs=sr;else{Ne=Ne||ox();var pp=/margin|padding|left|right|width|text|word|letter/i.test(Ee)||/X$/.test(Ee)||Ee==="x"?"x":"y";switch(sr){case"%":Me*=pp==="x"?Ne.percentToPxWidth:Ne.percentToPxHeight;break;case"px":break;default:Me*=Ne[sr+"ToPx"]}switch(hs){case"%":Me*=1/(pp==="x"?Ne.percentToPxWidth:Ne.percentToPxHeight);break;case"px":break;default:Me*=1/Ne[hs+"ToPx"]}}switch(Oc){case"+":_e=Me+_e;break;case"-":_e=Me-_e;break;case"*":_e=Me*_e;break;case"/":_e=Me/_e;break}Re[Ee]={rootPropertyValue:Us,startValue:Me,currentValue:Me,endValue:_e,unitType:hs,easing:ax},ds&&(Re[Ee].pattern=ds),v.debug&&console.log("tweensContainer ("+Ee+"): "+JSON.stringify(Re[Ee]),Z)};for(var kc in P)if(P.hasOwnProperty(kc)){var np=_.Names.camelCase(kc),Fa=rx(P[kc]);if(u(_.Lists.colors)){var ap=Fa[0],op=Fa[1],lp=Fa[2];if(_.RegEx.isHex.test(ap)){for(var cp=["Red","Green","Blue"],nx=_.Values.hexToRgb(ap),up=lp?_.Values.hexToRgb(lp):r,wn=0;wn<cp.length;wn++){var Pc=[nx[wn]];op&&Pc.push(op),up!==r&&Pc.push(up[wn]),rp(np+cp[wn],Pc)}continue}}rp(np,Fa)}Re.element=Z}Re.element&&(_.Values.addClass(Z,"velocity-animating"),ne.push(Re),Te=y(Z),Te&&(X.queue===""&&(Te.tweensContainer=Re,Te.opts=X),Te.isAnimating=!0),x===J-1?(v.State.calls.push([ne,N,X,null,z.resolver,null,0]),v.State.isTicking===!1&&(v.State.isTicking=!0,R())):x++)}if(X.queue===!1)if(X.delay){var bt=v.State.delayedElements.count++;v.State.delayedElements[bt]=Z;var Ht=function(As){return function(){v.State.delayedElements[As]=!1,Ve()}}(bt);y(Z).delayBegin=new Date().getTime(),y(Z).delay=parseFloat(X.delay),y(Z).delayTimer={setTimeout:setTimeout(Ve,parseFloat(X.delay)),next:Ht}}else Ve();else h.queue(Z,X.queue,function(As,Te){if(Te===!0)return z.promise&&z.resolver(N),!0;v.velocityQueueEntryFlag=!0,Ve()});(X.queue===""||X.queue==="fx")&&h.queue(Z)[0]!=="inprogress"&&h.dequeue(Z)}h.each(N,function(Z,se){d.isNode(se)&&Se(se,Z)}),S=h.extend({},v.defaults,Y),S.loop=parseInt(S.loop,10);var Be=S.loop*2-1;if(S.loop)for(var Ye=0;Ye<Be;Ye++){var Pe={delay:S.delay,progress:S.progress};Ye===Be-1&&(Pe.display=S.display,Pe.visibility=S.visibility,Pe.complete=S.complete),C(N,"reverse",Pe)}return A()};v=h.extend(C,v),v.animate=C;var U=t.requestAnimationFrame||a;if(!v.State.isMobile&&i.hidden!==r){var L=function(){i.hidden?(U=function(S){return setTimeout(function(){S(!0)},16)},R()):U=t.requestAnimationFrame||a};L(),i.addEventListener("visibilitychange",L)}function R(S){if(S){var A=v.timestamp&&S!==!0?S:o.now(),I=v.State.calls.length;I>1e4&&(v.State.calls=l(v.State.calls),I=v.State.calls.length);for(var D=0;D<I;D++)if(v.State.calls[D]){var O=v.State.calls[D],H=O[0],N=O[2],P=O[3],Y=!P,z=null,J=O[5],x=O[6];if(P||(P=v.State.calls[D][3]=A-16),J)if(J.resume===!0)P=O[3]=Math.round(A-x-16),O[5]=null;else continue;x=O[6]=A-P;for(var F=Math.min(x/N.duration,1),G=0,Q=H.length;G<Q;G++){var ee=H[G],ae=ee.element;if(y(ae)){var de=!1;if(N.display!==r&&N.display!==null&&N.display!=="none"){if(N.display==="flex"){var ye=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];h.each(ye,function(X,Re){_.setPropertyValue(ae,"display",Re)})}_.setPropertyValue(ae,"display",N.display)}N.visibility!==r&&N.visibility!=="hidden"&&_.setPropertyValue(ae,"visibility",N.visibility);for(var pe in ee)if(ee.hasOwnProperty(pe)&&pe!=="element"){var le=ee[pe],ne,Se=d.isString(le.easing)?v.Easings[le.easing]:le.easing;if(d.isString(le.pattern)){var Be=F===1?function(X,Re,Ne){var Ve=le.endValue[Re];return Ne?Math.round(Ve):Ve}:function(X,Re,Ne){var Ve=le.startValue[Re],bt=le.endValue[Re]-Ve,Ht=Ve+bt*Se(F,N,bt);return Ne?Math.round(Ht):Ht};ne=le.pattern.replace(/{(\d+)(!)?}/g,Be)}else if(F===1)ne=le.endValue;else{var Ye=le.endValue-le.startValue;ne=le.startValue+Ye*Se(F,N,Ye)}if(!Y&&ne===le.currentValue)continue;if(le.currentValue=ne,pe==="tween")z=ne;else{var Pe;if(_.Hooks.registered[pe]){Pe=_.Hooks.getRoot(pe);var Z=y(ae).rootPropertyValueCache[Pe];Z&&(le.rootPropertyValue=Z)}var se=_.setPropertyValue(ae,pe,le.currentValue+(n<9&&parseFloat(ne)===0?"":le.unitType),le.rootPropertyValue,le.scrollData);_.Hooks.registered[pe]&&(_.Normalizations.registered[Pe]?y(ae).rootPropertyValueCache[Pe]=_.Normalizations.registered[Pe]("extract",null,se[1]):y(ae).rootPropertyValueCache[Pe]=se[1]),se[0]==="transform"&&(de=!0)}}N.mobileHA&&y(ae).transformCache.translate3d===r&&(y(ae).transformCache.translate3d="(0px, 0px, 0px)",de=!0),de&&_.flushTransformCache(ae)}}N.display!==r&&N.display!=="none"&&(v.State.calls[D][2].display=!1),N.visibility!==r&&N.visibility!=="hidden"&&(v.State.calls[D][2].visibility=!1),N.progress&&N.progress.call(O[1],O[1],F,Math.max(0,P+N.duration-A),P,z),F===1&&B(D)}}v.State.isTicking&&U(R)}function B(S,A){if(!v.State.calls[S])return!1;for(var I=v.State.calls[S][0],D=v.State.calls[S][1],O=v.State.calls[S][2],H=v.State.calls[S][4],N=!1,P=0,Y=I.length;P<Y;P++){var z=I[P].element;!A&&!O.loop&&(O.display==="none"&&_.setPropertyValue(z,"display",O.display),O.visibility==="hidden"&&_.setPropertyValue(z,"visibility",O.visibility));var J=y(z);if(O.loop!==!0&&(h.queue(z)[1]===r||!/\.velocityQueueEntryFlag/i.test(h.queue(z)[1]))&&J){J.isAnimating=!1,J.rootPropertyValueCache={};var x=!1;h.each(_.Lists.transforms3D,function(Q,ee){var ae=/^scale/.test(ee)?1:0,de=J.transformCache[ee];J.transformCache[ee]!==r&&new RegExp("^\\("+ae+"[^.]").test(de)&&(x=!0,delete J.transformCache[ee])}),O.mobileHA&&(x=!0,delete J.transformCache.translate3d),x&&_.flushTransformCache(z),_.Values.removeClass(z,"velocity-animating")}if(!A&&O.complete&&!O.loop&&P===Y-1)try{O.complete.call(D,D)}catch(Q){setTimeout(function(){throw Q},1)}H&&O.loop!==!0&&H(D),J&&O.loop===!0&&!A&&(h.each(J.tweensContainer,function(Q,ee){if(/^rotate/.test(Q)&&(parseFloat(ee.startValue)-parseFloat(ee.endValue))%360===0){var ae=ee.startValue;ee.startValue=ee.endValue,ee.endValue=ae}/^backgroundPosition/.test(Q)&&parseFloat(ee.endValue)===100&&ee.unitType==="%"&&(ee.endValue=0,ee.startValue=100)}),v(z,"reverse",{loop:!0,delay:O.delay})),O.queue!==!1&&h.dequeue(z,O.queue)}v.State.calls[S]=!1;for(var F=0,G=v.State.calls.length;F<G;F++)if(v.State.calls[F]!==!1){N=!0;break}N===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}return e.Velocity=v,e!==t&&(e.fn.velocity=C,e.fn.velocity.defaults=v.defaults),h.each(["Down","Up"],function(S,A){v.Redirects["slide"+A]=function(I,D,O,H,N,P){var Y=h.extend({},D),z=Y.begin,J=Y.complete,x={},F={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};Y.display===r&&(Y.display=A==="Down"?v.CSS.Values.getDisplayType(I)==="inline"?"inline-block":"block":"none"),Y.begin=function(){O===0&&z&&z.call(N,N);for(var G in F)if(F.hasOwnProperty(G)){x[G]=I.style[G];var Q=_.getPropertyValue(I,G);F[G]=A==="Down"?[Q,0]:[0,Q]}x.overflow=I.style.overflow,I.style.overflow="hidden"},Y.complete=function(){for(var G in x)x.hasOwnProperty(G)&&(I.style[G]=x[G]);O===H-1&&(J&&J.call(N,N),P&&P.resolver(N))},v(I,F,Y)}}),h.each(["In","Out"],function(S,A){v.Redirects["fade"+A]=function(I,D,O,H,N,P){var Y=h.extend({},D),z=Y.complete,J={opacity:A==="In"?1:0};O!==0&&(Y.begin=null),O!==H-1?Y.complete=null:Y.complete=function(){z&&z.call(N,N),P&&P.resolver(N)},Y.display===r&&(Y.display=A==="In"?"auto":"none"),v(this,J,Y)}}),v}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)})})(Cb);var eR=Cb.exports;const Zm=Oe(eR),tR={name:"Scroller",methods:{beforeEnter:function(s){s.style.opacity=0,s.style.width=0},enter:function(s,e){let t=s.dataset.index*150;setTimeout(function(){Zm(s,{opacity:1,width:"357px"},{complete:e})},t)},leave:function(s,e){let t=s.dataset.index*150;setTimeout(function(){Zm(s,{opacity:0,width:0},{complete:e})},t)}}};var sR=function(){var e=this,t=e._self._c;return t("transition-group",{ref:"scroller",staticClass:"scroller",attrs:{name:"staggered-fade",tag:"ul",css:!0},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[e._t("default")],2)},iR=[],rR=ve(tR,sR,iR,!1,null,"b83d083d");const nR=rR.exports,aR={name:"ListContainer",components:{FontAwesomeIcon:Jt,Scroller:nR},props:{title:String,badge:Number}};var oR=function(){var e=this,t=e._self._c;return t("div",{staticClass:"list-container"},[e.title?t("div",{staticClass:"titlebar"},[t("h3",{staticClass:"title"},[e._v(" "+e._s(e.title)+" "),e.badge!==void 0?t("span",{staticClass:"badge"},[e._v(e._s(e.badge))]):e._e()])]):e._e(),t("div",{staticClass:"list-inner"},[t("Scroller",[e._t("default")],2)],1)])},lR=[],cR=ve(aR,oR,lR,!1,null,"50be77f4");const eh=cR.exports,uR={name:"EpisodeList",components:{Episode:ZI,ListContainer:eh},props:{episodes:Array,title:String,badge:String}};var fR=function(){var e=this,t=e._self._c;return t("ListContainer",{attrs:{title:e.title,badge:e.badge}},e._l(e.episodes,function(i,r){return t("Episode",{key:i.id,attrs:{subtitle:`S${i.airedSeason}E${i.airedEpisodeNumber} - ${i.Series.seriesName}`,episode:i}})}),1)},dR=[],hR=ve(uR,fR,dR,!1,null,"9260bc6e");const Aa=hR.exports,pR={name:"Show",props:["title","subtitle","series"],data(){return{}},computed:xt(["host"]),methods:{openModal:function(s){this.$modal.show("ShowDialog",{show:this.series})},viewEpisodes:function(s){this.$router.push({name:"SeriesView",params:{seriesId:this.series.id}})}}};var mR=function(){var e=this,t=e._self._c;return t("li",{staticClass:"show"},[t("div",{staticClass:"show-poster",style:{backgroundImage:"url("+e.host+"/series/"+e.series.id+"/poster)"}},[t("a",{staticClass:"play",on:{click:e.viewEpisodes}},[t("i",{staticClass:"fa fa-eye",attrs:{"aria-hidden":"true"}})]),t("div",{staticClass:"actions"},[t("a",{staticClass:"action-item",attrs:{title:"Options"},on:{click:e.openModal}},[t("i",{staticClass:"fa fa-info",attrs:{"aria-hidden":"true"}})])])]),t("div",{staticClass:"title",attrs:{title:e.title}},[e._v(" "+e._s(e.title)+" ")]),e.subtitle?t("div",{staticClass:"subtitle"},[e._v(" "+e._s(e.subtitle)+" ")]):e._e()])},gR=[],vR=ve(pR,mR,gR,!1,null,"1d76d6b6");const yR=vR.exports,bR={name:"SeriesList",components:{Series:yR,ListContainer:eh},props:{series:Array,title:String,badge:String},methods:{seriesSubtitle(s){if(!s)return null;const e=[],t=this.formatYear(s.firstAired);t&&e.push(t);const i=this.normalizeText(s.network);i&&e.push(i);const r=this.formatRuntime(s.runtime);r&&e.push(r);const n=this.formatRating(s.siteRating,s.siteRatingCount,s.rating);n&&e.push(n);const a=this.formatGenres(s.genre,2);return a&&e.push(a),e.length===0?null:e.join(" | ")},formatYear(s){if(!s)return null;const e=String(s).match(/^\d{4}/);return e?e[0]:null},formatRuntime(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;const t=Math.floor(e/60),i=Math.round(e%60);return t>0&&i>0?`${t}h ${i}m`:t>0?`${t}h`:`${i}m`},formatRating(s,e,t){const i=Number(s);if(Number.isFinite(i)&&i>0){const n=Math.round(i*10)/10,a=Number(e);return Number.isFinite(a)&&a>0?`Rating ${n} (${this.formatCount(a)})`:`Rating ${n}`}return this.normalizeText(t)||null},formatCount(s){return Number.isFinite(s)?s>=1e6?`${Math.round(s/1e5)/10}m`:s>=1e3?`${Math.round(s/100)/10}k`:`${Math.round(s)}`:null},formatGenres(s,e=2){const t=this.normalizeGenres(s);return t.length?t.slice(0,e).join(", "):null},normalizeGenres(s){if(!s)return[];if(Array.isArray(s))return s.map(e=>String(e).trim()).filter(Boolean);if(typeof s=="string"){const e=s.trim();if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(Boolean)}catch{}return e.split(",").map(t=>t.trim()).filter(Boolean)}return[]},normalizeText(s){if(s==null)return null;const e=String(s).trim();return e.length>0?e:null}}};var SR=function(){var e=this,t=e._self._c;return t("ListContainer",{attrs:{title:e.title,badge:e.badge}},e._l(e.series,function(i,r){return t("Series",{key:i.id,attrs:{title:i.seriesName,"series-id":i.id,subtitle:e.seriesSubtitle(i),series:i,watching:i.watching}})}),1)},ER=[],_R=ve(bR,SR,ER,!1,null,"161d1f84");const ac=_R.exports,xR={name:"Movie",props:["title","movieId","subtitle","inside","horizontal","movie"],computed:xt(["host"]),created(){this.movie.TrackMovies[0]&&(this.progress=this.movie.TrackMovies[0].progress),gl().on("client-movie-progress",this.handleMovieProgress)},data(){return{progress:0}},beforeUnmount(){gl().off("client-movie-progress",this.handleMovieProgress)},methods:{handleMovieProgress:function(s){s.movieId===this.movieId&&(this.movie.TrackMovies[0]=s,this.progress=s.progress)},playMovie:function(s){s.preventDefault(),this.$store.dispatch("playMovie",this.movie.id)},openModal:function(s){this.$modal.show("MovieDialog",{movie:this.movie})},viewMovieInfo:function(s){this.$router.push({name:"MovieInfo",params:{movieId:this.movieId}})}}};var AR=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"slide-fade",appear:""}},[e.horizontal?t("li",{staticClass:"movie-horizontal"},[t("div",{staticClass:"movie-poster",style:{backgroundImage:"url("+e.host+"/movie/"+e.movieId+"/banner)"}},[t("a",{staticClass:"play",on:{click:e.playMovie}},[t("i",{staticClass:"fa fa-play",attrs:{"aria-hidden":"true"}})]),e.inside?t("div",{staticClass:"title",attrs:{title:e.title}},[e._v(" "+e._s(e.title)+" ")]):e._e(),t("div",{staticClass:"progress",style:{width:e.progress*100+"%"}})]),e.inside?e._e():t("div",{staticClass:"title",attrs:{title:e.title}},[e._v(" "+e._s(e.title)+" ")]),e.subtitle&&!e.inside?t("div",{staticClass:"subtitle"},[e._v(" "+e._s(e.subtitle)+" ")]):e._e()]):e._e(),e.horizontal?e._e():t("li",{staticClass:"movie-vertical"},[t("div",{staticClass:"movie-poster",style:{backgroundImage:"url("+e.host+"/movie/"+e.movieId+"/poster)"}},[t("a",{staticClass:"play",on:{click:e.playMovie}},[t("i",{staticClass:"fa fa-play",attrs:{"aria-hidden":"true"}})]),t("div",{staticClass:"actions"},[t("a",{staticClass:"action-item",attrs:{title:"Options"},on:{click:e.openModal}},[t("i",{staticClass:"fa fa-info",attrs:{"aria-hidden":"true"}})]),t("a",{staticClass:"action-item",attrs:{title:"Info"},on:{click:e.viewMovieInfo}},[t("i",{staticClass:"fa fa-eye",attrs:{"aria-hidden":"true"}})])]),t("div",{staticClass:"progress",style:{width:e.progress*100+"%"}})]),t("div",{staticClass:"title",attrs:{title:e.title}},[e._v(" "+e._s(e.title)+" ")]),e.subtitle?t("div",{staticClass:"subtitle"},[e._v(" "+e._s(e.subtitle)+" ")]):e._e()])])},TR=[],wR=ve(xR,AR,TR,!1,null,"38daab6e");const CR=wR.exports,LR={name:"MovieList",components:{Movie:CR,ListContainer:eh},props:{movies:Array,title:String,badge:String},methods:{movieSubtitle(s){if(!s)return null;const e=[],t=this.formatYear(s.releaseDate);t&&e.push(t);const i=this.formatRuntime(s.runtime);i&&e.push(i);const r=this.formatGenres(s.genres||s.genre,2);return r&&e.push(r),e.length>0?e.join(" | "):s.releaseDate?"Released: "+s.releaseDate:null},formatYear(s){if(!s)return null;const e=String(s).match(/^\d{4}/);return e?e[0]:null},formatRuntime(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;const t=Math.floor(e/60),i=Math.round(e%60);return t>0&&i>0?`${t}h ${i}m`:t>0?`${t}h`:`${i}m`},formatGenres(s,e=2){const t=this.normalizeGenres(s);return t.length?t.slice(0,e).join(", "):null},normalizeGenres(s){if(!s)return[];if(Array.isArray(s))return s.map(e=>String(e).trim()).filter(Boolean);if(typeof s=="string"){const e=s.trim();if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(Boolean)}catch{}return e.split(",").map(t=>t.trim()).filter(Boolean)}return[]}}};var IR=function(){var e=this,t=e._self._c;return t("ListContainer",{attrs:{title:e.title,badge:e.badge}},e._l(e.movies,function(i,r){return t("Movie",{key:i.id,attrs:{title:i.movieName,"movie-id":i.id,subtitle:e.movieSubtitle(i),movie:i}})}),1)},RR=[],DR=ve(LR,IR,RR,!1,null,"967d940f");const Ta=DR.exports,kR={name:"WatchPanel",components:{SeriesList:ac,EpisodeList:Aa,MovieList:Ta},computed:xt(["watchingEpisodes","watchingMovies","nextEpisodes"]),created(){},methods:{}};var PR=function(){var e=this,t=e._self._c;return t("div",{staticClass:"watching"},[t("tabs",{attrs:{options:{useUrlFragment:!1}}},[t("tab",{attrs:{name:"Tracked episodes",suffix:"<span class=badge>"+e.watchingEpisodes.length+"</span>"}},[t("EpisodeList",{attrs:{episodes:e.watchingEpisodes}})],1),t("tab",{attrs:{name:"Tracked movies",suffix:"<span class=badge>"+e.watchingMovies.length+"</span>"}},[t("MovieList",{attrs:{movies:e.watchingMovies}})],1),t("tab",{attrs:{name:"next up",suffix:"<span class=badge>"+e.nextEpisodes.length+"</span>"}},[t("EpisodeList",{attrs:{episodes:e.nextEpisodes}})],1)],1)],1)},OR=[],MR=ve(kR,PR,OR,!1,null,"a42969ab");const Lb=MR.exports,re=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},NR=Number.isSafeInteger||function(s){return typeof s=="number"&&Math.abs(s)<=FR},FR=Number.MAX_SAFE_INTEGER||9007199254740991;let fe=function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s}({}),V=function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",s.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",s.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.ASSET_LIST_LOAD_ERROR="assetListLoadError",s.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",s.ASSET_LIST_PARSING_ERROR="assetListParsingError",s.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.ATTACH_MEDIA_ERROR="attachMediaError",s.UNKNOWN="unknown",s}({}),b=function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.MEDIA_ENDED="hlsMediaEnded",s.STALL_RESOLVED="hlsStallResolved",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFERED_TO_END="hlsBufferedToEnd",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",s.ASSET_LIST_LOADING="hlsAssetListLoading",s.ASSET_LIST_LOADED="hlsAssetListLoaded",s.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",s.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",s.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",s.INTERSTITIAL_STARTED="hlsInterstitialStarted",s.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",s.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",s.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",s.INTERSTITIAL_ENDED="hlsInterstitialEnded",s.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",s.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",s.EVENT_CUE_ENTER="hlsEventCueEnter",s}({});var De={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ce={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class Mr{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class $R{constructor(e,t,i,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Mr(e),this.fast_=new Mr(t),this.defaultTTFB_=r,this.ttfb_=new Mr(e)}update(e,t){const{slow_:i,fast_:r,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new Mr(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new Mr(t,r.getEstimate(),r.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new Mr(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,r=e/1e3,n=i/r;this.fast_.sample(r,n),this.slow_.sample(r,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function BR(s,e,t){return(e=GR(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function ze(){return ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},ze.apply(null,arguments)}function eg(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(s,r).enumerable})),t.push.apply(t,i)}return t}function Ke(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eg(Object(t),!0).forEach(function(i){BR(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):eg(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function UR(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function GR(s){var e=UR(s,"string");return typeof e=="symbol"?e:e+""}class Es{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const i=`[${e}]:`;this.trace=Pi,this.debug=t.debug.bind(null,i),this.log=t.log.bind(null,i),this.warn=t.warn.bind(null,i),this.info=t.info.bind(null,i),this.error=t.error.bind(null,i)}}const Pi=function(){},HR={trace:Pi,debug:Pi,log:Pi,warn:Pi,info:Pi,error:Pi};function Df(){return ze({},HR)}function YR(s,e){const t=self.console[s];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${s}] >`):Pi}function tg(s,e,t){return e[s]?e[s].bind(e):YR(s,t)}const kf=Df();function jR(s,e,t){const i=Df();if(typeof console=="object"&&s===!0||typeof s=="object"){const r=["debug","log","info","warn","error"];r.forEach(n=>{i[n]=tg(n,s,t)});try{i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return Df()}r.forEach(n=>{kf[n]=tg(n,s)})}else ze(kf,i);return i}const We=kf;function Xi(s=!0){return typeof self>"u"?void 0:(s||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function VR(s){return typeof self<"u"&&s===self.ManagedMediaSource}function Ib(s,e){const t=Object.keys(s),i=Object.keys(e),r=t.length,n=i.length;return!r||!n||r===n&&!t.some(a=>i.indexOf(a)===-1)}function os(s,e=!1){if(typeof TextDecoder<"u"){const c=new TextDecoder("utf-8").decode(s);if(e){const u=c.indexOf("\0");return u!==-1?c.substring(0,u):c}return c.replace(/\0/g,"")}const t=s.length;let i,r,n,a="",o=0;for(;o<t;){if(i=s[o++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:r=s[o++],a+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=s[o++],n=s[o++],a+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return a}function Tt(s){let e="";for(let t=0;t<s.length;t++){let i=s[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}function Rb(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function KR(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var mu={exports:{}},sg;function WR(){return sg||(sg=1,function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,u){if(u=u||{},l=l.trim(),c=c.trim(),!c){if(!u.alwaysNormalize)return l;var f=o.parseURL(l);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return u.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var h=o.parseURL(l);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var p=r.exec(h.path);h.netLoc=p[1],h.path=p[2]}h.netLoc&&!h.path&&(h.path="/");var g={scheme:h.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(g.netLoc=h.netLoc,d.path[0]!=="/"))if(!d.path)g.path=h.path,d.params||(g.params=h.params,d.query||(g.query=h.query));else{var m=h.path,v=m.substring(0,m.lastIndexOf("/")+1)+d.path;g.path=o.normalizePath(v)}return g.path===null&&(g.path=u.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(g)},parseURL:function(l){var c=i.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})()}(mu)),mu.exports}var th=WR();class sh{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var qe={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Db{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,QR(this,"stats")}setByteRange(e,t){const i=e.split("@",2);let r;i.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(i[1]),this._byteRange=[r,parseInt(i[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[qe.AUDIO]:null,[qe.VIDEO]:null,[qe.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new sh),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=th.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[qe.AUDIO]=null,e[qe.VIDEO]=null,e[qe.AUDIOVIDEO]=null}}function ht(s){return s.sn!=="initSegment"}class gu extends Db{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(re(e)&&re(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const i=Object.keys(t);if(i.length===1){const r=this._decryptdata=t[i[0]]||null;r&&(this._decryptdata=r.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=re(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const i=Object.keys(this.levelkeys),r=i.length;if(r>1||r===1&&(t=this.levelkeys[i[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!re(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ht(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var i;const r=t[e];r&&!((i=this._decryptdata)!=null&&i.keyId)&&(this._decryptdata=r.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,i,r,n,a=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:n,partial:a};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,i),l.startDTS=Math.min(l.startDTS,r),l.endDTS=Math.max(l.endDTS,n)}}class zR extends Db{constructor(e,t,i,r,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function kb(s,e){const t=Object.getPrototypeOf(s);if(t){const i=Object.getOwnPropertyDescriptor(t,e);return i||kb(t,e)}}function QR(s,e){const t=kb(s,e);t&&(t.enumerable=!0,Object.defineProperty(s,e,t))}const ig=Math.pow(2,32)-1,qR=[].push,Pb={video:1,audio:2,id3:3,text:4};function gt(s){return String.fromCharCode.apply(null,s)}function Ob(s,e){const t=s[e]<<8|s[e+1];return t<0?65536+t:t}function me(s,e){const t=Mb(s,e);return t<0?4294967296+t:t}function rg(s,e){let t=me(s,e);return t*=Math.pow(2,32),t+=me(s,e+4),t}function Mb(s,e){return s[e]<<24|s[e+1]<<16|s[e+2]<<8|s[e+3]}function XR(s){const e=s.byteLength;for(let t=0;t<e;){const i=me(s,t);if(i>8&&s[t+4]===109&&s[t+5]===111&&s[t+6]===111&&s[t+7]===102)return!0;t=i>1?t+i:e}return!1}function Ie(s,e){const t=[];if(!e.length)return t;const i=s.byteLength;for(let r=0;r<i;){const n=me(s,r),a=gt(s.subarray(r+4,r+8)),o=n>1?r+n:i;if(a===e[0])if(e.length===1)t.push(s.subarray(r+8,o));else{const l=Ie(s.subarray(r+8,o),e.slice(1));l.length&&qR.apply(t,l)}r=o}return t}function JR(s){const e=[],t=s[0];let i=8;const r=me(s,i);i+=4;let n=0,a=0;t===0?(n=me(s,i),a=me(s,i+4),i+=8):(n=rg(s,i),a=rg(s,i+8),i+=16),i+=2;let o=s.length+a;const l=Ob(s,i);i+=2;for(let c=0;c<l;c++){let u=i;const f=me(s,u);u+=4;const d=f&2147483647;if((f&2147483648)>>>31===1)return We.warn("SIDX has hierarchical references (not supported)"),null;const p=me(s,u);u+=4,e.push({referenceSize:d,subsegmentDuration:p,info:{duration:p/r,start:o,end:o+d-1}}),o+=d,u+=4,i=u}return{earliestPresentationTime:n,timescale:r,version:t,referencesCount:l,references:e}}function Nb(s){const e=[],t=Ie(s,["moov","trak"]);for(let r=0;r<t.length;r++){const n=t[r],a=Ie(n,["tkhd"])[0];if(a){let o=a[0];const l=me(a,o===0?12:20),c=Ie(n,["mdia","mdhd"])[0];if(c){o=c[0];const u=me(c,o===0?12:20),f=Ie(n,["mdia","hdlr"])[0];if(f){const d=gt(f.subarray(8,12)),h={soun:qe.AUDIO,vide:qe.VIDEO}[d],p=Ie(n,["mdia","minf","stbl","stsd"])[0],g=ZR(p);h?(e[l]={timescale:u,type:h,stsd:g},e[h]=Ke({timescale:u,id:l},g)):e[l]={timescale:u,type:d,stsd:g}}}}}return Ie(s,["moov","mvex","trex"]).forEach(r=>{const n=me(r,4),a=e[n];a&&(a.default={duration:me(r,12),flags:me(r,20)})}),e}function ZR(s){const e=s.subarray(8),t=e.subarray(86),i=gt(e.subarray(4,8));let r=i,n;const a=i==="enca"||i==="encv";if(a){const c=Ie(e,[i])[0].subarray(i==="enca"?28:78);Ie(c,["sinf"]).forEach(f=>{const d=Ie(f,["schm"])[0];if(d){const h=gt(d.subarray(4,8));if(h==="cbcs"||h==="cenc"){const p=Ie(f,["frma"])[0];p&&(r=gt(p))}}})}const o=r;switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const l=Ie(t,["avcC"])[0];l&&l.length>3&&(r+="."+eo(l[1])+eo(l[2])+eo(l[3]),n=Za(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const l=Ie(e,[i])[0],c=Ie(l.subarray(28),["esds"])[0];if(c&&c.length>7){let u=4;if(c[u++]!==3)break;u=vu(c,u),u+=2;const f=c[u++];if(f&128&&(u+=2),f&64&&(u+=c[u++]),c[u++]!==4)break;u=vu(c,u);const d=c[u++];if(d===64)r+="."+eo(d);else break;if(u+=12,c[u++]!==5)break;u=vu(c,u);const h=c[u++];let p=(h&248)>>3;p===31&&(p+=1+((h&7)<<3)+((c[u]&224)>>5)),r+="."+p}break}case"hvc1":case"hev1":{const l=Ie(t,["hvcC"])[0];if(l&&l.length>12){const c=l[1],u=["","A","B","C"][c>>6],f=c&31,d=me(l,2),h=(c&32)>>5?"H":"L",p=l[12],g=l.subarray(6,12);r+="."+u+f,r+="."+eD(d).toString(16).toUpperCase(),r+="."+h+p;let m="";for(let v=g.length;v--;){const y=g[v];(y||m)&&(m="."+y.toString(16).toUpperCase()+m)}r+=m}n=Za(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{r=Za(r,t)||r;break}case"vp09":{const l=Ie(t,["vpcC"])[0];if(l&&l.length>6){const c=l[4],u=l[5],f=l[6]>>4&15;r+="."+js(c)+"."+js(u)+"."+js(f)}break}case"av01":{const l=Ie(t,["av1C"])[0];if(l&&l.length>2){const c=l[1]>>>5,u=l[1]&31,f=l[2]>>>7?"H":"M",d=(l[2]&64)>>6,h=(l[2]&32)>>5,p=c===2&&d?h?12:10:d?10:8,g=(l[2]&16)>>4,m=(l[2]&8)>>3,v=(l[2]&4)>>2,y=l[2]&3;r+="."+c+"."+js(u)+f+"."+js(p)+"."+g+"."+m+v+y+"."+js(1)+"."+js(1)+"."+js(1)+"."+0,n=Za("dav1",t)}break}}return{codec:r,encrypted:a,supplemental:n}}function Za(s,e){const t=Ie(e,["dvvC"]),i=t.length?t[0]:Ie(e,["dvcC"])[0];if(i){const r=i[2]>>1&127,n=i[2]<<5&32|i[3]>>3&31;return s+"."+js(r)+"."+js(n)}}function eD(s){let e=0;for(let t=0;t<32;t++)e|=(s>>t&1)<<31-t;return e>>>0}function vu(s,e){const t=e+5;for(;s[e++]&128&&e<t;);return e}function eo(s){return("0"+s.toString(16).toUpperCase()).slice(-2)}function js(s){return(s<10?"0":"")+s}function tD(s,e){if(!s||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&Fb(s,(i,r)=>{const n=i.subarray(8,24);n.some(a=>a!==0)||(We.log(`[eme] Patching keyId in 'enc${r?"a":"v"}>sinf>>tenc' box: ${Tt(n)} -> ${Tt(t)}`),i.set(t,8))})}function sD(s){const e=[];return Fb(s,t=>e.push(t.subarray(8,24))),e}function Fb(s,e){Ie(s,["moov","trak"]).forEach(i=>{const r=Ie(i,["mdia","minf","stbl","stsd"])[0];if(!r)return;const n=r.subarray(8);let a=Ie(n,["enca"]);const o=a.length>0;o||(a=Ie(n,["encv"])),a.forEach(l=>{const c=o?l.subarray(28):l.subarray(78);Ie(c,["sinf"]).forEach(f=>{const d=$b(f);d&&e(d,o)})})})}function $b(s){const e=Ie(s,["schm"])[0];if(e){const t=gt(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const i=Ie(s,["schi","tenc"])[0];if(i)return i}}}function iD(s,e,t){const i={},r=Ie(s,["moof","traf"]);for(let n=0;n<r.length;n++){const a=r[n],o=Ie(a,["tfhd"])[0],l=me(o,4),c=e[l];if(!c)continue;i[l]||(i[l]={start:NaN,duration:0,sampleCount:0,timescale:c.timescale,type:c.type});const u=i[l],f=Ie(a,["tfdt"])[0];if(f){const E=f[0];let w=me(f,4);E===1&&(w===ig?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(w*=ig+1,w+=me(f,8))),re(w)&&(!re(u.start)||w<u.start)&&(u.start=w)}const d=c.default,h=me(o,0)|(d==null?void 0:d.flags);let p=(d==null?void 0:d.duration)||0;h&8&&(h&2?p=me(o,12):p=me(o,8));const g=Ie(a,["trun"]);let m=u.start||0,v=0,y=p;for(let E=0;E<g.length;E++){const w=g[E],T=me(w,4),$=u.sampleCount;u.sampleCount+=T;const k=w[3]&1,M=w[3]&4,_=w[2]&1,C=w[2]&2,U=w[2]&4,L=w[2]&8;let R=8,B=T;for(k&&(R+=4),M&&T&&(!(w[R+1]&1)&&u.keyFrameIndex===void 0&&(u.keyFrameIndex=$),R+=4,_?(y=me(w,R),R+=4):y=p,C&&(R+=4),L&&(R+=4),m+=y,v+=y,B--);B--;)_?(y=me(w,R),R+=4):y=p,C&&(R+=4),U&&(w[R+1]&1||u.keyFrameIndex===void 0&&(u.keyFrameIndex=u.sampleCount-(B+1),u.keyFrameStart=m),R+=4),L&&(R+=4),m+=y,v+=y;!v&&p&&(v+=p*T)}u.duration+=v}if(!Object.keys(i).some(n=>i[n].duration)){let n=1/0,a=0;const o=Ie(s,["sidx"]);for(let l=0;l<o.length;l++){const c=JR(o[l]);if(c!=null&&c.references){n=Math.min(n,c.earliestPresentationTime/c.timescale);const u=c.references.reduce((f,d)=>f+d.info.duration||0,0);a=Math.max(a,u+c.earliestPresentationTime/c.timescale)}}a&&re(a)&&Object.keys(i).forEach(l=>{i[l].duration||(i[l].duration=a*i[l].timescale-i[l].start)})}return i}function rD(s){const e={valid:null,remainder:null},t=Ie(s,["moof"]);if(t.length<2)return e.remainder=s,e;const i=t[t.length-1];return e.valid=s.slice(0,i.byteOffset-8),e.remainder=s.slice(i.byteOffset-8),e}function bs(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function ng(s,e){const t=[],i=e.samples,r=e.timescale,n=e.id;let a=!1;return Ie(i,["moof"]).map(l=>{const c=l.byteOffset-8;Ie(l,["traf"]).map(f=>{const d=Ie(f,["tfdt"]).map(h=>{const p=h[0];let g=me(h,4);return p===1&&(g*=Math.pow(2,32),g+=me(h,8)),g/r})[0];return d!==void 0&&(s=d),Ie(f,["tfhd"]).map(h=>{const p=me(h,4),g=me(h,0)&16777215,m=(g&1)!==0,v=(g&2)!==0,y=(g&8)!==0;let E=0;const w=(g&16)!==0;let T=0;const $=(g&32)!==0;let k=8;p===n&&(m&&(k+=8),v&&(k+=4),y&&(E=me(h,k),k+=4),w&&(T=me(h,k),k+=4),$&&(k+=4),e.type==="video"&&(a=oc(e.codec)),Ie(f,["trun"]).map(M=>{const _=M[0],C=me(M,0)&16777215,U=(C&1)!==0;let L=0;const R=(C&4)!==0,B=(C&256)!==0;let S=0;const A=(C&512)!==0;let I=0;const D=(C&1024)!==0,O=(C&2048)!==0;let H=0;const N=me(M,4);let P=8;U&&(L=me(M,P),P+=4),R&&(P+=4);let Y=L+c;for(let z=0;z<N;z++){if(B?(S=me(M,P),P+=4):S=E,A?(I=me(M,P),P+=4):I=T,D&&(P+=4),O&&(_===0?H=me(M,P):H=Mb(M,P),P+=4),e.type===qe.VIDEO){let J=0;for(;J<I;){const x=me(i,Y);if(Y+=4,nD(a,i[Y])){const F=i.subarray(Y,Y+x);ih(F,a?2:1,s+H/r,t)}Y+=x,J+=x+4}}s+=S/r}}))})})}),t}function oc(s){if(!s)return!1;const e=s.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function nD(s,e){if(s){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function ih(s,e,t,i){const r=Bb(s);let n=0;n+=e;let a=0,o=0,l=0;for(;n<r.length;){a=0;do{if(n>=r.length)break;l=r[n++],a+=l}while(l===255);o=0;do{if(n>=r.length)break;l=r[n++],o+=l}while(l===255);const c=r.length-n;let u=n;if(o<c)n+=o;else if(o>c){We.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(a===4){if(r[u++]===181){const d=Ob(r,u);if(u+=2,d===49){const h=me(r,u);if(u+=4,h===1195456820){const p=r[u++];if(p===3){const g=r[u++],m=31&g,v=64&g,y=v?2+m*3:0,E=new Uint8Array(y);if(v){E[0]=g;for(let w=1;w<y;w++)E[w]=r[u++]}i.push({type:p,payloadType:a,pts:t,bytes:E})}}}}}else if(a===5&&o>16){const f=[];for(let p=0;p<16;p++){const g=r[u++].toString(16);f.push(g.length==1?"0"+g:g),(p===3||p===5||p===7||p===9)&&f.push("-")}const d=o-16,h=new Uint8Array(d);for(let p=0;p<d;p++)h[p]=r[u++];i.push({payloadType:a,pts:t,uuid:f.join(""),userData:os(h),userDataBytes:h})}}}function Bb(s){const e=s.byteLength,t=[];let i=1;for(;i<e-2;)s[i]===0&&s[i+1]===0&&s[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return s;const r=e-t.length,n=new Uint8Array(r);let a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=s[a];return n}function aD(s){const e=s[0];let t="",i="",r=0,n=0,a=0,o=0,l=0,c=0;if(e===0){for(;gt(s.subarray(c,c+1))!=="\0";)t+=gt(s.subarray(c,c+1)),c+=1;for(t+=gt(s.subarray(c,c+1)),c+=1;gt(s.subarray(c,c+1))!=="\0";)i+=gt(s.subarray(c,c+1)),c+=1;i+=gt(s.subarray(c,c+1)),c+=1,r=me(s,12),n=me(s,16),o=me(s,20),l=me(s,24),c=28}else if(e===1){c+=4,r=me(s,c),c+=4;const f=me(s,c);c+=4;const d=me(s,c);for(c+=4,a=2**32*f+d,NR(a)||(a=Number.MAX_SAFE_INTEGER,We.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=me(s,c),c+=4,l=me(s,c),c+=4;gt(s.subarray(c,c+1))!=="\0";)t+=gt(s.subarray(c,c+1)),c+=1;for(t+=gt(s.subarray(c,c+1)),c+=1;gt(s.subarray(c,c+1))!=="\0";)i+=gt(s.subarray(c,c+1)),c+=1;i+=gt(s.subarray(c,c+1)),c+=1}const u=s.subarray(c,s.byteLength);return{schemeIdUri:t,value:i,timeScale:r,presentationTime:a,presentationTimeDelta:n,eventDuration:o,id:l,payload:u}}function oD(s,...e){const t=e.length;let i=8,r=t;for(;r--;)i+=e[r].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=i&255,n.set(s,4),r=0,i=8;r<t;r++)n.set(e[r],i),i+=e[r].byteLength;return n}function lD(s,e,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");let i,r;i=0,r=new Uint8Array;let n;i>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),oD([112,115,115,104],new Uint8Array([i,0,0,0]),s,n,r,a,t)}function cD(s){const e=[];if(s instanceof ArrayBuffer){const t=s.byteLength;let i=0;for(;i+32<t;){const r=new DataView(s,i),n=uD(r);e.push(n),i+=n.size}}return e}function uD(s){const e=s.getUint32(0),t=s.byteOffset,i=s.byteLength;if(i<e)return{offset:t,size:i};if(s.getUint32(4)!==1886614376)return{offset:t,size:e};const n=s.getUint32(8)>>>24;if(n!==0&&n!==1)return{offset:t,size:e};const a=s.buffer,o=Tt(new Uint8Array(a,t+12,16));let l=null,c=null,u=0;if(n===0)u=28;else{const d=s.getUint32(28);if(!d||i<32+d*16)return{offset:t,size:e};l=[];for(let h=0;h<d;h++)l.push(new Uint8Array(a,t+32+h*16,16));u=32+d*16}if(!u)return{offset:t,size:e};const f=s.getUint32(u);return e-32<f?{offset:t,size:e}:(c=new Uint8Array(a,t+u+4,f),{version:n,systemId:o,kids:l,data:c,offset:t,size:e})}const Ub=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),cn={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function rh(s,e){const t=cn[e];return!!t&&!!t[s.slice(0,4)]}function la(s,e,t=!0){return!s.split(",").some(i=>!nh(i,e,t))}function nh(s,e,t=!0){var i;const r=Xi(t);return(i=r==null?void 0:r.isTypeSupported(ca(s,e)))!=null?i:!1}function ca(s,e){return`${e}/mp4;codecs=${s}`}function ag(s){if(s){const e=s.substring(0,4);return cn.video[e]}return 2}function vl(s){const e=Ub();return s.split(",").reduce((t,i)=>{const n=e&&oc(i)?9:cn.video[i];return n?(n*2+t)/(t?3:2):(cn.audio[i]+t)/(t?2:1)},0)}const yu={};function fD(s,e=!0){if(yu[s])return yu[s];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[s];for(let r=0;r<t.length;r++){var i;if(nh(t[r],"audio",e))return yu[s]=t[r],t[r];if(t[r]==="mp3"&&(i=Xi(e))!=null&&i.isTypeSupported("audio/mpeg"))return""}return s}const dD=/flac|opus|mp4a\.40\.34/i;function yl(s,e=!0){return s.replace(dD,t=>fD(t.toLowerCase(),e))}function hD(s,e){const t=[];if(s){const i=s.split(",");for(let r=0;r<i.length;r++)rh(i[r],"video")||t.push(i[r])}return e&&t.push(e),t.join(",")}function ko(s,e){if(s&&(s.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(s)!==-1)&&(og(s,"audio")||og(s,"video")))return s;if(e){const t=e.split(",");if(t.length>1){if(s){for(let i=t.length;i--;)if(t[i].substring(0,4)===s.substring(0,4))return t[i]}return t[0]}}return e||s}function og(s,e){return rh(s,e)&&nh(s,e)}function pD(s){const e=s.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&i[0]==="avc1"&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}function mD(s){if(s.startsWith("av01.")){const e=s.split("."),t=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=t[i-4];return e.join(".")}return s}function lg(s){const e=Xi(s)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Pf(s){return s.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const gD={supported:!0,powerEfficient:!0,smooth:!0},vD={supported:!1,smooth:!1,powerEfficient:!1},Gb={supported:!0,configurations:[],decodingInfoResults:[gD]};function Hb(s,e){return{supported:!1,configurations:e,decodingInfoResults:[vD],error:s}}function yD(s,e,t,i,r,n){const a=s.videoCodec,o=s.audioCodec?s.audioGroups:null,l=n==null?void 0:n.audioCodec,c=n==null?void 0:n.channels,u=c?parseInt(c):l?1/0:2;let f=null;if(o!=null&&o.length)try{o.length===1&&o[0]?f=e.groups[o[0]].channels:f=o.reduce((d,h)=>{if(h){const p=e.groups[h];if(!p)throw new Error(`Audio track group ${h} not found`);Object.keys(p.channels).forEach(g=>{d[g]=(d[g]||0)+p.channels[g]})}return d},{2:0})}catch{return!0}return a!==void 0&&(a.split(",").some(d=>oc(d))||s.width>1920&&s.height>1088||s.height>1920&&s.width>1088||s.frameRate>Math.max(i,30)||s.videoRange!=="SDR"&&s.videoRange!==t||s.bitrate>Math.max(r,8e6))||!!f&&re(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function Yb(s,e,t,i={}){const r=s.videoCodec;if(!r&&!s.audioCodec||!t)return Promise.resolve(Gb);const n=[],a=bD(s),o=a.length,l=SD(s,e,o>0),c=l.length;for(let u=o||1*c||1;u--;){const f={type:"media-source"};if(o&&(f.video=a[u%o]),c){f.audio=l[u%c];const d=f.audio.bitrate;f.video&&d&&(f.video.bitrate-=d)}n.push(f)}if(r){const u=navigator.userAgent;if(r.split(",").some(f=>oc(f))&&Ub())return Promise.resolve(Hb(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${u})`),n))}return Promise.all(n.map(u=>{const f=_D(u);return i[f]||(i[f]=t.decodingInfo(u))})).then(u=>({supported:!u.some(f=>!f.supported),configurations:n,decodingInfoResults:u})).catch(u=>({supported:!1,configurations:n,decodingInfoResults:[],error:u}))}function bD(s){var e;const t=(e=s.videoCodec)==null?void 0:e.split(","),i=jb(s),r=s.width||640,n=s.height||480,a=s.frameRate||30,o=s.videoRange.toLowerCase();return t?t.map(l=>{const c={contentType:ca(mD(l),"video"),width:r,height:n,bitrate:i,framerate:a};return o!=="sdr"&&(c.transferFunction=o),c}):[]}function SD(s,e,t){var i;const r=(i=s.audioCodec)==null?void 0:i.split(","),n=jb(s);return r&&s.audioGroups?s.audioGroups.reduce((a,o)=>{var l;const c=o?(l=e.groups[o])==null?void 0:l.tracks:null;return c?c.reduce((u,f)=>{if(f.groupId===o){const d=parseFloat(f.channels||"");r.forEach(h=>{const p={contentType:ca(h,"audio"),bitrate:t?ED(h,n):n};d&&(p.channels=""+d),u.push(p)})}return u},a):a},[]):[]}function ED(s,e){if(e<=1)return 1;let t=128e3;return s==="ec-3"?t=768e3:s==="ac-3"&&(t=64e4),Math.min(e/2,t)}function jb(s){return Math.ceil(Math.max(s.bitrate*.9,s.averageBitrate)/1e3)*1e3||1}function _D(s){let e="";const{audio:t,video:i}=s;if(i){const r=Pf(i.contentType);e+=`${r}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${Math.ceil(i.bitrate/1e5)}`}if(t){const r=Pf(t.contentType);e+=`${i?"_":""}${r}_c${t.channels}`}return e}const Of=["NONE","TYPE-0","TYPE-1",null];function xD(s){return Of.indexOf(s)>-1}const bl=["SDR","PQ","HLG"];function AD(s){return!!s&&bl.indexOf(s)>-1}var Po={No:"",Yes:"YES",v2:"v2"};function cg(s){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=s,r=i<e/2;return e&&r?t?Po.v2:Po.Yes:Po.No}class ug{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class ua{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(i=>!!i).map(i=>i.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const i=(t=e.supplemental)==null?void 0:t.videoCodec;i&&i!==e.videoCodec&&(this.codecSet+=`,${i.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return fg(this._audioGroups,e)}hasSubtitleGroup(e){return fg(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function fg(s,e){return!e||!s?!1:s.indexOf(e)!==-1}function TD(){if(typeof matchMedia=="function"){const s=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(s.media!==e.media)return s.matches===!0}return!1}function wD(s,e){let t=!1,i=[];if(s&&(t=s!=="SDR",i=[s]),e){i=e.allowedVideoRanges||bl.slice(0);const r=i.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:r&&TD(),t||(i=["SDR"])}return{preferHDR:t,allowedVideoRanges:i}}const CD=s=>{const e=new WeakSet;return(t,i)=>{if(s&&(i=s(t,i)),typeof i=="object"&&i!==null){if(e.has(i))return;e.add(i)}return i}},Xe=(s,e)=>JSON.stringify(s,CD(e));function LD(s,e,t,i,r){const n=Object.keys(s),a=i==null?void 0:i.channels,o=i==null?void 0:i.audioCodec,l=r==null?void 0:r.videoCodec,c=a&&parseInt(a)===2;let u=!1,f=!1,d=1/0,h=1/0,p=1/0,g=1/0,m=0,v=[];const{preferHDR:y,allowedVideoRanges:E}=wD(e,r);for(let M=n.length;M--;){const _=s[n[M]];u||(u=_.channels[2]>0),d=Math.min(d,_.minHeight),h=Math.min(h,_.minFramerate),p=Math.min(p,_.minBitrate),E.filter(U=>_.videoRanges[U]>0).length>0&&(f=!0)}d=re(d)?d:0,h=re(h)?h:0;const w=Math.max(1080,d),T=Math.max(30,h);p=re(p)?p:t,t=Math.max(p,t),f||(e=void 0);const $=n.length>1;return{codecSet:n.reduce((M,_)=>{const C=s[_];if(_===M)return M;if(v=f?E.filter(U=>C.videoRanges[U]>0):[],$){if(C.minBitrate>t)return Gs(_,`min bitrate of ${C.minBitrate} > current estimate of ${t}`),M;if(!C.hasDefaultAudio)return Gs(_,"no renditions with default or auto-select sound found"),M;if(o&&_.indexOf(o.substring(0,4))%5!==0)return Gs(_,`audio codec preference "${o}" not found`),M;if(a&&!c){if(!C.channels[a])return Gs(_,`no renditions with ${a} channel sound found (channels options: ${Object.keys(C.channels)})`),M}else if((!o||c)&&u&&C.channels[2]===0)return Gs(_,"no renditions with stereo sound found"),M;if(C.minHeight>w)return Gs(_,`min resolution of ${C.minHeight} > maximum of ${w}`),M;if(C.minFramerate>T)return Gs(_,`min framerate of ${C.minFramerate} > maximum of ${T}`),M;if(!v.some(U=>C.videoRanges[U]>0))return Gs(_,`no variants with VIDEO-RANGE of ${Xe(v)} found`),M;if(l&&_.indexOf(l.substring(0,4))%5!==0)return Gs(_,`video codec preference "${l}" not found`),M;if(C.maxScore<m)return Gs(_,`max score of ${C.maxScore} < selected max of ${m}`),M}return M&&(vl(_)>=vl(M)||C.fragmentError>s[M].fragmentError)?M:(g=C.minIndex,m=C.maxScore,_)},void 0),videoRanges:v,preferHDR:y,minFramerate:h,minBitrate:p,minIndex:g}}function Gs(s,e){We.log(`[abr] start candidates with "${s}" ignored because ${e}`)}function Vb(s){return s.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const r=t.channels||"2";return i.channels[r]=(i.channels[r]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function ID(s,e,t,i){return s.slice(t,i+1).reduce((r,n,a)=>{if(!n.codecSet)return r;const o=n.audioGroups;let l=r[n.codecSet];l||(r[n.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,n.bitrate);const c=Math.min(n.height,n.width);return l.minHeight=Math.min(l.minHeight,c),l.minFramerate=Math.min(l.minFramerate,n.frameRate),l.minIndex=Math.min(l.minIndex,a),l.maxScore=Math.max(l.maxScore,n.score),l.fragmentError+=n.fragmentError,l.videoRanges[n.videoRange]=(l.videoRanges[n.videoRange]||0)+1,o&&o.forEach(u=>{if(!u)return;const f=e.groups[u];f&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(d=>{l.channels[d]=(l.channels[d]||0)+f.channels[d]}))}),r},{})}function dg(s){if(!s)return s;const{lang:e,assocLang:t,characteristics:i,channels:r,audioCodec:n}=s;return{lang:e,assocLang:t,characteristics:i,channels:r,audioCodec:n}}function zs(s,e,t){if("attrs"in s){const i=e.indexOf(s);if(i!==-1)return i}for(let i=0;i<e.length;i++){const r=e[i];if(mr(s,r,t))return i}return-1}function mr(s,e,t){const{groupId:i,name:r,lang:n,assocLang:a,default:o}=s,l=s.forced;return(i===void 0||e.groupId===i)&&(r===void 0||e.name===r)&&(n===void 0||RD(n,e.lang))&&(n===void 0||e.assocLang===a)&&(o===void 0||e.default===o)&&(l===void 0||e.forced===l)&&(!("characteristics"in s)||DD(s.characteristics||"",e.characteristics))&&(t===void 0||t(s,e))}function RD(s,e="--"){return s.length===e.length?s===e:s.startsWith(e)||e.startsWith(s)}function DD(s,e=""){const t=s.split(","),i=e.split(",");return t.length===i.length&&!t.some(r=>i.indexOf(r)===-1)}function lr(s,e){const{audioCodec:t,channels:i}=s;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function kD(s,e,t,i,r){const n=e[i],o=e.reduce((d,h,p)=>{const g=h.uri;return(d[g]||(d[g]=[])).push(p),d},{})[n.uri];o.length>1&&(i=Math.max.apply(Math,o));const l=n.videoRange,c=n.frameRate,u=n.codecSet.substring(0,4),f=hg(e,i,d=>{if(d.videoRange!==l||d.frameRate!==c||d.codecSet.substring(0,4)!==u)return!1;const h=d.audioGroups,p=t.filter(g=>!h||h.indexOf(g.groupId)!==-1);return zs(s,p,r)>-1});return f>-1?f:hg(e,i,d=>{const h=d.audioGroups,p=t.filter(g=>!h||h.indexOf(g.groupId)!==-1);return zs(s,p,r)>-1})}function hg(s,e,t){for(let i=e;i>-1;i--)if(t(s[i]))return i;for(let i=e+1;i<s.length;i++)if(t(s[i]))return i;return-1}function Sl(s,e){var t;return!!s&&s!==((t=e.loadLevelObj)==null?void 0:t.uri)}class PD extends Es{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var i;const{fragCurrent:r,partCurrent:n,hls:a}=this,{autoLevelEnabled:o,media:l}=a;if(!r||!l)return;const c=performance.now(),u=n?n.stats:r.stats,f=n?n.duration:r.duration,d=c-u.loading.start,h=a.minAutoLevel,p=r.level,g=this._nextAutoLevel;if(u.aborted||u.loaded&&u.loaded===u.total||p<=h){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const m=g>-1&&g!==p,v=!!t||m;if(!v&&(l.paused||!l.playbackRate||!l.readyState))return;const y=a.mainForwardBufferInfo;if(!v&&y===null)return;const E=this.bwEstimator.getEstimateTTFB(),w=Math.abs(l.playbackRate);if(d<=Math.max(E,1e3*(f/(w*2))))return;const T=y?y.len/w:0,$=u.loading.first?u.loading.first-u.loading.start:-1,k=u.loaded&&$>-1,M=this.getBwEstimate(),_=a.levels,C=_[p],U=Math.max(u.loaded,Math.round(f*(r.bitrate||C.averageBitrate)/8));let L=k?d-$:d;L<1&&k&&(L=Math.min(d,u.loaded*8/M));const R=k?u.loaded*1e3/L:0,B=E/1e3,S=R?(U-u.loaded)/R:U*8/M+B;if(S<=T)return;const A=R?R*8:M,I=((i=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:i.live)===!0,D=this.hls.config.abrBandWidthUpFactor;let O=Number.POSITIVE_INFINITY,H;for(H=p-1;H>h;H--){const z=_[H].maxBitrate,J=!_[H].details||I;if(O=this.getTimeToLoadFrag(B,A,f*z,J),O<Math.min(T,f+B))break}if(O>=S||O>f*10)return;k?this.bwEstimator.sample(d-Math.min(E,$),u.loaded):this.bwEstimator.sampleTTFB(d);const N=_[H].maxBitrate;this.getBwEstimate()*D>N&&this.resetEstimator(N);const P=this.findBestLevel(N,h,H,0,T,1,1);P>-1&&(H=P),this.warn(`Fragment ${r.sn}${n?" part "+n.index:""} of level ${p} is loading too slowly;
|
|
357
|
+
Fragment duration: ${r.duration.toFixed(3)}
|
|
358
|
+
Time to underbuffer: ${T.toFixed(3)} s
|
|
359
|
+
Estimated load time for current fragment: ${S.toFixed(3)} s
|
|
360
|
+
Estimated load time for down switch fragment: ${O.toFixed(3)} s
|
|
361
|
+
TTFB estimate: ${$|0} ms
|
|
362
|
+
Current BW estimate: ${re(M)?M|0:"Unknown"} bps
|
|
363
|
+
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
364
|
+
Switching to level ${H} @ ${N|0} bps`),a.nextLoadLevel=a.nextAutoLevel=H,this.clearTimer();const Y=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===H&&H>0){const z=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${H>0?"and switching down":""}
|
|
365
|
+
Fragment duration: ${r.duration.toFixed(3)} s
|
|
366
|
+
Time to underbuffer: ${z.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,H>h){let J=this.findBestLevel(this.hls.levels[h].bitrate,h,H,0,z,1,1);J===-1&&(J=h),this.hls.nextLoadLevel=this.hls.nextAutoLevel=J,this.resetEstimator(this.hls.levels[J].bitrate)}}};m||S>O*2?Y():this.timer=self.setInterval(Y,O*1e3),a.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:n,stats:u})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new $R(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.FRAG_LOADING,this.onFragLoading,this),e.on(b.FRAG_LOADED,this.onFragLoaded,this),e.on(b.FRAG_BUFFERED,this.onFragBuffered,this),e.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(b.LEVEL_LOADED,this.onLevelLoaded,this),e.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(b.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.FRAG_LOADING,this.onFragLoading,this),e.off(b.FRAG_LOADED,this.onFragLoaded,this),e.off(b.FRAG_BUFFERED,this.onFragBuffered,this),e.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(b.LEVEL_LOADED,this.onLevelLoaded,this),e.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(b.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(b.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const i=t.frag;if(!this.ignoreFragment(i)){if(!i.bitrateTest){var r;this.fragCurrent=i,this.partCurrent=(r=t.part)!=null?r:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case V.BUFFER_ADD_CODEC_ERROR:case V.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case V.FRAG_LOAD_TIMEOUT:{const i=t.frag,{fragCurrent:r,partCurrent:n}=this;if(i&&r&&i.sn===r.sn&&i.level===r.level){const a=performance.now(),o=n?n.stats:i.stats,l=a-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(f,c),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,i,r){const n=e+i/t,a=r?e+this.lastLevelLoadSec:0;return n+a}onLevelLoaded(e,t){const i=this.hls.config,{loading:r}=t.stats,n=r.end-r.first;re(n)&&(this.lastLevelLoadSec=n/1e3),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:i}){const r=i?i.stats:t.stats;if(t.type===ce.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const n=i?i.duration:t.duration,a=this.hls.levels[t.level],o=(a.loaded?a.loaded.bytes:0)+r.loaded,l=(a.loaded?a.loaded.duration:0)+n;a.loaded={bytes:o,duration:l},a.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const n={stats:r,frag:t,part:i,id:t.type};this.onFragBuffered(b.FRAG_BUFFERED,n),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:i,part:r}=t,n=r!=null&&r.stats.loaded?r.stats:i.stats;if(n.aborted||this.ignoreFragment(i))return;const a=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ce.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,i=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,n=this.findBestLevel(i,t,e,0,r,1,1);if(n>-1)return n;const a=this.hls.firstLevel,o=Math.min(Math.max(a,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,i=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!i||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const n=i&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const a=this.hls.levels;if(a.length>Math.max(e,n)&&a[e].loadError<=a[n].loadError)return e}return this._nextAutoLevel=n,this.nextAutoLevelKey=this.getAutoLevelKey(),n}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this;if(i.levels.length<=1)return i.loadLevel;const{maxAutoLevel:r,config:n,minAutoLevel:a}=i,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),c=this.getStarvationDelay();let u=n.abrBandWidthFactor,f=n.abrBandWidthUpFactor;if(c){const m=this.findBestLevel(l,a,r,c,0,u,f);if(m>=0)return this.rebufferNotice=-1,m}let d=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay;if(!c){const m=this.bitrateTestDelay;m&&(d=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-m,this.info(`bitrate test took ${Math.round(1e3*m)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),u=f=1)}const h=this.findBestLevel(l,a,r,c,d,u,f);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const p=i.levels[a],g=i.loadLevelObj;return g&&(p==null?void 0:p.bitrate)<g.bitrate?a:i.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const i=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,i,r,n,a,o){var l;const c=r+n,u=this.lastLoadedFragLevel,f=u===-1?this.hls.firstLevel:u,{fragCurrent:d,partCurrent:h}=this,{levels:p,allAudioTracks:g,loadLevel:m,config:v}=this.hls;if(p.length===1)return 0;const y=p[f],E=!!((l=this.hls.latestLevelDetails)!=null&&l.live),w=m===-1||u===-1;let T,$="SDR",k=(y==null?void 0:y.frameRate)||0;const{audioPreference:M,videoPreference:_}=v,C=this.audioTracksByGroup||(this.audioTracksByGroup=Vb(g));let U=-1;if(w){if(this.firstSelection!==-1)return this.firstSelection;const A=this.codecTiers||(this.codecTiers=ID(p,C,t,i)),I=LD(A,$,e,M,_),{codecSet:D,videoRanges:O,minFramerate:H,minBitrate:N,minIndex:P,preferHDR:Y}=I;U=P,T=D,$=Y?O[O.length-1]:O[0],k=H,e=Math.max(e,N),this.log(`picked start tier ${Xe(I)}`)}else T=y==null?void 0:y.codecSet,$=y==null?void 0:y.videoRange;const L=h?h.duration:d?d.duration:0,R=this.bwEstimator.getEstimateTTFB()/1e3,B=[];for(let A=i;A>=t;A--){var S;const I=p[A],D=A>f;if(!I)continue;if(v.useMediaCapabilities&&!I.supportedResult&&!I.supportedPromise){const J=navigator.mediaCapabilities;typeof(J==null?void 0:J.decodingInfo)=="function"&&yD(I,C,$,k,e,M)?(I.supportedPromise=Yb(I,C,J,this.supportedCache),I.supportedPromise.then(x=>{if(!this.hls)return;I.supportedResult=x;const F=this.hls.levels,G=F.indexOf(I);x.error?this.warn(`MediaCapabilities decodingInfo error: "${x.error}" for level ${G} ${Xe(x)}`):x.supported?x.decodingInfoResults.some(Q=>Q.smooth===!1||Q.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${G} not smooth or powerEfficient: ${Xe(x)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${G} ${Xe(x)}`),G>-1&&F.length>1&&(this.log(`Removing unsupported level ${G}`),this.hls.removeLevel(G),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(x=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${x}`)})):I.supportedResult=Gb}if((T&&I.codecSet!==T||$&&I.videoRange!==$||D&&k>I.frameRate||!D&&k>0&&k<I.frameRate||(S=I.supportedResult)!=null&&(S=S.decodingInfoResults)!=null&&S.some(J=>J.smooth===!1))&&(!w||A!==U)){B.push(A);continue}const O=I.details,H=(h?O==null?void 0:O.partTarget:O==null?void 0:O.averagetargetduration)||L;let N;D?N=o*e:N=a*e;const P=L&&r>=L*2&&n===0?I.averageBitrate:I.maxBitrate,Y=this.getTimeToLoadFrag(R,N,P*H,O===void 0);if(N>=P&&(A===u||I.loadError===0&&I.fragmentError===0)&&(Y<=R||!re(Y)||E&&!this.bitrateTestDelay||Y<c)){const J=this.forcedAutoLevel;return A!==m&&(J===-1||J!==m)&&(B.length&&this.trace(`Skipped level(s) ${B.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${p[B[0]].codecs}" ${p[B[0]].videoRange}; not compatible with "${T}" ${$}`),this.info(`switch candidate:${f}->${A} adjustedbw(${Math.round(N)})-bitrate=${Math.round(N-P)} ttfb:${R.toFixed(1)} avgDuration:${H.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${Y.toFixed(1)} firstSelection:${w} codecSet:${I.codecSet} videoRange:${I.videoRange} hls.loadLevel:${m}`)),w&&(this.firstSelection=A),A}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:i}=this.hls;return Math.min(Math.max(e,i),t)}}const Kb={search:function(s,e){let t=0,i=s.length-1,r=null,n=null;for(;t<=i;){r=(t+i)/2|0,n=s[r];const a=e(n);if(a>0)t=r+1;else if(a<0)i=r-1;else return n}return null}};function OD(s,e,t){if(e===null||!Array.isArray(s)||!s.length||!re(e))return null;const i=s[0].programDateTime;if(e<(i||0))return null;const r=s[s.length-1].endProgramDateTime;if(e>=(r||0))return null;for(let n=0;n<s.length;++n){const a=s[n];if(ND(e,t,a))return a}return null}function _r(s,e,t=0,i=0,r=.005){let n=null;if(s){n=e[1+s.sn-e[0].sn]||null;const o=s.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),n&&s.level!==n.level&&n.end<=s.end&&(n=e[2+s.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(n=e[0]);if(n&&((!s||s.level===n.level)&&pg(t,i,n)===0||MD(n,s,Math.min(r,i))))return n;const a=Kb.search(e,pg.bind(null,t,i));return a&&(a!==s||!n)?a:n}function MD(s,e,t){if(e&&e.start===0&&e.level<s.level&&(e.endPTS||0)>0){const i=e.tagList.reduce((r,n)=>(n[0]==="INF"&&(r+=parseFloat(n[1])),r),t);return s.start<=i}return!1}function pg(s=0,e=0,t){if(t.start<=s&&t.start+t.duration>s)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=s?1:t.start-i>s&&t.start?-1:0}function ND(s,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>s}function Wb(s,e,t){if(s&&s.startCC<=e&&s.endCC>=e){let i=s.fragments;const{fragmentHint:r}=s;r&&(i=i.concat(r));let n;return Kb.search(i,a=>a.cc<e?1:a.cc>e?-1:(n=a,a.end<=t?1:a.start>t?-1:0)),n||null}return null}function El(s){switch(s.details){case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_TIMEOUT:case V.LEVEL_LOAD_TIMEOUT:case V.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function zb(s){return s.details.startsWith("key")}function Qb(s){return zb(s)&&!!s.frag&&!s.frag.decryptdata}function mg(s,e){const t=El(e);return s.default[`${t?"timeout":"error"}Retry`]}function ah(s,e){const t=s.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function gg(s){return Ke(Ke({},s),{errorRetry:null,timeoutRetry:null})}function _l(s,e,t,i){if(!s)return!1;const r=i==null?void 0:i.code,n=e<s.maxNumRetry&&(FD(r)||!!t);return s.shouldRetry?s.shouldRetry(s,e,t,i,n):n}function FD(s){return Mf(s)||!!s&&(s<400||s>499)}function Mf(s){return s===0&&navigator.onLine===!1}var At={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},is={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class $D extends Es{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(b.ERROR,this.onError,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(b.ERROR,this.onError,this),e.off(b.ERROR,this.onErrorOut,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ce.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,i=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||i===-1?t.loadLevel:i}variantHasKey(e,t){if(e){var i;if((i=e.details)!=null&&i.hasKey(t))return!0;const r=e.audioGroups;if(r)return this.hls.allAudioTracks.filter(a=>r.indexOf(a.groupId)>=0).some(a=>{var o;return(o=a.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case V.FRAG_PARSING_ERROR:if((i=t.frag)!=null&&i.gap){t.errorAction=Jr();return}case V.FRAG_GAP:case V.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=At.SendAlternateToPenaltyBox;return}case V.LEVEL_EMPTY_ERROR:case V.LEVEL_PARSING_ERROR:{var a;const l=t.parent===ce.MAIN?t.level:r.loadLevel;t.details===V.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(a=a.levelDetails)!=null&&a.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case V.LEVEL_LOAD_ERROR:case V.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case V.AUDIO_TRACK_LOAD_ERROR:case V.AUDIO_TRACK_LOAD_TIMEOUT:case V.SUBTITLE_LOAD_ERROR:case V.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const l=r.loadLevelObj;if(l&&(n.type===De.AUDIO_TRACK&&l.hasAudioGroup(n.groupId)||n.type===De.SUBTITLE_TRACK&&l.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=At.SendAlternateToPenaltyBox,t.errorAction.flags=is.MoveAllAlternatesMatchingHost;return}}return;case V.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:At.SendAlternateToPenaltyBox,flags:is.MoveAllAlternatesMatchingHDCP};return;case V.KEY_SYSTEM_SESSION_UPDATE_FAILED:case V.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case V.KEY_SYSTEM_NO_SESSION:t.errorAction={action:At.SendAlternateToPenaltyBox,flags:is.MoveAllAlternatesMatchingKey};return;case V.BUFFER_ADD_CODEC_ERROR:case V.REMUX_ALLOC_ERROR:case V.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:r.loadLevel)}return;case V.INTERNAL_EXCEPTION:case V.BUFFER_APPENDING_ERROR:case V.BUFFER_FULL_ERROR:case V.LEVEL_SWITCH_ERROR:case V.BUFFER_STALLED_ERROR:case V.BUFFER_SEEK_OVER_HOLE:case V.BUFFER_NUDGE_ON_STALL:t.errorAction=Jr();return}t.type===fe.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Jr())}getPlaylistRetryOrSwitchAction(e,t){const i=this.hls,r=mg(i.config.playlistLoadPolicy,e),n=this.playlistError++;if(_l(r,n,El(e),e.response))return{action:At.RetryRequest,flags:is.None,retryConfig:r,retryCount:n};const o=this.getLevelSwitchAction(e,t);return r&&(o.retryConfig=r,o.retryCount=n),o}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],{fragLoadPolicy:n,keyLoadPolicy:a}=t.config,o=mg(zb(e)?a:n,e),l=t.levels.reduce((u,f)=>u+f.fragmentError,0);if(r&&(e.details!==V.FRAG_GAP&&r.fragmentError++,!Qb(e)&&_l(o,l,El(e),e.response)))return{action:At.RetryRequest,flags:is.None,retryConfig:o,retryCount:l};const c=this.getLevelSwitchAction(e,i);return o&&(c.retryConfig=o,c.retryCount=l),c}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.loadLevel);const r=this.hls.levels[t];if(r){var n,a;const c=e.details;r.loadError++,c===V.BUFFER_APPEND_ERROR&&r.fragmentError++;let u=-1;const{levels:f,loadLevel:d,minAutoLevel:h,maxAutoLevel:p}=i;!i.autoLevelEnabled&&!i.config.preserveManualLevelOnError&&(i.loadLevel=-1);const g=(n=e.frag)==null?void 0:n.type,v=(g===ce.AUDIO&&c===V.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===V.BUFFER_ADD_CODEC_ERROR||c===V.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:$})=>r.audioCodec!==$),E=e.sourceBufferName==="video"&&(c===V.BUFFER_ADD_CODEC_ERROR||c===V.BUFFER_APPEND_ERROR)&&f.some(({codecSet:$,audioCodec:k})=>r.codecSet!==$&&r.audioCodec===k),{type:w,groupId:T}=(a=e.context)!=null?a:{};for(let $=f.length;$--;){const k=($+d)%f.length;if(k!==d&&k>=h&&k<=p&&f[k].loadError===0){var o,l;const M=f[k];if(c===V.FRAG_GAP&&g===ce.MAIN&&e.frag){const _=f[k].details;if(_){const C=_r(e.frag,_.fragments,e.frag.start);if(C!=null&&C.gap)continue}}else{if(w===De.AUDIO_TRACK&&M.hasAudioGroup(T)||w===De.SUBTITLE_TRACK&&M.hasSubtitleGroup(T))continue;if(g===ce.AUDIO&&(o=r.audioGroups)!=null&&o.some(_=>M.hasAudioGroup(_))||g===ce.SUBTITLE&&(l=r.subtitleGroups)!=null&&l.some(_=>M.hasSubtitleGroup(_))||v&&r.audioCodec===M.audioCodec||E&&r.codecSet===M.codecSet||!v&&r.codecSet!==M.codecSet)continue}u=k;break}}if(u>-1&&i.loadLevel!==u)return e.levelRetry=!0,this.playlistError=0,{action:At.SendAlternateToPenaltyBox,flags:is.None,nextAutoLevel:u}}return{action:At.SendAlternateToPenaltyBox,flags:is.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.action){case At.DoNothing:break;case At.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==V.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:r}=i,n=i.nextAutoLevel;switch(r){case is.None:this.switchLevel(e,n);break;case is.MoveAllAlternatesMatchingHDCP:{const l=this.getVariantLevelIndex(e.frag),c=t.levels[l],u=c==null?void 0:c.attrs["HDCP-LEVEL"];if(i.hdcpLevel=u,u==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(u){t.maxHdcpLevel=Of[Of.indexOf(u)-1],i.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case is.MoveAllAlternatesMatchingKey:{const l=e.decryptdata;if(l){const c=this.hls.levels,u=c.length;for(let d=u;d--;)if(this.variantHasKey(c[d],l)){var a,o;this.log(`Banned key found in level ${d} (${c[d].bitrate}bps) or audio group "${(a=c[d].audioGroups)==null?void 0:a.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${Tt(l.keyId||[])}`),c[d].fragmentError++,c[d].loadError++,this.log(`Removing level ${d} with key error (${e.error})`),this.hls.removeLevel(d)}const f=e.frag;if(this.hls.levels.length<u)i.resolved=!0;else if(f&&f.type!==ce.MAIN){const d=f.decryptdata;d&&!l.matches(d)&&(i.resolved=!0)}}break}}i.resolved||this.switchLevel(e,n)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===V.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const i=Pf(e.mimeType),r=this.hls.levels;for(let n=r.length;n--;)r[n][`${e.sourceBufferName}Codec`]===i&&(this.log(`Removing level ${n} for ${e.details} ("${i}" not supported)`),this.hls.removeLevel(n))}}}function Jr(s){const e={action:At.DoNothing,flags:is.None};return s&&(e.resolved=!0),e}var vt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class BD{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.BUFFER_APPENDED,this.onBufferAppended,this),e.on(b.FRAG_BUFFERED,this.onFragBuffered,this),e.on(b.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.BUFFER_APPENDED,this.onBufferAppended,this),e.off(b.FRAG_BUFFERED,this.onFragBuffered,this),e.off(b.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const i=this.activePartLists[t];if(i)for(let r=i.length;r--;){const n=i[r];if(!n)break;if(n.start<=e&&e<=n.end&&n.loaded)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,i){const{fragments:r}=this,n=Object.keys(r);for(let a=n.length;a--;){const o=r[n[a]];if((o==null?void 0:o.body.type)===t&&(!i||o.buffered)){const l=o.body;if(l.start<=e&&e<=l.end)return l}}return null}detectEvictedFragments(e,t,i,r,n){this.timeRanges&&(this.timeRanges[e]=t);const a=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const l=this.fragments[o];if(!l||a>=l.body.sn)return;if(!l.buffered&&(!l.loaded||n)){l.body.type===i&&this.removeFragment(l.body);return}const c=l.range[e];if(c){if(c.time.length===0){this.removeFragment(l.body);return}c.time.some(u=>{const f=!this.isTimeBuffered(u.startPTS,u.endPTS,t);return f&&this.removeFragment(l.body),f})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const i=e.frag,r=Nr(i),n=this.fragments[r];if(!n||n.buffered&&i.gap)return;const a=!i.relurl;Object.keys(t).forEach(o=>{const l=i.elementaryStreams[o];if(!l)return;const c=t[o],u=a||l.partial===!0;n.range[o]=this.getBufferedTimes(i,e.part,u,c)}),n.loaded=null,Object.keys(n.range).length?(this.bufferedEnd(n,i),to(n)||this.removeParts(i.sn-1,i.type)):this.removeFragment(n.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=vg(i,r=>r.fragment.sn>=e))}fragBuffered(e,t){const i=Nr(e);let r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,this.bufferedEnd(r,e))}getBufferedTimes(e,t,i,r){const n={time:[],partial:i},a=e.start,o=e.end,l=e.minEndPTS||o,c=e.maxStartPTS||a;for(let u=0;u<r.length;u++){const f=r.start(u)-this.bufferPadding,d=r.end(u)+this.bufferPadding;if(c>=f&&l<=d){n.time.push({startPTS:Math.max(a,r.start(u)),endPTS:Math.min(o,r.end(u))});break}else if(a<d&&o>f){const h=Math.max(a,r.start(u)),p=Math.min(o,r.end(u));p>h&&(n.partial=!0,n.time.push({startPTS:h,endPTS:p}))}else if(o<=f)break}return n}getPartialFragment(e){let t=null,i,r,n,a=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const u=l[c];u&&to(u)&&(r=u.body.start-o,n=u.body.end+o,e>=r&&e<=n&&(i=Math.min(e-r,n-e),a<=i&&(t=u.body,a=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||to(t))}getState(e){const t=Nr(e),i=this.fragments[t];return i?i.buffered?to(i)?vt.PARTIAL:vt.OK:vt.APPENDING:vt.NOT_LOADED}isTimeBuffered(e,t,i){let r,n;for(let a=0;a<i.length;a++){if(r=i.start(a)-this.bufferPadding,n=i.end(a)+this.bufferPadding,e>=r&&t<=n)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const i=t.frag,r=t.part?null:t,n=Nr(i);this.fragments[n]={body:i,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:r,timeRanges:n,type:a}=t;if(i.sn==="initSegment")return;const o=i.type;if(r){let c=this.activePartLists[o];c||(this.activePartLists[o]=c=[]),c.push(r)}this.timeRanges=n;const l=n[a];this.detectEvictedFragments(a,l,o,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Nr(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,i=Object.keys(t);if(!e)return i.length>0;for(let r=i.length;r--;){const n=t[i[r]];if((n==null?void 0:n.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,i,r,n){r&&!this.hasGaps||Object.keys(this.fragments).forEach(a=>{const o=this.fragments[a];if(!o)return;const l=o.body;l.type!==i||r&&!l.gap||l.start<t&&l.end>e&&(o.buffered||n)&&this.removeFragment(l)})}removeFragment(e){const t=Nr(e);e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const r=e.sn;this.activePartLists[e.type]=vg(i,n=>n.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(i=>i.clearElementaryStreamInfo())}}function to(s){var e,t,i;return s.buffered&&!!(s.body.gap||(e=s.range.video)!=null&&e.partial||(t=s.range.audio)!=null&&t.partial||(i=s.range.audiovideo)!=null&&i.partial)}function Nr(s){return`${s.type}_${s.level}_${s.sn}`}function vg(s,e){return s.filter(t=>{const i=e(t);return i||t.clearElementaryStreamInfo(),i})}var Ji={cbc:0,ctr:1};class UD{constructor(e,t,i){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=i}decrypt(e,t){switch(this.aesMode){case Ji.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Ji.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function GD(s){const e=s.byteLength,t=e&&new DataView(s.buffer).getUint8(e-1);return t?s.slice(0,e-t):s}class HD{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let r=0;r<4;r++)i[r]=t.getUint32(r*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],n=i[1],a=i[2],o=i[3],l=this.invSubMix,c=l[0],u=l[1],f=l[2],d=l[3],h=new Uint32Array(256);let p=0,g=0,m=0;for(m=0;m<256;m++)m<128?h[m]=m<<1:h[m]=m<<1^283;for(m=0;m<256;m++){let v=g^g<<1^g<<2^g<<3^g<<4;v=v>>>8^v&255^99,e[p]=v,t[v]=p;const y=h[p],E=h[y],w=h[E];let T=h[v]*257^v*16843008;r[p]=T<<24|T>>>8,n[p]=T<<16|T>>>16,a[p]=T<<8|T>>>24,o[p]=T,T=w*16843009^E*65537^y*257^p*16843008,c[v]=T<<24|T>>>8,u[v]=T<<16|T>>>16,f[v]=T<<8|T>>>24,d[v]=T,p?(p=y^h[h[h[w^y]]],g^=h[h[g]]):p=g=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,r=0;for(;r<t.length&&i;)i=t[r]===this.key[r],r++;if(i)return;this.key=t;const n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const a=this.ksRows=(n+6+1)*4;let o,l;const c=this.keySchedule=new Uint32Array(a),u=this.invKeySchedule=new Uint32Array(a),f=this.sBox,d=this.rcon,h=this.invSubMix,p=h[0],g=h[1],m=h[2],v=h[3];let y,E;for(o=0;o<a;o++){if(o<n){y=c[o]=t[o];continue}E=y,o%n===0?(E=E<<8|E>>>24,E=f[E>>>24]<<24|f[E>>>16&255]<<16|f[E>>>8&255]<<8|f[E&255],E^=d[o/n|0]<<24):n>6&&o%n===4&&(E=f[E>>>24]<<24|f[E>>>16&255]<<16|f[E>>>8&255]<<8|f[E&255]),c[o]=y=(c[o-n]^E)>>>0}for(l=0;l<a;l++)o=a-l,l&3?E=c[o]:E=c[o-4],l<4||o<=4?u[l]=E:u[l]=p[f[E>>>24]]^g[f[E>>>16&255]]^m[f[E>>>8&255]]^v[f[E&255]],u[l]=u[l]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,i){const r=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,l=o[0],c=o[1],u=o[2],f=o[3],d=this.uint8ArrayToUint32Array_(i);let h=d[0],p=d[1],g=d[2],m=d[3];const v=new Int32Array(e),y=new Int32Array(v.length);let E,w,T,$,k,M,_,C,U,L,R,B,S,A;const I=this.networkToHostOrderSwap;for(;t<v.length;){for(U=I(v[t]),L=I(v[t+1]),R=I(v[t+2]),B=I(v[t+3]),k=U^n[0],M=B^n[1],_=R^n[2],C=L^n[3],S=4,A=1;A<r;A++)E=l[k>>>24]^c[M>>16&255]^u[_>>8&255]^f[C&255]^n[S],w=l[M>>>24]^c[_>>16&255]^u[C>>8&255]^f[k&255]^n[S+1],T=l[_>>>24]^c[C>>16&255]^u[k>>8&255]^f[M&255]^n[S+2],$=l[C>>>24]^c[k>>16&255]^u[M>>8&255]^f[_&255]^n[S+3],k=E,M=w,_=T,C=$,S=S+4;E=a[k>>>24]<<24^a[M>>16&255]<<16^a[_>>8&255]<<8^a[C&255]^n[S],w=a[M>>>24]<<24^a[_>>16&255]<<16^a[C>>8&255]<<8^a[k&255]^n[S+1],T=a[_>>>24]<<24^a[C>>16&255]<<16^a[k>>8&255]<<8^a[M&255]^n[S+2],$=a[C>>>24]<<24^a[k>>16&255]<<16^a[M>>8&255]<<8^a[_&255]^n[S+3],y[t]=I(E^h),y[t+1]=I($^p),y[t+2]=I(T^g),y[t+3]=I(w^m),h=U,p=L,g=R,m=B,t=t+4}return y.buffer}}class YD{constructor(e,t,i){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=i}expandKey(){const e=jD(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function jD(s){switch(s){case Ji.cbc:return"AES-CBC";case Ji.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${s}`)}}const VD=16;class oh{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?GD(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i,r){return this.useSoftware?new Promise((n,a)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,i,r);const l=this.flush();l?n(l.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i,r)}softwareDecrypt(e,t,i,r){const{currentIV:n,currentResult:a,remainderData:o}=this;if(r!==Ji.cbc||t.byteLength!==16)return We.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=bs(o,e),this.remainderData=null);const l=this.getValidChunk(e);if(!l.length)return null;n&&(i=n);let c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new HD),c.expandKey(t);const u=a;return this.currentResult=c.decrypt(l.buffer,0,i),this.currentIV=l.slice(-16).buffer,u||null}webCryptoDecrypt(e,t,i,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,i,r));this.key=t,this.fastAesKey=new YD(this.subtle,t,r)}return this.fastAesKey.expandKey().then(n=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new UD(this.subtle,new Uint8Array(i),r).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(We.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,i,r)))}onWebCryptoError(e,t,i,r){const n=this.enableSoftwareAES;if(n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i,r);const a=this.flush();if(a)return a.buffer}throw new Error("WebCrypto"+(n?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%VD;return i!==e.length&&(t=e.slice(0,i),this.remainderData=e.slice(i)),t}logOnce(e){this.logEnabled&&(We.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const yg=Math.pow(2,17);class KD{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new ui({type:fe.NETWORK_ERROR,details:V.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,n=r.fLoader,a=r.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(p=>p[0]==="GAP")){l(Sg(e));return}else e.gap=!1;const c=this.loader=n?new n(r):new a(r),u=bg(e);e.loader=c;const f=gg(r.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:yg};e.stats=c.stats;const h={onSuccess:(p,g,m,v)=>{this.resetLoader(e,c);let y=p.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(y.slice(0,16)),y=y.slice(16)),o({frag:e,part:null,payload:y,networkDetails:v})},onError:(p,g,m,v)=>{this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Ke({url:i,data:void 0},p),error:new Error(`HTTP Error ${p.code} ${p.text}`),networkDetails:m,stats:v}))},onAbort:(p,g,m)=>{this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:p}))},onTimeout:(p,g,m)=>{this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:p}))}};t&&(h.onProgress=(p,g,m,v)=>t({frag:e,part:null,payload:m,networkDetails:v})),c.load(u,d,h)})}loadPart(e,t,i){this.abort();const r=this.config,n=r.fLoader,a=r.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(Sg(e,t));return}const c=this.loader=n?new n(r):new a(r),u=bg(e,t);e.loader=c;const f=gg(r.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:yg};t.stats=c.stats,c.load(u,d,{onSuccess:(h,p,g,m)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const v={frag:e,part:t,payload:h.data,networkDetails:m};i(v),o(v)},onError:(h,p,g,m)=>{this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:Ke({url:u.url,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:g,stats:m}))},onAbort:(h,p,g)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:g,stats:h}))},onTimeout:(h,p,g)=>{this.resetLoader(e,c),l(new ui({type:fe.NETWORK_ERROR,details:V.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:g,stats:h}))}})})}updateStatsFromPart(e,t){const i=e.stats,r=t.stats,n=r.total;if(i.loaded+=r.loaded,n){const l=Math.round(e.duration/t.duration),c=Math.min(Math.round(i.loaded/n),l),f=(l-c)*Math.round(i.loaded/c);i.total=i.loaded+f}else i.total=Math.max(i.loaded,i.total);const a=i.loading,o=r.loading;a.start?a.first+=o.first-o.start:(a.start=o.start,a.first=o.first),a.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function bg(s,e=null){const t=e||s,i={frag:s,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,n=t.byteRangeEndOffset;if(re(r)&&re(n)){var a;let o=r,l=n;if(s.sn==="initSegment"&&WD((a=s.decryptdata)==null?void 0:a.method)){const c=n-r;c%16&&(l=n+(16-c%16)),r!==0&&(i.resetIV=!0,o=r-16)}i.rangeStart=o,i.rangeEnd=l}return i}function Sg(s,e){const t=new Error(`GAP ${s.gap?"tag":"attribute"} found`),i={type:fe.MEDIA_ERROR,details:V.FRAG_GAP,fatal:!1,frag:s,error:t,networkDetails:null};return e&&(i.part=e),(e||s).stats.aborted=!0,new ui(i)}function WD(s){return s==="AES-128"||s==="AES-256"}class ui extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class qb extends Es{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class lh{constructor(e,t,i,r=0,n=-1,a=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=so(),this.buffering={audio:so(),video:so(),audiovideo:so()},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=n,this.partial=a}}function so(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Eg={length:0,start:()=>0,end:()=>0};class be{static isBuffered(e,t){if(e){const i=be.getBuffered(e);for(let r=i.length;r--;)if(t>=i.start(r)&&t<=i.end(r))return!0}return!1}static bufferedRanges(e){if(e){const t=be.getBuffered(e);return be.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}static bufferInfo(e,t,i){if(e){const r=be.bufferedRanges(e);if(r.length)return be.bufferedInfo(r,t,i)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.length>1&&e.sort((u,f)=>u.start-f.start||f.end-u.end);let r=-1,n=[];if(i)for(let u=0;u<e.length;u++){t>=e[u].start&&t<=e[u].end&&(r=u);const f=n.length;if(f){const d=n[f-1].end;e[u].start-d<i?e[u].end>d&&(n[f-1].end=e[u].end):n.push(e[u])}else n.push(e[u])}else n=e;let a=0,o,l=t,c=t;for(let u=0;u<n.length;u++){const f=n[u].start,d=n[u].end;if(r===-1&&t>=f&&t<=d&&(r=u),t+i>=f&&t<d)l=f,c=d,a=c-t;else if(t+i<f){o=f;break}}return{len:a,start:l||0,end:c||0,nextStart:o,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||Eg}catch(t){return We.log("failed to get media.buffered",t),Eg}}}const Xb=/\{\$([a-zA-Z0-9-_]+)\}/g;function _g(s){return Xb.test(s)}function Nf(s,e){if(s.variableList!==null||s.hasVariableRefs){const t=s.variableList;return e.replace(Xb,i=>{const r=i.substring(2,i.length-1),n=t==null?void 0:t[r];return n===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),i):n})}return e}function xg(s,e,t){let i=s.variableList;i||(s.variableList=i={});let r,n;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const a=new self.URL(t).searchParams;if(a.has(r))n=a.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(a){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else r=e.NAME,n=e.VALUE;r in i?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):i[r]=n||""}function zD(s,e,t){const i=e.IMPORT;if(t&&i in t){let r=s.variableList;r||(s.variableList=r={}),r[i]=t[i]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}const QD=/^(\d+)x(\d+)$/,Ag=/(.+?)=(".*?"|.*?)(?:,|$)/g;class nt{constructor(e,t){typeof e=="string"&&(e=nt.parseAttrList(e,t)),ze(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const i=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(r*2,r*2+2),16);return i}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const i=this[e];return(i?i.split(/[ ,]+/):[]).reduce((r,n)=>(r[n.toLowerCase()]=!0,r),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=QD.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let i;const r={},n='"';for(Ag.lastIndex=0;(i=Ag.exec(e))!==null;){const a=i[1].trim();let o=i[2];const l=o.indexOf(n)===0&&o.lastIndexOf(n)===o.length-1;let c=!1;if(l)o=o.slice(1,-1);else switch(a){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":c=!0}if(t&&(l||c))o=Nf(t,o);else if(!c&&!l)switch(a){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":We.warn(`${e}: attribute ${a} is missing quotes`)}r[a]=o}return r}}const qD="com.apple.hls.interstitial";function XD(s){return s!=="ID"&&s!=="CLASS"&&s!=="CUE"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function JD(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"||s==="SCTE35-CMD"}class Jb{constructor(e,t,i=0){var r;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(r=t==null?void 0:t.tagOrder)!=null?r:i,t){const n=t.attr;for(const a in n)if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==n[a]){We.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=a;break}e=ze(new nt({}),n,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);re(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(We.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(re(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===qD}get isValid(){return!!this.id&&!this._badValueForSameId&&re(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const ZD=10;class e2{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let i=t.decryptdata;return i||(t.setKeyFormat(e.keyFormat),i=t.decryptdata),!!i&&e.matches(i)})}get hasProgramDateTime(){return this.fragments.length?re(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||ZD}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let i=e.length;i--;)if(e[i].index>t)return e[i].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function xl(s,e){return s.length===e.length?!s.some((t,i)=>t!==e[i]):!1}function Tg(s,e){return!s&&!e?!0:!s||!e?!1:xl(s,e)}function Zr(s){return s==="AES-128"||s==="AES-256"||s==="AES-256-CTR"}function ch(s){switch(s){case"AES-128":case"AES-256":return Ji.cbc;case"AES-256-CTR":return Ji.ctr;default:throw new Error(`invalid full segment method ${s}`)}}function uh(s){return Uint8Array.from(atob(s),e=>e.charCodeAt(0))}function Ff(s){return Uint8Array.from(unescape(encodeURIComponent(s)),e=>e.charCodeAt(0))}function t2(s){const e=Ff(s).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Zb(s){const e=function(i,r,n){const a=i[r];i[r]=i[n],i[n]=a};e(s,0,3),e(s,1,2),e(s,4,5),e(s,6,7)}function eS(s){const e=s.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),r=i[i.length-1].split(",");if(r.length===2){const n=r[0]==="base64",a=r[1];n?(i.splice(-1,1),t=uh(a)):t=t2(a)}}return t}const Al=typeof self<"u"?self:void 0;var ot={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},wt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Oo(s){switch(s){case wt.FAIRPLAY:return ot.FAIRPLAY;case wt.PLAYREADY:return ot.PLAYREADY;case wt.WIDEVINE:return ot.WIDEVINE;case wt.CLEARKEY:return ot.CLEARKEY}}function bu(s){switch(s){case ot.FAIRPLAY:return wt.FAIRPLAY;case ot.PLAYREADY:return wt.PLAYREADY;case ot.WIDEVINE:return wt.WIDEVINE;case ot.CLEARKEY:return wt.CLEARKEY}}function Hn(s){const{drmSystems:e,widevineLicenseUrl:t}=s,i=e?[ot.FAIRPLAY,ot.WIDEVINE,ot.PLAYREADY,ot.CLEARKEY].filter(r=>!!e[r]):[];return!i[ot.WIDEVINE]&&t&&i.push(ot.WIDEVINE),i}const tS=function(s){return Al!=null&&(s=Al.navigator)!=null&&s.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function s2(s,e,t,i){let r;switch(s){case ot.FAIRPLAY:r=["cenc","sinf"];break;case ot.WIDEVINE:case ot.PLAYREADY:r=["cenc"];break;case ot.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return i2(r,e,t,i)}function i2(s,e,t,i){return[{initDataTypes:s,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs=${n}`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs=${n}`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function r2(s){var e;return!!s&&(s.sessionType==="persistent-license"||!!((e=s.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function sS(s){const e=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),i=t.substring(t.indexOf("<"),t.length),a=new DOMParser().parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(a){const o=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(o){const l=uh(o).subarray(0,16);return Zb(l),l}}return null}let Fr={};class Hi{static clearKeyUriToKeyIdMap(){Fr={}}static setKeyIdForUri(e,t){Fr[e]=t}static addKeyIdForUri(e){const t=Object.keys(Fr).length%Number.MAX_SAFE_INTEGER,i=new Uint8Array(16);return new DataView(i.buffer,12,4).setUint32(0,t),Fr[e]=i,i}constructor(e,t,i,r=[1],n=null,a){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=r,this.iv=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Zr(e),a!=null&&a.startsWith("0x")&&(this.keyId=new Uint8Array(Rb(a)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&xl(e.keyFormatVersions,this.keyFormatVersions)&&Tg(e.iv,this.iv)&&Tg(e.keyId,this.keyId)}isSupported(){if(this.method){if(Zr(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case wt.FAIRPLAY:case wt.WIDEVINE:case wt.PLAYREADY:case wt.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Zr(this.method)){let n=this.iv;return n||(typeof e!="number"&&(We.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),n=a2(e)),new Hi(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.keyId){const n=Fr[this.uri];if(n&&!xl(this.keyId,n)&&Hi.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const i=eS(this.uri);if(i)switch(this.keyFormat){case wt.WIDEVINE:if(this.pssh=i,!this.keyId){const n=cD(i.buffer);if(n.length){var r;const a=n[0];this.keyId=(r=a.kids)!=null&&r.length?a.kids[0]:null}}this.keyId||(this.keyId=wg(t));break;case wt.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=lD(n,null,i),this.keyId=sS(i);break}default:{let n=i.subarray(0,16);if(n.length!==16){const a=new Uint8Array(16);a.set(n,16-n.length),n=a}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n;n=n2(t),n||(n=wg(t),n||(n=Fr[this.uri])),n&&(this.keyId=n,Hi.setKeyIdForUri(this.uri,n))}return this}}function n2(s){const e=s==null?void 0:s[wt.WIDEVINE];return e?e.keyId:null}function wg(s){const e=s==null?void 0:s[wt.PLAYREADY];if(e){const t=eS(e.uri);if(t)return sS(t)}return null}function a2(s){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=s>>8*(15-t)&255;return e}const Cg=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Lg=/#EXT-X-MEDIA:(.*)/g,o2=/^#EXT(?:INF|-X-TARGETDURATION):/m,Su=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),l2=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Qs{static findGroup(e,t){for(let i=0;i<e.length;i++){const r=e[i];if(r.id===t)return r}}static resolve(e,t){return th.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return o2.test(e)}static parseMasterPlaylist(e,t){const i=_g(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},n=[];if(Cg.lastIndex=0,!e.startsWith("#EXTM3U"))return r.playlistParsingError=new Error("no EXTM3U delimiter"),r;let a;for(;(a=Cg.exec(e))!=null;)if(a[1]){var o;const c=new nt(a[1],r),u=Nf(r,a[2]),f={attrs:c,bitrate:c.decimalInteger("BANDWIDTH")||c.decimalInteger("AVERAGE-BANDWIDTH"),name:c.NAME,url:Qs.resolve(u,t)},d=c.decimalResolution("RESOLUTION");d&&(f.width=d.width,f.height=d.height),Dg(c.CODECS,f);const h=c["SUPPLEMENTAL-CODECS"];h&&(f.supplemental={},Dg(h,f.supplemental)),(o=f.unknownCodecs)!=null&&o.length||n.push(f),r.levels.push(f)}else if(a[3]){const c=a[3],u=a[4];switch(c){case"SESSION-DATA":{const f=new nt(u,r),d=f["DATA-ID"];d&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[d]=f);break}case"SESSION-KEY":{const f=Ig(u,t,r);f.encrypted&&f.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(f)):We.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${u}"`);break}case"DEFINE":{{const f=new nt(u,r);xg(r,f,t)}break}case"CONTENT-STEERING":{const f=new nt(u,r);r.contentSteering={uri:Qs.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=Rg(u);break}}}const l=n.length>0&&n.length<r.levels.length;return r.levels=l?n:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,i){let r;const n={},a=i.levels,o={AUDIO:a.map(c=>({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:a.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Lg.lastIndex=0;(r=Lg.exec(e))!==null;){const c=new nt(r[1],i),u=c.TYPE;if(u){const f=o[u],d=n[u]||[];n[u]=d;const h=c.LANGUAGE,p=c["ASSOC-LANGUAGE"],g=c.CHANNELS,m=c.CHARACTERISTICS,v=c["INSTREAM-ID"],y={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",name:c.NAME||h||"",type:u,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:h,url:c.URI?Qs.resolve(c.URI,t):""};if(p&&(y.assocLang=p),g&&(y.channels=g),m&&(y.characteristics=m),v&&(y.instreamId=v),f!=null&&f.length){const E=Qs.findGroup(f,y.groupId)||f[0];kg(y,E,"audioCodec"),kg(y,E,"textCodec")}d.push(y)}}return n}static parseLevelPlaylist(e,t,i,r,n,a){var o;const l={url:t},c=new e2(t),u=c.fragments,f=[];let d=null,h=0,p=0,g=0,m=0,v=0,y=null,E=new gu(r,l),w,T,$,k=-1,M=!1,_=null,C;if(Su.lastIndex=0,c.m3u8=e,c.hasVariableRefs=_g(e),((o=Su.exec(e))==null?void 0:o[0])!=="#EXTM3U")return c.playlistParsingError=new Error("Missing format identifier #EXTM3U"),c;for(;(w=Su.exec(e))!==null;){M&&(M=!1,E=new gu(r,l),E.playlistOffset=g,E.setStart(g),E.sn=h,E.cc=m,v&&(E.bitrate=v),E.level=i,d&&(E.initSegment=d,d.rawProgramDateTime&&(E.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null),_&&(E.setByteRange(_),_=null)));const B=w[1];if(B){E.duration=parseFloat(B);const S=(" "+w[2]).slice(1);E.title=S||null,E.tagList.push(S?["INF",B,S]:["INF",B])}else if(w[3]){if(re(E.duration)){E.playlistOffset=g,E.setStart(g),$&&Og(E,$,c),E.sn=h,E.level=i,E.cc=m,u.push(E);const S=(" "+w[3]).slice(1);E.relurl=Nf(c,S),$f(E,y,f),y=E,g+=E.duration,h++,p=0,M=!0}}else{if(w=w[0].match(l2),!w){We.warn("No matches on slow regex match for level playlist!");continue}for(T=1;T<w.length&&w[T]===void 0;T++);const S=(" "+w[T]).slice(1),A=(" "+w[T+1]).slice(1),I=w[T+2]?(" "+w[T+2]).slice(1):null;switch(S){case"BYTERANGE":y?E.setByteRange(A,y):E.setByteRange(A);break;case"PROGRAM-DATE-TIME":E.rawProgramDateTime=A,E.tagList.push(["PROGRAM-DATE-TIME",A]),k===-1&&(k=u.length);break;case"PLAYLIST-TYPE":c.type&&oi(c,S,w),c.type=A.toUpperCase();break;case"MEDIA-SEQUENCE":c.startSN!==0?oi(c,S,w):u.length>0&&Mg(c,S,w),h=c.startSN=parseInt(A);break;case"SKIP":{c.skippedSegments&&oi(c,S,w);const D=new nt(A,c),O=D.decimalInteger("SKIPPED-SEGMENTS");if(re(O)){c.skippedSegments+=O;for(let N=O;N--;)u.push(null);h+=O}const H=D.enumeratedString("RECENTLY-REMOVED-DATERANGES");H&&(c.recentlyRemovedDateranges=(c.recentlyRemovedDateranges||[]).concat(H.split(" ")));break}case"TARGETDURATION":c.targetduration!==0&&oi(c,S,w),c.targetduration=Math.max(parseInt(A),1);break;case"VERSION":c.version!==null&&oi(c,S,w),c.version=parseInt(A);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":c.live||oi(c,S,w),c.live=!1;break;case"#":(A||I)&&E.tagList.push(I?[A,I]:[A]);break;case"DISCONTINUITY":m++,E.tagList.push(["DIS"]);break;case"GAP":E.gap=!0,E.tagList.push([S]);break;case"BITRATE":E.tagList.push([S,A]),v=parseInt(A)*1e3,re(v)?E.bitrate=v:v=0;break;case"DATERANGE":{const D=new nt(A,c),O=new Jb(D,c.dateRanges[D.ID],c.dateRangeTagCount);c.dateRangeTagCount++,O.isValid||c.skippedSegments?c.dateRanges[O.id]=O:We.warn(`Ignoring invalid DATERANGE tag: "${A}"`),E.tagList.push(["EXT-X-DATERANGE",A]);break}case"DEFINE":{{const D=new nt(A,c);"IMPORT"in D?zD(c,D,a):xg(c,D,t)}break}case"DISCONTINUITY-SEQUENCE":c.startCC!==0?oi(c,S,w):u.length>0&&Mg(c,S,w),c.startCC=m=parseInt(A);break;case"KEY":{const D=Ig(A,t,c);if(D.isSupported()){if(D.method==="NONE"){$=void 0;break}$||($={});const O=$[D.keyFormat];O!=null&&O.matches(D)||(O&&($=ze({},$)),$[D.keyFormat]=D)}else We.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${A}"`);break}case"START":c.startTimeOffset=Rg(A);break;case"MAP":{const D=new nt(A,c);if(E.duration){const O=new gu(r,l);Pg(O,D,i,$),d=O,E.initSegment=d,d.rawProgramDateTime&&!E.rawProgramDateTime&&(E.rawProgramDateTime=d.rawProgramDateTime)}else{const O=E.byteRangeEndOffset;if(O){const H=E.byteRangeStartOffset;_=`${O-H}@${H}`}else _=null;Pg(E,D,i,$),d=E,M=!0}d.cc=m;break}case"SERVER-CONTROL":{C&&oi(c,S,w),C=new nt(A),c.canBlockReload=C.bool("CAN-BLOCK-RELOAD"),c.canSkipUntil=C.optionalFloat("CAN-SKIP-UNTIL",0),c.canSkipDateRanges=c.canSkipUntil>0&&C.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=C.optionalFloat("PART-HOLD-BACK",0),c.holdBack=C.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{c.partTarget&&oi(c,S,w);const D=new nt(A);c.partTarget=D.decimalFloatingPoint("PART-TARGET");break}case"PART":{let D=c.partList;D||(D=c.partList=[]);const O=p>0?D[D.length-1]:void 0,H=p++,N=new nt(A,c),P=new zR(N,E,l,H,O);D.push(P),E.duration+=P.duration;break}case"PRELOAD-HINT":{const D=new nt(A,c);c.preloadHint=D;break}case"RENDITION-REPORT":{const D=new nt(A,c);c.renditionReports=c.renditionReports||[],c.renditionReports.push(D);break}default:We.warn(`line parsed but not handled: ${w}`);break}}}y&&!y.relurl?(u.pop(),g-=y.duration,c.partList&&(c.fragmentHint=y)):c.partList&&($f(E,y,f),E.cc=m,c.fragmentHint=E,$&&Og(E,$,c)),c.targetduration||(c.playlistParsingError=new Error("Missing Target Duration"));const U=u.length,L=u[0],R=u[U-1];if(g+=c.skippedSegments*c.targetduration,g>0&&U&&R){c.averagetargetduration=g/U;const B=R.sn;c.endSN=B!=="initSegment"?B:0,c.live||(R.endList=!0),k>0&&(u2(u,k),L&&f.unshift(L))}return c.fragmentHint&&(g+=c.fragmentHint.duration),c.totalduration=g,f.length&&c.dateRangeTagCount&&L&&iS(f,c),c.endCC=m,c}}function iS(s,e){let t=s.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];s.push(o),t++}else return;const i=s[t-1],r=e.live?1/0:e.totalduration,n=Object.keys(e.dateRanges);for(let o=n.length;o--;){const l=e.dateRanges[n[o]],c=l.startDate.getTime();l.tagAnchor=i.ref;for(let u=t;u--;){var a;if(((a=s[u])==null?void 0:a.sn)<e.startSN)break;const f=c2(e,c,s,u,r);if(f!==-1){l.tagAnchor=e.fragments[f].ref;break}}}}function c2(s,e,t,i,r){const n=t[i];if(n){const o=n.programDateTime;if(e>=o||i===0){var a;const l=(((a=t[i+1])==null?void 0:a.start)||r)-n.start;if(e<=o+l*1e3){const c=t[i].sn-s.startSN;if(c<0)return-1;const u=s.fragments;if(u.length>t.length){const d=(t[i+1]||u[u.length-1]).sn-s.startSN;for(let h=d;h>c;h--){const p=u[h].programDateTime;if(e>=p&&e<p+u[h].duration*1e3)return h}}return c}}}return-1}function Ig(s,e,t){var i,r;const n=new nt(s,t),a=(i=n.METHOD)!=null?i:"",o=n.URI,l=n.hexadecimalInteger("IV"),c=n.KEYFORMATVERSIONS,u=(r=n.KEYFORMAT)!=null?r:"identity";o&&n.IV&&!l&&We.error(`Invalid IV: ${n.IV}`);const f=o?Qs.resolve(o,e):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Hi(a,f,u,d,l,n.KEYID)}function Rg(s){const t=new nt(s).decimalFloatingPoint("TIME-OFFSET");return re(t)?t:null}function Dg(s,e){let t=(s||"").split(/[ ,]+/).filter(i=>i);["video","audio","text"].forEach(i=>{const r=t.filter(n=>rh(n,i));r.length&&(e[`${i}Codec`]=r.map(n=>n.split("/")[0]).join(","),t=t.filter(n=>r.indexOf(n)===-1))}),e.unknownCodecs=t}function kg(s,e,t){const i=e[t];i&&(s[t]=i)}function u2(s,e){let t=s[e];for(let i=e;i--;){const r=s[i];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function $f(s,e,t){s.rawProgramDateTime?t.push(s):e!=null&&e.programDateTime&&(s.programDateTime=e.endProgramDateTime)}function Pg(s,e,t,i){s.relurl=e.URI,e.BYTERANGE&&s.setByteRange(e.BYTERANGE),s.level=t,s.sn="initSegment",i&&(s.levelkeys=i),s.initSegment=null}function Og(s,e,t){s.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&i.push(s)}function oi(s,e,t){s.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Mg(s,e,t){s.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Eu(s,e){const t=e.startPTS;if(re(t)){let i=0,r;e.sn>s.sn?(i=t-s.start,r=s):(i=s.start-t,r=e),r.duration!==i&&r.setDuration(i)}else e.sn>s.sn?s.cc===e.cc&&s.minEndPTS?e.setStart(s.start+(s.minEndPTS-s.start)):e.setStart(s.start+s.duration):e.setStart(Math.max(s.start-e.duration,0))}function rS(s,e,t,i,r,n,a){i-t<=0&&(a.warn("Fragment should have a positive duration",e),i=t+e.duration,n=r+e.duration);let l=t,c=i;const u=e.startPTS,f=e.endPTS;if(re(u)){const v=Math.abs(u-t);s&&v>s.totalduration?a.warn(`media timestamps and playlist times differ by ${v}s for level ${e.level} ${s.url}`):re(e.deltaPTS)?e.deltaPTS=Math.max(v,e.deltaPTS):e.deltaPTS=v,l=Math.max(t,u),t=Math.min(t,u),r=e.startDTS!==void 0?Math.min(r,e.startDTS):r,c=Math.min(i,f),i=Math.max(i,f),n=e.endDTS!==void 0?Math.max(n,e.endDTS):n}const d=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(i-e.start),e.startPTS=t,e.maxStartPTS=l,e.startDTS=r,e.endPTS=i,e.minEndPTS=c,e.endDTS=n;const h=e.sn;if(!s||h<s.startSN||h>s.endSN)return 0;let p;const g=h-s.startSN,m=s.fragments;for(m[g]=e,p=g;p>0;p--)Eu(m[p],m[p-1]);for(p=g;p<m.length-1;p++)Eu(m[p],m[p+1]);return s.fragmentHint&&Eu(m[m.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,d}function f2(s,e,t){if(s===e)return;let i=null;const r=s.fragments;for(let u=r.length-1;u>=0;u--){const f=r[u].initSegment;if(f){i=f;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let n;p2(s,e,(u,f,d,h)=>{if((!e.startCC||e.skippedSegments)&&f.cc!==u.cc){const p=u.cc-f.cc;for(let g=d;g<h.length;g++)h[g].cc+=p;e.endCC=h[h.length-1].cc}re(u.startPTS)&&re(u.endPTS)&&(f.setStart(f.startPTS=u.startPTS),f.startDTS=u.startDTS,f.maxStartPTS=u.maxStartPTS,f.endPTS=u.endPTS,f.endDTS=u.endDTS,f.minEndPTS=u.minEndPTS,f.setDuration(u.endPTS-u.startPTS),f.duration&&(n=f),e.PTSKnown=e.alignedSliding=!0),u.hasStreams&&(f.elementaryStreams=u.elementaryStreams),f.loader=u.loader,u.hasStats&&(f.stats=u.stats),u.initSegment&&(f.initSegment=u.initSegment,i=u.initSegment)});const a=e.fragments,o=e.fragmentHint?a.concat(e.fragmentHint):a;if(i&&o.forEach(u=>{var f;u&&(!u.initSegment||u.initSegment.relurl===((f=i)==null?void 0:f.relurl))&&(u.initSegment=i)}),e.skippedSegments){if(e.deltaUpdateFailed=a.some(u=>!u),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let u=e.skippedSegments;u--;)a.shift();e.startSN=a[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=d2(s.dateRanges,e,t));const u=s.fragments.filter(f=>f.rawProgramDateTime);if(s.hasProgramDateTime&&!e.hasProgramDateTime)for(let f=1;f<o.length;f++)o[f].programDateTime===null&&$f(o[f],o[f-1],u);iS(u,e)}e.endCC=a[a.length-1].cc}if(!e.startCC){var l;const u=oS(s,e.startSN-1);e.startCC=(l=u==null?void 0:u.cc)!=null?l:a[0].cc}h2(s.partList,e.partList,(u,f)=>{f.elementaryStreams=u.elementaryStreams,f.stats=u.stats}),n?rS(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS,t):nS(s,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=s.driftStartTime,e.driftStart=s.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const u=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=u),e.driftEndTime=c,e.driftEnd=u}else e.driftEndTime=s.driftEndTime,e.driftEnd=s.driftEnd,e.advancedDateTime=s.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=s.requestScheduled)}function d2(s,e,t){const{dateRanges:i,recentlyRemovedDateranges:r}=e,n=ze({},s);r&&r.forEach(l=>{delete n[l]});const o=Object.keys(n).length;return o?(Object.keys(i).forEach(l=>{const c=n[l],u=new Jb(i[l].attr,c);u.isValid?(n[l]=u,c||(u.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Xe(i[l].attr)}"`)}),n):i}function h2(s,e,t){if(s&&e){let i=0;for(let r=0,n=s.length;r<=n;r++){const a=s[r],o=e[r+i];a&&o&&a.index===o.index&&a.fragment.sn===o.fragment.sn?t(a,o):i--}}}function p2(s,e,t){const i=e.skippedSegments,r=Math.max(s.startSN,e.startSN)-e.startSN,n=(s.fragmentHint?1:0)+(i?e.endSN:Math.min(s.endSN,e.endSN))-e.startSN,a=e.startSN-s.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;for(let c=r;c<=n;c++){const u=l[a+c];let f=o[c];if(i&&!f&&u&&(f=e.fragments[c]=u),u&&f){t(u,f,c,o);const d=u.relurl,h=f.relurl;if(d&&m2(d,h)){e.playlistParsingError=Ng(`media sequence mismatch ${f.sn}:`,s,e,u,f);return}else if(u.cc!==f.cc){e.playlistParsingError=Ng(`discontinuity sequence mismatch (${u.cc}!=${f.cc})`,s,e,u,f);return}}}}function Ng(s,e,t,i,r){return new Error(`${s} ${r.url}
|
|
367
|
+
Playlist starting @${e.startSN}
|
|
368
|
+
${e.m3u8}
|
|
369
|
+
|
|
370
|
+
Playlist starting @${t.startSN}
|
|
371
|
+
${t.m3u8}`)}function nS(s,e,t=!0){const i=e.startSN+e.skippedSegments-s.startSN,r=s.fragments,n=i>=0;let a=0;if(n&&i<r.length)a=r[i].start;else if(n&&e.startSN===s.endSN+1)a=s.fragmentEnd;else if(n&&t)a=s.fragmentStart+i*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)a=s.fragmentStart;else return;Bf(e,a)}function Bf(s,e){if(e){const t=s.fragments;for(let i=s.skippedSegments;i<t.length;i++)t[i].addStart(e);s.fragmentHint&&s.fragmentHint.addStart(e)}}function aS(s,e=1/0){let t=1e3*s.targetduration;if(s.updated){const i=s.fragments;if(i.length&&t*4>e){const n=i[i.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function oS(s,e,t){if(!s)return null;let i=s.fragments[e-s.startSN];return i||(i=s.fragmentHint,i&&i.sn===e)?i:e<s.startSN&&t&&t.sn===e?t:null}function Fg(s,e,t){return s?lS(s.partList,e,t):null}function lS(s,e,t){if(s)for(let i=s.length;i--;){const r=s[i];if(r.index===t&&r.fragment.sn===e)return r}return null}function cS(s){s.forEach((e,t)=>{var i;(i=e.details)==null||i.fragments.forEach(r=>{r.level=t,r.initSegment&&(r.initSegment.level=t)})})}function m2(s,e){return s!==e&&e?$g(s)!==$g(e):!1}function $g(s){return s.replace(/\?[^?]*$/,"")}function Kn(s,e){for(let i=0,r=s.length;i<r;i++){var t;if(((t=s[i])==null?void 0:t.cc)===e)return s[i]}return null}function g2(s,e){return!!(s&&e.startCC<s.endCC&&e.endCC>s.startCC)}function Bg(s,e){const t=s.start+e;s.startPTS=t,s.setStart(t),s.endPTS=t+s.duration}function uS(s,e){const t=e.fragments;for(let i=0,r=t.length;i<r;i++)Bg(t[i],s);e.fragmentHint&&Bg(e.fragmentHint,s),e.alignedSliding=!0}function v2(s,e){s&&(fS(e,s),e.alignedSliding||Tl(e,s),!e.alignedSliding&&!e.skippedSegments&&nS(s,e,!1))}function fS(s,e){if(!g2(e,s))return;const t=Math.min(e.endCC,s.endCC),i=Kn(e.fragments,t),r=Kn(s.fragments,t);if(!i||!r)return;We.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const n=i.start-r.start;uS(n,s)}function Tl(s,e){if(!s.hasProgramDateTime||!e.hasProgramDateTime)return;const t=s.fragments,i=e.fragments;if(!t.length||!i.length)return;let r,n;const a=Math.min(e.endCC,s.endCC);e.startCC<a&&s.startCC<a&&(r=Kn(i,a),n=Kn(t,a)),(!r||!n)&&(r=i[Math.floor(i.length/2)],n=Kn(t,r.cc)||t[Math.floor(t.length/2)]);const o=r.programDateTime,l=n.programDateTime;if(!o||!l)return;const c=(l-o)/1e3-(n.start-r.start);uS(c,s)}function $t(s,e,t){zt(s,e,t),s.addEventListener(e,t)}function zt(s,e,t){s.removeEventListener(e,t)}const y2={toString:function(s){let e="";const t=s.length;for(let i=0;i<t;i++)e+=`[${s.start(i).toFixed(3)}-${s.end(i).toFixed(3)}]`;return e}},q={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class fh extends qb{constructor(e,t,i,r,n){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=q.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:a,fragCurrent:o,media:l,mediaBuffer:c,state:u}=this,f=l?l.currentTime:0,d=be.bufferInfo(c||l,f,a.maxBufferHole),h=!d.len;if(this.log(`Media seeking to ${re(f)?f.toFixed(3):f}, state: ${u}, ${h?"out of":"in"} buffer`),this.state===q.ENDED)this.resetLoadingState();else if(o){const p=a.maxFragLookUpTolerance,g=o.start-p,m=o.start+o.duration+p;if(h||m<d.start||g>d.end){const v=f>m;(f<g||v)&&(v&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(l){this.fragmentTracker.removeFragmentsInRange(f,1/0,this.playlistType,!0);const p=this.lastCurrentTime;if(f>p&&(this.lastCurrentTime=f),!this.loadingParts){const g=Math.max(d.end,f),m=this.shouldLoadParts(this.getLevelDetails(),g);m&&(this.log(`LL-Part loading ON after seeking to ${f.toFixed(2)} with buffer @${g.toFixed(2)}`),this.loadingParts=m)}}this.hls.hasEnoughToStart||(this.log(`Setting ${h?"startPosition":"nextLoadPosition"} to ${f} for seek without enough to start`),this.nextLoadPosition=f,h&&(this.startPosition=f)),h&&this.state===q.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=n,this.hls=e,this.fragmentLoader=new KD(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new oh(e.config)}registerListeners(){const{hls:e}=this;e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(b.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===q.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=q.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const i=e.end||0,r=this.config.timelineOffset||0;if(i<=r)return!1;const n=e.buffered;this.config.maxBufferHole&&n&&n.length>1&&(e=be.bufferedInfo(n,e.start,0));const a=e.nextStart;if(a&&a>r&&a<t.edge||this.media.currentTime<e.start)return!1;const l=t.partList;if(l!=null&&l.length){const u=l[l.length-1];return be.isBuffered(this.media,u.start+u.duration/2)}const c=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(c)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;$t(i,"seeking",this.onMediaSeeking),$t(i,"ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===q.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const i=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),zt(r,"seeking",this.onMediaSeeking),zt(r,"ended",this.onMediaEnded),this.keyLoader&&!i&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,i){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=q.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,i){this.startFragRequested=!0,this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){const r=n=>{const a=n.frag;if(this.fragContextChanged(a)){this.warn(`${a.type} sn: ${a.sn}${n.part?" part: "+n.part.index:""} of ${this.fragInfo(a,!1,n.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(a);return}a.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,i,r).then(n=>{if(!n)return;const a=this.state,o=n.frag;if(this.fragContextChanged(o)){(a===q.FRAG_LOADING||!this.fragCurrent&&a===q.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=q.IDLE);return}"payload"in n&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(b.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===q.STOPPED||this.state===q.ERROR||(this.warn(`Frag error: ${(n==null?void 0:n.message)||n}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:i}=this;if(i.getState(e)===vt.APPENDING){const n=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,n),o=Math.max(e.duration,a?a.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===vt.PARTIAL&&i.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,i=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:i};this.hls.trigger(b.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{const r=i==null?void 0:i.frag;if(!r||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:r}=this,{frag:n,payload:a}=i,o=n.decryptdata;if(a&&a.byteLength>0&&o!=null&&o.key&&o.iv&&Zr(o.method)){const l=self.performance.now();return this.decrypter.decrypt(new Uint8Array(a),o.key.buffer,o.iv.buffer,ch(o.method)).catch(c=>{throw r.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:n}),c}).then(c=>{const u=self.performance.now();return r.trigger(b.FRAG_DECRYPTED,{frag:n,payload:c,stats:{tstart:l,tdecrypt:u}}),i.payload=c,this.completeInitSegmentLoad(i)})}return this.completeInitSegmentLoad(i)}).catch(i=>{this.state===q.STOPPED||this.state===q.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const i=e.frag.stats;this.state!==q.STOPPED&&(this.state=q.IDLE),e.frag.data=new Uint8Array(e.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var i,r;const n=e.tracks;if(n&&!t.encrypted&&((i=n.audio)!=null&&i.encrypted||(r=n.video)!=null&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const a=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${a?"attached mediaKeys: "+a.mediaKeys:"detached"})`);return this.warn(o.message),!a||a.mediaKeys?!1:(this.hls.trigger(b.ERROR,{type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const i=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${i?y2.toString(be.getBuffered(i)):"(detached)"})`),ht(e)){var r;if(e.type!==ce.SUBTITLE){const a=e.elementaryStreams;if(!Object.keys(a).some(o=>!!a[o])){this.state=q.IDLE;return}}const n=(r=this.levels)==null?void 0:r[e.level];n!=null&&n.fragmentError&&(this.log(`Resetting level fragment error count of ${n.fragmentError} on frag buffered`),n.fragmentError=0)}this.state=q.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:r,partsLoaded:n}=e,a=!n||n.length===0||n.some(l=>!l),o=new lh(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!a);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,r){var n;this.fragCurrent=e;const a=t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let o=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)){if(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=q.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(d=>{if(!this.fragContextChanged(d.frag))return this.hls.trigger(b.KEY_LOADED,d),this.state===q.KEY_LOADING&&(this.state=q.IDLE),d}),this.hls.trigger(b.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,a.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const l=this.fragPrevious;if(ht(e)&&(!l||e.sn!==l.sn)){const d=this.shouldLoadParts(t.details,e.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} loading sn ${l==null?void 0:l.sn}->${e.sn}`),this.loadingParts=d)}if(i=Math.max(e.start,i||0),this.loadingParts&&ht(e)){const d=a.partList;if(d&&r){i>a.fragmentEnd&&a.fragmentHint&&(e=a.fragmentHint);const h=this.getNextPart(d,e,i);if(h>-1){const p=d[h];e=this.fragCurrent=p.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${p.index} (${h}/${d.length-1}) of ${this.fragInfo(e,!1,p)}) cc: ${e.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=p.start+p.duration,this.state=q.FRAG_LOADING;let g;return o?g=o.then(m=>!m||this.fragContextChanged(m.frag)?null:this.doFragPartsLoad(e,p,t,r)).catch(m=>this.handleFragLoadError(m)):g=this.doFragPartsLoad(e,p,t,r).catch(m=>this.handleFragLoadError(m)),this.hls.trigger(b.FRAG_LOADING,{frag:e,part:p,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}else if(!e.url||this.loadedEndOfParts(d,i))return Promise.resolve(null)}}if(ht(e)&&this.loadingParts){var c;this.log(`LL-Part loading OFF after next part miss @${i.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(c=a.partList)==null?void 0:c.filter(d=>d.loaded).map(d=>`[${d.start}-${d.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+a.startSN+"-"+a.endSN+"]"}, target: ${parseFloat(i.toFixed(3))}`),re(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=q.FRAG_LOADING;const u=this.config.progressive&&e.type!==ce.SUBTITLE;let f;return u&&o?f=o.then(d=>!d||this.fragContextChanged(d.frag)?null:this.fragmentLoader.load(e,r)).catch(d=>this.handleFragLoadError(d)):f=Promise.all([this.fragmentLoader.load(e,u?r:void 0),o]).then(([d])=>(!u&&r&&r(d),d)).catch(d=>this.handleFragLoadError(d)),this.hls.trigger(b.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,i,r){return new Promise((n,a)=>{var o;const l=[],c=(o=i.details)==null?void 0:o.partList,u=f=>{this.fragmentLoader.loadPart(e,f,r).then(d=>{l[f.index]=d;const h=d.part;this.hls.trigger(b.FRAG_LOADED,d);const p=Fg(i.details,e.sn,f.index+1)||lS(c,e.sn,f.index+1);if(p)u(p);else return n({frag:e,part:h,partsLoaded:l})}).catch(a)};u(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===V.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===fe.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(b.ERROR,t)}else this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==q.PARSING){!this.fragCurrent&&this.state!==q.STOPPED&&this.state!==q.ERROR&&(this.state=q.IDLE);return}const{frag:i,part:r,level:n}=t,a=self.performance.now();i.stats.parsing.end=a,r&&(r.stats.parsing.end=a);const o=this.getLevelDetails(),c=o&&i.sn>o.endSN||this.shouldLoadParts(o,i.end);c!==this.loadingParts&&(this.log(`LL-Part loading ${c?"ON":"OFF"} after parsing segment ending @${i.end.toFixed(2)}`),this.loadingParts=c),this.updateLevelTiming(i,r,n,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var i;const n=e.partList[0];if(n.fragment.type===ce.SUBTITLE)return!1;const a=n.end+(((i=e.fragmentHint)==null?void 0:i.duration)||0);if(t>=a){var r;if((this.hls.hasEnoughToStart?((r=this.media)==null?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>n.start-n.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:r,sn:n,part:a}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${n} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const o=t[r],l=o.details,c=a>-1?Fg(l,n,a):null,u=c?c.fragment:oS(l,n,i);return u?(i&&i!==u&&(u.stats=i.stats),{frag:u,part:c,level:o}):null}bufferFragmentData(e,t,i,r,n){if(this.state!==q.PARSING)return;const{data1:a,data2:o}=e;let l=a;if(o&&(l=bs(a,o)),!l.length)return;const c=this.initPTS[t.cc],u=c?-c.baseTime/c.timescale:void 0,f={type:e.type,frag:t,part:i,chunkMeta:r,offset:u,parent:t.type,data:l};if(this.hls.trigger(b.BUFFER_APPENDING,f),e.dropped&&e.independent&&!i){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!be.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const i=t.currentTime,r=be.bufferInfo(t,i,0),n=e.duration,a=Math.min(this.config.maxFragLookUpTolerance*2,n*.25),o=Math.max(Math.min(e.start-a,r.end-a),i+a);e.start-o>a&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var i;const r=this.getLoadPosition();if(!re(r))return null;const a=this.lastCurrentTime>r||(i=this.media)!=null&&i.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,a)}getFwdBufferInfoAtPos(e,t,i,r){const n=be.bufferInfo(e,t,r);if(n.len===0&&n.nextStart!==void 0){const a=this.fragmentTracker.getBufferedFrag(t,i);if(a&&(n.nextStart<=a.end||a.gap)){const o=Math.max(Math.min(n.nextStart,a.end)-t,r);return be.bufferInfo(e,t,o)}}return n}getMaxBufferLength(e){const{config:t}=this;let i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const i=this.config,r=Math.max(Math.min(e-t,i.maxBufferLength),t),n=Math.max(e-t*3,i.maxMaxBufferLength/2,r);return n>=r?(i.maxMaxBufferLength=n,this.warn(`Reduce max buffer length to ${n}s`),!0):!1}getAppendedFrag(e,t=ce.MAIN){const i=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const i=t.fragments,r=i.length;if(!r)return null;const{config:n}=this,a=i[0].start,o=n.lowLatencyMode&&!!t.partList;let l=null;if(t.live){const f=n.initialLiveManifestSize;if(r<f)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${f})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<a){var c;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),l=this.getInitialLiveFragment(t);const d=this.hls.startPosition,h=this.hls.liveSyncPosition,p=l?(d!==-1&&d>=a?d:h)||l.start:e;this.log(`Setting startPosition to ${p} to match start frag at live edge. mainStart: ${d} liveSyncPosition: ${h} frag.start: ${(c=l)==null?void 0:c.start}`),this.startPosition=this.nextLoadPosition=p}}else e<=a&&(l=i[0]);if(!l){const f=this.loadingParts?t.partEnd:t.fragmentEnd;l=this.getFragmentAtPosition(e,f,t)}let u=this.filterReplacedPrimary(l,t);if(!u&&l){const f=l.sn-t.startSN;u=this.filterReplacedPrimary(i[f+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===vt.OK||i===vt.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,r,n){let a=null;if(e.gap&&(a=this.getNextFragment(this.nextLoadPosition,t),a&&!a.gap&&i.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r,0);if(o!==null&&i.len+o.len>=n){const l=a.sn;return this.loopSn!==l&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${l}`),this.loopSn=l),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(Ug(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Ug(this.config)&&e.type!==ce.SUBTITLE){const i=this.hls.interstitialsManager,r=i==null?void 0:i.bufferingItem;if(r){const a=r.event;if(a){if(a.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&(t==null?void 0:t.live)===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}const n=i==null?void 0:i.playerQueue;if(n)for(let a=n.length;a--;){const o=n[a].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,i){let r=-1,n=!1,a=!0;for(let o=0,l=e.length;o<l;o++){const c=e[o];if(a=a&&!c.independent,r>-1&&i<c.start)break;const u=c.loaded;u?r=-1:(n||(c.independent||a)&&c.fragment===t)&&(c.fragment!==t&&this.warn(`Need buffer at ${i} but next unloaded part starts at ${c.start}`),r=o),n=u}return r}loadedEndOfParts(e,t){let i;for(let r=e.length;r--;){if(i=e[r],!i.loaded)return!1;if(t>i.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,i=this.fragPrevious;let r=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=OD(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){const a=t[n-e.startSN];i.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Wb(e,i.cc,i.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(r=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,i){const{config:r}=this;let{fragPrevious:n}=this,{fragments:a,endSN:o}=i;const{fragmentHint:l}=i,{maxFragLookUpTolerance:c}=r,u=i.partList,f=!!(this.loadingParts&&u!=null&&u.length&&l);f&&!this.bitrateTest&&u[u.length-1].fragment.sn===l.sn&&(a=a.concat(l),o=l.sn);let d;if(e<t){var h;const g=e<this.lastCurrentTime||e>t-c||(h=this.media)!=null&&h.paused||!this.startFragRequested?0:c;d=_r(n,a,e,g)}else d=a[a.length-1];if(d){const p=d.sn-i.startSN,g=this.fragmentTracker.getState(d);if((g===vt.OK||g===vt.PARTIAL&&d.gap)&&(n=d),n&&d.sn===n.sn&&(!f||u[0].fragment.sn>d.sn||!i.live)&&d.level===n.level){const v=a[p+1];d.sn<o&&this.fragmentTracker.getState(v)!==vt.OK?d=v:d=null}}return d}alignPlaylists(e,t,i){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const n=e.fragmentStart,a=!t,o=e.alignedSliding&&re(n);if(a||!o&&!n){v2(i,e);const l=e.fragmentStart;return this.log(`Live playlist sliding: ${l.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),l}return n}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let i=this.startPosition;i<t&&(i=-1);const r=this.timelineOffset;if(i===-1){const n=this.startTimeOffset!==null,a=n?this.startTimeOffset:e.startTimeOffset;a!==null&&re(a)?(i=t+a,a<0&&(i+=e.edge),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Setting startPosition to ${i} for start time offset ${a} found in ${n?"multivariant":"media"} playlist`),this.startPosition=i):e.live?(i=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${i}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=i=0),this.lastCurrentTime=i+r}this.nextLoadPosition=i+r}getLoadPosition(){var e;const{media:t}=this;let i=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?i=t.currentTime:this.nextLoadPosition>=0&&(i=this.nextLoadPosition),i}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&ht(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==q.FRAG_LOADING_WAITING_RETRY)&&(this.state=q.IDLE)}onFragmentOrKeyLoadError(e,t){var i;if(t.chunkMeta&&!t.frag){const v=this.getCurrentContext(t.chunkMeta);v&&(t.frag=v.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;if(this.fragContextChanged(r)){var n;this.warn(`Frag load error must match current frag to retry ${r.url} > ${(n=this.fragCurrent)==null?void 0:n.url}`);return}const a=t.details===V.FRAG_GAP;a&&this.fragmentTracker.fragBuffered(r,!0);const o=t.errorAction;if(!o){this.state=q.ERROR;return}const{action:l,flags:c,retryCount:u=0,retryConfig:f}=o,d=!!f,h=d&&l===At.RetryRequest,p=d&&!o.resolved&&c===is.MoveAllAlternatesMatchingHost,g=(i=this.hls.latestLevelDetails)==null?void 0:i.live;if(!h&&p&&ht(r)&&!r.endList&&g&&!Qb(t))this.resetFragmentErrors(e),this.treatAsGap(r),o.resolved=!0;else if((h||p)&&u<f.maxNumRetry){var m;const v=Mf((m=t.response)==null?void 0:m.code),y=ah(f,u);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+y,this.state=q.FRAG_LOADING_WAITING_RETRY,o.resolved=!0,v){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${y}ms`)}else if(f)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!a&&l!==At.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else l===At.SendAlternateToPenaltyBox?this.state=q.WAITING_LEVEL:this.state=q.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,i=t===1/0;(!t||e>=t||i&&!Mf(0))&&(i&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=q.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===q.PARSING||this.state===q.PARSED){const t=e.frag,i=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,i),n=r&&r.len>.5;n&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const a=!n;return a&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${i} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===ce.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==q.STOPPED&&(this.state=q.IDLE)}afterBufferFlushed(e,t,i){if(!e)return;const r=be.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===q.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==q.STOPPED&&(this.state=q.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,r){const n=i.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,c)=>{const u=e.elementaryStreams[c];if(u){const f=u.endPTS-u.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${f})`),l||!1;const d=r?0:rS(n,e,u.startPTS,u.endPTS,u.startDTS,u.endDTS,this);return this.hls.trigger(b.LEVEL_PTS_UPDATED,{details:n,level:i,drift:d,type:c,frag:e,start:u.startPTS,end:u.endPTS}),!0}return l},!1)){var o;const l=((o=this.transmuxer)==null?void 0:o.error)===null;if((i.fragmentError===0||l&&(i.fragmentError<2||e.endList))&&this.treatAsGap(e,i),l){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=q.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(b.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ce.MAIN?"level":"track"}fragInfo(e,t=!0,i){var r,n;return`${this.playlistLabel()} ${e.level} (${i?"part":"frag"}:[${((r=t&&!i?e.startPTS:(i||e).start)!=null?r:NaN).toFixed(3)}-${((n=t&&!i?e.endPTS:(i||e).end)!=null?n:NaN).toFixed(3)}]${i&&e.type==="main"?"INDEPENDENT="+(i.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Ug(s){return!!s.interstitialsController&&s.enableInterstitialPlayback!==!1}class dS{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=b2(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function b2(s,e){const t=new Uint8Array(e);let i=0;for(let r=0;r<s.length;r++){const n=s[r];t.set(n,i),i+=n.length}return t}var _u={exports:{}},Gg;function S2(){return Gg||(Gg=1,function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function n(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new r(u,f||l,d),p=t?t+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new i:delete l._events[c]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=t?t+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},o.prototype.listenerCount=function(c){var u=t?t+c:c,f=this._events[u];return f?f.fn?1:f.length:0},o.prototype.emit=function(c,u,f,d,h,p){var g=t?t+c:c;if(!this._events[g])return!1;var m=this._events[g],v=arguments.length,y,E;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,u),!0;case 3:return m.fn.call(m.context,u,f),!0;case 4:return m.fn.call(m.context,u,f,d),!0;case 5:return m.fn.call(m.context,u,f,d,h),!0;case 6:return m.fn.call(m.context,u,f,d,h,p),!0}for(E=1,y=new Array(v-1);E<v;E++)y[E-1]=arguments[E];m.fn.apply(m.context,y)}else{var w=m.length,T;for(E=0;E<w;E++)switch(m[E].once&&this.removeListener(c,m[E].fn,void 0,!0),v){case 1:m[E].fn.call(m[E].context);break;case 2:m[E].fn.call(m[E].context,u);break;case 3:m[E].fn.call(m[E].context,u,f);break;case 4:m[E].fn.call(m[E].context,u,f,d);break;default:if(!y)for(T=1,y=new Array(v-1);T<v;T++)y[T-1]=arguments[T];m[E].fn.apply(m[E].context,y)}}return!0},o.prototype.on=function(c,u,f){return n(this,c,u,f,!1)},o.prototype.once=function(c,u,f){return n(this,c,u,f,!0)},o.prototype.removeListener=function(c,u,f,d){var h=t?t+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var g=0,m=[],v=p.length;g<v;g++)(p[g].fn!==u||d&&!p[g].once||f&&p[g].context!==f)&&m.push(p[g]);m.length?this._events[h]=m.length===1?m[0]:m:a(this,h)}return this},o.prototype.removeAllListeners=function(c){var u;return c?(u=t?t+c:c,this._events[u]&&a(this,u)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,s.exports=o}(_u)),_u.exports}var E2=S2(),dh=KR(E2);const fa="1.6.15",un={};function _2(){return typeof __HLS_WORKER_BUNDLE__=="function"}function x2(){const s=un[fa];if(s)return s.clientCount++,s;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),r={worker:new self.Worker(t),objectURL:t,clientCount:1};return un[fa]=r,r}function A2(s){const e=un[s];if(e)return e.clientCount++,e;const t=new self.URL(s,self.location.href).href,r={worker:new self.Worker(t),scriptURL:t,clientCount:1};return un[s]=r,r}function T2(s){const e=un[s||fa];if(e&&e.clientCount--===1){const{worker:i,objectURL:r}=e;delete un[s||fa],r&&self.URL.revokeObjectURL(r),i.terminate()}}function hS(s,e){return e+10<=s.length&&s[e]===51&&s[e+1]===68&&s[e+2]===73&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128}function hh(s,e){return e+10<=s.length&&s[e]===73&&s[e+1]===68&&s[e+2]===51&&s[e+3]<255&&s[e+4]<255&&s[e+6]<128&&s[e+7]<128&&s[e+8]<128&&s[e+9]<128}function lc(s,e){let t=0;return t=(s[e]&127)<<21,t|=(s[e+1]&127)<<14,t|=(s[e+2]&127)<<7,t|=s[e+3]&127,t}function da(s,e){const t=e;let i=0;for(;hh(s,e);){i+=10;const r=lc(s,e+6);i+=r,hS(s,e+10)&&(i+=10),e+=i}if(i>0)return s.subarray(t,t+i)}function w2(s,e,t,i){const r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],n=e[t+2],a=n>>2&15;if(a>12){const h=new Error(`invalid ADTS sampling index:${a}`);s.emit(b.ERROR,b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!0,error:h,reason:h.message});return}const o=(n>>6&3)+1,l=e[t+3]>>6&3|(n&1)<<2,c="mp4a.40."+o,u=r[a];let f=a;(o===5||o===29)&&(f-=3);const d=[o<<3|(f&14)>>1,(f&1)<<7|l<<3];return We.log(`manifest codec:${i}, parsed codec:${c}, channels:${l}, rate:${u} (ADTS object type:${o} sampling index:${a})`),{config:d,samplerate:u,channelCount:l,codec:c,parsedCodec:c,manifestCodec:i}}function pS(s,e){return s[e]===255&&(s[e+1]&246)===240}function mS(s,e){return s[e+1]&1?7:9}function ph(s,e){return(s[e+3]&3)<<11|s[e+4]<<3|(s[e+5]&224)>>>5}function C2(s,e){return e+5<s.length}function wl(s,e){return e+1<s.length&&pS(s,e)}function L2(s,e){return C2(s,e)&&pS(s,e)&&ph(s,e)<=s.length-e}function I2(s,e){if(wl(s,e)){const t=mS(s,e);if(e+t>=s.length)return!1;const i=ph(s,e);if(i<=t)return!1;const r=e+i;return r===s.length||wl(s,r)}return!1}function gS(s,e,t,i,r){if(!s.samplerate){const n=w2(e,t,i,r);if(!n)return;ze(s,n)}}function vS(s){return 1024*9e4/s}function R2(s,e){const t=mS(s,e);if(e+t<=s.length){const i=ph(s,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function yS(s,e,t,i,r){const n=vS(s.samplerate),a=i+r*n,o=R2(e,t);let l;if(o){const{frameLength:f,headerLength:d}=o,h=d+f,p=Math.max(0,t+h-e.length);p?(l=new Uint8Array(h-d),l.set(e.subarray(t+d,e.length),0)):l=e.subarray(t+d,t+h);const g={unit:l,pts:a};return p||s.samples.push(g),{sample:g,length:h,missing:p}}const c=e.length-t;return l=new Uint8Array(c),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:a},length:c,missing:-1}}function D2(s,e){return hh(s,e)&&lc(s,e+6)+10<=s.length-e}function k2(s){return s instanceof ArrayBuffer?s:s.byteOffset==0&&s.byteLength==s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer}function xu(s,e=0,t=1/0){return P2(s,e,t,Uint8Array)}function P2(s,e,t,i){const r=O2(s);let n=1;"BYTES_PER_ELEMENT"in i&&(n=i.BYTES_PER_ELEMENT);const a=M2(s)?s.byteOffset:0,o=(a+s.byteLength)/n,l=(a+e)/n,c=Math.floor(Math.max(0,Math.min(l,o))),u=Math.floor(Math.min(c+Math.max(t,0),o));return new i(r,c,u-c)}function O2(s){return s instanceof ArrayBuffer?s:s.buffer}function M2(s){return s&&s.buffer instanceof ArrayBuffer&&s.byteLength!==void 0&&s.byteOffset!==void 0}function N2(s){const e={key:s.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(s.size<2)return;if(s.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const i=s.data.subarray(1).indexOf(0);if(i===-1)return;const r=os(xu(s.data,1,i)),n=s.data[2+i],a=s.data.subarray(3+i).indexOf(0);if(a===-1)return;const o=os(xu(s.data,3+i,a));let l;return r==="-->"?l=os(xu(s.data,4+i+a)):l=k2(s.data.subarray(4+i+a)),e.mimeType=r,e.pictureType=n,e.description=o,e.data=l,e}function F2(s){if(s.size<2)return;const e=os(s.data,!0),t=new Uint8Array(s.data.subarray(e.length+1));return{key:s.type,info:e,data:t.buffer}}function $2(s){if(s.size<2)return;if(s.type==="TXXX"){let t=1;const i=os(s.data.subarray(t),!0);t+=i.length+1;const r=os(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=os(s.data.subarray(1));return{key:s.type,info:"",data:e}}function B2(s){if(s.type==="WXXX"){if(s.size<2)return;let t=1;const i=os(s.data.subarray(t),!0);t+=i.length+1;const r=os(s.data.subarray(t));return{key:s.type,info:i,data:r}}const e=os(s.data);return{key:s.type,info:"",data:e}}function U2(s){return s.type==="PRIV"?F2(s):s.type[0]==="W"?B2(s):s.type==="APIC"?N2(s):$2(s)}function G2(s){const e=String.fromCharCode(s[0],s[1],s[2],s[3]),t=lc(s,4),i=10;return{type:e,size:t,data:s.subarray(i,i+t)}}const io=10,H2=10;function bS(s){let e=0;const t=[];for(;hh(s,e);){const i=lc(s,e+6);s[e+5]>>6&1&&(e+=io),e+=io;const r=e+i;for(;e+H2<r;){const n=G2(s.subarray(e)),a=U2(n);a&&t.push(a),e+=n.size+io}hS(s,e)&&(e+=io)}return t}function SS(s){return s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp"}function Y2(s){if(s.data.byteLength===8){const e=new Uint8Array(s.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}}function mh(s){const e=bS(s);for(let t=0;t<e.length;t++){const i=e[t];if(SS(i))return Y2(i)}}let ns=function(s){return s.audioId3="org.id3",s.dateRange="com.apple.quicktime.HLS",s.emsg="https://aomedia.org/emsg/ID3",s.misbklv="urn:misb:KLV:bin:1910.1",s}({});function Vs(s="",e=9e4){return{type:s,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class gh{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=bs(this.cachedData,e),this.cachedData=null);let i=da(e,0),r=i?i.length:0,n;const a=this._audioTrack,o=this._id3Track,l=i?mh(i):void 0,c=e.length;for((this.basePTS===null||this.frameIndex===0&&re(l))&&(this.basePTS=j2(l,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ns.audioId3,duration:Number.POSITIVE_INFINITY});r<c;){if(this.canParse(e,r)){const u=this.appendFrame(a,e,r);u?(this.frameIndex++,this.lastPTS=u.sample.pts,r+=u.length,n=r):r=c}else D2(e,r)?(i=da(e,r),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ns.audioId3,duration:Number.POSITIVE_INFINITY}),r+=i.length,n=r):r++;if(r===c&&n!==c){const u=e.slice(n);this.cachedData?this.cachedData=bs(this.cachedData,u):this.cachedData=u}}return{audioTrack:a,videoTrack:Vs(),id3Track:o,textTrack:Vs()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Vs(),id3Track:this._id3Track,textTrack:Vs()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const j2=(s,e,t)=>{if(re(s))return s*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};let ro=null;const V2=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],K2=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W2=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],z2=[0,1,1,4];function ES(s,e,t,i,r){if(t+24>e.length)return;const n=_S(e,t);if(n&&t+n.frameLength<=e.length){const a=n.samplesPerFrame*9e4/n.sampleRate,o=i+r*a,l={unit:e.subarray(t,t+n.frameLength),pts:o,dts:o};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(l),{sample:l,length:n.frameLength,missing:0}}}function _S(s,e){const t=s[e+1]>>3&3,i=s[e+1]>>1&3,r=s[e+2]>>4&15,n=s[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&n!==3){const a=s[e+2]>>1&1,o=s[e+3]>>6,l=t===3?3-i:i===3?3:4,c=V2[l*14+r-1]*1e3,f=K2[(t===3?0:t===2?1:2)*3+n],d=o===3?1:2,h=W2[t][i],p=z2[i],g=h*8*p,m=Math.floor(h*c/f+a)*p;if(ro===null){const E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ro=E?parseInt(E[1]):0}return!!ro&&ro<=87&&i===2&&c>=224e3&&o===0&&(s[e+3]=s[e+3]|128),{sampleRate:f,channelCount:d,frameLength:m,samplesPerFrame:g}}}function vh(s,e){return s[e]===255&&(s[e+1]&224)===224&&(s[e+1]&6)!==0}function xS(s,e){return e+1<s.length&&vh(s,e)}function Q2(s,e){return vh(s,e)&&4<=s.length-e}function AS(s,e){if(e+1<s.length&&vh(s,e)){const i=_S(s,e);let r=4;i!=null&&i.frameLength&&(r=i.frameLength);const n=e+r;return n===s.length||xS(s,n)}return!1}class q2 extends gh{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const i=da(e,0);let r=(i==null?void 0:i.length)||0;if(AS(e,r))return!1;for(let n=e.length;r<n;r++)if(I2(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return L2(e,t)}appendFrame(e,t,i){gS(e,this.observer,t,i,e.manifestCodec);const r=yS(e,t,i,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const TS=(s,e)=>{let t=0,i=5;e+=i;const r=new Uint32Array(1),n=new Uint32Array(1),a=new Uint8Array(1);for(;i>0;){a[0]=s[e];const o=Math.min(i,8),l=8-o;n[0]=4278190080>>>24+l<<l,r[0]=(a[0]&n[0])>>l,t=t?t<<o|r[0]:r[0],e+=1,i-=o}return t};class X2 extends gh{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,i){const r=wS(e,t,i,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;const t=da(e,0);if(!t)return!1;const i=t.length;return e[i]===11&&e[i+1]===119&&mh(t)!==void 0&&TS(e,i)<16}}function wS(s,e,t,i,r){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const n=e[t+4]>>6;if(n>=3)return-1;const o=[48e3,44100,32e3][n],l=e[t+4]&63,u=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+n]*2;if(t+u>e.length)return-1;const f=e[t+6]>>5;let d=0;f===2?d+=2:(f&1&&f!==1&&(d+=2),f&4&&(d+=2));const h=(e[t+6]<<8|e[t+7])>>12-d&1,g=[2,1,2,3,3,4,4,5][f]+h,m=e[t+5]>>3,v=e[t+5]&7,y=new Uint8Array([n<<6|m<<1|v>>2,(v&3)<<6|f<<3|h<<2|l>>4,l<<4&224]),E=1536/o*9e4,w=i+r*E,T=e.subarray(t,t+u);return s.config=y,s.channelCount=g,s.samplerate=o,s.samples.push({unit:T,pts:w}),u}class J2 extends gh{resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=da(e,0);let i=(t==null?void 0:t.length)||0;if(t&&e[i]===11&&e[i+1]===119&&mh(t)!==void 0&&TS(e,i)<=16)return!1;for(let r=e.length;i<r;i++)if(AS(e,i))return We.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Q2(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return ES(e,t,i,this.basePTS,this.frameIndex)}}const Z2=/\/emsg[-/]ID3/i;class ek{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,i,r){const n=this.videoTrack=Vs("video",1),a=this.audioTrack=Vs("audio",1),o=this.txtTrack=Vs("text",1);if(this.id3Track=Vs("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const l=Nb(e);if(l.video){const{id:c,timescale:u,codec:f,supplemental:d}=l.video;n.id=c,n.timescale=o.timescale=u,n.codec=f,n.supplemental=d}if(l.audio){const{id:c,timescale:u,codec:f}=l.audio;a.id=c,a.timescale=u,a.codec=f}o.id=Pb.text,n.sampleDuration=0,n.duration=a.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return XR(e)}demux(e,t){this.timeOffset=t;let i=e;const r=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=bs(this.remainderData,e));const o=rD(i);this.remainderData=o.remainder,r.samples=o.valid||new Uint8Array}else r.samples=i;const a=this.extractID3Track(r,t);return n.samples=ng(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return i.samples=ng(e,t),{videoTrack:t,audioTrack:Vs(),id3Track:r,textTrack:Vs()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const r=Ie(e.samples,["emsg"]);r&&r.forEach(n=>{const a=aD(n);if(Z2.test(a.schemeIdUri)){const o=Hg(a,t);let l=a.eventDuration===4294967295?Number.POSITIVE_INFINITY:a.eventDuration/a.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=a.payload;i.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:ns.emsg,duration:l})}else if(this.config.enableEmsgKLVMetadata&&a.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Hg(a,t);i.samples.push({data:a.payload,len:a.payload.byteLength,dts:o,pts:o,type:ns.misbklv,duration:Number.POSITIVE_INFINITY})}})}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function Hg(s,e){return re(s.presentationTime)?s.presentationTime/s.timeScale:e+s.presentationTimeDelta/s.timeScale}class tk{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new oh(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Ji.cbc)}decryptAacSample(e,t,i){const r=e[t].unit;if(r.length<=16)return;const n=r.subarray(16,r.length-r.length%16),a=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(a).then(o=>{const l=new Uint8Array(o);r.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)}).catch(i)}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)i.set(e.subarray(n,n+16),r);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let r=0;for(let n=32;n<e.length-16;n+=160,r+=16)e.set(i.subarray(r,r+16),n);return e}decryptAvcSample(e,t,i,r,n){const a=Bb(n.data),o=this.getAvcEncryptedData(a);this.decryptBuffer(o.buffer).then(l=>{n.data=this.getAvcDecryptedUnit(a,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,r)}).catch(r)}decryptAvcSamples(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){r();return}const n=e[t].units;for(;!(i>=n.length);i++){const a=n[i];if(!(a.data.length<=48||a.type!==1&&a.type!==5)&&(this.decryptAvcSample(e,t,i,r,a),!this.decrypter.isSync()))return}}}}class CS{constructor(){this.VideoSample=null}createVideoSample(e,t,i){return{key:e,frame:!1,pts:t,dts:i,units:[],length:0}}getLastNalUnit(e){var t;let i=this.VideoSample,r;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const n=i.units;r=n[n.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const i=t.samples,r=i.length;if(r){const n=i[r-1];e.pts=n.pts,e.dts=n.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,i){const r=t.byteLength;let n=e.naluState||0;const a=n,o=[];let l=0,c,u,f,d=-1,h=0;for(n===-1&&(d=0,h=this.getNALuType(t,0),n=0,l=1);l<r;){if(c=t[l++],!n){n=c?0:1;continue}if(n===1){n=c?0:2;continue}if(!c)n=3;else if(c===1){if(u=l-n-1,d>=0){const p={data:t.subarray(d,u),type:h};o.push(p)}else{const p=this.getLastNalUnit(e.samples);p&&(a&&l<=4-a&&p.state&&(p.data=p.data.subarray(0,p.data.byteLength-a)),u>0&&(p.data=bs(p.data,t.subarray(0,u)),p.state=0))}l<r?(f=this.getNALuType(t,l),d=l,h=f,n=0):n=-1}else n=0}if(d>=0&&n>=0){const p={data:t.subarray(d,r),type:h,state:n};o.push(p)}if(o.length===0){const p=this.getLastNalUnit(e.samples);p&&(p.data=bs(p.data,t))}return e.naluState=n,o}}class Wn{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");r.set(e.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&We.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class sk extends CS{parsePES(e,t,i,r){const n=this.parseNALu(e,i.data,r);let a=this.VideoSample,o,l=!1;i.data=null,a&&n.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),n.forEach(c=>{var u,f;switch(c.type){case 1:{let g=!1;o=!0;const m=c.data;if(l&&m.length>4){const v=this.readSliceType(m);(v===2||v===4||v===7||v===9)&&(g=!0)}if(g){var d;(d=a)!=null&&d.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.frame=!0,a.key=g;break}case 5:o=!0,(u=a)!=null&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 6:{o=!0,ih(c.data,1,i.pts,t.samples);break}case 7:{var h,p;o=!0,l=!0;const g=c.data,m=this.readSPS(g);if(!e.sps||e.width!==m.width||e.height!==m.height||((h=e.pixelRatio)==null?void 0:h[0])!==m.pixelRatio[0]||((p=e.pixelRatio)==null?void 0:p[1])!==m.pixelRatio[1]){e.width=m.width,e.height=m.height,e.pixelRatio=m.pixelRatio,e.sps=[g];const v=g.subarray(1,4);let y="avc1.";for(let E=0;E<3;E++){let w=v[E].toString(16);w.length<2&&(w="0"+w),y+=w}e.codec=y}break}case 8:o=!0,e.pps=[c.data];break;case 9:o=!0,e.audFound=!0,(f=a)!=null&&f.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;case 12:o=!0;break;default:o=!1;break}a&&o&&a.units.push(c)}),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Wn(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let i=8,r=8,n;for(let a=0;a<e;a++)r!==0&&(n=t.readEG(),r=(i+n+256)%256),i=r===0?i:r}readSPS(e){const t=new Wn(e);let i=0,r=0,n=0,a=0,o,l,c;const u=t.readUByte.bind(t),f=t.readBits.bind(t),d=t.readUEG.bind(t),h=t.readBoolean.bind(t),p=t.skipBits.bind(t),g=t.skipEG.bind(t),m=t.skipUEG.bind(t),v=this.skipScalingList.bind(this);u();const y=u();if(f(5),p(3),u(),m(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){const M=d();if(M===3&&p(1),m(),m(),p(1),h())for(l=M!==3?8:12,c=0;c<l;c++)h()&&(c<6?v(16,t):v(64,t))}m();const E=d();if(E===0)d();else if(E===1)for(p(1),g(),g(),o=d(),c=0;c<o;c++)g();m(),p(1);const w=d(),T=d(),$=f(1);$===0&&p(1),p(1),h()&&(i=d(),r=d(),n=d(),a=d());let k=[1,1];if(h()&&h())switch(u()){case 1:k=[1,1];break;case 2:k=[12,11];break;case 3:k=[10,11];break;case 4:k=[16,11];break;case 5:k=[40,33];break;case 6:k=[24,11];break;case 7:k=[20,11];break;case 8:k=[32,11];break;case 9:k=[80,33];break;case 10:k=[18,11];break;case 11:k=[15,11];break;case 12:k=[64,33];break;case 13:k=[160,99];break;case 14:k=[4,3];break;case 15:k=[3,2];break;case 16:k=[2,1];break;case 255:{k=[u()<<8|u(),u()<<8|u()];break}}return{width:Math.ceil((w+1)*16-i*2-r*2),height:(2-$)*(T+1)*16-($?2:4)*(n+a),pixelRatio:k}}}class ik extends CS{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,i,r){const n=this.parseNALu(e,i.data,r);let a=this.VideoSample,o,l=!1;i.data=null,a&&n.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),n.forEach(c=>{var u,f;switch(c.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),a.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,l){var d;(d=a)!=null&&d.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:o=!0,(u=a)!=null&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 39:o=!0,ih(c.data,2,i.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=ze(e.params,this.readVPS(c.data)),this.initVPS=c.data),e.vps=[c.data];break;case 33:if(o=!0,l=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],c.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const h=this.readSPS(c.data);e.width=h.width,e.height=h.height,e.pixelRatio=h.pixelRatio,e.codec=h.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const p in h.params)e.params[p]=h.params[p]}this.pushParameterSet(e.sps,c.data,e.vps),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const h=this.readPPS(c.data);for(const p in h)e.params[p]=h[p]}this.pushParameterSet(e.pps,c.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(f=a)!=null&&f.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;default:o=!1;break}a&&o&&a.units.push(c)}),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}pushParameterSet(e,t,i){(i&&i[0]===this.initVPS||!i&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let i=0;for(let r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[i]=e[r],i++);return new Uint8Array(t.buffer,0,i)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Wn(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const i=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:i+1,temporalIdNested:r}}readSPS(e){const t=new Wn(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const i=t.readBits(3);t.readBoolean();const r=t.readBits(2),n=t.readBoolean(),a=t.readBits(5),o=t.readUByte(),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),d=t.readUByte(),h=t.readUByte(),p=t.readUByte(),g=t.readUByte(),m=t.readUByte(),v=t.readUByte(),y=[],E=[];for(let ne=0;ne<i;ne++)y.push(t.readBoolean()),E.push(t.readBoolean());if(i>0)for(let ne=i;ne<8;ne++)t.readBits(2);for(let ne=0;ne<i;ne++)y[ne]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),E[ne]&&t.readUByte();t.readUEG();const w=t.readUEG();w==3&&t.skipBits(1);const T=t.readUEG(),$=t.readUEG(),k=t.readBoolean();let M=0,_=0,C=0,U=0;k&&(M+=t.readUEG(),_+=t.readUEG(),C+=t.readUEG(),U+=t.readUEG());const L=t.readUEG(),R=t.readUEG(),B=t.readUEG(),S=t.readBoolean();for(let ne=S?0:i;ne<=i;ne++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Se=0;Se<4;Se++)for(let Be=0;Be<(Se===3?2:6);Be++)if(!t.readBoolean())t.readUEG();else{const Pe=Math.min(64,1<<4+(Se<<1));Se>1&&t.readEG();for(let Z=0;Z<Pe;Z++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const D=t.readUEG();let O=0;for(let ne=0;ne<D;ne++){let Se=!1;if(ne!==0&&(Se=t.readBoolean()),Se){ne===D&&t.readUEG(),t.readBoolean(),t.readUEG();let Be=0;for(let Ye=0;Ye<=O;Ye++){const Pe=t.readBoolean();let Z=!1;Pe||(Z=t.readBoolean()),(Pe||Z)&&Be++}O=Be}else{const Be=t.readUEG(),Ye=t.readUEG();O=Be+Ye;for(let Pe=0;Pe<Be;Pe++)t.readUEG(),t.readBoolean();for(let Pe=0;Pe<Ye;Pe++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const ne=t.readUEG();for(let Se=0;Se<ne;Se++){for(let Be=0;Be<B+4;Be++)t.readBits(1);t.readBits(1)}}let N=0,P=1,Y=1,z=!0,J=1,x=0;t.readBoolean(),t.readBoolean();let F=!1;if(t.readBoolean()){if(t.readBoolean()){const se=t.readUByte(),X=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Re=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];se>0&&se<16?(P=X[se-1],Y=Re[se-1]):se===255&&(P=t.readBits(16),Y=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),F=t.readBoolean(),F&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(J=t.readBits(32),x=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Re=t.readBoolean(),Ne=t.readBoolean();let Ve=!1;(Re||Ne)&&(Ve=t.readBoolean(),Ve&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Ve&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let bt=0;bt<=i;bt++){z=t.readBoolean();const Ht=z||t.readBoolean();let As=!1;Ht?t.readEG():As=t.readBoolean();const Te=As?1:t.readUEG()+1;if(Re)for(let Ze=0;Ze<Te;Ze++)t.readUEG(),t.readUEG(),Ve&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Ne)for(let Ze=0;Ze<Te;Ze++)t.readUEG(),t.readUEG(),Ve&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),N=t.readUEG())}let Q=T,ee=$;if(k){let ne=1,Se=1;w===1?ne=Se=2:w==2&&(ne=2),Q=T-ne*_-ne*M,ee=$-Se*U-Se*C}const ae=r?["A","B","C"][r]:"",de=o<<24|l<<16|c<<8|u;let ye=0;for(let ne=0;ne<32;ne++)ye=(ye|(de>>ne&1)<<31-ne)>>>0;let pe=ye.toString(16);return a===1&&pe==="2"&&(pe="6"),{codecString:`hvc1.${ae}${a}.${pe}.${n?"H":"L"}${v}.B0`,params:{general_tier_flag:n,general_profile_idc:a,general_profile_space:r,general_profile_compatibility_flags:[o,l,c,u],general_constraint_indicator_flags:[f,d,h,p,g,m],general_level_idc:v,bit_depth:L+8,bit_depth_luma_minus8:L,bit_depth_chroma_minus8:R,min_spatial_segmentation_idc:N,chroma_format_idc:w,frame_rate:{fixed:z,fps:x/J}},width:Q,height:ee,pixelRatio:[P,Y]}}readPPS(e){const t=new Wn(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const r=t.readBoolean(),n=t.readBoolean();let a=1;return n&&r?a=0:n?a=3:r&&(a=2),{parallelismType:a}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const St=188;class Oi{constructor(e,t,i,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=i,this.logger=r,this.videoParser=null}static probe(e,t){const i=Oi.syncOffset(e);return i>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),i!==-1}static syncOffset(e){const t=e.length;let i=Math.min(St*5,t-St)+1,r=0;for(;r<i;){let n=!1,a=-1,o=0;for(let l=r;l<t;l+=St)if(e[l]===71&&(t-l===St||e[l+St]===71)){if(o++,a===-1&&(a=l,a!==0&&(i=Math.min(a+St*99,e.length-St)+1)),n||(n=Uf(e,l)===0),n&&o>1&&(a===0&&o>2||l+St>i))return a}else{if(o)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Pb[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Oi.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Oi.createTrack("audio",r),this._id3Track=Oi.createTrack("id3"),this._txtTrack=Oi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,i=!1,r=!1){i||(this.sampleAes=null);let n;const a=this._videoTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let u=a.pid,f=a.pesData,d=o.pid,h=l.pid,p=o.pesData,g=l.pesData,m=null,v=this.pmtParsed,y=this._pmtId,E=e.length;if(this.remainderData&&(e=bs(this.remainderData,e),E=e.length,this.remainderData=null),E<St&&!r)return this.remainderData=e,{audioTrack:o,videoTrack:a,id3Track:l,textTrack:c};const w=Math.max(0,Oi.syncOffset(e));E-=(E-w)%St,E<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,E,e.buffer.byteLength-E));let T=0;for(let k=w;k<E;k+=St)if(e[k]===71){const M=!!(e[k+1]&64),_=Uf(e,k),C=(e[k+3]&48)>>4;let U;if(C>1){if(U=k+5+e[k+4],U===k+St)continue}else U=k+4;switch(_){case u:M&&(f&&(n=$r(f,this.logger))&&(this.readyVideoParser(a.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(a,c,n,!1)),f={data:[],size:0}),f&&(f.data.push(e.subarray(U,k+St)),f.size+=k+St-U);break;case d:if(M){if(p&&(n=$r(p,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,n);break;case"mp3":this.parseMPEGPES(o,n);break;case"ac3":this.parseAC3PES(o,n);break}p={data:[],size:0}}p&&(p.data.push(e.subarray(U,k+St)),p.size+=k+St-U);break;case h:M&&(g&&(n=$r(g,this.logger))&&this.parseID3PES(l,n),g={data:[],size:0}),g&&(g.data.push(e.subarray(U,k+St)),g.size+=k+St-U);break;case 0:M&&(U+=e[U]+1),y=this._pmtId=rk(e,U);break;case y:{M&&(U+=e[U]+1);const L=nk(e,U,this.typeSupported,i,this.observer,this.logger);u=L.videoPid,u>0&&(a.pid=u,a.segmentCodec=L.segmentVideoCodec),d=L.audioPid,d>0&&(o.pid=d,o.segmentCodec=L.segmentAudioCodec),h=L.id3Pid,h>0&&(l.pid=h),m!==null&&!v&&(this.logger.warn(`MPEG-TS PMT found at ${k} after unknown PID '${m}'. Backtracking to sync byte @${w} to parse all TS packets.`),m=null,k=w-188),v=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=_;break}}else T++;T>0&&Gf(this.observer,new Error(`Found ${T} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=f,o.pesData=p,l.pesData=g;const $={audioTrack:o,videoTrack:a,id3Track:l,textTrack:c};return r&&this.extractRemainingSamples($),$}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:r,textTrack:n}=e,a=i.pesData,o=t.pesData,l=r.pesData;let c;if(a&&(c=$r(a,this.logger))?(this.readyVideoParser(i.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(i,n,c,!0),i.pesData=null)):i.pesData=a,o&&(c=$r(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(c=$r(l,this.logger))?(this.parseID3PES(r,c),r.pesData=null):r.pesData=l}demuxSampleAes(e,t,i){const r=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new tk(this.observer,this.config,t);return this.decrypt(r,n)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new sk:e==="hevc"&&(this.videoParser=new ik))}decrypt(e,t){return new Promise(i=>{const{audioTrack:r,videoTrack:n}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{i(e)}):i(e)}):n.samples&&t.decryptAvcSamples(n.samples,0,0,()=>{i(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let i=0;const r=this.aacOverFlow;let n=t.data;if(r){this.aacOverFlow=null;const f=r.missing,d=r.sample.unit.byteLength;if(f===-1)n=bs(r.sample.unit,n);else{const h=d-f;r.sample.unit.set(n.subarray(0,f),h),e.samples.push(r.sample),i=r.missing}}let a,o;for(a=i,o=n.length;a<o-1&&!wl(n,a);a++);if(a!==i){let f;const d=a<o-1;if(d?f=`AAC PES did not start with ADTS header,offset:${a}`:f="No ADTS header found in AAC PES",Gf(this.observer,new Error(f),d,this.logger),!d)return}gS(e,this.observer,n,a,this.audioCodec);let l;if(t.pts!==void 0)l=t.pts;else if(r){const f=vS(e.samplerate);l=r.sample.pts+f}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let c=0,u;for(;a<o;)if(u=yS(e,n,a,l,c),a+=u.length,u.missing){this.aacOverFlow=u;break}else for(c++;a<o-1&&!wl(n,a);a++);}parseMPEGPES(e,t){const i=t.data,r=i.length;let n=0,a=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<r;)if(xS(i,a)){const l=ES(e,i,a,o,n);if(l)a+=l.length,n++;else break}else a++}parseAC3PES(e,t){{const i=t.data,r=t.pts;if(r===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const n=i.length;let a=0,o=0,l;for(;o<n&&(l=wS(e,i,o,r,a++))>0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=ze({},t,{type:this._videoTrack?ns.emsg:ns.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Uf(s,e){return((s[e+1]&31)<<8)+s[e+2]}function rk(s,e){return(s[e+10]&31)<<8|s[e+11]}function nk(s,e,t,i,r,n){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(s[e+1]&15)<<8|s[e+2],l=e+3+o-4,c=(s[e+10]&15)<<8|s[e+11];for(e+=12+c;e<l;){const u=Uf(s,e),f=(s[e+3]&15)<<8|s[e+4];switch(s[e]){case 207:if(!i){Au("ADTS AAC",n);break}case 15:a.audioPid===-1&&(a.audioPid=u);break;case 21:a.id3Pid===-1&&(a.id3Pid=u);break;case 219:if(!i){Au("H.264",n);break}case 27:a.videoPid===-1&&(a.videoPid=u);break;case 3:case 4:!t.mpeg&&!t.mp3?n.log("MPEG audio found, not supported in this browser"):a.audioPid===-1&&(a.audioPid=u,a.segmentAudioCodec="mp3");break;case 193:if(!i){Au("AC-3",n);break}case 129:t.ac3?a.audioPid===-1&&(a.audioPid=u,a.segmentAudioCodec="ac3"):n.log("AC-3 audio found, not supported in this browser");break;case 6:if(a.audioPid===-1&&f>0){let d=e+5,h=f;for(;h>2;){switch(s[d]){case 106:t.ac3!==!0?n.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=u,a.segmentAudioCodec="ac3");break}const g=s[d+1]+2;d+=g,h-=g}}break;case 194:case 135:return Gf(r,new Error("Unsupported EC-3 in M2TS found"),void 0,n),a;case 36:a.videoPid===-1&&(a.videoPid=u,a.segmentVideoCodec="hevc",n.log("HEVC in M2TS found"));break}e+=f+5}return a}function Gf(s,e,t,i){i.warn(`parsing error: ${e.message}`),s.emit(b.ERROR,b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Au(s,e){e.log(`${s} with AES-128-CBC encryption found in unencrypted stream`)}function $r(s,e){let t=0,i,r,n,a,o;const l=s.data;if(!s||s.size===0)return null;for(;l[0].length<19&&l.length>1;)l[0]=bs(l[0],l[1]),l.splice(1,1);if(i=l[0],(i[0]<<16)+(i[1]<<8)+i[2]===1){if(r=(i[4]<<8)+i[5],r&&r>s.size-6)return null;const u=i[7];u&192&&(a=(i[9]&14)*536870912+(i[10]&255)*4194304+(i[11]&254)*16384+(i[12]&255)*128+(i[13]&254)/2,u&64?(o=(i[14]&14)*536870912+(i[15]&255)*4194304+(i[16]&254)*16384+(i[17]&255)*128+(i[18]&254)/2,a-o>60*9e4&&(e.warn(`${Math.round((a-o)/9e4)}s delta between PTS and DTS, align them`),a=o)):o=a),n=i[8];let f=n+9;if(s.size<=f)return null;s.size-=f;const d=new Uint8Array(s.size);for(let h=0,p=l.length;h<p;h++){i=l[h];let g=i.byteLength;if(f)if(f>g){f-=g;continue}else i=i.subarray(f),g-=f,f=0;d.set(i,t),t+=g}return r&&(r-=n+3),{data:d,pts:a,dts:o,len:r}}return null}class ak{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Di=Math.pow(2,32)-1;class j{static init(){j.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in j.types)j.types.hasOwnProperty(e)&&(j.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);j.HDLR_TYPES={video:t,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);j.STTS=j.STSC=j.STCO=n,j.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),j.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),j.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);j.FTYP=j.box(j.types.ftyp,a,l,a,o),j.DINF=j.box(j.types.dinf,j.box(j.types.dref,r))}static box(e,...t){let i=8,r=t.length;const n=r;for(;r--;)i+=t[r].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=i&255,a.set(e,4),r=0,i=8;r<n;r++)a.set(t[r],i),i+=t[r].byteLength;return a}static hdlr(e){return j.box(j.types.hdlr,j.HDLR_TYPES[e])}static mdat(e){return j.box(j.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Di+1)),r=Math.floor(t%(Di+1));return j.box(j.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return j.box(j.types.mdia,j.mdhd(e.timescale||0,e.duration||0),j.hdlr(e.type),j.minf(e))}static mfhd(e){return j.box(j.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?j.box(j.types.minf,j.box(j.types.smhd,j.SMHD),j.DINF,j.stbl(e)):j.box(j.types.minf,j.box(j.types.vmhd,j.VMHD),j.DINF,j.stbl(e))}static moof(e,t,i){return j.box(j.types.moof,j.mfhd(e),j.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=j.trak(e[t]);return j.box.apply(null,[j.types.moov,j.mvhd(e[0].timescale||0,e[0].duration||0)].concat(i).concat(j.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=j.trex(e[t]);return j.box.apply(null,[j.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Di+1)),r=Math.floor(t%(Di+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return j.box(j.types.mvhd,n)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let r,n;for(r=0;r<t.length;r++)n=t[r].flags,i[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return j.box(j.types.sdtp,i)}static stbl(e){return j.box(j.types.stbl,j.stsd(e),j.box(j.types.stts,j.STTS),j.box(j.types.stsc,j.STSC),j.box(j.types.stsz,j.STSZ),j.box(j.types.stco,j.STCO))}static avc1(e){let t=[],i=[],r,n,a;for(r=0;r<e.sps.length;r++)n=e.sps[r],a=n.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(n));for(r=0;r<e.pps.length;r++)n=e.pps[r],a=n.byteLength,i.push(a>>>8&255),i.push(a&255),i=i.concat(Array.prototype.slice.call(n));const o=j.box(j.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(i))),l=e.width,c=e.height,u=e.pixelRatio[0],f=e.pixelRatio[1];return j.box(j.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,j.box(j.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),j.box(j.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return j.box(j.types.mp4a,j.audioStsd(e),j.box(j.types.esds,j.esds(e)))}static mp3(e){return j.box(j.types[".mp3"],j.audioStsd(e))}static ac3(e){return j.box(j.types["ac-3"],j.audioStsd(e),j.box(j.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return j.box(j.types.stsd,j.STSD,j.mp4a(e));if(t==="ac3"&&e.config)return j.box(j.types.stsd,j.STSD,j.ac3(e));if(t==="mp3"&&e.codec==="mp3")return j.box(j.types.stsd,j.STSD,j.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return j.box(j.types.stsd,j.STSD,j.avc1(e));if(t==="hevc"&&e.vps)return j.box(j.types.stsd,j.STSD,j.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,i=(e.duration||0)*(e.timescale||0),r=e.width||0,n=e.height||0,a=Math.floor(i/(Di+1)),o=Math.floor(i%(Di+1));return j.box(j.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,n>>8&255,n&255,0,0]))}static traf(e,t){const i=j.sdtp(e),r=e.id,n=Math.floor(t/(Di+1)),a=Math.floor(t%(Di+1));return j.box(j.types.traf,j.box(j.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),j.box(j.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255])),j.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,j.box(j.types.trak,j.tkhd(e),j.mdia(e))}static trex(e){const t=e.id;return j.box(j.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],r=i.length,n=12+16*r,a=new Uint8Array(n);let o,l,c,u,f,d;for(t+=8+n,a.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<r;o++)l=i[o],c=l.duration,u=l.size,f=l.flags,d=l.cts,a.set([c>>>24&255,c>>>16&255,c>>>8&255,c&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return j.box(j.types.trun,a)}static initSegment(e){j.types||j.init();const t=j.moov(e);return bs(j.FTYP,t)}static hvc1(e){const t=e.params,i=[e.vps,e.sps,e.pps],r=4,n=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),r-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),i.length]);let a=n.length;for(let p=0;p<i.length;p+=1){a+=3;for(let g=0;g<i[p].length;g+=1)a+=2+i[p][g].length}const o=new Uint8Array(a);o.set(n,0),a=n.length;const l=i.length-1;for(let p=0;p<i.length;p+=1){o.set(new Uint8Array([32+p|(p===l?128:0),0,i[p].length]),a),a+=3;for(let g=0;g<i[p].length;g+=1)o.set(new Uint8Array([i[p][g].length>>8,i[p][g].length&255]),a),a+=2,o.set(i[p][g],a),a+=i[p][g].length}const c=j.box(j.types.hvcC,o),u=e.width,f=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return j.box(j.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,u&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,j.box(j.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),j.box(j.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,h>>24,h>>16&255,h>>8&255,h&255])))}}j.types=void 0;j.HDLR_TYPES=void 0;j.STTS=void 0;j.STSC=void 0;j.STCO=void 0;j.STSZ=void 0;j.VMHD=void 0;j.SMHD=void 0;j.STSD=void 0;j.FTYP=void 0;j.DINF=void 0;const LS=9e4;function yh(s,e,t=1,i=!1){const r=s*e*t;return i?Math.round(r):r}function ok(s,e,t=1,i=!1){return yh(s,e,1/t,i)}function Mn(s,e=!1){return yh(s,1e3,1/LS,e)}function lk(s,e=1){return yh(s,LS,1/e)}function Yg(s){const{baseTime:e,timescale:t,trackId:i}=s;return`${e/t} (${e}/${t}) trackId: ${i}`}const ck=10*1e3,uk=1024,fk=1152,dk=1536;let Br=null,Tu=null;function jg(s,e,t,i){return{duration:e,size:t,cts:i,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:s?2:1,isNonSync:s?0:1}}}class Mo extends Es{constructor(e,t,i,r){if(super("mp4-remuxer",r),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,Br===null){const a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Br=a?parseInt(a[1]):0}if(Tu===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);Tu=n?parseInt(n[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&Yg(t)} > ${e&&Yg(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const i=e[0].pts,r=e.reduce((n,a)=>{let o=a.pts,l=o-n;return l<-4294967296&&(t=!0,o=rs(o,i),l=o-n),l>0?n:o},i);return t&&this.debug("PTS rollover detected"),r}remux(e,t,i,r,n,a,o,l){let c,u,f,d,h,p,g=n,m=n;const v=e.pid>-1,y=t.pid>-1,E=t.samples.length,w=e.samples.length>0,T=o&&E>0||E>1;if((!v||w)&&(!y||T)||this.ISGenerated||o){if(this.ISGenerated){var k,M,_,C;const B=this.videoTrackConfig;(B&&(t.width!==B.width||t.height!==B.height||((k=t.pixelRatio)==null?void 0:k[0])!==((M=B.pixelRatio)==null?void 0:M[0])||((_=t.pixelRatio)==null?void 0:_[1])!==((C=B.pixelRatio)==null?void 0:C[1]))||!B&&T||this.nextAudioTs===null&&w)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,n,a));const U=this.isVideoContiguous;let L=-1,R;if(T&&(L=hk(t.samples),!U&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,L>0){this.warn(`Dropped ${L} out of ${E} video samples due to a missing keyframe`);const B=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(L),t.dropped+=L,m+=(t.samples[0].pts-B)/t.inputTimeScale,R=m}else L===-1&&(this.warn(`No keyframe found out of ${E} video samples`),p=!1);if(this.ISGenerated){if(w&&T){const B=this.getVideoStartPts(t.samples),A=(rs(e.samples[0].pts,B)-B)/t.inputTimeScale;g+=Math.max(0,A),m+=Math.max(0,-A)}if(w){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),f=this.generateIS(e,t,n,a)),u=this.remuxAudio(e,g,this.isAudioContiguous,a,y||T||l===ce.AUDIO?m:void 0),T){const B=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),f=this.generateIS(e,t,n,a)),c=this.remuxVideo(t,m,U,B)}}else T&&(c=this.remuxVideo(t,m,U,0));c&&(c.firstKeyFrame=L,c.independent=L!==-1,c.firstKeyFramePTS=R)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(h=IS(i,n,this._initPTS,this._initDTS)),r.samples.length&&(d=RS(r,n,this._initPTS))),{audio:u,video:c,initSegment:f,independent:p,text:d,id3:h}}computeInitPts(e,t,i,r){const n=Math.round(i*t);let a=rs(e,n);if(a<n+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(n-a)/t} ${r}`);a<n+t;)a+=8589934592;return a-n}generateIS(e,t,i,r){const n=e.samples,a=t.samples,o=this.typeSupported,l={},c=this._initPTS;let u=!c||r,f="audio/mp4",d,h,p,g=-1;if(u&&(d=h=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):j.initSegment([e]),metadata:{channelCount:e.channelCount}},u&&(g=e.id,p=e.inputTimeScale,!c||p!==c.timescale?d=h=this.computeInitPts(n[0].pts,p,i,"audio"):u=!1)}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:j.initSegment([t]),metadata:{width:t.width,height:t.height}},u)if(g=t.id,p=t.inputTimeScale,!c||p!==c.timescale){const m=this.getVideoStartPts(a),v=rs(a[0].dts,m),y=this.computeInitPts(v,p,i,"video"),E=this.computeInitPts(m,p,i,"video");h=Math.min(h,y),d=Math.min(d,E)}else u=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,u?(c&&this.warn(`Timestamps at playlist time: ${r?"":"~"}${i} ${d/p} != initPTS: ${c.baseTime/c.timescale} (${c.baseTime}/${c.timescale}) trackId: ${c.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${d/p} (${d}/${p}) trackId: ${g}`),this._initPTS={baseTime:d,timescale:p,trackId:g},this._initDTS={baseTime:h,timescale:p,trackId:g}):d=p=void 0,{tracks:l,initPTS:d,timescale:p,trackId:g}}remuxVideo(e,t,i,r){const n=e.inputTimeScale,a=e.samples,o=[],l=a.length,c=this._initPTS,u=c.baseTime*n/c.timescale;let f=this.nextVideoTs,d=8,h=this.videoSampleDuration,p,g,m=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,y=!1;if(!i||f===null){const N=u+t*n,P=a[0].pts-rs(a[0].dts,a[0].pts);Br&&f!==null&&Math.abs(N-P-(f+u))<15e3?i=!0:f=N-P-u}const E=f+u;for(let N=0;N<l;N++){const P=a[N];P.pts=rs(P.pts,E),P.dts=rs(P.dts,E),P.dts<a[N>0?N-1:N].dts&&(y=!0)}y&&a.sort(function(N,P){const Y=N.dts-P.dts,z=N.pts-P.pts;return Y||z}),p=a[0].dts,g=a[a.length-1].dts;const w=g-p,T=w?Math.round(w/(l-1)):h||e.inputTimeScale/30;if(i){const N=p-E,P=N>T,Y=N<-1;if((P||Y)&&(P?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Mn(N,!0)} ms (${N}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Mn(-N,!0)} ms (${N}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Y||E>=a[0].pts||Br)){p=E;const z=a[0].pts-N;if(P)a[0].dts=p,a[0].pts=z;else{let J=!0;for(let x=0;x<a.length&&!(a[x].dts>z&&J);x++){const F=a[x].pts;if(a[x].dts-=N,a[x].pts-=N,x<a.length-1){const G=a[x+1].pts,Q=a[x].pts,ee=G<=Q,ae=G<=F;J=ee==ae}}}this.log(`Video: Initial PTS/DTS adjusted: ${Mn(z,!0)}/${Mn(p,!0)}, delta: ${Mn(N,!0)} ms`)}}p=Math.max(0,p);let $=0,k=0,M=p;for(let N=0;N<l;N++){const P=a[N],Y=P.units,z=Y.length;let J=0;for(let x=0;x<z;x++)J+=Y[x].data.length;k+=J,$+=z,P.length=J,P.dts<M?(P.dts=M,M+=T/4|0||1):M=P.dts,m=Math.min(P.pts,m),v=Math.max(P.pts,v)}g=a[l-1].dts;const _=k+4*$+8;let C;try{C=new Uint8Array(_)}catch(N){this.observer.emit(b.ERROR,b.ERROR,{type:fe.MUX_ERROR,details:V.REMUX_ALLOC_ERROR,fatal:!1,error:N,bytes:_,reason:`fail allocating video mdat ${_}`});return}const U=new DataView(C.buffer);U.setUint32(0,_),C.set(j.types.mdat,4);let L=!1,R=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(let N=0;N<l;N++){const P=a[N],Y=P.units;let z=0;for(let F=0,G=Y.length;F<G;F++){const Q=Y[F],ee=Q.data,ae=Q.data.byteLength;U.setUint32(d,ae),d+=4,C.set(ee,d),d+=ae,z+=4+ae}let J;if(N<l-1)h=a[N+1].dts-P.dts,J=a[N+1].pts-P.pts;else{const F=this.config,G=N>0?P.dts-a[N-1].dts:T;if(J=N>0?P.pts-a[N-1].pts:T,F.stretchShortVideoTrack&&this.nextAudioTs!==null){const Q=Math.floor(F.maxBufferHole*n),ee=(r?m+r*n:this.nextAudioTs+u)-P.pts;ee>Q?(h=ee-G,h<0?h=G:L=!0,this.log(`It is approximately ${ee/90} ms to the next segment; using duration ${h/90} ms for the last video frame.`)):h=G}else h=G}const x=Math.round(P.pts-P.dts);R=Math.min(R,h),S=Math.max(S,h),B=Math.min(B,J),A=Math.max(A,J),o.push(jg(P.key,h,z,x))}if(o.length){if(Br){if(Br<70){const N=o[0].flags;N.dependsOn=2,N.isNonSync=0}}else if(Tu&&A-B<S-R&&T/S<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let N=p;for(let P=0,Y=o.length;P<Y;P++){const z=N+o[P].duration,J=N+o[P].cts;if(P<Y-1){const x=z+o[P+1].cts;o[P].duration=x-J}else o[P].duration=P?o[P-1].duration:T;o[P].cts=0,N=z}}}h=L||!h?T:h;const I=g+h;this.nextVideoTs=f=I-u,this.videoSampleDuration=h,this.isVideoContiguous=!0;const H={data1:j.moof(e.sequenceNumber++,p,ze(e,{samples:o})),data2:C,startPTS:(m-u)/n,endPTS:(v+h-u)/n,startDTS:(p-u)/n,endDTS:f/n,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,H}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return fk;case"ac3":return dk;default:return uk}}remuxAudio(e,t,i,r,n){const a=e.inputTimeScale,o=e.samplerate?e.samplerate:a,l=a/o,c=this.getSamplesPerFrame(e),u=c*l,f=this._initPTS,d=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,h=[],p=n!==void 0;let g=e.samples,m=d?0:8,v=this.nextAudioTs||-1;const y=f.baseTime*a/f.timescale,E=y+t*a;if(this.isAudioContiguous=i=i||g.length&&v>0&&(r&&Math.abs(E-(v+y))<9e3||Math.abs(rs(g[0].pts,E)-(v+y))<20*u),g.forEach(function(A){A.pts=rs(A.pts,E)}),!i||v<0){const A=g.length;if(g=g.filter(I=>I.pts>=0),A!==g.length&&this.warn(`Removed ${g.length-A} of ${A} samples (initPTS ${y} / ${a})`),!g.length)return;n===0?v=0:r&&!p?v=Math.max(0,E-y):v=g[0].pts-y}if(e.segmentCodec==="aac"){const A=this.config.maxAudioFramesDrift;for(let I=0,D=v+y;I<g.length;I++){const O=g[I],H=O.pts,N=H-D,P=Math.abs(1e3*N/a);if(N<=-A*u&&p)I===0&&(this.warn(`Audio frame @ ${(H/a).toFixed(3)}s overlaps marker by ${Math.round(1e3*N/a)} ms.`),this.nextAudioTs=v=H-y,D=H);else if(N>=A*u&&P<ck&&p){let Y=Math.round(N/u);for(D=H-Y*u;D<0&&Y&&u;)Y--,D+=u;I===0&&(this.nextAudioTs=v=D-y),this.warn(`Injecting ${Y} audio frames @ ${((D-y)/a).toFixed(3)}s due to ${Math.round(1e3*N/a)} ms gap.`);for(let z=0;z<Y;z++){let J=ak.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);J||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),J=O.unit.subarray()),g.splice(I,0,{unit:J,pts:D}),D+=u,I++}}O.pts=D,D+=u}}let w=null,T=null,$,k=0,M=g.length;for(;M--;)k+=g[M].unit.byteLength;for(let A=0,I=g.length;A<I;A++){const D=g[A],O=D.unit;let H=D.pts;if(T!==null){const P=h[A-1];P.duration=Math.round((H-T)/l)}else if(i&&e.segmentCodec==="aac"&&(H=v+y),w=H,k>0){k+=m;try{$=new Uint8Array(k)}catch(P){this.observer.emit(b.ERROR,b.ERROR,{type:fe.MUX_ERROR,details:V.REMUX_ALLOC_ERROR,fatal:!1,error:P,bytes:k,reason:`fail allocating audio mdat ${k}`});return}d||(new DataView($.buffer).setUint32(0,k),$.set(j.types.mdat,4))}else return;$.set(O,m);const N=O.byteLength;m+=N,h.push(jg(!0,c,N,0)),T=H}const _=h.length;if(!_)return;const C=h[h.length-1];v=T-y,this.nextAudioTs=v+l*C.duration;const U=d?new Uint8Array(0):j.moof(e.sequenceNumber++,w/l,ze({},e,{samples:h}));e.samples=[];const L=(w-y)/a,R=this.nextAudioTs/a,S={data1:U,data2:$,startPTS:L,endPTS:R,startDTS:L,endDTS:R,type:"audio",hasAudio:!0,hasVideo:!1,nb:_};return this.isAudioContiguous=!0,S}}function rs(s,e){let t;if(e===null)return s;for(e<s?t=-8589934592:t=8589934592;Math.abs(s-e)>4294967296;)s+=t;return s}function hk(s){for(let e=0;e<s.length;e++)if(s[e].key)return e;return-1}function IS(s,e,t,i){const r=s.samples.length;if(!r)return;const n=s.inputTimeScale;for(let o=0;o<r;o++){const l=s.samples[o];l.pts=rs(l.pts-t.baseTime*n/t.timescale,e*n)/n,l.dts=rs(l.dts-i.baseTime*n/i.timescale,e*n)/n}const a=s.samples;return s.samples=[],{samples:a}}function RS(s,e,t){const i=s.samples.length;if(!i)return;const r=s.inputTimeScale;for(let a=0;a<i;a++){const o=s.samples[a];o.pts=rs(o.pts-t.baseTime*r/t.timescale,e*r)/r}s.samples.sort((a,o)=>a.pts-o.pts);const n=s.samples;return s.samples=[],{samples:n}}class pk extends Es{constructor(e,t,i,r){super("passthrough-remuxer",r),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(e,r),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:i,videoCodec:r}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:n,video:a}=this.initData=Nb(e);if(t)tD(e,t);else{const l=n||a;l!=null&&l.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${l.codec}")!`)}n&&(i=Vg(n,qe.AUDIO,this)),a&&(r=Vg(a,qe.VIDEO,this));const o={};n&&a?o.audiovideo={container:"video/mp4",codec:i+","+r,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:n?o.audio={container:"audio/mp4",codec:i,encrypted:n.encrypted,initSegment:e,id:"audio"}:a?o.video={container:"video/mp4",codec:r,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,i,r,n,a){var o,l;let{initPTS:c,lastEndTime:u}=this;const f={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};re(u)||(u=this.lastEndTime=n||0);const d=t.samples;if(!d.length)return f;const h={initPTS:void 0,timescale:void 0,trackId:void 0};let p=this.initData;if((o=p)!=null&&o.length||(this.generateInitSegment(d),p=this.initData),!((l=p)!=null&&l.length))return this.warn("Failed to generate initSegment."),f;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const g=iD(d,p,this),m=p.audio?g[p.audio.id]:null,v=p.video?g[p.video.id]:null,y=no(v,1/0),E=no(m,1/0),w=no(v,0,!0),T=no(m,0,!0);let $=n,k=0;const M=m&&(!v||!c&&E<y||c&&c.trackId===p.audio.id),_=M?m:v;if(_){const D=_.timescale,O=_.start-n*D,H=M?p.audio.id:p.video.id;$=_.start/D,k=M?T-E:w-y,(a||!c)&&(mk(c,$,n,k)||D!==c.timescale)&&(c&&this.warn(`Timestamps at playlist time: ${a?"":"~"}${n} ${O/D} != initPTS: ${c.baseTime/c.timescale} (${c.baseTime}/${c.timescale}) trackId: ${c.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${$-n} (${O}/${D}) trackId: ${H}`),c=null,h.initPTS=O,h.timescale=D,h.trackId=H)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${n}`);c?(h.initPTS=c.baseTime,h.timescale=c.timescale,h.trackId=c.trackId):((!h.timescale||h.trackId===void 0||h.initPTS===void 0)&&(this.warn("Could not set initPTS"),h.initPTS=$,h.timescale=1,h.trackId=-1),this.initPTS=c={baseTime:h.initPTS,timescale:h.timescale,trackId:h.trackId});const C=$-c.baseTime/c.timescale,U=C+k;k>0?this.lastEndTime=U:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const L=!!p.audio,R=!!p.video;let B="";L&&(B+="audio"),R&&(B+="video");const S=(p.audio?p.audio.encrypted:!1)||(p.video?p.video.encrypted:!1),A={data1:d,startPTS:C,startDTS:C,endPTS:U,endDTS:U,type:B,hasAudio:L,hasVideo:R,nb:1,dropped:0,encrypted:S};f.audio=L&&!R?A:void 0,f.video=R?A:void 0;const I=v==null?void 0:v.sampleCount;if(I){const D=v.keyFrameIndex,O=D!==-1;A.nb=I,A.dropped=D===0||this.isVideoContiguous?0:O?D:I,A.independent=O,A.firstKeyFrame=D,O&&v.keyFrameStart&&(A.firstKeyFramePTS=(v.keyFrameStart-c.baseTime)/c.timescale),this.isVideoContiguous||(f.independent=O),this.isVideoContiguous||(this.isVideoContiguous=O),A.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${D}/${I} dropped: ${A.dropped} start: ${A.firstKeyFramePTS||"NA"}`)}return f.initSegment=h,f.id3=IS(i,n,c,c),r.samples.length&&(f.text=RS(r,n,c)),f}}function no(s,e,t=!1){return(s==null?void 0:s.start)!==void 0?(s.start+(t?s.duration:0))/s.timescale:e}function mk(s,e,t,i){if(s===null)return!0;const r=Math.max(i,1),n=e-s.baseTime/s.timescale;return Math.abs(n-t)>r}function Vg(s,e,t){const i=s.codec;return i&&i.length>4?i:e===qe.AUDIO?i==="ec-3"||i==="ac-3"||i==="alac"?i:i==="fLaC"||i==="Opus"?yl(i,!1):(t.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"):(t.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1")}let fi;try{fi=self.performance.now.bind(self.performance)}catch{fi=Date.now}const No=[{demux:ek,remux:pk},{demux:Oi,remux:Mo},{demux:q2,remux:Mo},{demux:J2,remux:Mo}];No.splice(2,0,{demux:X2,remux:Mo});class Kg{constructor(e,t,i,r,n,a){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=i,this.id=n,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,r){const n=i.transmuxing;n.executeStart=fi();let a=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;r&&(this.currentTransmuxState=r);const{contiguous:c,discontinuity:u,trackSwitch:f,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=r||o,{audioCodec:g,videoCodec:m,defaultInitPts:v,duration:y,initSegmentData:E}=l,w=gk(a,t);if(w&&Zr(w.method)){const M=this.getDecrypter(),_=ch(w.method);if(M.isSync()){let C=M.softwareDecrypt(a,w.key.buffer,w.iv.buffer,_);if(i.part>-1){const L=M.flush();C=L&&L.buffer}if(!C)return n.executeEnd=fi(),wu(i);a=new Uint8Array(C)}else return this.asyncResult=!0,this.decryptionPromise=M.webCryptoDecrypt(a,w.key.buffer,w.iv.buffer,_).then(C=>{const U=this.push(C,null,i);return this.decryptionPromise=null,U}),this.decryptionPromise}const T=this.needsProbing(u,f);if(T){const M=this.configureTransmuxer(a);if(M)return this.logger.warn(`[transmuxer] ${M.message}`),this.observer.emit(b.ERROR,b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,error:M,reason:M.message}),n.executeEnd=fi(),wu(i)}(u||f||p||T)&&this.resetInitSegment(E,g,m,y,t),(u||p||T)&&this.resetInitialTimestamp(v),c||this.resetContiguity();const $=this.transmux(a,w,h,d,i);this.asyncResult=ha($);const k=this.currentTransmuxState;return k.contiguous=!0,k.discontinuity=!1,k.trackSwitch=!1,n.executeEnd=fi(),$}flush(e){const t=e.transmuxing;t.executeStart=fi();const{decrypter:i,currentTransmuxState:r,decryptionPromise:n}=this;if(n)return this.asyncResult=!0,n.then(()=>this.flush(e));const a=[],{timeOffset:o}=r;if(i){const f=i.flush();f&&a.push(this.push(f.buffer,null,e))}const{demuxer:l,remuxer:c}=this;if(!l||!c){t.executeEnd=fi();const f=[wu(e)];return this.asyncResult?Promise.resolve(f):f}const u=l.flush(o);return ha(u)?(this.asyncResult=!0,u.then(f=>(this.flushRemux(a,f,e),a))):(this.flushRemux(a,u,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,i){const{audioTrack:r,videoTrack:n,id3Track:a,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part>-1?" part: "+i.part:""} of ${this.id===ce.MAIN?"level":"track"} ${i.level}`);const u=this.remuxer.remux(r,n,a,o,c,l,!0,this.id);e.push({remuxResult:u,chunkMeta:i}),i.transmuxing.executeEnd=fi()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,r,n){const{demuxer:a,remuxer:o}=this;!a||!o||(a.resetInitSegment(e,t,i,r),o.resetInitSegment(e,t,i,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,r,n){let a;return t&&t.method==="SAMPLE-AES"?a=this.transmuxSampleAes(e,t,i,r,n):a=this.transmuxUnencrypted(e,i,r,n),a}transmuxUnencrypted(e,t,i,r){const{audioTrack:n,videoTrack:a,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,a,o,l,t,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,i,r,n){return this.demuxer.demuxSampleAes(e,t,i).then(a=>({remuxResult:this.remuxer.remux(a.audioTrack,a.videoTrack,a.id3Track,a.textTrack,i,r,!1,this.id),chunkMeta:n}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:r}=this;let n;for(let f=0,d=No.length;f<d;f++){var a;if((a=No[f].demux)!=null&&a.probe(e,this.logger)){n=No[f];break}}if(!n)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,l=this.remuxer,c=n.remux,u=n.demux;(!l||!(l instanceof c))&&(this.remuxer=new c(i,t,r,this.logger)),(!o||!(o instanceof u))&&(this.demuxer=new u(i,t,r,this.logger),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new oh(this.config)),e}}function gk(s,e){let t=null;return s.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const wu=s=>({remuxResult:{},chunkMeta:s});function ha(s){return"then"in s&&s.then instanceof Function}class vk{constructor(e,t,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n||null}}class yk{constructor(e,t,i,r,n,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n,this.initSegmentChange=a}}let Wg=0;class DS{constructor(e,t,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Wg++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=l=>{const c=l.data,u=this.hls;if(!(!u||!(c!=null&&c.event)||c.instanceNo!==this.instanceNo))switch(c.event){case"init":{var f;const d=(f=this.workerContext)==null?void 0:f.objectURL;d&&self.URL.revokeObjectURL(d);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}case"workerLog":{u.logger[c.data.logType]&&u.logger[c.data.logType](c.data.message);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.part=this.part,c.data.id=this.id,u.trigger(c.event,c.data);break}}},this.onWorkerError=l=>{if(!this.hls)return;const c=new Error(`${l.message} (${l.filename}:${l.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:c})};const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const a=(l,c)=>{c=c||{},c.frag=this.frag||void 0,l===b.ERROR&&(c=c,c.parent=this.id,c.part=this.part,this.error=c.error),this.hls.trigger(l,c)};this.observer=new dh,this.observer.on(b.FRAG_DECRYPTED,a),this.observer.on(b.ERROR,a);const o=lg(n.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const l=this.hls.logger;if(n.workerPath||_2()){try{n.workerPath?(l.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=A2(n.workerPath)):(l.log(`injecting Web Worker for "${t}"`),this.workerContext=x2());const{worker:u}=this.workerContext;u.addEventListener("message",this.onWorkerMessage),u.addEventListener("error",this.onWorkerError),u.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:Xe(n)})}catch(u){l.warn(`Error setting up "${t}" Web Worker, fallback to inline`,u),this.terminateWorker(),this.error=null,this.transmuxer=new Kg(this.observer,o,n,"",t,e.logger)}return}}this.transmuxer=new Kg(this.observer,o,n,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Wg++;const t=this.hls.config,i=lg(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:i,id:this.id,config:Xe(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),T2(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,i,r,n,a,o,l,c,u){var f,d;c.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:p}=this,g=a?a.start:n.start,m=n.decryptdata,v=this.frag,y=!(v&&n.cc===v.cc),E=!(v&&c.level===v.level),w=v?c.sn-v.sn:-1,T=this.part?c.part-this.part.index:-1,$=w===0&&c.id>1&&c.id===(v==null?void 0:v.stats.chunkCount),k=!E&&(w===1||w===0&&(T===1||$&&T<=0)),M=self.performance.now();(E||w||n.stats.parsing.start===0)&&(n.stats.parsing.start=M),a&&(T||!k)&&(a.stats.parsing.start=M);const _=!(v&&((f=n.initSegment)==null?void 0:f.url)===((d=v.initSegment)==null?void 0:d.url)),C=new yk(y,k,l,E,g,_);if(!k||y||_){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${n.type} sn: ${c.sn}${c.part>-1?" part: "+c.part:""} ${this.id===ce.MAIN?"level":"track"}: ${c.level} id: ${c.id}
|
|
372
|
+
discontinuity: ${y}
|
|
373
|
+
trackSwitch: ${E}
|
|
374
|
+
contiguous: ${k}
|
|
375
|
+
accurateTimeOffset: ${l}
|
|
376
|
+
timeOffset: ${g}
|
|
377
|
+
initSegmentChange: ${_}`);const U=new vk(i,r,t,o,u);this.configureTransmuxer(U)}if(this.frag=n,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:C},e instanceof ArrayBuffer?[e]:[]);else if(p){const U=p.push(e,m,c,C);ha(U)?U.then(L=>{this.handleTransmuxComplete(L)}).catch(L=>{this.transmuxerError(L,c,"transmuxer-interface push error")}):this.handleTransmuxComplete(U)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(i){const r=i.flush(e);ha(r)?r.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")}):this.handleFlushResult(r,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):i&&i.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const zg=100;class bk extends fh{constructor(e,t,i){super(e,t,i,"audio-stream-controller",ce.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(b.LEVEL_LOADED,this.onLevelLoaded,this),e.on(b.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(b.BUFFER_RESET,this.onBufferReset,this),e.on(b.BUFFER_CREATED,this.onBufferCreated,this),e.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(b.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(b.FRAG_LOADING,this.onFragLoading,this),e.on(b.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(b.LEVEL_LOADED,this.onLevelLoaded,this),e.off(b.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(b.BUFFER_RESET,this.onBufferReset,this),e.off(b.BUFFER_CREATED,this.onBufferCreated,this),e.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(b.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(b.FRAG_LOADING,this.onFragLoading,this),e.off(b.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n,trackId:a}){if(i===ce.MAIN){const o=t.cc,l=this.fragCurrent;if(this.initPTS[o]={baseTime:r,timescale:n,trackId:a},this.log(`InitPTS for cc: ${o} found from main: ${r/n} (${r}/${n}) trackId: ${a}`),this.mainAnchor=t,this.state===q.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==o)&&this.syncWithAnchor(t,c==null?void 0:c.frag)}else!this.hls.hasEnoughToStart&&l&&l.cc!==o?(l.abortRequests(),this.syncWithAnchor(t,l)):this.state===q.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var i;const r=((i=this.mainFragLoading)==null?void 0:i.frag)||null;if(t&&(r==null?void 0:r.cc)===t.cc)return;const n=(r||e).cc,a=this.getLevelDetails(),o=this.getLoadPosition(),l=Wb(a,n,o);l&&(this.log(`Syncing with main frag at ${l.start} cc ${l.cc}`),this.startFragRequested=!1,this.nextLoadPosition=l.start,this.resetLoadingState(),this.state===q.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=q.STOPPED;return}const i=this.lastCurrentTime;this.stopLoad(),this.setInterval(zg),i>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i,this.state=q.IDLE):this.state=q.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case q.IDLE:this.doTickIdle();break;case q.WAITING_TRACK:{const{levels:e,trackId:t}=this,i=e==null?void 0:e[t],r=i==null?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=q.WAITING_INIT_PTS}break}case q.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case q.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:i,cache:r,complete:n}=e,a=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=q.FRAG_LOADING;const o=r.flush().buffer,l={frag:t,part:i,payload:o,networkDetails:null};this._handleFragmentLoadProgress(l),n&&super._handleFragmentLoadComplete(l)}else a&&a.cc!==e.frag.cc&&this.syncWithAnchor(a,e.frag)}else this.state=q.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:i,media:r,trackId:n}=this,a=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||!(i!=null&&i[n]))return;const o=i[n],l=o.details;if(!l||this.waitForLive(o)||this.waitForCdnTuneIn(l)){this.state=q.WAITING_TRACK,this.startFragRequested=!1;return}const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,qe.AUDIO,ce.AUDIO));const u=this.getFwdBufferInfo(c,ce.AUDIO);if(u===null)return;if(!this.switchingTrack&&this._streamEnded(u,l)){t.trigger(b.BUFFER_EOS,{type:"audio"}),this.state=q.ENDED;return}const f=u.len,d=t.maxBufferLength,h=l.fragments,p=h[0].start,g=this.getLoadPosition(),m=this.flushing?g:u.end;if(this.switchingTrack&&r){const E=g;l.PTSKnown&&E<p&&(u.end>p||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=p+.05)}if(f>=d&&!this.switchingTrack&&m<h[h.length-1].start)return;let v=this.getNextFragment(m,l);if(v&&this.isLoopLoading(v,m)&&(v=this.getNextFragmentLoopLoading(v,l,u,ce.MAIN,d)),!v){this.bufferFlushed=!0;return}let y=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&y&&ht(v)&&!v.endList&&(!l.live||!this.loadingParts&&m<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(y)===vt.OK&&(this.mainFragLoading=y=null),y&&ht(y))){if(v.start>y.end){const w=this.fragmentTracker.getFragAtPos(m,ce.MAIN);w&&w.end>y.end&&(y=w,this.mainFragLoading={frag:w,targetBufferTime:null})}if(v.start>y.end)return}this.loadFragment(v,o,m)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(i=>new ua(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==q.STOPPED&&(this.setInterval(zg),this.state=q.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const i=this.cachedTrackLoadedData;i&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(b.AUDIO_TRACK_LOADED,i))}onAudioTrackLoaded(e,t){var i;const{levels:r}=this,{details:n,id:a,groupId:o,track:l}=t;if(!r){this.warn(`Audio tracks reset while loading track ${a} "${l.name}" of "${o}"`);return}const c=this.mainDetails;if(!c||n.endCC>c.endCC||c.expired){this.cachedTrackLoadedData=t,this.state!==q.STOPPED&&(this.state=q.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${l.name}" of "${o}" loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const u=r[a];let f=0;if(n.live||(i=u.details)!=null&&i.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;if(u.details){var d;f=this.alignPlaylists(n,u.details,(d=this.levelLastLoaded)==null?void 0:d.details)}n.alignedSliding||(fS(n,c),n.alignedSliding||Tl(n,c),f=n.fragmentStart)}u.details=n,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(c,f),this.hls.trigger(b.AUDIO_TRACK_UPDATED,{details:n,id:a,groupId:t.groupId}),this.state===q.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=q.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:r,payload:n}=e,{config:a,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const u=c.details;if(!u){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(i.start);return}const f=a.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new DS(this.hls,ce.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[i.cc],p=(t=i.initSegment)==null?void 0:t.data;if(h!==void 0){const m=r?r.index:-1,v=m!==-1,y=new lh(i.level,i.sn,i.stats.chunkCount,n.byteLength,m,v);d.push(n,p,f,"",i,r,u.totalduration,!1,y,h)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${u.startSN} ,${u.endSN}],track ${o}`);const{cache:g}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new dS,complete:!1};g.push(new Uint8Array(n)),this.state!==q.STOPPED&&(this.state=q.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===ce.MAIN&&ht(t.frag)&&(this.mainFragLoading=t,this.state===q.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i.type!==ce.AUDIO){!this.audioOnly&&i.type===ce.MAIN&&!i.elementaryStreams.video&&!i.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ht(i)){this.fragPrevious=i;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(b.AUDIO_TRACK_SWITCHED,Ke({},n)))}this.fragBufferedComplete(i,r),this.media&&this.tick()}onError(e,t){var i;if(t.fatal){this.state=q.ERROR;return}switch(t.details){case V.FRAG_GAP:case V.FRAG_PARSING_ERROR:case V.FRAG_DECRYPT_ERROR:case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.AUDIO,t);break;case V.AUDIO_TRACK_LOAD_ERROR:case V.AUDIO_TRACK_LOAD_TIMEOUT:case V.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===q.WAITING_TRACK&&((i=t.context)==null?void 0:i.type)===De.AUDIO_TRACK&&(this.state=q.IDLE);break;case V.BUFFER_ADD_CODEC_ERROR:case V.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case V.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case V.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==qe.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==qe.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===q.ENDED&&(this.state=q.IDLE);const i=this.mediaBuffer||this.media;i&&(this.afterBufferFlushed(i,t,ce.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const i="audio",{hls:r}=this,{remuxResult:n,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o){this.resetWhenMissingContext(a);return}const{frag:l,part:c,level:u}=o,{details:f}=u,{audio:d,text:h,id3:p,initSegment:g}=n;if(this.fragContextChanged(l)||!f){this.fragmentTracker.removeFragment(l);return}if(this.state=q.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),g!=null&&g.tracks){const m=l.initSegment||l;if(this.unhandledEncryptionError(g,l))return;this._bufferInitSegment(u,g.tracks,m,a),r.trigger(b.FRAG_PARSING_INIT_SEGMENT,{frag:m,id:i,tracks:g.tracks})}if(d){const{startPTS:m,endPTS:v,startDTS:y,endDTS:E}=d;c&&(c.elementaryStreams[qe.AUDIO]={startPTS:m,endPTS:v,startDTS:y,endDTS:E}),l.setElementaryStreamInfo(qe.AUDIO,m,v,y,E),this.bufferFragmentData(d,l,c,a)}if(p!=null&&(t=p.samples)!=null&&t.length){const m=ze({id:i,frag:l,details:f},p);r.trigger(b.FRAG_PARSING_METADATA,m)}if(h){const m=ze({id:i,frag:l,details:f},h);r.trigger(b.FRAG_PARSING_USERDATA,m)}}_bufferInitSegment(e,t,i,r){if(this.state!==q.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const n=t.audio;n.id=ce.AUDIO;const a=e.audioCodec;this.log(`Init audio buffer, container:${n.container}, codecs[level/parsed]=[${a}/${n.codec}]`),a&&a.split(",").length===1&&(n.levelCodec=a),this.hls.trigger(b.BUFFER_CODECS,t);const o=n.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:i,part:null,chunkMeta:r,parent:i.type,data:o};this.hls.trigger(b.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===vt.NOT_LOADED||r===vt.PARTIAL){var n;if(!ht(e))this._loadInitSegment(e,t);else if((n=t.details)!=null&&n.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=q.WAITING_INIT_PTS;const a=this.mainDetails;a&&a.fragmentStart!==t.details.fragmentStart&&Tl(t.details,a)}else super.loadFragment(e,t,i)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:i,assocLang:r,characteristics:n,audioCodec:a,channels:o}=this.bufferedTrack;mr({name:t,lang:i,assocLang:r,characteristics:n,audioCodec:a,channels:o},e,lr)||(Sl(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(b.AUDIO_TRACK_SWITCHED,Ke({},e))}}class bh extends Es{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,i){const r=t==null?void 0:t.renditionReports;if(r){let n=-1;for(let a=0;a<r.length;a++){const o=r[a];let l;try{l=new self.URL(o.URI,t.url).href}catch(c){this.warn(`Could not construct new URL for Rendition Report: ${c}`),l=o.URI||""}if(l===e){n=a;break}else l===e.substring(0,l.length)&&(n=a)}if(n!==-1){const a=r[n],o=parseInt(a["LAST-MSN"])||t.lastPartSn;let l=parseInt(a["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const u=Math.min(t.age-t.partTarget,t.targetduration);l>=0&&u>t.partTarget&&(l+=1)}const c=i&&cg(i);return new ug(o,l>=0?l:void 0,c)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(i){this.warn(`Could not construct new URL with HLS Delivery Directives: ${i}`)}return e}playlistLoaded(e,t,i){const{details:r,stats:n}=t,a=self.performance.now(),o=n.loading.first?Math.max(0,a-n.loading.first):0;r.advancedDateTime=Date.now()-o;const l=this.hls.config.timelineOffset;if(l!==r.appliedTimelineOffset){const u=Math.max(l||0,0);r.appliedTimelineOffset=u,r.fragments.forEach(f=>{f.setStart(f.playlistOffset+u)})}if(r.live||i!=null&&i.live){const u="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(i),i&&r.fragments.length>0){f2(i,r,this);const y=r.playlistParsingError;if(y){this.warn(y);const E=this.hls;if(!E.config.ignorePlaylistParsingErrors){var c;const{networkDetails:w}=t;E.trigger(b.ERROR,{type:fe.NETWORK_ERROR,details:V.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:y,reason:y.message,level:t.level||void 0,parent:(c=r.fragments[0])==null?void 0:c.type,networkDetails:w,stats:n});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=n.loading.start);const f=this.hls.mainForwardBufferInfo,d=f?f.end-f.len:0,h=(r.edge-d)*1e3,p=aS(r,h);if(r.requestScheduled+p<a?r.requestScheduled=a:r.requestScheduled+=p,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let g,m,v;if(r.canBlockReload&&r.endSN&&r.advanced){const y=this.hls.config.lowLatencyMode,E=r.lastPartSn,w=r.endSN,T=r.lastPartIndex,$=T!==-1,k=E===w;$?k?(m=w+1,v=y?0:T):(m=E,v=y?T+1:r.maxPartIndex):m=w+1;const M=r.age,_=M+r.ageHeader;let C=Math.min(_-r.partTarget,r.targetduration*1.5);if(C>0){if(_>r.targetduration*3)this.log(`Playlist last advanced ${M.toFixed(2)}s ago. Omitting segment and part directives.`),m=void 0,v=void 0;else if(i!=null&&i.tuneInGoal&&_-r.partTarget>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${C} with playlist age: ${r.age}`),C=0;else{const U=Math.floor(C/r.targetduration);if(m+=U,v!==void 0){const L=Math.round(C%r.targetduration/r.partTarget);v+=L}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${M.toFixed(2)}s goal: ${C} skip sn ${U} to part ${v}`)}r.tuneInGoal=C}if(g=this.getDeliveryDirectives(r,t.deliveryDirectives,m,v),y||!k){r.requestScheduled=a,this.loadingPlaylist(u,g);return}}else(r.canBlockReload||r.canSkipUntil)&&(g=this.getDeliveryDirectives(r,t.deliveryDirectives,m,v));g&&m!==void 0&&r.canBlockReload&&(r.requestScheduled=n.loading.first+Math.max(p-o*2,p/2)),this.scheduleLoading(u,g,r)}else this.clearTimer()}scheduleLoading(e,t,i){const r=i||e.details;if(!r){this.loadingPlaylist(e,t);return}const n=self.performance.now(),a=r.requestScheduled;if(n>=a){this.loadingPlaylist(e,t);return}const o=a-n;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,i,r){let n=cg(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,n=Po.No),new ug(i,r,n)}checkRetry(e){const t=e.details,i=El(e),r=e.errorAction,{action:n,retryCount:a=0,retryConfig:o}=r||{},l=!!r&&!!o&&(n===At.RetryRequest||!r.resolved&&n===At.SendAlternateToPenaltyBox);if(l){var c;if(a>=o.maxNumRetry)return!1;if(i&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const u=ah(o,a);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),u),this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" in ${u}ms`)}e.levelRetry=!0,r.resolved=!0}return l}}function kS(s,e){if(s.length!==e.length)return!1;for(let t=0;t<s.length;t++)if(!pa(s[t].attrs,e[t].attrs))return!1;return!0}function pa(s,e,t){const i=s["STABLE-RENDITION-ID"];return i&&!t?i===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(r=>s[r]!==e[r])}function Hf(s,e){return e.label.toLowerCase()===s.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(s.lang||"").toLowerCase())}class Sk extends bh{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.LEVEL_LOADING,this.onLevelLoading,this),e.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(b.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(b.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:r,details:n}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==r){this.warn(`Audio track with id:${i} and group:${r} not found in active group ${a==null?void 0:a.groupId}`);return}const o=a.details;a.details=t.details,this.log(`Audio track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const i=t.audioGroups||null,r=this.groupIds;let n=this.currentTrack;if(!i||(r==null?void 0:r.length)!==(i==null?void 0:i.length)||i!=null&&i.some(o=>(r==null?void 0:r.indexOf(o))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(d=>!i||i.indexOf(d.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(d=>d.default)&&(this.selectDefaultTrack=!1),o.forEach((d,h)=>{d.id=h});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!n&&l){const d=zs(l,o,lr);if(d>-1)n=o[d];else{const h=zs(l,this.tracks);n=this.tracks[h]}}let c=this.findTrackId(n);c===-1&&n&&(c=this.findTrackId(null));const u={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${i==null?void 0:i.join(",")}`),this.hls.trigger(b.AUDIO_TRACKS_UPDATED,u);const f=this.trackId;if(c!==-1&&f===-1)this.setAudioTrack(c);else if(o.length&&f===-1){var a;const d=new Error(`No audio track selected for current audio group-ID(s): ${(a=this.groupIds)==null?void 0:a.join(",")} track count: ${o.length}`);this.warn(d.message),this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}}onError(e,t){t.fatal||!t.context||t.context.type===De.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const r=this.currentTrack;if(r&&mr(e,r,lr))return r;const n=zs(e,this.tracksInGroup,lr);if(n>-1){const a=this.tracksInGroup[n];return this.setAudioTrack(n),a}else if(r){let a=t.loadLevel;a===-1&&(a=t.firstAutoLevel);const o=kD(e,t.levels,i,a,lr);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const a=zs(e,i);if(a>-1)return i[a]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const i=this.currentTrack,r=t[e],n=r.details&&!r.details.live;if(e===this.trackId&&r===i&&n||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(b.AUDIO_TRACK_SWITCHING,Ke({},r)),n))return;const a=this.switchParams(r.url,i==null?void 0:i.details,r.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if(!(this.selectDefaultTrack&&!r.default)&&(!e||mr(e,r,lr)))return i}if(e){const{name:i,lang:r,assocLang:n,characteristics:a,audioCodec:o,channels:l}=e;for(let c=0;c<t.length;c++){const u=t[c];if(mr({name:i,lang:r,assocLang:n,characteristics:a,audioCodec:o,channels:l},u,lr))return c}for(let c=0;c<t.length;c++){const u=t[c];if(pa(e.attrs,u.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return c}for(let c=0;c<t.length;c++){const u=t[c];if(pa(e.attrs,u.attrs,["LANGUAGE"]))return c}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Sl(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=e.id,r=e.groupId,n=this.getUrlWithDirectives(e.url,t),a=e.details,o=a==null?void 0:a.age;this.log(`Loading audio-track ${i} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&a.live?" age "+o.toFixed(1)+(a.type&&" "+a.type||""):""} ${n}`),this.hls.trigger(b.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:t||null,track:e})}}class Ek{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,i){if(this.queues===null||this.tracks===null)return;const r=this.queues[t];r.push(e),r.length===1&&!i&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const i={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(i,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const i={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(i)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const i=(t=e[0])==null?void 0:t.label;(i==="async-blocker"||i==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(n){var i;if(r.onError(n),this.queues===null||this.tracks===null)return;const a=(i=this.tracks[e])==null?void 0:i.buffer;a!=null&&a.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
378
|
+
${this.list("video")}
|
|
379
|
+
${this.list("audio")}
|
|
380
|
+
${this.list("audiovideo")}}`}list(e){var t,i;return(t=this.queues)!=null&&t[e]||(i=this.tracks)!=null&&i[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const i=(t=this.tracks)==null?void 0:t[e],r=i==null?void 0:i.buffer;return r?`SourceBuffer${r.updating?" updating":""}${i.ended?" ended":""}${i.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(i=>i.label).join(", "))||""}}const Qg=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,PS="HlsJsTrackRemovedError";class _k extends Error{constructor(e){super(e),this.name=PS}}class xk extends Es{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=i=>{var r;this.hls&&((r=this.mediaSource)==null?void 0:r.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=i=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=i=>{const{media:r,mediaSource:n}=this;i&&this.log("Media source opened"),!(!r||!n)&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(b.MEDIA_ATTACHED,{media:r,mediaSource:n}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:i,_objectUrl:r}=this;i!==r&&this.error(`Media element src was set while attaching MediaSource (${r} > ${i})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=VR(Xi(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.BUFFER_RESET,this.onBufferReset,this),e.on(b.BUFFER_APPENDING,this.onBufferAppending,this),e.on(b.BUFFER_CODECS,this.onBufferCodecs,this),e.on(b.BUFFER_EOS,this.onBufferEos,this),e.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(b.FRAG_PARSED,this.onFragParsed,this),e.on(b.FRAG_CHANGED,this.onFragChanged,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.BUFFER_RESET,this.onBufferReset,this),e.off(b.BUFFER_APPENDING,this.onBufferAppending,this),e.off(b.BUFFER_CODECS,this.onBufferCodecs,this),e.off(b.BUFFER_EOS,this.onBufferEos,this),e.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(b.FRAG_PARSED,this.onFragParsed,this),e.off(b.FRAG_CHANGED,this.onFragChanged,this),e.off(b.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const i={};if(this.operationQueue){const n=this.isUpdating();n||this.operationQueue.removeBlockers();const a=this.isQueued();(n||a)&&this.warn(`Transfering MediaSource with${a?" operations in queue":""}${n?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?ze(i,r.tracks):this.sourceBuffers.forEach(n=>{const[a]=n;a&&(i[a]=ze({},this.tracks[a]),this.removeBuffer(a)),n[0]=n[1]=null}),{media:e,mediaSource:t,tracks:i}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var i;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(i=this.transferData)!=null&&i.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const i=this.media=t.media;this.transferData=this.overrides=void 0;const r=Xi(this.appendSource);if(r){const n=!!t.mediaSource;(n||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const a=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(a),n)this._objectUrl=i.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(a);if(this.appendSource)try{i.removeAttribute("src");const l=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||l&&a instanceof l,qg(i),Ak(i,o),i.load()}catch{i.src=o}else i.src=o}i.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,i;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(i=e.constructor)==null?void 0:i.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const i=this.tracks,r=t.tracks,n=r?Object.keys(r):null,a=n?n.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(r&&n&&a){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
381
|
+
required tracks: ${Xe(i,(l,c)=>l==="initSegment"?void 0:c)};
|
|
382
|
+
transfer tracks: ${Xe(r,(l,c)=>l==="initSegment"?void 0:c)}}`),!Ib(r,i)){t.mediaSource=null,t.tracks=void 0;const l=e.currentTime,c=this.details,u=Math.max(l,(c==null?void 0:c.fragments[0].start)||0);if(u-l>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${l} -> ${u}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(i)}") start time: ${u} currentTime: ${l}`),this.onMediaDetaching(b.MEDIA_DETACHING,{}),this.onMediaAttaching(b.MEDIA_ATTACHING,t),e.currentTime=u;return}this.transferData=void 0,n.forEach(l=>{const c=l,u=r[c];if(u){const f=u.buffer;if(f){const d=this.fragmentTracker,h=u.id;if(d.hasFragments(h)||d.hasParts(h)){const m=be.getBuffered(f);d.detectEvictedFragments(c,m,h,null,!0)}const p=Cu(c),g=[c,f];this.sourceBuffers[p]=g,f.updating&&this.operationQueue&&this.operationQueue.prependBlocker(c),this.trackSourceBuffer(c,u)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const i=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:n,_objectUrl:a}=this;if(n){if(this.log(`media source ${i?"transferring":"detaching"}`),i)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=n.readyState==="open";try{const l=n.sourceBuffers;for(let c=l.length;c--;)o&&l[c].abort(),n.removeSourceBuffer(l[c]);o&&n.endOfStream()}catch(l){this.warn(`onMediaDetaching: ${l.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.removeEventListener("startstreaming",this._onStartStreaming),n.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),i||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(r.removeAttribute("src"),this.appendSource&&qg(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(b.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const i=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),i)try{var r;(r=this.mediaSource)!=null&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}catch(n){this.warn(`onBufferReset ${e}`,n)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Cu(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Ek(this.tracks)}onBufferCodecs(e,t){var i;const r=this.tracks,n=Object.keys(t);this.log(`BUFFER_CODECS: "${n}" (current SB count ${this.sourceBufferCount})`);const a="audiovideo"in t&&(r.audio||r.video)||r.audiovideo&&("audio"in t||"video"in t),o=!a&&this.sourceBufferCount&&this.media&&n.some(l=>!r[l]);if(a||o){this.warn(`Unsupported transition between "${Object.keys(r)}" and "${n}" SourceBuffers`);return}n.forEach(l=>{var c,u;const f=t[l],{id:d,codec:h,levelCodec:p,container:g,metadata:m,supplemental:v}=f;let y=r[l];const E=(c=this.transferData)==null||(c=c.tracks)==null?void 0:c[l],w=E!=null&&E.buffer?E:y,T=(w==null?void 0:w.pendingCodec)||(w==null?void 0:w.codec),$=w==null?void 0:w.levelCodec;y||(y=r[l]={buffer:void 0,listeners:[],codec:h,supplemental:v,container:g,levelCodec:p,metadata:m,id:d});const k=ko(T,$),M=k==null?void 0:k.replace(Qg,"$1");let _=ko(h,p);const C=(u=_)==null?void 0:u.replace(Qg,"$1");_&&k&&M!==C&&(l.slice(0,5)==="audio"&&(_=yl(_,this.appendSource)),this.log(`switching codec ${T} to ${_}`),_!==(y.pendingCodec||y.codec)&&(y.pendingCodec=_),y.container=g,this.appendChangeType(l,g,_))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((i=t.audio)==null?void 0:i.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const i=this.tracks[t];return e[t]={id:i.id,container:i.container,codec:i.codec,levelCodec:i.levelCodec},e},{})}appendChangeType(e,t,i){const r=`${t};codecs=${i}`,n={label:`change-type=${r}`,execute:()=>{const a=this.tracks[e];if(a){const o=a.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),o.changeType(r),a.codec=i,a.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:a=>{this.warn(`Failed to change ${e} SourceBuffer type`,a)}};this.append(n,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const i=e.start,r=i+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(i,ce.MAIN))==null?void 0:t.gap)===!0)return;const a={label:"block-audio",execute:()=>{var o;const l=this.tracks.video;(this.lastVideoAppendEnd>r||l!=null&&l.buffer&&be.isBuffered(l.buffer,r)||((o=this.fragmentTracker.getAppendedFrag(r,ce.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:a,frag:e},this.append(a,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:i}=this,{data:r,type:n,parent:a,frag:o,part:l,chunkMeta:c,offset:u}=t,f=c.buffering[n],{sn:d,cc:h}=o,p=self.performance.now();f.start=p;const g=o.stats.buffering,m=l?l.stats.buffering:null;g.start===0&&(g.start=p),m&&m.start===0&&(m.start=p);const v=i.audio;let y=!1;n==="audio"&&(v==null?void 0:v.container)==="audio/mpeg"&&(y=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const E=i.video,w=E==null?void 0:E.buffer;if(w&&d!=="initSegment"){const k=l||o,M=this.blockedAudioAppend;if(n==="audio"&&a!=="main"&&!this.blockedAudioAppend&&!(E.ending||E.ended)){const C=k.start+k.duration*.05,U=w.buffered,L=this.currentOp("video");!U.length&&!L?this.blockAudio(k):!L&&!be.isBuffered(w,C)&&this.lastVideoAppendEnd<C&&this.blockAudio(k)}else if(n==="video"){const _=k.end;if(M){const C=M.frag.start;(_>C||_<this.lastVideoAppendEnd||be.isBuffered(w,C))&&this.unblockAudio()}this.lastVideoAppendEnd=_}}const T=(l||o).start,$={label:`append-${n}`,execute:()=>{var k;f.executeStart=self.performance.now();const M=(k=this.tracks[n])==null?void 0:k.buffer;M&&(y?this.updateTimestampOffset(M,T,.1,n,d,h):u!==void 0&&re(u)&&this.updateTimestampOffset(M,u,1e-6,n,d,h)),this.appendExecutor(r,n)},onStart:()=>{},onComplete:()=>{const k=self.performance.now();f.executeEnd=f.end=k,g.first===0&&(g.first=k),m&&m.first===0&&(m.first=k);const M={};this.sourceBuffers.forEach(([_,C])=>{_&&(M[_]=be.getBuffered(C))}),this.appendErrors[n]=0,n==="audio"||n==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(b.BUFFER_APPENDED,{type:n,frag:o,part:l,chunkMeta:c,parent:o.type,timeRanges:M})},onError:k=>{var M;const _={type:fe.MEDIA_ERROR,parent:o.type,details:V.BUFFER_APPEND_ERROR,sourceBufferName:n,frag:o,part:l,chunkMeta:c,error:k,err:k,fatal:!1},C=(M=this.media)==null?void 0:M.error;if(k.code===DOMException.QUOTA_EXCEEDED_ERR||k.name=="QuotaExceededError"||"quota"in k)_.details=V.BUFFER_FULL_ERROR;else if(k.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!C)_.errorAction=Jr(!0);else if(k.name===PS&&this.sourceBufferCount===0)_.errorAction=Jr(!0);else{const U=++this.appendErrors[n];this.warn(`Failed ${U}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${n}" sourceBuffer (${C||"no media error"})`),(U>=this.hls.config.appendErrorMaxRetry||C)&&(_.fatal=!0)}this.hls.trigger(b.ERROR,_)}};this.log(`queuing "${n}" append sn: ${d}${l?" p: "+l.index:""} of ${o.type===ce.MAIN?"level":"track"} ${o.level} cc: ${h}`),this.append($,n,this.isPending(this.tracks[n]))}getFlushOp(e,t,i){return this.log(`queuing "${e}" remove ${t}-${i}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,i)},onStart:()=>{},onComplete:()=>{this.hls.trigger(b.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${i} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:i,startOffset:r,endOffset:n}=t;i?this.append(this.getFlushOp(i,r,n),i):this.sourceBuffers.forEach(([a])=>{a&&this.append(this.getFlushOp(a,r,n),a)})}onFragParsed(e,t){const{frag:i,part:r}=t,n=[],a=r?r.elementaryStreams:i.elementaryStreams;a[qe.AUDIOVIDEO]?n.push("audiovideo"):(a[qe.AUDIO]&&n.push("audio"),a[qe.VIDEO]&&n.push("video"));const o=()=>{const l=self.performance.now();i.stats.buffering.end=l,r&&(r.stats.buffering.end=l);const c=r?r.stats:i.stats;this.hls.trigger(b.FRAG_BUFFERED,{frag:i,part:r,stats:c,id:i.type})};n.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(o,n).catch(l=>{this.warn(`Fragment buffered callback ${l}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var i;this.sourceBuffers.forEach(([a])=>{if(a){const o=this.tracks[a];(!t.type||t.type===a)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${a} buffer reached EOS`)))}});const r=((i=this.overrides)==null?void 0:i.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([a])=>{var o;return a&&!((o=this.tracks[a])!=null&&o.ended)})?r?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:a}=this;if(!a||a.readyState!=="open"){a&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${a.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),a.endOfStream(),this.hls.trigger(b.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(b.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===V.BUFFER_APPEND_ERROR&&t.frag){var i;const r=(i=t.errorAction)==null?void 0:i.nextAutoLevel;re(r)&&r!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:i}=this;if(!i||t===null||!this.sourceBufferCount)return;const r=e.config,n=i.currentTime,a=t.levelTargetDuration,o=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(re(o)&&o>=0){const c=Math.max(o,a),u=Math.floor(n/a)*a-c;this.flushBackBuffer(n,a,u)}const l=r.frontBufferFlushThreshold;if(re(l)&&l>0){const c=Math.max(r.maxBufferLength,l),u=Math.max(c,a),f=Math.floor(n/a)*a+u;this.flushFrontBuffer(n,a,f)}}flushBackBuffer(e,t,i){this.sourceBuffers.forEach(([r,n])=>{if(n){const o=be.getBuffered(n);if(o.length>0&&i>o.start(0)){var a;this.hls.trigger(b.BACK_BUFFER_REACHED,{bufferEnd:i});const l=this.tracks[r];if((a=this.details)!=null&&a.live)this.hls.trigger(b.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(l!=null&&l.ended){this.log(`Cannot flush ${r} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(b.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:r})}}})}flushFrontBuffer(e,t,i){this.sourceBuffers.forEach(([r,n])=>{if(n){const a=be.getBuffered(n),o=a.length;if(o<2)return;const l=a.start(o-1),c=a.end(o-1);if(i>l||e>=l&&e<=c)return;this.hls.trigger(b.BUFFER_FLUSHING,{startOffset:l,endOffset:1/0,type:r})}})}getDurationAndRange(){var e;const{details:t,mediaSource:i}=this;if(!t||!this.media||(i==null?void 0:i.readyState)!=="open")return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&i.setLiveSeekableRange){const c=Math.max(0,t.fragmentStart),u=Math.max(c,r);return{duration:1/0,start:c,end:u}}return{duration:1/0}}const n=(e=this.overrides)==null?void 0:e.duration;if(n)return re(n)?{duration:n}:null;const a=this.media.duration,o=re(i.duration)?i.duration:0;return r>o&&r>a||!re(a)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:i}){const r=this.mediaSource;!this.media||!r||r.readyState!=="open"||(r.duration!==e&&(re(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&i!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${i}.`),r.setLiveSeekableRange(t,i)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:i}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Xe(i)}`),this.tracksReady){var r;const n=(r=this.transferData)==null?void 0:r.tracks;n&&Object.keys(n).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,i])=>{if(t){const r=this.tracks[t];e[t]={buffer:i,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(b.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:i}=this;if(!i)throw new Error("createSourceBuffers called when mediaSource was null");for(const n in e){const a=n,o=e[a];if(this.isPending(o)){const l=this.getTrackCodec(o,a),c=`${o.container};codecs=${l}`;o.codec=l,this.log(`creating sourceBuffer(${c})${this.currentOp(a)?" Queued":""} ${Xe(o)}`);try{const u=i.addSourceBuffer(c),f=Cu(a),d=[a,u];t[f]=d,o.buffer=u}catch(u){var r;this.error(`error while trying to add sourceBuffer: ${u.message}`),this.shiftAndExecuteNext(a),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[a],this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,sourceBufferName:a,mimeType:c,parent:o.id});return}this.trackSourceBuffer(a,o)}}this.bufferCreated()}getTrackCodec(e,t){const i=e.supplemental;let r=e.codec;i&&(t==="video"||t==="audiovideo")&&la(i,"video")&&(r=hD(r,i));const n=ko(r,e.levelCodec);return n?t.slice(0,5)==="audio"?yl(n,this.appendSource):n:""}trackSourceBuffer(e,t){const i=t.buffer;if(!i)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:i,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(n,a)=>{const o=a.removedRanges;o!=null&&o.length&&this.hls.trigger(b.BUFFER_FLUSHED,{type:n})})}get mediaSrc(){var e,t;const i=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return i==null?void 0:i.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const i=this.currentOp(e);i&&(i.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var i;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(i=this.mediaSource)==null?void 0:i.readyState}`);this.error(`${r}`,t),this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const n=this.currentOp(e);n&&n.onError(r)}updateTimestampOffset(e,t,i,r,n,a){const o=t-e.timestampOffset;Math.abs(o)>=i&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${t} (sn: ${n} cc: ${a})`),e.timestampOffset=t)}removeExecutor(e,t,i){const{media:r,mediaSource:n}=this,a=this.tracks[e],o=a==null?void 0:a.buffer;if(!r||!n||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const l=re(r.duration)?r.duration:1/0,c=re(n.duration)?n.duration:1/0,u=Math.max(0,t),f=Math.min(i,l,c);f>u&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${u},${f}] from the ${e} SourceBuffer`),o.remove(u,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const i=this.tracks[t],r=i==null?void 0:i.buffer;if(!r)throw new _k(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);i.ending=!1,i.ended=!1,r.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:i}=this,r=t.map(a=>this.appendBlocker(a));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(a=>{i===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var i;const r=(i=this.tracks[t])==null?void 0:i.buffer;!r||r.updating||this.shiftAndExecuteNext(t)})}append(e,t,i){this.operationQueue&&this.operationQueue.append(e,t,i)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,i){const r=this.tracks[e];if(!r)return;const n=r.buffer;if(!n)return;const a=i.bind(this,e);r.listeners.push({event:t,listener:a}),n.addEventListener(t,a)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const i=t.buffer;i&&(t.listeners.forEach(r=>{i.removeEventListener(r.event,r.listener)}),t.listeners.length=0)}}function qg(s){const e=s.querySelectorAll("source");[].slice.call(e).forEach(t=>{s.removeChild(t)})}function Ak(s,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,s.appendChild(t)}function Cu(s){return s==="audio"?1:0}class Sh{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(b.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(b.BUFFER_CODECS,this.onBufferCodecs,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(b.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(b.BUFFER_CODECS,this.onBufferCodecs,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&re(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,i=this.getMaxLevel(e.length-1);i!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${i}: ${e[i].height}p@${e[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=i,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter((r,n)=>this.isLevelAllowed(r)&&n<=e);return this.clientRect=null,Sh.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){if(!(e!=null&&e.length))return-1;const r=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let n=e.length-1;const a=Math.max(t,i);for(let o=0;o<e.length;o+=1){const l=e[o];if((l.width>=a||l.height>=a)&&r(l,e[o+1])){n=o;break}}return n}}const Tk={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},jt=Tk,wk={HLS:"h"},Ck=wk;class Zs{constructor(e,t){Array.isArray(e)&&(e=e.map(i=>i instanceof Zs?i:new Zs(i))),this.value=e,this.params=t}}const Lk="Dict";function Ik(s){return Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":typeof s=="object"?JSON.stringify(s):String(s)}function Rk(s,e,t,i){return new Error(`failed to ${s} "${Ik(e)}" as ${t}`,{cause:i})}function ei(s,e,t){return Rk("serialize",s,e,t)}class OS{constructor(e){this.description=e}}const Xg="Bare Item",Dk="Boolean";function kk(s){if(typeof s!="boolean")throw ei(s,Dk);return s?"?1":"?0"}function Pk(s){return btoa(String.fromCharCode(...s))}const Ok="Byte Sequence";function Mk(s){if(ArrayBuffer.isView(s)===!1)throw ei(s,Ok);return`:${Pk(s)}:`}const Nk="Integer";function Fk(s){return s<-999999999999999||999999999999999<s}function MS(s){if(Fk(s))throw ei(s,Nk);return s.toString()}function $k(s){return`@${MS(s.getTime()/1e3)}`}function NS(s,e){if(s<0)return-NS(-s,e);const t=Math.pow(10,e);if(Math.abs(s*t%1-.5)<Number.EPSILON){const r=Math.floor(s*t);return(r%2===0?r:r+1)/t}else return Math.round(s*t)/t}const Bk="Decimal";function Uk(s){const e=NS(s,3);if(Math.floor(Math.abs(e)).toString().length>12)throw ei(s,Bk);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Gk="String",Hk=/[\x00-\x1f\x7f]+/;function Yk(s){if(Hk.test(s))throw ei(s,Gk);return`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function jk(s){return s.description||s.toString().slice(7,-1)}const Vk="Token";function Jg(s){const e=jk(s);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw ei(e,Vk);return e}function Yf(s){switch(typeof s){case"number":if(!re(s))throw ei(s,Xg);return Number.isInteger(s)?MS(s):Uk(s);case"string":return Yk(s);case"symbol":return Jg(s);case"boolean":return kk(s);case"object":if(s instanceof Date)return $k(s);if(s instanceof Uint8Array)return Mk(s);if(s instanceof OS)return Jg(s);default:throw ei(s,Xg)}}const Kk="Key";function jf(s){if(/^[a-z*][a-z0-9\-_.*]*$/.test(s)===!1)throw ei(s,Kk);return s}function Eh(s){return s==null?"":Object.entries(s).map(([e,t])=>t===!0?`;${jf(e)}`:`;${jf(e)}=${Yf(t)}`).join("")}function FS(s){return s instanceof Zs?`${Yf(s.value)}${Eh(s.params)}`:Yf(s)}function Wk(s){return`(${s.value.map(FS).join(" ")})${Eh(s.params)}`}function zk(s,e={whitespace:!0}){if(typeof s!="object"||s==null)throw ei(s,Lk);const t=s instanceof Map?s.entries():Object.entries(s),i=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,n])=>{n instanceof Zs||(n=new Zs(n));let a=jf(r);return n.value===!0?a+=Eh(n.params):(a+="=",Array.isArray(n.value)?a+=Wk(n):a+=FS(n)),a}).join(`,${i}`)}function $S(s,e){return zk(s,e)}const Hs="CMCD-Object",ct="CMCD-Request",nr="CMCD-Session",ki="CMCD-Status",Qk={br:Hs,ab:Hs,d:Hs,ot:Hs,tb:Hs,tpb:Hs,lb:Hs,tab:Hs,lab:Hs,url:Hs,pb:ct,bl:ct,tbl:ct,dl:ct,ltc:ct,mtp:ct,nor:ct,nrr:ct,rc:ct,sn:ct,sta:ct,su:ct,ttfb:ct,ttfbb:ct,ttlb:ct,cmsdd:ct,cmsds:ct,smrt:ct,df:ct,cs:ct,ts:ct,cid:nr,pr:nr,sf:nr,sid:nr,st:nr,v:nr,msd:nr,bs:ki,bsd:ki,cdn:ki,rtp:ki,bg:ki,pt:ki,ec:ki,e:ki},qk={REQUEST:ct};function Xk(s){return Object.keys(s).reduce((e,t)=>{var i;return(i=s[t])===null||i===void 0||i.forEach(r=>e[r]=t),e},{})}function Jk(s,e){const t={};if(!s)return t;const i=Object.keys(s),r=e?Xk(e):{};return i.reduce((n,a)=>{var o;const l=Qk[a]||r[a]||qk.REQUEST,c=(o=n[l])!==null&&o!==void 0?o:n[l]={};return c[a]=s[a],n},t)}function Zk(s){return["ot","sf","st","e","sta"].includes(s)}function eP(s){return typeof s=="number"?re(s):s!=null&&s!==""&&s!==!1}const BS="event";function tP(s,e){const t=new URL(s),i=new URL(e);if(t.origin!==i.origin)return s;const r=t.pathname.split("/").slice(1),n=i.pathname.split("/").slice(1,-1);for(;r[0]===n[0];)r.shift(),n.shift();for(;n.length;)n.shift(),r.unshift("..");return r.join("/")+t.search+t.hash}const Fo=s=>Math.round(s),Vf=(s,e)=>Array.isArray(s)?s.map(t=>Vf(t,e)):s instanceof Zs&&typeof s.value=="string"?new Zs(Vf(s.value,e),s.params):(e.baseUrl&&(s=tP(s,e.baseUrl)),e.version===1?encodeURIComponent(s):s),ao=s=>Fo(s/100)*100,sP=(s,e)=>{let t=s;return e.version>=2&&(s instanceof Zs&&typeof s.value=="string"?t=new Zs([s]):typeof s=="string"&&(t=[s])),Vf(t,e)},iP={br:Fo,d:Fo,bl:ao,dl:ao,mtp:ao,nor:sP,rtp:ao,tb:Fo},US="request",GS="response",_h=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],rP=["e"],nP=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function cc(s){return nP.test(s)}function aP(s){return _h.includes(s)||rP.includes(s)||cc(s)}const HS=["d","dl","nor","ot","rtp","su"];function oP(s){return _h.includes(s)||HS.includes(s)||cc(s)}const lP=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function cP(s){return _h.includes(s)||HS.includes(s)||lP.includes(s)||cc(s)}const uP=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function fP(s){return uP.includes(s)||cc(s)}const dP={[GS]:cP,[BS]:aP,[US]:oP};function YS(s,e={}){const t={};if(s==null||typeof s!="object")return t;const i=e.version||s.v||1,r=e.reportingMode||US,n=i===1?fP:dP[r];let a=Object.keys(s).filter(n);const o=e.filter;typeof o=="function"&&(a=a.filter(o));const l=r===GS||r===BS;l&&!a.includes("ts")&&a.push("ts"),i>1&&!a.includes("v")&&a.push("v");const c=ze({},iP,e.formatters),u={version:i,reportingMode:r,baseUrl:e.baseUrl};return a.sort().forEach(f=>{let d=s[f];const h=c[f];if(typeof h=="function"&&(d=h(d,u)),f==="v"){if(i===1)return;d=i}f=="pr"&&d===1||(l&&f==="ts"&&!re(d)&&(d=Date.now()),eP(d)&&(Zk(f)&&typeof d=="string"&&(d=new OS(d)),t[f]=d))}),t}function hP(s,e={}){const t={};if(!s)return t;const i=YS(s,e),r=Jk(i,e==null?void 0:e.customHeaderMap);return Object.entries(r).reduce((n,[a,o])=>{const l=$S(o,{whitespace:!1});return l&&(n[a]=l),n},t)}function pP(s,e,t){return ze(s,hP(e,t))}const mP="CMCD";function gP(s,e={}){return s?$S(YS(s,e),{whitespace:!1}):""}function vP(s,e={}){if(!s)return"";const t=gP(s,e);return encodeURIComponent(t)}function yP(s,e={}){if(!s)return"";const t=vP(s,e);return`${mP}=${t}`}const Zg=/CMCD=[^&#]+/;function bP(s,e,t){const i=yP(e,t);if(!i)return s;if(Zg.test(s))return s.replace(Zg,i);const r=s.includes("?")?"&":"?";return`${s}${r}${i}`}class SP{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:jt.MANIFEST,su:!this.initialized})}catch(n){this.hls.logger.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=r=>{try{const{frag:n,part:a}=r,o=this.hls.levels[n.level],l=this.getObjectType(n),c={d:(a||n).duration*1e3,ot:l};(l===jt.VIDEO||l===jt.AUDIO||l==jt.MUXED)&&(c.br=o.bitrate/1e3,c.tb=this.getTopBandwidth(l)/1e3,c.bl=this.getBufferLength(l));const u=a?this.getNextPart(a):this.getNextFrag(n);u!=null&&u.url&&u.url!==n.url&&(c.nor=u.url),this.apply(r,c)}catch(n){this.hls.logger.warn("Could not generate segment CMCD data.",n)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||e.sessionId,this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHED,this.onMediaDetached,this),e.on(b.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHED,this.onMediaDetached,this),e.off(b.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,r;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:1,sf:Ck.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){ze(t,this.createData());const i=t.ot===jt.INIT||t.ot===jt.VIDEO||t.ot===jt.MUXED;this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((a,o)=>(r.includes(o)&&(a[o]=t[o]),a),{}));const n={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),pP(e.headers,t,n)):e.url=bP(e.url,t,n)}getNextFrag(e){var t;const i=(t=this.hls.levels[e.level])==null?void 0:t.details;if(i){const r=e.sn-i.startSN;return i.fragments[r+1]}}getNextPart(e){var t;const{index:i,fragment:r}=e,n=(t=this.hls.levels[r.level])==null||(t=t.details)==null?void 0:t.partList;if(n){const{sn:a}=r;for(let o=n.length-1;o>=0;o--){const l=n[o];if(l.index===i&&l.fragment.sn===a)return n[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return jt.TIMED_TEXT;if(e.sn==="initSegment")return jt.INIT;if(t==="audio")return jt.AUDIO;if(t==="main")return this.hls.audioTracks.length?jt.VIDEO:jt.MUXED}getTopBandwidth(e){let t=0,i;const r=this.hls;if(e===jt.AUDIO)i=r.audioTracks;else{const n=r.maxAutoLevel,a=n>-1?n+1:r.levels.length;i=r.levels.slice(0,a)}return i.forEach(n=>{n.bitrate>t&&(t=n.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,i=e===jt.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:be.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,o){t(n),this.loader.load(n,a,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new i(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,o){t(n),this.loader.load(n,a,o)}}}}const EP=3e5;class _P extends Es{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(i=>i!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===At.SendAlternateToPenaltyBox&&i.flags===is.MoveAllAlternatesMatchingHost){const r=this.levels;let n=this._pathwayPriority,a=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:c}=t.context;o&&r?a=this.getPathwayForGroupId(o,c,a):l&&(a=l)}a in this.penalizedPathways||(this.penalizedPathways[a]=performance.now()),!n&&r&&(n=this.pathways()),n&&n.length>1&&(this.updatePathwayPriority(n),i.resolved=this.pathwayId!==a),t.details===V.BUFFER_APPEND_ERROR&&!t.fatal?i.resolved=!0:i.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${r&&r.length} priorities: ${Xe(n)} penalized: ${Xe(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach(n=>{r-i[n]>EP&&delete i[n]});for(let n=0;n<e.length;n++){const a=e[n];if(a in i)continue;if(a===this.pathwayId)return;const o=this.hls.nextLoadLevel,l=this.hls.levels[o];if(t=this.getLevelsForPathway(a),t.length>0){this.log(`Setting Pathway to "${a}"`),this.pathwayId=a,cS(t),this.hls.trigger(b.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,i){const r=this.getLevelsForPathway(i).concat(this.levels||[]);for(let n=0;n<r.length;n++)if(t===De.AUDIO_TRACK&&r[n].hasAudioGroup(e)||t===De.SUBTITLE_TRACK&&r[n].hasSubtitleGroup(e))return r[n].pathwayId;return i}clonePathways(e){const t=this.levels;if(!t)return;const i={},r={};e.forEach(n=>{const{ID:a,"BASE-ID":o,"URI-REPLACEMENT":l}=n;if(t.some(u=>u.pathwayId===a))return;const c=this.getLevelsForPathway(o).map(u=>{const f=new nt(u.attrs);f["PATHWAY-ID"]=a;const d=f.AUDIO&&`${f.AUDIO}_clone_${a}`,h=f.SUBTITLES&&`${f.SUBTITLES}_clone_${a}`;d&&(i[f.AUDIO]=d,f.AUDIO=d),h&&(r[f.SUBTITLES]=h,f.SUBTITLES=h);const p=jS(u.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),g=new ua({attrs:f,audioCodec:u.audioCodec,bitrate:u.bitrate,height:u.height,name:u.name,url:p,videoCodec:u.videoCodec,width:u.width});if(u.audioGroups)for(let m=1;m<u.audioGroups.length;m++)g.addGroupId("audio",`${u.audioGroups[m]}_clone_${a}`);if(u.subtitleGroups)for(let m=1;m<u.subtitleGroups.length;m++)g.addGroupId("text",`${u.subtitleGroups[m]}_clone_${a}`);return g});t.push(...c),e0(this.audioTracks,i,l,a),e0(this.subtitleTracks,r,l,a)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(t);let r;try{r=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const u=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+u)}const n={responseType:"json",url:r.href},a=t.steeringManifestLoadPolicy.default,o=a.errorRetry||a.timeoutRetry||{},l={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(u,f,d,h)=>{this.log(`Loaded steering manifest: "${r}"`);const p=u.data;if((p==null?void 0:p.VERSION)!==1){this.log(`Steering VERSION ${p.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=p.TTL;const{"RELOAD-URI":g,"PATHWAY-CLONES":m,"PATHWAY-PRIORITY":v}=p;if(g)try{this.uri=new self.URL(g,r).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${g}`);return}this.scheduleRefresh(this.uri||d.url),m&&this.clonePathways(m);const y={steeringManifest:p,url:r.toString()};this.hls.trigger(b.STEERING_MANIFEST_LOADED,y),v&&this.updatePathwayPriority(v)},onError:(u,f,d,h)=>{if(this.log(`Error loading steering manifest: ${u.code} ${u.text} (${f.url})`),this.stopLoad(),u.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let p=this.timeToLoad*1e3;if(u.code===429){const g=this.loader;if(typeof(g==null?void 0:g.getResponseHeader)=="function"){const m=g.getResponseHeader("Retry-After");m&&(p=parseFloat(m)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,p)},onTimeout:(u,f,d)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(n,l,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var i;const r=(i=this.hls)==null?void 0:i.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function e0(s,e,t,i){s&&Object.keys(e).forEach(r=>{const n=s.filter(a=>a.groupId===r).map(a=>{const o=ze({},a);return o.details=void 0,o.attrs=new nt(o.attrs),o.url=o.attrs.URI=jS(a.url,a.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[r],o.attrs["PATHWAY-ID"]=i,o});s.push(...n)})}function jS(s,e,t,i){const{HOST:r,PARAMS:n,[t]:a}=i;let o;e&&(o=a==null?void 0:a[e],o&&(s=o));const l=new self.URL(s);return r&&!o&&(l.host=r),n&&Object.keys(n).sort().forEach(c=>{c&&l.searchParams.set(c,n[c])}),l.href}class en extends Es{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=en.CDMCleanupPromise?[en.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:i,initData:r}=t,n=`"${t.type}" event: init data type: "${i}"`;if(this.debug(n),r!==null){if(!this.keyFormatPromise){let a=Object.keys(this.keySystemAccessPromises);a.length||(a=Hn(this.config));const o=a.map(bu).filter(l=>!!l);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(a=>{const o=Oo(a);if(i!=="sinf"||o!==ot.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${i}" for selected key-system ${o}`);return}let l;try{const h=gt(new Uint8Array(r)),p=uh(JSON.parse(h).sinf),g=$b(p);if(!g)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");l=new Uint8Array(g.subarray(8,24))}catch(h){this.warn(`${n} Failed to parse sinf: ${h}`);return}const c=Tt(l),{keyIdToKeySessionPromise:u,mediaKeySessions:f}=this;let d=u[c];for(let h=0;h<f.length;h++){const p=f[h],g=p.decryptdata;if(!g.keyId)continue;const m=Tt(g.keyId);if(xl(l,g.keyId)||g.uri.replace(/-/g,"").indexOf(c)!==-1){if(d=u[m],!d)continue;if(g.pssh)break;delete u[m],g.pssh=new Uint8Array(r),g.keyId=l,d=u[c]=d.then(()=>this.generateRequestWithPreferredKeySession(p,i,r,"encrypted-event-key-match")),d.catch(v=>this.handleError(v));break}}d||this.handleError(new Error(`Key ID ${c} not encountered in playlist. Key-system sessions ${f.length}.`))}).catch(a=>this.handleError(a))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(b.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(b.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(b.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(b.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(b.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,r=t==null?void 0:t[e];if(r)return r.licenseUrl;if(e===ot.WIDEVINE&&i)return i}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t==null?void 0:t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(a,o,l)=>!!a&&l.indexOf(a)===o,r=t.map(a=>a.audioCodec).filter(i),n=t.map(a=>a.videoCodec).filter(i);return r.length+n.length===0&&n.push("avc1.42e01e"),new Promise((a,o)=>{const l=c=>{const u=c.shift();this.getMediaKeysPromise(u,r,n).then(f=>a({keySystem:u,mediaKeys:f})).catch(f=>{c.length?l(c):f instanceof ss?o(f):o(new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${i}`;return tS===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return i(e,t)}getMediaKeysPromise(e,t,i){var r;const n=s2(e,t,i,this.config.drmSystemOptions||{});let a=this.keySystemAccessPromises[e],o=(r=a)==null?void 0:r.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Xe(n)}`),o=this.requestMediaKeySystemAccess(e,n);const l=a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),o.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const f=l.mediaKeys=c.createMediaKeys().then(d=>(this.log(`Media-keys created for "${e}"`),l.hasMediaKeys=!0,u.then(h=>h?this.setMediaKeysServerCertificate(d,e,h):d)));return f.catch(d=>{this.error(`Failed to create media-keys for "${e}"}: ${d}`)}),f})}return o.then(()=>a.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${Tt(e.keyId||[])} keyUri: ${e.uri}`);const r=i.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),r=oo(t),n="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,n,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyId ${Tt(e.decryptdata.keyId||[])}
|
|
383
|
+
} (data length: ${t.byteLength})`),i.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>bu(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:i})=>this.attemptSetMediaKeys(t,i))}selectKeySystem(e){return new Promise((t,i)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:r})=>{const n=bu(r);n?t(n):i(new Error(`Unable to find format for key-system "${r}"`))}).catch(i)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Hn(this.config),i=e.map(Oo).filter(r=>!!r&&t.indexOf(r)!==-1);return this.selectKeySystem(i)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let i=0;i<t.length;i++){const r=xP(e,t[i]);if(r)return r}}loadKey(e){const t=e.keyInfo.decryptdata,i=oo(t),r=this.bannedKeyIds[i];if(r||this.getKeyStatus(t)==="internal-error"){const o=t0(r||"internal-error",t);return this.handleError(o,e.frag),Promise.reject(o)}const n=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);const a=this.keyIdToKeySessionPromise[i];if(!a){const o=this.getKeySystemForKeyPromise(t).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(l,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:t}))))).then(l=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(l,c,u,"playlist-key")});return o.catch(l=>this.handleError(l,e.frag)),this.keyIdToKeySessionPromise[i]=o,o}return a.catch(o=>{if(o instanceof ss){const l=Ke({},o.data);this.getKeyStatus(t)==="internal-error"&&(l.decryptdata=t);const c=new ss(l,o.message);this.handleError(c,e.frag)}}),a}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof ss){t&&(e.data.frag=t);const i=e.data.decryptdata;this.error(`${e.message}${i?` (${Tt(i.keyId||[])})`:""}`),this.hls.trigger(b.ERROR,e.data)}else this.error(e.message),this.hls.trigger(b.ERROR,{type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=oo(e),i=this.keyIdToKeySessionPromise[t];if(!i){const r=Oo(e.keyFormat),n=r?[r]:Hn(this.config);return this.attemptKeySystemAccess(n)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=Hn(this.config)),e.length===0)throw new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Xe({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(i).then(()=>this.media?this.media.setMediaKeys(t):new Promise((n,a)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return a(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(n).catch(a)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>i.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,i,r){var n;const a=(n=this.config.drmSystems)==null||(n=n[e.keySystem])==null?void 0:n.generateRequest;if(a)try{const p=a.call(this.hls,t,i,e);if(!p)throw new Error("Invalid response from configured generateRequest filter");t=p.initDataType,i=p.initData?p.initData:null,e.decryptdata.pssh=i?new Uint8Array(i):null}catch(p){if(this.warn(p.message),this.hls&&this.hls.config.debug)throw p}if(i===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const o=oo(e.decryptdata),l=e.decryptdata.uri;this.log(`Generating key-session request for "${r}" keyId: ${o} URI: ${l} (init data type: ${t} length: ${i.byteLength})`);const c=new dh,u=e._onmessage=p=>{const g=e.mediaKeysSession;if(!g){c.emit("error",new Error("invalid state"));return}const{messageType:m,message:v}=p;this.log(`"${m}" message event for session "${g.sessionId}" message size: ${v.byteLength}`),m==="license-request"||m==="license-renewal"?this.renewLicense(e,v).catch(y=>{c.eventNames().length?c.emit("error",y):this.handleError(y)}):m==="license-release"?e.keySystem===ot.FAIRPLAY&&this.updateKeySession(e,Ff("acknowledged")).then(()=>this.removeSession(e)).catch(y=>this.handleError(y)):this.warn(`unhandled media key message type "${m}"`)},f=(p,g)=>{g.keyStatus=p;let m;p.startsWith("usable")?c.emit("resolved"):p==="internal-error"||p==="output-restricted"||p==="output-downscaled"?m=t0(p,g.decryptdata):p==="expired"?m=new Error(`key expired (keyId: ${o})`):p==="released"?m=new Error("key released"):p==="status-pending"||this.warn(`unhandled key status change "${p}" (keyId: ${o})`),m&&(c.eventNames().length?c.emit("error",m):this.handleError(m))},d=e._onkeystatuseschange=p=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}const m=this.getKeyStatuses(e);if(!Object.keys(m).some(w=>m[w]!=="status-pending"))return;if(m[o]==="expired"){this.log(`Expired key ${Xe(m)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let y=m[o];if(y)f(y,e);else{var E;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(E=e.keyStatusTimeouts)[o]||(E[o]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const T=this.getKeyStatus(e.decryptdata);if(T&&T!=="status-pending")return this.log(`No status for keyId ${o} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${T} from other session.`),f(T,e);this.log(`key status for ${o} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),y="internal-error",f(y,e)},1e3)),this.log(`No status for keyId ${o} (${Xe(m)}).`)}};$t(e.mediaKeysSession,"message",u),$t(e.mediaKeysSession,"keystatuseschange",d);const h=new Promise((p,g)=>{c.on("error",g),c.on("resolved",p)});return e.mediaKeysSession.generateRequest(t,i).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o} URI: ${l}`)}).catch(p=>{throw new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_SESSION,error:p,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${p}`)}).then(()=>h).catch(p=>(c.removeAllListeners(),this.removeSession(e).then(()=>{throw p}))).then(()=>(c.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((i,r)=>{if(typeof r=="string"&&typeof i=="object"){const o=r;r=i,i=o}const n="buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);if(e.keySystem===ot.PLAYREADY&&n.length===16){const o=Tt(n);t[o]=i,Zb(n)}const a=Tt(n);i==="internal-error"&&(this.bannedKeyIds[a]=i),this.log(`key status change "${i}" for keyStatuses keyId: ${a} key-session "${e.mediaKeysSession.sessionId}"`),t[a]=i}),t}fetchServerCertificate(e){const t=this.config,i=t.loader,r=new i(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching server certificate for "${e}"`),new Promise((a,o)=>{const l={responseType:"arraybuffer",url:n},c=t.certLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,g)=>{a(d.data)},onError:(d,h,p,g)=>{o(new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:Ke({url:l.url,data:void 0},d)},`"${e}" certificate request failed (${n}). Status: ${d.code} (${d.text})`))},onTimeout:(d,h,p)=>{o(new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(d,h,p)=>{o(new Error("aborted"))}};r.load(l,u,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise((r,n)=>{e.setServerCertificate(i).then(a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${i.byteLength}) on "${t}"`),r(e)}).catch(a=>{n(new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:a,fatal:!0},a.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(i=>this.updateKeySession(e,new Uint8Array(i)).catch(r=>{throw new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:r,fatal:!1},r.message)}))}unpackPlayReadyKeyMessage(e,t){const i=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!i.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=new DOMParser().parseFromString(i,"application/xml"),n=r.querySelectorAll("HttpHeader");if(n.length>0){let u;for(let f=0,d=n.length;f<d;f++){var a,o;u=n[f];const h=(a=u.querySelector("name"))==null?void 0:a.textContent,p=(o=u.querySelector("value"))==null?void 0:o.textContent;h&&p&&e.setRequestHeader(h,p)}}const l=r.querySelector("Challenge"),c=l==null?void 0:l.textContent;if(!c)throw new Error("Cannot find <Challenge> in key message");return Ff(atob(c))}setupLicenseXHR(e,t,i,r){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,i,r)}).catch(a=>{if(!i.decryptdata)throw a;return e.open("POST",t,!0),n.call(this.hls,e,t,i,r)}).then(a=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:a||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise((r,n)=>{const a=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${a}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,a,e)}catch(u){this.error(u)}r(l)}else{const l=i.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)n(new ss({type:fe.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:a,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${a}). Status: ${o.status} (${o.statusText})`));else{const u=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${u} attempts left`),this.requestLicense(e,t).then(r,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,a,e,t).then(({xhr:l,licenseChallenge:c})=>{e.keySystem==ot.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(l,c)),l.send(c)}).catch(n)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,$t(i,"encrypted",this.onMediaEncrypted),$t(i,"waitingforkey",this.onWaitingForKey);const r=this.mediaResolved;r?r():this.mediaKeys=i.mediaKeys}onMediaDetached(){const e=this.media;e&&(zt(e,"encrypted",this.onMediaEncrypted),zt(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const i=this.media,r=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Hi.clearKeyUriToKeyIdMap();const n=r.length;en.CDMCleanupPromise=Promise.all(r.map(a=>this.removeSession(a)).concat((i==null||(e=i.setMediaKeys(null))==null?void 0:e.catch(a=>{this.log(`Could not clear media keys: ${a}`),this.hls&&this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${a}`)})}))||Promise.resolve())).catch(a=>{this.log(`Could not close sessions and clear media keys: ${a}`),this.hls&&this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${a}`)})}).then(()=>{n&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const i=t.reduce((r,n)=>(r.indexOf(n.keyFormat)===-1&&r.push(n.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i,decryptdata:r}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Tt((r==null?void 0:r.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const n=this.mediaKeySessions.indexOf(e);n>-1&&this.mediaKeySessions.splice(n,1);const{keyStatusTimeouts:a}=e;a&&Object.keys(a).forEach(c=>self.clearTimeout(a[c]));const{drmSystemOptions:o}=this.config;return(r2(o)?new Promise((c,u)=>{self.setTimeout(()=>u(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(c).catch(u)}):Promise.resolve()).catch(c=>{this.log(`Could not remove session: ${c}`),this.hls&&this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${c}`)})}).then(()=>t.close()).catch(c=>{this.log(`Could not close session: ${c}`),this.hls&&this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${c}`)})})}return Promise.resolve()}}en.CDMCleanupPromise=void 0;function oo(s){if(!s)throw new Error("Could not read keyId of undefined decryptdata");if(s.keyId===null)throw new Error("keyId is null");return Tt(s.keyId)}function xP(s,e){if(s.keyId&&e.mediaKeysSession.keyStatuses.has(s.keyId))return e.mediaKeysSession.keyStatuses.get(s.keyId);if(s.matches(e.decryptdata))return e.keyStatus}class ss extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function t0(s,e){const t=s==="output-restricted",i=t?V.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:V.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new ss({type:fe.KEY_SYSTEM_ERROR,details:i,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${s}"`)}class AP{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(b.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(b.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,i){const r=performance.now();if(t){if(this.lastTime){const n=r-this.lastTime,a=i-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*a/n,c=this.hls;if(c.trigger(b.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:i}),l>0&&a>c.config.fpsDroppedMonitoringThreshold*o){let u=c.currentLevel;c.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=u)&&(u=u-1,c.trigger(b.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:c.currentLevel}),c.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function VS(s,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=s,e.dispatchEvent(t)}function KS(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(e.id))try{if(s.addCue(e),!s.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){We.debug(`[texttrack-utils]: ${i}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,s.addCue(r)}catch(r){We.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(s.mode=t)}function zr(s,e){const t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues)for(let i=s.cues.length;i--;)e&&s.cues[i].removeEventListener("enter",e),s.removeCue(s.cues[i]);t==="disabled"&&(s.mode=t)}function Kf(s,e,t,i){const r=s.mode;if(r==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const n=wP(s.cues,e,t);for(let a=0;a<n.length;a++)(!i||i(n[a]))&&s.removeCue(n[a])}r==="disabled"&&(s.mode=r)}function TP(s,e){if(e<=s[0].startTime)return 0;const t=s.length-1;if(e>s[t].endTime)return-1;let i=0,r=t,n;for(;i<=r;)if(n=Math.floor((r+i)/2),e<s[n].startTime)r=n-1;else if(e>s[n].startTime&&i<t)i=n+1;else return n;return s[i].startTime-e<e-s[r].startTime?i:r}function wP(s,e,t){const i=[],r=TP(s,e);if(r>-1)for(let n=r,a=s.length;n<a;n++){const o=s[n];if(o.startTime>=e&&o.endTime<=t)i.push(o);else if(o.startTime>t)return i}return i}function $o(s){const e=[];for(let t=0;t<s.length;t++){const i=s[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(s[t])}return e}class CP extends bh{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const i=$o(this.media.textTracks);for(let n=0;n<i.length;n++)if(i[n].mode==="hidden")t=i[n];else if(i[n].mode==="showing"){t=i[n];break}const r=this.findTrackForTextTrack(t);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(b.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.LEVEL_LOADING,this.onLevelLoading,this),e.off(b.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(b.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const i=this.media;if(!i)return;const r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||i.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;$o(i.textTracks).forEach(a=>{zr(a)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,groupId:r,details:n}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==r){this.warn(`Subtitle track with id:${i} and group:${r} not found in active group ${a==null?void 0:a.groupId}`);return}const o=a.details;a.details=t.details,this.log(`Subtitle track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const i=t.subtitleGroups||null,r=this.groupIds;let n=this.currentTrack;if(!i||(r==null?void 0:r.length)!==(i==null?void 0:i.length)||i!=null&&i.some(a=>(r==null?void 0:r.indexOf(a))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(u=>!i||i.indexOf(u.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(u=>u.default)&&(this.selectDefaultTrack=!1),a.forEach((u,f)=>{u.id=f});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const o=this.hls.config.subtitlePreference;if(!n&&o){this.selectDefaultTrack=!1;const u=zs(o,a);if(u>-1)n=a[u];else{const f=zs(o,this.tracks);n=this.tracks[f]}}let l=this.findTrackId(n);l===-1&&n&&(l=this.findTrackId(null));const c={subtitleTracks:a};this.log(`Updating subtitle tracks, ${a.length} track(s) found in "${i==null?void 0:i.join(",")}" group-id`),this.hls.trigger(b.SUBTITLE_TRACKS_UPDATED,c),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}}findTrackId(e){const t=this.tracksInGroup,i=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const n=t[r];if(!(i&&!n.default||!i&&!e)&&(!e||mr(n,e)))return r}if(e){for(let r=0;r<t.length;r++){const n=t[r];if(pa(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const n=t[r];if(pa(e.attrs,n.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if(Hf(r,e))return i}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===De.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const i=this.currentTrack;if(i&&mr(e,i))return i;const r=zs(e,this.tracksInGroup);if(r>-1){const n=this.tracksInGroup[r];return this.setSubtitleTrack(r),n}else{if(i)return null;{const n=zs(e,t);if(n>-1)return t[n]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=e.id,r=e.groupId,n=this.getUrlWithDirectives(e.url,t),a=e.details,o=a==null?void 0:a.age;this.log(`Loading subtitle ${i} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&a.live?" age "+o.toFixed(1)+(a.type&&" "+a.type||""):""} ${n}`),this.hls.trigger(b.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=$o(e.textTracks),i=this.currentTrack;let r;if(i&&(r=t.filter(n=>Hf(i,n))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)),[].slice.call(t).forEach(n=>{n.mode!=="disabled"&&n!==r&&(n.mode="disabled")}),r){const n=this.subtitleDisplay?"showing":"hidden";r.mode!==n&&(r.mode=n)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!re(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const i=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(b.SUBTITLE_TRACK_SWITCH,{id:e});return}const n=!!r.details&&!r.details.live;if(e===this.trackId&&r===i&&n)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:a,groupId:o="",name:l,type:c,url:u}=r;this.hls.trigger(b.SUBTITLE_TRACK_SWITCH,{id:a,groupId:o,name:l,type:c,url:u});const f=this.switchParams(r.url,i==null?void 0:i.details,r.details);this.loadPlaylist(f)}}function LP(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const n=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?n:n&3|8).toString(16)})}}}function zn(s){let e=5381,t=s.length;for(;t;)e=e*33^s.charCodeAt(--t);return(e>>>0).toString()}const tn=.025;let Cl=function(s){return s[s.Point=0]="Point",s[s.Range=1]="Range",s}({});function IP(s,e,t){return`${s.identifier}-${t+1}-${zn(e)}`}class RP{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const i=this.playoutLimit;return e<=0||isNaN(i)?!1:i===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>i}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Lu(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,i=Lu(t,e);return t-i<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=re(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return Lu(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<tn))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Cl.Range:Cl.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return DP(this)}}function Lu(s,e){return s-e.start<e.duration/2&&!(Math.abs(s-(e.start+e.duration))<tn)?e.start:e.start+e.duration}function WS(s,e,t){const i=new self.URL(s,t);return i.protocol!=="data:"&&i.searchParams.set("_HLS_primary_id",e),i}function Iu(s,e){for(;(t=s.assetList[++e])!=null&&t.error;)var t;return e}function DP(s){return`["${s.identifier}" ${s.cue.pre?"<pre>":s.cue.post?"<post>":""}${s.timelineStart.toFixed(2)}-${s.resumeTime.toFixed(2)}]`}function Yr(s){const e=s.timelineStart,t=s.duration||0;return`["${s.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class kP{constructor(e,t,i,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(b.PLAYOUT_LIMIT_REACHED,{})};const n=this.hls=new e(t);this.interstitial=i,this.assetItem=r;const a=()=>{this.hasDetails=!0};n.once(b.LEVEL_LOADED,a),n.once(b.AUDIO_TRACK_LOADED,a),n.once(b.SUBTITLE_TRACK_LOADED,a),n.on(b.MEDIA_ATTACHING,(o,{media:l})=>{this.removeMediaListeners(),this.mediaAttached=l,this.interstitial.playoutLimit&&(l.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&n.on(b.BUFFER_APPENDED,()=>{const u=this.bufferedEnd;this.reachedPlayout(u)&&(this._bufferedEosTime=u,n.trigger(b.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=WS(t,e.config.primarySessionId||"").href}catch{}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const i=Math.min(this._bufferedEosTime||1/0,this.duration),r=this.timelineOffset,n=be.bufferInfo(e,r,0);return this.getAssetTime(n.end)>=i-.02}reachedPlayout(e){const i=this.interstitial.playoutLimit;return this.startOffset+e>=i}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=be.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const i=t-this.startOffset;if(i>0&&i<e)return i}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const i=e-t;if(Math.abs(i)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,i=this.duration;return Math.min(Math.max(0,e-t),i)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=i=>delete i.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,i){var r;(r=this.hls)==null||r.on(e,t)}once(e,t,i){var r;(r=this.hls)==null||r.once(e,t)}off(e,t,i){var r;(r=this.hls)==null||r.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${Yr(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const s0=.033;class PP extends Es{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((i,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,i+1):i,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let i=-1;e.nextEvent?i=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(i=this.findEventIndex(e.previousEvent.identifier)+1);const r=this.items;if(r)for(r[i]||(t===void 0&&(t=e.start),i=this.findItemIndexAtTime(t));i>=0&&(n=r[i])!=null&&n.event;){var n;i--}return i}findItemIndexAtTime(e,t){const i=this.items;if(i)for(let r=0;r<i.length;r++){let n=i[r];if(t&&t!=="primary"&&(n=n[t]),e===n.start||e>n.start&&e<n.end)return r}return-1}findJumpRestrictedIndex(e,t){const i=this.items;if(i)for(let r=e;r<=t&&i[r];r++){const n=i[r].event;if(n!=null&&n.restrictions.jump&&!n.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var i;if(((i=t[r].event)==null?void 0:i.identifier)===e)return r}return-1}findAssetIndex(e,t){const i=e.assetList,r=i.length;if(r>1)for(let n=0;n<r;n++){const a=i[n];if(!a.error){const o=a.timelineStart;if(t===o||t>o&&(t<o+(a.duration||0)||n===r-1))return n}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const i=t.assetList,r=i[i.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const i=e.main.details,{dateRanges:r}=i,n=this.events,a=this.parseDateRanges(r,{url:i.url},t),o=Object.keys(r),l=n?n.filter(c=>!o.includes(c.identifier)):[];a.length&&a.sort((c,u)=>{const f=c.cue.pre,d=c.cue.post,h=u.cue.pre,p=u.cue.post;if(f&&!h)return-1;if(h&&!f||d&&!p)return 1;if(p&&!d)return-1;if(!f&&!h&&!d&&!p){const g=c.startTime,m=u.startTime;if(g!==m)return g-m}return c.dateRange.tagOrder-u.dateRange.tagOrder}),this.events=a,l.forEach(c=>{this.removeEvent(c)}),this.updateSchedule(e,l)}updateSchedule(e,t=[],i=!1){const r=this.events||[];if(r.length||t.length||this.length<2){const n=this.items,a=this.parseSchedule(r,e);(i||t.length||(n==null?void 0:n.length)!==a.length||a.some((l,c)=>Math.abs(l.playout.start-n[c].playout.start)>.005||Math.abs(l.playout.end-n[c].playout.end)>.005))&&(this.items=a,this.onScheduleUpdate(t,n))}}parseDateRanges(e,t,i){const r=[],n=Object.keys(e);for(let a=0;a<n.length;a++){const o=n[a],l=e[o];if(l.isInterstitial){let c=this.eventMap[o];c?c.setDateRange(l):(c=new RP(l,t),this.eventMap[o]=c,i===!1&&(c.appendInPlace=i)),r.push(c)}}return r}parseSchedule(e,t){const i=[],r=t.main.details,n=r.live?1/0:r.edge;let a=0;if(e=e.filter(l=>!l.error&&!(l.cue.once&&l.hasPlayed)),e.length){this.resolveOffsets(e,t);let l=0,c=0;if(e.forEach((u,f)=>{const d=u.cue.pre,h=u.cue.post,p=e[f-1]||null,g=u.appendInPlace,m=h?n:u.startOffset,v=u.duration,y=u.timelineOccupancy===Cl.Range?v:0,E=u.resumptionOffset,w=(p==null?void 0:p.startTime)===m,T=m+u.cumulativeDuration;let $=g?T+v:m+E;if(d||!h&&m<=0){const M=c;c+=y,u.timelineStart=T;const _=a;a+=v,i.push({event:u,start:T,end:$,playout:{start:_,end:a},integrated:{start:M,end:c}})}else if(m<=n){if(!w){const C=m-l;if(C>s0){const U=l,L=c;c+=C;const R=a;a+=C;const B={previousEvent:e[f-1]||null,nextEvent:u,start:U,end:U+C,playout:{start:R,end:a},integrated:{start:L,end:c}};i.push(B)}else C>0&&p&&(p.cumulativeDuration+=C,i[i.length-1].end=m)}h&&($=T),u.timelineStart=T;const M=c;c+=y;const _=a;a+=v,i.push({event:u,start:T,end:$,playout:{start:_,end:a},integrated:{start:M,end:c}})}else return;const k=u.resumeTime;h||k>n?l=n:l=k}),l<n){var o;const u=l,f=c,d=n-l;c+=d;const h=a;a+=d,i.push({previousEvent:((o=i[i.length-1])==null?void 0:o.event)||null,nextEvent:null,start:l,end:u+d,playout:{start:h,end:a},integrated:{start:f,end:c}})}this.setDurations(n,a,c)}else i.push({previousEvent:null,nextEvent:null,start:0,end:n,playout:{start:0,end:n},integrated:{start:0,end:n}}),this.setDurations(n,n,n);return i}setDurations(e,t,i){this.durations={primary:e,playout:t,integrated:i}}resolveOffsets(e,t){const i=t.main.details,r=i.live?1/0:i.edge;let n=0,a=-1;e.forEach((o,l)=>{const c=o.cue.pre,u=o.cue.post,f=c?0:u?r:o.startTime;this.updateAssetDurations(o),a===f?o.cumulativeDuration=n:(n=0,a=f),!u&&o.snapOptions.in&&(o.resumeAnchor=_r(null,i.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&l+1<e.length&&e[l+1].startTime-e[l].resumeTime<s0&&(e[l+1].appendInPlace=!1,e[l+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const h=re(o.resumeOffset)?o.resumeOffset:o.duration;n+=h})}primaryCanResumeInPlaceAt(e,t){const i=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(i-r)>tn?(this.log(`"${e.identifier}" resumption ${i} not aligned with estimated timeline end ${r}`),!1):!Object.keys(t).some(a=>{const o=t[a].details,l=o.edge;if(i>=l)return this.log(`"${e.identifier}" resumption ${i} past ${a} playlist end ${l}`),!1;const c=_r(null,o.fragments,i);if(!c)return this.log(`"${e.identifier}" resumption ${i} does not align with any fragments in ${a} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const u=a==="audio"?.175:0;return Math.abs(c.start-i)<tn+u||Math.abs(c.end-i)<tn+u?!1:(this.log(`"${e.identifier}" resumption ${i} not aligned with ${a} fragment bounds (${c.start}-${c.end} sn: ${c.sn} cc: ${c.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let i=0,r=!1,n=!1;for(let a=0;a<e.assetList.length;a++){const o=e.assetList[a],l=t+i;o.startOffset=i,o.timelineStart=l,r||(r=o.duration===null),n||(n=!!o.error);const c=o.error?0:o.duration||0;i+=c}r&&!n?e.duration=Math.max(i,e.duration):e.duration=i}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Ts(s){return`[${s.event?'"'+s.event.identifier+'"':"primary"}: ${s.start.toFixed(2)}-${s.end.toFixed(2)}]`}class OP{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const i=e.assetListUrl;let r;try{r=WS(i,this.hls.sessionId,e.baseUrl)}catch(d){const h=this.assignAssetListError(e,V.ASSET_LIST_LOAD_ERROR,d,i);this.hls.trigger(b.ERROR,h);return}t&&r.protocol!=="data:"&&r.searchParams.set("_HLS_start_offset",""+t);const n=this.hls.config,a=n.loader,o=new a(n),l={responseType:"json",url:r.href},c=n.interstitialAssetListLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,g)=>{const m=d.data,v=m==null?void 0:m.ASSETS;if(!Array.isArray(v)){const y=this.assignAssetListError(e,V.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),p.url,h,g);this.hls.trigger(b.ERROR,y);return}e.assetListResponse=m,this.hls.trigger(b.ASSET_LIST_LOADED,{event:e,assetListResponse:m,networkDetails:g})},onError:(d,h,p,g)=>{const m=this.assignAssetListError(e,V.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${h.url})`),h.url,g,p);this.hls.trigger(b.ERROR,m)},onTimeout:(d,h,p)=>{const g=this.assignAssetListError(e,V.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${h.url})`),h.url,d,p);this.hls.trigger(b.ERROR,g)}};return o.load(l,u,f),this.hls.trigger(b.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,i,r,n,a){return e.error=i,{type:fe.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:i,networkDetails:a,stats:n}}}function i0(s){var e;s==null||(e=s.play())==null||e.catch(()=>{})}function lo(s,e){return`[${s}] Advancing timeline position to ${e}`}class MP extends Es{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const i=this.currentTime;if(i===void 0||this.playbackDisabled||!this.schedule)return;const r=i-this.timelinePos;if(Math.abs(r)<1/7056e5)return;const a=r<=-.01;this.timelinePos=i,this.bufferedPos=i;const o=this.playingItem;if(!o){this.checkBuffer();return}if(a&&this.schedule.resetErrorsInRange(i,i-r)&&this.updateSchedule(!0),this.checkBuffer(),a&&i<o.start||i>=o.end){var l;const h=this.findItemIndex(o);let p=this.schedule.findItemIndexAtTime(i);if(p===-1&&(p=h+(a?-1:1),this.log(`seeked ${a?"back ":""}to position not covered by schedule ${i} (resolving from ${h} to ${p})`)),!this.isInterstitial(o)&&(l=this.media)!=null&&l.paused&&(this.shouldPlay=!1),!a&&p>h){const g=this.schedule.findJumpRestrictedIndex(h+1,p);if(g>h){this.setSchedulePosition(g);return}}this.setSchedulePosition(p);return}const c=this.playingAsset;if(!c){if(this.playingLastItem&&this.isInterstitial(o)){const h=o.event.assetList[0];h&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(i,h))}return}const u=c.timelineStart,f=c.duration||0;if(a&&i<u||i>=u+f){var d;(d=o.event)!=null&&d.appendInPlace&&(this.clearAssetPlayers(o.event,o),this.flushFrontBuffer(i)),this.setScheduleToAssetAtTime(i,c)}},this.onTimeupdate=()=>{const i=this.currentTime;if(i===void 0||this.playbackDisabled)return;if(i>this.timelinePos)this.timelinePos=i,i>this.bufferedPos&&this.checkBuffer();else return;const r=this.playingItem;if(!r||this.playingLastItem)return;if(i>=r.end){this.timelinePos=r.end;const o=this.findItemIndex(r);this.setSchedulePosition(o+1)}const n=this.playingAsset;if(!n)return;const a=n.timelineStart+(n.duration||0);i>=a&&this.setScheduleToAssetAtTime(i,n)},this.onScheduleUpdate=(i,r)=>{const n=this.schedule;if(!n)return;const a=this.playingItem,o=n.events||[],l=n.items||[],c=n.durations,u=i.map(g=>g.identifier),f=!!(o.length||u.length);(f||r)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
384
|
+
Schedule: ${l.map(g=>Ts(g))} pos: ${this.timelinePos}`),u.length&&this.log(`Removed events ${u}`);let d=null,h=null;a&&(d=this.updateItem(a,this.timelinePos),this.itemsMatch(a,d)?this.playingItem=d:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const p=this.bufferingItem;if(p&&(h=this.updateItem(p,this.bufferedPos),this.itemsMatch(p,h)?this.bufferingItem=h:p.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(p.event,null))),i.forEach(g=>{g.assetList.forEach(m=>{this.clearAssetPlayer(m.identifier,null)})}),this.playerQueue.forEach(g=>{if(g.interstitial.appendInPlace){const m=g.assetItem.timelineStart,v=g.timelineOffset-m;if(v)try{g.timelineOffset=m}catch(y){Math.abs(v)>tn&&this.warn(`${y} ("${g.assetId}" ${g.timelineOffset}->${m})`)}}}),f||r){if(this.hls.trigger(b.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:l.slice(0),durations:c,removedIds:u}),this.isInterstitial(a)&&u.includes(a.event.identifier)){this.warn(`Interstitial "${a.event.identifier}" removed while playing`),this.primaryFallback(a.event);return}a&&this.trimInPlace(d,a),p&&h!==d&&this.trimInPlace(h,p),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new OP(e),this.schedule=new PP(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(b.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(b.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(b.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(b.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(b.BUFFER_APPENDED,this.onBufferAppended,this),e.on(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(b.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(b.MEDIA_ENDED,this.onMediaEnded,this),e.on(b.ERROR,this.onError,this),e.on(b.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(b.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(b.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(b.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(b.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(b.BUFFER_CODECS,this.onBufferCodecs,this),e.off(b.BUFFER_APPENDED,this.onBufferAppended,this),e.off(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(b.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(b.MEDIA_ENDED,this.onMediaEnded,this),e.off(b.ERROR,this.onError,this),e.off(b.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){zt(e,"play",this.onPlay),zt(e,"pause",this.onPause),zt(e,"seeking",this.onSeeking),zt(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const i=this.media=t.media;$t(i,"seeking",this.onSeeking),$t(i,"timeupdate",this.onTimeupdate),$t(i,"play",this.onPlay),$t(i,"pause",this.onPause)}onMediaAttached(e,t){const i=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,i===null)this.checkStart();else if(!r){this.clearScheduleState();const n=this.findItemIndex(i);this.setSchedulePosition(n)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const i=!!t.transferMedia,r=this.media;if(this.media=null,!i&&(r&&this.removeMediaListeners(r),this.detachedData)){const n=this.getBufferingPlayer();n&&(this.log(`Removing schedule state for detachedData and ${n}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,n.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,i=f=>f&&e.getAssetPlayer(f.identifier),r=(f,d,h,p,g)=>{if(f){let m=f[d].start;const v=f.event;if(v){if(d==="playout"||v.timelineOccupancy!==Cl.Point){const y=i(h);(y==null?void 0:y.interstitial)===v&&(m+=y.assetItem.startOffset+y[g])}}else{const y=p==="bufferedPos"?a():e[p];m+=y-f.start}return m}return 0},n=(f,d)=>{var h;if(f!==0&&d!=="primary"&&(h=e.schedule)!=null&&h.length){var p;const g=e.schedule.findItemIndexAtTime(f),m=(p=e.schedule.items)==null?void 0:p[g];if(m){const v=m[d].start-m.start;return f+v}}return f},a=()=>{const f=e.bufferedPos;return f===Number.MAX_VALUE?o("primary"):Math.max(f,0)},o=f=>{var d,h;return(d=e.primaryDetails)!=null&&d.live?e.primaryDetails.edge:((h=e.schedule)==null?void 0:h.durations[f])||0},l=(f,d)=>{var h,p;const g=e.effectivePlayingItem;if(g!=null&&(h=g.event)!=null&&h.restrictions.skip||!e.schedule)return;e.log(`seek to ${f} "${d}"`);const m=e.effectivePlayingItem,v=e.schedule.findItemIndexAtTime(f,d),y=(p=e.schedule.items)==null?void 0:p[v],E=e.getBufferingPlayer(),w=E==null?void 0:E.interstitial,T=w==null?void 0:w.appendInPlace,$=m&&e.itemsMatch(m,y);if(m&&(T||$)){const k=i(e.playingAsset),M=(k==null?void 0:k.media)||e.primaryMedia;if(M){const _=d==="primary"?M.currentTime:r(m,d,e.playingAsset,"timelinePos","currentTime"),C=f-_,U=(T?_:M.currentTime)+C;if(U>=0&&(!k||T||U<=k.duration)){M.currentTime=U;return}}}if(y){let k=f;if(d!=="primary"){const _=y[d].start,C=f-_;k=y.start+C}const M=!e.isInterstitial(y);if((!e.isInterstitial(m)||m.event.appendInPlace)&&(M||y.event.appendInPlace)){const _=e.media||(T?E==null?void 0:E.media:null);_&&(_.currentTime=k)}else if(m){const _=e.findItemIndex(m);if(v>_){const U=e.schedule.findJumpRestrictedIndex(_+1,v);if(U>_){e.setSchedulePosition(U);return}}let C=0;if(M)e.timelinePos=k,e.checkBuffer();else{const U=y.event.assetList,L=f-(y[d]||y).start;for(let R=U.length;R--;){const B=U[R];if(B.duration&&L>=B.startOffset&&L<B.startOffset+B.duration){C=R;break}}}e.setSchedulePosition(v,C)}}},c=()=>{const f=e.effectivePlayingItem;if(e.isInterstitial(f))return f;const d=t();return e.isInterstitial(d)?d:null},u={get bufferedEnd(){const f=t(),d=e.bufferingItem;if(d&&d===f){var h;return r(d,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-d.playout.start||((h=e.bufferingAsset)==null?void 0:h.startOffset)||0}return 0},get currentTime(){const f=c(),d=e.effectivePlayingItem;return d&&d===f?r(d,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-d.playout.start:0},set currentTime(f){const d=c(),h=e.effectivePlayingItem;h&&h===d&&l(f+h.playout.start,"playout")},get duration(){const f=c();return f?f.playout.end-f.playout.start:0},get assetPlayers(){var f;const d=(f=c())==null?void 0:f.event.assetList;return d?d.map(h=>e.getAssetPlayer(h.identifier)):[]},get playingIndex(){var f;const d=(f=c())==null?void 0:f.event;return d&&e.effectivePlayingAsset?d.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return c()}};return this.manager={get events(){var f;return((f=e.schedule)==null||(f=f.events)==null?void 0:f.slice(0))||[]},get schedule(){var f;return((f=e.schedule)==null||(f=f.items)==null?void 0:f.slice(0))||[]},get interstitialPlayer(){return c()?u:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const f=t();return e.findItemIndex(f)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const f=e.effectivePlayingItem;return e.findItemIndex(f)},primary:{get bufferedEnd(){return a()},get currentTime(){const f=e.timelinePos;return f>0?f:0},set currentTime(f){l(f,"primary")},get duration(){return o("primary")},get seekableStart(){var f;return((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(f){l(f,"integrated")},get duration(){return o("integrated")},get seekableStart(){var f;return n(((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0,"integrated")}},skip:()=>{const f=e.effectivePlayingItem,d=f==null?void 0:f.event;if(d&&!d.restrictions.skip){const h=e.findItemIndex(f);if(d.appendInPlace){const p=f.playout.start+f.event.duration;l(p+.001,"playout")}else e.advanceAfterAssetEnded(d,h,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,i=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!i?!1:this.findItemIndex(t)===i.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let r=this.media;!r&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(r=this.primaryMedia);const n=(t=r)==null?void 0:t.currentTime;if(!(n===void 0||!re(n)))return n}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const i=this.getAssetPlayer(e);i&&this.transferMediaFromPlayer(i,t)}transferMediaFromPlayer(e,t){const i=e.interstitial.appendInPlace,r=e.media;if(i&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}const n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${Xe(n)}`),this.detachedData=n}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var i,r;if(e.media===t)return;let n=null;const a=this.hls,o=e!==a,l=o&&e.interstitial.appendInPlace,c=(i=this.detachedData)==null?void 0:i.mediaSource;let u;if(a.media)l&&(n=a.transferMedia(),this.detachedData=n),u="Primary";else if(c){const p=this.getBufferingPlayer();p?(n=p.transferMedia(),u=`${p}`):u="detached MediaSource"}else u="detached media";if(!n){if(c)n=this.detachedData,this.log(`using detachedData: MediaSource ${Xe(n)}`);else if(!this.detachedData||a.media===t){const p=this.playerQueue;p.length>1&&p.forEach(g=>{if(o&&g.interstitial.appendInPlace!==l){const m=g.interstitial;this.clearInterstitial(g.interstitial,null),m.appendInPlace=!1,m.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${m}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const f=n&&"mediaSource"in n&&((r=n.mediaSource)==null?void 0:r.readyState)!=="closed",d=f&&n?n:t;this.log(`${f?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${u} (media.currentTime: ${t.currentTime})`);const h=this.schedule;if(d===n&&h){const p=o&&e.assetId===h.assetIdAtEnd;d.overrides={duration:h.duration,endOfStream:!o||p,cueRemoval:!o}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const i=this.timelinePos,r=this.effectivePlayingItem;if(i===-1){const n=this.hls.startPosition;if(this.log(lo("checkStart",n)),this.timelinePos=n,t.length&&t[0].cue.pre){const a=e.findEventIndex(t[0].identifier);this.setSchedulePosition(a)}else if(n>=0||!this.primaryLive){const a=this.timelinePos=n>0?n:0,o=e.findItemIndexAtTime(a);this.setSchedulePosition(o)}}else if(r&&!this.playingItem){const n=e.findItemIndex(r);this.setSchedulePosition(n)}}advanceAssetBuffering(e,t){const i=e.event,r=i.findAssetIndex(t),n=Iu(i,r);if(!i.isAssetPastPlayoutLimit(n))this.bufferedToEvent(e,n);else if(this.schedule){var a;const o=(a=this.schedule.items)==null?void 0:a[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,i){const r=Iu(e,i);if(e.isAssetPastPlayoutLimit(r)){if(this.schedule){const n=this.schedule.items;if(n){const a=t+1,o=n.length;if(a>=o){this.setSchedulePosition(-1);return}const l=e.resumeTime;this.timelinePos<l&&(this.log(lo("advanceAfterAssetEnded",l)),this.timelinePos=l,e.appendInPlace&&this.advanceInPlace(l),this.checkBuffer(this.bufferedPos<l)),this.setSchedulePosition(a)}}}else{if(e.appendInPlace){const n=e.assetList[r];n&&this.advanceInPlace(n.timelineStart)}this.setSchedulePosition(t,r)}}setScheduleToAssetAtTime(e,t){const i=this.schedule;if(!i)return;const r=t.parentIdentifier,n=i.getEvent(r);if(n){const a=i.findEventIndex(r),o=i.findAssetIndex(n,e);this.advanceAfterAssetEnded(n,a,o-1)}}setSchedulePosition(e,t){var i;const r=(i=this.schedule)==null?void 0:i.items;if(!r||this.playbackDisabled)return;const n=e>=0?r[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${n&&Ts(n)}) pos: ${this.timelinePos}`);const a=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(a)){const u=a.event,f=this.playingAsset,d=f==null?void 0:f.identifier,h=d?this.getAssetPlayer(d):null;if(h&&d&&(!this.eventItemsMatch(a,n)||t!==void 0&&d!==u.assetList[t].identifier)){var l;const p=u.findAssetIndex(f);if(this.log(`INTERSTITIAL_ASSET_ENDED ${p+1}/${u.assetList.length} ${Yr(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(b.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:p,event:u,schedule:r.slice(0),scheduleIndex:e,player:h}),a!==this.playingItem){this.itemsMatch(a,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(u,this.findItemIndex(this.playingItem),p);return}this.retreiveMediaSource(d,n),h.media&&!((l=this.detachedData)!=null&&l.mediaSource)&&h.detachMedia()}if(!this.eventItemsMatch(a,n)&&(this.endedItem=a,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${Ts(a)}`),u.hasPlayed=!0,this.hls.trigger(b.INTERSTITIAL_ENDED,{event:u,schedule:r.slice(0),scheduleIndex:e}),u.cue.once)){var c;this.updateSchedule();const p=(c=this.schedule)==null?void 0:c.items;if(n&&p){const g=this.findItemIndex(n);this.advanceSchedule(g,p,t,a,o)}return}}this.advanceSchedule(e,r,t,a,o)}advanceSchedule(e,t,i,r,n){const a=this.schedule;if(!a)return;const o=t[e]||null,l=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,d=a.findEventIndex(f.identifier);(d<e||d>e+1)&&this.clearInterstitial(f,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const u=o.event;if(i===void 0){i=a.findAssetIndex(u,this.timelinePos);const p=Iu(u,i-1);if(u.isAssetPastPlayoutLimit(p)||u.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(u,e,i);return}i=p}const f=this.waitingItem;this.assetsBuffered(o,l)||this.setBufferingItem(o);let d=this.preloadAssets(u,i);if(this.eventItemsMatch(o,f||r)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Ts(o)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(b.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const h=u.assetList[i];if(!h){this.advanceAfterAssetEnded(u,e,i||0);return}if(d||(d=this.getAssetPlayer(h.identifier)),d===null||d.destroyed){const p=u.assetList.length;this.warn(`asset ${i+1}/${p} player destroyed ${u}`),d=this.createAssetPlayer(u,h,i),d.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(h))return;this.startAssetPlayer(d,i,t,e,l),this.shouldPlay&&i0(d.media)}else o?(this.resumePrimary(o,e,r),this.shouldPlay&&i0(this.hls.media)):n&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(a.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,i){var r,n;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ts(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.log(lo("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!i)return;const a=(n=this.schedule)==null?void 0:n.items;a&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ts(e)}`),this.hls.trigger(b.INTERSTITIALS_PRIMARY_RESUMED,{schedule:a.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const i=e.start;if(this.primaryLive){const r=this.primaryDetails;if(t===0)return this.hls.startPosition;if(r&&(i<r.fragmentStart||i>r.edge))return this.hls.liveSyncPosition||-1}return i}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:be.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,i){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const n=this.hls;n.media?this.checkBuffer():(this.transferMediaTo(n,r),i&&this.startLoadingPrimaryAt(e,i)),i||(this.log(lo("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,i))}startLoadingPrimaryAt(e,t){var i;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs((((i=r.mainForwardBufferInfo)==null?void 0:i.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(b.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(b.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const i=this.hls.levels[t.level];if(!i.details)return;const r=Ke(Ke({},this.mediaSelection||this.altSelection),{},{main:i});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const i=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=Ke(Ke({},this.altSelection),{},{audio:i});return}const n=Ke(Ke({},r),{},{audio:i});this.mediaSelection=n}onSubtitleTrackUpdated(e,t){const i=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=Ke(Ke({},this.altSelection),{},{subtitles:i});return}const n=Ke(Ke({},r),{},{subtitles:i});this.mediaSelection=n}onAudioTrackSwitching(e,t){const i=dg(t);this.playerQueue.forEach(({hls:r})=>r&&(r.setAudioOption(t)||r.setAudioOption(i)))}onSubtitleTrackSwitch(e,t){const i=dg(t);this.playerQueue.forEach(({hls:r})=>r&&(r.setSubtitleOption(t)||t.id!==-1&&r.setSubtitleOption(i)))}onBufferCodecs(e,t){const i=t.tracks;i&&(this.requiredTracks=i)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const i=this.playingItem;if(i&&!this.itemsMatch(i,this.bufferingItem)&&!this.isInterstitial(i)){const r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let r=0;r<t.length;r++){const n=t[r];if(n.cue.post){var i;const a=this.schedule.findEventIndex(n.identifier),o=(i=this.schedule.items)==null?void 0:i[a];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const i=this.findItemIndex(t);this.setSchedulePosition(i+1)}else this.shouldPlay=!1}updateItem(e,t){var i;const r=(i=this.schedule)==null?void 0:i.items;if(e&&r){const n=this.findItemIndex(e,t);return r[n]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((n,a)=>{e.event.isAssetPastPlayoutLimit(a)&&this.clearAssetPlayer(n.identifier,null)});const i=e.end+.25,r=be.bufferInfo(this.primaryMedia,i,0);(r.end>i||(r.nextStart||0)>i)&&(this.log(`trim buffered interstitial ${Ts(e)} (was ${Ts(t)})`),this.attachPrimary(i,null,!0),this.flushFrontBuffer(i))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var i;return!!t&&(e===t||e.event.identifier===((i=t.event)==null?void 0:i.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const i=this.mediaSelection;i&&((t=this.schedule)==null||t.updateSchedule(i,[],e))}checkBuffer(e){var t;const i=(t=this.schedule)==null?void 0:t.items;if(!i)return;const r=be.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=r.len<1),this.updateBufferedPos(r.end,i,e)}updateBufferedPos(e,t,i){const r=this.schedule,n=this.bufferingItem;if(this.bufferedPos>e||!r)return;if(t.length===1&&this.itemsMatch(t[0],n)){this.bufferedPos=e;return}const a=this.playingItem,o=this.findItemIndex(a);let l=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var c;const u=this.findItemIndex(n),f=Math.min(u+1,t.length-1),d=t[f];if((l===-1&&n&&e>=n.end||(c=d.event)!=null&&c.appendInPlace&&e+.01>=d.start)&&(l=f),this.isInterstitial(n)){const h=n.event;if(f-o>1&&h.appendInPlace===!1||h.assetList.length===0&&h.assetListLoader)return}if(this.bufferedPos=e,l>u&&l>o)this.bufferedToItem(d);else{const h=this.primaryDetails;this.primaryLive&&h&&e>h.edge-h.targetduration&&d.start<h.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(d)&&this.preloadAssets(d.event,0)}}else i&&a&&!this.itemsMatch(a,n)&&(l===o?this.bufferedToItem(a):l===o+1&&this.bufferedToItem(t[l]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(r=>{const n=this.getAssetPlayer(r.identifier);return!(n!=null&&n.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,i=this.schedule;if(!this.itemsMatch(e,t)&&i){const{items:r,events:n}=i;if(!r||!n)return t;const a=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const l=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ts(e)}`+(t?` (${l.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(a){const c=i.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((u,f)=>{const d=this.getAssetPlayer(u.identifier);d&&(f===c&&d.loadSource(),d.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(c=>c.pauseBuffering());this.hls.trigger(b.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:n.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const i=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(i!==null){this.bufferingAsset=null;const r=this.detachedData;r?r.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),i=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(i)}bufferedToEvent(e,t){const i=e.event,r=i.assetList.length===0&&!i.assetListLoader,n=i.cue.once;if(r||!n){const a=this.preloadAssets(i,t);if(a!=null&&a.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(a,o)}}}preloadAssets(e,t){const i=e.assetUrl,r=e.assetList.length,n=r===0&&!e.assetListLoader,a=e.cue.once;if(n){const l=e.timelineStart;if(e.appendInPlace){var o;const d=this.playingItem;!this.isInterstitial(d)&&(d==null||(o=d.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(l+.25)}let c,u=0;if(!this.playingItem&&this.primaryLive&&(u=this.hls.startPosition,u===-1&&(u=this.hls.liveSyncPosition||0)),u&&!(e.cue.pre||e.cue.post)){const d=u-l;d>0&&(c=Math.round(d*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${i?1:r} ${e}${c?` live-start: ${u} start-offset: ${c}`:""}`),i)return this.createAsset(e,0,0,l,e.duration,i);const f=this.assetListLoader.loadAssetList(e,c);f&&(e.assetListLoader=f)}else if(!a&&r){for(let c=t;c<r;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}const l=e.assetList[t];if(l){const c=this.getAssetPlayer(l.identifier);return c&&c.loadSource(),c}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(r=>{this.hls.trigger(b.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:r})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let i=0;i<t.length;i++)if(e===t[i].assetId)return i;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let i=0;i<e.length;i++)if(e[i].media===t)return e[i]}return null}createAsset(e,t,i,r,n,a){const o={parentIdentifier:e.identifier,identifier:IP(e,a,t),duration:n,startOffset:i,timelineStart:r,uri:a};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,i){const r=this.hls,n=r.userConfig;let a=n.videoPreference;const o=r.loadLevelObj||r.levels[r.currentLevel];(a||o)&&(a=ze({},a),o.videoCodec&&(a.videoCodec=o.videoCodec),o.videoRange&&(a.allowedVideoRanges=[o.videoRange]));const l=r.audioTracks[r.audioTrack],c=r.subtitleTracks[r.subtitleTrack];let u=0;if(this.primaryLive||e.appendInPlace){const w=this.timelinePos-t.timelineStart;if(w>1){const T=t.duration;T&&w<T&&(u=w)}}const f=t.identifier,d=Ke(Ke({},n),{},{maxMaxBufferLength:Math.min(180,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:u,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:l||n.audioPreference,subtitlePreference:c||n.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(d.timelineOffset=t.timelineStart));const h=d.cmcd;h!=null&&h.sessionId&&h.contentId&&(d.cmcd=ze({},h,{contentId:zn(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const p=new kP(this.HlsPlayerClass,d,e,t);this.playerQueue.push(p),e.assetList[i]=t;let g=!0;const m=w=>{if(w.live){var T;const M=new Error(`Interstitials MUST be VOD assets ${e}`),_={fatal:!0,type:fe.OTHER_ERROR,details:V.INTERSTITIAL_ASSET_ITEM_ERROR,error:M},C=((T=this.schedule)==null?void 0:T.findEventIndex(e.identifier))||-1;this.handleAssetItemError(_,e,C,i,M.message);return}const $=w.edge-w.fragmentStart,k=t.duration;(g||k===null||$>k)&&(g=!1,this.log(`Interstitial asset "${f}" duration change ${k} > ${$}`),t.duration=$,this.updateSchedule())};p.on(b.LEVEL_UPDATED,(w,{details:T})=>m(T)),p.on(b.LEVEL_PTS_UPDATED,(w,{details:T})=>m(T)),p.on(b.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const v=(w,T)=>{const $=this.getAssetPlayer(f);if($&&T.tracks){$.off(b.BUFFER_CODECS,v),$.tracks=T.tracks;const k=this.primaryMedia;this.bufferingAsset===$.assetItem&&k&&!$.media&&this.bufferAssetPlayer($,k)}};p.on(b.BUFFER_CODECS,v);const y=()=>{var w;const T=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${T}`),!T||!this.schedule)return;const $=this.schedule.findEventIndex(e.identifier),k=(w=this.schedule.items)==null?void 0:w[$];this.isInterstitial(k)&&this.advanceAssetBuffering(k,t)};p.on(b.BUFFERED_TO_END,y);const E=w=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;const $=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,$,w)};return p.once(b.MEDIA_ENDED,E(i)),p.once(b.PLAYOUT_LIMIT_REACHED,E(1/0)),p.on(b.ERROR,(w,T)=>{if(!this.schedule)return;const $=this.getAssetPlayer(f);if(T.details===V.BUFFER_STALLED_ERROR){if($!=null&&$.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(T,e,this.schedule.findEventIndex(e.identifier),i,`Asset player error ${T.error} ${e}`)}),p.on(b.DESTROYING,()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;const T=new Error(`Asset player destroyed unexpectedly ${f}`),$={fatal:!0,type:fe.OTHER_ERROR,details:V.INTERSTITIAL_ASSET_ITEM_ERROR,error:T};this.handleAssetItemError($,e,this.schedule.findEventIndex(e.identifier),i,T.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Yr(t)}`),this.hls.trigger(b.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:i,event:e,player:p}),p}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(i=>{this.clearAssetPlayer(i.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const i=this.playerQueue[t];this.transferMediaFromPlayer(i,null),i.resetDetails()}}clearAssetPlayer(e,t){const i=this.getAssetPlayerQueueIndex(e);if(i!==-1){const r=this.playerQueue[i];this.log(`clear ${r} toSegment: ${t&&Ts(t)}`),this.transferMediaFromPlayer(r,t),this.playerQueue.splice(i,1),r.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,i,r,n){const{interstitial:a,assetItem:o,assetId:l}=e,c=a.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!u||u.identifier!==l)&&(u&&(this.clearAssetPlayer(u.identifier,i[r]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${c} ${Yr(o)}`),this.hls.trigger(b.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:a,schedule:i.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,n)}bufferAssetPlayer(e,t){var i,r;if(!this.schedule)return;const{interstitial:n,assetItem:a}=e,o=this.schedule.findEventIndex(n.identifier),l=(i=this.schedule.items)==null?void 0:i[o];if(!l)return;e.loadSource(),this.setBufferingItem(l),this.bufferingAsset=a;const c=this.getBufferingPlayer();if(c===e)return;const u=n.appendInPlace;if(u&&(c==null?void 0:c.interstitial.appendInPlace)===!1)return;const f=(c==null?void 0:c.tracks)||((r=this.detachedData)==null?void 0:r.tracks)||this.requiredTracks;if(u&&a!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(f&&!Ib(f,e.tracks)){const d=new Error(`Asset ${Yr(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(f)}')`),h={fatal:!0,type:fe.OTHER_ERROR,details:V.INTERSTITIAL_ASSET_ITEM_ERROR,error:d},p=n.findAssetIndex(a);this.handleAssetItemError(h,n,o,p,d.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,i=this.primaryMedia;if(!t||!i)return;const r=i.currentTime,n=t.findAssetIndex(e,r),a=e.assetList[n];if(a){const o=this.getAssetPlayer(a.identifier);if(o){const l=o.currentTime||r-a.timelineStart,c=o.duration-l;if(this.warn(`Stalled at ${l} of ${l+c} in ${o} ${e} (media.currentTime: ${r})`),l&&(c/i.playbackRate<.5||o.bufferedInPlaceToEnd(i))&&o.hls){const u=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,u,n)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,i,r,n){if(e.details===V.BUFFER_STALLED_ERROR)return;const a=t.assetList[r]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${a&&Yr(a)} ${e.error}`),!this.schedule)return;const o=(a==null?void 0:a.identifier)||"",l=this.getAssetPlayerQueueIndex(o),c=this.playerQueue[l]||null,u=this.schedule.items,f=ze({},e,{fatal:!1,errorAction:Jr(!0),asset:a,assetListIndex:r,event:t,schedule:u,scheduleIndex:i,player:c});if(this.hls.trigger(b.INTERSTITIAL_ASSET_ERROR,f),!e.fatal)return;const d=this.playingAsset,h=this.bufferingAsset,p=new Error(n);if(a&&(this.clearAssetPlayer(o,null),a.error=p),!t.assetList.some(g=>!g.error))t.error=p;else for(let g=r;g<t.assetList.length;g++)this.resetAssetPlayer(t.assetList[g].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):d&&d.identifier===o?this.advanceAfterAssetEnded(t,i,r):h&&h.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,h)}primaryFallback(e){const t=e.timelineStart,i=this.effectivePlayingItem;let r=this.timelinePos;if(i){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${r} playing: ${Ts(i)} error: ${e.error}`),r===-1&&(r=this.hls.startPosition);const a=this.updateItem(i,r);this.itemsMatch(i,a)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(r===-1){this.checkStart();return}if(!this.schedule)return;const n=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(n)}onAssetListLoaded(e,t){var i,r;const n=t.event,a=n.identifier,o=t.assetListResponse.ASSETS;if(!((i=this.schedule)!=null&&i.hasEvent(a)))return;const l=n.timelineStart,c=n.duration;let u=0;o.forEach((g,m)=>{const v=parseFloat(g.DURATION);this.createAsset(n,m,u,l+u,v,g.URI),u+=v}),n.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${n}`);const f=this.waitingItem,d=(f==null?void 0:f.event.identifier)===a;this.updateSchedule();const h=(r=this.bufferingItem)==null?void 0:r.event;if(d){var p;const g=this.schedule.findEventIndex(a),m=(p=this.schedule.items)==null?void 0:p[g];if(m){if(!this.playingItem&&this.timelinePos>m.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==g){n.error=new Error(`Interstitial ${o.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${n}`),this.log(n.error.message),this.updateSchedule(!0),this.primaryFallback(n);return}this.setBufferingItem(m)}this.setSchedulePosition(g)}else if((h==null?void 0:h.identifier)===a){const g=n.assetList[0];if(g){const m=this.getAssetPlayer(g.identifier);if(h.appendInPlace){const v=this.primaryMedia;m&&v&&this.bufferAssetPlayer(m,v)}else m&&m.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case V.ASSET_LIST_PARSING_ERROR:case V.ASSET_LIST_LOAD_ERROR:case V.ASSET_LIST_LOAD_TIMEOUT:{const i=t.interstitial;i&&(this.updateSchedule(!0),this.primaryFallback(i));break}case V.BUFFER_STALLED_ERROR:{const i=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&i.event.appendInPlace){this.handleInPlaceStall(i.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const r0=500;class NP extends fh{constructor(e,t,i){super(e,t,i,"subtitle-stream-controller",ce.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(b.LEVEL_LOADED,this.onLevelLoaded,this),e.on(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(b.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(b.LEVEL_LOADED,this.onLevelLoaded,this),e.off(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(b.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(b.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(b.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=q.IDLE,this.setInterval(r0),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:r}=t;if(this.fragContextChanged(i)||(ht(i)&&(this.fragPrevious=i),this.state=q.IDLE),!r)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let a;const o=i.start;for(let c=0;c<n.length;c++)if(o>=n[c].start&&o<=n[c].end){a=n[c];break}const l=i.start+i.duration;a?a.end=l:(a={start:o,end:l},n.push(a)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:i,endOffset:r}=t;if(i===0&&r!==Number.POSITIVE_INFINITY){const n=r-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(a=>{for(let o=0;o<a.length;){if(a[o].end<=n){a.shift();continue}else if(a[o].start<n)a[o].start=n;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(i,n,ce.SUBTITLE)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===ce.SUBTITLE&&(t.details===V.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==q.STOPPED&&(this.state=q.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&kS(this.levels,t)){this.levels=t.map(i=>new ua(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const r=new ua(i);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ce.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var i;if(this.currentTrackId=t.id,!((i=this.levels)!=null&&i.length)||this.currentTrackId===-1){this.clearInterval();return}const r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==q.STOPPED&&this.setInterval(r0)}onSubtitleTrackLoaded(e,t){var i;const{currentTrackId:r,levels:n}=this,{details:a,id:o}=t;if(!n){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=n[o];if(o>=n.length||!l)return;this.log(`Subtitle track ${o} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(a.live||(i=l.details)!=null&&i.live){if(a.deltaUpdateFailed)return;const f=this.mainDetails;if(!f){this.startFragRequested=!1;return}const d=f.fragments[0];if(!l.details)a.hasProgramDateTime&&f.hasProgramDateTime?(Tl(a,f),c=a.fragmentStart):d&&(c=d.start,Bf(a,c));else{var u;c=this.alignPlaylists(a,l.details,(u=this.levelLastLoaded)==null?void 0:u.details),c===0&&d&&(c=d.start,Bf(a,c))}f&&!this.startFragRequested&&this.setStartPosition(f,c)}l.details=a,this.levelLastLoaded=l,o===r&&(this.hls.trigger(b.SUBTITLE_TRACK_UPDATED,{details:a,id:o,groupId:t.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===q.IDLE&&(_r(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,r=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&r!=null&&r.key&&r.iv&&Zr(r.method)){const a=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer,ch(r.method)).catch(o=>{throw n.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();n.trigger(b.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:a,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=q.IDLE})}}doTick(){if(!this.media){this.state=q.IDLE;return}if(this.state===q.IDLE){const{currentTrackId:e,levels:t}=this,i=t==null?void 0:t[e];if(!i||!t.length||!i.details||this.waitForLive(i))return;const{config:r}=this,n=this.getLoadPosition(),a=be.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,r.maxBufferHole),{end:o,len:l}=a,c=i.details,u=this.hls.maxBufferLength+c.levelTargetDuration;if(l>u)return;const f=c.fragments,d=f.length,h=c.edge;let p=null;const g=this.fragPrevious;if(o<h){const y=r.maxFragLookUpTolerance,E=o>h-y?0:y;p=_r(g,f,Math.max(f[0].start,o),E),!p&&g&&g.start<f[0].start&&(p=f[0])}else p=f[d-1];if(p=this.filterReplacedPrimary(p,i.details),!p)return;const m=p.sn-c.startSN,v=f[m-1];if(v&&v.cc===p.cc&&this.fragmentTracker.getState(v)===vt.NOT_LOADED&&(p=v),this.fragmentTracker.getState(p)===vt.NOT_LOADED){const y=this.mapToInitFragWhenRequired(p);y&&this.loadFragment(y,i,o)}}}loadFragment(e,t,i){ht(e)?super.loadFragment(e,t,i):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new FP(this.tracksBuffered[this.currentTrackId]||[])}}class FP{constructor(e){this.buffered=void 0;const t=(i,r,n)=>{if(r=r>>>0,r>n-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${n})`);return e[r][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}const $P={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},zS=s=>String.fromCharCode($P[s]||s),Cs=15,li=100,BP={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},UP={17:2,18:4,21:6,22:8,23:10,19:13,20:15},GP={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},HP={25:2,26:4,29:6,30:8,31:10,27:13,28:15},YP=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class jP{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;We.log(`${this.time} [${e}] ${i}`)}}}const ar=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class QS{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class VP{constructor(){this.uchar=" ",this.penState=new QS}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class KP{constructor(e){this.chars=[],this.pos=0,this.currPenState=new QS,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<li;t++)this.chars.push(new VP);this.logger=e}equals(e){for(let t=0;t<li;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<li;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<li;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>li&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=li)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=zS(e);if(this.pos>=li){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<li;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<li;i++){const r=this.chars[i].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ru{constructor(e){this.rows=[],this.currRow=Cs-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Cs;t++)this.rows.push(new KP(e));this.logger=e}reset(){for(let e=0;e<Cs;e++)this.rows[e].clear();this.currRow=Cs-1}equals(e){let t=!0;for(let i=0;i<Cs;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<Cs;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Cs;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+Xe(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<Cs;o++)this.rows[o].clear();const n=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){const o=a.rows[n].cueStartTime,l=this.logger.time;if(o!==null&&l!==null&&o<l)for(let c=0;c<this.nrRollUpRows;c++)this.rows[t-this.nrRollUpRows+c+1].copy(a.rows[n+c])}}this.currRow=t;const i=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,a=Math.max(n-1,0);i.setCursor(e.indent),e.color=i.chars[a].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+Xe(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",r=-1;for(let n=0;n<Cs;n++){const a=this.rows[n].getTextString();a&&(r=n+1,e?t.push("Row "+r+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(e?i="["+t.join(" | ")+"]":i=t.join(`
|
|
385
|
+
`)),i}getTextAndFormat(){return this.rows}}class n0{constructor(e,t,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ru(i),this.nonDisplayedMemory=new Ru(i),this.lastOutputScreen=new Ru(i),this.currRollUpRow=this.displayedMemory.rows[Cs-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Cs-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+Xe(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class a0{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=zP(),this.logger=void 0;const r=this.logger=new jP;this.channels=[null,new n0(e,t,r),new n0(e+1,i,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let i=0;i<t.length;i+=2){const r=t[i]&127,n=t[i+1]&127;let a=!1,o=null;if(r===0&&n===0)continue;this.logger.log(3,()=>"["+ar([t[i],t[i+1]])+"] -> ("+ar([r,n])+")");const l=this.cmdHistory;if(r>=16&&r<=31){if(WP(r,n,l)){co(null,null,l),this.logger.log(3,()=>"Repeated command ("+ar([r,n])+") is dropped");continue}co(r,n,this.cmdHistory),a=this.parseCmd(r,n),a||(a=this.parseMidrow(r,n)),a||(a=this.parsePAC(r,n)),a||(a=this.parseBackgroundAttributes(r,n))}else co(null,null,l);if(!a&&(o=this.parseChars(r,n),o)){const u=this.currentChannel;u&&u>0?this.channels[u].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!a&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+ar([r,n])+" orig: "+ar([t[i],t[i+1]]))}}parseCmd(e,t){const i=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(i||r))return!1;const n=e===20||e===21||e===23?1:2,a=this.channels[n];return e===20||e===21||e===28||e===29?t===32?a.ccRCL():t===33?a.ccBS():t===34?a.ccAOF():t===35?a.ccAON():t===36?a.ccDER():t===37?a.ccRU(2):t===38?a.ccRU(3):t===39?a.ccRU(4):t===40?a.ccFON():t===41?a.ccRDC():t===42?a.ccTR():t===43?a.ccRTD():t===44?a.ccEDM():t===45?a.ccCR():t===46?a.ccENM():t===47&&a.ccEOC():a.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+ar([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,n=(e===16||e===24)&&t>=64&&t<=95;if(!(r||n))return!1;const a=e<=23?1:2;t>=64&&t<=95?i=a===1?BP[e]:GP[e]:i=a===1?UP[e]:HP[e];const o=this.channels[a];return o?(o.setPAC(this.interpretPAC(i,t)),this.currentChannel=a,!0):!1}interpretPAC(e,t){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,r.underline=(i&1)===1,i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((i-16)/2)*4,r}parseChars(e,t){let i,r=null,n=null;if(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19){let a;n===17?a=t+80:n===18?a=t+112:a=t+144,this.logger.log(2,()=>"Special char '"+zS(a)+"' in channel "+i),r=[a]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+ar(r).join(",")),r}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(i||r))return!1;let n;const a={};e===16||e===24?(n=Math.floor((t-32)/2),a.background=YP[n],t%2===1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(a),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}co(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function co(s,e,t){t.a=s,t.b=e}function WP(s,e,t){return t.a===s&&t.b===e}function zP(){return{a:null,b:null}}var xh=function(){if(Al!=null&&Al.VTTCue)return self.VTTCue;const s=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function i(o){return t(s,o)}function r(o){return t(e,o)}function n(o,...l){let c=1;for(;c<arguments.length;c++){const u=arguments[c];for(const f in u)o[f]=u[f]}return o}function a(o,l,c){const u=this,f={enumerable:!0};u.hasBeenReset=!1;let d="",h=!1,p=o,g=l,m=c,v=null,y="",E=!0,w="auto",T="start",$=50,k="middle",M=50,_="middle";Object.defineProperty(u,"id",n({},f,{get:function(){return d},set:function(C){d=""+C}})),Object.defineProperty(u,"pauseOnExit",n({},f,{get:function(){return h},set:function(C){h=!!C}})),Object.defineProperty(u,"startTime",n({},f,{get:function(){return p},set:function(C){if(typeof C!="number")throw new TypeError("Start time must be set to a number.");p=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",n({},f,{get:function(){return g},set:function(C){if(typeof C!="number")throw new TypeError("End time must be set to a number.");g=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",n({},f,{get:function(){return m},set:function(C){m=""+C,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",n({},f,{get:function(){return v},set:function(C){v=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",n({},f,{get:function(){return y},set:function(C){const U=i(C);if(U===!1)throw new SyntaxError("An invalid or illegal string was specified.");y=U,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",n({},f,{get:function(){return E},set:function(C){E=!!C,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",n({},f,{get:function(){return w},set:function(C){if(typeof C!="number"&&C!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",n({},f,{get:function(){return T},set:function(C){const U=r(C);if(!U)throw new SyntaxError("An invalid or illegal string was specified.");T=U,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",n({},f,{get:function(){return $},set:function(C){if(C<0||C>100)throw new Error("Position must be between 0 and 100.");$=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",n({},f,{get:function(){return k},set:function(C){const U=r(C);if(!U)throw new SyntaxError("An invalid or illegal string was specified.");k=U,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",n({},f,{get:function(){return M},set:function(C){if(C<0||C>100)throw new Error("Size must be between 0 and 100.");M=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",n({},f,{get:function(){return _},set:function(C){const U=r(C);if(!U)throw new SyntaxError("An invalid or illegal string was specified.");_=U,this.hasBeenReset=!0}})),u.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class QP{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function qS(s){function e(i,r,n,a){return(i|0)*3600+(r|0)*60+(n|0)+parseFloat(a||0)}const t=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}let qP=class{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}};function XS(s,e,t,i){const r=i?s.split(i):[s];for(const n in r){if(typeof r[n]!="string")continue;const a=r[n].split(t);if(a.length!==2)continue;const o=a[0],l=a[1];e(o,l)}}const Wf=new xh(0,0,""),uo=Wf.align==="middle"?"middle":"center";function XP(s,e,t){const i=s;function r(){const o=qS(s);if(o===null)throw new Error("Malformed timestamp: "+i);return s=s.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){const c=new qP;XS(o,function(d,h){let p;switch(d){case"region":for(let g=t.length-1;g>=0;g--)if(t[g].id===h){c.set(d,t[g].region);break}break;case"vertical":c.alt(d,h,["rl","lr"]);break;case"line":p=h.split(","),c.integer(d,p[0]),c.percent(d,p[0])&&c.set("snapToLines",!1),c.alt(d,p[0],["auto"]),p.length===2&&c.alt("lineAlign",p[1],["start",uo,"end"]);break;case"position":p=h.split(","),c.percent(d,p[0]),p.length===2&&c.alt("positionAlign",p[1],["start",uo,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,h);break;case"align":c.alt(d,h,["start",uo,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let u=c.get("line","auto");u==="auto"&&Wf.line===-1&&(u=-1),l.line=u,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",uo);let f=c.get("position","auto");f==="auto"&&Wf.position===50&&(f=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=f}function a(){s=s.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),s.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);s=s.slice(3),a(),e.endTime=r(),a(),n(s,e)}function JS(s){return s.replace(/<br(?: \/)?>/gi,`
|
|
386
|
+
`)}class JP{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new QP,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function i(){let n=t.buffer,a=0;for(n=JS(n);a<n.length&&n[a]!=="\r"&&n[a]!==`
|
|
387
|
+
`;)++a;const o=n.slice(0,a);return n[a]==="\r"&&++a,n[a]===`
|
|
388
|
+
`&&++a,t.buffer=n.slice(a),o}function r(n){XS(n,function(a,o){},/:/)}try{let n="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;n=i();const o=n.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let a=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:n=i(),t.state){case"HEADER":/:/.test(n)?r(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new xh(0,0,""),t.state="CUE",n.indexOf("-->")===-1){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{XP(n,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=n.indexOf("-->")!==-1;if(!n||o&&(a=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
389
|
+
`),t.cue.text+=n}continue;case"BADCUE":n||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
390
|
+
|
|
391
|
+
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const ZP=/\r\n|\n\r|\n|\r/g,Du=function(e,t,i=0){return e.slice(i,i+t.length)===t},eO=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!re(t)||!re(i)||!re(r)||!re(n))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=60*1e3*r,t+=60*60*1e3*n,t};function Ah(s,e,t){return zn(s.toString())+zn(e.toString())+zn(t)}const tO=function(e,t,i){let r=e[t],n=e[r.prevCC];if(!n||!n.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(a=n)!=null&&a.new;){var a;e.ccOffset+=r.start-n.start,r.new=!1,r=n,n=e[r.prevCC]}e.presentationOffset=i};function sO(s,e,t,i,r,n,a){const o=new JP,l=os(new Uint8Array(s)).trim().replace(ZP,`
|
|
392
|
+
`).split(`
|
|
393
|
+
`),c=[],u=e?lk(e.baseTime,e.timescale):0;let f="00:00.000",d=0,h=0,p,g=!0;o.oncue=function(m){const v=t[i];let y=t.ccOffset;const E=(d-u)/9e4;if(v!=null&&v.new&&(h!==void 0?y=t.ccOffset=v.start:tO(t,i,E)),E){if(!e){p=new Error("Missing initPTS for VTT MPEGTS");return}y=E-t.presentationOffset}const w=m.endTime-m.startTime,T=rs((m.startTime+y-h)*9e4,r*9e4)/9e4;m.startTime=Math.max(T,0),m.endTime=Math.max(T+w,0);const $=m.text.trim();m.text=decodeURIComponent(encodeURIComponent($)),m.id||(m.id=Ah(m.startTime,m.endTime,$)),m.endTime>0&&c.push(m)},o.onparsingerror=function(m){p=m},o.onflush=function(){if(p){a(p);return}n(c)},l.forEach(m=>{if(g)if(Du(m,"X-TIMESTAMP-MAP=")){g=!1,m.slice(16).split(",").forEach(v=>{Du(v,"LOCAL:")?f=v.slice(6):Du(v,"MPEGTS:")&&(d=parseInt(v.slice(7)))});try{h=eO(f)/1e3}catch(v){p=v}return}else m===""&&(g=!1);o.parse(m+`
|
|
394
|
+
`)}),o.flush()}const ku="stpp.ttml.im1t",ZS=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,eE=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,iO={left:"start",center:"center",right:"end",start:"start",end:"end"};function o0(s,e,t,i){const r=Ie(new Uint8Array(s),["mdat"]);if(r.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const n=r.map(o=>os(o)),a=ok(e.baseTime,1,e.timescale);try{n.forEach(o=>t(rO(o,a)))}catch(o){i(o)}}function rO(s,e){const r=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((f,d)=>(f[d]=r.getAttribute(`ttp:${d}`)||n[d],f),{}),o=r.getAttribute("xml:space")!=="preserve",l=l0(Pu(r,"styling","style")),c=l0(Pu(r,"layout","region")),u=Pu(r,"body","[begin]");return[].map.call(u,f=>{const d=tE(f,o);if(!d||!f.hasAttribute("begin"))return null;const h=Mu(f.getAttribute("begin"),a),p=Mu(f.getAttribute("dur"),a);let g=Mu(f.getAttribute("end"),a);if(h===null)throw c0(f);if(g===null){if(p===null)throw c0(f);g=h+p}const m=new xh(h-e,g-e,d);m.id=Ah(m.startTime,m.endTime,m.text);const v=c[f.getAttribute("region")],y=l[f.getAttribute("style")],E=nO(v,y,l),{textAlign:w}=E;if(w){const T=iO[w];T&&(m.lineAlign=T),m.align=w}return ze(m,E),m}).filter(f=>f!==null)}function Pu(s,e,t){const i=s.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function l0(s){return s.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function tE(s,e){return[].slice.call(s.childNodes).reduce((t,i,r)=>{var n;return i.nodeName==="br"&&r?t+`
|
|
395
|
+
`:(n=i.childNodes)!=null&&n.length?tE(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function nO(s,e,t){const i="http://www.w3.org/ns/ttml#styling";let r=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=s!=null&&s.hasAttribute("style")?s.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(r=t[a]),n.reduce((o,l)=>{const c=Ou(e,i,l)||Ou(s,i,l)||Ou(r,i,l);return c&&(o[l]=c),o},{})}function Ou(s,e,t){return s&&s.hasAttributeNS(e,t)?s.getAttributeNS(e,t):null}function c0(s){return new Error(`Could not parse ttml timestamp ${s}`)}function Mu(s,e){if(!s)return null;let t=qS(s);return t===null&&(ZS.test(s)?t=aO(s,e):eE.test(s)&&(t=oO(s,e))),t}function aO(s,e){const t=ZS.exec(s),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function oO(s,e){const t=eE.exec(s),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class fo{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class lO{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f0(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(b.FRAG_LOADING,this.onFragLoading,this),e.on(b.FRAG_LOADED,this.onFragLoaded,this),e.on(b.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(b.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(b.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(b.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(b.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(b.FRAG_LOADING,this.onFragLoading,this),e.off(b.FRAG_LOADED,this.onFragLoaded,this),e.off(b.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(b.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(b.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(b.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new fo(this,"textTrack1"),t=new fo(this,"textTrack2"),i=new fo(this,"textTrack3"),r=new fo(this,"textTrack4");this.cea608Parser1=new a0(1,e,t),this.cea608Parser2=new a0(3,i,r)}addCues(e,t,i,r,n){let a=!1;for(let o=n.length;o--;){const l=n[o],c=cO(l[0],l[1],t,i);if(c>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],i),a=!0,c/(i-t)>.5))return}if(a||n.push([t,i]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,i,r)}else{const o=this.Cues.newCue(null,t,i,r);this.hls.trigger(b.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n,trackId:a}){const{unparsedVttFrags:o}=this;i===ce.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:n,trackId:a}),o.length&&(this.unparsedVttFrags=[],o.forEach(l=>{this.initPTS[l.frag.cc]?this.onFragLoaded(b.FRAG_LOADED,l):this.hls.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:i}=this;if(i)for(let r=0;r<i.textTracks.length;r++){const n=i.textTracks[r];if(u0(n,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:r}=this,{label:n,languageCode:a}=t[e],o=this.getExistingTrack(n,a);if(o)i[e]=o,zr(i[e]),VS(i[e],r);else{const l=this.createTextTrack("captions",n,a);l&&(l[e]=!0,i[e]=l)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,r={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(b.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,i){const r=this.media;if(r)return r.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const i=!!t.transferMedia;if(this.media=null,i)return;const{captionsTracks:r}=this;Object.keys(r).forEach(n=>{zr(r[n]),delete r[n]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f0(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let i=0;i<t.length;i++)zr(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],r=i.some(n=>n.textCodec===ku);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(kS(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const a=this.media,o=a?$o(a.textTracks):null;if(this.tracks.forEach((l,c)=>{let u;if(o){let f=null;for(let d=0;d<o.length;d++)if(o[d]&&u0(o[d],l)){f=o[d],o[d]=null;break}f&&(u=f)}if(u)zr(u);else{const f=sE(l);u=this.createTextTrack(f,l.name,l.lang),u&&(u.mode="disabled")}u&&this.textTracks.push(u)}),o!=null&&o.length){const l=o.filter(c=>c!==null).map(c=>c.label);l.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const a=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(b.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const r=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!r)return;const n=`textTrack${r[1]}`,a=this.captionsProperties[n];a&&(a.label=i.name,i.lang&&(a.languageCode=i.lang),a.media=i)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ce.MAIN){var i,r;const{cea608Parser1:n,cea608Parser2:a,lastSn:o}=this,{cc:l,sn:c}=t.frag,u=(i=(r=t.part)==null?void 0:r.index)!=null?i:-1;n&&a&&(c!==o+1||c===o&&u!==this.lastPartIndex+1||l!==this.lastCc)&&(n.reset(),a.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=u}}onFragLoaded(e,t){const{frag:i,payload:r}=t;if(i.type===ce.SUBTITLE)if(r.byteLength){const n=i.decryptdata,a="stats"in t;if(n==null||!n.encrypted||a){const o=this.tracks[i.level],l=this.vttCCs;l[i.cc]||(l[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),o&&o.textCodec===ku?this._parseIMSC1(i,r):this._parseVTTs(t)}}else this.hls.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;o0(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),i.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{i.logger.log(`Failed to parse IMSC1: ${r}`),i.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:i,payload:r}=e,{initPTS:n,unparsedVttFrags:a}=this,o=n.length-1;if(!n[i.cc]&&o===-1){a.push(e);return}const l=this.hls,c=(t=i.initSegment)!=null&&t.data?bs(i.initSegment.data,new Uint8Array(r)).buffer:r;sO(c,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,u=>{this._appendCues(u,i.level),l.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},u=>{const f=u.message==="Missing initPTS for VTT MPEGTS";f?a.push(e):this._fallbackToIMSC1(i,r),l.logger.log(`Failed to parse VTT cue: ${u}`),!(f&&o>i.cc)&&l.trigger(b.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:u})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||o0(t,this.initPTS[e.cc],()=>{i.textCodec=ku,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(n=>KS(r,n))}else{const r=this.tracks[t];if(!r)return;const n=r.default?"default":"subtitles"+t;i.trigger(b.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===ce.SUBTITLE&&this.onFragLoaded(b.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:r}=t;if(!(i.type===ce.MAIN&&this.closedCaptionsForLevel(i)==="NONE"))for(let n=0;n<r.length;n++){const a=r[n].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(a);this.cea608Parser1.addData(r[n].pts,o[0]),this.cea608Parser2.addData(r[n].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:r,type:n}){const{media:a}=this;if(!(!a||a.currentTime<i)){if(!n||n==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(l=>Kf(o[l],t,i))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>Kf(o[l],t,r))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let r=2;for(let n=0;n<i;n++){const a=e[r++],o=127&e[r++],l=127&e[r++];if(o===0&&l===0)continue;if((4&a)!==0){const u=3&a;(u===0||u===1)&&(t[u].push(o),t[u].push(l))}}return t}}function sE(s){return s.characteristics&&/transcribes-spoken-dialog/gi.test(s.characteristics)&&/describes-music-and-sound/gi.test(s.characteristics)?"captions":"subtitles"}function u0(s,e){return!!s&&s.kind===sE(e)&&Hf(e,s)}function cO(s,e,t,i){return Math.min(e,i)-Math.max(s,t)}function f0(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const uO=/\s/,fO={newCue(s,e,t,i){const r=[];let n,a,o,l,c;const u=self.VTTCue||self.TextTrackCue;for(let d=0;d<i.rows.length;d++)if(n=i.rows[d],o=!0,l=0,c="",!n.isEmpty()){var f;for(let g=0;g<n.chars.length;g++)uO.test(n.chars[g].uchar)&&o?l++:(c+=n.chars[g].uchar,o=!1);n.cueStartTime=e,e===t&&(t+=1e-4),l>=16?l--:l++;const h=JS(c.trim()),p=Ah(e,t,h);s!=null&&(f=s.cues)!=null&&f.getCueById(p)||(a=new u(e,t,h),a.id=p,a.line=d+1,a.align="left",a.position=10+Math.min(80,Math.floor(l*8/32)*10),r.push(a))}return s&&r.length&&(r.sort((d,h)=>d.line==="auto"||h.line==="auto"?0:d.line>8&&h.line>8?h.line-d.line:d.line-h.line),r.forEach(d=>KS(s,d))),r}};function dO(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const hO=/(\d+)-(\d+)\/(\d+)/;class d0{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||vO,this.controller=new self.AbortController,this.stats=new sh}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const n=pO(e,this.controller.signal),a=e.responseType==="arraybuffer",o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=l&&re(l)?l:c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(ha(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(f=>{var d;this.response=this.loader=f;const h=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},c-(h-r.loading.start)),!f.ok){const{status:g,statusText:m}=f;throw new yO(m||"fetch, bad network response",g,f)}r.loading.first=h,r.total=gO(f.headers)||r.total;const p=(d=this.callbacks)==null?void 0:d.onProgress;return p&&re(t.highWaterMark)?this.loadProgressively(f,r,e,t.highWaterMark,p):a?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{var d,h;const p=this.response;if(!p)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const g=f[o];g&&(r.loaded=r.total=g);const m={url:p.url,data:f,code:p.status},v=(d=this.callbacks)==null?void 0:d.onProgress;v&&!re(t.highWaterMark)&&v(r,e,f,p),(h=this.callbacks)==null||h.onSuccess(m,r,e,p)}).catch(f=>{var d;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const h=f&&f.code||0,p=f?f.message:null;(d=this.callbacks)==null||d.onError({code:h,text:p},e,f?f.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,r=0,n){const a=new dS,o=e.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return a.dataLength&&n(t,i,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const u=c.value,f=u.length;return t.loaded+=f,f<r||a.dataLength?(a.push(u),a.dataLength>=r&&n(t,i,a.flush().buffer,e)):n(t,i,u.buffer,e),l()}).catch(()=>Promise.reject());return l()}}function pO(s,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(ze({},s.headers))};return s.rangeEnd&&t.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),t}function mO(s){const e=hO.exec(s);if(e)return parseInt(e[2])-parseInt(e[1])+1}function gO(s){const e=s.get("Content-Range");if(e){const i=mO(e);if(re(i))return i}const t=s.get("Content-Length");if(t)return parseInt(t)}function vO(s,e){return new self.Request(s.url,e)}class yO extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const bO=/^age:\s*[\d.]+\s*$/im;class iE{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new sh,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!(this.loader!==i||this.stats.aborted))return n(i,t.url)}).catch(a=>{if(!(this.loader!==i||this.stats.aborted))return i.open("GET",t.url,!0),n(i,t.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(a=>{var o;(o=this.callbacks)==null||o.onError({code:i.status,text:a.message},t,i,r)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:a}=i.loadPolicy;if(r)for(const o in r)e.setRequestHeader(o,r[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&re(n)?n:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const r=t.readyState,n=this.config;if(!i.aborted&&r>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const c=t.status,u=t.responseType==="text"?t.responseText:null;if(c>=200&&c<300){const p=u??t.response;if(p!=null){var a,o;i.loading.end=Math.max(self.performance.now(),i.loading.first);const g=t.responseType==="arraybuffer"?p.byteLength:p.length;i.loaded=i.total=g,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first);const m=(a=this.callbacks)==null?void 0:a.onProgress;m&&m(i,e,p,t);const v={url:t.responseURL,data:p,code:c};(o=this.callbacks)==null||o.onSuccess(v,i,e,t);return}}const f=n.loadPolicy.errorRetry,d=i.retry,h={url:e.url,data:void 0,code:c};if(_l(f,d,!1,h))this.retry(f);else{var l;We.error(`${c} while loading ${e.url}`),(l=this.callbacks)==null||l.onError({code:c,text:t.statusText},e,t,i)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(_l(e,t,!0))this.retry(e);else{var i;We.warn(`timeout while loading ${(i=this.context)==null?void 0:i.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=ah(e,i.retry),i.retry++,We.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&bO.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const SO={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},EO=Ke(Ke({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:iE,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:PD,bufferController:xk,capLevelController:Sh,errorController:$D,fpsController:AP,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:tS,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:SO},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},_O()),{},{subtitleStreamController:NP,subtitleTrackController:CP,timelineController:lO,audioStreamController:bk,audioTrackController:Sk,emeController:en,cmcdController:SP,contentSteeringController:_P,interstitialsController:MP});function _O(){return{cueHandler:fO,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function xO(s,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=zf(s),r=["manifest","level","frag"],n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return r.forEach(a=>{const o=`${a==="level"?"playlist":a}LoadPolicy`,l=e[o]===void 0,c=[];n.forEach(u=>{const f=`${a}Loading${u}`,d=e[f];if(d!==void 0&&l){c.push(f);const h=i[o].default;switch(e[o]={default:h},u){case"TimeOut":h.maxLoadTimeMs=d,h.maxTimeToFirstByteMs=d;break;case"MaxRetry":h.errorRetry.maxNumRetry=d,h.timeoutRetry.maxNumRetry=d;break;case"RetryDelay":h.errorRetry.retryDelayMs=d,h.timeoutRetry.retryDelayMs=d;break;case"MaxRetryTimeout":h.errorRetry.maxRetryDelayMs=d,h.timeoutRetry.maxRetryDelayMs=d;break}}}),c.length&&t.warn(`hls.js config: "${c.join('", "')}" setting(s) are deprecated, use "${o}": ${Xe(e[o])}`)}),Ke(Ke({},i),e)}function zf(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(zf):Object.keys(s).reduce((e,t)=>(e[t]=zf(s[t]),e),{}):s}function AO(s,e){const t=s.loader;t!==d0&&t!==iE?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):dO()&&(s.loader=d0,s.progressive=!0,s.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Bo=2,TO=.1,wO=.05,CO=100;class LO extends qb{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var i;(i=this.media)!=null&&i.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var i;this.ended=((i=this.media)==null?void 0:i.currentTime)||1,this.hls.trigger(b.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(CO),this.mediaSource=t.mediaSource;const i=this.media=t.media;$t(i,"playing",this.onMediaPlaying),$t(i,"waiting",this.onMediaWaiting),$t(i,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:i}=this;i&&(zt(i,"playing",this.onMediaPlaying),zt(i,"waiting",this.onMediaWaiting),zt(i,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var i,r;const n=(i=this.hls)==null?void 0:i.config;if(!n)return;const a=this.media;if(!a)return;const{seeking:o}=a,l=this.seeking&&!o,c=!this.seeking&&o,u=a.paused&&!o||a.ended||a.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!u&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(c||l){l&&this.stallResolved(e);return}if(u){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(b.MEDIA_ENDED,{stalled:!1}));return}if(!be.getBuffered(a).length){this.nudgeRetry=0;return}const f=be.bufferInfo(a,e,0),d=f.nextStart||0,h=this.fragmentTracker;if(o&&h&&this.hls){const $=h0(this.hls.inFlightFragments,e),k=f.len>Bo,M=!d||$||d-e>Bo&&!h.getPartialFragment(e);if(k||M)return;this.moved=!1}const p=(r=this.hls)==null?void 0:r.latestLevelDetails;if(!this.moved&&this.stalled!==null&&h){if(!(f.len>0)&&!d)return;const k=Math.max(d,f.start||0)-e,_=!!(p!=null&&p.live)?p.targetduration*2:Bo,C=ho(e,h);if(k>0&&(k<=_||C)){a.paused||this._trySkipBufferHole(C);return}}const g=n.detectStallWithCurrentTimeMs,m=self.performance.now(),v=this.waiting;let y=this.stalled;if(y===null)if(v>0&&m-v<g)y=this.stalled=v;else{this.stalled=m;return}const E=m-y;if(!o&&(E>=g||v)&&this.hls){var w;if(((w=this.mediaSource)==null?void 0:w.readyState)==="ended"&&!(p!=null&&p.live)&&Math.abs(e-((p==null?void 0:p.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(b.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(f),!this.media||!this.hls)return}const T=be.bufferInfo(a,e,n.maxBufferHole);this._tryFixBufferStall(T,E,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(b.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var i;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(i=this.buffered.audio)!=null&&i.length&&r&&r.length>1&&e>r.end(0)){const n=be.bufferedInfo(be.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const a=be.timeRangesToArray(r),o=be.bufferedInfo(a,t,0).bufferedIndex;if(o>-1&&o<a.length-1){const l=be.bufferedInfo(a,e,0).bufferedIndex,c=a[o].end,u=a[o+1].start;if((l===-1||l>o)&&u-c<1&&e-c<2){const f=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${c} -> ${u} buffered index: ${l}`);this.warn(f.message),this.media.currentTime+=1e-6;let d=ho(e,this.fragmentTracker);d&&"fragment"in d?d=d.fragment:d||(d=void 0);const h=be.bufferInfo(this.media,e,0);this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:d,buffer:h.len,bufferInfo:h})}}}}}_tryFixBufferStall(e,t,i){var r,n;const{fragmentTracker:a,media:o}=this,l=(r=this.hls)==null?void 0:r.config;if(!o||!a||!l)return;const c=(n=this.hls)==null?void 0:n.latestLevelDetails,u=ho(i,a);if((u||c!=null&&c.live&&i<c.fragmentStart)&&(this._trySkipBufferHole(u)||!this.media))return;const f=e.buffered,d=this.adjacentTraversal(e,i);(f&&f.length>1&&e.len>l.maxBufferHole||e.nextStart&&(e.nextStart-i<l.maxBufferHole||d))&&(t>l.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const i=this.fragmentTracker,r=e.nextStart;if(i&&r){const n=i.getFragAtPos(t,ce.MAIN),a=i.getFragAtPos(r,ce.MAIN);if(n&&a)return a.sn-n.sn<2}return!1}_reportStall(e){const{hls:t,media:i,stallReported:r,stalled:n}=this;if(!r&&n!==null&&i&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${Xe(e)})`);this.warn(a.message),t.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:n}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:i,media:r}=this,n=(t=this.hls)==null?void 0:t.config;if(!r||!i||!n)return 0;const a=r.currentTime,o=be.bufferInfo(r,a,0),l=a<o.start?o.start:o.nextStart;if(l&&this.hls){const u=o.len<=n.maxBufferHole,f=o.len>0&&o.len<1&&r.readyState<3,d=l-a;if(d>0&&(u||f)){if(d>n.maxBufferHole){let p=!1;if(a===0){const g=i.getAppendedFrag(0,ce.MAIN);g&&l<g.end&&(p=!0)}if(!p&&e){var c;if(!((c=this.hls.loadLevelObj)!=null&&c.details)||h0(this.hls.inFlightFragments,l))return 0;let m=!1,v=e.end;for(;v<l;){const y=ho(v,i);if(y)v+=y.duration;else{m=!0;break}}if(m)return 0}}const h=Math.max(l+wO,a+TO);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${h}`),this.moved=!0,r.currentTime=h,!(e!=null&&e.gap)){const p=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${h}`),g={type:fe.MEDIA_ERROR,details:V.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:p,reason:p.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?g.part=e:g.frag=e),this.hls.trigger(b.ERROR,g)}return h}}return 0}_tryNudgeBuffer(e){const{hls:t,media:i,nudgeRetry:r}=this,n=t==null?void 0:t.config;if(!i||!n)return 0;const a=i.currentTime;if(this.nudgeRetry++,r<n.nudgeMaxRetry){const o=a+(r+1)*n.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${a} to ${o}`);this.warn(l.message),i.currentTime=o,t.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${a} after ${n.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function h0(s,e){const t=p0(s.main);if(t&&t.start<=e)return t;const i=p0(s.audio);return i&&i.start<=e?i:null}function p0(s){if(!s)return null;switch(s.state){case q.IDLE:case q.STOPPED:case q.ENDED:case q.ERROR:return null}return s.frag}function ho(s,e){return e.getAppendedFrag(s,ce.MAIN)||e.getPartialFragment(s)}const IO=.25;function Qf(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Nu(s,e,t,i,r){let n=new s(e,t,"");try{n.value=i,r&&(n.type=r)}catch{n=new s(e,t,Xe(r?Ke({type:r},i):i))}return n}const po=(()=>{const s=Qf();try{s&&new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class RO{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(b.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(b.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(b.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(b.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(b.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var i;this.media=t.media,((i=t.overrides)==null?void 0:i.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&zr(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if(i.kind==="metadata"&&i.label==="id3")return VS(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:i,enableID3MetadataCues:r}=this.hls.config;if(!i&&!r)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=Qf();if(a)for(let o=0;o<n.length;o++){const l=n[o].type;if(l===ns.emsg&&!i||!r)continue;const c=bS(n[o].data),u=n[o].pts;let f=u+n[o].duration;f>po&&(f=po),f-u<=0&&(f=u+IO);for(let h=0;h<c.length;h++){const p=c[h];if(!SS(p)){this.updateId3CueEnds(u,l);const g=Nu(a,u,f,p,l);g&&this.id3Track.addCue(g)}}}}updateId3CueEnds(e,t){var i;const r=(i=this.id3Track)==null?void 0:i.cues;if(r)for(let n=r.length;n--;){const a=r[n];a.type===t&&a.startTime<e&&a.endTime===po&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:r}){const{id3Track:n,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:l}}=a;if(n&&(o||l)){let c;r==="audio"?c=u=>u.type===ns.audioId3&&l:r==="video"?c=u=>u.type===ns.emsg&&o:c=u=>u.type===ns.audioId3&&l||u.type===ns.emsg&&o,Kf(n,t,i,c)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:i,timelineOffset:r,enableDateRangeMetadataCues:n,interstitialsController:a}=this.hls.config;if(!n)return;const o=Qf();if(i&&r&&!a){const{fragmentStart:g,fragmentEnd:m}=e;let v=this.assetCue;v?(v.startTime=g,v.endTime=m):o&&(v=this.assetCue=Nu(o,g,m,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),v&&(v.id=i,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(v),v.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:l}=this,{dateRanges:c}=e,u=Object.keys(c);let f=this.dateRangeCuesAppended;if(l&&t){var d;if((d=l.cues)!=null&&d.length){const g=Object.keys(f).filter(m=>!u.includes(m));for(let m=g.length;m--;){var h;const v=g[m],y=(h=f[v])==null?void 0:h.cues;delete f[v],y&&Object.keys(y).forEach(E=>{const w=y[E];if(w){w.removeEventListener("enter",this.onEventCueEnter);try{l.removeCue(w)}catch{}}})}}else f=this.dateRangeCuesAppended={}}const p=e.fragments[e.fragments.length-1];if(!(u.length===0||!re(p==null?void 0:p.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let g=0;g<u.length;g++){const m=u[g],v=c[m],y=v.startTime,E=f[m],w=(E==null?void 0:E.cues)||{};let T=(E==null?void 0:E.durationKnown)||!1,$=po;const{duration:k,endDate:M}=v;if(M&&k!==null)$=y+k,T=!0;else if(v.endOnNext&&!T){const C=u.reduce((U,L)=>{if(L!==v.id){const R=c[L];if(R.class===v.class&&R.startDate>v.startDate&&(!U||v.startDate<U.startDate))return R}return U},null);C&&($=C.startTime,T=!0)}const _=Object.keys(v.attr);for(let C=0;C<_.length;C++){const U=_[C];if(!XD(U))continue;const L=w[U];if(L)T&&!(E!=null&&E.durationKnown)?L.endTime=$:Math.abs(L.startTime-y)>.01&&(L.startTime=y,L.endTime=$);else if(o){let R=v.attr[U];JD(U)&&(R=Rb(R));const S=Nu(o,y,$,{key:U,data:R},ns.dateRange);S&&(S.id=m,this.id3Track.addCue(S),w[U]=S,a&&(U==="X-ASSET-LIST"||U==="X-ASSET-URL")&&S.addEventListener("enter",this.onEventCueEnter))}}f[m]={cues:w,dateRange:v,durationKnown:T}}}}}class DO{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;const r=this.computeLatency();if(r===null)return;this._latency=r;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:a}=this.config;if(!n||a===1||!i.live)return;const o=this.targetLatency;if(o===null)return;const l=r-o,c=Math.min(this.maxLatency,o+i.targetduration);if(l<c&&l>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,a)),d=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20,h=Math.min(f,Math.max(1,d));this.changeMediaPlaybackRate(t,h)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:i,targetduration:r}=e,{liveSyncDuration:n,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&i||t;(this._targetLatencyUpdated||l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=n!==void 0?n:a*r);const u=r;return c+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,u)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const i=this.levelDetails;if(i===null)return null;const r=i.edge,n=e-t-this.edgeStalled,a=r-i.totalduration,o=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,n),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(b.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(b.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(b.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var i;t.details===V.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(i=this.levelDetails)!=null&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var i,r;e.playbackRate!==t&&((i=this.hls)==null||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(r=this.targetLatency)==null?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class kO extends bh{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(b.LEVEL_LOADED,this.onLevelLoaded,this),e.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(b.FRAG_BUFFERED,this.onFragBuffered,this),e.on(b.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(b.LEVEL_LOADED,this.onLevelLoaded,this),e.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(b.FRAG_BUFFERED,this.onFragBuffered,this),e.off(b.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=this.hls.config.preferManagedMediaSource,r=[],n={},a={};let o=!1,l=!1,c=!1;t.levels.forEach(u=>{const f=u.attrs;let{audioCodec:d,videoCodec:h}=u;d&&(u.audioCodec=d=yl(d,i)||void 0),h&&(h=u.videoCodec=pD(h));const{width:p,height:g,unknownCodecs:m}=u,v=(m==null?void 0:m.length)||0;if(o||(o=!!(p&&g)),l||(l=!!h),c||(c=!!d),v||d&&!this.isAudioSupported(d)||h&&!this.isVideoSupported(h)){this.log(`Some or all CODECS not supported "${f.CODECS}"`);return}const{CODECS:y,"FRAME-RATE":E,"HDCP-LEVEL":w,"PATHWAY-ID":T,RESOLUTION:$,"VIDEO-RANGE":k}=f,_=`${`${T||"."}-`}${u.bitrate}-${$}-${E}-${y}-${k}-${w}`;if(n[_])if(n[_].uri!==u.url&&!u.attrs["PATHWAY-ID"]){const C=a[_]+=1;u.attrs["PATHWAY-ID"]=new Array(C+1).join(".");const U=this.createLevel(u);n[_]=U,r.push(U)}else n[_].addGroupId("audio",f.AUDIO),n[_].addGroupId("text",f.SUBTITLES);else{const C=this.createLevel(u);n[_]=C,a[_]=1,r.push(C)}}),this.filterAndSortMediaOptions(r,t,o,l,c)}createLevel(e){const t=new ua(e),i=e.supplemental;if(i!=null&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const r=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(r.message),t.supportedResult=Hb(r,[])}return t}isAudioSupported(e){return la(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return la(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,i,r,n){var a;let o=[],l=[],c=e;const u=((a=t.stats)==null?void 0:a.parsing)||{};if((i||r)&&n&&(c=c.filter(({videoCodec:y,videoRange:E,width:w,height:T})=>(!!y||!!(w&&T))&&AD(E))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let y="no level with compatible codecs found in manifest",E=y;t.levels.length&&(E=`one or more CODECS in variant not supported: ${Xe(t.levels.map(T=>T.attrs.CODECS).filter((T,$,k)=>k.indexOf(T)===$))}`,this.warn(E),y+=` (${E})`);const w=new Error(y);this.hls.trigger(b.ERROR,{type:fe.MEDIA_ERROR,details:V.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:w,reason:E})}}),u.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(y=>!y.audioCodec||this.isAudioSupported(y.audioCodec)),m0(o)),t.subtitles&&(l=t.subtitles,m0(l));const f=c.slice(0);c.sort((y,E)=>{if(y.attrs["HDCP-LEVEL"]!==E.attrs["HDCP-LEVEL"])return(y.attrs["HDCP-LEVEL"]||"")>(E.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&y.height!==E.height)return y.height-E.height;if(y.frameRate!==E.frameRate)return y.frameRate-E.frameRate;if(y.videoRange!==E.videoRange)return bl.indexOf(y.videoRange)-bl.indexOf(E.videoRange);if(y.videoCodec!==E.videoCodec){const w=ag(y.videoCodec),T=ag(E.videoCodec);if(w!==T)return T-w}if(y.uri===E.uri&&y.codecSet!==E.codecSet){const w=vl(y.codecSet),T=vl(E.codecSet);if(w!==T)return T-w}return y.averageBitrate!==E.averageBitrate?y.averageBitrate-E.averageBitrate:0});let d=f[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==f.length)){for(let y=0;y<f.length;y++)if(f[y].pathwayId===c[0].pathwayId){d=f[y];break}}this._levels=c;for(let y=0;y<c.length;y++)if(c[y]===d){var h;this._firstLevel=y;const E=d.bitrate,w=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${E}`),((h=this.hls.userConfig)==null?void 0:h.abrEwmaDefaultEstimate)===void 0){const T=Math.min(E,this.hls.config.abrEwmaDefaultEstimateMax);T>w&&w===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=T)}break}const p=n&&!r,g=this.hls.config,m=!!(g.audioStreamController&&g.audioTrackController),v={levels:c,audioTracks:o,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:r,altAudio:m&&!p&&o.some(y=>!!y.url)};u.end=performance.now(),this.hls.trigger(b.MANIFEST_PARSED,v)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const u=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:u,reason:u.message}),f)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,n=r?r.attrs["PATHWAY-ID"]:void 0,a=t[e],o=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,i===e&&r&&n===o)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${o?" with Pathway "+o:""} from level ${i}${n?" with Pathway "+n:""}`);const l={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(b.LEVEL_SWITCHING,l);const c=a.details;if(!c||c.live){const u=this.switchParams(a.uri,r==null?void 0:r.details,c);this.loadPlaylist(u)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),i=e.filter(r=>t.indexOf(r)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=i}}onError(e,t){t.fatal||!t.context||t.context.type===De.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ce.MAIN){const i=t.elementaryStreams;if(!Object.keys(i).some(n=>!!i[n]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var i;const{level:r,details:n}=t,a=t.levelInfo;if(!a){var o;this.warn(`Invalid level index ${r}`),(o=t.deliveryDirectives)!=null&&o.skip&&(n.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let l=a.details;l===t.details&&l.advanced&&(l=void 0),this.playlistLoaded(r,t,l)}else(i=t.deliveryDirectives)!=null&&i.skip&&(n.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,n=e.attrs["PATHWAY-ID"],a=e.details,o=a==null?void 0:a.age;this.log(`Loading level index ${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${n?" Pathway "+n:""}${o&&a.live?" age "+o.toFixed(1)+(a.type&&" "+a.type||""):""} ${i}`),this.hls.trigger(b.LEVEL_LOADING,{url:i,level:r,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const i=this._levels.filter((n,a)=>a!==e?!0:(this.steering&&this.steering.removeLevel(n),n===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,n.details&&n.details.fragments.forEach(o=>o.level=-1)),!1));cS(i),this._levels=i,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=i.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(b.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(b.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function m0(s){const e={};s.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function rE(){return self.SourceBuffer||self.WebKitSourceBuffer}function nE(){if(!Xi())return!1;const e=rE();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function PO(){if(!nE())return!1;const s=Xi();return typeof(s==null?void 0:s.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>s.isTypeSupported(ca(e,"video")))||["mp4a.40.2","fLaC"].some(e=>s.isTypeSupported(ca(e,"audio"))))}function OO(){var s;const e=rE();return typeof(e==null||(s=e.prototype)==null?void 0:s.changeType)=="function"}const MO=100;class NO extends fh{constructor(e,t,i){super(e,t,i,"stream-controller",ce.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const r=this.media,n=r?r.currentTime:null;if(n===null||!re(n)||(this.log(`Media seeked to ${n.toFixed(3)}`),!this.getBufferedFrag(n)))return;const a=this.getFwdBufferInfoAtPos(r,n,ce.MAIN,0);if(a===null||a.len===0){this.warn(`Main forward buffer length at ${n} on "seeked" event ${a?a.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(b.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.LEVEL_LOADED,this.onLevelLoaded,this),e.on(b.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(b.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(b.BUFFER_CREATED,this.onBufferCreated,this),e.on(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(b.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(b.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.LEVEL_LOADED,this.onLevelLoaded,this),e.off(b.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(b.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(b.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(b.BUFFER_CREATED,this.onBufferCreated,this),e.off(b.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(b.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:i,hls:r}=this;if(this.stopLoad(),this.setInterval(MO),this.level=-1,!this.startFragRequested){let n=r.startLevel;n===-1&&(r.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=r.firstAutoLevel),r.nextLoadLevel=n,this.level=r.loadLevel,this._hasEnoughToStart=!!t}i>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i),this.state=q.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=q.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case q.WAITING_LEVEL:{const{levels:e,level:t}=this,i=e==null?void 0:e[t],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=q.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=q.IDLE;break}break}case q.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===q.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const n=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(i!=null&&i[n]))return;const a=i[n],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const g={};this.altAudio===2&&(g.type="video"),this.hls.trigger(b.BUFFER_EOS,g),this.state=q.ENDED;return}if(!this.buffering)return;e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const c=a.details;if(!c||this.state===q.WAITING_LEVEL||this.waitForLive(a)){this.level=n,this.state=q.WAITING_LEVEL,this.startFragRequested=!1;return}const u=o.len,f=this.getMaxBufferLength(a.maxBitrate);if(u>=f)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let h=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&h&&ht(h)&&this.fragmentTracker.getState(h)!==vt.OK){var p;const m=((p=this.backtrackFragment)!=null?p:h).sn-c.startSN,v=c.fragments[m-1];v&&h.cc===v.cc&&(h=v,this.fragmentTracker.removeFragment(v))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const m=this.audioOnly&&!this.altAudio?qe.AUDIO:qe.VIDEO,v=(m===qe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;v&&this.afterBufferFlushed(v,m,ce.MAIN)}h=this.getNextFragmentLoopLoading(h,c,o,ce.MAIN,f)}h&&(h.initSegment&&!h.initSegment.data&&!this.bitrateTest&&(h=h.initSegment),this.loadFragment(h,a,d))}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);r===vt.NOT_LOADED||r===vt.PARTIAL?ht(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,i):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ce.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let i;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const n=this.getLevelDetails();if(n!=null&&n.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<n.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,l=e[o],c=this.fragLastKbps;c&&this.fragCurrent?i=this.fragCurrent.duration*l.maxBitrate/(1e3*c)+1:i=0}else i=0;const a=this.getBufferedFrag(t.currentTime+i);if(a){const o=this.followingBufferedFrag(a);if(o){this.abortCurrentFrag();const l=o.maxStartPTS?o.maxStartPTS:o.start,c=o.duration,u=Math.max(a.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,c*(this.couldBacktrack?.5:.125)),c*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case q.KEY_LOADING:case q.FRAG_LOADING:case q.FRAG_LOADING_WAITING_RETRY:case q.PARSING:case q.PARSED:this.state=q.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;$t(i,"playing",this.onMediaPlaying),$t(i,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:i}=this;i&&(zt(i,"playing",this.onMediaPlaying),zt(i,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(b.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let i=!1,r=!1;for(let n=0;n<t.levels.length;n++){const a=t.levels[n].audioCodec;a&&(i=i||a.indexOf("mp4a.40.2")!==-1,r=r||a.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=i&&r&&!OO(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==q.IDLE)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=q.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:r,startFragRequested:n}=this,a=t.level,o=t.details,l=o.totalduration;if(!r){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${l}`);const c=t.levelInfo,u=this.fragCurrent;u&&(this.state===q.FRAG_LOADING||this.state===q.FRAG_LOADING_WAITING_RETRY)&&u.level!==t.level&&u.loader&&this.abortCurrentFrag();let f=0;if(o.live||(i=c.details)!=null&&i.live){var d;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;f=this.alignPlaylists(o,c.details,(d=this.levelLastLoaded)==null?void 0:d.details)}if(c.details=o,this.levelLastLoaded=c,n||this.setStartPosition(o,f),this.hls.trigger(b.LEVEL_UPDATED,{details:o,level:a}),this.state===q.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=q.IDLE}n&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,n=this.getLoadPosition(),a=e.fragmentStart,o=e.edge,l=n>=a-t.maxFragLookUpTolerance&&n<=o;if(r!==null&&i.duration>r&&(n<r||!l)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!l&&i.readyState<4||n<o-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),i.readyState))if(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var c;const f=be.bufferInfo(i,r,0);if(!((c=f.buffered)!=null&&c.length)){i.currentTime=r;return}if(f.start<=n){i.currentTime=r;return}const{nextStart:h}=be.bufferedInfo(f.buffered,n,0);h&&(i.currentTime=h)}else i.currentTime=r}}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:r,payload:n}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const o=a[i.level];if(!o){this.warn(`Level ${i.level} not found on progress`);return}const l=o.details;if(!l){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const c=o.videoCodec,u=l.PTSKnown||!l.live,f=(t=i.initSegment)==null?void 0:t.data,d=this._getAudioCodec(o),h=this.transmuxer=this.transmuxer||new DS(this.hls,ce.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=r?r.index:-1,g=p!==-1,m=new lh(i.level,i.sn,i.stats.chunkCount,n.byteLength,p,g),v=this.initPTS[i.cc];h.push(n,f,d,c,i,r,l.totalduration,u,m,v)}onAudioTrackSwitching(e,t){const i=this.hls,r=this.altAudio!==0;if(Sl(t.url,i))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests(),this.fragmentTracker.removeFragment(a)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.altAudio=0,this.fragmentTracker.removeAllFragments(),i.once(b.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(b.AUDIO_TRACK_SWITCHED,t)}),i.trigger(b.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}i.trigger(b.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=Sl(t.url,this.hls);if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i?2:0,this.tick()}onBufferCreated(e,t){const i=t.tracks;let r,n,a=!1;for(const o in i){const l=i[o];if(l.id==="main"){if(n=o,r=l,o==="video"){const c=i[o];c&&(this.videoBuffer=c.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:r}=t,n=i.type===ce.MAIN;if(n){if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===q.PARSED&&(this.state=q.IDLE);return}const o=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),ht(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}const a=this.media;a&&(!this._hasEnoughToStart&&be.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),n&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var i;if(t.fatal){this.state=q.ERROR;return}switch(t.details){case V.FRAG_GAP:case V.FRAG_PARSING_ERROR:case V.FRAG_DECRYPT_ERROR:case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.MAIN,t);break;case V.LEVEL_LOAD_ERROR:case V.LEVEL_LOAD_TIMEOUT:case V.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===q.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===De.LEVEL&&(this.state=q.IDLE);break;case V.BUFFER_ADD_CODEC_ERROR:case V.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case V.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case V.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=q.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==qe.AUDIO||!this.altAudio){const i=(t===qe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;i&&(this.afterBufferFlushed(i,t,ce.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const r=this.timelineOffset;r&&i&&(i+=r);const n=this.getLevelDetails(),a=be.getBuffered(e),o=a.length?a.start(0):0,l=o-i,c=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||l>0&&(l<c||this.loadingParts&&l<2*((n==null?void 0:n.partTarget)||0)))&&(this.log(`adjusting start position by ${l} to match buffer start`),i+=l,this.startPosition=i),t<i&&(this.log(`seek to target start position ${i} from current time ${t} buffer start ${o}`),e.currentTime=i)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(i=>{const{hls:r}=this,n=i==null?void 0:i.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=q.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=n.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),r.trigger(b.FRAG_LOADED,i),n.bitrateTest=!1}).catch(i=>{this.state===q.STOPPED||this.state===q.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a){this.resetWhenMissingContext(n);return}const{frag:o,part:l,level:c}=a,{video:u,text:f,id3:d,initSegment:h}=r,{details:p}=c,g=this.altAudio?void 0:r.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=q.PARSING,h){const m=h.tracks;if(m){const w=o.initSegment||o;if(this.unhandledEncryptionError(h,o))return;this._bufferInitSegment(c,m,w,n),i.trigger(b.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:t,tracks:m})}const v=h.initPTS,y=h.timescale,E=this.initPTS[o.cc];if(re(v)&&(!E||E.baseTime!==v||E.timescale!==y)){const w=h.trackId;this.initPTS[o.cc]={baseTime:v,timescale:y,trackId:w},i.trigger(b.INIT_PTS_FOUND,{frag:o,id:t,initPTS:v,timescale:y,trackId:w})}}if(u&&p){g&&u.type==="audiovideo"&&this.logMuxedErr(o);const m=p.fragments[o.sn-1-p.startSN],v=o.sn===p.startSN,y=!m||o.cc>m.cc;if(r.independent!==!1){const{startPTS:E,endPTS:w,startDTS:T,endDTS:$}=u;if(l)l.elementaryStreams[u.type]={startPTS:E,endPTS:w,startDTS:T,endDTS:$};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!y&&(this.couldBacktrack=!0),u.dropped&&u.independent){const k=this.getMainFwdBufferInfo(),M=(k?k.end:this.getLoadPosition())+this.config.maxBufferHole,_=u.firstKeyFramePTS?u.firstKeyFramePTS:E;if(!v&&M<_-this.config.maxBufferHole&&!y){this.backtrack(o);return}else y&&(o.gap=!0);o.setElementaryStreamInfo(u.type,o.start,w,o.start,$,!0)}else v&&E-(p.appliedTimelineOffset||0)>Bo&&(o.gap=!0);o.setElementaryStreamInfo(u.type,E,w,T,$),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(u,o,l,n,v||y)}else if(v||y)o.gap=!0;else{this.backtrack(o);return}}if(g){const{startPTS:m,endPTS:v,startDTS:y,endDTS:E}=g;l&&(l.elementaryStreams[qe.AUDIO]={startPTS:m,endPTS:v,startDTS:y,endDTS:E}),o.setElementaryStreamInfo(qe.AUDIO,m,v,y,E),this.bufferFragmentData(g,o,l,n)}if(p&&d!=null&&d.samples.length){const m={id:t,frag:o,details:p,samples:d.samples};i.trigger(b.FRAG_PARSING_METADATA,m)}if(p&&f){const m={id:t,frag:o,details:p,samples:f.samples};i.trigger(b.FRAG_PARSING_USERDATA,m)}}logMuxedErr(e){this.warn(`${ht(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,i,r){if(this.state!==q.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(i));const{audio:n,video:a,audiovideo:o}=t;if(n){const c=e.audioCodec;let u=ko(n.codec,c);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const d=n.metadata;d&&"channelCount"in d&&(d.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),c&&c!==u&&this.log(`Swapping manifest audio codec "${c}" for "${u}"`),n.levelCodec=u,n.id=ce.MAIN,this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${u||""}/${c||""}/${n.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=ce.MAIN;const c=a.codec;if((c==null?void 0:c.length)===4)switch(c){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${c}]${a.codec!==c?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const l=Object.keys(t);if(l.length){if(this.hls.trigger(b.BUFFER_CODECS,t),!this.hls)return;l.forEach(c=>{const f=t[c].initSegment;f!=null&&f.byteLength&&this.hls.trigger(b.BUFFER_APPENDING,{type:c,data:f,frag:i,part:null,chunkMeta:r,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ce.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,i=e==null?void 0:e[t];return i?this.getMaxBufferLength(i.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=q.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(be.isBuffered(e,i)?t=this.getAppendedFrag(i):be.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,n=t.level;(!r||t.sn!==r.sn||r.level!==n)&&(this.fragPlaying=t,this.hls.trigger(b.FRAG_CHANGED,{frag:t}),(!r||r.level!==n)&&this.hls.trigger(b.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return re(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(re(t)){const i=this.getLevelDetails(),r=this.currentFrag||(i?_r(null,i.fragments,t):null);if(r){const n=r.programDateTime;if(n!==null){const a=n+(t-r.start)*1e3;return new Date(a)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class FO extends Es{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const i in this.keyIdToKeyInfo){const r=this.keyIdToKeyInfo[i].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=V.KEY_LOAD_ERROR,i,r,n){return new ui({type:fe.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:r})}loadClear(e,t,i){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,n=t.length;r<n;r++){const a=t[r];if(e.cc<=a.cc&&(!ht(e)||!ht(a)||e.sn<a.sn)||!i&&r==n-1)return this.emeController.selectKeySystemFormat(a).then(o=>{if(!this.emeController)return;a.setKeyFormat(o);const l=Oo(o);if(l)return this.emeController.getKeySystemAccess([l])})}if(this.config.requireKeySystemAccessOnStart){const r=Hn(this.config);if(r.length)return this.emeController.getKeySystemAccess(r)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var i,r;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,c))}const a=n.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));const o=Fu(n);let l=this.keyIdToKeyInfo[o];if((i=l)!=null&&i.decryptdata.key)return n.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if(this.emeController&&(r=l)!=null&&r.keyLoadPromise)switch(this.emeController.getKeyStatus(l.decryptdata)){case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>{const{keyInfo:f}=u;return n.key=f.decryptdata.key,{frag:e,keyInfo:f}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${n.keyId?" keyId: "+Tt(n.keyId):""} URI: ${n.uri} from ${e.type} ${e.level}`),l=this.keyIdToKeyInfo[o]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&(r=t.initSegment)!=null&&r.data){const a=sD(t.initSegment.data);if(a.length){let o=a[0];o.some(l=>l!==0)?(this.log(`Using keyId found in init segment ${Tt(o)}`),Hi.setKeyIdForUri(e.decryptdata.uri,o)):(o=Hi.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${Tt(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!ht(t))return Promise.resolve(i);const n=this.emeController.loadKey(i);return(e.keyLoadPromise=n.then(a=>(e.mediaKeySessionContext=a,i))).catch(a=>{throw e.keyLoadPromise=null,"data"in a&&(a.data.frag=t),a})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,r=i.loader,n=new r(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((a,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=i.keyLoadPolicy.default,u={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,g)=>{const{frag:m,keyInfo:v}=p,y=Fu(v.decryptdata);if(!m.decryptdata||v!==this.keyIdToKeyInfo[y])return o(this.createKeyLoadError(m,V.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),g));v.decryptdata.key=m.decryptdata.key=new Uint8Array(d.data),m.keyLoader=null,v.loader=null,a({frag:m,keyInfo:v})},onError:(d,h,p,g)=>{this.resetLoader(h),o(this.createKeyLoadError(t,V.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),p,Ke({url:l.url,data:void 0},d)))},onTimeout:(d,h,p)=>{this.resetLoader(h),o(this.createKeyLoadError(t,V.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),p))},onAbort:(d,h,p)=>{this.resetLoader(h),o(this.createKeyLoadError(t,V.INTERNAL_ABORTED,new Error("key loading aborted"),p))}};n.load(l,u,f)})}resetLoader(e){const{frag:t,keyInfo:i,url:r}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null);const a=Fu(i.decryptdata)||r;delete this.keyIdToKeyInfo[a],n&&n.destroy()}}function Fu(s){if(s.keyFormat!==wt.FAIRPLAY){const e=s.keyId;if(e)return Tt(e)}return s.uri}function g0(s){const{type:e}=s;switch(e){case De.AUDIO_TRACK:return ce.AUDIO;case De.SUBTITLE_TRACK:return ce.SUBTITLE;default:return ce.MAIN}}function $u(s,e){let t=s.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class $O{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(b.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(b.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(b.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(b.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.LEVEL_LOADING,this.onLevelLoading,this),e.off(b.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(b.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(b.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,r=t.loader,n=i||r,a=new n(t);return this.loaders[e.type]=a,a}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:De.MANIFEST,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:i,level:r,pathwayId:n,url:a,deliveryDirectives:o,levelInfo:l}=t;this.load({id:i,level:r,pathwayId:n,responseType:"text",type:De.LEVEL,url:a,deliveryDirectives:o,levelOrTrack:l})}onAudioTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:De.AUDIO_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:a,track:o}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:De.SUBTITLE_TRACK,url:n,deliveryDirectives:a,levelOrTrack:o})}onLevelsUpdated(e,t){const i=this.loaders[De.LEVEL];if(i){const r=i.context;r&&!t.levels.some(n=>n===r.levelOrTrack)&&(i.abort(),delete this.loaders[De.LEVEL])}}load(e){var t;const i=this.hls.config;let r=this.getInternalLoader(e);if(r){const c=this.hls.logger,u=r.context;if(u&&u.levelOrTrack===e.levelOrTrack&&(u.url===e.url||u.deliveryDirectives&&!e.deliveryDirectives)){u.url===e.url?c.log(`[playlist-loader]: ignore ${e.url} ongoing request`):c.log(`[playlist-loader]: ignore ${e.url} in favor of ${u.url}`);return}c.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let n;if(e.type===De.MANIFEST?n=i.manifestLoadPolicy.default:n=ze({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),re((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===De.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===De.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===De.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const u=c.partTarget,f=c.targetduration;if(u&&f){const d=Math.max(u*3,f*.8)*1e3;n=ze({},n,{maxTimeToFirstByteMs:Math.min(d,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,n.maxTimeToFirstByteMs)})}}}const a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(c,u,f,d)=>{const h=this.getInternalLoader(f);this.resetInternalLoader(f.type);const p=c.data;u.parsing.start=performance.now(),Qs.isMediaPlaylist(p)||f.type!==De.MANIFEST?this.handleTrackOrLevelPlaylist(c,u,f,d||null,h):this.handleMasterPlaylist(c,u,f,d)},onError:(c,u,f,d)=>{this.handleNetworkError(u,f,!1,c,d)},onTimeout:(c,u,f)=>{this.handleNetworkError(u,f,!0,void 0,c)}};r.load(e,o,l)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:i}=this.hls;(e||i)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,i,r){const n=this.hls,a=e.data,o=$u(e,i),l=Qs.parseMasterPlaylist(a,o);if(l.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,i,l.playlistParsingError,r,t);return}const{contentSteering:c,levels:u,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p}=l;this.variableList=p,u.forEach(y=>{const{unknownCodecs:E}=y;if(E){const{preferManagedMediaSource:w}=this.hls.config;let{audioCodec:T,videoCodec:$}=y;for(let k=E.length;k--;){const M=E[k];la(M,"audio",w)?(y.audioCodec=T=T?`${T},${M}`:M,cn.audio[T.substring(0,4)]=2,E.splice(k,1)):la(M,"video",w)&&(y.videoCodec=$=$?`${$},${M}`:M,cn.video[$.substring(0,4)]=2,E.splice(k,1))}}});const{AUDIO:g=[],SUBTITLES:m,"CLOSED-CAPTIONS":v}=Qs.parseMasterPlaylistMedia(a,o,l);g.length&&!g.some(E=>!E.url)&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new nt({}),bitrate:0,url:""})),n.trigger(b.MANIFEST_LOADED,{levels:u,audioTracks:g,subtitles:m,captions:v,contentSteering:c,url:o,stats:t,networkDetails:r,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,t,i,r,n){const a=this.hls,{id:o,level:l,type:c}=i,u=$u(e,i),f=re(l)?l:re(o)?o:0,d=g0(i),h=Qs.parseLevelPlaylist(e.data,u,f,d,0,this.variableList);if(c===De.MANIFEST){const p={attrs:new nt({}),bitrate:0,details:h,name:"",url:u};h.requestScheduled=t.loading.start+aS(h,0),a.trigger(b.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:u,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=h,this.handlePlaylistLoaded(h,e,t,i,r,n)}handleManifestParsingError(e,t,i,r,n){this.hls.trigger(b.ERROR,{type:fe.NETWORK_ERROR,details:V.MANIFEST_PARSING_ERROR,fatal:t.type===De.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:n})}handleNetworkError(e,t,i=!1,r,n){let a=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===De.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===De.AUDIO_TRACK||e.type===De.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let l=V.UNKNOWN,c=!1;const u=this.getInternalLoader(e);switch(e.type){case De.MANIFEST:l=i?V.MANIFEST_LOAD_TIMEOUT:V.MANIFEST_LOAD_ERROR,c=!0;break;case De.LEVEL:l=i?V.LEVEL_LOAD_TIMEOUT:V.LEVEL_LOAD_ERROR,c=!1;break;case De.AUDIO_TRACK:l=i?V.AUDIO_TRACK_LOAD_TIMEOUT:V.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case De.SUBTITLE_TRACK:l=i?V.SUBTITLE_TRACK_LOAD_TIMEOUT:V.SUBTITLE_LOAD_ERROR,c=!1;break}u&&this.resetInternalLoader(e.type);const f={type:fe.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:u,context:e,error:o,networkDetails:t,stats:n};if(r){const d=(t==null?void 0:t.url)||e.url;f.response=Ke({url:d,data:void 0},r)}this.hls.trigger(b.ERROR,f)}handlePlaylistLoaded(e,t,i,r,n,a){const o=this.hls,{type:l,level:c,levelOrTrack:u,id:f,groupId:d,deliveryDirectives:h}=r,p=$u(t,r),g=g0(r);let m=typeof r.level=="number"&&g===ce.MAIN?c:void 0;const v=e.playlistParsingError;if(v){if(this.hls.logger.warn(`${v} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(b.ERROR,{type:fe.NETWORK_ERROR,details:V.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:v,reason:v.message,response:t,context:r,level:m,parent:g,networkDetails:n,stats:i});return}e.playlistParsingError=null}if(!e.fragments.length){const y=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(b.ERROR,{type:fe.NETWORK_ERROR,details:V.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:y,reason:y.message,response:t,context:r,level:m,parent:g,networkDetails:n,stats:i});return}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case De.MANIFEST:case De.LEVEL:if(m){if(!u)m=0;else if(u!==o.levels[m]){const y=o.levels.indexOf(u);y>-1&&(m=y)}}o.trigger(b.LEVEL_LOADED,{details:e,levelInfo:u||o.levels[0],level:m||0,id:f||0,stats:i,networkDetails:n,deliveryDirectives:h,withoutMultiVariant:l===De.MANIFEST});break;case De.AUDIO_TRACK:o.trigger(b.AUDIO_TRACK_LOADED,{details:e,track:u,id:f||0,groupId:d||"",stats:i,networkDetails:n,deliveryDirectives:h});break;case De.SUBTITLE_TRACK:o.trigger(b.SUBTITLE_TRACK_LOADED,{details:e,track:u,id:f||0,groupId:d||"",stats:i,networkDetails:n,deliveryDirectives:h});break}}}class _t{static get version(){return fa}static isMSESupported(){return nE()}static isSupported(){return PO()}static getMediaSource(){return Xi()}static get Events(){return b}static get MetadataSchema(){return ns}static get ErrorTypes(){return fe}static get ErrorDetails(){return V}static get DefaultConfig(){return _t.defaultConfig?_t.defaultConfig:EO}static set DefaultConfig(e){_t.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new dh,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=jR(e.debug||!1,"Hls instance",e.assetPlayerId),i=this.config=xO(_t.DefaultConfig,e,t);this.userConfig=e,i.progressive&&AO(i,t);const{abrController:r,bufferController:n,capLevelController:a,errorController:o,fpsController:l}=i,c=new o(this),u=this.abrController=new r(this),f=new BD(this),d=i.interstitialsController,h=d?this.interstitialsController=new d(this,_t):null,p=this.bufferController=new n(this,f),g=this.capLevelController=new a(this),m=new l(this),v=new $O(this),y=i.contentSteeringController,E=y?new y(this):null,w=this.levelController=new kO(this,E),T=new RO(this),$=new FO(this.config,this.logger),k=this.streamController=new NO(this,f,$),M=this.gapController=new LO(this,f);g.setStreamController(k),m.setStreamController(k);const _=[v,w,k];h&&_.splice(1,0,h),E&&_.splice(1,0,E),this.networkControllers=_;const C=[u,p,M,g,m,T,f];this.audioTrackController=this.createController(i.audioTrackController,_);const U=i.audioStreamController;U&&_.push(this.audioStreamController=new U(this,f,$)),this.subtitleTrackController=this.createController(i.subtitleTrackController,_);const L=i.subtitleStreamController;L&&_.push(this.subtititleStreamController=new L(this,f,$)),this.createController(i.timelineController,C),$.emeController=this.emeController=this.createController(i.emeController,C),this.cmcdController=this.createController(i.cmcdController,C),this.latencyController=this.createController(DO,C),this.coreComponents=C,_.push(c);const R=c.onErrorOut;typeof R=="function"&&this.on(b.ERROR,R,c),this.on(b.MANIFEST_LOADED,v.onManifestLoaded,v)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,r){this._emitter.off(e,t,i,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const r=e===b.ERROR;this.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,fatal:r,event:e,error:i}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(b.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const n=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(b.ERROR,{type:fe.OTHER_ERROR,details:V.ATTACH_MEDIA_ERROR,fatal:!0,error:n});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,i=t?e.media:e,r=t?e:{media:i};this._media=i,this.trigger(b.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(b.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(b.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,i=this._url,r=this._url=th.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(b.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(e,t),!(!this.started||!this.networkControllers));i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ce.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ce.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ce.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=LP()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){xD(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,i)for(let n=r;n--;){const a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=i)return n}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const i=Vb(t);return Yb(e,i,navigator.mediaCapabilities)}}_t.defaultConfig=void 0;var BO={prefix:"fas",iconName:"angle-down",icon:[320,512,[],"f107","M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"]};const UO=Oe(BO);var GO={prefix:"fas",iconName:"angle-up",icon:[320,512,[],"f106","M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"]};const HO=Oe(GO);var YO={prefix:"fas",iconName:"stop",icon:[448,512,[],"f04d","M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"]};const jO=Oe(YO);var VO={prefix:"fas",iconName:"play",icon:[448,512,[],"f04b","M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"]};const KO=Oe(VO);var WO={prefix:"fas",iconName:"pause",icon:[448,512,[],"f04c","M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"]};const zO=Oe(WO);var QO={prefix:"fas",iconName:"expand-arrows-alt",icon:[448,512,[],"f31e","M448.1 344v112c0 13.3-10.7 24-24 24h-112c-21.4 0-32.1-25.9-17-41l36.2-36.2L224 295.6 116.8 402.9 153 439c15.1 15.1 4.4 41-17 41H24c-13.3 0-24-10.7-24-24V344c0-21.4 25.9-32.1 41-17l36.2 36.2L184.5 256 77.2 148.7 41 185c-15.1 15.1-41 4.4-41-17V56c0-13.3 10.7-24 24-24h112c21.4 0 32.1 25.9 17 41l-36.2 36.2L224 216.4l107.3-107.3L295.1 73c-15.1-15.1-4.4-41 17-41h112c13.3 0 24 10.7 24 24v112c0 21.4-25.9 32.1-41 17l-36.2-36.2L263.6 256l107.3 107.3 36.2-36.2c15.1-15.2 41-4.5 41 16.9z"]};const qO=Oe(QO);var XO={prefix:"fas",iconName:"compress",icon:[448,512,[],"f066","M436 192H312c-13.3 0-24-10.7-24-24V44c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v84h84c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-276-24V44c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v84H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24zm0 300V344c0-13.3-10.7-24-24-24H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-84h84c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H312c-13.3 0-24 10.7-24 24v124c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12z"]};const JO=Oe(XO),Et={LARGE:1,SMALL:2,FULLSCREEN:3};let ZO=5,eM=.9;const tM={name:"PlayBar",components:{FontAwesomeIcon:Jt},data(){return{paused:!0,progress:0,loading:!1,fullscreenEnabled:document.fullscreenEnabled||!1,browserSupportsPiP:document.pictureInPictureEnabled||!1,initialProgress:0,playbarTimeout:0,showVideo:!1,nextepisode:!1,qualityPopUp:!1,autoplaying:!1,PlayingFileID:0,shouldPreSeek:!0,playbackSession:{},hls:null,streamType:"hls"}},computed:{player(){return this.$refs.videoPlayer},playbar(){return this.$refs.playbar},iconUp(){return HO},iconDown(){return UO},iconStop(){return jO},iconPlay(){return KO},iconPause(){return zO},iconFullscreen(){return qO},iconDeFullscreen(){return JO},PlayTimeDisplayValue(){let s=("0"+Math.floor(this.progress*this.playing.entity.Files[this.PlayingFileID].duration/3600)).substr(-2),e=("0"+Math.floor(this.progress*this.playing.entity.Files[this.PlayingFileID].duration/60)%60).substr(-2),t=("0"+Math.floor(this.progress*this.playing.entity.Files[this.PlayingFileID].duration)%60).substr(-2);return`${s}:${e}:${t}`},DurationDisplayValue(){let s=("0"+Math.floor(this.playing.entity.Files[this.PlayingFileID].duration/3600)).substr(-2),e=("0"+Math.floor(this.playing.entity.Files[this.PlayingFileID].duration/60)%60).substr(-2),t=("0"+Math.floor(this.playing.entity.Files[this.PlayingFileID].duration)%60).substr(-2);return`${s}:${e}:${t}`},iconCog(){return Xy},...xt(["playing","autoplay","host","playSizeFormat"])},methods:{...zl(["setPlaySizeFormat"]),getBaseUrl:function(){var s,e;return((e=(s=ie==null?void 0:ie.axios)==null?void 0:s.defaults)==null?void 0:e.baseURL)||window.location.origin},getHlsAuthHeader:function(){return!ie||!ie.accessToken?null:`bearer ${ie.accessToken}`},normalizeHlsUrl:function(s){var r;if(!s)return s;let e=this.getBaseUrl().replace(/\/+$/,""),t=(r=this.playbackSession)==null?void 0:r.sessionId,i=s.match(/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i);return s.includes("/session/stream/")?s:t&&s.startsWith(e+"/")&&i&&!s.includes("/HLS/")?`${e}/HLS/${t}/segment/${i[1]}`:s},buildHlsConfig:function(){let s=this.getHlsAuthHeader(),e=t=>this.normalizeHlsUrl(t);return{enableWorker:!0,lowLatencyMode:!1,xhrSetup:(t,i)=>{let r=e(i);r&&r!==i&&t.open("GET",r,!0),s&&t.setRequestHeader("Authorization",s)},fetchSetup:(t,i)=>{let r=i||{},n=e(t.url);return s&&(r.headers={...r.headers||{},Authorization:s}),new Request(n,r)}}},destroyHls:function(){this.hls&&(this.hls.stopLoad(),this.hls.detachMedia(),this.hls.destroy(),this.hls=null)},attachHlsStream:function(s){this.destroyHls(),_t.isSupported()?(this.hls=new _t(this.buildHlsConfig()),this.hls.on(_t.Events.MEDIA_ATTACHED,()=>{console.log("[hls] media attached")}),this.hls.on(_t.Events.MANIFEST_LOADING,(e,t)=>{console.log("[hls] manifest loading",t==null?void 0:t.url)}),this.hls.on(_t.Events.MANIFEST_LOADED,(e,t)=>{console.log("[hls] manifest loaded",t)}),this.hls.on(_t.Events.LEVEL_LOADED,(e,t)=>{var i,r,n;console.log("[hls] level loaded",{startSN:(i=t==null?void 0:t.details)==null?void 0:i.startSN,endSN:(r=t==null?void 0:t.details)==null?void 0:r.endSN,live:(n=t==null?void 0:t.details)==null?void 0:n.live})}),this.hls.on(_t.Events.FRAG_LOADED,(e,t)=>{var i,r,n;console.log("[hls] frag loaded",{sn:(i=t==null?void 0:t.frag)==null?void 0:i.sn,level:(r=t==null?void 0:t.frag)==null?void 0:r.level,url:(n=t==null?void 0:t.frag)==null?void 0:n.url})}),this.hls.on(_t.Events.FRAG_CHANGED,(e,t)=>{var i,r;console.log("[hls] frag changed",{sn:(i=t==null?void 0:t.frag)==null?void 0:i.sn,level:(r=t==null?void 0:t.frag)==null?void 0:r.level})}),this.hls.on(_t.Events.ERROR,(e,t)=>{if(console.warn("[hls] error",t),!(!t||!t.fatal))switch(t.type){case _t.ErrorTypes.NETWORK_ERROR:this.hls.startLoad();break;case _t.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls()}}),this.hls.loadSource(s),this.hls.attachMedia(this.player)):this.player.canPlayType("application/vnd.apple.mpegurl")?(this.player.src=s,this.player.load()):(this.player.src=s,this.player.load())},viewShow:function(){this.playing.type==="episode"&&(this.$router.push({name:"SeriesView",params:{seriesId:this.playing.entity.Series.id}}),this.setPlaySizeFormat(Et.SMALL))},changeFileId:async function(s){this.updateLocalTracker();let e=this.playing.entity.TrackMovies||this.playing.entity.TrackEpisodes,t=this.streamType==="hls"||this.playbackSession.seeking==="server";this.PlayingFileID=s,t?e[0]!==void 0&&(this.initialProgress=e[0].time):(this.initialProgress=0,this.shouldPreSeek=!0),await this.updateSession(this.initialProgress),this.qualityPopUp=!1,this.loading=!0,this.setURL()},updateSession:async function(s=null){let e={type:this.streamType};this.streamType==="hls"&&(e.formats="mp4",e.videoCodecs="h264",e.audioCodec="aac"),typeof s=="number"&&(e.offset=s),this.playbackSession=await ie.sessions.create(this.playing.entity.Files[this.PlayingFileID].id,e)},updateURL:async function(s=null){await this.updateSession(s),this.setURL()},setURL:function(){let s=this.playbackSession.sessionId,e=ie.sessions.getStreamUrl(s);this.attachHlsStream(e)},seek:function(s){let e=this.playing.entity.Files[this.PlayingFileID].duration*s.clientX/document.documentElement.clientWidth;if(this.playbackSession.seeking==="server"){if(e<this.initialProgress+this.player.duration&&e-this.initialProgress>0){this.player.currentTime=e-this.initialProgress;return}this.initialProgress=e,this.updateURL(this.initialProgress)}else this.player.currentTime=e},toggleFullScreen:function(){this.playSizeFormat!==Et.FULLSCREEN?this.setPlaySizeFormat(Et.FULLSCREEN):this.setPlaySizeFormat(Et.LARGE)},stopPlaying:function(){this.destroyHls(),this.player.src="",this.$store.dispatch("clearPlaying"),this.$store.dispatch("updateWatching"),this.showVideo=!1,this.qualityPopUp=!1,this.paused=!0,this.loading=!1,this.autoplaying=!1,this.progress=0,this.setPlaySizeFormat(Et.SMALL)},playPause:function(s){s.preventDefault(),console.log(this.$store),this.paused=!this.paused},playNext:function(){this.$store.dispatch("playEpisode",this.nextepisode.id)},updateLocalTracker:function(){this.playing.type==="movie"&&(this.playing.entity.TrackMovies||(this.playing.entity.TrackMovies=[]),this.playing.entity.TrackMovies[0]||(this.playing.entity.TrackMovies[0]={}),this.playing.entity.TrackMovies[0].time=this.initialProgress+this.player.currentTime),this.playing.type==="episode"&&(this.playing.entity.TrackEpisodes||(this.playing.entity.TrackEpisodes=[]),this.playing.entity.TrackEpisodes[0]||(this.playing.entity.TrackEpisodes[0]={}),this.playing.entity.TrackEpisodes[0].time=this.initialProgress+this.player.currentTime)}},watch:{playSizeFormat:async function(s,e){switch(console.log("Size changed:",s),s){case Et.FULLSCREEN:this.browserSupportsPiP&&document.pictureInPictureElement&&await document.exitPictureInPicture(),await this.playbar.requestFullscreen();break;case Et.LARGE:document.fullscreenElement&&await document.exitFullscreen(),this.browserSupportsPiP&&document.pictureInPictureElement&&await document.exitPictureInPicture();break;case Et.SMALL:document.fullscreenElement&&await document.exitFullscreen(),this.browserSupportsPiP&&await this.player.requestPictureInPicture();break}},playing:async function(s,e){if((!e.entity||!e.entity.title)&&this.setPlaySizeFormat(Et.LARGE),this.initialProgress=0,this.progress=0,this.PlayingFileID=0,this.shouldPreSeek=!1,this.showVideo=!1,this.qualityPopUp=!1,this.paused=!0,this.loading=!1,this.autoplaying=!1,this.nextepisode=null,this.playing.entity===void 0){navigator.mediaSession.playbackState="none";return}this.loading=!0,this.showVideo=!0;let t=this.playing.entity.TrackMovies||this.playing.entity.TrackEpisodes;if(t[0]&&(this.shouldPreSeek=t[0].progress<eM),(this.streamType==="hls"||this.playbackSession.seeking==="server")&&t[0]!==void 0&&this.shouldPreSeek&&(this.initialProgress=t[0].time),await this.updateSession(this.initialProgress),this.setURL(),"mediaSession"in navigator){let r="";this.playing.type==="episode"&&(r=this.host+"/episode/"+this.playing.entity.id+"/banner"),navigator.mediaSession.metadata=new MediaMetadata({title:this.playing.title,album:this.playing.entity.Series.seriesName,artwork:[{src:r}]}),navigator.mediaSession.setActionHandler("nexttrack",this.playNext),navigator.mediaSession.setActionHandler("stop",this.stopPlaying)}this.playing.type==="episode"&&(this.nextepisode=await ie.episodeLibrary.getNext(this.playing.entity.id))},paused:async function(s,e){if(navigator.mediaSession.playbackState=s?"paused":"playing",s)return this.player.pause();this.player.play()}},mounted:function(){window.addEventListener("keydown",s=>{s.code==="Space"&&this.playing!=={}&&this.playSizeFormat!==Et.SMALL&&(s.preventDefault(),(this.playSizeFormat===Et.FULLSCREEN||this.playSizeFormat===Et.LARGE)&&(this.paused=!this.paused))}),this.player.addEventListener("waiting",()=>{this.loading=!0,console.log("[player] waiting")}),this.player.addEventListener("playing",()=>{this.paused=!1,this.loading=!1,console.log("[player] playing")}),this.player.addEventListener("pause",()=>{this.paused=!0,console.log("[player] pause")}),this.player.addEventListener("play",()=>{this.paused=!1,console.log("[player] play")}),this.player.addEventListener("ended",()=>{this.$store.dispatch("updateWatching"),console.log("[player] ended")}),this.player.addEventListener("enterpictureinpicture",()=>{this.setPlaySizeFormat(Et.SMALL),this.browserSupportsPiP=!0}),this.player.addEventListener("leavepictureinpicture",()=>{this.playSizeFormat===Et.SMALL&&this.setPlaySizeFormat(Et.LARGE)}),this.player.addEventListener("loadedmetadata",()=>{console.log("[player] loadedmetadata",{duration:this.player.duration});let s=this.playing.entity.TrackMovies||this.playing.entity.TrackEpisodes;s[0]&&this.shouldPreSeek&&(this.player.currentTime=s[0].time-this.initialProgress),this.player.play(),this.paused=!1,this.loading=!1}),this.player.addEventListener("timeupdate",()=>{if(this.updateLocalTracker(),this.playing.entity===void 0){this.playbarTimeout=0;return}switch(this.playbarTimeout<20&&(this.playbarTimeout+=1),this.progress=(this.initialProgress+this.player.currentTime)/this.playing.entity.Files[this.PlayingFileID].duration,this.autoplay&&!this.autoplaying&&this.playing.entity.Files[this.PlayingFileID].duration-(this.initialProgress+this.player.currentTime)<=ZO&&(this.autoplaying=!0,this.playNext()),this.playing.type){case"episode":this.$socket.emit("playing",{time:this.playing.entity.TrackEpisodes[0].time=this.initialProgress+this.player.currentTime,progress:this.progress,episodeId:this.playing.entity.id,type:"tv"});break;case"movie":this.$socket.emit("playing",{time:this.playing.entity.TrackMovies[0].time,progress:this.progress,movieId:this.playing.entity.id,type:"movie"});break}})}};var sM=function(){var e=this,t=e._self._c;return t("div",{ref:"playbar",staticClass:"playBar",class:{hiddenBar:!(e.playbarTimeout<20||e.playSizeFormat===2)},on:{mousemove:function(i){e.playbarTimeout=0}}},[t("div",{staticClass:"player",class:{small:e.playSizeFormat===2,hidden:!e.showVideo||e.playSizeFormat===2&&e.browserSupportsPiP}},[t("video",{ref:"videoPlayer"})]),t("div",{ref:"bar",staticClass:"bar"},[t("div",{staticClass:"progressbarContainer",on:{click:e.seek}},[t("div",{staticClass:"progressbar",class:{loading:e.loading},style:{width:e.progress*100+"%"}}),e.$refs.videoPlayer&&e.$refs.videoPlayer.buffered.length>0?t("div",{staticClass:"progressbarload",style:{width:(e.initialProgress+e.$refs.videoPlayer.buffered.end(e.$refs.videoPlayer.buffered.length-1))/e.playing.entity.Files[e.PlayingFileID].duration*100+"%"}}):e._e()]),t("div",{staticClass:"bar-content"},[t("div",{staticClass:"meta"},[e.playing.type==="episode"?t("span",{staticClass:"seriesid",on:{click:e.viewShow}},[e._v(" "+e._s(e.playing.entity.Series.seriesName)+" S"+e._s(e.playing.entity.airedSeason)+"E"+e._s(e.playing.entity.airedEpisodeNumber)+": ")]):e._e(),t("span",{staticClass:"title"},[e._v(e._s(e.playing.title))])]),t("div",{staticClass:"controls"},[e.showVideo?t("span",{staticClass:"time"},[e._v(" "+e._s(e.PlayTimeDisplayValue)+" / "+e._s(e.DurationDisplayValue)+" ")]):e._e(),e.qualityPopUp?t("div",{staticClass:"quality-selector"},[t("ul",e._l(e.playing.entity.Files,function(i,r){return t("li",{key:i.id,class:{selected:r===e.PlayingFileID},on:{click:function(n){return e.changeFileId(r)}}},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"badge"},[e._v(e._s(i.extension))])])}),0)]):e._e(),e.showVideo?t("span",{staticClass:"toggle-button",on:{click:function(i){e.qualityPopUp=!e.qualityPopUp}}},[t("FontAwesomeIcon",{attrs:{icon:e.iconCog}})],1):e._e(),e.showVideo?t("span",{staticClass:"toggle-button",on:{click:e.stopPlaying}},[t("FontAwesomeIcon",{attrs:{icon:e.iconStop}})],1):e._e(),e.showVideo?t("span",{staticClass:"toggle-button",on:{click:e.playPause}},[t("FontAwesomeIcon",{attrs:{icon:e.paused?e.iconPlay:e.iconPause}})],1):e._e(),e.showVideo&&e.fullscreenEnabled?t("span",{staticClass:"toggle-button",on:{click:e.toggleFullScreen}},[t("FontAwesomeIcon",{attrs:{icon:e.playSizeFormat===3?e.iconDeFullscreen:e.iconFullscreen}})],1):e._e(),e.showVideo&&e.playSizeFormat!==3?t("span",{staticClass:"toggle-button",on:{click:function(i){e.setPlaySizeFormat(e.playSizeFormat%2+1)}}},[t("FontAwesomeIcon",{attrs:{icon:e.playSizeFormat===1?e.iconDown:e.iconUp}})],1):e._e(),e.progress>.9&e.playing.type==="episode"?t("a",{staticClass:"nextepisode",on:{click:e.playNext}},[e._v("Next Episode")]):e._e()])])])])},iM=[],rM=ve(tM,sM,iM,!1,null,null);const nM=rM.exports,aM={name:"LoadingPage"};var oM=function(){var e=this;return e._self._c,e._m(0)},lM=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"loading-container"},[e("div",{staticClass:"loader"})])}],cM=ve(aM,oM,lM,!1,null,"861404df");const uM=cM.exports,fM={name:"ShowDialog",data(){return{show:{}}},methods:{beforeOpen(s){this.show=s.params.show},modifyShow:function(){this.$modal.show("ShowModify",{show:this.show}),this.$modal.hide("ShowDialog")},indexShow:function(){ie.seriesLibrary.indexSeries(this.show.id).then(s=>{this.$notify({group:"system",title:"Library update requested successfully for "+this.show.seriesName,text:"A library index update has been started",type:"warning"})}).catch(s=>{})}}};var dM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"ShowDialog"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.show.seriesName))])]),t("div",{staticClass:"body"},[t("ul",[t("li",[t("a",{attrs:{href:"#"},on:{click:e.indexShow}},[e._v("Re-index show")])]),t("li",[t("a",{attrs:{href:"#"},on:{click:e.modifyShow}},[e._v("Edit show data")])])])])])])},hM=[],pM=ve(fM,dM,hM,!1,null,"48b35d3f");const mM=pM.exports,gM={name:"ShowModify",data(){return{show:{}}},computed:xt(["host"]),methods:{beforeOpen(s){this.show=s.params.show}}};var vM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"ShowModify",height:"auto"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.show.seriesName))])]),t("div",{staticClass:"body"},[t("div",{staticClass:"wrapper"},[t("div",{staticClass:"poster"},[t("img",{attrs:{src:e.host+"/series/"+e.show.id+"/poster",alt:""}})])])])])])},yM=[],bM=ve(gM,vM,yM,!1,null,"4f5705df");const SM=bM.exports,EM={name:"UserAdd",data(){return{name:"",username:"",email:"",password:"",attempted:!1}},methods:{beforeOpen(s){this.attempted=!1},async addUser(){if(this.attempted=!0,!this.name||!this.username||!this.email||!this.password){this.$notify({group:"system",title:"Missing fields",text:"Please fill out all fields",type:"error"});return}try{await ie.userManager.createUser(this.username,this.password,this.name,this.email),this.$notify({group:"system",title:"User has been created successfully",text:"You can now login with the username: "+this.name,type:"success"})}catch{this.$notify({group:"system",title:"User could not be created",text:"Maybe not all fields are filled?",type:"error"})}}}};var _M=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"UserAdd",height:"auto"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v("Add user")])]),t("div",{staticClass:"body"},[t("label",{attrs:{for:"name"}},[e._v("Name:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"name"}],class:{invalid:e.attempted&&e.name===""},attrs:{id:"name",type:"text"},domProps:{value:e.name},on:{input:function(i){i.target.composing||(e.name=i.target.value)}}}),t("label",{attrs:{for:"username"}},[e._v("Username:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.username,expression:"username"}],class:{invalid:e.attempted&&e.username===""},attrs:{id:"username",type:"text"},domProps:{value:e.username},on:{input:function(i){i.target.composing||(e.username=i.target.value)}}}),t("label",{attrs:{for:"email"}},[e._v("Email:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],class:{invalid:e.attempted&&e.email===""},attrs:{id:"email",type:"text"},domProps:{value:e.email},on:{input:function(i){i.target.composing||(e.email=i.target.value)}}}),t("label",{attrs:{for:"password"}},[e._v("Password:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],class:{invalid:e.attempted&&e.password===""},attrs:{id:"password",type:"password"},domProps:{value:e.password},on:{input:function(i){i.target.composing||(e.password=i.target.value)}}})]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.addUser}},[e._v(" Add user ")])])])])},xM=[],AM=ve(EM,_M,xM,!1,null,"424a4a92");const TM=AM.exports,wM={name:"MovieDialog",data(){return{movie:{}}},methods:{async beforeOpen(s){this.movie={},this.movie=await ie.movieLibrary.getInfo(s.params.movie.id),console.log(this.movie)}}};var CM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"MovieDialog"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.movie.movieName))])]),t("div",{staticClass:"body"},[t("tabs",{attrs:{options:{useUrlFragment:!1}}},[t("tab",{attrs:{name:"Data"}}),t("tab",{attrs:{name:"Files"}},[t("ul",e._l(e.movie.Files,function(i,r){return t("li",{key:i.id},[t("span",[e._v(e._s(i.path))])])}),0)])],1)],1)])])},LM=[],IM=ve(wM,CM,LM,!1,null,"a3fa5645");const RM=IM.exports,DM={name:"EpisodeDialog",data(){return{episode:{}}},methods:{async beforeOpen(s){this.episode={},this.episode=await ie.episodeLibrary.getInfo(s.params.episode.id)}}};var kM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"EpisodeDialog"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.episode.episodeName))])]),t("div",{staticClass:"body"},[t("tabs",{attrs:{options:{useUrlFragment:!1}}},[t("tab",{attrs:{name:"Data"}}),t("tab",{attrs:{name:"Files"}},[t("ul",e._l(e.episode.Files,function(i,r){return t("li",{key:i.id},[t("span",[e._v(e._s(i.path))])])}),0)])],1)],1)])])},PM=[],OM=ve(DM,kM,PM,!1,null,"491135bd");const MM=OM.exports,NM={name:"UserAdd",data(){return{path:"",libraryType:"movie",attempted:!1}},methods:{...Ql("libraries",["updateAll","deleteMovieLibrary","deleteSeriesLibrary"]),beforeOpen(s){this.libraryType=s.params.libraryType,this.path="",this.attempted=!1},opened(){this.$refs.pathInput.focus()},async addLibrary(){if(this.attempted=!0,!this.path){this.$notify({group:"system",title:"Missing path",text:"Please provide a library path",type:"error"});return}try{await ie.libraries.addPath(this.libraryType,this.path),this.$notify({group:"system",title:"Library path has been successfully added",text:"The library will be indexed on next update",type:"success"}),this.updateAll(),this.$modal.hide("LibraryAdd"),this.path=""}catch{this.$notify({group:"system",title:"Library path could not be added",text:"The request to add the path has failed",type:"error"})}}}};var FM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"LibraryAdd",height:"auto"},on:{"before-open":e.beforeOpen,opened:e.opened}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v("Add "+e._s(e.libraryType)+" library")])]),t("div",{staticClass:"body"},[t("label",{attrs:{for:"name"}},[e._v("Path:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.path,expression:"path"}],ref:"pathInput",class:{invalid:e.attempted&&e.path===""},attrs:{id:"name",type:"text"},domProps:{value:e.path},on:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.addLibrary.apply(null,arguments)},input:function(i){i.target.composing||(e.path=i.target.value)}}})]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.addLibrary}},[e._v(" Add library ")])])])])},$M=[],BM=ve(NM,FM,$M,!1,null,"db21cdf0");const UM=BM.exports,GM={name:"NewMovieSet",data(){return{name:"",overview:"",public:!0,attempted:!1}},methods:{beforeOpen(s){this.attempted=!1},async addSet(){if(this.attempted=!0,!this.name||!this.overview){this.$notify({group:"system",title:"Missing fields",text:"Please provide a name and overview",type:"error"});return}try{await ie.sets.createMovieSet({name:this.name,overview:this.overview,public:this.public}),this.$notify({group:"system",title:"Set has been created successfully",text:"",type:"success"})}catch{this.$notify({group:"system",title:"Set could not be created",text:"Maybe not all fields are filled?",type:"error"})}}}};var HM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"NewMovieSet",height:"auto"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v("Create Movie Set")])]),t("div",{staticClass:"body"},[t("label",{attrs:{for:"name"}},[e._v("Name:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"name"}],class:{invalid:e.attempted&&e.name===""},attrs:{id:"name",type:"text"},domProps:{value:e.name},on:{input:function(i){i.target.composing||(e.name=i.target.value)}}}),t("label",{attrs:{for:"name"}},[e._v("Overview:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.overview,expression:"overview"}],class:{invalid:e.attempted&&e.overview===""},attrs:{id:"overview",type:"text"},domProps:{value:e.overview},on:{input:function(i){i.target.composing||(e.overview=i.target.value)}}})]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.addSet}},[e._v(" Create set ")])])])])},YM=[],jM=ve(GM,HM,YM,!1,null,"f8eb3f83");const VM=jM.exports,KM={name:"PasswordChange",data(){return{userid:null,name:"",username:"",email:"",password:"",attempted:!1}},methods:{beforeOpen(s){this.userid=s.params.id,this.name=s.params.name,this.username=s.params.username,this.email=s.params.email,this.password="",this.attempted=!1},async setPassword(){if(this.userid===null)return!1;if(this.attempted=!0,!this.password){this.$notify({group:"system",title:"Missing password",text:"Please enter a password",type:"error"});return}try{await ie.userManager.updateUser(this.userid,{password:this.password}),this.$notify({group:"system",title:"Password has been changed successfully",text:"You can now login with the username: "+this.name,type:"success"})}catch{this.$notify({group:"system",title:"Password could not be changed",text:"Maybe not all fields are filled?",type:"error"})}}}};var WM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"PasswordChange",height:"auto"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v("Change password for "+e._s(e.username))])]),t("div",{staticClass:"body"},[t("label",{attrs:{for:"password"}},[e._v("Password:")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],class:{invalid:e.attempted&&e.password===""},attrs:{id:"password",type:"password"},domProps:{value:e.password},on:{input:function(i){i.target.composing||(e.password=i.target.value)}}})]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.setPassword}},[e._v(" Set password ")])])])])},zM=[],QM=ve(KM,WM,zM,!1,null,"fd64f2c8");const qM=QM.exports,XM={name:"CopyText",data(){return{title:"",text:""}},methods:{beforeOpen(s){this.title=s.params.title,this.text=s.params.text},copy(){this.$refs.inputTextField.focus(),this.$refs.inputTextField.select(),document.execCommand("copy")}}};var JM=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"CopyText",height:"auto"},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.title))])]),t("div",{staticClass:"body"},[t("input",{ref:"inputTextField",attrs:{id:"name",type:"text"},domProps:{value:e.text}})]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.copy}},[e._v(" Copy ")])])])])},ZM=[],eN=ve(XM,JM,ZM,!1,null,"a8293d49");const tN=eN.exports,sN={name:"ChangeRemoteDialog",data(){return{remotes:[]}},methods:{async beforeOpen(s){this.remotes=await ie.remotes.getClients()},setRemote(s){this.$modal.hide("ChangeRemoteDialog"),this.setPlaybackRemote(s)},...zl(["setPlaybackRemote"])}};var iN=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"ChangeRemoteDialog",adaptive:!0},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v("Choose Playback device")])]),t("div",{staticClass:"body"},[t("ul",e._l(e.remotes,function(i,r){return t("li",{key:r},[t("span",{on:{click:function(n){return e.setRemote(i.clientId)}}},[e._v(e._s(i.clientName))])])}),0)])])])},rN=[],nN=ve(sN,iN,rN,!1,null,"ecce19b0");const aN=nN.exports,oN={name:"SeedboxDialog",data(){return{seedboxForm:this.getEmptySeedbox(),isNew:!0,callback:null}},methods:{getEmptySeedbox(){return{name:"",storageDriver:"ssh",storageDriverOptions:{host:"",username:"",password:"",secure:!0},mediaImport:{movieDirectory:"",seriesDirectory:""},automaticImport:!0,deleteOnImport:!1,enabled:!0}},beforeOpen(s){if(!s||!s.params){this.seedboxForm=this.getEmptySeedbox(),this.isNew=!0,this.callback=null;return}if(this.callback=s.params.callback,this.isNew=!s.params.seedbox,s.params.seedbox){const e=s.params.seedbox,t=this.getEmptySeedbox();this.seedboxForm={...t,...e,storageDriver:e.storageDriver||"ssh",storageDriverOptions:{...t.storageDriverOptions,...e.storageDriverOptions||{}},mediaImport:{...t.mediaImport,...e.mediaImport||{}}}}else this.seedboxForm=this.getEmptySeedbox()},save(){if(!this.seedboxForm.name||!this.seedboxForm.storageDriverOptions.host){this.$notify({type:"error",title:"Missing info",text:"Name and host are required."});return}this.callback&&this.callback({...this.seedboxForm}),this.$modal.hide("SeedboxDialog")}}};var lN=function(){var e=this,t=e._self._c;return t("modal",{attrs:{name:"SeedboxDialog",height:"auto",scrollable:!0},on:{"before-open":e.beforeOpen}},[t("div",{staticClass:"container"},[t("div",{staticClass:"heading"},[t("h3",[e._v(e._s(e.isNew?"Add Seedbox":"Edit Seedbox"))])]),t("div",{staticClass:"body"},[t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Name")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.name,expression:"seedboxForm.name"}],attrs:{type:"text",placeholder:"My Seedbox"},domProps:{value:e.seedboxForm.name},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm,"name",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Storage Driver")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.storageDriver,expression:"seedboxForm.storageDriver"}],on:{change:function(i){var r=Array.prototype.filter.call(i.target.options,function(n){return n.selected}).map(function(n){var a="_value"in n?n._value:n.value;return a});e.$set(e.seedboxForm,"storageDriver",i.target.multiple?r:r[0])}}},[t("option",{attrs:{value:"ssh"}},[e._v(" SSH ")]),t("option",{attrs:{value:"ftp"}},[e._v(" FTP ")]),t("option",{attrs:{value:"ftps"}},[e._v(" FTPS ")])])])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Host")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.storageDriverOptions.host,expression:"seedboxForm.storageDriverOptions.host"}],attrs:{type:"text",placeholder:"seedbox.example.com"},domProps:{value:e.seedboxForm.storageDriverOptions.host},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm.storageDriverOptions,"host",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Username")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.storageDriverOptions.username,expression:"seedboxForm.storageDriverOptions.username"}],attrs:{type:"text",placeholder:"seeduser"},domProps:{value:e.seedboxForm.storageDriverOptions.username},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm.storageDriverOptions,"username",i.target.value)}}})])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Password")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.storageDriverOptions.password,expression:"seedboxForm.storageDriverOptions.password"}],attrs:{type:"password",placeholder:"••••••••"},domProps:{value:e.seedboxForm.storageDriverOptions.password},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm.storageDriverOptions,"password",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Secure Connection")]),t("label",{staticClass:"checkbox-container"},[e._v(" Use Secure Connection "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.storageDriverOptions.secure,expression:"seedboxForm.storageDriverOptions.secure"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.seedboxForm.storageDriverOptions.secure)?e._i(e.seedboxForm.storageDriverOptions.secure,null)>-1:e.seedboxForm.storageDriverOptions.secure},on:{change:function(i){var r=e.seedboxForm.storageDriverOptions.secure,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.seedboxForm.storageDriverOptions,"secure",r.concat([o])):l>-1&&e.$set(e.seedboxForm.storageDriverOptions,"secure",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.seedboxForm.storageDriverOptions,"secure",a)}}}),t("span",{staticClass:"checkmark"})])])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Movie Directory")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.mediaImport.movieDirectory,expression:"seedboxForm.mediaImport.movieDirectory"}],attrs:{type:"text",placeholder:"/downloads/finished/movie"},domProps:{value:e.seedboxForm.mediaImport.movieDirectory},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm.mediaImport,"movieDirectory",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Series Directory")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.mediaImport.seriesDirectory,expression:"seedboxForm.mediaImport.seriesDirectory"}],attrs:{type:"text",placeholder:"/downloads/finished/tv"},domProps:{value:e.seedboxForm.mediaImport.seriesDirectory},on:{input:function(i){i.target.composing||e.$set(e.seedboxForm.mediaImport,"seriesDirectory",i.target.value)}}})])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",{staticClass:"checkbox-container"},[e._v(" Automatic Import "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.automaticImport,expression:"seedboxForm.automaticImport"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.seedboxForm.automaticImport)?e._i(e.seedboxForm.automaticImport,null)>-1:e.seedboxForm.automaticImport},on:{change:function(i){var r=e.seedboxForm.automaticImport,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.seedboxForm,"automaticImport",r.concat([o])):l>-1&&e.$set(e.seedboxForm,"automaticImport",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.seedboxForm,"automaticImport",a)}}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" Automatically import media found in the seedbox directories. ")])]),t("div",{staticClass:"form-group"},[t("label",{staticClass:"checkbox-container"},[e._v(" Delete On Import "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.deleteOnImport,expression:"seedboxForm.deleteOnImport"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.seedboxForm.deleteOnImport)?e._i(e.seedboxForm.deleteOnImport,null)>-1:e.seedboxForm.deleteOnImport},on:{change:function(i){var r=e.seedboxForm.deleteOnImport,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.seedboxForm,"deleteOnImport",r.concat([o])):l>-1&&e.$set(e.seedboxForm,"deleteOnImport",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.seedboxForm,"deleteOnImport",a)}}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" Remove files from the seedbox after import completes. ")])])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Enabled "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.seedboxForm.enabled,expression:"seedboxForm.enabled"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.seedboxForm.enabled)?e._i(e.seedboxForm.enabled,null)>-1:e.seedboxForm.enabled},on:{change:function(i){var r=e.seedboxForm.enabled,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.seedboxForm,"enabled",r.concat([o])):l>-1&&e.$set(e.seedboxForm,"enabled",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.seedboxForm,"enabled",a)}}}),t("span",{staticClass:"checkmark"})])])]),t("div",{staticClass:"footer"},[t("button",{staticClass:"success",on:{click:e.save}},[e._v(" "+e._s(e.isNew?"Add Seedbox":"Save Changes")+" ")])])])])},cN=[],uN=ve(oN,lN,cN,!1,null,"d8020012");const fN=uN.exports,dN={name:"App",components:{ChangeRemoteDialog:aN,WatchPanel:Lb,NavBar:KC,ShowDialogModal:mM,PasswordChange:qM,ShowModifyModal:SM,UserAddModal:TM,MovieDialogModal:RM,EpisodeDialogModal:MM,CopyText:tN,NewMovieSet:VM,LibraryAdd:UM,SeedboxDialog:fN,playBar:nM,LoadingPage:uM},computed:{...xt({loaded:s=>s.initialLoaded,playSizeFormat:s=>s.playSizeFormat,playing:s=>s.playing})},watch:{playing:async function(s,e){if(this.playSizeFormat===Et.LARGE&&this.playing.entity){document.body.style.overflow="hidden";return}document.body.style.overflow="auto"},playSizeFormat:async function(s,e){if(s===Et.LARGE&&this.playing.entity){document.body.style.overflow="hidden";return}document.body.style.overflow="auto"}},created(){},beforeCreate(){this.$store.dispatch("updateAll")},methods:{}};var hN=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("ShowDialogModal"),t("ShowModifyModal"),t("UserAddModal"),t("MovieDialogModal"),t("EpisodeDialogModal"),t("LibraryAdd"),t("NewMovieSet"),t("PasswordChange"),t("CopyText"),t("ChangeRemoteDialog"),t("SeedboxDialog"),t("notifications",{attrs:{group:"system",classes:"system-notification",position:"bottom center"}}),e.$router.history.current.name!=="login"&&e.loaded?t("NavBar"):e._e(),e.$router.history.current.name!=="login"&&e.loaded?t("WatchPanel"):e._e(),e.$router.history.current.name!=="login"&&e.loaded?t("playBar"):e._e(),t("transition",{attrs:{name:"long-fade",mode:"out"}},[e.$router.history.current.name!=="login"&&!e.loaded?t("LoadingPage"):e._e()],1),e.$router.history.current.name==="login"||e.loaded?t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1):e._e()],1)},pN=[],mN=ve(dN,hN,pN,!1,null,null);const gN=mN.exports;/*!
|
|
396
|
+
* vue-router v3.6.5
|
|
397
|
+
* (c) 2022 Evan You
|
|
398
|
+
* @license MIT
|
|
399
|
+
*/function Is(s,e){for(var t in e)s[t]=e[t];return s}var vN=/[!'()*]/g,yN=function(s){return"%"+s.charCodeAt(0).toString(16)},bN=/%2C/g,Ur=function(s){return encodeURIComponent(s).replace(vN,yN).replace(bN,",")};function qf(s){try{return decodeURIComponent(s)}catch{}return s}function SN(s,e,t){e===void 0&&(e={});var i=t||EN,r;try{r=i(s||"")}catch{r={}}for(var n in e){var a=e[n];r[n]=Array.isArray(a)?a.map(v0):v0(a)}return r}var v0=function(s){return s==null||typeof s=="object"?s:String(s)};function EN(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var i=t.replace(/\+/g," ").split("="),r=qf(i.shift()),n=i.length>0?qf(i.join("=")):null;e[r]===void 0?e[r]=n:Array.isArray(e[r])?e[r].push(n):e[r]=[e[r],n]}),e}function _N(s){var e=s?Object.keys(s).map(function(t){var i=s[t];if(i===void 0)return"";if(i===null)return Ur(t);if(Array.isArray(i)){var r=[];return i.forEach(function(n){n!==void 0&&(n===null?r.push(Ur(t)):r.push(Ur(t)+"="+Ur(n)))}),r.join("&")}return Ur(t)+"="+Ur(i)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var Ll=/\/?$/;function Il(s,e,t,i){var r=i&&i.options.stringifyQuery,n=e.query||{};try{n=Xf(n)}catch{}var a={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:n,params:e.params||{},fullPath:y0(e,r),matched:s?xN(s):[]};return t&&(a.redirectedFrom=y0(t,r)),Object.freeze(a)}function Xf(s){if(Array.isArray(s))return s.map(Xf);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=Xf(s[t]);return e}else return s}var tr=Il(null,{path:"/"});function xN(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function y0(s,e){var t=s.path,i=s.query;i===void 0&&(i={});var r=s.hash;r===void 0&&(r="");var n=e||_N;return(t||"/")+n(i)+r}function aE(s,e,t){return e===tr?s===e:e?s.path&&e.path?s.path.replace(Ll,"")===e.path.replace(Ll,"")&&(t||s.hash===e.hash&&Uo(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&Uo(s.query,e.query)&&Uo(s.params,e.params)):!1:!1}function Uo(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.length!==i.length?!1:t.every(function(r,n){var a=s[r],o=i[n];if(o!==r)return!1;var l=e[r];return a==null||l==null?a===l:typeof a=="object"&&typeof l=="object"?Uo(a,l):String(a)===String(l)})}function AN(s,e){return s.path.replace(Ll,"/").indexOf(e.path.replace(Ll,"/"))===0&&(!e.hash||s.hash===e.hash)&&TN(s.query,e.query)}function TN(s,e){for(var t in e)if(!(t in s))return!1;return!0}function oE(s){for(var e=0;e<s.matched.length;e++){var t=s.matched[e];for(var i in t.instances){var r=t.instances[i],n=t.enteredCbs[i];if(!(!r||!n)){delete t.enteredCbs[i];for(var a=0;a<n.length;a++)r._isBeingDestroyed||n[a](r)}}}}var wN={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var i=t.props,r=t.children,n=t.parent,a=t.data;a.routerView=!0;for(var o=n.$createElement,l=i.name,c=n.$route,u=n._routerViewCache||(n._routerViewCache={}),f=0,d=!1;n&&n._routerRoot!==n;){var h=n.$vnode?n.$vnode.data:{};h.routerView&&f++,h.keepAlive&&n._directInactive&&n._inactive&&(d=!0),n=n.$parent}if(a.routerViewDepth=f,d){var p=u[l],g=p&&p.component;return g?(p.configProps&&b0(g,a,p.route,p.configProps),o(g,a,r)):o()}var m=c.matched[f],v=m&&m.components[l];if(!m||!v)return u[l]=null,o();u[l]={component:v},a.registerRouteInstance=function(E,w){var T=m.instances[l];(w&&T!==E||!w&&T===E)&&(m.instances[l]=w)},(a.hook||(a.hook={})).prepatch=function(E,w){m.instances[l]=w.componentInstance},a.hook.init=function(E){E.data.keepAlive&&E.componentInstance&&E.componentInstance!==m.instances[l]&&(m.instances[l]=E.componentInstance),oE(c)};var y=m.props&&m.props[l];return y&&(Is(u[l],{route:c,configProps:y}),b0(v,a,c,y)),o(v,a,r)}};function b0(s,e,t,i){var r=e.props=CN(t,i);if(r){r=e.props=Is({},r);var n=e.attrs=e.attrs||{};for(var a in r)(!s.props||!(a in s.props))&&(n[a]=r[a],delete r[a])}}function CN(s,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(s);case"boolean":return e?s.params:void 0}}function lE(s,e,t){var i=s.charAt(0);if(i==="/")return s;if(i==="?"||i==="#")return e+s;var r=e.split("/");(!t||!r[r.length-1])&&r.pop();for(var n=s.replace(/^\//,"").split("/"),a=0;a<n.length;a++){var o=n[a];o===".."?r.pop():o!=="."&&r.push(o)}return r[0]!==""&&r.unshift(""),r.join("/")}function LN(s){var e="",t="",i=s.indexOf("#");i>=0&&(e=s.slice(i),s=s.slice(0,i));var r=s.indexOf("?");return r>=0&&(t=s.slice(r+1),s=s.slice(0,r)),{path:s,query:t,hash:e}}function Yi(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var Rl=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},Sn=fE,IN=Th,RN=ON,DN=cE,kN=uE,PN=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function Th(s,e){for(var t=[],i=0,r=0,n="",a=e&&e.delimiter||"/",o;(o=PN.exec(s))!=null;){var l=o[0],c=o[1],u=o.index;if(n+=s.slice(r,u),r=u+l.length,c){n+=c[1];continue}var f=s[r],d=o[2],h=o[3],p=o[4],g=o[5],m=o[6],v=o[7];n&&(t.push(n),n="");var y=d!=null&&f!=null&&f!==d,E=m==="+"||m==="*",w=m==="?"||m==="*",T=o[2]||a,$=p||g;t.push({name:h||i++,prefix:d||"",delimiter:T,optional:w,repeat:E,partial:y,asterisk:!!v,pattern:$?FN($):v?".*":"[^"+Go(T)+"]+?"})}return r<s.length&&(n+=s.substr(r)),n&&t.push(n),t}function ON(s,e){return cE(Th(s,e),e)}function MN(s){return encodeURI(s).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function NN(s){return encodeURI(s).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function cE(s,e){for(var t=new Array(s.length),i=0;i<s.length;i++)typeof s[i]=="object"&&(t[i]=new RegExp("^(?:"+s[i].pattern+")$",Ch(e)));return function(r,n){for(var a="",o=r||{},l=n||{},c=l.pretty?MN:encodeURIComponent,u=0;u<s.length;u++){var f=s[u];if(typeof f=="string"){a+=f;continue}var d=o[f.name],h;if(d==null)if(f.optional){f.partial&&(a+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(Rl(d)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(d.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(h=c(d[p]),!t[u].test(h))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(h)+"`");a+=(p===0?f.prefix:f.delimiter)+h}continue}if(h=f.asterisk?NN(d):c(d),!t[u].test(h))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+h+'"');a+=f.prefix+h}return a}}function Go(s){return s.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function FN(s){return s.replace(/([=!:$\/()])/g,"\\$1")}function wh(s,e){return s.keys=e,s}function Ch(s){return s&&s.sensitive?"":"i"}function $N(s,e){var t=s.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return wh(s,e)}function BN(s,e,t){for(var i=[],r=0;r<s.length;r++)i.push(fE(s[r],e,t).source);var n=new RegExp("(?:"+i.join("|")+")",Ch(t));return wh(n,e)}function UN(s,e,t){return uE(Th(s,t),e,t)}function uE(s,e,t){Rl(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,r=t.end!==!1,n="",a=0;a<s.length;a++){var o=s[a];if(typeof o=="string")n+=Go(o);else{var l=Go(o.prefix),c="(?:"+o.pattern+")";e.push(o),o.repeat&&(c+="(?:"+l+c+")*"),o.optional?o.partial?c=l+"("+c+")?":c="(?:"+l+"("+c+"))?":c=l+"("+c+")",n+=c}}var u=Go(t.delimiter||"/"),f=n.slice(-u.length)===u;return i||(n=(f?n.slice(0,-u.length):n)+"(?:"+u+"(?=$))?"),r?n+="$":n+=i&&f?"":"(?="+u+"|$)",wh(new RegExp("^"+n,Ch(t)),e)}function fE(s,e,t){return Rl(e)||(t=e||t,e=[]),t=t||{},s instanceof RegExp?$N(s,e):Rl(s)?BN(s,e,t):UN(s,e,t)}Sn.parse=IN;Sn.compile=RN;Sn.tokensToFunction=DN;Sn.tokensToRegExp=kN;var S0=Object.create(null);function Ho(s,e,t){e=e||{};try{var i=S0[s]||(S0[s]=Sn.compile(s));return typeof e.pathMatch=="string"&&(e[0]=e.pathMatch),i(e,{pretty:!0})}catch{return""}finally{delete e[0]}}function Lh(s,e,t,i){var r=typeof s=="string"?{path:s}:s;if(r._normalized)return r;if(r.name){r=Is({},s);var n=r.params;return n&&typeof n=="object"&&(r.params=Is({},n)),r}if(!r.path&&r.params&&e){r=Is({},r),r._normalized=!0;var a=Is(Is({},e.params),r.params);if(e.name)r.name=e.name,r.params=a;else if(e.matched.length){var o=e.matched[e.matched.length-1].path;r.path=Ho(o,a,"path "+e.path)}return r}var l=LN(r.path||""),c=e&&e.path||"/",u=l.path?lE(l.path,c,t||r.append):c,f=SN(l.query,r.query,i&&i.options.parseQuery),d=r.hash||l.hash;return d&&d.charAt(0)!=="#"&&(d="#"+d),{_normalized:!0,path:u,query:f,hash:d}}var GN=[String,Object],HN=[String,Array],E0=function(){},YN={name:"RouterLink",props:{to:{type:GN,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:HN,default:"click"}},render:function(e){var t=this,i=this.$router,r=this.$route,n=i.resolve(this.to,r,this.append),a=n.location,o=n.route,l=n.href,c={},u=i.options.linkActiveClass,f=i.options.linkExactActiveClass,d=u??"router-link-active",h=f??"router-link-exact-active",p=this.activeClass==null?d:this.activeClass,g=this.exactActiveClass==null?h:this.exactActiveClass,m=o.redirectedFrom?Il(null,Lh(o.redirectedFrom),null,i):o;c[g]=aE(r,m,this.exactPath),c[p]=this.exact||this.exactPath?c[g]:AN(r,m);var v=c[g]?this.ariaCurrentValue:null,y=function(L){_0(L)&&(t.replace?i.replace(a,E0):i.push(a,E0))},E={click:_0};Array.isArray(this.event)?this.event.forEach(function(L){E[L]=y}):E[this.event]=y;var w={class:c},T=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:o,navigate:y,isActive:c[p],isExactActive:c[g]});if(T){if(T.length===1)return T[0];if(T.length>1||!T.length)return T.length===0?e():e("span",{},T)}if(this.tag==="a")w.on=E,w.attrs={href:l,"aria-current":v};else{var $=dE(this.$slots.default);if($){$.isStatic=!1;var k=$.data=Is({},$.data);k.on=k.on||{};for(var M in k.on){var _=k.on[M];M in E&&(k.on[M]=Array.isArray(_)?_:[_])}for(var C in E)C in k.on?k.on[C].push(E[C]):k.on[C]=y;var U=$.data.attrs=Is({},$.data.attrs);U.href=l,U["aria-current"]=v}else w.on=E}return e(this.tag,w,this.$slots.default)}};function _0(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function dE(s){if(s){for(var e,t=0;t<s.length;t++)if(e=s[t],e.tag==="a"||e.children&&(e=dE(e.children)))return e}}var Dl;function Jf(s){if(!(Jf.installed&&Dl===s)){Jf.installed=!0,Dl=s;var e=function(r){return r!==void 0},t=function(r,n){var a=r.$options._parentVnode;e(a)&&e(a=a.data)&&e(a=a.registerRouteInstance)&&a(r,n)};s.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),s.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,t(this,this)},destroyed:function(){t(this)}}),Object.defineProperty(s.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(s.prototype,"$route",{get:function(){return this._routerRoot._route}}),s.component("RouterView",wN),s.component("RouterLink",YN);var i=s.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}}var wa=typeof window<"u";function mo(s,e,t,i,r){var n=e||[],a=t||Object.create(null),o=i||Object.create(null);s.forEach(function(u){Zf(n,a,o,u,r)});for(var l=0,c=n.length;l<c;l++)n[l]==="*"&&(n.push(n.splice(l,1)[0]),c--,l--);return{pathList:n,pathMap:a,nameMap:o}}function Zf(s,e,t,i,r,n){var a=i.path,o=i.name,l=i.pathToRegexpOptions||{},c=VN(a,r,l.strict);typeof i.caseSensitive=="boolean"&&(l.sensitive=i.caseSensitive);var u={path:c,regex:jN(c,l),components:i.components||{default:i.component},alias:i.alias?typeof i.alias=="string"?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:o,parent:r,matchAs:n,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:i.props==null?{}:i.components?i.props:{default:i.props}};if(i.children&&i.children.forEach(function(g){var m=n?Yi(n+"/"+g.path):void 0;Zf(s,e,t,g,u,m)}),e[u.path]||(s.push(u.path),e[u.path]=u),i.alias!==void 0)for(var f=Array.isArray(i.alias)?i.alias:[i.alias],d=0;d<f.length;++d){var h=f[d],p={path:h,children:i.children};Zf(s,e,t,p,r,u.path||"/")}o&&(t[o]||(t[o]=u))}function jN(s,e){var t=Sn(s,[],e);return t}function VN(s,e,t){return t||(s=s.replace(/\/$/,"")),s[0]==="/"||e==null?s:Yi(e.path+"/"+s)}function KN(s,e){var t=mo(s),i=t.pathList,r=t.pathMap,n=t.nameMap;function a(h){mo(h,i,r,n)}function o(h,p){var g=typeof h!="object"?n[h]:void 0;mo([p||h],i,r,n,g),g&&g.alias.length&&mo(g.alias.map(function(m){return{path:m,children:[p]}}),i,r,n,g)}function l(){return i.map(function(h){return r[h]})}function c(h,p,g){var m=Lh(h,p,!1,e),v=m.name;if(v){var y=n[v];if(!y)return d(null,m);var E=y.regex.keys.filter(function(M){return!M.optional}).map(function(M){return M.name});if(typeof m.params!="object"&&(m.params={}),p&&typeof p.params=="object")for(var w in p.params)!(w in m.params)&&E.indexOf(w)>-1&&(m.params[w]=p.params[w]);return m.path=Ho(y.path,m.params),d(y,m,g)}else if(m.path){m.params={};for(var T=0;T<i.length;T++){var $=i[T],k=r[$];if(WN(k.regex,m.path,m.params))return d(k,m,g)}}return d(null,m)}function u(h,p){var g=h.redirect,m=typeof g=="function"?g(Il(h,p,null,e)):g;if(typeof m=="string"&&(m={path:m}),!m||typeof m!="object")return d(null,p);var v=m,y=v.name,E=v.path,w=p.query,T=p.hash,$=p.params;if(w=v.hasOwnProperty("query")?v.query:w,T=v.hasOwnProperty("hash")?v.hash:T,$=v.hasOwnProperty("params")?v.params:$,y)return n[y],c({_normalized:!0,name:y,query:w,hash:T,params:$},void 0,p);if(E){var k=zN(E,h),M=Ho(k,$);return c({_normalized:!0,path:M,query:w,hash:T},void 0,p)}else return d(null,p)}function f(h,p,g){var m=Ho(g,p.params),v=c({_normalized:!0,path:m});if(v){var y=v.matched,E=y[y.length-1];return p.params=v.params,d(E,p)}return d(null,p)}function d(h,p,g){return h&&h.redirect?u(h,g||p):h&&h.matchAs?f(h,p,h.matchAs):Il(h,p,g,e)}return{match:c,addRoute:o,getRoutes:l,addRoutes:a}}function WN(s,e,t){var i=e.match(s);if(i){if(!t)return!0}else return!1;for(var r=1,n=i.length;r<n;++r){var a=s.keys[r-1];a&&(t[a.name||"pathMatch"]=typeof i[r]=="string"?qf(i[r]):i[r])}return!0}function zN(s,e){return lE(s,e.parent?e.parent.path:"/",!0)}var QN=wa&&window.performance&&window.performance.now?window.performance:Date;function hE(){return QN.now().toFixed(3)}var pE=hE();function uc(){return pE}function mE(s){return pE=s}var gE=Object.create(null);function vE(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var s=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(s,""),t=Is({},window.history.state);return t.key=uc(),window.history.replaceState(t,"",e),window.addEventListener("popstate",x0),function(){window.removeEventListener("popstate",x0)}}function ji(s,e,t,i){if(s.app){var r=s.options.scrollBehavior;r&&s.app.$nextTick(function(){var n=qN(),a=r.call(s,e,t,i?n:null);a&&(typeof a.then=="function"?a.then(function(o){w0(o,n)}).catch(function(o){}):w0(a,n))})}}function yE(){var s=uc();s&&(gE[s]={x:window.pageXOffset,y:window.pageYOffset})}function x0(s){yE(),s.state&&s.state.key&&mE(s.state.key)}function qN(){var s=uc();if(s)return gE[s]}function XN(s,e){var t=document.documentElement,i=t.getBoundingClientRect(),r=s.getBoundingClientRect();return{x:r.left-i.left-e.x,y:r.top-i.top-e.y}}function A0(s){return fn(s.x)||fn(s.y)}function T0(s){return{x:fn(s.x)?s.x:window.pageXOffset,y:fn(s.y)?s.y:window.pageYOffset}}function JN(s){return{x:fn(s.x)?s.x:0,y:fn(s.y)?s.y:0}}function fn(s){return typeof s=="number"}var ZN=/^#\d/;function w0(s,e){var t=typeof s=="object";if(t&&typeof s.selector=="string"){var i=ZN.test(s.selector)?document.getElementById(s.selector.slice(1)):document.querySelector(s.selector);if(i){var r=s.offset&&typeof s.offset=="object"?s.offset:{};r=JN(r),e=XN(i,r)}else A0(s)&&(e=T0(s))}else t&&A0(s)&&(e=T0(s));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:s.behavior}):window.scrollTo(e.x,e.y))}var Vi=wa&&function(){var s=window.navigator.userAgent;return(s.indexOf("Android 2.")!==-1||s.indexOf("Android 4.0")!==-1)&&s.indexOf("Mobile Safari")!==-1&&s.indexOf("Chrome")===-1&&s.indexOf("Windows Phone")===-1?!1:window.history&&typeof window.history.pushState=="function"}();function kl(s,e){yE();var t=window.history;try{if(e){var i=Is({},t.state);i.key=uc(),t.replaceState(i,"",s)}else t.pushState({key:mE(hE())},"",s)}catch{window.location[e?"replace":"assign"](s)}}function ed(s){kl(s,!0)}var Cr={redirected:2,aborted:4,cancelled:8,duplicated:16};function eF(s,e){return fc(s,e,Cr.redirected,'Redirected when going from "'+s.fullPath+'" to "'+rF(e)+'" via a navigation guard.')}function tF(s,e){var t=fc(s,e,Cr.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".');return t.name="NavigationDuplicated",t}function C0(s,e){return fc(s,e,Cr.cancelled,'Navigation cancelled from "'+s.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function sF(s,e){return fc(s,e,Cr.aborted,'Navigation aborted from "'+s.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function fc(s,e,t,i){var r=new Error(i);return r._isRouter=!0,r.from=s,r.to=e,r.type=t,r}var iF=["params","query","hash"];function rF(s){if(typeof s=="string")return s;if("path"in s)return s.path;var e={};return iF.forEach(function(t){t in s&&(e[t]=s[t])}),JSON.stringify(e,null,2)}function Pl(s){return Object.prototype.toString.call(s).indexOf("Error")>-1}function dc(s,e){return Pl(s)&&s._isRouter&&(e==null||s.type===e)}function L0(s,e,t){var i=function(r){r>=s.length?t():s[r]?e(s[r],function(){i(r+1)}):i(r+1)};i(0)}function nF(s){return function(e,t,i){var r=!1,n=0,a=null;bE(s,function(o,l,c,u){if(typeof o=="function"&&o.cid===void 0){r=!0,n++;var f=I0(function(g){oF(g)&&(g=g.default),o.resolved=typeof g=="function"?g:Dl.extend(g),c.components[u]=g,n--,n<=0&&i()}),d=I0(function(g){var m="Failed to resolve async component "+u+": "+g;a||(a=Pl(g)?g:new Error(m),i(a))}),h;try{h=o(f,d)}catch(g){d(g)}if(h)if(typeof h.then=="function")h.then(f,d);else{var p=h.component;p&&typeof p.then=="function"&&p.then(f,d)}}}),r||i()}}function bE(s,e){return SE(s.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function SE(s){return Array.prototype.concat.apply([],s)}var aF=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function oF(s){return s.__esModule||aF&&s[Symbol.toStringTag]==="Module"}function I0(s){var e=!1;return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(!e)return e=!0,s.apply(this,t)}}var Ns=function(e,t){this.router=e,this.base=lF(t),this.current=tr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};Ns.prototype.listen=function(e){this.cb=e};Ns.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};Ns.prototype.onError=function(e){this.errorCbs.push(e)};Ns.prototype.transitionTo=function(e,t,i){var r=this,n;try{n=this.router.match(e,this.current)}catch(o){throw this.errorCbs.forEach(function(l){l(o)}),o}var a=this.current;this.confirmTransition(n,function(){r.updateRoute(n),t&&t(n),r.ensureURL(),r.router.afterHooks.forEach(function(o){o&&o(n,a)}),r.ready||(r.ready=!0,r.readyCbs.forEach(function(o){o(n)}))},function(o){i&&i(o),o&&!r.ready&&(!dc(o,Cr.redirected)||a!==tr)&&(r.ready=!0,r.readyErrorCbs.forEach(function(l){l(o)}))})};Ns.prototype.confirmTransition=function(e,t,i){var r=this,n=this.current;this.pending=e;var a=function(g){!dc(g)&&Pl(g)&&(r.errorCbs.length?r.errorCbs.forEach(function(m){m(g)}):console.error(g)),i&&i(g)},o=e.matched.length-1,l=n.matched.length-1;if(aE(e,n)&&o===l&&e.matched[o]===n.matched[l])return this.ensureURL(),e.hash&&ji(this.router,n,e,!1),a(tF(n,e));var c=cF(this.current.matched,e.matched),u=c.updated,f=c.deactivated,d=c.activated,h=[].concat(fF(f),this.router.beforeHooks,dF(u),d.map(function(g){return g.beforeEnter}),nF(d)),p=function(g,m){if(r.pending!==e)return a(C0(n,e));try{g(e,n,function(v){v===!1?(r.ensureURL(!0),a(sF(n,e))):Pl(v)?(r.ensureURL(!0),a(v)):typeof v=="string"||typeof v=="object"&&(typeof v.path=="string"||typeof v.name=="string")?(a(eF(n,e)),typeof v=="object"&&v.replace?r.replace(v):r.push(v)):m(v)})}catch(v){a(v)}};L0(h,p,function(){var g=hF(d),m=g.concat(r.router.resolveHooks);L0(m,p,function(){if(r.pending!==e)return a(C0(n,e));r.pending=null,t(e),r.router.app&&r.router.app.$nextTick(function(){oE(e)})})})};Ns.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};Ns.prototype.setupListeners=function(){};Ns.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=tr,this.pending=null};function lF(s){if(!s)if(wa){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function cF(s,e){var t,i=Math.max(s.length,e.length);for(t=0;t<i&&s[t]===e[t];t++);return{updated:e.slice(0,t),activated:e.slice(t),deactivated:s.slice(t)}}function Ih(s,e,t,i){var r=bE(s,function(n,a,o,l){var c=uF(n,e);if(c)return Array.isArray(c)?c.map(function(u){return t(u,a,o,l)}):t(c,a,o,l)});return SE(i?r.reverse():r)}function uF(s,e){return typeof s!="function"&&(s=Dl.extend(s)),s.options[e]}function fF(s){return Ih(s,"beforeRouteLeave",EE,!0)}function dF(s){return Ih(s,"beforeRouteUpdate",EE)}function EE(s,e){if(e)return function(){return s.apply(e,arguments)}}function hF(s){return Ih(s,"beforeRouteEnter",function(e,t,i,r){return pF(e,i,r)})}function pF(s,e,t){return function(r,n,a){return s(r,n,function(o){typeof o=="function"&&(e.enteredCbs[t]||(e.enteredCbs[t]=[]),e.enteredCbs[t].push(o)),a(o)})}}var _E=function(s){function e(t,i){s.call(this,t,i),this._startLocation=Yn(this.base)}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var r=this.router,n=r.options.scrollBehavior,a=Vi&&n;a&&this.listeners.push(vE());var o=function(){var l=i.current,c=Yn(i.base);i.current===tr&&c===i._startLocation||i.transitionTo(c,function(u){a&&ji(r,u,l,!0)})};window.addEventListener("popstate",o),this.listeners.push(function(){window.removeEventListener("popstate",o)})}},e.prototype.go=function(i){window.history.go(i)},e.prototype.push=function(i,r,n){var a=this,o=this,l=o.current;this.transitionTo(i,function(c){kl(Yi(a.base+c.fullPath)),ji(a.router,c,l,!1),r&&r(c)},n)},e.prototype.replace=function(i,r,n){var a=this,o=this,l=o.current;this.transitionTo(i,function(c){ed(Yi(a.base+c.fullPath)),ji(a.router,c,l,!1),r&&r(c)},n)},e.prototype.ensureURL=function(i){if(Yn(this.base)!==this.current.fullPath){var r=Yi(this.base+this.current.fullPath);i?kl(r):ed(r)}},e.prototype.getCurrentLocation=function(){return Yn(this.base)},e}(Ns);function Yn(s){var e=window.location.pathname,t=e.toLowerCase(),i=s.toLowerCase();return s&&(t===i||t.indexOf(Yi(i+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var xE=function(s){function e(t,i,r){s.call(this,t,i),!(r&&mF(this.base))&&R0()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var r=this.router,n=r.options.scrollBehavior,a=Vi&&n;a&&this.listeners.push(vE());var o=function(){var c=i.current;R0()&&i.transitionTo(Yo(),function(u){a&&ji(i.router,u,c,!0),Vi||jo(u.fullPath)})},l=Vi?"popstate":"hashchange";window.addEventListener(l,o),this.listeners.push(function(){window.removeEventListener(l,o)})}},e.prototype.push=function(i,r,n){var a=this,o=this,l=o.current;this.transitionTo(i,function(c){D0(c.fullPath),ji(a.router,c,l,!1),r&&r(c)},n)},e.prototype.replace=function(i,r,n){var a=this,o=this,l=o.current;this.transitionTo(i,function(c){jo(c.fullPath),ji(a.router,c,l,!1),r&&r(c)},n)},e.prototype.go=function(i){window.history.go(i)},e.prototype.ensureURL=function(i){var r=this.current.fullPath;Yo()!==r&&(i?D0(r):jo(r))},e.prototype.getCurrentLocation=function(){return Yo()},e}(Ns);function mF(s){var e=Yn(s);if(!/^\/#/.test(e))return window.location.replace(Yi(s+"/#"+e)),!0}function R0(){var s=Yo();return s.charAt(0)==="/"?!0:(jo("/"+s),!1)}function Yo(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function td(s){var e=window.location.href,t=e.indexOf("#"),i=t>=0?e.slice(0,t):e;return i+"#"+s}function D0(s){Vi?kl(td(s)):window.location.hash=s}function jo(s){Vi?ed(td(s)):window.location.replace(td(s))}var gF=function(s){function e(t,i){s.call(this,t,i),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(i,r,n){var a=this;this.transitionTo(i,function(o){a.stack=a.stack.slice(0,a.index+1).concat(o),a.index++,r&&r(o)},n)},e.prototype.replace=function(i,r,n){var a=this;this.transitionTo(i,function(o){a.stack=a.stack.slice(0,a.index).concat(o),r&&r(o)},n)},e.prototype.go=function(i){var r=this,n=this.index+i;if(!(n<0||n>=this.stack.length)){var a=this.stack[n];this.confirmTransition(a,function(){var o=r.current;r.index=n,r.updateRoute(a),r.router.afterHooks.forEach(function(l){l&&l(a,o)})},function(o){dc(o,Cr.duplicated)&&(r.index=n)})}},e.prototype.getCurrentLocation=function(){var i=this.stack[this.stack.length-1];return i?i.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Ns),tt=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=KN(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!Vi&&e.fallback!==!1,this.fallback&&(t="hash"),wa||(t="abstract"),this.mode=t,t){case"history":this.history=new _E(this,e.base);break;case"hash":this.history=new xE(this,e.base,this.fallback);break;case"abstract":this.history=new gF(this,e.base);break}},AE={currentRoute:{configurable:!0}};tt.prototype.match=function(e,t,i){return this.matcher.match(e,t,i)};AE.currentRoute.get=function(){return this.history&&this.history.current};tt.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var a=t.apps.indexOf(e);a>-1&&t.apps.splice(a,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var i=this.history;if(i instanceof _E||i instanceof xE){var r=function(a){var o=i.current,l=t.options.scrollBehavior,c=Vi&&l;c&&"fullPath"in a&&ji(t,a,o,!1)},n=function(a){i.setupListeners(),r(a)};i.transitionTo(i.getCurrentLocation(),n,n)}i.listen(function(a){t.apps.forEach(function(o){o._route=a})})}};tt.prototype.beforeEach=function(e){return Rh(this.beforeHooks,e)};tt.prototype.beforeResolve=function(e){return Rh(this.resolveHooks,e)};tt.prototype.afterEach=function(e){return Rh(this.afterHooks,e)};tt.prototype.onReady=function(e,t){this.history.onReady(e,t)};tt.prototype.onError=function(e){this.history.onError(e)};tt.prototype.push=function(e,t,i){var r=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(n,a){r.history.push(e,n,a)});this.history.push(e,t,i)};tt.prototype.replace=function(e,t,i){var r=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(n,a){r.history.replace(e,n,a)});this.history.replace(e,t,i)};tt.prototype.go=function(e){this.history.go(e)};tt.prototype.back=function(){this.go(-1)};tt.prototype.forward=function(){this.go(1)};tt.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(i){return Object.keys(i.components).map(function(r){return i.components[r]})})):[]};tt.prototype.resolve=function(e,t,i){t=t||this.history.current;var r=Lh(e,t,i,this),n=this.match(r,t),a=n.redirectedFrom||n.fullPath,o=this.history.base,l=vF(o,a,this.mode);return{location:r,route:n,href:l,normalizedTo:r,resolved:n}};tt.prototype.getRoutes=function(){return this.matcher.getRoutes()};tt.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==tr&&this.history.transitionTo(this.history.getCurrentLocation())};tt.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==tr&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(tt.prototype,AE);var TE=tt;function Rh(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function vF(s,e,t){var i=t==="hash"?"#"+e:e;return s?Yi(s+"/"+i):i}tt.install=Jf;tt.version="3.6.5";tt.isNavigationFailure=dc;tt.NavigationFailureType=Cr;tt.START_LOCATION=tr;wa&&window.Vue&&window.Vue.use(tt);const yF={name:"SeriesView",components:{WatchPanel:Lb,EpisodeList:Aa},data(){return{showData:{},series:{},posterLoaded:!1,posterUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAAEsCAYAAACPEVzEAAANtklEQVR4nO3Y6dvOdR7G8U8pWihClhCKLIWiblmy5NZt3wohRCVEIUuW7Gt2IbIv7RullNKilNK+7/u+TTPNNDPNdM6D7/W7fndPru/nQfOk4/3g/Se8jvM4Tjs4qJEODm6kg4Mb6uDghnr+kqQz9PylZ+iFbKfrhctO14tJQxroxSEN9NKQBnrp8vrZXh5aXy8PrRcaVk+vDKunV4adpleGh14dfppeveLUbK+NOFWvjagbGllXr4+sq9dH1tHrV4beuLKO3riqdrY3R9XWm6NqhUbX0luja+mt0aforTGht8ecorevrpntnbE19c7YGqFxNfTuuBp6d9zJend86L3xJ+u98SfpvQmh9yecpPevqZ7tg4nV9cHEaqFJ1fThpGr6cFJVfTi5qj6aXFUfTT5RH00JfTzlRH18bZVsn0ytok+mVg5Nq6xPp1XWp9Mq6dPpoc+mV9JnM07I9vnME/T5zIqhWRX1xayK+mJWBX0xO/Tl7Ar6ck75bF/NLa+v5pYLzSunr+eV09fzjtfX80PfzD9e3ywom+3bBWX17XVlsn23sIy+W1g6tKi0vl9UWt8vOk7fLw79sPg4/bCkVLYfl5bSj0tLhpaV1F+WHRtaHvpp+TH6aUXaX68vkbayhP62snhoVejnVUfr59Vpf7/hqLQ1R+kfa44MrQ39svYI/XJj2j/XFftd/1pfNG1DUf17w+GhjaFfNx6mXzel/WdzkbQtRfTfLYeGtoZ+23qIftuWpu0me25QI4EGNKDxobHnBjUSaEADGh8ae+7iMwUa0IDGhyaAAQ1oQONCY88mYEADGtBE0dizA88UaEADGh8ae3bgWQINaEDjQ5MBAxrQgMaDxg4MSMCABjSgiaGxAwPOEmhAAxofGjswIE+gAQ1ofGjsQP88gQY0oPGhsWf65wk0oAGND4090z9PoAENaHxo7JmLGgs0oAGND00AAxrQgMaFxp5OwIAGNKCJorGn+zUWaEADGh8ae7rf2QINaEDjQ5MBAxrQgMaDxvb3TcCABjSgiaGx/X3PFmhAAxofGtvft4lAAxrQ+NDY/j5NBBrQgMaHxp7q00SgAQ1ofGjsqT5NBBrQgMaHxp66sKlAAxrQ+NAEMKABDWhcaOzJBAxoQAOaKBp7sndTgQY0oPGhsSd7NxNoQAMaH5oMGNCABjQeNLavVwIGNKABTQyN7evVTKABDWh8aGxfr+YCDWhA40Nj+3o2F2hAAxofGnuiZ3OBBjSg8aGxJ3o2F2hAAxofGnvignMEGtCAxocmgAENaEDjQmOPJ2BAAxrQRNHY4+efI9CABjQ+NPb4+S0EGtCAxocmAwY0oAGNB4091iMBAxrQgCaGxh7r0UKgAQ1ofGjssR4tBRrQgMaHJgMGNKABjQeNPdo9AQMa0IAmhsYe7d5KoAENaHxoMmBAAxrQeNDY3m4JGNCABjQxNLa3WyuBBjSg8aGxvd1aCzSgAY0Pje3t2lqgAQ1ofGjska6tBRrQgMaHxh7p2lqgAQ1ofGjskS7nCjSgAY0PTQADGtCAxoXGHk7AgAY0oImisYc7nyvQgAY0PjT2cOc2Ag1oQONDkwEDGtCAxoPG9nRKwIAGNKCJobE9ndoINKABjQ+N7emUL9CABjQ+NLanY77+KDSPggY0f3I09lDHfP2RaFga0PyZ0dhDHfMFGtCAxofGHurQVqABDWh8aAIY0IAGNC409mACBjSgAU0UjT3Yvq3+32h4z0DzZ0FjD7Y/T6ABDWh8aDJgQAMa0HjQ2O52CRjQgAY0MTS2u915Ag1oQONDY7vbFQg0oAGND43tLigQaEADGh8ae6CgQKABDWh8aOyBggKBBjSg8aGxB85rJ9CABjQ+NAEMaEADGhcauz8BAxrQgCaKxu5v206gAQ1ofGjs/rbtBRrQgMaHJgMGNKABjQeN7cpPwIAGNKCJobFd+e0FGtCAxofGduV3EGhAAxofGtvVpoNAAxrQ+NDYfW06CDSgAY0Pjd3XpoNAAxrQ+NDYfed2FGhAAxofmgAGNKABjQuN3ZuAAQ1oQBNFY/e27ijQgAY0PjR2b+tOAg1oQONDkwEDGtCAxoPGdrZKwIAGNKCJobGdrToJNKABjQ+N7WzVWaABDWh8aGxny84CDWhA40NjO1p2FmhAAxofGtvRsrNAAxrQ+NDYjpZdBBrQgMaHxna06CLQgAY0PjR2T4suAg1oQONDY/e06CLQgAY0PjR2zzldBRrQgMaHJoABDWhA40JjdydgQAMa0ETR2N3Nuwk0oAGND00AAxrQgMaFJgUDGtCAJorG7mpWCAxoQAOanGjsrmbdBRrQgMaHJgMGNKABjQeN3dU0AQMa0IAmhsbubNpdoAENaHxo7M6mPQQa0IDGh8bubNJDoAENaHxoAhjQgAY0LjR2RwIGNKABTRSN3XH2+QINaEDjQxPAgAY0oHGhScGABjSgiaKx2xsXAgMa0IAmJxq7vfEFAg1oQONDkwEDGtCAxoPGbs9LwIAGNKCJobHb8i4QaEADGh8auy2vp0ADGtD40NhtZ/UUaEADGh+aAAY0oAGNC43dmoABDWhAE0Vjt57ZS6ABDWh8aAIY0IAGNC40KRjQgAY0UTR2S6NCYEADGtDkRGO3NOot0IAGND40GTCgAQ1oPGjsloYJGNCABjQxNHZzw94CDWhA40NjNze8UKABDWh8aOzmMy4UaEADGh+aAAY0oAGNC43dlIABDWhAE0VjN53eR6ABDWh8aAIY0IAGNC40KRjQgAY0UTS2vUEhMKABDWhyorHtDfoKNKABjQ9NBgxoQAMaDxrbXj8BAxrQgCaGxrbV7yvQgAY0PjS2rX4/gQY0oPGhsW31+gk0oAGND00AAxrQgMaFxrYmYEADGtBE0djWehcJNKABjQ+NbT3tIoEGNKDxoQlgQAMa0LjQ2JYEDGhAA5ooGttyan+BBjSg8aEJYEADGtC40KRgQAMa0ETR2Oa6hcCABjSgyYnGNtcdINCABjQ+NBkwoAENaDxobHOdBAxoQAOaGBrbVGeAQAMa0PjQ2KY6AwUa0IDGh8Y21R4o0IAGND40trH2QIEGNKDxobGNtS8WaEADGh8a21jrYoEGNKDxoQlgQAMa0LjQ2IYEDGhAA5ooGttwyiCBBjSg8aEJYEADGtC40KRgQAMa0ETR2PqahcCABjSgyYnG1tccLNCABjQ+NBkwoAENaDxobH2NBAxoQAOaGBpbV2OwQAMa0PjQ2Loalwg0oAGND42tO/kSgQY0oPGhCWBAAxrQuNDYjQkY0IAGNFE0duNJlwo0oAGND00AAxrQgMaFJgUDGtCAJorG1lYvBAY0oAFNTjS2tvplAg1oQONDkwEDGtCAxoPG1lZLwIAGNKCJobE11S4TaEADGh8aW1NtiEADGtD40NiaqkMEGtCAxocmgAENaEDjQmM3JGBAAxrQRNHYDSdeLtCABjQ+NAEMaEADGheaFAxoQAOaKBpbXaUQGNCABjQ50djqKkMFGtCAxocmAwY0oAGNB42trpyAAQ1oQBNDY6sqDxVoQAMaHxpbVXmYQAMa0PjQ2KpKwwQa0IDGhyaAAQ1oQONCYysTMKABDWiiaGxlpeECDWhA40NjK08YLtCABjQ+NAEMaEADGhcauz4BAxrQgCaKxq6veIVAAxrQ+NAEMKABDWhcaFIwoAENaKJobEWFQmBAAxrQ5ERjKyqMEGhAAxofmgwY0IAGNB40tqJ8AgY0oAFNDI0tLz9CoAENaHxobHn5kQINaEDjQ2PLy40UaEADGh+aAAY0oAGNC40tS8CABjSgiaKxZcdfKdCABjQ+NAEMaEADGheaFAxoQAOaKBpbWrYQGNCABjQ50djSslcJNKABjQ9NBgxoQAMaDxpbWiYBAxrQgCaGxpaUGSXQgAY0PjS2pMwogQY0oPGhsSWlAxjQgAY0cTQBDGhAAxoXGltcerRAAxrQ+NDY4uNGCzSgAY0PTQADGtCAxoUmBQMa0IAmisYWlRoj0IAGND40tqjUGIEGNKDxocmCAQ1oQBNHY4tKpmBAAxrQ5EZjC0teLdCABjQ+NLaw5NUCDWhA40NjC48NYEADGtDE0QQwoAENaFxo7Lpjxwo0oAGND41dd8xYgQY0oPGhCWBAAxrQuNCkYEADGtBE0diCEuMEGtCAxofGFpQYJ9CABjQ+NFkwoAENaOJobEHxFAxoQAOa3GhsfvHxAg1oQONDY/OLjxdoQAMaHxqbf3QAAxrQgCaOJoABDWhA40Jj846eINCABjQ+NDbvqAkCDWhA40MTwIAGNKBxoUnBgAY0oImisblHXiPQgAY0PjQ298hrBBrQgMaHJgsGNKABTRzN78CABjSgyY3G5hwxUaABDWh8aGzOERMFGtCAxocmCwY0oAFNHI3NKZaCAQ1oQJMbjc0uNkmgAQ1ofGhsdrFJAg1oQONDY7OLBjCgAQ1o4mgCGNCABjQuNDar6GSBBjSg8aGxWYdPFmhAAxofmgAGNKABjQtNCgY0oAFNFI3NPGyKQAMa0PjQ2MzDpgg0oAGND00WDGhAA5o4GptZJAUDGtCAJjcam1HkWoEGNKDxobEZRa4VaEADGh8am3FoAAMa0IAmjiaAAQ1oQONCY9MPnSrQgAY0PjQ2/ZCpAg1oQONDE8CABjSgcaFJwYAGNKCJorFpNk2gAQ1ofGj+ByMT5OTD2qptAAAAAElFTkSuQmCC"}},computed:{...xt(["host"]),seriesGenres(){return this.normalizeGenres(this.showData.genre)},seriesMeta(){if(!this.showData)return[];const s=[],e=this.normalizeText(this.showData.status);e&&s.push({label:"Status",value:e});const t=this.normalizeText(this.showData.network);t&&s.push({label:"Network",value:t});const i=this.formatAirs(this.showData.airsDayOfWeek,this.showData.airsTime);i&&s.push({label:"Airs",value:i});const r=this.formatRuntime(this.showData.runtime);r&&s.push({label:"Runtime",value:r});const n=this.normalizeText(this.showData.rating);n&&s.push({label:"Content rating",value:n});const a=this.formatCommunityRating(this.showData.siteRating,this.showData.siteRatingCount);a&&s.push({label:"Community rating",value:a});const o=this.formatPopularity(this.showData.popularity);return o&&s.push({label:"Popularity",value:o}),s}},watch:{$route(s,e){this.loadInfo(),this.loadEpisodes()}},async created(){this.loadInfo(),this.loadEpisodes()},methods:{normalizeText(s){if(s==null)return null;const e=String(s).trim();return e.length>0?e:null},normalizeGenres(s){if(!s)return[];if(Array.isArray(s))return s.map(e=>String(e).trim()).filter(Boolean);if(typeof s=="string"){const e=s.trim();if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(Boolean)}catch{}return e.split(",").map(t=>t.trim()).filter(Boolean)}return[]},formatRuntime(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;const t=Math.floor(e/60),i=Math.round(e%60);return t>0&&i>0?`${t}h ${i}m`:t>0?`${t}h`:`${i}m`},formatAirs(s,e){const t=this.normalizeText(s),i=this.normalizeText(e);return t&&i?`${t} ${i}`:t||i||null},formatCommunityRating(s,e){const t=Number(s);if(!Number.isFinite(t)||t<=0)return null;const i=Math.round(t*10)/10,r=Number(e);return Number.isFinite(r)&&r>0?`${i} (${this.formatCount(r)})`:String(i)},formatCount(s){return Number.isFinite(s)?s>=1e6?`${Math.round(s/1e5)/10}m`:s>=1e3?`${Math.round(s/100)/10}k`:`${Math.round(s)}`:null},formatPopularity(s){const e=Number(s);return!Number.isFinite(e)||e<=0?null:String(Math.round(e*10)/10)},async loadInfo(){this.showData=await ie.seriesLibrary.getInfo(this.$route.params.seriesId);const s=new Image;s.src=this.host+"/series/"+this.showData.id+"/poster",s.onload=()=>{this.posterUrl=s.src,this.posterLoaded=!0},s.onerror=()=>{this.posterLoaded=!0}},async loadEpisodes(){let s=await ie.seriesLibrary.getEpisodes(this.$route.params.seriesId),e=[];s.forEach(function(i,r){e[i.airedSeason]||(e[i.airedSeason]=[]),e[i.airedSeason].push(i)});let t={};e.forEach(function(i,r){i.sort((n,a)=>n.airedEpisodeNumber-a.airedEpisodeNumber),t["Season "+r]||(t["Season "+r]=i)}),this.series=t}}};var bF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[e.showData&&e.posterLoaded?t("div",{staticClass:"show"},[t("div",{staticClass:"info-container"},[t("div",{staticClass:"info"},[t("div",{staticClass:"poster"},[t("img",{attrs:{src:e.posterUrl,alt:""}})]),t("div",{staticClass:"right"},[t("h2",[e._v(e._s(e.showData.seriesName))]),t("span",{staticClass:"year"},[e._v("First aired on "+e._s(e.showData.firstAired))]),e.seriesMeta.length?t("div",{staticClass:"meta"},e._l(e.seriesMeta,function(i){return t("div",{key:i.label,staticClass:"meta-item"},[t("span",{staticClass:"meta-label"},[e._v(e._s(i.label))]),t("span",{staticClass:"meta-value"},[e._v(e._s(i.value))])])}),0):e._e(),t("p",[e._v(" "+e._s(e.showData.overview)+" ")]),e.seriesGenres.length?t("ul",{staticClass:"genres"},e._l(e.seriesGenres,function(i){return t("li",{staticClass:"genre"},[e._v(" "+e._s(i)+" ")])}),0):e._e()])])]),t("div",{staticClass:"episodes"},e._l(e.series,function(i,r){return t("EpisodeList",{key:r,attrs:{episodes:i,show:e.showData,title:r}})}),1)]):e._e()])},SF=[],EF=ve(yF,bF,SF,!1,null,"aeea6ebb");const _F=EF.exports;var xF={prefix:"fas",iconName:"copy",icon:[448,512,[],"f0c5","M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"]};const AF=Oe(xF),TF={name:"FileList",components:{FontAwesomeIcon:Jt},props:["files"],computed:{iconCopy:()=>AF},methods:{getUrl:async function(s){let e=await ie.sessions.create(s,{noremux:!0});return ie.sessions.getStreamUrl(e.sessionId)},copyUrl:async function(s){this.$modal.show("CopyText",{title:"Copy URL",text:await this.getUrl(s)})}}};var wF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"file-list-container"},[e.files.length>0?t("ul",{staticClass:"file-list"},e._l(e.files,function(i,r){return t("li",{key:i.id,staticClass:"file-list-item"},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"badge"},[e._v(e._s(i.extension))]),t("div",{staticClass:"file-item-right"},[t("span",{staticClass:"copy",on:{click:function(n){return e.copyUrl(i.id)}}},[t("FontAwesomeIcon",{attrs:{icon:e.iconCopy}})],1)])])}),0):e._e(),e.files.length===0?t("div",{staticClass:"error"},[t("span",{staticClass:"msg"},[e._v("No files linked")])]):e._e()])},CF=[],LF=ve(TF,wF,CF,!1,null,"00186396");const wE=LF.exports,IF={name:"MovieInfo",components:{MovieList:Ta,FileList:wE},data(){return{movieData:{},sets:[],endGradient:"",infoBottom:0,posterLoaded:!1,posterUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAAEsCAYAAACPEVzEAAANtklEQVR4nO3Y6dvOdR7G8U8pWihClhCKLIWiblmy5NZt3wohRCVEIUuW7Gt2IbIv7RullNKilNK+7/u+TTPNNDPNdM6D7/W7fndPru/nQfOk4/3g/Se8jvM4Tjs4qJEODm6kg4Mb6uDghnr+kqQz9PylZ+iFbKfrhctO14tJQxroxSEN9NKQBnrp8vrZXh5aXy8PrRcaVk+vDKunV4adpleGh14dfppeveLUbK+NOFWvjagbGllXr4+sq9dH1tHrV4beuLKO3riqdrY3R9XWm6NqhUbX0luja+mt0aforTGht8ecorevrpntnbE19c7YGqFxNfTuuBp6d9zJend86L3xJ+u98SfpvQmh9yecpPevqZ7tg4nV9cHEaqFJ1fThpGr6cFJVfTi5qj6aXFUfTT5RH00JfTzlRH18bZVsn0ytok+mVg5Nq6xPp1XWp9Mq6dPpoc+mV9JnM07I9vnME/T5zIqhWRX1xayK+mJWBX0xO/Tl7Ar6ck75bF/NLa+v5pYLzSunr+eV09fzjtfX80PfzD9e3ywom+3bBWX17XVlsn23sIy+W1g6tKi0vl9UWt8vOk7fLw79sPg4/bCkVLYfl5bSj0tLhpaV1F+WHRtaHvpp+TH6aUXaX68vkbayhP62snhoVejnVUfr59Vpf7/hqLQ1R+kfa44MrQ39svYI/XJj2j/XFftd/1pfNG1DUf17w+GhjaFfNx6mXzel/WdzkbQtRfTfLYeGtoZ+23qIftuWpu0me25QI4EGNKDxobHnBjUSaEADGh8ae+7iMwUa0IDGhyaAAQ1oQONCY88mYEADGtBE0dizA88UaEADGh8ae3bgWQINaEDjQ5MBAxrQgMaDxg4MSMCABjSgiaGxAwPOEmhAAxofGjswIE+gAQ1ofGjsQP88gQY0oPGhsWf65wk0oAGND4090z9PoAENaHxo7JmLGgs0oAGND00AAxrQgMaFxp5OwIAGNKCJorGn+zUWaEADGh8ae7rf2QINaEDjQ5MBAxrQgMaDxvb3TcCABjSgiaGx/X3PFmhAAxofGtvft4lAAxrQ+NDY/j5NBBrQgMaHxp7q00SgAQ1ofGjsqT5NBBrQgMaHxp66sKlAAxrQ+NAEMKABDWhcaOzJBAxoQAOaKBp7sndTgQY0oPGhsSd7NxNoQAMaH5oMGNCABjQeNLavVwIGNKABTQyN7evVTKABDWh8aGxfr+YCDWhA40Nj+3o2F2hAAxofGnuiZ3OBBjSg8aGxJ3o2F2hAAxofGnvignMEGtCAxocmgAENaEDjQmOPJ2BAAxrQRNHY4+efI9CABjQ+NPb4+S0EGtCAxocmAwY0oAGNB4091iMBAxrQgCaGxh7r0UKgAQ1ofGjssR4tBRrQgMaHJgMGNKABjQeNPdo9AQMa0IAmhsYe7d5KoAENaHxoMmBAAxrQeNDY3m4JGNCABjQxNLa3WyuBBjSg8aGxvd1aCzSgAY0Pje3t2lqgAQ1ofGjska6tBRrQgMaHxh7p2lqgAQ1ofGjskS7nCjSgAY0PTQADGtCAxoXGHk7AgAY0oImisYc7nyvQgAY0PjT2cOc2Ag1oQONDkwEDGtCAxoPG9nRKwIAGNKCJobE9ndoINKABjQ+N7emUL9CABjQ+NLanY77+KDSPggY0f3I09lDHfP2RaFga0PyZ0dhDHfMFGtCAxofGHurQVqABDWh8aAIY0IAGNC409mACBjSgAU0UjT3Yvq3+32h4z0DzZ0FjD7Y/T6ABDWh8aDJgQAMa0HjQ2O52CRjQgAY0MTS2u915Ag1oQONDY7vbFQg0oAGND43tLigQaEADGh8ae6CgQKABDWh8aOyBggKBBjSg8aGxB85rJ9CABjQ+NAEMaEADGhcauz8BAxrQgCaKxu5v206gAQ1ofGjs/rbtBRrQgMaHJgMGNKABjQeN7cpPwIAGNKCJobFd+e0FGtCAxofGduV3EGhAAxofGtvVpoNAAxrQ+NDYfW06CDSgAY0Pjd3XpoNAAxrQ+NDYfed2FGhAAxofmgAGNKABjQuN3ZuAAQ1oQBNFY/e27ijQgAY0PjR2b+tOAg1oQONDkwEDGtCAxoPGdrZKwIAGNKCJobGdrToJNKABjQ+N7WzVWaABDWh8aGxny84CDWhA40NjO1p2FmhAAxofGtvRsrNAAxrQ+NDYjpZdBBrQgMaHxna06CLQgAY0PjR2T4suAg1oQONDY/e06CLQgAY0PjR2zzldBRrQgMaHJoABDWhA40JjdydgQAMa0ETR2N3Nuwk0oAGND00AAxrQgMaFJgUDGtCAJorG7mpWCAxoQAOanGjsrmbdBRrQgMaHJgMGNKABjQeN3dU0AQMa0IAmhsbubNpdoAENaHxo7M6mPQQa0IDGh8bubNJDoAENaHxoAhjQgAY0LjR2RwIGNKABTRSN3XH2+QINaEDjQxPAgAY0oHGhScGABjSgiaKx2xsXAgMa0IAmJxq7vfEFAg1oQONDkwEDGtCAxoPGbs9LwIAGNKCJobHb8i4QaEADGh8auy2vp0ADGtD40NhtZ/UUaEADGh+aAAY0oAGNC43dmoABDWhAE0Vjt57ZS6ABDWh8aAIY0IAGNC40KRjQgAY0UTR2S6NCYEADGtDkRGO3NOot0IAGND40GTCgAQ1oPGjsloYJGNCABjQxNHZzw94CDWhA40NjNze8UKABDWh8aOzmMy4UaEADGh+aAAY0oAGNC43dlIABDWhAE0VjN53eR6ABDWh8aAIY0IAGNC40KRjQgAY0UTS2vUEhMKABDWhyorHtDfoKNKABjQ9NBgxoQAMaDxrbXj8BAxrQgCaGxrbV7yvQgAY0PjS2rX4/gQY0oPGhsW31+gk0oAGND00AAxrQgMaFxrYmYEADGtBE0djWehcJNKABjQ+NbT3tIoEGNKDxoQlgQAMa0LjQ2JYEDGhAA5ooGttyan+BBjSg8aEJYEADGtC40KRgQAMa0ETR2Oa6hcCABjSgyYnGNtcdINCABjQ+NBkwoAENaDxobHOdBAxoQAOaGBrbVGeAQAMa0PjQ2KY6AwUa0IDGh8Y21R4o0IAGND40trH2QIEGNKDxobGNtS8WaEADGh8a21jrYoEGNKDxoQlgQAMa0LjQ2IYEDGhAA5ooGttwyiCBBjSg8aEJYEADGtC40KRgQAMa0ETR2PqahcCABjSgyYnG1tccLNCABjQ+NBkwoAENaDxobH2NBAxoQAOaGBpbV2OwQAMa0PjQ2Loalwg0oAGND42tO/kSgQY0oPGhCWBAAxrQuNDYjQkY0IAGNFE0duNJlwo0oAGND00AAxrQgMaFJgUDGtCAJorG1lYvBAY0oAFNTjS2tvplAg1oQONDkwEDGtCAxoPG1lZLwIAGNKCJobE11S4TaEADGh8aW1NtiEADGtD40NiaqkMEGtCAxocmgAENaEDjQmM3JGBAAxrQRNHYDSdeLtCABjQ+NAEMaEADGheaFAxoQAOaKBpbXaUQGNCABjQ50djqKkMFGtCAxocmAwY0oAGNB42trpyAAQ1oQBNDY6sqDxVoQAMaHxpbVXmYQAMa0PjQ2KpKwwQa0IDGhyaAAQ1oQONCYysTMKABDWiiaGxlpeECDWhA40NjK08YLtCABjQ+NAEMaEADGhcauz4BAxrQgCaKxq6veIVAAxrQ+NAEMKABDWhcaFIwoAENaKJobEWFQmBAAxrQ5ERjKyqMEGhAAxofmgwY0IAGNB40tqJ8AgY0oAFNDI0tLz9CoAENaHxobHn5kQINaEDjQ2PLy40UaEADGh+aAAY0oAGNC40tS8CABjSgiaKxZcdfKdCABjQ+NAEMaEADGheaFAxoQAOaKBpbWrYQGNCABjQ50djSslcJNKABjQ9NBgxoQAMaDxpbWiYBAxrQgCaGxpaUGSXQgAY0PjS2pMwogQY0oPGhsSWlAxjQgAY0cTQBDGhAAxoXGltcerRAAxrQ+NDY4uNGCzSgAY0PTQADGtCAxoUmBQMa0IAmisYWlRoj0IAGND40tqjUGIEGNKDxocmCAQ1oQBNHY4tKpmBAAxrQ5EZjC0teLdCABjQ+NLaw5NUCDWhA40NjC48NYEADGtDE0QQwoAENaFxo7Lpjxwo0oAGND41dd8xYgQY0oPGhCWBAAxrQuNCkYEADGtBE0diCEuMEGtCAxofGFpQYJ9CABjQ+NFkwoAENaOJobEHxFAxoQAOa3GhsfvHxAg1oQONDY/OLjxdoQAMaHxqbf3QAAxrQgCaOJoABDWhA40Jj846eINCABjQ+NDbvqAkCDWhA40MTwIAGNKBxoUnBgAY0oImisblHXiPQgAY0PjQ298hrBBrQgMaHJgsGNKABTRzN78CABjSgyY3G5hwxUaABDWh8aGzOERMFGtCAxocmCwY0oAFNHI3NKZaCAQ1oQJMbjc0uNkmgAQ1ofGhsdrFJAg1oQONDY7OLBjCgAQ1o4mgCGNCABjQuNDar6GSBBjSg8aGxWYdPFmhAAxofmgAGNKABjQtNCgY0oAFNFI3NPGyKQAMa0PjQ2MzDpgg0oAGND00WDGhAA5o4GptZJAUDGtCAJjcam1HkWoEGNKDxobEZRa4VaEADGh8am3FoAAMa0IAmjiaAAQ1oQONCY9MPnSrQgAY0PjQ2/ZCpAg1oQONDE8CABjSgcaFJwYAGNKCJorFpNk2gAQ1ofGj+ByMT5OTD2qptAAAAAElFTkSuQmCC"}},computed:{...xt(["host"]),movieGenres(){return this.normalizeGenres(this.movieData.genres||this.movieData.genre)},movieMeta(){if(!this.movieData)return[];const s=[],e=this.formatRuntime(this.movieData.runtime);e&&s.push({label:"Runtime",value:e});const t=this.formatLanguage(this.movieData.originalLanguage);t&&s.push({label:"Language",value:t});const i=this.normalizeText(this.movieData.originalName);i&&i!==this.movieData.movieName&&s.push({label:"Original title",value:i});const r=this.normalizeText(this.movieData.tagline);r&&s.push({label:"Tagline",value:r});const n=this.formatCurrency(this.movieData.budget);n&&s.push({label:"Budget",value:n});const a=this.formatCurrency(this.movieData.revenue);a&&s.push({label:"Revenue",value:a});const o=this.formatPopularity(this.movieData.popularity);return o&&s.push({label:"Popularity",value:o}),s}},watch:{async $route(s,e){await this.update()}},async mounted(){this.updateGradient(),window.addEventListener("resize",this.updateGradient),window.addEventListener("scroll",this.updateGradient)},async updated(){this.updateGradient()},async created(){await this.update()},async beforeUnmount(){window.removeEventListener("resize",this.updateGradient),window.removeEventListener("scroll",this.updateGradient)},methods:{playMovie:function(s){s.preventDefault(),this.$store.dispatch("playMovie",this.movieData.id)},openModal:function(s){this.$modal.show("MovieDialog",{movie:this.movieData})},update:async function(){this.movieData=await ie.movieLibrary.getInfo(this.$route.params.movieId),this.sets=await ie.movieLibrary.getMovieSets(this.$route.params.movieId);const s=new Image;s.src=this.host+"/movie/"+this.movieData.id+"/poster",s.onload=()=>{this.posterUrl=s.src,this.posterLoaded=!0},s.onerror=()=>{this.posterLoaded=!0}},gradientColor:function(){if(!this.$refs.infoContainer)return[0,0,0];let s=this.$refs.infoContainer.getBoundingClientRect().bottom,e=window.innerHeight,t=e*.36;var i=s/t,r=1-i,n=[Math.round(105*r+85*i),Math.round(96*r+83*i),Math.round(96*r+91*i)];return s-t<0||(i=(s-t)/(e-t),r=1-i,n=[Math.round(85*r+40*i),Math.round(83*r+52*i),Math.round(91*r+59*i)]),n},updateGradient:function(){let s=this.gradientColor();this.endGradient=`rgb(${s[0]}, ${s[1]}, ${s[2]})`},normalizeText(s){if(s==null)return null;const e=String(s).trim();return e.length>0?e:null},normalizeGenres(s){if(!s)return[];if(Array.isArray(s))return s.map(e=>String(e).trim()).filter(Boolean);if(typeof s=="string"){const e=s.trim();if(!e)return[];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(i=>String(i).trim()).filter(Boolean)}catch{}return e.split(",").map(t=>t.trim()).filter(Boolean)}return[]},formatRuntime(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;const t=Math.floor(e/60),i=Math.round(e%60);return t>0&&i>0?`${t}h ${i}m`:t>0?`${t}h`:`${i}m`},formatLanguage(s){const e=this.normalizeText(s);return e?e.length<=3?e.toUpperCase():e:null},formatCurrency(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}catch{return`$${Math.round(e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}`}},formatPopularity(s){const e=Number(s);return!Number.isFinite(e)||e<=0?null:String(Math.round(e*10)/10)}}};var RF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("div",{staticClass:"movie"},[e.movieData.id?t("div",{ref:"infoContainer",staticClass:"info-container",style:{backgroundImage:"linear-gradient(to bottom, rgba(255,255,255, 0) 40%, "+e.endGradient+" 80%), url("+e.host+"/movie/"+e.movieData.id+"/fanart)"}},[e.posterLoaded?t("div",{staticClass:"info"},[t("div",{staticClass:"poster"},[t("img",{attrs:{src:e.posterUrl,alt:""}}),t("a",{staticClass:"play",on:{click:e.playMovie}},[t("i",{staticClass:"fa fa-play",attrs:{"aria-hidden":"true"}})])]),t("div",{staticClass:"right"},[t("h2",[e._v(e._s(e.movieData.movieName))]),t("span",{staticClass:"year"},[e._v("First released on "+e._s(e.movieData.releaseDate))]),e.movieMeta.length?t("div",{staticClass:"meta"},e._l(e.movieMeta,function(i){return t("div",{key:i.label,staticClass:"meta-item"},[t("span",{staticClass:"meta-label"},[e._v(e._s(i.label))]),t("span",{staticClass:"meta-value"},[e._v(e._s(i.value))])])}),0):e._e(),t("p",[e._v(" "+e._s(e.movieData.overview)+" ")]),e.movieGenres.length?t("ul",{staticClass:"genres"},e._l(e.movieGenres,function(i){return t("li",{staticClass:"genre"},[e._v(" "+e._s(i)+" ")])}),0):e._e()])]):e._e()]):e._e(),t("FileList",{attrs:{files:e.movieData.Files||[]}}),e._l(e.sets,function(i,r){return t("MovieList",{key:i.id,attrs:{title:i.setName,movies:i.Movies}})})],2)])},DF=[],kF=ve(IF,RF,DF,!1,null,"972137a1");const PF=kF.exports,OF={name:"EpisodeInfo",components:{FileList:wE},data(){return{episodeData:{},endGradient:"",posterLoaded:!1,posterUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAAEsCAYAAACPEVzEAAANtklEQVR4nO3Y6dvOdR7G8U8pWihClhCKLIWiblmy5NZt3wohRCVEIUuW7Gt2IbIv7RullNKilNK+7/u+TTPNNDPNdM6D7/W7fndPru/nQfOk4/3g/Se8jvM4Tjs4qJEODm6kg4Mb6uDghnr+kqQz9PylZ+iFbKfrhctO14tJQxroxSEN9NKQBnrp8vrZXh5aXy8PrRcaVk+vDKunV4adpleGh14dfppeveLUbK+NOFWvjagbGllXr4+sq9dH1tHrV4beuLKO3riqdrY3R9XWm6NqhUbX0luja+mt0aforTGht8ecorevrpntnbE19c7YGqFxNfTuuBp6d9zJend86L3xJ+u98SfpvQmh9yecpPevqZ7tg4nV9cHEaqFJ1fThpGr6cFJVfTi5qj6aXFUfTT5RH00JfTzlRH18bZVsn0ytok+mVg5Nq6xPp1XWp9Mq6dPpoc+mV9JnM07I9vnME/T5zIqhWRX1xayK+mJWBX0xO/Tl7Ar6ck75bF/NLa+v5pYLzSunr+eV09fzjtfX80PfzD9e3ywom+3bBWX17XVlsn23sIy+W1g6tKi0vl9UWt8vOk7fLw79sPg4/bCkVLYfl5bSj0tLhpaV1F+WHRtaHvpp+TH6aUXaX68vkbayhP62snhoVejnVUfr59Vpf7/hqLQ1R+kfa44MrQ39svYI/XJj2j/XFftd/1pfNG1DUf17w+GhjaFfNx6mXzel/WdzkbQtRfTfLYeGtoZ+23qIftuWpu0me25QI4EGNKDxobHnBjUSaEADGh8ae+7iMwUa0IDGhyaAAQ1oQONCY88mYEADGtBE0dizA88UaEADGh8ae3bgWQINaEDjQ5MBAxrQgMaDxg4MSMCABjSgiaGxAwPOEmhAAxofGjswIE+gAQ1ofGjsQP88gQY0oPGhsWf65wk0oAGND4090z9PoAENaHxo7JmLGgs0oAGND00AAxrQgMaFxp5OwIAGNKCJorGn+zUWaEADGh8ae7rf2QINaEDjQ5MBAxrQgMaDxvb3TcCABjSgiaGx/X3PFmhAAxofGtvft4lAAxrQ+NDY/j5NBBrQgMaHxp7q00SgAQ1ofGjsqT5NBBrQgMaHxp66sKlAAxrQ+NAEMKABDWhcaOzJBAxoQAOaKBp7sndTgQY0oPGhsSd7NxNoQAMaH5oMGNCABjQeNLavVwIGNKABTQyN7evVTKABDWh8aGxfr+YCDWhA40Nj+3o2F2hAAxofGnuiZ3OBBjSg8aGxJ3o2F2hAAxofGnvignMEGtCAxocmgAENaEDjQmOPJ2BAAxrQRNHY4+efI9CABjQ+NPb4+S0EGtCAxocmAwY0oAGNB4091iMBAxrQgCaGxh7r0UKgAQ1ofGjssR4tBRrQgMaHJgMGNKABjQeNPdo9AQMa0IAmhsYe7d5KoAENaHxoMmBAAxrQeNDY3m4JGNCABjQxNLa3WyuBBjSg8aGxvd1aCzSgAY0Pje3t2lqgAQ1ofGjska6tBRrQgMaHxh7p2lqgAQ1ofGjskS7nCjSgAY0PTQADGtCAxoXGHk7AgAY0oImisYc7nyvQgAY0PjT2cOc2Ag1oQONDkwEDGtCAxoPG9nRKwIAGNKCJobE9ndoINKABjQ+N7emUL9CABjQ+NLanY77+KDSPggY0f3I09lDHfP2RaFga0PyZ0dhDHfMFGtCAxofGHurQVqABDWh8aAIY0IAGNC409mACBjSgAU0UjT3Yvq3+32h4z0DzZ0FjD7Y/T6ABDWh8aDJgQAMa0HjQ2O52CRjQgAY0MTS2u915Ag1oQONDY7vbFQg0oAGND43tLigQaEADGh8ae6CgQKABDWh8aOyBggKBBjSg8aGxB85rJ9CABjQ+NAEMaEADGhcauz8BAxrQgCaKxu5v206gAQ1ofGjs/rbtBRrQgMaHJgMGNKABjQeN7cpPwIAGNKCJobFd+e0FGtCAxofGduV3EGhAAxofGtvVpoNAAxrQ+NDYfW06CDSgAY0Pjd3XpoNAAxrQ+NDYfed2FGhAAxofmgAGNKABjQuN3ZuAAQ1oQBNFY/e27ijQgAY0PjR2b+tOAg1oQONDkwEDGtCAxoPGdrZKwIAGNKCJobGdrToJNKABjQ+N7WzVWaABDWh8aGxny84CDWhA40NjO1p2FmhAAxofGtvRsrNAAxrQ+NDYjpZdBBrQgMaHxna06CLQgAY0PjR2T4suAg1oQONDY/e06CLQgAY0PjR2zzldBRrQgMaHJoABDWhA40JjdydgQAMa0ETR2N3Nuwk0oAGND00AAxrQgMaFJgUDGtCAJorG7mpWCAxoQAOanGjsrmbdBRrQgMaHJgMGNKABjQeN3dU0AQMa0IAmhsbubNpdoAENaHxo7M6mPQQa0IDGh8bubNJDoAENaHxoAhjQgAY0LjR2RwIGNKABTRSN3XH2+QINaEDjQxPAgAY0oHGhScGABjSgiaKx2xsXAgMa0IAmJxq7vfEFAg1oQONDkwEDGtCAxoPGbs9LwIAGNKCJobHb8i4QaEADGh8auy2vp0ADGtD40NhtZ/UUaEADGh+aAAY0oAGNC43dmoABDWhAE0Vjt57ZS6ABDWh8aAIY0IAGNC40KRjQgAY0UTR2S6NCYEADGtDkRGO3NOot0IAGND40GTCgAQ1oPGjsloYJGNCABjQxNHZzw94CDWhA40NjNze8UKABDWh8aOzmMy4UaEADGh+aAAY0oAGNC43dlIABDWhAE0VjN53eR6ABDWh8aAIY0IAGNC40KRjQgAY0UTS2vUEhMKABDWhyorHtDfoKNKABjQ9NBgxoQAMaDxrbXj8BAxrQgCaGxrbV7yvQgAY0PjS2rX4/gQY0oPGhsW31+gk0oAGND00AAxrQgMaFxrYmYEADGtBE0djWehcJNKABjQ+NbT3tIoEGNKDxoQlgQAMa0LjQ2JYEDGhAA5ooGttyan+BBjSg8aEJYEADGtC40KRgQAMa0ETR2Oa6hcCABjSgyYnGNtcdINCABjQ+NBkwoAENaDxobHOdBAxoQAOaGBrbVGeAQAMa0PjQ2KY6AwUa0IDGh8Y21R4o0IAGND40trH2QIEGNKDxobGNtS8WaEADGh8a21jrYoEGNKDxoQlgQAMa0LjQ2IYEDGhAA5ooGttwyiCBBjSg8aEJYEADGtC40KRgQAMa0ETR2PqahcCABjSgyYnG1tccLNCABjQ+NBkwoAENaDxobH2NBAxoQAOaGBpbV2OwQAMa0PjQ2Loalwg0oAGND42tO/kSgQY0oPGhCWBAAxrQuNDYjQkY0IAGNFE0duNJlwo0oAGND00AAxrQgMaFJgUDGtCAJorG1lYvBAY0oAFNTjS2tvplAg1oQONDkwEDGtCAxoPG1lZLwIAGNKCJobE11S4TaEADGh8aW1NtiEADGtD40NiaqkMEGtCAxocmgAENaEDjQmM3JGBAAxrQRNHYDSdeLtCABjQ+NAEMaEADGheaFAxoQAOaKBpbXaUQGNCABjQ50djqKkMFGtCAxocmAwY0oAGNB42trpyAAQ1oQBNDY6sqDxVoQAMaHxpbVXmYQAMa0PjQ2KpKwwQa0IDGhyaAAQ1oQONCYysTMKABDWiiaGxlpeECDWhA40NjK08YLtCABjQ+NAEMaEADGhcauz4BAxrQgCaKxq6veIVAAxrQ+NAEMKABDWhcaFIwoAENaKJobEWFQmBAAxrQ5ERjKyqMEGhAAxofmgwY0IAGNB40tqJ8AgY0oAFNDI0tLz9CoAENaHxobHn5kQINaEDjQ2PLy40UaEADGh+aAAY0oAGNC40tS8CABjSgiaKxZcdfKdCABjQ+NAEMaEADGheaFAxoQAOaKBpbWrYQGNCABjQ50djSslcJNKABjQ9NBgxoQAMaDxpbWiYBAxrQgCaGxpaUGSXQgAY0PjS2pMwogQY0oPGhsSWlAxjQgAY0cTQBDGhAAxoXGltcerRAAxrQ+NDY4uNGCzSgAY0PTQADGtCAxoUmBQMa0IAmisYWlRoj0IAGND40tqjUGIEGNKDxocmCAQ1oQBNHY4tKpmBAAxrQ5EZjC0teLdCABjQ+NLaw5NUCDWhA40NjC48NYEADGtDE0QQwoAENaFxo7Lpjxwo0oAGND41dd8xYgQY0oPGhCWBAAxrQuNCkYEADGtBE0diCEuMEGtCAxofGFpQYJ9CABjQ+NFkwoAENaOJobEHxFAxoQAOa3GhsfvHxAg1oQONDY/OLjxdoQAMaHxqbf3QAAxrQgCaOJoABDWhA40Jj846eINCABjQ+NDbvqAkCDWhA40MTwIAGNKBxoUnBgAY0oImisblHXiPQgAY0PjQ298hrBBrQgMaHJgsGNKABTRzN78CABjSgyY3G5hwxUaABDWh8aGzOERMFGtCAxocmCwY0oAFNHI3NKZaCAQ1oQJMbjc0uNkmgAQ1ofGhsdrFJAg1oQONDY7OLBjCgAQ1o4mgCGNCABjQuNDar6GSBBjSg8aGxWYdPFmhAAxofmgAGNKABjQtNCgY0oAFNFI3NPGyKQAMa0PjQ2MzDpgg0oAGND00WDGhAA5o4GptZJAUDGtCAJjcam1HkWoEGNKDxobEZRa4VaEADGh8am3FoAAMa0IAmjiaAAQ1oQONCY9MPnSrQgAY0PjQ2/ZCpAg1oQONDE8CABjSgcaFJwYAGNKCJorFpNk2gAQ1ofGj+ByMT5OTD2qptAAAAAElFTkSuQmCC",bannerUrl:""}},computed:{...xt(["host"]),seriesLabel(){const s=this.normalizeText(this.episodeSeriesName);return s?`View ${s}`:null},episodeSeriesName(){return this.episodeData?this.episodeData.Series&&this.episodeData.Series.seriesName?this.episodeData.Series.seriesName:this.normalizeText(this.episodeData.seriesName):null},episodeSubtitle(){const s=Number(this.episodeData.airedSeason),e=Number(this.episodeData.airedEpisodeNumber),t=[];Number.isFinite(s)&&Number.isFinite(e)&&t.push(`S${s}E${e}`);const i=this.normalizeText(this.episodeSeriesName);return i&&t.push(i),t.length?t.join(" • "):null},episodeAirDate(){return this.normalizeText(this.episodeData.firstAired||this.episodeData.aired||this.episodeData.airDate)},episodeMeta(){if(!this.episodeData)return[];const s=[],e=this.formatRuntime(this.episodeData.runtime);e&&s.push({label:"Runtime",value:e});const t=this.normalizeText(this.episodeData.rating);t&&s.push({label:"Content rating",value:t});const i=this.formatCommunityRating(this.episodeData.siteRating,this.episodeData.siteRatingCount);return i&&s.push({label:"Community rating",value:i}),s}},watch:{async $route(s,e){await this.update()}},async mounted(){this.updateGradient(),window.addEventListener("resize",this.updateGradient),window.addEventListener("scroll",this.updateGradient)},async updated(){this.updateGradient()},async created(){await this.update()},async beforeUnmount(){window.removeEventListener("resize",this.updateGradient),window.removeEventListener("scroll",this.updateGradient)},methods:{playEpisode(s){s.preventDefault(),this.$store.dispatch("playEpisode",this.episodeData.id)},viewSeries(s){s.preventDefault();const e=this.episodeData&&this.episodeData.Series&&this.episodeData.Series.id;e&&this.$router.push({name:"SeriesView",params:{seriesId:e}})},async update(){this.posterLoaded=!1,this.episodeData=await ie.episodeLibrary.getInfo(this.$route.params.episodeId),this.bannerUrl=this.host+"/episode/"+this.episodeData.id+"/banner";const s=this.episodeData&&this.episodeData.Series&&this.episodeData.Series.id,e=s?this.host+"/series/"+s+"/poster":this.bannerUrl,t=new Image;t.src=e,t.onload=()=>{this.posterUrl=t.src,this.posterLoaded=!0},t.onerror=()=>{if(t.src!==this.bannerUrl){const i=new Image;i.src=this.bannerUrl,i.onload=()=>{this.posterUrl=i.src,this.posterLoaded=!0},i.onerror=()=>{this.posterLoaded=!0}}else this.posterLoaded=!0}},gradientColor(){if(!this.$refs.infoContainer)return[0,0,0];let s=this.$refs.infoContainer.getBoundingClientRect().bottom,e=window.innerHeight,t=e*.36;var i=s/t,r=1-i,n=[Math.round(105*r+85*i),Math.round(96*r+83*i),Math.round(96*r+91*i)];return s-t<0||(i=(s-t)/(e-t),r=1-i,n=[Math.round(85*r+40*i),Math.round(83*r+52*i),Math.round(91*r+59*i)]),n},updateGradient(){let s=this.gradientColor();this.endGradient=`rgb(${s[0]}, ${s[1]}, ${s[2]})`},normalizeText(s){if(s==null)return null;const e=String(s).trim();return e.length>0?e:null},formatRuntime(s){const e=Number(s);if(!Number.isFinite(e)||e<=0)return null;const t=Math.floor(e/60),i=Math.round(e%60);return t>0&&i>0?`${t}h ${i}m`:t>0?`${t}h`:`${i}m`},formatCommunityRating(s,e){const t=Number(s);if(!Number.isFinite(t)||t<=0)return null;const i=Math.round(t*10)/10,r=Number(e);return Number.isFinite(r)&&r>0?`${i} (${this.formatCount(r)})`:String(i)},formatCount(s){return Number.isFinite(s)?s>=1e6?`${Math.round(s/1e5)/10}m`:s>=1e3?`${Math.round(s/100)/10}k`:`${Math.round(s)}`:null}}};var MF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("div",{staticClass:"episode"},[e.episodeData.id?t("div",{ref:"infoContainer",staticClass:"info-container",style:{backgroundImage:"linear-gradient(to bottom, rgba(255,255,255, 0) 40%, "+e.endGradient+" 80%), url("+e.bannerUrl+")"}},[e.posterLoaded?t("div",{staticClass:"info"},[t("div",{staticClass:"poster"},[t("img",{attrs:{src:e.posterUrl,alt:""}}),t("a",{staticClass:"play",on:{click:e.playEpisode}},[t("i",{staticClass:"fa fa-play",attrs:{"aria-hidden":"true"}})])]),t("div",{staticClass:"right"},[t("h2",[e._v(e._s(e.episodeData.episodeName))]),e.episodeSubtitle?t("span",{staticClass:"year"},[e._v(e._s(e.episodeSubtitle))]):e._e(),e.episodeAirDate?t("span",{staticClass:"year"},[e._v("First aired on "+e._s(e.episodeAirDate))]):e._e(),e.episodeMeta.length?t("div",{staticClass:"meta"},e._l(e.episodeMeta,function(i){return t("div",{key:i.label,staticClass:"meta-item"},[t("span",{staticClass:"meta-label"},[e._v(e._s(i.label))]),t("span",{staticClass:"meta-value"},[e._v(e._s(i.value))])])}),0):e._e(),t("p",[e._v(" "+e._s(e.episodeData.overview)+" ")]),e.seriesLabel?t("div",{staticClass:"series-link"},[t("a",{on:{click:e.viewSeries}},[e._v(e._s(e.seriesLabel))])]):e._e()])]):e._e()]):e._e(),t("FileList",{attrs:{files:e.episodeData.Files||[]}})],1)])},NF=[],FF=ve(OF,MF,NF,!1,null,"9a23d222");const $F=FF.exports,BF={name:"Login",data(){return{credentials:{username:"",password:""}}},computed:xt(["host"]),methods:{async changeHost(){const s=prompt("New host?");s&&(await this.$store.dispatch("updateHost",s),zI(this.$root,s))},async submit(){try{await ie.authenticate(this.credentials.username,this.credentials.password),this.axios.defaults.headers.common={Authorization:`bearer ${ie.accessToken}`},this.$socket.emit("authenticate",{token:ie.accessToken});try{await this.$store.dispatch("updateAll")}catch(s){console.log(s)}this.$router.push({name:"Main"})}catch(s){console.log(s),this.$notify({group:"system",title:"Error occurred",text:"An error occurred during login",type:"error"})}}}};var UF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("div",{staticClass:"form",on:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.submit.apply(null,arguments)}}},[t("div",{staticClass:"logo"},[t("img",{attrs:{src:e.host+"/web/logo.png",alt:""}})]),t("label",{attrs:{for:"username"}},[e._v("Username")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.username,expression:"credentials.username"}],attrs:{id:"username",type:"text"},domProps:{value:e.credentials.username},on:{input:function(i){i.target.composing||e.$set(e.credentials,"username",i.target.value)}}}),t("label",{attrs:{for:"password"}},[e._v("Password")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.credentials.password,expression:"credentials.password"}],attrs:{id:"password",type:"password"},domProps:{value:e.credentials.password},on:{input:function(i){i.target.composing||e.$set(e.credentials,"password",i.target.value)}}}),t("div",{staticClass:"bottom"},[t("span",{staticClass:"server-indicator"},[e._v(e._s(e.host)+" "),t("a",{staticClass:"nav-link",on:{click:e.changeHost}},[e._v("Change")])]),t("button",{attrs:{type:"submit"},on:{click:e.submit}},[e._v(" Login ")])])])])},GF=[],HF=ve(BF,UF,GF,!1,null,"7aba0e1a");const YF=HF.exports,jF={name:"Movies",components:{MovieList:Ta},computed:xt("movies",{movies:s=>s.lists,sets:s=>s.sets}),data(){return{}},created:function(){}};var VF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("MovieList",{attrs:{title:"Recently Added",movies:e.movies.createdAt}}),t("MovieList",{attrs:{title:"Popular movies",movies:e.movies.popularity}}),t("MovieList",{attrs:{title:"Recently released movies",movies:e.movies.releaseDate}}),e._l(e.sets,function(i,r){return t("MovieList",{key:i.id,attrs:{title:i.setName,movies:i.movies}})})],2)},KF=[],WF=ve(jF,VF,KF,!1,null,"8c9bdc91");const zF=WF.exports,QF={name:"Search",components:{MovieList:Ta,EpisodeList:Aa,SeriesList:ac},data(){return{searchResults:{episodes:[],movies:[],shows:[]}}},watch:{async $route(s,e){this.search(s.params.search)}},async created(){this.search(this.$route.params.search)},methods:{async search(s){let[e,t,i]=await Promise.all([ie.episodeLibrary.search(s),ie.movieLibrary.search(s),ie.seriesLibrary.search(s)]);this.searchResults={episodes:e,movies:t,series:i}}}};var qF=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[e.searchResults.movies.length>0?t("MovieList",{attrs:{title:"Movie Results",badge:`${e.searchResults.movies.length}`,movies:e.searchResults.movies}}):e._e(),e.searchResults.episodes.length>0?t("EpisodeList",{attrs:{title:"Episode Results",badge:`${e.searchResults.episodes.length}`,episodes:e.searchResults.episodes}}):e._e(),e.searchResults.series.length>0?t("SeriesList",{attrs:{title:"TV Show Results",badge:`${e.searchResults.series.length}`,series:e.searchResults.series}}):e._e()],1)},XF=[],JF=ve(QF,qF,XF,!1,null,null);const ZF=JF.exports,e4={name:"Main",components:{SeriesList:ac,EpisodeList:Aa,MovieList:Ta},computed:xt({movies:s=>s.movies.lists,series:s=>s.series.lists,episodes:s=>s.episodes.lists}),created(){}};var t4=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("EpisodeList",{attrs:{title:"Recently aired",episodes:e.episodes.firstAired}}),t("SeriesList",{attrs:{title:"Recently added series",series:e.series.createdAt}}),t("EpisodeList",{attrs:{title:"Recently added episodes",episodes:e.episodes.createdAt}}),t("MovieList",{attrs:{title:"Recently added movies",movies:e.movies.createdAt}}),t("SeriesList",{attrs:{title:"Shows watched by others",series:e.series.siteRatingCount}}),t("MovieList",{attrs:{title:"Popular movies",movies:e.movies.popularity}}),t("SeriesList",{attrs:{title:"Best rated series",series:e.series.siteRating}}),t("MovieList",{attrs:{title:"Recently released movies",movies:e.movies.releaseDate}})],1)},s4=[],i4=ve(e4,t4,s4,!1,null,"1ab61151");const r4=i4.exports;var n4={prefix:"fas",iconName:"wrench",icon:[512,512,[],"f0ad","M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"]};const a4=Oe(n4);var o4={prefix:"fas",iconName:"users",icon:[640,512,[],"f0c0","M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"]};const l4=Oe(o4);var c4={prefix:"fas",iconName:"folder-open",icon:[576,512,[],"f07c","M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"]};const u4=Oe(c4);var f4={prefix:"fas",iconName:"file-video",icon:[384,512,[],"f1c8","M384 121.941V128H256V0h6.059c6.365 0 12.47 2.529 16.971 7.029l97.941 97.941A24.005 24.005 0 0 1 384 121.941zM224 136V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248c-13.2 0-24-10.8-24-24zm96 144.016v111.963c0 21.445-25.943 31.998-40.971 16.971L224 353.941V392c0 13.255-10.745 24-24 24H88c-13.255 0-24-10.745-24-24V280c0-13.255 10.745-24 24-24h112c13.255 0 24 10.745 24 24v38.059l55.029-55.013c15.011-15.01 40.971-4.491 40.971 16.97z"]};const d4=Oe(f4);var h4={prefix:"fas",iconName:"tags",icon:[640,512,[],"f02c","M497.941 225.941L286.059 14.059A48 48 0 0 0 252.118 0H48C21.49 0 0 21.49 0 48v204.118a48 48 0 0 0 14.059 33.941l211.882 211.882c18.744 18.745 49.136 18.746 67.882 0l204.118-204.118c18.745-18.745 18.745-49.137 0-67.882zM112 160c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm513.941 133.823L421.823 497.941c-18.745 18.745-49.137 18.745-67.882 0l-.36-.36L527.64 323.522c16.999-16.999 26.36-39.6 26.36-63.64s-9.362-46.641-26.36-63.64L331.397 0h48.721a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882z"]};const p4=Oe(h4);var m4={prefix:"fas",iconName:"image",icon:[512,512,[],"f03e","M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"]};const CE=Oe(m4);var g4={prefix:"fas",iconName:"globe",icon:[496,512,[],"f0ac","M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"]};const v4=Oe(g4);var y4={prefix:"fas",iconName:"server",icon:[512,512,[],"f233","M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"]};const b4=Oe(y4);var S4={prefix:"fas",iconName:"exclamation-triangle",icon:[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]};const E4=Oe(S4);var _4={prefix:"fas",iconName:"signal",icon:[640,512,[],"f012","M36 384h56c6.6 0 12 5.4 12 12v104c0 6.6-5.4 12-12 12H36c-6.6 0-12-5.4-12-12V396c0-6.6 5.4-12 12-12zm116-36v152c0 6.6 5.4 12 12 12h56c6.6 0 12-5.4 12-12V348c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12zm128-80v232c0 6.6 5.4 12 12 12h56c6.6 0 12-5.4 12-12V268c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12zm128-112v344c0 6.6 5.4 12 12 12h56c6.6 0 12-5.4 12-12V156c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12zM536 12v488c0 6.6 5.4 12 12 12h56c6.6 0 12-5.4 12-12V12c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12z"]};const x4=Oe(_4);Gt.library.add(a4,l4,u4,d4,p4,CE,v4,b4,E4,x4);const A4={name:"Settings",components:{FontAwesomeIcon:Jt}};var T4=function(){var e=this,t=e._self._c;return t("div",{staticClass:"settings-layout"},[t("aside",{staticClass:"settings-sidebar"},[t("ul",{staticClass:"nav-list"},[t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"SettingsMaintenance"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"wrench"}}),e._v(" Maintenance ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"SettingsUsers"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"users"}}),e._v(" Users ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"SettingsLibraries"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"folder-open"}}),e._v(" Libraries ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"IndexerSettings"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"file-video"}}),e._v(" Indexer Settings ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"ArtworkSettings"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"image"}}),e._v(" Artwork ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"FederationSettings"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"globe"}}),e._v(" Federation ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"SeedboxSettings"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"server"}}),e._v(" Seedboxes ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"SettingsSets"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"tags"}}),e._v(" Sets ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"ProblematicFiles"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"exclamation-triangle"}}),e._v(" Problematic Files ")],1)],1),t("li",{staticClass:"nav-item"},[t("router-link",{attrs:{to:{name:"ServerStatus"}}},[t("font-awesome-icon",{staticClass:"fa-fw",attrs:{icon:"signal"}}),e._v(" Server Status ")],1)],1)])]),t("main",{staticClass:"settings-content"},[t("router-view")],1)])},w4=[],C4=ve(A4,T4,w4,!1,null,"8bf993aa");const L4=C4.exports;var I4={prefix:"fas",iconName:"sync",icon:[512,512,[],"f021","M440.935 12.574l3.966 82.766C399.416 41.904 331.674 8 256 8 134.813 8 33.933 94.924 12.296 209.824 10.908 217.193 16.604 224 24.103 224h49.084c5.57 0 10.377-3.842 11.676-9.259C103.407 137.408 172.931 80 256 80c60.893 0 114.512 30.856 146.104 77.801l-101.53-4.865c-6.845-.328-12.574 5.133-12.574 11.986v47.411c0 6.627 5.373 12 12 12h200.333c6.627 0 12-5.373 12-12V12c0-6.627-5.373-12-12-12h-47.411c-6.853 0-12.315 5.729-11.987 12.574zM256 432c-60.895 0-114.517-30.858-146.109-77.805l101.868 4.871c6.845.327 12.573-5.134 12.573-11.986v-47.412c0-6.627-5.373-12-12-12H12c-6.627 0-12 5.373-12 12V500c0 6.627 5.373 12 12 12h47.385c6.863 0 12.328-5.745 11.985-12.599l-4.129-82.575C112.725 470.166 180.405 504 256 504c121.187 0 222.067-86.924 243.704-201.824 1.388-7.369-4.308-14.176-11.807-14.176h-49.084c-5.57 0-10.377 3.842-11.676 9.259C408.593 374.592 339.069 432 256 432z"]};const hc=Oe(I4);var R4={prefix:"fas",iconName:"tv",icon:[640,512,[],"f26c","M592 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h245.1v32h-160c-17.7 0-32 14.3-32 32s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-160v-32H592c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h512v288z"]};const LE=Oe(R4);var D4={prefix:"fas",iconName:"film",icon:[512,512,[],"f008","M488 64h-8v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V64H96v20c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12V64h-8C10.7 64 0 74.7 0 88v336c0 13.3 10.7 24 24 24h8v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h320v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h8c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24zM96 372c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm272 208c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm0-168c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm112 152c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40z"]};const IE=Oe(D4);var k4={prefix:"fas",iconName:"broom",icon:[512,512,[],"f51a","M10.8 247.2C-.7 251.8-3.7 266.7 5 275.4l54.8 54.8 73.2-24.4-24.4 73.2 128 128c8.8 8.8 23.6 5.7 28.2-5.8l98.1-243.7-108.4-108.4-243.7 98.1zM507.3 27.3L484.7 4.7c-6.2-6.3-16.4-6.3-22.6 0L359.8 106.9l-40.4-40.4c-4.2-4.3-11.4-3-13.9 2.5l-27.2 58.6 106.1 106.1 58.6-27.2c5.4-2.5 6.7-9.7 2.5-13.9l-40.4-40.4L507.3 49.9c6.3-6.2 6.3-16.3 0-22.6z"]};const P4=Oe(k4);Gt.library.add(hc,LE,IE,P4,CE);const O4={name:"Maintenance",components:{FontAwesomeIcon:Jt},methods:{async triggerMaintenance(s,e){await ie.system.triggerMaintenance(s,e),this.$notify({group:"system",title:"Maintenance task started",text:`Action: ${s}, Target: ${e}`,type:"success"})},async DownloadTVShowArt(){await this.triggerMaintenance("update_artwork","series")},async DownloadMovieArt(){await this.triggerMaintenance("update_artwork","movies")},async index(s){await this.triggerMaintenance("scan",s)},async clean(s){await this.triggerMaintenance("clean",s)},async update(s){await this.triggerMaintenance("update_metadata",s)}}};var M4=function(){var e=this,t=e._self._c;return t("div",{staticClass:"maintenance"},[t("div",{staticClass:"settings-card"},[t("h3",[e._v("Library Indexing")]),t("div",{staticClass:"actions-group"},[t("button",{staticClass:"btn",on:{click:function(i){return e.index("all")}}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Full re-index ")],1),t("button",{staticClass:"btn",on:{click:function(i){return e.index("series")}}},[t("font-awesome-icon",{attrs:{icon:"tv"}}),e._v(" Re-index series ")],1),t("button",{staticClass:"btn",on:{click:function(i){return e.index("movies")}}},[t("font-awesome-icon",{attrs:{icon:"film"}}),e._v(" Re-index movies ")],1)])]),t("div",{staticClass:"settings-card"},[t("h3",[e._v("Library Cleanup")]),t("div",{staticClass:"actions-group"},[t("button",{staticClass:"btn btn-secondary",on:{click:function(i){return e.clean("files")}}},[t("font-awesome-icon",{attrs:{icon:"broom"}}),e._v(" Clean up files database ")],1),t("button",{staticClass:"btn btn-secondary",on:{click:function(i){return e.clean("episodes")}}},[t("font-awesome-icon",{attrs:{icon:"broom"}}),e._v(" Cleanup episodes without linked files ")],1),t("button",{staticClass:"btn btn-secondary",on:{click:function(i){return e.clean("movies")}}},[t("font-awesome-icon",{attrs:{icon:"broom"}}),e._v(" Cleanup movies without linked files ")],1),t("button",{staticClass:"btn btn-secondary",on:{click:function(i){return e.clean("series")}}},[t("font-awesome-icon",{attrs:{icon:"broom"}}),e._v(" Remove Series without episodes ")],1)])]),t("div",{staticClass:"settings-card"},[t("h3",[e._v("Artwork")]),t("div",{staticClass:"actions-group"},[t("button",{staticClass:"btn",on:{click:e.DownloadTVShowArt}},[t("font-awesome-icon",{attrs:{icon:"image"}}),e._v(" Download artwork for TV Shows and Episodes ")],1),t("button",{staticClass:"btn",on:{click:e.DownloadMovieArt}},[t("font-awesome-icon",{attrs:{icon:"image"}}),e._v(" Download artwork for Movies ")],1)])]),t("div",{staticClass:"settings-card"},[t("h3",[e._v("Metadata Updates")]),t("div",{staticClass:"actions-group"},[t("button",{staticClass:"btn",on:{click:function(i){return e.update("episodes")}}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Update episode entries ")],1),t("button",{staticClass:"btn",on:{click:function(i){return e.update("movies")}}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Update movie entries ")],1),t("button",{staticClass:"btn",on:{click:function(i){return e.update("series")}}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Update series entries ")],1),t("button",{staticClass:"btn",on:{click:function(i){return e.update("files")}}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Update file entries ")],1)])])])},N4=[],F4=ve(O4,M4,N4,!1,null,"2e268b76");const k0=F4.exports;var $4={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm415.2 56.7L394.8 467c-1.6 25.3-22.6 45-47.9 45H101.1c-25.3 0-46.3-19.7-47.9-45L32.8 140.7c-.4-6.9 5.1-12.7 12-12.7h358.5c6.8 0 12.3 5.8 11.9 12.7z"]};const xi=Oe($4);var B4={prefix:"fas",iconName:"edit",icon:[576,512,[],"f044","M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"]};const Dh=Oe(B4);Gt.library.add(xi,Dh);const U4={name:"UserEntry",components:{FontAwesomeIcon:Jt},props:{user:{type:Object,required:!0}},methods:{async deleteUser(){confirm(`Are you sure you want to delete user ${this.user.username}?`)&&(await ie.userManager.deleteUser(this.user.id),this.$parent.created())},editUser(){}}};var G4=function(){var e=this,t=e._self._c;return t("tr",[t("td",[e._v(e._s(e.user.id))]),t("td",[e._v(e._s(e.user.name))]),t("td",[e._v(e._s(e.user.username))]),t("td",[e._v(e._s(e.user.email))]),t("td",[e._v(e._s(e.user.group))]),t("td",{staticClass:"actions"},[t("a",{staticClass:"edit",on:{click:e.editUser}},[t("font-awesome-icon",{attrs:{icon:"edit"}})],1),t("a",{staticClass:"delete",on:{click:e.deleteUser}},[t("font-awesome-icon",{attrs:{icon:"trash"}})],1)])])},H4=[],Y4=ve(U4,G4,H4,!1,null,"745851e7");const j4=Y4.exports;var V4={prefix:"fas",iconName:"plus",icon:[448,512,[],"f067","M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"]};const Ca=Oe(V4);Gt.library.add(Ca);const K4={name:"UserManager",components:{userEntry:j4,FontAwesomeIcon:Jt},data(){return{users:{}}},async created(){this.users=await ie.userManager.getUsers()},methods:{async userAdd(){this.$modal.show("UserAdd")}}};var W4=function(){var e=this,t=e._self._c;return t("div",{staticClass:"UserManager"},[t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Users ")]),t("a",{staticClass:"btn",on:{click:e.userAdd}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" Add user ")],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(0),t("tbody",e._l(e.users,function(i,r){return t("user-entry",{key:i.id,attrs:{user:i}})}),1)])])])])},z4=[function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",[s._v("User ID")]),e("th",[s._v("Name")]),e("th",[s._v("Username")]),e("th",[s._v("Email")]),e("th",[s._v("Group")]),e("th",[s._v("Actions")])])])}],Q4=ve(K4,W4,z4,!1,null,"045897c2");const q4=Q4.exports,X4={name:"TagInput",props:{value:{type:Array,required:!0},options:{type:Array,default:()=>[]}},data(){return{selectedOption:""}},computed:{availableOptions(){return this.options.filter(s=>!this.value.includes(s))}},methods:{addTag(){if(this.selectedOption){const s=[...this.value,this.selectedOption];this.$emit("input",s),this.selectedOption=""}},removeTag(s){const e=this.value.filter(t=>t!==s);this.$emit("input",e)}}};var J4=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tag-input"},[t("div",{staticClass:"tags-container"},[e._l(e.value,function(i,r){return t("div",{key:r,staticClass:"tag"},[e._v(" "+e._s(i)+" "),t("span",{staticClass:"remove",on:{click:function(n){return e.removeTag(i)}}},[e._v("×")])])}),e.availableOptions.length>0?t("div",{staticClass:"add-tag-wrapper"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedOption,expression:"selectedOption"}],staticClass:"add-select",on:{change:[function(i){var r=Array.prototype.filter.call(i.target.options,function(n){return n.selected}).map(function(n){var a="_value"in n?n._value:n.value;return a});e.selectedOption=i.target.multiple?r:r[0]},e.addTag]}},[t("option",{attrs:{value:"",disabled:"",selected:""}},[e._v(" + Add... ")]),e._l(e.availableOptions,function(i){return t("option",{key:i,domProps:{value:i}},[e._v(" "+e._s(i)+" ")])})],2)]):e._e()],2)])},Z4=[],e$=ve(X4,J4,Z4,!1,null,"4ca233b6");const t$=e$.exports;Gt.library.add(xi,Ca);const s$={name:"Libraries",components:{FontAwesomeIcon:Jt,TagInput:t$},computed:{...xt("libraries",["shows","movies"]),deleteIcon(){return xi}},data(){return{moviesConfig:{doReIndex:!1,indexBroken:!1,movieIdentifiers:[],movieUpdaters:[]},tvConfig:{doReIndex:!1,indexBroken:!1,ignoreSeriesMismatch:!0,seriesIdentifiers:[],episodeIdentifiers:[],seriesUpdaters:[],episodeUpdaters:[]},capabilities:{movies:{identifiers:[],updaters:[]},tvshows:{seriesIdentifiers:[],episodeIdentifiers:[],seriesUpdaters:[],episodeUpdaters:[]}}}},async created(){this.updateAll(),this.loadConfig()},methods:{...Ql("libraries",["updateAll","deleteMovieLibrary","deleteSeriesLibrary"]),async libraryAdd(s){this.$modal.show("LibraryAdd",{libraryType:s})},async loadConfig(){try{this.capabilities=await ie.system.getCapabilities();const s=await ie.settings.getSection("movies"),e=await ie.settings.getSection("tvshows");this.moviesConfig={...s,movieIdentifiers:s.movieIdentifiers||[],movieUpdaters:s.movieUpdaters||[]},this.tvConfig={...e,seriesIdentifiers:e.seriesIdentifiers||[],episodeIdentifiers:e.episodeIdentifiers||[],seriesUpdaters:e.seriesUpdaters||[],episodeUpdaters:e.episodeUpdaters||[]}}catch(s){console.error("Failed to load library config",s)}},async saveMoviesConfig(){const s={doReIndex:this.moviesConfig.doReIndex,indexBroken:this.moviesConfig.indexBroken,movieIdentifiers:this.moviesConfig.movieIdentifiers,movieUpdaters:this.moviesConfig.movieUpdaters};try{await ie.settings.updateSection("movies",s),this.$notify({type:"success",title:"Saved",text:"Movie settings saved"})}catch{this.$notify({type:"error",title:"Error",text:"Failed to save movie settings"})}},async saveTvConfig(){const s={doReIndex:this.tvConfig.doReIndex,indexBroken:this.tvConfig.indexBroken,ignoreSeriesMismatch:this.tvConfig.ignoreSeriesMismatch,seriesIdentifiers:this.tvConfig.seriesIdentifiers,episodeIdentifiers:this.tvConfig.episodeIdentifiers,seriesUpdaters:this.tvConfig.seriesUpdaters,episodeUpdaters:this.tvConfig.episodeUpdaters};try{await ie.settings.updateSection("tvshows",s),this.$notify({type:"success",title:"Saved",text:"TV settings saved"})}catch{this.$notify({type:"error",title:"Error",text:"Failed to save TV settings"})}}}};var i$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"Libraries"},[t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Movies ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.libraryAdd("movies")}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" Add movie library ")],1)]),t("div",{staticClass:"settings-section-gap"},[t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Re-index on Startup "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.moviesConfig.doReIndex,expression:"moviesConfig.doReIndex"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.moviesConfig.doReIndex)?e._i(e.moviesConfig.doReIndex,null)>-1:e.moviesConfig.doReIndex},on:{change:[function(i){var r=e.moviesConfig.doReIndex,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.moviesConfig,"doReIndex",r.concat([o])):l>-1&&e.$set(e.moviesConfig,"doReIndex",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.moviesConfig,"doReIndex",a)},e.saveMoviesConfig]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Index Broken Files "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.moviesConfig.indexBroken,expression:"moviesConfig.indexBroken"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.moviesConfig.indexBroken)?e._i(e.moviesConfig.indexBroken,null)>-1:e.moviesConfig.indexBroken},on:{change:[function(i){var r=e.moviesConfig.indexBroken,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.moviesConfig,"indexBroken",r.concat([o])):l>-1&&e.$set(e.moviesConfig,"indexBroken",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.moviesConfig,"indexBroken",a)},e.saveMoviesConfig]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"form-group"},[t("label",[e._v("Identifiers")]),t("TagInput",{attrs:{options:e.capabilities.movies.identifiers},on:{input:e.saveMoviesConfig},model:{value:e.moviesConfig.movieIdentifiers,callback:function(i){e.$set(e.moviesConfig,"movieIdentifiers",i)},expression:"moviesConfig.movieIdentifiers"}})],1),t("div",{staticClass:"form-group"},[t("label",[e._v("Updaters")]),t("TagInput",{attrs:{options:e.capabilities.movies.updaters},on:{input:e.saveMoviesConfig},model:{value:e.moviesConfig.movieUpdaters,callback:function(i){e.$set(e.moviesConfig,"movieUpdaters",i)},expression:"moviesConfig.movieUpdaters"}})],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(0),t("tbody",[e.movies.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"3"}},[e._v(" No movie libraries configured. ")])]):e._e(),e._l(e.movies,function(i,r){return t("tr",{key:r},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i.path))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Delete library path"},on:{click:function(n){return e.deleteMovieLibrary(i.path)}}},[t("font-awesome-icon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])]),t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" TV Shows ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.libraryAdd("tvshows")}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" Add TV show library ")],1)]),t("div",{staticClass:"settings-section-gap"},[t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Re-index on Startup "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.tvConfig.doReIndex,expression:"tvConfig.doReIndex"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.tvConfig.doReIndex)?e._i(e.tvConfig.doReIndex,null)>-1:e.tvConfig.doReIndex},on:{change:[function(i){var r=e.tvConfig.doReIndex,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.tvConfig,"doReIndex",r.concat([o])):l>-1&&e.$set(e.tvConfig,"doReIndex",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.tvConfig,"doReIndex",a)},e.saveTvConfig]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Index Broken Files "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.tvConfig.indexBroken,expression:"tvConfig.indexBroken"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.tvConfig.indexBroken)?e._i(e.tvConfig.indexBroken,null)>-1:e.tvConfig.indexBroken},on:{change:[function(i){var r=e.tvConfig.indexBroken,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.tvConfig,"indexBroken",r.concat([o])):l>-1&&e.$set(e.tvConfig,"indexBroken",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.tvConfig,"indexBroken",a)},e.saveTvConfig]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Ignore Series Mismatch "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.tvConfig.ignoreSeriesMismatch,expression:"tvConfig.ignoreSeriesMismatch"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.tvConfig.ignoreSeriesMismatch)?e._i(e.tvConfig.ignoreSeriesMismatch,null)>-1:e.tvConfig.ignoreSeriesMismatch},on:{change:[function(i){var r=e.tvConfig.ignoreSeriesMismatch,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.tvConfig,"ignoreSeriesMismatch",r.concat([o])):l>-1&&e.$set(e.tvConfig,"ignoreSeriesMismatch",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.tvConfig,"ignoreSeriesMismatch",a)},e.saveTvConfig]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Series Identifiers")]),t("TagInput",{attrs:{options:e.capabilities.tvshows.seriesIdentifiers},on:{input:e.saveTvConfig},model:{value:e.tvConfig.seriesIdentifiers,callback:function(i){e.$set(e.tvConfig,"seriesIdentifiers",i)},expression:"tvConfig.seriesIdentifiers"}})],1),t("div",{staticClass:"form-group"},[t("label",[e._v("Episode Identifiers")]),t("TagInput",{attrs:{options:e.capabilities.tvshows.episodeIdentifiers},on:{input:e.saveTvConfig},model:{value:e.tvConfig.episodeIdentifiers,callback:function(i){e.$set(e.tvConfig,"episodeIdentifiers",i)},expression:"tvConfig.episodeIdentifiers"}})],1)]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Series Updaters")]),t("TagInput",{attrs:{options:e.capabilities.tvshows.seriesUpdaters},on:{input:e.saveTvConfig},model:{value:e.tvConfig.seriesUpdaters,callback:function(i){e.$set(e.tvConfig,"seriesUpdaters",i)},expression:"tvConfig.seriesUpdaters"}})],1),t("div",{staticClass:"form-group"},[t("label",[e._v("Episode Updaters")]),t("TagInput",{attrs:{options:e.capabilities.tvshows.episodeUpdaters},on:{input:e.saveTvConfig},model:{value:e.tvConfig.episodeUpdaters,callback:function(i){e.$set(e.tvConfig,"episodeUpdaters",i)},expression:"tvConfig.episodeUpdaters"}})],1)])]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(1),t("tbody",[e.shows.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"3"}},[e._v(" No TV show libraries configured. ")])]):e._e(),e._l(e.shows,function(i,r){return t("tr",{key:r},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i.path))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Delete library path"},on:{click:function(n){return e.deleteSeriesLibrary(i.path)}}},[t("font-awesome-icon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])])])},r$=[function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Path")]),e("th",{attrs:{width:"100"}},[s._v(" Actions ")])])])},function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Path")]),e("th",{attrs:{width:"100"}},[s._v(" Actions ")])])])}],n$=ve(s$,i$,r$,!1,null,"704a5da1");const a$=n$.exports;Gt.library.add(Ca,xi);const o$={name:"Sets",components:{FontAwesomeIcon:Jt},data(){return{movieSets:[],seriesSets:[],showModal:!1,modalType:"movie",newSet:{name:"",overview:"",public:!0}}},computed:{deleteIcon(){return xi}},async created(){this.refresh()},methods:{async refresh(){try{const[s,e]=await Promise.all([ie.movieLibrary.getSets(),ie.seriesLibrary.getSets()]);this.movieSets=s,this.seriesSets=e}catch(s){console.error("Failed to fetch sets",s),this.$notify({type:"error",title:"Error",text:"Failed to load sets"})}},openModal(s){this.modalType=s,this.newSet={name:"",overview:"",public:!0},this.showModal=!0},closeModal(){this.showModal=!1},async createSet(){if(!this.newSet.name){this.$notify({type:"error",title:"Error",text:"Name is required"});return}try{const s={name:this.newSet.name,overview:this.newSet.overview,public:this.newSet.public};this.modalType==="movie"?await ie.sets.createMovieSet(s):await ie.sets.createSeriesSet(s),this.$notify({type:"success",title:"Success",text:"Set created"}),this.closeModal(),this.refresh()}catch(s){console.error("Failed to create set",s),this.$notify({type:"error",title:"Error",text:"Failed to create set"})}},async deleteSet(s,e){if(confirm("Are you sure you want to delete this set?"))try{e==="movie"?await ie.sets.deleteMovieSet(s):await ie.sets.deleteSeriesSet(s),this.$notify({type:"success",title:"Success",text:"Set deleted"}),this.refresh()}catch(t){console.error("Failed to delete set",t),this.$notify({type:"error",title:"Error",text:"Failed to delete set"})}}}};var l$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Movie Sets ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.openModal("movie")}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" New Movie Set ")],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(0),t("tbody",[e.movieSets.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"4"}},[e._v(" No movie sets found. ")])]):e._e(),e._l(e.movieSets,function(i,r){return t("tr",{key:i.id},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i.setName))]),t("td",[e._v(e._s(i.overview||"-"))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Delete set"},on:{click:function(n){return e.deleteSet(i.id,"movie")}}},[t("font-awesome-icon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])]),t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" TV Show Sets ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.openModal("series")}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" New TV Show Set ")],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(1),t("tbody",[e.seriesSets.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"4"}},[e._v(" No TV show sets found. ")])]):e._e(),e._l(e.seriesSets,function(i,r){return t("tr",{key:i.id},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i.setName))]),t("td",[e._v(e._s(i.overview||"-"))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Delete set"},on:{click:function(n){return e.deleteSet(i.id,"series")}}},[t("font-awesome-icon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])]),e.showModal?t("div",{staticClass:"modal-overlay",on:{click:function(i){return i.target!==i.currentTarget?null:e.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"modal-content settings-card"},[t("h3",[e._v("New "+e._s(e.modalType==="movie"?"Movie":"TV Show")+" Set")]),t("div",{staticClass:"form-group"},[t("label",[e._v("Name")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newSet.name,expression:"newSet.name"}],attrs:{type:"text",placeholder:"Collection Name"},domProps:{value:e.newSet.name},on:{input:function(i){i.target.composing||e.$set(e.newSet,"name",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Overview")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newSet.overview,expression:"newSet.overview"}],attrs:{type:"text",placeholder:"Description"},domProps:{value:e.newSet.overview},on:{input:function(i){i.target.composing||e.$set(e.newSet,"overview",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",{staticClass:"checkbox-container"},[e._v(" Public "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newSet.public,expression:"newSet.public"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.newSet.public)?e._i(e.newSet.public,null)>-1:e.newSet.public},on:{change:function(i){var r=e.newSet.public,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.newSet,"public",r.concat([o])):l>-1&&e.$set(e.newSet,"public",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.newSet,"public",a)}}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"settings-inline-actions"},[t("a",{staticClass:"btn btn-secondary",on:{click:e.closeModal}},[e._v("Cancel")]),t("a",{staticClass:"btn",on:{click:e.createSet}},[e._v("Create")])])])]):e._e()])},c$=[function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Name")]),e("th",[s._v("Overview")]),e("th",{attrs:{width:"100"}},[s._v(" Actions ")])])])},function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Name")]),e("th",[s._v("Overview")]),e("th",{attrs:{width:"100"}},[s._v(" Actions ")])])])}],u$=ve(o$,l$,c$,!1,null,"294ebb3a");const f$=u$.exports;Gt.library.add(Ca,xi);const d$={name:"IndexerSettings",components:{FontAwesomeIcon:Jt},data(){return{videoFiletypes:[],indexer:{runAtBoot:!1},cleaner:{runAtBoot:!1},files:{doHash:!1}}},computed:{deleteIcon(){return xi}},async created(){this.refresh()},methods:{async refresh(){var s;try{const e=await ie.settings.getAll();this.videoFiletypes=((s=e.fileExtensions)==null?void 0:s.video)||[],this.indexer=e.indexer||{runAtBoot:!1},this.cleaner=e.cleaner||{runAtBoot:!1},this.files=e.files||{doHash:!1}}catch(e){console.error("Failed to load settings",e),this.$notify({type:"error",title:"Error",text:"Failed to load settings"})}},async saveSettings(){try{await ie.settings.update({indexer:this.indexer,cleaner:this.cleaner,files:this.files}),this.$notify({type:"success",title:"Saved",text:"Settings saved successfully"})}catch(s){console.error("Failed to save settings",s),this.$notify({type:"error",title:"Error",text:"Failed to save settings"})}},async filetypeAdd(s){const e=prompt("Enter new file extension (e.g. .mkv):");if(e){let t=[...this.videoFiletypes];t.includes(e)||(t.push(e),await this.updateFiletypes(t),this.$notify({type:"success",title:"Success",text:"Filetype added"}))}},async deleteFiletype(s,e){if(confirm(`Are you sure you want to remove ${s}?`)){let t=this.videoFiletypes.filter(i=>i!==s);await this.updateFiletypes(t),this.$notify({type:"success",title:"Success",text:"Filetype removed"})}},async updateFiletypes(s){await ie.settings.updateSection("fileExtensions",{video:s}),this.refresh()}}};var h$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" General Configuration ")]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Run Indexer on Startup "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.indexer.runAtBoot,expression:"indexer.runAtBoot"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.indexer.runAtBoot)?e._i(e.indexer.runAtBoot,null)>-1:e.indexer.runAtBoot},on:{change:[function(i){var r=e.indexer.runAtBoot,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.indexer,"runAtBoot",r.concat([o])):l>-1&&e.$set(e.indexer,"runAtBoot",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.indexer,"runAtBoot",a)},e.saveSettings]}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" Automatically scan for new files when the server starts. ")])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Run Cleaner on Startup "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.cleaner.runAtBoot,expression:"cleaner.runAtBoot"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.cleaner.runAtBoot)?e._i(e.cleaner.runAtBoot,null)>-1:e.cleaner.runAtBoot},on:{change:[function(i){var r=e.cleaner.runAtBoot,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.cleaner,"runAtBoot",r.concat([o])):l>-1&&e.$set(e.cleaner,"runAtBoot",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.cleaner,"runAtBoot",a)},e.saveSettings]}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" Automatically check for removed files when the server starts. ")])]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Calculate File Hashes "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.files.doHash,expression:"files.doHash"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.files.doHash)?e._i(e.files.doHash,null)>-1:e.files.doHash},on:{change:[function(i){var r=e.files.doHash,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.files,"doHash",r.concat([o])):l>-1&&e.$set(e.files,"doHash",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.files,"doHash",a)},e.saveSettings]}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" Calculate MD5 hashes for files to detect duplicates and changes. (Slower) ")])])]),t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Video Filetypes ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.filetypeAdd("video")}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" Add Filetype ")],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(0),t("tbody",[e.videoFiletypes.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"3"}},[e._v(" No video filetypes configured. ")])]):e._e(),e._l(e.videoFiletypes,function(i,r){return t("tr",{key:r},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Remove filetype"},on:{click:function(n){return e.deleteFiletype(i,"video")}}},[t("FontAwesomeIcon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])])])},p$=[function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Filetype")]),e("th",{attrs:{width:"100"}},[s._v(" Actions ")])])])}],m$=ve(d$,h$,p$,!1,null,"029045c8");const g$=m$.exports,v$={name:"ArtworkSettings",data(){return{assets:{storeWithFile:!1,episodeBannerLocation:"",showPosterLocation:"",moviePosterLocation:"",movieFanartLocation:""},artwork:{poster:{small:0,medium:0,large:0},fanart:{small:0,medium:0,large:0},banner:{small:0,medium:0,large:0}},tmdb:{key:""},tvdb:{key:""},fanartTv:{key:""}}},async created(){this.refresh()},methods:{async refresh(){try{const s=await ie.settings.getAll();this.assets=s.assets||this.assets,this.artwork=s.artwork||this.artwork,this.tmdb=s.themoviedb||{key:""},this.tvdb=s.tvdb||{key:""},this.fanartTv=s["fanart.tv"]||{key:""}}catch(s){console.error("Failed to load settings",s),this.$notify({type:"error",title:"Error",text:"Failed to load settings"})}},async saveSettings(){try{await ie.settings.update({assets:this.assets,artwork:this.artwork,themoviedb:this.tmdb,tvdb:this.tvdb,"fanart.tv":this.fanartTv}),this.$notify({type:"success",title:"Saved",text:"Settings saved successfully"})}catch(s){console.error("Failed to save settings",s),this.$notify({type:"error",title:"Error",text:"Failed to save settings"})}}}};var y$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Asset Storage ")]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Store assets with file "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.assets.storeWithFile,expression:"assets.storeWithFile"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.assets.storeWithFile)?e._i(e.assets.storeWithFile,null)>-1:e.assets.storeWithFile},on:{change:[function(i){var r=e.assets.storeWithFile,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.assets,"storeWithFile",r.concat([o])):l>-1&&e.$set(e.assets,"storeWithFile",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.assets,"storeWithFile",a)},e.saveSettings]}}),t("span",{staticClass:"checkmark"})]),t("p",{staticClass:"description"},[e._v(" If enabled, images will be saved in the same directory as the media file. ")])]),t("div",{staticClass:"form-group"},[t("label",[e._v("Show Poster Location")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.assets.showPosterLocation,expression:"assets.showPosterLocation"}],attrs:{type:"text"},domProps:{value:e.assets.showPosterLocation},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.assets,"showPosterLocation",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Episode Banner Location")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.assets.episodeBannerLocation,expression:"assets.episodeBannerLocation"}],attrs:{type:"text"},domProps:{value:e.assets.episodeBannerLocation},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.assets,"episodeBannerLocation",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Movie Poster Location")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.assets.moviePosterLocation,expression:"assets.moviePosterLocation"}],attrs:{type:"text"},domProps:{value:e.assets.moviePosterLocation},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.assets,"moviePosterLocation",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Movie Fanart Location")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.assets.movieFanartLocation,expression:"assets.movieFanartLocation"}],attrs:{type:"text"},domProps:{value:e.assets.movieFanartLocation},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.assets,"movieFanartLocation",i.target.value)}}})])]),t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Image Resizing ")]),t("p",{staticClass:"settings-description"},[e._v(" Configure target widths (in pixels) for generated images. ")]),t("h3",[e._v("Posters")]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Small")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.poster.small,expression:"artwork.poster.small",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.poster.small},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.poster,"small",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Medium")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.poster.medium,expression:"artwork.poster.medium",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.poster.medium},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.poster,"medium",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Large")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.poster.large,expression:"artwork.poster.large",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.poster.large},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.poster,"large",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})])]),t("h3",[e._v("Fanart")]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Small")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.fanart.small,expression:"artwork.fanart.small",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.fanart.small},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.fanart,"small",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Medium")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.fanart.medium,expression:"artwork.fanart.medium",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.fanart.medium},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.fanart,"medium",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Large")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.fanart.large,expression:"artwork.fanart.large",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.fanart.large},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.fanart,"large",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})])]),t("h3",[e._v("Banners")]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Small")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.banner.small,expression:"artwork.banner.small",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.banner.small},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.banner,"small",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Medium")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.banner.medium,expression:"artwork.banner.medium",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.banner.medium},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.banner,"medium",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Large")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.artwork.banner.large,expression:"artwork.banner.large",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.artwork.banner.large},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.artwork.banner,"large",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})])])]),t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Metadata Providers ")]),t("div",{staticClass:"form-group"},[t("label",[e._v("TheMovieDB Key")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.tmdb.key,expression:"tmdb.key"}],attrs:{type:"text"},domProps:{value:e.tmdb.key},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.tmdb,"key",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("TVDB Key")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.tvdb.key,expression:"tvdb.key"}],attrs:{type:"text"},domProps:{value:e.tvdb.key},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.tvdb,"key",i.target.value)}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Fanart.tv Key")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.fanartTv.key,expression:"fanartTv.key"}],attrs:{type:"text"},domProps:{value:e.fanartTv.key},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.fanartTv,"key",i.target.value)}}})])])])},b$=[],S$=ve(v$,y$,b$,!1,null,"d89cf5e8");const E$=S$.exports,_$={name:"FederationSettings",data(){return{federation:{enable:!1,dataPort:9131,mediaPort:9132,key:""}}},async created(){this.refresh()},methods:{async refresh(){try{const s=await ie.settings.getAll();this.federation=s.federation||this.federation}catch(s){console.error("Failed to load settings",s),this.$notify({type:"error",title:"Error",text:"Failed to load settings"})}},async saveSettings(){try{await ie.settings.update({federation:this.federation}),this.$notify({type:"success",title:"Saved",text:"Settings saved successfully"})}catch(s){console.error("Failed to save settings",s),this.$notify({type:"error",title:"Error",text:"Failed to save settings"})}}}};var x$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Federation ")]),t("p",{staticClass:"settings-description"},[e._v(" Connect multiple Oblecto servers to share libraries and streaming capabilities. ")]),t("div",{staticClass:"setting-row"},[t("label",{staticClass:"checkbox-container"},[e._v(" Enable Federation "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.federation.enable,expression:"federation.enable"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.federation.enable)?e._i(e.federation.enable,null)>-1:e.federation.enable},on:{change:[function(i){var r=e.federation.enable,n=i.target,a=!!n.checked;if(Array.isArray(r)){var o=null,l=e._i(r,o);n.checked?l<0&&e.$set(e.federation,"enable",r.concat([o])):l>-1&&e.$set(e.federation,"enable",r.slice(0,l).concat(r.slice(l+1)))}else e.$set(e.federation,"enable",a)},e.saveSettings]}}),t("span",{staticClass:"checkmark"})])]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Data Port")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.federation.dataPort,expression:"federation.dataPort",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.federation.dataPort},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.federation,"dataPort",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})]),t("div",{staticClass:"form-group"},[t("label",[e._v("Media Port")]),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.federation.mediaPort,expression:"federation.mediaPort",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:e.federation.mediaPort},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.federation,"mediaPort",e._n(i.target.value))},blur:function(i){return e.$forceUpdate()}}})])]),t("div",{staticClass:"form-group"},[t("label",[e._v("Private Key Path")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.federation.key,expression:"federation.key"}],attrs:{type:"text",placeholder:"/etc/oblecto/id_rsa"},domProps:{value:e.federation.key},on:{change:e.saveSettings,input:function(i){i.target.composing||e.$set(e.federation,"key",i.target.value)}}}),t("p",{staticClass:"settings-description settings-description-tight"},[e._v(" Path to the RSA private key for identity. ")])])])])},A$=[],T$=ve(_$,x$,A$,!1,null,"1f3442a8");const w$=T$.exports;Gt.library.add(Ca,xi,Dh,hc);const Bu=()=>({name:"",storageDriver:"ssh",storageDriverOptions:{host:"",username:"",password:"",secure:!0},mediaImport:{movieDirectory:"",seriesDirectory:""},automaticImport:!0,deleteOnImport:!1,enabled:!0}),C$={name:"SeedboxSettings",components:{FontAwesomeIcon:Jt},data(){return{seedboxes:[],importSource:"all",status:null}},computed:{deleteIcon(){return xi},editIcon(){return Dh}},async created(){this.refresh()},methods:{async refresh(){try{const s=await ie.settings.getSection("seedboxes"),e=Array.isArray(s)?s:(s==null?void 0:s.seedboxes)||(s==null?void 0:s.items)||[];this.seedboxes=e.map(t=>({...Bu(),...t,storageDriver:(t==null?void 0:t.storageDriver)||"ssh",storageDriverOptions:{...Bu().storageDriverOptions,...(t==null?void 0:t.storageDriverOptions)||{}},mediaImport:{...Bu().mediaImport,...(t==null?void 0:t.mediaImport)||{}}})),this.refreshStatus()}catch(s){console.error("Failed to load seedbox settings",s),this.$notify({type:"error",title:"Error",text:"Failed to load seedbox settings"})}},async refreshStatus(){try{this.status=await ie.status.getSeedboxStatus()}catch(s){console.error("Failed to get seedbox status",s)}},async saveSettings(){try{await ie.settings.updateSection("seedboxes",this.seedboxes),this.$notify({type:"success",title:"Saved",text:"Seedbox settings saved successfully"})}catch(s){console.error("Failed to save seedbox settings",s),this.$notify({type:"error",title:"Error",text:"Failed to save seedbox settings"})}},openDialog(s=null){const e=s!==null?this.seedboxes[s]:null;this.$modal.show("SeedboxDialog",{seedbox:e,callback:async t=>{s!==null?this.$set(this.seedboxes,s,t):this.seedboxes.push(t),await this.saveSettings()}})},editSeedbox(s){this.openDialog(s)},async deleteSeedbox(s){const e=this.seedboxes[s];confirm(`Remove seedbox "${e.name||e.storageDriverOptions.host}"?`)&&(this.seedboxes.splice(s,1),await this.saveSettings())},async triggerImport(s){try{await ie.system.triggerImport(this.importSource,s);const e=this.importSource==="all"?"all seedboxes":this.importSource;this.$notify({group:"system",title:"Import started",text:`Importing ${s} from ${e}.`,type:"success"})}catch(e){console.error("Failed to trigger import",e),this.$notify({group:"system",title:"Error",text:"Failed to start seedbox import.",type:"error"})}}}};var L$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[e._m(0),e.status?t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Import Status ")]),t("a",{staticClass:"btn",on:{click:e.refreshStatus}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Refresh ")],1)]),t("div",{staticClass:"resize-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Queue State")]),t("div",{staticClass:"value"},[e._v(" "+e._s(e.status.queue.idle?"Idle":"Running")+" ")])]),t("div",{staticClass:"form-group"},[t("label",[e._v("Items in Queue")]),t("div",{staticClass:"value"},[e._v(" "+e._s(e.status.queue.length)+" ")])]),t("div",{staticClass:"form-group"},[t("label",[e._v("Active Imports")]),t("div",{staticClass:"value"},[e._v(" "+e._s(e.status.queue.running)+" ")])])])]):e._e(),t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Manual Import ")]),t("p",{staticClass:"settings-description"},[e._v(" Trigger a one-time import from a specific seedbox or all seedboxes. ")]),t("div",{staticClass:"resize-grid import-grid"},[t("div",{staticClass:"form-group"},[t("label",[e._v("Source")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.importSource,expression:"importSource"}],on:{change:function(i){var r=Array.prototype.filter.call(i.target.options,function(n){return n.selected}).map(function(n){var a="_value"in n?n._value:n.value;return a});e.importSource=i.target.multiple?r:r[0]}}},[t("option",{attrs:{value:"all"}},[e._v(" All seedboxes ")]),e._l(e.seedboxes,function(i,r){return t("option",{key:`import-${i.name||i.storageDriverOptions.host||r}`,domProps:{value:i.name||String(r)}},[e._v(" "+e._s(i.name||i.storageDriverOptions.host||`Seedbox ${r+1}`)+" ")])})],2)]),t("div",{staticClass:"form-group import-actions"},[t("label",[e._v("Import Type")]),t("div",{staticClass:"actions-group"},[t("button",{staticClass:"btn",on:{click:function(i){return e.triggerImport("movies")}}},[e._v(" Import Movies ")]),t("button",{staticClass:"btn",on:{click:function(i){return e.triggerImport("tvshows")}}},[e._v(" Import TV Shows ")])])])])]),t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Configured Seedboxes ")]),t("a",{staticClass:"btn",on:{click:function(i){return e.openDialog()}}},[t("font-awesome-icon",{attrs:{icon:"plus"}}),e._v(" New Seedbox ")],1)]),t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(1),t("tbody",[e.seedboxes.length===0?t("tr",[t("td",{staticClass:"settings-table-center",attrs:{colspan:"8"}},[e._v(" No seedboxes configured. ")])]):e._e(),e._l(e.seedboxes,function(i,r){return t("tr",{key:i.id||r},[t("td",{staticClass:"id"},[e._v(" "+e._s(r+1)+" ")]),t("td",[e._v(e._s(i.name||"Untitled"))]),t("td",[e._v(e._s(i.storageDriverOptions.host||"-"))]),t("td",[e._v(e._s((i.storageDriver||"ssh").toUpperCase()))]),t("td",[e._v(e._s(i.mediaImport.movieDirectory||"-"))]),t("td",[e._v(e._s(i.mediaImport.seriesDirectory||"-"))]),t("td",[e._v(e._s(i.enabled?"Enabled":"Disabled"))]),t("td",{staticClass:"actions"},[t("a",{attrs:{title:"Edit seedbox"},on:{click:function(n){return e.editSeedbox(r)}}},[t("font-awesome-icon",{attrs:{icon:e.editIcon}})],1),t("a",{attrs:{title:"Remove seedbox"},on:{click:function(n){return e.deleteSeedbox(r)}}},[t("font-awesome-icon",{attrs:{icon:e.deleteIcon}})],1)])])})],2)])])])])},I$=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"settings-card"},[e("h2",{staticClass:"settings-section-title"},[s._v(" Seedbox Setup ")]),e("p",{staticClass:"settings-description"},[s._v(" Configure remote seedboxes for automated downloads and media imports. ")]),e("p",{staticClass:"description settings-description settings-description-tight"},[s._v(" Each seedbox can be enabled individually, with its own import rules. ")])])},function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",{attrs:{width:"50"}},[s._v(" # ")]),e("th",[s._v("Name")]),e("th",[s._v("Host")]),e("th",[s._v("Driver")]),e("th",[s._v("Movie Dir")]),e("th",[s._v("Series Dir")]),e("th",[s._v("Status")]),e("th",{attrs:{width:"120"}},[s._v(" Actions ")])])])}],R$=ve(C$,L$,I$,!1,null,"4961c6a4");const D$=R$.exports;Gt.library.add(hc);const k$={name:"ProblematicFiles",components:{FontAwesomeIcon:Jt},data(){return{files:[]}},async created(){await this.refresh()},methods:{async refresh(){try{const s=await ie.files.getProblematic();this.files=s.map(e=>({...e,retrying:!1}))}catch(s){console.error("Failed to load problematic files",s),this.$notify({type:"error",title:"Error",text:"Failed to load files"})}},async retryFile(s){if(!s.retrying){s.retrying=!0;try{await ie.files.retryFile(s.id),this.$notify({type:"success",title:"Success",text:"Retry scheduled"}),this.files=this.files.filter(e=>e.id!==s.id)}catch(e){console.error("Retry failed",e),this.$notify({type:"error",title:"Error",text:"Retry request failed"}),s.retrying=!1}}}}};var P$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wrapper"},[t("div",{staticClass:"settings-card"},[t("h2",{staticClass:"settings-section-title"},[e._v(" Problematic Files ")]),e.files.length===0?t("p",{staticClass:"settings-empty"},[e._v(" No problematic files found. ")]):t("div",{staticClass:"settings-table-scroll"},[t("table",{staticClass:"settings-table"},[e._m(0),t("tbody",e._l(e.files,function(i){return t("tr",{key:i.id},[t("td",{staticClass:"settings-table-cell-wrap"},[e._v(" "+e._s(i.path)+" ")]),t("td",[t("div",{staticClass:"error-msg"},[e._v(" "+e._s(i.error)+" ")])]),t("td",{staticClass:"actions"},[t("a",{staticClass:"btn-icon",attrs:{title:"Retry Indexing"},on:{click:function(r){return e.retryFile(i)}}},[t("font-awesome-icon",{attrs:{icon:"sync",spin:i.retrying}})],1)])])}),0)])])])])},O$=[function(){var s=this,e=s._self._c;return e("thead",[e("tr",[e("th",[s._v("Path")]),e("th",[s._v("Error")]),e("th",{attrs:{width:"120"}},[s._v(" Actions ")])])])}],M$=ve(k$,P$,O$,!1,null,"55c3c36b");const N$=M$.exports;var F$={prefix:"fas",iconName:"play-circle",icon:[512,512,[],"f144","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"]};const $$=Oe(F$);var B$={prefix:"fas",iconName:"desktop",icon:[576,512,[],"f108","M528 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h192l-16 48h-72c-13.3 0-24 10.7-24 24s10.7 24 24 24h272c13.3 0 24-10.7 24-24s-10.7-24-24-24h-72l-16-48h192c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h448v288z"]};const U$=Oe(B$);var G$={prefix:"fas",iconName:"user",icon:[448,512,[],"f007","M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"]};const H$=Oe(G$);//! moment.js
|
|
400
|
+
//! version : 2.29.4
|
|
401
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
402
|
+
//! license : MIT
|
|
403
|
+
//! momentjs.com
|
|
404
|
+
var RE;function oe(){return RE.apply(null,arguments)}function Y$(s){RE=s}function ks(s){return s instanceof Array||Object.prototype.toString.call(s)==="[object Array]"}function gr(s){return s!=null&&Object.prototype.toString.call(s)==="[object Object]"}function Ge(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function kh(s){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(s).length===0;var e;for(e in s)if(Ge(s,e))return!1;return!0}function Vt(s){return s===void 0}function _i(s){return typeof s=="number"||Object.prototype.toString.call(s)==="[object Number]"}function La(s){return s instanceof Date||Object.prototype.toString.call(s)==="[object Date]"}function DE(s,e){var t=[],i,r=s.length;for(i=0;i<r;++i)t.push(e(s[i],i));return t}function Bi(s,e){for(var t in e)Ge(e,t)&&(s[t]=e[t]);return Ge(e,"toString")&&(s.toString=e.toString),Ge(e,"valueOf")&&(s.valueOf=e.valueOf),s}function ii(s,e,t,i){return t_(s,e,t,i,!0).utc()}function j$(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function we(s){return s._pf==null&&(s._pf=j$()),s._pf}var sd;Array.prototype.some?sd=Array.prototype.some:sd=function(s){var e=Object(this),t=e.length>>>0,i;for(i=0;i<t;i++)if(i in e&&s.call(this,e[i],i,e))return!0;return!1};function Ph(s){if(s._isValid==null){var e=we(s),t=sd.call(e.parsedDateParts,function(r){return r!=null}),i=!isNaN(s._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t);if(s._strict&&(i=i&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(s))s._isValid=i;else return i}return s._isValid}function pc(s){var e=ii(NaN);return s!=null?Bi(we(e),s):we(e).userInvalidated=!0,e}var P0=oe.momentProperties=[],Uu=!1;function Oh(s,e){var t,i,r,n=P0.length;if(Vt(e._isAMomentObject)||(s._isAMomentObject=e._isAMomentObject),Vt(e._i)||(s._i=e._i),Vt(e._f)||(s._f=e._f),Vt(e._l)||(s._l=e._l),Vt(e._strict)||(s._strict=e._strict),Vt(e._tzm)||(s._tzm=e._tzm),Vt(e._isUTC)||(s._isUTC=e._isUTC),Vt(e._offset)||(s._offset=e._offset),Vt(e._pf)||(s._pf=we(e)),Vt(e._locale)||(s._locale=e._locale),n>0)for(t=0;t<n;t++)i=P0[t],r=e[i],Vt(r)||(s[i]=r);return s}function Ia(s){Oh(this,s),this._d=new Date(s._d!=null?s._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Uu===!1&&(Uu=!0,oe.updateOffset(this),Uu=!1)}function Ps(s){return s instanceof Ia||s!=null&&s._isAMomentObject!=null}function kE(s){oe.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+s)}function _s(s,e){var t=!0;return Bi(function(){if(oe.deprecationHandler!=null&&oe.deprecationHandler(null,s),t){var i=[],r,n,a,o=arguments.length;for(n=0;n<o;n++){if(r="",typeof arguments[n]=="object"){r+=`
|
|
405
|
+
[`+n+"] ";for(a in arguments[0])Ge(arguments[0],a)&&(r+=a+": "+arguments[0][a]+", ");r=r.slice(0,-2)}else r=arguments[n];i.push(r)}kE(s+`
|
|
406
|
+
Arguments: `+Array.prototype.slice.call(i).join("")+`
|
|
407
|
+
`+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var O0={};function PE(s,e){oe.deprecationHandler!=null&&oe.deprecationHandler(s,e),O0[s]||(kE(e),O0[s]=!0)}oe.suppressDeprecationWarnings=!1;oe.deprecationHandler=null;function ri(s){return typeof Function<"u"&&s instanceof Function||Object.prototype.toString.call(s)==="[object Function]"}function V$(s){var e,t;for(t in s)Ge(s,t)&&(e=s[t],ri(e)?this[t]=e:this["_"+t]=e);this._config=s,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function id(s,e){var t=Bi({},s),i;for(i in e)Ge(e,i)&&(gr(s[i])&&gr(e[i])?(t[i]={},Bi(t[i],s[i]),Bi(t[i],e[i])):e[i]!=null?t[i]=e[i]:delete t[i]);for(i in s)Ge(s,i)&&!Ge(e,i)&&gr(s[i])&&(t[i]=Bi({},t[i]));return t}function Mh(s){s!=null&&this.set(s)}var rd;Object.keys?rd=Object.keys:rd=function(s){var e,t=[];for(e in s)Ge(s,e)&&t.push(e);return t};var K$={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function W$(s,e,t){var i=this._calendar[s]||this._calendar.sameElse;return ri(i)?i.call(e,t):i}function ti(s,e,t){var i=""+Math.abs(s),r=e-i.length,n=s>=0;return(n?t?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var Nh=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,go=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Gu={},sn={};function he(s,e,t,i){var r=i;typeof i=="string"&&(r=function(){return this[i]()}),s&&(sn[s]=r),e&&(sn[e[0]]=function(){return ti(r.apply(this,arguments),e[1],e[2])}),t&&(sn[t]=function(){return this.localeData().ordinal(r.apply(this,arguments),s)})}function z$(s){return s.match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"")}function Q$(s){var e=s.match(Nh),t,i;for(t=0,i=e.length;t<i;t++)sn[e[t]]?e[t]=sn[e[t]]:e[t]=z$(e[t]);return function(r){var n="",a;for(a=0;a<i;a++)n+=ri(e[a])?e[a].call(r,s):e[a];return n}}function Vo(s,e){return s.isValid()?(e=OE(e,s.localeData()),Gu[e]=Gu[e]||Q$(e),Gu[e](s)):s.localeData().invalidDate()}function OE(s,e){var t=5;function i(r){return e.longDateFormat(r)||r}for(go.lastIndex=0;t>=0&&go.test(s);)s=s.replace(go,i),go.lastIndex=0,t-=1;return s}var q$={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function X$(s){var e=this._longDateFormat[s],t=this._longDateFormat[s.toUpperCase()];return e||!t?e:(this._longDateFormat[s]=t.match(Nh).map(function(i){return i==="MMMM"||i==="MM"||i==="DD"||i==="dddd"?i.slice(1):i}).join(""),this._longDateFormat[s])}var J$="Invalid date";function Z$(){return this._invalidDate}var eB="%d",tB=/\d{1,2}/;function sB(s){return this._ordinal.replace("%d",s)}var iB={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function rB(s,e,t,i){var r=this._relativeTime[t];return ri(r)?r(s,e,t,i):r.replace(/%d/i,s)}function nB(s,e){var t=this._relativeTime[s>0?"future":"past"];return ri(t)?t(e):t.replace(/%s/i,e)}var Qn={};function Ot(s,e){var t=s.toLowerCase();Qn[t]=Qn[t+"s"]=Qn[e]=s}function xs(s){return typeof s=="string"?Qn[s]||Qn[s.toLowerCase()]:void 0}function Fh(s){var e={},t,i;for(i in s)Ge(s,i)&&(t=xs(i),t&&(e[t]=s[i]));return e}var ME={};function Mt(s,e){ME[s]=e}function aB(s){var e=[],t;for(t in s)Ge(s,t)&&e.push({unit:t,priority:ME[t]});return e.sort(function(i,r){return i.priority-r.priority}),e}function mc(s){return s%4===0&&s%100!==0||s%400===0}function gs(s){return s<0?Math.ceil(s)||0:Math.floor(s)}function ke(s){var e=+s,t=0;return e!==0&&isFinite(e)&&(t=gs(e)),t}function En(s,e){return function(t){return t!=null?(NE(this,s,t),oe.updateOffset(this,e),this):Ol(this,s)}}function Ol(s,e){return s.isValid()?s._d["get"+(s._isUTC?"UTC":"")+e]():NaN}function NE(s,e,t){s.isValid()&&!isNaN(t)&&(e==="FullYear"&&mc(s.year())&&s.month()===1&&s.date()===29?(t=ke(t),s._d["set"+(s._isUTC?"UTC":"")+e](t,s.month(),Ec(t,s.month()))):s._d["set"+(s._isUTC?"UTC":"")+e](t))}function oB(s){return s=xs(s),ri(this[s])?this[s]():this}function lB(s,e){if(typeof s=="object"){s=Fh(s);var t=aB(s),i,r=t.length;for(i=0;i<r;i++)this[t[i].unit](s[t[i].unit])}else if(s=xs(s),ri(this[s]))return this[s](e);return this}var FE=/\d/,fs=/\d\d/,$E=/\d{3}/,$h=/\d{4}/,gc=/[+-]?\d{6}/,st=/\d\d?/,BE=/\d\d\d\d?/,UE=/\d\d\d\d\d\d?/,vc=/\d{1,3}/,Bh=/\d{1,4}/,yc=/[+-]?\d{1,6}/,_n=/\d+/,bc=/[+-]?\d+/,cB=/Z|[+-]\d\d:?\d\d/gi,Sc=/Z|[+-]\d\d(?::?\d\d)?/gi,uB=/[+-]?\d+(\.\d{1,3})?/,Ra=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ml;Ml={};function ue(s,e,t){Ml[s]=ri(e)?e:function(i,r){return i&&t?t:e}}function fB(s,e){return Ge(Ml,s)?Ml[s](e._strict,e._locale):new RegExp(dB(s))}function dB(s){return as(s.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,r,n){return t||i||r||n}))}function as(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var nd={};function Qe(s,e){var t,i=e,r;for(typeof s=="string"&&(s=[s]),_i(e)&&(i=function(n,a){a[e]=ke(n)}),r=s.length,t=0;t<r;t++)nd[s[t]]=i}function Da(s,e){Qe(s,function(t,i,r,n){r._w=r._w||{},e(t,r._w,r,n)})}function hB(s,e,t){e!=null&&Ge(nd,s)&&nd[s](e,t._a,t,s)}var kt=0,mi=1,Ks=2,yt=3,Rs=4,gi=5,cr=6,pB=7,mB=8;function gB(s,e){return(s%e+e)%e}var dt;Array.prototype.indexOf?dt=Array.prototype.indexOf:dt=function(s){var e;for(e=0;e<this.length;++e)if(this[e]===s)return e;return-1};function Ec(s,e){if(isNaN(s)||isNaN(e))return NaN;var t=gB(e,12);return s+=(e-t)/12,t===1?mc(s)?29:28:31-t%7%2}he("M",["MM",2],"Mo",function(){return this.month()+1});he("MMM",0,0,function(s){return this.localeData().monthsShort(this,s)});he("MMMM",0,0,function(s){return this.localeData().months(this,s)});Ot("month","M");Mt("month",8);ue("M",st);ue("MM",st,fs);ue("MMM",function(s,e){return e.monthsShortRegex(s)});ue("MMMM",function(s,e){return e.monthsRegex(s)});Qe(["M","MM"],function(s,e){e[mi]=ke(s)-1});Qe(["MMM","MMMM"],function(s,e,t,i){var r=t._locale.monthsParse(s,i,t._strict);r!=null?e[mi]=r:we(t).invalidMonth=s});var vB="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),GE="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),HE=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,yB=Ra,bB=Ra;function SB(s,e){return s?ks(this._months)?this._months[s.month()]:this._months[(this._months.isFormat||HE).test(e)?"format":"standalone"][s.month()]:ks(this._months)?this._months:this._months.standalone}function EB(s,e){return s?ks(this._monthsShort)?this._monthsShort[s.month()]:this._monthsShort[HE.test(e)?"format":"standalone"][s.month()]:ks(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function _B(s,e,t){var i,r,n,a=s.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)n=ii([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(n,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(n,"").toLocaleLowerCase();return t?e==="MMM"?(r=dt.call(this._shortMonthsParse,a),r!==-1?r:null):(r=dt.call(this._longMonthsParse,a),r!==-1?r:null):e==="MMM"?(r=dt.call(this._shortMonthsParse,a),r!==-1?r:(r=dt.call(this._longMonthsParse,a),r!==-1?r:null)):(r=dt.call(this._longMonthsParse,a),r!==-1?r:(r=dt.call(this._shortMonthsParse,a),r!==-1?r:null))}function xB(s,e,t){var i,r,n;if(this._monthsParseExact)return _B.call(this,s,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=ii([2e3,i]),t&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!t&&!this._monthsParse[i]&&(n="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(n.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[i].test(s))return i;if(t&&e==="MMM"&&this._shortMonthsParse[i].test(s))return i;if(!t&&this._monthsParse[i].test(s))return i}}function YE(s,e){var t;if(!s.isValid())return s;if(typeof e=="string"){if(/^\d+$/.test(e))e=ke(e);else if(e=s.localeData().monthsParse(e),!_i(e))return s}return t=Math.min(s.date(),Ec(s.year(),e)),s._d["set"+(s._isUTC?"UTC":"")+"Month"](e,t),s}function jE(s){return s!=null?(YE(this,s),oe.updateOffset(this,!0),this):Ol(this,"Month")}function AB(){return Ec(this.year(),this.month())}function TB(s){return this._monthsParseExact?(Ge(this,"_monthsRegex")||VE.call(this),s?this._monthsShortStrictRegex:this._monthsShortRegex):(Ge(this,"_monthsShortRegex")||(this._monthsShortRegex=yB),this._monthsShortStrictRegex&&s?this._monthsShortStrictRegex:this._monthsShortRegex)}function wB(s){return this._monthsParseExact?(Ge(this,"_monthsRegex")||VE.call(this),s?this._monthsStrictRegex:this._monthsRegex):(Ge(this,"_monthsRegex")||(this._monthsRegex=bB),this._monthsStrictRegex&&s?this._monthsStrictRegex:this._monthsRegex)}function VE(){function s(a,o){return o.length-a.length}var e=[],t=[],i=[],r,n;for(r=0;r<12;r++)n=ii([2e3,r]),e.push(this.monthsShort(n,"")),t.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(e.sort(s),t.sort(s),i.sort(s),r=0;r<12;r++)e[r]=as(e[r]),t[r]=as(t[r]);for(r=0;r<24;r++)i[r]=as(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}he("Y",0,0,function(){var s=this.year();return s<=9999?ti(s,4):"+"+s});he(0,["YY",2],0,function(){return this.year()%100});he(0,["YYYY",4],0,"year");he(0,["YYYYY",5],0,"year");he(0,["YYYYYY",6,!0],0,"year");Ot("year","y");Mt("year",1);ue("Y",bc);ue("YY",st,fs);ue("YYYY",Bh,$h);ue("YYYYY",yc,gc);ue("YYYYYY",yc,gc);Qe(["YYYYY","YYYYYY"],kt);Qe("YYYY",function(s,e){e[kt]=s.length===2?oe.parseTwoDigitYear(s):ke(s)});Qe("YY",function(s,e){e[kt]=oe.parseTwoDigitYear(s)});Qe("Y",function(s,e){e[kt]=parseInt(s,10)});function qn(s){return mc(s)?366:365}oe.parseTwoDigitYear=function(s){return ke(s)+(ke(s)>68?1900:2e3)};var KE=En("FullYear",!0);function CB(){return mc(this.year())}function LB(s,e,t,i,r,n,a){var o;return s<100&&s>=0?(o=new Date(s+400,e,t,i,r,n,a),isFinite(o.getFullYear())&&o.setFullYear(s)):o=new Date(s,e,t,i,r,n,a),o}function ma(s){var e,t;return s<100&&s>=0?(t=Array.prototype.slice.call(arguments),t[0]=s+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(s)):e=new Date(Date.UTC.apply(null,arguments)),e}function Nl(s,e,t){var i=7+e-t,r=(7+ma(s,0,i).getUTCDay()-e)%7;return-r+i-1}function WE(s,e,t,i,r){var n=(7+t-i)%7,a=Nl(s,i,r),o=1+7*(e-1)+n+a,l,c;return o<=0?(l=s-1,c=qn(l)+o):o>qn(s)?(l=s+1,c=o-qn(s)):(l=s,c=o),{year:l,dayOfYear:c}}function ga(s,e,t){var i=Nl(s.year(),e,t),r=Math.floor((s.dayOfYear()-i-1)/7)+1,n,a;return r<1?(a=s.year()-1,n=r+vi(a,e,t)):r>vi(s.year(),e,t)?(n=r-vi(s.year(),e,t),a=s.year()+1):(a=s.year(),n=r),{week:n,year:a}}function vi(s,e,t){var i=Nl(s,e,t),r=Nl(s+1,e,t);return(qn(s)-i+r)/7}he("w",["ww",2],"wo","week");he("W",["WW",2],"Wo","isoWeek");Ot("week","w");Ot("isoWeek","W");Mt("week",5);Mt("isoWeek",5);ue("w",st);ue("ww",st,fs);ue("W",st);ue("WW",st,fs);Da(["w","ww","W","WW"],function(s,e,t,i){e[i.substr(0,1)]=ke(s)});function IB(s){return ga(s,this._week.dow,this._week.doy).week}var RB={dow:0,doy:6};function DB(){return this._week.dow}function kB(){return this._week.doy}function PB(s){var e=this.localeData().week(this);return s==null?e:this.add((s-e)*7,"d")}function OB(s){var e=ga(this,1,4).week;return s==null?e:this.add((s-e)*7,"d")}he("d",0,"do","day");he("dd",0,0,function(s){return this.localeData().weekdaysMin(this,s)});he("ddd",0,0,function(s){return this.localeData().weekdaysShort(this,s)});he("dddd",0,0,function(s){return this.localeData().weekdays(this,s)});he("e",0,0,"weekday");he("E",0,0,"isoWeekday");Ot("day","d");Ot("weekday","e");Ot("isoWeekday","E");Mt("day",11);Mt("weekday",11);Mt("isoWeekday",11);ue("d",st);ue("e",st);ue("E",st);ue("dd",function(s,e){return e.weekdaysMinRegex(s)});ue("ddd",function(s,e){return e.weekdaysShortRegex(s)});ue("dddd",function(s,e){return e.weekdaysRegex(s)});Da(["dd","ddd","dddd"],function(s,e,t,i){var r=t._locale.weekdaysParse(s,i,t._strict);r!=null?e.d=r:we(t).invalidWeekday=s});Da(["d","e","E"],function(s,e,t,i){e[i]=ke(s)});function MB(s,e){return typeof s!="string"?s:isNaN(s)?(s=e.weekdaysParse(s),typeof s=="number"?s:null):parseInt(s,10)}function NB(s,e){return typeof s=="string"?e.weekdaysParse(s)%7||7:isNaN(s)?null:s}function Uh(s,e){return s.slice(e,7).concat(s.slice(0,e))}var FB="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zE="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$B="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),BB=Ra,UB=Ra,GB=Ra;function HB(s,e){var t=ks(this._weekdays)?this._weekdays:this._weekdays[s&&s!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return s===!0?Uh(t,this._week.dow):s?t[s.day()]:t}function YB(s){return s===!0?Uh(this._weekdaysShort,this._week.dow):s?this._weekdaysShort[s.day()]:this._weekdaysShort}function jB(s){return s===!0?Uh(this._weekdaysMin,this._week.dow):s?this._weekdaysMin[s.day()]:this._weekdaysMin}function VB(s,e,t){var i,r,n,a=s.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)n=ii([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(n,"").toLocaleLowerCase();return t?e==="dddd"?(r=dt.call(this._weekdaysParse,a),r!==-1?r:null):e==="ddd"?(r=dt.call(this._shortWeekdaysParse,a),r!==-1?r:null):(r=dt.call(this._minWeekdaysParse,a),r!==-1?r:null):e==="dddd"?(r=dt.call(this._weekdaysParse,a),r!==-1||(r=dt.call(this._shortWeekdaysParse,a),r!==-1)?r:(r=dt.call(this._minWeekdaysParse,a),r!==-1?r:null)):e==="ddd"?(r=dt.call(this._shortWeekdaysParse,a),r!==-1||(r=dt.call(this._weekdaysParse,a),r!==-1)?r:(r=dt.call(this._minWeekdaysParse,a),r!==-1?r:null)):(r=dt.call(this._minWeekdaysParse,a),r!==-1||(r=dt.call(this._weekdaysParse,a),r!==-1)?r:(r=dt.call(this._shortWeekdaysParse,a),r!==-1?r:null))}function KB(s,e,t){var i,r,n;if(this._weekdaysParseExact)return VB.call(this,s,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=ii([2e3,1]).day(i),t&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(n="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(n.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[i].test(s))return i;if(t&&e==="ddd"&&this._shortWeekdaysParse[i].test(s))return i;if(t&&e==="dd"&&this._minWeekdaysParse[i].test(s))return i;if(!t&&this._weekdaysParse[i].test(s))return i}}function WB(s){if(!this.isValid())return s!=null?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return s!=null?(s=MB(s,this.localeData()),this.add(s-e,"d")):e}function zB(s){if(!this.isValid())return s!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return s==null?e:this.add(s-e,"d")}function QB(s){if(!this.isValid())return s!=null?this:NaN;if(s!=null){var e=NB(s,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function qB(s){return this._weekdaysParseExact?(Ge(this,"_weekdaysRegex")||Gh.call(this),s?this._weekdaysStrictRegex:this._weekdaysRegex):(Ge(this,"_weekdaysRegex")||(this._weekdaysRegex=BB),this._weekdaysStrictRegex&&s?this._weekdaysStrictRegex:this._weekdaysRegex)}function XB(s){return this._weekdaysParseExact?(Ge(this,"_weekdaysRegex")||Gh.call(this),s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ge(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=UB),this._weekdaysShortStrictRegex&&s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function JB(s){return this._weekdaysParseExact?(Ge(this,"_weekdaysRegex")||Gh.call(this),s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ge(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=GB),this._weekdaysMinStrictRegex&&s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Gh(){function s(u,f){return f.length-u.length}var e=[],t=[],i=[],r=[],n,a,o,l,c;for(n=0;n<7;n++)a=ii([2e3,1]).day(n),o=as(this.weekdaysMin(a,"")),l=as(this.weekdaysShort(a,"")),c=as(this.weekdays(a,"")),e.push(o),t.push(l),i.push(c),r.push(o),r.push(l),r.push(c);e.sort(s),t.sort(s),i.sort(s),r.sort(s),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Hh(){return this.hours()%12||12}function ZB(){return this.hours()||24}he("H",["HH",2],0,"hour");he("h",["hh",2],0,Hh);he("k",["kk",2],0,ZB);he("hmm",0,0,function(){return""+Hh.apply(this)+ti(this.minutes(),2)});he("hmmss",0,0,function(){return""+Hh.apply(this)+ti(this.minutes(),2)+ti(this.seconds(),2)});he("Hmm",0,0,function(){return""+this.hours()+ti(this.minutes(),2)});he("Hmmss",0,0,function(){return""+this.hours()+ti(this.minutes(),2)+ti(this.seconds(),2)});function QE(s,e){he(s,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}QE("a",!0);QE("A",!1);Ot("hour","h");Mt("hour",13);function qE(s,e){return e._meridiemParse}ue("a",qE);ue("A",qE);ue("H",st);ue("h",st);ue("k",st);ue("HH",st,fs);ue("hh",st,fs);ue("kk",st,fs);ue("hmm",BE);ue("hmmss",UE);ue("Hmm",BE);ue("Hmmss",UE);Qe(["H","HH"],yt);Qe(["k","kk"],function(s,e,t){var i=ke(s);e[yt]=i===24?0:i});Qe(["a","A"],function(s,e,t){t._isPm=t._locale.isPM(s),t._meridiem=s});Qe(["h","hh"],function(s,e,t){e[yt]=ke(s),we(t).bigHour=!0});Qe("hmm",function(s,e,t){var i=s.length-2;e[yt]=ke(s.substr(0,i)),e[Rs]=ke(s.substr(i)),we(t).bigHour=!0});Qe("hmmss",function(s,e,t){var i=s.length-4,r=s.length-2;e[yt]=ke(s.substr(0,i)),e[Rs]=ke(s.substr(i,2)),e[gi]=ke(s.substr(r)),we(t).bigHour=!0});Qe("Hmm",function(s,e,t){var i=s.length-2;e[yt]=ke(s.substr(0,i)),e[Rs]=ke(s.substr(i))});Qe("Hmmss",function(s,e,t){var i=s.length-4,r=s.length-2;e[yt]=ke(s.substr(0,i)),e[Rs]=ke(s.substr(i,2)),e[gi]=ke(s.substr(r))});function e3(s){return(s+"").toLowerCase().charAt(0)==="p"}var t3=/[ap]\.?m?\.?/i,s3=En("Hours",!0);function i3(s,e,t){return s>11?t?"pm":"PM":t?"am":"AM"}var XE={calendar:K$,longDateFormat:q$,invalidDate:J$,ordinal:eB,dayOfMonthOrdinalParse:tB,relativeTime:iB,months:vB,monthsShort:GE,week:RB,weekdays:FB,weekdaysMin:$B,weekdaysShort:zE,meridiemParse:t3},it={},Nn={},va;function r3(s,e){var t,i=Math.min(s.length,e.length);for(t=0;t<i;t+=1)if(s[t]!==e[t])return t;return i}function M0(s){return s&&s.toLowerCase().replace("_","-")}function n3(s){for(var e=0,t,i,r,n;e<s.length;){for(n=M0(s[e]).split("-"),t=n.length,i=M0(s[e+1]),i=i?i.split("-"):null;t>0;){if(r=_c(n.slice(0,t).join("-")),r)return r;if(i&&i.length>=t&&r3(n,i)>=t-1)break;t--}e++}return va}function a3(s){return s.match("^[^/\\\\]*$")!=null}function _c(s){var e=null,t;if(it[s]===void 0&&typeof Jn<"u"&&Jn&&Jn.exports&&a3(s))try{e=va._abbr,t=require,t("./locale/"+s),Ki(e)}catch{it[s]=null}return it[s]}function Ki(s,e){var t;return s&&(Vt(e)?t=Ai(s):t=Yh(s,e),t?va=t:typeof console<"u"&&console.warn&&console.warn("Locale "+s+" not found. Did you forget to load it?")),va._abbr}function Yh(s,e){if(e!==null){var t,i=XE;if(e.abbr=s,it[s]!=null)PE("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=it[s]._config;else if(e.parentLocale!=null)if(it[e.parentLocale]!=null)i=it[e.parentLocale]._config;else if(t=_c(e.parentLocale),t!=null)i=t._config;else return Nn[e.parentLocale]||(Nn[e.parentLocale]=[]),Nn[e.parentLocale].push({name:s,config:e}),null;return it[s]=new Mh(id(i,e)),Nn[s]&&Nn[s].forEach(function(r){Yh(r.name,r.config)}),Ki(s),it[s]}else return delete it[s],null}function o3(s,e){if(e!=null){var t,i,r=XE;it[s]!=null&&it[s].parentLocale!=null?it[s].set(id(it[s]._config,e)):(i=_c(s),i!=null&&(r=i._config),e=id(r,e),i==null&&(e.abbr=s),t=new Mh(e),t.parentLocale=it[s],it[s]=t),Ki(s)}else it[s]!=null&&(it[s].parentLocale!=null?(it[s]=it[s].parentLocale,s===Ki()&&Ki(s)):it[s]!=null&&delete it[s]);return it[s]}function Ai(s){var e;if(s&&s._locale&&s._locale._abbr&&(s=s._locale._abbr),!s)return va;if(!ks(s)){if(e=_c(s),e)return e;s=[s]}return n3(s)}function l3(){return rd(it)}function jh(s){var e,t=s._a;return t&&we(s).overflow===-2&&(e=t[mi]<0||t[mi]>11?mi:t[Ks]<1||t[Ks]>Ec(t[kt],t[mi])?Ks:t[yt]<0||t[yt]>24||t[yt]===24&&(t[Rs]!==0||t[gi]!==0||t[cr]!==0)?yt:t[Rs]<0||t[Rs]>59?Rs:t[gi]<0||t[gi]>59?gi:t[cr]<0||t[cr]>999?cr:-1,we(s)._overflowDayOfYear&&(e<kt||e>Ks)&&(e=Ks),we(s)._overflowWeeks&&e===-1&&(e=pB),we(s)._overflowWeekday&&e===-1&&(e=mB),we(s).overflow=e),s}var c3=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,u3=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,f3=/Z|[+-]\d\d(?::?\d\d)?/,vo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Hu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],d3=/^\/?Date\((-?\d+)/i,h3=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,p3={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function JE(s){var e,t,i=s._i,r=c3.exec(i)||u3.exec(i),n,a,o,l,c=vo.length,u=Hu.length;if(r){for(we(s).iso=!0,e=0,t=c;e<t;e++)if(vo[e][1].exec(r[1])){a=vo[e][0],n=vo[e][2]!==!1;break}if(a==null){s._isValid=!1;return}if(r[3]){for(e=0,t=u;e<t;e++)if(Hu[e][1].exec(r[3])){o=(r[2]||" ")+Hu[e][0];break}if(o==null){s._isValid=!1;return}}if(!n&&o!=null){s._isValid=!1;return}if(r[4])if(f3.exec(r[4]))l="Z";else{s._isValid=!1;return}s._f=a+(o||"")+(l||""),Kh(s)}else s._isValid=!1}function m3(s,e,t,i,r,n){var a=[g3(s),GE.indexOf(e),parseInt(t,10),parseInt(i,10),parseInt(r,10)];return n&&a.push(parseInt(n,10)),a}function g3(s){var e=parseInt(s,10);return e<=49?2e3+e:e<=999?1900+e:e}function v3(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function y3(s,e,t){if(s){var i=zE.indexOf(s),r=new Date(e[0],e[1],e[2]).getDay();if(i!==r)return we(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function b3(s,e,t){if(s)return p3[s];if(e)return 0;var i=parseInt(t,10),r=i%100,n=(i-r)/100;return n*60+r}function ZE(s){var e=h3.exec(v3(s._i)),t;if(e){if(t=m3(e[4],e[3],e[2],e[5],e[6],e[7]),!y3(e[1],t,s))return;s._a=t,s._tzm=b3(e[8],e[9],e[10]),s._d=ma.apply(null,s._a),s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),we(s).rfc2822=!0}else s._isValid=!1}function S3(s){var e=d3.exec(s._i);if(e!==null){s._d=new Date(+e[1]);return}if(JE(s),s._isValid===!1)delete s._isValid;else return;if(ZE(s),s._isValid===!1)delete s._isValid;else return;s._strict?s._isValid=!1:oe.createFromInputFallback(s)}oe.createFromInputFallback=_s("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(s){s._d=new Date(s._i+(s._useUTC?" UTC":""))});function jr(s,e,t){return s??e??t}function E3(s){var e=new Date(oe.now());return s._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Vh(s){var e,t,i=[],r,n,a;if(!s._d){for(r=E3(s),s._w&&s._a[Ks]==null&&s._a[mi]==null&&_3(s),s._dayOfYear!=null&&(a=jr(s._a[kt],r[kt]),(s._dayOfYear>qn(a)||s._dayOfYear===0)&&(we(s)._overflowDayOfYear=!0),t=ma(a,0,s._dayOfYear),s._a[mi]=t.getUTCMonth(),s._a[Ks]=t.getUTCDate()),e=0;e<3&&s._a[e]==null;++e)s._a[e]=i[e]=r[e];for(;e<7;e++)s._a[e]=i[e]=s._a[e]==null?e===2?1:0:s._a[e];s._a[yt]===24&&s._a[Rs]===0&&s._a[gi]===0&&s._a[cr]===0&&(s._nextDay=!0,s._a[yt]=0),s._d=(s._useUTC?ma:LB).apply(null,i),n=s._useUTC?s._d.getUTCDay():s._d.getDay(),s._tzm!=null&&s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),s._nextDay&&(s._a[yt]=24),s._w&&typeof s._w.d<"u"&&s._w.d!==n&&(we(s).weekdayMismatch=!0)}}function _3(s){var e,t,i,r,n,a,o,l,c;e=s._w,e.GG!=null||e.W!=null||e.E!=null?(n=1,a=4,t=jr(e.GG,s._a[kt],ga(et(),1,4).year),i=jr(e.W,1),r=jr(e.E,1),(r<1||r>7)&&(l=!0)):(n=s._locale._week.dow,a=s._locale._week.doy,c=ga(et(),n,a),t=jr(e.gg,s._a[kt],c.year),i=jr(e.w,c.week),e.d!=null?(r=e.d,(r<0||r>6)&&(l=!0)):e.e!=null?(r=e.e+n,(e.e<0||e.e>6)&&(l=!0)):r=n),i<1||i>vi(t,n,a)?we(s)._overflowWeeks=!0:l!=null?we(s)._overflowWeekday=!0:(o=WE(t,i,r,n,a),s._a[kt]=o.year,s._dayOfYear=o.dayOfYear)}oe.ISO_8601=function(){};oe.RFC_2822=function(){};function Kh(s){if(s._f===oe.ISO_8601){JE(s);return}if(s._f===oe.RFC_2822){ZE(s);return}s._a=[],we(s).empty=!0;var e=""+s._i,t,i,r,n,a,o=e.length,l=0,c,u;for(r=OE(s._f,s._locale).match(Nh)||[],u=r.length,t=0;t<u;t++)n=r[t],i=(e.match(fB(n,s))||[])[0],i&&(a=e.substr(0,e.indexOf(i)),a.length>0&&we(s).unusedInput.push(a),e=e.slice(e.indexOf(i)+i.length),l+=i.length),sn[n]?(i?we(s).empty=!1:we(s).unusedTokens.push(n),hB(n,i,s)):s._strict&&!i&&we(s).unusedTokens.push(n);we(s).charsLeftOver=o-l,e.length>0&&we(s).unusedInput.push(e),s._a[yt]<=12&&we(s).bigHour===!0&&s._a[yt]>0&&(we(s).bigHour=void 0),we(s).parsedDateParts=s._a.slice(0),we(s).meridiem=s._meridiem,s._a[yt]=x3(s._locale,s._a[yt],s._meridiem),c=we(s).era,c!==null&&(s._a[kt]=s._locale.erasConvertYear(c,s._a[kt])),Vh(s),jh(s)}function x3(s,e,t){var i;return t==null?e:s.meridiemHour!=null?s.meridiemHour(e,t):(s.isPM!=null&&(i=s.isPM(t),i&&e<12&&(e+=12),!i&&e===12&&(e=0)),e)}function A3(s){var e,t,i,r,n,a,o=!1,l=s._f.length;if(l===0){we(s).invalidFormat=!0,s._d=new Date(NaN);return}for(r=0;r<l;r++)n=0,a=!1,e=Oh({},s),s._useUTC!=null&&(e._useUTC=s._useUTC),e._f=s._f[r],Kh(e),Ph(e)&&(a=!0),n+=we(e).charsLeftOver,n+=we(e).unusedTokens.length*10,we(e).score=n,o?n<i&&(i=n,t=e):(i==null||n<i||a)&&(i=n,t=e,a&&(o=!0));Bi(s,t||e)}function T3(s){if(!s._d){var e=Fh(s._i),t=e.day===void 0?e.date:e.day;s._a=DE([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(i){return i&&parseInt(i,10)}),Vh(s)}}function w3(s){var e=new Ia(jh(e_(s)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function e_(s){var e=s._i,t=s._f;return s._locale=s._locale||Ai(s._l),e===null||t===void 0&&e===""?pc({nullInput:!0}):(typeof e=="string"&&(s._i=e=s._locale.preparse(e)),Ps(e)?new Ia(jh(e)):(La(e)?s._d=e:ks(t)?A3(s):t?Kh(s):C3(s),Ph(s)||(s._d=null),s))}function C3(s){var e=s._i;Vt(e)?s._d=new Date(oe.now()):La(e)?s._d=new Date(e.valueOf()):typeof e=="string"?S3(s):ks(e)?(s._a=DE(e.slice(0),function(t){return parseInt(t,10)}),Vh(s)):gr(e)?T3(s):_i(e)?s._d=new Date(e):oe.createFromInputFallback(s)}function t_(s,e,t,i,r){var n={};return(e===!0||e===!1)&&(i=e,e=void 0),(t===!0||t===!1)&&(i=t,t=void 0),(gr(s)&&kh(s)||ks(s)&&s.length===0)&&(s=void 0),n._isAMomentObject=!0,n._useUTC=n._isUTC=r,n._l=t,n._i=s,n._f=e,n._strict=i,w3(n)}function et(s,e,t,i){return t_(s,e,t,i,!1)}var L3=_s("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var s=et.apply(null,arguments);return this.isValid()&&s.isValid()?s<this?this:s:pc()}),I3=_s("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var s=et.apply(null,arguments);return this.isValid()&&s.isValid()?s>this?this:s:pc()});function s_(s,e){var t,i;if(e.length===1&&ks(e[0])&&(e=e[0]),!e.length)return et();for(t=e[0],i=1;i<e.length;++i)(!e[i].isValid()||e[i][s](t))&&(t=e[i]);return t}function R3(){var s=[].slice.call(arguments,0);return s_("isBefore",s)}function D3(){var s=[].slice.call(arguments,0);return s_("isAfter",s)}var k3=function(){return Date.now?Date.now():+new Date},Fn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function P3(s){var e,t=!1,i,r=Fn.length;for(e in s)if(Ge(s,e)&&!(dt.call(Fn,e)!==-1&&(s[e]==null||!isNaN(s[e]))))return!1;for(i=0;i<r;++i)if(s[Fn[i]]){if(t)return!1;parseFloat(s[Fn[i]])!==ke(s[Fn[i]])&&(t=!0)}return!0}function O3(){return this._isValid}function M3(){return Fs(NaN)}function xc(s){var e=Fh(s),t=e.year||0,i=e.quarter||0,r=e.month||0,n=e.week||e.isoWeek||0,a=e.day||0,o=e.hour||0,l=e.minute||0,c=e.second||0,u=e.millisecond||0;this._isValid=P3(e),this._milliseconds=+u+c*1e3+l*6e4+o*1e3*60*60,this._days=+a+n*7,this._months=+r+i*3+t*12,this._data={},this._locale=Ai(),this._bubble()}function Ko(s){return s instanceof xc}function ad(s){return s<0?Math.round(-1*s)*-1:Math.round(s)}function N3(s,e,t){var i=Math.min(s.length,e.length),r=Math.abs(s.length-e.length),n=0,a;for(a=0;a<i;a++)ke(s[a])!==ke(e[a])&&n++;return n+r}function i_(s,e){he(s,0,0,function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+ti(~~(t/60),2)+e+ti(~~t%60,2)})}i_("Z",":");i_("ZZ","");ue("Z",Sc);ue("ZZ",Sc);Qe(["Z","ZZ"],function(s,e,t){t._useUTC=!0,t._tzm=Wh(Sc,s)});var F3=/([\+\-]|\d\d)/gi;function Wh(s,e){var t=(e||"").match(s),i,r,n;return t===null?null:(i=t[t.length-1]||[],r=(i+"").match(F3)||["-",0,0],n=+(r[1]*60)+ke(r[2]),n===0?0:r[0]==="+"?n:-n)}function zh(s,e){var t,i;return e._isUTC?(t=e.clone(),i=(Ps(s)||La(s)?s.valueOf():et(s).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+i),oe.updateOffset(t,!1),t):et(s).local()}function od(s){return-Math.round(s._d.getTimezoneOffset())}oe.updateOffset=function(){};function $3(s,e,t){var i=this._offset||0,r;if(!this.isValid())return s!=null?this:NaN;if(s!=null){if(typeof s=="string"){if(s=Wh(Sc,s),s===null)return this}else Math.abs(s)<16&&!t&&(s=s*60);return!this._isUTC&&e&&(r=od(this)),this._offset=s,this._isUTC=!0,r!=null&&this.add(r,"m"),i!==s&&(!e||this._changeInProgress?a_(this,Fs(s-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,oe.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?i:od(this)}function B3(s,e){return s!=null?(typeof s!="string"&&(s=-s),this.utcOffset(s,e),this):-this.utcOffset()}function U3(s){return this.utcOffset(0,s)}function G3(s){return this._isUTC&&(this.utcOffset(0,s),this._isUTC=!1,s&&this.subtract(od(this),"m")),this}function H3(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var s=Wh(cB,this._i);s!=null?this.utcOffset(s):this.utcOffset(0,!0)}return this}function Y3(s){return this.isValid()?(s=s?et(s).utcOffset():0,(this.utcOffset()-s)%60===0):!1}function j3(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V3(){if(!Vt(this._isDSTShifted))return this._isDSTShifted;var s={},e;return Oh(s,this),s=e_(s),s._a?(e=s._isUTC?ii(s._a):et(s._a),this._isDSTShifted=this.isValid()&&N3(s._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function K3(){return this.isValid()?!this._isUTC:!1}function W3(){return this.isValid()?this._isUTC:!1}function r_(){return this.isValid()?this._isUTC&&this._offset===0:!1}var z3=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Q3=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Fs(s,e){var t=s,i=null,r,n,a;return Ko(s)?t={ms:s._milliseconds,d:s._days,M:s._months}:_i(s)||!isNaN(+s)?(t={},e?t[e]=+s:t.milliseconds=+s):(i=z3.exec(s))?(r=i[1]==="-"?-1:1,t={y:0,d:ke(i[Ks])*r,h:ke(i[yt])*r,m:ke(i[Rs])*r,s:ke(i[gi])*r,ms:ke(ad(i[cr]*1e3))*r}):(i=Q3.exec(s))?(r=i[1]==="-"?-1:1,t={y:or(i[2],r),M:or(i[3],r),w:or(i[4],r),d:or(i[5],r),h:or(i[6],r),m:or(i[7],r),s:or(i[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(a=q3(et(t.from),et(t.to)),t={},t.ms=a.milliseconds,t.M=a.months),n=new xc(t),Ko(s)&&Ge(s,"_locale")&&(n._locale=s._locale),Ko(s)&&Ge(s,"_isValid")&&(n._isValid=s._isValid),n}Fs.fn=xc.prototype;Fs.invalid=M3;function or(s,e){var t=s&&parseFloat(s.replace(",","."));return(isNaN(t)?0:t)*e}function N0(s,e){var t={};return t.months=e.month()-s.month()+(e.year()-s.year())*12,s.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+s.clone().add(t.months,"M"),t}function q3(s,e){var t;return s.isValid()&&e.isValid()?(e=zh(e,s),s.isBefore(e)?t=N0(s,e):(t=N0(e,s),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function n_(s,e){return function(t,i){var r,n;return i!==null&&!isNaN(+i)&&(PE(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=t,t=i,i=n),r=Fs(t,i),a_(this,r,s),this}}function a_(s,e,t,i){var r=e._milliseconds,n=ad(e._days),a=ad(e._months);s.isValid()&&(i=i??!0,a&&YE(s,Ol(s,"Month")+a*t),n&&NE(s,"Date",Ol(s,"Date")+n*t),r&&s._d.setTime(s._d.valueOf()+r*t),i&&oe.updateOffset(s,n||a))}var X3=n_(1,"add"),J3=n_(-1,"subtract");function o_(s){return typeof s=="string"||s instanceof String}function Z3(s){return Ps(s)||La(s)||o_(s)||_i(s)||t5(s)||e5(s)||s===null||s===void 0}function e5(s){var e=gr(s)&&!kh(s),t=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,n,a=i.length;for(r=0;r<a;r+=1)n=i[r],t=t||Ge(s,n);return e&&t}function t5(s){var e=ks(s),t=!1;return e&&(t=s.filter(function(i){return!_i(i)&&o_(s)}).length===0),e&&t}function s5(s){var e=gr(s)&&!kh(s),t=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,n;for(r=0;r<i.length;r+=1)n=i[r],t=t||Ge(s,n);return e&&t}function i5(s,e){var t=s.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function r5(s,e){arguments.length===1&&(arguments[0]?Z3(arguments[0])?(s=arguments[0],e=void 0):s5(arguments[0])&&(e=arguments[0],s=void 0):(s=void 0,e=void 0));var t=s||et(),i=zh(t,this).startOf("day"),r=oe.calendarFormat(this,i)||"sameElse",n=e&&(ri(e[r])?e[r].call(this,t):e[r]);return this.format(n||this.localeData().calendar(r,this,et(t)))}function n5(){return new Ia(this)}function a5(s,e){var t=Ps(s)?s:et(s);return this.isValid()&&t.isValid()?(e=xs(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function o5(s,e){var t=Ps(s)?s:et(s);return this.isValid()&&t.isValid()?(e=xs(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function l5(s,e,t,i){var r=Ps(s)?s:et(s),n=Ps(e)?e:et(e);return this.isValid()&&r.isValid()&&n.isValid()?(i=i||"()",(i[0]==="("?this.isAfter(r,t):!this.isBefore(r,t))&&(i[1]===")"?this.isBefore(n,t):!this.isAfter(n,t))):!1}function c5(s,e){var t=Ps(s)?s:et(s),i;return this.isValid()&&t.isValid()?(e=xs(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(i=t.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function u5(s,e){return this.isSame(s,e)||this.isAfter(s,e)}function f5(s,e){return this.isSame(s,e)||this.isBefore(s,e)}function d5(s,e,t){var i,r,n;if(!this.isValid())return NaN;if(i=zh(s,this),!i.isValid())return NaN;switch(r=(i.utcOffset()-this.utcOffset())*6e4,e=xs(e),e){case"year":n=Wo(this,i)/12;break;case"month":n=Wo(this,i);break;case"quarter":n=Wo(this,i)/3;break;case"second":n=(this-i)/1e3;break;case"minute":n=(this-i)/6e4;break;case"hour":n=(this-i)/36e5;break;case"day":n=(this-i-r)/864e5;break;case"week":n=(this-i-r)/6048e5;break;default:n=this-i}return t?n:gs(n)}function Wo(s,e){if(s.date()<e.date())return-Wo(e,s);var t=(e.year()-s.year())*12+(e.month()-s.month()),i=s.clone().add(t,"months"),r,n;return e-i<0?(r=s.clone().add(t-1,"months"),n=(e-i)/(i-r)):(r=s.clone().add(t+1,"months"),n=(e-i)/(r-i)),-(t+n)||0}oe.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";oe.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function h5(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function p5(s){if(!this.isValid())return null;var e=s!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Vo(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ri(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Vo(t,"Z")):Vo(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function m5(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var s="moment",e="",t,i,r,n;return this.isLocal()||(s=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+s+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=e+'[")]',this.format(t+i+r+n)}function g5(s){s||(s=this.isUtc()?oe.defaultFormatUtc:oe.defaultFormat);var e=Vo(this,s);return this.localeData().postformat(e)}function v5(s,e){return this.isValid()&&(Ps(s)&&s.isValid()||et(s).isValid())?Fs({to:this,from:s}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function y5(s){return this.from(et(),s)}function b5(s,e){return this.isValid()&&(Ps(s)&&s.isValid()||et(s).isValid())?Fs({from:this,to:s}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function S5(s){return this.to(et(),s)}function l_(s){var e;return s===void 0?this._locale._abbr:(e=Ai(s),e!=null&&(this._locale=e),this)}var c_=_s("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(s){return s===void 0?this.localeData():this.locale(s)});function u_(){return this._locale}var Fl=1e3,rn=60*Fl,$l=60*rn,f_=(365*400+97)*24*$l;function nn(s,e){return(s%e+e)%e}function d_(s,e,t){return s<100&&s>=0?new Date(s+400,e,t)-f_:new Date(s,e,t).valueOf()}function h_(s,e,t){return s<100&&s>=0?Date.UTC(s+400,e,t)-f_:Date.UTC(s,e,t)}function E5(s){var e,t;if(s=xs(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?h_:d_,s){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=nn(e+(this._isUTC?0:this.utcOffset()*rn),$l);break;case"minute":e=this._d.valueOf(),e-=nn(e,rn);break;case"second":e=this._d.valueOf(),e-=nn(e,Fl);break}return this._d.setTime(e),oe.updateOffset(this,!0),this}function _5(s){var e,t;if(s=xs(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?h_:d_,s){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=$l-nn(e+(this._isUTC?0:this.utcOffset()*rn),$l)-1;break;case"minute":e=this._d.valueOf(),e+=rn-nn(e,rn)-1;break;case"second":e=this._d.valueOf(),e+=Fl-nn(e,Fl)-1;break}return this._d.setTime(e),oe.updateOffset(this,!0),this}function x5(){return this._d.valueOf()-(this._offset||0)*6e4}function A5(){return Math.floor(this.valueOf()/1e3)}function T5(){return new Date(this.valueOf())}function w5(){var s=this;return[s.year(),s.month(),s.date(),s.hour(),s.minute(),s.second(),s.millisecond()]}function C5(){var s=this;return{years:s.year(),months:s.month(),date:s.date(),hours:s.hours(),minutes:s.minutes(),seconds:s.seconds(),milliseconds:s.milliseconds()}}function L5(){return this.isValid()?this.toISOString():null}function I5(){return Ph(this)}function R5(){return Bi({},we(this))}function D5(){return we(this).overflow}function k5(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr");he("NN",0,0,"eraAbbr");he("NNN",0,0,"eraAbbr");he("NNNN",0,0,"eraName");he("NNNNN",0,0,"eraNarrow");he("y",["y",1],"yo","eraYear");he("y",["yy",2],0,"eraYear");he("y",["yyy",3],0,"eraYear");he("y",["yyyy",4],0,"eraYear");ue("N",Qh);ue("NN",Qh);ue("NNN",Qh);ue("NNNN",Y5);ue("NNNNN",j5);Qe(["N","NN","NNN","NNNN","NNNNN"],function(s,e,t,i){var r=t._locale.erasParse(s,i,t._strict);r?we(t).era=r:we(t).invalidEra=s});ue("y",_n);ue("yy",_n);ue("yyy",_n);ue("yyyy",_n);ue("yo",V5);Qe(["y","yy","yyy","yyyy"],kt);Qe(["yo"],function(s,e,t,i){var r;t._locale._eraYearOrdinalRegex&&(r=s.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[kt]=t._locale.eraYearOrdinalParse(s,r):e[kt]=parseInt(s,10)});function P5(s,e){var t,i,r,n=this._eras||Ai("en")._eras;for(t=0,i=n.length;t<i;++t){switch(typeof n[t].since){case"string":r=oe(n[t].since).startOf("day"),n[t].since=r.valueOf();break}switch(typeof n[t].until){case"undefined":n[t].until=1/0;break;case"string":r=oe(n[t].until).startOf("day").valueOf(),n[t].until=r.valueOf();break}}return n}function O5(s,e,t){var i,r,n=this.eras(),a,o,l;for(s=s.toUpperCase(),i=0,r=n.length;i<r;++i)if(a=n[i].name.toUpperCase(),o=n[i].abbr.toUpperCase(),l=n[i].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(o===s)return n[i];break;case"NNNN":if(a===s)return n[i];break;case"NNNNN":if(l===s)return n[i];break}else if([a,o,l].indexOf(s)>=0)return n[i]}function M5(s,e){var t=s.since<=s.until?1:-1;return e===void 0?oe(s.since).year():oe(s.since).year()+(e-s.offset)*t}function N5(){var s,e,t,i=this.localeData().eras();for(s=0,e=i.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),i[s].since<=t&&t<=i[s].until||i[s].until<=t&&t<=i[s].since)return i[s].name;return""}function F5(){var s,e,t,i=this.localeData().eras();for(s=0,e=i.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),i[s].since<=t&&t<=i[s].until||i[s].until<=t&&t<=i[s].since)return i[s].narrow;return""}function $5(){var s,e,t,i=this.localeData().eras();for(s=0,e=i.length;s<e;++s)if(t=this.clone().startOf("day").valueOf(),i[s].since<=t&&t<=i[s].until||i[s].until<=t&&t<=i[s].since)return i[s].abbr;return""}function B5(){var s,e,t,i,r=this.localeData().eras();for(s=0,e=r.length;s<e;++s)if(t=r[s].since<=r[s].until?1:-1,i=this.clone().startOf("day").valueOf(),r[s].since<=i&&i<=r[s].until||r[s].until<=i&&i<=r[s].since)return(this.year()-oe(r[s].since).year())*t+r[s].offset;return this.year()}function U5(s){return Ge(this,"_erasNameRegex")||qh.call(this),s?this._erasNameRegex:this._erasRegex}function G5(s){return Ge(this,"_erasAbbrRegex")||qh.call(this),s?this._erasAbbrRegex:this._erasRegex}function H5(s){return Ge(this,"_erasNarrowRegex")||qh.call(this),s?this._erasNarrowRegex:this._erasRegex}function Qh(s,e){return e.erasAbbrRegex(s)}function Y5(s,e){return e.erasNameRegex(s)}function j5(s,e){return e.erasNarrowRegex(s)}function V5(s,e){return e._eraYearOrdinalRegex||_n}function qh(){var s=[],e=[],t=[],i=[],r,n,a=this.eras();for(r=0,n=a.length;r<n;++r)e.push(as(a[r].name)),s.push(as(a[r].abbr)),t.push(as(a[r].narrow)),i.push(as(a[r].name)),i.push(as(a[r].abbr)),i.push(as(a[r].narrow));this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}he(0,["gg",2],0,function(){return this.weekYear()%100});he(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ac(s,e){he(0,[s,s.length],0,e)}Ac("gggg","weekYear");Ac("ggggg","weekYear");Ac("GGGG","isoWeekYear");Ac("GGGGG","isoWeekYear");Ot("weekYear","gg");Ot("isoWeekYear","GG");Mt("weekYear",1);Mt("isoWeekYear",1);ue("G",bc);ue("g",bc);ue("GG",st,fs);ue("gg",st,fs);ue("GGGG",Bh,$h);ue("gggg",Bh,$h);ue("GGGGG",yc,gc);ue("ggggg",yc,gc);Da(["gggg","ggggg","GGGG","GGGGG"],function(s,e,t,i){e[i.substr(0,2)]=ke(s)});Da(["gg","GG"],function(s,e,t,i){e[i]=oe.parseTwoDigitYear(s)});function K5(s){return p_.call(this,s,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function W5(s){return p_.call(this,s,this.isoWeek(),this.isoWeekday(),1,4)}function z5(){return vi(this.year(),1,4)}function Q5(){return vi(this.isoWeekYear(),1,4)}function q5(){var s=this.localeData()._week;return vi(this.year(),s.dow,s.doy)}function X5(){var s=this.localeData()._week;return vi(this.weekYear(),s.dow,s.doy)}function p_(s,e,t,i,r){var n;return s==null?ga(this,i,r).year:(n=vi(s,i,r),e>n&&(e=n),J5.call(this,s,e,t,i,r))}function J5(s,e,t,i,r){var n=WE(s,e,t,i,r),a=ma(n.year,0,n.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}he("Q",0,"Qo","quarter");Ot("quarter","Q");Mt("quarter",7);ue("Q",FE);Qe("Q",function(s,e){e[mi]=(ke(s)-1)*3});function Z5(s){return s==null?Math.ceil((this.month()+1)/3):this.month((s-1)*3+this.month()%3)}he("D",["DD",2],"Do","date");Ot("date","D");Mt("date",9);ue("D",st);ue("DD",st,fs);ue("Do",function(s,e){return s?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Qe(["D","DD"],Ks);Qe("Do",function(s,e){e[Ks]=ke(s.match(st)[0])});var m_=En("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear");Ot("dayOfYear","DDD");Mt("dayOfYear",4);ue("DDD",vc);ue("DDDD",$E);Qe(["DDD","DDDD"],function(s,e,t){t._dayOfYear=ke(s)});function eU(s){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return s==null?e:this.add(s-e,"d")}he("m",["mm",2],0,"minute");Ot("minute","m");Mt("minute",14);ue("m",st);ue("mm",st,fs);Qe(["m","mm"],Rs);var tU=En("Minutes",!1);he("s",["ss",2],0,"second");Ot("second","s");Mt("second",15);ue("s",st);ue("ss",st,fs);Qe(["s","ss"],gi);var sU=En("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)});he(0,["SS",2],0,function(){return~~(this.millisecond()/10)});he(0,["SSS",3],0,"millisecond");he(0,["SSSS",4],0,function(){return this.millisecond()*10});he(0,["SSSSS",5],0,function(){return this.millisecond()*100});he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ot("millisecond","ms");Mt("millisecond",16);ue("S",vc,FE);ue("SS",vc,fs);ue("SSS",vc,$E);var Ui,g_;for(Ui="SSSS";Ui.length<=9;Ui+="S")ue(Ui,_n);function iU(s,e){e[cr]=ke(("0."+s)*1e3)}for(Ui="S";Ui.length<=9;Ui+="S")Qe(Ui,iU);g_=En("Milliseconds",!1);he("z",0,0,"zoneAbbr");he("zz",0,0,"zoneName");function rU(){return this._isUTC?"UTC":""}function nU(){return this._isUTC?"Coordinated Universal Time":""}var te=Ia.prototype;te.add=X3;te.calendar=r5;te.clone=n5;te.diff=d5;te.endOf=_5;te.format=g5;te.from=v5;te.fromNow=y5;te.to=b5;te.toNow=S5;te.get=oB;te.invalidAt=D5;te.isAfter=a5;te.isBefore=o5;te.isBetween=l5;te.isSame=c5;te.isSameOrAfter=u5;te.isSameOrBefore=f5;te.isValid=I5;te.lang=c_;te.locale=l_;te.localeData=u_;te.max=I3;te.min=L3;te.parsingFlags=R5;te.set=lB;te.startOf=E5;te.subtract=J3;te.toArray=w5;te.toObject=C5;te.toDate=T5;te.toISOString=p5;te.inspect=m5;typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});te.toJSON=L5;te.toString=h5;te.unix=A5;te.valueOf=x5;te.creationData=k5;te.eraName=N5;te.eraNarrow=F5;te.eraAbbr=$5;te.eraYear=B5;te.year=KE;te.isLeapYear=CB;te.weekYear=K5;te.isoWeekYear=W5;te.quarter=te.quarters=Z5;te.month=jE;te.daysInMonth=AB;te.week=te.weeks=PB;te.isoWeek=te.isoWeeks=OB;te.weeksInYear=q5;te.weeksInWeekYear=X5;te.isoWeeksInYear=z5;te.isoWeeksInISOWeekYear=Q5;te.date=m_;te.day=te.days=WB;te.weekday=zB;te.isoWeekday=QB;te.dayOfYear=eU;te.hour=te.hours=s3;te.minute=te.minutes=tU;te.second=te.seconds=sU;te.millisecond=te.milliseconds=g_;te.utcOffset=$3;te.utc=U3;te.local=G3;te.parseZone=H3;te.hasAlignedHourOffset=Y3;te.isDST=j3;te.isLocal=K3;te.isUtcOffset=W3;te.isUtc=r_;te.isUTC=r_;te.zoneAbbr=rU;te.zoneName=nU;te.dates=_s("dates accessor is deprecated. Use date instead.",m_);te.months=_s("months accessor is deprecated. Use month instead",jE);te.years=_s("years accessor is deprecated. Use year instead",KE);te.zone=_s("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",B3);te.isDSTShifted=_s("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V3);function aU(s){return et(s*1e3)}function oU(){return et.apply(null,arguments).parseZone()}function v_(s){return s}var He=Mh.prototype;He.calendar=W$;He.longDateFormat=X$;He.invalidDate=Z$;He.ordinal=sB;He.preparse=v_;He.postformat=v_;He.relativeTime=rB;He.pastFuture=nB;He.set=V$;He.eras=P5;He.erasParse=O5;He.erasConvertYear=M5;He.erasAbbrRegex=G5;He.erasNameRegex=U5;He.erasNarrowRegex=H5;He.months=SB;He.monthsShort=EB;He.monthsParse=xB;He.monthsRegex=wB;He.monthsShortRegex=TB;He.week=IB;He.firstDayOfYear=kB;He.firstDayOfWeek=DB;He.weekdays=HB;He.weekdaysMin=jB;He.weekdaysShort=YB;He.weekdaysParse=KB;He.weekdaysRegex=qB;He.weekdaysShortRegex=XB;He.weekdaysMinRegex=JB;He.isPM=e3;He.meridiem=i3;function Bl(s,e,t,i){var r=Ai(),n=ii().set(i,e);return r[t](n,s)}function y_(s,e,t){if(_i(s)&&(e=s,s=void 0),s=s||"",e!=null)return Bl(s,e,t,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Bl(s,i,t,"month");return r}function Xh(s,e,t,i){typeof s=="boolean"?(_i(e)&&(t=e,e=void 0),e=e||""):(e=s,t=e,s=!1,_i(e)&&(t=e,e=void 0),e=e||"");var r=Ai(),n=s?r._week.dow:0,a,o=[];if(t!=null)return Bl(e,(t+n)%7,i,"day");for(a=0;a<7;a++)o[a]=Bl(e,(a+n)%7,i,"day");return o}function lU(s,e){return y_(s,e,"months")}function cU(s,e){return y_(s,e,"monthsShort")}function uU(s,e,t){return Xh(s,e,t,"weekdays")}function fU(s,e,t){return Xh(s,e,t,"weekdaysShort")}function dU(s,e,t){return Xh(s,e,t,"weekdaysMin")}Ki("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(s){var e=s%10,t=ke(s%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return s+t}});oe.lang=_s("moment.lang is deprecated. Use moment.locale instead.",Ki);oe.langData=_s("moment.langData is deprecated. Use moment.localeData instead.",Ai);var ci=Math.abs;function hU(){var s=this._data;return this._milliseconds=ci(this._milliseconds),this._days=ci(this._days),this._months=ci(this._months),s.milliseconds=ci(s.milliseconds),s.seconds=ci(s.seconds),s.minutes=ci(s.minutes),s.hours=ci(s.hours),s.months=ci(s.months),s.years=ci(s.years),this}function b_(s,e,t,i){var r=Fs(e,t);return s._milliseconds+=i*r._milliseconds,s._days+=i*r._days,s._months+=i*r._months,s._bubble()}function pU(s,e){return b_(this,s,e,1)}function mU(s,e){return b_(this,s,e,-1)}function F0(s){return s<0?Math.floor(s):Math.ceil(s)}function gU(){var s=this._milliseconds,e=this._days,t=this._months,i=this._data,r,n,a,o,l;return s>=0&&e>=0&&t>=0||s<=0&&e<=0&&t<=0||(s+=F0(ld(t)+e)*864e5,e=0,t=0),i.milliseconds=s%1e3,r=gs(s/1e3),i.seconds=r%60,n=gs(r/60),i.minutes=n%60,a=gs(n/60),i.hours=a%24,e+=gs(a/24),l=gs(S_(e)),t+=l,e-=F0(ld(l)),o=gs(t/12),t%=12,i.days=e,i.months=t,i.years=o,this}function S_(s){return s*4800/146097}function ld(s){return s*146097/4800}function vU(s){if(!this.isValid())return NaN;var e,t,i=this._milliseconds;if(s=xs(s),s==="month"||s==="quarter"||s==="year")switch(e=this._days+i/864e5,t=this._months+S_(e),s){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(ld(this._months)),s){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return e*24+i/36e5;case"minute":return e*1440+i/6e4;case"second":return e*86400+i/1e3;case"millisecond":return Math.floor(e*864e5)+i;default:throw new Error("Unknown unit "+s)}}function yU(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+ke(this._months/12)*31536e6:NaN}function Ti(s){return function(){return this.as(s)}}var bU=Ti("ms"),SU=Ti("s"),EU=Ti("m"),_U=Ti("h"),xU=Ti("d"),AU=Ti("w"),TU=Ti("M"),wU=Ti("Q"),CU=Ti("y");function LU(){return Fs(this)}function IU(s){return s=xs(s),this.isValid()?this[s+"s"]():NaN}function Lr(s){return function(){return this.isValid()?this._data[s]:NaN}}var RU=Lr("milliseconds"),DU=Lr("seconds"),kU=Lr("minutes"),PU=Lr("hours"),OU=Lr("days"),MU=Lr("months"),NU=Lr("years");function FU(){return gs(this.days()/7)}var di=Math.round,Qr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function $U(s,e,t,i,r){return r.relativeTime(e||1,!!t,s,i)}function BU(s,e,t,i){var r=Fs(s).abs(),n=di(r.as("s")),a=di(r.as("m")),o=di(r.as("h")),l=di(r.as("d")),c=di(r.as("M")),u=di(r.as("w")),f=di(r.as("y")),d=n<=t.ss&&["s",n]||n<t.s&&["ss",n]||a<=1&&["m"]||a<t.m&&["mm",a]||o<=1&&["h"]||o<t.h&&["hh",o]||l<=1&&["d"]||l<t.d&&["dd",l];return t.w!=null&&(d=d||u<=1&&["w"]||u<t.w&&["ww",u]),d=d||c<=1&&["M"]||c<t.M&&["MM",c]||f<=1&&["y"]||["yy",f],d[2]=e,d[3]=+s>0,d[4]=i,$U.apply(null,d)}function UU(s){return s===void 0?di:typeof s=="function"?(di=s,!0):!1}function GU(s,e){return Qr[s]===void 0?!1:e===void 0?Qr[s]:(Qr[s]=e,s==="s"&&(Qr.ss=e-1),!0)}function HU(s,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,i=Qr,r,n;return typeof s=="object"&&(e=s,s=!1),typeof s=="boolean"&&(t=s),typeof e=="object"&&(i=Object.assign({},Qr,e),e.s!=null&&e.ss==null&&(i.ss=e.s-1)),r=this.localeData(),n=BU(this,!t,i,r),t&&(n=r.pastFuture(+this,n)),r.postformat(n)}var Yu=Math.abs;function Gr(s){return(s>0)-(s<0)||+s}function Tc(){if(!this.isValid())return this.localeData().invalidDate();var s=Yu(this._milliseconds)/1e3,e=Yu(this._days),t=Yu(this._months),i,r,n,a,o=this.asSeconds(),l,c,u,f;return o?(i=gs(s/60),r=gs(i/60),s%=60,i%=60,n=gs(t/12),t%=12,a=s?s.toFixed(3).replace(/\.?0+$/,""):"",l=o<0?"-":"",c=Gr(this._months)!==Gr(o)?"-":"",u=Gr(this._days)!==Gr(o)?"-":"",f=Gr(this._milliseconds)!==Gr(o)?"-":"",l+"P"+(n?c+n+"Y":"")+(t?c+t+"M":"")+(e?u+e+"D":"")+(r||i||s?"T":"")+(r?f+r+"H":"")+(i?f+i+"M":"")+(s?f+a+"S":"")):"P0D"}var $e=xc.prototype;$e.isValid=O3;$e.abs=hU;$e.add=pU;$e.subtract=mU;$e.as=vU;$e.asMilliseconds=bU;$e.asSeconds=SU;$e.asMinutes=EU;$e.asHours=_U;$e.asDays=xU;$e.asWeeks=AU;$e.asMonths=TU;$e.asQuarters=wU;$e.asYears=CU;$e.valueOf=yU;$e._bubble=gU;$e.clone=LU;$e.get=IU;$e.milliseconds=RU;$e.seconds=DU;$e.minutes=kU;$e.hours=PU;$e.days=OU;$e.weeks=FU;$e.months=MU;$e.years=NU;$e.humanize=HU;$e.toISOString=Tc;$e.toString=Tc;$e.toJSON=Tc;$e.locale=l_;$e.localeData=u_;$e.toIsoString=_s("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc);$e.lang=c_;he("X",0,0,"unix");he("x",0,0,"valueOf");ue("x",bc);ue("X",uB);Qe("X",function(s,e,t){t._d=new Date(parseFloat(s)*1e3)});Qe("x",function(s,e,t){t._d=new Date(ke(s))});//! moment.js
|
|
408
|
+
oe.version="2.29.4";Y$(et);oe.fn=te;oe.min=R3;oe.max=D3;oe.now=k3;oe.utc=ii;oe.unix=aU;oe.months=lU;oe.isDate=La;oe.locale=Ki;oe.invalid=pc;oe.duration=Fs;oe.isMoment=Ps;oe.weekdays=uU;oe.parseZone=oU;oe.localeData=Ai;oe.isDuration=Ko;oe.monthsShort=cU;oe.weekdaysMin=dU;oe.defineLocale=Yh;oe.updateLocale=o3;oe.locales=l3;oe.weekdaysShort=fU;oe.normalizeUnits=xs;oe.relativeTimeRounding=UU;oe.relativeTimeThreshold=GU;oe.calendarFormat=i5;oe.prototype=te;oe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};Gt.library.add(hc,$$,U$,H$,IE,LE);const YU={name:"ServerStatus",components:{FontAwesomeIcon:Jt},data(){return{sessions:[],clients:[]}},async created(){await this.refresh()},methods:{async refresh(){try{this.sessions=await ie.status.getSessions(),this.clients=await ie.status.getClients()}catch(s){console.error("Failed to fetch server status",s),this.$notify({group:"system",title:"Error",text:"Failed to fetch server status",type:"error"})}},getFileName(s){return s?s.split(/[/\\]/).pop():"Unknown File"},formatDate(s){return oe(s).fromNow()},formatAddress(s){return s.replace(/^::ffff:/,"")},hasActivity(s){return s.activity.movie&&s.activity.movie.length>0||s.activity.series&&s.activity.series.length>0}}};var jU=function(){var e=this,t=e._self._c;return t("div",{staticClass:"server-status"},[t("div",{staticClass:"settings-card"},[t("div",{staticClass:"settings-header-row"},[t("h2",{staticClass:"settings-title-plain"},[e._v(" Active Sessions ")]),t("button",{staticClass:"btn",on:{click:e.refresh}},[t("font-awesome-icon",{attrs:{icon:"sync"}}),e._v(" Refresh ")],1)]),t("div",{staticClass:"status-grid"},[e._l(e.sessions,function(i){return t("div",{key:i.sessionId,staticClass:"status-card"},[t("div",{staticClass:"card-header"},[t("div",{staticClass:"card-title"},[t("font-awesome-icon",{attrs:{icon:"play-circle"}}),t("span",[e._v(e._s(e.getFileName(i.file.path)))])],1),t("span",{class:["status-badge",i.state]},[e._v(e._s(i.state))])]),t("div",{staticClass:"card-body"},[t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("Session ID:")]),t("span",{staticClass:"value monospace"},[e._v(e._s(i.sessionId.substring(0,8))+"...")])]),t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("Output:")]),t("span",{staticClass:"value"},[e._v(e._s(i.output.format)+" ("+e._s(i.output.videoCodec)+"/"+e._s(i.output.audioCodec)+")")])]),t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("Seek Mode:")]),t("span",{staticClass:"value"},[e._v(e._s(i.seekMode))])]),t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("Destinations:")]),t("span",{staticClass:"value"},[e._v(e._s(i.destinationCount))])])])])}),!e.sessions||e.sessions.length===0?t("div",{staticClass:"empty-state"},[t("font-awesome-icon",{staticClass:"empty-icon",attrs:{icon:"film"}}),t("p",[e._v("No active streaming sessions")])],1):e._e()],2)]),t("div",{staticClass:"settings-card"},[e._m(0),t("div",{staticClass:"status-grid"},[e._l(e.clients,function(i){return t("div",{key:i.clientId,staticClass:"status-card"},[t("div",{staticClass:"card-header"},[t("div",{staticClass:"card-title"},[t("font-awesome-icon",{attrs:{icon:"desktop"}}),t("span",[e._v(e._s(i.clientName||"Unknown Client"))])],1),t("span",{staticClass:"user-badge"},[t("font-awesome-icon",{attrs:{icon:"user"}}),e._v(" "+e._s(i.user.username)+" ")],1)]),t("div",{staticClass:"card-body"},[t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("IP Address:")]),t("span",{staticClass:"value monospace"},[e._v(e._s(e.formatAddress(i.address)))])]),t("div",{staticClass:"info-row"},[t("span",{staticClass:"label"},[e._v("Connected:")]),t("span",{staticClass:"value"},[e._v(e._s(e.formatDate(i.connectedAt)))])]),e.hasActivity(i)?t("div",{staticClass:"activity-section"},[t("div",{staticClass:"divider"}),t("div",{staticClass:"activity-title"},[e._v("Now Playing")]),i.activity.movie.length>0?t("div",{staticClass:"activity-item"},[t("font-awesome-icon",{attrs:{icon:"film"}}),e._v(" Movie (ID: "+e._s(i.activity.movie[0].movieId)+") "),t("div",{staticClass:"progress-bar"},[t("div",{staticClass:"progress-fill",style:{width:i.activity.movie[0].progress*100+"%"}})])],1):e._e(),i.activity.series.length>0?t("div",{staticClass:"activity-item"},[t("font-awesome-icon",{attrs:{icon:"tv"}}),e._v(" Episode ")],1):e._e()]):t("div",{staticClass:"activity-section idle"},[t("span",{staticClass:"idle-text"},[e._v("Idle")])])])])}),!e.clients||e.clients.length===0?t("div",{staticClass:"empty-state"},[t("font-awesome-icon",{staticClass:"empty-icon",attrs:{icon:"users"}}),t("p",[e._v("No clients connected")])],1):e._e()],2)])])},VU=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"settings-header-row"},[e("h2",{staticClass:"settings-title-plain"},[s._v(" Connected Clients ")])])}],KU=ve(YU,jU,VU,!1,null,"fd48d58e");const WU=KU.exports;function Ul(s){return Ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(s)}function Xn(s,e){if(!s.vueAxiosInstalled){var t=E_(e)?qU(e):e;if(XU(t)){var i=JU(s);if(i){var r=i<3?zU:QU;Object.keys(t).forEach(function(n){r(s,n,t[n])}),s.vueAxiosInstalled=!0}else console.error("[vue-axios] unknown Vue version")}else console.error("[vue-axios] configuration is invalid, expected options are either <axios_instance> or { <registration_key>: <axios_instance> }")}}function zU(s,e,t){Object.defineProperty(s.prototype,e,{get:function(){return t}}),s[e]=t}function QU(s,e,t){s.config.globalProperties[e]=t,s[e]=t}function E_(s){return s&&typeof s.get=="function"&&typeof s.post=="function"}function qU(s){return{axios:s,$http:s}}function XU(s){return Ul(s)==="object"&&Object.keys(s).every(function(e){return E_(s[e])})}function JU(s){return s&&s.version&&Number(s.version.split(".")[0])}(typeof hd>"u"?"undefined":Ul(hd))=="object"?Jn.exports=Xn:typeof define=="function"&&define.amd?define([],function(){return Xn}):window.Vue&&window.axios&&window.Vue.use&&Vue.use(Xn,window.axios);function __(s,e){return function(){return s.apply(e,arguments)}}const{toString:ZU}=Object.prototype,{getPrototypeOf:Jh}=Object,{iterator:wc,toStringTag:x_}=Symbol,Cc=(s=>e=>{const t=ZU.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),$s=s=>(s=s.toLowerCase(),e=>Cc(e)===s),Lc=s=>e=>typeof e===s,{isArray:xn}=Array,dn=Lc("undefined");function ka(s){return s!==null&&!dn(s)&&s.constructor!==null&&!dn(s.constructor)&&Qt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const A_=$s("ArrayBuffer");function e6(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&A_(s.buffer),e}const t6=Lc("string"),Qt=Lc("function"),T_=Lc("number"),Pa=s=>s!==null&&typeof s=="object",s6=s=>s===!0||s===!1,zo=s=>{if(Cc(s)!=="object")return!1;const e=Jh(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(x_ in s)&&!(wc in s)},i6=s=>{if(!Pa(s)||ka(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},r6=$s("Date"),n6=$s("File"),a6=$s("Blob"),o6=$s("FileList"),l6=s=>Pa(s)&&Qt(s.pipe),c6=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||Qt(s.append)&&((e=Cc(s))==="formdata"||e==="object"&&Qt(s.toString)&&s.toString()==="[object FormData]"))},u6=$s("URLSearchParams"),[f6,d6,h6,p6]=["ReadableStream","Request","Response","Headers"].map($s),m6=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oa(s,e,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let i,r;if(typeof s!="object"&&(s=[s]),xn(s))for(i=0,r=s.length;i<r;i++)e.call(null,s[i],i,s);else{if(ka(s))return;const n=t?Object.getOwnPropertyNames(s):Object.keys(s),a=n.length;let o;for(i=0;i<a;i++)o=n[i],e.call(null,s[o],o,s)}}function w_(s,e){if(ka(s))return null;e=e.toLowerCase();const t=Object.keys(s);let i=t.length,r;for(;i-- >0;)if(r=t[i],e===r.toLowerCase())return r;return null}const ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,C_=s=>!dn(s)&&s!==ur;function cd(){const{caseless:s,skipUndefined:e}=C_(this)&&this||{},t={},i=(r,n)=>{const a=s&&w_(t,n)||n;zo(t[a])&&zo(r)?t[a]=cd(t[a],r):zo(r)?t[a]=cd({},r):xn(r)?t[a]=r.slice():(!e||!dn(r))&&(t[a]=r)};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Oa(arguments[r],i);return t}const g6=(s,e,t,{allOwnKeys:i}={})=>(Oa(e,(r,n)=>{t&&Qt(r)?s[n]=__(r,t):s[n]=r},{allOwnKeys:i}),s),v6=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),y6=(s,e,t,i)=>{s.prototype=Object.create(e.prototype,i),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t)},b6=(s,e,t,i)=>{let r,n,a;const o={};if(e=e||{},s==null)return e;do{for(r=Object.getOwnPropertyNames(s),n=r.length;n-- >0;)a=r[n],(!i||i(a,s,e))&&!o[a]&&(e[a]=s[a],o[a]=!0);s=t!==!1&&Jh(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},S6=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;const i=s.indexOf(e,t);return i!==-1&&i===t},E6=s=>{if(!s)return null;if(xn(s))return s;let e=s.length;if(!T_(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},_6=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&Jh(Uint8Array)),x6=(s,e)=>{const i=(s&&s[wc]).call(s);let r;for(;(r=i.next())&&!r.done;){const n=r.value;e.call(s,n[0],n[1])}},A6=(s,e)=>{let t;const i=[];for(;(t=s.exec(e))!==null;)i.push(t);return i},T6=$s("HTMLFormElement"),w6=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),$0=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),C6=$s("RegExp"),L_=(s,e)=>{const t=Object.getOwnPropertyDescriptors(s),i={};Oa(t,(r,n)=>{let a;(a=e(r,n,s))!==!1&&(i[n]=a||r)}),Object.defineProperties(s,i)},L6=s=>{L_(s,(e,t)=>{if(Qt(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=s[t];if(Qt(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},I6=(s,e)=>{const t={},i=r=>{r.forEach(n=>{t[n]=!0})};return xn(s)?i(s):i(String(s).split(e)),t},R6=()=>{},D6=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e;function k6(s){return!!(s&&Qt(s.append)&&s[x_]==="FormData"&&s[wc])}const P6=s=>{const e=new Array(10),t=(i,r)=>{if(Pa(i)){if(e.indexOf(i)>=0)return;if(ka(i))return i;if(!("toJSON"in i)){e[r]=i;const n=xn(i)?[]:{};return Oa(i,(a,o)=>{const l=t(a,r+1);!dn(l)&&(n[o]=l)}),e[r]=void 0,n}}return i};return t(s,0)},O6=$s("AsyncFunction"),M6=s=>s&&(Pa(s)||Qt(s))&&Qt(s.then)&&Qt(s.catch),I_=((s,e)=>s?setImmediate:e?((t,i)=>(ur.addEventListener("message",({source:r,data:n})=>{r===ur&&n===t&&i.length&&i.shift()()},!1),r=>{i.push(r),ur.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Qt(ur.postMessage)),N6=typeof queueMicrotask<"u"?queueMicrotask.bind(ur):typeof process<"u"&&process.nextTick||I_,F6=s=>s!=null&&Qt(s[wc]),K={isArray:xn,isArrayBuffer:A_,isBuffer:ka,isFormData:c6,isArrayBufferView:e6,isString:t6,isNumber:T_,isBoolean:s6,isObject:Pa,isPlainObject:zo,isEmptyObject:i6,isReadableStream:f6,isRequest:d6,isResponse:h6,isHeaders:p6,isUndefined:dn,isDate:r6,isFile:n6,isBlob:a6,isRegExp:C6,isFunction:Qt,isStream:l6,isURLSearchParams:u6,isTypedArray:_6,isFileList:o6,forEach:Oa,merge:cd,extend:g6,trim:m6,stripBOM:v6,inherits:y6,toFlatObject:b6,kindOf:Cc,kindOfTest:$s,endsWith:S6,toArray:E6,forEachEntry:x6,matchAll:A6,isHTMLForm:T6,hasOwnProperty:$0,hasOwnProp:$0,reduceDescriptors:L_,freezeMethods:L6,toObjectSet:I6,toCamelCase:w6,noop:R6,toFiniteNumber:D6,findKey:w_,global:ur,isContextDefined:C_,isSpecCompliantForm:k6,toJSONObject:P6,isAsyncFn:O6,isThenable:M6,setImmediate:I_,asap:N6,isIterable:F6};function xe(s,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}K.inherits(xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const R_=xe.prototype,D_={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{D_[s]={value:s}});Object.defineProperties(xe,D_);Object.defineProperty(R_,"isAxiosError",{value:!0});xe.from=(s,e,t,i,r,n)=>{const a=Object.create(R_);K.toFlatObject(s,a,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const o=s&&s.message?s.message:"Error",l=e==null&&s?s.code:e;return xe.call(a,o,l,t,i,r),s&&a.cause==null&&Object.defineProperty(a,"cause",{value:s,configurable:!0}),a.name=s&&s.name||"Error",n&&Object.assign(a,n),a};const $6=null;function ud(s){return K.isPlainObject(s)||K.isArray(s)}function k_(s){return K.endsWith(s,"[]")?s.slice(0,-2):s}function B0(s,e,t){return s?s.concat(e).map(function(r,n){return r=k_(r),!t&&n?"["+r+"]":r}).join(t?".":""):e}function B6(s){return K.isArray(s)&&!s.some(ud)}const U6=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)});function Ic(s,e,t){if(!K.isObject(s))throw new TypeError("target must be an object");e=e||new FormData,t=K.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!K.isUndefined(m[g])});const i=t.metaTokens,r=t.visitor||u,n=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(e);if(!K.isFunction(r))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(K.isDate(p))return p.toISOString();if(K.isBoolean(p))return p.toString();if(!l&&K.isBlob(p))throw new xe("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(p)||K.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let v=p;if(p&&!m&&typeof p=="object"){if(K.endsWith(g,"{}"))g=i?g:g.slice(0,-2),p=JSON.stringify(p);else if(K.isArray(p)&&B6(p)||(K.isFileList(p)||K.endsWith(g,"[]"))&&(v=K.toArray(p)))return g=k_(g),v.forEach(function(E,w){!(K.isUndefined(E)||E===null)&&e.append(a===!0?B0([g],w,n):a===null?g:g+"[]",c(E))}),!1}return ud(p)?!0:(e.append(B0(m,g,n),c(p)),!1)}const f=[],d=Object.assign(U6,{defaultVisitor:u,convertValue:c,isVisitable:ud});function h(p,g){if(!K.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(p),K.forEach(p,function(v,y){(!(K.isUndefined(v)||v===null)&&r.call(e,v,K.isString(y)?y.trim():y,g,d))===!0&&h(v,g?g.concat(y):[y])}),f.pop()}}if(!K.isObject(s))throw new TypeError("data must be an object");return h(s),e}function U0(s){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Zh(s,e){this._pairs=[],s&&Ic(s,this,e)}const P_=Zh.prototype;P_.append=function(e,t){this._pairs.push([e,t])};P_.toString=function(e){const t=e?function(i){return e.call(this,i,U0)}:U0;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function G6(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function O_(s,e,t){if(!e)return s;const i=t&&t.encode||G6;K.isFunction(t)&&(t={serialize:t});const r=t&&t.serialize;let n;if(r?n=r(e,t):n=K.isURLSearchParams(e)?e.toString():new Zh(e,t).toString(i),n){const a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+n}return s}class G0{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(i){i!==null&&e(i)})}}const M_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},H6=typeof URLSearchParams<"u"?URLSearchParams:Zh,Y6=typeof FormData<"u"?FormData:null,j6=typeof Blob<"u"?Blob:null,V6={isBrowser:!0,classes:{URLSearchParams:H6,FormData:Y6,Blob:j6},protocols:["http","https","file","blob","url","data"]},ep=typeof window<"u"&&typeof document<"u",fd=typeof navigator=="object"&&navigator||void 0,K6=ep&&(!fd||["ReactNative","NativeScript","NS"].indexOf(fd.product)<0),W6=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",z6=ep&&window.location.href||"http://localhost",Q6=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ep,hasStandardBrowserEnv:K6,hasStandardBrowserWebWorkerEnv:W6,navigator:fd,origin:z6},Symbol.toStringTag,{value:"Module"})),Dt={...Q6,...V6};function q6(s,e){return Ic(s,new Dt.classes.URLSearchParams,{visitor:function(t,i,r,n){return Dt.isNode&&K.isBuffer(t)?(this.append(i,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function X6(s){return K.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function J6(s){const e={},t=Object.keys(s);let i;const r=t.length;let n;for(i=0;i<r;i++)n=t[i],e[n]=s[n];return e}function N_(s){function e(t,i,r,n){let a=t[n++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),l=n>=t.length;return a=!a&&K.isArray(r)?r.length:a,l?(K.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!o):((!r[a]||!K.isObject(r[a]))&&(r[a]=[]),e(t,i,r[a],n)&&K.isArray(r[a])&&(r[a]=J6(r[a])),!o)}if(K.isFormData(s)&&K.isFunction(s.entries)){const t={};return K.forEachEntry(s,(i,r)=>{e(X6(i),r,t,0)}),t}return null}function Z6(s,e,t){if(K.isString(s))try{return(e||JSON.parse)(s),K.trim(s)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(s)}const Ma={transitional:M_,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,n=K.isObject(e);if(n&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return r?JSON.stringify(N_(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(n){if(i.indexOf("application/x-www-form-urlencoded")>-1)return q6(e,this.formSerializer).toString();if((o=K.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ic(o?{"files[]":e}:e,l&&new l,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),Z6(e)):e}],transformResponse:[function(e){const t=this.transitional||Ma.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(i&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(a)throw o.name==="SyntaxError"?xe.from(o,xe.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],s=>{Ma.headers[s]={}});const e8=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),t8=s=>{const e={};let t,i,r;return s&&s.split(`
|
|
409
|
+
`).forEach(function(a){r=a.indexOf(":"),t=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!t||e[t]&&e8[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},H0=Symbol("internals");function $n(s){return s&&String(s).trim().toLowerCase()}function Qo(s){return s===!1||s==null?s:K.isArray(s)?s.map(Qo):String(s)}function s8(s){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(s);)e[i[1]]=i[2];return e}const i8=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ju(s,e,t,i,r){if(K.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!K.isString(e)){if(K.isString(i))return e.indexOf(i)!==-1;if(K.isRegExp(i))return i.test(e)}}function r8(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function n8(s,e){const t=K.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(s,i+t,{value:function(r,n,a){return this[i].call(this,e,r,n,a)},configurable:!0})})}let qt=class{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function n(o,l,c){const u=$n(l);if(!u)throw new Error("header name must be a non-empty string");const f=K.findKey(r,u);(!f||r[f]===void 0||c===!0||c===void 0&&r[f]!==!1)&&(r[f||l]=Qo(o))}const a=(o,l)=>K.forEach(o,(c,u)=>n(c,u,l));if(K.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(K.isString(e)&&(e=e.trim())&&!i8(e))a(t8(e),t);else if(K.isObject(e)&&K.isIterable(e)){let o={},l,c;for(const u of e){if(!K.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[c=u[0]]=(l=o[c])?K.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}a(o,t)}else e!=null&&n(t,e,i);return this}get(e,t){if(e=$n(e),e){const i=K.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return s8(r);if(K.isFunction(t))return t.call(this,r,i);if(K.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=$n(e),e){const i=K.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||ju(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function n(a){if(a=$n(a),a){const o=K.findKey(i,a);o&&(!t||ju(i,i[o],o,t))&&(delete i[o],r=!0)}}return K.isArray(e)?e.forEach(n):n(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const n=t[i];(!e||ju(this,this[n],n,e,!0))&&(delete this[n],r=!0)}return r}normalize(e){const t=this,i={};return K.forEach(this,(r,n)=>{const a=K.findKey(i,n);if(a){t[a]=Qo(r),delete t[n];return}const o=e?r8(n):String(n).trim();o!==n&&delete t[n],t[o]=Qo(r),i[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return K.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&K.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
410
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[H0]=this[H0]={accessors:{}}).accessors,r=this.prototype;function n(a){const o=$n(a);i[o]||(n8(r,a),i[o]=!0)}return K.isArray(e)?e.forEach(n):n(e),this}};qt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.reduceDescriptors(qt.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(i){this[t]=i}}});K.freezeMethods(qt);function Vu(s,e){const t=this||Ma,i=e||t,r=qt.from(i.headers);let n=i.data;return K.forEach(s,function(o){n=o.call(t,n,r.normalize(),e?e.status:void 0)}),r.normalize(),n}function F_(s){return!!(s&&s.__CANCEL__)}function An(s,e,t){xe.call(this,s??"canceled",xe.ERR_CANCELED,e,t),this.name="CanceledError"}K.inherits(An,xe,{__CANCEL__:!0});function $_(s,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?s(t):e(new xe("Request failed with status code "+t.status,[xe.ERR_BAD_REQUEST,xe.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function a8(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function o8(s,e){s=s||10;const t=new Array(s),i=new Array(s);let r=0,n=0,a;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[n];a||(a=c),t[r]=l,i[r]=c;let f=n,d=0;for(;f!==r;)d+=t[f++],f=f%s;if(r=(r+1)%s,r===n&&(n=(n+1)%s),c-a<e)return;const h=u&&c-u;return h?Math.round(d*1e3/h):void 0}}function l8(s,e){let t=0,i=1e3/e,r,n;const a=(c,u=Date.now())=>{t=u,r=null,n&&(clearTimeout(n),n=null),s(...c)};return[(...c)=>{const u=Date.now(),f=u-t;f>=i?a(c,u):(r=c,n||(n=setTimeout(()=>{n=null,a(r)},i-f)))},()=>r&&a(r)]}const Gl=(s,e,t=3)=>{let i=0;const r=o8(50,250);return l8(n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,l=a-i,c=r(l),u=a<=o;i=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:c||void 0,estimated:c&&o&&u?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[e?"download":"upload"]:!0};s(f)},t)},Y0=(s,e)=>{const t=s!=null;return[i=>e[0]({lengthComputable:t,total:s,loaded:i}),e[1]]},j0=s=>(...e)=>K.asap(()=>s(...e)),c8=Dt.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,Dt.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(Dt.origin),Dt.navigator&&/(msie|trident)/i.test(Dt.navigator.userAgent)):()=>!0,u8=Dt.hasStandardBrowserEnv?{write(s,e,t,i,r,n,a){if(typeof document>"u")return;const o=[`${s}=${encodeURIComponent(e)}`];K.isNumber(t)&&o.push(`expires=${new Date(t).toUTCString()}`),K.isString(i)&&o.push(`path=${i}`),K.isString(r)&&o.push(`domain=${r}`),n===!0&&o.push("secure"),K.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(s){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function f8(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function d8(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function B_(s,e,t){let i=!f8(e);return s&&(i||t==!1)?d8(s,e):e}const V0=s=>s instanceof qt?{...s}:s;function xr(s,e){e=e||{};const t={};function i(c,u,f,d){return K.isPlainObject(c)&&K.isPlainObject(u)?K.merge.call({caseless:d},c,u):K.isPlainObject(u)?K.merge({},u):K.isArray(u)?u.slice():u}function r(c,u,f,d){if(K.isUndefined(u)){if(!K.isUndefined(c))return i(void 0,c,f,d)}else return i(c,u,f,d)}function n(c,u){if(!K.isUndefined(u))return i(void 0,u)}function a(c,u){if(K.isUndefined(u)){if(!K.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function o(c,u,f){if(f in e)return i(c,u);if(f in s)return i(void 0,c)}const l={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,u,f)=>r(V0(c),V0(u),f,!0)};return K.forEach(Object.keys({...s,...e}),function(u){const f=l[u]||r,d=f(s[u],e[u],u);K.isUndefined(d)&&f!==o||(t[u]=d)}),t}const U_=s=>{const e=xr({},s);let{data:t,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:n,headers:a,auth:o}=e;if(e.headers=a=qt.from(a),e.url=O_(B_(e.baseURL,e.url,e.allowAbsoluteUrls),s.params,s.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),K.isFormData(t)){if(Dt.hasStandardBrowserEnv||Dt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(K.isFunction(t.getHeaders)){const l=t.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,f])=>{c.includes(u.toLowerCase())&&a.set(u,f)})}}if(Dt.hasStandardBrowserEnv&&(i&&K.isFunction(i)&&(i=i(e)),i||i!==!1&&c8(e.url))){const l=r&&n&&u8.read(n);l&&a.set(r,l)}return e},h8=typeof XMLHttpRequest<"u",p8=h8&&function(s){return new Promise(function(t,i){const r=U_(s);let n=r.data;const a=qt.from(r.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:c}=r,u,f,d,h,p;function g(){h&&h(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout;function v(){if(!m)return;const E=qt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),T={data:!o||o==="text"||o==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:E,config:s,request:m};$_(function(k){t(k),g()},function(k){i(k),g()},T),m=null}"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(v)},m.onabort=function(){m&&(i(new xe("Request aborted",xe.ECONNABORTED,s,m)),m=null)},m.onerror=function(w){const T=w&&w.message?w.message:"Network Error",$=new xe(T,xe.ERR_NETWORK,s,m);$.event=w||null,i($),m=null},m.ontimeout=function(){let w=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const T=r.transitional||M_;r.timeoutErrorMessage&&(w=r.timeoutErrorMessage),i(new xe(w,T.clarifyTimeoutError?xe.ETIMEDOUT:xe.ECONNABORTED,s,m)),m=null},n===void 0&&a.setContentType(null),"setRequestHeader"in m&&K.forEach(a.toJSON(),function(w,T){m.setRequestHeader(T,w)}),K.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),o&&o!=="json"&&(m.responseType=r.responseType),c&&([d,p]=Gl(c,!0),m.addEventListener("progress",d)),l&&m.upload&&([f,h]=Gl(l),m.upload.addEventListener("progress",f),m.upload.addEventListener("loadend",h)),(r.cancelToken||r.signal)&&(u=E=>{m&&(i(!E||E.type?new An(null,s,m):E),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const y=a8(r.url);if(y&&Dt.protocols.indexOf(y)===-1){i(new xe("Unsupported protocol "+y+":",xe.ERR_BAD_REQUEST,s));return}m.send(n||null)})},m8=(s,e)=>{const{length:t}=s=s?s.filter(Boolean):[];if(e||t){let i=new AbortController,r;const n=function(c){if(!r){r=!0,o();const u=c instanceof Error?c:this.reason;i.abort(u instanceof xe?u:new An(u instanceof Error?u.message:u))}};let a=e&&setTimeout(()=>{a=null,n(new xe(`timeout ${e} of ms exceeded`,xe.ETIMEDOUT))},e);const o=()=>{s&&(a&&clearTimeout(a),a=null,s.forEach(c=>{c.unsubscribe?c.unsubscribe(n):c.removeEventListener("abort",n)}),s=null)};s.forEach(c=>c.addEventListener("abort",n));const{signal:l}=i;return l.unsubscribe=()=>K.asap(o),l}},g8=function*(s,e){let t=s.byteLength;if(t<e){yield s;return}let i=0,r;for(;i<t;)r=i+e,yield s.slice(i,r),i=r},v8=async function*(s,e){for await(const t of y8(s))yield*g8(t,e)},y8=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const e=s.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},K0=(s,e,t,i)=>{const r=v8(s,e);let n=0,a,o=l=>{a||(a=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){o(),l.close();return}let f=u.byteLength;if(t){let d=n+=f;t(d)}l.enqueue(new Uint8Array(u))}catch(c){throw o(c),c}},cancel(l){return o(l),r.return()}},{highWaterMark:2})},W0=64*1024,{isFunction:yo}=K,b8=(({Request:s,Response:e})=>({Request:s,Response:e}))(K.global),{ReadableStream:z0,TextEncoder:Q0}=K.global,q0=(s,...e)=>{try{return!!s(...e)}catch{return!1}},S8=s=>{s=K.merge.call({skipUndefined:!0},b8,s);const{fetch:e,Request:t,Response:i}=s,r=e?yo(e):typeof fetch=="function",n=yo(t),a=yo(i);if(!r)return!1;const o=r&&yo(z0),l=r&&(typeof Q0=="function"?(p=>g=>p.encode(g))(new Q0):async p=>new Uint8Array(await new t(p).arrayBuffer())),c=n&&o&&q0(()=>{let p=!1;const g=new t(Dt.origin,{body:new z0,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),u=a&&o&&q0(()=>K.isReadableStream(new i("").body)),f={stream:u&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!f[p]&&(f[p]=(g,m)=>{let v=g&&g[p];if(v)return v.call(g);throw new xe(`Response type '${p}' is not supported`,xe.ERR_NOT_SUPPORT,m)})});const d=async p=>{if(p==null)return 0;if(K.isBlob(p))return p.size;if(K.isSpecCompliantForm(p))return(await new t(Dt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(K.isArrayBufferView(p)||K.isArrayBuffer(p))return p.byteLength;if(K.isURLSearchParams(p)&&(p=p+""),K.isString(p))return(await l(p)).byteLength},h=async(p,g)=>{const m=K.toFiniteNumber(p.getContentLength());return m??d(g)};return async p=>{let{url:g,method:m,data:v,signal:y,cancelToken:E,timeout:w,onDownloadProgress:T,onUploadProgress:$,responseType:k,headers:M,withCredentials:_="same-origin",fetchOptions:C}=U_(p),U=e||fetch;k=k?(k+"").toLowerCase():"text";let L=m8([y,E&&E.toAbortSignal()],w),R=null;const B=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let S;try{if($&&c&&m!=="get"&&m!=="head"&&(S=await h(M,v))!==0){let N=new t(g,{method:"POST",body:v,duplex:"half"}),P;if(K.isFormData(v)&&(P=N.headers.get("content-type"))&&M.setContentType(P),N.body){const[Y,z]=Y0(S,Gl(j0($)));v=K0(N.body,W0,Y,z)}}K.isString(_)||(_=_?"include":"omit");const A=n&&"credentials"in t.prototype,I={...C,signal:L,method:m.toUpperCase(),headers:M.normalize().toJSON(),body:v,duplex:"half",credentials:A?_:void 0};R=n&&new t(g,I);let D=await(n?U(R,C):U(g,I));const O=u&&(k==="stream"||k==="response");if(u&&(T||O&&B)){const N={};["status","statusText","headers"].forEach(J=>{N[J]=D[J]});const P=K.toFiniteNumber(D.headers.get("content-length")),[Y,z]=T&&Y0(P,Gl(j0(T),!0))||[];D=new i(K0(D.body,W0,Y,()=>{z&&z(),B&&B()}),N)}k=k||"text";let H=await f[K.findKey(f,k)||"text"](D,p);return!O&&B&&B(),await new Promise((N,P)=>{$_(N,P,{data:H,headers:qt.from(D.headers),status:D.status,statusText:D.statusText,config:p,request:R})})}catch(A){throw B&&B(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new xe("Network Error",xe.ERR_NETWORK,p,R),{cause:A.cause||A}):xe.from(A,A&&A.code,p,R)}}},E8=new Map,G_=s=>{let e=s&&s.env||{};const{fetch:t,Request:i,Response:r}=e,n=[i,r,t];let a=n.length,o=a,l,c,u=E8;for(;o--;)l=n[o],c=u.get(l),c===void 0&&u.set(l,c=o?new Map:S8(e)),u=c;return c};G_();const tp={http:$6,xhr:p8,fetch:{get:G_}};K.forEach(tp,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const X0=s=>`- ${s}`,_8=s=>K.isFunction(s)||s===null||s===!1;function x8(s,e){s=K.isArray(s)?s:[s];const{length:t}=s;let i,r;const n={};for(let a=0;a<t;a++){i=s[a];let o;if(r=i,!_8(i)&&(r=tp[(o=String(i)).toLowerCase()],r===void 0))throw new xe(`Unknown adapter '${o}'`);if(r&&(K.isFunction(r)||(r=r.get(e))))break;n[o||"#"+a]=r}if(!r){const a=Object.entries(n).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
411
|
+
`+a.map(X0).join(`
|
|
412
|
+
`):" "+X0(a[0]):"as no adapter specified";throw new xe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r}const H_={getAdapter:x8,adapters:tp};function Ku(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new An(null,s)}function J0(s){return Ku(s),s.headers=qt.from(s.headers),s.data=Vu.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),H_.getAdapter(s.adapter||Ma.adapter,s)(s).then(function(i){return Ku(s),i.data=Vu.call(s,s.transformResponse,i),i.headers=qt.from(i.headers),i},function(i){return F_(i)||(Ku(s),i&&i.response&&(i.response.data=Vu.call(s,s.transformResponse,i.response),i.response.headers=qt.from(i.response.headers))),Promise.reject(i)})}const Y_="1.13.2",Rc={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Rc[s]=function(i){return typeof i===s||"a"+(e<1?"n ":" ")+s}});const Z0={};Rc.transitional=function(e,t,i){function r(n,a){return"[Axios v"+Y_+"] Transitional option '"+n+"'"+a+(i?". "+i:"")}return(n,a,o)=>{if(e===!1)throw new xe(r(a," has been removed"+(t?" in "+t:"")),xe.ERR_DEPRECATED);return t&&!Z0[a]&&(Z0[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,a,o):!0}};Rc.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function A8(s,e,t){if(typeof s!="object")throw new xe("options must be an object",xe.ERR_BAD_OPTION_VALUE);const i=Object.keys(s);let r=i.length;for(;r-- >0;){const n=i[r],a=e[n];if(a){const o=s[n],l=o===void 0||a(o,n,s);if(l!==!0)throw new xe("option "+n+" must be "+l,xe.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new xe("Unknown option "+n,xe.ERR_BAD_OPTION)}}const qo={assertOptions:A8,validators:Rc},Ys=qo.validators;let vr=class{constructor(e){this.defaults=e||{},this.interceptors={request:new G0,response:new G0}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const n=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?n&&!String(i.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
|
413
|
+
`+n):i.stack=n}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=xr(this.defaults,t);const{transitional:i,paramsSerializer:r,headers:n}=t;i!==void 0&&qo.assertOptions(i,{silentJSONParsing:Ys.transitional(Ys.boolean),forcedJSONParsing:Ys.transitional(Ys.boolean),clarifyTimeoutError:Ys.transitional(Ys.boolean)},!1),r!=null&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:qo.assertOptions(r,{encode:Ys.function,serialize:Ys.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),qo.assertOptions(t,{baseUrl:Ys.spelling("baseURL"),withXsrfToken:Ys.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&K.merge(n.common,n[t.method]);n&&K.forEach(["delete","get","head","post","put","patch","common"],p=>{delete n[p]}),t.headers=qt.concat(a,n);const o=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(l=l&&g.synchronous,o.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,f=0,d;if(!l){const p=[J0.bind(this),void 0];for(p.unshift(...o),p.push(...c),d=p.length,u=Promise.resolve(t);f<d;)u=u.then(p[f++],p[f++]);return u}d=o.length;let h=t;for(;f<d;){const p=o[f++],g=o[f++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=J0.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,d=c.length;f<d;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=xr(this.defaults,e);const t=B_(e.baseURL,e.url,e.allowAbsoluteUrls);return O_(t,e.params,e.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(e){vr.prototype[e]=function(t,i){return this.request(xr(i||{},{method:e,url:t,data:(i||{}).data}))}});K.forEach(["post","put","patch"],function(e){function t(i){return function(n,a,o){return this.request(xr(o||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:n,data:a}))}}vr.prototype[e]=t(),vr.prototype[e+"Form"]=t(!0)});let T8=class j_{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});const i=this;this.promise.then(r=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](r);i._listeners=null}),this.promise.then=r=>{let n;const a=new Promise(o=>{i.subscribe(o),n=o}).then(r);return a.cancel=function(){i.unsubscribe(n)},a},e(function(n,a,o){i.reason||(i.reason=new An(n,a,o),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new j_(function(r){e=r}),cancel:e}}};function w8(s){return function(t){return s.apply(null,t)}}function C8(s){return K.isObject(s)&&s.isAxiosError===!0}const dd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dd).forEach(([s,e])=>{dd[e]=s});function V_(s){const e=new vr(s),t=__(vr.prototype.request,e);return K.extend(t,vr.prototype,e,{allOwnKeys:!0}),K.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return V_(xr(s,r))},t}const ft=V_(Ma);ft.Axios=vr;ft.CanceledError=An;ft.CancelToken=T8;ft.isCancel=F_;ft.VERSION=Y_;ft.toFormData=Ic;ft.AxiosError=xe;ft.Cancel=ft.CanceledError;ft.all=function(e){return Promise.all(e)};ft.spread=w8;ft.isAxiosError=C8;ft.mergeConfig=xr;ft.AxiosHeaders=qt;ft.formToJSON=s=>N_(K.isHTMLForm(s)?new FormData(s):s);ft.getAdapter=H_.getAdapter;ft.HttpStatusCode=dd;ft.default=ft;const{Axios:pG,AxiosError:mG,CanceledError:gG,isCancel:vG,CancelToken:yG,VERSION:bG,all:SG,Cancel:EG,isAxiosError:_G,spread:xG,toFormData:AG,AxiosHeaders:TG,HttpStatusCode:wG,formToJSON:CG,getAdapter:LG,mergeConfig:IG}=ft,L8={name:"Series",components:{SeriesList:ac,EpisodeList:Aa},computed:xt({series:s=>s.series.lists,episodes:s=>s.episodes.lists}),created(){}};var I8=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("EpisodeList",{attrs:{title:"Recently aired",episodes:e.episodes.firstAired}}),t("SeriesList",{attrs:{title:"Recently added shows",series:e.series.createdAt}}),t("EpisodeList",{attrs:{title:"Recently added episodes",episodes:e.episodes.createdAt}}),t("SeriesList",{attrs:{title:"Watched by others",series:e.series.siteRatingCount}}),t("SeriesList",{attrs:{title:"Best rated",series:e.series.siteRating}})],1)},R8=[],D8=ve(L8,I8,R8,!1,null,"880b77f6");const k8=D8.exports;Ce.use(Xn,ft);Ce.use(TE);const sp=new TE({mode:"history",base:"/web/",routes:[{path:"/",name:"Main",component:r4,meta:{requiresAuth:!0}},{path:"/series",name:"Series",component:k8,meta:{requiresAuth:!0}},{path:"/movies",name:"Movies",component:zF,meta:{requiresAuth:!0}},{path:"/series/:seriesId",name:"SeriesView",component:_F,meta:{requiresAuth:!0}},{path:"/movie/:movieId",name:"MovieInfo",component:PF,meta:{requiresAuth:!0}},{path:"/episode/:episodeId",name:"EpisodeInfo",component:$F,meta:{requiresAuth:!0}},{path:"/search/:search",name:"Search",component:ZF,meta:{requiresAuth:!0}},{path:"/login",name:"login",component:YF},{path:"/settings",component:L4,meta:{requiresAuth:!0},children:[{name:"SettingsHome",path:"",component:k0},{name:"SettingsMaintenance",path:"maintenance",component:k0},{name:"SettingsUsers",path:"users",component:q4},{name:"SettingsLibraries",path:"libraries",component:a$},{name:"SettingsSets",path:"sets",component:f$},{name:"IndexerSettings",path:"indexer",component:g$},{name:"ArtworkSettings",path:"artwork",component:E$},{name:"FederationSettings",path:"federation",component:w$},{name:"SeedboxSettings",path:"seedboxes",component:D$},{name:"ProblematicFiles",path:"problematic",component:N$},{name:"ServerStatus",path:"status",component:WU}]}]});sp.beforeEach((s,e,t)=>{s.matched.some(i=>i.meta.requiresAuth)?ie.accessToken?t():t({path:"/login",query:{redirect:s.fullPath}}):t()});const K_="RECEIVE_MOVIES",W_="RECEIVE_MOVIES_SETS",z_="RECEIVE_SHOWS",Q_="RECEIVE_EPISODES",q_="RECIEVE_LIBRARIES_MOVIES",X_="RECIEVE_LIBRARIES_SHOWS",P8={lists:{},sets:{}},O8={},M8={async getMovies({commit:s,state:e},{sort:t,order:i}){let r=await ie.movieLibrary.getList(t,i,100,0);s(K_,{movies:r,sort:t})},async getMovieSets({commit:s,state:e}){let t=await ie.movieLibrary.getSets();s(W_,t)}},N8={[K_](s,{movies:e,sort:t}){s.lists[t]=e},[W_](s,e){s.sets=e}},F8={namespaced:!0,state:P8,getters:O8,actions:M8,mutations:N8},$8={lists:{}},B8={},U8={async getSeries({commit:s,state:e},{sort:t,order:i}){let r=await ie.seriesLibrary.getList(t,i,100,0);s(z_,{shows:r,sort:t})}},G8={[z_](s,{shows:e,sort:t}){s.lists[t]=e}},H8={namespaced:!0,state:$8,getters:B8,actions:U8,mutations:G8},Y8={lists:{}},j8={},V8={async getEpisodes({commit:s,state:e},{sort:t,order:i}){let r=await ie.episodeLibrary.getList(t,i,100,0);s(Q_,{episodes:r,sort:t})}},K8={[Q_](s,{episodes:e,sort:t}){s.lists[t]=e}},W8={namespaced:!0,state:Y8,getters:j8,actions:V8,mutations:K8},z8={shows:[],movies:[]},Q8={},q8={async updateAll({dispatch:s}){s("updateMovies"),s("updateTVShows")},async updateMovies({commit:s}){let e=await ie.libraries.getLibraryPaths("movies");s(q_,e)},async updateTVShows({commit:s}){let e=await ie.libraries.getLibraryPaths("tvshows");s(X_,e)},async deleteMovieLibrary({dispatch:s},e){await ie.libraries.removePath("movies",e),s("updateAll")},async deleteSeriesLibrary({dispatch:s},e){await ie.libraries.removePath("tvshows",e),s("updateAll")}},X8={[q_](s,e){s.movies=e},[X_](s,e){s.shows=e}},J8={namespaced:!0,state:z8,getters:Q8,actions:q8,mutations:X8};Ce.use(hy);const J_=new hy.Store({state:{host:null,initialLoaded:!1,shows:{},watchingEpisodes:[],watchingMovies:[],nextEpisodes:[],playing:{title:""},autoplay:!0,playSizeFormat:Et.SMALL,playbackRemote:"local"},modules:{movies:F8,series:H8,episodes:W8,libraries:J8},mutations:{saveWatchingEpisodes:function(s,e){Ce.set(s,"watchingEpisodes",e)},saveNextEpisodes:function(s,e){Ce.set(s,"nextEpisodes",e)},saveWatchingMovies:function(s,e){Ce.set(s,"watchingMovies",e)},setPlaying:function(s,e){Ce.set(s,"playing",e)},updateHost:function(s,e){Ce.set(s,"host",e)},initialLoaded:function(s,e){Ce.set(s,"initialLoaded",e)},setPlaybackRemote:function(s,e){Ce.set(s,"playbackRemote",e)},setPlaySizeFormat:function(s,e){Ce.set(s,"playSizeFormat",e)}},actions:{updateAll:async({commit:s,dispatch:e})=>{await e("movies/getMovies",{sort:"createdAt",order:"DESC"}),await e("movies/getMovies",{sort:"popularity",order:"DESC"}),await e("movies/getMovies",{sort:"releaseDate",order:"DESC"}),await e("movies/getMovieSets"),await e("series/getSeries",{sort:"createdAt",order:"DESC"}),await e("series/getSeries",{sort:"siteRating",order:"DESC"}),await e("series/getSeries",{sort:"siteRatingCount",order:"DESC"}),await e("episodes/getEpisodes",{sort:"firstAired",order:"DESC"}),await e("episodes/getEpisodes",{sort:"createdAt",order:"DESC"}),await e("updateWatching"),s("initialLoaded",!0)},logout:function(s){s.commit("saveWatchingEpisodes",[]),s.dispatch("clearPlaying"),s.commit("initialLoaded",!1),ie.accessToken="",sp.push({name:"login"})},updateWatching:async function({commit:s,dispatch:e}){let t=await ie.episodeLibrary.getWatching(),i=await ie.movieLibrary.getWatching();try{await e("updateNext")}catch(r){console.log(r)}s("saveWatchingEpisodes",t),s("saveWatchingMovies",i)},updateNext:async function(s){let e=await ie.episodeLibrary.getNextUp();s.commit("saveNextEpisodes",e)},updateHost:function(s,e){s.commit("updateHost",e),Ce.axios.defaults.baseURL=e,ie.axios.defaults.baseURL=e},clearPlaying:function(s){s.commit("setPlaying",{})},playEpisodeLocal:async function({commit:s,dispatch:e},t){await e("clearPlaying");let i=await ie.episodeLibrary.getInfo(t);s("setPlaying",{title:i.episodeName,type:"episode",entity:i})},playEpisode:async function({state:s,commit:e,dispatch:t},i){if(s.playbackRemote!=="local"){await ie.remotes.playback(s.playbackRemote,"episode",i);return}await t("playEpisodeLocal",i)},playMovieLocal:async function({commit:s,dispatch:e},t){await e("clearPlaying");let i=await ie.movieLibrary.getInfo(t);s("setPlaying",{title:i.movieName,type:"movie",entity:i})},playMovie:async function({state:s,commit:e,dispatch:t},i){if(s.playbackRemote!=="local"){await ie.remotes.playback(s.playbackRemote,"movie",i);return}await t("playMovieLocal",i)}}});var Z_={exports:{}};(function(s,e){(function(i,r){s.exports=r()})(typeof self<"u"?self:Vn,function(){return function(t){var i={};function r(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=i,r.d=function(n,a,o){r.o(n,a)||Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:o})},r.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(a,"a",a),a},r.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},r.p="",r(r.s=7)}([function(t,i,r){t.exports=!r(6)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,i){t.exports=function(r){return typeof r=="object"?r!==null:typeof r=="function"}},function(t,i){t.exports=function(n,a,o,l,c){var u,f=n=n||{},d=typeof n.default;(d==="object"||d==="function")&&(u=n,f=n.default);var h=typeof f=="function"?f.options:f;a&&(h.render=a.render,h.staticRenderFns=a.staticRenderFns),l&&(h._scopeId=l);var p;if(c?(p=function(v){v=v||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!v&&typeof __VUE_SSR_CONTEXT__<"u"&&(v=__VUE_SSR_CONTEXT__),o&&o.call(this,v),v&&v._registeredComponents&&v._registeredComponents.add(c)},h._ssrRegister=p):o&&(p=o),p){var g=h.functional,m=g?h.render:h.beforeCreate;g?h.render=function(y,E){return p.call(E),m(y,E)}:h.beforeCreate=m?[].concat(m,p):[p]}return{esModule:u,exports:f,options:h}}},function(t,i){var r=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=r)},function(t,i){var r=t.exports={version:"2.5.7"};typeof __e=="number"&&(__e=r)},function(t,i,r){var n=r(23),a=r(24),o=r(26),l=Object.defineProperty;i.f=r(0)?Object.defineProperty:function(u,f,d){if(n(u),f=o(f,!0),n(d),a)try{return l(u,f,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(u[f]=d.value),u}},function(t,i){t.exports=function(r){try{return!!r()}catch{return!0}}},function(t,i,r){var n,a,o;(function(l,c){a=[i,r(8),r(11)],n=c,o=typeof n=="function"?n.apply(i,a):n,o!==void 0&&(t.exports=o)})(this,function(l,c,u){Object.defineProperty(l,"__esModule",{value:!0}),l.Tabs=l.Tab=void 0;var f=h(c),d=h(u);function h(p){return p&&p.__esModule?p:{default:p}}l.default={install:function(g){g.component("tab",f.default),g.component("tabs",d.default)}},l.Tab=f.default,l.Tabs=d.default})},function(t,i,r){var n=r(2)(r(9),r(10),null,null,null);t.exports=n.exports},function(t,i,r){var n,a,o;(function(l,c){a=[i],n=c,o=typeof n=="function"?n.apply(i,a):n,o!==void 0&&(t.exports=o)})(this,function(l){Object.defineProperty(l,"__esModule",{value:!0}),l.default={props:{id:{default:null},name:{required:!0},prefix:{default:""},suffix:{default:""},isDisabled:{default:!1}},data:function(){return{isActive:!1,isVisible:!0}},computed:{header:function(){return this.prefix+this.name+this.suffix},computedId:function(){return this.id?this.id:this.name.toLowerCase().replace(/ /g,"-")},hash:function(){return this.isDisabled?"#":"#"+this.computedId}}}})},function(t,i){t.exports={render:function(){var r=this,n=r.$createElement,a=r._self._c||n;return a("section",{directives:[{name:"show",rawName:"v-show",value:r.isActive,expression:"isActive"}],staticClass:"tabs-component-panel",attrs:{"aria-hidden":!r.isActive,id:r.computedId,role:"tabpanel"}},[r._t("default")],2)},staticRenderFns:[]}},function(t,i,r){var n=r(2)(r(12),r(29),null,null,null);t.exports=n.exports},function(t,i,r){var n,a,o;(function(l,c){a=[i,r(13)],n=c,o=typeof n=="function"?n.apply(i,a):n,o!==void 0&&(t.exports=o)})(this,function(l,c){Object.defineProperty(l,"__esModule",{value:!0});var u=f(c);function f(d){return d&&d.__esModule?d:{default:d}}l.default={props:{cacheLifetime:{default:5},options:{type:Object,required:!1,default:function(){return{useUrlFragment:!0,defaultTabHash:null}}}},data:function(){return{tabs:[],activeTabHash:"",activeTabIndex:0,lastActiveTabHash:""}},computed:{storageKey:function(){return"vue-tabs-component.cache."+window.location.host+window.location.pathname}},created:function(){this.tabs=this.$children},mounted:function(){var h=this;if(window.addEventListener("hashchange",function(){return h.selectTab(window.location.hash)}),this.findTab(window.location.hash)){this.selectTab(window.location.hash);return}var p=u.default.get(this.storageKey);if(this.findTab(p)){this.selectTab(p);return}if(this.options.defaultTabHash!==null&&this.findTab("#"+this.options.defaultTabHash)){this.selectTab("#"+this.options.defaultTabHash);return}this.tabs.length&&this.selectTab(this.tabs[0].hash)},methods:{findTab:function(h){return this.tabs.find(function(p){return p.hash===h})},selectTab:function(h,p){p&&!this.options.useUrlFragment&&p.preventDefault();var g=this.findTab(h);if(g){if(g.isDisabled){p.preventDefault();return}if(this.lastActiveTabHash===g.hash){this.$emit("clicked",{tab:g});return}this.tabs.forEach(function(m){m.isActive=m.hash===g.hash}),this.$emit("changed",{tab:g}),this.activeTabHash=g.hash,this.activeTabIndex=this.getTabIndex(h),this.lastActiveTabHash=this.activeTabHash=g.hash,u.default.set(this.storageKey,g.hash,this.cacheLifetime)}},setTabVisible:function(h,p){var g=this.findTab(h);g&&(g.isVisible=p,g.isActive&&(g.isActive=p,this.tabs.every(function(m,v,y){return m.isVisible?(m.isActive=!0,!1):!0})))},getTabIndex:function(h){var p=this.findTab(h);return this.tabs.indexOf(p)},getTabHash:function(h){var p=this,g=this.tabs.find(function(m){return p.tabs.indexOf(m)===h});if(g)return g.hash},getActiveTab:function(){return this.findTab(this.activeTabHash)},getActiveTabIndex:function(){return this.getTabIndex(this.activeTabHash)}}}})},function(t,i,r){var n,a,o;(function(l,c){a=[i,r(14),r(15)],n=c,o=typeof n=="function"?n.apply(i,a):n,o!==void 0&&(t.exports=o)})(this,function(l,c,u){Object.defineProperty(l,"__esModule",{value:!0});var f=h(c),d=h(u);function h(g){return g&&g.__esModule?g:{default:g}}var p=function(){function g(){(0,f.default)(this,g)}return(0,d.default)(g,[{key:"get",value:function(v){var y=JSON.parse(localStorage.getItem(v));if(!y)return null;var E=new Date(y.expires);return E<new Date?(localStorage.removeItem(v),null):y.value}},{key:"set",value:function(v,y,E){var w=new Date().getTime(),T=new Date(w+E*6e4);localStorage.setItem(v,JSON.stringify({value:y,expires:T}))}}]),g}();l.default=new p})},function(t,i,r){i.__esModule=!0,i.default=function(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}},function(t,i,r){i.__esModule=!0;var n=r(16),a=o(n);function o(l){return l&&l.__esModule?l:{default:l}}i.default=function(){function l(c,u){for(var f=0;f<u.length;f++){var d=u[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),(0,a.default)(c,d.key,d)}}return function(c,u,f){return u&&l(c.prototype,u),f&&l(c,f),c}}()},function(t,i,r){t.exports={default:r(17),__esModule:!0}},function(t,i,r){r(18);var n=r(4).Object;t.exports=function(o,l,c){return n.defineProperty(o,l,c)}},function(t,i,r){var n=r(19);n(n.S+n.F*!r(0),"Object",{defineProperty:r(5).f})},function(t,i,r){var n=r(3),a=r(4),o=r(20),l=r(22),c=r(28),u="prototype",f=function(d,h,p){var g=d&f.F,m=d&f.G,v=d&f.S,y=d&f.P,E=d&f.B,w=d&f.W,T=m?a:a[h]||(a[h]={}),$=T[u],k=m?n:v?n[h]:(n[h]||{})[u],M,_,C;m&&(p=h);for(M in p)_=!g&&k&&k[M]!==void 0,!(_&&c(T,M))&&(C=_?k[M]:p[M],T[M]=m&&typeof k[M]!="function"?p[M]:E&&_?o(C,n):w&&k[M]==C?function(U){var L=function(R,B,S){if(this instanceof U){switch(arguments.length){case 0:return new U;case 1:return new U(R);case 2:return new U(R,B)}return new U(R,B,S)}return U.apply(this,arguments)};return L[u]=U[u],L}(C):y&&typeof C=="function"?o(Function.call,C):C,y&&((T.virtual||(T.virtual={}))[M]=C,d&f.R&&$&&!$[M]&&l($,M,C)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,i,r){var n=r(21);t.exports=function(a,o,l){if(n(a),o===void 0)return a;switch(l){case 1:return function(c){return a.call(o,c)};case 2:return function(c,u){return a.call(o,c,u)};case 3:return function(c,u,f){return a.call(o,c,u,f)}}return function(){return a.apply(o,arguments)}}},function(t,i){t.exports=function(r){if(typeof r!="function")throw TypeError(r+" is not a function!");return r}},function(t,i,r){var n=r(5),a=r(27);t.exports=r(0)?function(o,l,c){return n.f(o,l,a(1,c))}:function(o,l,c){return o[l]=c,o}},function(t,i,r){var n=r(1);t.exports=function(a){if(!n(a))throw TypeError(a+" is not an object!");return a}},function(t,i,r){t.exports=!r(0)&&!r(6)(function(){return Object.defineProperty(r(25)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,i,r){var n=r(1),a=r(3).document,o=n(a)&&n(a.createElement);t.exports=function(l){return o?a.createElement(l):{}}},function(t,i,r){var n=r(1);t.exports=function(a,o){if(!n(a))return a;var l,c;if(o&&typeof(l=a.toString)=="function"&&!n(c=l.call(a))||typeof(l=a.valueOf)=="function"&&!n(c=l.call(a))||!o&&typeof(l=a.toString)=="function"&&!n(c=l.call(a)))return c;throw TypeError("Can't convert object to primitive value")}},function(t,i){t.exports=function(r,n){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:n}}},function(t,i){var r={}.hasOwnProperty;t.exports=function(n,a){return r.call(n,a)}},function(t,i){t.exports={render:function(){var r=this,n=r.$createElement,a=r._self._c||n;return a("div",{staticClass:"tabs-component"},[a("ul",{staticClass:"tabs-component-tabs",attrs:{role:"tablist"}},r._l(r.tabs,function(o,l){return a("li",{directives:[{name:"show",rawName:"v-show",value:o.isVisible,expression:"tab.isVisible"}],key:l,staticClass:"tabs-component-tab",class:{"is-active":o.isActive,"is-disabled":o.isDisabled},attrs:{role:"presentation"}},[a("a",{staticClass:"tabs-component-tab-a",attrs:{"aria-controls":o.hash,"aria-selected":o.isActive,href:o.hash,role:"tab"},domProps:{innerHTML:r._s(o.header)},on:{click:function(c){r.selectTab(o.hash,c)}}})])})),r._v(" "),a("div",{staticClass:"tabs-component-panels"},[r._t("default")],2)])},staticRenderFns:[]}}])})})(Z_);var ex=Z_.exports,tx={exports:{}};(function(s,e){(function(t,i){s.exports=i()})(window,function(){return r={},t.m=i=[function(n,a,o){var l=o(6);typeof l=="string"&&(l=[[n.i,l,""]]),l.locals&&(n.exports=l.locals),(0,o(4).default)("27d83796",l,!1,{})},function(n,a,o){var l=o(8);typeof l=="string"&&(l=[[n.i,l,""]]),l.locals&&(n.exports=l.locals),(0,o(4).default)("0e783494",l,!1,{})},function(n,a,o){var l=o(10);typeof l=="string"&&(l=[[n.i,l,""]]),l.locals&&(n.exports=l.locals),(0,o(4).default)("17757f60",l,!1,{})},function(n,a){n.exports=function(o){var l=[];return l.toString=function(){return this.map(function(c){var u=function(f,d){var h=f[1]||"",p=f[3];if(!p)return h;if(d&&typeof btoa=="function"){var g=function(v){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(v))))+" */"}(p),m=p.sources.map(function(v){return"/*# sourceURL="+p.sourceRoot+v+" */"});return[h].concat(m).concat([g]).join(`
|
|
414
|
+
`)}return[h].join(`
|
|
415
|
+
`)}(c,o);return c[2]?"@media "+c[2]+"{"+u+"}":u}).join("")},l.i=function(c,u){typeof c=="string"&&(c=[[null,c,""]]);for(var f={},d=0;d<this.length;d++){var h=this[d][0];typeof h=="number"&&(f[h]=!0)}for(d=0;d<c.length;d++){var p=c[d];typeof p[0]=="number"&&f[p[0]]||(u&&!p[2]?p[2]=u:u&&(p[2]="("+p[2]+") and ("+u+")"),l.push(p))}},l}},function(n,a,o){function l(C,U){for(var L=[],R={},B=0;B<U.length;B++){var S=U[B],A=S[0],I={id:C+":"+B,css:S[1],media:S[2],sourceMap:S[3]};R[A]?R[A].parts.push(I):L.push(R[A]={id:A,parts:[I]})}return L}o.r(a),o.d(a,"default",function(){return E});var c=typeof document<"u";if(typeof DEBUG<"u"&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u={},f=c&&(document.head||document.getElementsByTagName("head")[0]),d=null,h=0,p=!1,g=function(){},m=null,v="data-vue-ssr-id",y=typeof navigator<"u"&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function E(C,U,L,R){p=L,m=R||{};var B=l(C,U);return w(B),function(S){for(var A=[],I=0;I<B.length;I++){var D=B[I];(O=u[D.id]).refs--,A.push(O)}for(S?w(B=l(C,S)):B=[],I=0;I<A.length;I++){var O;if((O=A[I]).refs===0){for(var H=0;H<O.parts.length;H++)O.parts[H]();delete u[O.id]}}}}function w(C){for(var U=0;U<C.length;U++){var L=C[U],R=u[L.id];if(R){R.refs++;for(var B=0;B<R.parts.length;B++)R.parts[B](L.parts[B]);for(;B<L.parts.length;B++)R.parts.push($(L.parts[B]));R.parts.length>L.parts.length&&(R.parts.length=L.parts.length)}else{var S=[];for(B=0;B<L.parts.length;B++)S.push($(L.parts[B]));u[L.id]={id:L.id,refs:1,parts:S}}}}function T(){var C=document.createElement("style");return C.type="text/css",f.appendChild(C),C}function $(C){var U,L,R=document.querySelector("style["+v+'~="'+C.id+'"]');if(R){if(p)return g;R.parentNode.removeChild(R)}if(y){var B=h++;R=d=d||T(),U=_.bind(null,R,B,!1),L=_.bind(null,R,B,!0)}else R=T(),U=(function(S,A){var I=A.css,D=A.media,O=A.sourceMap;if(D&&S.setAttribute("media",D),m.ssrId&&S.setAttribute(v,A.id),O&&(I+=`
|
|
416
|
+
/*# sourceURL=`+O.sources[0]+" */",I+=`
|
|
417
|
+
/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(O))))+" */"),S.styleSheet)S.styleSheet.cssText=I;else{for(;S.firstChild;)S.removeChild(S.firstChild);S.appendChild(document.createTextNode(I))}}).bind(null,R),L=function(){R.parentNode.removeChild(R)};return U(C),function(S){if(S){if(S.css===C.css&&S.media===C.media&&S.sourceMap===C.sourceMap)return;U(C=S)}else L()}}var k,M=(k=[],function(C,U){return k[C]=U,k.filter(Boolean).join(`
|
|
418
|
+
`)});function _(C,U,L,R){var B=L?"":R.css;if(C.styleSheet)C.styleSheet.cssText=M(U,B);else{var S=document.createTextNode(B),A=C.childNodes;A[U]&&C.removeChild(A[U]),A.length?C.insertBefore(S,A[U]):C.appendChild(S)}}},function(n,a,o){var l=o(0);o.n(l).a},function(n,a,o){(n.exports=o(3)(!1)).push([n.i,`
|
|
419
|
+
.vue-modal-resizer {
|
|
420
|
+
display: block;
|
|
421
|
+
overflow: hidden;
|
|
422
|
+
position: absolute;
|
|
423
|
+
width: 12px;
|
|
424
|
+
height: 12px;
|
|
425
|
+
right: 0;
|
|
426
|
+
bottom: 0;
|
|
427
|
+
z-index: 9999999;
|
|
428
|
+
background: transparent;
|
|
429
|
+
cursor: se-resize;
|
|
430
|
+
}
|
|
431
|
+
.vue-modal-resizer::after {
|
|
432
|
+
display: block;
|
|
433
|
+
position: absolute;
|
|
434
|
+
content: '';
|
|
435
|
+
background: transparent;
|
|
436
|
+
left: 0;
|
|
437
|
+
top: 0;
|
|
438
|
+
width: 0;
|
|
439
|
+
height: 0;
|
|
440
|
+
border-bottom: 10px solid #ddd;
|
|
441
|
+
border-left: 10px solid transparent;
|
|
442
|
+
}
|
|
443
|
+
.vue-modal-resizer.clicked::after {
|
|
444
|
+
border-bottom: 10px solid #369be9;
|
|
445
|
+
}
|
|
446
|
+
`,""])},function(n,a,o){var l=o(1);o.n(l).a},function(n,a,o){(n.exports=o(3)(!1)).push([n.i,`
|
|
447
|
+
.v--modal-block-scroll {
|
|
448
|
+
overflow: hidden;
|
|
449
|
+
width: 100vw;
|
|
450
|
+
}
|
|
451
|
+
.v--modal-overlay {
|
|
452
|
+
position: fixed;
|
|
453
|
+
box-sizing: border-box;
|
|
454
|
+
left: 0;
|
|
455
|
+
top: 0;
|
|
456
|
+
width: 100%;
|
|
457
|
+
height: 100vh;
|
|
458
|
+
background: rgba(0, 0, 0, 0.2);
|
|
459
|
+
z-index: 999;
|
|
460
|
+
opacity: 1;
|
|
461
|
+
}
|
|
462
|
+
.v--modal-overlay.scrollable {
|
|
463
|
+
height: 100%;
|
|
464
|
+
min-height: 100vh;
|
|
465
|
+
overflow-y: auto;
|
|
466
|
+
-webkit-overflow-scrolling: touch;
|
|
467
|
+
}
|
|
468
|
+
.v--modal-overlay .v--modal-background-click {
|
|
469
|
+
width: 100%;
|
|
470
|
+
min-height: 100%;
|
|
471
|
+
height: auto;
|
|
472
|
+
}
|
|
473
|
+
.v--modal-overlay .v--modal-box {
|
|
474
|
+
position: relative;
|
|
475
|
+
overflow: hidden;
|
|
476
|
+
box-sizing: border-box;
|
|
477
|
+
}
|
|
478
|
+
.v--modal-overlay.scrollable .v--modal-box {
|
|
479
|
+
margin-bottom: 2px;
|
|
480
|
+
}
|
|
481
|
+
.v--modal {
|
|
482
|
+
background-color: white;
|
|
483
|
+
text-align: left;
|
|
484
|
+
border-radius: 3px;
|
|
485
|
+
box-shadow: 0 20px 60px -2px rgba(27, 33, 58, 0.4);
|
|
486
|
+
padding: 0;
|
|
487
|
+
}
|
|
488
|
+
.v--modal.v--modal-fullscreen {
|
|
489
|
+
width: 100vw;
|
|
490
|
+
height: 100vh;
|
|
491
|
+
margin: 0;
|
|
492
|
+
left: 0;
|
|
493
|
+
top: 0;
|
|
494
|
+
}
|
|
495
|
+
.v--modal-top-right {
|
|
496
|
+
display: block;
|
|
497
|
+
position: absolute;
|
|
498
|
+
right: 0;
|
|
499
|
+
top: 0;
|
|
500
|
+
}
|
|
501
|
+
.overlay-fade-enter-active,
|
|
502
|
+
.overlay-fade-leave-active {
|
|
503
|
+
transition: all 0.2s;
|
|
504
|
+
}
|
|
505
|
+
.overlay-fade-enter,
|
|
506
|
+
.overlay-fade-leave-active {
|
|
507
|
+
opacity: 0;
|
|
508
|
+
}
|
|
509
|
+
.nice-modal-fade-enter-active,
|
|
510
|
+
.nice-modal-fade-leave-active {
|
|
511
|
+
transition: all 0.4s;
|
|
512
|
+
}
|
|
513
|
+
.nice-modal-fade-enter,
|
|
514
|
+
.nice-modal-fade-leave-active {
|
|
515
|
+
opacity: 0;
|
|
516
|
+
transform: translateY(-20px);
|
|
517
|
+
}
|
|
518
|
+
`,""])},function(n,a,o){var l=o(2);o.n(l).a},function(n,a,o){(n.exports=o(3)(!1)).push([n.i,`
|
|
519
|
+
.vue-dialog div {
|
|
520
|
+
box-sizing: border-box;
|
|
521
|
+
}
|
|
522
|
+
.vue-dialog .dialog-flex {
|
|
523
|
+
width: 100%;
|
|
524
|
+
height: 100%;
|
|
525
|
+
}
|
|
526
|
+
.vue-dialog .dialog-content {
|
|
527
|
+
flex: 1 0 auto;
|
|
528
|
+
width: 100%;
|
|
529
|
+
padding: 15px;
|
|
530
|
+
font-size: 14px;
|
|
531
|
+
}
|
|
532
|
+
.vue-dialog .dialog-c-title {
|
|
533
|
+
font-weight: 600;
|
|
534
|
+
padding-bottom: 15px;
|
|
535
|
+
}
|
|
536
|
+
.vue-dialog .dialog-c-text {
|
|
537
|
+
}
|
|
538
|
+
.vue-dialog .vue-dialog-buttons {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex: 0 1 auto;
|
|
541
|
+
width: 100%;
|
|
542
|
+
border-top: 1px solid #eee;
|
|
543
|
+
}
|
|
544
|
+
.vue-dialog .vue-dialog-buttons-none {
|
|
545
|
+
width: 100%;
|
|
546
|
+
padding-bottom: 15px;
|
|
547
|
+
}
|
|
548
|
+
.vue-dialog-button {
|
|
549
|
+
font-size: 12px !important;
|
|
550
|
+
background: transparent;
|
|
551
|
+
padding: 0;
|
|
552
|
+
margin: 0;
|
|
553
|
+
border: 0;
|
|
554
|
+
cursor: pointer;
|
|
555
|
+
box-sizing: border-box;
|
|
556
|
+
line-height: 40px;
|
|
557
|
+
height: 40px;
|
|
558
|
+
color: inherit;
|
|
559
|
+
font: inherit;
|
|
560
|
+
outline: none;
|
|
561
|
+
}
|
|
562
|
+
.vue-dialog-button:hover {
|
|
563
|
+
background: rgba(0, 0, 0, 0.01);
|
|
564
|
+
}
|
|
565
|
+
.vue-dialog-button:active {
|
|
566
|
+
background: rgba(0, 0, 0, 0.025);
|
|
567
|
+
}
|
|
568
|
+
.vue-dialog-button:not(:first-of-type) {
|
|
569
|
+
border-left: 1px solid #eee;
|
|
570
|
+
}
|
|
571
|
+
`,""])},function(n,a,o){o.r(a),o.d(a,"getModalsContainer",function(){return Y});function l(){var x=this,F=x.$createElement,G=x._self._c||F;return G("transition",{attrs:{name:x.overlayTransition}},[x.visibility.overlay?G("div",{ref:"overlay",class:x.overlayClass,attrs:{"aria-expanded":x.visibility.overlay.toString(),"data-modal":x.name}},[G("div",{staticClass:"v--modal-background-click",on:{mousedown:function(Q){return Q.target!==Q.currentTarget?null:x.handleBackgroundClick(Q)},touchstart:function(Q){return Q.target!==Q.currentTarget?null:x.handleBackgroundClick(Q)}}},[G("div",{staticClass:"v--modal-top-right"},[x._t("top-right")],2),x._v(" "),G("transition",{attrs:{name:x.transition},on:{"before-enter":x.beforeTransitionEnter,"after-enter":x.afterTransitionEnter,"after-leave":x.afterTransitionLeave}},[x.visibility.modal?G("div",{ref:"modal",class:x.modalClass,style:x.modalStyle,attrs:{role:"dialog","aria-modal":"true"}},[x._t("default"),x._v(" "),x.resizable&&!x.isAutoHeight?G("resizer",{attrs:{"min-width":x.minWidth,"min-height":x.minHeight,"max-width":x.maxWidth,"max-height":x.maxHeight},on:{resize:x.handleModalResize}}):x._e()],2):x._e()])],1)]):x._e()])}function c(){var x=this.$createElement;return(this._self._c||x)("div",{class:this.className})}function u(x,F){return function(G){if(Array.isArray(G))return G}(x)||function(G,Q){var ee=[],ae=!0,de=!1,ye=void 0;try{for(var pe,le=G[Symbol.iterator]();!(ae=(pe=le.next()).done)&&(ee.push(pe.value),!Q||ee.length!==Q);ae=!0);}catch(ne){de=!0,ye=ne}finally{try{ae||le.return==null||le.return()}finally{if(de)throw ye}}return ee}(x,F)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(x){for(var F=1;F<arguments.length;F++){var G=arguments[F]!=null?arguments[F]:{},Q=Object.keys(G);typeof Object.getOwnPropertySymbols=="function"&&(Q=Q.concat(Object.getOwnPropertySymbols(G).filter(function(ee){return Object.getOwnPropertyDescriptor(G,ee).enumerable}))),Q.forEach(function(ee){d(x,ee,G[ee])})}return x}function d(x,F,G){return F in x?Object.defineProperty(x,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):x[F]=G,x}c._withStripped=l._withStripped=!0;function h(x,F,G){return G<x?x:F<G?F:G}function p(){var x=window.innerWidth,F=document.documentElement.clientWidth;return x&&F?Math.min(x,F):F||x}var g=function(x){var F=0;return function(){return(F++).toString()}}(),m={name:"VueJsModalResizer",props:{minHeight:{type:Number,default:0},minWidth:{type:Number,default:0},maxWidth:{type:Number,default:Number.MAX_SAFE_INTEGER},maxHeight:{type:Number,default:Number.MAX_SAFE_INTEGER}},data:function(){return{clicked:!1,size:{}}},mounted:function(){this.$el.addEventListener("mousedown",this.start,!1)},computed:{className:function(){return{"vue-modal-resizer":!0,clicked:this.clicked}}},methods:{start:function(x){this.clicked=!0,window.addEventListener("mousemove",this.mousemove,!1),window.addEventListener("mouseup",this.stop,!1),x.stopPropagation(),x.preventDefault()},stop:function(){this.clicked=!1,window.removeEventListener("mousemove",this.mousemove,!1),window.removeEventListener("mouseup",this.stop,!1),this.$emit("resize-stop",{element:this.$el.parentElement,size:this.size})},mousemove:function(x){this.resize(x)},resize:function(x){var F=this.$el.parentElement;if(F){var G=x.clientX-F.offsetLeft,Q=x.clientY-F.offsetTop,ee=Math.min(p(),this.maxWidth),ae=Math.min(window.innerHeight,this.maxHeight);G=h(this.minWidth,ee,G),Q=h(this.minHeight,ae,Q),this.size={width:G,height:Q},F.style.width=G+"px",F.style.height=Q+"px",this.$emit("resize",{element:F,size:this.size})}}}};o(5);function v(x,F,G,Q,ee,ae,de,ye){var pe,le=typeof x=="function"?x.options:x;return F&&(le.render=F,le.staticRenderFns=G,le._compiled=!0),{exports:x,options:le}}var y=v(m,c,[]);y.options.__file="src/Resizer.vue";var E=y.exports;function w(x){return(w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F})(x)}function T(x){switch(w(x)){case"number":return{type:"px",value:x};case"string":return function(F){if(F==="auto")return{type:F,value:0};var G=M.find(function(Q){return Q.regexp.test(F)});return G?{type:G.name,value:parseFloat(F)}:{type:"",value:F}}(x);default:return{type:"",value:x}}}function $(x){if(typeof x!="string")return 0<=x;var F=T(x);return(F.type==="%"||F.type==="px")&&0<F.value}var k="[-+]?[0-9]*.?[0-9]+",M=[{name:"px",regexp:new RegExp("^".concat(k,"px$"))},{name:"%",regexp:new RegExp("^".concat(k,"%$"))},{name:"px",regexp:new RegExp("^".concat(k,"$"))}];function _(x,F,G){return F in x?Object.defineProperty(x,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):x[F]=G,x}var C={name:"VueJsModal",props:{name:{required:!0,type:String},delay:{type:Number,default:0},resizable:{type:Boolean,default:!1},adaptive:{type:Boolean,default:!1},draggable:{type:[Boolean,String],default:!1},scrollable:{type:Boolean,default:!1},reset:{type:Boolean,default:!1},overlayTransition:{type:String,default:"overlay-fade"},transition:{type:String},clickToClose:{type:Boolean,default:!0},classes:{type:[String,Array],default:"v--modal"},styles:{type:[String,Array,Object]},minWidth:{type:Number,default:0,validator:function(x){return 0<=x}},minHeight:{type:Number,default:0,validator:function(x){return 0<=x}},maxWidth:{type:Number,default:Number.MAX_SAFE_INTEGER},maxHeight:{type:Number,default:Number.MAX_SAFE_INTEGER},width:{type:[Number,String],default:600,validator:$},height:{type:[Number,String],default:300,validator:function(x){return x==="auto"||$(x)}},pivotX:{type:Number,default:.5,validator:function(x){return 0<=x&&x<=1}},pivotY:{type:Number,default:.5,validator:function(x){return 0<=x&&x<=1}}},components:{Resizer:E},data:function(){return{visible:!1,visibility:{modal:!1,overlay:!1},shift:{left:0,top:0},modal:{width:0,widthType:"px",height:0,heightType:"px",renderedHeight:0},viewportHeight:0,viewportWidth:0,mutationObserver:null}},created:function(){this.setInitialSize()},beforeMount:function(){var x=this;if(J.event.$on("toggle",this.handleToggleEvent),window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize(),this.scrollable&&!this.isAutoHeight&&console.warn('Modal "'.concat(this.name,'" has scrollable flag set to true ')+'but height is not "auto" ('.concat(this.height,")")),this.isAutoHeight){var F=function(){if(typeof window<"u")for(var G=["","WebKit","Moz","O","Ms"],Q=0;Q<G.length;Q++){var ee=G[Q]+"MutationObserver";if(ee in window)return window[ee]}return!1}();F?this.mutationObserver=new F(function(G){x.updateRenderedHeight()}):console.warn("MutationObserver was not found. Vue-js-modal automatic resizing relies heavily on MutationObserver. Please make sure to provide shim for it.")}this.clickToClose&&window.addEventListener("keyup",this.handleEscapeKeyUp)},beforeDestroy:function(){J.event.$off("toggle",this.handleToggleEvent),window.removeEventListener("resize",this.handleWindowResize),this.clickToClose&&window.removeEventListener("keyup",this.handleEscapeKeyUp),this.scrollable&&document.body.classList.remove("v--modal-block-scroll")},computed:{isAutoHeight:function(){return this.modal.heightType==="auto"},position:function(){var x=this.viewportHeight,F=this.viewportWidth,G=this.shift,Q=this.pivotX,ee=this.pivotY,ae=this.trueModalWidth,de=this.trueModalHeight,ye=F-ae,pe=Math.max(x-de,0),le=G.left+Q*ye,ne=G.top+ee*pe;return{left:parseInt(h(0,ye,le)),top:parseInt(h(0,pe,ne))}},trueModalWidth:function(){var x=this.viewportWidth,F=this.modal,G=this.adaptive,Q=this.minWidth,ee=this.maxWidth,ae=F.widthType==="%"?x/100*F.width:F.width,de=Math.max(Q,Math.min(x,ee));return G?h(Q,de,ae):ae},trueModalHeight:function(){var x=this.viewportHeight,F=this.modal,G=this.isAutoHeight,Q=this.adaptive,ee=this.minHeight,ae=this.maxHeight,de=F.heightType==="%"?x/100*F.height:F.height;if(G)return this.modal.renderedHeight;var ye=Math.max(ee,Math.min(x,ae));return Q?h(ee,ye,de):de},overlayClass:function(){return{"v--modal-overlay":!0,scrollable:this.scrollable&&this.isAutoHeight}},modalClass:function(){return["v--modal-box",this.classes]},stylesProp:function(){return typeof this.styles=="string"?this.styles.split(";").map(function(x){return x.trim()}).filter(Boolean).map(function(x){return x.split(":")}).reduce(function(x,F){var G=u(F,2);return f({},x,d({},G[0],G[1]))},{}):this.styles},modalStyle:function(){return[this.stylesProp,{top:this.position.top+"px",left:this.position.left+"px",width:this.trueModalWidth+"px",height:this.isAutoHeight?"auto":this.trueModalHeight+"px"}]}},watch:{visible:function(x){var F=this;x?(this.visibility.overlay=!0,setTimeout(function(){F.visibility.modal=!0,F.$nextTick(function(){F.addDraggableListeners(),F.callAfterEvent(!0)})},this.delay)):(this.visibility.modal=!1,setTimeout(function(){F.visibility.overlay=!1,F.$nextTick(function(){F.removeDraggableListeners(),F.callAfterEvent(!1)})},this.delay))}},methods:{handleToggleEvent:function(x,F,G){if(this.name===x){var Q=F===void 0?!this.visible:F;this.toggle(Q,G)}},setInitialSize:function(){var x=this.modal,F=T(this.width),G=T(this.height);x.width=F.value,x.widthType=F.type,x.height=G.value,x.heightType=G.type},handleEscapeKeyUp:function(x){x.which===27&&this.visible&&this.$modal.hide(this.name)},handleWindowResize:function(){this.viewportWidth=p(),this.viewportHeight=window.innerHeight,this.ensureShiftInWindowBounds()},createModalEvent:function(x){var F=0<arguments.length&&x!==void 0?x:{};return function(G){var Q=0<arguments.length&&G!==void 0?G:{};return f({id:g(),timestamp:Date.now(),canceled:!1},Q)}(function(G){for(var Q=1;Q<arguments.length;Q++){var ee=arguments[Q]!=null?arguments[Q]:{},ae=Object.keys(ee);typeof Object.getOwnPropertySymbols=="function"&&(ae=ae.concat(Object.getOwnPropertySymbols(ee).filter(function(de){return Object.getOwnPropertyDescriptor(ee,de).enumerable}))),ae.forEach(function(de){_(G,de,ee[de])})}return G}({name:this.name,ref:this.$refs.modal},F))},handleModalResize:function(x){this.modal.widthType="px",this.modal.width=x.size.width,this.modal.heightType="px",this.modal.height=x.size.height;var F=this.modal.size;this.$emit("resize",this.createModalEvent({size:F}))},toggle:function(x,F){var G=this.reset,Q=this.scrollable,ee=this.visible;if(ee!==x){var ae=ee?"before-close":"before-open";ae=="before-open"?(G&&(this.setInitialSize(),this.shift.left=0,this.shift.top=0),Q&&document.body.classList.add("v--modal-block-scroll")):Q&&document.body.classList.remove("v--modal-block-scroll");var de=!1,ye=this.createModalEvent({stop:function(){de=!0},state:x,params:F});this.$emit(ae,ye),de||(this.visible=x,ae=="before-open"&&typeof document<"u"&&document.activeElement&&document.activeElement.tagName!=="BODY"&&document.activeElement.blur&&document.activeElement.blur())}},getDraggableElement:function(){var x=typeof this.draggable!="string"?".v--modal-box":this.draggable;return x?this.$refs.overlay.querySelector(x):null},handleBackgroundClick:function(){this.clickToClose&&this.toggle(!1)},callAfterEvent:function(x){x?this.connectObserver():this.disconnectObserver();var F=x?"opened":"closed",G=this.createModalEvent({state:x});this.$emit(F,G)},addDraggableListeners:function(){var x=this;if(this.draggable){var F=this.getDraggableElement();if(F){var G=0,Q=0,ee=0,ae=0,de=function(ne){return ne.touches&&0<ne.touches.length?ne.touches[0]:ne},ye=function(ne){var Se=ne.target;if(!Se||Se.nodeName!=="INPUT"&&Se.nodeName!=="TEXTAREA"&&Se.nodeName!=="SELECT"){var Be=de(ne),Ye=Be.clientX,Pe=Be.clientY;document.addEventListener("mousemove",pe),document.addEventListener("touchmove",pe),document.addEventListener("mouseup",le),document.addEventListener("touchend",le),G=Ye,Q=Pe,ee=x.shift.left,ae=x.shift.top}},pe=function(ne){var Se=de(ne),Be=Se.clientX,Ye=Se.clientY;x.shift.left=ee+Be-G,x.shift.top=ae+Ye-Q,ne.preventDefault()},le=function ne(Se){x.ensureShiftInWindowBounds(),document.removeEventListener("mousemove",pe),document.removeEventListener("touchmove",pe),document.removeEventListener("mouseup",ne),document.removeEventListener("touchend",ne),Se.preventDefault()};F.addEventListener("mousedown",ye),F.addEventListener("touchstart",ye)}}},removeDraggableListeners:function(){},updateRenderedHeight:function(){this.$refs.modal&&(this.modal.renderedHeight=this.$refs.modal.getBoundingClientRect().height)},connectObserver:function(){this.mutationObserver&&this.mutationObserver.observe(this.$refs.overlay,{childList:!0,attributes:!0,subtree:!0})},disconnectObserver:function(){this.mutationObserver&&this.mutationObserver.disconnect()},beforeTransitionEnter:function(){this.connectObserver()},afterTransitionEnter:function(){},afterTransitionLeave:function(){},ensureShiftInWindowBounds:function(){var x=this.viewportHeight,F=this.viewportWidth,G=this.shift,Q=this.pivotX,ee=this.pivotY,ae=this.trueModalWidth,de=this.trueModalHeight,ye=F-ae,pe=Math.max(x-de,0),le=G.left+Q*ye,ne=G.top+ee*pe;this.shift.left-=le-h(0,ye,le),this.shift.top-=ne-h(0,pe,ne)}}},U=(o(7),v(C,l,[]));U.options.__file="src/Modal.vue";function L(){var x=this,F=x.$createElement,G=x._self._c||F;return G("modal",{attrs:{name:"dialog",height:"auto",classes:["v--modal","vue-dialog",this.params.class],width:x.width,"pivot-y":.3,adaptive:!0,clickToClose:x.clickToClose,transition:x.transition},on:{"before-open":x.beforeOpened,"before-close":x.beforeClosed,opened:function(Q){x.$emit("opened",Q)},closed:function(Q){x.$emit("closed",Q)}}},[G("div",{staticClass:"dialog-content"},[x.params.title?G("div",{staticClass:"dialog-c-title",domProps:{innerHTML:x._s(x.params.title||"")}}):x._e(),x._v(" "),x.params.component?G(x.params.component,x._b({tag:"component"},"component",x.params.props,!1)):G("div",{staticClass:"dialog-c-text",domProps:{innerHTML:x._s(x.params.text||"")}})],1),x._v(" "),x.buttons?G("div",{staticClass:"vue-dialog-buttons"},x._l(x.buttons,function(Q,ee){return G("button",{key:ee,class:Q.class||"vue-dialog-button",style:x.buttonStyle,attrs:{type:"button"},domProps:{innerHTML:x._s(Q.title)},on:{click:function(ae){ae.stopPropagation(),x.click(ee,ae)}}},[x._v(`
|
|
572
|
+
`+x._s(Q.title)+`
|
|
573
|
+
`)])})):G("div",{staticClass:"vue-dialog-buttons-none"})])}var R=U.exports;L._withStripped=!0;var B={name:"VueJsDialog",props:{width:{type:[Number,String],default:400},clickToClose:{type:Boolean,default:!0},transition:{type:String,default:"fade"}},data:function(){return{params:{},defaultButtons:[{title:"CLOSE"}]}},computed:{buttons:function(){return this.params.buttons||this.defaultButtons},buttonStyle:function(){return{flex:"1 1 ".concat(100/this.buttons.length,"%")}}},methods:{beforeOpened:function(x){window.addEventListener("keyup",this.onKeyUp),this.params=x.params||{},this.$emit("before-opened",x)},beforeClosed:function(x){window.removeEventListener("keyup",this.onKeyUp),this.params={},this.$emit("before-closed",x)},click:function(x,F,G){var Q=2<arguments.length&&G!==void 0?G:"click",ee=this.buttons[x];ee&&typeof ee.handler=="function"?ee.handler(x,F,{source:Q}):this.$modal.hide("dialog")},onKeyUp:function(x){if(x.which===13&&0<this.buttons.length){var F=this.buttons.length===1?0:this.buttons.findIndex(function(G){return G.default});F!==-1&&this.click(F,x,"keypress")}}}},S=(o(9),v(B,L,[]));S.options.__file="src/Dialog.vue";function A(){var x=this,F=x.$createElement,G=x._self._c||F;return G("div",{attrs:{id:"modals-container"}},x._l(x.modals,function(Q){return G("modal",x._g(x._b({key:Q.id,on:{closed:function(ee){x.remove(Q.id)}}},"modal",Q.modalAttrs,!1),Q.modalListeners),[G(Q.component,x._g(x._b({tag:"component",on:{close:function(ee){x.$modal.hide(Q.modalAttrs.name)}}},"component",Q.componentAttrs,!1),x.$listeners))],1)}))}var I=S.exports;function D(x,F,G){return F in x?Object.defineProperty(x,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):x[F]=G,x}A._withStripped=!0;var O=v({data:function(){return{modals:[]}},created:function(){this.$root._dynamicContainer=this},methods:{add:function(x,F,G,Q){var ee=this,ae=1<arguments.length&&F!==void 0?F:{},de=2<arguments.length&&G!==void 0?G:{},ye=3<arguments.length&&Q!==void 0?Q:{},pe=g(),le=de.name||"_dynamic_modal_"+pe;this.modals.push({id:pe,modalAttrs:function(ne){for(var Se=1;Se<arguments.length;Se++){var Be=arguments[Se]!=null?arguments[Se]:{},Ye=Object.keys(Be);typeof Object.getOwnPropertySymbols=="function"&&(Ye=Ye.concat(Object.getOwnPropertySymbols(Be).filter(function(Pe){return Object.getOwnPropertyDescriptor(Be,Pe).enumerable}))),Ye.forEach(function(Pe){D(ne,Pe,Be[Pe])})}return ne}({},de,{name:le}),modalListeners:ye,component:x,componentAttrs:ae}),this.$nextTick(function(){ee.$modal.show(le)})},remove:function(x){var F=this.modals.findIndex(function(G){return G.id===x});F!==-1&&this.modals.splice(F,1)}}},A,[]);O.options.__file="src/ModalsContainer.vue";var H=O.exports;function N(x){return(N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F})(x)}function P(x,F,G){return F in x?Object.defineProperty(x,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):x[F]=G,x}var Y=function(x,F,G){if(!G._dynamicContainer&&F.injectModalsContainer){var Q=(ee=document.createElement("div"),document.body.appendChild(ee),ee);new x({parent:G,render:function(ae){return ae(H)}}).$mount(Q)}var ee;return G._dynamicContainer},z={install:function(x,F){var G=1<arguments.length&&F!==void 0?F:{};if(!this.installed){this.installed=!0,this.event=new x,this.rootInstance=null;var Q=G.componentName||"Modal",ee=G.dynamicDefaults||{},ae=function(de,ye,pe,le){var ne=pe&&pe.root?pe.root:z.rootInstance,Se=Y(x,G,ne);Se?Se.add(de,ye,function(Be){for(var Ye=1;Ye<arguments.length;Ye++){var Pe=arguments[Ye]!=null?arguments[Ye]:{},Z=Object.keys(Pe);typeof Object.getOwnPropertySymbols=="function"&&(Z=Z.concat(Object.getOwnPropertySymbols(Pe).filter(function(se){return Object.getOwnPropertyDescriptor(Pe,se).enumerable}))),Z.forEach(function(se){P(Be,se,Pe[se])})}return Be}({},ee,pe),le):console.warn("[vue-js-modal] In order to render dynamic modals, a <modals-container> component must be present on the page.")};x.prototype.$modal={show:function(de){for(var ye=arguments.length,pe=new Array(1<ye?ye-1:0),le=1;le<ye;le++)pe[le-1]=arguments[le];switch(N(de)){case"string":return(function(ne,Se){z.event.$emit("toggle",ne,!0,Se)}).apply(void 0,[de].concat(pe));case"object":case"function":return G.dynamic?ae.apply(void 0,[de].concat(pe)):console.warn("[vue-js-modal] $modal() received object as a first argument, but dynamic modals are switched off. https://github.com/euvl/vue-js-modal/#dynamic-modals");default:console.warn("[vue-js-modal] $modal() received an unsupported argument as a first argument.",de)}},hide:function(de,ye){z.event.$emit("toggle",de,!1,ye)},toggle:function(de,ye){z.event.$emit("toggle",de,void 0,ye)}},x.component(Q,R),G.dialog&&x.component("VDialog",I),G.dynamic&&(x.component("ModalsContainer",H),x.mixin({beforeMount:function(){z.rootInstance===null&&(z.rootInstance=this.$root)}}))}}},J=a.default=z}],t.c=r,t.d=function(n,a,o){t.o(n,a)||Object.defineProperty(n,a,{enumerable:!0,get:o})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,a){if(1&a&&(n=t(n)),8&a||4&a&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&a&&typeof n!="string")for(var l in n)t.d(o,l,(function(c){return n[c]}).bind(null,l));return o},t.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(a,"a",a),a},t.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},t.p="/dist/",t(t.s=11);function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return i[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i,r})})(tx);var Z8=tx.exports;const eG=Oe(Z8);var sx={exports:{}};const tG=py(mw);(function(s,e){(function(i,r){s.exports=r(tG)})(Vn,function(t){return function(i){var r={};function n(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return i[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=i,n.c=r,n.i=function(a){return a},n.d=function(a,o,l){n.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},n.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(o,"a",o),o},n.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},n.p="/dist/",n(n.s=2)}([function(i,r){i.exports=function(a,o,l,c){var u,f=a=a||{},d=typeof a.default;(d==="object"||d==="function")&&(u=a,f=a.default);var h=typeof f=="function"?f.options:f;if(o&&(h.render=o.render,h.staticRenderFns=o.staticRenderFns),l&&(h._scopeId=l),c){var p=Object.create(h.computed||null);Object.keys(c).forEach(function(g){var m=c[g];p[g]=function(){return m}}),h.computed=p}return{esModule:u,exports:f,options:h}}},function(i,r,n){n.d(r,"a",function(){return l});var a=n(20),o=n.n(a),l=new o.a({name:"vue-notification"})},function(i,r,n){Object.defineProperty(r,"__esModule",{value:!0});var a=n(3),o=n.n(a),l=n(1),c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},u={install:function(d){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.installed){this.installed=!0,this.params=h,d.component(h.componentName||"notifications",o.a);var p=function(v){typeof v=="string"&&(v={title:"",text:v}),(typeof v>"u"?"undefined":c(v))==="object"&&l.a.$emit("add",v)};p.close=function(m){l.a.$emit("close",m)};var g=h.name||"notify";d.prototype["$"+g]=p,d[g]=p}}};r.default=u},function(i,r,n){n(17);var a=n(0)(n(5),n(15),null,null);i.exports=a.exports},function(i,r,n){Object.defineProperty(r,"__esModule",{value:!0}),r.default={name:"CssGroup",props:["name"]}},function(i,r,n){Object.defineProperty(r,"__esModule",{value:!0});var a=n(2),o=n(1),l=n(9),c=n(7),u=n(13),f=n.n(u),d=n(12),h=n.n(d),p=n(8);function g(y,E,w){return E in y?Object.defineProperty(y,E,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[E]=w,y}var m={IDLE:0,DESTROYED:2},v={name:"Notifications",components:{VelocityGroup:f.a,CssGroup:h.a},props:{group:{type:String,default:""},width:{type:[Number,String],default:300},reverse:{type:Boolean,default:!1},position:{type:[String,Array],default:function(){return c.a.position}},classes:{type:String,default:"vue-notification"},animationType:{type:String,default:"css",validator:function(E){return E==="css"||E==="velocity"}},animation:{type:Object,default:function(){return c.a.velocityAnimation}},animationName:{type:String,default:c.a.cssAnimation},speed:{type:Number,default:300},cooldown:{type:Number,default:0},duration:{type:Number,default:3e3},delay:{type:Number,default:0},max:{type:Number,default:1/0},ignoreDuplicates:{type:Boolean,default:!1},closeOnClick:{type:Boolean,default:!0}},data:function(){return{list:[],velocity:a.default.params.velocity}},mounted:function(){o.a.$on("add",this.addItem),o.a.$on("close",this.closeItem)},computed:{actualWidth:function(){return n.i(p.a)(this.width)},isVA:function(){return this.animationType==="velocity"},componentName:function(){return this.isVA?"VelocityGroup":"CssGroup"},styles:function(){var E=n.i(l.a)(this.position),w=E.x,T=E.y,$=this.actualWidth.value,k=this.actualWidth.type,M=g({width:$+k},T,"0px");return w==="center"?M.left="calc(50% - "+$/2+k+")":M[w]="0px",M},active:function(){return this.list.filter(function(E){return E.state!==m.DESTROYED})},botToTop:function(){return this.styles.hasOwnProperty("bottom")}},methods:{destroyIfNecessary:function(E){this.closeOnClick&&this.destroy(E)},addItem:function(E){var w=this;if(E.group=E.group||"",this.group===E.group){if(E.clean||E.clear){this.destroyAll();return}var T=typeof E.duration=="number"?E.duration:this.duration,$=typeof E.speed=="number"?E.speed:this.speed,k=typeof E.ignoreDuplicates=="boolean"?E.ignoreDuplicates:this.ignoreDuplicates,M=E.title,_=E.text,C=E.type,U=E.data,L=E.id,R={id:L||n.i(l.b)(),title:M,text:_,type:C,state:m.IDLE,speed:$,length:T+2*$,data:U};T>=0&&(R.timer=setTimeout(function(){w.destroy(R)},R.length));var B=this.reverse?!this.botToTop:this.botToTop,S=-1,A=this.active.some(function(D){return D.title===E.title&&D.text===E.text}),I=k?!A:!0;I&&(B?(this.list.push(R),this.active.length>this.max&&(S=0)):(this.list.unshift(R),this.active.length>this.max&&(S=this.active.length-1)),S!==-1&&this.destroy(this.active[S]))}},closeItem:function(E){this.destroyById(E)},notifyClass:function(E){return["vue-notification-template",this.classes,E.type]},notifyWrapperStyle:function(E){return this.isVA?null:{transition:"all "+E.speed+"ms"}},destroy:function(E){clearTimeout(E.timer),E.state=m.DESTROYED,this.isVA||this.clean()},destroyById:function(E){var w=this.list.find(function(T){return T.id===E});w&&this.destroy(w)},destroyAll:function(){this.active.forEach(this.destroy)},getAnimation:function(E,w){var T=this.animation[E];return typeof T=="function"?T.call(this,w):T},enter:function(E){var w=E.el,T=E.complete,$=this.getAnimation("enter",w);this.velocity(w,$,{duration:this.speed,complete:T})},leave:function(E){var w=E.el,T=E.complete,$=this.getAnimation("leave",w);this.velocity(w,$,{duration:this.speed,complete:T})},clean:function(){this.list=this.list.filter(function(E){return E.state!==m.DESTROYED})}}};r.default=v},function(i,r,n){Object.defineProperty(r,"__esModule",{value:!0}),r.default={name:"VelocityGroup",methods:{enter:function(o,l){this.$emit("enter",{el:o,complete:l})},leave:function(o,l){this.$emit("leave",{el:o,complete:l})},afterLeave:function(){this.$emit("afterLeave")}}}},function(i,r,n){r.a={position:["top","right"],cssAnimation:"vn-fade",velocityAnimation:{enter:function(o){var l=o.clientHeight;return{height:[l,0],opacity:[1,0]}},leave:{height:0,opacity:[0,1]}}}},function(i,r,n){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},o="[-+]?[0-9]*.?[0-9]+",l=[{name:"px",regexp:new RegExp("^"+o+"px$")},{name:"%",regexp:new RegExp("^"+o+"%$")},{name:"px",regexp:new RegExp("^"+o+"$")}],c=function(d){if(d==="auto")return{type:d,value:0};for(var h=0;h<l.length;h++){var p=l[h];if(p.regexp.test(d))return{type:p.name,value:parseFloat(d)}}return{type:"",value:d}},u=function(d){switch(typeof d>"u"?"undefined":a(d)){case"number":return{type:"px",value:d};case"string":return c(d);default:return{type:"",value:d}}};r.a=u},function(i,r,n){n.d(r,"b",function(){return o}),n.d(r,"a",function(){return c});var a={x:["left","center","right"],y:["top","bottom"]},o=function(u){return function(){return u++}}(0),l=function(f){return typeof f!="string"?[]:f.split(/\s+/gi).filter(function(d){return d})},c=function(f){typeof f=="string"&&(f=l(f));var d=null,h=null;return f.forEach(function(p){a.y.indexOf(p)!==-1&&(h=p),a.x.indexOf(p)!==-1&&(d=p)}),{x:d,y:h}}},function(i,r,n){r=i.exports=n(11)(),r.push([i.i,".vue-notification-group{display:block;position:fixed;z-index:5000}.vue-notification-wrapper{display:block;overflow:hidden;width:100%;margin:0;padding:0}.notification-title{font-weight:600}.vue-notification-template{background:#fff}.vue-notification,.vue-notification-template{display:block;box-sizing:border-box;text-align:left}.vue-notification{font-size:12px;padding:10px;margin:0 5px 5px;color:#fff;background:#44a4fc;border-left:5px solid #187fe7}.vue-notification.warn{background:#ffb648;border-left-color:#f48a06}.vue-notification.error{background:#e54d42;border-left-color:#b82e24}.vue-notification.success{background:#68cd86;border-left-color:#42a85f}.vn-fade-enter-active,.vn-fade-leave-active,.vn-fade-move{transition:all .5s}.vn-fade-enter,.vn-fade-leave-to{opacity:0}",""])},function(i,r){i.exports=function(){var n=[];return n.toString=function(){for(var o=[],l=0;l<this.length;l++){var c=this[l];c[2]?o.push("@media "+c[2]+"{"+c[1]+"}"):o.push(c[1])}return o.join("")},n.i=function(a,o){typeof a=="string"&&(a=[[null,a,""]]);for(var l={},c=0;c<this.length;c++){var u=this[c][0];typeof u=="number"&&(l[u]=!0)}for(c=0;c<a.length;c++){var f=a[c];(typeof f[0]!="number"||!l[f[0]])&&(o&&!f[2]?f[2]=o:o&&(f[2]="("+f[2]+") and ("+o+")"),n.push(f))}},n}},function(i,r,n){var a=n(0)(n(4),n(16),null,null);i.exports=a.exports},function(i,r,n){var a=n(0)(n(6),n(14),null,null);i.exports=a.exports},function(i,r){i.exports={render:function(){var n=this,a=n.$createElement,o=n._self._c||a;return o("transition-group",{attrs:{css:!1},on:{enter:n.enter,leave:n.leave,"after-leave":n.afterLeave}},[n._t("default")],2)},staticRenderFns:[]}},function(i,r){i.exports={render:function(){var n=this,a=n.$createElement,o=n._self._c||a;return o("div",{staticClass:"vue-notification-group",style:n.styles},[o(n.componentName,{tag:"component",attrs:{name:n.animationName},on:{enter:n.enter,leave:n.leave,"after-leave":n.clean}},n._l(n.active,function(l){return o("div",{key:l.id,staticClass:"vue-notification-wrapper",style:n.notifyWrapperStyle(l),attrs:{"data-id":l.id}},[n._t("body",[o("div",{class:n.notifyClass(l),on:{click:function(c){return n.destroyIfNecessary(l)}}},[l.title?o("div",{staticClass:"notification-title",domProps:{innerHTML:n._s(l.title)}}):n._e(),n._v(" "),o("div",{staticClass:"notification-content",domProps:{innerHTML:n._s(l.text)}})])],{item:l,close:function(){return n.destroy(l)}})],2)}),0)],1)},staticRenderFns:[]}},function(i,r){i.exports={render:function(){var n=this,a=n.$createElement,o=n._self._c||a;return o("transition-group",{attrs:{name:n.name}},[n._t("default")],2)},staticRenderFns:[]}},function(i,r,n){var a=n(10);typeof a=="string"&&(a=[[i.i,a,""]]),a.locals&&(i.exports=a.locals),n(18)("2901aeae",a,!0)},function(i,r,n){var a=typeof document<"u";if(typeof DEBUG<"u"&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o=n(19),l={},c=a&&(document.head||document.getElementsByTagName("head")[0]),u=null,f=0,d=!1,h=function(){},p=typeof navigator<"u"&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());i.exports=function(T,$,k){d=k;var M=o(T,$);return g(M),function(C){for(var U=[],L=0;L<M.length;L++){var R=M[L],B=l[R.id];B.refs--,U.push(B)}C?(M=o(T,C),g(M)):M=[];for(var L=0;L<U.length;L++){var B=U[L];if(B.refs===0){for(var S=0;S<B.parts.length;S++)B.parts[S]();delete l[B.id]}}}};function g(T){for(var $=0;$<T.length;$++){var k=T[$],M=l[k.id];if(M){M.refs++;for(var _=0;_<M.parts.length;_++)M.parts[_](k.parts[_]);for(;_<k.parts.length;_++)M.parts.push(v(k.parts[_]));M.parts.length>k.parts.length&&(M.parts.length=k.parts.length)}else{for(var C=[],_=0;_<k.parts.length;_++)C.push(v(k.parts[_]));l[k.id]={id:k.id,refs:1,parts:C}}}}function m(){var T=document.createElement("style");return T.type="text/css",c.appendChild(T),T}function v(T){var $,k,M=document.querySelector('style[data-vue-ssr-id~="'+T.id+'"]');if(M){if(d)return h;M.parentNode.removeChild(M)}if(p){var _=f++;M=u||(u=m()),$=E.bind(null,M,_,!1),k=E.bind(null,M,_,!0)}else M=m(),$=w.bind(null,M),k=function(){M.parentNode.removeChild(M)};return $(T),function(U){if(U){if(U.css===T.css&&U.media===T.media&&U.sourceMap===T.sourceMap)return;$(T=U)}else k()}}var y=function(){var T=[];return function($,k){return T[$]=k,T.filter(Boolean).join(`
|
|
574
|
+
`)}}();function E(T,$,k,M){var _=k?"":M.css;if(T.styleSheet)T.styleSheet.cssText=y($,_);else{var C=document.createTextNode(_),U=T.childNodes;U[$]&&T.removeChild(U[$]),U.length?T.insertBefore(C,U[$]):T.appendChild(C)}}function w(T,$){var k=$.css,M=$.media,_=$.sourceMap;if(M&&T.setAttribute("media",M),_&&(k+=`
|
|
575
|
+
/*# sourceURL=`+_.sources[0]+" */",k+=`
|
|
576
|
+
/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(_))))+" */"),T.styleSheet)T.styleSheet.cssText=k;else{for(;T.firstChild;)T.removeChild(T.firstChild);T.appendChild(document.createTextNode(k))}}},function(i,r){i.exports=function(a,o){for(var l=[],c={},u=0;u<o.length;u++){var f=o[u],d=f[0],h=f[1],p=f[2],g=f[3],m={id:a+":"+u,css:h,media:p,sourceMap:g};c[d]?c[d].parts.push(m):l.push(c[d]={id:d,parts:[m]})}return l}},function(i,r){i.exports=t}])})})(sx);var sG=sx.exports;const iG=Oe(sG);Ce.use(eG);Ce.use(iG);Ce.use(Xn,ft);J_.dispatch("updateHost",ie.axios.defaults.baseURL);Ce.component("Tabs",ex.Tabs);Ce.component("Tab",ex.Tab);Ce.config.productionTip=!1;const rG=new Ce({el:"#app",store:J_,router:sp,render:s=>s(gN)});wb(rG)});export default nG();
|