(()=>{var e={67228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},48926:e=>{function t(e,t,o,a,i,r,n){try{var E=e[r](n),_=E.value}catch(e){return void o(e)}E.done?t(_):Promise.resolve(_).then(a,i)}e.exports=function(e){return function(){var o=this,a=arguments;return new Promise((function(i,r){var n=e.apply(o,a);function E(e){t(n,i,r,E,_,"next",e)}function _(e){t(n,i,r,E,_,"throw",e)}E(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},34575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},93913:e=>{function t(e,t){for(var o=0;o{e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},95318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},13884:e=>{e.exports=function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r}},e.exports.default=e.exports,e.exports.__esModule=!0},80521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},6479:(e,t,o)=>{var a=o(37316);e.exports=function(e,t){if(null==e)return{};var o,i,r=a(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r},e.exports.default=e.exports,e.exports.__esModule=!0},37316:e=>{e.exports=function(e,t){if(null==e)return{};var o,a,i={},r=Object.keys(e);for(a=0;a=0||(i[o]=e[o]);return i},e.exports.default=e.exports,e.exports.__esModule=!0},63038:(e,t,o)=>{var a=o(22858),i=o(13884),r=o(60379),n=o(80521);e.exports=function(e,t){return a(e)||i(e,t)||r(e,t)||n()},e.exports.default=e.exports,e.exports.__esModule=!0},50008:e=>{function t(o){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(o)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},60379:(e,t,o)=>{var a=o(67228);e.exports=function(e,t){if(e){if("string"==typeof e)return a(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?a(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},87757:(e,t,o)=>{e.exports=o(35666)},56553:(e,t,o)=>{"use strict";var a=o(95318),i=a(o(87757)),r=a(o(48926));e.exports=function(e,t){t.addEventListener("message",(function(){var o=(0,r.default)(i.default.mark((function o(a){var r,n,E,_,s,T,S;return i.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(r=a.data.request){o.next=3;break}return o.abrupt("return");case 3:if(n=r.id,E=r.path,_=r.args,o.prev=4,"function"!=typeof(s=E.reduce((function(e,t){return e[t]}),e))){o.next=13;break}return S=E.slice(0,E.length-1).reduce((function(e,t){return e[t]}),e),o.next=10,s.apply(S,_);case 10:T=o.sent,o.next=16;break;case 13:return o.next=15,s;case 15:T=o.sent;case 16:t.postMessage({response:{id:n,result:{data:T}}}),o.next=22;break;case 19:o.prev=19,o.t0=o.catch(4),t.postMessage({response:{id:n,result:{error:o.t0}}});case 22:case"end":return o.stop()}}),o,null,[[4,19]])})));return function(e){return o.apply(this,arguments)}})()),this.call=(function(){var e=(0,r.default)(i.default.mark((function e(o,a){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Math.random().toString(32).slice(2),e.abrupt("return",new Promise((function(e,i){t.addEventListener("message",(function o(a){var n=a.data.response;n&&n.id===r&&(t.removeEventListener("message",o),"error"in n.result?i(n.result.error):e(n.result.data))})),t.postMessage({request:{id:r,path:o,args:a}})})));case 2:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}})()}},10792:(e,t,o)=>{var a=o(26729),i=o(39657);function r(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=e.chromecastTransport;if(!o)throw new Error("Chromecast transport required");var r=o.getCastDevice();if(null===r)throw new Error("Chromecast session must be started");var n=document.createElement("div");n.style.display="flex",n.style.flexDirection="row",n.style.alignItems="center",n.style.justifyContent="center",n.style.width="100%",n.style.height="100%",n.style.backgroundColor="black";var E=document.createElement("div");E.style.flex="none",E.style.maxWidth="80%",E.style.fontSize="5vmin",E.style.lineHeight="1.2em",E.style.maxHeight="3.6em",E.style.textAlign="center",E.style.color="#FFFFFF90",E.innerText="Casting to "+r.friendlyName,n.appendChild(E),t.appendChild(n),o.on("message",u),o.on("message-error",l);var _=new a,s=!1,T={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,audioTracks:!1,selectedAudioTrackId:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,volume:!1,muted:!1,playbackSpeed:!1,videoParams:!1,extraSubtitlesTracks:!1,selectedExtraSubtitlesTrackId:!1,extraSubtitlesDelay:!1,extraSubtitlesSize:!1,extraSubtitlesOffset:!1,extraSubtitlesTextColor:!1,extraSubtitlesBackgroundColor:!1,extraSubtitlesOutlineColor:!1};function S(e,t){_.emit("error",Object.assign({},i.CHROMECAST_SENDER_VIDEO.MESSAGE_SEND_FAILED,{error:e,action:t}))}function l(e){_.emit("error",Object.assign({},i.CHROMECAST_SENDER_VIDEO.INVALID_MESSAGE_RECEIVED,{error:e}))}function u(e){if(e&&"string"==typeof e.event){var t=Array.isArray(e.args)?e.args:[];_.emit.apply(_,[e.event].concat(t))}else l(new Error("Invalid message: "+e))}function I(e,t){T[e]&&_.emit("propChanged",e,t)}this.on=function(e,t){if(s)throw new Error("Video is destroyed");_.on(e,t)},this.dispatch=function(e){if(s)throw new Error("Video is destroyed");if(e)switch(e.type){case"observeProp":return i=e.propName,T.hasOwnProperty(i)&&(T[i]=!0),void o.sendMessage(e).catch((function(t){S(t,e)}));case"setProp":return void o.sendMessage(e).catch((function(t){S(t,e)}));case"command":return a=e.commandName,e.commandArgs,"destroy"===a&&(s=!0,I("stream",null),I("loaded",null),I("paused",null),I("time",null),I("duration",null),I("buffering",null),I("buffered",null),I("audioTracks",[]),I("selectedAudioTrackId",[]),I("subtitlesTracks",[]),I("selectedSubtitlesTrackId",null),I("subtitlesOffset",null),I("subtitlesSize",null),I("subtitlesTextColor",null),I("subtitlesBackgroundColor",null),I("subtitlesOutlineColor",null),I("volume",null),I("muted",null),I("playbackSpeed",null),I("videoParams",null),I("extraSubtitlesTracks",[]),I("selectedExtraSubtitlesTrackId",null),I("extraSubtitlesDelay",null),I("extraSubtitlesSize",null),I("extraSubtitlesOffset",null),I("extraSubtitlesTextColor",null),I("extraSubtitlesBackgroundColor",null),I("extraSubtitlesOutlineColor",null),_.removeAllListeners(),o.off("message",u),t.removeChild(n)),void o.sendMessage(e).catch((function(t){S(t,e)}))}var a,i;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}r.canPlayStream=function(){return Promise.resolve(!0)},r.manifest={name:"ChromecastSenderVideo",external:!0,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed","videoParams","extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"],commands:["load","unload","destroy","addExtraSubtitlesTracks"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded","extraSubtitlesTrackLoaded","implementationChanged"]},e.exports=r},43153:(e,t,o)=>{var a=o(10792);e.exports=a},41431:(e,t,o)=>{var a=o(26729),i=o(67631),r=o(83465),n=o(62682),E=o(6767),_=o(39657),s=o(28973),T=o(11566);function S(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=document.createElement("style");t.appendChild(o),o.sheet.insertRule("video::cue { font-size: 4vmin; color: rgb(255, 255, 255); background-color: rgba(0, 0, 0, 0); text-shadow: rgb(34, 34, 34) 1px 1px 0.1em; }");var S=document.createElement("video");S.style.width="100%",S.style.height="100%",S.style.backgroundColor="black",S.controls=!1,S.playsInline=!0,S.onerror=function(){!(function(){if(I)return;var e;switch(S.error.code){case 1:e=_.HTML_VIDEO.MEDIA_ERR_ABORTED;break;case 2:e=_.HTML_VIDEO.MEDIA_ERR_NETWORK;break;case 3:e=_.HTML_VIDEO.MEDIA_ERR_DECODE;break;case 4:e=_.HTML_VIDEO.MEDIA_ERR_SRC_NOT_SUPPORTED;break;default:e=_.UNKNOWN_ERROR}N(Object.assign({},e,{critical:!0,error:S.error}))})()},S.onended=function(){u.emit("ended")},S.onpause=function(){m("paused")},S.onplay=function(){m("paused")},S.ontimeupdate=function(){m("time"),m("buffered")},S.ondurationchange=function(){m("duration")},S.onwaiting=function(){m("buffering"),m("buffered")},S.onseeking=function(){m("time"),m("buffering"),m("buffered")},S.onseeked=function(){m("time"),m("buffering"),m("buffered")},S.onstalled=function(){m("buffering"),m("buffered")},S.onplaying=function(){m("time"),m("buffering"),m("buffered")},S.oncanplay=function(){m("buffering"),m("buffered")},S.canplaythrough=function(){m("buffering"),m("buffered")},S.onloadedmetadata=function(){m("loaded")},S.onloadeddata=function(){m("buffering"),m("buffered")},S.onvolumechange=function(){m("volume"),m("muted")},S.onratechange=function(){m("playbackSpeed")},S.textTracks.onchange=function(){m("subtitlesTracks"),m("selectedSubtitlesTrackId"),R(),Array.from(S.textTracks).forEach((function(e){e.oncuechange=R}))},t.appendChild(S);var l=null,u=new a,I=!1,d=null,A=0,c={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,audioTracks:!1,selectedAudioTrackId:!1,volume:!1,muted:!1,playbackSpeed:!1};function O(e){switch(e){case"stream":return d;case"loaded":return null===d?null:S.readyState>=S.HAVE_METADATA;case"paused":return null===d?null:!!S.paused;case"time":return null!==d&&null!==S.currentTime&&isFinite(S.currentTime)?Math.floor(1e3*S.currentTime):null;case"duration":return null!==d&&null!==S.duration&&isFinite(S.duration)?Math.floor(1e3*S.duration):null;case"buffering":return null===d?null:S.readyState0?e.lang:"string"==typeof e.name&&e.name.length>0?e.name:String(e.id),label:"string"==typeof e.name&&e.name.length>0?e.name:"string"==typeof e.lang&&e.lang.length>0?e.lang:String(e.id),origin:"EMBEDDED",embedded:!0})})):[];case"selectedAudioTrackId":return null!==l&&null!==l.audioTrack&&isFinite(l.audioTrack)&&-1!==l.audioTrack?"EMBEDDED_"+String(l.audioTrack):null;case"volume":return I||null===S.volume||!isFinite(S.volume)?null:Math.floor(100*S.volume);case"muted":return I?null:!!S.muted;case"playbackSpeed":return I||null===S.playbackRate||!isFinite(S.playbackRate)?null:S.playbackRate;default:return null}}function R(){Array.from(S.textTracks).forEach((function(e){Array.from(e.cues||[]).forEach((function(e){e.snapToLines=!1,e.line=100-A}))}))}function N(e){u.emit("error",e),e.critical&&p("unload")}function m(e){c[e]&&u.emit("propChanged",e,O(e))}function p(e,a){switch(e){case"load":p("unload"),a&&a.stream&&"string"==typeof a.stream.url?(d=a.stream,m("stream"),m("loaded"),S.autoplay="boolean"!=typeof a.autoplay||a.autoplay,S.currentTime=null!==a.time&&isFinite(a.time)?parseInt(a.time,10)/1e3:0,m("paused"),m("time"),m("duration"),m("buffering"),m("buffered"),m("subtitlesTracks"),m("selectedSubtitlesTrackId"),m("audioTracks"),m("selectedAudioTrackId"),s(d).then((function(e){d===a.stream&&("application/vnd.apple.mpegurl"===e&&i.isSupported()?((l=new i(T)).on(i.Events.AUDIO_TRACKS_UPDATED,(function(){m("audioTracks"),m("selectedAudioTrackId")})),l.on(i.Events.AUDIO_TRACK_SWITCHED,(function(){m("audioTracks"),m("selectedAudioTrackId")})),l.loadSource(d.url),l.attachMedia(S)):S.src=d.url)})).catch((function(){d===a.stream&&(S.src=d.url)}))):N(Object.assign({},_.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":d=null,Array.from(S.textTracks).forEach((function(e){e.oncuechange=null})),null!==l&&(l.removeAllListeners(),l.detachMedia(S),l.destroy(),l=null),S.removeAttribute("src"),S.load(),S.currentTime=0,m("stream"),m("loaded"),m("paused"),m("time"),m("duration"),m("buffering"),m("buffered"),m("subtitlesTracks"),m("selectedSubtitlesTrackId"),m("audioTracks"),m("selectedAudioTrackId");break;case"destroy":p("unload"),I=!0,m("subtitlesOffset"),m("subtitlesSize"),m("subtitlesTextColor"),m("subtitlesBackgroundColor"),m("subtitlesOutlineColor"),m("volume"),m("muted"),m("playbackSpeed"),u.removeAllListeners(),S.onerror=null,S.onended=null,S.onpause=null,S.onplay=null,S.ontimeupdate=null,S.ondurationchange=null,S.onwaiting=null,S.onseeking=null,S.onseeked=null,S.onstalled=null,S.onplaying=null,S.oncanplay=null,S.canplaythrough=null,S.onloadeddata=null,S.onvolumechange=null,S.onratechange=null,S.textTracks.onchange=null,t.removeChild(S),t.removeChild(o)}}this.on=function(e,t){if(I)throw new Error("Video is destroyed");u.on(e,t)},this.dispatch=function(e){if(I)throw new Error("Video is destroyed");if(e)switch((e=n(r(e))).type){case"observeProp":return t=e.propName,void(c.hasOwnProperty(t)&&(u.emit("propValue",t,O(t)),c[t]=!0));case"setProp":return void(function(e,t){switch(e){case"paused":null!==d&&(t?S.pause():S.play(),m("paused"));break;case"time":null!==d&&null!==t&&isFinite(t)&&(S.currentTime=parseInt(t,10)/1e3,m("time"));break;case"selectedSubtitlesTrackId":if(null!==d){Array.from(S.textTracks).forEach((function(e,o){e.mode="EMBEDDED_"+String(o)===t?"showing":"disabled"}));var a=O("subtitlesTracks").find((function(e){return e.id===t}));a&&(m("selectedSubtitlesTrackId"),u.emit("subtitlesTrackLoaded",a))}break;case"subtitlesOffset":null!==t&&isFinite(t)&&(A=Math.max(0,Math.min(100,parseInt(t,10))),R(),m("subtitlesOffset"));break;case"subtitlesSize":null!==t&&isFinite(t)&&(o.sheet.cssRules[0].style.fontSize=Math.floor(Math.max(0,parseInt(t,10))/25)+"vmin",m("subtitlesSize"));break;case"subtitlesTextColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.color=E(t).rgb().string()}catch(e){console.error("HTMLVideo",e)}m("subtitlesTextColor")}break;case"subtitlesBackgroundColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.backgroundColor=E(t).rgb().string()}catch(e){console.error("HTMLVideo",e)}m("subtitlesBackgroundColor")}break;case"subtitlesOutlineColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.textShadow=E(t).rgb().string()+" 1px 1px 0.1em"}catch(e){console.error("HTMLVideo",e)}m("subtitlesOutlineColor")}break;case"selectedAudioTrackId":if(null!==l){var i=O("audioTracks").find((function(e){return e.id===t}));l.audioTrack=i?parseInt(i.id.split("_").pop(),10):-1,i&&(m("selectedAudioTrackId"),u.emit("audioTrackLoaded",i))}break;case"volume":null!==t&&isFinite(t)&&(S.muted=!1,S.volume=Math.max(0,Math.min(100,parseInt(t,10)))/100,m("muted"),m("volume"));break;case"muted":S.muted=!!t,m("muted");break;case"playbackSpeed":null!==t&&isFinite(t)&&(S.playbackRate=parseFloat(t),m("playbackSpeed"))}})(e.propName,e.propValue);case"command":return void p(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}S.canPlayStream=function(e){return!e||e.behaviorHints&&e.behaviorHints.notWebReady?Promise.resolve(!1):s(e).then((function(e){return!!document.createElement("video").canPlayType(e)||"application/vnd.apple.mpegurl"===e&&i.isSupported()})).catch((function(){return!1}))},S.manifest={name:"HTMLVideo",external:!1,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded"]},e.exports=S},28973:e=>{e.exports=function(e){return e&&"string"==typeof e.url?e.behaviorHints&&e.behaviorHints.proxyHeaders&&e.behaviorHints.proxyHeaders.response&&"string"==typeof e.behaviorHints.proxyHeaders.response["content-type"]?Promise.resolve(e.behaviorHints.proxyHeaders.response["content-type"]):fetch(e.url,{method:"HEAD"}).then((function(e){if(e.ok)return e.headers.get("content-type");throw new Error(e.status+" ("+e.statusText+")")})):Promise.reject(new Error("Invalid stream parameter!"))}},11566:e=>{e.exports={debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:50,maxMaxBufferLength:80,maxFragLookUpTolerance:0,maxBufferHole:0,appendErrorMaxRetry:20,nudgeMaxRetry:20,manifestLoadingTimeOut:3e4,manifestLoadingMaxRetry:10}},59222:(e,t,o)=>{var a=o(41431);e.exports=a},78879:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(39657);function E(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=document.createElement("iframe");o.style.width="100%",o.style.height="100%",o.style.border=0,o.style.backgroundColor="black",o.allowFullscreen=!1,o.allow="autoplay",t.appendChild(o);var E=new a,_=!1,s={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,volume:!1,muted:!1,playbackSpeed:!1};function T(e){if(e.source===o.contentWindow){var t=e.data||e.message;if(t&&"string"==typeof t.event){var a=t.event,i=Array.isArray(t.args)?t.args:[];E.emit.apply(E,[a].concat(i))}}}function S(e){o.contentWindow.postMessage(e,"*")}function l(e,t){s[e]&&E.emit("propChanged",e,t)}function u(e,a){switch(e){case"load":return u("unload"),a&&a.stream&&"string"==typeof a.stream.playerFrameUrl?(window.addEventListener("message",T,!1),o.onload=function(){S({type:"command",commandName:e,commandArgs:a})},o.src=a.stream.playerFrameUrl):(i=Object.assign({},n.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}),E.emit("error",i),i.critical&&u("unload")),!0;case"unload":return window.removeEventListener("message",T),o.onload=null,o.removeAttribute("src"),l("stream",null),l("loaded",null),l("paused",null),l("time",null),l("duration",null),l("buffering",null),l("buffered",null),l("volume",null),l("muted",null),l("playbackSpeed",null),!0;case"destroy":return u("unload"),_=!0,E.removeAllListeners(),t.removeChild(o),!0}var i}this.on=function(e,t){if(_)throw new Error("Video is destroyed");E.on(e,t)},this.dispatch=function(e){if(_)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":return t=e.propName,s.hasOwnProperty(t)&&(s[t]=!0),void S(e);case"setProp":return void S(e);case"command":return void(u(e.commandName,e.commandArgs)||S(e))}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}E.canPlayStream=function(e){return Promise.resolve(e&&"string"==typeof e.playerFrameUrl)},E.manifest={name:"IFrameVideo",external:!0,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed","extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"],commands:["load","unload","destroy","addExtraSubtitlesTracks"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded","extraSubtitlesTrackLoaded","implementationChanged"]},e.exports=E},47685:(e,t,o)=>{var a=o(78879);e.exports=a},78945:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(39657),E=.0066,_={stream:null,paused:"pause",time:"time-pos",duration:"duration",buffering:"buffering",volume:"volume",muted:"mute",playbackSpeed:"speed",audioTracks:"audioTracks",selectedAudioTrackId:"aid",subtitlesTracks:"subtitlesTracks",selectedSubtitlesTrackId:"sid",subtitlesSize:"sub-scale",subtitlesTextColor:"sub-color",subtitlesBackgroundColor:"sub-back-color",subtitlesOutlineColor:"sub-border-color"};function s(e){var t=(e=e||{}).shellTransport,o={};Object.keys(_).forEach((function(e){_[e]&&(o[_[e]]=e)})),t.send("mpv-command",["stop"]),t.send("mpv-observe-prop","path"),t.send("mpv-observe-prop","time-pos"),t.send("mpv-observe-prop","volume"),t.send("mpv-observe-prop","pause"),t.send("mpv-observe-prop","seeking"),t.send("mpv-observe-prop","eof-reached"),t.send("mpv-observe-prop","duration"),t.send("mpv-observe-prop","metadata"),t.send("mpv-observe-prop","video-params"),t.send("mpv-observe-prop","track-list"),t.send("mpv-observe-prop","paused-for-cache"),t.send("mpv-observe-prop","cache-buffering-state"),t.send("mpv-observe-prop","aid"),t.send("mpv-observe-prop","vid"),t.send("mpv-observe-prop","sid"),t.send("mpv-observe-prop","sub-scale"),t.send("mpv-observe-prop","sub-pos"),t.send("mpv-observe-prop","speed"),t.send("mpv-observe-prop","mpv-version"),t.send("mpv-observe-prop","ffmpeg-version");var s=new a,T=!1,S=null,l={},u=0,I=0,d={};function A(t){for(var o=t?"":"transparent",a=e.containerElement;a;a=a.parentElement)a.style.background=o}var c=0;function O(e){return _[e]?d[_[e]]:(console.log("Unsupported prop requested",e),null)}function R(e){s.emit("error",e),e.critical&&m("unload")}function N(e){l[e]&&s.emit("propChanged",e,O(e))}function m(o,a){switch(o){case"load":if(m("unload"),a&&a.stream&&"string"==typeof a.stream.url){S=a.stream,N("stream"),u=null!==a.time&&isFinite(a.time)?parseInt(a.time,10)/1e3:0,A(!1),t.send("mpv-set-prop",["no-sub-ass"]);var i="Win32"===navigator.platform?"direct3d":"opengl",r=e.mpvSeparateWindow?i:"opengl-cb",E=e.mpvSeparateWindow?"yes":"no";t.send("mpv-set-prop",["vo",r]),t.send("mpv-set-prop",["osc",E]),t.send("mpv-set-prop",["input-defalt-bindings",E]),t.send("mpv-set-prop",["input-vo-keyboard",E]),t.send("mpv-command",["loadfile",S.url]),t.send("mpv-set-prop",["pause",!1]),t.send("mpv-set-prop",["speed",d.speed]),t.send("mpv-set-prop",["aid",d.aid]),t.send("mpv-set-prop",["mute","no"]),N("paused"),N("time"),N("duration"),N("buffering"),N("volume"),N("muted"),N("subtitlesTracks"),N("selectedSubtitlesTrackId")}else R(Object.assign({},n.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":d={mute:!1,speed:1,subtitlesTracks:[],buffering:!0,aid:null,sid:null},u=0,I=0,t.send("mpv-command",["stop"]),N("stream"),N("paused"),N("time"),N("duration"),N("buffering"),N("volume"),N("muted"),N("subtitlesTracks"),N("selectedSubtitlesTrackId"),A(!0);break;case"destroy":m("unload"),T=!0,s.removeAllListeners()}}t.on("mpv-prop-change",(function(e){switch(e.name){case"mpv-version":case"ffmpeg-version":d[e.name]=(function(e){console.log(e.name+": "+e.data)})(e);break;case"duration":var a=0|e.data;d[e.name]=e.data>=30&&(!I||a===I)?Math.round(1e3*e.data):null,I=I?I+a>>1:a;break;case"time-pos":d[e.name]=Math.round(1e3*e.data),u&&(t.send("mpv-set-prop",["time-pos",u]),d[e.name]=Math.round(u),u=0);break;case"sub-scale":d[e.name]=Math.round(e.data/E);break;case"paused-for-cache":case"seeking":d.buffering!==e.data&&(d.buffering=e.data,N("buffering"));break;case"aid":case"sid":case"vid":d[e.name]=(function(e){return e.data?"EMBEDDED_"+e.data.toString():null})(e);break;case"track-list":d.audioTracks=e.data.filter((function(e){return"audio"===e.type})).map((function(e,t){return{id:"EMBEDDED_"+e.id,lang:void 0===e.lang?"Track"+(t+1):e.lang,label:void 0===e.title||void 0===e.lang?"":e.title||e.lang,origin:"EMBEDDED",embedded:!0,mode:e.id===d.aid?"showing":"disabled"}})),N("audioTracks"),d.subtitlesTracks=e.data.filter((function(e){return"sub"===e.type})).map((function(e,t){return{id:"EMBEDDED_"+e.id,lang:void 0===e.lang?"Track "+(t+1):e.lang,label:void 0===e.title||void 0===e.lang?"":e.title||e.lang,origin:"EMBEDDED",embedded:!0,mode:e.id===d.sid?"showing":"disabled"}})),N("subtitlesTracks");break;default:d[e.name]=e.data}var i="time-pos"===e.name?Math.floor(d["time-pos"]/1e3):null;i&&c===i||!o[e.name]||(i&&(c=i),N(o[e.name]))})),t.on("mpv-event-ended",(function(e){e.error?R(e.error):s.emit("ended")})),this.on=function(e,t){if(T)throw new Error("Video is destroyed");s.on(e,t)},this.dispatch=function(e){if(T)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":o=e.propName,s.emit("propValue",o,O(o)),l[o]=!0;break;case"setProp":return void(function(e,o){switch(e){case"paused":null!==S&&t.send("mpv-set-prop",["pause",o]);break;case"time":null!==S&&null!==o&&isFinite(o)&&t.send("mpv-set-prop",["time-pos",o/1e3]);break;case"playbackSpeed":null!==S&&null!==o&&isFinite(o)&&t.send("mpv-set-prop",["speed",o]);break;case"volume":null!==S&&null!==o&&isFinite(o)&&(d.mute=!1,t.send("mpv-set-prop",["mute","no"]),t.send("mpv-set-prop",["volume",o]),N("muted"),N("volume"));break;case"muted":null!==S&&(t.send("mpv-set-prop",["mute",o?"yes":"no"]),d.mute=o,N("muted"));break;case"selectedAudioTrackId":if(null!==S){var a=o.slice("EMBEDDED_".length);t.send("mpv-set-prop",["aid",a])}break;case"selectedSubtitlesTrackId":null!==S&&(o?(a=o.slice("EMBEDDED_".length),t.send("mpv-set-prop",["sid",a]),s.emit("subtitlesTrackLoaded",o)):(t.send("mpv-set-prop",["sid","no"]),d.sid=null)),N("selectedSubtitlesTrackId");break;case"subtitlesSize":t.send("mpv-set-prop",[_[e],o*E]);break;case"subtitlesOffset":t.send("mpv-set-prop",[_[e],o]);break;case"subtitlesTextColor":case"subtitlesBackgroundColor":case"subtitlesOutlineColor":var i=o.replace(/^#(\w{6})(\w{2})$/,"#$2$1");t.send("mpv-set-prop",[_[e],i]);break;default:console.log("Unhandled setProp for",e)}})(e.propName,e.propValue);case"command":return void m(e.commandName,e.commandArgs)}var o}}s.canPlayStream=function(){return Promise.resolve(!0)},s.manifest={name:"ShellVideo",external:!1,props:Object.keys(_),commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded"]},e.exports=s},22024:(e,t,o)=>{var a=o(78945);e.exports=a},8117:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(72081),E=o(39657);function _(){var e=null,t=new a,o=!1;this.on=function(e,a){if(o)throw new Error("Video is destroyed");t.on(e,a)},this.dispatch=function(a,_){if(o)throw new Error("Video is destroyed");if(!a)throw new Error("Invalid action dispatched: "+JSON.stringify(a));if(_=_||{},"command"===(a=r(i(a))).type&&"load"===a.commandName&&a.commandArgs){var s=n(a.commandArgs,_);if(null!==e&&e.constructor!==s&&(e.dispatch({type:"command",commandName:"destroy"}),e=null),null===e){if(null===s)return void t.emit("error",Object.assign({},E.UNSUPPORTED_STREAM,{error:new Error("No video implementation was selected"),critical:!0,stream:a.commandArgs.stream}));(e=new s(_)).on("ended",(function(){t.emit("ended")})),e.on("error",(function(e){t.emit("error",e)})),e.on("propValue",(function(e,o){t.emit("propValue",e,o)})),e.on("propChanged",(function(e,o){t.emit("propChanged",e,o)})),e.on("subtitlesTrackLoaded",(function(e){t.emit("subtitlesTrackLoaded",e)})),e.on("audioTrackLoaded",(function(e){t.emit("audioTrackLoaded",e)})),e.on("extraSubtitlesTrackLoaded",(function(e){t.emit("extraSubtitlesTrackLoaded",e)})),s.manifest.external?e.on("implementationChanged",(function(e){t.emit("implementationChanged",e)})):t.emit("implementationChanged",s.manifest)}}if(null!==e)try{e.dispatch(a)}catch(t){console.error(e.constructor.manifest.name,t)}"command"===a.type&&"destroy"===a.commandName&&(e=null)},this.destroy=function(){o=!0,null!==e&&(e.dispatch({type:"command",commandName:"destroy"}),e=null),t.removeAllListeners()}}_.ERROR=E,e.exports=_},35010:(e,t,o)=>{var a=o(8117);e.exports=a},72081:(e,t,o)=>{var a=o(43153),i=o(22024),r=o(59222),n=o(5682),E=o(18846),_=o(47685),s=o(33142),T=o(5690),S=o(74282),l=o(29450);e.exports=function(e,t){return e.stream&&"string"!=typeof e.stream.externalUrl?t.chromecastTransport&&t.chromecastTransport.getCastState()===cast.framework.CastState.CONNECTED?a:"string"==typeof e.stream.ytId?l(S(s)):"string"==typeof e.stream.playerFrameUrl?l(_):t.shellTransport?T(S(i)):"string"==typeof e.streamingServerURL?void 0!==o.g.tizen?T(S(n)):void 0!==o.g.webOS?T(S(E)):T(S(r)):"string"==typeof e.stream.url?void 0!==o.g.webOS?l(S(E)):void 0!==o.g.tizen?l(S(n)):l(S(r)):null:null}},95071:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(6767),E=o(39657);function _(e){var t=!0,o=1,_=null,s=null,T=(e=e||{}).containerElement;if(!(T instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var S,l=!1,u=100,I=0,d="rgb(255, 255, 255)",A="rgba(0, 0, 0, 0)",c="rgb(34, 34, 34)",O=document.createElement("object");O.type="application/avplayer",O.style.width="100%",O.style.height="100%",O.style.backgroundColor="black";var R=!1;function N(){if(S){var e=S.duration-(B("time")-S.now);e>0&&m(e,S.text)}}function m(e,t){if(!R){for(S={duration:e,text:t,now:B("time")},p&&(clearTimeout(p),p=!1);h.hasChildNodes();)h.removeChild(h.lastChild);h.style.bottom=I+"%";var a=document.createElement("span");a.innerHTML=t,a.style.display="inline-block",a.style.padding="0.2em",a.style.fontSize=Math.floor(u/25)+"vmin",a.style.color=d,a.style.backgroundColor=A,a.style.textShadow="1px 1px 0.1em "+c,h.appendChild(a),h.appendChild(document.createElement("br")),e&&(p=setTimeout((function(){for(;h.hasChildNodes();)h.removeChild(h.lastChild)}),parseInt(e*o)))}}var p=!1,L={onbufferingstart:function(){t=!0,v("buffering")},onbufferingprogress:function(){t=!0,v("buffering")},onbufferingcomplete:function(){t=!1,v("buffering")},oncurrentplaytime:function(){v("time")},onerror:function(){!(function(){if(f)return;var e;e=E.UNKNOWN_ERROR,P(Object.assign({},e,{critical:!0,error:e}))})()},onsubtitlechange:function(e,t){m(e,t)},onstreamcompleted:function(){D.emit("ended")}};window.webapis.avplay.setListener(L),T.appendChild(O);var h=document.createElement("div");h.style.position="absolute",h.style.right="0",h.style.bottom="0",h.style.left="0",h.style.zIndex="1",h.style.textAlign="center",T.style.position="relative",T.style.zIndex="0",T.appendChild(h);var D=new a,f=!1,C=null,g={stream:!1,paused:!1,time:!1,duration:!1,buffering:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,audioTracks:!1,selectedAudioTrackId:!1,playbackSpeed:!1};function B(e){switch(e){case"stream":return C;case"paused":if(null===C)return null;var a=!("PAUSED"!==window.webapis.avplay.getState());return!a&&l&&(window.webapis.avplay.setSelectTrack("AUDIO",parseInt(l.replace("EMBEDDED_",""))),l=!1),a;case"time":var i=window.webapis.avplay.getCurrentTime();return null!==C&&null!==i&&isFinite(i)?Math.floor(i):null;case"duration":var r=window.webapis.avplay.getDuration();return null!==C&&null!==r&&isFinite(r)?Math.floor(r):null;case"buffering":return null===C?null:t;case"subtitlesTracks":if(null===C)return[];for(var n=window.webapis.avplay.getTotalTrackInfo(),E=[],T=0;T0?N.track_lang.trim():null;E.push({id:O,lang:m,label:m,origin:"EMBEDDED",embedded:!0,mode:R||O!==_?"disabled":"showing"})}return E;case"selectedSubtitlesTrackId":if(null===C||R)return null;var p=window.webapis.avplay.getCurrentStreamInfo();for(T=0;T0?N.language:null;L.push({id:D,lang:g,label:g,origin:"EMBEDDED",embedded:!0,mode:D===s?"showing":"disabled"})}return L;case"selectedAudioTrackId":if(null===C)return null;if(l)return l;p=window.webapis.avplay.getCurrentStreamInfo();var B=!1;for(T=0;T{var a=o(95071);e.exports=a},64333:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(39657);function E(e,t,o,a){t&&(e.onSuccess=t||function(){}),e.onFailure=function(){o&&o()},window.webOS.service.request(a||"luna://com.webos.media",e)}function _(e,t,o){window.webOS.service.request("luna://com.webos.applicationManager",{method:"launch",parameters:{id:e.id,params:{payload:[{fullPath:e.url,artist:"",subtitle:"",dlnaInfo:{flagVal:4096,cleartextSize:"-1",contentLength:"-1",opVal:1,protocolInfo:"http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000",duration:0},mediaType:"VIDEO",thumbnail:"",deviceType:"DMR",album:"",fileName:e.name,lastPlayPosition:e.position}]}},onSuccess:function(){t&&t()},onFailure:function(){o&&o(new Error("Failed to launch"+e.id)),"com.webos.app.photovideo"===e.id?(e.id="com.webos.app.smartshare",_(e,t,o)):"com.webos.app.smartshare"===e.id&&(e.id="com.webos.app.mediadiscovery",_(e,t,o))}})}var s=["black","white","yellow","red","green","blue"],T={"rgba(0, 0, 0, 255)":"black","rgba(255, 255, 255, 255)":"white","rgba(255, 255, 0, 255)":"yellow","rgba(255, 0, 0, 255)":"red","rgba(0, 255, 0, 255)":"green","rgba(0, 0, 255, 255)":"blue","rgba(0, 0, 0, 1)":"black","rgba(255, 255, 255, 1)":"white","rgba(255, 255, 0, 1)":"yellow","rgba(255, 0, 0, 1)":"red","rgba(0, 255, 0, 1)":"green","rgba(0, 0, 255, 1)":"blue","rgba(0, 0, 0)":"black","rgba(255, 255, 255)":"white","rgba(255, 255, 0)":"yellow","rgba(255, 0, 0)":"red","rgba(0, 255, 0)":"green","rgba(0, 0, 255)":"blue","#000000FF":"black","#FFFFFFFF":"white","#FFFF00FF":"yellow","#FF0000FF":"red","#00FF00FF":"green","#0000FFFF":"blue","#000000":"black","#FFFFFF":"white","#FFFF00":"yellow","#FF0000":"red","#00FF00":"green","#0000FF":"blue"};function S(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=!1,S=75,l=!0,u=!1,I=!1,d=!1,A=[],c=[],O=0,R=function(e){if(!u){u=!0;var t=!1;E({method:"subscribe",parameters:{mediaId:o,subscribe:!0}},(function(a){if(a.sourceInfo&&!t){t=!0;var i=a.sourceInfo.programInfo[0];!(function(e){if(A=[],e.numSubtitleTracks){for(var t=0;t=L.HAVE_METADATA&&null!==t&&isFinite(t))try{L.currentTime=parseInt(t,10)/1e3}catch(e){}break;case"selectedSubtitlesTrackId":if(null!==P)if(0===(t||"").indexOf("EMBEDDED_")){l&&m(!0),I=t;var a=parseInt(t.replace("EMBEDDED_",""));E({method:"selectTrack",parameters:{type:"text",mediaId:o,index:a}},(function(){var e=W("subtitlesTracks").find((function(e){return e.id===t}));A=A.map((function(e){return e.mode=e.id===I?"showing":"disabled",e})),e&&(g.emit("subtitlesTrackLoaded",e),G("selectedSubtitlesTrackId"))}))}else t||m(!1);break;case"subtitlesOffset":if(null!==t&&isFinite(t)){y=Math.max(0,Math.min(100,parseInt(t,10)));var i=0===(O=5)?-3:O<=2?-2:O<=3?-1:O<=5?0:O<=10?1:O<=25?2:O<=50?3:O<=100&&4;!1===i&&(i=0),E({method:"setSubtitlePosition",parameters:{mediaId:o,position:i}},(function(){})),G("subtitlesOffset")}break;case"subtitlesSize":if(null!==t&&isFinite(t)){S=Math.max(0,parseInt(t,10));var r=(u=S)<=75?1:u<=100?2:u<=150?3:u<=250&&4;!1===r&&(r=2),E({method:"setSubtitleFontSize",parameters:{mediaId:o,fontSize:r}},(function(){})),G("subtitlesSize")}break;case"subtitlesTextColor":if("string"==typeof t){var n="white";T[t]&&s.indexOf(T[t])>-1&&(n=T[t]),E({method:"setSubtitleCharacterColor",parameters:{mediaId:o,charColor:n}},(function(){})),h=t,G("subtitlesTextColor")}break;case"subtitlesBackgroundColor":"string"==typeof t&&(T[t]&&s.indexOf(T[t])>-1?E({method:"setSubtitleBackgroundColor",parameters:{mediaId:o,color:T[t]}},(function(){f||E({method:"setSubtitleBackgroundOpacity",parameters:{mediaId:o,bgOpacity:255}},(function(){f=255}))})):E({method:"setSubtitleBackgroundOpacity",parameters:{mediaId:o,bgOpacity:0}},(function(){f=0})),D=t,G("subtitlesBackgroundColor"));break;case"selectedAudioTrackId":if(0===(t||"").indexOf("EMBEDDED_")){d=t;a=parseInt(t.replace("EMBEDDED_",""));if(E({method:"selectTrack",parameters:{type:"audio",mediaId:o,index:a}},(function(){var e=W("audioTracks").find((function(e){return e.id===t}));c=c.map((function(e){return e.mode=e.id===d?"showing":"disabled",e})),e&&(g.emit("audioTrackLoaded",e),G("selectedAudioTrackId"))})),L.audioTracks){for(var _=0;_4&&(clearInterval(E),r())}),300)}else U(Object.assign({},n.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":P=null,v=null,Array.from(L.textTracks).forEach((function(e){e.oncuechange=null})),L.removeAttribute("src"),L.load(),G("stream"),G("paused"),G("time"),G("duration"),G("buffering"),G("buffered"),G("subtitlesTracks"),G("selectedSubtitlesTrackId"),G("audioTracks"),G("selectedAudioTrackId");break;case"destroy":F("unload"),B=!0,G("subtitlesOffset"),G("subtitlesSize"),G("subtitlesTextColor"),G("subtitlesBackgroundColor"),G("volume"),G("muted"),G("playbackSpeed"),g.removeAllListeners(),L.onerror=null,L.onended=null,L.onpause=null,L.onplay=null,L.ontimeupdate=null,L.ondurationchange=null,L.onwaiting=null,L.onseeking=null,L.onseeked=null,L.onstalled=null,L.onplaying=null,L.oncanplay=null,L.canplaythrough=null,L.onloadeddata=null,L.onloadedmetadata=null,L.onvolumechange=null,L.onratechange=null,L.textTracks.onchange=null,t.removeChild(L),t.removeChild(p)}var r,E}this.on=function(e,t){if(B)throw new Error("Video is destroyed");g.on(e,t)},this.dispatch=function(e){if(B)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":return t=e.propName,void(M.hasOwnProperty(t)&&(g.emit("propValue",t,W(t)),M[t]=!0));case"setProp":return void k(e.propName,e.propValue);case"command":return void F(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}S.canPlayStream=function(){return Promise.resolve(!0)},S.manifest={name:"WebOsVideo",external:!1,props:["stream","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","volume","muted","playbackSpeed"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded"]},e.exports=S},18846:(e,t,o)=>{var a=o(64333);e.exports=a},59736:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682),n=o(39657);function E(e){var t=null!==(e=e||{}).timeChangedTimeout&&isFinite(e.timeChangedTimeout)?parseInt(e.timeChangedTimeout,10):100,o=e.containerElement;if(!(o instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var E=document.createElement("script");E.type="text/javascript",E.src="https://www.youtube.com/iframe_api",E.onload=function(){if(I)return;if(!YT||"function"!=typeof YT.ready)return void O();YT.ready((function(){I||(YT&&YT.PlayerState&&"function"==typeof YT.Player?T=new YT.Player(_,{width:"100%",height:"100%",playerVars:{autoplay:1,cc_load_policy:3,controls:0,disablekb:1,enablejsapi:1,fs:0,iv_load_policy:3,loop:0,modestbranding:1,playsinline:1,rel:0},events:{onError:R,onReady:N,onApiChange:m,onStateChange:p}}):O())}))},E.onerror=O,o.appendChild(E);var _=document.createElement("div");_.style.width="100%",_.style.height="100%",_.style.backgroundColor="black",o.appendChild(_);var s=window.setInterval((function(){D("time"),D("volume"),D("muted"),D("playbackSpeed")}),t),T=null,S=!1,l=null,u=new a,I=!1,d=null,A=null,c={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,volume:!1,muted:!1,playbackSpeed:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1};function O(){I||h(Object.assign({},n.YOUTUBE_VIDEO.API_LOAD_FAILED,{critical:!0}))}function R(e){if(!I){var t;switch(e.data){case 2:t=n.YOUTUBE_VIDEO.INVALID_PARAMETER;break;case 5:t=n.YOUTUBE_VIDEO.HTML5_VIDEO;break;case 100:t=n.YOUTUBE_VIDEO.VIDEO_NOT_FOUND;break;case 101:case 150:t=n.YOUTUBE_VIDEO.VIDEO_NOT_EMBEDDABLE;break;default:t=n.UNKNOWN_ERROR}h(Object.assign({},t,{critical:!0,error:e}))}}function N(){I||(S=!0,null!==l&&(f("load",l),l=null))}function m(){I||("function"==typeof T.loadModule&&T.loadModule("captions"),"function"==typeof T.setOption&&T.setOption("captions","track",{}),D("paused"),D("time"),D("duration"),D("buffering"),D("volume"),D("muted"),D("playbackSpeed"),D("subtitlesTracks"),D("selectedSubtitlesTrackId"))}function p(e){switch(D("buffering"),e.data){case YT.PlayerState.ENDED:u.emit("ended");break;case YT.PlayerState.CUED:case YT.PlayerState.UNSTARTED:case YT.PlayerState.PAUSED:case YT.PlayerState.PLAYING:D("paused"),D("time"),D("duration")}}function L(e){switch(e){case"stream":return d;case"loaded":return null!==d||null;case"paused":return null===d||"function"!=typeof T.getPlayerState?null:T.getPlayerState()!==YT.PlayerState.PLAYING;case"time":return null!==d&&"function"==typeof T.getCurrentTime&&null!==T.getCurrentTime()&&isFinite(T.getCurrentTime())?Math.floor(1e3*T.getCurrentTime()):null;case"duration":return null!==d&&"function"==typeof T.getDuration&&null!==T.getDuration()&&isFinite(T.getDuration())?Math.floor(1e3*T.getDuration()):null;case"buffering":return null===d||"function"!=typeof T.getPlayerState?null:T.getPlayerState()===YT.PlayerState.BUFFERING;case"volume":return null!==d&&"function"==typeof T.getVolume&&null!==T.getVolume()&&isFinite(T.getVolume())?T.getVolume():null;case"muted":return null===d||"function"!=typeof T.isMuted?null:T.isMuted();case"playbackSpeed":return null!==d&&"function"==typeof T.getPlaybackRate&&null!==T.getPlaybackRate()&&isFinite(T.getPlaybackRate())?T.getPlaybackRate():null;case"subtitlesTracks":return null===d||"function"!=typeof T.getOption?[]:(T.getOption("captions","tracklist")||[]).filter((function(e){return e&&"string"==typeof e.languageCode})).map((function(e,t){return Object.freeze({id:"EMBEDDED_"+String(t),lang:e.languageCode,label:"string"==typeof e.displayName?e.displayName:e.languageCode,origin:"EMBEDDED",embedded:!0})}));case"selectedSubtitlesTrackId":return null===d?null:A;default:return null}}function h(e){u.emit("error",e),e.critical&&f("unload")}function D(e){c[e]&&u.emit("propChanged",e,L(e))}function f(e,t){switch(e){case"load":if(f("unload"),t&&t.stream&&"string"==typeof t.stream.ytId)if(S){d=t.stream,D("stream"),D("loaded");var a="boolean"!=typeof t.autoplay||t.autoplay,i=null!==t.time&&isFinite(t.time)?parseInt(t.time,10)/1e3:0;a&&"function"==typeof T.loadVideoById?T.loadVideoById({videoId:t.stream.ytId,startSeconds:i}):"function"==typeof T.cueVideoById&&T.cueVideoById({videoId:t.stream.ytId,startSeconds:i}),D("paused"),D("time"),D("duration"),D("buffering"),D("volume"),D("muted"),D("playbackSpeed"),D("subtitlesTracks"),D("selectedSubtitlesTrackId")}else l=t;else h(Object.assign({},n.UNSUPPORTED_STREAM,{critical:!0,stream:t?t.stream:null}));break;case"unload":l=null,d=null,D("stream"),D("loaded"),A=null,S&&"function"==typeof T.stopVideo&&T.stopVideo(),D("paused"),D("time"),D("duration"),D("buffering"),D("volume"),D("muted"),D("playbackSpeed"),D("subtitlesTracks"),D("selectedSubtitlesTrackId");break;case"destroy":f("unload"),I=!0,u.removeAllListeners(),clearInterval(s),S&&"function"==typeof T.destroy&&T.destroy(),o.removeChild(E),o.removeChild(_)}}this.on=function(e,t){if(I)throw new Error("Video is destroyed");u.on(e,t)},this.dispatch=function(e){if(I)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":return t=e.propName,void(c.hasOwnProperty(t)&&(u.emit("propValue",t,L(t)),c[t]=!0));case"setProp":return void(function(e,t){switch(e){case"paused":null!==d&&(t?"function"==typeof T.pauseVideo&&T.pauseVideo():"function"==typeof T.playVideo&&T.playVideo());break;case"time":null!==d&&"function"==typeof T.seekTo&&null!==t&&isFinite(t)&&T.seekTo(parseInt(t,10)/1e3);break;case"volume":null!==d&&null!==t&&isFinite(t)&&("function"==typeof T.unMute&&T.unMute(),"function"==typeof T.setVolume&&T.setVolume(Math.max(0,Math.min(100,parseInt(t,10)))),D("muted"),D("volume"));break;case"muted":null!==d&&(t?"function"==typeof T.mute&&T.mute():"function"==typeof T.unMute&&T.unMute(),D("muted"));break;case"playbackSpeed":null!==d&&"function"==typeof T.setPlaybackRate&&isFinite(t)&&(T.setPlaybackRate(t),D("playbackSpeed"));break;case"selectedSubtitlesTrackId":if(null!==d){A=null;var o=L("subtitlesTracks").find((function(e){return e.id===t}));"function"==typeof T.setOption&&(o?(A=o.id,T.setOption("captions","track",{languageCode:o.lang}),u.emit("subtitlesTrackLoaded",o)):T.setOption("captions","track",{})),D("selectedSubtitlesTrackId")}}})(e.propName,e.propValue);case"command":return void f(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}E.canPlayStream=function(e){return Promise.resolve(e&&"string"==typeof e.ytId)},E.manifest={name:"YouTubeVideo",external:!1,props:["stream","loaded","paused","time","duration","buffering","volume","muted","playbackSpeed","subtitlesTracks","selectedSubtitlesTrackId"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded"]},e.exports=E},33142:(e,t,o)=>{var a=o(59736);e.exports=a},39657:e=>{e.exports={CHROMECAST_SENDER_VIDEO:{INVALID_MESSAGE_RECEIVED:{code:100,message:"Invalid message received"},MESSAGE_SEND_FAILED:{code:101,message:"Failed to send message"}},YOUTUBE_VIDEO:{API_LOAD_FAILED:{code:90,message:"YouTube player iframe API failed to load"},INVALID_PARAMETER:{code:91,message:"The request contains an invalid parameter value"},HTML5_VIDEO:{code:92,message:"The requested content cannot be played in an HTML5 player"},VIDEO_NOT_FOUND:{code:93,message:"The video requested was not found"},VIDEO_NOT_EMBEDDABLE:{code:94,message:"The owner of the requested video does not allow it to be played in embedded players"}},HTML_VIDEO:{MEDIA_ERR_ABORTED:{code:80,message:"Fetching process aborted"},MEDIA_ERR_NETWORK:{code:81,message:"Error occurred when downloading"},MEDIA_ERR_DECODE:{code:82,message:"Error occurred when decoding"},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:83,message:"Video is not supported"}},WITH_HTML_SUBTITLES:{LOAD_FAILED:{code:70,message:"Failed to load external subtitles"}},WITH_STREAMING_SERVER:{CONVERT_FAILED:{code:60,message:"Your device does not support the stream"}},UNKNOWN_ERROR:{code:1,message:"Unknown error"},UNSUPPORTED_STREAM:{code:2,message:"Stream is not supported"}}},91654:(e,t,o)=>{var a=o(35010);e.exports=a},55015:e=>{var t,o,a=[{codec:"h264",force:window.chrome||window.cast,mime:'video/mp4; codecs="avc1.42E01E"'},{codec:"h265",force:window.chrome||window.cast,mime:'video/mp4; codecs="hev1.1.6.L150.B0"',aliases:["hevc"]},{codec:"vp8",mime:'video/mp4; codecs="vp8"'},{codec:"vp9",mime:'video/mp4; codecs="vp9"'}],i=[{codec:"aac",mime:'audio/mp4; codecs="mp4a.40.2"'},{codec:"mp3",mime:'audio/mp4; codecs="mp3"'},{codec:"ac3",mime:'audio/mp4; codecs="ac-3"'},{codec:"eac3",mime:'audio/mp4; codecs="ec-3"'},{codec:"vorbis",mime:'audio/mp4; codecs="vorbis"'},{codec:"opus",mime:'audio/mp4; codecs="opus"'}];function r(e,t){return e.force||t.mediaElement.canPlayType(e.mime)?[e.codec].concat(e.aliases||[]):[]}e.exports=(t=document.createElement("video"),o=["mp4"],(window.chrome||window.cast)&&o.push("matroska,webm"),{formats:o,videoCodecs:a.map((function(e){return r(e,{mediaElement:t})})).reduce((function(e,t){return e.concat(t)}),[]),audioCodecs:i.map((function(e){return r(e,{mediaElement:t})})).reduce((function(e,t){return e.concat(t)}),[]),maxAudioChannels:(function(){if(/firefox/i.test(window.navigator.userAgent))return 6;if(!window.AudioContext||window.chrome||window.cast)return 2;var e=(new AudioContext).destination.maxChannelCount;return e>0?e:2})()})},69490:e=>{e.exports=function(e,t){if(tt?a=r-1:(e[r]{var a=o(4253);e.exports=a},86950:e=>{function t(e){for(var t="",o=(e=e.replace(/<[a-zA-Z/][^>]*>/g,"")).split(/\n/);o.length>3;){for(var a=3;a\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return r?(t+=r[1]+":"+r[2]+":"+r[3]+"."+r[4]+" --\x3e "+r[5]+":"+r[6]+":"+r[7]+"."+r[8]+"\n",o[i+=1]&&(t+=o[i]+"\n\n"),t):""}e.exports={convert:function(e){if(e.includes("WEBVTT"))return e;try{return(function(e){var o=e.replace(/\r+/g,""),a=(o=o.replace(/^\s+|\s+$/g,"")).split("\n\n"),i="";if(a.length>0){i+="WEBVTT\n\n";for(var r=0;r{var a=o(58369),i=o(69490);e.exports={parse:function(e){return new Promise((function(t,o){var r=new a.WebVTT.Parser(window,a.WebVTT.StringDecoder()),n=[],E=[],_={};r.oncue=function(e){var t={startTime:1e3*e.startTime|0,endTime:1e3*e.endTime|0,text:e.text};E.push(t),_[t.startTime]=_[t.startTime]||[],_[t.endTime]=_[t.endTime]||[]},r.onparsingerror=function(e){0===e.code?(r.oncue=null,r.onparsingerror=null,r.onflush=null,o(e)):(console.warn("Subtitles parsing error",e),n.push(e))},r.onflush=function(){_.times=Object.keys(_).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t}));for(var e=0;e{var a=o(58369),i=o(69490);e.exports={render:function(e,t){var o=[],r=i(e.times,t);if(-1!==r)for(var n=e[e.times[r]],E=0;E{var a=o(26729),i=o(83465),r=o(62682),n=o(6767),E=o(39657),_=o(45517),s=o(42913),T=o(86950);e.exports=function(e){function t(t){var o=new e(t=t||{});o.on("error",(function(e){d.emit("error",e),e.critical&&v("unload")})),o.on("propValue",C.bind(null,"propValue")),o.on("propChanged",C.bind(null,"propChanged")),e.manifest.events.filter((function(e){return!["error","propValue","propChanged"].includes(e)})).forEach((function(e){o.on(e,(function(e){return function(){d.emit.apply(d,[e].concat(Array.from(arguments)))}})(e))}));var S=t.containerElement;if(!(S instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var l=document.createElement("div");l.style.position="absolute",l.style.right="0",l.style.bottom="0",l.style.left="0",l.style.zIndex="1",l.style.textAlign="center",S.style.position="relative",S.style.zIndex="0",S.appendChild(l);var u={time:null},I=null,d=new a,A=!1,c=[],O=null,R=null,N=100,m=0,p="rgb(255, 255, 255)",L="rgba(0, 0, 0, 0)",h="rgb(34, 34, 34)",D={extraSubtitlesTracks:!1,selectedExtraSubtitlesTrackId:!1,extraSubtitlesDelay:!1,extraSubtitlesSize:!1,extraSubtitlesOffset:!1,extraSubtitlesTextColor:!1,extraSubtitlesBackgroundColor:!1,extraSubtitlesOutlineColor:!1};function f(){for(;l.hasChildNodes();)l.removeChild(l.lastChild);null!==I&&null!==u.time&&isFinite(u.time)&&(l.style.bottom=m+"%",s.render(I,u.time+R).forEach((function(e){e.style.display="inline-block",e.style.padding="0.2em",e.style.fontSize=Math.floor(N/25)+"vmin",e.style.color=p,e.style.backgroundColor=L,e.style.textShadow="1px 1px 0.1em "+h,l.appendChild(e),l.appendChild(document.createElement("br"))})))}function C(e,t,o){if("time"===t)u.time=o,f();d.emit(e,t,B(t,o))}function g(e){D[e]&&d.emit("propChanged",e,B(e,null))}function B(e,t){switch(e){case"extraSubtitlesTracks":return A?[]:c.slice();case"selectedExtraSubtitlesTrackId":return A?null:O;case"extraSubtitlesDelay":return A?null:R;case"extraSubtitlesSize":return A?null:N;case"extraSubtitlesOffset":return A?null:m;case"extraSubtitlesTextColor":return A?null:p;case"extraSubtitlesBackgroundColor":return A?null:L;case"extraSubtitlesOutlineColor":return A?null:h;default:return t}}function P(e,t){switch(e){case"selectedExtraSubtitlesTrackId":I=null,O=null,R=null;var a=c.find((function(e){return e.id===t}));return a&&(O=a.id,R=0,fetch(a.url).then((function(e){if(e.ok)return e.text();throw new Error(e.status+" ("+e.statusText+")")})).then((function(e){return T.convert(e)})).then((function(e){return _.parse(e)})).then((function(e){O===a.id&&(I=e,f(),d.emit("extraSubtitlesTrackLoaded",a))})).catch((function(e){O===a.id&&(function(e){d.emit("error",e),e.critical&&(v("unload"),o.dispatch({type:"command",commandName:"unload"}))})(Object.assign({},E.WITH_HTML_SUBTITLES.LOAD_FAILED,{error:e,track:a,critical:!1}))}))),f(),g("selectedExtraSubtitlesTrackId"),g("extraSubtitlesDelay"),!0;case"extraSubtitlesDelay":return null!==O&&null!==t&&isFinite(t)&&(R=parseInt(t,10),f(),g("extraSubtitlesDelay")),!0;case"extraSubtitlesSize":return null!==t&&isFinite(t)&&(N=Math.max(0,parseInt(t,10)),f(),g("extraSubtitlesSize")),!0;case"extraSubtitlesOffset":return null!==t&&isFinite(t)&&(m=Math.max(0,Math.min(100,parseInt(t,10))),f(),g("extraSubtitlesOffset")),!0;case"extraSubtitlesTextColor":if("string"==typeof t){try{p=n(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}f(),g("extraSubtitlesTextColor")}return!0;case"extraSubtitlesBackgroundColor":if("string"==typeof t){try{L=n(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}f(),g("extraSubtitlesBackgroundColor")}return!0;case"extraSubtitlesOutlineColor":if("string"==typeof t){try{h=n(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}f(),g("extraSubtitlesOutlineColor")}return!0;default:return!1}}function v(e,t){switch(e){case"addExtraSubtitlesTracks":return t&&Array.isArray(t.tracks)&&(c=c.concat(t.tracks).filter((function(e,t,o){return e&&"string"==typeof e.id&&"string"==typeof e.url&&"string"==typeof e.lang&&"string"==typeof e.label&&"string"==typeof e.origin&&!e.embedded&&t===o.findIndex((function(t){return t.id===e.id}))})),g("extraSubtitlesTracks")),!0;case"load":return v("unload"),t.stream&&Array.isArray(t.stream.subtitles)&&v("addExtraSubtitlesTracks",{tracks:t.stream.subtitles.map((function(e){return Object.assign({},e,{origin:"EXCLUSIVE",exclusive:!0,embedded:!1})}))}),!1;case"unload":return I=null,c=[],O=null,R=null,f(),g("extraSubtitlesTracks"),g("selectedExtraSubtitlesTrackId"),g("extraSubtitlesDelay"),!1;case"destroy":return v("unload"),A=!0,g("extraSubtitlesSize"),g("extraSubtitlesOffset"),g("extraSubtitlesTextColor"),g("extraSubtitlesBackgroundColor"),g("extraSubtitlesOutlineColor"),o.dispatch({type:"command",commandName:"destroy"}),d.removeAllListeners(),S.removeChild(l),!0;default:return!1}}this.on=function(e,t){if(A)throw new Error("Video is destroyed");d.on(e,t)},this.dispatch=function(e){if(A)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":if((function(e){switch(e){case"extraSubtitlesTracks":case"selectedExtraSubtitlesTrackId":case"extraSubtitlesDelay":case"extraSubtitlesSize":case"extraSubtitlesOffset":case"extraSubtitlesTextColor":case"extraSubtitlesBackgroundColor":case"extraSubtitlesOutlineColor":return d.emit("propValue",e,B(e,null)),D[e]=!0,!0;default:return!1}})(e.propName))return;break;case"setProp":if(P(e.propName,e.propValue))return;break;case"command":if(v(e.commandName,e.commandArgs))return}o.dispatch(e)}}return t.canPlayStream=function(t){return e.canPlayStream(t)},t.manifest={name:e.manifest.name+"WithHTMLSubtitles",external:e.manifest.external,props:e.manifest.props.concat(["extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"]).filter((function(e,t,o){return o.indexOf(e)===t})),commands:e.manifest.commands.concat(["load","unload","destroy","addExtraSubtitlesTracks"]).filter((function(e,t,o){return o.indexOf(e)===t})),events:e.manifest.events.concat(["propValue","propChanged","error","extraSubtitlesTrackLoaded"]).filter((function(e,t,o){return o.indexOf(e)===t}))},t}},17054:(e,t,o)=>{var a=o(49566),i=o(97190);e.exports=function(e,t,o){return new Promise((function(r,n){if("string"!=typeof t.url)"string"!=typeof t.infoHash?n(new Error("Stream cannot be converted")):i(e,t.infoHash,t.fileIdx,t.announce,o).then((function(e){r({url:e.url,infoHash:e.infoHash,fileIdx:e.fileIdx})})).catch((function(e){n(e)}));else if(0===t.url.indexOf("magnet:")){var E;try{if(!(E=a.decode(t.url))||"string"!=typeof E.infoHash)throw new Error("Failed to decode magnet url")}catch(e){return void n(e)}var _=Array.isArray(E.announce)?E.announce.map((function(e){return"tracker:"+e})):[];i(e,E.infoHash,null,_,o).then((function(e){r({url:e.url,infoHash:e.infoHash,fileIdx:e.fileIdx})})).catch((function(e){n(e)}))}else r({url:t.url})}))}},97190:(e,t,o)=>{var a=o(8575);function i(e,t,o,i){var r=Array.isArray(i)&&i.length>0?"?"+new URLSearchParams(i.map((function(e){return["tr",e]}))):"";return{url:a.resolve(e,"/"+encodeURIComponent(t)+"/"+encodeURIComponent(o))+r,infoHash:t,fileIdx:o,sources:i}}e.exports=function(e,t,o,r,n){if((!Array.isArray(r)||0===r.length)&&null!==o&&isFinite(o))return Promise.resolve(i(e,t,o,r));var E={torrent:{infoHash:t}};return Array.isArray(r)&&r.length>0&&(E.peerSearch={sources:["dht:"+t].concat(r).filter((function(e,t,o){return o.indexOf(e)===t})),min:40,max:200}),null!==o&&isFinite(o)?E.guessFileIdx=!1:(E.guessFileIdx={},n&&(null!==n.season&&isFinite(n.season)&&(E.guessFileIdx.season=n.season),null!==n.episode&&isFinite(n.episode)&&(E.guessFileIdx.episode=n.episode))),fetch(a.resolve(e,"/"+encodeURIComponent(t)+"/create"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(E)}).then((function(e){if(e.ok)return e.json();throw new Error(e.status+" ("+e.statusText+")")})).then((function(a){return i(e,t,E.guessFileIdx?a.guessedFileIdx:o,E.peerSearch?E.peerSearch.sources:[])}))}},94536:(e,t,o)=>{var a=o(8575);function i(e,t,o){var i=o&&"string"==typeof o.videoHash?o.videoHash:null,r=o&&isFinite(o.videoSize)?o.videoSize:null;if("string"==typeof i&&null!==r&&isFinite(r))return Promise.resolve({hash:i,size:r});var n=new URLSearchParams([["videoUrl",t]]);return fetch(a.resolve(e,"/opensubHash?"+n.toString())).then((function(e){if(e.ok)return e.json();throw new Error(e.status+" ("+e.statusText+")")})).then((function(e){if(e.error)throw new Error(e.error);return{hash:"string"==typeof i?i:e.result&&"string"==typeof e.result.hash?e.result.hash:null,size:null!==r&&isFinite(r)?r:e.result&&(e.result.size,1)?e.result.size:null}}))}function r(e,t,o,i,r){return r&&"string"==typeof r.filename?Promise.resolve(r.filename):o?fetch(a.resolve(e,"/"+encodeURIComponent(o)+"/"+encodeURIComponent(i)+"/stats.json")).then((function(e){if(e.ok)return e.json();throw new Error(e.status+" ("+e.statusText+")")})).then((function(e){if(!e||"string"!=typeof e.streamName)throw new Error("Could not retrieve filename from torrent");return e.streamName})):Promise.resolve(decodeURIComponent(t.split("/").pop()))}e.exports=function(e,t,o,a,n){return Promise.allSettled([i(e,t,n),r(e,t,o,a,n)]).then((function(e){var t={hash:null,size:null,filename:null};return"fulfilled"===e[0].status?(t.hash=e[0].value.hash,t.size=e[0].value.size):e[0].reason&&console.error(e[0].reason),"fulfilled"===e[1].status?t.filename=e[1].value:e[1].reason&&console.error(e[1].reason),t}))}},5690:(e,t,o)=>{var a=o(47746);e.exports=a},47746:(e,t,o)=>{var a=o(26729),i=o(8575),r=o(542),n=o(83465),E=o(62682),_=o(55015),s=o(17054),T=o(94536),S=o(39657);e.exports=function(e){function t(o){var l=new e(o=o||{});l.on("error",(function(e){O.emit("error",e),e.critical&&D("unload")})),l.on("propValue",m.bind(null,"propValue")),l.on("propChanged",m.bind(null,"propChanged")),e.manifest.events.filter((function(e){return!["error","propValue","propChanged"].includes(e)})).forEach((function(e){l.on(e,(function(e){return function(){O.emit.apply(O,[e].concat(Array.from(arguments)))}})(e))}));var u=this,I=null,d=!1,A=[],c=null,O=new a,R=!1,N={stream:!1,videoParams:!1};function m(e,t,o){O.emit(e,t,h(t,o))}function p(e){N[e]&&O.emit("propChanged",e,h(e,null))}function L(e){O.emit("error",e),e.critical&&(D("unload"),l.dispatch({type:"command",commandName:"unload"}))}function h(e,t){switch(e){case"stream":return null!==I?I.stream:null;case"videoParams":return c;default:return t}}function D(e,o){switch(e){case"load":return o&&o.stream&&"string"==typeof o.streamingServerURL?(D("unload"),l.dispatch({type:"command",commandName:"unload"}),I=o,p("stream"),s(o.streamingServerURL,o.stream,o.seriesInfo).then((function(e){var a=e.url,n=e.infoHash,E=e.fileIdx,s=Array.isArray(o.formats)?o.formats:_.formats,T=Array.isArray(o.videoCodecs)?o.videoCodecs:_.videoCodecs,S=Array.isArray(o.audioCodecs)?o.audioCodecs:_.audioCodecs,l=null!==o.maxAudioChannels&&isFinite(o.maxAudioChannels)?o.maxAudioChannels:_.maxAudioChannels,u=Object.assign({},o,{formats:s,videoCodecs:T,audioCodecs:S,maxAudioChannels:l});return(o.forceTranscoding?Promise.resolve(!1):t.canPlayStream({url:a},u)).catch((function(e){return console.warn("Media probe error",e),!1})).then((function(e){if(e)return{mediaURL:a,infoHash:n,fileIdx:E,stream:{url:a}};var t=r(),_=new URLSearchParams([["mediaURL",a]]);return o.forceTranscoding&&_.set("forceTranscoding","1"),T.forEach((function(e){_.append("videoCodecs",e)})),S.forEach((function(e){_.append("audioCodecs",e)})),_.set("maxAudioChannels",l),{mediaURL:a,infoHash:n,fileIdx:E,stream:{url:i.resolve(o.streamingServerURL,"/hlsv2/"+t+"/master.m3u8?"+_.toString()),subtitles:Array.isArray(o.stream.subtitles)?o.stream.subtitles.map((function(e){return Object.assign({},e,{url:"string"==typeof e.url?i.resolve(o.streamingServerURL,"/subtitles.vtt?"+new URLSearchParams([["from",e.url]]).toString()):e.url})})):[],behaviorHints:{headers:{"content-type":"application/vnd.apple.mpegurl"}}}}}))})).then((function(e){o===I&&(l.dispatch({type:"command",commandName:"load",commandArgs:Object.assign({},o,{stream:e.stream})}),d=!0,(function(){for(;A.length>0;){var e=A.shift();u.dispatch.call(u,e)}})(),T(o.streamingServerURL,e.mediaURL,e.infoHash,e.fileIdx,o.stream.behaviorHints).then((function(e){o===I&&(c=e,p("videoParams"))})).catch((function(e){o===I&&(console.error(e),c={hash:null,size:null,filename:null},p("videoParams"))})))})).catch((function(e){o===I&&L(Object.assign({},S.WITH_STREAMING_SERVER.CONVERT_FAILED,{error:e,critical:!0,stream:o.stream,streamingServerURL:o.streamingServerURL}))}))):L(Object.assign({},S.UNSUPPORTED_STREAM,{critical:!0,stream:o?o.stream:null,streamingServerURL:o&&"string"==typeof o.streamingServerURL?o.streamingServerURL:null})),!0;case"addExtraSubtitlesTracks":return I&&o&&Array.isArray(o.tracks)&&(d?l.dispatch({type:"command",commandName:"addExtraSubtitlesTracks",commandArgs:Object.assign({},o,{tracks:o.tracks.map((function(e){return Object.assign({},e,{url:"string"==typeof e.url?i.resolve(I.streamingServerURL,"/subtitles.vtt?"+new URLSearchParams([["from",e.url]]).toString()):e.url})}))})}):A.push({type:"command",commandName:"addExtraSubtitlesTracks",commandArgs:o})),!0;case"unload":return I=null,d=!1,A=[],c=null,p("stream"),p("videoParams"),!1;case"destroy":return D("unload"),R=!0,l.dispatch({type:"command",commandName:"destroy"}),O.removeAllListeners(),!0;default:return!d&&(A.push({type:"command",commandName:e,commandArgs:o}),!0)}}this.on=function(e,t){if(R)throw new Error("Video is destroyed");O.on(e,t)},this.dispatch=function(e){if(R)throw new Error("Video is destroyed");if(e)switch((e=E(n(e))).type){case"observeProp":if((function(e){switch(e){case"stream":case"videoParams":return O.emit("propValue",e,h(e,null)),N[e]=!0,!0;default:return!1}})(e.propName))return;break;case"command":if(D(e.commandName,e.commandArgs))return}l.dispatch(e)}}return t.canPlayStream=function(t,o){return e.canPlayStream(t).then((function(e){if(!e)throw new Error("Fallback using /hlsv2/probe");return e})).catch((function(){var e=new URLSearchParams([["mediaURL",t.url]]);return fetch(i.resolve(o.streamingServerURL,"/hlsv2/probe?"+e.toString())).then((function(e){return e.json()})).then((function(e){var t=o.formats.some((function(t){return-1!==e.format.name.indexOf(t)})),a=e.streams.every((function(e){return"audio"===e.track?e.channels<=o.maxAudioChannels&&-1!==o.audioCodecs.indexOf(e.codec):"video"!==e.track||-1!==o.videoCodecs.indexOf(e.codec)}));return t&&a}))}))},t.manifest={name:e.manifest.name+"WithStreamingServer",external:e.manifest.external,props:e.manifest.props.concat(["stream","videoParams"]).filter((function(e,t,o){return o.indexOf(e)===t})),commands:e.manifest.commands.concat(["load","unload","destroy","addExtraSubtitlesTracks"]).filter((function(e,t,o){return o.indexOf(e)===t})),events:e.manifest.events.concat(["propValue","propChanged","error"]).filter((function(e,t,o){return o.indexOf(e)===t}))},t}},29450:(e,t,o)=>{var a=o(6693);e.exports=a},6693:(e,t,o)=>{var a=o(26729),i=o(83465),r=o(62682);e.exports=function(e){function t(t){var o=new e(t=t||{});o.on("propValue",T.bind(null,"propValue")),o.on("propChanged",T.bind(null,"propChanged")),e.manifest.events.filter((function(e){return!["propValue","propChanged"].includes(e)})).forEach((function(e){o.on(e,(function(e){return function(){E.emit.apply(E,[e].concat(Array.from(arguments)))}})(e))}));var n=null,E=new a,_=!1,s={videoParams:!1};function T(e,t,o){"videoParams"!==t&&E.emit(e,t,S(t,o)),"stream"===t&&(n=o,(function(e){s[e]&&E.emit("propChanged",e,S(e,null))})("videoParams"))}function S(e,t){return"videoParams"===e?null===n?null:{hash:n.behaviorHints&&"string"==typeof n.behaviorHints.videoHash?n.behaviorHints.videoHash:null,size:n.behaviorHints&&null!==n.behaviorHints.videoSize&&isFinite(n.behaviorHints.videoSize)?n.behaviorHints.videoSize:null,filename:n.behaviorHints&&"string"==typeof n.behaviorHints.filename?n.behaviorHints.filename:null}:t}this.on=function(e,t){if(_)throw new Error("Video is destroyed");E.on(e,t)},this.dispatch=function(e){if(_)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":if("videoParams"===(a=e.propName)&&(E.emit("propValue",a,S(a,null)),s[a]=!0,1))return;break;case"command":if(t=e.commandName,e.commandArgs,"destroy"===t&&(_=!0,o.dispatch({type:"command",commandName:"destroy"}),E.removeAllListeners(),1))return}var t,a;o.dispatch(e)}}return t.canPlayStream=function(t,o){return e.canPlayStream(t,o)},t.manifest={name:e.manifest.name+"WithVideoParams",external:e.manifest.external,props:e.manifest.props.concat(["videoParams"]).filter((function(e,t,o){return o.indexOf(e)===t})),commands:e.manifest.commands.concat(["destroy"]).filter((function(e,t,o){return o.indexOf(e)===t})),events:e.manifest.events.concat(["propValue","propChanged"]).filter((function(e,t,o){return o.indexOf(e)===t}))},t}},43746:function(e){"undefined"!=typeof self&&self,e.exports=(function(e){var t={};function o(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(a,i,function(t){return e[t]}.bind(null,i));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)})([function(e,t,o){"use strict";var a=o(3);function i(e){return!0===a(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,o;return!1!==i(e)&&"function"==typeof(t=e.constructor)&&!1!==i(o=t.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf")}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.PALETTE_MATERIAL_CHROME=t.PALETTE_MATERIAL_500=t.COLOR_NAMES=t.getLuminance=t.intToRgb=t.rgbToInt=t.rgbToHsv=t.rgbToHsl=t.hslToRgb=t.rgbToHex=t.parseColor=t.parseColorToHsla=t.parseColorToHsl=t.parseColorToRgba=t.parseColorToRgb=t.from=t.createPicker=void 0;var a=(function(){function e(e,t){for(var o=0;o-1,l="undefined"!=typeof window&&window.navigator.userAgent.indexOf("rv:")>-1,u={id:null,attachTo:"body",showHSL:!0,showRGB:!0,showHEX:!0,showAlpha:!1,color:"#ff0000",palette:null,paletteEditable:!1,useAlphaInPalette:"auto",slBarSize:[232,150],hueBarSize:[150,11],alphaBarSize:[150,11]},I="COLOR",d="RGBA_USER",A="HSLA_USER";function c(e,t,o){return e?e instanceof HTMLElement?e:e instanceof NodeList?e[0]:"string"==typeof e?document.querySelector(e):e.jquery?e.get(0):o?t:null:t}function O(e){var t=e.getContext("2d"),o=+e.width,a=+e.height,n=t.createLinearGradient(1,1,1,a-1);return n.addColorStop(0,"white"),n.addColorStop(1,"black"),{setHue:function(e){var i=t.createLinearGradient(1,0,o-1,0);i.addColorStop(0,"hsla("+e+", 100%, 50%, 0)"),i.addColorStop(1,"hsla("+e+", 100%, 50%, 1)"),t.fillStyle=n,t.fillRect(0,0,o,a),t.fillStyle=i,t.globalCompositeOperation="multiply",t.fillRect(0,0,o,a),t.globalCompositeOperation="source-over"},grabColor:function(e,o){return t.getImageData(e,o,1,1).data},findColor:function(e,t,n){var E=(0,r.rgbToHsv)(e,t,n),_=i(E,3),s=_[1],T=_[2];return[s*o,a-T*a]}}}function R(e,t,o){return null===e?t:/^\s*$/.test(e)?o:!!/true|yes|1/i.test(e)||!/false|no|0/i.test(e)&&t}function N(e,t,o){if(null===e)return t;if(/^\s*$/.test(e))return o;var a=e.split(",").map(Number);return 2===a.length&&a[0]&&a[1]?a:t}var m=(function(){function e(t,o){if(s(this,e),o?(t=c(t),this.options=Object.assign({},u,o)):t&&(0,n.default)(t)?(this.options=Object.assign({},u,t),t=c(this.options.attachTo)):(this.options=Object.assign({},u),t=c((0,r.nvl)(t,this.options.attachTo))),!t)throw new Error("Container not found: "+this.options.attachTo);!(function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"acp-";if(t.hasAttribute(o+"show-hsl")&&(e.showHSL=R(t.getAttribute(o+"show-hsl"),u.showHSL,!0)),t.hasAttribute(o+"show-rgb")&&(e.showRGB=R(t.getAttribute(o+"show-rgb"),u.showRGB,!0)),t.hasAttribute(o+"show-hex")&&(e.showHEX=R(t.getAttribute(o+"show-hex"),u.showHEX,!0)),t.hasAttribute(o+"show-alpha")&&(e.showAlpha=R(t.getAttribute(o+"show-alpha"),u.showAlpha,!0)),t.hasAttribute(o+"palette-editable")&&(e.paletteEditable=R(t.getAttribute(o+"palette-editable"),u.paletteEditable,!0)),t.hasAttribute(o+"sl-bar-size")&&(e.slBarSize=N(t.getAttribute(o+"sl-bar-size"),u.slBarSize,[232,150])),t.hasAttribute(o+"hue-bar-size")&&(e.hueBarSize=N(t.getAttribute(o+"hue-bar-size"),u.hueBarSize,[150,11]),e.alphaBarSize=e.hueBarSize),t.hasAttribute(o+"palette")){var a=t.getAttribute(o+"palette");switch(a){case"PALETTE_MATERIAL_500":e.palette=r.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":case"":e.palette=r.PALETTE_MATERIAL_CHROME;break;default:e.palette=a.split(/[;|]/)}}t.hasAttribute(o+"color")&&(e.color=t.getAttribute(o+"color"))})(this.options,t),this.H=0,this.S=0,this.L=0,this.R=0,this.G=0,this.B=0,this.A=1,this.palette={},this.element=document.createElement("div"),this.options.id&&(this.element.id=this.options.id),this.element.className="a-color-picker",this.element.innerHTML=E.default,t.appendChild(this.element);var a=this.element.querySelector(".a-color-picker-h");this.setupHueCanvas(a),this.hueBarHelper=O(a),this.huePointer=this.element.querySelector(".a-color-picker-h+.a-color-picker-dot");var i=this.element.querySelector(".a-color-picker-sl");this.setupSlCanvas(i),this.slBarHelper=O(i),this.slPointer=this.element.querySelector(".a-color-picker-sl+.a-color-picker-dot"),this.preview=this.element.querySelector(".a-color-picker-preview"),this.setupClipboard(this.preview.querySelector(".a-color-picker-clipbaord")),this.options.showHSL?(this.setupInput(this.inputH=this.element.querySelector(".a-color-picker-hsl>input[nameref=H]")),this.setupInput(this.inputS=this.element.querySelector(".a-color-picker-hsl>input[nameref=S]")),this.setupInput(this.inputL=this.element.querySelector(".a-color-picker-hsl>input[nameref=L]"))):this.element.querySelector(".a-color-picker-hsl").remove(),this.options.showRGB?(this.setupInput(this.inputR=this.element.querySelector(".a-color-picker-rgb>input[nameref=R]")),this.setupInput(this.inputG=this.element.querySelector(".a-color-picker-rgb>input[nameref=G]")),this.setupInput(this.inputB=this.element.querySelector(".a-color-picker-rgb>input[nameref=B]"))):this.element.querySelector(".a-color-picker-rgb").remove(),this.options.showHEX?this.setupInput(this.inputRGBHEX=this.element.querySelector("input[nameref=RGBHEX]")):this.element.querySelector(".a-color-picker-rgbhex").remove(),this.options.paletteEditable||this.options.palette&&this.options.palette.length>0?this.setPalette(this.paletteRow=this.element.querySelector(".a-color-picker-palette")):(this.paletteRow=this.element.querySelector(".a-color-picker-palette"),this.paletteRow.remove()),this.options.showAlpha?(this.setupAlphaCanvas(this.element.querySelector(".a-color-picker-a")),this.alphaPointer=this.element.querySelector(".a-color-picker-a+.a-color-picker-dot")):this.element.querySelector(".a-color-picker-alpha").remove(),this.element.style.width=this.options.slBarSize[0]+"px",this.onValueChanged(I,this.options.color)}return a(e,[{key:"setupHueCanvas",value:function(e){var t=this;e.width=this.options.hueBarSize[0],e.height=this.options.hueBarSize[1];for(var o=e.getContext("2d"),a=o.createLinearGradient(0,0,this.options.hueBarSize[0],0),i=0;i<=1;i+=1/360)a.addColorStop(i,"hsl("+360*i+", 100%, 50%)");o.fillStyle=a,o.fillRect(0,0,this.options.hueBarSize[0],this.options.hueBarSize[1]);var n=function(o){var a=(0,r.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.hueBarSize[0]),i=Math.round(360*a/t.options.hueBarSize[0]);t.huePointer.style.left=a-7+"px",t.onValueChanged("H",i)},E=function e(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){n(e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",E)}))}},{key:"setupSlCanvas",value:function(e){var t=this;e.width=this.options.slBarSize[0],e.height=this.options.slBarSize[1];var o=function(o){var a=(0,r.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.slBarSize[0]-1),i=(0,r.limit)(o.clientY-e.getBoundingClientRect().top,0,t.options.slBarSize[1]-1),n=t.slBarHelper.grabColor(a,i);t.slPointer.style.left=a-7+"px",t.slPointer.style.top=i-7+"px",t.onValueChanged("RGB",n)},a=function e(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){o(e),document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}))}},{key:"setupAlphaCanvas",value:function(e){var t=this;e.width=this.options.alphaBarSize[0],e.height=this.options.alphaBarSize[1];var o=e.getContext("2d"),a=o.createLinearGradient(0,0,e.width-1,0);a.addColorStop(0,"hsla(0, 0%, 50%, 0)"),a.addColorStop(1,"hsla(0, 0%, 50%, 1)"),o.fillStyle=a,o.fillRect(0,0,this.options.alphaBarSize[0],this.options.alphaBarSize[1]);var i=function(o){var a=(0,r.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.alphaBarSize[0]),i=+(a/t.options.alphaBarSize[0]).toFixed(2);t.alphaPointer.style.left=a-7+"px",t.onValueChanged("ALPHA",i)},n=function e(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){i(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)}))}},{key:"setupInput",value:function(e){var t=this,o=+e.min,a=+e.max,i=e.getAttribute("nameref");e.hasAttribute("select-on-focus")&&e.addEventListener("focus",(function(){e.select()})),"text"===e.type?e.addEventListener("change",(function(){t.onValueChanged(i,e.value)})):((S||l)&&e.addEventListener("keydown",(function(n){"Up"===n.key?(e.value=(0,r.limit)(+e.value+1,o,a),t.onValueChanged(i,e.value),n.returnValue=!1):"Down"===n.key&&(e.value=(0,r.limit)(+e.value-1,o,a),t.onValueChanged(i,e.value),n.returnValue=!1)})),e.addEventListener("change",(function(){var n=+e.value;t.onValueChanged(i,(0,r.limit)(n,o,a))})))}},{key:"setupClipboard",value:function(e){var t=this;e.title="click to copy",e.addEventListener("click",(function(){e.value=(0,r.parseColor)([t.R,t.G,t.B,t.A],"hexcss4"),e.select(),document.execCommand("copy")}))}},{key:"setPalette",value:function(e){var t=this,o="auto"===this.options.useAlphaInPalette?this.options.showAlpha:this.options.useAlphaInPalette,a=null;switch(this.options.palette){case"PALETTE_MATERIAL_500":a=r.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":a=r.PALETTE_MATERIAL_CHROME;break;default:a=(0,r.ensureArray)(this.options.palette)}if(this.options.paletteEditable||a.length>0){var i=function(o,a,i){var r=e.querySelector('.a-color-picker-palette-color[data-color="'+o+'"]')||document.createElement("div");r.className="a-color-picker-palette-color",r.style.backgroundColor=o,r.setAttribute("data-color",o),r.title=o,e.insertBefore(r,a),t.palette[o]=!0,i&&t.onPaletteColorAdd(o)},n=function(o,a){o?(e.removeChild(o),t.palette[o.getAttribute("data-color")]=!1,a&&t.onPaletteColorRemove(o.getAttribute("data-color"))):(e.querySelectorAll(".a-color-picker-palette-color[data-color]").forEach((function(t){e.removeChild(t)})),Object.keys(t.palette).forEach((function(e){t.palette[e]=!1})),a&&t.onPaletteColorRemove())};if(a.map((function(e){return(0,r.parseColor)(e,o?"rgbcss4":"hex")})).filter((function(e){return!!e})).forEach((function(e){return i(e)})),this.options.paletteEditable){var E=document.createElement("div");E.className="a-color-picker-palette-color a-color-picker-palette-add",E.innerHTML="+",e.appendChild(E),e.addEventListener("click",(function(e){/a-color-picker-palette-add/.test(e.target.className)?e.shiftKey?n(null,!0):i(o?(0,r.parseColor)([t.R,t.G,t.B,t.A],"rgbcss4"):(0,r.rgbToHex)(t.R,t.G,t.B),e.target,!0):/a-color-picker-palette-color/.test(e.target.className)&&(e.shiftKey?n(e.target,!0):t.onValueChanged(I,e.target.getAttribute("data-color")))}))}else e.addEventListener("click",(function(e){/a-color-picker-palette-color/.test(e.target.className)&&t.onValueChanged(I,e.target.getAttribute("data-color"))}))}else e.style.display="none"}},{key:"updatePalette",value:function(e){this.paletteRow.innerHTML="",this.palette={},this.paletteRow.parentElement||this.element.appendChild(this.paletteRow),this.options.palette=e,this.setPalette(this.paletteRow)}},{key:"onValueChanged",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{silent:!1};switch(e){case"H":this.H=t;var a=(0,r.hslToRgb)(this.H,this.S,this.L),n=i(a,3);this.R=n[0],this.G=n[1],this.B=n[2],this.slBarHelper.setHue(t),this.updatePointerH(this.H),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"S":this.S=t;var E=(0,r.hslToRgb)(this.H,this.S,this.L),_=i(E,3);this.R=_[0],this.G=_[1],this.B=_[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"L":this.L=t;var s=(0,r.hslToRgb)(this.H,this.S,this.L),T=i(s,3);this.R=T[0],this.G=T[1],this.B=T[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"R":this.R=t;var S=(0,r.rgbToHsl)(this.R,this.G,this.B),l=i(S,3);this.H=l[0],this.S=l[1],this.L=l[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"G":this.G=t;var u=(0,r.rgbToHsl)(this.R,this.G,this.B),c=i(u,3);this.H=c[0],this.S=c[1],this.L=c[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"B":this.B=t;var O=(0,r.rgbToHsl)(this.R,this.G,this.B),R=i(O,3);this.H=R[0],this.S=R[1],this.L=R[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"RGB":var N=i(t,3);this.R=N[0],this.G=N[1],this.B=N[2];var m=(0,r.rgbToHsl)(this.R,this.G,this.B),p=i(m,3);this.H=p[0],this.S=p[1],this.L=p[2],this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case d:var L=i(t,4);this.R=L[0],this.G=L[1],this.B=L[2],this.A=L[3];var h=(0,r.rgbToHsl)(this.R,this.G,this.B),D=i(h,3);this.H=D[0],this.S=D[1],this.L=D[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case A:var f=i(t,4);this.H=f[0],this.S=f[1],this.L=f[2],this.A=f[3];var C=(0,r.hslToRgb)(this.H,this.S,this.L),g=i(C,3);this.R=g[0],this.G=g[1],this.B=g[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"RGBHEX":var B=(0,r.cssColorToRgb)(t)||[this.R,this.G,this.B],P=i(B,3);this.R=P[0],this.G=P[1],this.B=P[2];var v=(0,r.rgbToHsl)(this.R,this.G,this.B),y=i(v,3);this.H=y[0],this.S=y[1],this.L=y[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B);break;case I:var M=(0,r.parseColor)(t,"rgba")||[0,0,0,1],W=i(M,4);this.R=W[0],this.G=W[1],this.B=W[2],this.A=W[3];var b=(0,r.rgbToHsl)(this.R,this.G,this.B),U=i(b,3);this.H=U[0],this.S=U[1],this.L=U[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"ALPHA":this.A=t}1===this.A?this.preview.style.backgroundColor="rgb("+this.R+","+this.G+","+this.B+")":this.preview.style.backgroundColor="rgba("+this.R+","+this.G+","+this.B+","+this.A+")",o&&o.silent||this.onchange&&this.onchange(this.preview.style.backgroundColor)}},{key:"onPaletteColorAdd",value:function(e){this.oncoloradd&&this.oncoloradd(e)}},{key:"onPaletteColorRemove",value:function(e){this.oncolorremove&&this.oncolorremove(e)}},{key:"updateInputHSL",value:function(e,t,o){this.options.showHSL&&(this.inputH.value=e,this.inputS.value=t,this.inputL.value=o)}},{key:"updateInputRGB",value:function(e,t,o){this.options.showRGB&&(this.inputR.value=e,this.inputG.value=t,this.inputB.value=o)}},{key:"updateInputRGBHEX",value:function(e,t,o){this.options.showHEX&&(this.inputRGBHEX.value=(0,r.rgbToHex)(e,t,o))}},{key:"updatePointerH",value:function(e){var t=this.options.hueBarSize[0]*e/360;this.huePointer.style.left=t-7+"px"}},{key:"updatePointerSL",value:function(e,t,o){var a=(0,r.hslToRgb)(e,t,o),n=i(a,3),E=n[0],_=n[1],s=n[2],T=this.slBarHelper.findColor(E,_,s),S=i(T,2),l=S[0],u=S[1];l>=0&&(this.slPointer.style.left=l-7+"px",this.slPointer.style.top=u-7+"px")}},{key:"updatePointerA",value:function(e){if(this.options.showAlpha){var t=this.options.alphaBarSize[0]*e;this.alphaPointer.style.left=t-7+"px"}}}]),e})(),p=(function(){function e(t){s(this,e),this.name=t,this.listeners=[]}return a(e,[{key:"on",value:function(e){e&&this.listeners.push(e)}},{key:"off",value:function(e){this.listeners=e?this.listeners.filter((function(t){return t!==e})):[]}},{key:"emit",value:function(e,t){for(var o=this.listeners.slice(0),a=0;a1&&void 0!==arguments[1]&&arguments[1];o.onValueChanged(I,e,{silent:t})},get all(){if(n){var e=[o.R,o.G,o.B,o.A],t=o.A<1?"rgba("+o.R+","+o.G+","+o.B+","+o.A+")":r.rgbToHex.apply(void 0,e);(E=(0,r.parseColor)(e,E)).toString=function(){return t},n=!1}return Object.assign({},E)},get onchange(){return a.change&&a.change.listeners[0]},set onchange(e){this.off("change").on("change",e)},get oncoloradd(){return a.coloradd&&a.coloradd.listeners[0]},set oncoloradd(e){this.off("coloradd").on("coloradd",e)},get oncolorremove(){return a.colorremove&&a.colorremove.listeners[0]},set oncolorremove(e){this.off("colorremove").on("colorremove",e)},get palette(){return Object.keys(o.palette).filter((function(e){return o.palette[e]}))},set palette(e){o.updatePalette(e)},show:function(){o.element.classList.remove("hidden")},hide:function(){o.element.classList.add("hidden")},toggle:function(){o.element.classList.toggle("hidden")},on:function(e,t){return e&&a[e]&&a[e].on(t),this},off:function(e,t){return e&&a[e]&&a[e].off(t),this},destroy:function(){a.change.off(),a.coloradd.off(),a.colorremove.off(),o.element.remove(),a=null,o=null}};return o.onchange=function(){for(var e=arguments.length,t=Array(e),o=0;ostyle[data-source="a-color-picker"]')){var h=o(5).toString(),D=document.createElement("style");D.setAttribute("type","text/css"),D.setAttribute("data-source","a-color-picker"),D.innerHTML=h,document.querySelector("head").appendChild(D)}t.createPicker=L,t.from=function(e,t){var o=(function(e){return e?Array.isArray(e)?e:e instanceof HTMLElement?[e]:e instanceof NodeList?[].concat(T(e)):"string"==typeof e?[].concat(T(document.querySelectorAll(e))):e.jquery?e.get():[]:[]})(e).map((function(e,o){var a=L(e,t);return a.index=o,a}));return o.on=function(e,t){return o.forEach((function(o){return o.on(e,t)})),this},o.off=function(e){return o.forEach((function(t){return t.off(e)})),this},o},t.parseColorToRgb=r.parseColorToRgb,t.parseColorToRgba=r.parseColorToRgba,t.parseColorToHsl=r.parseColorToHsl,t.parseColorToHsla=r.parseColorToHsla,t.parseColor=r.parseColor,t.rgbToHex=r.rgbToHex,t.hslToRgb=r.hslToRgb,t.rgbToHsl=r.rgbToHsl,t.rgbToHsv=r.rgbToHsv,t.rgbToInt=r.rgbToInt,t.intToRgb=r.intToRgb,t.getLuminance=r.getLuminance,t.COLOR_NAMES=r.COLOR_NAMES,t.PALETTE_MATERIAL_500=r.PALETTE_MATERIAL_500,t.PALETTE_MATERIAL_CHROME=r.PALETTE_MATERIAL_CHROME,t.VERSION="1.2.1"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nvl=t.ensureArray=t.limit=t.getLuminance=t.parseColor=t.parseColorToHsla=t.parseColorToHsl=t.cssHslaToHsla=t.cssHslToHsl=t.parseColorToRgba=t.parseColorToRgb=t.cssRgbaToRgba=t.cssRgbToRgb=t.cssColorToRgba=t.cssColorToRgb=t.intToRgb=t.rgbToInt=t.rgbToHsv=t.rgbToHsl=t.hslToRgb=t.rgbToHex=t.PALETTE_MATERIAL_CHROME=t.PALETTE_MATERIAL_500=t.COLOR_NAMES=void 0;var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return(function(e,t){var o=[],a=!0,i=!1,r=void 0;try{for(var n,E=e[Symbol.iterator]();!(a=(n=E.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{!a&&E.return&&E.return()}finally{if(i)throw r}}return o})(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=(function(e){return e&&e.__esModule?e:{default:e}})(o(0));function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);to?o:e}function _(e,t){return null==e?t:e}function s(e,t,o){var a=[E(e,0,255),E(t,0,255),E(o,0,255)];return"#"+("000000"+((e=a[0])<<16|(t=a[1])<<8|(o=a[2])).toString(16)).slice(-6)}function T(e,t,o){var a=void 0,i=void 0,r=void 0,n=[E(e,0,360)/360,E(t,0,100)/100,E(o,0,100)/100];if(e=n[0],o=n[2],0==(t=n[1]))a=i=r=o;else{var _=function(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e},s=o<.5?o*(1+t):o+t-o*t,T=2*o-s;a=_(T,s,e+1/3),i=_(T,s,e),r=_(T,s,e-1/3)}return[255*a,255*i,255*r].map(Math.round)}function S(e,t,o){var a=[E(e,0,255)/255,E(t,0,255)/255,E(o,0,255)/255];e=a[0],t=a[1],o=a[2];var i=Math.max(e,t,o),r=Math.min(e,t,o),n=void 0,_=void 0,s=(i+r)/2;if(i==r)n=_=0;else{var T=i-r;switch(_=s>.5?T/(2-i-r):T/(i+r),i){case e:n=(t-o)/T+(t>16&255,e>>8&255,255&e]},t.cssColorToRgb=u,t.cssColorToRgba=I,t.cssRgbToRgb=d,t.cssRgbaToRgba=A,t.parseColorToRgb=function(e){return Array.isArray(e)?e=[E(e[0],0,255),E(e[1],0,255),E(e[2],0,255)]:u(e)||d(e)},t.parseColorToRgba=c,t.cssHslToHsl=O,t.cssHslaToHsla=R,t.parseColorToHsl=function(e){return Array.isArray(e)?e=[E(e[0],0,360),E(e[1],0,100),E(e[2],0,100)]:O(e)},t.parseColorToHsla=N,t.parseColor=function(e,t){if(t=t||"rgb",null!=e){var o=void 0;if((o=c(e))||(o=N(e))&&(o=[].concat(r(T.apply(void 0,r(o))),[o[3]])))return(0,i.default)(t)?["rgb","rgbcss","rgbcss4","rgba","rgbacss","hsl","hslcss","hslcss4","hsla","hslacss","hex","hexcss4","int"].reduce((function(e,t){return e[t]=m(o,t),e}),t||{}):m(o,t.toString().toLowerCase())}},t.getLuminance=function(e,t,o){return.2126*(e=(e/=255)<.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=(t/=255)<.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((o/=255)<.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},t.limit=E,t.ensureArray=function(e){return e?Array.from(e):[]},t.nvl=_},function(e,t,o){"use strict";e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t){e.exports='
'},function(e,t,o){var a=o(6);e.exports="string"==typeof a?a:a.toString()},function(e,t,o){(e.exports=o(7)(!1)).push([e.i,"/*!\n * a-color-picker\n * https://github.com/narsenico/a-color-picker\n *\n * Copyright (c) 2017-2018, Gianfranco Caldi.\n * Released under the MIT License.\n */.a-color-picker{background-color:#fff;padding:0;display:inline-flex;flex-direction:column;user-select:none;width:232px;font:400 10px Helvetica,Arial,sans-serif;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px rgba(0,0,0,.25)}.a-color-picker,.a-color-picker-row,.a-color-picker input{box-sizing:border-box}.a-color-picker-row{padding:15px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;user-select:none}.a-color-picker-row-top{padding:0}.a-color-picker-row:not(:first-child){border-top:1px solid #f5f5f5}.a-color-picker-column{display:flex;flex-direction:column}.a-color-picker-cell{flex:1 1 auto;margin-bottom:4px}.a-color-picker-cell:last-child{margin-bottom:0}.a-color-picker-stack{position:relative}.a-color-picker-dot{position:absolute;width:14px;height:14px;top:0;left:0;background:#fff;pointer-events:none;border-radius:50px;z-index:1000;box-shadow:0 1px 2px rgba(0,0,0,.75)}.a-color-picker-a,.a-color-picker-h,.a-color-picker-sl{cursor:cell}.a-color-picker-a+.a-color-picker-dot,.a-color-picker-h+.a-color-picker-dot{top:-2px}.a-color-picker-a,.a-color-picker-h{border-radius:2px}.a-color-picker-preview{box-sizing:border-box;width:30px;height:30px;user-select:none;border-radius:15px}.a-color-picker-circle{border-radius:50px;border:1px solid #eee}.a-color-picker-hsl,.a-color-picker-rgb,.a-color-picker-single-input{justify-content:space-evenly}.a-color-picker-hsl>label,.a-color-picker-rgb>label,.a-color-picker-single-input>label{padding:0 8px;flex:0 0 auto;color:#969696}.a-color-picker-hsl>input,.a-color-picker-rgb>input,.a-color-picker-single-input>input{text-align:center;padding:2px 0;width:0;flex:1 1 auto;border:1px solid #e0e0e0;line-height:20px}.a-color-picker-hsl>input::-webkit-inner-spin-button,.a-color-picker-rgb>input::-webkit-inner-spin-button,.a-color-picker-single-input>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.a-color-picker-hsl>input:focus,.a-color-picker-rgb>input:focus,.a-color-picker-single-input>input:focus{border-color:#04a9f4;outline:none}.a-color-picker-transparent{background-image:linear-gradient(-45deg,#cdcdcd 25%,transparent 0),linear-gradient(45deg,#cdcdcd 25%,transparent 0),linear-gradient(-45deg,transparent 75%,#cdcdcd 0),linear-gradient(45deg,transparent 75%,#cdcdcd 0);background-size:11px 11px;background-position:0 0,0 -5.5px,-5.5px 5.5px,5.5px 0}.a-color-picker-sl{border-radius:3px 3px 0 0}.a-color-picker.hide-alpha [show-on-alpha],.a-color-picker.hide-hsl [show-on-hsl],.a-color-picker.hide-rgb [show-on-rgb],.a-color-picker.hide-single-input [show-on-single-input]{display:none}.a-color-picker-clipbaord{width:100%;height:100%;opacity:0;cursor:pointer}.a-color-picker-palette{flex-flow:wrap;flex-direction:row;justify-content:flex-start;padding:10px}.a-color-picker-palette-color{width:15px;height:15px;flex:0 1 15px;margin:3px;box-sizing:border-box;cursor:pointer;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.a-color-picker-palette-add{text-align:center;line-height:13px;color:#607d8b}.a-color-picker.hidden{display:none}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=(function(e,t){var o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var i=(function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"})(a),r=a.sources.map((function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"}));return[o].concat(r).concat([i]).join("\n")}return[o].join("\n")})(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o})).join("")},t.i=function(e,o){"string"==typeof e&&(e=[[null,e,""]]);for(var a={},i=0;i{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(81341);e.exports=a},59239:(e,t,o)=>{var a=o(67294),i=o(63662).useServices,r=o(86590).useToast;e.exports=function(){var e=i(),t=e.core,o=e.dragAndDrop,n=r();return a.useEffect((function(){var e=function(e){var t=e.event,o=e.args;switch(t){case"Error":if("UserPulledFromAPI"===o.source.event&&null===o.source.args.uid)break;if("LibrarySyncWithAPIPlanned"===o.source.event&&null===o.source.args.uid)break;if("Other"===o.error.type&&3===o.error.code&&"AddonInstalled"===o.source.event&&o.source.args.transport_url.startsWith("https://www.strem.io/trakt/addon"))break;n.show({type:"error",title:o.source.event,message:o.error.message,timeout:4e3,dataset:{type:"CoreEvent"}});break;case"TorrentParsed":n.show({type:"success",title:"Torrent file parsed",timeout:4e3});break;case"MagnetParsed":n.show({type:"success",title:"Magnet link parsed",timeout:4e3});break;case"PlayingOnDevice":n.show({type:"success",title:"Stream opened in ".concat(o.device),timeout:4e3})}},a=function(e){var t;n.show({type:"error",title:e.message,message:null===(t=e.file)||void 0===t?void 0:t.name,timeout:4e3})};return t.transport.on("CoreEvent",e),o.on("error",a),function(){t.transport.off("CoreEvent",e),o.off("error",a)}}),[]),null}},4008:(e,t,o)=>{var a=o(5677);e.exports=a},49884:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(29872),_=o(88135),s=function(e){var t=e.className,o=e.id,i=e.name,s=e.version,T=e.logo,S=e.description,l=e.types,u=e.transportUrl,I=e.official,d=a.useCallback((function(){return a.createElement(n,{className:_.icon,name:"addons"})}),[]);return a.createElement("div",{className:r(t,_["addon-details-container"])},a.createElement("div",{className:_["title-container"]},a.createElement(E,{className:_.logo,src:T,alt:" ",renderFallback:d}),a.createElement("div",{className:_["name-container"]},a.createElement("span",{className:_.name},"string"==typeof i&&i.length>0?i:o),"string"==typeof s&&s.length>0?a.createElement("span",{className:_.version},"v. ",s):null)),"string"==typeof S&&S.length>0?a.createElement("div",{className:_["section-container"]},a.createElement("span",{className:_["section-label"]},S)):null,"string"==typeof u&&u.length>0?a.createElement("div",{className:_["section-container"]},a.createElement("span",{className:_["section-header"]},"URL: "),a.createElement("span",{className:r(_["section-label"],_["transport-url-label"])},u)):null,Array.isArray(l)&&l.length>0?a.createElement("div",{className:_["section-container"]},a.createElement("span",{className:_["section-header"]},"Supported types: "),a.createElement("span",{className:_["section-label"]},1===l.length?l[0]:l.slice(0,-1).join(", ")+" & "+l[l.length-1])):null,I?null:a.createElement("div",{className:_["section-container"]},a.createElement("div",{className:r(_["section-label"],_["disclaimer-label"])},"Using third-party add-ons will always be subject to your responsibility and the governing law of the jurisdiction you are located.")))};s.propTypes={className:i.string,id:i.string,name:i.string,version:i.string,logo:i.string,description:i.string,types:i.arrayOf(i.string),transportUrl:i.string,official:i.bool},e.exports=s},45368:(e,t,o)=>{var a=o(95471);e.exports=a},88029:(e,t,o)=>{var a=["remoteAddon","localAddon"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(58253),s=o(36672).withCoreSuspender,T=o(63662).useServices,S=(function(e){var t=function(t){var o=t.remoteAddon,E=t.localAddon,_=r(t,a),s=null!==o&&"Ready"===o.content.type?o.content.content:null!==E?E:null;return null===s?null:n.createElement(e,i({},_,{id:s.manifest.id,name:s.manifest.name,version:s.manifest.version,logo:s.manifest.logo,description:s.manifest.description,types:s.manifest.types,transportUrl:s.transportUrl,official:s.flags.official}))};return t.displayName="withRemoteAndLocalAddon",t})(o(45368)),l=o(29208),u=o(60355);var I=function(e){var t=e.transportUrl,o=e.onCloseRequest,a=T().core,i=l(t),r=n.useMemo((function(){var e={className:u["cancel-button"],label:"Cancel",props:{onClick:function(e){"function"==typeof o&&o({type:"cancel",reactEvent:e,nativeEvent:e.nativeEvent})}}},r=null!==i.remoteAddon&&"Ready"===i.remoteAddon.content.type&&i.remoteAddon.content.content.manifest.behaviorHints.configurable?{className:u["configure-button"],label:"Configure",props:{onClick:function(e){window.open(t.replace("manifest.json","configure")),"function"==typeof o&&o({type:"configure",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null,n=null!==i.localAddon?{className:u["uninstall-button"],label:"Uninstall",props:{onClick:function(e){a.transport.dispatch({action:"Ctx",args:{action:"UninstallAddon",args:i.localAddon}}),"function"==typeof o&&o({type:"uninstall",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null!==i.remoteAddon&&"Ready"===i.remoteAddon.content.type?{className:u["install-button"],label:"Install",props:{onClick:function(e){a.transport.dispatch({action:"Ctx",args:{action:"InstallAddon",args:i.remoteAddon.content.content}}),"function"==typeof o&&o({type:"install",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null;return null!==n?r?[e,r,n]:[e,n]:[e]}),[i,o]);return n.createElement(_,{className:u["addon-details-modal-container"],title:"Stremio addon",buttons:r,onCloseRequest:o},null===i.selected?n.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest"):null===i.remoteAddon||"Loading"===i.remoteAddon.content.type?n.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest from ",i.selected.transportUrl):"Err"===i.remoteAddon.content.type&&null===i.localAddon?n.createElement("div",{className:u["addon-details-message-container"]},"Failed to get addon manifest from ",i.selected.transportUrl,n.createElement("div",null,i.remoteAddon.content.content.message)):n.createElement(S,{className:u["addon-details-container"],remoteAddon:i.remoteAddon,localAddon:i.localAddon}))};I.propTypes={transportUrl:E.string,onCloseRequest:E.func};var d=function(e){var t=e.onCloseRequest;return n.createElement(_,{className:u["addon-details-modal-container"],title:"Stremio addon",onCloseRequest:t},n.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest"))};d.propTypes=I.propTypes,e.exports=s(I,d)},58512:(e,t,o)=>{var a=o(88029);e.exports=a},29208:(e,t,o)=>{var a=o(67294),i=o(71535);e.exports=function(e){var t=a.useMemo((function(){return"string"==typeof e?{action:"Load",args:{model:"AddonDetails",args:{transportUrl:e}}}:{action:"Unload"}}),[e]);return i({model:"addon_details",action:t})}},67458:(e,t,o)=>{var a=["className","href","disabled","children","onLongPress"];function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function r(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(74520),l=o(20243).useLongPress,u=_.forwardRef((function(e,t){var o=e.className,i=e.href,n=e.disabled,s=e.children,u=e.onLongPress,I=E(e,a),d=l(u,{detect:"pointer"}),A=_.useCallback((function(e){"function"==typeof I.onKeyDown&&I.onKeyDown(e),"Enter"===e.key&&(e.preventDefault(),e.nativeEvent.buttonClickPrevented||e.currentTarget.click())}),[I.onKeyDown]),c=_.useCallback((function(e){"function"==typeof I.onMouseDown&&I.onMouseDown(e),e.nativeEvent.buttonBlurPrevented||(e.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur())}),[I.onMouseDown]);return _.createElement("string"==typeof i&&i.length>0?"a":"div",r(r({tabIndex:0},I),{},{ref:t,className:T(o,S["button-container"],{disabled:n}),href:i,onKeyDown:A,onMouseDown:c},d()),s)}));u.displayName="Button",u.propTypes={className:s.string,href:s.string,disabled:s.bool,children:s.node,onKeyDown:s.func,onMouseDown:s.func,onLongPress:s.func},e.exports=u},6851:(e,t,o)=>{var a=o(67458);e.exports=a},52734:e=>{var t={movie:10,series:9,channel:8,tv:7,music:6,radio:5,podcast:4,game:3,book:2,adult:1,other:-1/0},o=new Map([["movie","movies"],["series","series"],["channel","channels"],["tv","tv"],["book","ic_book"],["game","ic_games"],["music","ic_music"],["adult","ic_adult"],["radio","ic_radio"],["podcast","ic_podcast"],["other","movies"]]);e.exports={CHROMECAST_RECEIVER_APP_ID:"1634F54B",SUBTITLES_SIZES:[75,100,125,150,175,200,250],SUBTITLES_FONTS:["PlusJakartaSans","Arial","Halvetica","Times New Roman","Verdana","Courier","Lucida Console","sans-serif","serif","monospace"],SEEK_TIME_DURATIONS:[3e3,5e3,1e4,15e3,2e4,3e4],NEXT_VIDEO_POPUP_DURATIONS:[0,5e3,1e4,15e3,2e4,25e3,3e4,35e3,4e4,45e3,5e4,55e3,6e4,65e3,7e4,75e3,8e4,85e3,9e4],CATALOG_PREVIEW_SIZE:10,CATALOG_PAGE_SIZE:100,NONE_EXTRA_VALUE:"None",SKIP_EXTRA_NAME:"skip",META_LINK_CATEGORY:"meta",IMDB_LINK_CATEGORY:"imdb",SHARE_LINK_CATEGORY:"share",WRITERS_LINK_CATEGORY:"Writers",TYPE_PRIORITIES:t,ICON_FOR_TYPE:o,EXTERNAL_PLAYERS:[{label:"EXTERNAL_PLAYER_DISABLED",value:null,platforms:["ios","android","windows","linux","macos"]},{label:"EXTERNAL_PLAYER_ALLOW_CHOOSING",value:"choose",platforms:["android"]},{label:"VLC",value:"vlc",platforms:["ios","android"]},{label:"MPV",value:"mpv",platforms:["macos"]},{label:"IINA",value:"iina",platforms:["macos"]},{label:"MX Player",value:"mxplayer",platforms:["android"]},{label:"Just Player",value:"justplayer",platforms:["android"]},{label:"Outplayer",value:"outplayer",platforms:["ios"]}]}},83064:(e,t,o)=>{var a=["className","checked","children"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(94184),s=o(6851),T=o(41726),S=n.forwardRef((function(e,t){var o=e.className,E=e.checked,S=e.children,l=r(e,a);return n.createElement(s,i({},l,{ref:t,className:_(o,T["checkbox-container"],{checked:E})}),n.createElement("div",{className:T.toggle}),S)}));S.displayName="Checkbox",S.propTypes={className:E.string,checked:E.bool,children:E.node},e.exports=S},49666:(e,t,o)=>{var a=o(83064);e.exports=a},54750:(e,t,o)=>{var a=["className","value","dataset","onChange"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(43746),l=o(81468).useTranslation,u=o(6851),I=o(58253),d=o(74024),A=o(57711),c=o(5461),O=function(e){var t=S.parseColor(e,"hexcss4");return"string"==typeof t?t:"#ffffffff"},R=function(e){var t=e.className,o=e.value,n=e.dataset,s=e.onChange,S=E(e,a),R=l().t,N=r(d(!1),3),m=N[0],p=N[1],L=N[2],h=r(_.useState((function(){return O(o)})),2),D=h[0],f=h[1],C=_.useMemo((function(){return{backgroundColor:o}}),[o]),g=_.useMemo((function(){return O(o).endsWith("00")}),[o]),B=_.useCallback((function(e){"function"==typeof S.onClick&&S.onClick(e),e.nativeEvent.openModalPrevented||p()}),[S.onClick]),P=_.useCallback((function(e){e.nativeEvent.openModalPrevented=!0}),[]),v=_.useMemo((function(){return[{label:"Select",props:{"data-autofocus":!0,onClick:function(e){"function"==typeof s&&s({type:"change",value:D,dataset:n,reactEvent:e,nativeEvent:e.nativeEvent}),L()}}}]}),[D,n,s]),y=_.useCallback((function(e){f(O(e.value))}),[]);return _.useLayoutEffect((function(){f(O(o))}),[o,m]),_.createElement(u,i({title:g?R("BUTTON_COLOR_TRANSPARENT"):o},S,{style:C,className:T(t,c["color-input-container"]),onClick:B}),g?_.createElement("div",{className:c["transparent-label-container"]},_.createElement("div",{className:c["transparent-label"]},R("BUTTON_COLOR_TRANSPARENT"))):null,m?_.createElement(I,{title:"Choose a color:",buttons:v,onCloseRequest:L,onClick:P},_.createElement(A,{className:c["color-picker-container"],value:D,onInput:y})):null)};R.propTypes={className:s.string,value:s.string,dataset:s.object,onChange:s.func,onClick:s.func},e.exports=R},73378:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(43746),E=o(74809),_=function(e){return n.parseColor(e,"hexcss4")},s=function(e){var t=e.className,o=e.value,i=e.onInput,s=a.useRef(null),T=a.useRef(null);return a.useLayoutEffect((function(){s.current=n.createPicker(T.current,{color:_(o),showHSL:!1,showHEX:!1,showRGB:!1,showAlpha:!0});var e=T.current.querySelector(".a-color-picker-clipbaord");e instanceof HTMLElement&&(e.tabIndex=-1)}),[]),a.useLayoutEffect((function(){return"function"==typeof i&&s.current.on("change",(function(e,t){i({type:"input",value:_(t)})})),function(){s.current.off("change")}}),[i]),a.useLayoutEffect((function(){var e=_(o);e!==_(s.current.color)&&(s.current.color=e)}),[o]),a.createElement("div",{ref:T,className:r(t,E["color-picker-container"])})};s.propTypes={className:i.string,value:i.string,onInput:i.func},e.exports=s},57711:(e,t,o)=>{var a=o(73378);e.exports=a},28809:(e,t,o)=>{var a=o(54750);e.exports=a},16306:(e,t,o)=>{var a=["_id","deepLinks"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(63662).useServices,s=o(7049),T=o(35748),S=function(e){var t=e._id,o=e.deepLinks,E=r(e,a),S=_().core,l=s(),u=n.useMemo((function(){var e,o,a,i=null!==(e=null===(o=l.items)||void 0===o||null===(a=o[t])||void 0===a?void 0:a.length)&&void 0!==e?e:0;return Math.min(Math.max(i,0),99)}),[t,l.items]),I=n.useCallback((function(){var e,t;(null!==(e=null==o?void 0:o.metaDetailsVideos)&&void 0!==e?e:null==o?void 0:o.metaDetailsStreams)&&(window.location=null!==(t=null==o?void 0:o.metaDetailsVideos)&&void 0!==t?t:null==o?void 0:o.metaDetailsStreams)}),[o]),d=n.useCallback((function(e){var t,a,i,r;(e.stopPropagation(),null!==(t=null!==(a=null==o?void 0:o.player)&&void 0!==a?a:null==o?void 0:o.metaDetailsStreams)&&void 0!==t?t:null==o?void 0:o.metaDetailsVideos)&&(window.location=null!==(i=null!==(r=null==o?void 0:o.player)&&void 0!==r?r:null==o?void 0:o.metaDetailsStreams)&&void 0!==i?i:null==o?void 0:o.metaDetailsVideos)}),[o]),A=n.useCallback((function(e){e.stopPropagation(),"string"==typeof t&&(S.transport.dispatch({action:"Ctx",args:{action:"RewindLibraryItem",args:t}}),S.transport.dispatch({action:"Ctx",args:{action:"DismissNotificationItem",args:t}}))}),[t]);return n.createElement(T,i({},E,{posterChangeCursor:!0,newVideos:u,onClick:I,onPlayClick:d,onDismissClick:A}))};S.propTypes={_id:E.string,deepLinks:E.shape({metaDetailsVideos:E.string,metaDetailsStreams:E.string,player:E.string})},e.exports=S},63418:(e,t,o)=>{var a=o(16306);e.exports=a},36672:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:function(){};return function(o){var i=n().core,T=s(),S=a(r.useState(null===T),2),l=S[0],u=S[1],I=r.useRef({}),d=r.useRef({}),A=r.useCallback((function(e){return I.current[e]||(I.current[e]=_(i.transport.getState(e))),I.current[e].read()}),[]),c=r.useCallback((function(e){return d.current[e]||(d.current[e]=_(i.transport.decodeStream(e))),d.current[e].read()}),[]),O=r.useMemo((function(){return{getState:A,decodeStream:c}}),[]);return r.useLayoutEffect((function(){l||u(!0)}),[]),l?r.createElement(r.Suspense,{fallback:r.createElement(t,o)},r.createElement(E.Provider,{value:O},r.createElement(e,o))):null}},useCoreSuspender:s}},17473:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(17473);e.exports=a},83193:(e,t,o)=>{var a=o(67294),i=o(81468).useTranslation,r=o(6851),n=o(58253),E=o(25876),_=o(79950),s=o(95985).default;e.exports=function(){var e,t,o=i().t,T=E(),S=T.events,l=T.pullEvents,u=T.dismissEvent,I=a.useMemo((function(){var e;return"Ready"===(null==S||null===(e=S.modal)||void 0===e?void 0:e.type)?S.modal.content:null}),[S]),d=a.useCallback((function(){(null==I?void 0:I.id)&&u(I.id)}),[I]);return a.useEffect((function(){l()}),[]),null!==I?a.createElement(n,{className:_["event-modal"],onCloseRequest:d},I.imageUrl?a.createElement("img",{className:_.image,src:I.imageUrl}):null,a.createElement("div",{className:_["info-container"]},a.createElement("div",{className:_["title-container"]},I.title?a.createElement("div",{className:_.title},I.title):null,I.message?a.createElement("div",{className:_.label},I.message):null),null!=I&&null!==(e=I.addon)&&void 0!==e&&e.name?a.createElement("div",{className:_["addon-container"]},a.createElement(s,{className:_.icon,name:"addons"}),a.createElement("div",{className:_.name},I.addon.name)):null,null!=I&&null!==(t=I.addon)&&void 0!==t&&t.manifestUrl?a.createElement(r,{className:_["action-button"],href:"#/addons?addon=".concat(encodeURIComponent(I.addon.manifestUrl)),onClick:d},a.createElement("div",{className:_["button-label"]},o("INSTALL_ADDON"))):I.externalUrl?a.createElement(r,{className:_["action-button"],href:I.externalUrl,target:"_blank"},a.createElement("div",{className:_["button-label"]},o("LEARN_MORE"))):null)):null}},50586:(e,t,o)=>{var a=o(83193);e.exports=a},25876:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var r=o(71535),n=o(63662).useServices,E=function(e){return(function(e){for(var t=1;t{var a=["className","src","alt","fallbackSrc","renderFallback"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=function(e){var t=e.className,o=e.src,n=e.alt,s=e.fallbackSrc,T=e.renderFallback,S=E(e,a),l=r(_.useState(!1),2),u=l[0],I=l[1],d=_.useCallback((function(e){"function"==typeof S.onError&&S.onError(e),I(!0)}),[S.onError]);return _.useLayoutEffect((function(){I(!1)}),[o]),!u&&"string"==typeof o&&0!==o.length||"function"!=typeof T&&"string"!=typeof s?_.createElement("img",i({},S,{className:t,src:o,alt:n,onError:d})):"function"==typeof T?T():_.createElement("img",i({},S,{className:t,src:s,alt:n}))};T.propTypes={className:s.string,src:s.string,alt:s.string,fallbackSrc:s.string,renderFallback:s.func,onError:s.func},e.exports=T},29872:(e,t,o)=>{var a=o(49504);e.exports=a},60859:(e,t,o)=>{var a=["_id","removable"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var s=o(67294),T=o(63662).useServices,S=o(45697),l=o(98277),u=o(96073).t,I=[{label:"LIBRARY_PLAY",value:"play"},{label:"LIBRARY_DETAILS",value:"details"},{label:"LIBRARY_RESUME_DISMISS",value:"dismiss"},{label:"LIBRARY_REMOVE",value:"remove"}],d=function(e){var t=e._id,o=e.removable,r=_(e,a),E=T().core,S=s.useMemo((function(){return I.filter((function(e){switch(e.value){case"play":return r.deepLinks&&"string"==typeof r.deepLinks.player;case"details":return r.deepLinks&&("string"==typeof r.deepLinks.metaDetailsVideos||"string"==typeof r.deepLinks.metaDetailsStreams);case"dismiss":return"string"==typeof t&&null!==r.progress&&!isNaN(r.progress);case"remove":return"string"==typeof t&&o}})).map((function(e){return n(n({},e),{},{label:u(e.label)})}))}),[t,o,r.progress,r.deepLinks]),d=s.useCallback((function(e){if("function"==typeof r.optionOnSelect&&r.optionOnSelect(e),!e.nativeEvent.optionSelectPrevented)switch(e.value){case"play":r.deepLinks&&"string"==typeof r.deepLinks.player&&(window.location=r.deepLinks.player);break;case"details":r.deepLinks&&("string"==typeof r.deepLinks.metaDetailsVideos?window.location=r.deepLinks.metaDetailsVideos:"string"==typeof r.deepLinks.metaDetailsStreams&&(window.location=r.deepLinks.metaDetailsStreams));break;case"dismiss":"string"==typeof t&&(E.transport.dispatch({action:"Ctx",args:{action:"RewindLibraryItem",args:t}}),E.transport.dispatch({action:"Ctx",args:{action:"DismissNotificationItem",args:t}}));break;case"remove":"string"==typeof t&&E.transport.dispatch({action:"Ctx",args:{action:"RemoveFromLibrary",args:t}})}}),[t,r.deepLinks,r.optionOnSelect]);return s.createElement(l,i({},r,{options:S,optionOnSelect:d}))};d.propTypes={_id:S.string,removable:S.bool,progress:S.number,deepLinks:S.shape({metaDetailsVideos:S.string,metaDetailsStreams:S.string,player:S.string}),optionOnSelect:S.func},e.exports=d},35748:(e,t,o)=>{var a=o(60859);e.exports=a},83364:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(11785),E=n.VerticalNavBar,_=n.HorizontalNavBar,s=o(49684),T=[{id:"board",label:"Board",icon:"home",href:"#/"},{id:"discover",label:"Discover",icon:"discover",href:"#/discover"},{id:"library",label:"Library",icon:"library",href:"#/library"},{id:"addons",label:"ADDONS",icon:"addons",href:"#/addons"},{id:"settings",label:"SETTINGS",icon:"settings",href:"#/settings"}],S=a.memo((function(e){var t=e.className,o=e.route,i=e.query,n=e.children;return a.createElement("div",{className:r(t,s["main-nav-bars-container"])},a.createElement(_,{className:s["horizontal-nav-bar"],route:o,query:i,backButton:!1,searchBar:!0,addonsButton:!0,fullscreenButton:!0,navMenu:!0}),a.createElement(E,{className:s["vertical-nav-bar"],selected:o,tabs:T}),a.createElement("div",{className:s["nav-content-container"]},n))}));S.displayName="MainNavBars",S.propTypes={className:i.string,route:i.string,query:i.string,children:i.node},e.exports=S},11297:(e,t,o)=>{var a=o(83364);e.exports=a},43037:(e,t,o)=>{var a=["className","type","name","poster","posterShape","posterChangeCursor","progress","newVideos","options","deepLinks","dataset","optionOnSelect","onDismissClick","onPlayClick"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(81468).useTranslation,l=o(87280).Z,u=o(95985).default,I=o(6851),d=o(29872),A=o(53981),c=o(74024),O=o(52734).ICON_FOR_TYPE,R=o(54661),N=_.memo((function(e){var t=e.className,o=e.type,n=e.name,s=e.poster,N=e.posterShape,m=e.posterChangeCursor,p=e.progress,L=e.newVideos,h=e.options,D=e.deepLinks,f=e.dataset,C=e.optionOnSelect,g=e.onDismissClick,B=e.onPlayClick,P=E(e,a),v=S().t,y=r(c(!1),3),M=y[0],W=y[1],b=y[2],U=_.useMemo((function(){return D?"string"==typeof D.player?D.player:"string"==typeof D.metaDetailsStreams?D.metaDetailsStreams:"string"==typeof D.metaDetailsVideos?D.metaDetailsVideos:null:null}),[D]),G=_.useCallback((function(e){"function"==typeof P.onClick&&P.onClick(e),e.nativeEvent.selectPrevented&&e.preventDefault()}),[P.onClick]),k=_.useCallback((function(e){e.nativeEvent.selectPrevented=!0}),[]),F=_.useCallback((function(e){"function"==typeof C&&C({type:"select-option",value:e.value,dataset:f,reactEvent:e.reactEvent,nativeEvent:e.nativeEvent})}),[f,C]),w=_.useCallback((function(){return _.createElement(u,{className:R["placeholder-icon"],name:O.has(o)?O.get(o):O.get("other")})}),[o]),V=_.useCallback((function(){return _.createElement(u,{className:R.icon,name:"more-vertical"})}),[]);return _.createElement(I,i({title:n,href:U},l(P),{className:T(t,R["meta-item-container"],R["poster-shape-poster"],R["poster-shape-".concat(N)],{active:M}),onClick:G}),_.createElement("div",{className:T(R["poster-container"],{"poster-change-cursor":m})},g?_.createElement("div",{title:v("LIBRARY_RESUME_DISMISS"),className:R["dismiss-icon-layer"],onClick:g},_.createElement(u,{className:R["dismiss-icon"],name:"close"}),_.createElement("div",{className:R["dismiss-icon-backdrop"]})):null,_.createElement("div",{className:R["poster-image-layer"]},_.createElement(d,{className:R["poster-image"],src:s,alt:" ",renderFallback:w})),B?_.createElement("div",{title:v("CONTINUE_WATCHING"),className:R["play-icon-layer"],onClick:B},_.createElement(u,{className:R["play-icon"],name:"play"}),_.createElement("div",{className:R["play-icon-outer"]}),_.createElement("div",{className:R["play-icon-background"]})):null,p>0?_.createElement("div",{className:R["progress-bar-layer"]},_.createElement("div",{className:R["progress-bar"],style:{width:"".concat(100*Math.max(0,Math.min(1,p)),"%")}}),_.createElement("div",{className:R["progress-bar-background"]})):null,L>0?_.createElement("div",{className:R["new-videos"]},_.createElement("div",{className:R.layer}),_.createElement("div",{className:R.layer}),_.createElement("div",{className:R.layer},_.createElement(u,{className:R.icon,name:"add"}),_.createElement("div",{className:R.label},L))):null),"string"==typeof n&&n.length>0||Array.isArray(h)&&h.length>0?_.createElement("div",{className:R["title-bar-container"]},_.createElement("div",{className:R["title-label"]},"string"==typeof n&&n.length>0?n:""),Array.isArray(h)&&h.length>0?_.createElement(A,{className:R["menu-label-container"],renderLabelContent:V,options:h,onOpen:W,onClose:b,onSelect:F,tabIndex:-1,onClick:k}):null):null)}));N.displayName="MetaItem",N.propTypes={className:s.string,type:s.string,name:s.string,poster:s.string,posterShape:s.oneOf(["poster","landscape","square"]),posterChangeCursor:s.bool,progress:s.number,newVideos:s.number,options:s.array,deepLinks:s.shape({metaDetailsVideos:s.string,metaDetailsStreams:s.string,player:s.string}),dataset:s.object,optionOnSelect:s.func,onDismissClick:s.func,onPlayClick:s.func,onClick:s.func},e.exports=N},98277:(e,t,o)=>{var a=o(43037);e.exports=a},84902:(e,t,o)=>{var a=["className","icon","label","tooltip"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(94184),s=o(95985).default,T=o(6851),S=o(65883),l=o(37541).Tooltip,u=function(e){var t=e.className,o=e.icon,E=e.label,u=e.tooltip,I=r(e,a);return n.createElement(T,i({title:u?"":E},I,{className:_(t,S["action-button-container"],{wide:"string"==typeof E&&!u})}),!0===u?n.createElement(l,{label:E,position:"top"}):null,"string"==typeof o&&o.length>0?n.createElement("div",{className:S["icon-container"]},n.createElement(s,{className:S.icon,name:o})):null,!u&&"string"==typeof E&&E.length>0?n.createElement("div",{className:S["label-container"]},n.createElement("div",{className:S.label},E)):null)};u.propTypes={className:E.string,icon:E.string,label:E.string,tooltip:E.bool},e.exports=u},60217:(e,t,o)=>{var a=o(84902);e.exports=a},78049:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(6851),_=o(17621),s=function(e){var t=e.className,o=e.label,i=e.links,s=n().t;return a.createElement("div",{className:r(t,_["meta-links-container"])},"string"==typeof o&&o.length>0?a.createElement("div",{className:_["label-container"]},s("LINKS_".concat(o.toUpperCase()))):null,Array.isArray(i)&&i.length>0?a.createElement("div",{className:_["links-container"]},i.map((function(e,t){var o=e.label,i=e.href;return a.createElement(E,{key:t,className:_["link-container"],title:o,href:i},s(o))}))):null)};s.propTypes={className:i.string,label:i.string,links:i.arrayOf(i.shape({label:i.string,href:i.string}))},e.exports=s},37818:(e,t,o)=>{var a=o(78049);e.exports=a},26314:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&(e.has(o)||e.set(o,[]),e.get(o).push({label:a,href:"https://www.stremio.com/warning#".concat(encodeURIComponent(i))})),e}),new Map):new Map}),[v]),V=n.useMemo((function(){return P?"string"==typeof P.player?P.player:"string"==typeof P.metaDetailsStreams?P.metaDetailsStreams:"string"==typeof P.metaDetailsVideos?P.metaDetailsVideos:null:null}),[P]),H=n.useMemo((function(){return Array.isArray(y)&&0!==y.length?y[0].deepLinks.player:null}),[y]),Y=n.useCallback((function(){return n.createElement("div",{className:p["logo-placeholder"]},m)}),[m]);return n.createElement("div",{className:_(E,p["meta-preview-container"],(t={},o=p.compact,r=c,o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t))},"string"==typeof D&&D.length>0?n.createElement("div",{className:p["background-image-layer"]},n.createElement(u,{className:p["background-image"],src:D,alt:" "})):null,n.createElement("div",{className:p["meta-info-container"]},"string"==typeof h&&h.length>0?n.createElement(u,{className:p.logo,src:h,alt:" ",title:m,renderFallback:Y}):Y(),"string"==typeof C&&C.length>0||g instanceof Date&&!isNaN(g.getTime())||"string"==typeof f&&f.length>0||w.has(A.IMDB_LINK_CATEGORY)?n.createElement("div",{className:p["runtime-release-info-container"]},"string"==typeof f&&f.length>0?n.createElement("div",{className:p["runtime-label"]},f):null,"string"==typeof C&&C.length>0?n.createElement("div",{className:p["release-info-label"]},C):g instanceof Date&&!isNaN(g.getTime())?n.createElement("div",{className:p["release-info-label"]},g.getFullYear()):null,w.has(A.IMDB_LINK_CATEGORY)?n.createElement(l,a({className:p["imdb-button-container"],title:w.get(A.IMDB_LINK_CATEGORY).label,href:w.get(A.IMDB_LINK_CATEGORY).href,target:"_blank"},c?{tabIndex:-1}:null),n.createElement("div",{className:p.label},w.get(A.IMDB_LINK_CATEGORY).label),n.createElement(S,{className:p.icon,name:"imdb"})):null):null,c&&"string"==typeof B&&B.length>0?n.createElement("div",{className:p["description-container"]},B):null,Array.from(w.keys()).filter((function(e){return e!==A.IMDB_LINK_CATEGORY&&e!==A.SHARE_LINK_CATEGORY&&e!==A.WRITERS_LINK_CATEGORY})).map((function(e,t){return n.createElement(N,{key:t,className:p["meta-links"],label:e,links:w.get(e)})})),!c&&"string"==typeof B&&B.length>0?n.createElement("div",{className:p["description-container"]},n.createElement("div",{className:p["label-container"]},b("SUMMARY")),B):null),n.createElement("div",{className:p["action-buttons-container"]},"function"==typeof W?n.createElement(R,{className:p["action-button"],icon:M?"remove-from-library":"add-to-library",label:b(M?"REMOVE_FROM_LIB":"ADD_TO_LIB"),tooltip:c,tabIndex:c?-1:0,onClick:W}):null,"string"==typeof H?n.createElement(R,{className:p["action-button"],icon:"trailer",label:b("TRAILER"),tabIndex:c?-1:0,href:H,tooltip:c}):null,"string"==typeof V&&c?n.createElement(R,{className:_(p["action-button"],p["show-button"]),icon:"play",label:b("SHOW"),tabIndex:c?-1:0,href:V}):null,w.has(A.SHARE_LINK_CATEGORY)&&!c?n.createElement(n.Fragment,null,n.createElement(R,{className:p["action-button"],icon:"share",label:b("CTX_SHARE"),tooltip:!0,tabIndex:c?-1:0,onClick:k}),G?n.createElement(I,{title:b("CTX_SHARE"),onCloseRequest:F},n.createElement(d,{className:p["share-prompt"],url:w.get(A.SHARE_LINK_CATEGORY).href})):null):null))};h.Placeholder=m,h.propTypes={className:E.string,compact:E.bool,name:E.string,logo:E.string,background:E.string,runtime:E.string,releaseInfo:E.string,released:E.instanceOf(Date),description:E.string,deepLinks:E.shape({metaDetailsVideos:E.string,metaDetailsStreams:E.string,player:E.string}),links:E.arrayOf(E.shape({category:E.string,name:E.string,url:E.string})),trailerStreams:E.array,inLibrary:E.bool,toggleInLibrary:E.func},e.exports=h},12641:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(76506),E=function(e){var t=e.className;return a.createElement("div",{className:r(t,n["meta-preview-placeholder-container"])},a.createElement("div",{className:n["meta-info-container"]},a.createElement("div",{className:n["logo-container"]}),a.createElement("div",{className:n["duration-release-info-container"]},a.createElement("div",{className:n["duration-container"]}),a.createElement("div",{className:n["release-info-container"]})),a.createElement("div",{className:n["genres-container"]},a.createElement("div",{className:n["genres-header-container"]}),a.createElement("div",{className:n["genre-label-container"]})),a.createElement("div",{className:n["genres-container"]},a.createElement("div",{className:n["genres-header-container"]}),a.createElement("div",{className:n["genre-label-container"]})),a.createElement("div",{className:n["genres-container"]},a.createElement("div",{className:n["genres-header-container"]}),a.createElement("div",{className:n["genre-label-container"]}))),a.createElement("div",{className:n["action-buttons-container"]}))};E.propTypes={className:i.string},e.exports=E},74322:(e,t,o)=>{var a=o(12641);e.exports=a},73070:(e,t,o)=>{var a=o(26314);e.exports=a},78370:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t0||I&&("string"==typeof I.discover||"string"==typeof I.library)?n.createElement("div",{className:d["header-container"]},"string"==typeof o&&o.length>0?n.createElement("div",{className:d["title-container"],title:o},o):null,!I||"string"!=typeof I.discover&&"string"!=typeof I.library?null:n.createElement(l,{className:d["see-all-container"],title:A("BUTTON_SEE_ALL"),href:I.discover||I.library,tabIndex:-1},n.createElement("div",{className:d.label},A("BUTTON_SEE_ALL")),n.createElement(S,{className:d.icon,name:"chevron-forward"}))):null,"string"==typeof a&&a.length>0?n.createElement("div",{className:d["message-container"],title:a},a):n.createElement("div",{className:d["meta-items-container"]},E.isValidElementType(_)?r.slice(0,u.CATALOG_PREVIEW_SIZE).map((function(e,t){return n.createElement(_,i(i({},e),{},{key:t,className:s(d["meta-item"],d["poster-shape-poster"],d["poster-shape-".concat(e.posterShape)])}))})):null,Array(Math.max(0,u.CATALOG_PREVIEW_SIZE-r.length)).fill(null).map((function(e,t){return n.createElement("div",{key:t,className:s(d["meta-item"],d["poster-shape-poster"])})}))))};A.Placeholder=I,A.propTypes={className:_.string,title:_.string,message:_.string,items:_.arrayOf(_.shape({posterShape:_.string})),itemComponent:_.elementType,deepLinks:_.shape({discover:_.string,library:_.string})},e.exports=A},92268:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(95985).default,_=o(6851),s=o(52734),T=o(17841),S=function(e){var t=e.className,o=e.title,i=e.deepLinks,S=n().t;return a.createElement("div",{className:r(t,T["meta-row-placeholder-container"])},a.createElement("div",{className:T["header-container"]},a.createElement("div",{className:T["title-container"],title:"string"==typeof o&&o.length>0?o:null},"string"==typeof o&&o.length>0?o:null),i&&"string"==typeof i.discover?a.createElement(_,{className:T["see-all-container"],title:S("BUTTON_SEE_ALL"),href:i.discover,tabIndex:-1},a.createElement("div",{className:T.label},S("BUTTON_SEE_ALL")),a.createElement(E,{className:T.icon,name:"chevron-forward"})):null),a.createElement("div",{className:T["meta-items-container"]},Array(s.CATALOG_PREVIEW_SIZE).fill(null).map((function(e,t){return a.createElement("div",{key:t,className:T["meta-item"]},a.createElement("div",{className:T["poster-container"]}),a.createElement("div",{className:T["title-bar-container"]},a.createElement("div",{className:T["title-label"]})))}))))};S.propTypes={className:i.string,title:i.string,deepLinks:i.shape({discover:i.string})},e.exports=S},90411:(e,t,o)=>{var a=o(92268);e.exports=a},39321:(e,t,o)=>{var a=o(78370);e.exports=a},98787:(e,t,o)=>{var a=["className","title","buttons","children","dataset","onCloseRequest"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(94184),s=o(21665),T=s.useRouteFocused,S=s.useModalsContainer,l=o(6851),u=o(95985).default,I=o(21665).Modal,d=o(11621),A=function(e){var t=e.className,o=e.title,E=e.buttons,s=e.children,A=e.dataset,c=e.onCloseRequest,O=r(e,a),R=T(),N=S(),m=n.useRef(null),p=n.useCallback((function(e){"function"==typeof c&&c({type:"close",dataset:A,reactEvent:e,nativeEvent:e.nativeEvent})}),[A,c]),L=n.useCallback((function(e){e.nativeEvent.closeModalDialogPrevented||"function"!=typeof c||c({type:"close",dataset:A,reactEvent:e,nativeEvent:e.nativeEvent})}),[A,c]),h=n.useCallback((function(e){e.nativeEvent.closeModalDialogPrevented=!0}),[]);return n.useEffect((function(){var e=function(e){"Escape"===e.code&&N.childNodes[N.childElementCount-2]===m.current&&"function"==typeof c&&c({type:"close",dataset:A,nativeEvent:e})};return R&&window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[R,A,c]),n.createElement(I,i({ref:m},O,{className:_(t,d["modal-container"]),onMouseDown:L}),n.createElement("div",{className:d["modal-dialog-container"],onMouseDown:h},n.createElement(l,{className:d["close-button-container"],title:"Close",onClick:p},n.createElement(u,{className:d.icon,name:"close"})),"string"==typeof o&&o.length>0?n.createElement("div",{className:d["title-container"],title:o},o):null,n.createElement("div",{className:d["modal-dialog-content"]},s),Array.isArray(E)&&E.length>0?n.createElement("div",{className:d["buttons-container"]},E.map((function(e,t){var o=e.className,a=e.label,r=e.icon,E=e.props;return n.createElement(l,i({title:a},E,{key:t,className:_(o,d["action-button"])}),"string"==typeof r&&r.length>0?n.createElement(u,{className:d.icon,name:r}):null,"string"==typeof a&&a.length>0?n.createElement("div",{className:d.label},a):null)}))):null))};A.propTypes={className:E.string,title:E.string,buttons:E.arrayOf(E.shape({className:E.string,label:E.string,icon:E.string,props:E.object})),children:E.oneOfType([E.arrayOf(E.node),E.node]),dataset:E.object,onCloseRequest:E.func},e.exports=A},58253:(e,t,o)=>{var a=o(98787);e.exports=a},82035:(e,t,o)=>{var a=["className","mode","direction","title","disabled","dataset","renderLabelContent","renderLabelText","onOpen","onClose","onSelect"],i=["children","className"];function r(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var l=o(67294),u=o(45697),I=o(94184),d=o(95985).default,A=o(6851),c=o(9418),O=o(58253),R=o(74024),N=o(57409),m=function(e){var t=e.className,o=e.mode,r=e.direction,E=e.title,T=e.disabled,u=e.dataset,m=e.renderLabelContent,p=e.renderLabelText,L=e.onOpen,h=e.onClose,D=e.onSelect,f=S(e,a),C=s(R(!1),4),g=C[0],B=C[2],P=C[3],v=l.useMemo((function(){return Array.isArray(f.options)?f.options.filter((function(e){return e&&("string"==typeof e.value||null===e.value)})):[]}),[f.options]),y=l.useMemo((function(){return Array.isArray(f.selected)?f.selected.filter((function(e){return"string"==typeof e||null===e})):[]}),[f.selected]),M=l.useCallback((function(e){"function"==typeof f.onClick&&f.onClick(e),e.nativeEvent.toggleMenuPrevented||P()}),[f.onClick,P]),W=l.useCallback((function(e){e.nativeEvent.toggleMenuPrevented=!0}),[]),b=l.useCallback((function(e){e.nativeEvent.buttonClickPrevented=!0}),[]),U=l.useCallback((function(e){"function"==typeof D&&D({type:"select",value:e.currentTarget.dataset.value,reactEvent:e,nativeEvent:e.nativeEvent,dataset:u}),e.nativeEvent.closeMenuPrevented||B()}),[u,D]),G=l.useRef(!1);l.useLayoutEffect((function(){G.current&&(g?"function"==typeof L&&L({type:"open",dataset:u}):"function"==typeof h&&h({type:"close",dataset:u})),G.current=!0}),[g]);var k=l.useCallback((function(e){var t=e.children,o=e.className,a=S(e,i);return l.createElement(A,_({},a,{className:I(o,N["label-container"],{active:g}),title:E,disabled:T,onClick:M}),"function"==typeof m?m():l.createElement(l.Fragment,null,l.createElement("div",{className:N.label},"function"==typeof p?p():y.length>0?y.map((function(e){var t=v.find((function(t){return t.value===e}));return t&&"string"==typeof t.label?t.label:e})).join(", "):E),l.createElement(d,{className:N.icon,name:"caret-down"})),t)}),[g,E,T,v,y,M,m,p]),F=l.useCallback((function(){return l.createElement("div",{className:N["menu-container"],onKeyDown:b,onClick:W},v.length>0?v.map((function(e){var t=e.label,o=e.title,a=e.value;return l.createElement(A,{key:a,className:I(N["option-container"],{selected:y.includes(a)}),title:"string"==typeof o?o:"string"==typeof t?t:a,"data-value":a,onClick:U},l.createElement("div",{className:N.label},"string"==typeof t?t:a),l.createElement("div",{className:N.icon}))})):l.createElement("div",{className:N["no-options-container"]},l.createElement("div",{className:N.label},"No options available")))}),[v,y,b,W,U]),w=l.useMemo((function(){return function(e){return k(n(n(n({},e),f),{},{className:I(t,e.className)}))}}),[f,t,k]);return"modal"===o?k(n(n({},f),{},{className:t,children:g?l.createElement(O,{className:N["modal-container"],title:E,onCloseRequest:B,onKeyDown:b,onClick:W},F()):null})):l.createElement(c,{open:g,direction:r,onCloseRequest:B,renderLabel:w,renderMenu:F})};m.propTypes={className:u.string,mode:u.oneOf(["popup","modal"]),direction:u.any,title:u.string,options:u.arrayOf(u.shape({value:u.string,title:u.string,label:u.string})),selected:u.arrayOf(u.string),disabled:u.bool,dataset:u.object,renderLabelContent:u.func,renderLabelText:u.func,onOpen:u.func,onClose:u.func,onSelect:u.func,onClick:u.func},e.exports=m},53981:(e,t,o)=>{var a=o(82035);e.exports=a},46934:(e,t,o)=>{var a=["className","route","query","title","backButton","searchBar","addonsButton","fullscreenButton","navMenu"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(95985).default,l=o(6851),u=o(29872),I=o(88489),d=o(43224),A=o(75430),c=o(70923),O=o(74887),R=o(96073).t,N=_.memo((function(e){var t=e.className,n=e.route,s=e.query,N=e.title,m=e.backButton,p=e.searchBar,L=e.addonsButton,h=e.fullscreenButton,D=e.navMenu,f=E(e,a),C=_.useCallback((function(){window.history.back()}),[]),g=r(I(),3),B=g[0],P=g[1],v=g[2],y=r(d(),1)[0],M=_.useCallback((function(e){var t=e.ref,o=e.className,a=e.onClick,i=e.children;return _.createElement(l,{ref:t,className:T(o,O["button-container"],O["menu-button-container"]),tabIndex:-1,onClick:a},_.createElement(S,{className:O.icon,name:"person-outline"}),i)}),[]);return _.createElement("nav",i({},f,{className:T(t,O["horizontal-nav-bar-container"])}),m?_.createElement(l,{className:T(O["button-container"],O["back-button-container"]),tabIndex:-1,onClick:C},_.createElement(S,{className:O.icon,name:"chevron-back"})):_.createElement("div",{className:O["logo-container"]},_.createElement(u,{className:O.logo,src:o(35313),alt:" "})),"string"==typeof N&&N.length>0?_.createElement("h2",{className:O.title},N):null,p?_.createElement(A,{className:O["search-bar"],query:s,active:"search"===n}):null,_.createElement("div",{className:O["buttons-container"]},L?_.createElement(l,{className:O["button-container"],href:"#/addons",title:R("ADDONS"),tabIndex:-1},_.createElement(S,{className:O.icon,name:"addons-outline"})):null,!y&&h?_.createElement(l,{className:O["button-container"],title:R(B?"EXIT_FULLSCREEN":"ENTER_FULLSCREEN"),tabIndex:-1,onClick:B?v:P},_.createElement(S,{className:O.icon,name:B?"minimize":"maximize"})):null,D?_.createElement(c,{renderLabel:M}):null))}));N.displayName="HorizontalNavBar",N.propTypes={className:s.string,route:s.string,query:s.string,title:s.string,backButton:s.bool,searchBar:s.bool,addonsButton:s.bool,fullscreenButton:s.bool,navMenu:s.bool},e.exports=N},21229:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t,o,a,i,r,n){try{var E=e[r](n),_=E.value}catch(e){return void o(e)}E.done?t(_):Promise.resolve(_).then(a,i)}function i(e){return function(){var t=this,o=arguments;return new Promise((function(i,r){var n=e.apply(t,o);function E(e){a(n,i,r,E,_,"next",e)}function _(e){a(n,i,r,E,_,"throw",e)}E(void 0)}))}}function r(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(21229);e.exports=a},83833:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(95985).default,_=o(21665).useRouteFocused,s=o(6851),T=o(86230),S=o(91657),l=o(36672).withCoreSuspender,u=o(87551),I=function(e){var t=e.className,o=e.query,i=e.active,l=n().t,I=_(),d=S().createTorrentFromMagnet,A=a.useRef(null),c=a.useCallback((function(){i||(window.location="#/search")}),[i]),O=a.useCallback((function(){try{d(A.current.value)}catch(e){}}),[]),R=a.useCallback((function(){if(null!==A.current){var e=new URLSearchParams([["search",A.current.value]]);window.location="#/search?".concat(e.toString())}}),[]);return a.useEffect((function(){I&&i&&A.current.focus()}),[I,i,o]),a.createElement("label",{className:r(t,u["search-bar-container"],{active:i}),onClick:c},i?a.createElement(T,{key:o,ref:A,className:u["search-input"],type:"text",placeholder:l("SEARCH_OR_PASTE_LINK"),defaultValue:o,tabIndex:-1,onChange:O,onSubmit:R}):a.createElement("div",{className:u["search-input"]},a.createElement("div",{className:u["placeholder-label"]},l("SEARCH_OR_PASTE_LINK"))),a.createElement(s,{className:u["submit-button-container"],tabIndex:-1,onClick:R},a.createElement(E,{className:u.icon,name:"search"})))};I.propTypes={className:i.string,query:i.string,active:i.bool};var d=function(e){var t=e.className,o=n().t;return a.createElement("label",{className:r(t,u["search-bar-container"])},a.createElement("div",{className:u["search-input"]},a.createElement("div",{className:u["placeholder-label"]},o("SEARCH_OR_PASTE_LINK"))),a.createElement(s,{className:u["submit-button-container"],tabIndex:-1},a.createElement(E,{className:u.icon,name:"search"})))};d.propTypes=I.propTypes,e.exports=l(I,d)},75430:(e,t,o)=>{var a=o(83833);e.exports=a},91871:(e,t,o)=>{var a=o(46934);e.exports=a},82878:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(6851),_=o(29872),s=o(39842),T=function(e){var t=e.className,o=e.logo,i=e.icon,T=e.label,S=e.href,l=e.selected,u=e.onClick,I=a.useCallback((function(){return"string"==typeof i&&i.length>0?a.createElement(n,{className:s.icon,name:i}):null}),[i]);return a.createElement(E,{className:r(t,s["nav-tab-button-container"],{selected:l}),title:T,tabIndex:-1,href:S,onClick:u},"string"==typeof o&&o.length>0?a.createElement(_,{className:s.logo,src:o,alt:" ",renderFallback:I}):"string"==typeof i&&i.length>0?a.createElement(n,{className:s.icon,name:l?i:"".concat(i,"-outline")}):null,"string"==typeof T&&T.length>0?a.createElement("div",{className:s.label},T):null)};T.propTypes={className:i.string,logo:i.string,icon:i.string,label:i.string,href:i.string,selected:i.bool,onClick:i.func},e.exports=T},63908:(e,t,o)=>{var a=o(82878);e.exports=a},96063:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(63908),_=o(27636),s=a.memo((function(e){var t=e.className,o=e.selected,i=e.tabs,s=n().t;return a.createElement("nav",{className:r(t,_["vertical-nav-bar-container"])},Array.isArray(i)?i.map((function(e,t){return a.createElement(E,{key:t,className:_["nav-tab-button"],selected:e.id===o,href:e.href,logo:e.logo,icon:e.icon,label:s(e.label),onClick:e.onClick})})):null)}));s.displayName="VerticalNavBar",s.propTypes={className:i.string,selected:i.string,tabs:i.arrayOf(i.shape({id:i.string,label:i.string,logo:i.string,icon:i.string,href:i.string,onClick:i.func}))},e.exports=s},29798:(e,t,o)=>{var a=o(96063);e.exports=a},11785:(e,t,o)=>{var a=o(91871),i=o(29798);e.exports={HorizontalNavBar:a,VerticalNavBar:i}},98417:(e,t,o)=>{var a=["className","label","dataset","onSelect"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(94184),s=o(95985).default,T=o(6851),S=o(12168),l=function(e){var t=e.className,o=e.label,E=e.dataset,l=e.onSelect,u=r(e,a),I=n.useCallback((function(e){"function"==typeof l&&l({type:"change-page",value:e.currentTarget.dataset.value,dataset:E,reactEvent:e,nativeEvent:e.nativeEvent})}),[E,l]);return n.createElement("div",i({},u,{className:_(t,S["pagination-input-container"])}),n.createElement(T,{className:S["prev-button-container"],title:"Previous page","data-value":"prev",onClick:I},n.createElement(s,{className:S.icon,name:"chevron-back"})),n.createElement("div",{className:S["label-container"],title:o},n.createElement("div",{className:S.label},o)),n.createElement(T,{className:S["next-button-container"],title:"Next page","data-value":"next",onClick:I},n.createElement(s,{className:S.icon,name:"chevron-forward"})))};l.propTypes={className:E.string,label:E.string,dataset:E.object,onSelect:E.func},e.exports=l},52391:(e,t,o)=>{var a=o(98417);e.exports=a},57206:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(9192),n=function(e){var t=e.className;return a.createElement("svg",{className:t,viewBox:"0 0 100 100"},a.createElement("circle",{className:r.background,cx:"50",cy:"50",r:"50"}),a.createElement("svg",{className:r.icon,x:"0",y:"25",width:"100",height:"50",viewBox:"0 0 37.14 32"},a.createElement("path",{d:"M 9.14,0 37.14,16 9.14,32 Z"})))};n.propTypes={className:i.string},e.exports=n},60926:(e,t,o)=>{var a=o(57206);e.exports=a},51804:(e,t,o)=>{var a=["open","direction","renderLabel","renderMenu","dataset","onCloseRequest"];function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function r(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var T=o(67294),S=o(45697),l=o(94184),u=o(56413).ZP,I=o(21665).useRouteFocused,d=o(20194),A=function e(t){if(t===document.documentElement)return t;var o=window.getComputedStyle(t);return-1!==o.overflowY.indexOf("auto")||-1!==o.overflowY.indexOf("scroll")?t:e(t.parentElement)},c=function(e){var t=e.open,o=e.direction,i=e.renderLabel,_=e.renderMenu,S=e.dataset,c=e.onCloseRequest,O=s(e,a),R=I(),N=T.useRef(null),m=T.useRef(null),p=E(T.useState(null),2),L=p[0],h=p[1],D=T.useCallback((function(e){e.nativeEvent.closePopupPrevented=!0}),[]);return T.useEffect((function(){var e=function(e){if(!e.closePopupPrevented&&"function"==typeof c){var t={type:"close",nativeEvent:e,dataset:S};switch(e.type){case"keydown":"Escape"===e.code&&c(t);break;case"mousedown":case"pointerdown":e.target===document.documentElement||N.current.contains(e.target)||c(t)}}};return R&&t&&(window.addEventListener("keydown",e),window.addEventListener("mousedown",e),window.addEventListener("pointerdown",e)),function(){window.removeEventListener("keydown",e),window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",e)}}),[R,t,c,S]),T.useLayoutEffect((function(){if(t){var e=[],o=A(N.current).getBoundingClientRect(),a=N.current.getBoundingClientRect(),i=m.current.getBoundingClientRect(),r={left:a.left-o.left,top:a.top-o.top,right:o.width+o.left-(a.left+a.width),bottom:o.height+o.top-(a.top+a.height)};i.height<=r.bottom?e.push("bottom"):i.height<=r.top?e.push("top"):r.bottom>=r.top?e.push("bottom"):e.push("top"),i.width<=r.right+a.width?e.push("right"):i.width<=r.left+a.width?e.push("left"):r.right>r.left?e.push("right"):e.push("left"),h(e.join("-"))}else h(null)}),[t]),i(r(r({},O),{},{ref:N,className:l(d["label-container"],O.className,{active:t}),children:t?T.createElement(u,{ref:m,className:l(d["menu-container"],n({},d["menu-direction-".concat(L)],!o),n({},d["menu-direction-".concat(o)],o)),autoFocus:!1,lockProps:{onMouseDown:D}},_()):null}))};c.propTypes={open:S.bool,direction:S.oneOf(["top-left","bottom-left","top-right","bottom-right"]),renderLabel:S.func.isRequired,renderMenu:S.func.isRequired,dataset:S.object,onCloseRequest:S.func},e.exports=c},9418:(e,t,o)=>{var a=o(51804);e.exports=a},56182:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(86230),_=o(64830),s=o(30330),T=function(e){var t=e.className,o=e.title,i=e.value,_=e.onChange;return a.createElement("label",{title:o,className:r(t,s["search-bar-container"])},a.createElement(E,{className:s["search-input"],type:"text",placeholder:o,value:i,onChange:_}),a.createElement(n,{className:s.icon,name:"search"}))};T.Placeholder=_,T.propTypes={className:i.string,title:i.string,value:i.string,onChange:i.func},e.exports=T},83994:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(3109),_=function(e){var t=e.className,o=e.title;return a.createElement("div",{className:r(t,E["search-bar-container"])},a.createElement("div",{className:E["search-input"]},o),a.createElement(n,{className:E.icon,name:"search"}))};_.propTypes={className:i.string,title:i.string},e.exports=_},64830:(e,t,o)=>{var a=o(83994);e.exports=a},6798:(e,t,o)=>{var a=o(56182);e.exports=a},55005:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(95985).default,_=o(21665).useRouteFocused,s=o(63662).useServices,T=o(6851),S=o(86230),l=o(84530),u=function(e){var t=e.className,o=e.url,i=n().t,u=s().core,I=a.useRef(null),d=_(),A=a.useCallback((function(){null!==I.current&&I.current.select()}),[]),c=a.useCallback((function(){null!==I.current&&(I.current.select(),document.execCommand("copy"))}),[]);return a.useEffect((function(){d&&null!==I.current&&I.current.select()}),[d]),a.useEffect((function(){u.transport.analytics({event:"Share",args:{url:o}})}),[o]),a.createElement("div",{className:r(t,l["share-prompt-container"])},a.createElement("div",{className:l["buttons-container"]},a.createElement(T,{className:r(l["button-container"],l["facebook-button"]),title:"Facebook",href:"https://www.facebook.com/sharer/sharer.php?u=".concat(o),target:"_blank"},a.createElement(E,{className:l.icon,name:"facebook"}),a.createElement("div",{className:l.label},"Facebook")),a.createElement(T,{className:r(l["button-container"],l["twitter-button"]),title:"Twitter",href:"https://twitter.com/home?status=".concat(o),target:"_blank"},a.createElement(E,{className:l.icon,name:"ic_twitter"}),a.createElement("div",{className:l.label},"Twitter"))),a.createElement("div",{className:l["url-container"]},a.createElement(S,{ref:I,className:l["url-text-input"],type:"text",readOnly:!0,defaultValue:o,onClick:A,tabIndex:-1}),a.createElement(T,{className:l["copy-button"],title:"Copy to clipboard",onClick:c},a.createElement(E,{className:l.icon,name:"link"}),a.createElement("div",{className:l.label},i("COPY")))))};u.propTypes={className:i.string,url:i.string},e.exports=u},89393:(e,t,o)=>{var a=o(55005);e.exports=a},34068:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(34068);e.exports=a},69009:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;tDate.now()?null:n.createElement("div",{className:s(t,I["warning-container"])},n.createElement("div",{className:I["warning-statement"]},o("SETTINGS_SERVER_UNAVAILABLE")),n.createElement("a",{href:"https://www.stremio.com/download-service",target:"_blank",rel:"noreferrer"},n.createElement(S,{className:I["warning-button"],title:o("SERVICE_INSTALL"),tabIndex:-1},n.createElement("div",{className:I["warning-label"]},o("SERVICE_INSTALL")))),n.createElement(S,{className:I["warning-button"],title:o("WARNING_STREAMING_SERVER_LATER"),onClick:_,tabIndex:-1},n.createElement("div",{className:I["warning-label"]},o("WARNING_STREAMING_SERVER_LATER"))),n.createElement(S,{className:I["warning-button"],title:o("DONT_SHOW_AGAIN"),onClick:u,tabIndex:-1},n.createElement("div",{className:I["warning-label"]},o("DONT_SHOW_AGAIN"))))};d.propTypes={className:_.string},e.exports=u(d)},60861:(e,t,o)=>{var a=o(69009);e.exports=a},31007:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(31007);e.exports=a},6049:(e,t,o)=>{var a=o(67294).createContext({show:function(){},clear:function(){}});a.displayName="ToastContext",e.exports=a},33345:(e,t,o)=>{var a=["title","message","dataset","onSelect","onClose"];function i(e,t){if(null==e)return{};var o,a,i=(function(e,t){if(null==e)return{};var o,a,i={},r=Object.keys(e);for(a=0;a=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var r=o(67294),n=o(45697),E=o(94184),_=o(95985).default,s=o(6851),T=o(49775),S=function(e){var t=e.title,o=e.message,n=e.dataset,S=e.onSelect,l=e.onClose,u=i(e,a),I=r.useMemo((function(){return["success","alert","error"].includes(u.type)?u.type:"success"}),[u.type]),d=r.useMemo((function(){return"string"==typeof u.icon?u.icon:"success"===I?"checkmark":"error"===I?"warning":null}),[I,u.icon]),A=r.useCallback((function(e){e.nativeEvent.selectToastPrevented||"function"!=typeof S||S({type:"select",dataset:n,reactEvent:e,nativeEvent:e.nativeEvent}),e.nativeEvent.closeToastPrevented||"function"!=typeof l||l({type:"close",dataset:n,reactEvent:e,nativeEvent:e.nativeEvent})}),[n,S,l]),c=r.useCallback((function(e){e.nativeEvent.selectToastPrevented=!0,"function"==typeof l&&l({type:"close",dataset:n,reactEvent:e,nativeEvent:e.nativeEvent})}),[n,l]);return r.createElement(s,{className:E(T["toast-item-container"],T[I]),tabIndex:-1,onClick:A},"string"==typeof d&&d.length>0?r.createElement("div",{className:T["icon-container"]},r.createElement(_,{className:T.icon,name:d})):null,r.createElement("div",{className:T["info-container"]},"string"==typeof t&&t.length>0?r.createElement("div",{className:T["title-container"]},t):null,"string"==typeof o&&o.length>0?r.createElement("div",{className:T["message-container"]},o):null),r.createElement(s,{className:T["close-button-container"],title:"Close",tabIndex:-1,onClick:c},r.createElement(_,{className:T.icon,name:"close"})))};S.propTypes={type:n.oneOf(["success","alert","error"]),title:n.string,message:n.string,icon:n.string,dataset:n.object,onSelect:n.func,onClose:n.func},e.exports=S},25008:(e,t,o)=>{var a=o(33345);e.exports=a},19076:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o-1&&e.splice(o,1)},show:function(t){if(!e.some((function(e){return e(t)}))){var o="number"!=typeof t.timeout||isNaN(t.timeout)?3e3:t.timeout,a=setTimeout((function(){d({type:"remove",id:a})}),o);d({type:"add",item:r(r({},t),{},{id:a,dataset:r(r({},t.dataset),{},{id:a}),onClose:A})})}},clear:function(){d({type:"clear"})}}}),[]);return s.createElement(l.Provider,{value:c},n instanceof HTMLElement?o:null,s.createElement("div",{ref:_,className:t},I.map((function(e,t){return s.createElement(S,a({key:t},e))}))))};u.propTypes={className:T.string,children:T.node},e.exports=u},20018:(e,t,o)=>{var a=o(19076),i=o(17263);e.exports={ToastProvider:a,useToast:i}},17263:(e,t,o)=>{var a=o(67294),i=o(6049);e.exports=function(){return a.useContext(i)}},36014:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(10152),n=o(63494),E=function(e){var t=e.label,o=e.position,i=e.margin,E=void 0===i?15:i,_=r(),s=a.useRef((Math.random()+1).toString(36).substring(7)),T=a.useRef(null),S=function(){_.update(s.current,{active:!0})},l=function(){_.update(s.current,{active:!1})};return a.useEffect((function(){_.update(s.current,{label:t})}),[t]),a.useLayoutEffect((function(){if(T.current&&T.current.parentElement){var e=T.current.parentElement;_.add({id:s.current,label:t,position:o,margin:E,parent:e}),e.addEventListener("mouseenter",S),e.addEventListener("mouseleave",l)}return function(){if(T.current&&T.current.parentElement){var e=T.current.parentElement;e.removeEventListener("mouseenter",S),e.removeEventListener("mouseleave",l),_.remove(s.current)}}}),[]),a.createElement("div",{ref:T,className:n["tooltip-placeholder"]})};E.propTypes={label:i.string.isRequired,position:i.string.isRequired,margin:i.number},e.exports=E},79410:(e,t,o)=>{var a=o(36014);e.exports=a},5494:(e,t,o)=>{var a=(0,o(67294).createContext)(null);e.exports=a},12508:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(12508);e.exports=a},67169:(e,t,o)=>{var a=["id"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function n(e){return(function(e){if(Array.isArray(e))return l(e)})(e)||(function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||S(e)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function E(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function _(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(67169),i=o(79410);e.exports={TooltipProvider:a,Tooltip:i}},10152:(e,t,o)=>{var a=o(67294),i=o(5494);e.exports=function(){return a.useContext(i)}},69309:e=>{e.exports=function(e){return function(t,o){return isNaN(e[t])&&isNaN(e[o])?t.localeCompare(o):isNaN(e[t])?e[o]===Number.NEGATIVE_INFINITY?-1:1:isNaN(e[o])?e[t]===Number.NEGATIVE_INFINITY?1:-1:e[o]-e[t]}}},9324:e=>{e.exports=function(e){return Array.from(e.children).reduce((function(t,o,a){return(function(e,t){var o=t.offsetTop,a=t.offsetTop+t.clientHeight,i=e.scrollTop,r=e.scrollTop+e.clientHeight;return o>=i&&a<=r||o{var a=o(58512),i=o(6851),r=o(49666),n=o(28809),E=o(63418),_=o(8006),s=o(29872),T=o(35748),S=o(11297),l=o(98277),u=o(73070),I=o(39321),d=o(58253),A=o(53981),c=o(11785),O=c.HorizontalNavBar,R=c.VerticalNavBar,N=o(52391),m=o(60926),p=o(9418),L=o(6798),h=o(60861),D=o(89393),f=o(36e3),C=o(86230),g=o(20018),B=g.ToastProvider,P=g.useToast,v=o(37541),y=v.TooltipProvider,M=v.Tooltip,W=o(69309),b=o(52734),U=o(36672),G=U.withCoreSuspender,k=U.useCoreSuspender,F=o(9324),w=o(75232),V=o(68832),H=o(68803),Y=o(36649),z=o(4),K=o(74024),x=o(88489),j=o(47985),Q=o(71535),X=o(7049),$=o(83760),q=o(50552),J=o(30432),Z=o(91657),ee=o(355),te=o(50586);e.exports={AddonDetailsModal:a,Button:i,Checkbox:r,ColorInput:n,ContinueWatchingItem:E,DelayedRenderer:_,Image:s,LibItem:T,MainNavBars:S,MetaItem:l,MetaPreview:u,MetaRow:I,ModalDialog:d,Multiselect:A,HorizontalNavBar:O,VerticalNavBar:R,PaginationInput:N,PlayIconCircleCentered:m,Popup:p,SearchBar:L,StreamingServerWarning:h,SharePrompt:D,Slider:f,TextInput:C,ToastProvider:B,useToast:P,TooltipProvider:y,Tooltip:M,comparatorWithPriorities:W,CONSTANTS:b,withCoreSuspender:G,useCoreSuspender:k,getVisibleChildrenRange:F,interfaceLanguages:w,languageNames:V,routesRegexp:H,translateOption:Y,useAnimationFrame:z,useBinaryState:K,useFullscreen:x,useLiveRef:j,useModelState:Q,useNotifications:X,useOnScrollToBottom:$,useProfile:q,useStreamingServer:J,useTorrent:Z,platform:ee,EventModal:te}},355:(e,t,o)=>{var a,i;var r=o(51206).parse((null===(a=window.navigator)||void 0===a?void 0:a.userAgent)||""),n=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document?"ios":((null==r||null===(i=r.os)||void 0===i?void 0:i.name)||"unknown").toLowerCase();e.exports={name:n,isMobile:function(){return"ios"===n||"android"===n}}},68803:e=>{e.exports={intro:{regexp:/^\/intro$/,urlParamsNames:[]},board:{regexp:/^\/?$/,urlParamsNames:[]},discover:{regexp:/^\/discover(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/,urlParamsNames:["transportUrl","type","catalogId"]},library:{regexp:/^\/library(?:\/([^/]*))?$/,urlParamsNames:["type"]},continuewatching:{regexp:/^\/continuewatching(?:\/([^/]*))?$/,urlParamsNames:["type"]},search:{regexp:/^\/search$/,urlParamsNames:[]},metadetails:{regexp:/^\/(?:metadetails|detail)\/([^/]*)\/([^/]*)(?:\/([^/]*))?$/,urlParamsNames:["type","id","videoId"]},addons:{regexp:/^\/addons(?:\/([^/]*)(?:\/([^/]*)\/([^/]*))?)?$/,urlParamsNames:["type","transportUrl","catalogId"]},settings:{regexp:/^\/settings$/,urlParamsNames:[]},player:{regexp:/^\/player\/([^/]*)(?:\/([^/]*)\/([^/]*)\/([^/]*)\/([^/]*)\/([^/]*))?$/,urlParamsNames:["stream","streamTransportUrl","metaTransportUrl","type","id","videoId"]}}},36649:(e,t,o)=>{var a=o(96073).t;e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o="".concat(t).concat(e),i=a(o,{defaultValue:a(o.toUpperCase(),{defaultValue:null})});return null!=i?i:e.charAt(0).toUpperCase()+e.slice(1)}},4:(e,t,o)=>{var a=o(67294);e.exports=function(){var e=a.useRef(null),t=a.useCallback((function(){cancelAnimationFrame(e.current),e.current=null}),[]);return[a.useCallback((function(o){t(),e.current=requestAnimationFrame((function(){o(),e.current=null}))}),[]),t]}},74024:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(67294);e.exports=function(e){var t=a.useRef();return t.current=e,t}},71535:(e,t,o)=>{var a=["action"];function i(e,t,o,a,i,r,n){try{var E=e[r](n),_=E.value}catch(e){return void o(e)}E.done?t(_):Promise.resolve(_).then(a,i)}function r(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(93096),T=o(72307),S=o(20394),l=o(36672).useCoreSuspender,u=o(21665).useRouteFocused,I=o(63662).useServices;e.exports=function(e){var t=e.action,o=E(e,a),n=I().core,d=u(),A=_.useRef(!1),c=r(_.useMemo((function(){return[o.model,o.timeout,o.map,o.deps]}),[]),4),O=c[0],R=c[1],N=c[2],m=c[3],p=l().getState,L=r(_.useReducer((function(e,t){return Object.keys(e).reduce((function(o,a){return o[a]=T(e[a],t[a])?e[a]:t[a],o}),{})}),void 0,(function(){return"function"==typeof N?N(p(O)):p(O)})),2),h=L[0],D=L[1];return _.useInsertionEffect((function(){t&&n.transport.dispatch(t,O)}),[t]),_.useInsertionEffect((function(){return function(){n.transport.dispatch({action:"Unload"},O)}}),[]),_.useInsertionEffect((function(){var e=(function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(-1!==t.indexOf(O)||Array.isArray(m)&&0!==S(m,t).length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,n.transport.getState(O);case 4:o=e.sent,D("function"==typeof N?N(o):o);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,o=arguments;return new Promise((function(a,r){var n=e.apply(t,o);function E(e){i(n,a,r,E,_,"next",e)}function _(e){i(n,a,r,E,_,"throw",e)}E(void 0)}))});return function(e){return t.apply(this,arguments)}})(),t=s(e,R);return d&&(n.transport.on("NewState",t),A.current&&e([O])),function(){t.cancel(),n.transport.off("NewState",t)}}),[d]),_.useInsertionEffect((function(){A.current=!0}),[]),h}},7049:(e,t,o)=>{var a=o(71535),i=function(e){return e.notifications};e.exports=function(){return a({model:"ctx",map:i})}},83760:(e,t,o)=>{var a=o(67294);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=a.useRef(!1),i=a.useCallback((function(a){a.target.scrollTop+a.target.clientHeight>=a.target.scrollHeight-t?o.current||(o.current=!0,"function"==typeof e&&e(a)):o.current=!1}),[e]);return i}},43224:(e,t,o)=>{var a=o(67294);e.exports=function(){return a.useMemo((function(){return[window.navigator.standalone,window.matchMedia("(display-mode: standalone)").matches]}),[])}},50552:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{var a=o(71535);e.exports=function(){return a({model:"streaming_server"})}},91657:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=["className","autoFocus","disabled","children"];function i(e,t){if(null==e)return{};var o,a,i=(function(e,t){if(null==e)return{};var o,a,i={},r=Object.keys(e);for(a=0;a=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var r=o(67294),n=o(73935),E=o(45697),_=o(94184),s=o(56413).ZP,T=o(98795).useModalsContainer,S=r.forwardRef((function(e,t){var o=e.className,E=e.autoFocus,S=e.disabled,l=e.children,u=i(e,a),I=T();return n.createPortal(r.createElement(s,{ref:t,className:_(o,"modal-container"),autoFocus:!!E,disabled:!!S,lockProps:u},l),I)}));S.displayName="Modal",S.propTypes={className:E.string,autoFocus:E.bool,disabled:E.bool,children:E.node},e.exports=S},65717:(e,t,o)=>{var a=o(49900);e.exports=a},57033:(e,t,o)=>{var a=o(67294).createContext(null);a.displayName="ModalsContainerContext",e.exports=a},50115:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(50115),i=o(94163);e.exports={ModalsContainerProvider:a,useModalsContainer:i}},94163:(e,t,o)=>{var a=o(67294),i=o(57033);e.exports=function(){return a.useContext(i)}},59314:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(98795).ModalsContainerProvider,n=function(e){var t=e.children;return a.createElement("div",{className:"route-container"},a.createElement(r,null,a.createElement("div",{className:"route-content"},t)))};n.propTypes={children:i.node},e.exports=n},4777:(e,t,o)=>{var a=o(59314);e.exports=a},9010:(e,t,o)=>{var a=o(67294).createContext(!0);a.displayName="RouteFocusedContext",e.exports=a},16267:(e,t,o)=>{var a=o(9010),i=o(71517);e.exports={RouteFocusedProvider:a.Provider,useRouteFocused:i}},71517:(e,t,o)=>{var a=o(67294),i=o(9010);e.exports=function(){return a.useContext(i)}},88968:(e,t,o)=>{var a=["className","onPathNotMatch","onRouteChange"];function i(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return r(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var E=o(67294),_=o(59864),s=o(45697),T=o(94184),S=o(8575),l=o(72307),u=o(16267).RouteFocusedProvider,I=o(4777),d=o(33295),A=o(10598),c=function(e){var t=e.className,o=e.onPathNotMatch,r=e.onRouteChange,s=n(e,a),c=E.useMemo((function(){return s.viewsConfig}),[]),O=i(E.useState((function(){return Array(c.length).fill(null)})),2),R=O[0],N=O[1];return E.useLayoutEffect((function(){var e=function(){var e=S.parse(window.location.hash.slice(1)),t=e.pathname,a=e.query,i=new URLSearchParams("string"==typeof a?a:""),n=d(c,"string"==typeof t?t:"");if(null!==n){var E=A(n,"string"==typeof t?t:""),s=c.findIndex((function(e){return e.includes(n)})),T=c[s].findIndex((function(e){return e===n}));"function"==typeof r&&r(n,E,i)||N((function(e){return e.slice(0,c.length).map((function(e,t){return t{var a=o(88968);e.exports=a},33295:e=>{function t(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=(function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return o(e,t)})(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,E=!0,_=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return E=e.done,e},e:function(e){_=!0,n=e},f:function(){try{E||null==a.return||a.return()}finally{if(_)throw n}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{e.exports=function(e,t){var o=t.match(e.regexp);return e.urlParamsNames.reduce((function(e,t,a){return Array.isArray(o)&&"string"==typeof o[a+1]?e[t]=decodeURIComponent(o[a+1]):e[t]=null,e}),{path:t})}},21665:(e,t,o)=>{var a=o(16267).useRouteFocused,i=o(98795).useModalsContainer,r=o(65717),n=o(16013);e.exports={useRouteFocused:a,useModalsContainer:i,Modal:r,Router:n}},92788:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(95985).default,_=o(86590),s=_.Button,T=_.Image,S=o(72638),l=function(e){var t=e.className,o=e.id,i=e.name,_=e.version,l=e.logo,u=e.description,I=e.types,d=e.behaviorHints,A=e.installed,c=e.onToggle,O=e.onConfigure,R=e.onShare,N=e.dataset,m=n().t,p=a.useCallback((function(e){"function"==typeof c&&c({type:"toggle",nativeEvent:e.nativeEvent,reactEvent:e,dataset:N})}),[c,N]),L=a.useCallback((function(e){"function"==typeof O&&O({type:"configure",nativeEvent:e.nativeEvent,reactEvent:e,dataset:N})}),[O,N]),h=a.useCallback((function(e){"function"==typeof R&&R({type:"share",nativeEvent:e.nativeEvent,reactEvent:e,dataset:N})}),[R,N]),D=a.useCallback((function(e){"Enter"===e.key&&"function"==typeof c&&c({type:"toggle",nativeEvent:e.nativeEvent,reactEvent:e,dataset:N})}),[c,N]),f=a.useCallback((function(){return a.createElement(E,{className:S.icon,name:"addons"})}),[]);return a.createElement(s,{className:r(t,S["addon-container"]),onKeyDown:D},a.createElement("div",{className:S["logo-container"]},a.createElement(T,{className:S.logo,src:l,alt:" ",renderFallback:f})),a.createElement("div",{className:S["info-container"]},a.createElement("div",{className:S["name-container"],title:"string"==typeof i&&i.length>0?i:o},"string"==typeof i&&i.length>0?i:o),"string"==typeof _&&_.length>0?a.createElement("div",{className:S["version-container"],title:"v.".concat(_)},"v.",_):null,Array.isArray(I)&&I.length>0?a.createElement("div",{className:S["types-container"]},1===I.length?I.join(""):I.slice(0,-1).join(", ")+" & "+I[I.length-1]):null,"string"==typeof u&&u.length>0?a.createElement("div",{className:S["description-container"],title:u},u):null),a.createElement("div",{className:S["buttons-container"]},a.createElement("div",{className:S["action-buttons-container"]},!d.configurationRequired&&d.configurable?a.createElement(s,{className:S["configure-button-container"],title:m("ADDON_CONFIGURE"),tabIndex:-1,onClick:L},a.createElement(E,{className:S.icon,name:"settings"})):null,a.createElement(s,{className:A?S["uninstall-button-container"]:S["install-button-container"],title:A?m("ADDON_UNINSTALL"):d.configurationRequired?m("ADDON_CONFIGURE"):m("ADDON_INSTALL"),tabIndex:-1,onClick:!A&&d.configurationRequired?L:p},a.createElement("div",{className:S.label},A?m("ADDON_UNINSTALL"):d.configurationRequired?m("ADDON_CONFIGURE"):m("ADDON_INSTALL")))),a.createElement(s,{className:S["share-button-container"],title:m("SHARE_ADDON"),tabIndex:-1,onClick:h},a.createElement(E,{className:S.icon,name:"share"}),a.createElement("div",{className:S.label},m("SHARE_ADDON")))))};l.propTypes={className:i.string,id:i.string,name:i.string,version:i.string,logo:i.string,description:i.string,types:i.arrayOf(i.string),behaviorHints:i.shape({adult:i.bool,configurable:i.bool,configurationRequired:i.bool,p2p:i.bool}),installed:i.bool,onToggle:i.func,onConfigure:i.func,onShare:i.func,dataset:i.object},e.exports=l},84845:(e,t,o)=>{var a=o(92788);e.exports=a},92994:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?Q.manifest.name:Q.manifest.id),"string"==typeof Q.manifest.version&&Q.manifest.version.length>0?n.createElement("span",{className:g.version},"v. ",Q.manifest.version):null)),n.createElement(R,{className:g["share-prompt-container"],url:Q.transportUrl})):null,"string"==typeof B?n.createElement(l,{transportUrl:B,onCloseRequest:ee}):null)};B.propTypes={urlParams:E.shape({path:E.string,transportUrl:E.string,catalogId:E.string,type:E.string}),queryParams:E.instanceOf(URLSearchParams)};e.exports=p(B,(function(){return n.createElement(A,{className:g["addons-container"],route:"addons"})}))},57165:(e,t,o)=>{var a=o(92994);e.exports=a},60290:(e,t,o)=>{var a=o(67294);e.exports=function(e,t){var o=a.useMemo((function(){return t.get("addon")}),[t]),i=a.useCallback((function(o){var a=new URLSearchParams(t);"string"==typeof o?a.set("addon",o):a.delete("addon"),window.location.replace("#".concat(e.path,"?").concat(a))}),[e,t]);return[o,i]}},68061:(e,t,o)=>{var a=o(67294),i=o(86590).useModelState;e.exports=function(e){var t=a.useMemo((function(){return"string"!=typeof e.transportUrl&&"string"!=typeof e.catalogId?{action:"Load",args:{model:"InstalledAddonsWithFilters",args:{request:{type:"string"==typeof e.type?e.type:null}}}}:{action:"Unload"}}),[e]);return i({model:"installed_addons",action:t})}},8916:(e,t,o)=>{var a=o(67294),i=o(86590).useModelState;e.exports=function(e){var t=a.useMemo((function(){return"string"==typeof e.type&&"string"==typeof e.transportUrl&&"string"==typeof e.catalogId?{action:"Load",args:{model:"CatalogWithFilters",args:{request:{base:e.transportUrl,path:{resource:"addon_catalog",type:e.type,id:e.catalogId,extra:[]}}}}}:{action:"Unload"}}),[e]);return i({model:"remote_addons",action:t,deps:["ctx"]})}},40146:(e,t,o)=>{var a=o(67294),i=o(96073).t,r=o(86590).translateOption;e.exports=function(e,t){var o=a.useMemo((function(){return(function(e,t){var o={title:i("SELECT_CATALOG"),options:t.selectable.catalogs.concat(e.selectable.catalogs).map((function(e){var t=e.name;return{value:e.deepLinks.addons,label:r(t,"ADDON_"),title:r(t,"ADDON_")}})),selected:t.selectable.catalogs.concat(e.selectable.catalogs).filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})),renderLabelText:null!==t.selected?function(){var e=t.selectable.catalogs.find((function(e){return e.id===t.selected.request.path.id}));return e?r(e.name,"ADDON_"):t.selected.request.path.id}:null,onSelect:function(e){window.location=e.value}},a={title:i("SELECT_TYPE"),options:null!==e.selected?e.selectable.types.map((function(e){var t=e.type;return{value:e.deepLinks.addons,label:null!==t?r(t,"TYPE_"):i("TYPE_ALL")}})):t.selectable.types.map((function(e){var t=e.type;return{value:e.deepLinks.addons,label:r(t,"TYPE_")}})),selected:null!==e.selected?e.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})):t.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})),renderLabelText:function(){return null!==e.selected?null===e.selected.request.type?i("TYPE_ALL"):r(e.selected.request.type,"TYPE_"):null!==t.selected?r(t.selected.request.path.type,"TYPE_"):a.title},onSelect:function(e){window.location=e.value}};return[o,a]})(e,t)}),[e,t]);return o}},1180:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?1:0,L=r.useRef(),h=r.useCallback((function(){var e=c(L.current);if(null!==e){var t=Math.max(0,e.start-p-5),o=e.end-p+5;o0?r.createElement(S,{className:n(m["board-row"],m["continue-watching-row"],"animation-fade-in"),title:e("BOARD_CONTINUE_WATCHING"),items:o.items,itemComponent:l,deepLinks:o.deepLinks}):null,s.catalogs.map((function(e,t){var o;switch(null===(o=e.content)||void 0===o?void 0:o.type){case"Ready":return r.createElement(S,{key:t,className:n(m["board-row"],m["board-row-".concat(e.content.content[0].posterShape)],"animation-fade-in"),title:e.title,items:e.content.content,itemComponent:u,deepLinks:e.deepLinks});case"Err":return r.createElement(S,{key:t,className:n(m["board-row"],"animation-fade-in"),title:e.title,message:e.content.content,deepLinks:e.deepLinks});default:return r.createElement(S.Placeholder,{key:t,className:n(m["board-row"],m["board-row-poster"],"animation-fade-in"),title:e.title,deepLinks:e.deepLinks})}})))),null!==t.settings&&"Err"===t.settings.type?r.createElement(I,{className:m["board-warning-container"]}):null)}),(function(){return r.createElement("div",{className:m["board-container"]},r.createElement(T,{className:m["board-content-container"],route:"board"}))}))},88823:(e,t,o)=>{var a=o(1180);e.exports=a},76981:(e,t,o)=>{var a=o(67294),i=o(63662).useServices,r=o(86590).useModelState;e.exports=function(){var e=i().core,t=a.useMemo((function(){return{action:"Load",args:{model:"CatalogsWithExtra",args:{extra:[]}}}}),[]),o=a.useCallback((function(t){e.transport.dispatch({action:"CatalogsWithExtra",args:{action:"LoadRange",args:t}},"board")}),[]);return[r({model:"board",timeout:1500,action:t}),o]}},82916:(e,t,o)=>{var a=o(86590).useModelState;e.exports=function(){return a({model:"continue_watching_preview"})}},69694:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(69694);e.exports=a},30083:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t0?{action:"Load",args:{model:"CatalogWithFilters",args:{request:{base:e.transportUrl,path:{resource:"catalog",type:e.type,id:e.catalogId,extra:Array.from(t.entries())}}}}}:{action:"Unload"}}),[e,t]);return[s({model:"discover",action:i,map:T,deps:["ctx"]}),a]}},88674:(e,t,o)=>{function a(e){return(function(e){if(Array.isArray(e))return i(e)})(e)||(function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=["className","label","link","href","onToggle"];function i(){return i=Object.assign||function(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var n=o(67294),E=o(45697),_=o(94184),s=o(86590),T=s.Button,S=s.Checkbox,l=o(66947),u=n.forwardRef((function(e,t){var o=e.className,E=e.label,s=e.link,u=e.href,I=e.onToggle,d=r(e,a),A=n.useCallback((function(e){"function"==typeof d.onClick&&d.onClick(e),e.nativeEvent.togglePrevented||"function"!=typeof I||I({type:"toggle",reactEvent:e,nativeEvent:e.nativeEvent})}),[I,d.onClick]),c=n.useCallback((function(e){e.nativeEvent.togglePrevented=!0}),[]);return n.createElement(S,i({},d,{ref:t,className:_(o,l["consent-checkbox-container"]),onClick:A}),n.createElement("div",{className:l.label},E," ","string"==typeof s&&s.length>0&&"string"==typeof u&&u.length>0?n.createElement(T,{className:l.link,href:u,target:"_blank",tabIndex:-1,onClick:c},s):null))}));u.displayName="ConsentCheckbox",u.propTypes={className:E.string,checked:E.bool,label:E.string,link:E.string,href:E.string,onToggle:E.func,onClick:E.func},e.exports=u},6050:(e,t,o)=>{var a=o(82759);e.exports=a},12130:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(12130);e.exports=a},45398:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:{},t=e.user;if(!t||"string"!=typeof t.email||"string"!=typeof t.fbLoginToken)throw new Error("Login failed at getting token from Stremio");return{email:t.email,password:t.fbLoginToken}}))})).then((function(e){var t=e.email,o=e.password;a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Login",email:t,password:o,facebook:!0}}})})).catch((function(e){F(),Y({type:"error",error:e.message})}))}),[]),K=_.useCallback((function(){"string"==typeof H.email&&0!==H.email.length&&l.current.validity.valid?"string"==typeof H.password&&0!==H.password.length?(k(),a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Login",email:H.email,password:H.password}}})):Y({type:"error",error:"Invalid password"}):Y({type:"error",error:"Invalid email"})}),[H.email,H.password]),x=_.useCallback((function(){H.termsAccepted?window.location="#/":Y({type:"error",error:"You must accept the Terms of Service"})}),[H.termsAccepted]),j=_.useCallback((function(){"string"==typeof H.email&&0!==H.email.length&&l.current.validity.valid?"string"==typeof H.password&&0!==H.password.length?H.password===H.confirmPassword?H.termsAccepted?H.privacyPolicyAccepted?(k(),a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Register",email:H.email,password:H.password,gdpr_consent:{tos:H.termsAccepted,privacy:H.privacyPolicyAccepted,marketing:H.marketingAccepted,from:"web"}}}})):Y({type:"error",error:"You must accept the Privacy Policy"}):Y({type:"error",error:"You must accept the Terms of Service"}):Y({type:"error",error:"Passwords do not match"}):Y({type:"error",error:"Invalid password"}):Y({type:"error",error:"Invalid email"})}),[H.email,H.password,H.confirmPassword,H.termsAccepted,H.privacyPolicyAccepted,H.marketingAccepted]),Q=_.useCallback((function(e){Y({type:"change-credentials",name:"email",value:e.currentTarget.value})}),[]),X=_.useCallback((function(){A.current.focus()}),[]),$=_.useCallback((function(e){Y({type:"change-credentials",name:"password",value:e.currentTarget.value})}),[]),q=_.useCallback((function(){H.form===D?C.current.focus():K()}),[H.form,K]),J=_.useCallback((function(e){Y({type:"change-credentials",name:"confirmPassword",value:e.currentTarget.value})}),[]),Z=_.useCallback((function(){g.current.focus()}),[]),ee=_.useCallback((function(){Y({type:"toggle-checkbox",name:"termsAccepted"})}),[]),te=_.useCallback((function(){Y({type:"toggle-checkbox",name:"privacyPolicyAccepted"})}),[]),oe=_.useCallback((function(){Y({type:"toggle-checkbox",name:"marketingAccepted"})}),[]),ae=_.useCallback((function(){var e=new URLSearchParams([["form",H.form===D?f:D]]);window.location="#/intro?".concat(e.toString())}),[H.form]);return _.useEffect((function(){[f,D].includes(t.get("form"))&&Y({type:"set-form",form:t.get("form")})}),[t]),_.useEffect((function(){E&&"string"==typeof H.error&&H.error.length>0&&v.current.scrollIntoView()}),[H.error]),_.useEffect((function(){E&&l.current.focus()}),[H.form,E]),_.useEffect((function(){var e=function(e){var t=e.event,o=e.args;switch(t){case"UserAuthenticated":F(),E&&(window.location="#/");break;case"Error":"UserAuthenticated"===o.source.event&&F()}};return a.transport.on("CoreEvent",e),function(){a.transport.off("CoreEvent",e)}}),[E]),_.createElement("div",{className:h["intro-container"]},_.createElement("div",{className:h["background-container"]}),_.createElement("div",{className:h["heading-container"]},_.createElement("div",{className:h["logo-container"]},_.createElement(O,{className:h.logo,src:o(75631),alt:" "})),_.createElement("div",{className:h["title-container"]},"Freedom to Stream"),_.createElement("div",{className:h["slogan-container"]},"All the Video Content You Enjoy in One Place")),_.createElement("div",{className:h["content-container"]},_.createElement("div",{className:h["form-container"]},_.createElement(N,{ref:l,className:h["credentials-text-input"],type:"email",placeholder:"Email",value:H.email,onChange:Q,onSubmit:X}),_.createElement(N,{ref:A,className:h["credentials-text-input"],type:"password",placeholder:"Password",value:H.password,onChange:$,onSubmit:q}),H.form===D?_.createElement(_.Fragment,null,_.createElement(N,{ref:C,className:h["credentials-text-input"],type:"password",placeholder:"Confirm Password",value:H.confirmPassword,onChange:J,onSubmit:Z}),_.createElement(m,{ref:g,className:h["consent-checkbox"],label:"I have read and agree with the Stremio",link:"Terms and conditions",href:"https://www.stremio.com/tos",checked:H.termsAccepted,onToggle:ee}),_.createElement(m,{ref:B,className:h["consent-checkbox"],label:"I have read and agree with the Stremio",link:"Privacy Policy",href:"https://www.stremio.com/privacy",checked:H.privacyPolicyAccepted,onToggle:te}),_.createElement(m,{ref:P,className:h["consent-checkbox"],label:"I agree to receive marketing communications from Stremio",checked:H.marketingAccepted,onToggle:oe})):_.createElement("div",{className:h["forgot-password-link-container"]},_.createElement(c,{className:h["forgot-password-link"],onClick:W},"Forgot password?")),H.error.length>0?_.createElement("div",{ref:v,className:h["error-message"]},H.error):null,_.createElement(c,{className:T(h["form-button"],h["submit-button"]),onClick:H.form===D?j:K},_.createElement("div",{className:h.label},H.form===D?"Sign up":"Log in"))),_.createElement("div",{className:h["options-container"]},_.createElement(c,{className:T(h["form-button"],h["facebook-button"]),onClick:z},_.createElement(S,{className:h.icon,name:"facebook"}),_.createElement("div",{className:h.label},"Continue with Facebook")),H.form===D?_.createElement(c,{className:T(h["form-button"],h["login-form-button"]),onClick:ae},_.createElement("div",{className:h.label},"LOG IN")):null,H.form===f?_.createElement(c,{className:T(h["form-button"],h["signup-form-button"]),onClick:ae},_.createElement("div",{className:h.label},"SIGN UP WITH EMAIL")):null,H.form===D?_.createElement(c,{className:T(h["form-button"],h["guest-login-button"]),onClick:x},_.createElement("div",{className:h.label},"GUEST LOGIN")):null)),M?_.createElement(p,{email:H.email,onCloseRequest:b}):null,G?_.createElement(u,{className:h["loading-modal-container"]},_.createElement("div",{className:h["loader-container"]},_.createElement(S,{className:h.icon,name:"person"}),_.createElement("div",{className:h.label},"Authenticating..."))):null)};C.propTypes={queryParams:s.instanceOf(URLSearchParams)},e.exports=C},21517:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&u.current.validity.valid?window.open("https://www.strem.io/reset-password/"+u.current.value,"_blank"):l("Invalid email")}),[]),d=r.useMemo((function(){return[{className:T["cancel-button"],label:"Cancel",props:{onClick:o}},{label:"Send",props:{onClick:I}}]}),[o]),A=r.useCallback((function(){l("")}),[]);return r.useEffect((function(){i&&u.current.focus()}),[i]),r.createElement(_,{className:T["password-reset-modal-container"],title:"Password reset",buttons:d,onCloseRequest:o},r.createElement(s,{ref:u,className:T["credentials-text-input"],type:"email",placeholder:"Email",defaultValue:"string"==typeof t?t:"",onChange:A,onSubmit:I}),S.length>0?r.createElement("div",{className:T["error-message"]},S):null)};S.propTypes={email:n.string,onCloseRequest:n.func},e.exports=S},2015:(e,t,o)=>{var a=o(21517);e.exports=a},16732:(e,t,o)=>{var a=o(45398);e.exports=a},44167:(e,t,o)=>{var a=o(67294);e.exports=function(){var e=a.useCallback((function(){return new Promise((function(e,t){"undefined"!=typeof FB?FB.getLoginStatus((function(o){o&&o.authResponse&&"string"==typeof o.authResponse.accessToken?e(o.authResponse.accessToken):FB.login((function(o){o&&o.authResponse&&"string"==typeof o.authResponse.accessToken?e(o.authResponse.accessToken):t(new Error("Failed to get token from Facebook"))}))})):t(new Error("Failed to connect to Facebook"))}))}),[]);return a.useEffect((function(){window.fbAsyncInit=function(){FB.init({appId:"1537119779906825",status:!0,xfbml:!1,version:"v2.7"})};var e=document.createElement("script");return e.src="https://connect.facebook.net/en_US/sdk.js",e.async=!0,e.defer=!0,document.body.appendChild(e),function(){document.body.removeChild(e)}}),[]),e}},68171:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(68171);e.exports=a},53242:(e,t,o)=>{var a=o(67294),i=o(86590).useModelState;e.exports=function(e,t,o){var r=a.useMemo((function(){return{action:"Load",args:{model:"LibraryWithFilters",args:{request:{type:"string"==typeof t.type?t.type:null,sort:o.has("sort")?o.get("sort"):void 0,page:o.has("page")?parseInt(o.get("page"),10):void 0}}}}}),[t,o]);return i({model:e,action:r})}},62948:(e,t,o)=>{var a=o(67294),i=o(81468).useTranslation,r=o(86590).translateOption;e.exports=function(e){var t=i().t,o=a.useMemo((function(){return(function(e,t){return[{title:t("SELECT_TYPE"),options:e.selectable.types.map((function(e){var o=e.type;return{value:e.deepLinks.library,label:null===o?t("TYPE_ALL"):r(o,"TYPE_")}})),selected:e.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.library})),onSelect:function(e){window.location=e.value}},{title:t("SELECT_SORT"),options:e.selectable.sorts.map((function(e){var t=e.sort;return{value:e.deepLinks.library,label:r(t,"SORT_")}})),selected:e.selectable.sorts.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.library})),onSelect:function(e){window.location=e.value}},e.selectable.prevPage||e.selectable.nextPage?{label:e.selected.request.page.toString(),onSelect:function(t){"prev"===t.value&&e.selectable.prevPage&&(window.location=e.selectable.prevPage.deepLinks.library),"next"===t.value&&e.selectable.nextPage&&(window.location=e.selectable.nextPage.deepLinks.library)}}:null]})(e,t)}),[e]);return o}},88493:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?r.createElement(T,{className:p["vertical-nav-bar"],tabs:f,selected:null!==C?C.url:null}):null,null===P?r.createElement(d,{delay:500},r.createElement("div",{className:p["meta-message-container"]},r.createElement(I,{className:p.image,src:o(47740),alt:" "}),r.createElement("div",{className:p["message-label"]},"No meta was selected!"))):null===s.metaItem?r.createElement("div",{className:p["meta-message-container"]},r.createElement(I,{className:p.image,src:o(47740),alt:" "}),r.createElement("div",{className:p["message-label"]},"No addons ware requested for this meta!")):"Err"===s.metaItem.content.type?r.createElement("div",{className:p["meta-message-container"]},r.createElement(I,{className:p.image,src:o(47740),alt:" "}),r.createElement("div",{className:p["message-label"]},"No metadata was found!")):"Loading"===s.metaItem.content.type?r.createElement(l.Placeholder,{className:p["meta-preview"]}):r.createElement(r.Fragment,null,"string"==typeof s.metaItem.content.content.background&&s.metaItem.content.content.background.length>0?r.createElement("div",{className:p["background-image-layer"]},r.createElement(I,{className:p["background-image"],src:s.metaItem.content.content.background,renderFallback:G,alt:" "})):null,r.createElement(l,{className:E(p["meta-preview"],"animation-fade-in"),name:s.metaItem.content.content.name,logo:s.metaItem.content.content.logo,runtime:s.metaItem.content.content.runtime,releaseInfo:s.metaItem.content.content.releaseInfo,released:s.metaItem.content.content.released,description:null!==y&&"string"==typeof y.overview&&y.overview.length>0?y.overview:s.metaItem.content.content.description,links:s.metaItem.content.content.links,trailerStreams:s.metaItem.content.content.trailerStreams,inLibrary:s.metaItem.content.content.inLibrary,toggleInLibrary:s.metaItem.content.content.inLibrary?W:M})),r.createElement("div",{className:p.spacing}),null!==v?r.createElement(c,{className:p["streams-list"],streams:s.streams,video:y}):null!==P?r.createElement(O,{className:p["videos-list"],metaItem:s.metaItem,libraryItem:s.libraryItem,season:L,seasonOnSelect:U,toggleNotifications:b}):null),null!==C?r.createElement(u,{className:p["meta-extension-modal-container"],title:C.name,onCloseRequest:g},r.createElement("iframe",{className:p["meta-extension-modal-iframe"],sandbox:"allow-forms allow-scripts allow-same-origin",src:C.url})):null)};L.propTypes={urlParams:n.shape({type:n.string,id:n.string,videoId:n.string}),queryParams:n.instanceOf(URLSearchParams)};e.exports=A(L,(function(){return r.createElement("div",{className:p["metadetails-container"]},r.createElement(S,{className:p["nav-bar"],backButton:!0,addonsButton:!0,fullscreenButton:!0,navMenu:!0}))}))},72742:(e,t,o)=>{var a=["className","videoId","videoReleased","addonName","name","description","thumbnail","progress","deepLinks"];function i(e,t){if(null==e)return{};var o,a,i=(function(e,t){if(null==e)return{};var o,a,i={},r=Object.keys(e);for(a=0;a=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var r=o(67294),n=o(45697),E=o(94184),_=o(95985).default,s=o(86590),T=s.Button,S=s.Image,l=s.useProfile,u=s.platform,I=s.useToast,d=o(63662).useServices,A=o(34134),c=o(63458),O=function(e){var t=e.className,o=e.videoId,n=e.videoReleased,s=e.addonName,A=e.name,O=e.description,R=e.thumbnail,N=e.progress,m=e.deepLinks,p=i(e,a),L=l(),h=I(),D=d().core,f=r.useMemo((function(){return m?m.externalPlayer?m.externalPlayer.web?m.externalPlayer.web:m.externalPlayer.openPlayer?m.externalPlayer.openPlayer[u.name]?m.externalPlayer.openPlayer[u.name]:m.externalPlayer.playlist:m.player:m.player:null}),[m]),C=r.useMemo((function(){var e;return f===(null==m||null===(e=m.externalPlayer)||void 0===e?void 0:e.playlist)?m.externalPlayer.fileName:null}),[f,m]),g=r.useMemo((function(){var e;return f===(null==m||null===(e=m.externalPlayer)||void 0===e?void 0:e.web)?"_blank":null}),[f,m]),B=r.useCallback((function(){"string"==typeof o&&D.transport.dispatch({action:"MetaDetails",args:{action:"MarkVideoAsWatched",args:[{id:o,released:n},!0]}})}),[o,n]),P=r.useCallback((function(e){null!==L.settings.playerType&&(B(),h.show({type:"success",title:"Stream opened in external player",timeout:4e3})),"function"==typeof p.onClick&&p.onClick(e)}),[p.onClick,L.settings,B]),v=r.useCallback((function(){return r.createElement(_,{className:c["placeholder-icon"],name:"ic_broken_link"})}),[]);return r.createElement(T,{className:E(t,c["stream-container"]),title:s,href:f,download:C,target:g,onClick:P},r.createElement("div",{className:c["info-container"]},"string"==typeof R&&R.length>0?r.createElement("div",{className:c["thumbnail-container"],title:A||s},r.createElement(S,{className:c.thumbnail,src:R,alt:" ",renderFallback:v})):r.createElement("div",{className:c["addon-name-container"],title:A||s},r.createElement("div",{className:c["addon-name"]},A||s)),null!==N&&!isNaN(N)&&N>0?r.createElement("div",{className:c["progress-bar-container"]},r.createElement("div",{className:c["progress-bar"],style:{width:"".concat(N,"%")}}),r.createElement("div",{className:c["progress-bar-background"]})):null),r.createElement("div",{className:c["description-container"],title:O},O),r.createElement(_,{className:c.icon,name:"play"}))};O.Placeholder=A,O.propTypes={className:n.string,videoId:n.string,videoReleased:n.instanceOf(Date),addonName:n.string,name:n.string,description:n.string,thumbnail:n.string,progress:n.number,deepLinks:n.shape({player:n.string,externalPlayer:n.shape({download:n.string,streaming:n.string,playlist:n.string,fileName:n.string,web:n.string,openPlayer:n.shape({ios:n.string,android:n.string,windows:n.string,macos:n.string,linux:n.string})})}),onClick:n.func},e.exports=O},63210:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(60926),E=o(81384),_=function(e){var t=e.className;return a.createElement("div",{className:r(t,E["stream-placeholder-container"])},a.createElement("div",{className:E["addon-container"]},a.createElement("div",{className:E["addon-name"]})),a.createElement("div",{className:E["info-container"]},a.createElement("div",{className:E["description-container"]}),a.createElement("div",{className:E["description-container"]})),a.createElement(n,{className:E["play-icon"]}))};_.propTypes={className:i.string},e.exports=_},34134:(e,t,o)=>{var a=o(63210);e.exports=a},24674:(e,t,o)=>{var a=o(72742);e.exports=a},14176:(e,t,o)=>{var a=["className","video"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var u=o(67294),I=o(45697),d=o(94184),A=o(81468).useTranslation,c=o(95985).default,O=o(86590),R=O.Button,N=O.Image,m=O.Multiselect,p=o(63662).useServices,L=o(24674),h=o(36796),D="ALL",f=function(e){var t=e.className,n=e.video,_=l(e,a),T=A().t,S=p().core,I=s(u.useState(D),2),O=I[0],f=I[1],C=u.useCallback((function(e){f(e.value)}),[]),g=u.useCallback((function(){window.history.back()}),[]),B=u.useMemo((function(){return _.streams.filter((function(e){return"Loading"===e.content.type})).length}),[_.streams]),P=u.useMemo((function(){return _.streams.filter((function(e){return"Ready"===e.content.type})).reduce((function(e,t){return e[t.addon.transportUrl]={addon:t.addon,streams:t.content.content.map((function(e){return E(E({},e),{},{onClick:function(){S.transport.analytics({event:"StreamClicked",args:{stream:e}})},addonName:t.addon.manifest.name})}))},e}),{})}),[_.streams]),v=u.useMemo((function(){return O===D?Object.values(P).map((function(e){return e.streams})).flat(1):P[O]?P[O].streams:[]}),[P,O]),y=u.useMemo((function(){return{title:"Select Addon",options:[{value:D,label:T("ALL_ADDONS"),title:T("ALL_ADDONS")}].concat(r(Object.keys(P).map((function(e){return{value:e,label:P[e].addon.manifest.name,title:P[e].addon.manifest.name}})))),selected:[O],onSelect:C}}),[P,O]);return u.createElement("div",{className:d(t,h["streams-list-container"])},0===_.streams.length?u.createElement("div",{className:h["message-container"]},u.createElement(N,{className:h.image,src:o(47740),alt:" "}),u.createElement("div",{className:h.label},"No addons were requested for streams!")):_.streams.every((function(e){return"Err"===e.content.type}))?u.createElement("div",{className:h["message-container"]},u.createElement(N,{className:h.image,src:o(47740),alt:" "}),u.createElement("div",{className:h.label},T("NO_STREAM"))):0===v.length?u.createElement("div",{className:h["streams-container"]},u.createElement(L.Placeholder,null),u.createElement(L.Placeholder,null)):u.createElement(u.Fragment,null,B>0?u.createElement("div",{className:h["addons-loading-container"]},u.createElement("div",{className:h["addons-loading"]},B," ",T("MOBILE_ADDONS_LOADING")),u.createElement("span",{className:h["addons-loading-bar"]})):null,u.createElement("div",{className:h["select-choices-wrapper"]},n?u.createElement(u.Fragment,null,u.createElement(R,{className:d(h["button-container"],h["back-button-container"]),tabIndex:-1,onClick:g},u.createElement(c,{className:h.icon,name:"chevron-back"})),u.createElement("div",{className:h["episode-title"]},"S".concat(null==n?void 0:n.season,"E").concat(null==n?void 0:n.episode," ").concat(null==n?void 0:n.title))):null,Object.keys(P).length>1?u.createElement(m,i({},y,{className:h["select-input-container"]})):null),u.createElement("div",{className:h["streams-container"]},v.map((function(e,t){return u.createElement(L,{key:t,videoId:null==n?void 0:n.id,videoReleased:null==n?void 0:n.released,addonName:e.addonName,name:e.name,description:e.description,thumbnail:e.thumbnail,progress:e.progress,deepLinks:e.deepLinks,onClick:e.onClick})})))),u.createElement(R,{className:h["install-button-container"],title:T("ADDON_CATALOGUE_MORE"),href:"#/addons"},u.createElement(c,{className:h.icon,name:"addons"}),u.createElement("div",{className:h.label},T("ADDON_CATALOGUE_MORE"))))};f.propTypes={className:I.string,streams:I.arrayOf(I.object).isRequired,video:I.object},e.exports=f},42231:(e,t,o)=>{var a=o(14176);e.exports=a},42813:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(96073).t,E=o(95985).default,_=o(86590),s=_.Button,T=_.Multiselect,S=o(53570),l=o(56351),u=function(e){var t=e.className,o=e.seasons,i=e.season,_=e.onSelect,S=a.useMemo((function(){return o.map((function(e){return{value:String(e),label:e>0?"".concat(n("SEASON")," ").concat(e):n("SPECIAL")}}))}),[o]),u=a.useMemo((function(){return[String(i)]}),[i]),I=a.useCallback((function(e){if("function"==typeof _){var t=o.indexOf(i),a="next"===e.currentTarget.dataset.action?t+1=0?t-1:0,r=o[a];_({type:"select",value:r,reactEvent:e,nativeEvent:e.nativeEvent})}}),[i,o,_]),d=a.useCallback((function(e){var t=parseFloat(e.value);"function"==typeof _&&_({type:"select",value:t,reactEvent:e.reactEvent,nativeEvent:e.nativeEvent})}),[_]);return a.createElement("div",{className:r(t,l["seasons-bar-container"])},a.createElement(s,{className:l["prev-season-button"],title:"Previous season","data-action":"prev",onClick:I},a.createElement(E,{className:l.icon,name:"chevron-back"}),a.createElement("div",{className:l.label},"Prev")),a.createElement(T,{className:l["seasons-popup-label-container"],title:i>0?"".concat(n("SEASON")," ").concat(i):n("SPECIAL"),direction:"bottom-left",options:S,selected:u,onSelect:d}),a.createElement(s,{className:l["next-season-button"],title:"Next season","data-action":"next",onClick:I},a.createElement("div",{className:l.label},"Next"),a.createElement(E,{className:l.icon,name:"chevron-forward"})))};u.Placeholder=S,u.propTypes={className:i.string,seasons:i.arrayOf(i.number).isRequired,season:i.number.isRequired,onSelect:i.func},e.exports=u},89319:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(32180),_=function(e){var t=e.className;return a.createElement("div",{className:r(t,E["seasons-bar-placeholder-container"])},a.createElement("div",{className:E["prev-season-button"]},a.createElement(n,{className:E.icon,name:"chevron-back"}),a.createElement("div",{className:E.label},"Prev")),a.createElement("div",{className:E["seasons-popup-label-container"]},a.createElement("div",{className:E["seasons-popup-label"]},"Season 1"),a.createElement(n,{className:E["seasons-popup-icon"],name:"caret-down"})),a.createElement("div",{className:E["next-season-button"]},a.createElement("div",{className:E.label},"Next"),a.createElement(n,{className:E.icon,name:"chevron-forward"})))};_.propTypes={className:i.string},e.exports=_},53570:(e,t,o)=>{var a=o(89319);e.exports=a},23424:(e,t,o)=>{var a=o(42813);e.exports=a},32824:(e,t,o)=>{var a=["className","id","title","thumbnail","episode","released","upcoming","watched","progress","scheduled","deepLinks"],i=["className","id","title","thumbnail","episode","released","upcoming","watched","progress","scheduled","children"];function r(){return r=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var s=o(67294),T=o(45697),S=o(94184),l=o(96073).t,u=o(63662).useServices,I=o(21665).useRouteFocused,d=o(95985).default,A=o(86590),c=A.Button,O=A.Image,R=A.Popup,N=A.useBinaryState,m=o(9922),p=o(14486),L=function(e){var t=e.className,o=e.id,E=e.title,T=e.thumbnail,A=e.episode,m=e.released,L=e.upcoming,h=e.watched,D=e.progress,f=e.scheduled,C=e.deepLinks,g=_(e,a),B=u().core,P=I(),v=n(N(!1),4),y=v[0],M=v[2],W=v[3],b=s.useCallback((function(e){e.nativeEvent.togglePopupPrevented||(e.nativeEvent.ctrlKey||2===e.nativeEvent.button)&&(e.preventDefault(),W())}),[]),U=s.useCallback((function(e){e.nativeEvent.togglePopupPrevented||e.nativeEvent.ctrlKey||e.preventDefault()}),[W]),G=s.useCallback((function(e){"mouse"===e.nativeEvent.pointerType||e.nativeEvent.togglePopupPrevented||W()}),[W]),k=s.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),F=s.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),w=s.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),V=s.useCallback((function(e){e.nativeEvent.buttonClickPrevented=!0}),[]),H=s.useCallback((function(e){e.preventDefault(),M(),B.transport.dispatch({action:"MetaDetails",args:{action:"MarkVideoAsWatched",args:[{id:o,released:m},!h]}})}),[o,m,h]),Y=s.useMemo((function(){return C?"string"==typeof C.player?C.player:"string"==typeof C.metaDetailsStreams?C.metaDetailsStreams:null:null}),[C]),z=s.useMemo((function(){return function(e){var t=e.className,o=e.id,a=e.title,n=e.thumbnail,E=e.episode,T=e.released,l=e.upcoming,u=e.watched,I=e.progress,A=e.scheduled,R=e.children,N=_(e,i);return s.createElement(c,r({},N,{className:S(t,p["video-container"]),title:a}),"string"==typeof n&&n.length>0?s.createElement("div",{className:p["thumbnail-container"]},s.createElement(O,{className:p.thumbnail,src:n,alt:" ",renderFallback:function(){return s.createElement(d,{className:p["placeholder-icon"],name:"symbol"})}}),null!==I&&!isNaN(I)&&I>0?s.createElement("div",{className:p["progress-bar-container"]},s.createElement("div",{className:p["progress-bar"],style:{width:"".concat(I,"%")}}),s.createElement("div",{className:p["progress-bar-background"]})):null):null,s.createElement("div",{className:p["info-container"]},s.createElement("div",{className:p["title-container"]},null===E||isNaN(E)?null:"".concat(E,". "),"string"==typeof a&&a.length>0?a:o),s.createElement("div",{className:p["flex-row-container"]},T instanceof Date&&!isNaN(T.getTime())?s.createElement("div",{className:p["released-container"]},T.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric"})):A?s.createElement("div",{className:p["released-container"],title:"To be announced"},"TBA"):null,s.createElement("div",{className:p["upcoming-watched-container"]},l?s.createElement("div",{className:p["upcoming-container"]},s.createElement("div",{className:p["flag-label"]},"Upcoming")):null,u?s.createElement("div",{className:p["watched-container"]},s.createElement(d,{className:p["flag-icon"],name:"eye"}),s.createElement("div",{className:p["flag-label"]},"Watched")):null))),R)}}),[]),K=s.useMemo((function(){return function(){return s.createElement("div",{className:p["context-menu-content"],onPointerDown:k,onContextMenu:F,onClick:w,onKeyDown:V},s.createElement(c,{className:p["context-menu-option-container"],title:"Watch"},s.createElement("div",{className:p["context-menu-option-label"]},l("CTX_WATCH"))),s.createElement(c,{className:p["context-menu-option-container"],title:h?"Mark as non-watched":"Mark as watched",onClick:H},s.createElement("div",{className:p["context-menu-option-label"]},l(h?"CTX_MARK_NON_WATCHED":"CTX_MARK_WATCHED"))))}}),[h,H]);return s.useEffect((function(){P||M()}),[P]),s.createElement(R,r({className:t,id:o,title:E,thumbnail:T,episode:A,released:m,upcoming:L,watched:h,progress:D,scheduled:f,href:Y},g,{onMouseUp:b,onLongPress:G,onContextMenu:U,open:y,onCloseRequest:M,renderLabel:z,renderMenu:K}))};L.Placeholder=m,L.propTypes={className:T.string,id:T.string,title:T.string,thumbnail:T.string,episode:T.number,released:T.instanceOf(Date),upcoming:T.bool,watched:T.bool,progress:T.number,scheduled:T.bool,deepLinks:T.shape({metaDetailsStreams:T.string,player:T.string})},e.exports=L},38509:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(75507),E=function(e){var t=e.className;return a.createElement("div",{className:r(t,n["video-placeholder-container"])},a.createElement("div",{className:n["info-container"]},a.createElement("div",{className:n["name-container"]}),a.createElement("div",{className:n["released-container"]})))};E.propTypes={className:i.string},e.exports=E},9922:(e,t,o)=>{var a=o(38509);e.exports=a},90123:(e,t,o)=>{var a=o(32824);e.exports=a},41702:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?e[e.length-1]:N.length>0?N[N.length-1]:null}),[N,s]),p=r.useMemo((function(){return R.filter((function(e){return null===m||e.season===m})).sort((function(e,t){return e.episode-t.episode}))}),[R,m]),L=a(r.useState(""),2),h=L[0],D=L[1],f=r.useCallback((function(e){D(e.currentTarget.value)}),[]);return r.createElement("div",{className:E(t,d["videos-list-container"])},i&&"Loading"!==i.content.type?"Err"===i.content.type||0===p.length?r.createElement("div",{className:d["message-container"]},r.createElement(T,{className:d.image,src:o(47740),alt:" "}),r.createElement("div",{className:d.label},"No videos found for this meta!")):r.createElement(r.Fragment,null,O&&n?r.createElement(l,{className:d["notifications-checkbox"],checked:!n.state.noNotif,onClick:c},_("DETAIL_RECEIVE_NOTIF_SERIES")):null,N.length>0?r.createElement(u,{className:d["seasons-bar"],season:m,seasons:N,onSelect:A}):null,r.createElement(S,{className:d["search-bar"],title:_("SEARCH_VIDEOS"),value:h,onChange:f}),r.createElement("div",{className:d["videos-container"]},p.filter((function(e){return 0===h.length||"string"==typeof e.title&&e.title.toLowerCase().includes(h.toLowerCase())||!isNaN(e.released.getTime())&&e.released.toLocaleString(void 0,{year:"2-digit",month:"short",day:"numeric"}).toLowerCase().includes(h.toLowerCase())})).map((function(e,t){return r.createElement(I,{key:t,id:e.id,title:e.title,thumbnail:e.thumbnail,episode:e.episode,released:e.released,upcoming:e.upcoming,watched:e.watched,progress:e.progress,deepLinks:e.deepLinks,scheduled:e.scheduled})})))):r.createElement(r.Fragment,null,r.createElement(u.Placeholder,{className:d["seasons-bar"]}),r.createElement(S.Placeholder,{className:d["search-bar"],title:_("SEARCH_VIDEOS")}),r.createElement("div",{className:d["videos-scroll-container"]},r.createElement(I.Placeholder,null),r.createElement(I.Placeholder,null),r.createElement(I.Placeholder,null),r.createElement(I.Placeholder,null),r.createElement(I.Placeholder,null))))};A.propTypes={className:n.string,metaItem:n.object,libraryItem:n.object,season:n.number,seasonOnSelect:n.func,toggleNotifications:n.func},e.exports=A},48437:(e,t,o)=>{var a=o(41702);e.exports=a},69005:(e,t,o)=>{var a=o(88493);e.exports=a},48450:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(67294);e.exports=function(e,t){var o=a.useMemo((function(){return t.has("season")&&!isNaN(t.get("season"))?parseInt(t.get("season"),10):null}),[t]),i=a.useCallback((function(o){var a=new URLSearchParams(t);a.set("season",o),window.location.replace("#".concat(e.path,"?").concat(a))}),[e,t]);return[o,i]}},39096:(e,t,o)=>{var a=o(67294),i=o(86590),r=i.Image,n=i.HorizontalNavBar,E=o(25142);e.exports=function(){return a.createElement("div",{className:E["not-found-container"]},a.createElement(n,{className:E["nav-bar"],title:"Page not found",backButton:!0,fullscreenButton:!0,navMenu:!0}),a.createElement("div",{className:E["not-found-content"]},a.createElement(r,{className:E["not-found-image"],src:o(47740),alt:" "}),a.createElement("div",{className:E["not-found-label"]},"Page not found!")))}},50353:(e,t,o)=>{var a=o(39096);e.exports=a},29579:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(86590).Image,E=o(91391),_=function(e){var t=e.className,i=e.logo;return a.createElement("div",{className:r(t,E["buffering-loader-container"])},a.createElement(n,{className:E["buffering-loader"],src:i,alt:" ",fallbackSrc:o(35313)}))};_.propTypes={className:i.string,logo:i.string},e.exports=_},33475:(e,t,o)=>{var a=o(29579);e.exports=a},95531:(e,t,o)=>{var a=["className","paused","time","duration","buffered","volume","muted","playbackSpeed","subtitlesTracks","audioTracks","metaItem","nextVideo","stream","statistics","onPlayRequested","onPauseRequested","onNextVideoRequested","onMuteRequested","onUnmuteRequested","onVolumeChangeRequested","onSeekRequested","onToggleSubtitlesMenu","onToggleInfoMenu","onToggleSpeedMenu","onToggleVideosMenu","onToggleOptionsMenu","onToggleStatisticsMenu"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(95985).default,l=o(86590).Button,u=o(63662).useServices,I=o(85280),d=o(47429),A=o(90578),c=o(86590).useBinaryState,O=o(96073).t,R=function(e){var t,o,n=e.className,s=e.paused,R=e.time,N=e.duration,m=e.buffered,p=e.volume,L=e.muted,h=e.playbackSpeed,D=e.subtitlesTracks,f=e.audioTracks,C=e.metaItem,g=e.nextVideo,B=e.stream,P=e.statistics,v=e.onPlayRequested,y=e.onPauseRequested,M=e.onNextVideoRequested,W=e.onMuteRequested,b=e.onUnmuteRequested,U=e.onVolumeChangeRequested,G=e.onSeekRequested,k=e.onToggleSubtitlesMenu,F=e.onToggleInfoMenu,w=e.onToggleSpeedMenu,V=e.onToggleVideosMenu,H=e.onToggleOptionsMenu,Y=e.onToggleStatisticsMenu,z=E(e,a),K=u().chromecast,x=r(_.useState((function(){return K.active})),2),j=x[0],Q=x[1],X=r(c(!1),4),$=X[0],q=X[3],J=_.useCallback((function(e){e.nativeEvent.subtitlesMenuClosePrevented=!0}),[]),Z=_.useCallback((function(e){e.nativeEvent.infoMenuClosePrevented=!0}),[]),ee=_.useCallback((function(e){e.nativeEvent.speedMenuClosePrevented=!0}),[]),te=_.useCallback((function(e){e.nativeEvent.videosMenuClosePrevented=!0}),[]),oe=_.useCallback((function(e){e.nativeEvent.optionsMenuClosePrevented=!0}),[]),ae=_.useCallback((function(e){e.nativeEvent.statisticsMenuClosePrevented=!0}),[]),ie=_.useCallback((function(){s?"function"==typeof v&&v():"function"==typeof y&&y()}),[s,v,y]),re=_.useCallback((function(){null!==g&&"function"==typeof M&&M()}),[g,M]),ne=_.useCallback((function(){L?"function"==typeof b&&b():"function"==typeof W&&W()}),[L,W,b]),Ee=_.useCallback((function(){"function"==typeof k&&k()}),[k]),_e=_.useCallback((function(){"function"==typeof F&&F()}),[F]),se=_.useCallback((function(){"function"==typeof w&&w()}),[w]),Te=_.useCallback((function(){"function"==typeof V&&V()}),[V]),Se=_.useCallback((function(){"function"==typeof H&&H()}),[H]),le=_.useCallback((function(){"function"==typeof Y&&Y()}),[Y]),ue=_.useCallback((function(){K.transport.requestSession()}),[]);return _.useEffect((function(){var e=function(){Q(K.active)};return K.on("stateChanged",e),function(){K.off("stateChanged",e)}}),[]),_.createElement("div",i({},z,{className:T(n,A["control-bar-container"])}),_.createElement(I,{className:A["seek-bar"],time:R,duration:N,buffered:m,onSeekRequested:G}),_.createElement("div",{className:A["control-bar-buttons-container"]},_.createElement(l,{className:T(A["control-bar-button"],{disabled:"boolean"!=typeof s}),title:O(s?"PLAYER_PLAY":"PLAYER_PAUSE"),tabIndex:-1,onClick:ie},_.createElement(S,{className:A.icon,name:"boolean"!=typeof s||s?"play":"pause"})),null!==g?_.createElement(l,{className:T(A["control-bar-button"]),title:O("PLAYER_NEXT_VIDEO"),tabIndex:-1,onClick:re},_.createElement(S,{className:A.icon,name:"next"})):null,_.createElement(l,{className:T(A["control-bar-button"],{disabled:"boolean"!=typeof L}),title:O(L?"PLAYER_UNMUTE":"PLAYER_MUTE"),tabIndex:-1,onClick:ne},_.createElement(S,{className:A.icon,name:"boolean"==typeof L&&L?"volume-mute":null===p||isNaN(p)?"volume-off":p<30?"volume-low":p<70?"volume-medium":"volume-high"})),_.createElement(d,{className:A["volume-slider"],volume:p,onVolumeChangeRequested:U}),_.createElement("div",{className:A.spacing}),_.createElement(l,{className:A["control-bar-buttons-menu-button"],onClick:q},_.createElement(S,{className:A.icon,name:"more-vertical"})),_.createElement("div",{className:T(A["control-bar-buttons-menu-container"],{open:$})},_.createElement(l,{className:T(A["control-bar-button"],{disabled:null===P||"Err"===P.type||null===B||"string"!=typeof B.infoHash||"number"!=typeof B.fileIdx}),tabIndex:-1,onMouseDown:ae,onClick:le},_.createElement(S,{className:A.icon,name:"network"})),_.createElement(l,{className:T(A["control-bar-button"],{disabled:null===h}),tabIndex:-1,onMouseDown:ee,onClick:se},_.createElement(S,{className:A.icon,name:"speed"})),_.createElement(l,{className:T(A["control-bar-button"],{disabled:null===C||"Ready"!==C.type}),tabIndex:-1,onMouseDown:Z,onClick:_e},_.createElement(S,{className:A.icon,name:"about"})),_.createElement(l,{className:T(A["control-bar-button"],{disabled:!j}),tabIndex:-1,onClick:ue},_.createElement(S,{className:A.icon,name:"cast"})),_.createElement(l,{className:T(A["control-bar-button"],{disabled:!(Array.isArray(D)&&0!==D.length||Array.isArray(f)&&0!==f.length)}),tabIndex:-1,onMouseDown:J,onClick:Ee},_.createElement(S,{className:A.icon,name:"subtitles"})),(null==C||null===(t=C.content)||void 0===t||null===(o=t.videos)||void 0===o?void 0:o.length)>0?_.createElement(l,{className:A["control-bar-button"],tabIndex:-1,onMouseDown:te,onClick:Te},_.createElement(S,{className:A.icon,name:"episodes"})):null,_.createElement(l,{className:A["control-bar-button"],tabIndex:-1,onMouseDown:oe,onClick:Se},_.createElement(S,{className:A.icon,name:"more-horizontal"})))))};R.propTypes={className:s.string,paused:s.bool,time:s.number,duration:s.number,buffered:s.number,volume:s.number,muted:s.bool,playbackSpeed:s.number,subtitlesTracks:s.array,audioTracks:s.array,metaItem:s.object,nextVideo:s.object,stream:s.object,statistics:s.object,onPlayRequested:s.func,onPauseRequested:s.func,onNextVideoRequested:s.func,onMuteRequested:s.func,onUnmuteRequested:s.func,onVolumeChangeRequested:s.func,onSeekRequested:s.func,onToggleSubtitlesMenu:s.func,onToggleInfoMenu:s.func,onToggleSpeedMenu:s.func,onToggleVideosMenu:s.func,onToggleOptionsMenu:s.func,onToggleStatisticsMenu:s.func},e.exports=R},36181:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var t=function(e){return("0"+e).slice(-1*Math.max(e.toString().length,2))};e.exports=function(e){if(null===e||isNaN(e))return"--:--:--";var o=Math.floor(e/36e5),a=Math.floor(e/6e4%60),i=Math.floor(e/1e3%60);return"".concat(t(o),":").concat(t(a),":").concat(t(i))}},85280:(e,t,o)=>{var a=o(36181);e.exports=a},44932:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(44932);e.exports=a},39292:(e,t,o)=>{var a=o(95531);e.exports=a},68928:(e,t,o)=>{var a=["className"];function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function r(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(86590),l=S.MetaPreview,u=S.CONSTANTS,I=o(33800),d=function(e){var t=e.className,o=E(e,a),i=_.useMemo((function(){return null!==o.metaItem?r(r({},o.metaItem),{},{links:o.metaItem.links.filter((function(e){return e.category===u.SHARE_LINK_CATEGORY}))}):null}),[o.metaItem]),n=_.useCallback((function(e){e.nativeEvent.infoMenuClosePrevented=!0}),[]);return _.createElement("div",{className:T(t,I["info-menu-container"]),onMouseDown:n},null!==i?_.createElement(l,{className:I["meta-preview"],compact:!0,name:i.name,logo:i.logo,runtime:i.runtime,releaseInfo:i.releaseInfo,released:i.released,description:i.description,links:i.links}):null)};d.propTypes={className:s.string,metaItem:s.object,addon:s.object,stream:s.object},e.exports=d},95458:(e,t,o)=>{var a=o(68928);e.exports=a},72690:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(72690);e.exports=a},19252:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(86590).Button,_=o(81530),s=function(e){var t=e.icon,o=e.label,i=e.deviceId,s=e.disabled,T=e.onClick,S=a.useCallback((function(){"function"==typeof T&&T(i)}),[T,i]);return a.createElement(E,{className:r(_["option-container"],{disabled:s}),disabled:s,onClick:S},a.createElement(n,{className:_.icon,name:t}),a.createElement("div",{className:_.label},o))};s.propTypes={icon:i.string,label:i.string,deviceId:i.string,disabled:i.bool,onClick:i.func},e.exports=s},19944:(e,t,o)=>{var a=o(19252);e.exports=a},61366:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(61366);e.exports=a},12230:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0||Array.isArray(Qe.extraSubtitlesTracks)&&Qe.extraSubtitlesTracks.length>0||Array.isArray(Qe.audioTracks)&&Qe.audioTracks.length>0)&&Re();break;case"KeyI":Ie(),Oe(),fe(),Pe(),ke(),null!==x.metaItem&&"Ready"===x.metaItem.type&&Le();break;case"KeyR":Ie(),pe(),Oe(),Pe(),ke(),null!==Qe.playbackSpeed&&Ce();break;case"KeyV":Ie(),pe(),Oe(),fe(),ke(),null!==x.metaItem&&"Ready"===x.metaItem.type&&ve();break;case"KeyD":Ie(),pe(),Oe(),fe(),Pe(),null!==te.statistics&&"Err"!==te.statistics.type&&x.selected&&"string"==typeof x.selected.stream.infoHash&&"number"==typeof x.selected.stream.fileIdx&&Fe();break;case"Escape":Ie(),Oe(),pe(),fe(),Pe(),ke(),Rt()}},t=function(e){e.deltaY>0?ce||me||Be||De||ue||Ge||null===Qe.volume||Tt(Qe.volume-5):ce||me||Be||De||ue||Ge||null===Qe.volume||Tt(Qe.volume+5)};return oe&&(window.addEventListener("keydown",e),window.addEventListener("wheel",t)),function(){window.removeEventListener("keydown",e),window.removeEventListener("wheel",t)}}),[x.metaItem,x.selected,te.statistics,Z.seekTimeDuration,Z.seekShortTimeDuration,oe,ce,me,Be,De,ue,Ge,Qe.paused,Qe.time,Qe.volume,Qe.audioTracks,Qe.subtitlesTracks,Qe.extraSubtitlesTracks,Qe.playbackSpeed,Re,Le,ve,Fe]),_.useLayoutEffect((function(){return function(){Se.cancel(),rt.cancel(),Et.cancel()}}),[]),_.createElement("div",{className:T(G["player-container"],r({},G.immersed,se&&!ne&&null!==Qe.paused&&!Qe.paused&&!ce&&!me&&!De&&!Be&&!Me&&!ue&&!Ge)),onMouseDown:Lt,onMouseMove:ht,onMouseOver:ht,onMouseLeave:Dt},_.createElement(W,{ref:$e,className:G.layer,onEnded:et,onError:tt,onPropValue:Ze,onPropChanged:Ze,onSubtitlesTrackLoaded:ot,onExtraSubtitlesTrackLoaded:at,onImplementationChanged:Je}),Qe.buffering?_.createElement(D,{className:G.layer,logo:null==x||null===(t=x.metaItem)||void 0===t||null===(o=t.content)||void 0===o?void 0:o.logo}):null,_.createElement("div",{className:G.layer,onClick:mt,onDoubleClick:pt}),null!==ze?_.createElement("div",{className:T(G.layer,G["error-layer"])},_.createElement("div",{className:G["error-label"],title:ze.message},ze.message),2===ze.code?_.createElement("div",{className:G["error-sub"],title:F("EXTERNAL_PLAYER_HINT")},F("EXTERNAL_PLAYER_HINT")):null,null!==(null===(a=x.selected)||void 0===a||null===(E=a.stream)||void 0===E||null===(s=E.deepLinks)||void 0===s||null===(A=s.externalPlayer)||void 0===A?void 0:A.playlist)?_.createElement(O,{className:G["playlist-button"],title:F("PLAYER_OPEN_IN_EXTERNAL"),href:x.selected.stream.deepLinks.externalPlayer.playlist,download:x.selected.stream.deepLinks.externalPlayer.fileName,target:"_blank"},_.createElement(h,{className:G.icon,name:"ic_downloads"}),_.createElement("div",{className:G.label},F("PLAYER_OPEN_IN_EXTERNAL"))):null):null,ce||me||Be||De||ue||Ge?_.createElement("div",{className:G.layer}):null,_.createElement(c,{className:T(G.layer,G["nav-bar-layer"]),title:null!==x.title?x.title:"",backButton:!0,fullscreenButton:!0,onMouseMove:ft,onMouseOver:ft}),_.createElement(f,{className:T(G.layer,G["control-bar-layer"]),paused:Qe.paused,time:Qe.time,duration:Qe.duration,buffered:Qe.buffered,volume:Qe.volume,muted:Qe.muted,playbackSpeed:Qe.playbackSpeed,subtitlesTracks:Qe.subtitlesTracks.concat(Qe.extraSubtitlesTracks),audioTracks:Qe.audioTracks,metaItem:x.metaItem,nextVideo:x.nextVideo,stream:null!==x.selected?x.selected.stream:null,statistics:te.statistics,onPlayRequested:it,onPauseRequested:nt,onNextVideoRequested:Nt,onMuteRequested:_t,onUnmuteRequested:st,onVolumeChangeRequested:Tt,onSeekRequested:St,onToggleOptionsMenu:de,onToggleSubtitlesMenu:Re,onToggleInfoMenu:Le,onToggleSpeedMenu:Ce,onToggleVideosMenu:ve,onToggleStatisticsMenu:Fe,onMouseMove:ft,onMouseOver:ft}),Me?_.createElement(C,{className:T(G.layer,G["menu-layer"]),metaItem:null!==x.metaItem&&"Ready"===x.metaItem.type?x.metaItem.content:null,nextVideo:x.nextVideo,onDismiss:Rt,onNextVideoRequested:Nt}):null,Ge?_.createElement(g,{className:T(G.layer,G["menu-layer"]),stream:null!==x.selected?x.selected.stream:null,statistics:te.statistics}):null,ce?_.createElement(y,{className:T(G.layer,G["menu-layer"]),audioTracks:Qe.audioTracks,selectedAudioTrackId:Qe.selectedAudioTrackId,subtitlesTracks:Qe.subtitlesTracks,selectedSubtitlesTrackId:Qe.selectedSubtitlesTrackId,subtitlesOffset:Qe.subtitlesOffset,subtitlesSize:Qe.subtitlesSize,extraSubtitlesTracks:Qe.extraSubtitlesTracks,selectedExtraSubtitlesTrackId:Qe.selectedExtraSubtitlesTrackId,extraSubtitlesOffset:Qe.extraSubtitlesOffset,extraSubtitlesDelay:Qe.extraSubtitlesDelay,extraSubtitlesSize:Qe.extraSubtitlesSize,onSubtitlesTrackSelected:ut,onExtraSubtitlesTrackSelected:It,onAudioTrackSelected:dt,onSubtitlesOffsetChanged:Ot,onSubtitlesSizeChanged:ct,onExtraSubtitlesOffsetChanged:Ot,onExtraSubtitlesDelayChanged:At,onExtraSubtitlesSizeChanged:ct}):null,me?_.createElement(B,{className:T(G.layer,G["menu-layer"]),stream:null!==x.selected?x.selected.stream:null,addon:x.addon,metaItem:null!==x.metaItem&&"Ready"===x.metaItem.type?x.metaItem.content:null}):null,De?_.createElement(M,{className:T(G.layer,G["menu-layer"]),playbackSpeed:Qe.playbackSpeed,onPlaybackSpeedChanged:lt}):null,Be?_.createElement(v,{className:T(G.layer,G["menu-layer"]),metaItem:null!==x.metaItem&&"Ready"===x.metaItem.type?x.metaItem.content:null,seriesInfo:x.seriesInfo}):null,ue?_.createElement(P,{className:T(G.layer,G["menu-layer"]),stream:x.selected.stream,playbackDevices:null!==te.playbackDevices&&"Ready"===te.playbackDevices.type?te.playbackDevices.content:[]}):null)};k.propTypes={urlParams:s.shape({stream:s.string,streamTransportUrl:s.string,metaTransportUrl:s.string,type:s.string,id:s.string,videoId:s.string}),queryParams:s.instanceOf(URLSearchParams)};e.exports=L(k,(function(){return _.createElement("div",{className:T(G["player-container"])})}))},97764:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(86590).Button,E=o(54805),_=function(e){var t=e.className,o=e.value,i=e.selected,_=e.onSelect,s=a.useCallback((function(){"function"==typeof _&&_(o)}),[_,o]);return a.createElement(n,{className:r(t,E.option,{selected:i}),onClick:s},a.createElement("div",{className:E.label},o,"x"),a.createElement("div",{className:E.icon}))};_.propTypes={className:i.string,value:i.number,selected:i.bool,onSelect:i.func},e.exports=_},99396:(e,t,o)=>{var a=o(97764);e.exports=a},85296:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(81468).useTranslation,E=o(99396),_=o(69715),s=Array.from(Array(8).keys(),(function(e){return.25*e+.25})).reverse(),T=function(e){var t=e.className,o=e.playbackSpeed,i=e.onPlaybackSpeedChanged,T=n().t,S=a.useCallback((function(e){e.nativeEvent.speedMenuClosePrevented=!0}),[]),l=a.useCallback((function(e){"function"==typeof i&&i(e)}),[i]);return a.createElement("div",{className:r(t,_["speed-menu-container"]),onMouseDown:S},a.createElement("div",{className:_.title},T("PLAYBACK_SPEED")),a.createElement("div",{className:_["options-container"]},s.map((function(e){return a.createElement(E,{className:_.option,key:e,value:e,selected:e===o,onSelect:l})}))))};T.propTypes={className:i.string,playbackSpeed:i.number,onPlaybackSpeedChanged:i.func},e.exports=T},41998:(e,t,o)=>{var a=o(85296);e.exports=a},92763:(e,t,o)=>{var a=o(67294),i=o(94184),r=o(45697),n=o(51289),E=function(e){var t=e.className,o=e.stream,r=e.statistics,E=a.useMemo((function(){var e;return"Ready"===r.type&&null!==(e=r.content)&&void 0!==e&&e.peers?r.content.peers:0}),[r]),_=a.useMemo((function(){var e;return"Ready"===r.type&&null!==(e=r.content)&&void 0!==e&&e.downloadSpeed?(r.content.downloadSpeed/1e3/1e3).toFixed(2):0}),[r]),s=a.useMemo((function(){var e;return"Ready"===r.type&&null!==(e=r.content)&&void 0!==e&&e.streamProgress?(100*r.content.streamProgress).toFixed(2):0}),[r]);return a.createElement("div",{className:i(t,n["statistics-menu-container"])},a.createElement("div",{className:n.title},"Statistics"),a.createElement("div",{className:n.stats},a.createElement("div",{className:n.stat},a.createElement("div",{className:n.label},"Peers"),a.createElement("div",{className:n.value},E)),a.createElement("div",{className:n.stat},a.createElement("div",{className:n.label},"Speed"),a.createElement("div",{className:n.value},_," MB/s")),a.createElement("div",{className:n.stat},a.createElement("div",{className:n.label},"Completed"),a.createElement("div",{className:n.value},s," %"))),a.createElement("div",{className:n["info-hash"]},a.createElement("div",{className:n.label},"Info Hash"),a.createElement("div",{className:n.value},o.infoHash)))};E.propTypes={className:r.string,stream:r.object,statistics:r.object},e.exports=E},24426:(e,t,o)=>{var a=o(92763);e.exports=a},50569:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(95985).default,E=o(86590).Button,_=o(93283),s=function(e){var t=e.className,o=e.value,i=e.label,s=e.disabled,T=e.dataset,S=e.onChange,l=a.useCallback((function(e){"function"==typeof S&&S({type:"change",value:e.currentTarget.dataset.type,dataset:T,reactEvent:e,nativeEvent:e.nativeEvent})}),[T,S]);return a.createElement("div",{className:r(t,_["discrete-input-container"],{disabled:s})},a.createElement("div",{className:_.header},i),a.createElement("div",{className:_["input-container"],title:s?"".concat(i," is not configurable"):null},a.createElement(E,{className:r(_["button-container"],{disabled:s}),"data-type":"decrement",onClick:l},a.createElement(n,{className:_.icon,name:"remove"})),a.createElement("div",{className:_["option-label"],title:o},o),a.createElement(E,{className:r(_["button-container"],{disabled:s}),"data-type":"increment",onClick:l},a.createElement(n,{className:_.icon,name:"add"}))))};s.propTypes={className:i.string,value:i.string,label:i.string,disabled:i.bool,dataset:i.object,onChange:i.func},e.exports=s},23132:(e,t,o)=>{var a=o(50569);e.exports=a},81346:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(86590),E=n.Button,_=n.CONSTANTS,s=n.comparatorWithPriorities,T=n.languageNames,S=o(23132),l=o(73889),u=o(96073).t,I={EMBEDDED:2,EXCLUSIVE:1},d={eng:1},A=a.memo((function(e){var t=a.useMemo((function(){return(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).reduce((function(e,t){var o=t.lang;return e.includes(o)||e.push(o),e}),[]).sort(s(d))}),[e.subtitlesTracks,e.extraSubtitlesTracks]),o=a.useMemo((function(){return"string"==typeof e.selectedSubtitlesTrackId?(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).reduce((function(t,o){var a=o.id,i=o.lang;return a===e.selectedSubtitlesTrackId?i:t}),null):"string"==typeof e.selectedExtraSubtitlesTrackId?(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).reduce((function(t,o){var a=o.id,i=o.lang;return a===e.selectedExtraSubtitlesTrackId?i:t}),null):null}),[e.subtitlesTracks,e.extraSubtitlesTracks,e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId]),i=a.useMemo((function(){return(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).filter((function(e){return e.lang===o})).sort((function(e,t){return s(I)(e.origin,t.origin)}))}),[e.subtitlesTracks,e.extraSubtitlesTracks,o]),n=a.useCallback((function(e){e.nativeEvent.subtitlesMenuClosePrevented=!0}),[]),A=a.useCallback((function(t){var o=(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).filter((function(e){return e.lang===t.currentTarget.dataset.lang})).sort((function(e,t){return s(I)(e.origin,t.origin)})).shift();o?o.embedded?"function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(o.id):"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(o.id):("function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(null),"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(null))}),[e.subtitlesTracks,e.extraSubtitlesTracks,e.onSubtitlesTrackSelected,e.onExtraSubtitlesTrackSelected]),c=a.useCallback((function(t){"true"===t.currentTarget.dataset.embedded?"function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(t.currentTarget.dataset.id):"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(t.currentTarget.dataset.id)}),[e.onSubtitlesTrackSelected,e.onExtraSubtitlesTrackSelected]),O=a.useCallback((function(t){var o="increment"===t.value?250:-250;if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.extraSubtitlesDelay&&!isNaN(e.extraSubtitlesDelay)){var a=e.extraSubtitlesDelay+o;"function"==typeof e.onExtraSubtitlesDelayChanged&&e.onExtraSubtitlesDelayChanged(a)}}),[e.selectedExtraSubtitlesTrackId,e.extraSubtitlesDelay,e.onExtraSubtitlesDelayChanged]),R=a.useCallback((function(t){var o="increment"===t.value?1:-1;if("string"==typeof e.selectedSubtitlesTrackId){if(null!==e.subtitlesSize&&!isNaN(e.subtitlesSize)){var a=_.SUBTITLES_SIZES.indexOf(e.subtitlesSize),i=_.SUBTITLES_SIZES[Math.max(0,Math.min(_.SUBTITLES_SIZES.length-1,a+o))];"function"==typeof e.onSubtitlesSizeChanged&&e.onSubtitlesSizeChanged(i)}}else if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.extraSubtitlesSize&&!isNaN(e.extraSubtitlesSize)){var r=_.SUBTITLES_SIZES.indexOf(e.extraSubtitlesSize),n=_.SUBTITLES_SIZES[Math.max(0,Math.min(_.SUBTITLES_SIZES.length-1,r+o))];"function"==typeof e.onExtraSubtitlesSizeChanged&&e.onExtraSubtitlesSizeChanged(n)}}),[e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId,e.subtitlesSize,e.extraSubtitlesSize,e.onSubtitlesSizeChanged,e.onExtraSubtitlesSizeChanged]),N=a.useCallback((function(t){var o="increment"===t.value?1:-1;if("string"==typeof e.selectedSubtitlesTrackId){if(null!==e.extraSubtitlesOffset&&!isNaN(e.extraSubtitlesOffset)){var a=Math.max(0,Math.min(100,Math.floor(e.extraSubtitlesOffset+o)));"function"==typeof e.onExtraSubtitlesOffsetChanged&&e.onExtraSubtitlesOffsetChanged(a)}}else if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.subtitlesOffset&&!isNaN(e.subtitlesOffset)){var i=Math.max(0,Math.min(100,Math.floor(e.subtitlesOffset+o)));"function"==typeof e.onSubtitlesOffsetChanged&&e.onSubtitlesOffsetChanged(i)}}),[e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId,e.subtitlesOffset,e.extraSubtitlesOffset,e.onSubtitlesOffsetChanged,e.onExtraSubtitlesOffsetChanged]),m=a.useCallback((function(t){"function"==typeof e.onAudioTrackSelected&&e.onAudioTrackSelected(t.currentTarget.dataset.id)}),[e.onAudioTrackSelected]);return a.createElement("div",{className:r(e.className,l["subtitles-menu-container"]),onMouseDown:n},Array.isArray(e.audioTracks)&&e.audioTracks.length>1?a.createElement("div",{className:l["languages-container"]},a.createElement("div",{className:l["languages-header"]},"Audio Languages"),a.createElement("div",{className:l["languages-list"]},e.audioTracks.map((function(t,o){var i=t.id,n=t.label,_=t.lang;return a.createElement(E,{key:o,title:n,className:r(l["language-option"],{selected:e.selectedAudioTrackId===i}),"data-id":i,onClick:m},a.createElement("div",{className:l["language-label"]},"string"==typeof T[_]?T[_]:_),e.selectedAudioTrackId===i?a.createElement("div",{className:l.icon}):null)})))):null,a.createElement("div",{className:l["languages-container"]},a.createElement("div",{className:l["languages-header"]},u("PLAYER_SUBTITLES_LANGUAGES")),a.createElement("div",{className:l["languages-list"]},a.createElement(E,{title:u("OFF"),className:r(l["language-option"],{selected:null===o}),onClick:A},a.createElement("div",{className:l["language-label"]},u("OFF")),null===o?a.createElement("div",{className:l.icon}):null),t.map((function(e,t){return a.createElement(E,{key:t,title:"string"==typeof T[e]?T[e]:e,className:r(l["language-option"],{selected:o===e}),"data-lang":e,onClick:A},a.createElement("div",{className:l["language-label"]},"string"==typeof T[e]?T[e]:e),o===e?a.createElement("div",{className:l.icon}):null)})))),a.createElement("div",{className:l["variants-container"]},a.createElement("div",{className:l["variants-header"]},u("PLAYER_SUBTITLES_VARIANTS")),i.length>0?a.createElement("div",{className:l["variants-list"]},i.map((function(t,o){return a.createElement(E,{key:o,title:t.label,className:r(l["variant-option"],{selected:e.selectedSubtitlesTrackId===t.id||e.selectedExtraSubtitlesTrackId===t.id}),"data-id":t.id,"data-origin":t.origin,"data-embedded":t.embedded,onClick:c},a.createElement("div",{className:l["variant-label"]},t.origin),e.selectedSubtitlesTrackId===t.id||e.selectedExtraSubtitlesTrackId===t.id?a.createElement("div",{className:l.icon}):null)}))):a.createElement("div",{className:l["no-variants-container"]},a.createElement("div",{className:l["no-variants-label"]},u("PLAYER_SUBTITLES_DISABLED")))),a.createElement("div",{className:l["subtitles-settings-container"]},a.createElement("div",{className:l["settings-header"]},"Subtitles Settings"),a.createElement(S,{className:l["discrete-input"],label:u("DELAY"),value:"string"!=typeof e.selectedExtraSubtitlesTrackId||null===e.extraSubtitlesDelay||isNaN(e.extraSubtitlesDelay)?"--":"".concat((e.extraSubtitlesDelay/1e3).toFixed(2),"s"),disabled:"string"!=typeof e.selectedExtraSubtitlesTrackId||null===e.extraSubtitlesDelay||isNaN(e.extraSubtitlesDelay),onChange:O}),a.createElement(S,{className:l["discrete-input"],label:u("SIZE"),value:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesSize||isNaN(e.subtitlesSize)?"--":"".concat(e.subtitlesSize,"%"):"string"==typeof e.selectedExtraSubtitlesTrackId?null===e.extraSubtitlesSize||isNaN(e.extraSubtitlesSize)?"--":"".concat(e.extraSubtitlesSize,"%"):"--",disabled:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesSize||isNaN(e.subtitlesSize):"string"!=typeof e.selectedExtraSubtitlesTrackId||(null===e.extraSubtitlesSize||isNaN(e.extraSubtitlesSize)),onChange:R}),a.createElement(S,{className:l["discrete-input"],label:u("PLAYER_SUBTITLES_VERTICAL_POSIITON"),value:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesOffset||isNaN(e.subtitlesOffset)?"--":"".concat(e.subtitlesOffset,"%"):"string"==typeof e.selectedExtraSubtitlesTrackId?null===e.extraSubtitlesOffset||isNaN(e.extraSubtitlesOffset)?"--":"".concat(e.extraSubtitlesOffset,"%"):"--",disabled:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesOffset||isNaN(e.subtitlesOffset):"string"!=typeof e.selectedExtraSubtitlesTrackId||(null===e.extraSubtitlesOffset||isNaN(e.extraSubtitlesOffset)),onChange:N})))}));A.displayName="MainNavBars",A.propTypes={className:i.string,subtitlesTracks:i.arrayOf(i.shape({id:i.string.isRequired,lang:i.string.isRequired,origin:i.string.isRequired})),selectedSubtitlesTrackId:i.string,subtitlesOffset:i.number,subtitlesSize:i.number,extraSubtitlesTracks:i.arrayOf(i.shape({id:i.string.isRequired,lang:i.string.isRequired,origin:i.string.isRequired,label:i.string.isRequired})),selectedExtraSubtitlesTrackId:i.string,extraSubtitlesOffset:i.number,extraSubtitlesDelay:i.number,extraSubtitlesSize:i.number,audioTracks:i.arrayOf(i.shape({id:i.string.isRequired,lang:i.string.isRequired,origin:i.string.isRequired,label:i.string.isRequired})),selectedAudioTrackId:i.string,onSubtitlesTrackSelected:i.func,onExtraSubtitlesTrackSelected:i.func,onAudioTrackSelected:i.func,onSubtitlesOffsetChanged:i.func,onSubtitlesSizeChanged:i.func,onExtraSubtitlesOffsetChanged:i.func,onExtraSubtitlesDelayChanged:i.func,onExtraSubtitlesSizeChanged:i.func},e.exports=A},19646:(e,t,o)=>{var a=o(81346);e.exports=a},55245:(e,t,o)=>{var a=["className"];function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function r(e){for(var t=1;t=0||(i[o]=e[o]);return i})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}var _=o(67294),s=o(45697),T=o(94184),S=o(91654),l=o(86590).useLiveRef,u=o(44236),I=_.forwardRef((function(e,t){var o=e.className,i=E(e,a),n=l(i.onEnded),s=l(i.onError),I=l(i.onPropValue),d=l(i.onPropChanged),A=l(i.onSubtitlesTrackLoaded),c=l(i.onExtraSubtitlesTrackLoaded),O=l(i.onImplementationChanged),R=_.useRef(null),N=_.useRef(null),m=_.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==N.current)try{N.current.dispatch(e,r(r({},t),{},{containerElement:R.current}))}catch(e){console.error("Video",e)}}),[]);return _.useImperativeHandle(t,(function(){return{dispatch:m}}),[]),_.useEffect((function(){return null!==R.current&&(N.current=new S,N.current.on("ended",(function(){"function"==typeof n.current&&n.current()})),N.current.on("error",(function(e){"function"==typeof s.current&&s.current(e)})),N.current.on("propValue",(function(e,t){"function"==typeof I.current&&I.current(e,t)})),N.current.on("propChanged",(function(e,t){"function"==typeof d.current&&d.current(e,t)})),N.current.on("subtitlesTrackLoaded",(function(e){"function"==typeof A.current&&A.current(e)})),N.current.on("extraSubtitlesTrackLoaded",(function(e){"function"==typeof c.current&&c.current(e)})),N.current.on("implementationChanged",(function(e){"function"==typeof O.current&&O.current(e)}))),function(){N.current.destroy()}}),[]),_.createElement("div",{className:T(o,u["video-container"])},_.createElement("div",{ref:R,className:u.video}))}));I.displayName="Video",I.propTypes={className:s.string,onEnded:s.func,onError:s.func,onPropValue:s.func,onPropChanged:s.func,onSubtitlesTrackLoaded:s.func,onExtraSubtitlesTrackLoaded:s.func,onImplementationChanged:s.func},e.exports=I},5711:(e,t,o)=>{var a=o(55245);e.exports=a},84027:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(94184),n=o(90123),E=o(10674),_=function(e){var t=e.className,o=e.metaItem,i=e.seriesInfo,_=a.useCallback((function(e){e.nativeEvent.videosMenuClosePrevented=!0}),[]),s=a.useMemo((function(){return i&&"number"==typeof i.season&&Array.isArray(o.videos)?o.videos.filter((function(e){return e.season===i.season})):o.videos}),[o,i]);return a.createElement("div",{className:r(t,E["videos-menu-container"]),onMouseDown:_},s.map((function(e,t){return a.createElement(n,{key:t,id:e.id,title:e.title,thumbnail:e.thumbnail,episode:e.episode,released:e.released,upcoming:e.upcoming,watched:e.watched,progress:e.progress,deepLinks:e.deepLinks,scheduled:e.scheduled})})))};_.propTypes={className:i.string,metaItem:i.object,seriesInfo:i.shape({season:i.number,episode:i.number})},e.exports=_},66429:(e,t,o)=>{var a=o(84027);e.exports=a},57793:(e,t,o)=>{var a=o(12230);e.exports=a},85852:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,i,r=[],n=!0,E=!1;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){E=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(E)throw i}}return r})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(24853);e.exports=a},84182:(e,t,o)=>{var a=o(67294),i=o(86590).useModelState,r=o(63662).useServices;e.exports=function(e){var t=r().core,o=a.useMemo((function(){return e.has("search")&&e.get("search").length>0?{action:"Load",args:{model:"CatalogsWithExtra",args:{extra:[["search",e.get("search")]]}}}:{action:"Unload"}}),[e]),n=a.useCallback((function(e){t.transport.dispatch({action:"CatalogsWithExtra",args:{action:"LoadRange",args:e}},"search")}),[]);return[i({model:"search",action:o}),n]}},85674:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=he.current.scrollHeight-50)ye(Be[Be.length-1].id);else for(var e=Be.length-1;e>=0;e--)if(Be[e].ref.current.offsetTop-he.current.offsetTop<=he.current.scrollTop){ye(Be[e].id);break}}),[]),We=E.useCallback((function(e){var t=Be.find((function(t){return t.id===e.currentTarget.dataset.section}));he.current.scrollTo({top:t.ref.current.offsetTop-he.current.offsetTop,behavior:"smooth"})}),[]),be=E.useCallback(s((function(){Me()}),50),[]);return E.useEffect((function(){ce&&de&&(n.transport.dispatch({action:"Ctx",args:{action:"InstallTraktAddon"}}),Ae(!1))}),[ce,de]),E.useEffect((function(){null!==G.exportUrl&&"string"==typeof G.exportUrl&&window.open(G.exportUrl)}),[G.exportUrl]),E.useLayoutEffect((function(){D&&Me(),Se()}),[D]),E.createElement(c,{className:P["settings-container"],route:"settings"},E.createElement("div",{className:_(P["settings-content"],"animation-fade-in")},E.createElement("div",{className:P["side-menu-container"]},E.createElement(d,{className:_(P["side-menu-button"],i({},P.selected,ve===v)),title:e("SETTINGS_NAV_GENERAL"),"data-section":v,onClick:We},e("SETTINGS_NAV_GENERAL")),E.createElement(d,{className:_(P["side-menu-button"],i({},P.selected,ve===y)),title:e("SETTINGS_NAV_PLAYER"),"data-section":y,onClick:We},e("SETTINGS_NAV_PLAYER")),E.createElement(d,{className:_(P["side-menu-button"],i({},P.selected,ve===M)),title:e("SETTINGS_NAV_STREAMING"),"data-section":M,onClick:We},e("SETTINGS_NAV_STREAMING")),E.createElement(d,{className:_(P["side-menu-button"],i({},P.selected,ve===W)),title:e("SETTINGS_NAV_SHORTCUTS"),"data-section":W,onClick:We},e("SETTINGS_NAV_SHORTCUTS")),E.createElement("div",{className:P.spacing}),E.createElement("div",{className:P["version-info-label"],title:"5.0.0-beta.4"},"App Version: ","5.0.0-beta.4"),null!==F.settings&&"Ready"===F.settings.type?E.createElement("div",{className:P["version-info-label"],title:F.settings.content.serverVersion},"Server Version: ",F.settings.content.serverVersion):null),E.createElement("div",{ref:he,className:P["sections-container"],onScroll:be},E.createElement("div",{ref:De,className:P["section-container"]},E.createElement("div",{className:_(P["option-container"],P["user-info-option-container"])},E.createElement("div",{className:P["user-info-content"]},E.createElement("div",{className:P["avatar-container"],style:{backgroundImage:null===b.auth?"url('".concat(o(93028),"')"):b.auth.user.avatar?"url('".concat(b.auth.user.avatar,"')"):"url('".concat(o(11251),"')")}}),E.createElement("div",{className:P["email-logout-container"]},E.createElement("div",{className:P["email-label-container"],title:null===b.auth?"Anonymous user":b.auth.user.email},E.createElement("div",{className:P["email-label"]},null===b.auth?"Anonymous user":b.auth.user.email)),null!==b.auth?E.createElement(d,{className:P["logout-button-container"],title:e("LOG_OUT"),onClick:Re},E.createElement("div",{className:P["logout-label"]},e("LOG_OUT"))):null))),null===b.auth?E.createElement("div",{className:P["option-container"]},E.createElement(d,{className:_(P["option-input-container"],P["button-container"]),title:"".concat(e("LOG_IN")," / ").concat(e("SIGN_UP")),href:"#/intro"},E.createElement("div",{className:P.label},e("LOG_IN")," / ",e("SIGN_UP")))):null),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("SETTINGS_DATA_EXPORT"),tabIndex:-1,onClick:pe},E.createElement("div",{className:P.label},e("SETTINGS_DATA_EXPORT")))),null!==b.auth&&null!==b.auth.user&&"string"==typeof b.auth.user._id?E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("SETTINGS_SUBSCRIBE_CALENDAR"),tabIndex:-1,onClick:me},E.createElement("div",{className:P.label},e("SETTINGS_SUBSCRIBE_CALENDAR")))):null,E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("SETTINGS_SUPPORT"),target:"_blank",href:"https://stremio.zendesk.com/hc/en-us"},E.createElement("div",{className:P.label},e("SETTINGS_SUPPORT")))),E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:"Source code",target:"_blank",href:"https://github.com/stremio/stremio-web/tree/".concat("c45613317387f3d8ab23cb3fc257acddfdd8728d")},E.createElement("div",{className:P.label},"Source code"))),E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("TERMS_OF_SERVICE"),target:"_blank",href:"https://www.stremio.com/tos"},E.createElement("div",{className:P.label},e("TERMS_OF_SERVICE")))),E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("PRIVACY_POLICY"),target:"_blank",href:"https://www.stremio.com/privacy"},E.createElement("div",{className:P.label},e("PRIVACY_POLICY")))),null!==b.auth&&null!==b.auth.user?E.createElement("div",{className:_(P["option-container"],P["link-container"])},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("SETTINGS_ACC_DELETE"),target:"_blank",href:"https://stremio.zendesk.com/hc/en-us/articles/360021428911-How-to-delete-my-account"},E.createElement("div",{className:P.label},e("SETTINGS_ACC_DELETE")))):null,null!==b.auth&&null!==b.auth.user&&"string"==typeof b.auth.user.email?E.createElement("div",{className:P["option-container"]},E.createElement(d,{className:_(P["option-input-container"],P["link-input-container"]),title:e("SETTINGS_CHANGE_PASSWORD"),target:"_blank",href:"https://www.strem.io/reset-password/".concat(b.auth.user.email)},E.createElement("div",{className:P.label},e("SETTINGS_CHANGE_PASSWORD")))):null,E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:_(P["option-name-container"],P["trakt-icon"])},E.createElement(S,{className:P.icon,name:"trakt"}),E.createElement("div",{className:P.label},"Trakt Scrobbling")),E.createElement(d,{className:_(P["option-input-container"],P["button-container"]),title:"Authenticate",disabled:null===b.auth,tabIndex:-1,onClick:Ne},E.createElement("div",{className:P.label},null!==b.auth&&null!==b.auth.user&&null!==b.auth.user.trakt?e("LOG_OUT"):e("SETTINGS_TRAKT_AUTHENTICATE"))))),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_UI_LANGUAGE"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"]),tabIndex:-1},H)))),E.createElement("div",{ref:fe,className:P["section-container"]},E.createElement("div",{className:P["section-title"]},e("SETTINGS_NAV_PLAYER")),E.createElement("div",{className:P["section-category-container"]},E.createElement(S,{className:P.icon,name:"subtitles"}),E.createElement("div",{className:P.label},e("SETTINGS_SECTION_SUBTITLES"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SUBTITLES_LANGUAGE"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},Y))),I.active?E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_FULLSCREEN_EXIT"))),E.createElement(A,a({className:_(P["option-input-container"],P["checkbox-container"])},J))):null,E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SUBTITLES_SIZE"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},z))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SUBTITLES_COLOR"))),E.createElement(R,a({className:_(P["option-input-container"],P["color-input-container"])},K))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SUBTITLES_COLOR_BACKGROUND"))),E.createElement(R,a({className:_(P["option-input-container"],P["color-input-container"])},x))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SUBTITLES_COLOR_OUTLINE"))),E.createElement(R,a({className:_(P["option-input-container"],P["color-input-container"])},j)))),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:P["section-category-container"]},E.createElement(S,{className:P.icon,name:"volume-medium"}),E.createElement("div",{className:P.label},e("SETTINGS_SECTION_AUDIO"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_DEFAULT_AUDIO_TRACK"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},Q))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SURROUND_SOUND"))),E.createElement(A,a({className:_(P["option-input-container"],P["checkbox-container"]),tabIndex:-1},X)))),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:P["section-category-container"]},E.createElement(S,{className:P.icon,name:"remote"}),E.createElement("div",{className:P.label},e("SETTINGS_SECTION_CONTROLS"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SEEK_KEY"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},$))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SEEK_KEY_SHIFT"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},q))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_PLAY_IN_BACKGROUND"))),E.createElement(A,a({className:_(P["option-input-container"],P["checkbox-container"]),disabled:!0,tabIndex:-1},oe)))),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:P["section-category-container"]},E.createElement(S,{className:P.icon,name:"play"}),E.createElement("div",{className:P.label},e("SETTINGS_SECTION_AUTO_PLAY"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("AUTO_PLAY"))),E.createElement(A,a({className:_(P["option-input-container"],P["checkbox-container"])},te))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_NEXT_VIDEO_POPUP_DURATION"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"]),disabled:!b.settings.bingeWatching},ee)))),E.createElement("div",{className:P["section-container"]},E.createElement("div",{className:P["section-category-container"]},E.createElement(S,{className:P.icon,name:"glasses"}),E.createElement("div",{className:P.label},e("SETTINGS_SECTION_ADVANCED"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_PLAY_IN_EXTERNAL_PLAYER"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},Z))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_HWDEC"))),E.createElement(A,a({className:_(P["option-input-container"],P["checkbox-container"]),disabled:!0,tabIndex:-1},ae)))),E.createElement("div",{ref:Ce,className:P["section-container"]},E.createElement("div",{className:P["section-title"]},e("SETTINGS_NAV_STREAMING")),E.createElement("div",{className:P["option-container"]},E.createElement(d,{className:_(P["option-input-container"],P["button-container"]),title:"Reload",onClick:Le},E.createElement("div",{className:P.label},e("RELOAD")))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("STATUS"))),E.createElement("div",{className:_(P["option-input-container"],P["info-container"])},E.createElement("div",{className:P.label},null===F.settings?"NotLoaded":"Ready"===F.settings.type?e("SETTINGS_SERVER_STATUS_ONLINE"):"Err"===F.settings.type?e("SETTINGS_SERVER_STATUS_ERROR"):F.settings.type))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},"Url")),E.createElement("div",{className:_(P["option-input-container"],P["configure-input-container"])},E.createElement("div",{className:P.label,title:ie.value},ie.value),E.createElement(d,{className:P["configure-button-container"],title:"Configure server url",onClick:Te},E.createElement(S,{className:P.icon,name:"settings"})))),null!==ne?E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SERVER_CACHE_SIZE"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},ne))):null,null!==Ee?E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SERVER_TORRENT_PROFILE"))),E.createElement(O,a({className:_(P["option-input-container"],P["multiselect-container"])},Ee))):null),E.createElement("div",{ref:ge,className:P["section-container"]},E.createElement("div",{className:P["section-title"]},e("SETTINGS_NAV_SHORTCUTS")),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_PLAY_PAUSE"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,e("SETTINGS_SHORTCUT_SPACE")))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_SEEK_FORWARD"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"→"),E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_OR")),E.createElement("kbd",null,"⇧ ",e("SETTINGS_SHORTCUT_SHIFT")),E.createElement("div",{className:P.label},"+"),E.createElement("kbd",null,"→"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_SEEK_BACKWARD"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"←"),E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_OR")),E.createElement("kbd",null,"⇧ ",e("SETTINGS_SHORTCUT_SHIFT")),E.createElement("div",{className:P.label},"+"),E.createElement("kbd",null,"←"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_VOLUME_UP"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"↑"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_VOLUME_DOWN"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"↓"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_MENU_SUBTITLES"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"S"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_MENU_INFO"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"I"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_FULLSCREEN"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"F"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_NAVIGATE_MENUS"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"1"),E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_TO")),E.createElement("kbd",null,"5"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_GO_TO_SEARCH"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,"0"))),E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},e("SETTINGS_SHORTCUT_EXIT_BACK"))),E.createElement("div",{className:_(P["option-input-container"],P["shortcut-container"])},E.createElement("kbd",null,e("SETTINGS_SHORTCUT_ESC"))))),E.createElement("div",{className:_(P["section-container"],P["versions-section-container"])},E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},"App Version")),E.createElement("div",{className:_(P["option-input-container"],P["info-container"])},E.createElement("div",{className:P.label},"5.0.0-beta.4"))),null!==F.settings&&"Ready"===F.settings.type?E.createElement("div",{className:P["option-container"]},E.createElement("div",{className:P["option-name-container"]},E.createElement("div",{className:P.label},"Server Version")),E.createElement("div",{className:_(P["option-input-container"],P["info-container"])},E.createElement("div",{className:P.label},F.settings.content.serverVersion))):null))),se?E.createElement(m,{className:P["configure-server-url-modal-container"],title:e("SETTINGS_SERVER_CONFIGURE_TITLE"),buttons:Oe,onCloseRequest:Se},E.createElement(N,{ref:le,autoFocus:!0,className:P["server-url-input"],type:"text",defaultValue:ie.value,placeholder:e("SETTINGS_SERVER_CONFIGURE_INPUT"),onSubmit:ue})):null)}),(function(){return E.createElement(c,{className:P["settings-container"],route:"settings"})}))},62465:(e,t,o)=>{var a=o(85674);e.exports=a},94137:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t{var a=o(57165),i=o(88823),r=o(21901),n=o(77965),E=o(69005),_=o(50353),s=o(96375),T=o(62465),S=o(57793),l=o(16732);e.exports={Addons:a,Board:i,Discover:r,Library:n,MetaDetails:E,NotFound:_,Search:s,Settings:T,Player:S,Intro:l}},61099:(e,t,o)=>{var a=o(26729),i=o(55482);e.exports=function(){var e=!1,t=null,o=!1,r=null,n=new a;function E(){e=!0,t=null,o=!1,s()}function _(a){console.error(a),e=!1,t=new Error("Google Cast API not available",{cause:a}),o=!1,s(),r=null}function s(){n.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}},error:{configurable:!1,enumerable:!0,get:function(){return t}},starting:{configurable:!1,enumerable:!0,get:function(){return o}},transport:{configurable:!1,enumerable:!0,get:function(){return r}}}),this.start=function(){e||t instanceof Error||o||(o=!0,(r=new i).on("init",E),r.on("init-error",_),s())},this.stop=function(){e=!1,t=null,o=!1,s(),null!==r&&(r.removeAllListeners(),r=null)},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)}}},55482:(e,t,o)=>{var a=o(26729),i=o(542),r="urn:x-cast:com.stremio",n=2e4,E=null,_=new a;window.__onGCastApiAvailable=function(e){delete window.__onGCastApiAvailable,E=!!e,_.emit("availabilityChanged")};e.exports=function(){var e=new a,t={};function o(o,a){try{var i=JSON.parse(a),r=i.id,n=i.chunk,E=i.index,_=i.length;if(t[r]=t[r]||[],t[r][E]=n,Object.keys(t[r]).length===_){var s=JSON.parse(t[r].join(""));delete t[r],e.emit("message",s)}}catch(t){e.emit("message-error",t)}}function s(t){e.emit(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,t)}function T(t){e.emit(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,t)}function S(t){e.emit(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,t)}function l(t){e.emit(cast.framework.CastSession.VOLUME_CHANGED,t)}function u(t){e.emit(cast.framework.CastSession.MEDIA_SESSION,t)}function I(t){e.emit(cast.framework.CastContextEventType.CAST_STATE_CHANGED,t)}function d(t){switch(e.emit(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,t),t.sessionState){case cast.framework.SessionState.SESSION_STARTED:t.session.addMessageListener(r,o),t.session.addEventListener(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,s),t.session.addEventListener(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,T),t.session.addEventListener(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,S),t.session.addEventListener(cast.framework.CastSession.VOLUME_CHANGED,l),t.session.addEventListener(cast.framework.CastSession.MEDIA_SESSION,u);break;case cast.framework.SessionState.SESSION_ENDED:t.session.removeMessageListener(r,o),t.session.removeEventListener(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,s),t.session.removeEventListener(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,T),t.session.removeEventListener(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,S),t.session.removeEventListener(cast.framework.CastSession.VOLUME_CHANGED,l),t.session.removeEventListener(cast.framework.CastSession.MEDIA_SESSION,u)}}new Promise((function(e,t){function o(){_.off("availabilityChanged",o),E?e():t(new Error("window.cast api not available"))}null!==E?o():_.on("availabilityChanged",o)})).then((function(){cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,I),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,d)})).then((function(){try{e.emit("init")}catch(e){console.error("ChromecastTransport",e)}})).catch((function(t){e.emit("init-error",t)})),this.on=function(t,o){e.on(t,o)},this.off=function(t,o){e.off(t,o)},this.removeAllListeners=function(){e.removeAllListeners()},this.getCastState=function(){return cast.framework.CastContext.getInstance().getCastState()},this.getSessionState=function(){return cast.framework.CastContext.getInstance().getSessionState()},this.getCastDevice=function(){var e=cast.framework.CastContext.getInstance().getCurrentSession();return null!==e?e.getCastDevice():null},this.setOptions=function(e){cast.framework.CastContext.getInstance().setOptions(e)},this.requestSession=function(){return cast.framework.CastContext.getInstance().requestSession()},this.endCurrentSession=function(e){cast.framework.CastContext.getInstance().endCurrentSession(e)},this.sendMessage=function(e){var t=cast.framework.CastContext.getInstance().getCurrentSession();if(null!==t){for(var o=JSON.stringify(e),a=Math.ceil(o.length/n),E=[],_=0;_{var a=o(61099);e.exports=a},46194:(e,t,o)=>{var a=o(26729),i=o(6806);e.exports=function(e){var t=!1,o=null,r=!1,n=null,E=new a;function _(){t=!0,o=null,r=!1,T()}function s(e){console.error(e),t=!1,o=new Error("Stremio Core Transport initialization failed",{cause:e}),r=!1,T(),n=null}function T(){E.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return t}},error:{configurable:!1,enumerable:!0,get:function(){return o}},starting:{configurable:!1,enumerable:!0,get:function(){return r}},transport:{configurable:!1,enumerable:!0,get:function(){return n}}}),this.start=function(){t||o instanceof Error||r||(r=!0,(n=new i(e)).on("init",_),n.on("error",s),T())},this.stop=function(){t=!1,o=null,r=!1,T(),null!==n&&(n.removeAllListeners(),n=null)},this.on=function(e,t){E.on(e,t)},this.off=function(e,t){E.off(e,t)}}},6806:(e,t,o)=>{function a(e,t,o,a,i,r,n){try{var E=e[r](n),_=E.value}catch(e){return void o(e)}E.done?t(_):Promise.resolve(_).then(a,i)}function i(e){return function(){var t=this,o=arguments;return new Promise((function(i,r){var n=e.apply(t,o);function E(e){a(n,i,r,E,_,"next",e)}function _(e){a(n,i,r,E,_,"throw",e)}E(void 0)}))}}var r=o(26729),n=o(56553);e.exports=function(e){var t=new r,o=new Worker("".concat("c45613317387f3d8ab23cb3fc257acddfdd8728d","/scripts/worker.js")),a=new n(window,o);window.onCoreEvent=function(e){var o=e.name,a=e.args;try{t.emit(o,a)}catch(e){console.error("CoreTransport",e)}},a.call(["init"],[e]).then((function(){try{t.emit("init")}catch(e){console.error("CoreTransport",e)}})).catch((function(e){t.emit("error",e)})),this.on=function(e,o){t.on(e,o)},this.off=function(e,o){t.off(e,o)},this.removeAllListeners=function(){t.removeAllListeners()},this.getState=(function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["getState"],[t]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),this.getDebugState=i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["getDebugState"],[]));case 1:case"end":return e.stop()}}),e)}))),this.dispatch=(function(){var e=i(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["dispatch"],[t,o,location.hash]));case 1:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}})(),this.analytics=(function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["analytics"],[t,location.hash]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),this.decodeStream=(function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["decodeStream"],[t]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})()}},4937:(e,t,o)=>{var a=o(46194);e.exports=a},48634:(e,t,o)=>{function a(e,t,o,a,i,r,n){try{var E=e[r](n),_=E.value}catch(e){return void o(e)}E.done?t(_):Promise.resolve(_).then(a,i)}function i(e){return function(){var t=this,o=arguments;return new Promise((function(i,r){var n=e.apply(t,o);function E(e){a(n,i,r,E,_,"next",e)}function _(e){a(n,i,r,E,_,"throw",e)}E(void 0)}))}}var r=o(26729);e.exports=function(e){var t=e.core,o=!1,a=new r;function n(e){e.preventDefault()}function E(e){return _.apply(this,arguments)}function _(){return(_=i(regeneratorRuntime.mark((function e(o){var i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.preventDefault(),!(o.dataTransfer.files instanceof FileList&&o.dataTransfer.files.length>0)){e.next=18;break}i=o.dataTransfer.files[0],e.t0=i.type,e.next="application/x-bittorrent"===e.t0?6:17;break;case 6:return e.prev=6,e.next=9,i.arrayBuffer();case 9:r=e.sent,t.transport.dispatch({action:"StreamingServer",args:{action:"CreateTorrent",args:Array.from(new Uint8Array(r))}}),e.next=16;break;case 13:e.prev=13,e.t1=e.catch(6),a.emit("error",{message:"Failed to process file",file:{name:i.name,type:i.type}});case 16:return e.abrupt("break",18);case 17:a.emit("error",{message:"Unsupported file",file:{name:i.name,type:i.type}});case 18:case"end":return e.stop()}}),e,null,[[6,13]])})))).apply(this,arguments)}function s(){a.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return o}}}),this.start=function(){o||(window.addEventListener("dragover",n),window.addEventListener("drop",E),o=!0,s())},this.stop=function(){window.removeEventListener("dragover",n),window.removeEventListener("drop",E),o=!1,s()},this.on=function(e,t){a.on(e,t)},this.off=function(e,t){a.off(e,t)}}},98500:(e,t,o)=>{var a=o(48634);e.exports=a},19093:(e,t,o)=>{var a=o(26729);e.exports=function(){var e=!1,t=new a;function o(e){if(!(e.keyboardShortcutPrevented||"INPUT"===e.target.tagName||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey))switch(e.code){case"Digit0":e.preventDefault(),window.location="#/search";break;case"Digit1":e.preventDefault(),window.location="#/";break;case"Digit2":e.preventDefault(),window.location="#/discover";break;case"Digit3":e.preventDefault(),window.location="#/library";break;case"Digit4":e.preventDefault(),window.location="#/settings";break;case"Digit5":e.preventDefault(),window.location="#/addons";break;case"Backspace":e.preventDefault(),e.ctrlKey?window.history.forward():window.history.back();break;case"KeyF":e.preventDefault(),document.fullscreenElement===document.documentElement?document.exitFullscreen():document.documentElement.requestFullscreen()}}function i(){t.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}}}),this.start=function(){e||(window.addEventListener("keydown",o),e=!0,i())},this.stop=function(){window.removeEventListener("keydown",o),e=!1,i()}}},97369:(e,t,o)=>{var a=o(19093);e.exports=a},42207:(e,t,o)=>{var a=o(67294).createContext({});a.displayName="ServicesContext",e.exports=a},58261:(e,t,o)=>{var a=o(67294),i=o(45697),r=o(42207),n=function(e){var t=e.services,o=void 0===t?{}:t,i=e.children;return a.createElement(r.Provider,{value:o},i)};n.propTypes={services:i.object,children:i.oneOfType([i.arrayOf(i.node),i.node])},e.exports=n},83487:(e,t,o)=>{var a=o(58261),i=o(71806);e.exports={ServicesProvider:a,useServices:i}},71806:(e,t,o)=>{var a=o(67294),i=o(42207);e.exports=function(){return a.useContext(i)}},53015:(e,t,o)=>{var a=o(26729),i=o(80755);e.exports=function(){var e=!1,t=null,o=!1,r=null,n=new a;function E(){e=!0,t=null,o=!1,s()}function _(a){console.error(a),e=!1,t=new Error(a),o=!1,s(),r=null}function s(){n.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}},error:{configurable:!1,enumerable:!0,get:function(){return t}},starting:{configurable:!1,enumerable:!0,get:function(){return o}},transport:{configurable:!1,enumerable:!0,get:function(){return r}}}),this.start=function(){e||t instanceof Error||o||(e=!1,o=!0,(r=new i).on("init",E),r.on("init-error",_),s())},this.stop=function(){e=!1,t=null,o=!1,s()},this.on=function(e,t){n.on(e,t)},this.off=function(e,t){n.off(e,t)}}},80755:(e,t,o)=>{var a=o(26729),i=!1,r=new a,n=1,E=3,_=6,s=7,T="transport";window.initShellComm=function(){delete window.initShellComm,r.emit("availabilityChanged")};e.exports=function(){var e=new a;this.props={};var t=this;(window.qt?new Promise((function(e){function t(){r.off("availabilityChanged",t),i=!0,e()}i?t():r.on("availabilityChanged",t)})):Promise.reject("Qt API not found")).then((function(){var o=window.qt&&window.qt.webChannelTransport;if(!o)throw"no viable transport found (qt.webChannelTransport)";var a=0;function i(e){e.id=a++,o.send(JSON.stringify(e))}o.onmessage=function(o){var a=JSON.parse(o.data);if(0===a.id){var r=a.data[T];r.properties.slice(1).forEach((function(e){t.props[e[1]]=e[3]})),"string"==typeof t.props.shellVersion&&(t.shellVersionArr=(t.props.shellVersion.match(/(\d+)\.(\d+)\.(\d+)/)||[]).slice(1,4).map(Number)),e.emit("received-props",t.props),r.signals.forEach((function(e){i({type:s,object:T,signal:e[1]})}));var E=r.methods.filter((function(e){return"onEvent"===e[0]}))[0];t.send=function(e,t){i({type:_,object:T,method:E[1],args:[e,t||{}]})},t.send("app-ready",{})}a.object===T&&a.type===n&&e.emit(a.args[0],a.args[1]),e.emit("init")},i({type:E})})).catch((function(t){e.emit("init-error",t)})),this.on=function(t,o){e.on(t,o)},this.off=function(t,o){e.off(t,o)},this.removeAllListeners=function(){e.removeAllListeners()}}},61921:(e,t,o)=>{var a=o(53015);e.exports=a},63662:(e,t,o)=>{var a=o(56623),i=o(4937),r=o(98500),n=o(97369),E=o(83487),_=E.ServicesProvider,s=E.useServices,T=o(61921);e.exports={Chromecast:a,Core:i,DragAndDrop:r,KeyboardShortcuts:n,ServicesProvider:_,useServices:s,Shell:T}},79742:(e,t)=>{"use strict";t.byteLength=function(e){var t=_(e),o=t[0],a=t[1];return 3*(o+a)/4-a},t.toByteArray=function(e){var t,o,r=_(e),n=r[0],E=r[1],s=new i((function(e,t,o){return 3*(t+o)/4-o})(0,n,E)),T=0,S=E>0?n-4:n;for(o=0;o>16&255,s[T++]=t>>8&255,s[T++]=255&t;2===E&&(t=a[e.charCodeAt(o)]<<2|a[e.charCodeAt(o+1)]>>4,s[T++]=255&t);1===E&&(t=a[e.charCodeAt(o)]<<10|a[e.charCodeAt(o+1)]<<4|a[e.charCodeAt(o+2)]>>2,s[T++]=t>>8&255,s[T++]=255&t);return s},t.fromByteArray=function(e){for(var t,a=e.length,i=a%3,r=[],n=16383,E=0,_=a-i;E<_;E+=n)r.push(s(e,E,E+n>_?_:E+n));1===i?(t=e[a-1],r.push(o[t>>2]+o[t<<4&63]+"==")):2===i&&(t=(e[a-2]<<8)+e[a-1],r.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"="));return r.join("")};for(var o=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,E=r.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");return-1===o&&(o=t),[o,o===t?0:4-o%4]}function s(e,t,a){for(var i,r,n=[],E=t;E>18&63]+o[r>>12&63]+o[r>>6&63]+o[63&r]);return n.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},57500:e=>{function t(e){return e.reduce(((e,t,o,a)=>{const i=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,o)=>o+e)))(...i))}),[])}e.exports=t,e.exports.parse=t,e.exports.compose=function(e){return e.reduce(((e,t,o,a)=>(0!==o&&t===a[o-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},51206:function(e){e.exports=(function(e){var t={};function o(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(a,i,function(t){return e[t]}.bind(null,i));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=90)})({17:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a=o(18),i=(function(){function e(){}return e.getFirstMatch=function(e,t){var o=t.match(e);return o&&o.length>0&&o[1]||""},e.getSecondMatch=function(e,t){var o=t.match(e);return o&&o.length>1&&o[2]||""},e.matchAndReturnConst=function(e,t,o){if(e.test(t))return o},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,o,a){void 0===a&&(a=!1);var i=e.getVersionPrecision(t),r=e.getVersionPrecision(o),n=Math.max(i,r),E=0,_=e.map([t,o],(function(t){var o=n-e.getVersionPrecision(t),a=t+new Array(o+1).join(".0");return e.map(a.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(a&&(E=n-Math.min(i,r)),n-=1;n>=E;){if(_[0][n]>_[1][n])return 1;if(_[0][n]===_[1][n]){if(n===E)return 0;n-=1}else if(_[0][n]<_[1][n])return-1}},e.map=function(e,t){var o,a=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(o=0;o1?i-1:0),n=1;n0){var n=Object.keys(o),_=E.default.find(n,(function(e){return t.isOS(e)}));if(_){var s=this.satisfies(o[_]);if(void 0!==s)return s}var T=E.default.find(n,(function(e){return t.isPlatform(e)}));if(T){var S=this.satisfies(o[T]);if(void 0!==S)return S}}if(r>0){var l=Object.keys(i),u=E.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==u)return this.compareVersion(i[u])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var o=this.getBrowserName().toLowerCase(),a=e.toLowerCase(),i=E.default.getBrowserTypeByAlias(a);return t&&i&&(a=i.toLowerCase()),a===o},t.compareVersion=function(e){var t=[0],o=e,a=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(o=e.substr(1),"="===e[1]?(a=!0,o=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?o=e.substr(1):"~"===e[0]&&(a=!0,o=e.substr(1)),t.indexOf(E.default.compareVersions(i,o,a))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e})();t.default=s,e.exports=t.default},92:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,i=(a=o(17))&&a.__esModule?a:{default:a},r=/version\/(\d+(\.?_?\d+)+)/i,n=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},o=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},o=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},o=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},o=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},o=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},o=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},o=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},o=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},o=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},o=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},o=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},o=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},o=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},o=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},o=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return o&&(t.version=o),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},o=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},o=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},o=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},o=i.default.getFirstMatch(r,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},o=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},o=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},o=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},o=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},o=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},o=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},o=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},o=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},o=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){var t=!e.test(/like android/i),o=e.test(/android/i);return t&&o},describe:function(e){var t={name:"Android Browser"},o=i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},o=i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},o=i.default.getFirstMatch(r,e);return o&&(t.version=o),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=n,e.exports=t.default},93:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,i=(a=o(17))&&a.__esModule?a:{default:a},r=o(18),n=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),o=i.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},o=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return o&&(t.version=o),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),o=i.default.getMacOSVersionName(t),a={name:r.OS_MAP.MacOS,version:t};return o&&(a.versionName=o),a}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),o=e.test(/android/i);return t&&o},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),o=i.default.getAndroidVersionName(t),a={name:r.OS_MAP.Android,version:t};return o&&(a.versionName=o),a}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),o={name:r.OS_MAP.WebOS};return t&&t.length&&(o.version=t),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=n,e.exports=t.default},94:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,i=(a=o(17))&&a.__esModule?a:{default:a},r=o(18),n=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",o={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(o.model=t),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),o=e.test(/like (ipod|iphone)/i);return t&&!o},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=n,e.exports=t.default},95:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,i=(a=o(17))&&a.__esModule?a:{default:a},r=o(18),n=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},o=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},o=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){var t=e.test(/gecko/i),o=e.test(/like gecko/i);return t&&!o},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},o=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},o=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}}];t.default=n,e.exports=t.default}})},48764:(e,t,o)=>{"use strict";const a=o(79742),i=o(80645),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=_,t.SlowBuffer=function(e){+e!=e&&(e=0);return _.alloc(+e)},t.INSPECT_MAX_BYTES=50;const n=2147483647;function E(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,_.prototype),t}function _(e,t,o){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return S(e)}return s(e,t,o)}function s(e,t,o){if("string"==typeof e)return(function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!_.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const o=0|d(e,t);let a=E(o);const i=a.write(e,t);i!==o&&(a=a.slice(0,i));return a})(e,t);if(ArrayBuffer.isView(e))return(function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return u(t.buffer,t.byteOffset,t.byteLength)}return l(e)})(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return u(e,t,o);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return u(e,t,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return _.from(a,t,o);const i=(function(e){if(_.isBuffer(e)){const t=0|I(e.length),o=E(t);return 0===o.length||e.copy(o,0,0,t),o}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?E(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)})(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return _.from(e[Symbol.toPrimitive]("string"),t,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function T(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function S(e){return T(e),E(e<0?0:0|I(e))}function l(e){const t=e.length<0?0:0|I(e.length),o=E(t);for(let a=0;a=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function d(e,t){if(_.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const o=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===o)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return x(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*o;case"hex":return o>>>1;case"base64":return j(e).length;default:if(i)return a?-1:x(e).length;t=(""+t).toLowerCase(),i=!0}}function A(e,t,o){let a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===o||o>this.length)&&(o=this.length),o<=0)return"";if((o>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,o);case"utf8":case"utf-8":return f(this,t,o);case"ascii":return g(this,t,o);case"latin1":case"binary":return B(this,t,o);case"base64":return D(this,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,o);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function c(e,t,o){const a=e[t];e[t]=e[o],e[o]=a}function O(e,t,o,a,i){if(0===e.length)return-1;if("string"==typeof o?(a=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),$(o=+o)&&(o=i?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(i)return-1;o=e.length-1}else if(o<0){if(!i)return-1;o=0}if("string"==typeof t&&(t=_.from(t,a)),_.isBuffer(t))return 0===t.length?-1:R(e,t,o,a,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,o):Uint8Array.prototype.lastIndexOf.call(e,t,o):R(e,[t],o,a,i);throw new TypeError("val must be string, number or Buffer")}function R(e,t,o,a,i){let r,n=1,E=e.length,_=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;n=2,E/=2,_/=2,o/=2}function s(e,t){return 1===n?e[t]:e.readUInt16BE(t*n)}if(i){let a=-1;for(r=o;rE&&(o=E-_),r=o;r>=0;r--){let o=!0;for(let a=0;a<_;a++)if(s(e,r+a)!==s(t,a)){o=!1;break}if(o)return r}return-1}function N(e,t,o,a){o=Number(o)||0;const i=e.length-o;a?(a=Number(a))>i&&(a=i):a=i;const r=t.length;let n;for(a>r/2&&(a=r/2),n=0;n>8,i=o%256,r.push(i),r.push(a);return r})(t,e.length-o),e,o,a)}function D(e,t,o){return 0===t&&o===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,o))}function f(e,t,o){o=Math.min(e.length,o);const a=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+n<=o){let o,a,E,_;switch(n){case 1:t<128&&(r=t);break;case 2:o=e[i+1],128==(192&o)&&(_=(31&t)<<6|63&o,_>127&&(r=_));break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(_=(15&t)<<12|(63&o)<<6|63&a,_>2047&&(_<55296||_>57343)&&(r=_));break;case 4:o=e[i+1],a=e[i+2],E=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&E)&&(_=(15&t)<<18|(63&o)<<12|(63&a)<<6|63&E,_>65535&&_<1114112&&(r=_))}}null===r?(r=65533,n=1):r>65535&&(r-=65536,a.push(r>>>10&1023|55296),r=56320|1023&r),a.push(r),i+=n}return(function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let o="",a=0;for(;aa.length?(_.isBuffer(t)||(t=_.from(t)),t.copy(a,i)):Uint8Array.prototype.set.call(a,t,i);else{if(!_.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(a,i)}i+=t.length}return a},_.byteLength=d,_.prototype._isBuffer=!0,_.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;to&&(e+=" ... "),""},r&&(_.prototype[r]=_.prototype.inspect),_.prototype.compare=function(e,t,o,a,i){if(X(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),!_.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===o&&(o=e?e.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),t<0||o>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=o)return 0;if(a>=i)return-1;if(t>=o)return 1;if(this===e)return 0;let r=(i>>>=0)-(a>>>=0),n=(o>>>=0)-(t>>>=0);const E=Math.min(r,n),s=this.slice(a,i),T=e.slice(t,o);for(let e=0;e>>=0,isFinite(o)?(o>>>=0,void 0===a&&(a="utf8")):(a=o,o=void 0)}const i=this.length-t;if((void 0===o||o>i)&&(o=i),e.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");let r=!1;for(;;)switch(a){case"hex":return N(this,e,t,o);case"utf8":case"utf-8":return m(this,e,t,o);case"ascii":case"latin1":case"binary":return p(this,e,t,o);case"base64":return L(this,e,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,e,t,o);default:if(r)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),r=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function g(e,t,o){let a="";o=Math.min(e.length,o);for(let i=t;ia)&&(o=a);let i="";for(let a=t;ao)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,o,a,i,r){if(!_.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function W(e,t,o,a,i){H(t,a,i,e,o,7);let r=Number(t&BigInt(4294967295));e[o++]=r,r>>=8,e[o++]=r,r>>=8,e[o++]=r,r>>=8,e[o++]=r;let n=Number(t>>BigInt(32)&BigInt(4294967295));return e[o++]=n,n>>=8,e[o++]=n,n>>=8,e[o++]=n,n>>=8,e[o++]=n,o}function b(e,t,o,a,i){H(t,a,i,e,o,7);let r=Number(t&BigInt(4294967295));e[o+7]=r,r>>=8,e[o+6]=r,r>>=8,e[o+5]=r,r>>=8,e[o+4]=r;let n=Number(t>>BigInt(32)&BigInt(4294967295));return e[o+3]=n,n>>=8,e[o+2]=n,n>>=8,e[o+1]=n,n>>=8,e[o]=n,o+8}function U(e,t,o,a,i,r){if(o+a>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function G(e,t,o,a,r){return t=+t,o>>>=0,r||U(e,0,o,4),i.write(e,t,o,a,23,4),o+4}function k(e,t,o,a,r){return t=+t,o>>>=0,r||U(e,0,o,8),i.write(e,t,o,a,52,8),o+8}_.prototype.slice=function(e,t){const o=this.length;(e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t>>=0,t>>>=0,o||y(e,t,this.length);let a=this[e],i=1,r=0;for(;++r>>=0,t>>>=0,o||y(e,t,this.length);let a=this[e+--t],i=1;for(;t>0&&(i*=256);)a+=this[e+--t]*i;return a},_.prototype.readUint8=_.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},_.prototype.readBigUInt64LE=J((function(e){Y(e>>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+o*2**24;return BigInt(a)+(BigInt(i)<>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+o;return(BigInt(a)<>>=0,t>>>=0,o||y(e,t,this.length);let a=this[e],i=1,r=0;for(;++r=i&&(a-=Math.pow(2,8*t)),a},_.prototype.readIntBE=function(e,t,o){e>>>=0,t>>>=0,o||y(e,t,this.length);let a=t,i=1,r=this[e+--a];for(;a>0&&(i*=256);)r+=this[e+--a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},_.prototype.readInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},_.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);const o=this[e]|this[e+1]<<8;return 32768&o?4294901760|o:o},_.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);const o=this[e+1]|this[e]<<8;return 32768&o?4294901760|o:o},_.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},_.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},_.prototype.readBigInt64LE=J((function(e){Y(e>>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=this[e+4]+256*this[e+5]+65536*this[e+6]+(o<<24);return(BigInt(a)<>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(a)<>>=0,t||y(e,4,this.length),i.read(this,e,!0,23,4)},_.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!1,23,4)},_.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!0,52,8)},_.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!1,52,8)},_.prototype.writeUintLE=_.prototype.writeUIntLE=function(e,t,o,a){if(e=+e,t>>>=0,o>>>=0,!a){M(this,e,t,o,Math.pow(2,8*o)-1,0)}let i=1,r=0;for(this[t]=255&e;++r>>=0,o>>>=0,!a){M(this,e,t,o,Math.pow(2,8*o)-1,0)}let i=o-1,r=1;for(this[t+i]=255&e;--i>=0&&(r*=256);)this[t+i]=e/r&255;return t+o},_.prototype.writeUint8=_.prototype.writeUInt8=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,1,255,0),this[t]=255&e,t+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},_.prototype.writeBigUInt64LE=J((function(e,t=0){return W(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),_.prototype.writeBigUInt64BE=J((function(e,t=0){return b(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),_.prototype.writeIntLE=function(e,t,o,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*o-1);M(this,e,t,o,a-1,-a)}let i=0,r=1,n=0;for(this[t]=255&e;++i>0)-n&255;return t+o},_.prototype.writeIntBE=function(e,t,o,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*o-1);M(this,e,t,o,a-1,-a)}let i=o-1,r=1,n=0;for(this[t+i]=255&e;--i>=0&&(r*=256);)e<0&&0===n&&0!==this[t+i+1]&&(n=1),this[t+i]=(e/r>>0)-n&255;return t+o},_.prototype.writeInt8=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},_.prototype.writeInt16LE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},_.prototype.writeInt16BE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},_.prototype.writeInt32LE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},_.prototype.writeInt32BE=function(e,t,o){return e=+e,t>>>=0,o||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},_.prototype.writeBigInt64LE=J((function(e,t=0){return W(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),_.prototype.writeBigInt64BE=J((function(e,t=0){return b(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),_.prototype.writeFloatLE=function(e,t,o){return G(this,e,t,!0,o)},_.prototype.writeFloatBE=function(e,t,o){return G(this,e,t,!1,o)},_.prototype.writeDoubleLE=function(e,t,o){return k(this,e,t,!0,o)},_.prototype.writeDoubleBE=function(e,t,o){return k(this,e,t,!1,o)},_.prototype.copy=function(e,t,o,a){if(!_.isBuffer(e))throw new TypeError("argument should be a Buffer");if(o||(o=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t>>=0,o=void 0===o?this.length:o>>>0,e||(e=0),"number"==typeof e)for(i=t;i=a+4;o-=3)t=`_${e.slice(o-3,o)}${t}`;return`${e.slice(0,o)}${t}`}function H(e,t,o,a,i,r){if(e>o||e3?0===t||t===BigInt(0)?`>= 0${a} and < 2${a} ** ${8*(r+1)}${a}`:`>= -(2${a} ** ${8*(r+1)-1}${a}) and < 2 ** ${8*(r+1)-1}${a}`:`>= ${t}${a} and <= ${o}${a}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!(function(e,t,o){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+o]||z(t,e.length-(o+1))})(a,i,r)}function Y(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,o){if(Math.floor(e)!==e)throw Y(e,o),new F.ERR_OUT_OF_RANGE(o||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(o||"offset",`>= ${o?1:0} and <= ${t}`,e)}w("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),w("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),w("ERR_OUT_OF_RANGE",(function(e,t,o){let a=`The value of "${e}" is out of range.`,i=o;return Number.isInteger(o)&&Math.abs(o)>2**32?i=V(String(o)):"bigint"==typeof o&&(i=String(o),(o>BigInt(2)**BigInt(32)||o<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),a+=` It must be ${t}. Received ${i}`,a}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function x(e,t){let o;t=t||1/0;const a=e.length;let i=null;const r=[];for(let n=0;n55295&&o<57344){if(!i){if(o>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(n+1===a){(t-=3)>-1&&r.push(239,191,189);continue}i=o;continue}if(o<56320){(t-=3)>-1&&r.push(239,191,189),i=o;continue}o=65536+(i-55296<<10|o-56320)}else i&&(t-=3)>-1&&r.push(239,191,189);if(i=null,o<128){if((t-=1)<0)break;r.push(o)}else if(o<2048){if((t-=2)<0)break;r.push(o>>6|192,63&o|128)}else if(o<65536){if((t-=3)<0)break;r.push(o>>12|224,o>>6&63|128,63&o|128)}else{if(!(o<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}}return r}function j(e){return a.toByteArray((function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(e))}function Q(e,t,o,a){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+o]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const q=(function(){const e="0123456789abcdef",t=new Array(256);for(let o=0;o<16;++o){const a=16*o;for(let i=0;i<16;++i)t[a+i]=e[o]+e[i]}return t})();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},94184:(e,t)=>{var o;!(function(){"use strict";var a={}.hasOwnProperty;function i(){for(var e=[],t=0;t{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],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],darkgreen:[0,100,0],darkgrey:[169,169,169],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],darkslategrey:[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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],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],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],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],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,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],rebeccapurple:[102,51,153],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],slategrey:[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],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},19818:(e,t,o)=>{var a=o(8874),i=o(86851),r=Object.hasOwnProperty,n=Object.create(null);for(var E in a)r.call(a,E)&&(n[a[E]]=E);var _=e.exports={to:{},get:{}};function s(e,t,o){return Math.min(Math.max(t,e),o)}function T(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}_.get=function(e){var t,o;switch(e.substring(0,3).toLowerCase()){case"hsl":t=_.get.hsl(e),o="hsl";break;case"hwb":t=_.get.hwb(e),o="hwb";break;default:t=_.get.rgb(e),o="rgb"}return t?{model:o,value:t}:null},_.get.rgb=function(e){if(!e)return null;var t,o,i,n=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=t[2],t=t[1],o=0;o<3;o++){var E=2*o;n[o]=parseInt(t.slice(E,E+2),16)}i&&(n[3]=parseInt(i,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(i=(t=t[1])[3],o=0;o<3;o++)n[o]=parseInt(t[o]+t[o],16);i&&(n[3]=parseInt(i+i,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(o=0;o<3;o++)n[o]=parseInt(t[o+1],0);t[4]&&(t[5]?n[3]=.01*parseFloat(t[4]):n[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:r.call(a,t[1])?((n=a[t[1]])[3]=1,n):null:null;for(o=0;o<3;o++)n[o]=Math.round(2.55*parseFloat(t[o+1]));t[4]&&(t[5]?n[3]=.01*parseFloat(t[4]):n[3]=parseFloat(t[4]))}for(o=0;o<3;o++)n[o]=s(n[o],0,255);return n[3]=s(n[3],0,1),n},_.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var o=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(o)?1:o,0,1)]}return null},_.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var o=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,s(parseFloat(t[2]),0,100),s(parseFloat(t[3]),0,100),s(isNaN(o)?1:o,0,1)]}return null},_.to.hex=function(){var e=i(arguments);return"#"+T(e[0])+T(e[1])+T(e[2])+(e[3]<1?T(Math.round(255*e[3])):"")},_.to.rgb=function(){var e=i(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},_.to.rgb.percent=function(){var e=i(arguments),t=Math.round(e[0]/255*100),o=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+o+"%, "+a+"%)":"rgba("+t+"%, "+o+"%, "+a+"%, "+e[3]+")"},_.to.hsl=function(){var e=i(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},_.to.hwb=function(){var e=i(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},_.to.keyword=function(e){return n[e.slice(0,3)]}},6767:(e,t,o)=>{const a=o(19818),i=o(80978),r=["keyword","gray","hex"],n={};for(const e of Object.keys(i))n[[...i[e].labels].sort().join("")]=e;const E={};function _(e,t){if(!(this instanceof _))return new _(e,t);if(t&&t in r&&(t=null),t&&!(t in i))throw new Error("Unknown model: "+t);let o,s;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof _)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=a.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,s=i[this.model].channels,this.color=t.value.slice(0,s),this.valpha="number"==typeof t.value[s]?t.value[s]:1}else if(e.length>0){this.model=t||"rgb",s=i[this.model].channels;const o=Array.prototype.slice.call(e,0,s);this.color=l(o,s),this.valpha="number"==typeof e[s]?e[s]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const a=t.sort().join("");if(!(a in n))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=n[a];const{labels:r}=i[this.model],E=[];for(o=0;o(e%360+360)%360)),saturationl:T("hsl",1,S(100)),lightness:T("hsl",2,S(100)),saturationv:T("hsv",1,S(100)),value:T("hsv",2,S(100)),chroma:T("hcg",1,S(100)),gray:T("hcg",2,S(100)),white:T("hwb",1,S(100)),wblack:T("hwb",2,S(100)),cyan:T("cmyk",0,S(100)),magenta:T("cmyk",1,S(100)),yellow:T("cmyk",2,S(100)),black:T("cmyk",3,S(100)),x:T("xyz",0,S(95.047)),y:T("xyz",1,S(100)),z:T("xyz",2,S(108.833)),l:T("lab",0,S(100)),a:T("lab",1),b:T("lab",2),keyword(e){return void 0!==e?new _(e):i[this.model].keyword(this.color)},hex(e){return void 0!==e?new _(e):a.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new _(e);const t=this.rgb().round().color;let o=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===o.length&&(o="0"+o),a.to.hex(t)+o},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[o,a]of e.entries()){const e=a/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),o=e.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return _.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let o=t.color[0];return o=(o+e)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const o=e.rgb(),a=this.rgb(),i=void 0===t?.5:t,r=2*i-1,n=o.alpha()-a.alpha(),E=((r*n==-1?r:(r+n)/(1+r*n))+1)/2,s=1-E;return _.rgb(E*o.red()+s*a.red(),E*o.green()+s*a.green(),E*o.blue()+s*a.blue(),o.alpha()*i+a.alpha()*(1-i))}};for(const e of Object.keys(i)){if(r.includes(e))continue;const{channels:t}=i[e];_.prototype[e]=function(...t){return this.model===e?new _(this):t.length>0?new _(t,e):new _([...(o=i[this.model][e].raw(this.color),Array.isArray(o)?o:[o]),this.valpha],e);var o},_[e]=function(...o){let a=o[0];return"number"==typeof a&&(a=l(o,t)),new _(a,e)}}function s(e){return function(t){return(function(e,t){return Number(e.toFixed(t))})(t,e)}}function T(e,t,o){e=Array.isArray(e)?e:[e];for(const a of e)(E[a]||(E[a]=[]))[t]=o;return e=e[0],function(a){let i;return void 0!==a?(o&&(a=o(a)),i=this[e](),i.color[t]=a,i):(i=this[e]().color[t],o&&(i=o(i)),i)}}function S(e){return function(t){return Math.max(0,Math.min(e,t))}}function l(e,t){for(let o=0;o{const a=o(58900),i={};for(const e of Object.keys(a))i[a[e]]=e;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=r;for(const e of Object.keys(r)){if(!("channels"in r[e]))throw new Error("missing channels property: "+e);if(!("labels"in r[e]))throw new Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:o}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:t}),Object.defineProperty(r[e],"labels",{value:o})}r.rgb.hsl=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(t,o,a),r=Math.max(t,o,a),n=r-i;let E,_;r===i?E=0:t===r?E=(o-a)/n:o===r?E=2+(a-t)/n:a===r&&(E=4+(t-o)/n),E=Math.min(60*E,360),E<0&&(E+=360);const s=(i+r)/2;return _=r===i?0:s<=.5?n/(r+i):n/(2-r-i),[E,100*_,100*s]},r.rgb.hsv=function(e){let t,o,a,i,r;const n=e[0]/255,E=e[1]/255,_=e[2]/255,s=Math.max(n,E,_),T=s-Math.min(n,E,_),S=function(e){return(s-e)/6/T+.5};return 0===T?(i=0,r=0):(r=T/s,t=S(n),o=S(E),a=S(_),n===s?i=a-o:E===s?i=1/3+t-a:_===s&&(i=2/3+o-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*r,100*s]},r.rgb.hwb=function(e){const t=e[0],o=e[1];let a=e[2];const i=r.rgb.hsl(e)[0],n=1/255*Math.min(t,Math.min(o,a));return a=1-1/255*Math.max(t,Math.max(o,a)),[i,100*n,100*a]},r.rgb.cmyk=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(1-t,1-o,1-a);return[100*((1-t-i)/(1-i)||0),100*((1-o-i)/(1-i)||0),100*((1-a-i)/(1-i)||0),100*i]},r.rgb.keyword=function(e){const t=i[e];if(t)return t;let o,r=1/0;for(const t of Object.keys(a)){const i=a[t],_=(E=i,((n=e)[0]-E[0])**2+(n[1]-E[1])**2+(n[2]-E[2])**2);_.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;return[100*(.4124*t+.3576*o+.1805*a),100*(.2126*t+.7152*o+.0722*a),100*(.0193*t+.1192*o+.9505*a)]},r.rgb.lab=function(e){const t=r.rgb.xyz(e);let o=t[0],a=t[1],i=t[2];o/=95.047,a/=100,i/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*a-16,500*(o-a),200*(a-i)]},r.hsl.rgb=function(e){const t=e[0]/360,o=e[1]/100,a=e[2]/100;let i,r,n;if(0===o)return n=255*a,[n,n,n];i=a<.5?a*(1+o):a+o-a*o;const E=2*a-i,_=[0,0,0];for(let e=0;e<3;e++)r=t+1/3*-(e-1),r<0&&r++,r>1&&r--,n=6*r<1?E+6*(i-E)*r:2*r<1?i:3*r<2?E+(i-E)*(2/3-r)*6:E,_[e]=255*n;return _},r.hsl.hsv=function(e){const t=e[0];let o=e[1]/100,a=e[2]/100,i=o;const r=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,i*=r<=1?r:2-r;return[t,100*(0===a?2*i/(r+i):2*o/(a+o)),100*((a+o)/2)]},r.hsv.rgb=function(e){const t=e[0]/60,o=e[1]/100;let a=e[2]/100;const i=Math.floor(t)%6,r=t-Math.floor(t),n=255*a*(1-o),E=255*a*(1-o*r),_=255*a*(1-o*(1-r));switch(a*=255,i){case 0:return[a,_,n];case 1:return[E,a,n];case 2:return[n,a,_];case 3:return[n,E,a];case 4:return[_,n,a];case 5:return[a,n,E]}},r.hsv.hsl=function(e){const t=e[0],o=e[1]/100,a=e[2]/100,i=Math.max(a,.01);let r,n;n=(2-o)*a;const E=(2-o)*i;return r=o*i,r/=E<=1?E:2-E,r=r||0,n/=2,[t,100*r,100*n]},r.hwb.rgb=function(e){const t=e[0]/360;let o=e[1]/100,a=e[2]/100;const i=o+a;let r;i>1&&(o/=i,a/=i);const n=Math.floor(6*t),E=1-a;r=6*t-n,0!=(1&n)&&(r=1-r);const _=o+r*(E-o);let s,T,S;switch(n){default:s=E,T=_,S=o;break;case 1:s=_,T=E,S=o;break;case 2:s=o,T=E,S=_;break;case 3:s=o,T=_,S=E;break;case 4:s=_,T=o,S=E;break;case 5:s=E,T=o,S=_}return[255*s,255*T,255*S]},r.cmyk.rgb=function(e){const t=e[0]/100,o=e[1]/100,a=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,o*(1-i)+i)),255*(1-Math.min(1,a*(1-i)+i))]},r.xyz.rgb=function(e){const t=e[0]/100,o=e[1]/100,a=e[2]/100;let i,r,n;return i=3.2406*t+-1.5372*o+-.4986*a,r=-.9689*t+1.8758*o+.0415*a,n=.0557*t+-.204*o+1.057*a,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,i=Math.min(Math.max(0,i),1),r=Math.min(Math.max(0,r),1),n=Math.min(Math.max(0,n),1),[255*i,255*r,255*n]},r.xyz.lab=function(e){let t=e[0],o=e[1],a=e[2];t/=95.047,o/=100,a/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;return[116*o-16,500*(t-o),200*(o-a)]},r.lab.xyz=function(e){let t,o,a;o=(e[0]+16)/116,t=e[1]/500+o,a=o-e[2]/200;const i=o**3,r=t**3,n=a**3;return o=i>.008856?i:(o-16/116)/7.787,t=r>.008856?r:(t-16/116)/7.787,a=n>.008856?n:(a-16/116)/7.787,t*=95.047,o*=100,a*=108.883,[t,o,a]},r.lab.lch=function(e){const t=e[0],o=e[1],a=e[2];let i;i=360*Math.atan2(a,o)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(o*o+a*a),i]},r.lch.lab=function(e){const t=e[0],o=e[1],a=e[2]/360*2*Math.PI;return[t,o*Math.cos(a),o*Math.sin(a)]},r.rgb.ansi16=function(e,t=null){const[o,a,i]=e;let n=null===t?r.rgb.hsv(e)[2]:t;if(n=Math.round(n/50),0===n)return 30;let E=30+(Math.round(i/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return 2===n&&(E+=60),E},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){const t=e[0],o=e[1],a=e[2];if(t===o&&o===a)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const o=.5*(1+~~(e>50));return[(1&t)*o*255,(t>>1&1)*o*255,(t>>2&1)*o*255]},r.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let o=t[0];3===t[0].length&&(o=o.split("").map((e=>e+e)).join(""));const a=parseInt(o,16);return[a>>16&255,a>>8&255,255&a]},r.rgb.hcg=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.max(Math.max(t,o),a),r=Math.min(Math.min(t,o),a),n=i-r;let E,_;return E=n<1?r/(1-n):0,_=n<=0?0:i===t?(o-a)/n%6:i===o?2+(a-t)/n:4+(t-o)/n,_/=6,_%=1,[360*_,100*n,100*E]},r.hsl.hcg=function(e){const t=e[1]/100,o=e[2]/100,a=o<.5?2*t*o:2*t*(1-o);let i=0;return a<1&&(i=(o-.5*a)/(1-a)),[e[0],100*a,100*i]},r.hsv.hcg=function(e){const t=e[1]/100,o=e[2]/100,a=t*o;let i=0;return a<1&&(i=(o-a)/(1-a)),[e[0],100*a,100*i]},r.hcg.rgb=function(e){const t=e[0]/360,o=e[1]/100,a=e[2]/100;if(0===o)return[255*a,255*a,255*a];const i=[0,0,0],r=t%1*6,n=r%1,E=1-n;let _=0;switch(Math.floor(r)){case 0:i[0]=1,i[1]=n,i[2]=0;break;case 1:i[0]=E,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=n;break;case 3:i[0]=0,i[1]=E,i[2]=1;break;case 4:i[0]=n,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=E}return _=(1-o)*a,[255*(o*i[0]+_),255*(o*i[1]+_),255*(o*i[2]+_)]},r.hcg.hsv=function(e){const t=e[1]/100,o=t+e[2]/100*(1-t);let a=0;return o>0&&(a=t/o),[e[0],100*a,100*o]},r.hcg.hsl=function(e){const t=e[1]/100,o=e[2]/100*(1-t)+.5*t;let a=0;return o>0&&o<.5?a=t/(2*o):o>=.5&&o<1&&(a=t/(2*(1-o))),[e[0],100*a,100*o]},r.hcg.hwb=function(e){const t=e[1]/100,o=t+e[2]/100*(1-t);return[e[0],100*(o-t),100*(1-o)]},r.hwb.hcg=function(e){const t=e[1]/100,o=1-e[2]/100,a=o-t;let i=0;return a<1&&(i=(o-a)/(1-a)),[e[0],100*a,100*i]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},80978:(e,t,o)=>{const a=o(12956),i=o(87774),r={};Object.keys(a).forEach((e=>{r[e]={},Object.defineProperty(r[e],"channels",{value:a[e].channels}),Object.defineProperty(r[e],"labels",{value:a[e].labels});const t=i(e);Object.keys(t).forEach((o=>{const a=t[o];r[e][o]=(function(e){const t=function(...t){const o=t[0];if(null==o)return o;o.length>1&&(t=o);const a=e(t);if("object"==typeof a)for(let e=a.length,t=0;t1&&(t=o),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t})(a)}))})),e.exports=r},87774:(e,t,o)=>{const a=o(12956);function i(e){const t=(function(){const e={},t=Object.keys(a);for(let o=t.length,a=0;a{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],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],darkgreen:[0,100,0],darkgrey:[169,169,169],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],darkslategrey:[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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],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],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],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],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,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],rebeccapurple:[102,51,153],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],slategrey:[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],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},62682:e=>{e.exports=function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(o){!t.hasOwnProperty(o)||null===t[o]||"object"!=typeof t[o]&&"function"!=typeof t[o]||Object.isFrozen(t[o])||e(t[o])})),t}},26729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,o="~";function a(){}function i(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function r(e,t,a,r,n){if("function"!=typeof a)throw new TypeError("The listener must be a function");var E=new i(a,r||e,n),_=o?o+t:t;return e._events[_]?e._events[_].fn?e._events[_]=[e._events[_],E]:e._events[_].push(E):(e._events[_]=E,e._eventsCount++),e}function n(e,t){0==--e._eventsCount?e._events=new a:delete e._events[t]}function E(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(o=!1)),E.prototype.eventNames=function(){var e,a,i=[];if(0===this._eventsCount)return i;for(a in e=this._events)t.call(e,a)&&i.push(o?a.slice(1):a);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},E.prototype.listeners=function(e){var t=o?o+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,r=a.length,n=new Array(r);i{"use strict";t.Z=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&E(o)&&(t[o]=e[o]);return t};var a,i=o(52047),r=(a=i)&&a.__esModule?a:{default:a};var n={onCopy:!0,onCut:!0,onPaste:!0,onLoad:!0,onError:!0,onWheel:!0,onScroll:!0,onCompositionEnd:!0,onCompositionStart:!0,onCompositionUpdate:!0,onKeyDown:!0,onKeyPress:!0,onKeyUp:!0,onFocus:!0,onBlur:!0,onChange:!0,onInput:!0,onSubmit:!0,onClick:!0,onContextMenu:!0,onDoubleClick:!0,onDrag:!0,onDragEnd:!0,onDragEnter:!0,onDragExit:!0,onDragLeave:!0,onDragOver:!0,onDragStart:!0,onDrop:!0,onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOut:!0,onMouseOver:!0,onMouseUp:!0,onSelect:!0,onTouchCancel:!0,onTouchEnd:!0,onTouchMove:!0,onTouchStart:!0,onAnimationStart:!0,onAnimationEnd:!0,onAnimationIteration:!0,onTransitionEnd:!0};function E(e){return n[e]||r.default[e]||/^(data|aria)-/.test(e)}},542:e=>{var t=e.exports=function(e,o){if(o||(o=16),void 0===e&&(e=128),e<=0)return"0";for(var a=Math.log(Math.pow(2,e))/Math.log(o),i=2;a===1/0;i*=2)a=Math.log(Math.pow(2,e/i))/Math.log(o)*i;var r=a-Math.floor(a),n="";for(i=0;i=Math.pow(2,e)?t(e,o):n};t.rack=function(e,o,a){var i=function(i){var n=0;do{if(n++>10){if(!a)throw new Error("too many ID collisions, use more bits");e+=a}var E=t(e,o)}while(Object.hasOwnProperty.call(r,E));return r[E]=i,E},r=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=o||16,i}},67631:e=>{!(function t(o){e.exports=(function(){"use strict";function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function a(t){for(var o=1;oe.length)&&(t=e.length);for(var o=0,a=new Array(t);o=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function R(e,t){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var a=o.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function N(e){var t=R(e,"string");return"symbol"==typeof t?t:String(t)}function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={exports:{}};!(function(e,t){var o,a,i,r,n;o=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,a=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(e,t,o){if(o=o||{},e=e.trim(),!(t=t.trim())){if(!o.alwaysNormalize)return e;var i=n.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=n.normalizePath(i.path),n.buildURLFromParts(i)}var r=n.parseURL(t);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return o.alwaysNormalize?(r.path=n.normalizePath(r.path),n.buildURLFromParts(r)):t;var E=n.parseURL(e);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&"/"!==E.path[0]){var _=a.exec(E.path);E.netLoc=_[1],E.path=_[2]}E.netLoc&&!E.path&&(E.path="/");var s={scheme:E.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(s.netLoc=E.netLoc,"/"!==r.path[0]))if(r.path){var T=E.path,S=T.substring(0,T.lastIndexOf("/")+1)+r.path;s.path=n.normalizePath(S)}else s.path=E.path,r.params||(s.params=E.params,r.query||(s.query=E.query));return null===s.path&&(s.path=o.alwaysNormalize?n.normalizePath(r.path):r.path),n.buildURLFromParts(s)},parseURL:function(e){var t=o.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=n})(p);var L=p.exports,h=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},D=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=f},f=Number.MAX_SAFE_INTEGER||9007199254740991,C=(function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e})({}),g=(function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e})({}),B=(function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e})({}),P=function(){},v={trace:P,debug:P,log:P,warn:P,info:P,error:P},y=v;function M(e){var t=self.console[e];return t?t.bind(self.console,"["+e+"] >"):P}function W(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;aNumber.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var o=new Uint8Array(t.length/2),a=0;aNumber.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var o=this[e];return o?parseFloat(o):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=G.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,o={},a='"';for(k.lastIndex=0;null!==(t=k.exec(e));){var i=t[2];0===i.indexOf(a)&&i.lastIndexOf(a)===i.length-1&&(i=i.slice(1,-1)),o[t[1].trim()]=i}return o},e})();function w(e){return"ID"!==e&&"CLASS"!==e&&"START-DATE"!==e&&"DURATION"!==e&&"END-DATE"!==e&&"END-ON-NEXT"!==e}function V(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}var H=(function(){function e(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){var o=t.attr;for(var a in o)if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==o[a]){U.warn('DATERANGE tag attribute: "'+a+'" does not match for tags with ID: "'+e.ID+'"'),this._badValueForSameId=a;break}e=E(new F({}),o,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){var i=new Date(this.attr["END-DATE"]);h(i.getTime())&&(this._endDate=i)}}return r(e,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}},{key:"duration",get:function(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(h(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&h(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),e})(),Y=function(){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}},z={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"},K=(function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[z.AUDIO]=null,t[z.VIDEO]=null,t[z.AUDIOVIDEO]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var o=e.split("@",2),a=[];1===o.length?a[0]=t?t.byteRangeEndOffset:0:a[0]=parseInt(o[1]),a[1]=parseInt(o[0])+a[0],this._byteRange=a},r(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=L.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e})(),x=(function(e){function t(t,o){var a;return(a=e.call(this,o)||this)._decryptdata=null,a.rawProgramDateTime=null,a.programDateTime=null,a.tagList=[],a.duration=0,a.sn=0,a.levelkeys=void 0,a.type=void 0,a.loader=null,a.keyLoader=null,a.level=-1,a.cc=0,a.startPTS=void 0,a.endPTS=void 0,a.startDTS=void 0,a.endDTS=void 0,a.start=0,a.deltaPTS=void 0,a.maxStartPTS=void 0,a.minEndPTS=void 0,a.stats=new Y,a.urlId=0,a.data=void 0,a.bitrateTest=!1,a.title=null,a.initSegment=null,a.endList=void 0,a.gap=void 0,a.type=t,a}_(t,e);var o=t.prototype;return o.setKeyFormat=function(e){if(this.levelkeys){var t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}},o.abortRequests=function(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()},o.setElementaryStreamInfo=function(e,t,o,a,i,r){void 0===r&&(r=!1);var n=this.elementaryStreams,E=n[e];E?(E.startPTS=Math.min(E.startPTS,t),E.endPTS=Math.max(E.endPTS,o),E.startDTS=Math.min(E.startDTS,a),E.endDTS=Math.max(E.endDTS,i)):n[e]={startPTS:t,endPTS:o,startDTS:a,endDTS:i,partial:r}},o.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[z.AUDIO]=null,e[z.VIDEO]=null,e[z.AUDIOVIDEO]=null},r(t,[{key:"decryptdata",get:function(){if(!this.levelkeys&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{var t=Object.keys(this.levelkeys);if(1===t.length)return this._decryptdata=this.levelkeys[t[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!h(this.programDateTime))return null;var e=h(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t=Object.keys(this.levelkeys),o=t.length;if(o>1||1===o&&this.levelkeys[t[0]].encrypted)return!0}return!1}}]),t})(K),j=(function(e){function t(t,o,a,i,r){var n;(n=e.call(this,a)||this).fragOffset=0,n.duration=0,n.gap=!1,n.independent=!1,n.relurl=void 0,n.fragment=void 0,n.index=void 0,n.stats=new Y,n.duration=t.decimalFloatingPoint("DURATION"),n.gap=t.bool("GAP"),n.independent=t.bool("INDEPENDENT"),n.relurl=t.enumeratedString("URI"),n.fragment=o,n.index=i;var E=t.enumeratedString("BYTERANGE");return E&&n.setByteRange(E,r),r&&(n.fragOffset=r.fragOffset+r.duration),n}return _(t,e),r(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t})(K),Q=10,X=(function(){function e(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.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 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.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}return e.prototype.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,o=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!o||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&o>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},r(e,[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&h(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||Q}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e})();function $(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)}))}function q(e){var t=ee(e).subarray(0,16),o=new Uint8Array(16);return o.set(t,16-t.length),o}function J(e){var t=function(e,t,o){var a=e[t];e[t]=e[o],e[o]=a};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function Z(e){var t=e.split(":"),o=null;if("data"===t[0]&&2===t.length){var a=t[1].split(";"),i=a[a.length-1].split(",");if(2===i.length){var r="base64"===i[0],n=i[1];r?(a.splice(-1,1),o=$(n)):o=q(n)}}return o}function ee(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(function(e){return e.charCodeAt(0)}))}var te={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},oe={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ae(e){switch(e){case oe.FAIRPLAY:return te.FAIRPLAY;case oe.PLAYREADY:return te.PLAYREADY;case oe.WIDEVINE:return te.WIDEVINE;case oe.CLEARKEY:return te.CLEARKEY}}var ie={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function re(e){if(e===ie.WIDEVINE)return te.WIDEVINE}function ne(e){switch(e){case te.FAIRPLAY:return oe.FAIRPLAY;case te.PLAYREADY:return oe.PLAYREADY;case te.WIDEVINE:return oe.WIDEVINE;case te.CLEARKEY:return oe.CLEARKEY}}function Ee(e){var t=e.drmSystems,o=e.widevineLicenseUrl,a=t?[te.FAIRPLAY,te.WIDEVINE,te.PLAYREADY,te.CLEARKEY].filter((function(e){return!!t[e]})):[];return!a[te.WIDEVINE]&&o&&a.push(te.WIDEVINE),a}var _e="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function se(e,t,o,a){var i;switch(e){case te.FAIRPLAY:i=["cenc","sinf"];break;case te.WIDEVINE:case te.PLAYREADY:i=["cenc"];break;case te.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+e)}return Te(i,t,o,a)}function Te(e,t,o,a){return[{initDataTypes:e,persistentState:a.persistentState||"not-allowed",distinctiveIdentifier:a.distinctiveIdentifier||"not-allowed",sessionTypes:a.sessionTypes||[a.sessionType||"temporary"],audioCapabilities:t.map((function(e){return{contentType:'audio/mp4; codecs="'+e+'"',robustness:a.audioRobustness||"",encryptionScheme:a.audioEncryptionScheme||null}})),videoCapabilities:o.map((function(e){return{contentType:'video/mp4; codecs="'+e+'"',robustness:a.videoRobustness||"",encryptionScheme:a.videoEncryptionScheme||null}}))}]}function Se(e,t,o){return Uint8Array.prototype.slice?e.slice(t,o):new Uint8Array(Array.prototype.slice.call(e,t,o))}var le,ue=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},Ie=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},de=function(e,t){for(var o=t,a=0;ue(e,t);)a+=10,a+=Ae(e,t+6),Ie(e,t+10)&&(a+=10),t+=a;if(a>0)return e.subarray(o,o+a)},Ae=function(e,t){var o=0;return o=(127&e[t])<<21,o|=(127&e[t+1])<<14,o|=(127&e[t+2])<<7,o|=127&e[t+3]},ce=function(e,t){return ue(e,t)&&Ae(e,t+6)+10<=e.length-t},Oe=function(e){for(var t=me(e),o=0;o>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(r);break;case 12:case 13:n=e[T++],s+=String.fromCharCode((31&r)<<6|63&n);break;case 14:n=e[T++],E=e[T++],s+=String.fromCharCode((15&r)<<12|(63&n)<<6|(63&E)<<0)}}return s};function ge(){if(!navigator.userAgent.includes("PlayStation 4"))return le||void 0===self.TextDecoder||(le=new self.TextDecoder("utf-8")),le}var Be={hexDump:function(e){for(var t="",o=0;o>24,e[t+1]=o>>16&255,e[t+2]=o>>8&255,e[t+3]=255&o}function ke(e,t){var o=[];if(!t.length)return o;for(var a=e.byteLength,i=0;i1?i+r:a;if(Me(e.subarray(i+4,i+8))===t[0])if(1===t.length)o.push(e.subarray(i+8,n));else{var E=ke(e.subarray(i+8,n),t.slice(1));E.length&&ve.apply(o,E)}i=n}return o}function Fe(e){var t=[],o=e[0],a=8,i=be(e,a);a+=4;var r=0,n=0;a+=0===o?8:16,a+=2;var E=e.length+n,_=We(e,a);a+=2;for(var s=0;s<_;s++){var T=a,S=be(e,T);T+=4;var l=2147483647&S;if(1==(2147483648&S)>>>31)return U.warn("SIDX has hierarchical references (not supported)"),null;var u=be(e,T);T+=4,t.push({referenceSize:l,subsegmentDuration:u,info:{duration:u/i,start:E,end:E+l-1}}),E+=l,a=T+=4}return{earliestPresentationTime:r,timescale:i,version:o,referencesCount:_,references:t}}function we(e){for(var t=[],o=ke(e,["moov","trak"]),a=0;a0;i||(a=ke(t,["encv"])),a.forEach((function(e){ke(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((function(e){var t=He(e);if(t){var a=t.subarray(8,24);a.some((function(e){return 0!==e}))||(U.log("[eme] Patching keyId in 'enc"+(i?"a":"v")+">sinf>>tenc' box: "+Be.hexDump(a)+" -> "+Be.hexDump(o)),t.set(o,8))}}))}))})),e}function He(e){var t=ke(e,["schm"])[0];if(t){var o=Me(t.subarray(4,8));if("cbcs"===o||"cenc"===o)return ke(e,["schi","tenc"])[0]}return U.error("[eme] missing 'schm' box"),null}function Ye(e,t){return ke(t,["moof","traf"]).reduce((function(t,o){var a=ke(o,["tfdt"])[0],i=a[0],r=ke(o,["tfhd"]).reduce((function(t,o){var r=be(o,4),n=e[r];if(n){var E=be(a,4);if(1===i){if(E===Pe)return U.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;E*=Pe+1,E+=be(a,8)}var _=E/(n.timescale||9e4);if(h(_)&&(null===t||_>1&63;return 39===o||40===o}return 6==(31&t)}function Je(e,t,o,a){var i=Ze(e),r=0;r+=t;for(var n=0,E=0,_=!1,s=0;r=i.length)break;n+=s=i[r++]}while(255===s);E=0;do{if(r>=i.length)break;E+=s=i[r++]}while(255===s);var T=i.length-r;if(!_&&4===n&&r16){for(var R=[],N=0;N<16;N++){var m=i[r++].toString(16);R.push(1==m.length?"0"+m:m),3!==N&&5!==N&&7!==N&&9!==N||R.push("-")}for(var p=E-16,L=new Uint8Array(p),h=0;hT)break}}function Ze(e){for(var t=e.byteLength,o=[],a=1;a1?t-1:0),a=1;a>24&255,E[1]=r>>16&255,E[2]=r>>8&255,E[3]=255&r,E.set(e,4),n=0,r=8;n0?(r=new Uint8Array(4),t.length>0&&new DataView(r.buffer).setUint32(0,t.length,!1)):r=new Uint8Array;var _=new Uint8Array(4);return o&&o.byteLength>0&&new DataView(_.buffer).setUint32(0,o.byteLength,!1),tt([112,115,115,104],new Uint8Array([a,0,0,0]),e,r,i,_,o||new Uint8Array)}function at(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;var t={version:0,systemId:"",kids:null,data:null},o=new DataView(e),a=o.getUint32(0);if(e.byteLength!==a&&a>44)return null;if(1886614376!==o.getUint32(4))return null;if(t.version=o.getUint32(8)>>>24,t.version>1)return null;t.systemId=Be.hexDump(new Uint8Array(e,12,16));var i=o.getUint32(28);if(0===t.version){if(a-32=22&&(this.keyId=a.subarray(a.length-22,a.length-6));break;case oe.PLAYREADY:var i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ot(i,null,a);var r=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),n=String.fromCharCode.apply(null,Array.from(r)),E=n.substring(n.indexOf("<"),n.length),_=(new DOMParser).parseFromString(E,"text/xml").getElementsByTagName("KID")[0];if(_){var s=_.childNodes[0]?_.childNodes[0].nodeValue:_.getAttribute("VALUE");if(s){var T=$(s).subarray(0,16);J(T),this.keyId=T}}break;default:var S=a.subarray(0,16);if(16!==S.length){var l=new Uint8Array(16);l.set(S,16-S.length),S=l}this.keyId=S}if(!this.keyId||16!==this.keyId.byteLength){var u=it[this.uri];if(!u){var I=Object.keys(it).length%Number.MAX_SAFE_INTEGER;u=new Uint8Array(16),new DataView(u.buffer,12,4).setUint32(0,I),it[this.uri]=u}this.keyId=u}return this},e})();function nt(e){for(var t=new Uint8Array(16),o=12;o<16;o++)t[o]=e>>8*(15-o)&255;return t}var Et=/\{\$([a-zA-Z0-9-_]+)\}/g;function _t(e){return Et.test(e)}function st(e,t,o){if(null!==e.variableList||e.hasVariableRefs)for(var a=o.length;a--;){var i=o[a],r=t[i];r&&(t[i]=Tt(e,r))}}function Tt(e,t){if(null!==e.variableList||e.hasVariableRefs){var o=e.variableList;return t.replace(Et,(function(t){var a=t.substring(2,t.length-1),i=null==o?void 0:o[a];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'+a+'"')),t):i}))}return t}function St(e,t,o){var a,i,r=e.variableList;if(r||(e.variableList=r={}),"QUERYPARAM"in t){a=t.QUERYPARAM;try{var n=new self.URL(o).searchParams;if(!n.has(a))throw new Error('"'+a+'" does not match any query parameter in URI: "'+o+'"');i=n.get(a)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+t.message))}}else a=t.NAME,i=t.VALUE;a in r?e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'+a+'"')):r[a]=i||""}function lt(e,t,o){var a=t.IMPORT;if(o&&a in o){var i=e.variableList;i||(e.variableList=i={}),i[a]=o[a]}else e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'+a+'"'))}function ut(){if("undefined"!=typeof self)return self.MediaSource||self.WebKitMediaSource}var It={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},dt=ut();function At(e,t){var o=It[t];return!!o&&!0===o[e.slice(0,4)]}function ct(e,t){var o;return null!=(o=null==dt?void 0:dt.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"'))&&o}var Ot=/#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,Rt=/#EXT-X-MEDIA:(.*)/g,Nt=/^#EXT(?:INF|-X-TARGETDURATION):/m,mt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),pt=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(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)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),Lt=(function(){function e(){}return e.findGroup=function(e,t){for(var o=0;o2){var o=t.shift()+".";return o+=parseInt(t.shift()).toString(16),o+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return L.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.isMediaPlaylist=function(e){return Nt.test(e)},e.parseMasterPlaylist=function(t,o){var a,i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:_t(t)},r=[];for(Ot.lastIndex=0;null!=(a=Ot.exec(t));)if(a[1]){var n,E=new F(a[1]);st(i,E,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);var _=Tt(i,a[2]),s={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:e.resolve(_,o)},T=E.decimalResolution("RESOLUTION");T&&(s.width=T.width,s.height=T.height),ft((E.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),s),s.videoCodec&&-1!==s.videoCodec.indexOf("avc1")&&(s.videoCodec=e.convertAVC1ToAVCOTI(s.videoCodec)),null!=(n=s.unknownCodecs)&&n.length||r.push(s),i.levels.push(s)}else if(a[3]){var S=a[3],l=a[4];switch(S){case"SESSION-DATA":var u=new F(l);st(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);var I=u["DATA-ID"];I&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[I]=u);break;case"SESSION-KEY":var d=ht(l,o,i);d.encrypted&&d.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(d)):U.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+l+'"');break;case"DEFINE":var A=new F(l);st(i,A,["NAME","VALUE","QUERYPARAM"]),St(i,A,o);break;case"CONTENT-STEERING":var c=new F(l);st(i,c,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:e.resolve(c["SERVER-URI"],o),pathwayId:c["PATHWAY-ID"]||"."};break;case"START":i.startTimeOffset=Dt(l)}}var O=r.length>0&&r.length0&&V.bool("CAN-SKIP-DATERANGES"),T.partHoldBack=V.optionalFloat("PART-HOLD-BACK",0),T.holdBack=V.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Y=new F(C);T.partTarget=Y.decimalFloatingPoint("PART-TARGET");break;case"PART":var z=T.partList;z||(z=T.partList=[]);var K=I>0?z[z.length-1]:void 0,Q=I++,$=new F(C);st(T,$,["BYTERANGE","URI"]);var q=new j($,O,t,Q,K);z.push(q),O.duration+=q.duration;break;case"PRELOAD-HINT":var J=new F(C);st(T,J,["URI"]),T.preloadHint=J;break;case"RENDITION-REPORT":var Z=new F(C);st(T,Z,["URI"]),T.renditionReports=T.renditionReports||[],T.renditionReports.push(Z);break;default:U.warn("line parsed but not handled: "+n)}}}c&&!c.relurl?(S.pop(),d-=c.duration,T.partList&&(T.fragmentHint=c)):T.partList&&(Bt(O,c),O.cc=A,T.fragmentHint=O,s&&vt(O,s,T));var ee=S.length,te=S[0],oe=S[ee-1];if((d+=T.skippedSegments*T.targetduration)>0&&ee&&oe){T.averagetargetduration=d/ee;var ae=oe.sn;T.endSN="initSegment"!==ae?ae:0,T.live||(oe.endList=!0),te&&(T.startCC=te.cc)}else T.endSN=0,T.startCC=0;return T.fragmentHint&&(d+=T.fragmentHint.duration),T.totalduration=d,T.endCC=A,R>0&>(S,R),T},e})();function ht(e,t,o){var a,i,r=new F(e);st(o,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);var n=null!=(a=r.METHOD)?a:"",E=r.URI,_=r.hexadecimalInteger("IV"),s=r.KEYFORMATVERSIONS,T=null!=(i=r.KEYFORMAT)?i:"identity";E&&r.IV&&!_&&U.error("Invalid IV: "+r.IV);var S=E?Lt.resolve(E,t):"",l=(s||"1").split("/").map(Number).filter(Number.isFinite);return new rt(n,S,T,l,_)}function Dt(e){var t=new F(e).decimalFloatingPoint("TIME-OFFSET");return h(t)?t:null}function ft(e,t){["video","audio","text"].forEach((function(o){var a=e.filter((function(e){return At(e,o)}));if(a.length){var i=a.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[o+"Codec"]=i.length>0?i[0]:a[0],e=e.filter((function(e){return-1===a.indexOf(e)}))}})),t.unknownCodecs=e}function Ct(e,t,o){var a=t[o];a&&(e[o]=a)}function gt(e,t){for(var o=e[t],a=t;a--;){var i=e[a];if(!i)return;i.programDateTime=o.programDateTime-1e3*i.duration,o=i}}function Bt(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),h(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function Pt(e,t,o,a){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=o,e.sn="initSegment",a&&(e.levelkeys=a),e.initSegment=null}function vt(e,t,o){e.levelkeys=t;var a=o.encryptedFragments;a.length&&a[a.length-1].levelkeys===t||!Object.keys(t).some((function(e){return t[e].isCommonEncryption}))||a.push(e)}var yt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Mt={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Wt(e){switch(e.type){case yt.AUDIO_TRACK:return Mt.AUDIO;case yt.SUBTITLE_TRACK:return Mt.SUBTITLE;default:return Mt.MAIN}}function bt(e,t){var o=e.url;return void 0!==o&&0!==o.indexOf("data:")||(o=t.url),o}var Ut=(function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){var e=this.hls;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(C.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_LOADING,this.onLevelLoading,this),e.off(C.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(C.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,o=t.pLoader,a=t.loader,i=new(o||a)(t);return this.loaders[e.type]=i,i},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var o=t.url;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:yt.MANIFEST,url:o,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var o=t.id,a=t.level,i=t.url,r=t.deliveryDirectives;this.load({id:o,level:a,responseType:"text",type:yt.LEVEL,url:i,deliveryDirectives:r})},t.onAudioTrackLoading=function(e,t){var o=t.id,a=t.groupId,i=t.url,r=t.deliveryDirectives;this.load({id:o,groupId:a,level:null,responseType:"text",type:yt.AUDIO_TRACK,url:i,deliveryDirectives:r})},t.onSubtitleTrackLoading=function(e,t){var o=t.id,a=t.groupId,i=t.url,r=t.deliveryDirectives;this.load({id:o,groupId:a,level:null,responseType:"text",type:yt.SUBTITLE_TRACK,url:i,deliveryDirectives:r})},t.load=function(e){var t,o,a,i=this,r=this.hls.config,n=this.getInternalLoader(e);if(n){var _=n.context;if(_&&_.url===e.url)return void U.trace("[playlist-loader]: playlist request ongoing");U.log("[playlist-loader]: aborting previous loader for type: "+e.type),n.abort()}if(o=e.type===yt.MANIFEST?r.manifestLoadPolicy.default:E({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part&&(e.type===yt.LEVEL&&null!==e.level?a=this.hls.levels[e.level].details:e.type===yt.AUDIO_TRACK&&null!==e.id?a=this.hls.audioTracks[e.id].details:e.type===yt.SUBTITLE_TRACK&&null!==e.id&&(a=this.hls.subtitleTracks[e.id].details),a)){var s=a.partTarget,T=a.targetduration;if(s&&T){var S=1e3*Math.max(3*s,.8*T);o=E({},o,{maxTimeToFirstByteMs:Math.min(S,o.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(S,o.maxTimeToFirstByteMs)})}}var l=o.errorRetry||o.timeoutRetry||{},u={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},I={onSuccess:function(e,t,o,a){var r=i.getInternalLoader(o);i.resetInternalLoader(o.type);var n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Lt.isMediaPlaylist(n)?i.handleTrackOrLevelPlaylist(e,t,o,a||null,r):i.handleMasterPlaylist(e,t,o,a)):i.handleManifestParsingError(e,o,new Error("no EXTM3U delimiter"),a||null,t)},onError:function(e,t,o,a){i.handleNetworkError(t,o,!1,e,a)},onTimeout:function(e,t,o){i.handleNetworkError(t,o,!0,void 0,e)}};n.load(e,u,I)},t.handleMasterPlaylist=function(e,t,o,a){var i=this.hls,r=e.data,n=bt(e,o),E=Lt.parseMasterPlaylist(r,n);if(E.playlistParsingError)this.handleManifestParsingError(e,o,E.playlistParsingError,a,t);else{var _=E.contentSteering,s=E.levels,T=E.sessionData,S=E.sessionKeys,l=E.startTimeOffset,u=E.variableList;this.variableList=u;var I=Lt.parseMasterPlaylistMedia(r,n,E),d=I.AUDIO,A=void 0===d?[]:d,c=I.SUBTITLES,O=I["CLOSED-CAPTIONS"];A.length&&(A.some((function(e){return!e.url}))||!s[0].audioCodec||s[0].attrs.AUDIO||(U.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new F({}),bitrate:0,url:""}))),i.trigger(C.MANIFEST_LOADED,{levels:s,audioTracks:A,subtitles:c,captions:O,contentSteering:_,url:n,stats:t,networkDetails:a,sessionData:T,sessionKeys:S,startTimeOffset:l,variableList:u})}},t.handleTrackOrLevelPlaylist=function(e,t,o,a,i){var r=this.hls,n=o.id,E=o.level,_=o.type,s=bt(e,o),T=h(n)?n:0,S=h(E)?E:T,l=Wt(o),u=Lt.parseLevelPlaylist(e.data,s,S,l,T,this.variableList);if(_===yt.MANIFEST){var I={attrs:new F({}),bitrate:0,details:u,name:"",url:s};r.trigger(C.MANIFEST_LOADED,{levels:[I],audioTracks:[],url:s,stats:t,networkDetails:a,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),o.levelDetails=u,this.handlePlaylistLoaded(u,e,t,o,a,i)},t.handleManifestParsingError=function(e,t,o,a,i){this.hls.trigger(C.ERROR,{type:g.NETWORK_ERROR,details:B.MANIFEST_PARSING_ERROR,fatal:t.type===yt.MANIFEST,url:e.url,err:o,error:o,reason:o.message,response:e,context:t,networkDetails:a,stats:i})},t.handleNetworkError=function(e,t,o,i,r){void 0===o&&(o=!1);var n="A network "+(o?"timeout":"error"+(i?" (status "+i.code+")":""))+" occurred while loading "+e.type;e.type===yt.LEVEL?n+=": "+e.level+" id: "+e.id:e.type!==yt.AUDIO_TRACK&&e.type!==yt.SUBTITLE_TRACK||(n+=" id: "+e.id+' group-id: "'+e.groupId+'"');var E=new Error(n);U.warn("[playlist-loader]: "+n);var _=B.UNKNOWN,s=!1,T=this.getInternalLoader(e);switch(e.type){case yt.MANIFEST:_=o?B.MANIFEST_LOAD_TIMEOUT:B.MANIFEST_LOAD_ERROR,s=!0;break;case yt.LEVEL:_=o?B.LEVEL_LOAD_TIMEOUT:B.LEVEL_LOAD_ERROR,s=!1;break;case yt.AUDIO_TRACK:_=o?B.AUDIO_TRACK_LOAD_TIMEOUT:B.AUDIO_TRACK_LOAD_ERROR,s=!1;break;case yt.SUBTITLE_TRACK:_=o?B.SUBTITLE_TRACK_LOAD_TIMEOUT:B.SUBTITLE_LOAD_ERROR,s=!1}T&&this.resetInternalLoader(e.type);var S={type:g.NETWORK_ERROR,details:_,fatal:s,url:e.url,loader:T,context:e,error:E,networkDetails:t,stats:r};if(i){var l=(null==t?void 0:t.url)||e.url;S.response=a({url:l,data:void 0},i)}this.hls.trigger(C.ERROR,S)},t.handlePlaylistLoaded=function(e,t,o,a,i,r){var n=this.hls,E=a.type,_=a.level,s=a.id,T=a.groupId,S=a.deliveryDirectives,l=bt(t,a),u=Wt(a),I="number"==typeof a.level&&u===Mt.MAIN?_:void 0;if(e.fragments.length){e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));var d=e.playlistParsingError;if(d)n.trigger(C.ERROR,{type:g.NETWORK_ERROR,details:B.LEVEL_PARSING_ERROR,fatal:!1,url:l,error:d,reason:d.message,response:t,context:a,level:I,parent:u,networkDetails:i,stats:o});else switch(e.live&&r&&(r.getCacheAge&&(e.ageHeader=r.getCacheAge()||0),r.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),E){case yt.MANIFEST:case yt.LEVEL:n.trigger(C.LEVEL_LOADED,{details:e,level:I||0,id:s||0,stats:o,networkDetails:i,deliveryDirectives:S});break;case yt.AUDIO_TRACK:n.trigger(C.AUDIO_TRACK_LOADED,{details:e,id:s||0,groupId:T||"",stats:o,networkDetails:i,deliveryDirectives:S});break;case yt.SUBTITLE_TRACK:n.trigger(C.SUBTITLE_TRACK_LOADED,{details:e,id:s||0,groupId:T||"",stats:o,networkDetails:i,deliveryDirectives:S})}}else{var A=new Error("No Segments found in Playlist");n.trigger(C.ERROR,{type:g.NETWORK_ERROR,details:B.LEVEL_EMPTY_ERROR,fatal:!1,url:l,error:A,reason:A.message,response:t,context:a,level:I,parent:u,networkDetails:i,stats:o})}},e})();function Gt(e,t){var o;try{o=new Event("addtrack")}catch(e){(o=document.createEvent("Event")).initEvent("addtrack",!1,!1)}o.track=e,t.dispatchEvent(o)}function kt(e,t){var o=e.mode;if("disabled"===o&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(o){U.debug("[texttrack-utils]: "+o);try{var a=new self.TextTrackCue(t.startTime,t.endTime,t.text);a.id=t.id,e.addCue(a)}catch(e){U.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+e)}}"disabled"===o&&(e.mode=o)}function Ft(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var o=e.cues.length;o--;)e.removeCue(e.cues[o]);"disabled"===t&&(e.mode=t)}function wt(e,t,o,a){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var r=Ht(e.cues,t,o),n=0;ne[o].endTime)return-1;for(var a=0,i=o;a<=i;){var r=Math.floor((i+a)/2);if(te[r].startTime&&a-1)for(var r=i,n=e.length;r=t&&E.endTime<=o)a.push(E);else if(E.startTime>o)return a}return a}var Yt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"},zt=.25;function Kt(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function xt(e,t,o,i,r){var n=new e(t,o,"");try{n.value=i,r&&(n.type=r)}catch(E){n=new e(t,o,JSON.stringify(r?a({type:r},i):i))}return n}var jt=(function(){var e=Kt();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Qt(e,t){return e.getTime()/1e3-t}function Xt(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var $t=(function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},t._registerListeners=function(){var e=this.hls;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this)},t._unregisterListeners=function(){var e=this.hls;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Ft(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},t.onManifestLoading=function(){this.dateRangeCuesAppended={}},t.createTrack=function(e){var t=this.getID3Track(e.textTracks);return t.mode="hidden",t},t.getID3Track=function(e){if(this.media){for(var t=0;tjt&&(S=jt),S-T<=0&&(S=T+zt);for(var l=0;lt.startDate&&e.push(a),e}),[]).sort((function(e,t){return e.startDate.getTime()-t.startDate.getTime()}))[0];I&&(T=Qt(I.startDate,l),_=!0)}for(var A=Object.keys(t.attr),c=0;c.05&&this.forwardBufferLength>1){var s=Math.min(2,Math.max(1,r)),T=Math.round(2/(1+Math.exp(-.75*E-this.edgeStalled))*20)/20;e.playbackRate=Math.min(s,Math.max(1,T))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},t.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},t.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},r(e,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,o=e.partHoldBack,a=e.targetduration,i=this.config,r=i.liveSyncDuration,n=i.liveSyncDurationCount,E=i.lowLatencyMode,_=this.hls.userConfig,s=E&&o||t;(_.liveSyncDuration||_.liveSyncDurationCount||0===s)&&(s=void 0!==r?r:n*a);var T=a,S=1;return s+Math.min(this.stallCount*S,T)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,o=this.levelDetails;if(null===e||null===t||null===o)return null;var a=o.edge,i=e-t-this.edgeStalled,r=a-o.totalduration,n=a-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(r,i),n)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var o=e.buffered.length;return(o?e.buffered.end(o-1):t.edge)-this.currentTime}}]),e})(),Jt=["NONE","TYPE-0","TYPE-1",null],Zt={No:"",Yes:"YES",v2:"v2"};function eo(e,t){var o=e.canSkipUntil,a=e.canSkipDateRanges,i=e.endSN;return o&&(void 0!==t?t-i:0)e.sn?(i=o-e.start,a=e):(i=e.start-o,a=t),a.duration!==i&&(a.duration=i)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function io(e,t,o,a,i,r){a-o<=0&&(U.warn("Fragment should have a positive duration",t),a=o+t.duration,r=i+t.duration);var n=o,E=a,_=t.startPTS,s=t.endPTS;if(h(_)){var T=Math.abs(_-o);h(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,n=Math.max(o,_),o=Math.min(o,_),i=Math.min(i,t.startDTS),E=Math.min(a,s),a=Math.max(a,s),r=Math.max(r,t.endDTS)}var S=o-t.start;0!==t.start&&(t.start=o),t.duration=a-t.start,t.startPTS=o,t.maxStartPTS=n,t.startDTS=i,t.endPTS=a,t.minEndPTS=E,t.endDTS=r;var l,u=t.sn;if(!e||ue.endSN)return 0;var I=u-e.startSN,d=e.fragments;for(d[I]=t,l=I;l>0;l--)ao(d[l],d[l-1]);for(l=I;l=0;i--){var r=a[i].initSegment;if(r){o=r;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var n,E=0;if(_o(e,t,(function(e,a){e.relurl&&(E=e.cc-a.cc),h(e.startPTS)&&h(e.endPTS)&&(a.start=a.startPTS=e.startPTS,a.startDTS=e.startDTS,a.maxStartPTS=e.maxStartPTS,a.endPTS=e.endPTS,a.endDTS=e.endDTS,a.minEndPTS=e.minEndPTS,a.duration=e.endPTS-e.startPTS,a.duration&&(n=a),t.PTSKnown=t.alignedSliding=!0),a.elementaryStreams=e.elementaryStreams,a.loader=e.loader,a.stats=e.stats,a.urlId=e.urlId,e.initSegment&&(a.initSegment=e.initSegment,o=e.initSegment)})),o&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null==(t=o)?void 0:t.relurl)||(e.initSegment=o)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed){U.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var _=t.skippedSegments;_--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=no(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));var s=t.fragments;if(E){U.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T=a.length||To(t,a[o].start)}function To(e,t){if(t){for(var o=e.fragments,a=e.skippedSegments;at){var r=1e3*a[a.length-1].duration;r499)}var po={search:function(e,t){for(var o=0,a=e.length-1,i=null,r=null;o<=a;){var n=t(r=e[i=(o+a)/2|0]);if(n>0)o=i+1;else{if(!(n<0))return r;a=i-1}}return null}};function Lo(e,t,o){if(null===t||!Array.isArray(e)||!e.length||!h(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;o=o||0;for(var a=0;ae)return 0;var a=Math.min(t,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-a<=e?1:o.start-a>e&&o.start?-1:0}function fo(e,t,o){var a=1e3*Math.min(t,o.duration+(o.deltaPTS?o.deltaPTS:0));return(o.endProgramDateTime||0)-a>e}function Co(e,t){return po.search(e,(function(e){return e.cct?-1:0}))}var go=3e5,Bo={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Po={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4},vo=(function(){function e(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=U.log.bind(U,"[info]:"),this.warn=U.warn.bind(U,"[warning]:"),this.error=U.error.bind(U,"[error]:"),this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(C.ERROR,this.onError,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this)},t.unregisterListeners=function(){var e=this.hls;e&&(e.off(C.ERROR,this.onError,this),e.off(C.ERROR,this.onErrorOut,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this))},t.destroy=function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}},t.startLoad=function(e){this.playlistError=0},t.stopLoad=function(){},t.getVariantLevelIndex=function(e){return(null==e?void 0:e.type)===Mt.MAIN?e.level:this.hls.loadLevel},t.onManifestLoading=function(){this.playlistError=0,this.penalizedRenditions={}},t.onLevelUpdated=function(){this.playlistError=0},t.onError=function(e,t){var o,a;if(!t.fatal){var i=this.hls,r=t.context;switch(t.details){case B.FRAG_LOAD_ERROR:case B.FRAG_LOAD_TIMEOUT:case B.KEY_LOAD_ERROR:case B.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case B.FRAG_PARSING_ERROR:if(null!=(o=t.frag)&&o.gap)return void(t.errorAction={action:Bo.DoNothing,flags:Po.None});case B.FRAG_GAP:case B.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Bo.SendAlternateToPenaltyBox);case B.LEVEL_EMPTY_ERROR:case B.LEVEL_PARSING_ERROR:var n,E,_=t.parent===Mt.MAIN?t.level:i.loadLevel;return void(t.details===B.LEVEL_EMPTY_ERROR&&null!=(n=t.context)&&null!=(E=n.levelDetails)&&E.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,_):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,_)));case B.LEVEL_LOAD_ERROR:case B.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level)));case B.AUDIO_TRACK_LOAD_ERROR:case B.AUDIO_TRACK_LOAD_TIMEOUT:case B.SUBTITLE_LOAD_ERROR:case B.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){var s=i.levels[i.loadLevel];if(s&&(r.type===yt.AUDIO_TRACK&&r.groupId===s.audioGroupId||r.type===yt.SUBTITLE_TRACK&&r.groupId===s.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Bo.SendAlternateToPenaltyBox,void(t.errorAction.flags=Po.MoveAllAlternatesMatchingHost)}return;case B.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var T=i.levels[i.loadLevel],S=null==T?void 0:T.attrs["HDCP-LEVEL"];return void(S&&(t.errorAction={action:Bo.SendAlternateToPenaltyBox,flags:Po.MoveAllAlternatesMatchingHDCP,hdcpLevel:S}));case B.BUFFER_ADD_CODEC_ERROR:case B.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(a=t.level)?a:i.loadLevel));case B.INTERNAL_EXCEPTION:case B.BUFFER_APPENDING_ERROR:case B.BUFFER_APPEND_ERROR:case B.BUFFER_FULL_ERROR:case B.LEVEL_SWITCH_ERROR:case B.BUFFER_STALLED_ERROR:case B.BUFFER_SEEK_OVER_HOLE:case B.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:Bo.DoNothing,flags:Po.None})}if(t.type===g.KEY_SYSTEM_ERROR){var l=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,l))}}},t.getPlaylistRetryOrSwitchAction=function(e,t){var o,a=co(this.hls.config.playlistLoadPolicy,e),i=this.playlistError++,r=null==(o=e.response)?void 0:o.code;if(No(a,i,Ao(e),r))return{action:Bo.RetryRequest,flags:Po.None,retryConfig:a,retryCount:i};var n=this.getLevelSwitchAction(e,t);return a&&(n.retryConfig=a,n.retryCount=i),n},t.getFragRetryOrSwitchAction=function(e){var t=this.hls,o=this.getVariantLevelIndex(e.frag),a=t.levels[o],i=t.config,r=i.fragLoadPolicy,n=i.keyLoadPolicy,E=co(e.details.startsWith("key")?n:r,e),_=t.levels.reduce((function(e,t){return e+t.fragmentError}),0);if(a){var s;e.details!==B.FRAG_GAP&&a.fragmentError++;var T=null==(s=e.response)?void 0:s.code;if(No(E,_,Ao(e),T))return{action:Bo.RetryRequest,flags:Po.None,retryConfig:E,retryCount:_}}var S=this.getLevelSwitchAction(e,o);return E&&(S.retryConfig=E,S.retryCount=_),S},t.getLevelSwitchAction=function(e,t){var o=this.hls;null==t&&(t=o.loadLevel);var a=this.hls.levels[t];if(a&&(a.loadError++,o.autoLevelEnabled)){for(var i,r,n=-1,E=o.levels,_=o.loadLevel,s=o.minAutoLevel,T=o.maxAutoLevel,S=null==(i=e.frag)?void 0:i.type,l=null!=(r=e.context)?r:{},u=l.type,I=l.groupId,d=E.length;d--;){var A=(d+_)%E.length;if(A!==_&&A>=s&&A<=T&&0===E[A].loadError){var c=E[A];if(e.details===B.FRAG_GAP&&e.frag){var O=E[A].details;if(O){var R=ho(e.frag,O.fragments,e.frag.start);if(null!=R&&R.gap)continue}}else{if(u===yt.AUDIO_TRACK&&I===c.audioGroupId||u===yt.SUBTITLE_TRACK&&I===c.textGroupId)continue;if(S===Mt.AUDIO&&a.audioGroupId===c.audioGroupId||S===Mt.SUBTITLE&&a.textGroupId===c.textGroupId)continue}n=A;break}}if(n>-1&&o.loadLevel!==n)return e.levelRetry=!0,this.playlistError=0,{action:Bo.SendAlternateToPenaltyBox,flags:Po.None,nextAutoLevel:n}}return{action:Bo.SendAlternateToPenaltyBox,flags:Po.MoveAllAlternatesMatchingHost}},t.onErrorOut=function(e,t){var o;switch(null==(o=t.errorAction)?void 0:o.action){case Bo.DoNothing:break;case Bo.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===B.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()},t.sendAlternateToPenaltyBox=function(e){var t=this.hls,o=e.errorAction;if(o){var a=o.flags,i=o.hdcpLevel,r=o.nextAutoLevel;switch(a){case Po.None:this.switchLevel(e,r);break;case Po.MoveAllAlternatesMatchingHost:o.resolved||(o.resolved=this.redundantFailover(e));break;case Po.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=Jt[Jt.indexOf(i)-1],o.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'+t.maxHdcpLevel+'" or lower')}o.resolved||this.switchLevel(e,r)}},t.switchLevel=function(e,t){void 0!==t&&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)},t.redundantFailover=function(e){var t=this,o=this.hls,a=this.penalizedRenditions,i=e.parent===Mt.MAIN?e.level:o.loadLevel,r=o.levels[i],n=r.url.length,E=e.frag?e.frag.urlId:r.urlId;r.urlId!==E||e.frag&&!r.details||this.penalizeRendition(r,e);for(var _=function(){var _=(E+s)%n,T=a[_];if(!T||yo(T,e,a[E]))return t.warn("Switching to Redundant Stream "+(_+1)+"/"+n+': "'+r.url[_]+'" after '+e.details),t.playlistError=0,o.levels.forEach((function(e){e.urlId=_})),o.nextLoadLevel=i,{v:!0}},s=1;sgo)return!0;var a=e.details;if(t.details===B.FRAG_GAP&&a&&t.frag){var i=t.frag.start,r=ho(null,a.fragments,i);if(r&&!r.gap)return!0}if(o&&e.errors.length3*a.targetduration)return!0}return!1}var Mo,Wo=(function(){function e(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=U.log.bind(U,t+":"),this.warn=U.warn.bind(U,t+":"),this.hls=e}var t=e.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(e,t){var o=null==t?void 0:t.renditionReports;if(o){for(var a=-1,i=0;i=0&&T>t.partTarget&&(s+=1)}return new to(_,s>=0?s:void 0,Zt.No)}}},t.loadPlaylist=function(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())},t.shouldLoadPlaylist=function(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)},t.shouldReloadPlaylist=function(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)},t.playlistLoaded=function(e,t,o){var a=this,i=t.details,r=t.stats,n=self.performance.now(),E=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-E,i.live||null!=o&&o.live){if(i.reloaded(o),o&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED")),o&&i.fragments.length>0&&ro(o,i),!this.canLoad||!i.live)return;var _,s=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var S=this.hls.config.lowLatencyMode,l=i.lastPartSn,u=i.endSN,I=i.lastPartIndex,d=l===u;-1!==I?(s=d?u+1:l,T=d?S?0:I:I+1):s=u+1;var A=i.age,c=A+i.ageHeader,O=Math.min(c-i.partTarget,1.5*i.targetduration);if(O>0){if(o&&O>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+O+" with playlist age: "+i.age),O=0;else{var R=Math.floor(O/i.targetduration);s+=R,void 0!==T&&(T+=Math.round(O%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+O+" skip sn "+R+" to part "+T)}i.tuneInGoal=O}if(_=this.getDeliveryDirectives(i,t.deliveryDirectives,s,T),S||!d)return void this.loadPlaylist(_)}else(i.canBlockReload||i.canSkipUntil)&&(_=this.getDeliveryDirectives(i,t.deliveryDirectives,s,T));var N=this.hls.mainForwardBufferInfo,m=N?N.end-N.len:0,p=So(i,1e3*(i.edge-m));i.updated&&n>this.requestScheduled+p&&(this.requestScheduled=r.loading.start),void 0!==s&&i.canBlockReload?this.requestScheduled=r.loading.first+p-(1e3*i.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+p=s.maxNumRetry)return!1;if(a&&null!=(S=e.context)&&S.deliveryDirectives)this.warn("Retrying playlist loading "+(_+1)+"/"+s.maxNumRetry+' after "'+o+'" without delivery-directives'),this.loadPlaylist();else{var l=Oo(s,_);this.timer=self.setTimeout((function(){return t.loadPlaylist()}),l),this.warn("Retrying playlist loading "+(_+1)+"/"+s.maxNumRetry+' after "'+o+'" in '+l+"ms")}e.levelRetry=!0,i.resolved=!0}return T},e})(),bo=(function(e){function t(t,o){var a;return(a=e.call(this,t,"[level-controller]")||this)._levels=[],a._firstLevel=-1,a._startLevel=void 0,a.currentLevel=null,a.currentLevelIndex=-1,a.manualLevelIndex=-1,a.steering=void 0,a.onParsedComplete=void 0,a.steering=o,a._registerListeners(),a}_(t,e);var o=t.prototype;return o._registerListeners=function(){var e=this.hls;e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this),e.on(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(C.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this),e.on(C.ERROR,this.onError,this)},o._unregisterListeners=function(){var e=this.hls;e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this),e.off(C.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(C.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this),e.off(C.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),e.prototype.destroy.call(this)},o.startLoad=function(){this._levels.forEach((function(e){e.loadError=0,e.fragmentError=0})),e.prototype.startLoad.call(this)},o.resetLevels=function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]},o.onManifestLoading=function(e,t){this.resetLevels()},o.onManifestLoaded=function(e,t){var o,a=[],i={};t.levels.forEach((function(e){var t,r=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(Mo||(Mo=/chrome|firefox/i.test(navigator.userAgent)),Mo&&(e.audioCodec=void 0));var n=r.AUDIO,E=r.CODECS,_=r["FRAME-RATE"],s=r["PATHWAY-ID"],T=r.RESOLUTION,S=r.SUBTITLES,l=(s||".")+"-"+e.bitrate+"-"+T+"-"+_+"-"+E;(o=i[l])?o.addFallback(e):(o=new oo(e),i[l]=o,a.push(o)),Uo(o,"audio",n),Uo(o,"text",S)})),this.filterAndSortMediaOptions(a,t)},o.filterAndSortMediaOptions=function(e,t){var o=this,a=[],i=[],r=!1,n=!1,E=!1,_=e.filter((function(e){var t=e.audioCodec,o=e.videoCodec,a=e.width,i=e.height,_=e.unknownCodecs;return r||(r=!(!a||!i)),n||(n=!!o),E||(E=!!t),!(null!=_&&_.length)&&(!t||ct(t,"audio"))&&(!o||ct(o,"video"))}));if((r||n)&&E&&(_=_.filter((function(e){var t=e.videoCodec,o=e.width,a=e.height;return!!t||!(!o||!a)}))),0!==_.length){t.audioTracks&&Go(a=t.audioTracks.filter((function(e){return!e.audioCodec||ct(e.audioCodec,"audio")}))),t.subtitles&&Go(i=t.subtitles);var s=_.slice(0);_.sort((function(e,t){return e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):r&&e.height!==t.height?e.height-t.height:0}));var T=s[0];if(this.steering&&(_=this.steering.filterParsedLevels(_)).length!==s.length)for(var S=0;S1&&void 0!==t?(i.url=i.url.filter(a),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(a)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(a)),i.urlId=0,!0):(o.steering&&o.steering.removeLevel(i),!1))}));this.hls.trigger(C.LEVELS_UPDATED,{levels:i})},o.onLevelsUpdated=function(e,t){var o=t.levels;o.forEach((function(e,t){var o=e.details;null!=o&&o.fragments&&o.fragments.forEach((function(e){e.level=t}))})),this._levels=o},r(t,[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;if(0!==t.length){if(e<0||e>=t.length){var o=new Error("invalid level idx"),a=e<0;if(this.hls.trigger(C.ERROR,{type:g.OTHER_ERROR,details:B.LEVEL_SWITCH_ERROR,level:e,fatal:a,error:o,reason:o.message}),a)return;e=Math.min(e,t.length-1)}var i=this.currentLevelIndex,r=this.currentLevel,n=r?r.attrs["PATHWAY-ID"]:void 0,_=t[e],s=_.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=_,i!==e||!_.details||!r||n!==s){this.log("Switching to level "+e+(s?" with Pathway "+s:"")+" from level "+i+(n?" with Pathway "+n:""));var T=E({},_,{level:e,maxBitrate:_.maxBitrate,attrs:_.attrs,uri:_.uri,urlId:_.urlId});delete T._attrs,delete T._urlId,this.hls.trigger(C.LEVEL_SWITCHING,T);var S=_.details;if(!S||S.live){var l=this.switchParams(_.uri,null==r?void 0:r.details);this.loadPlaylist(l)}}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}]),t})(Wo);function Uo(e,t,o){o&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=o):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=o))}function Go(e){var t={};e.forEach((function(e){var o=e.groupId||"";e.id=t[o]=t[o]||0,t[o]++}))}var ko={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Fo=(function(){function e(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()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(C.BUFFER_APPENDED,this.onBufferAppended,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(C.BUFFER_APPENDED,this.onBufferAppended,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){var o=this.activePartLists[t];if(o)for(var a=o.length;a--;){var i=o[a];if(!i)break;var r=i.end;if(i.start<=e&&null!==r&&e<=r)return i}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var o=this.fragments,a=Object.keys(o),i=a.length;i--;){var r=o[a[i]];if((null==r?void 0:r.body.type)===t&&r.buffered){var n=r.body;if(n.start<=e&&e<=n.end)return n}}return null},t.detectEvictedFragments=function(e,t,o,a){var i=this;this.timeRanges&&(this.timeRanges[e]=t);var r=(null==a?void 0:a.fragment.sn)||-1;Object.keys(this.fragments).forEach((function(a){var n=i.fragments[a];if(n&&!(r>=n.body.sn))if(n.buffered||n.loaded){var E=n.range[e];E&&E.time.some((function(e){var o=!i.isTimeBuffered(e.startPTS,e.endPTS,t);return o&&i.removeFragment(n.body),o}))}else n.body.type===o&&i.removeFragment(n.body)}))},t.detectPartialFragments=function(e){var t=this,o=this.timeRanges,a=e.frag,i=e.part;if(o&&"initSegment"!==a.sn){var r=Vo(a),n=this.fragments[r];if(!(!n||n.buffered&&a.gap)){var E=!a.relurl;Object.keys(o).forEach((function(e){var r=a.elementaryStreams[e];if(r){var _=o[e],s=E||!0===r.partial;n.range[e]=t.getBufferedTimes(a,i,s,_)}})),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=a.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),wo(n)||this.removeParts(a.sn-1,a.type)):this.removeFragment(n.body)}}},t.removeParts=function(e,t){var o=this.activePartLists[t];o&&(this.activePartLists[t]=o.filter((function(t){return t.fragment.sn>=e})))},t.fragBuffered=function(e,t){var o=Vo(e),a=this.fragments[o];!a&&t&&(a=this.fragments[o]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),a&&(a.loaded=null,a.buffered=!0)},t.getBufferedTimes=function(e,t,o,a){for(var i={time:[],partial:o},r=e.start,n=e.end,E=e.minEndPTS||n,_=e.maxStartPTS||r,s=0;s=T&&E<=S){i.time.push({startPTS:Math.max(r,a.start(s)),endPTS:Math.min(n,a.end(s))});break}if(rT)i.partial=!0,i.time.push({startPTS:Math.max(r,a.start(s)),endPTS:Math.min(n,a.end(s))});else if(n<=T)break}return i},t.getPartialFragment=function(e){var t,o,a,i=null,r=0,n=this.bufferPadding,E=this.fragments;return Object.keys(E).forEach((function(_){var s=E[_];s&&wo(s)&&(o=s.body.start-n,a=s.body.end+n,e>=o&&e<=a&&(t=Math.min(e-o,a-e),r<=t&&(i=s.body,r=t)))})),i},t.isEndListAppended=function(e){var t=this.endListFragments[e];return void 0!==t&&(t.buffered||wo(t))},t.getState=function(e){var t=Vo(e),o=this.fragments[t];return o?o.buffered?wo(o)?ko.PARTIAL:ko.OK:ko.APPENDING:ko.NOT_LOADED},t.isTimeBuffered=function(e,t,o){for(var a,i,r=0;r=a&&t<=i)return!0;if(t<=a)return!1}return!1},t.onFragLoaded=function(e,t){var o=t.frag,a=t.part;if("initSegment"!==o.sn&&!o.bitrateTest){var i=a?null:t,r=Vo(o);this.fragments[r]={body:o,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var o=this,a=t.frag,i=t.part,r=t.timeRanges;if("initSegment"!==a.sn){var n=a.type;if(i){var E=this.activePartLists[n];E||(this.activePartLists[n]=E=[]),E.push(i)}this.timeRanges=r,Object.keys(r).forEach((function(e){var t=r[e];o.detectEvictedFragments(e,t,n,i)}))}},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=Vo(e);return!!this.fragments[t]},t.hasParts=function(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)},t.removeFragmentsInRange=function(e,t,o,a,i){var r=this;a&&!this.hasGaps||Object.keys(this.fragments).forEach((function(n){var E=r.fragments[n];if(E){var _=E.body;_.type!==o||a&&!_.gap||_.starte&&(E.buffered||i)&&r.removeFragment(_)}}))},t.removeFragment=function(e){var t=Vo(e);e.stats.loaded=0,e.clearElementaryStreamInfo();var o=this.activePartLists[e.type];if(o){var a=e.sn;this.activePartLists[e.type]=o.filter((function(e){return e.fragment.sn!==a}))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1},e})();function wo(e){var t,o,a;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(o=e.range.audio)?void 0:o.partial)||(null==(a=e.range.audiovideo)?void 0:a.partial))}function Vo(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}var Ho=Math.pow(2,17),Yo=(function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var o=this,i=e.url;if(!i)return Promise.reject(new xo({type:g.NETWORK_ERROR,details:B.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();var r=this.config,n=r.fLoader,E=r.loader;return new Promise((function(_,s){if(o.loader&&o.loader.destroy(),e.gap){if(e.tagList.some((function(e){return"GAP"===e[0]})))return void s(Ko(e));e.gap=!1}var T=o.loader=e.loader=n?new n(r):new E(r),S=zo(e),l=Ro(r.fragLoadPolicy.default),u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:Ho};e.stats=T.stats,T.load(S,u,{onSuccess:function(t,a,i,r){o.resetLoader(e,T);var n=t.data;i.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(n.slice(0,16)),n=n.slice(16)),_({frag:e,part:null,payload:n,networkDetails:r})},onError:function(t,r,n,E){o.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:a({url:i,data:void 0},t),error:new Error("HTTP Error "+t.code+" "+t.text),networkDetails:n,stats:E}))},onAbort:function(t,a,i){o.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:i,stats:t}))},onTimeout:function(t,a,i){o.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error("Timeout after "+u.timeout+"ms"),networkDetails:i,stats:t}))},onProgress:function(o,a,i,r){t&&t({frag:e,part:null,payload:i,networkDetails:r})}})}))},t.loadPart=function(e,t,o){var i=this;this.abort();var r=this.config,n=r.fLoader,E=r.loader;return new Promise((function(_,s){if(i.loader&&i.loader.destroy(),e.gap||t.gap)s(Ko(e,t));else{var T=i.loader=e.loader=n?new n(r):new E(r),S=zo(e,t),l=Ro(r.fragLoadPolicy.default),u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Ho};t.stats=T.stats,T.load(S,u,{onSuccess:function(a,r,n,E){i.resetLoader(e,T),i.updateStatsFromPart(e,t);var s={frag:e,part:t,payload:a.data,networkDetails:E};o(s),_(s)},onError:function(o,r,n,E){i.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:a({url:S.url,data:void 0},o),error:new Error("HTTP Error "+o.code+" "+o.text),networkDetails:n,stats:E}))},onAbort:function(o,a,r){e.stats.aborted=t.stats.aborted,i.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:r,stats:o}))},onTimeout:function(o,a,r){i.resetLoader(e,T),s(new xo({type:g.NETWORK_ERROR,details:B.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error("Timeout after "+u.timeout+"ms"),networkDetails:r,stats:o}))}})}}))},t.updateStatsFromPart=function(e,t){var o=e.stats,a=t.stats,i=a.total;if(o.loaded+=a.loaded,i){var r=Math.round(e.duration/t.duration),n=Math.min(Math.round(o.loaded/i),r),E=(r-n)*Math.round(o.loaded/n);o.total=o.loaded+E}else o.total=Math.max(o.loaded,o.total);var _=o.loading,s=a.loading;_.start?_.first+=s.first-s.start:(_.start=s.start,_.first=s.first),_.end=s.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e})();function zo(e,t){void 0===t&&(t=null);var o=t||e,a={frag:e,part:t,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},i=o.byteRangeStartOffset,r=o.byteRangeEndOffset;if(h(i)&&h(r)){var n,E=i,_=r;if("initSegment"===e.sn&&"AES-128"===(null==(n=e.decryptdata)?void 0:n.method)){var s=r-i;s%16&&(_=r+(16-s%16)),0!==i&&(a.resetIV=!0,E=i-16)}a.rangeStart=E,a.rangeEnd=_}return a}function Ko(e,t){var o=new Error("GAP "+(e.gap?"tag":"attribute")+" found"),a={type:g.MEDIA_ERROR,details:B.FRAG_GAP,fatal:!1,frag:e,error:o,networkDetails:null};return t&&(a.part=t),(t||e).stats.aborted=!0,new xo(a)}var xo=(function(e){function t(t){var o;return(o=e.call(this,t.error.message)||this).data=void 0,o.data=t,o}return _(t,e),t})(I(Error)),jo=(function(){function e(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}var t=e.prototype;return t.abort=function(e){for(var t in this.keyUriToKeyInfo){var o=this.keyUriToKeyInfo[t].loader;if(o){if(e&&e!==o.context.frag.type)return;o.abort()}}},t.detach=function(){for(var e in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}},t.destroy=function(){for(var e in this.detach(),this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}},t.createKeyLoadError=function(e,t,o,a,i){return void 0===t&&(t=B.KEY_LOAD_ERROR),new xo({type:g.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:o,networkDetails:a})},t.loadClear=function(e,t){var o=this;if(this.emeController&&this.config.emeEnabled)for(var a=e.sn,i=e.cc,r=function(){var e=t[n];if(i<=e.cc&&("initSegment"===a||"initSegment"===e.sn||a1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e})(),Xo={length:0,start:function(){return 0},end:function(){return 0}},$o=(function(){function e(){}return e.isBuffered=function(t,o){try{if(t)for(var a=e.getBuffered(t),i=0;i=a.start(i)&&o<=a.end(i))return!0}catch(e){}return!1},e.bufferInfo=function(t,o,a){try{if(t){var i,r=e.getBuffered(t),n=[];for(i=0;in&&(a[r-1].end=e[i].end):a.push(e[i])}else a.push(e[i])}else a=e;for(var E,_=0,s=t,T=t,S=0;S=l&&to.startCC||e&&e.cc>>8^255&A^99,e[u]=A,t[A]=u;var c=l[u],O=l[c],R=l[O],N=257*l[A]^16843008*A;a[u]=N<<24|N>>>8,i[u]=N<<16|N>>>16,r[u]=N<<8|N>>>24,n[u]=N,N=16843009*R^65537*O^257*c^16843008*u,_[A]=N<<24|N>>>8,s[A]=N<<16|N>>>16,T[A]=N<<8|N>>>24,S[A]=N,u?(u=c^l[l[l[R^c]]],I^=l[l[I]]):u=I=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),o=!0,a=0;an.end){var T=r>s;(r<_||T)&&(T&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}o&&(this.fragmentTracker.removeFragmentsInRange(r,1/0,this.playlistType,!0),this.lastCurrentTime=r),this.loadedmetadata||n.len||(this.nextLoadPosition=this.startPosition=r),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onManifestLoaded=function(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]},o.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=da.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,e.prototype.onHandlerDestroyed.call(this)},o.loadFragment=function(e,t,o){this._loadFragForPlayback(e,t,o)},o._loadFragForPlayback=function(e,t,o){var a=this,i=function(t){if(a.fragContextChanged(e))return a.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),void a.fragmentTracker.removeFragment(e);e.stats.chunkCount++,a._handleFragmentLoadProgress(t)};this._doFragLoad(e,t,o,i).then((function(t){if(t){var o=a.state;a.fragContextChanged(e)?(o===da.FRAG_LOADING||!a.fragCurrent&&o===da.PARSING)&&(a.fragmentTracker.removeFragment(e),a.state=da.IDLE):("payload"in t&&(a.log("Loaded fragment "+e.sn+" of level "+e.level),a.hls.trigger(C.FRAG_LOADED,t)),a._handleFragmentLoadComplete(t))}})).catch((function(t){a.state!==da.STOPPED&&a.state!==da.ERROR&&(a.warn(t),a.resetFragmentLoading(e))}))},o.clearTrackerIfNeeded=function(e){var t,o=this.fragmentTracker;if(o.getState(e)===ko.APPENDING){var a=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,a),r=Math.max(e.duration,i?i.len:this.config.maxBufferLength);this.reduceMaxBufferLength(r)&&o.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?o.removeAllFragments():o.hasParts(e.type)&&(o.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),o.getState(e)===ko.PARTIAL&&o.removeFragment(e))},o.checkLiveUpdate=function(e){if(e.updated&&!e.live){var 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)},o.flushMainBuffer=function(e,t,o){if(void 0===o&&(o=null),e-t){var a={startOffset:e,endOffset:t,type:o};this.hls.trigger(C.BUFFER_FLUSHING,a)}},o._loadInitSegment=function(e,t){var o=this;this._doFragLoad(e,t).then((function(t){if(!t||o.fragContextChanged(e)||!o.levels)throw new Error("init load aborted");return t})).then((function(t){var a=o.hls,i=t.payload,r=e.decryptdata;if(i&&i.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){var n=self.performance.now();return o.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).catch((function(t){throw a.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((function(o){var i=self.performance.now();return a.trigger(C.FRAG_DECRYPTED,{frag:e,payload:o,stats:{tstart:n,tdecrypt:i}}),t.payload=o,t}))}return t})).then((function(a){var i=o.fragCurrent,r=o.hls;if(!o.levels)throw new Error("init load aborted, missing levels");var n=e.stats;o.state=da.IDLE,t.fragmentError=0,e.data=new Uint8Array(a.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),a.frag===i&&r.trigger(C.FRAG_BUFFERED,{stats:n,frag:i,part:null,id:e.type}),o.tick()})).catch((function(t){o.state!==da.STOPPED&&o.state!==da.ERROR&&(o.warn(t),o.resetFragmentLoading(e))}))},o.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},o.fragBufferedComplete=function(e,t){var o,a,i,r,n=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+(this.playlistType===Mt.MAIN?"level":"track")+" "+e.level+" (frag:["+(null!=(o=e.startPTS)?o:NaN).toFixed(3)+"-"+(null!=(a=e.endPTS)?a:NaN).toFixed(3)+"] > buffer:"+(n?Ia.toString($o.getBuffered(n)):"(detached)")+")"),this.state=da.IDLE,n&&(!this.loadedmetadata&&e.type==Mt.MAIN&&n.buffered.length&&(null==(i=this.fragCurrent)?void 0:i.sn)===(null==(r=this.fragPrevious)?void 0:r.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},o.seekToStartPos=function(){},o._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var o=e.frag,a=e.part,i=e.partsLoaded,r=!i||0===i.length||i.some((function(e){return!e})),n=new qo(o.level,o.sn,o.stats.chunkCount+1,0,a?a.index:-1,!r);t.flush(n)}},o._handleFragmentLoadProgress=function(e){},o._doFragLoad=function(e,t,o,a){var i,r=this;void 0===o&&(o=null);var n=null==t?void 0:t.details;if(!this.levels||!n)throw new Error("frag load aborted, missing level"+(n?"":" detail")+"s");var E=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments):(this.log("Loading key for "+e.sn+" of ["+n.startSN+"-"+n.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=da.KEY_LOADING,this.fragCurrent=e,E=this.keyLoader.load(e).then((function(e){if(!r.fragContextChanged(e.frag))return r.hls.trigger(C.KEY_LOADED,e),r.state===da.KEY_LOADING&&(r.state=da.IDLE),e})),this.hls.trigger(C.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(E=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),o=Math.max(e.start,o||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){var _=n.partList;if(_&&a){o>e.end&&n.fragmentHint&&(e=n.fragmentHint);var s=this.getNextPart(_,e,o);if(s>-1){var T,S=_[s];return this.log("Loading part sn: "+e.sn+" p: "+S.index+" cc: "+e.cc+" of playlist ["+n.startSN+"-"+n.endSN+"] parts [0-"+s+"-"+(_.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(o.toFixed(3))),this.nextLoadPosition=S.start+S.duration,this.state=da.FRAG_LOADING,T=E?E.then((function(o){return!o||r.fragContextChanged(o.frag)?null:r.doFragPartsLoad(e,S,t,a)})).catch((function(e){return r.handleFragLoadError(e)})):this.doFragPartsLoad(e,S,t,a).catch((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(C.FRAG_LOADING,{frag:e,part:S,targetBufferTime:o}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):T}if(!e.url||this.loadedEndOfParts(_,o))return Promise.resolve(null)}}this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(n?"of ["+n.startSN+"-"+n.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(o.toFixed(3))),h(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=da.FRAG_LOADING;var l,u=this.config.progressive;return l=u&&E?E.then((function(t){return!t||r.fragContextChanged(null==t?void 0:t.frag)?null:r.fragmentLoader.load(e,a)})).catch((function(e){return r.handleFragLoadError(e)})):Promise.all([this.fragmentLoader.load(e,u?a:void 0),E]).then((function(e){var t=e[0];return!u&&t&&a&&a(t),t})).catch((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(C.FRAG_LOADING,{frag:e,targetBufferTime:o}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l},o.doFragPartsLoad=function(e,t,o,a){var i=this;return new Promise((function(r,n){var E,_=[],s=null==(E=o.details)?void 0:E.partList;!(function t(E){i.fragmentLoader.loadPart(e,E,a).then((function(a){_[E.index]=a;var n=a.part;i.hls.trigger(C.FRAG_LOADED,a);var T=uo(o,e.sn,E.index+1)||Io(s,e.sn,E.index+1);if(!T)return r({frag:e,part:n,partsLoaded:_});t(T)})).catch(n)})(t)}))},o.handleFragLoadError=function(e){if("data"in e){var t=e.data;e.data&&t.details===B.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(C.ERROR,t)}else this.hls.trigger(C.ERROR,{type:g.OTHER_ERROR,details:B.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null},o._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===da.PARSING){var o=t.frag,a=t.part,i=t.level,r=self.performance.now();o.stats.parsing.end=r,a&&(a.stats.parsing.end=r),this.updateLevelTiming(o,a,i,e.partial)}else this.fragCurrent||this.state===da.STOPPED||this.state===da.ERROR||(this.state=da.IDLE)},o.getCurrentContext=function(e){var t=this.levels,o=this.fragCurrent,a=e.level,i=e.sn,r=e.part;if(null==t||!t[a])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+a+". The current chunk will not be buffered."),null;var n=t[a],E=r>-1?uo(n,i,r):null,_=E?E.fragment:lo(n,i,o);return _?(o&&o!==_&&(_.stats=o.stats),{frag:_,part:E,level:n}):null},o.bufferFragmentData=function(e,t,o,a,i){var r;if(e&&this.state===da.PARSING){var n=e.data1,E=e.data2,_=n;if(n&&E&&(_=Qe(n,E)),null!=(r=_)&&r.length){var s={type:e.type,frag:t,part:o,chunkMeta:a,parent:t.type,data:_};if(this.hls.trigger(C.BUFFER_APPENDING,s),e.dropped&&e.independent&&!o){if(i)return;this.flushBufferGap(t)}}}},o.flushBufferGap=function(e){var t=this.media;if(t)if($o.isBuffered(t,t.currentTime)){var o=t.currentTime,a=$o.bufferInfo(t,o,0),i=e.duration,r=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),n=Math.max(Math.min(e.start-r,a.end-r),o+r);e.start-n>r&&this.flushMainBuffer(n,e.start)}else this.flushMainBuffer(0,e.start)},o.getFwdBufferInfo=function(e,t){var o=this.getLoadPosition();return h(o)?this.getFwdBufferInfoAtPos(e,o,t):null},o.getFwdBufferInfoAtPos=function(e,t,o){var a=this.config.maxBufferHole,i=$o.bufferInfo(e,t,a);if(0===i.len&&void 0!==i.nextStart){var r=this.fragmentTracker.getBufferedFrag(t,o);if(r&&i.nextStart=o&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},o.getAppendedFrag=function(e,t){var o=this.fragmentTracker.getAppendedFrag(e,Mt.MAIN);return o&&"fragment"in o?o.fragment:o},o.getNextFragment=function(e,t){var o=t.fragments,a=o.length;if(!a)return null;var i,r=this.config,n=o[0].start;if(t.live){var E=r.initialLiveManifestSize;if(at},o.getNextFragmentLoopLoading=function(e,t,o,a,i){var r=e.gap,n=this.getNextFragment(this.nextLoadPosition,t);if(null===n)return n;if(e=n,r&&e&&!e.gap&&o.nextStart){var E=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,o.nextStart,a);if(null!==E&&o.len+E.len>=i)return this.log('buffer full after gaps in "'+a+'" playlist starting at sn: '+e.sn),null}return e},o.mapToInitFragWhenRequired=function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment},o.getNextPart=function(e,t,o){for(var a=-1,i=!1,r=!0,n=0,E=e.length;n-1&&o<_.start)break;var s=_.loaded;s?a=-1:(i||_.independent||r)&&_.fragment===t&&(a=n),i=s}return a},o.loadedEndOfParts=function(e,t){var o=e[e.length-1];return o&&t>o.start&&o.loaded},o.getInitialLiveFragment=function(e,t){var o=this.fragPrevious,a=null;if(o){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+o.programDateTime),a=Lo(t,o.endProgramDateTime,this.config.maxFragLookUpTolerance)),!a){var i=o.sn+1;if(i>=e.startSN&&i<=e.endSN){var r=t[i-e.startSN];o.cc===r.cc&&(a=r,this.log("Live playlist, switching playlist, load frag with next SN: "+a.sn))}a||(a=Co(t,o.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+a.sn)}}else{var n=this.hls.liveSyncPosition;null!==n&&(a=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return a},o.getFragmentAtPosition=function(e,t,o){var a,i=this.config,r=this.fragPrevious,n=o.fragments,E=o.endSN,_=o.fragmentHint,s=i.maxFragLookUpTolerance,T=o.partList,S=!!(i.lowLatencyMode&&null!=T&&T.length&&_);if(S&&_&&!this.bitrateTest&&(n=n.concat(_),E=_.sn),a=et-s?0:s):n[n.length-1]){var l=a.sn-o.startSN,u=this.fragmentTracker.getState(a);if((u===ko.OK||u===ko.PARTIAL&&a.gap)&&(r=a),r&&a.sn===r.sn&&(!S||T[0].fragment.sn>a.sn)&&r&&a.level===r.level){var I=n[l+1];a=a.sn=r-t.maxFragLookUpTolerance&&i<=n;if(null!==a&&o.duration>a&&(i"+e.startSN+" prev-sn: "+(i?i.sn:"na")+" fragments: "+n),T}return E},o.waitForCdnTuneIn=function(e){var t=3;return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*t)},o.setStartPosition=function(e,t){var o=this.startPosition;if(o "+(null==(i=this.fragCurrent)?void 0:i.url))}else{var r=t.details===B.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(a,!0);var n=t.errorAction,E=n||{},_=E.action,s=E.retryCount,T=void 0===s?0:s,S=E.retryConfig;if(n&&_===Bo.RetryRequest&&S){var l;this.resetStartWhenNotLoaded(null!=(l=this.levelLastLoaded)?l:a.level);var u=Oo(S,T);this.warn("Fragment "+a.sn+" of "+e+" "+a.level+" errored with "+t.details+", retrying loading "+(T+1)+"/"+S.maxNumRetry+" in "+u+"ms"),n.resolved=!0,this.retryDate=self.performance.now()+u,this.state=da.FRAG_LOADING_WAITING_RETRY}else S&&n?(this.resetFragmentErrors(e),T.5;a&&this.reduceMaxBufferLength(o.len);var i=!a;return i&&this.warn("Buffer full error while media.currentTime is not buffered, flush "+t+" buffer"),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),i}return!1},o.resetFragmentErrors=function(e){e===Mt.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==da.STOPPED&&(this.state=da.IDLE)},o.afterBufferFlushed=function(e,t,o){if(e){var a=$o.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,a,o),this.state===da.ENDED&&this.resetLoadingState()}},o.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=da.IDLE},o.resetStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},o.resetWhenMissingContext=function(e){var t;this.warn("The loading context changed while buffering fragment "+e.sn+" of level "+e.level+". This chunk will not be buffered."),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()},o.removeUnbufferedFrags=function(e){void 0===e&&(e=0),this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)},o.updateLevelTiming=function(e,t,o,a){var i,r=this,n=o.details;if(n){if(Object.keys(e.elementaryStreams).reduce((function(t,i){var E=e.elementaryStreams[i];if(E){var _=E.endPTS-E.startPTS;if(_<=0)return r.warn("Could not parse fragment "+e.sn+" "+i+" duration reliably ("+_+")"),t||!1;var s=a?0:io(n,e,E.startPTS,E.endPTS,E.startDTS,E.endDTS);return r.hls.trigger(C.LEVEL_PTS_UPDATED,{details:n,level:o,drift:s,type:i,frag:e,start:E.startPTS,end:E.endPTS}),!0}return t}),!1))o.fragmentError=0;else if(null===(null==(i=this.transmuxer)?void 0:i.error)){var E=new Error("Found no media in fragment "+e.sn+" of level "+e.level+" resetting transmuxer to fallback to playlist timing");if(0===o.fragmentError&&(o.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(E.message),this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_PARSING_ERROR,fatal:!1,error:E,frag:e,reason:"Found no media in msn "+e.sn+' of level "'+o.url+'"'}),!this.hls)return;this.resetTransmuxer()}this.state=da.PARSED,this.hls.trigger(C.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},o.recoverWorkerError=function(e){var t,o,a;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(o=this.levelLastLoaded)?o:null==(a=this.fragCurrent)?void 0:a.level)?t:0),this.resetLoadingState())},r(t,[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}]),t})(Qo);function ca(){return self.SourceBuffer||self.WebKitSourceBuffer}function Oa(){var e=ut();if(!e)return!1;var t=ca(),o=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!o&&!!a}function Ra(){var e,t=ca();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}function Na(e,t){return void 0===e&&(e=""),void 0===t&&(t=9e4),{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}var ma=(function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,o,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS=e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,o){},t.demux=function(e,t){this.cachedData&&(e=Qe(this.cachedData,e),this.cachedData=null);var o,a=de(e,0),i=a?a.length:0,r=this._audioTrack,n=this._id3Track,E=a?Oe(a):void 0,_=e.length;for((null===this.basePTS||0===this.frameIndex&&h(E))&&(this.basePTS=pa(E,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),a&&a.length>0&&n.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:Yt.audioId3,duration:Number.POSITIVE_INFINITY});i<_;){if(this.canParse(e,i)){var s=this.appendFrame(r,e,i);s?(this.frameIndex++,this.lastPTS=s.sample.pts,o=i+=s.length):i=_}else ce(e,i)?(a=de(e,i),n.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:Yt.audioId3,duration:Number.POSITIVE_INFINITY}),o=i+=a.length):i++;if(i===_&&o!==_){var T=Se(e,o);this.cachedData?this.cachedData=Qe(this.cachedData,T):this.cachedData=T}}return{audioTrack:r,videoTrack:Na(),id3Track:n,textTrack:Na()}},t.demuxSampleAes=function(e,t,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Na(),id3Track:this._id3Track,textTrack:Na()}},t.destroy=function(){},e})(),pa=function(e,t,o){return h(e)?90*e:9e4*t+(o?9e4*o.baseTime/o.timescale:0)};function La(e,t,o,a){var i,r,n,E,_=navigator.userAgent.toLowerCase(),s=a,T=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=1+((192&t[o+2])>>>6);var S=(60&t[o+2])>>>2;if(!(S>T.length-1))return n=(1&t[o+2])<<2,n|=(192&t[o+3])>>>6,U.log("manifest codec:"+a+", ADTS type:"+i+", samplingIndex:"+S),/firefox/i.test(_)?S>=6?(i=5,E=new Array(4),r=S-3):(i=2,E=new Array(2),r=S):-1!==_.indexOf("android")?(i=2,E=new Array(2),r=S):(i=5,E=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&S>=6?r=S-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(S>=6&&1===n||/vivaldi/i.test(_))||!a&&1===n)&&(i=2,E=new Array(2)),r=S)),E[0]=i<<3,E[0]|=(14&S)>>1,E[1]|=(1&S)<<7,E[1]|=n<<3,5===i&&(E[1]|=(14&r)>>1,E[2]=(1&r)<<7,E[2]|=8,E[3]=0),{config:E,samplerate:T[S],channelCount:n,codec:"mp4a.40."+i,manifestCodec:s};e.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S})}function ha(e,t){return 255===e[t]&&240==(246&e[t+1])}function Da(e,t){return 1&e[t+1]?7:9}function fa(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Ca(e,t){return t+5=e.length)return!1;var a=fa(e,t);if(a<=o)return!1;var i=t+a;return i===e.length||ga(e,i)}return!1}function va(e,t,o,a,i){if(!e.samplerate){var r=La(t,o,a,i);if(!r)return;e.config=r.config,e.samplerate=r.samplerate,e.channelCount=r.channelCount,e.codec=r.codec,e.manifestCodec=r.manifestCodec,U.log("parsed codec:"+e.codec+", rate:"+r.samplerate+", channels:"+r.channelCount)}}function ya(e){return 9216e4/e}function Ma(e,t){var o=Da(e,t);if(t+o<=e.length){var a=fa(e,t)-o;if(a>0)return{headerLength:o,frameLength:a}}}function Wa(e,t,o,a,i){var r,n=a+i*ya(e.samplerate),E=Ma(t,o);if(E){var _=E.frameLength,s=E.headerLength,T=s+_,S=Math.max(0,o+T-t.length);S?(r=new Uint8Array(T-s)).set(t.subarray(o+s,t.length),0):r=t.subarray(o+s,o+T);var l={unit:r,pts:n};return S||e.samples.push(l),{sample:l,length:T,missing:S}}var u=t.length-o;return(r=new Uint8Array(u)).set(t.subarray(o,t.length),0),{sample:{unit:r,pts:n},length:u,missing:-1}}var ba=(function(e){function t(t,o){var a;return(a=e.call(this)||this).observer=void 0,a.config=void 0,a.observer=t,a.config=o,a}_(t,e);var o=t.prototype;return o.resetInitSegment=function(t,o,a,i){e.prototype.resetInitSegment.call(this,t,o,a,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(de(e,0)||[]).length,o=e.length;t16384?e.subarray(0,16384):e,["moof"]).length>0},t.demux=function(e,t){this.timeOffset=t;var o=e,a=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(o=Qe(this.remainderData,e));var r=je(o);this.remainderData=r.remainder,a.samples=r.valid||new Uint8Array}else a.samples=o;var n=this.extractID3Track(a,t);return i.samples=Xe(t,a),{videoTrack:a,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}},t.flush=function(){var e=this.timeOffset,t=this.videoTrack,o=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var a=this.extractID3Track(t,this.timeOffset);return o.samples=Xe(e,t),{videoTrack:t,audioTrack:Na(),id3Track:a,textTrack:Na()}},t.extractID3Track=function(e,t){var o=this.id3Track;if(e.samples.length){var a=ke(e.samples,["emsg"]);a&&a.forEach((function(e){var a=et(e);if(Ua.test(a.schemeIdUri)){var i=h(a.presentationTime)?a.presentationTime/a.timeScale:t+a.presentationTimeDelta/a.timeScale,r=4294967295===a.eventDuration?Number.POSITIVE_INFINITY:a.eventDuration/a.timeScale;r<=.001&&(r=Number.POSITIVE_INFINITY);var n=a.payload;o.samples.push({data:n,len:n.byteLength,dts:i,pts:i,type:Yt.emsg,duration:r})}}))}return o},t.demuxSampleAes=function(e,t,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e})(),ka=null,Fa=[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],wa=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Va=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ha=[0,1,1,4];function Ya(e,t,o,a,i){if(!(o+24>t.length)){var r=za(t,o);if(r&&o+r.frameLength<=t.length){var n=a+i*(9e4*r.samplesPerFrame/r.sampleRate),E={unit:t.subarray(o,o+r.frameLength),pts:n,dts:n};return e.config=[],e.channelCount=r.channelCount,e.samplerate=r.sampleRate,e.samples.push(E),{sample:E,length:r.frameLength,missing:0}}}}function za(e,t){var o=e[t+1]>>3&3,a=e[t+1]>>1&3,i=e[t+2]>>4&15,r=e[t+2]>>2&3;if(1!==o&&0!==i&&15!==i&&3!==r){var n=e[t+2]>>1&1,E=e[t+3]>>6,_=1e3*Fa[14*(3===o?3-a:3===a?3:4)+i-1],s=wa[3*(3===o?0:2===o?1:2)+r],T=3===E?1:2,S=Va[o][a],l=Ha[a],u=8*S*l,I=Math.floor(S*_/s+n)*l;if(null===ka){var d=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ka=d?parseInt(d[1]):0}return!!ka&&ka<=87&&2===a&&_>=224e3&&0===E&&(e[t+3]=128|e[t+3]),{sampleRate:s,channelCount:T,frameLength:I,samplesPerFrame:u}}}function Ka(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function xa(e,t){return t+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),o=this.word>>>32-t;if(e>32&&U.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(t=e-t)>0&&this.bitsAvailable?o<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,o=8,a=0;a=e.length)return void o();if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,o),this.decrypter.isSync())))return}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,o=new Int8Array(t),a=0,i=32;i=e.length)return void a();for(var i=e[t].units;!(o>=i.length);o++){var r=i[o];if(!(r.data.length<=48||1!==r.type&&5!==r.type||(this.decryptAvcSample(e,t,o,a,r),this.decrypter.isSync())))return}}},e})(),qa=188,Ja=(function(){function e(e,t,o){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._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=o}e.probe=function(t){var o=e.syncOffset(t);return o>0&&U.warn("MPEG2-TS detected but first sync word found @ offset "+o),-1!==o},e.syncOffset=function(e){for(var t=e.length,o=Math.min(5*qa,e.length-qa)+1,a=0;a1&&(0===r&&n>2||E+qa>o))return r}a++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:ye[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,o,a,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=o,this.videoCodec=a,this._duration=i},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,o=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),o&&(o.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},t.demux=function(t,o,a,i){var r;void 0===a&&(a=!1),void 0===i&&(i=!1),a||(this.sampleAes=null);var n=this._avcTrack,E=this._audioTrack,_=this._id3Track,s=this._txtTrack,T=n.pid,S=n.pesData,l=E.pid,u=_.pid,I=E.pesData,d=_.pesData,A=null,c=this.pmtParsed,O=this._pmtId,R=t.length;if(this.remainderData&&(R=(t=Qe(this.remainderData,t)).length,this.remainderData=null),R>4>1){if((D=p+5+t[p+4])===p+qa)continue}else D=p+4;switch(h){case T:L&&(S&&(r=ai(S))&&this.parseAVCPES(n,s,r,!1),S={data:[],size:0}),S&&(S.data.push(t.subarray(D,p+qa)),S.size+=p+qa-D);break;case l:if(L){if(I&&(r=ai(I)))switch(E.segmentCodec){case"aac":this.parseAACPES(E,r);break;case"mp3":this.parseMPEGPES(E,r)}I={data:[],size:0}}I&&(I.data.push(t.subarray(D,p+qa)),I.size+=p+qa-D);break;case u:L&&(d&&(r=ai(d))&&this.parseID3PES(_,r),d={data:[],size:0}),d&&(d.data.push(t.subarray(D,p+qa)),d.size+=p+qa-D);break;case 0:L&&(D+=t[D]+1),O=this._pmtId=ti(t,D);break;case O:L&&(D+=t[D]+1);var f=oi(t,D,this.typeSupported,a);(T=f.avc)>0&&(n.pid=T),(l=f.audio)>0&&(E.pid=l,E.segmentCodec=f.segmentCodec),(u=f.id3)>0&&(_.pid=u),null===A||c||(U.warn("MPEG-TS PMT found at "+p+" after unknown PID '"+A+"'. Backtracking to sync byte @"+N+" to parse all TS packets."),A=null,p=N-188),c=this.pmtParsed=!0;break;case 17:case 8191:break;default:A=h}}else m++;if(m>0){var P=new Error("Found "+m+" TS packet/s that do not start with 0x47");this.observer.emit(C.ERROR,C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_PARSING_ERROR,fatal:!1,error:P,reason:P.message})}n.pesData=S,E.pesData=I,_.pesData=d;var v={audioTrack:E,videoTrack:n,id3Track:_,textTrack:s};return i&&this.extractRemainingSamples(v),v},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,o=e.audioTrack,a=e.videoTrack,i=e.id3Track,r=e.textTrack,n=a.pesData,E=o.pesData,_=i.pesData;if(n&&(t=ai(n))?(this.parseAVCPES(a,r,t,!0),a.pesData=null):a.pesData=n,E&&(t=ai(E))){switch(o.segmentCodec){case"aac":this.parseAACPES(o,t);break;case"mp3":this.parseMPEGPES(o,t)}o.pesData=null}else null!=E&&E.size&&U.log("last AAC PES packet truncated,might overlap between fragments"),o.pesData=E;_&&(t=ai(_))?(this.parseID3PES(i,t),i.pesData=null):i.pesData=_},t.demuxSampleAes=function(e,t,o){var a=this.demux(e,o,!0,!this.config.progressive),i=this.sampleAes=new $a(this.observer,this.config,t);return this.decrypt(a,i)},t.decrypt=function(e,t){return new Promise((function(o){var a=e.audioTrack,i=e.videoTrack;a.samples&&"aac"===a.segmentCodec?t.decryptAacSamples(a.samples,0,(function(){i.samples?t.decryptAvcSamples(i.samples,0,0,(function(){o(e)})):o(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(function(){o(e)}))}))},t.destroy=function(){this._duration=0},t.parseAVCPES=function(e,t,o,a){var i,r=this,n=this.parseAVCNALu(e,o.data),E=this.avcSample,_=!1;o.data=null,E&&n.length&&!e.audFound&&(ii(E,e),E=this.avcSample=Za(!1,o.pts,o.dts,"")),n.forEach((function(a){var n;switch(a.type){case 1:var s=!1;i=!0;var T,S=a.data;if(_&&S.length>4){var l=new Xa(S).readSliceType();2!==l&&4!==l&&7!==l&&9!==l||(s=!0)}s&&null!=(T=E)&&T.frame&&!E.key&&(ii(E,e),E=r.avcSample=null),E||(E=r.avcSample=Za(!0,o.pts,o.dts,"")),E.frame=!0,E.key=s;break;case 5:i=!0,null!=(n=E)&&n.frame&&!E.key&&(ii(E,e),E=r.avcSample=null),E||(E=r.avcSample=Za(!0,o.pts,o.dts,"")),E.key=!0,E.frame=!0;break;case 6:i=!0,Je(a.data,1,o.pts,t.samples);break;case 7:if(i=!0,_=!0,!e.sps){var u=a.data,I=new Xa(u).readSPS();e.width=I.width,e.height=I.height,e.pixelRatio=I.pixelRatio,e.sps=[u],e.duration=r._duration;for(var d=u.subarray(1,4),A="avc1.",c=0;c<3;c++){var O=d[c].toString(16);O.length<2&&(O="0"+O),A+=O}e.codec=A}break;case 8:i=!0,e.pps||(e.pps=[a.data]);break;case 9:i=!1,e.audFound=!0,E&&ii(E,e),E=r.avcSample=Za(!1,o.pts,o.dts,"");break;case 12:i=!0;break;default:i=!1,E&&(E.debug+="unknown NAL "+a.type+" ")}E&&i&&E.units.push(a)})),a&&E&&(ii(E,e),this.avcSample=null)},t.getLastNalUnit=function(e){var t,o,a=this.avcSample;if(a&&0!==a.units.length||(a=e[e.length-1]),null!=(t=a)&&t.units){var i=a.units;o=i[i.length-1]}return o},t.parseAVCNALu=function(e,t){var o,a,i=t.byteLength,r=e.naluState||0,n=r,E=[],_=0,s=-1,T=0;for(-1===r&&(s=0,T=31&t[0],r=0,_=1);_=0){var S={data:t.subarray(s,_-r-1),type:T};E.push(S)}else{var l=this.getLastNalUnit(e.samples);if(l&&(n&&_<=4-n&&l.state&&(l.data=l.data.subarray(0,l.data.byteLength-n)),(a=_-r-1)>0)){var u=new Uint8Array(l.data.byteLength+a);u.set(l.data,0),u.set(t.subarray(0,a),l.data.byteLength),l.data=u,l.state=0}}_=0&&r>=0){var I={data:t.subarray(s,i),type:T,state:r};E.push(I)}if(0===E.length){var d=this.getLastNalUnit(e.samples);if(d){var A=new Uint8Array(d.data.byteLength+t.byteLength);A.set(d.data,0),A.set(t,d.data.byteLength),d.data=A}}return e.naluState=r,E},t.parseAACPES=function(e,t){var o,a,i,r=0,n=this.aacOverFlow,E=t.data;if(n){this.aacOverFlow=null;var _=n.missing,s=n.sample.unit.byteLength;if(-1===_){var T=new Uint8Array(s+E.byteLength);T.set(n.sample.unit,0),T.set(E,s),E=T}else{var S=s-_;n.sample.unit.set(E.subarray(0,_),S),e.samples.push(n.sample),r=n.missing}}for(o=r,a=E.length;o1;){var _=new Uint8Array(E[0].length+E[1].length);_.set(E[0]),_.set(E[1],E[0].length),E[0]=_,E.splice(1,1)}if(1===((t=E[0])[0]<<16)+(t[1]<<8)+t[2]){if((o=(t[4]<<8)+t[5])&&o>e.size-6)return null;var s=t[7];192&s&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&s?i-(r=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(U.warn(Math.round((i-r)/9e4)+"s delta between PTS and DTS, align them"),i=r):r=i);var T=(a=t[8])+9;if(e.size<=T)return null;e.size-=T;for(var S=new Uint8Array(e.size),l=0,u=E.length;lI){T-=I;continue}t=t.subarray(T),I-=T,T=0}S.set(t,n),n+=I}return o&&(o-=a+3),{data:S,pts:i,dts:r,len:o}}return null}function ii(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var o=t.samples,a=o.length;if(!a)return void t.dropped++;var i=o[a-1];e.pts=i.pts,e.dts=i.dts}t.samples.push(e)}e.debug.length&&U.log(e.pts+"/"+e.dts+":"+e.debug)}var ri=(function(e){function t(){return e.apply(this,arguments)||this}_(t,e);var o=t.prototype;return o.resetInitSegment=function(t,o,a,i){e.prototype.resetInitSegment.call(this,t,o,a,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(de(e,0)||[]).length,o=e.length;t1?o-1:0),i=1;i>24&255,E[1]=t>>16&255,E[2]=t>>8&255,E[3]=255&t,E.set(e,4),r=0,t=8;r>24&255,t>>16&255,t>>8&255,255&t,a>>24,a>>16&255,a>>8&255,255&a,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,o,a){return e.box(e.types.moof,e.mfhd(t),e.traf(a,o))},e.moov=function(t){for(var o=t.length,a=[];o--;)a[o]=e.trak(t[o]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(a).concat(e.mvex(t)))},e.mvex=function(t){for(var o=t.length,a=[];o--;)a[o]=e.trex(t[o]);return e.box.apply(null,[e.types.mvex].concat(a))},e.mvhd=function(t,o){o*=t;var a=Math.floor(o/(Ei+1)),i=Math.floor(o%(Ei+1)),r=new Uint8Array([1,0,0,0,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,255&t,a>>24,a>>16&255,a>>8&255,255&a,i>>24,i>>16&255,i>>8&255,255&i,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 e.box(e.types.mvhd,r)},e.sdtp=function(t){var o,a,i=t.samples||[],r=new Uint8Array(4+i.length);for(o=0;o>>8&255),r.push(255&i),r=r.concat(Array.prototype.slice.call(a));for(o=0;o>>8&255),n.push(255&i),n=n.concat(Array.prototype.slice.call(a));var E=e.box(e.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|t.sps.length].concat(r).concat([t.pps.length]).concat(n))),_=t.width,s=t.height,T=t.pixelRatio[0],S=t.pixelRatio[1];return e.box(e.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,_>>8&255,255&_,s>>8&255,255&s,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]),E,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([T>>24,T>>16&255,T>>8&255,255&T,S>>24,S>>16&255,S>>8&255,255&S])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var o=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,o>>8&255,255&o,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var o=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,o>>8&255,255&o,0,0]))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var o=t.id,a=t.duration*t.timescale,i=t.width,r=t.height,n=Math.floor(a/(Ei+1)),E=Math.floor(a%(Ei+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,o>>24&255,o>>16&255,o>>8&255,255&o,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,E>>24,E>>16&255,E>>8&255,255&E,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,i>>8&255,255&i,0,0,r>>8&255,255&r,0,0]))},e.traf=function(t,o){var a=e.sdtp(t),i=t.id,r=Math.floor(o/(Ei+1)),n=Math.floor(o%(Ei+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n])),e.trun(t,a.length+16+20+8+16+8+8),a)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var o=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,o){var a,i,r,n,E,_,s=t.samples||[],T=s.length,S=12+16*T,l=new Uint8Array(S);for(o+=8+S,l.set(["video"===t.type?1:0,0,15,1,T>>>24&255,T>>>16&255,T>>>8&255,255&T,o>>>24&255,o>>>16&255,o>>>8&255,255&o],0),a=0;a>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,E.isLeading<<2|E.dependsOn,E.isDependedOn<<6|E.hasRedundancy<<4|E.paddingValue<<1|E.isNonSync,61440&E.degradPrio,15&E.degradPrio,_>>>24&255,_>>>16&255,_>>>8&255,255&_],12+16*a);return e.box(e.types.trun,l)},e.initSegment=function(t){e.types||e.init();var o=e.moov(t),a=new Uint8Array(e.FTYP.byteLength+o.byteLength);return a.set(e.FTYP),a.set(o,e.FTYP.byteLength),a},e})();_i.types=void 0,_i.HDLR_TYPES=void 0,_i.STTS=void 0,_i.STSC=void 0,_i.STCO=void 0,_i.STSZ=void 0,_i.VMHD=void 0,_i.SMHD=void 0,_i.STSD=void 0,_i.FTYP=void 0,_i.DINF=void 0;var si=9e4;function Ti(e,t,o,a){void 0===o&&(o=1),void 0===a&&(a=!1);var i=e*t*o;return a?Math.round(i):i}function Si(e,t,o,a){return void 0===o&&(o=1),void 0===a&&(a=!1),Ti(e,t,1/o,a)}function li(e,t){return void 0===t&&(t=!1),Ti(e,1e3,1/si,t)}function ui(e,t){return void 0===t&&(t=1),Ti(e,si,1/t)}var Ii=1e4,di=1024,Ai=1152,ci=null,Oi=null,Ri=(function(){function e(e,t,o,a){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=o,this.ISGenerated=!1,null===ci){var i=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ci=i?parseInt(i[1]):0}if(null===Oi){var r=navigator.userAgent.match(/Safari\/(\d+)/i);Oi=r?parseInt(r[1]):0}}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){U.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){U.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){U.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,o=e.reduce((function(e,o){var a=o.pts-e;return a<-4294967296?(t=!0,Ni(e,o.pts)):a>0?e:o.pts}),e[0].pts);return t&&U.debug("PTS rollover detected"),o},t.remux=function(e,t,o,a,i,r,n,E){var _,s,T,S,l,u,I=i,d=i,A=e.pid>-1,c=t.pid>-1,O=t.samples.length,R=e.samples.length>0,N=n&&O>0||O>1;if((!A||R)&&(!c||N)||this.ISGenerated||n){this.ISGenerated||(T=this.generateIS(e,t,i,r));var m,p=this.isVideoContiguous,L=-1;if(N&&(L=mi(t.samples),!p&&this.config.forceKeyFrameOnDiscontinuity))if(u=!0,L>0){U.warn("[mp4-remuxer]: Dropped "+L+" out of "+O+" video samples due to a missing keyframe");var h=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(L),t.dropped+=L,m=d+=(t.samples[0].pts-h)/t.inputTimeScale}else-1===L&&(U.warn("[mp4-remuxer]: No keyframe found out of "+O+" video samples"),u=!1);if(this.ISGenerated){if(R&&N){var D=this.getVideoStartPts(t.samples),f=(Ni(e.samples[0].pts,D)-D)/t.inputTimeScale;I+=Math.max(0,f),d+=Math.max(0,-f)}if(R){if(e.samplerate||(U.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),T=this.generateIS(e,t,i,r)),s=this.remuxAudio(e,I,this.isAudioContiguous,r,c||N||E===Mt.AUDIO?d:void 0),N){var C=s?s.endPTS-s.startPTS:0;t.inputTimeScale||(U.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),T=this.generateIS(e,t,i,r)),_=this.remuxVideo(t,d,p,C)}}else N&&(_=this.remuxVideo(t,d,p,0));_&&(_.firstKeyFrame=L,_.independent=-1!==L,_.firstKeyFramePTS=m)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(o.samples.length&&(l=pi(o,i,this._initPTS,this._initDTS)),a.samples.length&&(S=Li(a,i,this._initPTS))),{audio:s,video:_,initSegment:T,independent:u,text:S,id3:l}},t.generateIS=function(e,t,o,a){var i,r,n,E=e.samples,_=t.samples,s=this.typeSupported,T={},S=this._initPTS,l=!S||a,u="audio/mp4";if(l&&(i=r=1/0),e.config&&E.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(s.mpeg?(u="audio/mpeg",e.codec=""):s.mp3&&(e.codec="mp3")),T.audio={id:"audio",container:u,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&s.mpeg?new Uint8Array(0):_i.initSegment([e]),metadata:{channelCount:e.channelCount}},l&&(n=e.inputTimeScale,S&&n===S.timescale?l=!1:i=r=E[0].pts-Math.round(n*o))),t.sps&&t.pps&&_.length&&(t.timescale=t.inputTimeScale,T.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:_i.initSegment([t]),metadata:{width:t.width,height:t.height}},l))if(n=t.inputTimeScale,S&&n===S.timescale)l=!1;else{var I=this.getVideoStartPts(_),d=Math.round(n*o);r=Math.min(r,Ni(_[0].dts,I)-d),i=Math.min(i,I-d)}if(Object.keys(T).length)return this.ISGenerated=!0,l?(this._initPTS={baseTime:i,timescale:n},this._initDTS={baseTime:r,timescale:n}):i=n=void 0,{tracks:T,initPTS:i,timescale:n}},t.remuxVideo=function(e,t,o,a){var i,r,n=e.inputTimeScale,_=e.samples,s=[],T=_.length,S=this._initPTS,l=this.nextAvcDts,u=8,I=this.videoSampleDuration,d=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,c=!1;o&&null!==l||(l=t*n-(_[0].pts-Ni(_[0].dts,_[0].pts)));for(var O=S.baseTime*n/S.timescale,R=0;R0?R-1:R].dts&&(c=!0)}c&&_.sort((function(e,t){var o=e.dts-t.dts,a=e.pts-t.pts;return o||a})),i=_[0].dts;var m=(r=_[_.length-1].dts)-i,p=m?Math.round(m/(T-1)):I||e.inputTimeScale/30;if(o){var L=i-l,h=L>p,D=L<-1;if((h||D)&&(h?U.warn("AVC: "+li(L,!0)+" ms ("+L+"dts) hole between fragments detected, filling it"):U.warn("AVC: "+li(-L,!0)+" ms ("+L+"dts) overlapping between fragments detected"),!D||l>=_[0].pts)){i=l;var f=_[0].pts-L;_[0].dts=i,_[0].pts=f,U.log("Video: First PTS/DTS adjusted: "+li(f,!0)+"/"+li(i,!0)+", delta: "+li(L,!0)+" ms")}}i=Math.max(0,i);for(var P=0,v=0,y=0;y0?Q.dts-_[j-1].dts:p;if(oe=j>0?Q.pts-_[j-1].pts:p,ae.stretchShortVideoTrack&&null!==this.nextAudioPts){var re=Math.floor(ae.maxBufferHole*n),ne=(a?d+a*n:this.nextAudioPts)-Q.pts;ne>re?((I=ne-ie)<0?I=ie:H=!0,U.log("[mp4-remuxer]: It is approximately "+ne/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=ie}else I=ie}var Ee=Math.round(Q.pts-Q.dts);Y=Math.min(Y,I),K=Math.max(K,I),z=Math.min(z,oe),x=Math.max(x,oe),s.push(new Di(Q.key,I,$,Ee))}if(s.length)if(ci){if(ci<70){var _e=s[0].flags;_e.dependsOn=2,_e.isNonSync=0}}else if(Oi&&x-z0&&(a&&Math.abs(c-A)<9e3||Math.abs(Ni(I[0].pts-O,c)-A)<20*s),I.forEach((function(e){e.pts=Ni(e.pts-O,c)})),!o||A<0){if(I=I.filter((function(e){return e.pts>=0})),!I.length)return;A=0===i?0:a&&!u?Math.max(0,c):I[0].pts}if("aac"===e.segmentCodec)for(var R=this.config.maxAudioFramesDrift,N=0,m=A;N=R*s&&D0))return;G+=d;try{M=new Uint8Array(G)}catch(e){return void this.observer.emit(C.ERROR,C.ERROR,{type:g.MUX_ERROR,details:B.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:G,reason:"fail allocating audio mdat "+G})}S||(new DataView(M.buffer).setUint32(0,G),M.set(_i.types.mdat,4))}M.set(H,d);var z=H.byteLength;d+=z,l.push(new Di(!0,_,z,0)),b=Y}var K=l.length;if(K){var x=l[l.length-1];this.nextAudioPts=A=b+n*x.duration;var j=S?new Uint8Array(0):_i.moof(e.sequenceNumber++,W/n,E({},e,{samples:l}));e.samples=[];var Q=W/r,X=A/r,$={data1:j,data2:M,startPTS:Q,endPTS:X,startDTS:Q,endDTS:X,type:"audio",hasAudio:!0,hasVideo:!1,nb:K};return this.isAudioContiguous=!0,$}},t.remuxEmptyAudio=function(e,t,o,a){var i=e.inputTimeScale,r=i/(e.samplerate?e.samplerate:i),n=this.nextAudioPts,E=this._initDTS,_=9e4*E.baseTime/E.timescale,s=(null!==n?n:a.startDTS*i)+_,T=a.endDTS*i+_,S=r*di,l=Math.ceil((T-s)/S),u=ni.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(U.warn("[mp4-remuxer]: remux empty Audio"),u){for(var I=[],d=0;d4294967296;)e+=o;return e}function mi(e){for(var t=0;t0?this.lastEndTime=O:(U.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var R=!!u.audio,N=!!u.video,m="";R&&(m+="audio"),N&&(m+="video");var p={data1:S,startPTS:c,startDTS:c,endPTS:O,endDTS:O,type:m,hasAudio:R,hasVideo:N,nb:1,dropped:0};return T.audio="audio"===p.type?p:void 0,T.video="audio"!==p.type?p:void 0,T.initSegment=l,T.id3=pi(o,i,_,_),a.samples.length&&(T.text=Li(a,i,_)),T},e})();function gi(e,t,o,a){if(null===e)return!0;var i=Math.max(a,1),r=t-e.baseTime/e.timescale;return Math.abs(r-o)>i}function Bi(e,t){var o=null==e?void 0:e.codec;return o&&o.length>4?o:"hvc1"===o||"hev1"===o?"hvc1.1.6.L120.90":"av01"===o?"av01.0.04M.08":"avc1"===o||t===z.VIDEO?"avc1.42e01e":"mp4a.40.5"}try{hi=self.performance.now.bind(self.performance)}catch(e){U.debug("Unable to use Performance API on this environment"),hi="undefined"!=typeof self&&self.Date.now}var Pi=[{demux:Ga,remux:Ci},{demux:Ja,remux:Ri},{demux:ba,remux:Ri},{demux:ri,remux:Ri}],vi=(function(){function e(e,t,o,a,i){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=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=o,this.vendor=a,this.id=i}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,o,a){var i=this,r=o.transmuxing;r.executeStart=hi();var n=new Uint8Array(e),E=this.currentTransmuxState,_=this.transmuxConfig;a&&(this.currentTransmuxState=a);var s=a||E,T=s.contiguous,S=s.discontinuity,l=s.trackSwitch,u=s.accurateTimeOffset,I=s.timeOffset,d=s.initSegmentChange,A=_.audioCodec,c=_.videoCodec,O=_.defaultInitPts,R=_.duration,N=_.initSegmentData,m=yi(n,t);if(m&&"AES-128"===m.method){var p=this.getDecrypter();if(!p.isSync())return this.decryptionPromise=p.webCryptoDecrypt(n,m.key.buffer,m.iv.buffer).then((function(e){var t=i.push(e,null,o);return i.decryptionPromise=null,t})),this.decryptionPromise;var L=p.softwareDecrypt(n,m.key.buffer,m.iv.buffer);if(o.part>-1&&(L=p.flush()),!L)return r.executeEnd=hi(),Mi(o);n=new Uint8Array(L)}var h=this.needsProbing(S,l);if(h){var D=this.configureTransmuxer(n);if(D)return U.warn("[transmuxer] "+D.message),this.observer.emit(C.ERROR,C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_PARSING_ERROR,fatal:!1,error:D,reason:D.message}),r.executeEnd=hi(),Mi(o)}(S||l||d||h)&&this.resetInitSegment(N,A,c,R,t),(S||d||h)&&this.resetInitialTimestamp(O),T||this.resetContiguity();var f=this.transmux(n,m,I,u,o),P=this.currentTransmuxState;return P.contiguous=!0,P.discontinuity=!1,P.trackSwitch=!1,r.executeEnd=hi(),f},t.flush=function(e){var t=this,o=e.transmuxing;o.executeStart=hi();var a=this.decrypter,i=this.currentTransmuxState,r=this.decryptionPromise;if(r)return r.then((function(){return t.flush(e)}));var n=[],E=i.timeOffset;if(a){var _=a.flush();_&&n.push(this.push(_,null,e))}var s=this.demuxer,T=this.remuxer;if(!s||!T)return o.executeEnd=hi(),[Mi(e)];var S=s.flush(E);return Wi(S)?S.then((function(o){return t.flushRemux(n,o,e),n})):(this.flushRemux(n,S,e),n)},t.flushRemux=function(e,t,o){var a=t.audioTrack,i=t.videoTrack,r=t.id3Track,n=t.textTrack,E=this.currentTransmuxState,_=E.accurateTimeOffset,s=E.timeOffset;U.log("[transmuxer.ts]: Flushed fragment "+o.sn+(o.part>-1?" p: "+o.part:"")+" of level "+o.level);var T=this.remuxer.remux(a,i,r,n,s,_,!0,this.id);e.push({remuxResult:T,chunkMeta:o}),o.transmuxing.executeEnd=hi()},t.resetInitialTimestamp=function(e){var t=this.demuxer,o=this.remuxer;t&&o&&(t.resetTimeStamp(e),o.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,o,a,i){var r=this.demuxer,n=this.remuxer;r&&n&&(r.resetInitSegment(e,t,o,a),n.resetInitSegment(e,t,o,i))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,o,a,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,o,a,i):this.transmuxUnencrypted(e,o,a,i)},t.transmuxUnencrypted=function(e,t,o,a){var i=this.demuxer.demux(e,t,!1,!this.config.progressive),r=i.audioTrack,n=i.videoTrack,E=i.id3Track,_=i.textTrack;return{remuxResult:this.remuxer.remux(r,n,E,_,t,o,!1,this.id),chunkMeta:a}},t.transmuxSampleAes=function(e,t,o,a,i){var r=this;return this.demuxer.demuxSampleAes(e,t,o).then((function(e){return{remuxResult:r.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,o,a,!1,r.id),chunkMeta:i}}))},t.configureTransmuxer=function(e){for(var t,o=this.config,a=this.observer,i=this.typeSupported,r=this.vendor,n=0,E=Pi.length;n0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(o=t),o}var Mi=function(e){return{remuxResult:{},chunkMeta:e}};function Wi(e){return"then"in e&&e.then instanceof Function}var bi=function(e,t,o,a,i){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=o,this.duration=a,this.defaultInitPts=i||null},Ui=function(e,t,o,a,i,r){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=o,this.trackSwitch=a,this.timeOffset=i,this.initSegmentChange=r},Gi={exports:{}};!(function(e){var t=Object.prototype.hasOwnProperty,o="~";function a(){}function i(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function r(e,t,a,r,n){if("function"!=typeof a)throw new TypeError("The listener must be a function");var E=new i(a,r||e,n),_=o?o+t:t;return e._events[_]?e._events[_].fn?e._events[_]=[e._events[_],E]:e._events[_].push(E):(e._events[_]=E,e._eventsCount++),e}function n(e,t){0==--e._eventsCount?e._events=new a:delete e._events[t]}function E(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(o=!1)),E.prototype.eventNames=function(){var e,a,i=[];if(0===this._eventsCount)return i;for(a in e=this._events)t.call(e,a)&&i.push(o?a.slice(1):a);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},E.prototype.listeners=function(e){var t=o?o+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,r=a.length,n=new Array(r);i1&&_.id===(null==A?void 0:A.stats.chunkCount),p=!O&&(1===R||0===R&&(1===N||m&&N<=0)),L=self.performance.now();(O||R||0===i.stats.parsing.start)&&(i.stats.parsing.start=L),!r||!N&&p||(r.stats.parsing.start=L);var h=!(A&&(null==(T=i.initSegment)?void 0:T.url)===(null==(S=A.initSegment)?void 0:S.url)),D=new Ui(c,p,E,O,I,h);if(!p||c||h){U.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+"\n discontinuity: "+c+"\n trackSwitch: "+O+"\n contiguous: "+p+"\n accurateTimeOffset: "+E+"\n timeOffset: "+I+"\n initSegmentChange: "+h);var f=new bi(o,a,t,n,s);this.configureTransmuxer(f)}if(this.frag=i,this.part=r,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:d,chunkMeta:_,state:D},e instanceof ArrayBuffer?[e]:[]);else if(u){var C=u.push(e,d,_,D);Wi(C)?(u.async=!0,C.then((function(e){l.handleTransmuxComplete(e)})).catch((function(e){l.transmuxerError(e,_,"transmuxer-interface push error")}))):(u.async=!1,this.handleTransmuxComplete(C))}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var o=this.transmuxer;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(o){var a=o.flush(e);Wi(a)||o.async?(Wi(a)||(a=Promise.resolve(a)),a.then((function(o){t.handleFlushResult(o,e)})).catch((function(o){t.transmuxerError(o,e,"transmuxer-interface flush error")}))):this.handleFlushResult(a,e)}},t.transmuxerError=function(e,t,o){this.hls&&(this.error=e,this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:o}))},t.handleFlushResult=function(e,t){var o=this;e.forEach((function(e){o.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,o=this.hls;switch(t.event){case"init":var a,i=null==(a=this.workerContext)?void 0:a.objectURL;i&&self.URL.revokeObjectURL(i);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":U[t.data.logType]&&U[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,o.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.transmuxer;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e})(),Xi=250,$i=2,qi=.1,Ji=.05,Zi=(function(){function e(e,t,o,a){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=o,this.hls=a}var t=e.prototype;return t.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},t.poll=function(e,t){var o=this.config,a=this.media,i=this.stalled;if(null!==a){var r=a.currentTime,n=a.seeking,E=this.seeking&&!n,_=!this.seeking&&n;if(this.seeking=n,r===e){if(_||E)this.stalled=null;else if(!(a.paused&&!n||a.ended||0===a.playbackRate)&&$o.getBuffered(a).length){var s=$o.bufferInfo(a,r,0),T=s.len>0,S=s.nextStart||0;if(T||S){if(n){var l=s.len>$i,u=!S||t&&t.start<=r||S-r>$i&&!this.fragmentTracker.getPartialFragment(r);if(l||u)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var I,d=Math.max(S,s.start||0)-r,A=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,c=(null==A||null==(I=A.details)?void 0:I.live)?2*A.details.targetduration:$i,O=this.fragmentTracker.getPartialFragment(r);if(d>0&&(d<=c||O))return void this._trySkipBufferHole(O)}var R=self.performance.now();if(null!==i){var N=R-i;if(n||!(N>=Xi)||(this._reportStall(s),this.media)){var m=$o.bufferInfo(a,r,o.maxBufferHole);this._tryFixBufferStall(m,N)}}else this.stalled=R}}}else if(this.moved=!0,null!==i){if(this.stallReported){var p=self.performance.now()-i;U.warn("playback not stuck anymore @"+r+", after "+Math.round(p)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},t._tryFixBufferStall=function(e,t){var o=this.config,a=this.fragmentTracker,i=this.media;if(null!==i){var r=i.currentTime,n=a.getPartialFragment(r);if(n&&(this._trySkipBufferHole(n)||!this.media))return;(e.len>o.maxBufferHole||e.nextStart&&e.nextStart-r1e3*o.highBufferWatchdogPeriod&&(U.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},t._reportStall=function(e){var t=this.hls,o=this.media;if(!this.stallReported&&o){this.stallReported=!0;var a=new Error("Playback stalling at @"+o.currentTime+" due to low buffer ("+JSON.stringify(e)+")");U.warn(a.message),t.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len})}},t._trySkipBufferHole=function(e){var t=this.config,o=this.hls,a=this.media;if(null===a)return 0;var i=a.currentTime,r=$o.bufferInfo(a,i,0),n=i0&&r.len<1&&a.readyState<3,s=n-i;if(s>0&&(E||_)){if(s>t.maxBufferHole){var T=this.fragmentTracker,S=!1;if(0===i){var l=T.getAppendedFrag(0,Mt.MAIN);l&&n1?(a=0,this.bitrateTest=!0):a=o.nextAutoLevel),this.level=o.nextLoadLevel=a,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=da.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=da.STOPPED},o.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},o.doTick=function(){switch(this.state){case da.WAITING_LEVEL:var e,t=this.levels,o=this.level,a=null==t||null==(e=t[o])?void 0:e.details;if(a&&(!a.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(a))break;this.state=da.IDLE;break}if(this.hls.nextLoadLevel!==this.level){this.state=da.IDLE;break}break;case da.FRAG_LOADING_WAITING_RETRY:var i,r=self.performance.now(),n=this.retryDate;(!n||r>=n||null!=(i=this.media)&&i.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=da.IDLE)}this.state===da.IDLE&&this.doTickIdle(),this.onTickEnd()},o.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},o.doTickIdle=function(){var e=this.hls,t=this.levelLastLoaded,o=this.levels,a=this.media,i=e.config,r=e.nextLoadLevel;if(null!==t&&(a||!this.startFragRequested&&i.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&null!=o&&o[r]){var n=o[r],E=this.getMainFwdBufferInfo();if(null!==E){var _=this.getLevelDetails();if(_&&this._streamEnded(E,_)){var s={};return this.altAudio&&(s.type="video"),this.hls.trigger(C.BUFFER_EOS,s),void(this.state=da.ENDED)}e.loadLevel!==r&&-1===e.manualLevel&&this.log("Adapting to level "+r+" from level "+this.level),this.level=e.nextLoadLevel=r;var T=n.details;if(!T||this.state===da.WAITING_LEVEL||T.live&&this.levelLastLoaded!==r)return this.level=r,void(this.state=da.WAITING_LEVEL);var S=E.len,l=this.getMaxBufferLength(n.maxBitrate);if(!(S>=l)){this.backtrackFragment&&this.backtrackFragment.start>E.end&&(this.backtrackFragment=null);var u=this.backtrackFragment?this.backtrackFragment.start:E.end,I=this.getNextFragment(u,T);if(this.couldBacktrack&&!this.fragPrevious&&I&&"initSegment"!==I.sn&&this.fragmentTracker.getState(I)!==ko.OK){var d,A=(null!=(d=this.backtrackFragment)?d:I).sn-T.startSN,c=T.fragments[A-1];c&&I.cc===c.cc&&(I=c,this.fragmentTracker.removeFragment(c))}else this.backtrackFragment&&E.len&&(this.backtrackFragment=null);if(I&&this.isLoopLoading(I,u)){if(!I.gap){var O=this.audioOnly&&!this.altAudio?z.AUDIO:z.VIDEO,R=(O===z.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;R&&this.afterBufferFlushed(R,O,Mt.MAIN)}I=this.getNextFragmentLoopLoading(I,T,E,Mt.MAIN,l)}I&&(!I.initSegment||I.initSegment.data||this.bitrateTest||(I=I.initSegment),this.loadFragment(I,n,u))}}}},o.loadFragment=function(t,o,a){var i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===ko.NOT_LOADED||i===ko.PARTIAL?"initSegment"===t.sn?this._loadInitSegment(t,o):this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t,o)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,o,a)):this.clearTrackerIfNeeded(t)},o.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,Mt.MAIN)},o.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},o.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},o.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var o,a=this.getAppendedFrag(t.currentTime);a&&a.start>1&&this.flushMainBuffer(0,a.start-1);var i=this.getLevelDetails();if(null!=i&&i.live){var r=this.getMainFwdBufferInfo();if(!r||r.len<2*i.targetduration)return}if(!t.paused&&e){var n=e[this.hls.nextLoadLevel],E=this.fragLastKbps;o=E&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*E)+1:0}else o=0;var _=this.getBufferedFrag(t.currentTime+o);if(_){var s=this.followingBufferedFrag(_);if(s){this.abortCurrentFrag();var T=s.maxStartPTS?s.maxStartPTS:s.start,S=s.duration,l=Math.max(_.end,T+Math.min(Math.max(S-this.config.maxFragLookUpTolerance,.5*S),.75*S));this.flushMainBuffer(l,Number.POSITIVE_INFINITY)}}}},o.abortCurrentFrag=function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case da.KEY_LOADING:case da.FRAG_LOADING:case da.FRAG_LOADING_WAITING_RETRY:case da.PARSING:case da.PARSED:this.state=da.IDLE}this.nextLoadPosition=this.getLoadPosition()},o.flushMainBuffer=function(t,o){e.prototype.flushMainBuffer.call(this,t,o,this.altAudio?"video":null)},o.onMediaAttached=function(t,o){e.prototype.onMediaAttached.call(this,t,o);var a=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new Zi(this.config,a,this.fragmentTracker,this.hls)},o.onMediaDetaching=function(){var t=this.media;t&&this.onvplaying&&this.onvseeked&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},o.onMediaPlaying=function(){this.tick()},o.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;h(t)&&this.log("Media seeked to "+t.toFixed(3));var o=this.getMainFwdBufferInfo();null!==o&&0!==o.len?this.tick():this.warn('Main forward buffer length on "seeked" event '+(o?o.len:"empty")+")")},o.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1},o.onManifestParsed=function(e,t){var o,a=!1,i=!1;t.levels.forEach((function(e){(o=e.audioCodec)&&(-1!==o.indexOf("mp4a.40.2")&&(a=!0),-1!==o.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=a&&i&&!Ra(),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},o.onLevelLoading=function(e,t){var o=this.levels;if(o&&this.state===da.IDLE){var a=o[t.level];(!a.details||a.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(a.details))&&(this.state=da.WAITING_LEVEL)}},o.onLevelLoaded=function(e,t){var o,a=this.levels,i=t.level,r=t.details,n=r.totalduration;if(a){this.log("Level "+i+" loaded ["+r.startSN+","+r.endSN+"]"+(r.lastPartSn?"[part-"+r.lastPartSn+"-"+r.lastPartIndex+"]":"")+", cc ["+r.startCC+", "+r.endCC+"] duration:"+n);var E=a[i],_=this.fragCurrent;!_||this.state!==da.FRAG_LOADING&&this.state!==da.FRAG_LOADING_WAITING_RETRY||_.level===t.level&&_.urlId===E.urlId||!_.loader||this.abortCurrentFrag();var s=0;if(r.live||null!=(o=E.details)&&o.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;s=this.alignPlaylists(r,E.details)}if(E.details=r,this.levelLastLoaded=i,this.hls.trigger(C.LEVEL_UPDATED,{details:r,level:i}),this.state===da.WAITING_LEVEL){if(this.waitForCdnTuneIn(r))return;this.state=da.IDLE}this.startFragRequested?r.live&&this.synchronizeToLiveEdge(r):this.setStartPosition(r,s),this.tick()}else this.warn("Levels were reset while loading level "+i)},o._handleFragmentLoadProgress=function(e){var t,o=e.frag,a=e.part,i=e.payload,r=this.levels;if(r){var n=r[o.level],E=n.details;if(!E)return this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset"),void this.fragmentTracker.removeFragment(o);var _=n.videoCodec,s=E.PTSKnown||!E.live,T=null==(t=o.initSegment)?void 0:t.data,S=this._getAudioCodec(n),l=this.transmuxer=this.transmuxer||new Qi(this.hls,Mt.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),u=a?a.index:-1,I=-1!==u,d=new qo(o.level,o.sn,o.stats.chunkCount,i.byteLength,u,I),A=this.initPTS[o.cc];l.push(i,T,S,_,o,a,E.totalduration,s,d,A)}else this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered")},o.onAudioTrackSwitching=function(e,t){var o=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var 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();var i=this.hls;o&&(i.trigger(C.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),i.trigger(C.AUDIO_TRACK_SWITCHED,t)}},o.onAudioTrackSwitched=function(e,t){var o=t.id,a=!!this.hls.audioTracks[o].url;if(a){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=a,this.tick()},o.onBufferCreated=function(e,t){var o,a,i=t.tracks,r=!1;for(var n in i){var E=i[n];if("main"===E.id){if(a=n,o=E,"video"===n){var _=i[n];_&&(this.videoBuffer=_.buffer)}}else r=!0}r&&o?(this.log("Alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media},o.onFragBuffered=function(e,t){var o=t.frag,a=t.part;if(!o||o.type===Mt.MAIN){if(this.fragContextChanged(o))return this.warn("Fragment "+o.sn+(a?" p: "+a.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===da.PARSED&&(this.state=da.IDLE));var i=a?a.stats:o.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==o.sn&&(this.fragPrevious=o),this.fragBufferedComplete(o,a)}},o.onError=function(e,t){var o;if(t.fatal)this.state=da.ERROR;else switch(t.details){case B.FRAG_GAP:case B.FRAG_PARSING_ERROR:case B.FRAG_DECRYPT_ERROR:case B.FRAG_LOAD_ERROR:case B.FRAG_LOAD_TIMEOUT:case B.KEY_LOAD_ERROR:case B.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Mt.MAIN,t);break;case B.LEVEL_LOAD_ERROR:case B.LEVEL_LOAD_TIMEOUT:case B.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==da.WAITING_LEVEL||(null==(o=t.context)?void 0:o.type)!==yt.LEVEL||(this.state=da.IDLE);break;case B.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;if(this.reduceLengthAndFlushBuffer(t))this.flushMainBuffer(0,Number.POSITIVE_INFINITY);else{var a=this.fragCurrent;this.abortCurrentFrag(),a&&(this.flushMainBuffer(a.start,Number.POSITIVE_INFINITY),this.nextLoadPosition=a.start)}this.resetTransmuxer(),this.resetLoadingState();break;case B.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}},o.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!$o.getBuffered(e).length){var o=this.state!==da.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,o)}this.lastCurrentTime=e.currentTime}},o.onFragLoadEmergencyAborted=function(){this.state=da.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},o.onBufferFlushed=function(e,t){var o=t.type;if(o!==z.AUDIO||this.audioOnly&&!this.altAudio){var a=(o===z.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,o,Mt.MAIN)}},o.onLevelsUpdated=function(e,t){this.levels=t.levels},o.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},o.seekToStartPos=function(){var e=this.media;if(e){var t=e.currentTime,o=this.startPosition;if(o>=0&&t0&&(iR.cc;if(!1!==i.independent){var p=T.startPTS,L=T.endPTS,D=T.startDTS,f=T.endDTS;if(_)_.elementaryStreams[T.type]={startPTS:p,endPTS:L,startDTS:D,endDTS:f};else if(T.firstKeyFrame&&T.independent&&1===r.id&&!m&&(this.couldBacktrack=!0),T.dropped&&T.independent){var g=this.getMainFwdBufferInfo(),B=(g?g.end:this.getLoadPosition())+this.config.maxBufferHole,P=T.firstKeyFramePTS?T.firstKeyFramePTS:p;if(!N&&B1&&!1===e.seeking){var o=e.currentTime;if($o.isBuffered(e,o)?t=this.getAppendedFrag(o):$o.isBuffered(e,o+.1)&&(t=this.getAppendedFrag(o+.1)),t){this.backtrackFragment=null;var a=this.fragPlaying,i=t.level;a&&t.sn===a.sn&&a.level===i&&t.urlId===a.urlId||(this.fragPlaying=t,this.hls.trigger(C.FRAG_CHANGED,{frag:t}),a&&a.level===i||this.hls.trigger(C.LEVEL_SWITCHED,{level:i}))}}},r(t,[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,o=this.currentFrag;if(o&&h(t)&&h(o.programDateTime)){var a=o.programDateTime+1e3*(t-o.start);return new Date(a)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),t})(Aa),or=(function(){function e(e,t,o){void 0===t&&(t=0),void 0===o&&(o=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_=o}var t=e.prototype;return t.sample=function(e,t){var o=Math.pow(this.alpha_,e);this.estimate_=t*(1-o)+o*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e})(),ar=(function(){function e(e,t,o,a){void 0===a&&(a=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_=o,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new or(e),this.fast_=new or(t),this.defaultTTFB_=a,this.ttfb_=new or(e)}var t=e.prototype;return t.update=function(e,t){var o=this.slow_,a=this.fast_,i=this.ttfb_;o.halfLife!==e&&(this.slow_=new or(e,o.getEstimate(),o.getTotalWeight())),a.halfLife!==t&&(this.fast_=new or(t,a.getEstimate(),a.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new or(e,i.getEstimate(),i.getTotalWeight()))},t.sample=function(e,t){var o=(e=Math.max(e,this.minDelayMs_))/1e3,a=8*t/o;this.fast_.sample(o,a),this.slow_.sample(o,a)},t.sampleTTFB=function(e){var t=e/1e3,o=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(o,Math.max(e,5))},t.canEstimate=function(){return this.fast_.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.getEstimateTTFB=function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_},t.destroy=function(){},e})(),ir=(function(){function e(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;var t=e.config;this.bwEstimator=new ar(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(C.FRAG_LOADING,this.onFragLoading,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this),e.on(C.FRAG_BUFFERED,this.onFragBuffered,this),e.on(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(C.LEVEL_LOADED,this.onLevelLoaded,this)},t.unregisterListeners=function(){var e=this.hls;e.off(C.FRAG_LOADING,this.onFragLoading,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this),e.off(C.FRAG_BUFFERED,this.onFragBuffered,this),e.off(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(C.LEVEL_LOADED,this.onLevelLoaded,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(e,t){var o,a=t.frag;this.ignoreFragment(a)||(this.fragCurrent=a,this.partCurrent=null!=(o=t.part)?o:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))},t.onLevelSwitching=function(e,t){this.clearTimer()},t.getTimeToLoadFrag=function(e,t,o,a){return e+o/t+(a?this.lastLevelLoadSec:0)},t.onLevelLoaded=function(e,t){var o=this.hls.config,a=t.stats,i=a.total,r=a.bwEstimate;h(i)&&h(r)&&(this.lastLevelLoadSec=8*i/r),t.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var e=this.fragCurrent,t=this.partCurrent,o=this.hls,a=o.autoLevelEnabled,i=o.media;if(e&&i){var r=performance.now(),n=t?t.stats:e.stats,E=t?t.duration:e.duration,_=r-n.loading.start;if(n.aborted||n.loaded&&n.loaded===n.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(a&&!i.paused&&i.playbackRate&&i.readyState){var s=o.mainForwardBufferInfo;if(null!==s){var T=this.bwEstimator.getEstimateTTFB(),S=Math.abs(i.playbackRate);if(!(_<=Math.max(T,E/(2*S)*1e3))){var l=s.len/S;if(!(l>=2*E/S)){var u=n.loading.first?n.loading.first-n.loading.start:-1,I=n.loaded&&u>-1,d=this.bwEstimator.getEstimate(),A=o.levels,c=o.minAutoLevel,O=A[e.level],R=n.total||Math.max(n.loaded,Math.round(E*O.maxBitrate/8)),N=_-u;N<1&&I&&(N=Math.min(_,8*n.loaded/d));var m=I?1e3*n.loaded/N:0,p=m?(R-n.loaded)/m:8*R/d+T/1e3;if(!(p<=l)){var L,D=m?8*m:d,f=Number.POSITIVE_INFINITY;for(L=e.level-1;L>c;L--){var g=A[L].maxBitrate;if((f=this.getTimeToLoadFrag(T/1e3,D,E*g,!A[L].details))=p||f>10*E||(o.nextLoadLevel=L,I?this.bwEstimator.sample(_-Math.min(T,u),n.loaded):this.bwEstimator.sampleTTFB(_),this.clearTimer(),U.warn("[abr] Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly;\n Time to underbuffer: "+l.toFixed(3)+" s\n Estimated load time for current fragment: "+p.toFixed(3)+" s\n Estimated load time for down switch fragment: "+f.toFixed(3)+" s\n TTFB estimate: "+u+"\n Current BW estimate: "+(h(d)?(d/1024).toFixed(3):"Unknown")+" Kb/s\n New BW estimate: "+(this.bwEstimator.getEstimate()/1024).toFixed(3)+" Kb/s\n Aborting and switching to level "+L),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),o.trigger(C.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:n}))}}}}}}},t.onFragLoaded=function(e,t){var o=t.frag,a=t.part,i=a?a.stats:o.stats;if(o.type===Mt.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(o)){if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=a?a.duration:o.duration,n=this.hls.levels[o.level],E=(n.loaded?n.loaded.bytes:0)+i.loaded,_=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:E,duration:_},n.realBitrate=Math.round(8*E/_)}if(o.bitrateTest){var s={stats:i,frag:o,part:a,id:o.type};this.onFragBuffered(C.FRAG_BUFFERED,s),o.bitrateTest=!1}}},t.onFragBuffered=function(e,t){var o=t.frag,a=t.part,i=null!=a&&a.stats.loaded?a.stats:o.stats;if(!i.aborted&&!this.ignoreFragment(o)){var r=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(r,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=r/1e3:this.bitrateTestDelay=0}},t.ignoreFragment=function(e){return e.type!==Mt.MAIN||"initSegment"===e.sn},t.clearTimer=function(){self.clearInterval(this.timer)},t.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,o=this.hls,a=o.maxAutoLevel,i=o.config,r=o.minAutoLevel,n=o.media,E=t?t.duration:e?e.duration:0,_=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,s=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,T=o.mainForwardBufferInfo,S=(T?T.len:0)/_,l=this.findBestLevel(s,r,a,S,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(l>=0)return l;U.trace("[abr] "+(S?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var u=E?Math.min(E,i.maxStarvationDelay):i.maxStarvationDelay,I=i.abrBandWidthFactor,d=i.abrBandWidthUpFactor;if(!S){var A=this.bitrateTestDelay;A&&(u=(E?Math.min(E,i.maxLoadingDelay):i.maxLoadingDelay)-A,U.trace("[abr] bitrate test took "+Math.round(1e3*A)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*u)+" ms"),I=d=1)}return l=this.findBestLevel(s,r,a,S+u,I,d),Math.max(l,0)},t.findBestLevel=function(e,t,o,a,i,r){for(var n,E=this.fragCurrent,_=this.partCurrent,s=this.lastLoadedFragLevel,T=this.hls.levels,S=T[s],l=!(null==S||null==(n=S.details)||!n.live),u=null==S?void 0:S.codecSet,I=_?_.duration:E?E.duration:0,d=this.bwEstimator.getEstimateTTFB()/1e3,A=t,c=-1,O=o;O>=t;O--){var R=T[O];if(!R||u&&R.codecSet!==u)R&&(A=Math.min(O,A),c=Math.max(O,c));else{-1!==c&&U.trace("[abr] Skipped level(s) "+A+"-"+c+' with CODECS:"'+T[c].attrs.CODECS+'"; not compatible with "'+S.attrs.CODECS+'"');var N=R.details,m=(_?null==N?void 0:N.partTarget:null==N?void 0:N.averagetargetduration)||I,p=void 0;p=O<=s?i*e:r*e;var L=T[O].maxBitrate,D=this.getTimeToLoadFrag(d,p,L*m,void 0===N);if(U.trace("[abr] level:"+O+" adjustedbw-bitrate:"+Math.round(p-L)+" avgDuration:"+m.toFixed(1)+" maxFetchDuration:"+a.toFixed(1)+" fetchDuration:"+D.toFixed(1)),p>L&&(0===D||!h(D)||l&&!this.bitrateTestDelay||DMath.max(e,o)&&a[e].loadError<=a[o].loadError)return e}return-1!==e&&(o=Math.min(e,o)),o},set:function(e){this._nextAutoLevel=e}}]),e})(),rr=(function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,o=this.dataLength;return t.length?(e=1===t.length?t[0]:nr(t,o),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e})();function nr(e,t){for(var o=new Uint8Array(t),a=0,i=0;i0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=da.IDLE):(this.loadedmetadata=!1,this.state=da.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},o.doTick=function(){switch(this.state){case da.IDLE:this.doTickIdle();break;case da.WAITING_TRACK:var t,o=this.levels,a=this.trackId,i=null==o||null==(t=o[a])?void 0:t.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=da.WAITING_INIT_PTS}break;case da.FRAG_LOADING_WAITING_RETRY:var r,n=performance.now(),E=this.retryDate;(!E||n>=E||null!=(r=this.media)&&r.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=da.IDLE);break;case da.WAITING_INIT_PTS:var _=this.waitingData;if(_){var s=_.frag,T=_.part,S=_.cache,l=_.complete;if(void 0!==this.initPTS[s.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=da.FRAG_LOADING;var u={frag:s,part:T,payload:S.flush(),networkDetails:null};this._handleFragmentLoadProgress(u),l&&e.prototype._handleFragmentLoadComplete.call(this,u)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+s.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var I=this.getLoadPosition(),d=$o.bufferInfo(this.mediaBuffer,I,this.config.maxBufferHole);Do(d.end,this.config.maxFragLookUpTolerance,s)<0&&(this.log("Waiting fragment cc ("+s.cc+") @ "+s.start+" cancelled because another fragment at "+d.end+" is needed"),this.clearWaitingFragment())}}else this.state=da.IDLE}this.onTickEnd()},o.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=da.IDLE)},o.resetLoadingState=function(){this.clearWaitingFragment(),e.prototype.resetLoadingState.call(this)},o.onTickEnd=function(){var e=this.media;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)},o.doTickIdle=function(){var e=this.hls,t=this.levels,o=this.media,a=this.trackId,i=e.config;if(null!=t&&t[a]&&(o||!this.startFragRequested&&i.startFragPrefetch)){var r=t[a],n=r.details;if(!n||n.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(n))this.state=da.WAITING_TRACK;else{var E=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&E&&(this.bufferFlushed=!1,this.afterBufferFlushed(E,z.AUDIO,Mt.AUDIO));var _=this.getFwdBufferInfo(E,Mt.AUDIO);if(null!==_){var s=this.bufferedTrack,T=this.switchingTrack;if(!T&&this._streamEnded(_,n))return e.trigger(C.BUFFER_EOS,{type:"audio"}),void(this.state=da.ENDED);var S=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Mt.MAIN),l=_.len,u=this.getMaxBufferLength(null==S?void 0:S.len);if(!(l>=u)||T){var I=n.fragments[0].start,d=_.end;if(T&&o){var A=this.getLoadPosition();s&&T.attrs!==s.attrs&&(d=A),n.PTSKnown&&AI||_.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=I+.05)}var c=this.getNextFragment(d,n),O=!1;if(c&&this.isLoopLoading(c,d)&&(O=!!c.gap,c=this.getNextFragmentLoopLoading(c,n,_,Mt.MAIN,u)),c){var R=S&&c.start>S.end+n.targetduration;if(R||(null==S||!S.len)&&_.len){var N=this.getAppendedFrag(c.start,Mt.MAIN);if(null===N)return;if(O||(O=!!N.gap||!!R&&0===S.len),R&&!O||O&&_.nextStart&&_.nextStart=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var o=this.currentTrack;t[this.trackId];var i=t[e],r=i.groupId,n=i.name;if(this.log("Switching to audio-track "+e+' "'+n+'" lang:'+i.lang+" group:"+r),this.trackId=e,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(C.AUDIO_TRACK_SWITCHING,a({},i)),!i.details||i.details.live){var E=this.switchParams(i.url,null==o?void 0:o.details);this.loadPlaylist(E)}}},o.selectInitialTrack=function(){var e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{var o=new Error("No track found for running audio group-ID: "+this.groupId+" track count: "+e.length);this.warn(o.message),this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:o})}},o.findTrackId=function(e){for(var t=this.tracksInGroup,o=0;o=i[E].start&&n<=i[E].end){r=i[E];break}var _=o.start+o.duration;r?r.end=_:(r={start:n,end:_},i.push(r)),this.fragmentTracker.fragBuffered(o)}}},o.onBufferFlushing=function(e,t){var o=t.startOffset,a=t.endOffset;if(0===o&&a!==Number.POSITIVE_INFINITY){var i=a-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach((function(e){for(var t=0;t=n.length||i!==r)&&E){this.mediaBuffer=this.mediaBufferTimeRanges;var _=0;if(a.live||null!=(o=E.details)&&o.live){var s=this.mainDetails;if(a.deltaUpdateFailed||!s)return;var T=s.fragments[0];E.details?0===(_=this.alignPlaylists(a,E.details))&&T&&To(a,_=T.start):a.hasProgramDateTime&&s.hasProgramDateTime?(Ea(a,s),_=a.fragments[0].start):T&&To(a,_=T.start)}E.details=a,this.levelLastLoaded=i,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(E.details,_),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===da.IDLE&&(ho(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0))}}},o._handleFragmentLoadComplete=function(e){var t=this,o=e.frag,a=e.payload,i=o.decryptdata,r=this.hls;if(!this.fragContextChanged(o)&&a&&a.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var n=performance.now();this.decrypter.decrypt(new Uint8Array(a),i.key.buffer,i.iv.buffer).catch((function(e){throw r.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:o}),e})).then((function(e){var t=performance.now();r.trigger(C.FRAG_DECRYPTED,{frag:o,payload:e,stats:{tstart:n,tdecrypt:t}})})).catch((function(e){t.warn(e.name+": "+e.message),t.state=da.IDLE}))}},o.doTick=function(){if(this.media){if(this.state===da.IDLE){var e=this.currentTrackId,t=this.levels,o=t[e];if(!t.length||!o||!o.details)return;var a=this.config,i=this.getLoadPosition(),r=$o.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,a.maxBufferHole),n=r.end,E=r.len,_=this.getFwdBufferInfo(this.media,Mt.MAIN),s=o.details;if(E>this.getMaxBufferLength(null==_?void 0:_.len)+s.levelTargetDuration)return;var T=s.fragments,S=T.length,l=s.edge,u=null,I=this.fragPrevious;if(nl-d?0:d;!(u=ho(I,T,Math.max(T[0].start,n),A))&&I&&I.start>>=0)>a-1)throw new DOMException("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+o+") is greater than the maximum bound ("+a+")");return e[o][t]};this.buffered={get length(){return e.length},end:function(o){return t("end",o,e.length)},start:function(o){return t("start",o,e.length)}}},dr=(function(e){function t(t){var o;return(o=e.call(this,t,"[subtitle-track-controller]")||this).media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o._subtitleDisplay=!0,o.registerListeners(),o}_(t,e);var o=t.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},o.registerListeners=function(){var e=this.hls;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.LEVEL_LOADING,this.onLevelLoading,this),e.on(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(C.ERROR,this.onError,this)},o.unregisterListeners=function(){var e=this.hls;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.LEVEL_LOADING,this.onLevelLoading,this),e.off(C.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(C.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(C.ERROR,this.onError,this)},o.onMediaAttached=function(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))},o.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},o.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Ar(this.media.textTracks).forEach((function(e){Ft(e)})),this.subtitleTrack=-1,this.media=null)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},o.onSubtitleTrackLoaded=function(e,t){var o=t.id,a=t.details,i=this.trackId,r=this.tracksInGroup[i];if(r){var n=r.details;r.details=t.details,this.log("subtitle track "+o+" loaded ["+a.startSN+"-"+a.endSN+"]"),o===this.trackId&&this.playlistLoaded(o,t,n)}else this.warn("Invalid subtitle track id "+o)},o.onLevelLoading=function(e,t){this.switchLevel(t.level)},o.onLevelSwitching=function(e,t){this.switchLevel(t.level)},o.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var o=t.textGroupIds[t.urlId],a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==o){var i=this.tracks.filter((function(e){return!o||e.groupId===o}));this.tracksInGroup=i;var r=this.findTrackId(null==a?void 0:a.name)||this.findTrackId();this.groupId=o||null;var n={subtitleTracks:i};this.log("Updating subtitle tracks, "+i.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(C.SUBTITLE_TRACKS_UPDATED,n),-1!==r&&this.setSubtitleTrack(r,a)}else this.shouldReloadPlaylist(a)&&this.setSubtitleTrack(this.trackId,a)}},o.findTrackId=function(e){for(var t=this.tracksInGroup,o=0;o=a.length)){this.clearTimer();var i=a[e];if(this.log("Switching to subtitle-track "+e+(i?' "'+i.name+'" lang:'+i.lang+" group:"+i.groupId:"")),this.trackId=e,i){var r=i.id,n=i.groupId,E=void 0===n?"":n,_=i.name,s=i.type,T=i.url;this.hls.trigger(C.SUBTITLE_TRACK_SWITCH,{id:r,groupId:E,name:_,type:s,url:T});var S=this.switchParams(i.url,null==t?void 0:t.details);this.loadPlaylist(S)}else this.hls.trigger(C.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=Ar(this.media.textTracks),o=0;o-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}]),t})(Wo);function Ar(e){for(var t=[],o=0;o "+e.src+")")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},t.registerListeners=function(){var e=this.hls;e.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_PARSED,this.onManifestParsed,this),e.on(C.BUFFER_RESET,this.onBufferReset,this),e.on(C.BUFFER_APPENDING,this.onBufferAppending,this),e.on(C.BUFFER_CODECS,this.onBufferCodecs,this),e.on(C.BUFFER_EOS,this.onBufferEos,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(C.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(C.FRAG_PARSED,this.onFragParsed,this),e.on(C.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_PARSED,this.onManifestParsed,this),e.off(C.BUFFER_RESET,this.onBufferReset,this),e.off(C.BUFFER_APPENDING,this.onBufferAppending,this),e.off(C.BUFFER_CODECS,this.onBufferCodecs,this),e.off(C.BUFFER_EOS,this.onBufferEos,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(C.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(C.FRAG_PARSED,this.onFragParsed,this),e.off(C.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new cr(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},t.onManifestLoading=function(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null},t.onManifestParsed=function(e,t){var o=2;(t.audio&&!t.video||!t.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,U.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var o=this.media=t.media;if(o&&Or){var a=this.mediaSource=new Or;a.addEventListener("sourceopen",this._onMediaSourceOpen),a.addEventListener("sourceended",this._onMediaSourceEnded),a.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(a),this._objectUrl=o.src,o.addEventListener("emptied",this._onMediaEmptied)}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,o=this._objectUrl;if(t){if(U.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){U.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),o&&self.URL.revokeObjectURL(o),e.src===o?(e.removeAttribute("src"),e.load()):U.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(C.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var o=e.sourceBuffer[t];try{o&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(o),e.sourceBuffer[t]=void 0)}catch(e){U.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var o=this,a=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(a){var i=o.tracks[e];if(i&&"function"==typeof i.buffer.changeType){var r=t[e],n=r.id,E=r.codec,_=r.levelCodec,s=r.container,T=r.metadata,S=(i.levelCodec||i.codec).replace(Rr,"$1"),l=(_||E).replace(Rr,"$1");if(S!==l){var u=s+";codecs="+(_||E);o.appendChangeType(e,u),U.log("[buffer-controller]: switching codec "+S+" to "+l),o.tracks[e]={buffer:i.buffer,codec:E,container:s,levelCodec:_,metadata:T,id:n}}}}else o.pendingTracks[e]=t[e]})),a||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var o=this,a=this.operationQueue,i={execute:function(){var i=o.sourceBuffer[e];i&&(U.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),i.changeType(t)),a.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){U.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};a.append(i,e)},t.onBufferAppending=function(e,t){var o=this,a=this.hls,i=this.operationQueue,r=this.tracks,n=t.data,E=t.type,_=t.frag,s=t.part,T=t.chunkMeta,S=T.buffering[E],l=self.performance.now();S.start=l;var u=_.stats.buffering,I=s?s.stats.buffering:null;0===u.start&&(u.start=l),I&&0===I.start&&(I.start=l);var d=r.audio,A=!1;"audio"===E&&"audio/mpeg"===(null==d?void 0:d.container)&&(A=!this.lastMpegAudioChunk||1===T.id||this.lastMpegAudioChunk.sn!==T.sn,this.lastMpegAudioChunk=T);var c=_.start,O={execute:function(){if(S.executeStart=self.performance.now(),A){var e=o.sourceBuffer[E];if(e){var t=c-e.timestampOffset;Math.abs(t)>=.1&&(U.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c+" (delta: "+t+") sn: "+_.sn+")"),e.timestampOffset=c)}}o.appendExecutor(n,E)},onStart:function(){},onComplete:function(){var e=self.performance.now();S.executeEnd=S.end=e,0===u.first&&(u.first=e),I&&0===I.first&&(I.first=e);var t=o.sourceBuffer,a={};for(var i in t)a[i]=$o.getBuffered(t[i]);o.appendError=0,o.hls.trigger(C.BUFFER_APPENDED,{type:E,frag:_,part:s,chunkMeta:T,parent:_.type,timeRanges:a})},onError:function(e){U.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",e);var t={type:g.MEDIA_ERROR,parent:_.type,details:B.BUFFER_APPEND_ERROR,frag:_,part:s,chunkMeta:T,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=B.BUFFER_FULL_ERROR:(o.appendError++,t.details=B.BUFFER_APPEND_ERROR,o.appendError>a.config.appendErrorMaxRetry&&(U.error("[buffer-controller]: Failed "+a.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),a.trigger(C.ERROR,t)}};i.append(O,E)},t.onBufferFlushing=function(e,t){var o=this,a=this.operationQueue,i=function(e){return{execute:o.removeExecutor.bind(o,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(C.BUFFER_FLUSHED,{type:e})},onError:function(t){U.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?a.append(i(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){a.append(i(e),e)}))},t.onFragParsed=function(e,t){var o=this,a=t.frag,i=t.part,r=[],n=i?i.elementaryStreams:a.elementaryStreams;n[z.AUDIOVIDEO]?r.push("audiovideo"):(n[z.AUDIO]&&r.push("audio"),n[z.VIDEO]&&r.push("video"));var E=function(){var e=self.performance.now();a.stats.buffering.end=e,i&&(i.stats.buffering.end=e);var t=i?i.stats:a.stats;o.hls.trigger(C.FRAG_BUFFERED,{frag:a,part:i,stats:t,id:a.type})};0===r.length&&U.warn("Fragments must have at least one ElementaryStreamType set. type: "+a.type+" level: "+a.level+" sn: "+a.sn),this.blockBuffers(E,r)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var o=this;this.getSourceBufferTypes().reduce((function(e,a){var i=o.sourceBuffer[a];return!i||t.type&&t.type!==a||(i.ending=!0,i.ended||(i.ended=!0,U.log("[buffer-controller]: "+a+" sourceBuffer now EOS"))),e&&!(i&&!i.ended)}),!0)&&(U.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){o.getSourceBufferTypes().forEach((function(e){var t=o.sourceBuffer[e];t&&(t.ending=!1)}));var e=o.mediaSource;e&&"open"===e.readyState?(U.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&U.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+e.readyState)})))},t.onLevelUpdated=function(e,t){var o=t.details;o.fragments.length&&(this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,o=this.media,a=this.sourceBuffer;if(o&&null!==t){var i=this.getSourceBufferTypes();if(i.length){var r=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(h(r)&&!(r<0)){var n=o.currentTime,E=t.levelTargetDuration,_=Math.max(r,E),s=Math.floor(n/E)*E-_;i.forEach((function(o){var i=a[o];if(i){var r=$o.getBuffered(i);if(r.length>0&&s>r.start(0)){if(e.trigger(C.BACK_BUFFER_REACHED,{bufferEnd:s}),t.live)e.trigger(C.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(i.ended&&r.end(r.length-1)-n<2*E)return void U.info("[buffer-controller]: Cannot flush "+o+" back buffer while SourceBuffer is in ended state");e.trigger(C.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:o})}}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,o=this.media,a=this.mediaSource,i=e.fragments[0].start+e.totalduration,r=o.duration,n=h(a.duration)?a.duration:0;e.live&&t.config.liveDurationInfinity?(U.log("[buffer-controller]: Media Source duration is set to Infinity"),a.duration=1/0,this.updateSeekableRange(e)):(i>n&&i>r||!h(r))&&(U.log("[buffer-controller]: Updating Media Source duration to "+i.toFixed(3)),a.duration=i)}},t.updateSeekableRange=function(e){var t=this.mediaSource,o=e.fragments;if(o.length&&e.live&&null!=t&&t.setLiveSeekableRange){var a=Math.max(0,o[0].start),i=Math.max(a,a+e.totalduration);t.setLiveSeekableRange(a,i)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,o=this.pendingTracks,a=Object.keys(o).length;if(a&&!e||2===a){this.createSourceBuffers(o),this.pendingTracks={};var i=this.getSourceBufferTypes();if(i.length)this.hls.trigger(C.BUFFER_CREATED,{tracks:this.tracks}),i.forEach((function(e){t.executeNext(e)}));else{var r=new Error("could not create source buffer for media codec(s)");this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:r,reason:r.message})}}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");for(var a in e)if(!t[a]){var i=e[a];if(!i)throw Error("source buffer exists for track "+a+", however track does not");var r=i.levelCodec||i.codec,n=i.container+";codecs="+r;U.log("[buffer-controller]: creating sourceBuffer("+n+")");try{var E=t[a]=o.addSourceBuffer(n),_=a;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[a]={buffer:E,codec:r,container:i.container,levelCodec:i.levelCodec,metadata:i.metadata,id:i.id}}catch(e){U.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:n})}}},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){var o=new Error(e+" SourceBuffer error");U.error("[buffer-controller]: "+o,t),this.hls.trigger(C.ERROR,{type:g.MEDIA_ERROR,details:B.BUFFER_APPENDING_ERROR,error:o,fatal:!1});var a=this.operationQueue.current(e);a&&a.onError(t)},t.removeExecutor=function(e,t,o){var a=this.media,i=this.mediaSource,r=this.operationQueue,n=this.sourceBuffer[e];if(!a||!i||!n)return U.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);var E=h(a.duration)?a.duration:1/0,_=h(i.duration)?i.duration:1/0,s=Math.max(0,t),T=Math.min(o,E,_);T>s&&!n.ending?(n.ended=!1,U.log("[buffer-controller]: Removing ["+s+","+T+"] from the "+e+" SourceBuffer"),n.remove(s,T)):r.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var o=this.operationQueue,a=this.sourceBuffer[t];if(!a)return U.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void o.shiftAndExecuteNext(t);a.ended=!1,a.appendBuffer(e)},t.blockBuffers=function(e,t){var o=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return U.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);var a=this.operationQueue,i=t.map((function(e){return a.appendBlocker(e)}));Promise.all(i).then((function(){e(),t.forEach((function(e){var t=o.sourceBuffer[e];null!=t&&t.updating||a.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,o){var a=this.sourceBuffer[e];if(a){var i=o.bind(this,e);this.listeners[e].push({event:t,listener:i}),a.addEventListener(t,i)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e})(),mr={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},pr=function(e){var t=e;return mr.hasOwnProperty(e)&&(t=mr[e]),String.fromCharCode(t)},Lr=15,hr=100,Dr={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},fr={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Cr={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},gr={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Br=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Pr=(function(){function e(){this.time=null,this.verboseLevel=0}return e.prototype.log=function(e,t){if(this.verboseLevel>=e){var o="function"==typeof t?t():t;U.log(this.time+" ["+e+"] "+o)}},e})(),vr=function(e){for(var t=[],o=0;ohr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=hr)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var o=this.pos+1;o=144&&this.backSpace();var o=pr(e);this.pos>=hr?this.logger.log(0,(function(){return"Cannot insert "+e.toString(16)+" ("+o+") at position "+t.pos+". Skipping it!"})):(this.chars[this.pos].setChar(o,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t0&&(o=e?"["+t.join(" | ")+"]":t.join("\n")),o},t.getTextAndFormat=function(){return this.rows},e})(),Ur=(function(){function e(e,t,o){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 br(o),this.nonDisplayedMemory=new br(o),this.lastOutputScreen=new br(o),this.currRollUpRow=this.displayedMemory.rows[Lr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=o}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Lr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(function(){return"MODE="+e})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=this,o=0;o=46,t.italics)t.foreground="white";else{var o=Math.floor(e/2)-16,a=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=a[o]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?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.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e})(),Gr=(function(){function e(e,t,o){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var a=new Pr;this.channels=[null,new Ur(e,t,a),new Ur(e+1,o,a)],this.cmdHistory=wr(),this.logger=a}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var o,a,i,r=!1;this.logger.time=e;for(var n=0;n ("+vr([a,i])+")"),(o=this.parseCmd(a,i))||(o=this.parseMidrow(a,i)),o||(o=this.parsePAC(a,i)),o||(o=this.parseBackgroundAttributes(a,i)),!o&&(r=this.parseChars(a,i))){var E=this.currentChannel;E&&E>0?this.channels[E].insertChars(r):this.logger.log(2,"No channel found yet. TEXT-MODE?")}o||r||this.logger.log(2,"Couldn't parse cleaned data "+vr([a,i])+" orig: "+vr([t[n],t[n+1]]))}},t.parseCmd=function(e,t){var o=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(Fr(e,t,o))return kr(null,null,o),this.logger.log(3,"Repeated command ("+vr([e,t])+") is dropped"),!0;var a=20===e||21===e||23===e?1:2,i=this.channels[a];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),kr(e,t,o),this.currentChannel=a,!0},t.parseMidrow=function(e,t){var o=0;if((17===e||25===e)&&t>=32&&t<=47){if((o=17===e?1:2)!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;var a=this.channels[o];return!!a&&(a.ccMIDROW(t),this.logger.log(3,"MIDROW ("+vr([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var o,a=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(Fr(e,t,a))return kr(null,null,a),!0;var i=e<=23?1:2;o=t>=64&&t<=95?1===i?Dr[e]:Cr[e]:1===i?fr[e]:gr[e];var r=this.channels[i];return!!r&&(r.setPAC(this.interpretPAC(o,t)),kr(e,t,a),this.currentChannel=i,!0)},t.interpretPAC=function(e,t){var o,a={color:null,italics:!1,indent:null,underline:!1,row:e};return o=t>95?t-96:t-64,a.underline=1==(1&o),o<=13?a.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(o/2)]:o<=15?(a.italics=!0,a.color="white"):a.indent=4*Math.floor((o-16)/2),a},t.parseChars=function(e,t){var o,a,i=null,r=null;if(e>=25?(o=2,r=e-8):(o=1,r=e),r>=17&&r<=19?(a=17===r?t+80:18===r?t+112:t+144,this.logger.log(2,"Special char '"+pr(a)+"' in channel "+o),i=[a]):e>=32&&e<=127&&(i=0===t?[e]:[e,t]),i){var n=vr(i);this.logger.log(3,"Char codes = "+n.join(",")),kr(e,t,this.cmdHistory)}return i},t.parseBackgroundAttributes=function(e,t){var o;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var a={};16===e||24===e?(o=Math.floor((t-32)/2),a.background=Br[o],t%2==1&&(a.background=a.background+"_semi")):45===t?a.background="transparent":(a.foreground="black",47===t&&(a.underline=!0));var i=e<=23?1:2;return this.channels[i].setBkgData(a),kr(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=o,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[],this.startTime=null},e})(),Hr=(function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function o(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var o=t.toLowerCase();return!!~e.indexOf(o)&&o}function a(t){return o(e,t)}function i(e){return o(t,e)}function r(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a100)throw new Error("Position must be between 0 and 100.");O=e,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",r({},E,{get:function(){return R},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");R=t,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",r({},E,{get:function(){return N},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");N=e,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",r({},E,{get:function(){return m},set:function(e){var t=i(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");m=t,this.hasBeenReset=!0}})),n.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n})(),Yr=(function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e})();function zr(e){function t(e,t,o,a){return 3600*(0|e)+60*(0|t)+(0|o)+parseFloat(a||0)}var o=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?t(o[2],o[3],0,o[4]):t(o[1],o[2],o[3],o[4]):null}var Kr=(function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,o){return o?this.has(e)?this.values[e]:t[o]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,o){for(var a=0;a=0&&o<=100)return this.set(e,o),!0}return!1},e})();function xr(e,t,o,a){var i=a?e.split(a):[e];for(var r in i)if("string"==typeof i[r]){var n=i[r].split(o);2===n.length&&t(n[0],n[1])}}var jr=new Hr(0,0,""),Qr="middle"===jr.align?"middle":"center";function Xr(e,t,o){var a=e;function i(){var t=zr(e);if(null===t)throw new Error("Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function r(e,t){var a=new Kr;xr(e,(function(e,t){var i;switch(e){case"region":for(var r=o.length-1;r>=0;r--)if(o[r].id===t){a.set(e,o[r].region);break}break;case"vertical":a.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),a.integer(e,i[0]),a.percent(e,i[0])&&a.set("snapToLines",!1),a.alt(e,i[0],["auto"]),2===i.length&&a.alt("lineAlign",i[1],["start",Qr,"end"]);break;case"position":i=t.split(","),a.percent(e,i[0]),2===i.length&&a.alt("positionAlign",i[1],["start",Qr,"end","line-left","line-right","auto"]);break;case"size":a.percent(e,t);break;case"align":a.alt(e,t,["start",Qr,"end","left","right"])}}),/:/,/\s/),t.region=a.get("region",null),t.vertical=a.get("vertical","");var i=a.get("line","auto");"auto"===i&&-1===jr.line&&(i=-1),t.line=i,t.lineAlign=a.get("lineAlign","start"),t.snapToLines=a.get("snapToLines",!0),t.size=a.get("size",100),t.align=a.get("align",Qr);var r=a.get("position","auto");"auto"===r&&50===jr.position&&(r="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=r}function n(){e=e.replace(/^\s+/,"")}if(n(),t.startTime=i(),n(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.slice(3),n(),t.endTime=i(),n(),r(e,t)}function $r(e){return e.replace(//gi,"\n")}var qr=(function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new Yr,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function o(){var e=t.buffer,o=0;for(e=$r(e);o9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(h(t)&&h(o)&&h(a)&&h(i)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*o,t+=6e4*a,t+=36e5*i},tn=function(e){for(var t=5381,o=e.length;o;)t=33*t^e.charCodeAt(--o);return(t>>>0).toString()};function on(e,t,o){return tn(e.toString())+tn(t.toString())+tn(o)}var an=function(e,t,o){var a=e[t],i=e[a.prevCC];if(!i||!i.new&&a.new)return e.ccOffset=e.presentationOffset=a.start,void(a.new=!1);for(;null!=(r=i)&&r.new;){var r;e.ccOffset+=a.start-i.start,a.new=!1,i=e[(a=i).prevCC]}e.presentationOffset=o};function rn(e,t,o,a,i,r,n){var E,_=new qr,s=Ce(new Uint8Array(e)).trim().replace(Jr,"\n").split("\n"),T=[],S=t?ui(t.baseTime,t.timescale):0,l="00:00.000",u=0,I=0,d=!0;_.oncue=function(e){var r=o[a],n=o.ccOffset,_=(u-S)/9e4;if(null!=r&&r.new&&(void 0!==I?n=o.ccOffset=r.start:an(o,a,_)),_){if(!t)return void(E=new Error("Missing initPTS for VTT MPEGTS"));n=_-o.presentationOffset}var s=e.endTime-e.startTime,l=Ni(9e4*(e.startTime+n-I),9e4*i)/9e4;e.startTime=Math.max(l,0),e.endTime=Math.max(l+s,0);var d=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(d)),e.id||(e.id=on(e.startTime,e.endTime,d)),e.endTime>0&&T.push(e)},_.onparsingerror=function(e){E=e},_.onflush=function(){E?n(E):r(T)},s.forEach((function(e){if(d){if(Zr(e,"X-TIMESTAMP-MAP=")){d=!1,e.slice(16).split(",").forEach((function(e){Zr(e,"LOCAL:")?l=e.slice(6):Zr(e,"MPEGTS:")&&(u=parseInt(e.slice(7)))}));try{I=en(l)/1e3}catch(e){E=e}return}""===e&&(d=!1)}_.parse(e+"\n")})),_.flush()}var nn="stpp.ttml.im1t",En=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_n=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,sn={left:"start",center:"center",right:"end",start:"start",end:"end"};function Tn(e,t,o,a){var i=ke(new Uint8Array(e),["mdat"]);if(0!==i.length){var r=i.map((function(e){return Ce(e)})),n=Si(t.baseTime,1,t.timescale);try{r.forEach((function(e){return o(Sn(e,n))}))}catch(e){a(e)}}else a(new Error("Could not parse IMSC1 mdat"))}function Sn(e,t){var o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");var a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(a).reduce((function(e,t){return e[t]=o.getAttribute("ttp:"+t)||a[t],e}),{}),r="preserve"!==o.getAttribute("xml:space"),n=un(ln(o,"styling","style")),_=un(ln(o,"layout","region")),s=ln(o,"body","[begin]");return[].map.call(s,(function(e){var o=In(e,r);if(!o||!e.hasAttribute("begin"))return null;var a=On(e.getAttribute("begin"),i),s=On(e.getAttribute("dur"),i),T=On(e.getAttribute("end"),i);if(null===a)throw cn(e);if(null===T){if(null===s)throw cn(e);T=a+s}var S=new Hr(a-t,T-t,o);S.id=on(S.startTime,S.endTime,S.text);var l=dn(_[e.getAttribute("region")],n[e.getAttribute("style")],n),u=l.textAlign;if(u){var I=sn[u];I&&(S.lineAlign=I),S.align=u}return E(S,l),S})).filter((function(e){return null!==e}))}function ln(e,t,o){var a=e.getElementsByTagName(t)[0];return a?[].slice.call(a.querySelectorAll(o)):[]}function un(e){return e.reduce((function(e,t){var o=t.getAttribute("xml:id");return o&&(e[o]=t),e}),{})}function In(e,t){return[].slice.call(e.childNodes).reduce((function(e,o,a){var i;return"br"===o.nodeName&&a?e+"\n":null!=(i=o.childNodes)&&i.length?In(o,t):t?e+o.textContent.trim().replace(/\s+/g," "):e+o.textContent}),"")}function dn(e,t,o){var a="http://www.w3.org/ns/ttml#styling",i=null,r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return n&&o.hasOwnProperty(n)&&(i=o[n]),r.reduce((function(o,r){var n=An(t,a,r)||An(e,a,r)||An(i,a,r);return n&&(o[r]=n),o}),{})}function An(e,t,o){return e&&e.hasAttributeNS(t,o)?e.getAttributeNS(t,o):null}function cn(e){return new Error("Could not parse ttml timestamp "+e)}function On(e,t){if(!e)return null;var o=zr(e);return null===o&&(En.test(e)?o=Rn(e,t):_n.test(e)&&(o=Nn(e,t))),o}function Rn(e,t){var o=En.exec(e),a=(0|o[4])+(0|o[5])/t.subFrameRate;return 3600*(0|o[1])+60*(0|o[2])+(0|o[3])+a/t.frameRate}function Nn(e,t){var o=_n.exec(e),a=Number(o[1]);switch(o[2]){case"h":return 3600*a;case"m":return 60*a;case"ms":return 1e3*a;case"f":return a/t.frameRate;case"t":return a/t.tickRate}return a}var mn=(function(){function e(e){if(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.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=hn(),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}},this.config.enableCEA708Captions){var t=new Vr(this,"textTrack1"),o=new Vr(this,"textTrack2"),a=new Vr(this,"textTrack3"),i=new Vr(this,"textTrack4");this.cea608Parser1=new Gr(1,t,o),this.cea608Parser2=new Gr(3,a,i)}e.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(C.MANIFEST_LOADING,this.onManifestLoading,this),e.on(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(C.FRAG_LOADING,this.onFragLoading,this),e.on(C.FRAG_LOADED,this.onFragLoaded,this),e.on(C.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(C.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(C.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(C.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(C.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(C.MANIFEST_LOADING,this.onManifestLoading,this),e.off(C.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(C.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(C.FRAG_LOADING,this.onFragLoading,this),e.off(C.FRAG_LOADED,this.onFragLoaded,this),e.off(C.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(C.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(C.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(C.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(C.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,o,a,i){for(var r=!1,n=i.length;n--;){var E=i[n],_=Ln(E[0],E[1],t,o);if(_>=0&&(E[0]=Math.min(E[0],t),E[1]=Math.max(E[1],o),r=!0,_/(o-t)>.5))return}if(r||i.push([t,o]),this.config.renderTextTracksNatively){var s=this.captionsTracks[e];this.Cues.newCue(s,t,o,a)}else{var T=this.Cues.newCue(null,t,o,a);this.hls.trigger(C.CUES_PARSED,{type:"captions",cues:T,track:e})}},t.onInitPtsFound=function(e,t){var o=this,a=t.frag,i=t.id,r=t.initPTS,n=t.timescale,E=this.unparsedVttFrags;"main"===i&&(this.initPTS[a.cc]={baseTime:r,timescale:n}),E.length&&(this.unparsedVttFrags=[],E.forEach((function(e){o.onFragLoaded(C.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var o=0;oa.cc||_.trigger(C.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:t})}))}else n.push(e)},t._fallbackToIMSC1=function(e,t){var o=this,a=this.tracks[e.level];a.textCodec||Tn(t,this.initPTS[e.cc],(function(){a.textCodec=nn,o._parseIMSC1(e,t)}),(function(){a.textCodec="wvtt"}))},t._appendCues=function(e,t){var o=this.hls;if(this.config.renderTextTracksNatively){var a=this.textTracks[t];if(!a||"disabled"===a.mode)return;e.forEach((function(e){return kt(a,e)}))}else{var i=this.tracks[t];if(!i)return;var r=i.default?"default":"subtitles"+t;o.trigger(C.CUES_PARSED,{type:"subtitles",cues:e,track:r})}},t.onFragDecrypted=function(e,t){t.frag.type===Mt.SUBTITLE&&this.onFragLoaded(C.FRAG_LOADED,t)},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var o=this.cea608Parser1,a=this.cea608Parser2;if(this.enabled&&o&&a){var i=t.frag,r=t.samples;if(i.type!==Mt.MAIN||"NONE"!==this.closedCaptionsForLevel(i))for(var n=0;n0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},t.getMaxLevel=function(t){var o=this,a=this.hls.levels;if(!a.length)return-1;var i=a.filter((function(e,a){return o.isLevelAllowed(e)&&a<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},t.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},t.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},t.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var o=e.getBoundingClientRect();t.width=o.width,t.height=o.height,t.width||t.height||(t.width=o.right-o.left||e.width||0,t.height=o.bottom-o.top||e.height||0)}return this.clientRect=t,t},t.isLevelAllowed=function(e){return!this.restrictedLevels.some((function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height}))},e.getMaxLevelByMediaSize=function(e,t,o){if(null==e||!e.length)return-1;for(var a=function(e,t){return!t||e.width!==t.width||e.height!==t.height},i=e.length-1,r=0;r=t||n.height>=o)&&a(n,e[r+1])){i=r;break}}return i},r(e,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}}]),e})(),fn=(function(){function e(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()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(C.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(C.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var o=this.hls.config;if(o.capLevelOnFPSDrop){var a=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=a,a&&"function"==typeof a.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,o){var a=performance.now();if(t){if(this.lastTime){var i=a-this.lastTime,r=o-this.lastDroppedFrames,n=t-this.lastDecodedFrames,E=1e3*r/i,_=this.hls;if(_.trigger(C.FPS_DROP,{currentDropped:r,currentDecoded:n,totalDroppedFrames:o}),E>0&&r>_.config.fpsDroppedMonitoringThreshold*n){var s=_.currentLevel;U.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(-1===_.autoLevelCapping||_.autoLevelCapping>=s)&&(s-=1,_.trigger(C.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:_.currentLevel}),_.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=o,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e})(),Cn="[eme]",gn=(function(){function e(t){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=e.CDMCleanupPromise?[e.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=U.debug.bind(U,Cn),this.log=U.log.bind(U,Cn),this.warn=U.warn.bind(U,Cn),this.error=U.error.bind(U,Cn),this.hls=t,this.config=t.config,this.registerListeners()}var t=e.prototype;return t.destroy=function(){this.unregisterListeners(),this.onMediaDetached();var e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null},t.registerListeners=function(){this.hls.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(C.MANIFEST_LOADED,this.onManifestLoaded,this)},t.unregisterListeners=function(){this.hls.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(C.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(C.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(C.MANIFEST_LOADED,this.onManifestLoaded,this)},t.getLicenseServerUrl=function(e){var t=this.config,o=t.drmSystems,a=t.widevineLicenseUrl,i=o[e];if(i)return i.licenseUrl;if(e===te.WIDEVINE&&a)return a;throw new Error('no license server URL configured for key-system "'+e+'"')},t.getServerCertificateUrl=function(e){var t=this.config.drmSystems[e];if(t)return t.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+e+'"]')},t.attemptKeySystemAccess=function(e){var t=this,o=this.hls.levels,a=function(e,t,o){return!!e&&o.indexOf(e)===t},i=o.map((function(e){return e.audioCodec})).filter(a),r=o.map((function(e){return e.videoCodec})).filter(a);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((function(o,a){!(function e(n){var E=n.shift();t.getMediaKeysPromise(E,i,r).then((function(e){return o({keySystem:E,mediaKeys:e})})).catch((function(t){n.length?e(n):a(t instanceof Bn?t:new Bn({type:g.KEY_SYSTEM_ERROR,details:B.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))})(e)}))},t.requestMediaKeySystemAccess=function(e,t){var o=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof o){var a="Configured requestMediaKeySystemAccess is not a function "+o;return null===_e&&"http:"===self.location.protocol&&(a="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(a))}return o(e,t)},t.getMediaKeysPromise=function(e,t,o){var a=this,i=se(e,t,o,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e],n=null==r?void 0:r.keySystemAccess;if(!n){this.log('Requesting encrypted media "'+e+'" key-system access with config: '+JSON.stringify(i)),n=this.requestMediaKeySystemAccess(e,i);var E=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch((function(t){a.log('Failed to obtain access to key-system "'+e+'": '+t)})),n.then((function(t){a.log('Access for key-system "'+t.keySystem+'" obtained');var o=a.fetchServerCertificate(e);return a.log('Create media-keys for "'+e+'"'),E.mediaKeys=t.createMediaKeys().then((function(t){return a.log('Media-keys created for "'+e+'"'),o.then((function(o){return o?a.setMediaKeysServerCertificate(t,e,o):t}))})),E.mediaKeys.catch((function(t){a.error('Failed to create media-keys for "'+e+'"}: '+t)})),E.mediaKeys}))}return n.then((function(){return r.mediaKeys}))},t.createMediaKeySessionContext=function(e){var t=e.decryptdata,o=e.keySystem,a=e.mediaKeys;this.log('Creating key-system session "'+o+'" keyId: '+Be.hexDump(t.keyId||[]));var i=a.createSession(),r={decryptdata:t,keySystem:o,mediaKeys:a,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r},t.renewKeySession=function(e){var t=e.decryptdata;if(t.pssh){var o=this.createMediaKeySessionContext(e),a=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[a]=this.generateRequestWithPreferredKeySession(o,i,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)},t.getKeyIdString=function(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Be.hexDump(e.keyId)},t.updateKeySession=function(e,t){var o,a=e.mediaKeysSession;return this.log('Updating key-session "'+a.sessionId+'" for keyID '+Be.hexDump((null==(o=e.decryptdata)?void 0:o.keyId)||[])+"\n } (data length: "+(t?t.byteLength:t)+")"),a.update(t)},t.selectKeySystemFormat=function(e){var 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},t.getKeyFormatPromise=function(e){var t=this;return new Promise((function(o,a){var i=Ee(t.config),r=e.map(ae).filter((function(e){return!!e&&-1!==i.indexOf(e)}));return t.getKeySystemSelectionPromise(r).then((function(e){var t=e.keySystem,i=ne(t);i?o(i):a(new Error('Unable to find format for key-system "'+t+'"'))})).catch(a)}))},t.loadKey=function(e){var t=this,o=e.keyInfo.decryptdata,a=this.getKeyIdString(o),i="(keyId: "+a+' format: "'+o.keyFormat+'" method: '+o.method+" uri: "+o.uri+")";this.log("Starting session for key "+i);var r=this.keyIdToKeySessionPromise[a];return r||(r=this.keyIdToKeySessionPromise[a]=this.getKeySystemForKeyPromise(o).then((function(a){var r=a.keySystem,n=a.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: "+e.frag.sn+" "+e.frag.type+": "+e.frag.level+" using key "+i),t.attemptSetMediaKeys(r,n).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({keySystem:r,mediaKeys:n,decryptdata:o}),a="cenc";return t.generateRequestWithPreferredKeySession(e,a,o.pssh,"playlist-key")}))}))).catch((function(e){return t.handleError(e)})),r},t.throwIfDestroyed=function(e){if(!this.hls)throw new Error("invalid state")},t.handleError=function(e){this.hls&&(this.error(e.message),e instanceof Bn?this.hls.trigger(C.ERROR,e.data):this.hls.trigger(C.ERROR,{type:g.KEY_SYSTEM_ERROR,details:B.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))},t.getKeySystemForKeyPromise=function(e){var t=this.getKeyIdString(e),o=this.keyIdToKeySessionPromise[t];if(!o){var a=ae(e.keyFormat),i=a?[a]:Ee(this.config);return this.attemptKeySystemAccess(i)}return o},t.getKeySystemSelectionPromise=function(e){if(e.length||(e=Ee(this.config)),0===e.length)throw new Bn({type:g.KEY_SYSTEM_ERROR,details:B.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(e)},t._onMediaEncrypted=function(e){var t=this,o=e.initDataType,a=e.initData;if(this.debug('"'+e.type+'" event: init data type: "'+o+'"'),null!==a){var i,r;if("sinf"===o&&this.config.drmSystems[te.FAIRPLAY]){var n=Me(new Uint8Array(a));try{var E=$(JSON.parse(n).sinf),_=He(new Uint8Array(E));if(!_)return;i=_.subarray(8,24),r=te.FAIRPLAY}catch(e){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var s=at(a);if(null===s)return;0===s.version&&s.systemId===ie.WIDEVINE&&s.data&&(i=s.data.subarray(8,24)),r=re(s.systemId)}if(r&&i){for(var T=Be.hexDump(i),S=this.keyIdToKeySessionPromise,l=this.mediaKeySessions,u=S[T],I=function(){var e=l[d],r=e.decryptdata;if(r.pssh||!r.keyId)return"continue";var n=Be.hexDump(r.keyId);return T===n||-1!==r.uri.replace(/-/g,"").indexOf(T)?(u=S[n],delete S[n],r.pssh=new Uint8Array(a),r.keyId=i,u=S[T]=u.then((function(){return t.generateRequestWithPreferredKeySession(e,o,a,"encrypted-event-key-match")})),"break"):void 0},d=0;dS||E.status>=400&&E.status<500)r(new Bn({type:g.KEY_SYSTEM_ERROR,details:B.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:{url:n,data:void 0,code:E.status,text:E.statusText}},"License Request XHR failed ("+n+"). Status: "+E.status+" ("+E.statusText+")"));else{var l=S-o._requestLicenseFailureCount+1;o.warn("Retrying license request, "+l+" attempts left"),o.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=E,o.setupLicenseXHR(E,n,e,t).then((function(e){var t=e.xhr,o=e.licenseChallenge;t.send(o)}))}))},t.onMediaAttached=function(e,t){if(this.config.emeEnabled){var o=t.media;this.media=o,o.addEventListener("encrypted",this.onMediaEncrypted),o.addEventListener("waitingforkey",this.onWaitingForKey)}},t.onMediaDetached=function(){var t=this,o=this.media,a=this.mediaKeySessions;o&&(o.removeEventListener("encrypted",this.onMediaEncrypted),o.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},rt.clearKeyUriToKeyIdMap();var i=a.length;e.CDMCleanupPromise=Promise.all(a.map((function(e){return t.removeSession(e)})).concat(null==o?void 0:o.setMediaKeys(null).catch((function(e){t.log("Could not clear media keys: "+e+". media.src: "+(null==o?void 0:o.src))})))).then((function(){i&&(t.log("finished closing key sessions and clearing media keys"),a.length=0)})).catch((function(e){t.log("Could not close sessions and clear media keys: "+e+". media.src: "+(null==o?void 0:o.src))}))},t.onManifestLoading=function(){this.keyFormatPromise=null},t.onManifestLoaded=function(e,t){var o=t.sessionKeys;if(o&&this.config.emeEnabled&&!this.keyFormatPromise){var a=o.reduce((function(e,t){return-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e}),[]);this.log("Selecting key-system from session-keys "+a.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(a)}},t.removeSession=function(e){var t=this,o=e.mediaKeysSession,a=e.licenseXhr;if(o){this.log("Remove licenses and keys and close session "+o.sessionId),o.onmessage=null,o.onkeystatuseschange=null,a&&a.readyState!==XMLHttpRequest.DONE&&a.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;var i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),o.remove().catch((function(e){t.log("Could not remove session: "+e)})).then((function(){return o.close()})).catch((function(e){t.log("Could not close session: "+e)}))}},e})();gn.CDMCleanupPromise=void 0;var Bn=(function(e){function t(t,o){var a;return(a=e.call(this,o)||this).data=void 0,t.error||(t.error=new Error(o)),a.data=t,t.err=t.error,a}return _(t,e),t})(I(Error)),Pn=1,vn={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},yn="h",Mn=(function(){function e(t){var o=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(e){try{o.apply(e,{ot:vn.MANIFEST,su:!o.initialized})}catch(e){U.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var t=e.frag,a=o.hls.levels[t.level],i=o.getObjectType(t),r={d:1e3*t.duration,ot:i};i!==vn.VIDEO&&i!==vn.AUDIO&&i!=vn.MUXED||(r.br=a.bitrate/1e3,r.tb=o.getTopBandwidth(i)/1e3,r.bl=o.getBufferLength(i)),o.apply(e,r)}catch(e){U.warn("Could not generate segment CMCD data.",e)}},this.hls=t;var a=this.config=t.config,i=a.cmcd;null!=i&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||e.uuid(),this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(C.MEDIA_DETACHED,this.onMediaDetached,this),e.on(C.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(C.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(C.MEDIA_DETACHED,this.onMediaDetached,this),e.off(C.BUFFER_CREATED,this.onBufferCreated,this)},t.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var o,a;this.audioBuffer=null==(o=t.tracks.audio)?void 0:o.buffer,this.videoBuffer=null==(a=t.tracks.video)?void 0:a.buffer},t.createData=function(){var e;return{v:Pn,sf:yn,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,o){void 0===o&&(o={}),E(o,this.createData());var a=o.ot===vn.INIT||o.ot===vn.VIDEO||o.ot===vn.MUXED;if(this.starved&&a&&(o.bs=!0,o.su=!0,this.starved=!1),null==o.su&&(o.su=this.buffering),this.useHeaders){var i=e.toHeaders(o);if(!Object.keys(i).length)return;t.headers||(t.headers={}),E(t.headers,i)}else{var r=e.toQuery(o);if(!r)return;t.url=e.appendQueryToUri(t.url,r)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?vn.TIMED_TEXT:"initSegment"===e.sn?vn.INIT:"audio"===t?vn.AUDIO:"main"===t?this.hls.audioTracks.length?vn.VIDEO:vn.MUXED:void 0},t.getTopBandwidth=function(e){var t,o=0,a=this.hls;if(e===vn.AUDIO)t=a.audioTracks;else{var i=a.maxAutoLevel,r=i>-1?i+1:a.levels.length;t=a.levels.slice(0,r)}for(var n,E=O(t);!(n=E()).done;){var _=n.value;_.bitrate>o&&(o=_.bitrate)}return o>0?o:NaN},t.getBufferLength=function(e){var t=this.hls.media,o=e===vn.AUDIO?this.audioBuffer:this.videoBuffer;return o&&t?1e3*$o.bufferInfo(o,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,o=e||this.config.loader;return(function(){function e(e){this.loader=void 0,this.loader=new o(e)}var a=e.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(e,o,a){t(e),this.loader.load(e,o,a)},r(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e})()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,o=e||this.config.loader;return(function(){function e(e){this.loader=void 0,this.loader=new o(e)}var a=e.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(e,o,a){t(e),this.loader.load(e,o,a)},r(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e})()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,o=[],a=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},i=function(e){return Math.round(e)},r=function(e){return 100*i(e/100)},n=function(e){return encodeURIComponent(e)},E={br:i,d:i,bl:r,dl:r,mtp:r,nor:n,rtp:r,tb:i},_=O(Object.keys(e||{}).sort());!(t=_()).done;){var s=t.value,T=e[s];if(a(T)&&!("v"===s&&1===T||"pr"==s&&1===T)){var S=E[s];S&&(T=S(T));var l=typeof T,u=void 0;u="ot"===s||"sf"===s||"st"===s?s+"="+T:"boolean"===l?s:"number"===l?s+"="+T:s+"="+JSON.stringify(T),o.push(u)}}return o.join(",")},e.toHeaders=function(t){for(var o={},a=["Object","Request","Session","Status"],i=[{},{},{},{}],r={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},n=0,E=Object.keys(t);n1&&(this.updatePathwayPriority(a),o.resolved=this.pathwayId!==i)}},t.filterParsedLevels=function(e){this.levels=e;var t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){var o=e[0].pathwayId;this.log("No levels found in Pathway "+this.pathwayId+'. Setting initial Pathway to "'+o+'"'),t=this.getLevelsForPathway(o),this.pathwayId=o}return t.length!==e.length?(this.log("Found "+t.length+"/"+e.length+' levels in Pathway "'+this.pathwayId+'"'),t):e},t.getLevelsForPathway=function(e){return null===this.levels?[]:this.levels.filter((function(t){return e===t.pathwayId}))},t.updatePathwayPriority=function(e){var t;this.pathwayPriority=e;var o=this.penalizedPathways,a=performance.now();Object.keys(o).forEach((function(e){a-o[e]>Wn&&delete o[e]}));for(var i=0;i0){this.log('Setting Pathway to "'+r+'"'),this.pathwayId=r,this.hls.trigger(C.LEVELS_UPDATED,{levels:t});var _=this.hls.levels[n];E&&_&&this.levels&&(_.attrs["STABLE-VARIANT-ID"]!==E.attrs["STABLE-VARIANT-ID"]&&_.bitrate!==E.bitrate&&this.log("Unstable Pathways change from bitrate "+E.bitrate+" to "+_.bitrate),this.hls.nextLoadLevel=n);break}}}},t.clonePathways=function(e){var t=this,o=this.levels;if(o){var a={},i={};e.forEach((function(e){var r=e.ID,n=e["BASE-ID"],_=e["URI-REPLACEMENT"];if(!o.some((function(e){return e.pathwayId===r}))){var s=t.getLevelsForPathway(n).map((function(e){var t=E({},e);t.details=void 0,t.url=Gn(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",_);var o=new F(e.attrs);o["PATHWAY-ID"]=r;var n=o.AUDIO&&o.AUDIO+"_clone_"+r,s=o.SUBTITLES&&o.SUBTITLES+"_clone_"+r;n&&(a[o.AUDIO]=n,o.AUDIO=n),s&&(i[o.SUBTITLES]=s,o.SUBTITLES=s),t.attrs=o;var T=new oo(t);return Uo(T,"audio",n),Uo(T,"text",s),T}));o.push.apply(o,s),Un(t.audioTracks,a,_,r),Un(t.subtitleTracks,i,_,r)}}))}},t.loadSteeringManifest=function(e){var t,o=this,a=this.hls.config,i=a.loader;this.loader&&this.loader.destroy(),this.loader=new i(a);try{t=new self.URL(e)}catch(t){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: "+e)}if("data:"!==t.protocol){var r=0|(this.hls.bandwidthEstimate||a.abrEwmaDefaultEstimate);t.searchParams.set("_HLS_pathway",this.pathwayId),t.searchParams.set("_HLS_throughput",""+r)}var n={responseType:"json",url:t.href},E=a.steeringManifestLoadPolicy.default,_=E.errorRetry||E.timeoutRetry||{},s={loadPolicy:E,timeout:E.maxLoadTimeMs,maxRetry:_.maxNumRetry||0,retryDelay:_.retryDelayMs||0,maxRetryDelay:_.maxRetryDelayMs||0},T={onSuccess:function(e,a,i,r){o.log('Loaded steering manifest: "'+t+'"');var n=e.data;if(1===n.VERSION){o.updated=performance.now(),o.timeToLoad=n.TTL;var E=n["RELOAD-URI"],_=n["PATHWAY-CLONES"],s=n["PATHWAY-PRIORITY"];if(E)try{o.uri=new self.URL(E,t).href}catch(e){return o.enabled=!1,void o.log("Failed to parse Steering Manifest RELOAD-URI: "+E)}o.scheduleRefresh(o.uri||i.url),_&&o.clonePathways(_),s&&o.updatePathwayPriority(s)}else o.log("Steering VERSION "+n.VERSION+" not supported!")},onError:function(e,t,a,i){if(o.log("Error loading steering manifest: "+e.code+" "+e.text+" ("+t.url+")"),o.stopLoad(),410===e.code)return o.enabled=!1,void o.log("Steering manifest "+t.url+" no longer available");var r=1e3*o.timeToLoad;if(429!==e.code)o.scheduleRefresh(o.uri||t.url,r);else{var n=o.loader;if("function"==typeof(null==n?void 0:n.getResponseHeader)){var E=n.getResponseHeader("Retry-After");E&&(r=1e3*parseFloat(E))}o.log("Steering manifest "+t.url+" rate limited")}},onTimeout:function(e,t,a){o.log("Timeout loading steering manifest ("+t.url+")"),o.scheduleRefresh(o.uri||t.url)}};this.log("Requesting steering manifest: "+t),this.loader.load(n,s,T)},t.scheduleRefresh=function(e,t){var o=this;void 0===t&&(t=1e3*this.timeToLoad),self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((function(){o.loadSteeringManifest(e)}),t)},e})();function Un(e,t,o,a){e&&Object.keys(t).forEach((function(i){var r=e.filter((function(e){return e.groupId===i})).map((function(e){var r=E({},e);return r.details=void 0,r.attrs=new F(r.attrs),r.url=r.attrs.URI=Gn(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",o),r.groupId=r.attrs["GROUP-ID"]=t[i],r.attrs["PATHWAY-ID"]=a,r}));e.push.apply(e,r)}))}function Gn(e,t,o,a){var i,r=a.HOST,n=a.PARAMS,E=a[o];t&&(i=null==E?void 0:E[t])&&(e=i);var _=new self.URL(e);return r&&!i&&(_.host=r),n&&Object.keys(n).sort().forEach((function(e){e&&_.searchParams.set(e,n[e])})),_.href}var kn=/^age:\s*[\d.]+\s*$/im,Fn=(function(){function e(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=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Y,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,o){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=o,this.loadInternal()},t.loadInternal=function(){var e=this,t=this.config,o=this.context;if(t){var a=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;var r=this.xhrSetup;r?Promise.resolve().then((function(){if(!e.stats.aborted)return r(a,o.url)})).catch((function(e){return a.open("GET",o.url,!0),r(a,o.url)})).then((function(){e.stats.aborted||e.openAndSendXhr(a,o,t)})).catch((function(t){e.callbacks.onError({code:a.status,text:t.message},o,a,i)})):this.openAndSendXhr(a,o,t)}},t.openAndSendXhr=function(e,t,o){e.readyState||e.open("GET",t.url,!0);var a=this.context.headers,i=o.loadPolicy,r=i.maxTimeToFirstByteMs,n=i.maxLoadTimeMs;if(a)for(var E in a)e.setRequestHeader(E,a[E]);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),o.timeout=r&&h(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),e.send()},t.readystatechange=function(){var e=this.context,t=this.loader,o=this.stats;if(e&&t){var a=t.readyState,i=this.config;if(!o.aborted&&a>=2&&(0===o.loading.first&&(o.loading.first=Math.max(self.performance.now(),o.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(o.loading.first-o.loading.start)))),4===a)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;var r=t.status,n="text"!==t.responseType;if(r>=200&&r<300&&(n&&t.response||null!==t.responseText)){o.loading.end=Math.max(self.performance.now(),o.loading.first);var E=n?t.response:t.responseText,_="arraybuffer"===t.responseType?E.byteLength:E.length;if(o.loaded=o.total=_,o.bwEstimate=8e3*o.total/(o.loading.end-o.loading.first),!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(o,e,E,t),!this.callbacks)return;var T={url:t.responseURL,data:E,code:r};this.callbacks.onSuccess(T,o,e,t)}else{var S=i.loadPolicy.errorRetry;No(S,o.retry,!1,r)?this.retry(S):(U.error(r+" while loading "+e.url),this.callbacks.onError({code:r,text:t.statusText},e,t,o))}}}},t.loadtimeout=function(){var e,t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(No(t,this.stats.retry,!0))this.retry(t);else{U.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))}},t.retry=function(e){var t=this.context,o=this.stats;this.retryDelay=Oo(e,o.retry),o.retry++,U.warn((status?"HTTP Status "+status:"Timeout")+" while loading "+t.url+", retrying "+o.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)},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&kn.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},t.getResponseHeader=function(e){return this.loader&&new RegExp("^"+e+":\\s*[\\d.]+\\s*$","im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null},e})();function wn(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}var Vn=/(\d+)-(\d+)\/(\d+)/,Hn=(function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||xn,this.controller=new self.AbortController,this.stats=new Y}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,o){var a=this,i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();var r=Yn(e,this.controller.signal),n=o.onProgress,E="arraybuffer"===e.responseType,_=E?"byteLength":"length",s=t.loadPolicy,T=s.maxTimeToFirstByteMs,S=s.maxLoadTimeMs;this.context=e,this.config=t,this.callbacks=o,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=T&&h(T)?T:S,this.requestTimeout=self.setTimeout((function(){a.abortInternal(),o.onTimeout(i,e,a.response)}),t.timeout),self.fetch(this.request).then((function(r){a.response=a.loader=r;var _=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(a.requestTimeout),t.timeout=S,a.requestTimeout=self.setTimeout((function(){a.abortInternal(),o.onTimeout(i,e,a.response)}),S-(_-i.loading.start)),!r.ok){var s=r.status,T=r.statusText;throw new jn(T||"fetch, bad network response",s,r)}return i.loading.first=_,i.total=Kn(r.headers)||i.total,n&&h(t.highWaterMark)?a.loadProgressively(r,i,e,t.highWaterMark,n):E?r.arrayBuffer():"json"===e.responseType?r.json():r.text()})).then((function(r){var E=a.response;self.clearTimeout(a.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);var s=r[_];s&&(i.loaded=i.total=s);var T={url:E.url,data:r,code:E.status};n&&!h(t.highWaterMark)&&n(i,e,r,E),o.onSuccess(T,i,e,E)})).catch((function(t){if(self.clearTimeout(a.requestTimeout),!i.aborted){var r=t&&t.code||0,n=t?t.message:null;o.onError({code:r,text:n},e,t?t.details:null,i)}}))},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.getResponseHeader=function(e){return this.response?this.response.headers.get(e):null},t.loadProgressively=function(e,t,o,a,i){void 0===a&&(a=0);var r=new rr,n=e.body.getReader();return(function E(){return n.read().then((function(n){if(n.done)return r.dataLength&&i(t,o,r.flush(),e),Promise.resolve(new ArrayBuffer(0));var _=n.value,s=_.length;return t.loaded+=s,s=a&&i(t,o,r.flush(),e)):i(t,o,_,e),E()})).catch((function(){return Promise.reject()}))})()},e})();function Yn(e,t){var o={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(E({},e.headers))};return e.rangeEnd&&o.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),o}function zn(e){var t=Vn.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Kn(e){var t=e.get("Content-Range");if(t){var o=zn(t);if(h(o))return o}var a=e.get("Content-Length");if(a)return parseInt(a)}function xn(e,t){return new self.Request(e.url,t)}var jn=(function(e){function t(t,o,a){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=o,i.details=a,i}return _(t,e),t})(I(Error)),Qn=/\s/,Xn={newCue:function(e,t,o,a){for(var i,r,n,E,_,s=[],T=self.VTTCue||self.TextTrackCue,S=0;S=16?E--:E++;var I=$r(_.trim()),d=on(t,o,I);null!=e&&null!=(l=e.cues)&&l.getCueById(d)||((r=new T(t,o,I)).id=d,r.line=S+1,r.align="left",r.position=10+Math.min(80,10*Math.floor(8*E/32)),s.push(r))}return e&&s.length&&(s.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),s.forEach((function(t){return kt(e,t)}))),s}},$n=a(a({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,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,loader:Fn,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ir,bufferController:Nr,capLevelController:Dn,errorController:vo,fpsController:fn,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:_e,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},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}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},qn()),{},{subtitleStreamController:ur,subtitleTrackController:dr,timelineController:mn,audioStreamController:_r,audioTrackController:sr,emeController:gn,cmcdController:Mn,contentSteeringController:bn});function qn(){return{cueHandler:Xn,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 Jn(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');var o=Zn(e),i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((function(e){var a=("level"===e?"playlist":e)+"LoadPolicy",r=void 0===t[a],n=[];i.forEach((function(i){var E=e+"Loading"+i,_=t[E];if(void 0!==_&&r){n.push(E);var s=o[a].default;switch(t[a]={default:s},i){case"TimeOut":s.maxLoadTimeMs=_,s.maxTimeToFirstByteMs=_;break;case"MaxRetry":s.errorRetry.maxNumRetry=_,s.timeoutRetry.maxNumRetry=_;break;case"RetryDelay":s.errorRetry.retryDelayMs=_,s.timeoutRetry.retryDelayMs=_;break;case"MaxRetryTimeout":s.errorRetry.maxRetryDelayMs=_,s.timeoutRetry.maxRetryDelayMs=_}}})),n.length&&U.warn('hls.js config: "'+n.join('", "')+'" setting(s) are deprecated, use "'+a+'": '+JSON.stringify(t[a]))})),a(a({},o),t)}function Zn(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(Zn):Object.keys(e).reduce((function(t,o){return t[o]=Zn(e[o]),t}),{}):e}function eE(e){var t=e.loader;t!==Hn&&t!==Fn?(U.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):wn()&&(e.loader=Hn,e.progressive=!0,e.enableSoftwareAES=!0,U.log("[config]: Progressive streaming enabled, using FetchLoader"))}var tE=(function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ki,this._autoLevelCapping=void 0,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.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,b(t.debug||!1,"Hls instance");var o=this.config=Jn(e.DefaultConfig,t);this.userConfig=t,this._autoLevelCapping=-1,o.progressive&&eE(o);var a=o.abrController,i=o.bufferController,r=o.capLevelController,n=o.errorController,E=o.fpsController,_=new n(this),s=this.abrController=new a(this),T=this.bufferController=new i(this),S=this.capLevelController=new r(this),l=new E(this),u=new Ut(this),I=new $t(this),d=o.contentSteeringController,A=d?new d(this):null,c=this.levelController=new bo(this,A),O=new Fo(this),R=new jo(this.config),N=this.streamController=new tr(this,O,R);S.setStreamController(N),l.setStreamController(N);var m=[u,c,N];A&&m.splice(1,0,A),this.networkControllers=m;var p=[s,T,S,l,I,O];this.audioTrackController=this.createController(o.audioTrackController,m);var L=o.audioStreamController;L&&m.push(new L(this,O,R)),this.subtitleTrackController=this.createController(o.subtitleTrackController,m);var h=o.subtitleStreamController;h&&m.push(new h(this,O,R)),this.createController(o.timelineController,p),R.emeController=this.emeController=this.createController(o.emeController,p),this.cmcdController=this.createController(o.cmcdController,p),this.latencyController=this.createController(qt,p),this.coreComponents=p,m.push(_);var D=_.onErrorOut;"function"==typeof D&&this.on(C.ERROR,D,_)}e.isSupported=function(){return Oa()};var t=e.prototype;return t.createController=function(e,t){if(e){var o=new e(this);return t&&t.push(o),o}return null},t.on=function(e,t,o){void 0===o&&(o=this),this._emitter.on(e,t,o)},t.once=function(e,t,o){void 0===o&&(o=this),this._emitter.once(e,t,o)},t.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},t.off=function(e,t,o,a){void 0===o&&(o=this),this._emitter.off(e,t,o,a)},t.listeners=function(e){return this._emitter.listeners(e)},t.emit=function(e,t,o){return this._emitter.emit(e,t,o)},t.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){U.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(C.ERROR,{type:g.OTHER_ERROR,details:B.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1},t.listenerCount=function(e){return this._emitter.listenerCount(e)},t.destroy=function(){U.log("destroy"),this.trigger(C.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0;var e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null},t.attachMedia=function(e){U.log("attachMedia"),this._media=e,this.trigger(C.MEDIA_ATTACHING,{media:e})},t.detachMedia=function(){U.log("detachMedia"),this.trigger(C.MEDIA_DETACHING,void 0),this._media=null},t.loadSource=function(e){this.stopLoad();var t=this.media,o=this.url,a=this.url=L.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});U.log("loadSource:"+a),t&&o&&(o!==a||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(C.MANIFEST_LOADING,{url:e})},t.startLoad=function(e){void 0===e&&(e=-1),U.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},t.stopLoad=function(){U.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},t.swapAudioCodec=function(){U.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.recoverMediaError=function(){U.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},t.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},r(e,[{key:"levels",get:function(){var e=this.levelController.levels;return e||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){U.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){U.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){U.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){U.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){U.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(U.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"ttfbEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(e){Jt.indexOf(e)>-1&&(this._maxHdcpLevel=e)}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var o=e.length,a=0;a=t)return a;return 0}},{key:"maxAutoLevel",get:function(){var e,t=this.levels,o=this.autoLevelCapping,a=this.maxHdcpLevel;if(e=-1===o&&t&&t.length?t.length-1:o,a)for(var i=e;i--;){var r=t[i].attrs["HDCP-LEVEL"];if(r&&r<=a)return i}return e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.4.14-patch1"}},{key:"Events",get:function(){return C}},{key:"ErrorTypes",get:function(){return g}},{key:"ErrorDetails",get:function(){return B}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:$n},set:function(t){e.defaultConfig=t}}]),e})();return tE.defaultConfig=void 0,tE})()})(!1)},52047:e=>{"use strict";e.exports={abbr:"abbr",accept:"accept",acceptCharset:"accept-charset",accessKey:"accesskey",action:"action",allowFullScreen:"allowfullscreen",allowTransparency:"allowtransparency",alt:"alt",async:"async",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",cellPadding:"cellpadding",cellSpacing:"cellspacing",challenge:"challenge",charset:"charset",checked:"checked",cite:"cite",class:"class",className:"class",cols:"cols",colSpan:"colspan",command:"command",content:"content",contentEditable:"contenteditable",contextMenu:"contextmenu",controls:"controls",coords:"coords",crossOrigin:"crossorigin",data:"data",dateTime:"datetime",default:"default",defer:"defer",dir:"dir",disabled:"disabled",download:"download",draggable:"draggable",dropzone:"dropzone",encType:"enctype",for:"for",form:"form",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formNoValidate:"formnovalidate",formTarget:"formtarget",frameBorder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hrefLang:"hreflang",htmlFor:"for",httpEquiv:"http-equiv",icon:"icon",id:"id",inputMode:"inputmode",isMap:"ismap",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemScope:"itemscope",itemType:"itemtype",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",manifest:"manifest",max:"max",maxLength:"maxlength",media:"media",mediaGroup:"mediagroup",method:"method",min:"min",minLength:"minlength",multiple:"multiple",muted:"muted",name:"name",noValidate:"novalidate",open:"open",optimum:"optimum",pattern:"pattern",ping:"ping",placeholder:"placeholder",poster:"poster",preload:"preload",radioGroup:"radiogroup",readOnly:"readonly",rel:"rel",required:"required",role:"role",rows:"rows",rowSpan:"rowspan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",sortable:"sortable",span:"span",spellCheck:"spellcheck",src:"src",srcDoc:"srcdoc",srcSet:"srcset",start:"start",step:"step",style:"style",tabIndex:"tabindex",target:"target",title:"title",translate:"translate",type:"type",typeMustMatch:"typemustmatch",useMap:"usemap",value:"value",width:"width",wmode:"wmode",wrap:"wrap"}},81613:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>l});var a=o(71739),i=o.n(a),r=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},o=e.match(/<\/?([^\s]+?)[/\s>]/);if(o&&(t.name=o[1],(i()[o[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var a=e.indexOf("--\x3e");return{type:"comment",comment:-1!==a?e.slice(4,a):""}}for(var n=new RegExp(r),E=null;null!==(E=n.exec(e));)if(E[0].trim())if(E[1]){var _=E[1].trim(),s=[_,""];_.indexOf("=")>-1&&(s=_.split("=")),t.attrs[s[0]]=s[1],n.lastIndex--}else E[2]&&(t.attrs[E[2]]=E[3].trim().substring(1,E[3].length-1));return t}var E=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,_=/^\s*$/,s=Object.create(null);function T(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(e){var t=[];for(var o in e)t.push(o+'="'+e[o]+'"');return t.length?" "+t.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(T,"")+"";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var S={parse:function(e,t){t||(t={}),t.components||(t.components=s);var o,a=[],i=[],r=-1,T=!1;if(0!==e.indexOf("<")){var S=e.indexOf("<");a.push({type:"text",content:-1===S?e:e.substring(0,S)})}return e.replace(E,(function(E,s){if(T){if(E!=="")return;T=!1}var S,l="/"!==E.charAt(1),u=E.startsWith("\x3c!--"),I=s+E.length,d=e.charAt(I);if(u){var A=n(E);return r<0?(a.push(A),a):((S=i[r]).children.push(A),a)}if(l&&(r++,"tag"===(o=n(E)).type&&t.components[o.name]&&(o.type="component",T=!0),o.voidElement||T||!d||"<"===d||o.children.push({type:"text",content:e.slice(I,e.indexOf("<",I))}),0===r&&a.push(o),(S=i[r-1])&&S.children.push(o),i[r]=o),(!l||o.voidElement)&&(r>-1&&(o.voidElement||o.name===E.slice(2,-1))&&(r--,o=-1===r?a:i[r]),!T&&"<"!==d&&d)){S=-1===r?a:i[r].children;var c=e.indexOf("<",I),O=e.slice(I,-1===c?void 0:c);_.test(O)&&(O=" "),(c>-1&&r+S.length>=0||" "!==O)&&S.push({type:"text",content:O})}})),a},stringify:function(e){return e.reduce((function(e,t){return e+T("",t)}),"")}};const l=S},96073:(e,t,o)=>{"use strict";var a=o(17021),i=o(50949),r=o(94813),n=o(25627),E=o(96433),_=o(28542),s=o(42411),T=o(92401),S=o(29394);function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(a),I=l(i),d=l(r),A=l(n),c=l(E),O=l(_),R=l(s),N=l(T),m=l(S);function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function L(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};I.default(this,e),this.init(t,o)}return d.default(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||h,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),o=0;o1?t-1:0),a=1;a-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var n=a(r.shift());!e[n]&&o&&(e[n]=new o),e=Object.prototype.hasOwnProperty.call(e,n)?e[n]:{}}return i()?{}:{obj:e,k:a(r.shift())}}function v(e,t,o){var a=P(e,t,Object);a.obj[a.k]=o}function y(e,t){var o=P(e,t),a=o.obj,i=o.k;if(a)return a[i]}function M(e,t,o){var a=y(e,o);return void 0!==a?a:y(t,o)}function W(e,t,o){for(var a in t)"__proto__"!==a&&"constructor"!==a&&(a in e?"string"==typeof e[a]||e[a]instanceof String||"string"==typeof t[a]||t[a]instanceof String?o&&(e[a]=t[a]):W(e[a],t[a],o):e[a]=t[a]);return e}function b(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var U={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function G(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return U[e]})):e}var k="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,F=[" ",",","?","!",";"];function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function V(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var a=t.split(o),i=e,r=0;rr+n;)n++,_=i[E=a.slice(r,r+n).join(o)];if(void 0===_)return;if(null===_)return null;if(t.endsWith(E)){if("string"==typeof _)return _;if(E&&"string"==typeof _[E])return _[E]}var s=a.slice(r+n).join(o);return s?Y(_,s,o):void 0}i=i[a[r]]}return i}}var z=(function(e){c.default(o,e);var t=H(o);function o(e){var a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return I.default(this,o),a=t.call(this),k&&f.call(A.default(a)),a.data=e||{},a.options=i,void 0===a.options.keySeparator&&(a.options.keySeparator="."),void 0===a.options.ignoreJSONStructure&&(a.options.ignoreJSONStructure=!0),a}return d.default(o,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,r=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure,n=[e,t];o&&"string"!=typeof o&&(n=n.concat(o)),o&&"string"==typeof o&&(n=n.concat(i?o.split(i):o)),e.indexOf(".")>-1&&(n=e.split("."));var E=y(this.data,n);return E||!r||"string"!=typeof o?E:Y(this.data&&this.data[e]&&this.data[e][t],o,i)}},{key:"addResource",value:function(e,t,o,a){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0===r&&(r=".");var n=[e,t];o&&(n=n.concat(r?o.split(r):o)),e.indexOf(".")>-1&&(a=t,t=(n=e.split("."))[1]),this.addNamespaces(t),v(this.data,n,a),i.silent||this.emit("added",e,t,o,a)}},{key:"addResources",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in o)"string"!=typeof o[i]&&"[object Array]"!==Object.prototype.toString.apply(o[i])||this.addResource(e,t,i,o[i],{silent:!0});a.silent||this.emit("added",e,t,o)}},{key:"addResourceBundle",value:function(e,t,o,a,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},n=[e,t];e.indexOf(".")>-1&&(a=o,o=t,t=(n=e.split("."))[1]),this.addNamespaces(t);var E=y(this.data,n)||{};a?W(E,o,i):E=V(V({},E),o),v(this.data,n,E),r.silent||this.emit("added",e,t,o)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?V(V({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o})(f),K={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,o,a,i){var r=this;return e.forEach((function(e){r.processors[e]&&(t=r.processors[e].process(t,o,a,i))})),t}};function x(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function j(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return I.default(this,o),a=t.call(this),k&&f.call(A.default(a)),B(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,A.default(a)),a.options=i,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=D.create("translator"),a}return d.default(o,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var o=this.resolve(e,t);return o&&void 0!==o.res}},{key:"extractFromKey",value:function(e,t){var o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");var a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],r=o&&e.indexOf(o)>-1,n=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||(function(e,t,o){t=t||"",o=o||"";var a=F.filter((function(e){return t.indexOf(e)<0&&o.indexOf(e)<0}));if(0===a.length)return!0;var i=new RegExp("(".concat(a.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),r=!i.test(e);if(!r){var n=e.indexOf(o);n>0&&!i.test(e.substring(0,n))&&(r=!0)}return r})(e,o,a));if(r&&!n){var E=e.match(this.interpolator.nestingRegexp);if(E&&E.length>0)return{key:e,namespaces:i};var _=e.split(o);(o!==a||o===a&&this.options.ns.indexOf(_[0])>-1)&&(i=_.shift()),e=_.join(a)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,a){var i=this;if("object"!==u.default(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,E=this.extractFromKey(e[e.length-1],t),_=E.key,s=E.namespaces,T=s[s.length-1],S=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(S&&"cimode"===S.toLowerCase()){if(l){var I=t.nsSeparator||this.options.nsSeparator;return r?(d.res="".concat(T).concat(I).concat(_),d):"".concat(T).concat(I).concat(_)}return r?(d.res=_,d):_}var d=this.resolve(e,t),A=d&&d.res,c=d&&d.usedKey||_,O=d&&d.exactUsedKey||_,R=Object.prototype.toString.apply(A),N=["[object Number]","[object Function]","[object RegExp]"],m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,p=!this.i18nFormat||this.i18nFormat.handleAsObject,L="string"!=typeof A&&"boolean"!=typeof A&&"number"!=typeof A;if(p&&A&&L&&N.indexOf(R)<0&&("string"!=typeof m||"[object Array]"!==R)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var h=this.options.returnedObjectHandler?this.options.returnedObjectHandler(c,A,j(j({},t),{},{ns:s})):"key '".concat(_," (").concat(this.language,")' returned an object instead of string.");return r?(d.res=h,d):h}if(n){var D="[object Array]"===R,f=D?[]:{},C=D?O:c;for(var g in A)if(Object.prototype.hasOwnProperty.call(A,g)){var B="".concat(C).concat(n).concat(g);f[g]=this.translate(B,j(j({},t),{joinArrays:!1,ns:s})),f[g]===B&&(f[g]=A[g])}A=f}}else if(p&&"string"==typeof m&&"[object Array]"===R)(A=A.join(m))&&(A=this.extendTranslation(A,e,t,a));else{var P=!1,v=!1,y=void 0!==t.count&&"string"!=typeof t.count,M=o.hasDefaultValue(t),W=y?this.pluralResolver.getSuffix(S,t.count,t):"",b=t["defaultValue".concat(W)]||t.defaultValue;!this.isValidLookup(A)&&M&&(P=!0,A=b),this.isValidLookup(A)||(v=!0,A=_);var U=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,G=U&&v?void 0:A,k=M&&b!==A&&this.options.updateMissing;if(v||P||k){if(this.logger.log(k?"updateKey":"missingKey",S,T,_,k?b:A),n){var F=this.resolve(_,j(j({},t),{},{keySeparator:!1}));F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var w=[],V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&V&&V[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!n.isValidLookup(t)){var _=n.extractFromKey(e,E),s=_.key;o=s;var T=_.namespaces;n.options.fallbackNS&&(T=T.concat(n.options.fallbackNS));var S=void 0!==E.count&&"string"!=typeof E.count,l=S&&!E.ordinal&&0===E.count&&n.pluralResolver.shouldUseIntlApi(),u=void 0!==E.context&&("string"==typeof E.context||"number"==typeof E.context)&&""!==E.context,I=E.lngs?E.lngs:n.languageUtils.toResolveHierarchy(E.lng||n.language,E.fallbackLng);T.forEach((function(e){n.isValidLookup(t)||(r=e,!X["".concat(I[0],"-").concat(e)]&&n.utils&&n.utils.hasLoadedNamespace&&!n.utils.hasLoadedNamespace(r)&&(X["".concat(I[0],"-").concat(e)]=!0,n.logger.warn('key "'.concat(o,'" for languages "').concat(I.join(", "),'" won\'t get resolved as namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),I.forEach((function(o){if(!n.isValidLookup(t)){i=o;var r,_=[s];if(n.i18nFormat&&n.i18nFormat.addLookupKeys)n.i18nFormat.addLookupKeys(_,s,o,e,E);else{var T;S&&(T=n.pluralResolver.getSuffix(o,E.count,E));var I="".concat(n.options.pluralSeparator,"zero");if(S&&(_.push(s+T),l&&_.push(s+I)),u){var d="".concat(s).concat(n.options.contextSeparator).concat(E.context);_.push(d),S&&(_.push(d+T),l&&_.push(d+I))}}for(;r=_.pop();)n.isValidLookup(t)||(a=r,t=n.getResource(o,e,r,E))}})))}))}})),{res:t,usedKey:o,exactUsedKey:a,usedLng:i,usedNS:r}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,o,a):this.resourceStore.getResource(e,t,o,a)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,t.length)&&void 0!==e[o])return!0;return!1}}]),o})(f);function q(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=(function(){function e(t){I.default(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=D.create("languageUtils")}return d.default(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],o=e.split("-");return this.options.lowerCaseLng?o=o.map((function(e){return e.toLowerCase()})):2===o.length?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=q(o[1].toLowerCase()))):3===o.length&&(o[0]=o[0].toLowerCase(),2===o[1].length&&(o[1]=o[1].toUpperCase()),"sgn"!==o[0]&&2===o[2].length&&(o[2]=o[2].toUpperCase()),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=q(o[1].toLowerCase())),t.indexOf(o[2].toLowerCase())>-1&&(o[2]=q(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,o=this;return e?(e.forEach((function(e){if(!t){var a=o.formatLanguageCode(e);o.options.supportedLngs&&!o.isSupportedCode(a)||(t=a)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var a=o.getLanguagePartFromCode(e);if(o.isSupportedCode(a))return t=a;t=o.options.supportedLngs.find((function(e){if(0===e.indexOf(a))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}},{key:"toResolveHierarchy",value:function(e,t){var o=this,a=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=function(e){e&&(o.isSupportedCode(e)?i.push(e):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),a.forEach((function(e){i.indexOf(e)<0&&r(o.formatLanguageCode(e))})),i}}]),e})(),Z=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ee={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},te=["v1","v2","v3"],oe={zero:0,one:1,two:2,few:3,many:4,other:5};function ae(){var e={};return Z.forEach((function(t){t.lngs.forEach((function(o){e[o]={numbers:t.nr,plurals:ee[t.fc]}}))})),e}var ie=(function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};I.default(this,e),this.languageUtils=t,this.options=o,this.logger=D.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=ae()}return d.default(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,t);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,o).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.getRule(e,o);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort((function(e,t){return oe[e]-oe[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):a.numbers.map((function(a){return t.getSuffix(e,a,o)})):[]}},{key:"getSuffix",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.getRule(e,o);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(t)):this.getSuffixRetroCompatible(a,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var o=this,a=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[a];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var r=function(){return o.options.prepend&&i.toString()?o.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):r():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?r():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!te.includes(this.options.compatibilityJSON)}}]),e})();function re(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function ne(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};I.default(this,e),this.logger=D.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return d.default(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:G,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?b(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?b(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?b(t.nestingPrefix):t.nestingPrefixEscaped||b("$t("),this.nestingSuffix=t.nestingSuffix?b(t.nestingSuffix):t.nestingSuffixEscaped||b(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(e,t,o,a){var i,r,n,E=this,_=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function s(e){return e.replace(/\$/g,"$$$$")}var T=function(e){if(e.indexOf(E.formatSeparator)<0){var i=M(t,_,e);return E.alwaysFormat?E.format(i,void 0,o,ne(ne(ne({},a),t),{},{interpolationkey:e})):i}var r=e.split(E.formatSeparator),n=r.shift().trim(),s=r.join(E.formatSeparator).trim();return E.format(M(t,_,n),s,o,ne(ne(ne({},a),t),{},{interpolationkey:n}))};this.resetRegExp();var S=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,l=a&&a.interpolation&&void 0!==a.interpolation.skipOnVariables?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return s(e)}},{regex:this.regexp,safeValue:function(e){return E.escapeValue?s(E.escape(e)):s(e)}}].forEach((function(t){for(n=0;i=t.regex.exec(e);){var o=i[1].trim();if(void 0===(r=T(o)))if("function"==typeof S){var _=S(e,i,a);r="string"==typeof _?_:""}else if(a&&a.hasOwnProperty(o))r="";else{if(l){r=i[0];continue}E.logger.warn("missed to pass in variable ".concat(o," for interpolating ").concat(e)),r=""}else"string"==typeof r||E.useRawValueToEscape||(r=g(r));var s=t.safeValue(r);if(e=e.replace(i[0],s),l?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++n>=E.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var o,a,i,r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function E(e,t){var o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;var a=e.split(new RegExp("".concat(o,"[ ]*{"))),r="{".concat(a[1]);e=a[0];var n=(r=this.interpolate(r,i)).match(/'/g),E=r.match(/"/g);(n&&n.length%2==0&&!E||E.length%2!=0)&&(r=r.replace(/'/g,'"'));try{i=JSON.parse(r),t&&(i=ne(ne({},t),i))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(o).concat(r)}return delete i.defaultValue,e}for(;o=this.nestingRegexp.exec(e);){var _=[];(i=ne({},n)).applyPostProcessor=!1,delete i.defaultValue;var s=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){var T=o[1].split(this.formatSeparator).map((function(e){return e.trim()}));o[1]=T.shift(),_=T,s=!0}if((a=t(E.call(this,o[1].trim(),i),i))&&o[0]===e&&"string"!=typeof a)return a;"string"!=typeof a&&(a=g(a)),a||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),a=""),s&&(a=_.reduce((function(e,t){return r.format(e,t,n.lng,ne(ne({},n),{},{interpolationkey:o[1].trim()}))}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}]),e})();function _e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function se(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};I.default(this,e),this.logger=D.create("formatter"),this.options=t,this.formats={number:Te((function(e,t){var o=new Intl.NumberFormat(e,t);return function(e){return o.format(e)}})),currency:Te((function(e,t){var o=new Intl.NumberFormat(e,se(se({},t),{},{style:"currency"}));return function(e){return o.format(e)}})),datetime:Te((function(e,t){var o=new Intl.DateTimeFormat(e,se({},t));return function(e){return o.format(e)}})),relativetime:Te((function(e,t){var o=new Intl.RelativeTimeFormat(e,se({},t));return function(e){return o.format(e,t.range||"day")}})),list:Te((function(e,t){var o=new Intl.ListFormat(e,se({},t));return function(e){return o.format(e)}}))},this.init(t)}return d.default(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},o=t.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Te(t)}},{key:"format",value:function(e,t,o,a){var i=this;return t.split(this.formatSeparator).reduce((function(e,t){var r=(function(e){var t=e.toLowerCase().trim(),o={};if(e.indexOf("(")>-1){var a=e.split("(");t=a[0].toLowerCase().trim();var i=a[1].substring(0,a[1].length-1);"currency"===t&&i.indexOf(":")<0?o.currency||(o.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?o.range||(o.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=e.split(":"),a=m.default(t),i=a[0],r=a.slice(1).join(":").trim().replace(/^'+|'+$/g,"");o[i.trim()]||(o[i.trim()]=r),"false"===r&&(o[i.trim()]=!1),"true"===r&&(o[i.trim()]=!0),isNaN(r)||(o[i.trim()]=parseInt(r,10))}}))}return{formatName:t,formatOptions:o}})(t),n=r.formatName,E=r.formatOptions;if(i.formats[n]){var _=e;try{var s=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},T=s.locale||s.lng||a.locale||a.lng||o;_=i.formats[n](e,T,se(se(se({},E),a),s))}catch(e){i.logger.warn(e)}return _}return i.logger.warn("there was no format function for ".concat(n)),e}),e)}}]),e})();function le(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function ue(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return I.default(this,o),r=t.call(this),k&&f.call(A.default(r)),r.backend=e,r.store=a,r.services=i,r.languageUtils=i.languageUtils,r.options=n,r.logger=D.create("backendConnector"),r.waitingReads=[],r.maxParallelReads=n.maxParallelReads||10,r.readingCalls=0,r.maxRetries=n.maxRetries>=0?n.maxRetries:5,r.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(i,n.backend,n),r}return d.default(o,[{key:"queueLoad",value:function(e,t,o,a){var i=this,r={},n={},E={},_={};return e.forEach((function(e){var a=!0;t.forEach((function(t){var E="".concat(e,"|").concat(t);!o.reload&&i.store.hasResourceBundle(e,t)?i.state[E]=2:i.state[E]<0||(1===i.state[E]?void 0===n[E]&&(n[E]=!0):(i.state[E]=1,a=!1,void 0===n[E]&&(n[E]=!0),void 0===r[E]&&(r[E]=!0),void 0===_[t]&&(_[t]=!0)))})),a||(E[e]=!0)})),(Object.keys(r).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(r),pending:Object.keys(n),toLoadLanguages:Object.keys(E),toLoadNamespaces:Object.keys(_)}}},{key:"loaded",value:function(e,t,o){var a=e.split("|"),i=a[0],r=a[1];t&&this.emit("failedLoading",i,r,t),o&&this.store.addResourceBundle(i,r,o),this.state[e]=t?-1:2;var n={};this.queue.forEach((function(o){var a,E,_,s,T,S;a=o.loaded,E=r,s=P(a,[i],Object),T=s.obj,S=s.k,T[S]=T[S]||[],_&&(T[S]=T[S].concat(E)),_||T[S].push(E),(function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach((function(e){n[e]||(n[e]={});var t=o.loaded[e];t.length&&t.forEach((function(t){void 0===n[e][t]&&(n[e][t]=!0)}))})),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())})),this.emit("loaded",n),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,o){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,n=arguments.length>5?arguments[5]:void 0;if(!e.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:o,tried:i,wait:r,callback:n});else{this.readingCalls++;var E=function(E,_){if(a.readingCalls--,a.waitingReads.length>0){var s=a.waitingReads.shift();a.read(s.lng,s.ns,s.fcName,s.tried,s.wait,s.callback)}E&&_&&i2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,a,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach((function(e){o.loadOne(e)}))}},{key:"load",value:function(e,t,o){this.prepareLoading(e,t,{},o)}},{key:"reload",value:function(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}},{key:"loadOne",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=e.split("|"),i=a[0],r=a[1];this.read(i,r,"read",void 0,void 0,(function(a,n){a&&t.logger.warn("".concat(o,"loading namespace ").concat(r," for language ").concat(i," failed"),a),!a&&n&&t.logger.log("".concat(o,"loaded namespace ").concat(r," for language ").concat(i),n),t.loaded(e,a,n)}))}},{key:"saveMissing",value:function(e,t,o,a,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=o&&""!==o){if(this.backend&&this.backend.create){var E=ue(ue({},r),{},{isUpdate:i}),_=this.backend.create.bind(this.backend);if(_.length<6)try{var s;(s=5===_.length?_(e,t,o,a,E):_(e,t,o,a))&&"function"==typeof s.then?s.then((function(e){return n(null,e)})).catch(n):n(null,s)}catch(e){n(e)}else _(e,t,o,a,n,E)}e&&e[0]&&this.store.addResource(e[0],t,o,a)}}}]),o})(f);function Ae(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===u.default(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===u.default(e[2])||"object"===u.default(e[3])){var o=e[3]||e[2];Object.keys(o).forEach((function(e){t[e]=o[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,o,a){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ce(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Oe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function Re(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(I.default(this,o),e=t.call(this),k&&f.call(A.default(e)),e.options=ce(a),e.services={},e.logger=D,e.modules={external:[]},pe(A.default(e)),i&&!e.isInitialized&&!a.isClone){if(!e.options.initImmediate)return e.init(a,i),O.default(e,A.default(e));setTimeout((function(){e.init(a,i)}),0)}return e}return d.default(o,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(o=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var a=Ae();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Re(Re(Re({},a),this.options),ce(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Re(Re({},a.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var r;this.modules.logger?D.init(i(this.modules.logger),this.options):D.init(null,this.options),this.modules.formatter?r=this.modules.formatter:"undefined"!=typeof Intl&&(r=Se);var n=new J(this.options);this.store=new z(this.options.resources,this.options);var E=this.services;E.logger=D,E.resourceStore=this.store,E.languageUtils=n,E.pluralResolver=new ie(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!r||this.options.interpolation.format&&this.options.interpolation.format!==a.interpolation.format||(E.formatter=i(r),E.formatter.init(E,this.options),this.options.interpolation.format=E.formatter.format.bind(E.formatter)),E.interpolator=new Ee(this.options),E.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},E.backendConnector=new de(i(this.modules.backend),E.resourceStore,E,this.options),E.backendConnector.on("*",(function(t){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i1?o-1:0),i=1;i0&&"dev"!==_[0]&&(this.options.lng=_[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var s=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];s.forEach((function(t){e[t]=function(){var o;return(o=e.store)[t].apply(o,arguments)}}));var T=["addResource","addResources","addResourceBundle","removeResourceBundle"];T.forEach((function(t){e[t]=function(){var o;return(o=e.store)[t].apply(o,arguments),e}}));var S=C(),l=function(){var t=function(t,a){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),S.resolve(a),o(t,a)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),S}},{key:"loadResources",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me,a=o,i="string"==typeof e?e:this.language;if("function"==typeof e&&(a=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return a();var r=[],n=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};if(i)n(i);else{var E=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);E.forEach((function(e){return n(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return n(e)})),this.services.backendConnector.load(r,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),a(e)}))}else a(null)}},{key:"reloadResources",value:function(e,t,o){var a=C();return e||(e=this.languages),t||(t=this.options.ns),o||(o=me),this.services.backendConnector.reload(e,t,(function(e){a.resolve(),o(e)})),a}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&K.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(e,t){var o=this;this.isLanguageChangingTo=e;var a=C();this.emit("languageChanging",e);var i=function(e){o.language=e,o.languages=o.services.languageUtils.toResolveHierarchy(e),o.resolvedLanguage=void 0,o.setResolvedLanguage(e)},r=function(r){e||r||!o.services.languageDetector||(r=[]);var n="string"==typeof r?r:o.services.languageUtils.getBestMatchFromCodes(r);n&&(o.language||i(n),o.translator.language||o.translator.changeLanguage(n),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage&&o.services.languageDetector.cacheUserLanguage(n)),o.loadResources(n,(function(e){!(function(e,r){r?(i(r),o.translator.changeLanguage(r),o.isLanguageChangingTo=void 0,o.emit("languageChanged",r),o.logger.log("languageChanged",r)):o.isLanguageChangingTo=void 0,a.resolve((function(){return o.t.apply(o,arguments)})),t&&t(e,(function(){return o.t.apply(o,arguments)}))})(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),a}},{key:"getFixedT",value:function(e,t,o){var a=this,i=function e(t,i){var r;if("object"!==u.default(i)){for(var n=arguments.length,E=new Array(n>2?n-2:0),_=2;_1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===a.toLowerCase())return!0;var n=function(e,o){var a=t.services.backendConnector.state["".concat(e,"|").concat(o)];return-1===a||2===a};if(o.precheck){var E=o.precheck(this,n);if(void 0!==E)return E}return!!this.hasResourceBundle(a,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!n(a,e)||i&&!n(r,e)))}},{key:"loadNamespaces",value:function(e,t){var o=this,a=C();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){o.options.ns.indexOf(e)<0&&o.options.ns.push(e)})),this.loadResources((function(e){a.resolve(),t&&t(e)})),a):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var o=C();"string"==typeof e&&(e=[e]);var a=this.options.preload||[],i=e.filter((function(e){return a.indexOf(e)<0}));return i.length?(this.options.preload=a.concat(i),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new J(Ae());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me,i=Re(Re(Re({},this.options),t),{isClone:!0}),r=new o(i);void 0===t.debug&&void 0===t.prefix||(r.logger=r.logger.clone(t));var n=["store","services","language"];return n.forEach((function(t){r[t]=e[t]})),r.services=Re({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r.translator=new $(r.services,r.options),r.translator.on("*",(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Le(e,t)}));var he=Le.createInstance();he.createInstance=Le.createInstance,e.exports=he},80645:(e,t)=>{t.read=function(e,t,o,a,i){var r,n,E=8*i-a-1,_=(1<>1,T=-7,S=o?i-1:0,l=o?-1:1,u=e[t+S];for(S+=l,r=u&(1<<-T)-1,u>>=-T,T+=E;T>0;r=256*r+e[t+S],S+=l,T-=8);for(n=r&(1<<-T)-1,r>>=-T,T+=a;T>0;n=256*n+e[t+S],S+=l,T-=8);if(0===r)r=1-s;else{if(r===_)return n?NaN:1/0*(u?-1:1);n+=Math.pow(2,a),r-=s}return(u?-1:1)*n*Math.pow(2,r-a)},t.write=function(e,t,o,a,i,r){var n,E,_,s=8*r-i-1,T=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,u=a?0:r-1,I=a?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(E=isNaN(t)?1:0,n=T):(n=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-n))<1&&(n--,_*=2),(t+=n+S>=1?l/_:l*Math.pow(2,1-S))*_>=2&&(n++,_/=2),n+S>=T?(E=0,n=T):n+S>=1?(E=(t*_-1)*Math.pow(2,i),n+=S):(E=t*Math.pow(2,S-1)*Math.pow(2,i),n=0));i>=8;e[o+u]=255&E,u+=I,E/=256,i-=8);for(n=n<0;e[o+u]=255&n,u+=I,n/=256,s-=8);e[o+u-I]|=128*d}},85457:e=>{e.exports=[{name:"Abkhaz",local:"Аҧсуа",1:"ab",2:"abk","2T":"abk","2B":"abk",3:"abk"},{name:"Afar",local:"Afaraf",1:"aa",2:"aar","2T":"aar","2B":"aar",3:"aar"},{name:"Afrikaans",local:"Afrikaans",1:"af",2:"afr","2T":"afr","2B":"afr",3:"afr"},{name:"Akan",local:"Akan",1:"ak",2:"aka","2T":"aka","2B":"aka",3:"aka"},{name:"Albanian",local:"Shqip",1:"sq",2:"sqi","2T":"sqi","2B":"alb",3:"sqi"},{name:"Amharic",local:"አማርኛ",1:"am",2:"amh","2T":"amh","2B":"amh",3:"amh"},{name:"Arabic",local:"العربية",1:"ar",2:"ara","2T":"ara","2B":"ara",3:"ara"},{name:"Aragonese",local:"Aragonés",1:"an",2:"arg","2T":"arg","2B":"arg",3:"arg"},{name:"Armenian",local:"Հայերեն",1:"hy",2:"hye","2T":"hye","2B":"arm",3:"hye"},{name:"Assamese",local:"অসমীয়া",1:"as",2:"asm","2T":"asm","2B":"asm",3:"asm"},{name:"Avaric",local:"Авар",1:"av",2:"ava","2T":"ava","2B":"ava",3:"ava"},{name:"Avestan",local:"avesta",1:"ae",2:"ave","2T":"ave","2B":"ave",3:"ave"},{name:"Aymara",local:"Aymar",1:"ay",2:"aym","2T":"aym","2B":"aym",3:"aym"},{name:"Azerbaijani",local:"Azərbaycanca",1:"az",2:"aze","2T":"aze","2B":"aze",3:"aze"},{name:"Bambara",local:"Bamanankan",1:"bm",2:"bam","2T":"bam","2B":"bam",3:"bam"},{name:"Bashkir",local:"Башҡортса",1:"ba",2:"bak","2T":"bak","2B":"bak",3:"bak"},{name:"Basque",local:"Euskara",1:"eu",2:"eus","2T":"eus","2B":"baq",3:"eus"},{name:"Belarusian",local:"Беларуская",1:"be",2:"bel","2T":"bel","2B":"bel",3:"bel"},{name:"Bengali",local:"বাংলা",1:"bn",2:"ben","2T":"ben","2B":"ben",3:"ben"},{name:"Bihari",local:"भोजपुरी",1:"bh",2:"bih","2T":"bih","2B":"bih",3:"bih"},{name:"Bislama",local:"Bislama",1:"bi",2:"bis","2T":"bis","2B":"bis",3:"bis"},{name:"Bosnian",local:"Bosanski",1:"bs",2:"bos","2T":"bos","2B":"bos",3:"bos"},{name:"Breton",local:"Brezhoneg",1:"br",2:"bre","2T":"bre","2B":"bre",3:"bre"},{name:"Bulgarian",local:"Български",1:"bg",2:"bul","2T":"bul","2B":"bul",3:"bul"},{name:"Burmese",local:"မြန်မာဘာသာ",1:"my",2:"mya","2T":"mya","2B":"bur",3:"mya"},{name:"Catalan",local:"Català",1:"ca",2:"cat","2T":"cat","2B":"cat",3:"cat"},{name:"Chamorro",local:"Chamoru",1:"ch",2:"cha","2T":"cha","2B":"cha",3:"cha"},{name:"Chechen",local:"Нохчийн",1:"ce",2:"che","2T":"che","2B":"che",3:"che"},{name:"Chichewa",local:"Chichewa",1:"ny",2:"nya","2T":"nya","2B":"nya",3:"nya"},{name:"Chinese",local:"中文",1:"zh",2:"zho","2T":"zho","2B":"chi",3:"zho"},{name:"Chuvash",local:"Чӑвашла",1:"cv",2:"chv","2T":"chv","2B":"chv",3:"chv"},{name:"Cornish",local:"Kernewek",1:"kw",2:"cor","2T":"cor","2B":"cor",3:"cor"},{name:"Corsican",local:"Corsu",1:"co",2:"cos","2T":"cos","2B":"cos",3:"cos"},{name:"Cree",local:"ᓀᐦᐃᔭᐍᐏᐣ",1:"cr",2:"cre","2T":"cre","2B":"cre",3:"cre"},{name:"Croatian",local:"Hrvatski",1:"hr",2:"hrv","2T":"hrv","2B":"hrv",3:"hrv"},{name:"Czech",local:"Čeština",1:"cs",2:"ces","2T":"ces","2B":"cze",3:"ces"},{name:"Danish",local:"Dansk",1:"da",2:"dan","2T":"dan","2B":"dan",3:"dan"},{name:"Divehi",local:"Divehi",1:"dv",2:"div","2T":"div","2B":"div",3:"div"},{name:"Dutch",local:"Nederlands",1:"nl",2:"nld","2T":"nld","2B":"dut",3:"nld"},{name:"Dzongkha",local:"རྫོང་ཁ",1:"dz",2:"dzo","2T":"dzo","2B":"dzo",3:"dzo"},{name:"English",local:"English",1:"en",2:"eng","2T":"eng","2B":"eng",3:"eng"},{name:"Esperanto",local:"Esperanto",1:"eo",2:"epo","2T":"epo","2B":"epo",3:"epo"},{name:"Estonian",local:"Eesti",1:"et",2:"est","2T":"est","2B":"est",3:"est"},{name:"Ewe",local:"Eʋegbe",1:"ee",2:"ewe","2T":"ewe","2B":"ewe",3:"ewe"},{name:"Faroese",local:"Føroyskt",1:"fo",2:"fao","2T":"fao","2B":"fao",3:"fao"},{name:"Fijian",local:"Na Vosa Vaka-Viti",1:"fj",2:"fij","2T":"fij","2B":"fij",3:"fij"},{name:"Finnish",local:"Suomi",1:"fi",2:"fin","2T":"fin","2B":"fin",3:"fin"},{name:"French",local:"Français",1:"fr",2:"fra","2T":"fra","2B":"fre",3:"fra"},{name:"Fula",local:"Fulfulde",1:"ff",2:"ful","2T":"ful","2B":"ful",3:"ful"},{name:"Galician",local:"Galego",1:"gl",2:"glg","2T":"glg","2B":"glg",3:"glg"},{name:"Georgian",local:"ქართული",1:"ka",2:"kat","2T":"kat","2B":"geo",3:"kat"},{name:"German",local:"Deutsch",1:"de",2:"deu","2T":"deu","2B":"ger",3:"deu"},{name:"Greek",local:"Ελληνικά",1:"el",2:"ell","2T":"ell","2B":"gre",3:"ell"},{name:"Guaraní",local:"Avañe'ẽ",1:"gn",2:"grn","2T":"grn","2B":"grn",3:"grn"},{name:"Gujarati",local:"ગુજરાતી",1:"gu",2:"guj","2T":"guj","2B":"guj",3:"guj"},{name:"Haitian",local:"Kreyòl Ayisyen",1:"ht",2:"hat","2T":"hat","2B":"hat",3:"hat"},{name:"Hausa",local:"هَوُسَ",1:"ha",2:"hau","2T":"hau","2B":"hau",3:"hau"},{name:"Hebrew",local:"עברית",1:"he",2:"heb","2T":"heb","2B":"heb",3:"heb"},{name:"Herero",local:"Otjiherero",1:"hz",2:"her","2T":"her","2B":"her",3:"her"},{name:"Hindi",local:"हिन्दी",1:"hi",2:"hin","2T":"hin","2B":"hin",3:"hin"},{name:"Hiri Motu",local:"Hiri Motu",1:"ho",2:"hmo","2T":"hmo","2B":"hmo",3:"hmo"},{name:"Hungarian",local:"Magyar",1:"hu",2:"hun","2T":"hun","2B":"hun",3:"hun"},{name:"Interlingua",local:"Interlingua",1:"ia",2:"ina","2T":"ina","2B":"ina",3:"ina"},{name:"Indonesian",local:"Bahasa Indonesia",1:"id",2:"ind","2T":"ind","2B":"ind",3:"ind"},{name:"Interlingue",local:"Interlingue",1:"ie",2:"ile","2T":"ile","2B":"ile",3:"ile"},{name:"Irish",local:"Gaeilge",1:"ga",2:"gle","2T":"gle","2B":"gle",3:"gle"},{name:"Igbo",local:"Igbo",1:"ig",2:"ibo","2T":"ibo","2B":"ibo",3:"ibo"},{name:"Inupiaq",local:"Iñupiak",1:"ik",2:"ipk","2T":"ipk","2B":"ipk",3:"ipk"},{name:"Ido",local:"Ido",1:"io",2:"ido","2T":"ido","2B":"ido",3:"ido"},{name:"Icelandic",local:"Íslenska",1:"is",2:"isl","2T":"isl","2B":"ice",3:"isl"},{name:"Italian",local:"Italiano",1:"it",2:"ita","2T":"ita","2B":"ita",3:"ita"},{name:"Inuktitut",local:"ᐃᓄᒃᑎᑐᑦ",1:"iu",2:"iku","2T":"iku","2B":"iku",3:"iku"},{name:"Japanese",local:"日本語",1:"ja",2:"jpn","2T":"jpn","2B":"jpn",3:"jpn"},{name:"Javanese",local:"Basa Jawa",1:"jv",2:"jav","2T":"jav","2B":"jav",3:"jav"},{name:"Kalaallisut",local:"Kalaallisut",1:"kl",2:"kal","2T":"kal","2B":"kal",3:"kal"},{name:"Kannada",local:"ಕನ್ನಡ",1:"kn",2:"kan","2T":"kan","2B":"kan",3:"kan"},{name:"Kanuri",local:"Kanuri",1:"kr",2:"kau","2T":"kau","2B":"kau",3:"kau"},{name:"Kashmiri",local:"كشميري",1:"ks",2:"kas","2T":"kas","2B":"kas",3:"kas"},{name:"Kazakh",local:"Қазақша",1:"kk",2:"kaz","2T":"kaz","2B":"kaz",3:"kaz"},{name:"Khmer",local:"ភាសាខ្មែរ",1:"km",2:"khm","2T":"khm","2B":"khm",3:"khm"},{name:"Kikuyu",local:"Gĩkũyũ",1:"ki",2:"kik","2T":"kik","2B":"kik",3:"kik"},{name:"Kinyarwanda",local:"Kinyarwanda",1:"rw",2:"kin","2T":"kin","2B":"kin",3:"kin"},{name:"Kyrgyz",local:"Кыргызча",1:"ky",2:"kir","2T":"kir","2B":"kir",3:"kir"},{name:"Komi",local:"Коми",1:"kv",2:"kom","2T":"kom","2B":"kom",3:"kom"},{name:"Kongo",local:"Kongo",1:"kg",2:"kon","2T":"kon","2B":"kon",3:"kon"},{name:"Korean",local:"한국어",1:"ko",2:"kor","2T":"kor","2B":"kor",3:"kor"},{name:"Kurdish",local:"Kurdî",1:"ku",2:"kur","2T":"kur","2B":"kur",3:"kur"},{name:"Kwanyama",local:"Kuanyama",1:"kj",2:"kua","2T":"kua","2B":"kua",3:"kua"},{name:"Latin",local:"Latina",1:"la",2:"lat","2T":"lat","2B":"lat",3:"lat"},{name:"Luxembourgish",local:"Lëtzebuergesch",1:"lb",2:"ltz","2T":"ltz","2B":"ltz",3:"ltz"},{name:"Ganda",local:"Luganda",1:"lg",2:"lug","2T":"lug","2B":"lug",3:"lug"},{name:"Limburgish",local:"Limburgs",1:"li",2:"lim","2T":"lim","2B":"lim",3:"lim"},{name:"Lingala",local:"Lingála",1:"ln",2:"lin","2T":"lin","2B":"lin",3:"lin"},{name:"Lao",local:"ພາສາລາວ",1:"lo",2:"lao","2T":"lao","2B":"lao",3:"lao"},{name:"Lithuanian",local:"Lietuvių",1:"lt",2:"lit","2T":"lit","2B":"lit",3:"lit"},{name:"Luba-Katanga",local:"Tshiluba",1:"lu",2:"lub","2T":"lub","2B":"lub",3:"lub"},{name:"Latvian",local:"Latviešu",1:"lv",2:"lav","2T":"lav","2B":"lav",3:"lav"},{name:"Manx",local:"Gaelg",1:"gv",2:"glv","2T":"glv","2B":"glv",3:"glv"},{name:"Macedonian",local:"Македонски",1:"mk",2:"mkd","2T":"mkd","2B":"mac",3:"mkd"},{name:"Malagasy",local:"Malagasy",1:"mg",2:"mlg","2T":"mlg","2B":"mlg",3:"mlg"},{name:"Malay",local:"Bahasa Melayu",1:"ms",2:"msa","2T":"msa","2B":"may",3:"msa"},{name:"Malayalam",local:"മലയാളം",1:"ml",2:"mal","2T":"mal","2B":"mal",3:"mal"},{name:"Maltese",local:"Malti",1:"mt",2:"mlt","2T":"mlt","2B":"mlt",3:"mlt"},{name:"Māori",local:"Māori",1:"mi",2:"mri","2T":"mri","2B":"mao",3:"mri"},{name:"Marathi",local:"मराठी",1:"mr",2:"mar","2T":"mar","2B":"mar",3:"mar"},{name:"Marshallese",local:"Kajin M̧ajeļ",1:"mh",2:"mah","2T":"mah","2B":"mah",3:"mah"},{name:"Mongolian",local:"Монгол",1:"mn",2:"mon","2T":"mon","2B":"mon",3:"mon"},{name:"Nauru",local:"Dorerin Naoero",1:"na",2:"nau","2T":"nau","2B":"nau",3:"nau"},{name:"Navajo",local:"Diné Bizaad",1:"nv",2:"nav","2T":"nav","2B":"nav",3:"nav"},{name:"Northern Ndebele",local:"isiNdebele",1:"nd",2:"nde","2T":"nde","2B":"nde",3:"nde"},{name:"Nepali",local:"नेपाली",1:"ne",2:"nep","2T":"nep","2B":"nep",3:"nep"},{name:"Ndonga",local:"Owambo",1:"ng",2:"ndo","2T":"ndo","2B":"ndo",3:"ndo"},{name:"Norwegian Bokmål",local:"Norsk (Bokmål)",1:"nb",2:"nob","2T":"nob","2B":"nob",3:"nob"},{name:"Norwegian Nynorsk",local:"Norsk (Nynorsk)",1:"nn",2:"nno","2T":"nno","2B":"nno",3:"nno"},{name:"Norwegian",local:"Norsk",1:"no",2:"nor","2T":"nor","2B":"nor",3:"nor"},{name:"Nuosu",local:"ꆈꌠ꒿ Nuosuhxop",1:"ii",2:"iii","2T":"iii","2B":"iii",3:"iii"},{name:"Southern Ndebele",local:"isiNdebele",1:"nr",2:"nbl","2T":"nbl","2B":"nbl",3:"nbl"},{name:"Occitan",local:"Occitan",1:"oc",2:"oci","2T":"oci","2B":"oci",3:"oci"},{name:"Ojibwe",local:"ᐊᓂᔑᓈᐯᒧᐎᓐ",1:"oj",2:"oji","2T":"oji","2B":"oji",3:"oji"},{name:"Old Church Slavonic",local:"Словѣ́ньскъ",1:"cu",2:"chu","2T":"chu","2B":"chu",3:"chu"},{name:"Oromo",local:"Afaan Oromoo",1:"om",2:"orm","2T":"orm","2B":"orm",3:"orm"},{name:"Oriya",local:"ଓଡି଼ଆ",1:"or",2:"ori","2T":"ori","2B":"ori",3:"ori"},{name:"Ossetian",local:"Ирон æвзаг",1:"os",2:"oss","2T":"oss","2B":"oss",3:"oss"},{name:"Panjabi",local:"ਪੰਜਾਬੀ",1:"pa",2:"pan","2T":"pan","2B":"pan",3:"pan"},{name:"Pāli",local:"पाऴि",1:"pi",2:"pli","2T":"pli","2B":"pli",3:"pli"},{name:"Persian",local:"فارسی",1:"fa",2:"fas","2T":"fas","2B":"per",3:"fas"},{name:"Polish",local:"Polski",1:"pl",2:"pol","2T":"pol","2B":"pol",3:"pol"},{name:"Pashto",local:"پښتو",1:"ps",2:"pus","2T":"pus","2B":"pus",3:"pus"},{name:"Portuguese",local:"Português",1:"pt",2:"por","2T":"por","2B":"por",3:"por"},{name:"Quechua",local:"Runa Simi",1:"qu",2:"que","2T":"que","2B":"que",3:"que"},{name:"Romansh",local:"Rumantsch",1:"rm",2:"roh","2T":"roh","2B":"roh",3:"roh"},{name:"Kirundi",local:"Kirundi",1:"rn",2:"run","2T":"run","2B":"run",3:"run"},{name:"Romanian",local:"Română",1:"ro",2:"ron","2T":"ron","2B":"rum",3:"ron"},{name:"Russian",local:"Русский",1:"ru",2:"rus","2T":"rus","2B":"rus",3:"rus"},{name:"Sanskrit",local:"संस्कृतम्",1:"sa",2:"san","2T":"san","2B":"san",3:"san"},{name:"Sardinian",local:"Sardu",1:"sc",2:"srd","2T":"srd","2B":"srd",3:"srd"},{name:"Sindhi",local:"سنڌي‎",1:"sd",2:"snd","2T":"snd","2B":"snd",3:"snd"},{name:"Northern Sami",local:"Sámegiella",1:"se",2:"sme","2T":"sme","2B":"sme",3:"sme"},{name:"Samoan",local:"Gagana Sāmoa",1:"sm",2:"smo","2T":"smo","2B":"smo",3:"smo"},{name:"Sango",local:"Sängö",1:"sg",2:"sag","2T":"sag","2B":"sag",3:"sag"},{name:"Serbian",local:"Српски",1:"sr",2:"srp","2T":"srp","2B":"srp",3:"srp"},{name:"Gaelic",local:"Gàidhlig",1:"gd",2:"gla","2T":"gla","2B":"gla",3:"gla"},{name:"Shona",local:"ChiShona",1:"sn",2:"sna","2T":"sna","2B":"sna",3:"sna"},{name:"Sinhala",local:"සිංහල",1:"si",2:"sin","2T":"sin","2B":"sin",3:"sin"},{name:"Slovak",local:"Slovenčina",1:"sk",2:"slk","2T":"slk","2B":"slo",3:"slk"},{name:"Slovene",local:"Slovenščina",1:"sl",2:"slv","2T":"slv","2B":"slv",3:"slv"},{name:"Somali",local:"Soomaaliga",1:"so",2:"som","2T":"som","2B":"som",3:"som"},{name:"Southern Sotho",local:"Sesotho",1:"st",2:"sot","2T":"sot","2B":"sot",3:"sot"},{name:"Spanish",local:"Español",1:"es",2:"spa","2T":"spa","2B":"spa",3:"spa"},{name:"Sundanese",local:"Basa Sunda",1:"su",2:"sun","2T":"sun","2B":"sun",3:"sun"},{name:"Swahili",local:"Kiswahili",1:"sw",2:"swa","2T":"swa","2B":"swa",3:"swa"},{name:"Swati",local:"SiSwati",1:"ss",2:"ssw","2T":"ssw","2B":"ssw",3:"ssw"},{name:"Swedish",local:"Svenska",1:"sv",2:"swe","2T":"swe","2B":"swe",3:"swe"},{name:"Tamil",local:"தமிழ்",1:"ta",2:"tam","2T":"tam","2B":"tam",3:"tam"},{name:"Telugu",local:"తెలుగు",1:"te",2:"tel","2T":"tel","2B":"tel",3:"tel"},{name:"Tajik",local:"Тоҷикӣ",1:"tg",2:"tgk","2T":"tgk","2B":"tgk",3:"tgk"},{name:"Thai",local:"ภาษาไทย",1:"th",2:"tha","2T":"tha","2B":"tha",3:"tha"},{name:"Tigrinya",local:"ትግርኛ",1:"ti",2:"tir","2T":"tir","2B":"tir",3:"tir"},{name:"Tibetan Standard",local:"བོད་ཡིག",1:"bo",2:"bod","2T":"bod","2B":"tib",3:"bod"},{name:"Turkmen",local:"Türkmençe",1:"tk",2:"tuk","2T":"tuk","2B":"tuk",3:"tuk"},{name:"Tagalog",local:"Tagalog",1:"tl",2:"tgl","2T":"tgl","2B":"tgl",3:"tgl"},{name:"Tswana",local:"Setswana",1:"tn",2:"tsn","2T":"tsn","2B":"tsn",3:"tsn"},{name:"Tonga",local:"faka Tonga",1:"to",2:"ton","2T":"ton","2B":"ton",3:"ton"},{name:"Turkish",local:"Türkçe",1:"tr",2:"tur","2T":"tur","2B":"tur",3:"tur"},{name:"Tsonga",local:"Xitsonga",1:"ts",2:"tso","2T":"tso","2B":"tso",3:"tso"},{name:"Tatar",local:"Татарча",1:"tt",2:"tat","2T":"tat","2B":"tat",3:"tat"},{name:"Twi",local:"Twi",1:"tw",2:"twi","2T":"twi","2B":"twi",3:"twi"},{name:"Tahitian",local:"Reo Mā’ohi",1:"ty",2:"tah","2T":"tah","2B":"tah",3:"tah"},{name:"Uyghur",local:"ئۇيغۇرچه",1:"ug",2:"uig","2T":"uig","2B":"uig",3:"uig"},{name:"Ukrainian",local:"Українська",1:"uk",2:"ukr","2T":"ukr","2B":"ukr",3:"ukr"},{name:"Urdu",local:"اردو",1:"ur",2:"urd","2T":"urd","2B":"urd",3:"urd"},{name:"Uzbek",local:"O‘zbek",1:"uz",2:"uzb","2T":"uzb","2B":"uzb",3:"uzb"},{name:"Venda",local:"Tshivenḓa",1:"ve",2:"ven","2T":"ven","2B":"ven",3:"ven"},{name:"Vietnamese",local:"Tiếng Việt",1:"vi",2:"vie","2T":"vie","2B":"vie",3:"vie"},{name:"Volapük",local:"Volapük",1:"vo",2:"vol","2T":"vol","2B":"vol",3:"vol"},{name:"Walloon",local:"Walon",1:"wa",2:"wln","2T":"wln","2B":"wln",3:"wln"},{name:"Welsh",local:"Cymraeg",1:"cy",2:"cym","2T":"cym","2B":"wel",3:"cym"},{name:"Wolof",local:"Wolof",1:"wo",2:"wol","2T":"wol","2B":"wol",3:"wol"},{name:"Western Frisian",local:"Frysk",1:"fy",2:"fry","2T":"fry","2B":"fry",3:"fry"},{name:"Xhosa",local:"isiXhosa",1:"xh",2:"xho","2T":"xho","2B":"xho",3:"xho"},{name:"Yiddish",local:"ייִדיש",1:"yi",2:"yid","2T":"yid","2B":"yid",3:"yid"},{name:"Yoruba",local:"Yorùbá",1:"yo",2:"yor","2T":"yor","2B":"yor",3:"yor"},{name:"Zhuang",local:"Cuengh",1:"za",2:"zha","2T":"zha","2B":"zha",3:"zha"},{name:"Zulu",local:"isiZulu",1:"zu",2:"zul","2T":"zul","2B":"zul",3:"zul"}]},27576:(e,t,o)=>{var a=o(85457),i={all:function(){return a},has:function(e,t){return void 0!==r(e,t)},codes:function(e){if((function(e){return-1!==[1,2,3,"1","2","2B","2T","3"].indexOf(e)})(e))return n(a,(function(t){return t[e]}))},names:function(e){return n(a,(function(t){return e?t.local:t.name}))},where:r};function r(e,t){for(var o=0;o{e=o.nmd(e);var a="__lodash_hash_undefined__",i=9007199254740991,r="[object Arguments]",n="[object Boolean]",E="[object Date]",_="[object Function]",s="[object GeneratorFunction]",T="[object Map]",S="[object Number]",l="[object Object]",u="[object Promise]",I="[object RegExp]",d="[object Set]",A="[object String]",c="[object Symbol]",O="[object WeakMap]",R="[object ArrayBuffer]",N="[object DataView]",m="[object Float32Array]",p="[object Float64Array]",L="[object Int8Array]",h="[object Int16Array]",D="[object Int32Array]",f="[object Uint8Array]",C="[object Uint8ClampedArray]",g="[object Uint16Array]",B="[object Uint32Array]",P=/\w*$/,v=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,M={};M[r]=M["[object Array]"]=M[R]=M[N]=M[n]=M[E]=M[m]=M[p]=M[L]=M[h]=M[D]=M[T]=M[S]=M[l]=M[I]=M[d]=M[A]=M[c]=M[f]=M[C]=M[g]=M[B]=!0,M["[object Error]"]=M[_]=M[O]=!1;var W="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,b="object"==typeof self&&self&&self.Object===Object&&self,U=W||b||Function("return this")(),G=t&&!t.nodeType&&t,k=G&&e&&!e.nodeType&&e,F=k&&k.exports===G;function w(e,t){return e.set(t[0],t[1]),e}function V(e,t){return e.add(t),e}function H(e,t,o,a){var i=-1,r=e?e.length:0;for(a&&r&&(o=e[++i]);++i-1},Ce.prototype.set=function(e,t){var o=this.__data__,a=ye(o,e);return a<0?o.push([e,t]):o[a][1]=t,this},ge.prototype.clear=function(){this.__data__={hash:new fe,map:new(Ie||Ce),string:new fe}},ge.prototype.delete=function(e){return Ge(this,e).delete(e)},ge.prototype.get=function(e){return Ge(this,e).get(e)},ge.prototype.has=function(e){return Ge(this,e).has(e)},ge.prototype.set=function(e,t){return Ge(this,e).set(e,t),this},Be.prototype.clear=function(){this.__data__=new Ce},Be.prototype.delete=function(e){return this.__data__.delete(e)},Be.prototype.get=function(e){return this.__data__.get(e)},Be.prototype.has=function(e){return this.__data__.has(e)},Be.prototype.set=function(e,t){var o=this.__data__;if(o instanceof Ce){var a=o.__data__;if(!Ie||a.length<199)return a.push([e,t]),this;o=this.__data__=new ge(a)}return o.set(e,t),this};var Fe=Te?K(Te,Object):function(){return[]},we=function(e){return te.call(e)};function Ve(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||y.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=i})(e.length)&&!Qe(e)}var je=Se||function(){return!1};function Qe(e){var t=Xe(e)?te.call(e):"";return t==_||t==s}function Xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $e(e){return xe(e)?Pe(e):(function(e){if(!He(e))return le(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t})(e)}e.exports=function(e){return Me(e,!0,!0)}},91296:(e,t,o)=>{var a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,n=/^0o[0-7]+$/i,E=parseInt,_="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,s="object"==typeof self&&self&&self.Object===Object&&self,T=_||s||Function("return this")(),S=Object.prototype.toString,l=Math.max,u=Math.min,I=function(){return T.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function A(e){if("number"==typeof e)return e;if((function(e){return"symbol"==typeof e||(function(e){return!!e&&"object"==typeof e})(e)&&"[object Symbol]"==S.call(e)})(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var o=r.test(e);return o||n.test(e)?E(e.slice(2),o?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,o){var a,i,r,n,E,_,s=0,T=!1,S=!1,c=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function O(t){var o=a,r=i;return a=i=void 0,s=t,n=e.apply(r,o)}function R(e){return s=e,E=setTimeout(m,t),T?O(e):n}function N(e){var o=e-_;return void 0===_||o>=t||o<0||S&&e-s>=r}function m(){var e=I();if(N(e))return p(e);E=setTimeout(m,(function(e){var o=t-(e-_);return S?u(o,r-(e-s)):o})(e))}function p(e){return E=void 0,c&&a?O(e):(a=i=void 0,n)}function L(){var e=I(),o=N(e);if(a=arguments,i=this,_=e,o){if(void 0===E)return R(_);if(S)return E=setTimeout(m,t),O(_)}return void 0===E&&(E=setTimeout(m,t)),n}return t=A(t)||0,d(o)&&(T=!!o.leading,r=(S="maxWait"in o)?l(A(o.maxWait)||0,t):r,c="trailing"in o?!!o.trailing:c),L.cancel=function(){void 0!==E&&clearTimeout(E),s=0,a=_=i=E=void 0},L.flush=function(){return void 0===E?n:p(I())},L}},20394:(e,t,o)=>{var a="__lodash_hash_undefined__",i=9007199254740991,r=/^\[object .+?Constructor\]$/,n="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,E="object"==typeof self&&self&&self.Object===Object&&self,_=n||E||Function("return this")();function s(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}function T(e,t){return!!(e?e.length:0)&&(function(e,t,o){if(t!=t)return(function(e,t,o,a){var i=e.length,r=o+(a?1:-1);for(;a?r--:++r-1}function S(e,t,o){for(var a=-1,i=e?e.length:0;++a-1&&e%1==0&&e<=i})(e.length)&&!Y(e)})(e)})(e)?e:[]}function k(e,t){var o,a,i=e.__data__;return("string"==(a=typeof(o=t))||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==o:null===o)?i["string"==typeof t?"string":"hash"]:i.map}function F(e,t){var o=(function(e,t){return null==e?void 0:e[t]})(e,t);return U(o)?o:void 0}v.prototype.clear=function(){this.__data__=P?P(null):{}},v.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},v.prototype.get=function(e){var t=this.__data__;if(P){var o=t[e];return o===a?void 0:o}return L.call(t,e)?t[e]:void 0},v.prototype.has=function(e){var t=this.__data__;return P?void 0!==t[e]:L.call(t,e)},v.prototype.set=function(e,t){return this.__data__[e]=P&&void 0===t?a:t,this},y.prototype.clear=function(){this.__data__=[]},y.prototype.delete=function(e){var t=this.__data__,o=b(t,e);return!(o<0)&&(o==t.length-1?t.pop():f.call(t,o,1),!0)},y.prototype.get=function(e){var t=this.__data__,o=b(t,e);return o<0?void 0:t[o][1]},y.prototype.has=function(e){return b(this.__data__,e)>-1},y.prototype.set=function(e,t){var o=this.__data__,a=b(o,e);return a<0?o.push([e,t]):o[a][1]=t,this},M.prototype.clear=function(){this.__data__={hash:new v,map:new(B||y),string:new v}},M.prototype.delete=function(e){return k(this,e).delete(e)},M.prototype.get=function(e){return k(this,e).get(e)},M.prototype.has=function(e){return k(this,e).has(e)},M.prototype.set=function(e,t){return k(this,e).set(e,t),this},W.prototype.add=W.prototype.push=function(e){return this.__data__.set(e,a),this},W.prototype.has=function(e){return this.__data__.has(e)};var w,V,H=(w=function(e){var t=l(e,G);return t.length&&t[0]===e[0]?(function(e,t,o){for(var a=o?S:T,i=e[0].length,r=e.length,n=r,E=Array(r),_=1/0,s=[];n--;){var u=e[n];n&&t&&(u=l(u,I(t))),_=g(u.length,_),E[n]=!o&&(t||i>=120&&u.length>=120)?new W(n&&u):void 0}u=e[0];var A=-1,c=E[0];e:for(;++A{e=o.nmd(e);var a="__lodash_hash_undefined__",i=9007199254740991,r="[object Arguments]",n="[object Array]",E="[object Boolean]",_="[object Date]",s="[object Error]",T="[object Function]",S="[object Map]",l="[object Number]",u="[object Object]",I="[object Promise]",d="[object RegExp]",A="[object Set]",c="[object String]",O="[object Symbol]",R="[object WeakMap]",N="[object ArrayBuffer]",m="[object DataView]",p=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[r]=h[n]=h[N]=h[E]=h[m]=h[_]=h[s]=h[T]=h[S]=h[l]=h[u]=h[d]=h[A]=h[c]=h[R]=!1;var D="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,f="object"==typeof self&&self&&self.Object===Object&&self,C=D||f||Function("return this")(),g=t&&!t.nodeType&&t,B=g&&e&&!e.nodeType&&e,P=B&&B.exports===g,v=P&&D.process,y=(function(){try{return v&&v.binding&&v.binding("util")}catch(e){}})(),M=y&&y.isTypedArray;function W(e,t){for(var o=-1,a=null==e?0:e.length;++oE))return!1;var s=r.get(e);if(s&&r.get(t))return s==t;var T=-1,S=!0,l=2&o?new Ne:void 0;for(r.set(e,t),r.set(t,e);++T-1},Oe.prototype.set=function(e,t){var o=this.__data__,a=Le(o,e);return a<0?(++this.size,o.push([e,t])):o[a][1]=t,this},Re.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(re||Oe),string:new ce}},Re.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},Re.prototype.get=function(e){return ve(this,e).get(e)},Re.prototype.has=function(e){return ve(this,e).has(e)},Re.prototype.set=function(e,t){var o=ve(this,e),a=o.size;return o.set(e,t),this.size+=o.size==a?0:1,this},Ne.prototype.add=Ne.prototype.push=function(e){return this.__data__.set(e,a),this},Ne.prototype.has=function(e){return this.__data__.has(e)},me.prototype.clear=function(){this.__data__=new Oe,this.size=0},me.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},me.prototype.get=function(e){return this.__data__.get(e)},me.prototype.has=function(e){return this.__data__.has(e)},me.prototype.set=function(e,t){var o=this.__data__;if(o instanceof Oe){var a=o.__data__;if(!re||a.length<199)return a.push([e,t]),this.size=++o.size,this;o=this.__data__=new Re(a)}return o.set(e,t),this.size=o.size,this};var Me=te?function(e){return null==e?[]:(e=Object(e),(function(e,t){for(var o=-1,a=null==e?0:e.length,i=0,r=[];++o-1&&e%1==0&&e-1&&e%1==0&&e<=i}function Ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ze(e){return null!=e&&"object"==typeof e}var Ke=M?(function(e){return function(t){return e(t)}})(M):function(e){return ze(e)&&He(e.length)&&!!h[he(e)]};function xe(e){return null!=(t=e)&&He(t.length)&&!Ve(t)?pe(e):ge(e);var t}e.exports=function(e,t){return fe(e,t)}},93096:(e,t,o)=>{var a="Expected a function",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,E=/^0o[0-7]+$/i,_=parseInt,s="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,T="object"==typeof self&&self&&self.Object===Object&&self,S=s||T||Function("return this")(),l=Object.prototype.toString,u=Math.max,I=Math.min,d=function(){return S.Date.now()};function A(e,t,o){var i,r,n,E,_,s,T=0,S=!1,l=!1,A=!0;if("function"!=typeof e)throw new TypeError(a);function R(t){var o=i,a=r;return i=r=void 0,T=t,E=e.apply(a,o)}function N(e){return T=e,_=setTimeout(p,t),S?R(e):E}function m(e){var o=e-s;return void 0===s||o>=t||o<0||l&&e-T>=n}function p(){var e=d();if(m(e))return L(e);_=setTimeout(p,(function(e){var o=t-(e-s);return l?I(o,n-(e-T)):o})(e))}function L(e){return _=void 0,A&&i?R(e):(i=r=void 0,E)}function h(){var e=d(),o=m(e);if(i=arguments,r=this,s=e,o){if(void 0===_)return N(s);if(l)return _=setTimeout(p,t),R(s)}return void 0===_&&(_=setTimeout(p,t)),E}return t=O(t)||0,c(o)&&(S=!!o.leading,n=(l="maxWait"in o)?u(O(o.maxWait)||0,t):n,A="trailing"in o?!!o.trailing:A),h.cancel=function(){void 0!==_&&clearTimeout(_),T=0,i=s=r=_=void 0},h.flush=function(){return void 0===_?E:L(d())},h}function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function O(e){if("number"==typeof e)return e;if((function(e){return"symbol"==typeof e||(function(e){return!!e&&"object"==typeof e})(e)&&"[object Symbol]"==l.call(e)})(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=n.test(e);return o||E.test(e)?_(e.slice(2),o?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,o){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(a);return c(o)&&(i="leading"in o?!!o.leading:i,r="trailing"in o?!!o.trailing:r),A(e,t,{leading:i,maxWait:t,trailing:r})}},49566:(e,t,o)=>{var a=o(48764).Buffer;e.exports=n,e.exports.decode=n,e.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const o=Array.from(t);1===o.length&&(e.xt=o[0]);o.length>1&&(e.xt=o);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let a="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,o)=>{const i=Array.isArray(e[t])?e[t]:[e[t]];i.forEach(((e,i)=>{(o>0||i>0)&&("kt"!==t&&"so"!==t||0===i)&&(a+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(a+="kt"===t&&i>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(a+=`${t}=${r.compose(i)}`)})),a};const i=o(25017),r=o(57500);function n(e){const t={},o=e.split("magnet:?")[1];let n;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const o=e.split("=");if(2!==o.length)return;const a=o[0];let i=o[1];"dn"===a&&(i=decodeURIComponent(i).replace(/\+/g," ")),"tr"!==a&&"xs"!==a&&"as"!==a&&"ws"!==a||(i=decodeURIComponent(i)),"kt"===a&&(i=decodeURIComponent(i).split("+")),"ix"===a&&(i=Number(i)),"so"===a&&(i=r.parse(decodeURIComponent(i).split(","))),t[a]?(Array.isArray(t[a])||(t[a]=[t[a]]),t[a].push(i)):t[a]=i})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(n=e.match(/^urn:btih:(.{40})/))t.infoHash=n[1].toLowerCase();else if(n=e.match(/^urn:btih:(.{32})/)){const e=i.decode(n[1]);t.infoHash=a.from(e,"binary").toString("hex")}else(n=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=n[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(n=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=n[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=a.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=a.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=a.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}},66499:e=>{e.exports={"error-container":"error-container-OJnoc","error-image":"error-image-qU9Qo","error-message":"error-message-kW59Z","buttons-container":"buttons-container-tQonN","button-container":"button-container-vLSQK",label:"label-Up_te"}},49448:e=>{e.exports={"fade-in":"fade-in-pFkt_","toasts-container":"toasts-container-oKECy","tooltip-container":"tooltip-container-Qpse8",router:"router-_65XU","error-container":"error-container-VZXwH","loader-container":"loader-container-vwvnb"}},88135:e=>{e.exports={"addon-details-container":"addon-details-container-ZQqDB","title-container":"title-container-fR02m",icon:"icon-ScXNu",logo:"logo-BujW_","name-container":"name-container-Gfhqw",name:"name-XNqfo",version:"version-w_xoN","section-container":"section-container-l3YaI","section-header":"section-header-bs8iy","section-label":"section-label-rYxQh","transport-url-label":"transport-url-label-EW7I5","disclaimer-label":"disclaimer-label-IGdd3"}},60355:e=>{e.exports={"addon-details-modal-container":"addon-details-modal-container-_bwQ0","addon-details-container":"addon-details-container-AmNx2","addon-details-message-container":"addon-details-message-container-VEzeN","cancel-button":"cancel-button-luYIO","cancel-button-label":"cancel-button-label-jqVQf","uninstall-button":"uninstall-button-X2JXr"}},74520:e=>{e.exports={"button-container":"button-container-HNufV"}},41726:e=>{e.exports={"checkbox-container":"checkbox-container-heGq4",toggle:"toggle-jrHgS"}},74809:e=>{e.exports={"color-picker-container":"color-picker-container-deFkW"}},5461:e=>{e.exports={"color-input-container":"color-input-container-jRZsi","transparent-label-container":"transparent-label-container-Tx2fI","transparent-label":"transparent-label-omLaY","color-picker-container":"color-picker-container-C4puR"}},79950:e=>{e.exports={"event-modal":"event-modal-rnryK",image:"image-e8XVK","info-container":"info-container-wB_Hp","title-container":"title-container-HRHiu",title:"title-QWkHL",label:"label-BkLRo","addon-container":"addon-container-vbdZn",icon:"icon-wYzOg",name:"name-YiulJ","action-button":"action-button-Off_h","button-label":"button-label-j6aOz"}},49684:e=>{e.exports={"main-nav-bars-container":"main-nav-bars-container-fA7pO","horizontal-nav-bar":"horizontal-nav-bar-x5sxp","vertical-nav-bar":"vertical-nav-bar-JNw53","nav-content-container":"nav-content-container-VHwOU"}},54661:e=>{e.exports={"meta-item-container":"meta-item-container-drt6V","poster-container":"poster-container-Fruke","dismiss-icon-layer":"dismiss-icon-layer-ujhD1","poster-image-layer":"poster-image-layer-CdxrT","play-icon-layer":"play-icon-layer-_75Lo","play-icon-outer":"play-icon-outer-sAk71","play-icon-background":"play-icon-background-yHWuQ","title-bar-container":"title-bar-container-DFXJK","menu-label-container":"menu-label-container-dlL1I","poster-shape-poster":"poster-shape-poster-F_CO5","poster-shape-square":"poster-shape-square-UCby3","poster-shape-landscape":"poster-shape-landscape-BPmb1","dismiss-icon":"dismiss-icon-w57SZ","dismiss-icon-backdrop":"dismiss-icon-backdrop-L8zeK","poster-image":"poster-image-lt9zC","placeholder-icon":"placeholder-icon-uYwsv","play-icon":"play-icon-d9_ll","progress-bar-layer":"progress-bar-layer-r81Qx","progress-bar":"progress-bar-E3QY9","progress-bar-background":"progress-bar-background-Q7lT4","new-videos":"new-videos-gZv0w",layer:"layer-RqXo1",icon:"icon-IfJ81",label:"label-hSihm","title-label":"title-label-dZZ_A"}},65883:e=>{e.exports={"action-button-container":"action-button-container-TmbQ2","icon-container":"icon-container-hvLw4",icon:"icon-DG4TM","label-container":"label-container-eh2bk",label:"label-YhHvD"}},17621:e=>{e.exports={"meta-links-container":"meta-links-container-wSrm1","label-container":"label-container-zWFke","links-container":"links-container-o4RUG","link-container":"link-container-HUDqV"}},76506:e=>{e.exports={"meta-preview-placeholder-container":"meta-preview-placeholder-container-AQ4ld","meta-info-container":"meta-info-container-pEOFb","logo-container":"logo-container-g5eNB","duration-release-info-container":"duration-release-info-container-lNaI6","duration-container":"duration-container-x2E01","release-info-container":"release-info-container-PEmeu","genres-container":"genres-container-v3H7A","genres-header-container":"genres-header-container-lsPLU","genre-label-container":"genre-label-container-z7kU8","action-buttons-container":"action-buttons-container-U3sbl"}},46037:e=>{e.exports={"meta-preview-container":"meta-preview-container-bgBNf",compact:"compact-Wbl4Q","meta-info-container":"meta-info-container-tlmcb",logo:"logo-X9v1A","logo-placeholder":"logo-placeholder-kIy0x","runtime-release-info-container":"runtime-release-info-container-lXo3K","release-info-label":"release-info-label-XmqSY","runtime-label":"runtime-label-B29EN","description-container":"description-container-eSGft","action-buttons-container":"action-buttons-container-qQrnO","action-button":"action-button-R44aX","background-image-layer":"background-image-layer-GstuA","background-image":"background-image-B0d6i","imdb-button-container":"imdb-button-container-qCbl7",label:"label-_DfnK",icon:"icon-MBu8k","label-container":"label-container-xChHj","meta-links":"meta-links-mTHUo","show-button":"show-button-Sh8P3","share-prompt":"share-prompt-F8qOC"}},17841:e=>{e.exports={"meta-row-placeholder-container":"meta-row-placeholder-container-wpHNk","header-container":"header-container-GCHdB","title-container":"title-container-Bjp93","see-all-container":"see-all-container-FnlIf",label:"label-dU3S2",icon:"icon-FLhtv","meta-items-container":"meta-items-container-dbGXx","meta-item":"meta-item-IegjY","poster-container":"poster-container-RlQMV","title-bar-container":"title-bar-container-YJZrl","title-label":"title-label-Ka1vs"}},60676:e=>{e.exports={"meta-row-container":"meta-row-container-ucOuu","header-container":"header-container-RherZ","title-container":"title-container-SJ0nR","see-all-container":"see-all-container-HlJ4b",label:"label-isJw8",icon:"icon-PO0GH","message-container":"message-container-bIcjN","meta-items-container":"meta-items-container-TqzFs","meta-item":"meta-item-x28TU","poster-shape-poster":"poster-shape-poster-B1QR0","poster-shape-square":"poster-shape-square-m5r_O","poster-shape-landscape":"poster-shape-landscape-_FSOH"}},11621:e=>{e.exports={"modal-container":"modal-container-jZglc","modal-dialog-container":"modal-dialog-container-QgsId","close-button-container":"close-button-container-QrgQo",icon:"icon-hRjWc","title-container":"title-container-wqhp3","modal-dialog-content":"modal-dialog-content-ChXwF","buttons-container":"buttons-container-EJKJF","action-button":"action-button-bi6FL",label:"label-_ADoX"}},57409:e=>{e.exports={"label-container":"label-container-ZHk2S",icon:"icon-YGvLz",label:"label-kz1K0","modal-container":"modal-container-BQwj3","menu-container":"menu-container-Z1Pou","option-container":"option-container-yVj1o","no-options-container":"no-options-container-NYx9Z"}},48147:e=>{e.exports={"nav-menu-popup-label":"nav-menu-popup-label-JmI2m","nav-menu-container":"nav-menu-container-VSzwW","user-info-container":"user-info-container-BR8yb","avatar-container":"avatar-container-jmlBM","user-info-details":"user-info-details-vvVBe","email-container":"email-container-fvFrL","email-label":"email-label-WBX2T","logout-button-container":"logout-button-container-hSW_i","logout-label":"logout-label-dUa8B","nav-menu-section":"nav-menu-section-oMELF","nav-menu-option-container":"nav-menu-option-container-gZ1gT",icon:"icon-OSgm6","nav-menu-option-label":"nav-menu-option-label-XNuY6"}},87551:e=>{e.exports={"search-bar-container":"search-bar-container-TNPzI","search-input":"search-input-aOiJ2","placeholder-label":"placeholder-label-Irklk","submit-button-container":"submit-button-container-jPP5J",icon:"icon-FT4bG"}},74887:e=>{e.exports={"horizontal-nav-bar-container":"horizontal-nav-bar-container-jFw5Y","logo-container":"logo-container-fnFzY",logo:"logo-RVSxt","back-button-container":"back-button-container-K9AwF",title:"title-_UxXH","search-bar":"search-bar-NopQ6","buttons-container":"buttons-container-fHCke","button-container":"button-container-B23qB",icon:"icon-wrBcp","menu-button-container":"menu-button-container-WWcwa"}},39842:e=>{e.exports={"nav-tab-button-container":"nav-tab-button-container-r8HUb",label:"label-mc9eB",icon:"icon-vxKmB",logo:"logo-ST06l"}},27636:e=>{e.exports={"vertical-nav-bar-container":"vertical-nav-bar-container-AsGLM","nav-tab-button":"nav-tab-button-noMv6"}},12168:e=>{e.exports={"pagination-input-container":"pagination-input-container-vXhi6","next-button-container":"next-button-container-zNwG6","prev-button-container":"prev-button-container-qmJ1m",icon:"icon-UoyQ9","label-container":"label-container-VwInD",label:"label-cJKC1"}},9192:e=>{e.exports={background:"background-FNyrF",icon:"icon-XXj2q"}},20194:e=>{e.exports={"label-container":"label-container-iBMb9","menu-container":"menu-container-bfvDO","menu-direction-top-left":"menu-direction-top-left-KpAQN","menu-direction-bottom-left":"menu-direction-bottom-left-Uw06K","menu-direction-top-right":"menu-direction-top-right-jOtwq","menu-direction-bottom-right":"menu-direction-bottom-right-XZ9Ch"}},3109:e=>{e.exports={"search-bar-container":"search-bar-container-Vb_fz","search-input":"search-input-BWyeG",icon:"icon-poa62"}},30330:e=>{e.exports={"search-bar-container":"search-bar-container-MpNBA","search-input":"search-input-ge2wu",icon:"icon-Z_Hni"}},84530:e=>{e.exports={"share-prompt-container":"share-prompt-container-YsJwl","buttons-container":"buttons-container-Oc7PG","button-container":"button-container-oMOnv",icon:"icon-FVvQH",label:"label-iOGrs","facebook-button":"facebook-button-KaNwb","twitter-button":"twitter-button-pJka2","url-container":"url-container-fMSp4","url-text-input":"url-text-input-Yka4x","copy-button":"copy-button-ShwCB"}},5036:e=>{e.exports={"active-slider-within":"active-slider-within-lQFc1","slider-container":"slider-container-aRzVq",layer:"layer-FqnD7",track:"track-jWhBI","track-before":"track-before-FwOXh","track-after":"track-after-iD0ee",thumb:"thumb-tfDk6"}},57985:e=>{e.exports={"warning-container":"warning-container-FIITF","warning-statement":"warning-statement-I7pdD","warning-button":"warning-button-zlx_V","warning-label":"warning-label-XJnBc"}},35725:e=>{e.exports={"text-input":"text-input-jR2Nr"}},49775:e=>{e.exports={"toast-item-container":"toast-item-container-nG0uk",success:"success-eIDTa","icon-container":"icon-container-rjAiH",icon:"icon-Y4I_O",error:"error-quyOd","info-container":"info-container-xD9V6","title-container":"title-container-VFReJ","message-container":"message-container-znkCj","close-button-container":"close-button-container-YtyYE"}},63494:e=>{e.exports={"tooltip-placeholder":"tooltip-placeholder-niioe"}},13209:e=>{e.exports={"tooltip-item":"tooltip-item-gfYXu"}},72638:e=>{e.exports={"addon-container":"addon-container-lC5KN","logo-container":"logo-container-ZcSSC",logo:"logo-WrsGF",icon:"icon-GxVbY","info-container":"info-container-AdMB6","name-container":"name-container-qIAg8","version-container":"version-container-zdPyN","types-container":"types-container-DaOrg","description-container":"description-container-v7Jhe","buttons-container":"buttons-container-g0xXr","action-buttons-container":"action-buttons-container-xMVmz","configure-button-container":"configure-button-container-VwVAQ","install-button-container":"install-button-container-yfcq5","share-button-container":"share-button-container-s3gwP","uninstall-button-container":"uninstall-button-container-oV4Yo",label:"label-OnWh2"}},65531:e=>{e.exports={"addons-container":"addons-container-ogGYu","addons-content":"addons-content-zhFBl","selectable-inputs-container":"selectable-inputs-container-tUul1","add-button-container":"add-button-container-SkafT",icon:"icon-HsyZS","add-button-label":"add-button-label-NN6bu","select-input-container":"select-input-container-KqG8N",spacing:"spacing-wH1w5","search-bar":"search-bar-k7MXd","filter-button":"filter-button-lLJ1X","filter-icon":"filter-icon-LUDTS","message-container":"message-container-GBw0P","addons-list-container":"addons-list-container-Ovr2Z",addon:"addon-whmdO","filters-modal":"filters-modal-w6oWY","add-addon-modal-container":"add-addon-modal-container-KR5ny",notice:"notice-UQkO1","addon-url-input":"addon-url-input-ucetZ","cancel-button":"cancel-button-R2AxR","share-modal-container":"share-modal-container-DkzPM","title-container":"title-container-La49g",logo:"logo-PmYDP","name-container":"name-container-m_Sz0",name:"name-YD0xd",version:"version-wuAFB","share-prompt-container":"share-prompt-container-vaK4P"}},20969:e=>{e.exports={"board-container":"board-container-DTN_b","board-content-container":"board-content-container-ToQTz","board-content":"board-content-nPWv1","board-row":"board-row-CoJrZ","board-warning-container":"board-warning-container-a4m04","board-row-landscape":"board-row-landscape-FRGXx","board-row-poster":"board-row-poster-QPQqC","board-row-square":"board-row-square-pgaZ3","continue-watching-row":"continue-watching-row-ZiNSa"}},70820:e=>{e.exports={"discover-container":"discover-container-L6OGL","discover-content":"discover-content-CRsRg","catalog-container":"catalog-container-VNK_T","selectable-inputs-container":"selectable-inputs-container-IRz50","select-input":"select-input-CHDbe","filter-container":"filter-container-BVkqT","filter-icon":"filter-icon-zlFnX","missing-addon-warning-container":"missing-addon-warning-container-IXGuv","warning-label":"warning-label-f19Jg","install-button":"install-button-SmJe1",label:"label-ToW4S","message-container":"message-container-Zv9eF",image:"image-txC9E","message-label":"message-label-mRyRX","meta-items-container":"meta-items-container-n8vNz","meta-item-placeholder":"meta-item-placeholder-wxG4I","poster-container":"poster-container-Dch4R","title-bar-container":"title-bar-container-dtDnk","title-label":"title-label-vHdQd","meta-preview-container":"meta-preview-container-CoWs5","selectable-inputs-modal":"selectable-inputs-modal-ChpOa"}},66947:e=>{e.exports={"consent-checkbox-container":"consent-checkbox-container-WV60T",label:"label-l3LSw",link:"link-UppYg"}},29070:e=>{e.exports={"password-reset-modal-container":"password-reset-modal-container-KzJPQ","credentials-text-input":"credentials-text-input-ncrIR","error-message":"error-message-DkekN","cancel-button":"cancel-button-AneJE"}},88999:e=>{e.exports={"intro-container":"intro-container-tkNS6","background-container":"background-container-aYKCH","heading-container":"heading-container-oI70m","logo-container":"logo-container-W49kt",logo:"logo-WJ36F","slogan-container":"slogan-container-UlcYd","title-container":"title-container-CbIkM","content-container":"content-container-A1Drn","form-button":"form-button-vyqqj",icon:"icon-L_6b6",label:"label-uHD7L","guest-login-button":"guest-login-button-D8DWZ","login-form-button":"login-form-button-DqJUV","signup-form-button":"signup-form-button-UGmSk","submit-button":"submit-button-x3L8z","form-container":"form-container-HMlEh","credentials-text-input":"credentials-text-input-QMCZz","forgot-password-link-container":"forgot-password-link-container-ygZqb","forgot-password-link":"forgot-password-link-NxNUD","error-message":"error-message-cKdzB","options-container":"options-container-qxboQ","facebook-button":"facebook-button-LZ_kG","loading-modal-container":"loading-modal-container-eLyTm","loader-container":"loader-container-oe8rU",flash:"flash-wUFXY"}},71596:e=>{e.exports={"library-container":"library-container-zM_bj","library-content":"library-content-PgX4O","selectable-inputs-container":"selectable-inputs-container-hR3or","select-input-container":"select-input-container-H1VZ1","filter-container":"filter-container-oRBlw","filter-icon":"filter-icon-ZhMyS",spacing:"spacing-Rdiyt","pagination-input":"pagination-input-DvMtv","message-container":"message-container-MhY5t","no-user-message-container":"no-user-message-container-KMLpE","login-button-container":"login-button-container-RoEh7",label:"label-QqYmf",image:"image-csRHm","message-label":"message-label-UExl3","meta-items-container":"meta-items-container-IKrND","selectable-inputs-modal":"selectable-inputs-modal-rHlo7"}},81384:e=>{e.exports={"stream-placeholder-container":"stream-placeholder-container-T1nxv","addon-container":"addon-container-pm1P0","addon-name":"addon-name-zAOKP","info-container":"info-container-Z1Dl6","description-container":"description-container-ZOMcn","play-icon":"play-icon-MXqj3"}},63458:e=>{e.exports={"stream-container":"stream-container-JPdah",icon:"icon-rAZvO","info-container":"info-container-TihQo",thumbnail:"thumbnail-whoms","placeholder-icon":"placeholder-icon-znYz0","addon-name":"addon-name-tC8PX","progress-bar-container":"progress-bar-container-ADRp_","progress-bar":"progress-bar-XrEBL","progress-bar-background":"progress-bar-background-HueVQ","description-container":"description-container-vW_De"}},36796:e=>{e.exports={"streams-list-container":"streams-list-container-xYMJo","message-container":"message-container-f9_L4",image:"image-rIyu6",label:"label-luvnO","addons-loading-container":"addons-loading-container-Vkwp3","addons-loading":"addons-loading-zhdQr","addons-loading-bar":"addons-loading-bar-MqT59","select-choices-wrapper":"select-choices-wrapper-xGzfs","back-button-container":"back-button-container-cJ4bk",icon:"icon-SoFgF","episode-title":"episode-title-dln_c","select-input-container":"select-input-container-irGn_","streams-container":"streams-container-bbSc4","install-button-container":"install-button-container-Q60yJ"}},32180:e=>{e.exports={"seasons-bar-placeholder-container":"seasons-bar-placeholder-container-M81RN","next-season-button":"next-season-button-oGnlT","prev-season-button":"prev-season-button-TCbOq",icon:"icon-UzQjF",label:"label-lmBnj","seasons-popup-label-container":"seasons-popup-label-container-r2UDB","seasons-popup-label":"seasons-popup-label-xBinL","seasons-popup-icon":"seasons-popup-icon-p1T5d"}},56351:e=>{e.exports={"seasons-bar-container":"seasons-bar-container-nOZjG","next-season-button":"next-season-button-RrYAq","prev-season-button":"prev-season-button-bs1GQ",label:"label-uJbfD",icon:"icon-_ZBEE","seasons-popup-label-container":"seasons-popup-label-container-fZcu4"}},75507:e=>{e.exports={"video-placeholder-container":"video-placeholder-container-uDsav","info-container":"info-container-KTKtT","name-container":"name-container-Jvesr","released-container":"released-container-uoc4E"}},14486:e=>{e.exports={"video-container":"video-container-UBBpR","thumbnail-container":"thumbnail-container-n_jp7",thumbnail:"thumbnail-MiS3K","placeholder-icon":"placeholder-icon-LzVIO","progress-bar-container":"progress-bar-container-gMpiB","progress-bar":"progress-bar-Yhl4z","progress-bar-background":"progress-bar-background-briMe","info-container":"info-container-szYxP","title-container":"title-container-EMXpV","flex-row-container":"flex-row-container-ExEua","released-container":"released-container-zA91y","upcoming-watched-container":"upcoming-watched-container-y_ijd","upcoming-container":"upcoming-container-ASE1L","watched-container":"watched-container-LCso2","flag-icon":"flag-icon-IJVCW","flag-label":"flag-label-dIdBb","context-menu-content":"context-menu-content-MGBhW","context-menu-option-container":"context-menu-option-container-VlNjD","context-menu-option-label":"context-menu-option-label-hOUnH"}},12759:e=>{e.exports={"videos-list-container":"videos-list-container-NepX5","message-container":"message-container-_hhmQ",image:"image-_xAbP",label:"label-Ff1_X","notifications-checkbox":"notifications-checkbox-E2l5g","seasons-bar":"seasons-bar-Ma8vp","search-bar":"search-bar-mZHWa","videos-container":"videos-container-msX8s"}},9514:e=>{e.exports={"metadetails-container":"metadetails-container-K_Dqa","nav-bar":"nav-bar-MH6Vk","metadetails-content":"metadetails-content-Uz5EV","vertical-nav-bar":"vertical-nav-bar-B39nq","background-image-layer":"background-image-layer-wJa90","background-image":"background-image-tSjYu","meta-message-container":"meta-message-container-MJZN5",image:"image-R1LcJ","message-label":"message-label-Uz4_P","meta-preview":"meta-preview-ES0h3",spacing:"spacing-rgIYg","streams-list":"streams-list-Y1lCM","videos-list":"videos-list-nE0LJ","meta-extension-modal-container":"meta-extension-modal-container-gHjqy","meta-extension-modal-iframe":"meta-extension-modal-iframe-GGHlm"}},25142:e=>{e.exports={"not-found-container":"not-found-container-Q1qsP","nav-bar":"nav-bar-Eu3_y","not-found-content":"not-found-content-z_Eza","not-found-image":"not-found-image-Qab4G","not-found-label":"not-found-label-mmwyZ"}},91391:e=>{e.exports={"buffering-loader-container":"buffering-loader-container-P7S0m","buffering-loader":"buffering-loader-fMSpb",fadeInOut:"fadeInOut-WS5RD"}},98982:e=>{e.exports={"seek-bar-container":"seek-bar-container-JGGTa",label:"label-QFbsS",slider:"slider-hBDOf"}},66708:e=>{e.exports={"volume-slider":"volume-slider-G_xAt"}},90578:e=>{e.exports={"control-bar-container":"control-bar-container-xsWA7","seek-bar":"seek-bar-I7WeY","control-bar-buttons-container":"control-bar-buttons-container-SWhkU","control-bar-button":"control-bar-button-FQUsj",icon:"icon-qy6I6","volume-slider":"volume-slider-U9jfo",spacing:"spacing-p8NJQ","control-bar-buttons-menu-button":"control-bar-buttons-menu-button-h0MWd","control-bar-buttons-menu-container":"control-bar-buttons-menu-container-M6L0_"}},33800:e=>{e.exports={"info-menu-container":"info-menu-container-R1QKH",stream:"stream-MY2Oy"}},95626:e=>{e.exports={"next-video-popup-container":"next-video-popup-container-H4wnL","slide-fade-in":"slide-fade-in-rk2M8","poster-container":"poster-container-tXZjA","poster-image":"poster-image-2D6wg","placeholder-icon":"placeholder-icon-fu1rK","info-container":"info-container-KLOMx","details-container":"details-container-bUOTZ",name:"name-sIiDL",label:"label-zOq_w",title:"title-Z5Kgo",description:"description-gIXiC","buttons-container":"buttons-container-iYrpZ",spacing:"spacing-iFwsN","button-container":"button-container-i4F7t","play-button":"play-button-Dluk6",icon:"icon-N3Ewm",dismiss:"dismiss-IvEL_"}},81530:e=>{e.exports={"option-container":"option-container-m_jZq",icon:"icon-krR0X",label:"label-cmqqu"}},38183:e=>{e.exports={"options-menu-container":"options-menu-container-qlzLt"}},54805:e=>{e.exports={option:"option-_O96j",icon:"icon-kqaPF",label:"label-FEOiu"}},69715:e=>{e.exports={"speed-menu-container":"speed-menu-container-ABjzc",title:"title-Hu2Dm","options-container":"options-container-DNn3D",option:"option-GcPlB"}},51289:e=>{e.exports={"statistics-menu-container":"statistics-menu-container-DhiHn",title:"title-NCwWH",label:"label-h6nN_",value:"value-E8Ftb",stats:"stats-Tr37t",stat:"stat-zoq5A","info-hash":"info-hash-GT1Cv"}},93283:e=>{e.exports={"discrete-input-container":"discrete-input-container-CMThy",header:"header-n0jWL","input-container":"input-container-TNuI2","button-container":"button-container-ciSB5",icon:"icon-JDltr","option-label":"option-label-tjeeT"}},73889:e=>{e.exports={"subtitles-menu-container":"subtitles-menu-container-PxBRZ","languages-container":"languages-container-NS7H9","subtitles-settings-container":"subtitles-settings-container-LhRGS","variants-container":"variants-container-XglzH","languages-header":"languages-header-jGNcK","settings-header":"settings-header-eaWnm","variants-header":"variants-header-TsVSR","languages-list":"languages-list-sxIwI","variants-list":"variants-list-yZo6B","language-option":"language-option-O1Yr9","variant-option":"variant-option-t7_LA","language-label":"language-label-FjjqA","variant-label":"variant-label-opjnP",icon:"icon-I1Ruh","no-variants-container":"no-variants-container-q6u1Q","no-variants-label":"no-variants-label-RmDKZ",spacing:"spacing-AWJpt","discrete-input":"discrete-input-fXELp"}},44236:e=>{e.exports={"video-container":"video-container-v9_vA",video:"video-tkpQm"}},10674:e=>{e.exports={"videos-menu-container":"videos-menu-container-ATzKq"}},49731:e=>{e.exports={"player-container":"player-container-wIELK",immersed:"immersed-Y0hn1","control-bar-layer":"control-bar-layer-m2jto","menu-layer":"menu-layer-HZFG9","nav-bar-layer":"nav-bar-layer-r9HT5",layer:"layer-qalDW","error-layer":"error-layer-RCEZC","error-label":"error-label-FPIMw","error-sub":"error-sub-Myxw2","playlist-button":"playlist-button-CB2WC",icon:"icon-aMPEE",label:"label-njZqk"}},95532:e=>{e.exports={"search-container":"search-container-uXEFf","search-content":"search-content-LX6un","search-row":"search-row-EQLaD","search-hints-wrapper":"search-hints-wrapper-IjhmE","search-hints-title-container":"search-hints-title-container-MXt8W","search-hints-title":"search-hints-title-cigX3","search-hints-container":"search-hints-container-FHpPM","search-hint-container":"search-hint-container-kd8iX",icon:"icon-fOZZl",label:"label-l6wxz","message-container":"message-container-YAunr",image:"image-Xuwya","message-label":"message-label-K8LPz","search-row-landscape":"search-row-landscape-o3Lfv","search-row-poster":"search-row-poster-m7CUE","search-row-square":"search-row-square-VesJA"}},59819:e=>{e.exports={"settings-container":"settings-container-b0DCu","settings-content":"settings-content-lLXmk","side-menu-container":"side-menu-container-NG17D","side-menu-button":"side-menu-button-vbkJ1",selected:"selected-yhdng",spacing:"spacing-fpLUM","version-info-label":"version-info-label-uMkm7","sections-container":"sections-container-EUKAe","section-container":"section-container-twzKQ","section-title":"section-title-Nt71Z","section-category-container":"section-category-container-EOuS0",label:"label-FFamJ",icon:"icon-REQkK","option-container":"option-container-EGlcv","link-container":"link-container-ERYsD","user-info-option-container":"user-info-option-container-oRLJc","user-info-content":"user-info-content-ez7kZ","avatar-container":"avatar-container-YWq9E","email-logout-container":"email-logout-container-kYQDM","email-label-container":"email-label-container-oVmiO","logout-button-container":"logout-button-container-jLrU2","email-label":"email-label-Q__sJ","logout-label":"logout-label-zo4ES","user-panel-container":"user-panel-container-kkrJG","user-panel-label":"user-panel-label-beAQl","option-input-container":"option-input-container-NPgpT","option-name-container":"option-name-container-exGMI","trakt-icon":"trakt-icon-_dK95","button-container":"button-container-ENMae","multiselect-container":"multiselect-container-w0c9l","link-input-container":"link-input-container-TCi0w","checkbox-container":"checkbox-container-R9LLN","color-input-container":"color-input-container-WclA_","info-container":"info-container-wfFcS",selectable:"selectable-eucrJ","configure-input-container":"configure-input-container-PMyIY","configure-button-container":"configure-button-container-xGFgg","shortcut-container":"shortcut-container-ZSm5O","versions-section-container":"versions-section-container-LRCVQ","configure-server-url-modal-container":"configure-server-url-modal-container-vSL44","server-url-input":"server-url-input-Dfazw","cancel-button":"cancel-button-iydew"}},92703:(e,t,o)=>{"use strict";var a=o(50414);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,o,i,r,n){if(n!==a){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return o.PropTypes=o,o}},45697:(e,t,o)=>{e.exports=o(92703)()},50414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},74971:function(e,t,o){var a;e=o.nmd(e),(function(i){t&&t.nodeType,e&&e.nodeType;var r="object"==typeof o.g&&o.g;r.global!==r&&r.window!==r&&r.self;var n,E=2147483647,_=36,s=/^xn--/,T=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=Math.floor,I=String.fromCharCode;function d(e){throw RangeError(l[e])}function A(e,t){for(var o=e.length,a=[];o--;)a[o]=t(e[o]);return a}function c(e,t){var o=e.split("@"),a="";return o.length>1&&(a=o[0]+"@",e=o[1]),a+A((e=e.replace(S,".")).split("."),t).join(".")}function O(e){for(var t,o,a=[],i=0,r=e.length;i=55296&&t<=56319&&i65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)})).join("")}function N(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function m(e,t,o){var a=0;for(e=o?u(e/700):e>>1,e+=u(e/t);e>455;a+=_)e=u(e/35);return u(a+36*e/(e+38))}function p(e){var t,o,a,i,r,n,s,T,S,l,I,A=[],c=e.length,O=0,N=128,p=72;for((o=e.lastIndexOf("-"))<0&&(o=0),a=0;a=128&&d("not-basic"),A.push(e.charCodeAt(a));for(i=o>0?o+1:0;i=c&&d("invalid-input"),((T=(I=e.charCodeAt(i++))-48<10?I-22:I-65<26?I-65:I-97<26?I-97:_)>=_||T>u((E-O)/n))&&d("overflow"),O+=T*n,!(T<(S=s<=p?1:s>=p+26?26:s-p));s+=_)n>u(E/(l=_-S))&&d("overflow"),n*=l;p=m(O-r,t=A.length+1,0==r),u(O/t)>E-N&&d("overflow"),N+=u(O/t),O%=t,A.splice(O++,0,N)}return R(A)}function L(e){var t,o,a,i,r,n,s,T,S,l,A,c,R,p,L,h=[];for(c=(e=O(e)).length,t=128,o=0,r=72,n=0;n=t&&Au((E-o)/(R=a+1))&&d("overflow"),o+=(s-t)*R,t=s,n=0;nE&&d("overflow"),A==t){for(T=o,S=_;!(T<(l=S<=r?1:S>=r+26?26:S-r));S+=_)L=T-l,p=_-l,h.push(I(N(l+L%p,0))),T=u(L/p);h.push(I(N(T,0))),r=m(o,R,a==i),o=0,++a}++o,++t}return h.join("")}n={version:"1.3.2",ucs2:{decode:O,encode:R},decode:p,encode:L,toASCII:function(e){return c(e,(function(e){return T.test(e)?"xn--"+L(e):e}))},toUnicode:function(e){return c(e,(function(e){return s.test(e)?p(e.slice(4).toLowerCase()):e}))}},void 0===(a=function(){return n}.call(t,o,t,e))||(e.exports=a)})()},62587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,o,a,i){o=o||"&",a=a||"=";var r={};if("string"!=typeof e||0===e.length)return r;var n=/\+/g;e=e.split(o);var E=1e3;i&&"number"==typeof i.maxKeys&&(E=i.maxKeys);var _=e.length;E>0&&_>E&&(_=E);for(var s=0;s<_;++s){var T,S,l,u,I=e[s].replace(n,"%20"),d=I.indexOf(a);d>=0?(T=I.substr(0,d),S=I.substr(d+1)):(T=I,S=""),l=decodeURIComponent(T),u=decodeURIComponent(S),t(r,l)?Array.isArray(r[l])?r[l].push(u):r[l]=[r[l],u]:r[l]=u}return r}},12361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,o,a,i){return o=o||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var r=encodeURIComponent(t(i))+a;return Array.isArray(e[i])?e[i].map((function(e){return r+encodeURIComponent(t(e))})).join(o):r+encodeURIComponent(t(e[i]))})).join(o):i?encodeURIComponent(t(i))+a+encodeURIComponent(t(e)):""}},17673:(e,t,o)=>{"use strict";t.decode=t.parse=o(62587),t.encode=t.stringify=o(12361)},64448:(e,t,o)=>{"use strict";var a=o(67294),i=o(63840);function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o