(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[1814],{57922:(e,t,n)=>{"use strict";n.d(t,{Z:()=>oe});var i=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?u(E,--v):0,g--,10===y&&(g=1,m--),y}function T(){return y=v<_?u(E,v++):0,g++,10===y&&(g=1,m++),y}function O(){return u(E,v)}function I(){return v}function C(e,t){return d(E,e,t)}function N(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function L(e){return m=g=1,_=p(E=e),v=0,[]}function R(e){return E="",e}function P(e){return s(C(v-1,w(91===e?e+2:40===e?e+1:e)))}function k(e){for(;(y=O())&&y<33;)T();return N(e)>2||N(y)>3?"":" "}function D(e,t){for(;--t&&T()&&!(y<48||y>102||y>57&&y<65||y>70&&y<97););return C(e,I()+(t<6&&32==O()&&32==T()))}function w(e){for(;T();)switch(y){case e:return v;case 34:case 39:34!==e&&39!==e&&w(y);break;case 40:41===e&&w(e);break;case 92:T()}return v}function M(e,t){for(;T()&&e+y!==57&&(e+y!==84||47!==O()););return"/*"+C(t,v-1)+"*"+r(47===e?e:T())}function x(e){for(;!N(O());)T();return C(e,v)}var U="-ms-",V="-moz-",F="-webkit-",B="comm",H="rule",G="decl",K="@keyframes";function W(e,t){for(var n="",i=f(e),o=0;o0&&p(V)-_&&h(y>32?X(V+";",i,n,_-1):X(c(V," ","")+";",i,n,_-2),f);break;case 59:V+=";";default:if(h(U=J(V,t,n,m,g,o,d,L,R=[],w=[],_),a),123===N)if(0===g)z(V,t,U,U,R,a,_,d,w);else switch(99===v&&110===u(V,3)?100:v){case 100:case 108:case 109:case 115:z(e,U,U,i&&h(J(e,U,U,0,0,o,d,L,o,R=[],_),w),o,w,_,d,i?R:w);break;default:z(V,U,U,U,[""],w,0,d,w)}}m=g=y=0,b=C=1,L=V="",_=s;break;case 58:_=1+p(V),y=E;default:if(b<1)if(123==N)--b;else if(125==N&&0==b++&&125==A())continue;switch(V+=r(N),N*b){case 38:C=g>0?1:(V+="\f",-1);break;case 44:d[m++]=(p(V)-1)*C,C=1;break;case 64:45===O()&&(V+=P(T())),v=O(),g=_=p(L=V+=x(I())),N++;break;case 45:45===E&&2==p(V)&&(b=0)}}return a}function J(e,t,n,i,r,a,l,u,p,h,m){for(var g=r-1,_=0===r?a:[""],v=f(_),y=0,E=0,S=0;y0?_[A]+" "+T:c(T,/&\f/g,_[A])))&&(p[S++]=O);return b(e,t,n,0===r?H:u,p,h,m)}function q(e,t,n){return b(e,t,n,B,r(y),d(e,2,-2),0)}function X(e,t,n,i){return b(e,t,n,G,d(e,0,i),d(e,i+1,-1),i)}var Z=function(e,t,n){for(var i=0,o=0;i=o,o=O(),38===i&&12===o&&(t[n]=1),!N(o);)T();return C(e,v)},Q=function(e,t){return R(function(e,t){var n=-1,i=44;do{switch(N(i)){case 0:38===i&&12===O()&&(t[n]=1),e[n]+=Z(v-1,t,n);break;case 2:e[n]+=P(i);break;case 4:if(44===i){e[++n]=58===O()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=r(i)}}while(i=T());return e}(L(e),t))},$=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||$.get(n))&&!i){$.set(e,!0);for(var o=[],r=Q(t,o),a=n.props,s=0,c=0;s6)switch(u(e,t+1)){case 109:if(45!==u(e,t+4))break;case 102:return c(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+V+(108==u(e,t+3)?"$3":"$2-$3"))+e;case 115:return~l(e,"stretch")?ne(c(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==u(e,t+1))break;case 6444:switch(u(e,p(e)-3-(~l(e,"!important")&&10))){case 107:return c(e,":",":"+F)+e;case 101:return c(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+F+(45===u(e,14)?"inline-":"")+"box$3$1"+F+"$2$3$1"+U+"$2box$3")+e}break;case 5936:switch(u(e,t+11)){case 114:return F+e+U+c(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+U+c(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+U+c(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+U+e+e}return e}var ie=[function(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case G:e.return=ne(e.value,e.length);break;case K:return W([S(e,{value:c(e.value,"@","@"+F)})],i);case H:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return W([S(e,{props:[c(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return W([S(e,{props:[c(t,/:(plac\w+)/,":"+F+"input-$1")]}),S(e,{props:[c(t,/:(plac\w+)/,":-moz-$1")]}),S(e,{props:[c(t,/:(plac\w+)/,U+"input-$1")]})],i)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||ie;var r,a,s={},c=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n{"use strict";function i(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{Z:()=>i})},8534:(e,t,n)=>{"use strict";n.d(t,{iv:()=>L,tZ:()=>N,F4:()=>R});var i=n(50959),o=n.t(i,2),r=n(57922);var a=function(e,t,n){var i=e.key+"-"+t.name;!1===n&&void 0===e.registered[i]&&(e.registered[i]=t.styles)};var s={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},c=n(6816),l=/[A-Z]|^ms/g,u=/_EMO_([^_]+?)_([^]*?)_EMO_/g,d=function(e){return 45===e.charCodeAt(1)},p=function(e){return null!=e&&"boolean"!=typeof e},f=(0,c.Z)((function(e){return d(e)?e:e.replace(l,"-$&").toLowerCase()})),h=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(u,(function(e,t,n){return g={name:t,styles:n,next:g},t}))}return 1===s[e]||d(e)||"number"!=typeof t||0===t?t:t+"px"};function m(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return g={name:n.name,styles:n.styles,next:g},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)g={name:i.name,styles:i.styles,next:g},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;o=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+c;return{name:l,styles:o,next:g}},y=!!o.useInsertionEffect&&o.useInsertionEffect,E=y||function(e){return e()},b=(y||i.useLayoutEffect,{}.hasOwnProperty),S=i.createContext("undefined"!=typeof HTMLElement?(0,r.Z)({key:"css"}):null);S.Provider;var A=function(e){return(0,i.forwardRef)((function(t,n){var o=(0,i.useContext)(S);return e(t,o,n)}))};var T=i.createContext({});var O="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",I=function(e){var t=e.cache,n=e.serialized,i=e.isStringTag;return a(t,n,i),E((function(){return function(e,t,n){a(e,t,n);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+i:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,i)})),null};var C=A((function(e,t,n){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var r=e[O],a=[o],s="";"string"==typeof e.className?s=function(e,t,n){var i="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):i+=n+" "})),i}(t.registered,a,e.className):null!=e.className&&(s=e.className+" ");var c=v(a,void 0,i.useContext(T));s+=t.key+"-"+c.name;var l={};for(var u in e)b.call(e,u)&&"css"!==u&&u!==O&&(l[u]=e[u]);return l.ref=n,l.className=s,i.createElement(i.Fragment,null,i.createElement(I,{cache:t,serialized:c,isStringTag:"string"==typeof r}),i.createElement(r,l))})),N=(n(72535),function(e,t){var n=arguments;if(null==t||!b.call(t,"css"))return i.createElement.apply(void 0,n);var o=n.length,r=new Array(o);r[0]=C,r[1]=function(e,t){var n={};for(var i in t)b.call(t,i)&&(n[i]=t[i]);return n[O]=e,n}(e,t);for(var a=2;a{var t;t=function(){return function(){var e={254:function(e,t,n){e.exports=n(721).default},721:function(e,t,n){"use strict";var i=n(48),o=n.n(i),r=n(153),a=n.n(r),s=n(961),c=n.n(s);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=c().log,d=c().utils.secondsToMs,p=c().utils.assign,f=c().utils.getComputedStyle,h=c().utils.extractHostname,m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o().shaka;if("object"!==l(e)||void 0===e.constructor.version)return u.warn("[shakaPlayer-mux] You must provide a valid shakaPlayer to initShakaPlayerMux."),{emit:function(){u.warn("[shakaPlayer-mux] emit is a no-op because initShakaPlayerMux was not initialized correctly")},loadErrorHandler:function(){u.warn("[shakaPlayer-mux] loadErrorHandler is a no-op because initShakaPlayerMux was not initialized correctly")}};var i=function(t){return e.getMediaElement()&&e.getMediaElement()[t]},r=function(t){var n=e.getMediaElement();if(n)return parseInt(f(n,t))},s=function(){var e=i("preload");return"auto"===e||"metadata"===e};function m(){var t=a().fullscreenElement||a().webkitFullscreenElement||a().mozFullScreenElement||a().msFullscreenElement;return t?t===e.getMediaElement():void 0}(t=p({automaticErrorTracking:!0},t)).data=p({player_software_name:"Shaka Player",player_software_version:e.constructor.version,player_mux_plugin_name:"shakaplayer-mux",player_mux_plugin_version:"5.10.2"},t.data);var g=c().utils.generateShortID();e.mux={},e.mux.emit=function(e,t){c().emit(g,e,t)},t.getPlayheadTime=function(){return d(i("currentTime"))},t.getStateData=function(){var t=e.getStats();return{player_is_paused:i("paused"),player_width:r("width"),player_height:r("height"),video_source_height:t.height,video_source_width:t.width,player_is_fullscreen:m(),player_autoplay_on:i("autoplay"),player_preload_on:s(),video_source_url:e.getAssetUri(),video_source_duration:d(i("duration")),view_dropped_frame_count:t.droppedFrames,video_poster_url:i("poster"),player_language_code:i("lang")}};var _=["pause","play","playing","seeking","seeked","timeupdate","stalled","waiting","ended"],v={},y={},E=!1;y.onstatechange=function(t){!E&&e.getMediaElement()&&function(){E=!0;var t=e.getMediaElement();if(!t)return u.warn("[shakaPlayer-mux] Unable to getMediaElement() on shaka.Player instance when attempting to attachMediaElementEvents()");_.forEach((function(n){v[n]=function(){var i={};"timeupdate"===n&&(i.player_playhead_time=t.currentTime),e.mux.emit(n,i)},t.addEventListener(n,v[n],!1)}))}(),"load"===t.state&&e.mux.emit("playerready")};var b={video_source_bitrate:void 0,video_source_codec:void 0,video_source_fps:void 0},S=function(){var t=function(){var t,n,i=e.getVariantTracks(),o=i&&i.filter((function(e){return e.active})),r=o&&o.map((function(e){return e.bandwidth}));return{video_source_bitrate:r&&r.reduce((function(e,t){return e+t}),0),video_source_codec:null==o||null===(t=o[0])||void 0===t?void 0:t.videoCodec,video_source_fps:null==o||null===(n=o[0])||void 0===n?void 0:n.frameRate}}();t&&JSON.stringify(t)!==JSON.stringify(b)&&(b=t,e.mux.emit("renditionchange",t))};y.adaptation=function(){S()},y.variantchanged=function(){S()},e.addEventListener("onstatechange",y.onstatechange),e.addEventListener("adaptation",y.adaptation),e.addEventListener("variantchanged",y.variantchanged);var A=function(e){var t,i;if(e.message)return e.message;var o=null===(t=n.util)||void 0===t||null===(i=t.Error)||void 0===i?void 0:i.Code;for(var r in o)if(o[r]===e.code)return r;return e.code},T=function(t){var n;2===(null==t?void 0:t.severity)&&e.mux.emit("error",{player_error_code:t.code,player_error_message:A(t),player_error_context:null===(n=t.data)||void 0===n?void 0:n.toString()})};y.error=function(e){if(t.automaticErrorTracking){var n=e.detail;T(n)}},e.addEventListener("error",y.error),e.mux.destroy=function(){Object.keys(y).forEach((function(t){e.removeEventListener(t,y[t]),delete y[t]})),Object.keys(v).forEach((function(t){var n=e.getMediaElement();n&&n.removeEventListener(t,v[t],!1),delete v[t]})),e.mux.emit("destroy")};var O={0:"manifest",1:"media"};return e.getNetworkingEngine().registerResponseFilter((function(t,n){var i=c().utils.now();if(!n.fromCache){var o=O[t&&t.toString()];if(t){var r={request_bytes_loaded:n.data.byteLength,request_hostname:h(n.uri),request_url:n.uri,request_response_headers:n.headers,request_type:o,request_start:n.timeMs?i-n.timeMs:void 0,request_response_end:i};e.mux.emit("requestcompleted",r)}}})),c().init(g,t),{emit:e.mux.emit,loadErrorHandler:T}};m.utils=c().utils,t.default=m},153:function(e,t,n){var i,o=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},r=n(558);"undefined"!=typeof document?i=document:(i=o["__GLOBAL_DOCUMENT_CACHE@4"])||(i=o["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=i},48:function(e,t,n){var i;i="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e.exports=i},961:function(e){var t;t=function(){return function(){var e={80:function(e,t,n){e.exports=n(728).default},728:function(e,t,n){"use strict";n.d(t,{default:function(){return ft}});var i=n(48),o=n.n(i),r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},a=function(){return("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6)},s=function(e){return e&&void 0!==e.nodeName?(e.muxId||(e.muxId=e.id||a()),e.muxId):e},c=function(e){var t;e&&void 0!==e.nodeName?e=s(t=e):t=document.querySelector(e);var n=t&&t.nodeName?t.nodeName.toLowerCase():"";return[t,e,n]},l=n(640),u=n.n(l),d=u().methodFactory;u().methodFactory=function(e,t,n){var i=d(e,t,n);return function(){for(var e=["[mux]"],t=0;t=0||0===i.toLowerCase().indexOf("x-litix-"))&&(t[i]=n.join(": "))}})),t}function T(e){if(e){var t=b.find((function(t){return void 0!==e[t]}));return t?e[t]:void 0}}var O=function(e){var t={};for(var n in e){var i=e[n];-1!==i["DATA-ID"].search("io.litix.data.")&&(t[i["DATA-ID"].replace("io.litix.data.","")]=i.VALUE)}return t};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function C(e){for(var t=1;t0&&(i=A(p[p.length-1]._responseHeaders||"")),{requestStart:c,requestResponseStart:l,requestResponseEnd:u,requestBytesLoaded:s,requestResponseHeaders:i,requestMediaDuration:d,requestHostname:r,requestUrl:a,requestId:i?T(i):void 0}},M=function(e){var t;return null===(t=e.match(/.*codecs\*?="(.*)"/))||void 0===t?void 0:t[1]},x=0,U=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"on",value:function(e,t,n){return t._eventEmitterGuid=t._eventEmitterGuid||++x,this._listeners=this._listeners||{},this._listeners[e]=this._listeners[e]||[],n&&(t=t.bind(n)),this._listeners[e].push(t),t}},{key:"off",value:function(e,t){var n=this._listeners&&this._listeners[e];n&&n.forEach((function(e,i){e._eventEmitterGuid===t._eventEmitterGuid&&n.splice(i,1)}))}},{key:"one",value:function(e,t,n){var i=this;t._eventEmitterGuid=t._eventEmitterGuid||++x;var o=function o(){i.off(e,o),t.apply(n||this,arguments)};o._eventEmitterGuid=t._eventEmitterGuid,this.on(e,o)}},{key:"emit",value:function(e,t){var n=this;if(this._listeners){t=t||{};var i=this._listeners["before*"]||[],o=this._listeners[e]||[],r=this._listeners["after"+e]||[],a=function(t,i){(t=t.slice()).forEach((function(t){t.call(n,{type:e},i)}))};a(i,t),a(o,t),a(r,t)}}}],n&&function(e,t){for(var n=0;n=0&&e>this._playbackTimeTrackerLastPlayheadPosition?n=e-this._playbackTimeTrackerLastPlayheadPosition:this._isAdPlaying&&(n=t-this._lastTime),n>0&&n<=1e3&&E(this.pm.data,"view_content_playback_time",n),this._playbackTimeTrackerLastPlayheadPosition=e,this._lastTime=t}}])&&function(e,t){for(var n=0;nW&&(t.emit("viewend"),t.send("viewend"),t.mux.log.warn("Ending view after rebuffering for longer than ".concat(W,"ms, future events will be ignored unless a programchange or videochange occurs.")))}t.data.view_watch_time>=0&&t.data.view_rebuffer_count>0&&(t.data.view_rebuffer_frequency=t.data.view_rebuffer_count/t.data.view_watch_time,t.data.view_rebuffer_percentage=t.data.view_rebuffer_duration/t.data.view_watch_time)};t.on("playbackheartbeat",(function(e,t){return o(t)})),t.on("rebufferstart",(function(e,o){n||(E(t.data,"view_rebuffer_count",1),n=o.viewer_time,t.one("rebufferend",i))})),t.on("viewinit",(function(){n=void 0,t.off("rebufferend",i)}))}})),j=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pm=t,t.disableRebufferTracking||t.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,t.on("playbackheartbeat",this._checkIfRebuffering.bind(this)),t.on("playbackheartbeatend",this._cleanupRebufferTracker.bind(this)),t.on("seeking",(function(){n._cleanupRebufferTracker(null,{viewer_time:h.now()})})))}var t,n;return t=e,n=[{key:"_checkIfRebuffering",value:function(e,t){if(this.pm.seekingTracker.isSeeking||this.pm.adTracker.isAdBreak||!this.pm.playbackHeartbeat._playheadShouldBeProgressing)this._cleanupRebufferTracker(e,t);else if(null!==this._lastCheckedTime)if(this._lastPlayheadTime===this.pm.data.player_playhead_time){var n=t.viewer_time-this._lastPlayheadTimeUpdatedTime;"number"==typeof this.pm.sustainedRebufferThreshold&&n>=this.pm.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),this._lastCheckedTime=t.viewer_time}else this._cleanupRebufferTracker(e,t,!0);else this._prepareRebufferTrackerState(t.viewer_time)}},{key:"_clearRebufferTrackerState",value:function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null}},{key:"_prepareRebufferTrackerState",value:function(e){this._lastCheckedTime=e,this._lastPlayheadTime=this.pm.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=e}},{key:"_cleanupRebufferTracker",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.pm.emit("rebufferend",{viewer_time:t.viewer_time});else{if(null===this._lastCheckedTime)return;var i=this.pm.data.player_playhead_time-this._lastPlayheadTime,o=t.viewer_time-this._lastPlayheadTimeUpdatedTime;"number"==typeof this.pm.minimumRebufferDuration&&i>0&&o-i>this.pm.minimumRebufferDuration&&(this._lastCheckedTime=null,this.pm.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.pm.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+o-i}))}n?this._prepareRebufferTrackerState(t.viewer_time):this._clearRebufferTrackerState()}}],n&&function(e,t){for(var n=0;n=0&&t.data.player_playhead_time>=0&&n._lastPlayerWidth>=0&&n._lastSourceWidth>0&&n._lastPlayerHeight>=0&&n._lastSourceHeight>0){var e=t.data.player_playhead_time-n._lastPlayheadPosition;if(e<0)return void(n._lastPlayheadPosition=-1);var i=Math.min(n._lastPlayerWidth/n._lastSourceWidth,n._lastPlayerHeight/n._lastSourceHeight),o=Math.max(0,i-1),r=Math.max(0,1-i);t.data.view_max_upscale_percentage=Math.max(t.data.view_max_upscale_percentage||0,o),t.data.view_max_downscale_percentage=Math.max(t.data.view_max_downscale_percentage||0,r),E(t.data,"view_total_content_playback_time",e),E(t.data,"view_total_upscaling",o*e),E(t.data,"view_total_downscaling",r*e)}n._lastPlayheadPosition=-1}))})),["playing","hb"].forEach((function(e){t.on(e,(function(){n._lastPlayheadPosition=t.data.player_playhead_time,n._lastPlayerWidth=t.data.player_width,n._lastPlayerHeight=t.data.player_height,n._lastSourceWidth=t.data.video_source_width,n._lastSourceHeight=t.data.video_source_height}))}))})),X=function(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isSeeking=!1;var i=-1,o=function(){var e=h.now(),o=(t.data.viewer_time||e)-(i||e);E(t.data,"view_seek_duration",o),t.data.view_max_seek_time=Math.max(t.data.view_max_seek_time||0,o),n.isSeeking=!1,i=-1};t.on("seeking",(function(e,r){Object.assign(t.data,r),n.isSeeking&&r.viewer_time-i<=2e3?i=r.viewer_time:(n.isSeeking&&o(),n.isSeeking=!0,i=r.viewer_time,E(t.data,"view_seek_count",1),t.send("seeking"))})),t.on("seeked",(function(){o()})),t.on("viewend",(function(){n.isSeeking&&(o(),t.send("seeked")),n.isSeeking=!1,i=-1}))}));function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}(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 Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(t.data.view_preroll_request_time=Math.max(0,i.viewer_time-n._adRequests[0].viewer_time)),t.data.view_start&&(t.data.view_startup_preroll_request_time=Math.max(0,i.viewer_time-t.data.view_start)),n._prerollPlayTime=i.viewer_time)})),t.on("adplaying",(function(e,i){n.inPrerollPosition()&&void 0===t.data.view_preroll_load_time&&void 0!==n._prerollPlayTime&&(t.data.view_preroll_load_time=i.viewer_time-n._prerollPlayTime,t.data.view_startup_preroll_load_time=i.viewer_time-n._prerollPlayTime)})),t.on("adclicked",(function(e,i){n._wouldBeNewAdPlay||E(t.data,"view_ad_clicked_count")})),t.on("adskipped",(function(e,i){n._wouldBeNewAdPlay||E(t.data,"view_ad_skipped_count")})),t.on("adended",(function(){n._wouldBeNewAdPlay=!0})),t.on("aderror",(function(){n._wouldBeNewAdPlay=!0}))}var t,n;return t=e,(n=[{key:"inPrerollPosition",value:function(){return void 0===this.pm.data.view_content_playback_time||this.pm.data.view_content_playback_time<=1e3}},{key:"findAdRequest",value:function(e){for(var t=0;t3e4&&(t.emit("devicesleep",{viewer_time:o}),Object.assign(t.data,{viewer_time:o}),t.send("devicesleep"),t.emit("devicewake",{viewer_time:i}),Object.assign(t.data,{viewer_time:i}),t.send("devicewake"))};t.one("playbackheartbeat",i),t.on("playbackheartbeatend",(function(){t.off("before*",o),t.one("playbackheartbeat",i)}))})),oe=n(375),re=n(655),ae=n.n(re),se="muxData",ce=function(){var e;try{e=oe.parse(ae().get(se)||"")}catch(t){e={}}return e},le=function(e){try{ae().set(se,oe.stringify(e),{expires:365})}catch(e){}},ue=function(){var e=ce();return e.mux_viewer_id=e.mux_viewer_id||r(),e.msn=e.msn||Math.random(),le(e),{mux_viewer_id:e.mux_viewer_id,mux_sample_number:e.msn}},de=function(){var e;switch(pe()){case"cellular":e="cellular";break;case"ethernet":e="wired";break;case"wifi":e="wifi";break;case void 0:break;default:e="other"}return e},pe=function(){var e=o().navigator,t=e&&(e.connection||e.mozConnection||e.webkitConnection);return t&&t.type};de.getConnectionFromAPI=pe;var fe=de,he=ge({a:"env",b:"beacon",c:"custom",d:"ad",e:"event",f:"experiment",i:"internal",m:"mux",n:"response",p:"player",q:"request",r:"retry",s:"session",t:"timestamp",u:"viewer",v:"video",w:"page",x:"view",y:"sub"}),me=ge({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",ca:"cached",cb:"cancel",cc:"codec",cd:"code",cg:"category",ch:"changed",ck:"clicked",cl:"canceled",cn:"config",co:"count",ce:"counter",cp:"complete",cr:"creative",ct:"content",cu:"current",cx:"connection",cz:"context",dg:"downscaling",dm:"domain",dn:"cdn",do:"downscale",dr:"drm",dp:"dropped",du:"duration",dv:"device",ec:"encoding",ed:"edge",en:"end",eg:"engine",em:"embed",er:"error",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ep:"experiments",fa:"failed",fi:"first",fm:"family",ft:"format",fp:"fps",fq:"frequency",fr:"frame",fs:"fullscreen",ha:"has",hb:"holdback",he:"headers",ho:"host",hn:"hostname",ht:"height",id:"id",ii:"init",in:"instance",ip:"ip",is:"is",ke:"key",la:"language",lb:"labeled",le:"level",li:"live",ld:"loaded",lo:"load",ls:"lists",lt:"latency",ma:"max",md:"media",me:"message",mf:"manifest",mi:"mime",ml:"midroll",mm:"min",mn:"manufacturer",mo:"model",mx:"mux",ne:"newest",nm:"name",no:"number",on:"on",os:"os",pa:"paused",pb:"playback",pd:"producer",pe:"percentage",pf:"played",pg:"program",ph:"playhead",pi:"plugin",pl:"preroll",pn:"playing",po:"poster",pr:"preload",ps:"position",pt:"part",py:"property",ra:"rate",rd:"requested",re:"rebuffer",rf:"rendition",rm:"remote",ro:"ratio",rp:"response",rq:"request",rs:"requests",sa:"sample",sd:"skipped",se:"session",sk:"seek",sm:"stream",so:"source",sq:"sequence",sr:"series",st:"start",su:"startup",sv:"server",sw:"software",ta:"tag",tc:"tech",te:"text",tg:"target",th:"throughput",ti:"time",tl:"total",to:"to",tt:"title",ty:"type",ug:"upscaling",un:"universal",up:"upscale",ur:"url",us:"user",va:"variant",vd:"viewed",vi:"video",ve:"version",vw:"view",vr:"viewer",wd:"width",wa:"watch",wt:"waiting"});function ge(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function _e(e){var t={},n={};return Object.keys(e).forEach((function(i){var o=!1;if(e.hasOwnProperty(i)&&void 0!==e[i]){var r=i.split("_"),a=r[0],s=he[a];s||(p.info("Data key word `"+r[0]+"` not expected in "+i),s=a+"_"),r.splice(1).forEach((function(e){"url"===e&&(o=!0),me[e]?s+=me[e]:Number(e)&&Math.floor(Number(e))===Number(e)?s+=e:(p.info("Data key word `"+e+"` not expected in "+i),s+="_"+e+"_")})),o?n[s]=e[i]:t[s]=e[i]}})),Object.assign(t,n)}var ve={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},ye=["hb","requestcompleted","requestfailed","requestcanceled"],Ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._beaconUrl=e||"https://img.litix.io",this._eventQueue=[],this._postInFlight=!1,this._failureCount=0,this._sendTimeout=!1,this._options=Object.assign({},ve,t)};Ee.prototype.queueEvent=function(e,t){var n=Object.assign({},t);return(this._eventQueue.length<=this._options.maxQueueLength||"eventrateexceeded"===e)&&(this._eventQueue.push(n),this._sendTimeout||this._startBeaconSending(),this._eventQueue.length<=this._options.maxQueueLength)},Ee.prototype.flushEvents=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&1===this._eventQueue.length?this._eventQueue.pop():(this._eventQueue.length&&this._sendBeaconQueue(),this._startBeaconSending())},Ee.prototype.destroy=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.destroyed=!0,e?this._clearBeaconQueue():this.flushEvents(),o().clearTimeout(this._sendTimeout)},Ee.prototype._clearBeaconQueue=function(){var e=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,t=this._eventQueue.slice(e);e>0&&Object.assign(t[t.length-1],_e({mux_view_message:"event queue truncated"}));var n=this._createPayload(t);Se(this._beaconUrl,n,!0,(function(){}))},Ee.prototype._sendBeaconQueue=function(){var e=this;if(!this._postInFlight){var t=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0;var n=this._createPayload(t),i=h.now();Se(this._beaconUrl,n,!1,(function(n,o){o?(e._eventQueue=t.concat(e._eventQueue),e._failureCount+=1,p.info("Error sending beacon: "+o)):e._failureCount=0,e._roundTripTime=h.now()-i,e._postInFlight=!1}))}},Ee.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var e=Math.pow(2,this._failureCount-1);return(1+(e*=Math.random()))*this._options.baseTimeBetweenBeacons},Ee.prototype._startBeaconSending=function(){var e=this;o().clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=o().setTimeout((function(){e._eventQueue.length&&e._sendBeaconQueue(),e._startBeaconSending()}),this._getNextBeaconTime()))},Ee.prototype._createPayload=function(e){var t,n,i,o=this,r={transmission_timestamp:Math.round(h.now())};this._roundTripTime&&(r.rtt_ms=Math.round(this._roundTripTime));var a=function(){t=JSON.stringify({metadata:r,events:n||e}),i=t.length/1024},s=function(){return i<=o._options.maxPayloadKBSize};return a(),s()||(p.info("Payload size is too big ("+i+" kb). Removing unnecessary events."),n=e.filter((function(e){return-1===ye.indexOf(e.e)})),a()),s()||(p.info("Payload size still too big ("+i+" kb). Cropping fields.."),n.forEach((function(e){for(var t in e){var n=e[t];"string"==typeof n&&n.length>51200&&(e[t]=n.substring(0,51200))}})),a()),t};var be=function(e){return e.length<=57344},Se=function(e,t,n,i){if(n&&navigator&&navigator.sendBeacon&&navigator.sendBeacon(e,t))i();else if(o().fetch)o().fetch(e,{method:"POST",body:t,headers:{"Content-Type":"text/plain"},keepalive:be(t)}).then((function(e){return i(null,e.ok?null:"Error")})).catch((function(e){return i(null,e)}));else{if(o().XMLHttpRequest){var r=new(o().XMLHttpRequest);return r.onreadystatechange=function(){if(4===r.readyState)return i(null,200!==r.status?"error":void 0)},r.open("POST",e),r.setRequestHeader("Content-Type","text/plain"),void r.send(t)}i()}},Ae=Ee;function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),Ne(this,"previousBeaconData",null),Ne(this,"lastEventTime",0),Ne(this,"rateLimited",!1),this.mux=t,this.envKey=n,this.options=y,this.eventQueue=new Ae(function(e,t){var n=t.beaconCollectionDomain,i=t.beaconDomain;if(n)return"https://"+n;var o=i||"litix.io";return(e=e||"inferred").match(/^[a-z0-9]+$/)?"https://"+e+"."+o:"https://img.litix.io/a.gif"}(this.envKey,this.options)),this.sampleRate=null!==(i=this.options.sampleRate)&&void 0!==i?i:1,this.disableCookies=null!==(r=this.options.disableCookies)&&void 0!==r&&r,this.respectDoNotTrack=null!==(a=this.options.respectDoNotTrack)&&void 0!==a&&a,this.previousBeaconData=null,this.lastEventTime=0,this.rateLimited=!1,this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:null===(s=this.options.platform)||void 0===s?void 0:s.name,viewer_application_version:null===(c=this.options.platform)||void 0===c?void 0:c.version,viewer_application_engine:null===(l=this.options.platform)||void 0===l?void 0:l.layout,viewer_device_name:null===(u=this.options.platform)||void 0===u?void 0:u.product,viewer_device_category:"",viewer_device_manufacturer:null===(d=this.options.platform)||void 0===d?void 0:d.manufacturer,viewer_os_family:null===(p=this.options.platform)||void 0===p||null===(f=p.os)||void 0===f?void 0:f.family,viewer_os_architecture:null===(h=this.options.platform)||void 0===h||null===(m=h.os)||void 0===m?void 0:m.architecture,viewer_os_version:null===(g=this.options.platform)||void 0===g||null===(_=g.os)||void 0===_?void 0:_.version,viewer_connection_type:fe(),page_url:null===o()||void 0===o()||null===(v=o().location)||void 0===v?void 0:v.href},this.viewerData=this.disableCookies?{}:ue()}var t,n;return t=e,(n=[{key:"send",value:function(e,t){var n;if(e&&null!=t&&t.view_id){if(this.respectDoNotTrack&&f())return p.info("Not sending `"+e+"` because Do Not Track is enabled");if(!t||"object"!==Ce(t))return p.error("A data object was expected in send() but was not provided");var i,o,a=this.disableCookies?{}:(i=ce(),o=h.now(),i.session_start&&(i.sst=i.session_start,delete i.session_start),i.session_id&&(i.sid=i.session_id,delete i.session_id),i.session_expires&&(i.sex=i.session_expires,delete i.session_expires),(!i.sex||i.sex=this.sampleRate,l=_e(this._deduplicateBeaconData(e,s));if(this.lastEventTime=this.mux.utils.now(),c)return p.info("Not sending event due to sample rate restriction",e,s,l);if(this.envKey||p.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",e,s,l),!this.rateLimited)if(p.info("Sending event",e,s,l),this.rateLimited=!this.eventQueue.queueEvent(e,l),this.mux.WINDOW_UNLOADING&&"viewend"===e)this.eventQueue.destroy(!0);else if(this.mux.WINDOW_HIDDEN&&"hb"===e?this.eventQueue.flushEvents(!0):ke.indexOf(e)>=0&&this.eventQueue.flushEvents(),this.rateLimited)return s.event="eventrateexceeded",l=_e(s),this.eventQueue.queueEvent(s.event,l),p.error("Beaconing disabled due to rate limit.")}}},{key:"destroy",value:function(){this.eventQueue.destroy(!1)}},{key:"_deduplicateBeaconData",value:function(e,t){var n=this,i={},o=t.view_id;if("-1"===o||"viewstart"===e||"viewend"===e||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)i=Ie({},t),o&&(this.previousBeaconData=i),o&&"viewend"===e&&(this.previousBeaconData=null);else{var r=0===e.indexOf("request");Object.entries(t).forEach((function(t){var o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),2!==r.length);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return r}}(e)||function(e,t){if(e){if("string"==typeof e)return Te(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Te(e,2):void 0}}(e)||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.")}()}(t),a=o[0],s=o[1];n.previousBeaconData&&(s!==n.previousBeaconData[a]||Le.indexOf(a)>-1||n.objectHasChanged(r,a,s,n.previousBeaconData[a])||n.eventRequiresKey(e,a))&&(i[a]=s,n.previousBeaconData[a]=s)}))}return i}},{key:"objectHasChanged",value:function(e,t,n,i){return!(!e||0!==t.indexOf("request_")||"request_response_headers"!==t&&"object"===Ce(n)&&"object"===Ce(i)&&Object.keys(n||{}).length===Object.keys(i||{}).length)}},{key:"eventRequiresKey",value:function(e,t){return"renditionchange"===e&&0===t.indexOf("video_source_")||!(!Pe.includes(t)||!Re.includes(e))}}])&&function(e,t){for(var n=0;n0&&f&&f>0){var h=f/l*8e3;a++,i+=f,o+=l,t.data.view_min_request_throughput=Math.min(t.data.view_min_request_throughput||1/0,h),t.data.view_average_request_throughput=i/o*8e3,t.data.view_request_count=r,c>0&&(n+=c,t.data.view_max_request_latency=Math.max(t.data.view_max_request_latency||0,c),t.data.view_average_request_latency=n/a)}})),t.on("requestfailed",(function(e,n){r++,s++,t.data.view_request_count=r,t.data.view_request_failed_count=s})),t.on("requestcanceled",(function(e,n){r++,c++,t.data.view_request_count=r,t.data.view_request_canceled_count=c}))})),Me=function(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.on("before*",(function(e,i){var o=i.viewer_time,r=h.now(),a=n._lastEventTime;if(n._lastEventTime=r,a&&r-a>36e5){var s=Object.keys(t.data).reduce((function(e,n){return 0===n.indexOf("video_")?Object.assign(e,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},n,t.data[n])):e}),{});t.mux.log.info("Received event after at least an hour inactivity, creating a new view"),t.emit("viewinit",Object.assign({viewer_time:o},s)),t.playbackHeartbeat._playheadShouldBeProgressing&&"play"!==e.type&&"adbreakstart"!==e.type&&(t.emit("play",{viewer_time:o}),"playing"!==e.type&&t.emit("playing",{viewer_time:o}))}}))}));function xe(e){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(e)}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0||t.video_source_duration>0)&&(t.video_source_is_live=!1)),t.video_source_is_live||["player_program_time","player_manifest_newest_program_time","player_live_edge_program_time","player_program_time","video_holdback","video_part_holdback","video_target_duration","video_part_target_duration"].forEach((function(e){t[e]=void 0})),t.video_source_url=t.video_source_url||t.player_source_url,t.video_source_url){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),2!==r.length);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return r}}(e)||function(e,t){if(e){if("string"==typeof e)return Ue(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(e,2):void 0}}(e)||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.")}()}(g(t.video_source_url)),i=n[0],o=n[1];t.video_source_domain=o,t.video_source_hostname=i}delete t.ad_request_id,this.playbackEventDispatcher.send(e,t),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat(),"viewend"===e&&delete this.data.view_id}}},{key:"_updateStateData",value:function(){Object.assign(this.data,this.getStateData()),this.playheadTime._updatePlayheadTime(),this._sanitizeData()}},{key:"_sanitizeData",value:function(){var e=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach((function(t){var n=parseInt(e.data[t],10);e.data[t]=isNaN(n)?void 0:n})),["player_source_url","video_source_url"].forEach((function(t){if(e.data[t]){var n=e.data[t].toLowerCase();0!==n.indexOf("data:")&&0!==n.indexOf("blob:")||(e.data[t]="MSE style URL")}}))}},{key:"_resetVideoData",value:function(e,t){var n=this;Object.keys(this.data).forEach((function(e){0===e.indexOf("video_")&&delete n.data[e]}))}},{key:"_resetViewData",value:function(){var e=this;Object.keys(this.data).forEach((function(t){0===t.indexOf("view_")&&delete e.data[t]})),this.data.view_sequence_number=1}},{key:"_resetErrorData",value:function(e,t){delete this.data.player_error_code,delete this.data.player_error_message}},{key:"_initializeViewData",value:function(){var e=this,t=this.data.view_id=r(),n=function(){t===e.data.view_id&&E(e.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",n):n()}},{key:"_restartHeartBeat",value:function(){var e=this;window.clearTimeout(this._heartBeatTimeout),this.errorTracker.viewErrored||(this._heartBeatTimeout=window.setTimeout((function(){e.data.player_is_paused||e.emit("hb")}),1e4))}},{key:"addHLSJS",value:function(e){e.hlsjs?this.hlsjs?this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=e.hlsjs,function(e,t,n){var i=arguments.length>4?arguments[4]:void 0,o=e.log,r=e.utils.secondsToMs,a=function(e){var t,n=parseInt(i.version);return 1===n&&null!==e.programDateTime&&(t=e.programDateTime),0===n&&null!==e.pdt&&(t=e.pdt),t};if(_()){var s=function(n,i){return e.emit(t,n,i)},c=function(e,t){var n=t.levels,i=t.audioTracks,o=t.url,r=t.stats,a=t.networkDetails,c=t.sessionData,l={},u={};n.forEach((function(e,t){l[t]={width:e.width,height:e.height,bitrate:e.bitrate,attrs:e.attrs}})),i.forEach((function(e,t){u[t]={name:e.name,language:e.lang,bitrate:e.bitrate}}));var d=L(r),p=d.bytesLoaded,f=d.requestStart,h=d.responseStart,g=d.responseEnd;s("requestcompleted",C(C({},O(c)),{},{request_event_type:e,request_bytes_loaded:p,request_start:f,request_response_start:h,request_response_end:g,request_type:"manifest",request_hostname:m(o),request_response_headers:R(a),request_rendition_lists:{media:l,audio:u,video:{}}}))};n.on(i.Events.MANIFEST_LOADED,c);var l=function(e,t){var n=t.details,i=t.level,o=t.networkDetails,c=t.stats,l=L(c),u=l.bytesLoaded,d=l.requestStart,p=l.responseStart,f=l.responseEnd,h=n.fragments[n.fragments.length-1],g=a(h)+r(h.duration);s("requestcompleted",{request_event_type:e,request_bytes_loaded:u,request_start:d,request_response_start:p,request_response_end:f,request_current_level:i,request_type:"manifest",request_hostname:m(n.url),request_response_headers:R(o),video_holdback:n.holdBack&&r(n.holdBack),video_part_holdback:n.partHoldBack&&r(n.partHoldBack),video_part_target_duration:n.partTarget&&r(n.partTarget),video_target_duration:n.targetduration&&r(n.targetduration),video_source_is_live:n.live,player_manifest_newest_program_time:isNaN(g)?void 0:g})};n.on(i.Events.LEVEL_LOADED,l);var u=function(e,t){var n=t.details,i=t.networkDetails,o=t.stats,r=L(o),a=r.bytesLoaded,c=r.requestStart,l=r.responseStart,u=r.responseEnd;s("requestcompleted",{request_event_type:e,request_bytes_loaded:a,request_start:c,request_response_start:l,request_response_end:u,request_type:"manifest",request_hostname:m(n.url),request_response_headers:R(i)})};n.on(i.Events.AUDIO_TRACK_LOADED,u);var d=function(e,t){var i=t.stats,o=t.networkDetails,r=t.frag;i=i||r.stats;var a=L(i),c=a.bytesLoaded,l=a.requestStart,u=a.responseStart,d=a.responseEnd,p=o?R(o):void 0,f={request_event_type:e,request_bytes_loaded:c,request_start:l,request_response_start:u,request_response_end:d,request_hostname:o?m(o.responseURL):void 0,request_id:p?T(p):void 0,request_response_headers:p,request_media_duration:r.duration,request_url:null==o?void 0:o.responseURL};"main"===r.type?(f.request_type="media",f.request_current_level=r.level,f.request_video_width=(n.levels[r.level]||{}).width,f.request_video_height=(n.levels[r.level]||{}).height,f.request_labeled_bitrate=(n.levels[r.level]||{}).bitrate):f.request_type=r.type,s("requestcompleted",f)};n.on(i.Events.FRAG_LOADED,d);var p=function(e,t){var n=t.frag,i=n.start,o={currentFragmentPDT:a(n),currentFragmentStart:r(i)};s("fragmentchange",o)};n.on(i.Events.FRAG_CHANGED,p);var f=function(e,t){var n=t.type,o=t.details,r=t.response,a=t.fatal,c=t.frag,l=t.networkDetails,u=(null==c?void 0:c.url)||t.url||"",d=l?R(l):void 0;if(o!==i.ErrorDetails.MANIFEST_LOAD_ERROR&&o!==i.ErrorDetails.MANIFEST_LOAD_TIMEOUT&&o!==i.ErrorDetails.FRAG_LOAD_ERROR&&o!==i.ErrorDetails.FRAG_LOAD_TIMEOUT&&o!==i.ErrorDetails.LEVEL_LOAD_ERROR&&o!==i.ErrorDetails.LEVEL_LOAD_TIMEOUT&&o!==i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&o!==i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT&&o!==i.ErrorDetails.SUBTITLE_LOAD_ERROR&&o!==i.ErrorDetails.SUBTITLE_LOAD_TIMEOUT&&o!==i.ErrorDetails.KEY_LOAD_ERROR&&o!==i.ErrorDetails.KEY_LOAD_TIMEOUT||s("requestfailed",{request_error:o,request_url:u,request_hostname:m(u),request_id:d?T(d):void 0,request_type:o===i.ErrorDetails.FRAG_LOAD_ERROR||o===i.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":o===i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR||o===i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT?"audio":o===i.ErrorDetails.SUBTITLE_LOAD_ERROR||o===i.ErrorDetails.SUBTITLE_LOAD_TIMEOUT?"subtitle":o===i.ErrorDetails.KEY_LOAD_ERROR||o===i.ErrorDetails.KEY_LOAD_TIMEOUT?"encryption":"manifest",request_error_code:null==r?void 0:r.code,request_error_text:null==r?void 0:r.text}),a){var p,f="".concat(u?"url: ".concat(u,"\n"):"")+"".concat(r&&(r.code||r.text)?"response: ".concat(r.code,", ").concat(r.text,"\n"):"")+"".concat(t.reason?"failure reason: ".concat(t.reason,"\n"):"")+"".concat(t.level?"level: ".concat(t.level,"\n"):"")+"".concat(t.parent?"parent stream controller: ".concat(t.parent,"\n"):"")+"".concat(t.buffer?"buffer length: ".concat(t.buffer,"\n"):"")+"".concat(t.error?"error: ".concat(t.error,"\n"):"")+"".concat(t.event?"event: ".concat(t.event,"\n"):"")+"".concat(t.err?"error message: ".concat(null===(p=t.err)||void 0===p?void 0:p.message,"\n"):"");s("error",{player_error_code:n,player_error_message:o,player_error_context:f})}};n.on(i.Events.ERROR,f);var h=function(e,t){var n=t.frag,i=n&&n._url||"";s("requestcanceled",{request_event_type:e,request_url:i,request_type:"media",request_hostname:m(i)})};n.on(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,h);var g=function(e,t){var i=t.level,r=n.levels[i];if(r&&r.attrs&&r.attrs.BANDWIDTH){var a,c=r.attrs.BANDWIDTH,l=parseFloat(r.attrs["FRAME-RATE"]);isNaN(l)||(a=l),c?s("renditionchange",{video_source_fps:a,video_source_bitrate:c,video_source_width:r.width,video_source_height:r.height,video_source_rendition_name:r.name,video_source_codec:null==r?void 0:r.videoCodec}):o.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};n.on(i.Events.LEVEL_SWITCHED,g),n._stopMuxMonitor=function(){n.off(i.Events.MANIFEST_LOADED,c),n.off(i.Events.LEVEL_LOADED,l),n.off(i.Events.AUDIO_TRACK_LOADED,u),n.off(i.Events.FRAG_LOADED,d),n.off(i.Events.FRAG_CHANGED,p),n.off(i.Events.ERROR,f),n.off(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,h),n.off(i.Events.LEVEL_SWITCHED,g),n.off(i.Events.DESTROYING,n._stopMuxMonitor),delete n._stopMuxMonitor},n.on(i.Events.DESTROYING,n._stopMuxMonitor)}else o.warn("performance timing not supported. Not tracking HLS.js.")}(this.mux,this.id,e.hlsjs,{},e.Hls||window.Hls)):this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")}},{key:"removeHLSJS",value:function(){var e;this.hlsjs&&((e=this.hlsjs)&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor(),this.hlsjs=void 0)}},{key:"addDashJS",value:function(e){e.dashjs?this.dashjs?this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=e.dashjs,function(e,t,n){var i=e.log;if(n&&n.on){var o=function(n,i){return e.emit(t,n,i)},r=function(e){var t=e.type,n=(e.data||{}).url;o("requestcompleted",{request_event_type:t,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:m(n),request_url:n})};n.on("manifestLoaded",r);var a={},s=function(e){var t=e.type,i=e.fragmentModel,r=(e.chunk||{}).mediaInfo||{},s=r.type,c=r.bitrateList,l={};(c=c||[]).forEach((function(e,t){l[t]={},l[t].width=e.width,l[t].height=e.height,l[t].bitrate=e.bandwidth,l[t].attrs={}})),"video"===s?a.video=l:"audio"===s?a.audio=l:a.media=l;var u=w(i,n),d=u.requestStart,p=u.requestResponseStart,f=u.requestResponseEnd,h=u.requestResponseHeaders,m=u.requestMediaDuration,g=u.requestHostname,_=u.requestUrl,v=u.requestId;o("requestcompleted",{request_event_type:t,request_start:d,request_response_start:p,request_response_end:f,request_bytes_loaded:-1,request_type:s+"_init",request_response_headers:h,request_hostname:g,request_id:v,request_url:_,request_media_duration:m,request_rendition_lists:a})};n.on("initFragmentLoaded",s);var c=function(e){var t=e.type,i=e.fragmentModel,r=e.chunk||{},a=r.mediaInfo,s=r.start,c=(a||{}).type,l=w(i,n),u=l.requestStart,d=l.requestResponseStart,p=l.requestResponseEnd,f=l.requestBytesLoaded,h=l.requestResponseHeaders,m=l.requestMediaDuration,g=l.requestHostname,_=l.requestUrl,v=l.requestId,y=function(e,t){var n=t.getQualityFor(e),i=t.getCurrentTrackFor(e).bitrateList;return i?{currentLevel:n,renditionWidth:i[n].width||null,renditionHeight:i[n].height||null,renditionBitrate:i[n].bandwidth}:{}}(c,n),E=y.currentLevel,b=y.renditionWidth,S=y.renditionHeight,A=y.renditionBitrate;o("requestcompleted",{request_event_type:t,request_start:u,request_response_start:d,request_response_end:p,request_bytes_loaded:f,request_type:c,request_response_headers:h,request_hostname:g,request_id:v,request_url:_,request_media_start_time:s,request_media_duration:m,request_current_level:E,request_labeled_bitrate:A,request_video_width:b,request_video_height:S})};n.on("mediaFragmentLoaded",c);var l={video:void 0,audio:void 0,totalBitrate:void 0},u=function(e,t,r){if("number"==typeof e.newQuality){var a=e.mediaType;if("audio"===a||"video"===a){var s=n.getBitrateInfoListFor(a).find((function(t){return t.qualityIndex===e.newQuality}));if(s&&"number"==typeof s.bitrate){l[a]=k(k({},s),{},{codec:n.getCurrentTrackFor(a).codec});var c=function(){if(l.video&&"number"==typeof l.video.bitrate){if(l.video.width&&l.video.height){var e=l.video.bitrate;return l.audio&&"number"==typeof l.audio.bitrate&&(e+=l.audio.bitrate),e!==l.totalBitrate?(l.totalBitrate=e,{video_source_bitrate:e,video_source_height:l.video.height,video_source_width:l.video.width,video_source_codec:M(l.video.codec)}):void 0}i.warn("have bitrate info for video but missing width/height")}}();c&&o("renditionchange",c)}else i.warn("missing bitrate info for ".concat(a))}}else i.warn("missing evt.newQuality in qualityChangeRendered event",e)};n.on("qualityChangeRendered",u);var d=function(e){var t=e.request,n=e.mediaType;o("requestcanceled",{request_event_type:(t=t||{}).type+"_"+t.action,request_url:t.url,request_type:n,request_hostname:m(t.url)})};n.on("fragmentLoadingAbandoned",d);var p=function(e){var t,n,i=e.error,r=(null==i||null===(t=i.data)||void 0===t?void 0:t.request)||{},a=(null==i||null===(n=i.data)||void 0===n?void 0:n.response)||{};27===(null==i?void 0:i.code)&&o("requestfailed",{request_error:r.type+"_"+r.action,request_url:r.url,request_hostname:m(r.url),request_type:r.mediaType,request_error_code:a.status,request_error_text:a.statusText});var s="".concat(null!=r&&r.url?"url: ".concat(r.url,"\n"):"")+"".concat(null!=a&&a.status||null!=a&&a.statusText?"response: ".concat(null==a?void 0:a.status,", ").concat(null==a?void 0:a.statusText,"\n"):"");o("error",{player_error_code:null==i?void 0:i.code,player_error_message:null==i?void 0:i.message,player_error_context:s})};n.on("error",p),n._stopMuxMonitor=function(){n.off("manifestLoaded",r),n.off("initFragmentLoaded",s),n.off("mediaFragmentLoaded",c),n.off("qualityChangeRendered",u),n.off("error",p),n.off("fragmentLoadingAbandoned",d),delete n._stopMuxMonitor}}else i.warn("Invalid dash.js player reference. Monitoring blocked.")}(this.mux,this.id,e.dashjs)):this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")}},{key:"removeDashJS",value:function(){var e;this.dashjs&&((e=this.dashjs)&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor(),this.dashjs=void 0)}}],n&&function(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1;t=this.buffer.indexOf("\n"))this.processLine(this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},Qe.prototype.processLine=function(e){var t=e.indexOf(":"),n=rt(e,t),i=n[0],o=2===n.length?tt(n[1]):void 0;if("#"!==i[0])this.currentUri.uri=i,this.manifest.segments.push(this.currentUri),this.manifest.targetDuration&&!("duration"in this.currentUri)&&(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(i){case"#EXT-X-TARGETDURATION":if(!isFinite(o)||o<0)return;this.manifest.targetDuration=o,this.setHoldBack();break;case"#EXT-X-PART-INF":$e(this.manifest,n),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case"#EXT-X-SERVER-CONTROL":$e(this.manifest,n),this.setHoldBack();break;case"#EXTINF":0===o?this.currentUri.duration=.01:o>0&&(this.currentUri.duration=o);break;case"#EXT-X-PROGRAM-DATE-TIME":var r=o,a=new Date(r);this.manifest.dateTimeString||(this.manifest.dateTimeString=r,this.manifest.dateTimeObject=a),this.currentUri.dateTimeString=r,this.currentUri.dateTimeObject=a;break;case"#EXT-X-VERSION":$e(this.manifest,n);break;case"#EXT-X-SESSION-DATA":var s=at(n[1]),c=O(s);Object.assign(this.manifest.sessionData,c)}},Qe.prototype.setHoldBack=function(){var e=this.manifest,t=e.serverControl,n=e.targetDuration,i=e.partTargetDuration;if(t){var o="holdBack",r="partHoldBack",a=n&&3*n,s=i&&2*i;n&&!t.hasOwnProperty(o)&&(t[o]=a),a&&t[o]1&&(t[et(n[0])]=tt(n[1])),t},it=function(e){for(var t=e.split(","),n={},i=0;t.length>i;i++){var o=t[i],r=nt(o);n=Object.assign(r,n)}return n},ot=function(e){return e.indexOf("=")>-1},rt=function(e,t){return-1===t?[e]:[e.substring(0,t),e.substring(t+1)]},at=function(e){var t={};if(e){var n=e.search(",");return[e.slice(0,n),e.slice(n+1)].forEach((function(e,n){for(var i=e.replace(/['"]+/g,"").split("="),o=0;oe.length)&&(t=e.length);for(var n=0,i=new Array(t);n0){var c=o.getStartDate();if(c&&"function"==typeof c.getTime&&c.getTime()){var d=c.getTime();if(a.player_program_time=d+s,o.seekable.length>0){var p=d+o.seekable.end(o.seekable.length-1);a.player_live_edge_program_time=p}}}return a},o.mux=o.mux||{},o.mux.deleted=!1,o.mux.emit=function(t,n){e.emit(r,t,n)};var d=function(){s.error("The monitor for this video element has already been destroyed.")};o.mux.destroy=function(){Object.keys(o.mux.listeners).forEach((function(e){o.removeEventListener(e,o.mux.listeners[e],!1)})),delete o.mux.listeners,o.mux.destroy=d,o.mux.swapElement=d,o.mux.emit=d,o.mux.addHLSJS=d,o.mux.addDashJS=d,o.mux.removeHLSJS=d,o.mux.removeDashJS=d,o.mux.deleted=!0,e.emit(r,"destroy")},o.mux.swapElement=function(t){var n=ze(c(t),3),i=n[0],r=n[1],a=n[2];return i?"video"!==a&&"audio"!==a?e.log.error("The element of `"+r+"` was not a media element."):(i.muxId=o.muxId,delete o.muxId,i.mux=i.mux||{},i.mux.listeners=Object.assign({},o.mux.listeners),delete o.mux.listeners,Object.keys(i.mux.listeners).forEach((function(e){o.removeEventListener(e,i.mux.listeners[e],!1),i.addEventListener(e,i.mux.listeners[e],!1)})),i.mux.swapElement=o.mux.swapElement,i.mux.destroy=o.mux.destroy,delete o.mux,void(o=i)):e.log.error("No element was found with the `"+r+"` query selector.")},o.mux.addHLSJS=function(t){e.addHLSJS(r,t)},o.mux.addDashJS=function(t){e.addDashJS(r,t)},o.mux.removeHLSJS=function(){e.removeHLSJS(r)},o.mux.removeDashJS=function(){e.removeDashJS(r)},e.init(r,n),e.emit(r,"playerready"),o.paused||(e.emit(r,"play"),o.readyState>2&&e.emit(r,"playing")),o.mux.listeners={},Xe.forEach((function(t){("error"!==t||n.automaticErrorTracking)&&(o.mux.listeners[t]=function(){var n={};if("error"===t){if(!o.error)return;if(1===o.error.code)return;n.player_error_code=o.error.code,n.player_error_message=Ze[o.error.code]||o.error.message}e.emit(r,t,n)},o.addEventListener(t,o.mux.listeners[t],!1))}))}(dt,e,t)},destroyMonitor:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(r.push(i.value),1!==r.length);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return r}}(e)||function(e,t){if(e){if("string"==typeof e)return lt(e,1);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,1):void 0}}(e)||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.")}()}(c(e))[0];t&&t.mux&&"function"==typeof t.mux.destroy?t.mux.destroy():p.error("A video element monitor for `"+e+"` has not been initialized via `mux.monitor`.")},addHLSJS:function(e,t){var n=s(e);ut[n]?ut[n].addHLSJS(t):p.error("A monitor for `"+n+"` has not been initialized.")},addDashJS:function(e,t){var n=s(e);ut[n]?ut[n].addDashJS(t):p.error("A monitor for `"+n+"` has not been initialized.")},removeHLSJS:function(e){var t=s(e);ut[t]?ut[t].removeHLSJS():p.error("A monitor for `"+t+"` has not been initialized.")},removeDashJS:function(e){var t=s(e);ut[t]?ut[t].removeDashJS():p.error("A monitor for `"+t+"` has not been initialized.")},init:function(e,t){f()&&t&&t.respectDoNotTrack&&p.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var n=s(e);ut[n]=new Ke(dt,n,t)},emit:function(e,t,n){var i=s(e);ut[i]?(ut[i].emit(t,n),"destroy"===t&&delete ut[i]):p.error("A monitor for `"+i+"` has not been initialized.")},checkDoNotTrack:f,log:p,utils:ct,events:{PLAYER_READY:"playerready",VIEW_INIT:"viewinit",VIDEO_CHANGE:"videochange",PLAY:"play",PAUSE:"pause",PLAYING:"playing",TIME_UPDATE:"timeupdate",SEEKING:"seeking",SEEKED:"seeked",REBUFFER_START:"rebufferstart",REBUFFER_END:"rebufferend",ERROR:"error",ENDED:"ended",RENDITION_CHANGE:"renditionchange",ORIENTATION_CHANGE:"orientationchange",AD_REQUEST:"adrequest",AD_RESPONSE:"adresponse",AD_BREAK_START:"adbreakstart",AD_PLAY:"adplay",AD_PLAYING:"adplaying",AD_PAUSE:"adpause",AD_FIRST_QUARTILE:"adfirstquartile",AD_MID_POINT:"admidpoint",AD_THIRD_QUARTILE:"adthirdquartile",AD_ENDED:"adended",AD_BREAK_END:"adbreakend",AD_ERROR:"aderror",REQUEST_COMPLETED:"requestcompleted",REQUEST_FAILED:"requestfailed",REQUEST_CANCELLED:"requestcanceled"},WINDOW_HIDDEN:!1,WINDOW_UNLOADING:!1};Object.assign(dt,pt),void 0!==o()&&"function"==typeof o().addEventListener&&o().addEventListener("pagehide",(function(e){e.persisted||(dt.WINDOW_UNLOADING=!0)}),!1);var ft=dt},655:function(e,t,n){var i,o;function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}!function(a){var s=!1;if(void 0===(o="function"==typeof(i=a)?i.call(t,n,t,e):i)||(e.exports=o),s=!0,"object"===r(t)&&(e.exports=a(),s=!0),!s){var c=window.Cookies,l=window.Cookies=a();l.noConflict=function(){return window.Cookies=c,l}}}((function(){var e=function(){for(var e=0,t={};e1){if("number"==typeof(r=e({path:"/"},i.defaults,r)).expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*r.expires),r.expires=s}try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}t||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,u=0;u=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(r=n,!1!==i&&u(n),s.call(a,n,e),typeof console===t&&n{"use strict";function i(e){return e?(e.nodeName||"").toLowerCase():null}n.d(t,{Z:()=>i})},87401:(e,t,n)=>{"use strict";function i(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}n.d(t,{Z:()=>i})},11153:(e,t,n)=>{"use strict";n.d(t,{Re:()=>r,Zq:()=>a,kK:()=>o});var i=n(87401);function o(e){return e instanceof(0,i.Z)(e).Element||e instanceof Element}function r(e){return e instanceof(0,i.Z)(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof(0,i.Z)(e).ShadowRoot||e instanceof ShadowRoot)}},98566:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(33976),o=n(11153);const r={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},a=t.elements[e];(0,o.Re)(a)&&(0,i.Z)(a)&&(Object.assign(a.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],a=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});(0,o.Re)(r)&&(0,i.Z)(r)&&(Object.assign(r.style,s),Object.keys(a).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]}},75473:(e,t,n)=>{"use strict";function i(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect();return{width:n.width/1,height:n.height/1,top:n.top/1,right:n.right/1,bottom:n.bottom/1,left:n.left/1,x:n.left/1,y:n.top/1}}n.d(t,{fi:()=>ve});var o=n(87401);function r(e){var t=(0,o.Z)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}var a=n(11153);var s=n(33976);function c(e){return(((0,a.kK)(e)?e.ownerDocument:e.document)||window.document).documentElement}function l(e){return i(c(e)).left+r(e).scrollLeft}function u(e){return(0,o.Z)(e).getComputedStyle(e)}function d(e){var t=u(e),n=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}function p(e,t,n){void 0===n&&(n=!1);var u=(0,a.Re)(t),p=(0,a.Re)(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return 1!==n||1!==i}(t),f=c(t),h=i(e,p),m={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(u||!u&&!n)&&(("body"!==(0,s.Z)(t)||d(f))&&(m=function(e){return e!==(0,o.Z)(e)&&(0,a.Re)(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:r(e);var t}(t)),(0,a.Re)(t)?((g=i(t,!0)).x+=t.clientLeft,g.y+=t.clientTop):f&&(g.x=l(f))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}}function f(e){var t=i(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function h(e){return"html"===(0,s.Z)(e)?e:e.assignedSlot||e.parentNode||((0,a.Zq)(e)?e.host:null)||c(e)}function m(e){return["html","body","#document"].indexOf((0,s.Z)(e))>=0?e.ownerDocument.body:(0,a.Re)(e)&&d(e)?e:m(h(e))}function g(e,t){var n;void 0===t&&(t=[]);var i=m(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),a=(0,o.Z)(i),s=r?[a].concat(a.visualViewport||[],d(i)?i:[]):i,c=t.concat(s);return r?c:c.concat(g(h(s)))}function _(e){return["table","td","th"].indexOf((0,s.Z)(e))>=0}function v(e){return(0,a.Re)(e)&&"fixed"!==u(e).position?e.offsetParent:null}function y(e){for(var t=(0,o.Z)(e),n=v(e);n&&_(n)&&"static"===u(n).position;)n=v(n);return n&&("html"===(0,s.Z)(n)||"body"===(0,s.Z)(n)&&"static"===u(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&(0,a.Re)(e)&&"fixed"===u(e).position)return null;for(var n=h(e);(0,a.Re)(n)&&["html","body"].indexOf((0,s.Z)(n))<0;){var i=u(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var E="top",b="bottom",S="right",A="left",T="auto",O=[E,b,S,A],I="start",C="end",N="clippingParents",L="viewport",R="popper",P="reference",k=O.reduce((function(e,t){return e.concat([t+"-"+I,t+"-"+C])}),[]),D=[].concat(O,[T]).reduce((function(e,t){return e.concat([t,t+"-"+I,t+"-"+C])}),[]),w=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function M(e){var t=new Map,n=new Set,i=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&o(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),i}var x={placement:"bottom",modifiers:[],strategy:"absolute"};function U(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function W(e){var t,n=e.reference,i=e.element,o=e.placement,r=o?H(o):null,a=o?G(o):null,s=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(r){case E:t={x:s,y:n.y-i.height};break;case b:t={x:s,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:c};break;case A:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var l=r?K(r):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case I:t[l]=t[l]-(n[u]/2-i[u]/2);break;case C:t[l]=t[l]+(n[u]/2-i[u]/2)}}return t}const Y={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=W({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var j=Math.max,z=Math.min,J=Math.round,q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function X(e){var t,n=e.popper,i=e.popperRect,r=e.placement,a=e.variation,s=e.offsets,l=e.position,d=e.gpuAcceleration,p=e.adaptive,f=e.roundOffsets,h=!0===f?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:J(J(t*i)/i)||0,y:J(J(n*i)/i)||0}}(s):"function"==typeof f?f(s):s,m=h.x,g=void 0===m?0:m,_=h.y,v=void 0===_?0:_,T=s.hasOwnProperty("x"),O=s.hasOwnProperty("y"),I=A,N=E,L=window;if(p){var R=y(n),P="clientHeight",k="clientWidth";R===(0,o.Z)(n)&&"static"!==u(R=c(n)).position&&"absolute"===l&&(P="scrollHeight",k="scrollWidth"),r!==E&&(r!==A&&r!==S||a!==C)||(N=b,v-=R[P]-i.height,v*=d?1:-1),r!==A&&(r!==E&&r!==b||a!==C)||(I=S,g-=R[k]-i.width,g*=d?1:-1)}var D,w=Object.assign({position:l},p&&q);return d?Object.assign({},w,((D={})[N]=O?"0":"",D[I]=T?"0":"",D.transform=(L.devicePixelRatio||1)<=1?"translate("+g+"px, "+v+"px)":"translate3d("+g+"px, "+v+"px, 0)",D)):Object.assign({},w,((t={})[N]=O?v+"px":"",t[I]=T?g+"px":"",t.transform="",t))}const Z={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,o=void 0===i||i,r=n.adaptive,a=void 0===r||r,s=n.roundOffsets,c=void 0===s||s,l={placement:H(t.placement),variation:G(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,X(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,X(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var Q=n(98566);const $={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,r=void 0===o?[0,0]:o,a=D.reduce((function(e,n){return e[n]=function(e,t,n){var i=H(e),o=[A,E].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=r[0],s=r[1];return a=a||0,s=(s||0)*o,[A,S].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,r),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[i]=a}};var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}var ne={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function oe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(0,a.Zq)(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ae(e,t){return t===L?re(function(e){var t=(0,o.Z)(e),n=c(e),i=t.visualViewport,r=n.clientWidth,a=n.clientHeight,s=0,u=0;return i&&(r=i.width,a=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,u=i.offsetTop)),{width:r,height:a,x:s+l(e),y:u}}(e)):(0,a.Re)(t)?function(e){var t=i(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):re(function(e){var t,n=c(e),i=r(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=j(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=j(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),d=-i.scrollLeft+l(e),p=-i.scrollTop;return"rtl"===u(o||n).direction&&(d+=j(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:d,y:p}}(c(e)))}function se(e,t,n){var i="clippingParents"===t?function(e){var t=g(h(e)),n=["absolute","fixed"].indexOf(u(e).position)>=0&&(0,a.Re)(e)?y(e):e;return(0,a.kK)(n)?t.filter((function(e){return(0,a.kK)(e)&&oe(e,n)&&"body"!==(0,s.Z)(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),r=o[0],c=o.reduce((function(t,n){var i=ae(e,n);return t.top=j(i.top,t.top),t.right=z(i.right,t.right),t.bottom=z(i.bottom,t.bottom),t.left=j(i.left,t.left),t}),ae(e,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function ce(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function le(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ue(e,t){void 0===t&&(t={});var n=t,o=n.placement,r=void 0===o?e.placement:o,s=n.boundary,l=void 0===s?N:s,u=n.rootBoundary,d=void 0===u?L:u,p=n.elementContext,f=void 0===p?R:p,h=n.altBoundary,m=void 0!==h&&h,g=n.padding,_=void 0===g?0:g,v=ce("number"!=typeof _?_:le(_,O)),y=f===R?P:R,A=e.rects.popper,T=e.elements[m?y:f],I=se((0,a.kK)(T)?T:T.contextElement||c(e.elements.popper),l,d),C=i(e.elements.reference),k=W({reference:C,element:A,strategy:"absolute",placement:r}),D=re(Object.assign({},A,k)),w=f===R?D:C,M={top:I.top-w.top+v.top,bottom:w.bottom-I.bottom+v.bottom,left:I.left-w.left+v.left,right:w.right-I.right+v.right},x=e.modifiersData.offset;if(f===R&&x){var U=x[r];Object.keys(M).forEach((function(e){var t=[S,b].indexOf(e)>=0?1:-1,n=[E,b].indexOf(e)>=0?"y":"x";M[e]+=U[n]*t}))}return M}const de={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var o=n.mainAxis,r=void 0===o||o,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,_=H(g),v=c||(_===g||!h?[te(g)]:function(e){if(H(e)===T)return[];var t=te(e);return[ie(e),t,ie(t)]}(g)),y=[g].concat(v).reduce((function(e,n){return e.concat(H(n)===T?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=n.boundary,r=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?D:c,u=G(i),d=u?s?k:k.filter((function(e){return G(e)===u})):O,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=ue(e,{placement:n,boundary:o,rootBoundary:r,padding:a})[H(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),C=t.rects.reference,N=t.rects.popper,L=new Map,R=!0,P=y[0],w=0;w=0,F=V?"width":"height",B=ue(t,{placement:M,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),K=V?U?S:A:U?b:E;C[F]>N[F]&&(K=te(K));var W=te(K),Y=[];if(r&&Y.push(B[x]<=0),s&&Y.push(B[K]<=0,B[W]<=0),Y.every((function(e){return e}))){P=M,R=!1;break}L.set(M,Y)}if(R)for(var j=function(e){var t=y.find((function(t){var n=L.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return P=t,"break"},z=h?3:1;z>0;z--){if("break"===j(z))break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function pe(e,t,n){return j(e,z(t,n))}const fe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.mainAxis,r=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,m=n.tetherOffset,g=void 0===m?0:m,_=ue(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),v=H(t.placement),T=G(t.placement),O=!T,C=K(v),N="x"===C?"y":"x",L=t.modifiersData.popperOffsets,R=t.rects.reference,P=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,D={x:0,y:0};if(L){if(r||s){var w="y"===C?E:A,M="y"===C?b:S,x="y"===C?"height":"width",U=L[C],V=L[C]+_[w],F=L[C]-_[M],B=h?-P[x]/2:0,W=T===I?R[x]:P[x],Y=T===I?-P[x]:-R[x],J=t.elements.arrow,q=h&&J?f(J):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=X[w],Q=X[M],$=pe(0,R[x],q[x]),ee=O?R[x]/2-B-$-Z-k:W-$-Z-k,te=O?-R[x]/2+B+$+Q+k:Y+$+Q+k,ne=t.elements.arrow&&y(t.elements.arrow),ie=ne?"y"===C?ne.clientTop||0:ne.clientLeft||0:0,oe=t.modifiersData.offset?t.modifiersData.offset[t.placement][C]:0,re=L[C]+ee-oe-ie,ae=L[C]+te-oe;if(r){var se=pe(h?z(V,re):V,U,h?j(F,ae):F);L[C]=se,D[C]=se-U}if(s){var ce="x"===C?E:A,le="x"===C?b:S,de=L[N],fe=de+_[ce],he=de-_[le],me=pe(h?z(fe,re):fe,de,h?j(he,ae):he);L[N]=me,D[N]=me-de}}t.modifiersData[i]=D}},requiresIfExists:["offset"]};const he={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,o=e.options,r=n.elements.arrow,a=n.modifiersData.popperOffsets,s=H(n.placement),c=K(s),l=[A,S].indexOf(s)>=0?"height":"width";if(r&&a){var u=function(e,t){return ce("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:le(e,O))}(o.padding,n),d=f(r),p="y"===c?E:A,h="y"===c?b:S,m=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],g=a[c]-n.rects.reference[c],_=y(r),v=_?"y"===c?_.clientHeight||0:_.clientWidth||0:0,T=m/2-g/2,I=u[p],C=v-d[l]-u[h],N=v/2-d[l]/2+T,L=pe(I,N,C),R=c;n.modifiersData[i]=((t={})[R]=L,t.centerOffset=L-N,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&oe(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function me(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ge(e){return[E,S,b,A].some((function(t){return e[t]>=0}))}const _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,a=ue(t,{elementContext:"reference"}),s=ue(t,{altBoundary:!0}),c=me(a,i),l=me(s,o,r),u=ge(c),d=ge(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var ve=V({defaultModifiers:[B,Y,Z,Q.Z,$,de,fe,he,_e]})},45317:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),i=0,o=2,r=!0;for(;o{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var i=new Array(64),o=new Array(123),r=0;r<64;)o[i[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;n.encode=function(e,t,n){for(var o,r=null,a=[],s=0,c=0;t>2],o=(3&l)<<4,c=1;break;case 1:a[s++]=i[o|l>>4],o=(15&l)<<2,c=2;break;case 2:a[s++]=i[o|l>>6],a[s++]=i[63&l],c=0}s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=i[o],a[s++]=61,1===c&&(a[s++]=61)),r?(s&&r.push(String.fromCharCode.apply(String,a.slice(0,s))),r.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(e,t,n){for(var i,r=n,s=0,c=0;c1)break;if(void 0===(l=o[l]))throw Error(a);switch(s){case 0:i=l,s=1;break;case 1:t[n++]=i<<2|(48&l)>>4,i=l,s=2;break;case 2:t[n++]=(15&i)<<4|(60&l)>>2,i=l,s=3;break;case 3:t[n++]=(3&i)<<6|l,s=0}}if(1===s)throw Error(a);return n-r},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},23745:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),i=128===n[3];function o(e,i,o){t[0]=e,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3]}function r(e,i,o){t[0]=e,i[o]=n[3],i[o+1]=n[2],i[o+2]=n[1],i[o+3]=n[0]}function a(e,i){return n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],t[0]}function s(e,i){return n[3]=e[i],n[2]=e[i+1],n[1]=e[i+2],n[0]=e[i+3],t[0]}e.writeFloatLE=i?o:r,e.writeFloatBE=i?r:o,e.readFloatLE=i?a:s,e.readFloatBE=i?s:a}():function(){function t(e,t,n,i){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,i);else if(isNaN(t))e(2143289344,n,i);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,i);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,i);else{var r=Math.floor(Math.log(t)/Math.LN2);e((o<<31|r+127<<23|8388607&Math.round(t*Math.pow(2,-r)*8388608))>>>0,n,i)}}function a(e,t,n){var i=e(t,n),o=2*(i>>31)+1,r=i>>>23&255,a=8388607&i;return 255===r?a?NaN:o*(1/0):0===r?1401298464324817e-60*o*a:o*Math.pow(2,r-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,i),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,r)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),i=128===n[7];function o(e,i,o){t[0]=e,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3],i[o+4]=n[4],i[o+5]=n[5],i[o+6]=n[6],i[o+7]=n[7]}function r(e,i,o){t[0]=e,i[o]=n[7],i[o+1]=n[6],i[o+2]=n[5],i[o+3]=n[4],i[o+4]=n[3],i[o+5]=n[2],i[o+6]=n[1],i[o+7]=n[0]}function a(e,i){return n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],t[0]}function s(e,i){return n[7]=e[i],n[6]=e[i+1],n[5]=e[i+2],n[4]=e[i+3],n[3]=e[i+4],n[2]=e[i+5],n[1]=e[i+6],n[0]=e[i+7],t[0]}e.writeDoubleLE=i?o:r,e.writeDoubleBE=i?r:o,e.readDoubleLE=i?a:s,e.readDoubleBE=i?s:a}():function(){function t(e,t,n,i,o,r){var a=i<0?1:0;if(a&&(i=-i),0===i)e(0,o,r+t),e(1/i>0?0:2147483648,o,r+n);else if(isNaN(i))e(0,o,r+t),e(2146959360,o,r+n);else if(i>17976931348623157e292)e(0,o,r+t),e((a<<31|2146435072)>>>0,o,r+n);else{var s;if(i<22250738585072014e-324)e((s=i/5e-324)>>>0,o,r+t),e((a<<31|s/4294967296)>>>0,o,r+n);else{var c=Math.floor(Math.log(i)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=i*Math.pow(2,-c))>>>0,o,r+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,r+n)}}}function a(e,t,n,i,o){var r=e(i,o+t),a=e(i,o+n),s=2*(a>>31)+1,c=a>>>20&2047,l=4294967296*(1048575&a)+r;return 2047===c?l?NaN:s*(1/0):0===c?5e-324*s*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,r,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function r(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},50491:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},18601:e=>{"use strict";e.exports=function(e,t,n){var i=n||8192,o=i>>>1,r=null,a=i;return function(n){if(n<1||n>o)return e(n);a+n>i&&(r=e(i),a=0);var s=t.call(r,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},68375:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,i=0;i191&&i<224?r[a++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,r[a++]=55296+(i>>10),r[a++]=56320+(1023&i)):r[a++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,r)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,r.slice(0,a))),o.join("")):String.fromCharCode.apply(String,r.slice(0,a))},n.write=function(e,t,n){for(var i,o,r=n,a=0;a>6|192,t[n++]=63&i|128):55296==(64512&i)&&56320==(64512&(o=e.charCodeAt(a+1)))?(i=65536+((1023&i)<<10)+(1023&o),++a,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128);return n-r}},93725:(e,t,n)=>{"use strict";function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i3?t.i-4:t.i:Array.isArray(e)?1:p(e)?2:f(e)?3:0}function c(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){return 2===s(e)?e.get(t):e[t]}function u(e,t,n){var i=s(e);2===i?e.set(t,n):3===i?e.add(n):e[t]=n}function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){return G&&e instanceof Map}function f(e){return K&&e instanceof Set}function h(e){return e.o||e.t}function m(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=X(e);delete t[z];for(var n=q(t),i=0;i1&&(e.set=e.add=e.clear=e.delete=_),Object.freeze(e),t&&a(e,(function(e,t){return g(t,!0)}),!0)),e}function _(){i(2)}function v(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function y(e){var t=Z[e];return t||i(18,e),t}function E(e,t){Z[e]||(Z[e]=t)}function b(){return B}function S(e,t){t&&(y("Patches"),e.u=[],e.s=[],e.v=t)}function A(e){T(e),e.p.forEach(I),e.p=null}function T(e){e===B&&(B=e.l)}function O(e){return B={p:[],l:B,h:e,m:!0,_:0}}function I(e){var t=e[z];0===t.i||1===t.i?t.j():t.g=!0}function C(e,t){t._=t.p.length;var n=t.p[0],o=void 0!==e&&e!==n;return t.h.O||y("ES5").S(t,e,o),o?(n[z].P&&(A(t),i(4)),r(e)&&(e=N(t,e),t.l||R(t,e)),t.u&&y("Patches").M(n[z].t,e,t.u,t.s)):e=N(t,n,[]),A(t),t.u&&t.v(t.u,t.s),e!==Y?e:void 0}function N(e,t,n){if(v(t))return t;var i=t[z];if(!i)return a(t,(function(o,r){return L(e,i,t,o,r,n)}),!0),t;if(i.A!==e)return t;if(!i.P)return R(e,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var o=4===i.i||5===i.i?i.o=m(i.k):i.o,r=o,s=!1;3===i.i&&(r=new Set(o),o.clear(),s=!0),a(r,(function(t,r){return L(e,i,o,t,r,n,s)})),R(e,o,!1),n&&e.u&&y("Patches").N(i,n,e.u,e.s)}return i.o}function L(e,t,n,i,a,s,l){if(o(a)){var d=N(e,a,s&&t&&3!==t.i&&!c(t.R,i)?s.concat(i):void 0);if(u(n,i,d),!o(d))return;e.m=!1}else l&&n.add(a);if(r(a)&&!v(a)){if(!e.h.D&&e._<1)return;N(e,a),t&&t.A.l||R(e,a)}}function R(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&g(t,n)}function P(e,t){var n=e[z];return(n?h(n):e)[t]}function k(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var i=Object.getOwnPropertyDescriptor(n,t);if(i)return i;n=Object.getPrototypeOf(n)}}function D(e){e.P||(e.P=!0,e.l&&D(e.l))}function w(e){e.o||(e.o=m(e.t))}function M(e,t,n){var i=p(t)?y("MapSet").F(t,n):f(t)?y("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),i={i:n?1:0,A:t?t.A:b(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=i,r=Q;n&&(o=[i],r=$);var a=Proxy.revocable(o,r),s=a.revoke,c=a.proxy;return i.k=c,i.j=s,c}(t,n):y("ES5").J(t,n);return(n?n.A:b()).p.push(i),i}function x(e){return o(e)||i(22,e),function e(t){if(!r(t))return t;var n,i=t[z],o=s(t);if(i){if(!i.P&&(i.i<4||!y("ES5").K(i)))return i.t;i.I=!0,n=U(t,o),i.I=!1}else n=U(t,o);return a(n,(function(t,o){i&&l(i.t,t)===o||u(n,t,e(o))})),3===o?new Set(n):n}(e)}function U(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return m(e)}function V(){function e(e,t){var n=r[e];return n?n.enumerable=t:r[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[z];return Q.get(t,e)},set:function(t){var n=this[z];Q.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][z];if(!o.P)switch(o.i){case 5:i(o)&&D(o);break;case 4:n(o)&&D(o)}}}function n(e){for(var t=e.t,n=e.k,i=q(n),o=i.length-1;o>=0;o--){var r=i[o];if(r!==z){var a=t[r];if(void 0===a&&!c(t,r))return!0;var s=n[r],l=s&&s[z];if(l?l.t!==a:!d(s,a))return!0}}var u=!!t[z];return i.length!==q(t).length+(u?0:1)}function i(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var i=0;iye,Lq:()=>Se,oM:()=>Ae});var F,B,H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),G="undefined"!=typeof Map,K="undefined"!=typeof Set,W="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Y=H?Symbol.for("immer-nothing"):((F={})["immer-nothing"]=!0,F),j=H?Symbol.for("immer-draftable"):"__$immer_draftable",z=H?Symbol.for("immer-state"):"__$immer_state",J=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),q="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,X=Object.getOwnPropertyDescriptors||function(e){var t={};return q(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Z={},Q={get:function(e,t){if(t===z)return e;var n=h(e);if(!c(n,t))return function(e,t,n){var i,o=k(t,n);return o?"value"in o?o.value:null===(i=o.get)||void 0===i?void 0:i.call(e.k):void 0}(e,n,t);var i=n[t];return e.I||!r(i)?i:i===P(e.t,t)?(w(e),e.o[t]=M(e.A.h,i,e)):i},has:function(e,t){return t in h(e)},ownKeys:function(e){return Reflect.ownKeys(h(e))},set:function(e,t,n){var i=k(h(e),t);if(null==i?void 0:i.set)return i.set.call(e.k,n),!0;if(!e.P){var o=P(h(e),t),r=null==o?void 0:o[z];if(r&&r.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(d(n,o)&&(void 0!==n||c(e.t,t)))return!0;w(e),D(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==P(e.t,t)||t in e.t?(e.R[t]=!1,w(e),D(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=h(e),i=Reflect.getOwnPropertyDescriptor(n,t);return i?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:i.enumerable,value:n[t]}:i},defineProperty:function(){i(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){i(12)}},$={};a(Q,(function(e,t){$[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),$.deleteProperty=function(e,t){return $.set.call(this,e,t,void 0)},$.set=function(e,t,n){return Q.set.call(this,e[0],t,n,e[0])};var ee=function(){function e(e){var t=this;this.O=W,this.D=!0,this.produce=function(e,n,o){if("function"==typeof e&&"function"!=typeof n){var a=n;n=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var i=arguments.length,o=Array(i>1?i-1:0),r=1;r1?i-1:0),r=1;r=0;n--){var i=t[n];if(0===i.path.length&&"replace"===i.op){e=i.value;break}}n>-1&&(t=t.slice(n+1));var r=y("Patches").$;return o(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),te=new ee,ne=te.produce;te.produceWithPatches.bind(te),te.setAutoFreeze.bind(te),te.setUseProxies.bind(te),te.applyPatches.bind(te),te.createDraft.bind(te),te.finishDraft.bind(te);const ie=ne;var oe,re=n(67968),ae=(n(14224),oe=function(e,t){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},oe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),se=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]{"use strict";function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;ts,Gn:()=>S,J0:()=>r,LX:()=>A,RQ:()=>R,WK:()=>M,X3:()=>w,Zn:()=>O,aU:()=>o,cP:()=>c,cm:()=>N,fp:()=>u,pC:()=>L}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));function r(e,t){if(!1===e||null==e)throw new Error(t)}function a(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function s(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(t+="#"===i.charAt(0)?i:"#"+i),t}function c(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}var l;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(l||(l={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function u(e,t,n){void 0===n&&(n="/");let i=O(("string"==typeof t?c(t):t).pathname||"/",n);if(null==i)return null;let o=d(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let r=null;for(let e=0;null==r&&e{let s={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(r(s.relativePath.startsWith(i),'Absolute route path "'+s.relativePath+'" nested under path "'+i+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(i.length));let c=R([i,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(r(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+c+'".'),d(e.children,t,l,c)),(null!=e.path||e.index)&&t.push({path:c,score:E(c,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of p(e.path))o(e,t,n);else o(e,t)})),t}function p(e){let t=e.split("/");if(0===t.length)return[];let[n,...i]=t,o=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===i.length)return o?[r,""]:[r];let a=p(i.join("/")),s=[];return s.push(...a.map((e=>""===e?r:[r,e].join("/")))),o&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const f=/^:[\w-]+$/,h=3,m=2,g=1,_=10,v=-2,y=e=>"*"===e;function E(e,t){let n=e.split("/"),i=n.length;return n.some(y)&&(i+=v),t&&(i+=m),n.filter((e=>!y(e))).reduce(((e,t)=>e+(f.test(t)?h:""===t?g:_)),i)}function b(e,t){let{routesMeta:n}=e,i={},o="/",r=[];for(let e=0;enull==e?"":"string"==typeof e?e:String(e);return i+n.split(/\/+/).map(((e,n,i)=>{if(n===i.length-1&&"*"===e){return o(t["*"])}const a=e.match(/^:([\w-]+)(\??)$/);if(a){const[,e,n]=a;let i=t[e];return r("?"===n||null!=i,'Missing ":'+e+'" param'),o(i)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);a("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let i=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(i.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(i.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let r=new RegExp(o,t?void 0:"i");return[r,i]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let r=o[0],s=r.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:i.reduce(((e,t,n)=>{let{paramName:i,isOptional:o}=t;if("*"===i){let e=c[n]||"";s=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}const l=c[n];return e[i]=o&&!l?void 0:function(e,t){try{return decodeURIComponent(e)}catch(n){return a(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(l||"",i),e}),{}),pathname:r,pathnameBase:s,pattern:e}}function T(e){try{return decodeURI(e)}catch(t){return a(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function O(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&"/"!==i?null:e.slice(n)||"/"}function I(e,t,n,i){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(i)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function C(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function N(e,t){let n=C(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function L(e,t,n,o){let a;void 0===o&&(o=!1),"string"==typeof e?a=c(e):(a=i({},e),r(!a.pathname||!a.pathname.includes("?"),I("?","pathname","search",a)),r(!a.pathname||!a.pathname.includes("#"),I("#","pathname","hash",a)),r(!a.search||!a.search.includes("#"),I("#","search","hash",a)));let s,l=""===e||""===a.pathname,u=l?"/":a.pathname;if(null==u)s=n;else{let e=t.length-1;if(!o&&u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}s=e>=0?t[e]:"/"}let d=function(e,t){void 0===t&&(t="/");let{pathname:n,search:i="",hash:o=""}="string"==typeof e?c(e):e,r=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:r,search:k(i),hash:D(o)}}(a,s),p=u&&"/"!==u&&u.endsWith("/"),f=(l||"."===u)&&n.endsWith("/");return d.pathname.endsWith("/")||!p&&!f||(d.pathname+="/"),d}const R=e=>e.join("/").replace(/\/\/+/g,"/"),P=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),k=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",D=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class w extends Error{}function M(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const x=["post","put","patch","delete"],U=(new Set(x),["get",...x]);new Set(U),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},3738:(e,t,n)=>{"use strict";n.d(t,{S1:()=>jt});var i=n(97833),o=n(80256),r=n(63494),a=n(46770),s=n(71758);const c=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],l=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],u="InboundFilters",d=(0,s._I)(((e={})=>({name:u,setupOnce(){},processEvent(t,n,s){const u=s.getOptions(),d=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:c],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:l],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,u);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return a.X&&i.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,o.jH)(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(e){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));a.X&&0===t.length&&i.kg.error(`Could not extract message for event ${(0,o.jH)(e)}`);return t}(e).some((e=>(0,r.U0)(e,t)))}(e,t.ignoreErrors))return a.X&&i.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,o.jH)(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&(0,r.U0)(n,t)}(e,t.ignoreTransactions))return a.X&&i.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,o.jH)(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=p(e);return!!n&&(0,r.U0)(n,t)}(e,t.denyUrls))return a.X&&i.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,o.jH)(e)}.\nUrl: ${p(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=p(e);return!n||(0,r.U0)(n,t)}(e,t.allowUrls))return a.X&&i.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,o.jH)(e)}.\nUrl: ${p(e)}`),!0;return!1}(t,d)?null:t}})));(0,s.RN)(u,d);function p(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return a.X&&i.kg.error(`Cannot extract url for event ${(0,o.jH)(e)}`),null}}var f=n(78241),h=n(20287);let m;const g="FunctionToString",_=new WeakMap,v=(0,s._I)((()=>({name:g,setupOnce(){m=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=(0,f.HK)(this),n=_.has((0,h.s3)())&&void 0!==t?t:this;return m.apply(n,e)}}catch(e){}},setup(e){_.set(e,!0)}})));(0,s.RN)(g,v);var y=n(78108);function E(e,t){!0===t.debug&&(a.X?i.kg.enable():(0,i.Cf)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));(0,h.nZ)().update(t.initialScope);const n=new e(t);!function(e){const t=(0,y.Gd)().getStackTop();t.client=e,t.scope.setClient(e)}(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}var b=n(35325),S=n(5838),A=n(6150);const T=(0,A.R)();function O(){if(!("fetch"in T))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function I(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const C=(0,A.R)();const N={},L={};function R(e,t){N[e]=N[e]||[],N[e].push(t)}function P(e,t){L[e]||(t(),L[e]=!0)}function k(e,t){const n=e&&N[e];if(n)for(const o of n)try{o(t)}catch(t){S.X&&i.kg.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,b.$P)(o)}\nError:`,t)}}const D=A.GLOBAL_OBJ;let w;function M(e){const t="history";R(t,e),P(t,x)}function x(){if(!function(){const e=C.chrome,t=e&&e.app&&e.app.runtime,n="history"in C&&!!C.history.pushState&&!!C.history.replaceState;return!t&&n}())return;const e=D.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=w,t=String(n);w=t;k("history",{from:e,to:t})}return e.apply(this,t)}}D.onpopstate=function(...t){const n=D.location.href,i=w;w=n;if(k("history",{from:i,to:n}),e)try{return e.apply(this,t)}catch(e){}},(0,f.hl)(D.history,"pushState",t),(0,f.hl)(D.history,"replaceState",t)}const U=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function V(e,t=!1){const{host:n,path:i,pass:o,port:r,projectId:a,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&o?`:${o}`:""}@${n}${r?`:${r}`:""}/${i?`${i}/`:i}${a}`}function F(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function B(e){const t="string"==typeof e?function(e){const t=U.exec(e);if(!t)return void(0,i.Cf)((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,o,r="",a,s="",c]=t.slice(1);let l="",u=c;const d=u.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return F({host:a,pass:r,path:l,projectId:u,port:s,protocol:n,publicKey:o})}(e):F(e);if(t&&function(e){if(!S.X)return!0;const{port:t,projectId:n,protocol:o}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(i.kg.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(o)?t&&isNaN(parseInt(t,10))&&(i.kg.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(i.kg.error(`Invalid Sentry Dsn: Invalid protocol ${o}`),1):(i.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var H=n(93632),G=n(74224),K=n(34878);function W(e,t=[]){return[e,t]}function Y(e,t){const[n,i]=e;return[n,[...i,t]]}function j(e,t){const n=e[1];for(const e of n){if(t(e,e[0].type))return!0}return!1}function z(e,t){return(t||new TextEncoder).encode(e)}function J(e,t){const[n,i]=e;let o=JSON.stringify(n);function r(e){"string"==typeof o?o="string"==typeof e?o+e:[z(o,t),e]:o.push("string"==typeof e?z(e,t):e)}for(const e of i){const[t,n]=e;if(r(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)r(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify((0,K.Fv)(n))}r(e)}}return"string"==typeof o?o:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let i=0;for(const t of e)n.set(t,i),i+=t.length;return n}(o)}function q(e,t){const n="string"==typeof e.data?z(e.data,t):e.data;return[(0,f.Jr)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const X={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function Z(e){return X[e]}function Q(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}class $ extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}const ee="7";function te(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function ne(e,t={}){const n="string"==typeof t?t:t.tunnel,i="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${te(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return(0,f._j)({sentry_key:e.publicKey,sentry_version:ee,...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,i)}`}function ie(e,t,n,i){const o=Q(n),r=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,i){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&i&&{dsn:V(i)},...o&&{trace:(0,f.Jr)({...o})}}}(e,o,i,t);delete e.sdkProcessingMetadata;return W(a,[[{type:r},e]])}function oe(e,t,n,i){const o={sent_at:(new Date).toISOString()};n&&n.sdk&&(o.sdk={name:n.sdk.name,version:n.sdk.version}),i&&t&&(o.dsn=V(t));const r=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),i=e.length>0?`|#${e.map((([e,t])=>`${e}:${t}`)).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return W(o,[r])}var re=n(93385),ae=n(17544),se=n(56857);const ce="Not capturing exception because it's already been captured.";class le{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=B(e.dsn):a.X&&i.kg.warn("No DSN provided, client will not send events."),this._dsn){const t=ne(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if((0,o.YO)(e))return void(a.X&&i.kg.log(ce));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,i){let o=n&&n.event_id;const r=(0,H.Le)(e)?e:String(e),a=(0,H.pt)(e)?this.eventFromMessage(r,t,n):this.eventFromException(e,n);return this._process(a.then((e=>this._captureEvent(e,n,i))).then((e=>{o=e}))),o}captureEvent(e,t,n){if(t&&t.originalException&&(0,o.YO)(t.originalException))return void(a.X&&i.kg.log(ce));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){"string"!=typeof e.release?a.X&&i.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,re.CT)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):(0,G.WD)(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return a.X&&i.kg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];(0,s.m7)(this,e,this._integrations),t||(0,s.uf)(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=ie(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Y(n,q(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(n);i&&i.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const t=function(e,t,n,i){const o=Q(n);return W({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!i&&t&&{dsn:V(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;a.X&&i.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){a.X&&i.kg.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=oe(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=(0,s.q4)(this,e),(0,s.uf)(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,i=!1;const o=t.exception&&t.exception.values;if(o){i=!0;for(const e of o){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const r="ok"===e.status;(r&&0===e.errors||r&&n)&&((0,re.CT)(e,{...n&&{status:"crashed"},errors:e.errors||Number(i||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new G.cW((t=>{let n=0;const i=setInterval((()=>{0==this._numProcessing?(clearInterval(i),t(!0)):(n+=1,e&&n>=e&&(clearInterval(i),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,i=(0,y.aF)()){const o=this.getOptions(),r=Object.keys(this._integrations);return!t.integrations&&r.length>0&&(t.integrations=r),this.emit("preprocessEvent",e,t),(0,se.R)(o,e,t,n,this,i).then((e=>{if(null===e)return e;const t={...i.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:i,spanId:o,parentSpanId:r,dsc:a}=t;e.contexts={trace:{trace_id:i,span_id:o,parent_span_id:r},...e.contexts};const s=a||(0,ae._)(i,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(a.X){const t=e;"log"===t.logLevel?i.kg.log(t.message):i.kg.warn(t)}}))}_processEvent(e,t,n){const i=this.getOptions(),{sampleRate:o}=i,r=de(e),a=ue(e),s=e.type||"error",c=`before send for type \`${s}\``;if(a&&"number"==typeof o&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",e),(0,G.$2)(new $(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l="replay_event"===s?"replay":s;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,e),new $("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const o=function(e,t,n){const{beforeSend:i,beforeSendTransaction:o}=e;if(ue(t)&&i)return i(t,n);if(de(t)&&o)return o(t,n);return t}(i,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if((0,H.J8)(e))return e.then((e=>{if(!(0,H.PO)(e)&&null!==e)throw new $(n);return e}),(e=>{throw new $(`${t} rejected with ${e}`)}));if(!(0,H.PO)(e)&&null!==e)throw new $(n);return e}(o,c)})).then((i=>{if(null===i)throw this.recordDroppedEvent("before_send",l,e),new $(`${c} returned \`null\`, will not send event.`,"log");const o=n&&n.getSession();!r&&o&&this._updateSessionFromEvent(o,i);const a=i.transaction_info;if(r&&a&&i.transaction!==e.transaction){const e="custom";i.transaction_info={...a,source:e}}return this.sendEvent(i,t),i})).then(null,(e=>{if(e instanceof $)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new $(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{a.X&&i.kg.error("Error while sending event:",e)}));a.X&&i.kg.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,i]=t.split(":");return{reason:n,category:i,quantity:e[t]}}))}}function ue(e){return void 0===e.type}function de(e){return"transaction"===e.type}var pe=n(92071);var fe=n(28592);const he="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function me(e,t){const n=_e(e,t),i={type:t&&t.name,value:ye(t)};return n.length&&(i.stacktrace={frames:n}),void 0===i.type&&""===i.value&&(i.value="Unrecoverable error caught"),i}function ge(e,t){return{exception:{values:[me(e,t)]}}}function _e(e,t){const n=t.stacktrace||t.stack||"",i=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(ve.test(e.message))return 1}return 0}(t);try{return e(n,i)}catch(e){}return[]}const ve=/Minified React error #\d+;/i;function ye(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Ee(e,t,n,i,r){let a;if((0,H.VW)(t)&&t.error){return ge(e,t.error)}if((0,H.TX)(t)||(0,H.fm)(t)){const r=t;if("stack"in t)a=ge(e,t);else{const t=r.name||((0,H.TX)(r)?"DOMError":"DOMException"),s=r.message?`${t}: ${r.message}`:t;a=be(e,s,n,i),(0,o.Db)(a,s)}return"code"in r&&(a.tags={...a.tags,"DOMException.code":`${r.code}`}),a}if((0,H.VZ)(t))return ge(e,t);if((0,H.PO)(t)||(0,H.cO)(t)){return a=function(e,t,n,i){const o=(0,h.s3)(),r=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:(0,H.cO)(t)?t.constructor.name:i?"UnhandledRejection":"Error",value:Se(t,{isUnhandledRejection:i})}]},extra:{__serialized__:(0,K.Qy)(t,r)}};if(n){const t=_e(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,r),(0,o.EG)(a,{synthetic:!0}),a}return a=be(e,t,n,i),(0,o.Db)(a,`${t}`,void 0),(0,o.EG)(a,{synthetic:!0}),a}function be(e,t,n,i){const o={};if(i&&n){const i=_e(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}if((0,H.Le)(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Se(e,{isUnhandledRejection:t}){const n=(0,f.zf)(e),i=t?"promise rejection":"exception";if((0,H.VW)(e))return`Event \`ErrorEvent\` captured as ${i} with message \`${e.message}\``;if((0,H.cO)(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${i}`}return`Object captured as ${i} with keys: ${n}`}const Ae=A.GLOBAL_OBJ;let Te=0;function Oe(){return Te>0}function Ie(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if((0,f.HK)(e))return e}catch(t){return e}const i=function(){const i=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const o=i.map((e=>Ie(e,t)));return e.apply(this,o)}catch(e){throw Te++,setTimeout((()=>{Te--})),(0,h.$e)((n=>{n.addEventProcessor((e=>(t.mechanism&&((0,o.Db)(e,void 0,void 0),(0,o.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:i},e))),(0,h.Tb)(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t])}catch(e){}(0,f.$Q)(i,e),(0,f.xp)(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:()=>e.name})}catch(e){}return i}class Ce extends le{constructor(e){!function(e,t,n=[t],i="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${i}:@sentry/${e}`,version:pe.J}))),version:pe.J}),e._metadata=o}(e,"browser",["browser"],Ae.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Ae.document&&Ae.document.addEventListener("visibilitychange",(()=>{"hidden"===Ae.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,i){const r=Ee(e,t,n&&n.syntheticException||void 0,i);return(0,o.EG)(r),r.level="error",n&&n.event_id&&(r.event_id=n.event_id),(0,G.WD)(r)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",i,o){const r=be(e,t,i&&i.syntheticException||void 0,o);return r.level=n,i&&i.event_id&&(r.event_id=i.event_id),(0,G.WD)(r)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(he&&i.kg.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:i}){const o={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!i&&{dsn:V(i)}},r=function(e){return[{type:"user_report"},e]}(e);return W(o,[r])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(he&&i.kg.log("No outcomes to send"));if(!this._dsn)return void(he&&i.kg.log("No dsn provided, will not send outcomes"));he&&i.kg.log("Sending outcomes:",e);const t=(n=e,W((o=this._options.tunnel&&V(this._dsn))?{dsn:o}:{},[[{type:"client_report"},{timestamp:r||(0,fe.yW)(),discarded_events:n}]]));var n,o,r;this._sendEnvelope(t)}}function Ne(){"console"in A.GLOBAL_OBJ&&i.RU.forEach((function(e){e in A.GLOBAL_OBJ.console&&(0,f.hl)(A.GLOBAL_OBJ.console,e,(function(t){return i.LD[e]=t,function(...t){k("console",{args:t,level:e});const n=i.LD[e];n&&n.apply(A.GLOBAL_OBJ.console,t)}}))}))}const Le=A.GLOBAL_OBJ,Re=1e3;let Pe,ke,De;function we(){if(!Le.document)return;const e=k.bind(null,"dom"),t=Me(e,!0);Le.document.addEventListener("click",t,!1),Le.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=Le[t]&&Le[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,f.hl)(n,"addEventListener",(function(t){return function(n,i,o){if("click"===n||"keypress"==n)try{const i=this,r=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){const i=Me(e);a.handler=i,t.call(this,n,i,o)}a.refCount++}catch(e){}return t.call(this,n,i,o)}})),(0,f.hl)(n,"removeEventListener",(function(e){return function(t,n,i){if("click"===t||"keypress"==t)try{const n=this,o=n.__sentry_instrumentation_handlers__||{},r=o[t];r&&(r.refCount--,r.refCount<=0&&(e.call(this,t,r.handler,i),r.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,i)}})))}))}function Me(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const i=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t||!t.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,i))return;(0,f.xp)(n,"_sentryCaptured",!0),i&&!i._sentryId&&(0,f.xp)(i,"_sentryId",(0,o.DM)());const r="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==ke)return!1;try{if(!e.target||e.target._sentryId!==De)return!1}catch(e){}return!0}(n)){e({event:n,name:r,global:t}),ke=n.type,De=i?i._sentryId:void 0}clearTimeout(Pe),Pe=Le.setTimeout((()=>{De=void 0,ke=void 0}),Re)}}const xe=A.GLOBAL_OBJ,Ue="__sentry_xhr_v3__";function Ve(){if(!xe.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;(0,f.hl)(e,"open",(function(e){return function(...t){const n=Date.now(),i=(0,H.HD)(t[0])?t[0].toUpperCase():void 0,o=function(e){if((0,H.HD)(e))return e;try{return e.toString()}catch(e){}return}(t[1]);if(!i||!o)return e.apply(this,t);this[Ue]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const r=()=>{const e=this[Ue];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}k("xhr",{args:[i,o],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?(0,f.hl)(this,"onreadystatechange",(function(e){return function(...t){return r(),e.apply(this,t)}})):this.addEventListener("readystatechange",r),(0,f.hl)(this,"setRequestHeader",(function(e){return function(...t){const[n,i]=t,o=this[Ue];return o&&(0,H.HD)(n)&&(0,H.HD)(i)&&(o.request_headers[n.toLowerCase()]=i),e.apply(this,t)}})),e.apply(this,t)}})),(0,f.hl)(e,"send",(function(e){return function(...t){const n=this[Ue];if(!n)return e.apply(this,t);void 0!==t[0]&&(n.body=t[0]);return k("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}function Fe(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!O())return!1;if(I(T.fetch))return!0;let e=!1;const t=T.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=I(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){S.X&&i.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&(0,f.hl)(A.GLOBAL_OBJ,"fetch",(function(e){return function(...t){const{method:n,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:He(t),method:Be(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:He(t),method:Be(t,"method")?String(t.method).toUpperCase():"GET"}}(t),o={args:t,fetchData:{method:n,url:i},startTimestamp:Date.now()};return k("fetch",{...o}),e.apply(A.GLOBAL_OBJ,t).then((e=>(k("fetch",{...o,endTimestamp:Date.now(),response:e}),e)),(e=>{throw k("fetch",{...o,endTimestamp:Date.now(),error:e}),e}))}}))}function Be(e,t){return!!e&&"object"==typeof e&&!!e[t]}function He(e){return"string"==typeof e?e:e?Be(e,"url")?e.url:e.toString?e.toString():"":""}var Ge=n(52229);const Ke=["fatal","error","warning","log","info","debug"];function We(e){return"warn"===e?"warning":Ke.includes(e)?e:"log"}function Ye(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",i=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:i,relative:t[5]+n+i}}const je=1024,ze="Breadcrumbs",Je=(0,s._I)(((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ze,setupOnce(){},setup(e){var n;t.console&&function(e){const t="console";R(t,e),P(t,Ne)}(function(e){return function(t){if((0,h.s3)()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:We(t.level),message:(0,r.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${(0,r.nK)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}(0,h.n_)(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if((0,h.s3)()!==e)return;let o,r,a="object"==typeof t?t.serializeAttribute:void 0,s="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;s&&s>je&&(he&&i.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=je),"string"==typeof a&&(a=[a]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;o=(0,Ge.Rt)(t,{keyAttrs:a,maxStringLength:s}),r=(0,Ge.iY)(t)}catch(e){o=""}if(0===o.length)return;const c={category:`ui.${n.name}`,message:o};r&&(c.data={"ui.component_name":r}),(0,h.n_)(c,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),R("dom",n),P("dom",we)),t.xhr&&function(e){R("xhr",e),P("xhr",Ve)}(function(e){return function(t){if((0,h.s3)()!==e)return;const{startTimestamp:n,endTimestamp:i}=t,o=t.xhr[Ue];if(!n||!i||!o)return;const{method:r,url:a,status_code:s,body:c}=o,l={method:r,url:a,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:i};(0,h.n_)({category:"xhr",data:l,type:"http"},u)}}(e)),t.fetch&&function(e){const t="fetch";R(t,e),P(t,Fe)}(function(e){return function(t){if((0,h.s3)()!==e)return;const{startTimestamp:n,endTimestamp:i}=t;if(i&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const e=t.fetchData,o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:i};(0,h.n_)({category:"fetch",data:e,level:"error",type:"http"},o)}else{const e=t.response,o={...t.fetchData,status_code:e&&e.status},r={input:t.args,response:e,startTimestamp:n,endTimestamp:i};(0,h.n_)({category:"fetch",data:o,type:"http"},r)}}}(e)),t.history&&M(function(e){return function(t){if((0,h.s3)()!==e)return;let n=t.from,i=t.to;const o=Ye(Ae.location.href);let r=n?Ye(n):void 0;const a=Ye(i);r&&r.path||(r=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===r.protocol&&o.host===r.host&&(n=r.relative),(0,h.n_)({category:"navigation",data:{from:n,to:i}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){(0,h.s3)()===e&&(0,h.n_)({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,o.jH)(t)},{event:t})}}(e))}}}));(0,s.RN)(ze,Je);const qe="Dedupe",Xe=(0,s._I)((()=>{let e;return{name:qe,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,i=t.message;if(!n&&!i)return!1;if(n&&!i||!n&&i)return!1;if(n!==i)return!1;if(!Qe(e,t))return!1;if(!Ze(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=$e(t),i=$e(e);if(!n||!i)return!1;if(n.type!==i.type||n.value!==i.value)return!1;if(!Qe(e,t))return!1;if(!Ze(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return he&&i.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}}));(0,s.RN)(qe,Xe);function Ze(e,t){let n=et(e),i=et(t);if(!n&&!i)return!0;if(n&&!i||!n&&i)return!1;if(i.length!==n.length)return!1;for(let e=0;e{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:rt,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";R(t,e),P(t,nt)}((t=>{const{stackParser:n,attachStacktrace:i}=lt();if((0,h.s3)()!==e||Oe())return;const{msg:o,url:r,line:a,column:s,error:c}=t,l=void 0===c&&(0,H.HD)(o)?function(e,t,n,i){const o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let r=(0,H.VW)(e)?e.message:e,a="Error";const s=r.match(o);s&&(a=s[1],r=s[2]);const c={exception:{values:[{type:a,value:r}]}};return st(c,t,n,i)}(o,r,a,s):st(Ee(n,c||o,void 0,i,!1),r,a,s);l.level="error",(0,h.eN)(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}(e),ct("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";R(t,e),P(t,ot)}((t=>{const{stackParser:n,attachStacktrace:i}=lt();if((0,h.s3)()!==e||Oe())return;const o=function(e){if((0,H.pt)(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return e}(t),r=(0,H.pt)(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Ee(n,o,void 0,i,!0);r.level="error",(0,h.eN)(r,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),ct("onunhandledrejection"))}}}));(0,s.RN)(rt,at);function st(e,t,n,i){const o=e.exception=e.exception||{},r=o.values=o.values||[],a=r[0]=r[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(i,10))?void 0:i,u=isNaN(parseInt(n,10))?void 0:n,d=(0,H.HD)(t)&&t.length>0?t:(0,Ge.l4)();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),e}function ct(e){he&&i.kg.log(`Global Handler attached: ${e}`)}function lt(){const e=(0,h.s3)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const ut="HttpContext",dt=(0,s._I)((()=>({name:ut,setupOnce(){},preprocessEvent(e){if(!Ae.navigator&&!Ae.location&&!Ae.document)return;const t=e.request&&e.request.url||Ae.location&&Ae.location.href,{referrer:n}=Ae.document||{},{userAgent:i}=Ae.navigator||{},o={...e.request&&e.request.headers,...n&&{Referer:n},...i&&{"User-Agent":i}},r={...e.request,...t&&{url:t},headers:o};e.request=r}})));(0,s.RN)(ut,dt);function pt(e,t,n=250,i,o,a,s){if(!(a.exception&&a.exception.values&&s&&(0,H.V9)(s.originalException,Error)))return;const c=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;var l,u;c&&(a.exception.values=(l=ft(e,t,o,s.originalException,i,a.exception.values,c,0),u=n,l.map((e=>(e.value&&(e.value=(0,r.$G)(e.value,u)),e)))))}function ft(e,t,n,i,o,r,a,s){if(r.length>=n+1)return r;let c=[...r];if((0,H.V9)(i[o],Error)){ht(a,s);const r=e(t,i[o]),l=c.length;mt(r,o,l,s),c=ft(e,t,n,i[o],o,[r,...c],r,l)}return Array.isArray(i.errors)&&i.errors.forEach(((i,r)=>{if((0,H.V9)(i,Error)){ht(a,s);const l=e(t,i),u=c.length;mt(l,`errors[${r}]`,u,s),c=ft(e,t,n,i,o,[l,...c],l,u)}})),c}function ht(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function mt(e,t,n,i){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:i}}const gt="LinkedErrors",_t=(0,s._I)(((e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:gt,setupOnce(){},preprocessEvent(e,i,o){const r=o.getOptions();pt(me,r.stackParser,r.maxValueLength,n,t,e,i)}}})),vt=((0,s.RN)(gt,_t),["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"]),yt="TryCatch",Et=(0,s._I)(((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:yt,setupOnce(){t.setTimeout&&(0,f.hl)(Ae,"setTimeout",bt),t.setInterval&&(0,f.hl)(Ae,"setInterval",bt),t.requestAnimationFrame&&(0,f.hl)(Ae,"requestAnimationFrame",St),t.XMLHttpRequest&&"XMLHttpRequest"in Ae&&(0,f.hl)(XMLHttpRequest.prototype,"send",At);const e=t.eventTarget;if(e){(Array.isArray(e)?e:vt).forEach(Tt)}}}}));(0,s.RN)(yt,Et);function bt(e){return function(...t){const n=t[0];return t[0]=Ie(n,{mechanism:{data:{function:(0,b.$P)(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function St(e){return function(t){return e.apply(this,[Ie(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,b.$P)(e)},handled:!1,type:"instrument"}})])}}function At(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&(0,f.hl)(n,e,(function(t){const n={mechanism:{data:{function:e,handler:(0,b.$P)(t)},handled:!1,type:"instrument"}},i=(0,f.HK)(t);return i&&(n.mechanism.data.handler=(0,b.$P)(i)),Ie(t,n)}))})),e.apply(this,t)}}function Tt(e){const t=Ae,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,f.hl)(n,"addEventListener",(function(t){return function(n,i,o){try{"function"==typeof i.handleEvent&&(i.handleEvent=Ie(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,b.$P)(i),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,Ie(i,{mechanism:{data:{function:"addEventListener",handler:(0,b.$P)(i),target:e},handled:!1,type:"instrument"}}),o])}})),(0,f.hl)(n,"removeEventListener",(function(e){return function(t,n,i){const o=n;try{const n=o&&o.__sentry_wrapped__;n&&e.call(this,t,n,i)}catch(e){}return e.call(this,t,o,i)}})))}const Ot="?";function It(e,t,n,i){const o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==i&&(o.colno=i),o}const Ct=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Nt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Lt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,kt=[[30,e=>{const t=Ct.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Nt.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=wt(t[1]||Ot,t[2]);return It(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{const t=Lt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Rt.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Ot;return[n,e]=wt(n,e),It(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{const t=Pt.exec(e);return t?It(t[2],t[1]||Ot,+t[3],t[4]?+t[4]:void 0):void 0}]],Dt=(0,b.pE)(...kt),wt=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:Ot,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function Mt(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(i){if(!(void 0===e||t.lengthn(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new G.cW(((n,i)=>{let o=t.length;if(!o)return n(!0);const r=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{(0,G.WD)(e).then((()=>{--o||(clearTimeout(r),n(!0))}),i)}))}))}}}const xt=6e4;function Ut(e,{statusCode:t,headers:n},i=Date.now()){const o={...e},r=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(r)for(const e of r.trim().split(",")){const[t,n]=e.split(":",2),r=parseInt(t,10),a=1e3*(isNaN(r)?60:r);if(n)for(const e of n.split(";"))o[e]=i+a;else o.all=i+a}else a?o.all=i+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const i=Date.parse(`${e}`);return isNaN(i)?xt:i-t}(a,i):429===t&&(o.all=i+6e4);return o}const Vt=30;function Ft(e,t,n=Mt(e.bufferSize||Vt)){let o={};function r(r){const s=[];if(j(r,((t,n)=>{const i=Z(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(o,i)){const o=Bt(t,n);e.recordDroppedEvent("ratelimit_backoff",i,o)}else s.push(t)})),0===s.length)return(0,G.WD)();const c=W(r[0],s),l=t=>{j(c,((n,i)=>{const o=Bt(n,i);e.recordDroppedEvent(t,Z(i),o)}))};return n.add((()=>t({body:J(c,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&a.X&&i.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),o=Ut(o,e),e)),(e=>{throw l("network_error"),e})))).then((e=>e),(e=>{if(e instanceof $)return a.X&&i.kg.error("Skipped sending event because buffer is full."),l("queue_overflow"),(0,G.WD)();throw e}))}return r.__sentry__baseTransport__=!0,{send:r,flush:e=>n.drain(e)}}function Bt(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let Ht;function Gt(e,t=function(){if(Ht)return Ht;if(I(Ae.fetch))return Ht=Ae.fetch.bind(Ae);const e=Ae.document;let t=Ae.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const i=n.contentWindow;i&&i.fetch&&(t=i.fetch),e.head.removeChild(n)}catch(e){he&&i.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ht=t.bind(Ae)}()){let n=0,o=0;return Ft(e,(function(i){const r=i.body.length;n+=r,o++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&o<15,...e.fetchOptions};try{return t(e.url,a).then((e=>(n-=r,o--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Ht=void 0,n-=r,o--,(0,G.$2)(e)}}))}const Kt=4;function Wt(e){return Ft(e,(function(t){return new G.cW(((n,i)=>{const o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=()=>{o.readyState===Kt&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&o.setRequestHeader(t,e.headers[t]);o.send(t.body)}))}))}const Yt=[d(),v(),Et(),Je(),at(),_t(),Xe(),dt()];function jt(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Yt]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Ae.SENTRY_RELEASE&&Ae.SENTRY_RELEASE.id&&(e.release=Ae.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(0,b.Sq)(e.stackParser||Dt),integrations:(0,s.m8)(e),transport:e.transport||(O()?Gt:Wt)};E(Ce,t),e.autoSessionTracking&&function(){if(void 0===Ae.document)return void(he&&i.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));(0,h.yj)({ignoreDuration:!0}),(0,h.cg)(),M((({from:e,to:t})=>{void 0!==e&&e!==t&&((0,h.yj)({ignoreDuration:!0}),(0,h.cg)())}))}()}},75751:(e,t,n)=>{"use strict";n.d(t,{J:()=>i});const i="production"},46770:(e,t,n)=>{"use strict";n.d(t,{X:()=>i});const i="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},90287:(e,t,n)=>{"use strict";n.d(t,{RP:()=>u,cc:()=>l,fH:()=>c});var i=n(6150),o=n(74224),r=n(97833),a=n(93632),s=n(46770);function c(){return(0,i.Y)("globalEventProcessors",(()=>[]))}function l(e){c().push(e)}function u(e,t,n,i=0){return new o.cW(((o,c)=>{const l=e[i];if(null===t||"function"!=typeof l)o(t);else{const d=l({...t},n);s.X&&l.id&&null===d&&r.kg.log(`Event processor "${l.id}" dropped event`),(0,a.J8)(d)?d.then((t=>u(e,t,n,i+1).then(o))).then(null,c):u(e,d,n,i+1).then(o).then(null,c)}}))}},20287:(e,t,n)=>{"use strict";n.d(t,{$e:()=>p,Tb:()=>c,cg:()=>v,e:()=>u,eN:()=>l,nZ:()=>h,n_:()=>d,s3:()=>f,yj:()=>m});var i=n(6150),o=n(75751),r=n(78108),a=n(93385),s=n(56857);function c(e,t){return(0,r.Gd)().captureException(e,(0,s.U0)(t))}function l(e,t){return(0,r.Gd)().captureEvent(e,t)}function u(e){(0,r.Gd)().configureScope(e)}function d(e,t){(0,r.Gd)().addBreadcrumb(e,t)}function p(...e){const t=(0,r.Gd)();if(2===e.length){const[n,i]=e;return n?t.withScope((()=>(t.getStackTop().scope=n,i(n)))):t.withScope(i)}return t.withScope(e[0])}function f(){return(0,r.Gd)().getClient()}function h(){return(0,r.Gd)().getScope()}function m(e){const t=f(),n=(0,r.aF)(),s=h(),{release:c,environment:l=o.J}=t&&t.getOptions()||{},{userAgent:u}=i.GLOBAL_OBJ.navigator||{},d=(0,a.Hv)({release:c,environment:l,user:s.getUser()||n.getUser(),...u&&{userAgent:u},...e}),p=n.getSession();return p&&"ok"===p.status&&(0,a.CT)(p,{status:"exited"}),g(),n.setSession(d),s.setSession(d),d}function g(){const e=(0,r.aF)(),t=h(),n=t.getSession()||e.getSession();n&&(0,a.RJ)(n),_(),e.setSession(),t.setSession()}function _(){const e=(0,r.aF)(),t=h(),n=f(),i=t.getSession()||e.getSession();i&&n&&n.captureSession&&n.captureSession(i)}function v(e=!1){e?g():_()}},78108:(e,t,n)=>{"use strict";n.d(t,{Gd:()=>v,aF:()=>y});var i=n(93632),o=n(80256),r=n(28592),a=n(97833),s=n(6150),c=n(75751),l=n(46770),u=n(81923),d=n(93385),p=n(92071);const f=parseFloat(p.J),h=100;class m{constructor(e,t,n,i=f){let o,r;this._version=i,t?o=t:(o=new u.sX,o.setClient(e)),n?r=n:(r=new u.sX,r.setClient(e)),this._stack=[{scope:o}],e&&this.bindClient(e),this._isolationScope=r}isOlderThan(e){return this._version(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:(0,o.DM)(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...t,event_id:n}),n}captureMessage(e,t,n){const i=this._lastEventId=n&&n.event_id?n.event_id:(0,o.DM)(),r=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:r,...n,event_id:i}),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:(0,o.DM)();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=h}=i.getOptions&&i.getOptions()||{};if(s<=0)return;const c={timestamp:(0,r.yW)(),...e},l=o?(0,a.Cf)((()=>o(c,t))):c;null!==l&&(i.emit&&i.emit("beforeAddBreadcrumb",l,t),n.addBreadcrumb(l,s))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=_(this);try{e(this)}finally{_(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return l.X&&a.kg.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(l.X&&!n){this.getClient()?a.kg.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):a.kg.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&(0,d.RJ)(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:i,environment:o=c.J}=n&&n.getOptions()||{},{userAgent:r}=s.GLOBAL_OBJ.navigator||{},a=(0,d.Hv)({release:i,environment:o,user:t.getUser(),...r&&{userAgent:r},...e}),l=t.getSession&&t.getSession();return l&&"ok"===l.status&&(0,d.CT)(l,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=g().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);l.X&&a.kg.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function g(){return s.GLOBAL_OBJ.__SENTRY__=s.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},s.GLOBAL_OBJ}function _(e){const t=g(),n=S(t);return A(t,e),n}function v(){const e=g();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return E(e)}function y(){return v().getIsolationScope()}function E(e=g()){return b(e)&&!S(e).isOlderThan(f)||A(e,new m),S(e)}function b(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function S(e){return(0,s.Y)("hub",(()=>new m),e)}function A(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}},71758:(e,t,n)=>{"use strict";n.d(t,{RN:()=>f,_I:()=>h,m7:()=>p,m8:()=>l,q4:()=>u,uf:()=>d});var i=n(80256),o=n(97833),r=n(46770),a=n(90287),s=n(78108);const c=[];function l(e){const t=e.defaultIntegrations||[],n=e.integrations;let o;t.forEach((e=>{e.isDefaultInstance=!0})),o=Array.isArray(n)?[...t,...n]:"function"==typeof n?(0,i.lE)(n(t)):t;const r=function(e){const t={};return e.forEach((e=>{const{name:n}=e,i=t[n];i&&!i.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(o),a=function(e,t){for(let n=0;n"Debug"===e.name));if(-1!==a){const[e]=r.splice(a,1);r.push(e)}return r}function u(e,t){const n={};return t.forEach((t=>{t&&p(e,t,n)})),n}function d(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function p(e,t,n){if(n[t.name])r.X&&o.kg.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===c.indexOf(t.name)&&(t.setupOnce(a.cc,s.Gd),c.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,i)=>n(t,i,e)))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),i=Object.assign(((t,i)=>n(t,i,e)),{id:t.name});e.addEventProcessor(i)}r.X&&o.kg.log(`Integration installed: ${t.name}`)}}function f(e,t){return Object.assign((function(...e){return t(...e)}),{id:e})}function h(e){return e}},81923:(e,t,n)=>{"use strict";n.d(t,{lW:()=>p,sX:()=>d});var i=n(93632),o=n(28592),r=n(80256),a=n(97833),s=n(90287),c=n(93385),l=n(54234);let u;class d{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=f()}static clone(e){return e?e.clone():new d}clone(){const e=new d;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&(0,c.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof d?t:this}return e instanceof d?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):(0,i.PO)(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=f(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const i={timestamp:(0,o.yW)(),...e},r=this._breadcrumbs;return r.push(i),this._breadcrumbs=r.length>n?r.slice(-n):r,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:i,_extra:o,_user:r,_level:a,_fingerprint:s,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:u,_transactionName:d,_span:p}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:i,extra:o,user:r,level:a,fingerprint:s||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:u,transactionName:d,span:p}}applyToEvent(e,t={},n=[]){(0,l.gi)(e,this.getScopeData());const i=[...n,...(0,s.fH)(),...this._eventProcessors];return(0,s.RP)(i,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:(0,r.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...t,event_id:n},this),n}captureMessage(e,t,n){const i=n&&n.event_id?n.event_id:(0,r.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture message!"),i;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:i},this),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:(0,r.DM)();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(a.kg.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function p(){return u||(u=new d),u}function f(){return{traceId:(0,r.DM)(),spanId:(0,r.DM)().substring(16)}}},93385:(e,t,n)=>{"use strict";n.d(t,{CT:()=>s,Hv:()=>a,RJ:()=>c});var i=n(28592),o=n(80256),r=n(78241);function a(e){const t=(0,i.ph)(),n={sid:(0,o.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return(0,r.Jr)({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&s(n,e),n}function s(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,i.ph)(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,o.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function c(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),s(e,n)}},17544:(e,t,n)=>{"use strict";n.d(t,{_:()=>c,j:()=>l});var i=n(78241),o=n(75751),r=n(20287),a=n(43061),s=n(26508);function c(e,t,n){const r=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:s}=n&&n.getUser()||{},c=(0,i.Jr)({environment:r.environment||o.J,release:r.release,user_segment:s,public_key:a,trace_id:e});return t.emit&&t.emit("createDsc",c),c}function l(e){const t=(0,r.s3)();if(!t)return{};const n=c((0,s.XU)(e).trace_id||"",t,(0,r.nZ)()),i=(0,a.G)(e);if(!i)return n;const o=i&&i._frozenDynamicSamplingContext;if(o)return o;const{sampleRate:l,source:u}=i.metadata;null!=l&&(n.sample_rate=`${l}`);const d=(0,s.XU)(i);return u&&"url"!==u&&(n.transaction=d.description),n.sampled=String((0,s.Tt)(i)),t.emit&&t.emit("createDsc",n),n}},54234:(e,t,n)=>{"use strict";n.d(t,{gi:()=>c,yo:()=>l});var i=n(78241),o=n(80256),r=n(17544),a=n(43061),s=n(26508);function c(e,t){const{fingerprint:n,span:c,breadcrumbs:l,sdkProcessingMetadata:u}=t;!function(e,t){const{extra:n,tags:o,user:r,contexts:a,level:s,transactionName:c}=t,l=(0,i.Jr)(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const u=(0,i.Jr)(o);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});const d=(0,i.Jr)(r);d&&Object.keys(d).length&&(e.user={...d,...e.user});const p=(0,i.Jr)(a);p&&Object.keys(p).length&&(e.contexts={...p,...e.contexts});s&&(e.level=s);c&&(e.transaction=c)}(e,t),c&&function(e,t){e.contexts={trace:(0,s.wy)(t),...e.contexts};const n=(0,a.G)(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:(0,r.j)(t),...e.sdkProcessingMetadata};const i=(0,s.XU)(n).description;i&&(e.tags={transaction:i,...e.tags})}}(e,c),function(e,t){e.fingerprint=e.fingerprint?(0,o.lE)(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,l),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,u)}function l(e,t){const{extra:n,tags:i,user:o,contexts:r,level:a,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:l,eventProcessors:d,attachments:p,propagationContext:f,transactionName:h,span:m}=t;u(e,"extra",n),u(e,"tags",i),u(e,"user",o),u(e,"contexts",r),u(e,"sdkProcessingMetadata",s),a&&(e.level=a),h&&(e.transactionName=h),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...f}}function u(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[t][i]=n[i])}}},43061:(e,t,n)=>{"use strict";function i(e){return e.transaction}n.d(t,{G:()=>i})},56857:(e,t,n)=>{"use strict";n.d(t,{R:()=>f,U0:()=>m});var i=n(80256),o=n(28592),r=n(63494),a=n(6150),s=n(34878),c=n(75751),l=n(90287),u=n(81923),d=n(54234),p=n(26508);function f(e,t,n,f,m,g){const{normalizeDepth:_=3,normalizeMaxBreadth:v=1e3}=e,y={...t,event_id:t.event_id||n.event_id||(0,i.DM)(),timestamp:t.timestamp||(0,o.yW)()},E=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:i,dist:o,maxValueLength:a=250}=t;"environment"in e||(e.environment="environment"in t?n:c.J);void 0===e.release&&void 0!==i&&(e.release=i);void 0===e.dist&&void 0!==o&&(e.dist=o);e.message&&(e.message=(0,r.$G)(e.message,a));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=(0,r.$G)(s.value,a));const l=e.request;l&&l.url&&(l.url=(0,r.$G)(l.url,a))}(y,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(y,E),void 0===t.type&&function(e,t){const n=a.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let i;const o=h.get(t);o?i=o:(i=new Map,h.set(t,i));const r=Object.keys(n).reduce(((e,o)=>{let r;const a=i.get(o);a?r=a:(r=t(o),i.set(o,r));for(let t=r.length-1;t>=0;t--){const i=r[t];if(i.filename){e[i.filename]=n[o];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=r[e.filename])}))}))}catch(e){}}(y,e.stackParser);const b=function(e,t){if(!t)return e;const n=e?e.clone():new u.sX;return n.update(t),n}(f,n.captureContext);n.mechanism&&(0,i.EG)(y,n.mechanism);const S=m&&m.getEventProcessors?m.getEventProcessors():[],A=(0,u.lW)().getScopeData();if(g){const e=g.getScopeData();(0,d.yo)(A,e)}if(b){const e=b.getScopeData();(0,d.yo)(A,e)}const T=[...n.attachments||[],...A.attachments];T.length&&(n.attachments=T),(0,d.gi)(y,A);const O=[...S,...(0,l.fH)(),...A.eventProcessors];return(0,l.RP)(O,y,n).then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"==typeof _&&_>0?function(e,t,n){if(!e)return null;const i={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:(0,s.Fv)(e.data,t,n)}})))},...e.user&&{user:(0,s.Fv)(e.user,t,n)},...e.contexts&&{contexts:(0,s.Fv)(e.contexts,t,n)},...e.extra&&{extra:(0,s.Fv)(e.extra,t,n)}};e.contexts&&e.contexts.trace&&i.contexts&&(i.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(i.contexts.trace.data=(0,s.Fv)(e.contexts.trace.data,t,n)));e.spans&&(i.spans=e.spans.map((e=>{const i=(0,p.XU)(e).data;return i&&(e.data=(0,s.Fv)(i,t,n)),e})));return i}(e,_,v):e)))}const h=new WeakMap;function m(e){if(e)return function(e){return e instanceof u.sX||"function"==typeof e}(e)||function(e){return Object.keys(e).some((e=>g.includes(e)))}(e)?{captureContext:e}:e}const g=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},26508:(e,t,n)=>{"use strict";n.d(t,{Tt:()=>s,XU:()=>a,wy:()=>r});var i=n(78241);const o=1;function r(e){const{spanId:t,traceId:n}=e.spanContext(),{data:o,op:r,parent_span_id:s,status:c,tags:l,origin:u}=a(e);return(0,i.Jr)({data:o,op:r,parent_span_id:s,span_id:t,status:c,tags:l,trace_id:n,origin:u})}function a(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function s(e){const{traceFlags:t}=e.spanContext();return Boolean(t&o)}},92071:(e,t,n)=>{"use strict";n.d(t,{J:()=>i});const i="7.99.0"},66039:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(71758);const o="SessionTiming",r=(0,i._I)((()=>{const e=Date.now();return{name:o,setupOnce(){},processEvent(t){const n=Date.now();return{...t,extra:{...t.extra,"session:start":e,"session:duration":n-e,"session:end":n}}}}})),a=(0,i.RN)(o,r)},52229:(e,t,n)=>{"use strict";n.d(t,{Rt:()=>a,iY:()=>l,l4:()=>c});var i=n(93632);const o=(0,n(6150).R)(),r=80;function a(e,t={}){if(!e)return"";try{let n=e;const i=5,o=[];let a=0,c=0;const l=" > ",u=l.length;let d;const p=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||r;for(;n&&a++1&&c+o.length*u+d.length>=f));)o.push(d),c+=d.length,n=n.parentNode;return o.reverse().join(l)}catch(e){return""}}function s(e,t){const n=e,r=[];let a,s,c,l,u;if(!n||!n.tagName)return"";if(o.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const d=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(d&&d.length)d.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),a=n.className,a&&(0,i.HD)(a))for(s=a.split(/\s+/),u=0;u{"use strict";n.d(t,{X:()=>i});const i="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},93632:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>_,HD:()=>l,J8:()=>g,Kj:()=>m,Le:()=>u,PO:()=>p,TX:()=>s,V9:()=>y,VW:()=>a,VZ:()=>o,cO:()=>f,fm:()=>c,i2:()=>v,kK:()=>h,pt:()=>d,y1:()=>E});const i=Object.prototype.toString;function o(e){switch(i.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return y(e,Error)}}function r(e,t){return i.call(e)===`[object ${t}]`}function a(e){return r(e,"ErrorEvent")}function s(e){return r(e,"DOMError")}function c(e){return r(e,"DOMException")}function l(e){return r(e,"String")}function u(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function d(e){return null===e||u(e)||"object"!=typeof e&&"function"!=typeof e}function p(e){return r(e,"Object")}function f(e){return"undefined"!=typeof Event&&y(e,Event)}function h(e){return"undefined"!=typeof Element&&y(e,Element)}function m(e){return r(e,"RegExp")}function g(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function _(e){return p(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function v(e){return"number"==typeof e&&e!=e}function y(e,t){try{return e instanceof t}catch(e){return!1}}function E(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}},97833:(e,t,n)=>{"use strict";n.d(t,{Cf:()=>s,LD:()=>a,RU:()=>r,kg:()=>c});var i=n(5838),o=n(6150);const r=["debug","info","warn","error","log","assert","trace"],a={};function s(e){if(!("console"in o.GLOBAL_OBJ))return e();const t=o.GLOBAL_OBJ.console,n={},i=Object.keys(a);i.forEach((e=>{const i=a[e];n[e]=t[e],t[e]=i}));try{return e()}finally{i.forEach((e=>{t[e]=n[e]}))}}const c=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return i.X?r.forEach((n=>{t[n]=(...t)=>{e&&s((()=>{o.GLOBAL_OBJ.console[n](`Sentry Logger [${n}]:`,...t)}))}})):r.forEach((e=>{t[e]=()=>{}})),t}()},80256:(e,t,n)=>{"use strict";n.d(t,{DM:()=>r,Db:()=>c,EG:()=>l,YO:()=>u,jH:()=>s,lE:()=>d});var i=n(78241),o=n(6150);function r(){const e=o.GLOBAL_OBJ,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(e){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function a(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function s(e){const{message:t,event_id:n}=e;if(t)return t;const i=a(e);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||n||"":n||""}function c(e,t,n){const i=e.exception=e.exception||{},o=i.values=i.values||[],r=o[0]=o[0]||{};r.value||(r.value=t||""),r.type||(r.type=n||"Error")}function l(e,t){const n=a(e);if(!n)return;const i=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...i,...t},t&&"data"in t){const e={...i&&i.data,...t.data};n.mechanism.data=e}}function u(e){if(e&&e.__sentry_captured__)return!0;try{(0,i.xp)(e,"__sentry_captured__",!0)}catch(e){}return!1}function d(e){return Array.isArray(e)?e:[e]}},34878:(e,t,n)=>{"use strict";n.d(t,{Fv:()=>a,Qy:()=>s});var i=n(93632);var o=n(78241),r=n(35325);function a(e,t=100,n=1/0){try{return c("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function s(e,t=3,n=102400){const i=a(e,t);return o=i,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?s(e,t-1,n):i;var o}function c(e,t,a=1/0,s=1/0,l=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e=s){m[e]="[MaxProperties ~]";break}const t=_[e];m[e]=c(e,t,f-1,s,l),g++}return d(t),m}},78241:(e,t,n)=>{"use strict";n.d(t,{$Q:()=>u,HK:()=>d,Jr:()=>_,Sh:()=>f,_j:()=>p,hl:()=>c,xp:()=>l,zf:()=>g});var i=n(52229),o=n(5838),r=n(93632),a=n(97833),s=n(63494);function c(e,t,n){if(!(t in e))return;const i=e[t],o=n(i);"function"==typeof o&&u(o,i),e[t]=o}function l(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){o.X&&a.kg.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function u(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,l(e,"__sentry_original__",t)}catch(e){}}function d(e){return e.__sentry_original__}function p(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}function f(e){if((0,r.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...m(e)};if((0,r.cO)(e)){const t={type:e.type,target:h(e.target),currentTarget:h(e.currentTarget),...m(e)};return"undefined"!=typeof CustomEvent&&(0,r.V9)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function h(e){try{return(0,r.kK)(e)?(0,i.Rt)(e):Object.prototype.toString.call(e)}catch(e){return""}}function m(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function g(e,t=40){const n=Object.keys(f(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,s.$G)(n[0],t);for(let e=n.length;e>0;e--){const i=n.slice(0,e).join(", ");if(!(i.length>t))return e===n.length?i:(0,s.$G)(i,t)}return""}function _(e){return v(e,new Map)}function v(e,t){if(function(e){if(!(0,r.PO)(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const i={};t.set(e,i);for(const n of Object.keys(e))void 0!==e[n]&&(i[n]=v(e[n],t));return i}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const i=[];return t.set(e,i),e.forEach((e=>{i.push(v(e,t))})),i}return e}},35325:(e,t,n)=>{"use strict";n.d(t,{$P:()=>l,Sq:()=>s,pE:()=>a});const i=50,o=/\(error: (.*)\)/,r=/captureMessage|captureException/;function a(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const a=[],s=e.split("\n");for(let e=n;e1024)continue;const r=o.test(n)?n.replace(o,"$1"):n;if(!r.match(/\S*Error: /)){for(const e of t){const t=e(r);if(t){a.push(t);break}}if(a.length>=i)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop();t.reverse(),r.test(t[t.length-1].function||"")&&(t.pop(),r.test(t[t.length-1].function||"")&&t.pop());return t.slice(0,i).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}(a)}}function s(e){return Array.isArray(e)?a(...e):e}const c="";function l(e){try{return e&&"function"==typeof e&&e.name||c}catch(e){return c}}},63494:(e,t,n)=>{"use strict";n.d(t,{$G:()=>o,U0:()=>a,nK:()=>r});var i=n(93632);function o(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function r(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;tfunction(e,t,n=!1){return!!(0,i.HD)(e)&&((0,i.Kj)(t)?t.test(e):!!(0,i.HD)(t)&&(n?e===t:e.includes(t)))}(e,t,n)))}},74224:(e,t,n)=>{"use strict";n.d(t,{$2:()=>a,WD:()=>r,cW:()=>s});var i,o=n(93632);function r(e){return new s((t=>{t(e)}))}function a(e){return new s(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(i||(i={}));class s{constructor(e){s.prototype.__init.call(this),s.prototype.__init2.call(this),s.prototype.__init3.call(this),s.prototype.__init4.call(this),this._state=i.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new s(((n,i)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){i(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){i(e)}else i(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new s(((t,n)=>{let i,o;return this.then((t=>{o=!1,i=t,e&&e()}),(t=>{o=!0,i=t,e&&e()})).then((()=>{o?n(i):t(i)}))}))}__init(){this._resolve=e=>{this._setResult(i.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(i.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===i.PENDING&&((0,o.J8)(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===i.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===i.RESOLVED&&e[1](this._value),this._state===i.REJECTED&&e[2](this._value),e[0]=!0)}))}}}},28592:(e,t,n)=>{"use strict";n.d(t,{ph:()=>a,yW:()=>r});var i=n(6150);const o=1e3;function r(){return Date.now()/o}const a=function(){const{performance:e}=i.GLOBAL_OBJ;if(!e||!e.now)return r;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/o}();let s;(()=>{const{performance:e}=i.GLOBAL_OBJ;if(!e||!e.now)return void(s="none");const t=36e5,n=e.now(),o=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,a=r{"use strict";function i(e){return e&&e.Math==Math?e:void 0}n.d(t,{GLOBAL_OBJ:()=>o,R:()=>r,Y:()=>a});const o="object"==typeof globalThis&&i(globalThis)||"object"==typeof window&&i(window)||"object"==typeof self&&i(self)||"object"==typeof n.g&&i(n.g)||function(){return this}()||{};function r(){return o}function a(e,t,n){const i=n||o,r=i.__SENTRY__=i.__SENTRY__||{};return r[e]||(r[e]=t())}},86148:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>he});var i=n(75473),o=n(98566),r="tippy-content",a="tippy-backdrop",s="tippy-arrow",c="tippy-svg-arrow",l={passive:!0,capture:!0},u=function(){return document.body};function d(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function p(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function f(e,t){return"function"==typeof e?e.apply(void 0,t):e}function h(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function m(e){return[].concat(e)}function g(e,t){-1===e.indexOf(t)&&e.push(t)}function _(e){return e.split("-")[0]}function v(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function E(){return document.createElement("div")}function b(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function S(e){return p(e,"MouseEvent")}function A(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function T(e){return b(e)?[e]:function(e){return p(e,"NodeList")}(e)?v(e):Array.isArray(e)?e:v(document.querySelectorAll(e))}function O(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function I(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function C(e){var t,n=m(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function N(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function L(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var R={isTouch:!1},P=0;function k(){R.isTouch||(R.isTouch=!0,window.performance&&document.addEventListener("mousemove",D))}function D(){var e=performance.now();e-P<20&&(R.isTouch=!1,document.removeEventListener("mousemove",D)),P=e}function w(){var e=document.activeElement;if(A(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var M=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var x={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},U=Object.assign({appendTo:u,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},x,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),V=Object.keys(U);function F(e){var t=(e.plugins||[]).reduce((function(t,n){var i,o=n.name,r=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(i=U[o])?i:r);return t}),{});return Object.assign({},e,t)}function B(e,t){var n=Object.assign({},t,{content:f(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(F(Object.assign({},U,{plugins:t}))):V).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},U.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var H=function(){return"innerHTML"};function G(e,t){e[H()]=t}function K(e){var t=E();return!0===e?t.className=s:(t.className=c,b(e)?t.appendChild(e):G(t,e)),t}function W(e,t){b(t.content)?(G(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?G(e,t.content):e.textContent=t.content)}function Y(e){var t=e.firstElementChild,n=v(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(r)})),arrow:n.find((function(e){return e.classList.contains(s)||e.classList.contains(c)})),backdrop:n.find((function(e){return e.classList.contains(a)}))}}function j(e){var t=E(),n=E();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=E();function o(n,i){var o=Y(t),r=o.box,a=o.content,s=o.arrow;i.theme?r.setAttribute("data-theme",i.theme):r.removeAttribute("data-theme"),"string"==typeof i.animation?r.setAttribute("data-animation",i.animation):r.removeAttribute("data-animation"),i.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?r.setAttribute("role",i.role):r.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||W(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(r.removeChild(s),r.appendChild(K(i.arrow))):r.appendChild(K(i.arrow)):s&&r.removeChild(s)}return i.className=r,i.setAttribute("data-state","hidden"),W(i,e.props),t.appendChild(n),n.appendChild(i),o(e.props,e.props),{popper:t,onUpdate:o}}j.$$tippy=!0;var z=1,J=[],q=[];function X(e,t){var n,o,r,a,s,c,p,b,A=B(e,Object.assign({},U,F(y(t)))),T=!1,P=!1,k=!1,D=!1,w=[],x=h(Ee,A.interactiveDebounce),V=z++,H=(b=A.plugins).filter((function(e,t){return b.indexOf(e)===t})),G={id:V,reference:e,popper:E(),popperInstance:null,props:A,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:H,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(r)},setProps:function(t){0;if(G.state.isDestroyed)return;ae("onBeforeUpdate",[G,t]),ve();var n=G.props,i=B(e,Object.assign({},n,y(t),{ignoreAttributes:!0}));G.props=i,_e(),n.interactiveDebounce!==i.interactiveDebounce&&(le(),x=h(Ee,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?m(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");ce(),re(),j&&j(n,i);G.popperInstance&&(Te(),Ie().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[G,t])},setContent:function(e){G.setProps({content:e})},show:function(){0;var e=G.state.isVisible,t=G.state.isDestroyed,n=!G.state.isEnabled,i=R.isTouch&&!G.props.touch,o=d(G.props.duration,0,U.duration);if(e||t||n||i)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[G],!1),!1===G.props.onShow(G))return;G.state.isVisible=!0,ee()&&(W.style.visibility="visible");re(),fe(),G.state.isMounted||(W.style.transition="none");if(ee()){var r=ie();O([r.box,r.content],0)}c=function(){var e;if(G.state.isVisible&&!D){if(D=!0,W.offsetHeight,W.style.transition=G.props.moveTransition,ee()&&G.props.animation){var t=ie(),n=t.box,i=t.content;O([n,i],o),I([n,i],"visible")}se(),ce(),g(q,G),null==(e=G.popperInstance)||e.forceUpdate(),ae("onMount",[G]),G.props.animation&&ee()&&function(e,t){me(e,t)}(o,(function(){G.state.isShown=!0,ae("onShown",[G])}))}},function(){var e,t=G.props.appendTo,n=te();e=G.props.interactive&&t===u||"parent"===t?n.parentNode:f(t,[n]);e.contains(W)||e.appendChild(W);G.state.isMounted=!0,Te(),!1}()},hide:function(){0;var e=!G.state.isVisible,t=G.state.isDestroyed,n=!G.state.isEnabled,i=d(G.props.duration,1,U.duration);if(e||t||n)return;if(ae("onHide",[G],!1),!1===G.props.onHide(G))return;G.state.isVisible=!1,G.state.isShown=!1,D=!1,T=!1,ee()&&(W.style.visibility="hidden");if(le(),he(),re(!0),ee()){var o=ie(),r=o.box,a=o.content;G.props.animation&&(O([r,a],i),I([r,a],"hidden"))}se(),ce(),G.props.animation?ee()&&function(e,t){me(e,(function(){!G.state.isVisible&&W.parentNode&&W.parentNode.contains(W)&&t()}))}(i,G.unmount):G.unmount()},hideWithInteractivity:function(e){0;ne().addEventListener("mousemove",x),g(J,x),x(e)},enable:function(){G.state.isEnabled=!0},disable:function(){G.hide(),G.state.isEnabled=!1},unmount:function(){0;G.state.isVisible&&G.hide();if(!G.state.isMounted)return;Oe(),Ie().forEach((function(e){e._tippy.unmount()})),W.parentNode&&W.parentNode.removeChild(W);q=q.filter((function(e){return e!==G})),G.state.isMounted=!1,ae("onHidden",[G])},destroy:function(){0;if(G.state.isDestroyed)return;G.clearDelayTimeouts(),G.unmount(),ve(),delete e._tippy,G.state.isDestroyed=!0,ae("onDestroy",[G])}};if(!A.render)return G;var K=A.render(G),W=K.popper,j=K.onUpdate;W.setAttribute("data-tippy-root",""),W.id="tippy-"+G.id,G.popper=W,e._tippy=G,W._tippy=G;var X=H.map((function(e){return e.fn(G)})),Z=e.hasAttribute("aria-expanded");return _e(),ce(),re(),ae("onCreate",[G]),A.showOnCreate&&Ce(),W.addEventListener("mouseenter",(function(){G.props.interactive&&G.state.isVisible&&G.clearDelayTimeouts()})),W.addEventListener("mouseleave",(function(){G.props.interactive&&G.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",x)})),G;function Q(){var e=G.props.touch;return Array.isArray(e)?e:[e,0]}function $(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=G.props.render)||!e.$$tippy)}function te(){return p||e}function ne(){var e=te().parentNode;return e?C(e):document}function ie(){return Y(W)}function oe(e){return G.state.isMounted&&!G.state.isVisible||R.isTouch||a&&"focus"===a.type?0:d(G.props.delay,e?0:1,U.delay)}function re(e){void 0===e&&(e=!1),W.style.pointerEvents=G.props.interactive&&!e?"":"none",W.style.zIndex=""+G.props.zIndex}function ae(e,t,n){var i;(void 0===n&&(n=!0),X.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(i=G.props)[e].apply(i,t)}function se(){var t=G.props.aria;if(t.content){var n="aria-"+t.content,i=W.id;m(G.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(G.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var o=t&&t.replace(i,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function ce(){!Z&&G.props.aria.expanded&&m(G.props.triggerTarget||e).forEach((function(e){G.props.interactive?e.setAttribute("aria-expanded",G.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function le(){ne().removeEventListener("mousemove",x),J=J.filter((function(e){return e!==x}))}function ue(t){if(!R.isTouch||!k&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!G.props.interactive||!L(W,n)){if(m(G.props.triggerTarget||e).some((function(e){return L(e,n)}))){if(R.isTouch)return;if(G.state.isVisible&&G.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[G,t]);!0===G.props.hideOnClick&&(G.clearDelayTimeouts(),G.hide(),P=!0,setTimeout((function(){P=!1})),G.state.isMounted||he())}}}function de(){k=!0}function pe(){k=!1}function fe(){var e=ne();e.addEventListener("mousedown",ue,!0),e.addEventListener("touchend",ue,l),e.addEventListener("touchstart",pe,l),e.addEventListener("touchmove",de,l)}function he(){var e=ne();e.removeEventListener("mousedown",ue,!0),e.removeEventListener("touchend",ue,l),e.removeEventListener("touchstart",pe,l),e.removeEventListener("touchmove",de,l)}function me(e,t){var n=ie().box;function i(e){e.target===n&&(N(n,"remove",i),t())}if(0===e)return t();N(n,"remove",s),N(n,"add",i),s=i}function ge(t,n,i){void 0===i&&(i=!1),m(G.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),w.push({node:e,eventType:t,handler:n,options:i})}))}function _e(){var e;$()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",be,{passive:!0})),(e=G.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",be);break;case"focus":ge(M?"focusout":"blur",Se);break;case"focusin":ge("focusout",Se)}}))}function ve(){w.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),w=[]}function ye(e){var t,n=!1;if(G.state.isEnabled&&!Ae(e)&&!P){var i="focus"===(null==(t=a)?void 0:t.type);a=e,p=e.currentTarget,ce(),!G.state.isVisible&&S(e)&&J.forEach((function(t){return t(e)})),"click"===e.type&&(G.props.trigger.indexOf("mouseenter")<0||T)&&!1!==G.props.hideOnClick&&G.state.isVisible?n=!0:Ce(e),"click"===e.type&&(T=!n),n&&!i&&Ne(e)}}function Ee(e){var t=e.target,n=te().contains(t)||W.contains(t);if("mousemove"!==e.type||!n){var i=Ie().concat(W).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:A}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,r=e.props.interactiveBorder,a=_(o.placement),s=o.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-i+c>r,f=i-t.bottom-l>r,h=t.left-n+u>r,m=n-t.right-d>r;return p||f||h||m}))})(i,e)&&(le(),Ne(e))}}function be(e){Ae(e)||G.props.trigger.indexOf("click")>=0&&T||(G.props.interactive?G.hideWithInteractivity(e):Ne(e))}function Se(e){G.props.trigger.indexOf("focusin")<0&&e.target!==te()||G.props.interactive&&e.relatedTarget&&W.contains(e.relatedTarget)||Ne(e)}function Ae(e){return!!R.isTouch&&$()!==e.type.indexOf("touch")>=0}function Te(){Oe();var t=G.props,n=t.popperOptions,o=t.placement,r=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,l=ee()?Y(W).arrow:null,u=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:e,d={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=ie().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},d];ee()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),G.popperInstance=(0,i.fi)(u,W,Object.assign({},n,{placement:o,onFirstUpdate:c,modifiers:p}))}function Oe(){G.popperInstance&&(G.popperInstance.destroy(),G.popperInstance=null)}function Ie(){return v(W.querySelectorAll("[data-tippy-root]"))}function Ce(e){G.clearDelayTimeouts(),e&&ae("onTrigger",[G,e]),fe();var t=oe(!0),i=Q(),o=i[0],r=i[1];R.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){G.show()}),t):G.show()}function Ne(e){if(G.clearDelayTimeouts(),ae("onUntrigger",[G,e]),G.state.isVisible){if(!(G.props.trigger.indexOf("mouseenter")>=0&&G.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&T)){var t=oe(!1);t?o=setTimeout((function(){G.state.isVisible&&G.hide()}),t):r=requestAnimationFrame((function(){G.hide()}))}}else he()}}function Z(e,t){void 0===t&&(t={});var n=U.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",k,l),window.addEventListener("blur",w);var i=Object.assign({},t,{plugins:n}),o=T(e).reduce((function(e,t){var n=t&&X(t,i);return n&&e.push(n),e}),[]);return b(e)?o[0]:o}Z.defaultProps=U,Spicetify.Tippy=Z;Z.setDefaultProps=function(e){Object.keys(e).forEach((function(t){U[t]=e[t]}))},Z.currentInput=R;Object.assign({},o.Z,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Z.setDefaultProps({render:j});const Q=Z;var $=n(50959),ee=n(10422);function te(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n]);return o}var ne="undefined"!=typeof window&&"undefined"!=typeof document;function ie(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function oe(){return ne&&document.createElement("div")}function re(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!t.hasOwnProperty(n))return!1;if(!re(e[n],t[n]))return!1}return!0}return!1}function ae(e){var t=[];return e.forEach((function(e){t.find((function(t){return re(e,t)}))||t.push(e)})),t}function se(e,t){var n,i;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:ae([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(i=t.popperOptions)?void 0:i.modifiers)||[]))})})}var ce=ne?$.useLayoutEffect:$.useEffect;function le(e){var t=(0,$.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function ue(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var de={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function i(){e.props.className&&!n()||ue(t,"add",e.props.className)}return{onCreate:i,onBeforeUpdate:function(){n()&&ue(t,"remove",e.props.className)},onAfterUpdate:i}}};function pe(e){return function(t){var n=t.children,i=t.content,o=t.visible,r=t.singleton,a=t.render,s=t.reference,c=t.disabled,l=void 0!==c&&c,u=t.ignoreAttributes,d=void 0===u||u,p=(t.__source,t.__self,te(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),f=void 0!==o,h=void 0!==r,m=(0,$.useState)(!1),g=m[0],_=m[1],v=(0,$.useState)({}),y=v[0],E=v[1],b=(0,$.useState)(),S=b[0],A=b[1],T=le((function(){return{container:oe(),renders:1}})),O=Object.assign({ignoreAttributes:d},p,{content:T.container});f&&(O.trigger="manual",O.hideOnClick=!1),h&&(l=!0);var I=O,C=O.plugins||[];a&&(I=Object.assign({},O,{plugins:h&&null!=r.data?[].concat(C,[{fn:function(){return{onTrigger:function(e,t){var n=r.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,A(n.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[s].concat(n?[n.type]:[]);return ce((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||T.ref||oe(),Object.assign({},I,{plugins:[de].concat(O.plugins||[])}));return T.instance=n,l&&n.disable(),o&&n.show(),h&&r.hook({instance:n,content:i,props:I,setSingletonContent:A}),_(!0),function(){n.destroy(),null==r||r.cleanup(n)}}),N),ce((function(){var e;if(1!==T.renders){var t=T.instance;t.setProps(se(t.props,I)),null==(e=t.popperInstance)||e.forceUpdate(),l?t.disable():t.enable(),f&&(o?t.show():t.hide()),h&&r.hook({instance:t,content:i,props:I,setSingletonContent:A})}else T.renders++})),ce((function(){var e;if(a){var t=T.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,i=null==(t=n.modifiersData)?void 0:t.hide;y.placement===n.placement&&y.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&y.escaped===(null==i?void 0:i.hasPopperEscaped)||E({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[y.placement,y.referenceHidden,y.escaped].concat(N)),$.createElement($.Fragment,null,n?(0,$.cloneElement)(n,{ref:function(e){T.ref=e,ie(n.ref,e)}}):null,g&&(0,ee.createPortal)(a?a(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(y),S,T.instance):i,T.container))}}var fe=function(e,t){return(0,$.forwardRef)((function(n,i){var o=n.children,r=te(n,["children"]);return $.createElement(e,Object.assign({},t,r),o?(0,$.cloneElement)(o,{ref:function(e){ie(i,e),ie(o.ref,e)}}):null)}))};const he=fe(pe(Q))},67448:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>le});var i=n(75473),o=n(98566),r="tippy-content",a="tippy-backdrop",s="tippy-arrow",c="tippy-svg-arrow",l={passive:!0,capture:!0},u=function(){return document.body};function d(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function p(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function f(e,t){return"function"==typeof e?e.apply(void 0,t):e}function h(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function m(e){return[].concat(e)}function g(e,t){-1===e.indexOf(t)&&e.push(t)}function _(e){return e.split("-")[0]}function v(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function E(){return document.createElement("div")}function b(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function S(e){return p(e,"MouseEvent")}function A(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function T(e){return b(e)?[e]:function(e){return p(e,"NodeList")}(e)?v(e):Array.isArray(e)?e:v(document.querySelectorAll(e))}function O(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function I(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function C(e){var t,n=m(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function N(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function L(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var R={isTouch:!1},P=0;function k(){R.isTouch||(R.isTouch=!0,window.performance&&document.addEventListener("mousemove",D))}function D(){var e=performance.now();e-P<20&&(R.isTouch=!1,document.removeEventListener("mousemove",D)),P=e}function w(){var e=document.activeElement;if(A(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var M=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var x={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},U=Object.assign({appendTo:u,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},x,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),V=Object.keys(U);function F(e){var t=(e.plugins||[]).reduce((function(t,n){var i,o=n.name,r=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(i=U[o])?i:r);return t}),{});return Object.assign({},e,t)}function B(e,t){var n=Object.assign({},t,{content:f(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(F(Object.assign({},U,{plugins:t}))):V).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},U.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function H(e){var t=e.firstElementChild,n=v(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(r)})),arrow:n.find((function(e){return e.classList.contains(s)||e.classList.contains(c)})),backdrop:n.find((function(e){return e.classList.contains(a)}))}}var G=1,K=[],W=[];function Y(e,t){var n,o,r,a,s,c,p,b,A=B(e,Object.assign({},U,F(y(t)))),T=!1,P=!1,k=!1,D=!1,w=[],x=h(Ee,A.interactiveDebounce),V=G++,Y=(b=A.plugins).filter((function(e,t){return b.indexOf(e)===t})),j={id:V,reference:e,popper:E(),popperInstance:null,props:A,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(r)},setProps:function(t){0;if(j.state.isDestroyed)return;ae("onBeforeUpdate",[j,t]),ve();var n=j.props,i=B(e,Object.assign({},n,y(t),{ignoreAttributes:!0}));j.props=i,_e(),n.interactiveDebounce!==i.interactiveDebounce&&(le(),x=h(Ee,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?m(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");ce(),re(),q&&q(n,i);j.popperInstance&&(Te(),Ie().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[j,t])},setContent:function(e){j.setProps({content:e})},show:function(){0;var e=j.state.isVisible,t=j.state.isDestroyed,n=!j.state.isEnabled,i=R.isTouch&&!j.props.touch,o=d(j.props.duration,0,U.duration);if(e||t||n||i)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[j],!1),!1===j.props.onShow(j))return;j.state.isVisible=!0,ee()&&(J.style.visibility="visible");re(),fe(),j.state.isMounted||(J.style.transition="none");if(ee()){var r=ie();O([r.box,r.content],0)}c=function(){var e;if(j.state.isVisible&&!D){if(D=!0,J.offsetHeight,J.style.transition=j.props.moveTransition,ee()&&j.props.animation){var t=ie(),n=t.box,i=t.content;O([n,i],o),I([n,i],"visible")}se(),ce(),g(W,j),null==(e=j.popperInstance)||e.forceUpdate(),ae("onMount",[j]),j.props.animation&&ee()&&function(e,t){me(e,t)}(o,(function(){j.state.isShown=!0,ae("onShown",[j])}))}},function(){var e,t=j.props.appendTo,n=te();e=j.props.interactive&&t===u||"parent"===t?n.parentNode:f(t,[n]);e.contains(J)||e.appendChild(J);j.state.isMounted=!0,Te(),!1}()},hide:function(){0;var e=!j.state.isVisible,t=j.state.isDestroyed,n=!j.state.isEnabled,i=d(j.props.duration,1,U.duration);if(e||t||n)return;if(ae("onHide",[j],!1),!1===j.props.onHide(j))return;j.state.isVisible=!1,j.state.isShown=!1,D=!1,T=!1,ee()&&(J.style.visibility="hidden");if(le(),he(),re(!0),ee()){var o=ie(),r=o.box,a=o.content;j.props.animation&&(O([r,a],i),I([r,a],"hidden"))}se(),ce(),j.props.animation?ee()&&function(e,t){me(e,(function(){!j.state.isVisible&&J.parentNode&&J.parentNode.contains(J)&&t()}))}(i,j.unmount):j.unmount()},hideWithInteractivity:function(e){0;ne().addEventListener("mousemove",x),g(K,x),x(e)},enable:function(){j.state.isEnabled=!0},disable:function(){j.hide(),j.state.isEnabled=!1},unmount:function(){0;j.state.isVisible&&j.hide();if(!j.state.isMounted)return;Oe(),Ie().forEach((function(e){e._tippy.unmount()})),J.parentNode&&J.parentNode.removeChild(J);W=W.filter((function(e){return e!==j})),j.state.isMounted=!1,ae("onHidden",[j])},destroy:function(){0;if(j.state.isDestroyed)return;j.clearDelayTimeouts(),j.unmount(),ve(),delete e._tippy,j.state.isDestroyed=!0,ae("onDestroy",[j])}};if(!A.render)return j;var z=A.render(j),J=z.popper,q=z.onUpdate;J.setAttribute("data-tippy-root",""),J.id="tippy-"+j.id,j.popper=J,e._tippy=j,J._tippy=j;var X=Y.map((function(e){return e.fn(j)})),Z=e.hasAttribute("aria-expanded");return _e(),ce(),re(),ae("onCreate",[j]),A.showOnCreate&&Ce(),J.addEventListener("mouseenter",(function(){j.props.interactive&&j.state.isVisible&&j.clearDelayTimeouts()})),J.addEventListener("mouseleave",(function(){j.props.interactive&&j.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",x)})),j;function Q(){var e=j.props.touch;return Array.isArray(e)?e:[e,0]}function $(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=j.props.render)||!e.$$tippy)}function te(){return p||e}function ne(){var e=te().parentNode;return e?C(e):document}function ie(){return H(J)}function oe(e){return j.state.isMounted&&!j.state.isVisible||R.isTouch||a&&"focus"===a.type?0:d(j.props.delay,e?0:1,U.delay)}function re(e){void 0===e&&(e=!1),J.style.pointerEvents=j.props.interactive&&!e?"":"none",J.style.zIndex=""+j.props.zIndex}function ae(e,t,n){var i;(void 0===n&&(n=!0),X.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(i=j.props)[e].apply(i,t)}function se(){var t=j.props.aria;if(t.content){var n="aria-"+t.content,i=J.id;m(j.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(j.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var o=t&&t.replace(i,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function ce(){!Z&&j.props.aria.expanded&&m(j.props.triggerTarget||e).forEach((function(e){j.props.interactive?e.setAttribute("aria-expanded",j.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function le(){ne().removeEventListener("mousemove",x),K=K.filter((function(e){return e!==x}))}function ue(t){if(!R.isTouch||!k&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!j.props.interactive||!L(J,n)){if(m(j.props.triggerTarget||e).some((function(e){return L(e,n)}))){if(R.isTouch)return;if(j.state.isVisible&&j.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[j,t]);!0===j.props.hideOnClick&&(j.clearDelayTimeouts(),j.hide(),P=!0,setTimeout((function(){P=!1})),j.state.isMounted||he())}}}function de(){k=!0}function pe(){k=!1}function fe(){var e=ne();e.addEventListener("mousedown",ue,!0),e.addEventListener("touchend",ue,l),e.addEventListener("touchstart",pe,l),e.addEventListener("touchmove",de,l)}function he(){var e=ne();e.removeEventListener("mousedown",ue,!0),e.removeEventListener("touchend",ue,l),e.removeEventListener("touchstart",pe,l),e.removeEventListener("touchmove",de,l)}function me(e,t){var n=ie().box;function i(e){e.target===n&&(N(n,"remove",i),t())}if(0===e)return t();N(n,"remove",s),N(n,"add",i),s=i}function ge(t,n,i){void 0===i&&(i=!1),m(j.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),w.push({node:e,eventType:t,handler:n,options:i})}))}function _e(){var e;$()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",be,{passive:!0})),(e=j.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",be);break;case"focus":ge(M?"focusout":"blur",Se);break;case"focusin":ge("focusout",Se)}}))}function ve(){w.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),w=[]}function ye(e){var t,n=!1;if(j.state.isEnabled&&!Ae(e)&&!P){var i="focus"===(null==(t=a)?void 0:t.type);a=e,p=e.currentTarget,ce(),!j.state.isVisible&&S(e)&&K.forEach((function(t){return t(e)})),"click"===e.type&&(j.props.trigger.indexOf("mouseenter")<0||T)&&!1!==j.props.hideOnClick&&j.state.isVisible?n=!0:Ce(e),"click"===e.type&&(T=!n),n&&!i&&Ne(e)}}function Ee(e){var t=e.target,n=te().contains(t)||J.contains(t);if("mousemove"!==e.type||!n){var i=Ie().concat(J).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:A}:null})).filter(Boolean);(function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,r=e.props.interactiveBorder,a=_(o.placement),s=o.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-i+c>r,f=i-t.bottom-l>r,h=t.left-n+u>r,m=n-t.right-d>r;return p||f||h||m}))})(i,e)&&(le(),Ne(e))}}function be(e){Ae(e)||j.props.trigger.indexOf("click")>=0&&T||(j.props.interactive?j.hideWithInteractivity(e):Ne(e))}function Se(e){j.props.trigger.indexOf("focusin")<0&&e.target!==te()||j.props.interactive&&e.relatedTarget&&J.contains(e.relatedTarget)||Ne(e)}function Ae(e){return!!R.isTouch&&$()!==e.type.indexOf("touch")>=0}function Te(){Oe();var t=j.props,n=t.popperOptions,o=t.placement,r=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,l=ee()?H(J).arrow:null,u=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:e,d={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=ie().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},d];ee()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),j.popperInstance=(0,i.fi)(u,J,Object.assign({},n,{placement:o,onFirstUpdate:c,modifiers:p}))}function Oe(){j.popperInstance&&(j.popperInstance.destroy(),j.popperInstance=null)}function Ie(){return v(J.querySelectorAll("[data-tippy-root]"))}function Ce(e){j.clearDelayTimeouts(),e&&ae("onTrigger",[j,e]),fe();var t=oe(!0),i=Q(),o=i[0],r=i[1];R.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){j.show()}),t):j.show()}function Ne(e){if(j.clearDelayTimeouts(),ae("onUntrigger",[j,e]),j.state.isVisible){if(!(j.props.trigger.indexOf("mouseenter")>=0&&j.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&T)){var t=oe(!1);t?o=setTimeout((function(){j.state.isVisible&&j.hide()}),t):r=requestAnimationFrame((function(){j.hide()}))}}else he()}}function j(e,t){void 0===t&&(t={});var n=U.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",k,l),window.addEventListener("blur",w);var i=Object.assign({},t,{plugins:n}),o=T(e).reduce((function(e,t){var n=t&&Y(t,i);return n&&e.push(n),e}),[]);return b(e)?o[0]:o}j.defaultProps=U,Spicetify.Tippy=j;j.setDefaultProps=function(e){Object.keys(e).forEach((function(t){U[t]=e[t]}))},j.currentInput=R;Object.assign({},o.Z,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});j.setDefaultProps({animation:!1});const z=j;var J=n(50959),q=n(10422);function X(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n]);return o}var Z="undefined"!=typeof window&&"undefined"!=typeof document;function Q(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function $(){return Z&&document.createElement("div")}function ee(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!t.hasOwnProperty(n))return!1;if(!ee(e[n],t[n]))return!1}return!0}return!1}function te(e){var t=[];return e.forEach((function(e){t.find((function(t){return ee(e,t)}))||t.push(e)})),t}function ne(e,t){var n,i;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:te([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(i=t.popperOptions)?void 0:i.modifiers)||[]))})})}var ie=Z?J.useLayoutEffect:J.useEffect;function oe(e){var t=(0,J.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function re(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var ae={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function i(){e.props.className&&!n()||re(t,"add",e.props.className)}return{onCreate:i,onBeforeUpdate:function(){n()&&re(t,"remove",e.props.className)},onAfterUpdate:i}}};function se(e){return function(t){var n=t.children,i=t.content,o=t.visible,r=t.singleton,a=t.render,s=t.reference,c=t.disabled,l=void 0!==c&&c,u=t.ignoreAttributes,d=void 0===u||u,p=(t.__source,t.__self,X(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),f=void 0!==o,h=void 0!==r,m=(0,J.useState)(!1),g=m[0],_=m[1],v=(0,J.useState)({}),y=v[0],E=v[1],b=(0,J.useState)(),S=b[0],A=b[1],T=oe((function(){return{container:$(),renders:1}})),O=Object.assign({ignoreAttributes:d},p,{content:T.container});f&&(O.trigger="manual",O.hideOnClick=!1),h&&(l=!0);var I=O,C=O.plugins||[];a&&(I=Object.assign({},O,{plugins:h&&null!=r.data?[].concat(C,[{fn:function(){return{onTrigger:function(e,t){var n=r.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,A(n.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[s].concat(n?[n.type]:[]);return ie((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||T.ref||$(),Object.assign({},I,{plugins:[ae].concat(O.plugins||[])}));return T.instance=n,l&&n.disable(),o&&n.show(),h&&r.hook({instance:n,content:i,props:I,setSingletonContent:A}),_(!0),function(){n.destroy(),null==r||r.cleanup(n)}}),N),ie((function(){var e;if(1!==T.renders){var t=T.instance;t.setProps(ne(t.props,I)),null==(e=t.popperInstance)||e.forceUpdate(),l?t.disable():t.enable(),f&&(o?t.show():t.hide()),h&&r.hook({instance:t,content:i,props:I,setSingletonContent:A})}else T.renders++})),ie((function(){var e;if(a){var t=T.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,i=null==(t=n.modifiersData)?void 0:t.hide;y.placement===n.placement&&y.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&y.escaped===(null==i?void 0:i.hasPopperEscaped)||E({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[y.placement,y.referenceHidden,y.escaped].concat(N)),J.createElement(J.Fragment,null,n?(0,J.cloneElement)(n,{ref:function(e){T.ref=e,Q(n.ref,e)}}):null,g&&(0,q.createPortal)(a?a(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(y),S,T.instance):i,T.container))}}var ce=function(e,t){return(0,J.forwardRef)((function(n,i){var o=n.children,r=X(n,["children"]);return J.createElement(e,Object.assign({},t,r),o?(0,J.cloneElement)(o,{ref:function(e){Q(i,e),Q(o.ref,e)}}):null)}))};const le=ce(se(z),{render:function(){return""}})},66717:(e,t,n)=>{"use strict";function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var o;n.d(t,{C8:()=>f,f0:()=>s,kJ:()=>m}),function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(o||(o={}));var r={type:"xstate.init"};function a(e){return void 0===e?[]:[].concat(e)}function s(e){return{type:"xstate.assign",assignment:e}}function c(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function l(e){return function(t){return e===t}}function u(e){return"string"==typeof e?{type:e}:e}function d(e,t){return{value:e,context:t,actions:[],changed:!1,matches:l(e)}}function p(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function f(e,t){void 0===t&&(t={});var n=i(p(a(e.states[e.initial].entry).map((function(e){return c(e,t.actions)})),e.context,r),2),o=n[0],s=n[1],f={config:e,_options:t,initialState:{value:e.initial,actions:o,context:s,matches:l(e.initial)},transition:function(t,n){var o,r,s="string"==typeof t?{value:t,context:e.context}:t,h=s.value,m=s.context,g=u(n),_=e.states[h];if(_.on){var v=a(_.on[g.type]);"*"in _.on&&v.push.apply(v,function(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),E=y.next();!E.done;E=y.next()){var b=E.value;if(void 0===b)return d(h,m);var S="string"==typeof b?{target:b}:b,A=S.target,T=S.actions,O=void 0===T?[]:T,I=S.cond,C=void 0===I?function(){return!0}:I,N=void 0===A,L=null!=A?A:h,R=e.states[L];if(C(m,g)){var P=i(p((N?a(O):[].concat(_.exit,O,R.entry).filter((function(e){return e}))).map((function(e){return c(e,f._options.actions)})),m,g),3),k=P[0],D=P[1],w=P[2],M=null!=A?A:h;return{value:M,context:D,actions:k,changed:A!==h||k.length>0||w,matches:l(M)}}}}catch(e){o={error:e}}finally{try{E&&!E.done&&(r=y.return)&&r.call(y)}finally{if(o)throw o.error}}}return d(h,m)}};return f}var h=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function m(e){var t=e.initialState,n=o.NotStarted,i=new Set,a={_machine:e,send:function(r){n===o.Running&&(t=e.transition(t,r),h(t,u(r)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:l(s.value)}}else t=e.initialState;return n=o.Running,h(t,r),a},stop:function(){return n=o.Stopped,i.clear(),a},get state(){return t},get status(){return n}};return a}},21366:e=>{"use strict";const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},69783:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const i=200,o=0,r="linear",a=!0;class s{constructor(e={}){this._curve=e.curve||r,this._baseTime=e.baseTime||i,this._ceiling=e.ceiling||o,this._jitter="jitter"in e?!!e.jitter:a}getTime(e){let t;switch(this._curve){case"static":t=1;break;case"logarithmic":t=Math.log(e);break;case"exponential":t=Math.pow(Math.E,e);break;default:t=e+1}let n=Math.min(4294967296,Math.floor(t*this._baseTime));return this._ceiling&&(n=Math.min(n,this._ceiling)),this._jitter?function(e){const t=e/5;return Math.floor(e-t/2+Math.random()*t)}(n):n}}},39723:(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var i=n(99938);var o=n(69783);const r={backoffInitial:!1,baseTime:200,ceiling:0,curve:"linear",jitter:!0,maxDuration:1/0,maxRetries:1/0,maxTime:1/0,retryPredicate:()=>!0};class a{constructor(e,t){this._resolver=function(){let e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}(),this._ts=0,this._callCount=0,this._tickInterval=0,this._isRunning=!1,this._isDestroyed=!1;const n=Object.assign(Object.assign({},r),t),{backoffInitial:a,maxDuration:s,maxRetries:c,maxTime:l,retryPredicate:u}=n,d=(0,i.__rest)(n,["backoffInitial","maxDuration","maxRetries","maxTime","retryPredicate"]);this._fn=e,this._backoffInitial=a,this._maxDuration=s,this._maxRetries=c,this._maxTime=l,this._retryPredicate=u,this._backoffInitial=a,this._counter=new o.A(d),this._backoffInitial&&(this._maxRetries+=1)}static init(e,t={}){return new a(e,t).start()}_destroy(){this._isRunning=!1,this._isDestroyed=!0}_failure(e){if(!this._isDestroyed)if(e&&"retryAfter"in e)this._retryAfter(e);else{const t=this._counter.getTime(this._callCount);this._shouldRetry(t,e)?(this._callCount++,this._tickInterval=setTimeout((()=>this._tick()),t)):(this._resolver.reject(e),this._destroy())}}_retryAfter(e){this._callCount++,this._tickInterval=setTimeout((()=>this._tick()),e.retryAfter)}_success(...e){this._isDestroyed||(this._resolver.resolve(...e),this._destroy())}_shouldRetry(e,t){const n=Date.now()-this._ts+e;return this._callCountthis._success(...e))).catch((e=>this._failure(e)))}getResolver(){return this._resolver.promise}start(){return this._isDestroyed?Promise.reject(new Error("Backoff already consumed")):(this._isRunning||(this._ts=Date.now(),this._isRunning=!0,this._backoffInitial?(this._callCount=1,this._tickInterval=setTimeout((()=>this._tick()),this._counter.getTime(0))):this._tick()),this._resolver.promise)}stop(){clearTimeout(this._tickInterval),this._destroy()}getRetryCount(){return this._callCount}}},97127:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var i={};n.r(i),n.d(i,{disable:()=>g,disableAll:()=>y,enable:()=>m,enableAll:()=>v,forTag:()=>E,intercept:()=>p,list:()=>h,remove:()=>b,setLevel:()=>_,unintercept:()=>f});var o;n(46758),n(53321),n(86277),n(2836);!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.DEBUG=2]="DEBUG",e[e.INFO=4]="INFO",e[e.WARN=8]="WARN",e[e.ERROR=16]="ERROR"}(o||(o={}));n(14224);const r=class{constructor(){this.tag="",this.description=""}matchesTag(){return!1}setLevel(){}enable(){}disable(){}log(){}debug(){}info(){}warn(){}error(){}},a="__dbgLoggerRegistry";let s=n.g[a];s||(s={map:{},list:[],loggingPredicate:function(){}},Object.defineProperty?Object.defineProperty(n.g,a,{value:s}):n.g[a]=s);const c=s.map,l=s.list;function u(e){return!(!s.loggingPredicate||!s.loggingPredicate(e))}let d="log";function p(e){if("function"!=typeof e)throw new TypeError("Logging.intercept requires a function predicate.");s.loggingPredicate=e}function f(){s.loggingPredicate=()=>{}}function h(e){const t=Object.keys(c).filter((e=>c[e])).sort();return e?t.map((e=>({tag:e,description:c[e].description||"No description."}))):t.reduce(((e,t)=>(e[t]=c[t].description||"No description",e)),{})}function m(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.enable()}}}function g(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.disable()}}}function _(e){d=e;let t=l.length;for(;t--;){const n=l[t];n&&n.setLevel(e)}}function v(){let e=l.length;for(;e--;)l[e]&&l[e].enable()}function y(){let e=l.length;for(;e--;)l[e]&&l[e].disable()}function E(e,t){let n,i;if("string"==typeof e?(n=e.toLowerCase(),i=t):(n=e.tag,i=e.description),c.hasOwnProperty(n)&&c[n])return c[n];const o=new r(n,i,u);return o.setLevel(d),c[n]=o,l.push(o),o}function b(e){const t=e.toLowerCase();if(!c.hasOwnProperty(t)||!c[t])return;const n=c[t];c[t]=null;const i=l.indexOf(n);-1!==i&&l.splice(i,1)}},843:(e,t,n)=>{"use strict";function i(){let e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}n.d(t,{$:()=>i})},92614:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var i={};n.r(i),n.d(i,{disable:()=>g,disableAll:()=>y,enable:()=>m,enableAll:()=>v,forTag:()=>E,intercept:()=>p,list:()=>h,remove:()=>b,setLevel:()=>_,unintercept:()=>f});var o;n(46758),n(53321),n(86277),n(2836);!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.DEBUG=2]="DEBUG",e[e.INFO=4]="INFO",e[e.WARN=8]="WARN",e[e.ERROR=16]="ERROR"}(o||(o={}));let r=class{constructor(){this.tag="",this.description=""}matchesTag(){return!1}setLevel(){}enable(){}disable(){}log(){}debug(){}info(){}warn(){}error(){}};try{0}catch(e){}const a="__dbgLoggerRegistry";let s=n.g[a];s||(s={map:{},list:[],loggingPredicate:function(){}},Object.defineProperty?Object.defineProperty(n.g,a,{value:s}):n.g[a]=s);const c=s.map,l=s.list;function u(e){return!(!s.loggingPredicate||!s.loggingPredicate(e))}let d="log";function p(e){if("function"!=typeof e)throw new TypeError("Logging.intercept requires a function predicate.");s.loggingPredicate=e}function f(){s.loggingPredicate=()=>{}}function h(e){const t=Object.keys(c).filter((e=>c[e])).sort();return e?t.map((e=>({tag:e,description:c[e].description||"No description."}))):t.reduce(((e,t)=>(e[t]=c[t].description||"No description",e)),{})}function m(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.enable()}}}function g(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.disable()}}}function _(e){d=e;let t=l.length;for(;t--;){const n=l[t];n&&n.setLevel(e)}}function v(){let e=l.length;for(;e--;)l[e]&&l[e].enable()}function y(){let e=l.length;for(;e--;)l[e]&&l[e].disable()}function E(e,t){let n,i;if("string"==typeof e?(n=e.toLowerCase(),i=t):(n=e.tag,i=e.description),c.hasOwnProperty(n)&&c[n])return c[n];const o=new r(n,i,u);return o.setLevel(d),c[n]=o,l.push(o),o}function b(e){const t=e.toLowerCase();if(!c.hasOwnProperty(t)||!c[t])return;const n=c[t];c[t]=null;const i=l.indexOf(n);-1!==i&&l.splice(i,1)}},30622:(e,t,n)=>{"use strict";n.d(t,{R:()=>i,D:()=>o});var i={};n.r(i),n.d(i,{fromBytes:()=>f,fromHex:()=>g,toBytes:()=>h,toHex:()=>m});var o={};n.r(o),n.d(o,{decode:()=>b,encode:()=>E});const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a={},s={};function c(e,t,n){let i=0;for(let o=0;o{const e=[];for(let t=0;t<256;++t)e[t]=255;for(let t=0;t<64;++t)e[_.charCodeAt(t)]=t;return String.fromCharCode(...e)})();let E=function(e){const t=String(e),n=[],i=t.length;let o=0;for(;o>2),_.charAt((3&e)<<4),"==");break}const r=t.charCodeAt(o++);if(o===i){n.push(_.charAt(e>>2),_.charAt((3&e)<<4|(240&r)>>4),_.charAt((15&r)<<2),"=");break}const a=t.charCodeAt(o++);n.push(_.charAt(e>>2),_.charAt((3&e)<<4|(240&r)>>4),_.charAt((15&r)<<2|(192&a)>>6),_.charAt(63&a))}return n.join("")},b=function(e){const t=String(e),n=[],i=t.length;let o,r,a=0;for(;;){do{o=y.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>4));do{o=y.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>2));do{r=y.charCodeAt(255&t.charCodeAt(a++))}while(255===r&&awindow.btoa(e),b=e=>window.atob(e))},60045:(e,t,n)=>{"use strict";function i(){let e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}n.d(t,{$:()=>i})},52903:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var i={};n.r(i),n.d(i,{disable:()=>g,disableAll:()=>y,enable:()=>m,enableAll:()=>v,forTag:()=>E,intercept:()=>p,list:()=>h,remove:()=>b,setLevel:()=>_,unintercept:()=>f});n(14224);var o;n(46758),n(53321),n(86277),n(2836);!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.DEBUG=2]="DEBUG",e[e.INFO=4]="INFO",e[e.WARN=8]="WARN",e[e.ERROR=16]="ERROR"}(o||(o={}));n(14224);const r=class{constructor(){this.tag="",this.description=""}matchesTag(){return!1}setLevel(){}enable(){}disable(){}log(){}debug(){}info(){}warn(){}error(){}},a="__dbgLoggerRegistry";let s=n.g[a];s||(s={map:{},list:[],loggingPredicate:function(){}},Object.defineProperty?Object.defineProperty(n.g,a,{value:s}):n.g[a]=s);const c=s.map,l=s.list;function u(e){return!(!s.loggingPredicate||!s.loggingPredicate(e))}let d="log";function p(e){if("function"!=typeof e)throw new TypeError("Logging.intercept requires a function predicate.");s.loggingPredicate=e}function f(){s.loggingPredicate=()=>{}}function h(e){const t=Object.keys(c).filter((e=>c[e])).sort();return e?t.map((e=>({tag:e,description:c[e].description||"No description."}))):t.reduce(((e,t)=>(e[t]=c[t].description||"No description",e)),{})}function m(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.enable()}}}function g(e){var t;const n=Array.isArray(e)?e:[e];let i=n.length;for(;i--;){const e=null===(t=n[i])||void 0===t?void 0:t.toLowerCase();let o=l.length;for(;o--;){const t=l[o];t.matchesTag(e)&&t.disable()}}}function _(e){d=e;let t=l.length;for(;t--;){const n=l[t];n&&n.setLevel(e)}}function v(){let e=l.length;for(;e--;)l[e]&&l[e].enable()}function y(){let e=l.length;for(;e--;)l[e]&&l[e].disable()}function E(e,t){let n,i;if("string"==typeof e?(n=e.toLowerCase(),i=t):(n=e.tag,i=e.description),c.hasOwnProperty(n)&&c[n])return c[n];const o=new r(n,i,u);return o.setLevel(d),c[n]=o,l.push(o),o}function b(e){const t=e.toLowerCase();if(!c.hasOwnProperty(t)||!c[t])return;const n=c[t];c[t]=null;const i=l.indexOf(n);-1!==i&&l.splice(i,1)}},54787:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Base62:()=>i,Base64:()=>o});var i={};n.r(i),n.d(i,{fromBytes:()=>f,fromHex:()=>g,toBytes:()=>h,toHex:()=>m});var o={};n.r(o),n.d(o,{decode:()=>b,encode:()=>E});const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a={},s={};function c(e,t,n){let i=0;for(let o=0;o{const e=[];for(let t=0;t<256;++t)e[t]=255;for(let t=0;t<64;++t)e[_.charCodeAt(t)]=t;return String.fromCharCode(...e)})();let E=function(e){const t=String(e),n=[],i=t.length;let o=0;for(;o>2),_.charAt((3&e)<<4),"==");break}const r=t.charCodeAt(o++);if(o===i){n.push(_.charAt(e>>2),_.charAt((3&e)<<4|(240&r)>>4),_.charAt((15&r)<<2),"=");break}const a=t.charCodeAt(o++);n.push(_.charAt(e>>2),_.charAt((3&e)<<4|(240&r)>>4),_.charAt((15&r)<<2|(192&a)>>6),_.charAt(63&a))}return n.join("")},b=function(e){const t=String(e),n=[],i=t.length;let o,r,a=0;for(;;){do{o=y.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>4));do{o=y.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>2));do{r=y.charCodeAt(255&t.charCodeAt(a++))}while(255===r&&awindow.btoa(e),b=e=>window.atob(e))},98429:(e,t,n)=>{"use strict";n.d(t,{eV:()=>r,Hx:()=>l});n(86277);const i="undefined"!=typeof globalThis&&"function"==typeof globalThis.queueMicrotask?globalThis.queueMicrotask.bind(globalThis):function(){if("undefined"==typeof Promise)return e=>setTimeout(e,0);const e=Promise.resolve();return t=>{e.then(t).catch((e=>setTimeout((()=>{throw e}),0)))}}();var o;!function(e){e.INVALID_IDENT_DATA="INVALID_IDENT_DATA",e.LOGGING_REQUEST_FAILED="LOGGING_REQUEST_FAILED"}(o||(o={}));const r={UNKNOWN:"unknown",EMPTY:"",ZERO:0,EMPTY_VERSION:"0.0.0"};n(46758),n(2836);class a extends Error{constructor(e,t,n){super(t),this.name="LoggingError",this.code=e,this.status=n||0}}function s(e,t){const n=e.indexOf(t);return-1===n?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}const c=202;class l{constructor(e){this._transport=e.transport,this._endpoint=e.endpoint||"@webgate/melody",this._batchQueue=[],this._identData=Promise.all([e.sdkId,e.platform,e.clientVersion]).then((([e,t,n])=>({sdk_id:e||r.EMPTY,platform:t||r.EMPTY,client_version:n||r.EMPTY_VERSION})))}_assertValidIdentData(e){if(!e.sdk_id)throw new a(o.INVALID_IDENT_DATA,"sdkId must be a non-empty string.",0)}_sendBatchedLogs(){return this._identData.then((e=>{this._assertValidIdentData(e);const t=this._batchQueue.splice(0,this._batchQueue.length);if(t.length){const i=(n="endpoint",t.reduce((function(e,t){var i;const o=t[n];return void 0===o||(e[o]=null!==(i=e[o])&&void 0!==i?i:[],e[o].push(t)),e}),{})),r=Object.keys(i).map((t=>{var n;const r=null===(n=i[t])||void 0===n?void 0:n.map((({payload:e})=>e));return(null==r?void 0:r.length)?this._transport.request(`${this._endpoint}${t}`,{method:"POST",payload:JSON.stringify(Object.assign({messages:r},e)),retry:{maxRetries:5,condition:e=>e.status!==c}}).then((({status:e})=>e===c||Promise.reject(new a(o.LOGGING_REQUEST_FAILED,`Logging service responded with status ${e}`,e)))):Promise.resolve(!0)}));return Promise.all(r).then((()=>!0))}var n;return Promise.resolve(!0)}))}_sendLog(e,t){return this.sendLog(e,t)}sendLog(e,t,n){const r=null==n?void 0:n.forget;if(null==n?void 0:n.batch){if(r)throw new Error("'forget' cannot be used together with 'batch'.");return new Promise((n=>{this._batchQueue.push({endpoint:e,payload:t}),i((()=>{this._sendBatchedLogs().then(n)}))}))}return this._identData.then((n=>{this._assertValidIdentData(n);let i=this._endpoint+e;const o=r?this._transport.getLastToken():null;return o&&(i=function(e,t,n){const[i,o]=s(e,"#"),[r,a]=s(i,"?"),c=o?`#${o}`:"";let l=`${t}=${encodeURIComponent(n)}`;const u=a.split("&");for(const e of u)e.length>0&&s(e,"=")[0]!==t&&(l+=`&${e}`);return`${r}?${l}${c}`}(i,"access_token",o)),this._transport.request(i,{method:"POST",payload:JSON.stringify(Object.assign(Object.assign({},t),n)),forget:r,retry:{maxRetries:5,condition:e=>e.status!==c}})})).then((({status:e})=>!(!r&&e!==c)||Promise.reject(new a(o.LOGGING_REQUEST_FAILED,`Logging service responded with status ${e}`,e))))}}},59797:(e,t,n)=>{n(46758),n(53321),n(45205),n(27082),n(2836),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527),"undefined"!=typeof self&&self,e.exports=function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=18)}([function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(6))},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function i(e,t){for(var n=-1,i=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=b}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){return!!e&&"object"==typeof e}function E(e){return h(e)?o(e):a(e)}var b=9007199254740991,S="[object Arguments]",A="[object Function]",T="[object GeneratorFunction]",O=/^(?:0|[1-9]\d*)$/,I=Object.prototype,C=I.hasOwnProperty,N=I.toString,L=I.propertyIsEnumerable,R=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),P=Math.max,k=!L.call({valueOf:1},"valueOf"),D=Array.isArray,w=function(e){return s((function(t,n){var i=-1,o=n.length,r=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(o--,r):void 0,a&&u(n[0],n[1],a)&&(r=o<3?void 0:r,o=1),t=Object(t);++i=0&&(t[i]=n.join(": "))}})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=["x-cdn","content-type"]},function(e,t,n){"use strict";var i=SyntaxError,o=Function,r=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var c=function(){throw new r},l=s?function(){try{return c}catch(e){try{return s(arguments,"callee").get}catch(e){return c}}}():c,u=n(46)(),d=Object.getPrototypeOf||function(e){return e.__proto__},p={},f="undefined"==typeof Uint8Array?void 0:d(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":u?d([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?d(d([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?d((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?d((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?d(""[Symbol.iterator]()):void 0,"%Symbol%":u?Symbol:void 0,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":f,"%TypeError%":r,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},m=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(n=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return h[t]=n,n},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=n(10),v=n(49),y=_.call(Function.call,Array.prototype.concat),E=_.call(Function.apply,Array.prototype.splice),b=_.call(Function.call,String.prototype.replace),S=_.call(Function.call,String.prototype.slice),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,O=function(e){var t=S(e,0,1),n=S(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var o=[];return b(e,A,(function(e,t,n,i){o[o.length]=n?b(i,T,"$1"):t||e})),o},I=function(e,t){var n,o=e;if(v(g,o)&&(o="%"+(n=g[o])[0]+"%"),v(h,o)){var a=h[o];if(a===p&&(a=m(o)),void 0===a&&!t)throw new r("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:a}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new r('"allowMissing" argument must be a boolean');var n=O(e),o=n.length>0?n[0]:"",a=I("%"+o+"%",t),c=a.name,l=a.value,u=!1,d=a.alias;d&&(o=d[0],E(n,y([0,1],d)));for(var p=1,f=!0;p=n.length){var b=s(l,m);l=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[m]}else f=v(l,m),l=l[m];f&&!u&&(h[c]=l)}}return l}},function(e,t,n){"use strict";var i=n(48);e.exports=Function.prototype.bind||i},function(e,t,n){"use strict";var i=String.prototype.replace,o=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports={default:r.RFC3986,formatters:{RFC1738:function(e){return i.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findMediaElement=t.getMuxPlayerId=void 0;var i=n(7),o=function(e){return e&&void 0!==e.nodeName?(e.muxId||(e.muxId=e.id||(0,i.generateShortID)()),e.muxId):e},r=function(e){var t=void 0;return e&&void 0!==e.nodeName?e=o(t=e):t=document.querySelector(e),[t,e,t&&t.nodeName?t.nodeName.toLowerCase():""]};t.getMuxPlayerId=o,t.findMediaElement=r},function(e,t,n){"use strict";function i(){return"1"===(o.default.doNotTrack||o.default.navigator&&(o.default.navigator.doNotTrack||o.default.navigator.msDoNotTrack))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o={exists:function(){var e=i.default.performance;return void 0!==(e&&e.timing)},domContentLoadedEventEnd:function(){var e=i.default.performance,t=e&&e.timing;return t&&t.domContentLoadedEventEnd},navigationStart:function(){var e=i.default.performance,t=e&&e.timing;return t&&t.navigationStart}};t.default=o},function(e,t,n){"use strict";var i=n(44),o=n(54),r=n(11);e.exports={formats:r,parse:o,stringify:i}},function(e,t,n){"use strict";var i=n(11),o=Object.prototype.hasOwnProperty,r=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===i.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},f=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i=0&&t<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(s=t,!1!==n&&o(t),i.call(l,t,e),typeof console===c&&t0||t.video_source_duration>0)&&(t.video_source_is_live=!1),t.video_source_url=t.video_source_url||t.player_source_url,t.video_source_url){var n=(0,c.extractHostnameAndDomain)(t.video_source_url),i=o(n,2),r=i[0],s=i[1];t.video_source_domain=s,t.video_source_hostname=r}delete t.ad_request_id,this.playbackEventDispatcher.send(e,t),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()},P.prototype._updateStateData=function(){(0,a.default)(this.data,this.getStateData()),this.getPlayheadTime&&(this.data.player_playhead_time=this.getPlayheadTime()),this._sanitizeData()},P.prototype._sanitizeData=function(){var e=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach((function(t){var n=parseInt(e.data[t],10);e.data[t]=isNaN(n)?void 0:n})),["player_source_url","video_source_url"].forEach((function(t){if(e.data[t]){var n=e.data[t].toLowerCase();0!==n.indexOf("data:")&&0!==n.indexOf("blob:")||(e.data[t]="MSE style URL")}}))},P.prototype._resetVideoData=function(e,t){var n=this;Object.keys(this.data).forEach((function(e){0===e.indexOf("video_")&&delete n.data[e]}))},P.prototype._resetViewData=function(){var e=this;Object.keys(this.data).forEach((function(t){0===t.indexOf("view_")&&delete e.data[t]})),this.data.view_sequence_number=1},P.prototype._resetErrorData=function(e,t){delete this.data.player_error_code,delete this.data.player_error_message},P.prototype._initializeViewData=function(){var e=this,t=this.data.view_id=(0,s.generateUUID)();this.data.video_id||(this.data.video_id=(0,p.default)(this.data.player_source_url));var n=function(){t===e.data.view_id&&(0,d.default)(e.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",n):n()},P.prototype._restartHeartBeat=function(){var e=this;l.default.clearTimeout(this._heartBeatTimeout),this.viewErrored||(this._heartBeatTimeout=l.default.setTimeout((function(){e.data.player_is_paused||e.emit("hb")}),1e4))},P.prototype.addHLSJS=function(e){return e.hlsjs?this.hlsjs?void this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=e.hlsjs,void(0,f.monitorHlsJs)(this.mux,this.id,e.hlsjs,{},e.Hls||l.default.Hls)):void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")},P.prototype.removeHLSJS=function(){this.hlsjs&&((0,f.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},P.prototype.addDashJS=function(e){return e.dashjs?this.dashjs?void this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=e.dashjs,void(0,h.monitorDashJS)(this.mux,this.id,e.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},P.prototype.removeDashJS=function(){this.dashjs&&((0,h.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},t.default=P},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=r.default.createElement("a");t.href=e;var n=t.pathname.replace(/\.[^/.]+$/,"");return a.default.encode(t.host+n).split("=")[0]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=i(n(23)),a=i(n(25))},function(e,t,n){(function(t){var i,o=void 0!==t?t:"undefined"!=typeof window?window:{},r=n(24);"undefined"!=typeof document?i=document:(i=o["__GLOBAL_DOCUMENT_CACHE@4"])||(i=o["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=i}).call(t,n(6))},function(e,t){},function(e,t,n){(function(e,i){var o;!function(i){"object"==typeof e&&e&&e.exports;var r=function(e){this.message=e};r.prototype=new Error,r.prototype.name="InvalidCharacterError";var a=function(e){throw new r(e)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,l=function(e){var t=(e=String(e).replace(c,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,o=0,r="",l=-1;++l>(-2*o&6)));return r},u=function(e){e=String(e),/[^\0-\xFF]/.test(e)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n=e.length%3,i="",o=-1,r=e.length-n;++o>18&63)+s.charAt(t>>12&63)+s.charAt(t>>6&63)+s.charAt(63&t);return 2==n?(t=(e.charCodeAt(o)<<8)+e.charCodeAt(++o),i+=s.charAt(t>>10)+s.charAt(t>>4&63)+s.charAt(t<<2&63)+"="):1==n&&(t=e.charCodeAt(o),i+=s.charAt(t>>2)+s.charAt(t<<4&63)+"=="),i},d={encode:u,decode:l,version:"0.1.0"};void 0!==(o=function(){return d}.call(t,n,t,e))&&(e.exports=o)}()}).call(t,n(26)(e),n(6))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.stopMonitoringHlsJs=t.monitorHlsJs=void 0;var o=i(n(8)),r=i(n(14)),a=n(5),s=function(e){if(!e)return{};var t=r.default.navigationStart(),n=e.loading,i=n?n.start:e.trequest,o=n?n.first:e.tfirst,a=n?n.end:e.tload;return{bytesLoaded:e.total,requestStart:Math.round(t+i),responseStart:Math.round(t+o),responseEnd:Math.round(t+a)}},c=function(e){if(e&&"function"==typeof e.getAllResponseHeaders)return(0,o.default)(e.getAllResponseHeaders())},l=function(e,t,n){var i=arguments[4],o=e.log;if(r.default.exists()){var l=function(n,i){return e.emit(t,n,i)},u=function(e,t){var n=t.levels,i=t.audioTracks,o=t.url,r=t.stats,u=t.networkDetails,d={},p={};n.forEach((function(e,t){d[t]={width:e.width,height:e.height,bitrate:e.bitrate,attrs:e.attrs}})),i.forEach((function(e,t){p[t]={name:e.name,language:e.lang,bitrate:e.bitrate}}));var f=s(r),h=f.bytesLoaded,m=f.requestStart,g=f.responseStart,_=f.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:h,request_start:m,request_response_start:g,request_response_end:_,request_type:"manifest",request_hostname:(0,a.extractHostname)(o),request_response_headers:c(u),request_rendition_lists:{media:d,audio:p,video:{}}})};n.on(i.Events.MANIFEST_LOADED,u);var d=function(e,t){var n=t.details,i=t.level,o=t.networkDetails,r=t.stats,u=s(r),d=u.bytesLoaded,p=u.requestStart,f=u.responseStart,h=u.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:d,request_start:p,request_response_start:f,request_response_end:h,request_current_level:i,request_type:"manifest",request_hostname:(0,a.extractHostname)(n.url),request_response_headers:c(o)})};n.on(i.Events.LEVEL_LOADED,d);var p=function(e,t){var n=t.details,i=t.networkDetails,o=t.stats,r=s(o),u=r.bytesLoaded,d=r.requestStart,p=r.responseStart,f=r.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:u,request_start:d,request_response_start:p,request_response_end:f,request_type:"manifest",request_hostname:(0,a.extractHostname)(n.url),request_response_headers:c(i)})};n.on(i.Events.AUDIO_TRACK_LOADED,p);var f=function(e,t){var i=t.stats,o=t.networkDetails,r=t.frag,u=s(i),d={request_event_type:e,request_bytes_loaded:u.bytesLoaded,request_start:u.requestStart,request_response_start:u.responseStart,request_response_end:u.responseEnd,request_hostname:o?(0,a.extractHostname)(o.responseURL):void 0,request_response_headers:c(o),request_media_duration:r.duration};"main"===r.type?(d.request_type="media",d.request_current_level=r.level,d.request_video_width=(n.levels[r.level]||{}).width,d.request_video_height=(n.levels[r.level]||{}).height):d.request_type=r.type,l("requestcompleted",d)};n.on(i.Events.FRAG_LOADED,f);var h=function(e,t){var n=t.details,o=t.response,r=t.context,s=t.frag;if(n===i.ErrorDetails.MANIFEST_LOAD_ERROR||n===i.ErrorDetails.MANIFEST_LOAD_TIMEOUT||n===i.ErrorDetails.FRAG_LOAD_ERROR||n===i.ErrorDetails.FRAG_LOAD_TIMEOUT||n===i.ErrorDetails.LEVEL_LOAD_ERROR||n===i.ErrorDetails.LEVEL_LOAD_TIMEOUT){var c=s&&s.url||r&&r.url||"";l("requestfailed",{request_error:n,request_url:c,request_hostname:(0,a.extractHostname)(c),request_type:n===i.ErrorDetails.FRAG_LOAD_ERROR||n===i.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:o&&o.code,request_error_text:o&&o.text})}};n.on(i.Events.ERROR,h);var m=function(e,t){var n=t.frag,i=n&&n._url||"";l("requestcanceled",{request_cancel:e,request_url:i,request_type:"media",request_hostname:(0,a.extractHostname)(i)})};n.on(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,m);var g=function(e,t){var i=t.level,r=n.levels[i];if(r&&r.attrs&&r.attrs.BANDWIDTH){var a=r.attrs.BANDWIDTH;a?l("renditionchange",{video_source_bitrate:a,video_source_width:r.width,video_source_height:r.height}):o.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};n.on(i.Events.LEVEL_SWITCHED,g),n._stopMuxMonitor=function(){n.off(i.Events.MANIFEST_LOADED,u),n.off(i.Events.LEVEL_LOADED,d),n.off(i.Events.AUDIO_TRACK_LOADED,p),n.off(i.Events.FRAG_LOADED,f),n.off(i.Events.ERROR,h),n.off(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,m),n.off(i.Events.LEVEL_SWITCHED,g),n.off(i.Events.DESTROYING,n._stopMuxMonitor),delete n._stopMuxMonitor},n.on(i.Events.DESTROYING,n._stopMuxMonitor)}else o.warn("performance timing not supported. Not tracking HLS.js.")},u=function(e){e&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor()};t.monitorHlsJs=l,t.stopMonitoringHlsJs=u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.stopMonitoringDashJS=t.monitorDashJS=void 0;var o=i(n(0)),r=i(n(8)),a=n(5),s=function(e,t){if(!e||"function"!=typeof e.getRequests)return{};var n=e.getRequests({state:"executed"});if(0===n.length)return{};var i=n[n.length-1],o=(0,a.extractHostname)(i.url),s=i.bytesLoaded,c=new Date(i.requestStartDate).getTime(),l=new Date(i.firstByteDate).getTime(),u=new Date(i.requestEndDate).getTime(),d=isNaN(i.duration)?0:i.duration,p="function"==typeof t.getMetricsFor?t.getMetricsFor(i.mediaType).HttpList:t.getDashMetrics().getHttpRequests(i.mediaType),f=void 0;return p.length>0&&(f=(0,r.default)(p[p.length-1]._responseHeaders||"")),{requestStart:c,requestResponseStart:l,requestResponseEnd:u,requestBytesLoaded:s,requestResponseHeaders:f,requestMediaDuration:d,requestHostname:o}},c=function(e,t){var n=t.getQualityFor(e),i=t.getCurrentTrackFor(e).bitrateList;return i?{currentLevel:n,renditionWidth:i[n].width||null,renditionHeight:i[n].height||null,renditionBitrate:i[n].bandwidth}:{}},l=function(e,t,n){var i=e.log;if(n&&n.on){var r=function(n,i){return e.emit(t,n,i)},l=function(e){var t=e.type,n=(e.data||{}).url;r("requestcompleted",{request_event_type:t,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:(0,a.extractHostname)(n)})};n.on("manifestLoaded",l);var u={},d=function(e){var t=e.type,i=e.fragmentModel,o=(e.chunk||{}).mediaInfo||{},a=o.type,c=o.bitrateList,l={};(c=c||[]).forEach((function(e,t){l[t]={},l[t].width=e.width,l[t].height=e.height,l[t].bitrate=e.bandwidth,l[t].attrs={}})),"video"===a?u.video=l:"audio"===a?u.audio=l:u.media=l;var d=s(i,n),p=d.requestStart,f=d.requestResponseStart,h=d.requestResponseEnd,m=d.requestResponseHeaders,g=d.requestMediaDuration,_=d.requestHostname;r("requestcompleted",{request_event_type:t,request_start:p,request_response_start:f,request_response_end:h,request_bytes_loaded:-1,request_type:a+"_init",request_response_headers:m,request_hostname:_,request_media_duration:g,request_rendition_lists:u})};n.on("initFragmentLoaded",d);var p=function(e){var t=e.type,i=e.fragmentModel,o=e.chunk||{},a=o.mediaInfo,l=o.start,u=(a||{}).type,d=s(i,n),p=d.requestStart,f=d.requestResponseStart,h=d.requestResponseEnd,m=d.requestBytesLoaded,g=d.requestResponseHeaders,_=d.requestMediaDuration,v=d.requestHostname,y=c(u,n),E=y.currentLevel,b=y.renditionWidth,S=y.renditionHeight,A=y.renditionBitrate;r("requestcompleted",{request_event_type:t,request_start:p,request_response_start:f,request_response_end:h,request_bytes_loaded:m,request_type:u,request_response_headers:g,request_hostname:v,request_media_start_time:l,request_media_duration:_,request_current_level:E,request_labeled_bitrate:A,request_video_width:b,request_video_height:S})};n.on("mediaFragmentLoaded",p);var f={video:void 0,audio:void 0,totalBitrate:void 0},h=function(){if(f.video&&"number"==typeof f.video.bitrate){if(!f.video.width||!f.video.height)return void i.warn("have bitrate info for video but missing width/height");var e=f.video.bitrate;return f.audio&&"number"==typeof f.audio.bitrate&&(e+=f.audio.bitrate),e!==f.totalBitrate?(f.totalBitrate=e,{video_source_bitrate:e,video_source_height:f.video.height,video_source_width:f.video.width}):void 0}},m=function(e,t,o){if("number"==typeof e.newQuality){var a=e.mediaType;if("audio"===a||"video"===a){var s=n.getBitrateInfoListFor(a).find((function(t){return t.qualityIndex===e.newQuality}));if(!s||"number"!=typeof s.bitrate)return void i.warn("missing bitrate info for "+a);f[a]=s;var c=h();c&&r("renditionchange",c)}}else i.warn("missing evt.newQuality in qualityChangeRendered event",e)};n.on("qualityChangeRendered",m);var g=function(e){var t=e.error,n=e.event,i=(n=n||{}).request||{},s=o.default.event&&o.default.event.currentTarget||{};r("requestfailed",{request_error:t+"_"+n.id+"_"+i.type,request_url:n.url,request_hostname:(0,a.extractHostname)(n.url),request_type:i.mediaType,request_error_code:s.status,request_error_type:s.statusText})};n.on("error",g),n._stopMuxMonitor=function(){n.off("manifestLoaded",l),n.off("initFragmentLoaded",d),n.off("mediaFragmentLoaded",p),n.off("qualityChangeRendered",m),n.off("error",g),delete n._stopMuxMonitor}}else i.warn("Invalid dash.js player reference. Monitoring blocked.")},u=function(e){e&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor()};t.monitorDashJS=l,t.stopMonitoringDashJS=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){},o=0;i.prototype.on=function(e,t,n){return t._eventEmitterGuid=t._eventEmitterGuid||++o,this._listeners=this._listeners||{},this._listeners[e]=this._listeners[e]||[],n&&(t=t.bind(n)),this._listeners[e].push(t),t},i.prototype.off=function(e,t){var n=this._listeners&&this._listeners[e];n&&n.forEach((function(e,i){e._eventEmitterGuid===t._eventEmitterGuid&&n.splice(i,1)}))},i.prototype.one=function(e,t,n){var i=this;t._eventEmitterGuid=t._eventEmitterGuid||++o;var r=function o(){i.off(e,o),t.apply(n||this,arguments)};r._eventEmitterGuid=t._eventEmitterGuid,this.on(e,r)},i.prototype.emit=function(e,t){var n=this;if(this._listeners){t=t||{};var i=this._listeners["before*"]||[],o=this._listeners[e]||[],r=this._listeners["after"+e]||[],a=function(t,i){(t=t.slice()).forEach((function(t){t.call(n,{type:e},i)}))};a(i,t),a(o,t),a(r,t)}},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=function(){this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,this.on("playing",(function(){this._playheadShouldBeProgressing=!0})),this.on("play",this._startPlaybackHeartbeatInterval),this.on("playing",this._startPlaybackHeartbeatInterval),this.on("adbreakstart",this._startPlaybackHeartbeatInterval),this.on("adplay",this._startPlaybackHeartbeatInterval),this.on("adplaying",this._startPlaybackHeartbeatInterval),this.on("seeking",this._startPlaybackHeartbeatInterval),this.on("devicewake",this._startPlaybackHeartbeatInterval),this.on("viewstart",this._startPlaybackHeartbeatInterval),this.on("pause",this._stopPlaybackHeartbeatInterval),this.on("ended",this._stopPlaybackHeartbeatInterval),this.on("viewend",this._stopPlaybackHeartbeatInterval),this.on("error",this._stopPlaybackHeartbeatInterval),this.on("aderror",this._stopPlaybackHeartbeatInterval),this.on("adpause",this._stopPlaybackHeartbeatInterval),this.on("adended",this._stopPlaybackHeartbeatInterval),this.on("adbreakend",this._stopPlaybackHeartbeatInterval),this.on("seeked",(function(){this.data.player_is_paused?this._stopPlaybackHeartbeatInterval():this._startPlaybackHeartbeatInterval()})),this.on("timeupdate",(function(){null!==this._playbackHeartbeatInterval&&this.emit("playbackheartbeat")})),this.on("devicesleep",(function(e,t){null!==this._playbackHeartbeatInterval&&(i.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend",{viewer_time:t.viewer_time}),this._playbackHeartbeatInterval=null)}))};o.prototype._startPlaybackHeartbeatInterval=function(){var e=this;null===this._playbackHeartbeatInterval&&(this.emit("playbackheartbeat"),this._playbackHeartbeatInterval=i.default.setInterval((function(){e.emit("playbackheartbeat")}),this.playbackHeartbeatTime))},o.prototype._stopPlaybackHeartbeatInterval=function(){this._playheadShouldBeProgressing=!1,null!==this._playbackHeartbeatInterval&&(i.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)},t.default=o},function(e,t,n){"use strict";function i(){var e=this;this.on("viewinit",(function(){e.viewErrored=!1})),this.on("error",(function(){try{var t=e.errorTranslator({player_error_code:e.data.player_error_code,player_error_message:e.data.player_error_message});t?(e.data.player_error_code=t.player_error_code,e.data.player_error_message=t.player_error_message,e.viewErrored=!0):(delete e.data.player_error_code,delete e.data.player_error_message)}catch(t){e.mux.log.warn("Exception in error translator callback.",t),e.viewErrored=!0}}))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),o=function(){this._watchTimeTrackerLastCheckedTime=null,this.on("playbackheartbeat",this._updateWatchTime),this.on("playbackheartbeatend",this._clearWatchTimeState)};o.prototype._updateWatchTime=function(e,t){var n=t.viewer_time;null===this._watchTimeTrackerLastCheckedTime&&(this._watchTimeTrackerLastCheckedTime=n),(0,i.default)(this.data,"view_watch_time",n-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=n},o.prototype._clearWatchTimeState=function(e,t){this._updateWatchTime(e,t),this._watchTimeTrackerLastCheckedTime=null},t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),o=function(){this._playbackTimeTrackerLastPlayheadPosition=-1,this.on("playbackheartbeat",this._updatePlaybackTime),this.on("playbackheartbeatend",this._clearPlaybackTimeState),this.on("seeking",this._clearPlaybackTimeState)};o.prototype._updatePlaybackTime=function(){var e=this.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&e>this._playbackTimeTrackerLastPlayheadPosition){var t=e-this._playbackTimeTrackerLastPlayheadPosition;t<=1e3&&(0,i.default)(this.data,"view_content_playback_time",t)}this._playbackTimeTrackerLastPlayheadPosition=e},o.prototype._clearPlaybackTimeState=function(){this._updatePlaybackTime(),this._playbackTimeTrackerLastPlayheadPosition=-1},t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){this.on("playbackheartbeat",this._updatePlayheadTime),this.on("playbackheartbeatend",this._updatePlayheadTime),this.on("timeupdate",this._updatePlayheadTime),this.on("destroy",(function(){this.off("timeupdate",this._updatePlayheadTime)}))};i.prototype._updateMaxPlayheadPosition=function(){this.data.view_max_playhead_position=void 0===this.data.view_max_playhead_position?this.data.player_playhead_time:Math.max(this.data.view_max_playhead_position,this.data.player_playhead_time)},i.prototype._updatePlayheadTime=function(e,t){if(t.player_playhead_time)this.data.player_playhead_time=t.player_playhead_time,this._updateMaxPlayheadPosition();else if(this.getPlayheadTime){var n=this.getPlayheadTime();void 0!==n&&(this.data.player_playhead_time=n,this._updateMaxPlayheadPosition())}},t.default=i},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),r=i(n(2)),a=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,this.on("playbackheartbeat",this._checkIfRebuffering),this.on("playbackheartbeatend",this._cleanupRebufferTracker),this.on("seeking",(function(){this._cleanupRebufferTracker(null,{viewer_time:o.default.now()})}))};a.prototype._checkIfRebuffering=function(e,t){if(!this.disableRebufferTracking){if(this.isSeeking||this.isAdBreak||!this._playheadShouldBeProgressing)return void this._cleanupRebufferTracker(e,t);if(null===this._lastCheckedTime)return this._prepareRebufferTrackerState(t.viewer_time),void this._updateRebufferMetrics();if(this._lastPlayheadTime!==this.data.player_playhead_time)return void this._cleanupRebufferTracker(e,t,!0);var n=t.viewer_time-this._lastPlayheadTimeUpdatedTime;n>=this.sustainedRebufferThreshold&&(this._rebuffering?this._updateRebufferMetrics(t.viewer_time-this._lastCheckedTime):(this._rebuffering=!0,(0,r.default)(this.data,"view_rebuffer_count",1),this._updateRebufferMetrics(n),this.emit("rebufferstart"))),this._lastCheckedTime=t.viewer_time}},a.prototype._clearRebufferTrackerState=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null},a.prototype._prepareRebufferTrackerState=function(e){this._lastCheckedTime=e,this._lastPlayheadTime=this.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=e},a.prototype._cleanupRebufferTracker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.disableRebufferTracking){if(this._rebuffering)this._rebuffering=!1,this._updateRebufferMetrics(t.viewer_time-this._lastCheckedTime),this.emit("rebufferend",{viewer_time:t.viewer_time});else{if(null===this._lastCheckedTime)return void this._updateRebufferMetrics();var i=this.data.player_playhead_time-this._lastPlayheadTime,o=t.viewer_time-this._lastPlayheadTimeUpdatedTime;i>0&&o-i>this.minimumRebufferDuration?((0,r.default)(this.data,"view_rebuffer_count",1),this._updateRebufferMetrics(o-i),this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+o-i})):this._updateRebufferMetrics()}n?this._prepareRebufferTrackerState(t.viewer_time):this._clearRebufferTrackerState()}},a.prototype._updateRebufferMetrics=function(e){e>0&&(0,r.default)(this.data,"view_rebuffer_duration",e),this.data.view_watch_time>=0&&this.data.view_rebuffer_count>0&&(this.data.view_rebuffer_frequency=this.data.view_rebuffer_count/this.data.view_watch_time,this.data.view_rebuffer_percentage=this.data.view_rebuffer_duration/this.data.view_watch_time)},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(3)),o=function(){this.on("viewinit",(function(){var e=this.data,t=e.view_id;if(!e.view_program_changed){var n=function(e,n){var o=n.viewer_time;"playing"===e.type&&void 0===this.data.view_time_to_first_frame?this.calculateTimeToFirstFrame(o||i.default.now(),t):"adplaying"!==e.type||void 0!==this.data.view_time_to_first_frame&&!this.inPrerollPosition()||this.calculateTimeToFirstFrame(o||i.default.now(),t)};this.one("playing",n),this.one("adplaying",n),this.one("viewend",(function(){this.off("playing",n),this.off("adplaying",n)}))}}))};o.prototype.calculateTimeToFirstFrame=function(e,t){t===this.data.view_id&&(this._updateWatchTime(null,{viewer_time:e}),this.data.view_time_to_first_frame=this.data.view_watch_time,(this.data.player_autoplay_on||this.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.data.view_aggregate_startup_time=this.data.view_start+this.data.view_watch_time-this.NAVIGATION_START))},t.default=o},function(e,t,n){"use strict";function i(){var e=this;this.on("viewinit",(function(){this._lastPlayheadPosition=-1}));var t=["playing","hb"];["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach((function(t){e.on(t,(function(){if(this._lastPlayheadPosition>=0&&this.data.player_playhead_time>=0&&this._lastPlayerWidth>=0&&this._lastSourceWidth>0&&this._lastPlayerHeight>=0&&this._lastSourceHeight>0){var e=this.data.player_playhead_time-this._lastPlayheadPosition;if(e<0)return void(this._lastPlayheadPosition=-1);var t=Math.min(this._lastPlayerWidth/this._lastSourceWidth,this._lastPlayerHeight/this._lastSourceHeight),n=Math.max(0,t-1),i=Math.max(0,1-t);this.data.view_max_upscale_percentage=Math.max(this.data.view_max_upscale_percentage||0,n),this.data.view_max_downscale_percentage=Math.max(this.data.view_max_downscale_percentage||0,i),(0,o.default)(this.data,"view_total_content_playback_time",e),(0,o.default)(this.data,"view_total_upscaling",n*e),(0,o.default)(this.data,"view_total_downscaling",i*e)}this._lastPlayheadPosition=-1}))})),t.forEach((function(t){e.on(t,(function(){this._lastPlayheadPosition=this.data.player_playhead_time,this._lastPlayerWidth=this.data.player_width,this._lastPlayerHeight=this.data.player_height,this._lastSourceWidth=this.data.video_source_width,this._lastSourceHeight=this.data.video_source_height}))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(2))},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){this.isSeeking=!1,this.on("seeking",(function(e,t){(0,s.default)(this.data,t),this._lastSeekingTime=r.default.now(),!1===this.isSeeking&&(this.isSeeking=!0,this.send("seeking"))})),this.on("seeked",(function(){this.isSeeking=!1;var e=this._lastSeekingTime||r.default.now(),t=r.default.now()-e;(0,a.default)(this.data,"view_seek_count",1),(0,a.default)(this.data,"view_seek_duration",t);var n=this.data.view_max_seek_time||0;this.data.view_max_seek_time=Math.max(n,t)})),this.on("viewend",(function(){this.isSeeking=!1}))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=i(n(3)),a=i(n(2)),s=i(n(1))},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var n=[],i=!0,o=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){o=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=i(n(2)),a=n(5),s=i(n(1)),c=function(e,t){e.push(t),e.sort((function(e,t){return e.viewer_time-t.viewer_time}))},l=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],u=function(){var e=this;this.on("viewinit",(function(){this.isAdBreak=!1,this._currentAdRequestNumber=0,this._currentAdResponseNumber=0,this._adRequests=[],this._adResponses=[],this._adHasPlayed=!1,this._wouldBeNewAdPlay=!0,this._prerollPlayTime=void 0})),l.forEach((function(t){return e.on(t,e._updateAdData)}));var t=function(){e.isAdBreak=!1};this.on("adbreakstart",(function(){this.isAdBreak=!0})),this.on("play",t),this.on("playing",t),this.on("viewend",t),this.on("adrequest",(function(e,t){t=(0,s.default)({ad_request_id:"generatedAdRequestId"+this._currentAdRequestNumber++},t),c(this._adRequests,t),(0,r.default)(this.data,"view_ad_request_count"),this.inPrerollPosition()&&(this.data.view_preroll_requested=!0,this._adHasPlayed||(0,r.default)(this.data,"view_preroll_request_count"))})),this.on("adresponse",(function(e,t){t=(0,s.default)({ad_request_id:"generatedAdRequestId"+this._currentAdResponseNumber++},t),c(this._adResponses,t);var n=this.findAdRequest(t.ad_request_id);n&&(0,r.default)(this.data,"view_ad_request_time",Math.max(0,t.viewer_time-n.viewer_time))})),this.on("adplay",(function(e,t){this._adHasPlayed=!0,this._wouldBeNewAdPlay&&(this._wouldBeNewAdPlay=!1,(0,r.default)(this.data,"view_ad_played_count")),this.inPrerollPosition()&&!this.data.view_preroll_played&&(this.data.view_preroll_played=!0,this._adRequests.length>0&&(this.data.view_preroll_request_time=Math.max(0,t.viewer_time-this._adRequests[0].viewer_time)),this.data.view_start&&(this.data.view_startup_preroll_request_time=Math.max(0,t.viewer_time-this.data.view_start)),this._prerollPlayTime=t.viewer_time)})),this.on("adplaying",(function(e,t){this.inPrerollPosition()&&void 0===this.data.view_preroll_load_time&&void 0!==this._prerollPlayTime&&(this.data.view_preroll_load_time=t.viewer_time-this._prerollPlayTime,this.data.view_startup_preroll_load_time=t.viewer_time-this._prerollPlayTime)})),this.on("adended",(function(){this._wouldBeNewAdPlay=!0})),this.on("aderror",(function(){this._wouldBeNewAdPlay=!0}))};u.prototype.inPrerollPosition=function(){return void 0===this.data.view_content_playback_time||this.data.view_content_playback_time<=1e3},u.prototype.findAdRequest=function(e){for(var t=0;t3e4&&(this.emit("devicesleep",{viewer_time:n}),(0,r.default)(this.data,{viewer_time:n}),this.send("devicesleep"),this.emit("devicewake",{viewer_time:t}),(0,r.default)(this.data,{viewer_time:t}),this.send("devicewake"))}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(n(0)),a=n(43),s=i(n(4)),c=i(n(56)),l=i(n(13)),u=i(n(57)),d=i(n(17)),p=i(n(58)),f=i(n(1)),h=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],m=["viewstart","error","ended","viewend"],g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.mux=e,this.envKey=t,this.eventQueue=new p.default((0,c.default)(t,n.beaconDomain)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=n.sampleRate,this.disableCookies=n.disableCookies,this.respectDoNotTrack=n.respectDoNotTrack;var i=n.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:i.name,viewer_application_version:i.version,viewer_application_engine:i.layout,viewer_device_name:i.product,viewer_device_category:"",viewer_device_manufacturer:i.manufacturer,viewer_os_family:i.os&&i.os.family,viewer_os_architecture:i.os&&i.os.architecture,viewer_os_version:i.os&&i.os.version};var o=(0,u.default)();o&&(this.pageLevelData=(0,f.default)(this.pageLevelData,{viewer_connection_type:o})),void 0!==r.default&&r.default.location&&r.default.location.href&&(this.pageLevelData.page_url=r.default.location.href),this.viewerData=this.disableCookies?{}:(0,a.getAndUpdateViewerData)()};g.prototype.send=function(e,t){if(e){if(this.respectDoNotTrack&&(0,l.default)())return s.default.info("Not sending `"+e+"` because Do Not Track is enabled");if(!t||"object"!==(void 0===t?"undefined":o(t)))return s.default.error("A data object was expected in send() but was not provided");var n=this.disableCookies?{}:(0,a.getAndUpdateSessionData)(),i={};(0,f.default)(i,this.pageLevelData),(0,f.default)(i,t),(0,f.default)(i,n),(0,f.default)(i,this.viewerData),i.event=e,i.env_key=this.envKey,i.user_id&&(i.viewer_user_id=i.user_id,delete i.user_id);var r=i.mux_sample_number>=this.sampleRate,c=this._deduplicateBeaconData(e,i),u=(0,d.default)(c);if(this.lastEventTime=this.mux.utils.now(),r)return s.default.info("Not sending event due to sample rate restriction",e,i,u);if(!this.envKey)return s.default.info("Not sending event due to missing environment key",e,i,u);if(!this.rateLimited)if(s.default.info("Sending event",e,i,u),this.rateLimited=!this.eventQueue.queueEvent(e,u),this.mux.WINDOW_UNLOADING&&"viewend"===e)this.eventQueue.destroy(!0);else if(m.indexOf(e)>=0&&this.eventQueue.flushEvents(),this.rateLimited)return i.event="eventrateexceeded",u=(0,d.default)(i),this.eventQueue.queueEvent(i.event,u),s.default.error("Beaconing disabled due to rate limit.")}},g.prototype.destroy=function(){this.eventQueue.destroy(!1)};var _=function(e,t,n,i){return!(!e||0!==t.indexOf("request_")||"request_response_headers"!==t&&"object"===(void 0===n?"undefined":o(n))&&"object"===(void 0===i?"undefined":o(i))&&Object.keys(n||{}).length===Object.keys(i||{}).length)},v=function(e,t){return"renditionchange"===e&&0===t.indexOf("video_source_")};g.prototype._deduplicateBeaconData=function(e,t){var n=this,i={},o=t.view_id;if(!o||"viewstart"===e||"viewend"===e||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)i=(0,f.default)({},t),o&&(this.previousBeaconData=i),o&&"viewend"===e&&(this.previousBeaconData=null);else{var r=0===e.indexOf("request");Object.keys(t).forEach((function(o){var a=t[o];(a!==n.previousBeaconData[o]||h.indexOf(o)>-1||_(r,o,a,n.previousBeaconData[o])||v(e,o))&&(i[o]=a,n.previousBeaconData[o]=a)}))}return i},t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getAndUpdateSessionData=t.getAndUpdateViewerData=void 0;var o=i(n(15)),r=i(n(55)),a=n(7),s=i(n(3)),c=function(){var e=void 0;try{e=o.default.parse(r.default.get("muxData")||"")}catch(t){e={}}return e},l=function(e){try{r.default.set("muxData",o.default.stringify(e),{expires:7300})}catch(e){}},u=function(){var e=c();return e.mux_viewer_id=e.mux_viewer_id||(0,a.generateUUID)(),e.msn=e.msn||Math.random(),l(e),{mux_viewer_id:e.mux_viewer_id,mux_sample_number:e.msn}},d=function(){var e=c(),t=s.default.now();return e.session_start&&(e.sst=e.session_start,delete e.session_start),e.session_id&&(e.sid=e.session_id,delete e.session_id),e.session_expires&&(e.sex=e.session_expires,delete e.session_expires),(!e.sex||e.sex0?S.join(",")||null:void 0}];else if(c(d))A=d;else{var O=Object.keys(S);A=p?O.sort(p):O}for(var I=0;I0?v+_:""}},function(e,t,n){"use strict";var i=n(9),o=n(50),r=n(52),a=i("%TypeError%"),s=i("%WeakMap%",!0),c=i("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),m=function(e,t){for(var n,i=e;null!==(n=i.next);i=n)if(n.key===t)return i.next=n.next,n.next=e.next,e.next=n,n},g=function(e,t){var n=m(e,t);return n&&n.value},_=function(e,t,n){var i=m(e,t);i?i.value=n:e.next={key:t,next:e.next,value:n}},v=function(e,t){return!!m(e,t)};e.exports=function(){var e,t,n,i={assert:function(e){if(!i.has(e))throw new a("Side channel does not contain "+r(e))},get:function(i){if(s&&i&&("object"==typeof i||"function"==typeof i)){if(e)return l(e,i)}else if(c){if(t)return p(t,i)}else if(n)return g(n,i)},has:function(i){if(s&&i&&("object"==typeof i||"function"==typeof i)){if(e)return d(e,i)}else if(c){if(t)return h(t,i)}else if(n)return v(n,i);return!1},set:function(i,o){s&&i&&("object"==typeof i||"function"==typeof i)?(e||(e=new s),u(e,i,o)):c?(t||(t=new c),f(t,i,o)):(n||(n={key:{},next:null}),_(n,i,o))}};return i}},function(e,t,n){"use strict";var i="undefined"!=typeof Symbol&&Symbol,o=n(47);e.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&o()}},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";var i=Array.prototype.slice,o=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==o.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=i.call(arguments,1),a=function(){if(this instanceof n){var o=t.apply(this,r.concat(i.call(arguments)));return Object(o)===o?o:this}return t.apply(e,r.concat(i.call(arguments)))},s=Math.max(0,t.length-r.length),c=[],l=0;l-1?o(n):n}},function(e,t,n){"use strict";var i=n(10),o=n(9),r=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||i.call(a,r),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(i,a,arguments);return c&&l&&c(t,"length").configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return s(i,r,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},function(e,t,n){function i(e,t,n){var i="double"===(n.quoteStyle||t)?'"':"'";return i+e+i}function o(e){return String(e).replace(/"/g,""")}function r(e){return!("[object Array]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function a(e){return!("[object Date]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function s(e){return!("[object RegExp]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function c(e){return!("[object Error]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function l(e){return!("[object String]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function u(e){return!("[object Number]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function d(e){return!("[object Boolean]"!==m(e)||ne&&"object"==typeof e&&ne in e)}function p(e){if(Z)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!X)return!1;try{return X.call(e),!0}catch(e){}return!1}function f(e){if(!e||"object"!=typeof e||!J)return!1;try{return J.call(e),!0}catch(e){}return!1}function h(e,t){return ie.call(e,t)}function m(e){return Y.call(e)}function g(e){if(e.name)return e.name;var t=z.call(j.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function _(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return T(e.slice(0,t.maxStringLength),t)+o}return i(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,O),"single",t)}function O(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function I(e){return"Object("+e+")"}function C(e){return e+" { ? }"}function N(e,t,n,i){return e+" ("+t+") {"+(i?P(n,i):n.join(", "))+"}"}function L(e){for(var t=0;t=0)return!1;return!0}function R(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}function P(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function k(e,t){var n=r(e),i=[];if(n){i.length=e.length;for(var o=0;o0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return T(t,U);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var H=void 0===U.depth?5:U.depth;if(void 0===O&&(O=0),O>=H&&H>0&&"object"==typeof t)return r(t)?"[Array]":"[Object]";var G=R(U,O);if(void 0===D)D=[];else if(_(D,t)>=0)return"[Circular]";if("function"==typeof t){var K=g(t),Y=k(t,w);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(Y.length>0?" { "+Y.join(", ")+" }":"")}if(p(t)){var j=Z?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(t);return"object"!=typeof t||Z?j:I(j)}if(A(t)){for(var z="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],Q=0;Q"}if(r(t)){if(0===t.length)return"[]";var ee=k(t,w);return G&&!L(ee)?"["+P(ee,G)+"]":"[ "+ee.join(", ")+" ]"}if(c(t)){var ie=k(t,w);return 0===ie.length?"["+String(t)+"]":"{ ["+String(t)+"] "+ie.join(", ")+" }"}if("object"==typeof t&&V){if(te&&"function"==typeof t[te])return t[te]();if("symbol"!==V&&"function"==typeof t.inspect)return t.inspect()}if(v(t)){var oe=[];return x.call(t,(function(e,n){oe.push(w(n,t,!0)+" => "+w(e,t))})),N("Map",M.call(t),oe,G)}if(b(t)){var re=[];return B.call(t,(function(e){re.push(w(e,t))})),N("Set",F.call(t),re,G)}if(y(t))return C("WeakMap");if(S(t))return C("WeakSet");if(E(t))return C("WeakRef");if(u(t))return I(w(Number(t)));if(f(t))return I(w(J.call(t)));if(d(t))return I(W.call(t));if(l(t))return I(w(String(t)));if(!a(t)&&!s(t)){var ae=k(t,w),se=$?$(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",le=!se&&ne&&Object(t)===t&&ne in t?m(t).slice(8,-1):ce?"Object":"",ue=(se||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(le||ce?"["+[].concat(le||[],ce||[]).join(": ")+"] ":"");return 0===ae.length?ue+"{}":G?ue+"{"+P(ae,G)+"}":ue+"{ "+ae.join(", ")+" }"}return String(t)};var ie=Object.prototype.hasOwnProperty||function(e){return e in this}},function(e,t){},function(e,t,n){"use strict";var i=n(16),o=Object.prototype.hasOwnProperty,r=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:i.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,d),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=r(g)?[g]:g),o.call(l,m)?l[m]=i.combine(l[m],g):l[m]=g}return l},u=function(e,t,n,i){for(var o=i?t:c(t,n),r=e.length-1;r>=0;--r){var a,s=e[r];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:a[l]=o:a={0:o}}o=a}return o},d=function(e,t,n,i){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&a.exec(r),l=c?r.slice(0,c.index):r,d=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var p=0;n.depth>0&&null!==(c=s.exec(r))&&p1){if("number"==typeof(r=t({path:"/"},i.defaults,r)).expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*r.expires),r.expires=s}try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(e){}return o=n.write?n.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}e||(a={});for(var c=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,u=0;u0&&void 0!==arguments[0]&&arguments[0];this.destroyed=!0,e?this._clearBeaconQueue():this.flushEvents(),o.default.clearTimeout(this._sendTimeout)},d.prototype._clearBeaconQueue=function(){var e=o.default.navigator,t=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,n=this._eventQueue.slice(t);if(t>0&&(0,s.default)(n[n.length-1],(0,c.default)({mux_view_message:"event queue truncated"})),e.sendBeacon)e.sendBeacon(this._beaconUrl,JSON.stringify({events:n}));else if(o.default.XMLHttpRequest){var i=new o.default.XMLHttpRequest;i.open("POST",this._beaconUrl),i.setRequestHeader("Content-Type","application/json"),i.send(JSON.stringify({events:n}))}else a.default.send(this._beaconUrl,n[n.length-1])},d.prototype._sendBeaconQueue=function(){var e=this;if(o.default.XMLHttpRequest&&!this._postInFlight){var t=new o.default.XMLHttpRequest,n=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0,t.onreadystatechange=function(){4===t.readyState&&(200!==t.status?(e._eventQueue=n.concat(e._eventQueue),e._failureCount+=1,r.default.info("Error sending beacon: "+t.status),r.default.info(t.responseText)):e._failureCount=0,e._postInFlight=!1)},t.open("POST",this._beaconUrl),t.setRequestHeader("Content-Type","application/json"),t.send(JSON.stringify({events:n}))}},d.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var e=Math.pow(2,this._failureCount-1);return(1+(e*=Math.random()))*this._options.baseTimeBetweenBeacons},d.prototype._startBeaconSending=function(){var e=this;o.default.clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=o.default.setTimeout((function(){e._eventQueue.length&&e._sendBeaconQueue(),e._startBeaconSending()}),this._getNextBeaconTime()))},t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(15)),r=i(n(0)),a={send:function(e,t){function n(){i.src=s+(a?"&rc="+a:"")}var i=new Image,a=0,s=e+"?"+o.default.stringify(t);return i.addEventListener("error",(function(){a>3||r.default.setTimeout((function(){a++,n()}),5e3*a)})),n(),i}};t.default=a},function(e,t,n){"use strict";function i(){function e(e,t){var n=t.request_start,c=t.request_response_start,l=t.request_response_end,u=t.request_bytes_loaded;a++;var d=void 0,p=void 0;if(c?(d=c-n,p=l-c):p=l-n,p>0&&u>0){var f=u/p*8e3;s++,o+=u,r+=p,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,f),this.data.view_average_request_throughput=o/r*8e3,this.data.view_request_count=a,d>0&&(i+=d,this.data.view_max_request_latency=Math.max(this.data.view_max_request_latency||0,d),this.data.view_average_request_latency=i/s)}}function t(e,t){a++,c++,this.data.view_request_count=a,this.data.view_request_failed_count=c}function n(e,t){a++,l++,this.data.view_request_count=a,this.data.view_request_canceled_count=l}var i=0,o=0,r=0,a=0,s=0,c=0,l=0;this.on("requestcompleted",e),this.on("requestfailed",t),this.on("requestcanceled",n)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){"use strict";function i(e,t,n){var i=(0,s.findMediaElement)(t),u=r(i,3),d=u[0],p=u[1],f=u[2],h=e.log,m=e.utils.getComputedStyle,g=e.utils.secondsToMs,_={automaticErrorTracking:!0};if(!d)return h.error("No element was found with the `"+p+"` query selector.");if("video"!==f&&"audio"!==f)return h.error("The element of `"+p+"` was not a media element.");(n=(0,a.default)(_,n)).data=(0,a.default)({player_software:"HTML5 Video Element",player_software_version:"No Versions",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:"4.2.3"},n.data),n.getPlayheadTime=function(){return g(d.currentTime)},n.getStateData=function(){var e=this.hlsjs&&this.hlsjs.url,t=this.dashjs&&o("function"===this.dashjs.getSource)&&this.dashjs.getSource();return{player_is_paused:d.paused,player_playhead_time:g(d.currentTime),player_width:parseInt(m(d,"width")),player_height:parseInt(m(d,"height")),player_autoplay_on:d.autoplay,player_preload_on:d.preload,video_poster_url:d.poster,video_source_url:e||t||d.currentSrc,video_source_duration:g(d.duration),video_source_height:d.videoHeight,video_source_width:d.videoWidth}},d.mux=d.mux||{},d.mux.deleted=!1,d.mux.emit=function(t,n){e.emit(p,t,n)};var v=function(){h.error("The monitor for this video element has already been destroyed.")};d.mux.destroy=function(){Object.keys(d.mux.listeners).forEach((function(e){d.removeEventListener(e,d.mux.listeners[e],!1)})),delete d.mux.listeners,d.mux.destroy=v,d.mux.swapElement=v,d.mux.emit=v,d.mux.addHLSJS=v,d.mux.addDashJS=v,d.mux.removeHLSJS=v,d.mux.removeDashJS=v,d.mux.deleted=!0,e.emit(p,"destroy")},d.mux.swapElement=function(t){var n=(0,s.findMediaElement)(t),i=r(n,3),o=i[0],c=i[1],l=i[2];return o?"video"!==l&&"audio"!==l?e.log.error("The element of `"+c+"` was not a media element."):(o.muxId=d.muxId,delete d.muxId,o.mux=o.mux||{},o.mux.listeners=(0,a.default)({},d.mux.listeners),delete d.mux.listeners,Object.keys(o.mux.listeners).forEach((function(e){d.removeEventListener(e,o.mux.listeners[e],!1),o.addEventListener(e,o.mux.listeners[e],!1)})),o.mux.swapElement=d.mux.swapElement,o.mux.destroy=d.mux.destroy,delete d.mux,void(d=o)):e.log.error("No element was found with the `"+c+"` query selector.")},d.mux.addHLSJS=function(t){e.addHLSJS(p,t)},d.mux.addDashJS=function(t){e.addDashJS(p,t)},d.mux.removeHLSJS=function(){e.removeHLSJS(p)},d.mux.removeDashJS=function(){e.removeDashJS(p)},e.init(p,n),e.emit(p,"playerready"),d.paused||(e.emit(p,"play"),d.readyState>2&&e.emit(p,"playing")),d.mux.listeners={},c.forEach((function(t){("error"!==t||n.automaticErrorTracking)&&(d.mux.listeners[t]=function(){var n={};if("error"===t){if(!d.error)return;n.player_error_code=d.error.code,n.player_error_message=l[d.error.code]||d.error.message}e.emit(p,t,n)},d.addEventListener(t,d.mux.listeners[t],!1))}))}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){var n=[],i=!0,o=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){o=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=i;var a=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),s=n(12),c=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],l={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(63)),r=i(n(2)),a=i(n(64)),s=i(n(65)),c=i(n(1)),l=i(n(8)),u=n(5),d=i(n(3)),p={};p.safeCall=o.default,p.safeIncrement=r.default,p.getComputedStyle=a.default,p.secondsToMs=s.default,p.assign=c.default,p.headersStringToObject=l.default,p.extractHostnameAndDomain=u.extractHostnameAndDomain,p.extractHostname=u.extractHostname,p.now=d.default.now,t.default=p},function(e,t,n){"use strict";function i(e,t,n,i){var r=i;if(e&&"function"==typeof e[t])try{r=e[t].apply(e,n)}catch(e){o.default.info("safeCall error",e)}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4))},function(e,t,n){"use strict";function i(e,t){if(e&&t&&o.default&&"function"==typeof o.default.getComputedStyle){var n=void 0;return r&&r.has(e)&&(n=r.get(e)),n||(n=o.default.getComputedStyle(e,null),r&&r.set(e,n)),n.getPropertyValue(t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),r=void 0;o.default&&o.default.WeakMap&&(r=new WeakMap)},function(e,t,n){"use strict";function i(e){return Math.floor(1e3*e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i}])},48837:(e,t,n)=>{"use strict";n.d(t,{ArtistNpv:()=>It});var i=n(50959);function o(e){return i.createElement("div",{className:`npv-video-overlay npv-video-overlay--${e.mediaType} ${e.isActive&&"npv-video-overlay--active"} ${e.trackMetadataVisible&&"npv-video-overlay--visible"}`},i.createElement("div",{className:`npv-video-overlay-top ${e.contextMetadataVisible&&"npv-video-overlay-top--active"}`}))}const r=i.createContext((()=>0)),a=i.createContext(0);function s(){const e=(0,i.useContext)(r);return(0,i.useMemo)(e,[e])}function c(){return(0,i.useContext)(a)}function l(e=0,t){const n=36e5,i=Math.floor(e/1e3),o=Math.floor(i/60),r=u(o%60),a=u(i%60);if(void 0===t?e>=n:t>=n){return`${u(Math.floor(o/60))}:${r}:${a}`}return`${r}:${a}`}function u(e){return e<10?`0${e}`:`${e}`}var d=n(81558);const p=({visible:e,children:t,disableAnimationsAndTransitions:n=!1,classNames:o="fade-in-and-out-transition",timeout:r=500,onEnter:a,onEntered:s,onExit:c,onExited:l})=>t?n?e?i.createElement(i.Fragment,null,t):null:i.createElement(d.Z,{in:e,appear:!0,mountOnEnter:!0,unmountOnExit:!0,classNames:o,timeout:r,onEnter:a,onEntered:s,onExit:c,onExited:l},t):null;function f(e){const t={animation:function(e,t=1){const n=s(),[o,r]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{const e=setTimeout((()=>r(!1)),100);return r(!0),()=>clearTimeout(e)}),[n,e]),function(e,i){return void 0===e?"":`${"spotifyinternal-artistnpv-"+(o?"progress-reset":"progress")} ${e/t}ms linear -${n}ms ${i?"paused":"running"}`}}(e.duration,e.playbackSpeed)(e.duration,e.isPaused)};return i.createElement(p,{visible:e.progressBarVisible,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,classNames:`npv-progress-bar-transition--${e.mediaType}`},i.createElement("div",{className:"npv-progress-bar"},i.createElement("div",{className:"npv-progress-bar__bar"},i.createElement("div",{className:"npv-progress-bar__rail"}),i.createElement("div",{className:"npv-progress-bar__mark",style:t})),i.createElement("div",{className:"npv-progress-bar__timestamp"},i.createElement("time",{className:"npv-progress-bar__time npv-progress-bar__position"},i.createElement(h,{duration:e.duration})),i.createElement("time",{className:"npv-progress-bar__time npv-progress-bar__duration"},l(e.duration)))))}function h({duration:e}){const t=c();return i.createElement(i.Fragment,null,l(t,e))}const m=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z"}),i.createElement("path",{d:"M7.25 9V4h1.5v5h-1.5zm0 3.026v-1.5h1.5v1.5h-1.5z"})),g=(0,i.memo)(m),_=e=>{var t;return i.createElement(i.Fragment,null,i.createElement(g,{className:"npv-modal__icon"}),i.createElement("p",{className:"npv-modal__text"},null===(t=e.l10n)||void 0===t?void 0:t.title),e.errorDetails&&i.createElement("p",{className:"npv-modal__text npv-modal__details"},e.errorDetails))},v=({indicatorSize:e="md",className:t})=>i.createElement("div",{className:`${t} npv-loading-indicator`},i.createElement("div",{className:`npv-loading-indicator__circle npv-loading-indicator__circle--${e}`}),i.createElement("div",{className:`npv-loading-indicator__circle npv-loading-indicator__circle--${e}`}),i.createElement("div",{className:`npv-loading-indicator__circle npv-loading-indicator__circle--${e}`})),y=()=>i.createElement(v,null),E=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M1.665 15.226a.67.67 0 0 0 .915-.245l7.675-13.292a.67.67 0 1 0-1.161-.67L7.95 3H5a5 5 0 0 0-2.453 9.358L1.42 14.31a.67.67 0 0 0 .245.915zm1.632-4.167A3.5 3.5 0 0 1 5 4.5h2.084l-3.787 6.559zm2.368 4.167a.67.67 0 0 0 .915-.245L7.724 13H11a5 5 0 0 0 2.203-9.49l1.052-1.82a.67.67 0 1 0-1.161-.671L5.42 14.311a.67.67 0 0 0 .245.915zM12.45 4.814A3.501 3.501 0 0 1 11 11.5H8.59l3.86-6.686z"})),b=(0,i.memo)(E),S=e=>{var t;return i.createElement(i.Fragment,null,i.createElement(b,{className:"npv-modal__icon"}),i.createElement("p",{className:"npv-modal__text"},null===(t=e.l10n)||void 0===t?void 0:t.title))};n(46758),n(86277),n(2836);const A={ar:JSON.parse('{"ERROR_GENERIC":"حدث خطأ ما","PLAYING_FROM_X":"أنت تستمع إلى الأغاني من {CONTEXT}","CONTEXT_ALBUM":"ألبوم","CONTEXT_SEARCH":"بحث","CONTEXT_TRACK":"مقطع صوتي","CONTEXT_PLAYLIST":"قائمة الأغاني","CONTEXT_COLLECTION":"مجموعة","CONTEXT_RADIO":"راديو","CONTEXT_STATION":"راديو","CONTEXT_EPISODE":"بودكاست","CONTEXT_SHOW":"عرض","CONTEXT_ARTIST":"فنان","CONTEXT_AUDIOBOOK":"كتاب صوتي","NOTIFICATION_UP_NEXT":"التالي","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"يبدو أنه ليس لدينا كلمات لهذه الأغنية.","NO_LYRICS_MSG_2":"عذراً، ما زلنا نحاول الحصول على الكلمات.","NO_LYRICS_MSG_3":"نحن لا نعرف كلمات هذه الأغنية.","NO_LYRICS_MSG_4":"للأسف، عليك تخمين الكلمات بنفسك.","LYRICS_CREDITS":"مُرخّصة ومزوّدة من قِبل {PROVIDER}","LYRICS_UNSYNCED":"لم تتم مزامنة هذه الكلمات مع الأغنية حتى الآن.","LYRICS_ERROR_MESSAGE":"تعذَّر تحميل كلمات هذه الأغنية. يرجى إعادة المحاولة لاحقاً."}'),cs:JSON.parse('{"ERROR_GENERIC":"Něco se pokazilo.","PLAYING_FROM_X":"Zdroj pro přehrávání: {CONTEXT}","CONTEXT_ALBUM":"Album","CONTEXT_SEARCH":"hledání","CONTEXT_TRACK":"nahrávka","CONTEXT_PLAYLIST":"Playlist","CONTEXT_COLLECTION":"sbírka","CONTEXT_RADIO":"rádio","CONTEXT_STATION":"rádio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"pořad","CONTEXT_ARTIST":"umělec","CONTEXT_AUDIOBOOK":"audioknihy","NOTIFICATION_UP_NEXT":"Následuje","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Vypadá to, že text téhle skladby nemáme.","NO_LYRICS_MSG_2":"Teď jsi nás načapal/a, stále se snažíme získat text.","NO_LYRICS_MSG_3":"Hmm. K tomu text neznáme.","NO_LYRICS_MSG_4":"Promiň, ale text si budeš muset domyslet.","LYRICS_CREDITS":"Licencuje a poskytuje: {PROVIDER}","LYRICS_UNSYNCED":"Tenhle text ještě není synchronizovaný se skladbou.","LYRICS_ERROR_MESSAGE":"Text skladby se nepodařilo načíst. Zkus to prosím později."}'),de:JSON.parse('{"ERROR_GENERIC":"Irgendwas ist schiefgelaufen.","PLAYING_FROM_X":"Wiedergabe von {CONTEXT}","CONTEXT_ALBUM":"Album","CONTEXT_SEARCH":"Suche","CONTEXT_TRACK":"Titel","CONTEXT_PLAYLIST":"Playlist","CONTEXT_COLLECTION":"Sammlung","CONTEXT_RADIO":"Radio","CONTEXT_STATION":"Radio","CONTEXT_EPISODE":"Podcast","CONTEXT_SHOW":"Show","CONTEXT_ARTIST":"Künstler*in","CONTEXT_AUDIOBOOK":"Hörbuch","NOTIFICATION_UP_NEXT":"Als Nächstes","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Leider haben wir den Text zu diesem Song nicht.","NO_LYRICS_MSG_2":"Jetzt hast du uns erwischt, wir arbeiten noch am Songtext.","NO_LYRICS_MSG_3":"Hmm. Wir kennen den Text zu diesem Song leider nicht.","NO_LYRICS_MSG_4":"Tut uns leid, bei diesem Song musst du beim Text improvisieren.","LYRICS_CREDITS":"Lizenzierung und Bereitstellung durch {PROVIDER}","LYRICS_UNSYNCED":"Dieser Songtext ist noch nicht auf den Song abgestimmt.","LYRICS_ERROR_MESSAGE":"Der Text zu diesem Song konnte nicht geladen werden. Versuch’s später nochmal."}'),el:JSON.parse('{"ERROR_GENERIC":"Κάτι δεν πήγε καλά","PLAYING_FROM_X":"Αναπαραγωγή από {CONTEXT}","CONTEXT_ALBUM":"άλμπουμ","CONTEXT_SEARCH":"αναζήτηση","CONTEXT_TRACK":"κομμάτι","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"συλλογή","CONTEXT_RADIO":"ραδιόφωνο","CONTEXT_STATION":"ραδιόφωνο","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"εκπομπή","CONTEXT_ARTIST":"καλλιτέχνης","CONTEXT_AUDIOBOOK":"Ηχητικό βιβλίο","NOTIFICATION_UP_NEXT":"ΕΠΟΜΕΝΟ","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Φαίνεται ότι δεν έχουμε τους στίχους αυτού του τραγουδιού.","NO_LYRICS_MSG_2":"Μας τσάκωσες, ακόμα προσπαθούμε να βρούμε τους στίχους.","NO_LYRICS_MSG_3":"Χμ... Δεν ξέρουμε τους στίχους του.","NO_LYRICS_MSG_4":"Συγγνώμη. Θα πρέπει να μαντέψεις τους στίχους.","LYRICS_CREDITS":"Οι στίχοι παρέχονται κατόπιν άδειας από την {PROVIDER}","LYRICS_UNSYNCED":"Αυτοί οι στίχοι δεν είναι ακόμα συγχρονισμένοι με το τραγούδι.","LYRICS_ERROR_MESSAGE":"Δεν ήταν δυνατή η φόρτωση των στίχων γι\' αυτό το τραγούδι. Δοκίμασε ξανά αργότερα."}'),en:JSON.parse('{"ERROR_GENERIC":"Something went wrong","PLAYING_FROM_X":"Playing from {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"search","CONTEXT_TRACK":"track","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"collection","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"show","CONTEXT_ARTIST":"artist","CONTEXT_AUDIOBOOK":"audiobook","NOTIFICATION_UP_NEXT":"Up Next","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Looks like we don\'t have the lyrics to this song.","NO_LYRICS_MSG_2":"You caught us, we\'re still working on getting lyrics.","NO_LYRICS_MSG_3":"Hmm. We don\'t know the lyrics for this one.","NO_LYRICS_MSG_4":"Sorry, you\'ll have to guess the lyrics.","LYRICS_CREDITS":"Licensed & Provided by {PROVIDER}","LYRICS_UNSYNCED":"These lyrics aren’t synced to the song yet.","LYRICS_ERROR_MESSAGE":"Couldn’t load the lyrics for this song. Try again later."}'),"es-419":JSON.parse('{"ERROR_GENERIC":"Algo salió mal","PLAYING_FROM_X":"Reproduciendo desde {CONTEXT}","CONTEXT_ALBUM":"álbum","CONTEXT_SEARCH":"buscar","CONTEXT_TRACK":"canción","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"colección","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"programa","CONTEXT_ARTIST":"artista","CONTEXT_AUDIOBOOK":"audiolibro","NOTIFICATION_UP_NEXT":"Siguiente","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Parece que no tenemos la letra de esta canción.","NO_LYRICS_MSG_2":"Nos descubriste, todavía estamos trabajando para conseguir la letra.","NO_LYRICS_MSG_3":"Mmm… No nos sabemos esta letra.","NO_LYRICS_MSG_4":"Lo sentimos, tendrás que adivinar la letra esta vez.","LYRICS_CREDITS":"Licencias y distribución por {PROVIDER}","LYRICS_UNSYNCED":"La letra todavía no está sincronizada con la canción.","LYRICS_ERROR_MESSAGE":"No se pudo cargar la letra de esta canción. Inténtalo de nuevo más tarde."}'),es:JSON.parse('{"ERROR_GENERIC":"Algo no ha ido como debía","PLAYING_FROM_X":"Reproduciendo desde {CONTEXT}","CONTEXT_ALBUM":"álbum","CONTEXT_SEARCH":"buscar","CONTEXT_TRACK":"canción","CONTEXT_PLAYLIST":"lista","CONTEXT_COLLECTION":"colección","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"pódcast","CONTEXT_SHOW":"programa","CONTEXT_ARTIST":"artista","CONTEXT_AUDIOBOOK":"audiolibro","NOTIFICATION_UP_NEXT":"A continuación","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Parece que no tenemos la letra de esta canción.","NO_LYRICS_MSG_2":"¡Nos has pillado! Aún estamos aprendiéndonos la letra de esta.","NO_LYRICS_MSG_3":"Vaya. La verdad es que no nos sabemos la letra de esta.","NO_LYRICS_MSG_4":"Lo sentimos, pero la letra de esta la vas a tener que sacar tú.","LYRICS_CREDITS":"Letra licenciada y proporcionada por {PROVIDER}","LYRICS_UNSYNCED":"Esta letra aún no está sincronizada con la canción.","LYRICS_ERROR_MESSAGE":"No se ha podido cargar la letra de esta canción. Inténtalo de nuevo más tarde."}'),fi:JSON.parse('{"ERROR_GENERIC":"Jotain meni vikaan","PLAYING_FROM_X":"Toistetaan täältä: {CONTEXT}","CONTEXT_ALBUM":"albumi","CONTEXT_SEARCH":"haku","CONTEXT_TRACK":"kappale","CONTEXT_PLAYLIST":"soittolista","CONTEXT_COLLECTION":"kokoelma","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"ohjelma","CONTEXT_ARTIST":"artisti","CONTEXT_AUDIOBOOK":"äänikirja","NOTIFICATION_UP_NEXT":"Seuraavana vuorossa","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Vaikuttaa siltä, että meillä ei ole tämän kappaleen sanoja.","NO_LYRICS_MSG_2":"Kiinni jäimme. Sanat ovat vielä työn alla.","NO_LYRICS_MSG_3":"Hmm. Emme tiedä tämän sanoja.","NO_LYRICS_MSG_4":"Pahoittelut, sinun täytyy toistaiseksi yrittää kuunnella sanoja itse.","LYRICS_CREDITS":"Lisenssin haltija ja tarjoaja: {PROVIDER}","LYRICS_UNSYNCED":"Näitä sanoja ei ole vielä synkronoitu kappaleeseen.","LYRICS_ERROR_MESSAGE":"Tämän kappaleen sanoja ei voitu ladata. Yritä myöhemmin uudelleen."}'),"fr-CA":JSON.parse('{"ERROR_GENERIC":"Une erreur s\'est produite","PLAYING_FROM_X":"Lecture à partir de {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"rechercher","CONTEXT_TRACK":"titre","CONTEXT_PLAYLIST":"liste de lecture","CONTEXT_COLLECTION":"collection","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"balado","CONTEXT_SHOW":"émission","CONTEXT_ARTIST":"artiste","CONTEXT_AUDIOBOOK":"Livre audio","NOTIFICATION_UP_NEXT":"Prochains titres","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"On dirait que nous n\'avons pas les paroles de cette chanson.","NO_LYRICS_MSG_2":"Vous avez été trop rapide pour nous, nous tentons d\'obtenir les paroles.","NO_LYRICS_MSG_3":"Hum. Nous ne connaissons pas les paroles de cette chanson.","NO_LYRICS_MSG_4":"Nous sommes désolés! Vous devrez deviner les paroles.","LYRICS_CREDITS":"Autorisées et fournies par {PROVIDER}","LYRICS_UNSYNCED":"Ces paroles ne sont pas encore synchronisées avec la chanson.","LYRICS_ERROR_MESSAGE":"Impossible de charger les paroles de cette chanson. Réessayez plus tard."}'),fr:JSON.parse('{"ERROR_GENERIC":"Une erreur s\'est produite.","PLAYING_FROM_X":"Lecture à partir de {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"rechercher","CONTEXT_TRACK":"titre","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"collection","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"émission","CONTEXT_ARTIST":"artiste","CONTEXT_AUDIOBOOK":"livre audio","NOTIFICATION_UP_NEXT":"Prochains titres","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Il semble que nous ne disposions pas des paroles de ce titre.","NO_LYRICS_MSG_2":"Vous nous avez pris de court, nous essayons encore d\'obtenir les paroles.","NO_LYRICS_MSG_3":"Hum, nous ne connaissons pas les paroles de ce titre.","NO_LYRICS_MSG_4":"Désolés, vous allez devoir deviner les paroles.","LYRICS_CREDITS":"Autorisées sous licence et fournies par {PROVIDER}","LYRICS_UNSYNCED":"Ces paroles n\'ont pas encore été synchronisées avec le titre.","LYRICS_ERROR_MESSAGE":"Impossible de charger les paroles de ce titre. Veuillez réessayer plus tard."}'),hu:JSON.parse('{"ERROR_GENERIC":"Valami hiba történt","PLAYING_FROM_X":"Lejátszás: {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"keresés","CONTEXT_TRACK":"szám","CONTEXT_PLAYLIST":"műsorlista","CONTEXT_COLLECTION":"gyűjtemény","CONTEXT_RADIO":"rádió","CONTEXT_STATION":"rádió","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"műsor","CONTEXT_ARTIST":"előadó","CONTEXT_AUDIOBOOK":"hangoskönyv","NOTIFICATION_UP_NEXT":"Program","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Úgy tűnik, nincs meg nekünk a dal szövege.","NO_LYRICS_MSG_2":"Most lebuktunk, még dolgozunk ennek a dalszövegnek a megszerzésén.","NO_LYRICS_MSG_3":"Hmm. Ennek a dalnak nem tudjuk a szövegét.","NO_LYRICS_MSG_4":"Bocsi, de muszáj lesz egyedül kitalálnod a dalszöveget.","LYRICS_CREDITS":"Tulajdonos és szolgáltató: {PROVIDER}","LYRICS_UNSYNCED":"Ezt a dalszöveget még nem szinkronizáltuk a dallal.","LYRICS_ERROR_MESSAGE":"Nem sikerült betölteni a dalszöveget ehhez a dalhoz. Próbálkozz újra később."}'),id:JSON.parse('{"ERROR_GENERIC":"Ada yang salah","PLAYING_FROM_X":"Memutar dari {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"cari","CONTEXT_TRACK":"track","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"koleksi","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"acara","CONTEXT_ARTIST":"artis","CONTEXT_AUDIOBOOK":"buku audio","NOTIFICATION_UP_NEXT":"Berikutnya","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Tampaknya kami tidak punya lirik lagu ini.","NO_LYRICS_MSG_2":"Ups, kami masih terus berusaha mengumpulkan lirik.","NO_LYRICS_MSG_3":"Hmm. Kami juga tidak tahu lirik lagu ini.","NO_LYRICS_MSG_4":"Maaf, kamu harus menebak liriknya.","LYRICS_CREDITS":"Berlisensi & Disediakan oleh {PROVIDER}","LYRICS_UNSYNCED":"Lirik ini belum disinkronkan ke lagu.","LYRICS_ERROR_MESSAGE":"Tidak bisa memuat lirik untuk lagu ini. Coba lagi nanti."}'),it:JSON.parse('{"ERROR_GENERIC":"Si è verificato un problema","PLAYING_FROM_X":"Riproduzione da {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"ricerca","CONTEXT_TRACK":"brano","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"libreria","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"show","CONTEXT_ARTIST":"artista","CONTEXT_AUDIOBOOK":"audiolibro","NOTIFICATION_UP_NEXT":"In coda","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Il testo di questo brano non è disponibile.","NO_LYRICS_MSG_2":"Ci hai beccato: stiamo ancora lavorando per rendere disponibile il testo di questo brano.","NO_LYRICS_MSG_3":"Uhm. Non conosciamo il testo di questo brano.","NO_LYRICS_MSG_4":"Siamo spiacenti! Dovrai scoprire tu il testo di questo brano.","LYRICS_CREDITS":"Testo fornito in licenza da {PROVIDER}","LYRICS_UNSYNCED":"Questo testo non è ancora sincronizzato con il brano.","LYRICS_ERROR_MESSAGE":"Impossibile caricare il testo di questo brano. Riprova più tardi."}'),ja:JSON.parse('{"ERROR_GENERIC":"エラーが発生したようです","PLAYING_FROM_X":"{CONTEXT} から再生中","CONTEXT_ALBUM":"アルバム","CONTEXT_SEARCH":"検索","CONTEXT_TRACK":"曲","CONTEXT_PLAYLIST":"プレイリスト","CONTEXT_COLLECTION":"コレクション","CONTEXT_RADIO":"ラジオ","CONTEXT_STATION":"ラジオ","CONTEXT_EPISODE":"ポッドキャスト","CONTEXT_SHOW":"ショー","CONTEXT_ARTIST":"アーティスト","CONTEXT_AUDIOBOOK":"オーディオブック","NOTIFICATION_UP_NEXT":"次はこちら","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"この曲の歌詞情報がありません。","NO_LYRICS_MSG_2":"歌詞情報は現在収集中です。","NO_LYRICS_MSG_3":"申し訳ありません。この曲の歌詞情報がありません。","NO_LYRICS_MSG_4":"申し訳ありません。歌詞情報は準備できていません。","LYRICS_CREDITS":"ライセンス&歌詞提供:{PROVIDER}","LYRICS_UNSYNCED":"この歌詞はまだ曲と同期されていません。","LYRICS_ERROR_MESSAGE":"この楽曲の歌詞を読み込めませんでした。しばらくしてから、再度お試しください。"}'),ko:JSON.parse('{"ERROR_GENERIC":"문제가 발생했습니다","PLAYING_FROM_X":"{CONTEXT}에서 재생","CONTEXT_ALBUM":"앨범","CONTEXT_SEARCH":"검색하기","CONTEXT_TRACK":"트랙","CONTEXT_PLAYLIST":"플레이리스트","CONTEXT_COLLECTION":"컬렉션","CONTEXT_RADIO":"라디오","CONTEXT_STATION":"라디오","CONTEXT_EPISODE":"팟캐스트","CONTEXT_SHOW":"Show","CONTEXT_ARTIST":"아티스트","CONTEXT_AUDIOBOOK":"오디오북","NOTIFICATION_UP_NEXT":"다음 순서","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"이 곡은 아직 가사가 없는 것 같습니다.","NO_LYRICS_MSG_2":"죄송합니다. 가사를 아직 준비 중입니다.","NO_LYRICS_MSG_3":"죄송합니다. 가사를 찾을 수 없습니다.","NO_LYRICS_MSG_4":"죄송합니다. 가사가 제공되지 않습니다.","LYRICS_CREDITS":"라이선스 소유 및 가사 제공: {PROVIDER}","LYRICS_UNSYNCED":"가사가 아직 동기화되지 않았습니다.","LYRICS_ERROR_MESSAGE":"이 곡의 가사를 로드할 수 없습니다. 나중에 다시 시도하세요."}'),ms:JSON.parse('{"ERROR_GENERIC":"Sesuatu kesilapan berlaku","PLAYING_FROM_X":"Memainkan dari {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"cari","CONTEXT_TRACK":"lagu","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"koleksi","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"rancangan","CONTEXT_ARTIST":"artis","CONTEXT_AUDIOBOOK":"buku audio","NOTIFICATION_UP_NEXT":"Seterusnya","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Nampaknya kami tiada lirik untuk lagu ini.","NO_LYRICS_MSG_2":"Kami mengaku, kami masih berusaha mendapatkan lirik ini.","NO_LYRICS_MSG_3":"Hmm. Kami tidak tahu lirik untuk lagu ini.","NO_LYRICS_MSG_4":"Maaf, anda perlu meneka lirik ini sendiri.","LYRICS_CREDITS":"Dilesenkan & Disediakan oleh {PROVIDER}","LYRICS_UNSYNCED":"Lirik ini belum disegerakkan dengan lagu tersebut.","LYRICS_ERROR_MESSAGE":"Tidak dapat memuatkan lirik untuk lagu ini. Cuba lagi kemudian."}'),nl:JSON.parse('{"ERROR_GENERIC":"Er is iets fout gegaan.","PLAYING_FROM_X":"Afspelen vanaf {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"zoeken","CONTEXT_TRACK":"nummer","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"verzameling","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"show","CONTEXT_ARTIST":"artiest","CONTEXT_AUDIOBOOK":"luisterboek","NOTIFICATION_UP_NEXT":"Wachtrij","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Voor dit nummer hebben we geen songtekst.","NO_LYRICS_MSG_2":"Je hebt ons betrapt, we zijn nog steeds bezig met de songtekst.","NO_LYRICS_MSG_3":"Hmm. Hier kennen we de songtekst niet van.","NO_LYRICS_MSG_4":"Helaas! Je zal goed moeten luisteren wat de songtekst is.","LYRICS_CREDITS":"Aangeboden door en onder licentie van {PROVIDER}","LYRICS_UNSYNCED":"Deze songtekst is nog niet gesynchroniseerd met het nummer.","LYRICS_ERROR_MESSAGE":"Kan de songtekst van dit nummer niet laden. Probeer het later opnieuw."}'),pl:JSON.parse('{"ERROR_GENERIC":"Coś się nie udało","PLAYING_FROM_X":"Odtwarzanie z {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"wyszukaj","CONTEXT_TRACK":"utwór","CONTEXT_PLAYLIST":"playlista","CONTEXT_COLLECTION":"kolekcja","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"program","CONTEXT_ARTIST":"artysta","CONTEXT_AUDIOBOOK":"audiobooka","NOTIFICATION_UP_NEXT":"Następne","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Chyba nie mamy tekstu tego utworu.","NO_LYRICS_MSG_2":"I tu nas masz. Ciągle staramy się zdobyć tekst tej piosenki.","NO_LYRICS_MSG_3":"Hmmm. My też nie znamy tekstu.","NO_LYRICS_MSG_4":"Przykro nam, musisz improwizować bez tekstu.","LYRICS_CREDITS":"Licencja i udostępnienie: {PROVIDER}","LYRICS_UNSYNCED":"Ten tekst nie jest jeszcze zsynchronizowany czasowo z utworem.","LYRICS_ERROR_MESSAGE":"Nie udało się pobrać tekstu utworu. Spróbuj ponownie później."}'),"pt-BR":JSON.parse('{"ERROR_GENERIC":"Algo deu errado","PLAYING_FROM_X":"Tocando de {CONTEXT}","CONTEXT_ALBUM":"álbum","CONTEXT_SEARCH":"buscar","CONTEXT_TRACK":"faixa","CONTEXT_PLAYLIST":"playlist","CONTEXT_COLLECTION":"coleção","CONTEXT_RADIO":"rádio","CONTEXT_STATION":"rádio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"programa","CONTEXT_ARTIST":"artista","CONTEXT_AUDIOBOOK":"audiolivro","NOTIFICATION_UP_NEXT":"Próxima","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Parece que nós não temos a letra desta música.","NO_LYRICS_MSG_2":"Ih, foi mal! Ainda estamos aprendendo a cantar esta.","NO_LYRICS_MSG_3":"Hmm. Parece que ainda não aprendemos esta letra.","NO_LYRICS_MSG_4":"Eita! Essa letra você vai ter que inventar.","LYRICS_CREDITS":"Licenciada e oferecida por {PROVIDER}","LYRICS_UNSYNCED":"A letra ainda não foi sincronizada com a música.","LYRICS_ERROR_MESSAGE":"Não foi possível carregar a letra desta música. Tente de novo mais tarde."}'),ru:JSON.parse('{"ERROR_GENERIC":"Что-то пошло не так","PLAYING_FROM_X":"Источник: {CONTEXT}","CONTEXT_ALBUM":"альбом","CONTEXT_SEARCH":"поиск","CONTEXT_TRACK":"трек","CONTEXT_PLAYLIST":"плейлист","CONTEXT_COLLECTION":"коллекция","CONTEXT_RADIO":"радио","CONTEXT_STATION":"радио","CONTEXT_EPISODE":"подкаст","CONTEXT_SHOW":"шоу","CONTEXT_ARTIST":"исполнитель","CONTEXT_AUDIOBOOK":"аудиокнига","NOTIFICATION_UP_NEXT":"Далее","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Похоже, у нас нет текста этой песни.","NO_LYRICS_MSG_2":"Увы! Этого текста у нас пока нет.","NO_LYRICS_MSG_3":"Вот так да! Мы не знаем текста этой песни.","NO_LYRICS_MSG_4":"Текста пока нет, придется фантазировать.","LYRICS_CREDITS":"Лицензиар и источник: {PROVIDER}.","LYRICS_UNSYNCED":"Текст этой песни пока не синхронизирован.","LYRICS_ERROR_MESSAGE":"Не удалось загрузить текст песни. Попробуй позже."}'),sv:JSON.parse('{"ERROR_GENERIC":"Något blev fel","PLAYING_FROM_X":"Spelar upp från {CONTEXT}","CONTEXT_ALBUM":"Det här albumet","CONTEXT_SEARCH":"sök","CONTEXT_TRACK":"spår","CONTEXT_PLAYLIST":"Den här spellistan","CONTEXT_COLLECTION":"samling","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podd","CONTEXT_SHOW":"program","CONTEXT_ARTIST":"artist","CONTEXT_AUDIOBOOK":"ljudbok","NOTIFICATION_UP_NEXT":"Nästa","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Vi verkar inte ha texten till den här låten.","NO_LYRICS_MSG_2":"Du kom på oss, vi jobbar fortfarande på att hitta låttexten.","NO_LYRICS_MSG_3":"Hmm. Vi kan inte den här låttexten.","NO_LYRICS_MSG_4":"Vi ber om ursäkt! Du får försöka gissa låttexten.","LYRICS_CREDITS":"Licensierad och tillhandahållen av {PROVIDER}","LYRICS_UNSYNCED":"Den här låttexten är inte synkroniserad med låten än.","LYRICS_ERROR_MESSAGE":"Det gick inte att läsa in låttexten till den här låten. Försök igen senare."}'),th:JSON.parse('{"ERROR_GENERIC":"เกิดข้อผิดพลาด","PLAYING_FROM_X":"กำลังเล่นจาก {CONTEXT}","CONTEXT_ALBUM":"อัลบั้ม","CONTEXT_SEARCH":"ค้นหา","CONTEXT_TRACK":"แทร็ก","CONTEXT_PLAYLIST":"เพลย์ลิสต์","CONTEXT_COLLECTION":"คอลเลกชัน","CONTEXT_RADIO":"วิทยุ","CONTEXT_STATION":"วิทยุ","CONTEXT_EPISODE":"พอดแคสต์","CONTEXT_SHOW":"รายการโชว์","CONTEXT_ARTIST":"ศิลปิน","CONTEXT_AUDIOBOOK":"หนังสือเสียง","NOTIFICATION_UP_NEXT":"ถัดไป","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"ดูเหมือนเราจะไม่มีเนื้อเพลงของเพลงนี้","NO_LYRICS_MSG_2":"โดนจับได้ซะแล้ว เรากำลังหาเนื้อเพลงอยู่","NO_LYRICS_MSG_3":"อืมม เราไม่รู้เนื้อเพลงของเพลงนี้","NO_LYRICS_MSG_4":"ขออภัย คุณคงต้องเดาเนื้อเพลงนี้ไปก่อน","LYRICS_CREDITS":"ได้รับอนุญาตและให้บริการโดย {PROVIDER}","LYRICS_UNSYNCED":"เนื้อเพลงเหล่านี้ยังไม่ได้ซิงค์กับเพลง","LYRICS_ERROR_MESSAGE":"ไม่สามารถโหลดเนื้อเพลงสำหรับเพลงนี้ได้ โปรดลองอีกครั้งในภายหลัง"}'),tr:JSON.parse('{"ERROR_GENERIC":"Bir şeyler ters gitti","PLAYING_FROM_X":"{CONTEXT}\'den çalınıyor","CONTEXT_ALBUM":"albüm","CONTEXT_SEARCH":"ara","CONTEXT_TRACK":"parça","CONTEXT_PLAYLIST":"çalma listesi","CONTEXT_COLLECTION":"koleksiyon","CONTEXT_RADIO":"radyo","CONTEXT_STATION":"radyo","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"program","CONTEXT_ARTIST":"sanatçı","CONTEXT_AUDIOBOOK":"sesli kitap","NOTIFICATION_UP_NEXT":"Sıradaki","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Bu şarkının sözlerini şu anda gösteremiyoruz.","NO_LYRICS_MSG_2":"Şarkının sözleri üzerinde çalışıyoruz.","NO_LYRICS_MSG_3":"Hımm. Bu şarkının sözlerini bilmiyoruz.","NO_LYRICS_MSG_4":"Maalesef şarkının sözlerini kendin çıkarman gerekecek.","LYRICS_CREDITS":"Lisans Sahibi ve Sağlayan: {PROVIDER}","LYRICS_UNSYNCED":"Bu şarkı sözleri henüz şarkı ile senkronize değil.","LYRICS_ERROR_MESSAGE":"Bu şarkının sözleri yüklenemedi. Lütfen daha sonra tekrar dene."}'),vi:JSON.parse('{"ERROR_GENERIC":"Đã có sự cố xảy ra","PLAYING_FROM_X":"Phát từ {CONTEXT}","CONTEXT_ALBUM":"album","CONTEXT_SEARCH":"tìm kiếm","CONTEXT_TRACK":"bản nhạc","CONTEXT_PLAYLIST":"danh sách phát","CONTEXT_COLLECTION":"bộ sưu tập","CONTEXT_RADIO":"radio","CONTEXT_STATION":"radio","CONTEXT_EPISODE":"podcast","CONTEXT_SHOW":"chương trình","CONTEXT_ARTIST":"nghệ sĩ","CONTEXT_AUDIOBOOK":"sách nói","NOTIFICATION_UP_NEXT":"Phát tiếp theo","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"Có vẻ như chúng tôi chưa có lời cho bài hát này.","NO_LYRICS_MSG_2":"Bạn thấy đấy, chúng tôi vẫn đang tìm lời cho bài hát này.","NO_LYRICS_MSG_3":"Rất tiếc. Chúng tôi vẫn chưa có lời bài hát này.","NO_LYRICS_MSG_4":"Chúng tôi rất tiếc, bạn sẽ phải đoán lời bài hát này thôi.","LYRICS_CREDITS":"Do {PROVIDER} cấp phép và cung cấp","LYRICS_UNSYNCED":"Lời bài hát này chưa được đồng bộ hóa với bài hát.","LYRICS_ERROR_MESSAGE":"Không tải được lời cho bài hát này. Hãy thử lại sau."}'),"zh-Hant":JSON.parse('{"ERROR_GENERIC":"發生錯誤","PLAYING_FROM_X":"從 {CONTEXT} 播放","CONTEXT_ALBUM":"專輯","CONTEXT_SEARCH":"搜尋","CONTEXT_TRACK":"歌曲","CONTEXT_PLAYLIST":"播放清單","CONTEXT_COLLECTION":"收藏","CONTEXT_RADIO":"電台","CONTEXT_STATION":"電台","CONTEXT_EPISODE":"Podcast","CONTEXT_SHOW":"節目","CONTEXT_ARTIST":"藝人","CONTEXT_AUDIOBOOK":"有聲書","NOTIFICATION_UP_NEXT":"即將播放","OFFLINE":"You’re offline","NO_LYRICS_MSG_1":"我們好像沒有這首歌曲的歌詞。","NO_LYRICS_MSG_2":"被你發現了,我們還在努力找出歌詞。","NO_LYRICS_MSG_3":"嗯,我們也不知道這首歌曲的歌詞。","NO_LYRICS_MSG_4":"非常抱歉,你必須自己猜歌詞了。","LYRICS_CREDITS":"由「{PROVIDER}」授權及提供","LYRICS_UNSYNCED":"這些歌詞尚未與歌曲同步。","LYRICS_ERROR_MESSAGE":"無法載入這首歌曲的歌詞。請稍後再試。"}')},T=A.en;let O="en",I=T;const C={},N=e=>{if(e===O)return;const t=e.replace("_","-");I=A[t]||T,O=e},L=(e,t)=>(e.match(/\{[A-Z_]+\}/g)||[]).map((e=>e.replace(/[\{\}]/g,""))).reduce(((e,n)=>{let i=null;return i="number"==typeof t[n]?(e=>{try{return e.toLocaleString(O)}catch(t){return e.toString()}})(t[n]):t[n]||I[n]||n,e.replace(`{${n}}`,i)}),e),R=(e,t={})=>{if(!e)return"???";let n=I[e]||T[e]||e;if("string"!=typeof n&&void 0!==t.N){const e=((e,t)=>{try{return(C[e]||(C[e]=new Intl.PluralRules(e))).select(t)}catch(e){return"other"}})(O,parseInt(t.N,10));n[e]?n=n[e]:n.other&&(n=n.other)}return L(n,t)};function P(e){const t=function(e){return e.hasError?{className:"npv-modal__error",component:_,props:{errorDetails:e.errorDetails,l10n:{title:R("ERROR_GENERIC")}}}:function(e){const{playbackIsBuffering:t,currentTrack:n}=e,i=(null==n?void 0:n.mediaType)&&n.mediaType.toLowerCase();return!!t&&"video"===i}(e)?{className:"npv-modal__loading",component:y}:e.isOffline?{className:"npv-modal__offline",component:S,props:{l10n:{title:R("OFFLINE")}}}:{hidden:!0}}(e),n=null==t?void 0:t.component,o=e.disableAnimationsAndTransitions?0:1e3;return i.createElement(d.Z,{in:!t.hidden,classNames:"npv-modal",timeout:o,mountOnEnter:!0,unmountOnExit:!0},i.createElement("div",{className:`npv-modal ${null==t?void 0:t.className}`},i.createElement("div",{className:"npv-modal__content"},n&&i.createElement(n,Object.assign({},t.props)))))}var k=n(10422);const D=()=>{const e=(0,i.useRef)();(0,i.useEffect)((()=>(e.current=(()=>{var e,t;let n=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0];if(!n){const e=null===(t=document.getElementsByTagName("html"))||void 0===t?void 0:t[0];if(!e)return void console.error("Cannot create head element since no html element found");n=document.createElement("head"),e.appendChild(n)}const i=document.createElement("style");return i.setAttribute("type","text/css"),n.appendChild(i),i})(),()=>{var t;null===(t=e.current)||void 0===t||t.remove()})),[]);return t=>{e.current&&(e.current.textContent=t)}},w=({children:e,className:t})=>{const n=(0,i.useRef)(null),o=(0,i.useRef)(null);return((e,t,n)=>{const o=D();(0,i.useEffect)((()=>{var e,i;if(!t.current||!n.current)return;const r=1-(null!==(e=t.current.getBoundingClientRect().width)&&void 0!==e?e:1)/(null!==(i=n.current.getBoundingClientRect().width)&&void 0!==i?i:1);if(r<0)return void(n.current.style.animation="unset");const a=-100*r,s=Math.max(10*r,1.6),c=Math.min(Math.round(40/s),40),l=`marquee-${String(r).replace(/[^0-9]+/g,"")}`;n.current.style.animation=`${l} ${s}s linear infinite alternate`,o(`\n @-webkit-keyframes ${l} {\n 0%, ${c}% {\n -webkit-transform: translate3d(0, 0, 0);\n }\n ${100-c}%, 100% {\n -webkit-transform: translate3d(${a}%, 0, 0);\n }\n }\n\n @keyframes ${l} {\n 0%, ${c}% {\n transform: translate3d(0, 0, 0);\n -webkit-transform: translate3d(0, 0, 0);\n }\n ${100-c}%, 100% {\n transform: translate3d(${a}%, 0, 0);\n -webkit-transform: translate3d(${a}%, 0, 0);\n }\n }\n `)}),[n,t,e,o])})(e,n,o),i.createElement("p",{className:`${t} marquee`,ref:n},i.createElement("span",{className:"marquee__text",ref:o,"data-testid":"marquee-text"},e))},M=i.memo(w);function x(e){return i.createElement("div",{className:"npv-up-next"},i.createElement("img",{src:e.coverArtImageUrl,className:"npv-up-next__image",alt:"up next image"}),i.createElement("div",{className:"npv-up-next__info"},i.createElement("div",{className:"npv-up-next__text"},e.l10n.upNext),e.disableAnimationsAndTransitions?i.createElement("span",{className:"npv-up-next__metadata npv-up-next__metadata--static"},e.metadata):i.createElement(M,{className:"npv-up-next__metadata"},e.metadata)))}function U(e){const t=function(e){const t=c();return!!e&&e-t<=3e4}(e.duration),[n,o]=(0,i.useState)(null);(0,i.useEffect)((()=>{var n;null===(n=e.onVisibilityChanged)||void 0===n||n.call(e,t)}),[t]),(0,i.useEffect)((()=>{t&&o(e)}),[e,t]);const r=(0,i.useCallback)((()=>{o(null)}),[o]);if(!e.canRender)return null;const a=i.createElement(p,{visible:t,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,onExited:r},i.createElement(x,Object.assign({},n||e)));return e.portal&&e.portal.current?k.createPortal(a,e.portal.current):a}const V=1e3;function F({position:e,timestamp:t,isPaused:n,isBuffering:o,playbackSpeed:s=1,children:c}){const[,l]=(0,i.useState)(0),u=!n&&!o;(0,i.useEffect)((()=>{if(!u)return;const e=setInterval((()=>{l((e=>e+1))}),V/s);return()=>{clearInterval(e)}}),[u,s]);const d=(0,i.useCallback)((()=>function(e,t,n,i){return e+(i?Date.now()-t:0)*n}(e,t,s,u)),[e,t,s,u]);return i.createElement(r.Provider,{value:d},i.createElement(a.Provider,{value:d()},c))}var B=n(11317);const H=B.JM,G=[H.ALBUM,H.SEARCH,H.TRACK,H.PLAYLIST,H.PLAYLIST_V2,H.COLLECTION,H.RADIO,H.STATION,H.EPISODE,H.SHOW,H.ARTIST,"audiobook"];function K(e){return G.includes(e)}function W(e,t){const n={contextName:e.contextName,isGuestMode:e.isGuestMode,guestName:e.guestName,guestAvatarImage:e.guestAvatarImage,l10n:{playingFromContextType:""},contextMetadataVisible:!!e.contextMetadataVisible,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,mediaType:t},{contextType:i,contextUri:o}=e,r=i?function(e){return K(e)?`CONTEXT_${e.replace(/\-.*/,"").toUpperCase()}`:(console.warn(`Context type not allowed: ${e}`),"")}(i):function(e){if(!e)return"";const t=(0,B.EC)(e);return t?K(t.type)?`CONTEXT_${t.type.replace(/\-.*/,"").toUpperCase()}`:(console.warn(`Context type not allowed: ${null==t?void 0:t.type}`),""):(console.warn("Invalid URI value for trackUri"),"")}(o);return r?(n.l10n.playingFromContextType=R("PLAYING_FROM_X",{CONTEXT:R(r)}),n):n}function Y(e,t){var n;return!(!e.backgroundImageUrl&&!t)||"video"===(null===(n=e.currentTrack)||void 0===n?void 0:n.mediaType)}const j=e=>{const t=["spotifyinternal-artistnpv"];e.progressBarVisible&&t.push("npv-has-progress-bar");const n=e.disableAnimationsAndTransitions?"npv-has-no-animations-and-transitions":"npv-has-animations-and-transitions";return t.push(n),t.join(" ")};n(23012);const z={isAnimating:!1,isAnimationDone:!1},J={isAnimating:!0,isAnimationDone:!1},q={isAnimating:!1,isAnimationDone:!0};function X(e,t=0){let n;return function(...i){const o=this;clearTimeout(n),n=setTimeout((()=>e.apply(o,i)),t)}}const Z=i.memo((e=>{const t=(0,i.useRef)(),[n,o]=(0,i.useState)(z),[r,a]=(0,i.useState)({current:e.src}),s=(0,i.useCallback)((()=>{a({previous:t.current,current:e.src}),o(z),t.current=e.src}),[e.src]),c=(0,i.useCallback)(X((()=>{o(J)})),[]),l=(0,i.useCallback)(X((()=>{o(q)})),[]);(0,i.useEffect)((()=>{const t=new Image,n=()=>c(),i=setImmediate((()=>{e.src&&(t.src=e.src,t.addEventListener("load",n))}));return s(),()=>{clearImmediate(i),t.removeEventListener("load",n)}}),[e.src]);const{isAnimating:u,isAnimationDone:d}=n;return i.createElement("div",{className:`npv-cross-fade-container ${e.className}`},r.previous&&!d&&i.createElement("img",{className:"npv-cross-fade-image npv-cross-fade-image--previous "+(u||d?"npv-cross-fade-image--fade-out":""),onAnimationEnd:l,onLoad:c,src:r.previous,alt:e.alt}),r.current&&(u||d)&&i.createElement("img",{className:"npv-cross-fade-image npv-cross-fade--next "+(u?"npv-cross-fade-image--fade-in":""),onAnimationEnd:l,src:r.current,alt:e.alt}))}));function Q(e){return i.createElement("div",{className:`npv-background-image ${e.showBackgroundImage&&"npv-background-image--active"}`},i.createElement(Z,{src:e.backgroundImageUrl}),i.createElement("div",{className:"npv-background-image__overlay"}))}function $(e){const t=function(e,t){const n=[e];return"gradient"===t.modifier&&n.push(`${e}--gradient`),t.animated&&n.push(`${e}--animated`),n.join(" ")}("npv-background-color",e);return i.createElement("div",{className:t,style:{backgroundColor:e.backgroundColor,backgroundImage:"noise"===e.modifier?`linear-gradient(to bottom, ${e.backgroundColor}, ${e.backgroundColor})`:void 0}})}function ee(e){const t=["npv-playback-controls__action"];return e.className&&t.push(e.className),e.isActive&&t.push("npv-playback-controls__action--active"),t.join(" ")}const te=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M13.151.922a.75.75 0 1 0-1.06 1.06L13.109 3H11.16a3.75 3.75 0 0 0-2.873 1.34l-6.173 7.356A2.25 2.25 0 0 1 .39 12.5H0V14h.391a3.75 3.75 0 0 0 2.873-1.34l6.173-7.356a2.25 2.25 0 0 1 1.724-.804h1.947l-1.017 1.018a.75.75 0 0 0 1.06 1.06L15.98 3.75 13.15.922zM.391 3.5H0V2h.391c1.109 0 2.16.49 2.873 1.34L4.89 5.277l-.979 1.167-1.796-2.14A2.25 2.25 0 0 0 .39 3.5z"}),i.createElement("path",{d:"m7.5 10.723.98-1.167.957 1.14a2.25 2.25 0 0 0 1.724.804h1.947l-1.017-1.018a.75.75 0 1 1 1.06-1.06l2.829 2.828-2.829 2.828a.75.75 0 1 1-1.06-1.06L13.109 13H11.16a3.75 3.75 0 0 1-2.873-1.34l-.787-.938z"})),ne=(0,i.memo)(te);function ie(e){return i.createElement("div",{className:ee(e)},e.children,!e.hideDot&&i.createElement("div",{className:"npv-playback-controls__dot"}))}function oe(e){return i.createElement(ie,{className:"npv-playback-controls__shuffle",isActive:e.isActive},i.createElement(ne,{className:"npv-playback-controls__icon"}))}const re=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M0 4.75A3.75 3.75 0 0 1 3.75 1h8.5A3.75 3.75 0 0 1 16 4.75v5a3.75 3.75 0 0 1-3.75 3.75H9.81l1.018 1.018a.75.75 0 1 1-1.06 1.06L6.939 12.75l2.829-2.828a.75.75 0 1 1 1.06 1.06L9.811 12h2.439a2.25 2.25 0 0 0 2.25-2.25v-5a2.25 2.25 0 0 0-2.25-2.25h-8.5A2.25 2.25 0 0 0 1.5 4.75v5A2.25 2.25 0 0 0 3.75 12H5v1.5H3.75A3.75 3.75 0 0 1 0 9.75v-5z"})),ae=(0,i.memo)(re),se=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M0 4.75A3.75 3.75 0 0 1 3.75 1h.75v1.5h-.75A2.25 2.25 0 0 0 1.5 4.75v5A2.25 2.25 0 0 0 3.75 12H5v1.5H3.75A3.75 3.75 0 0 1 0 9.75v-5zM12.25 2.5h-.75V1h.75A3.75 3.75 0 0 1 16 4.75v5a3.75 3.75 0 0 1-3.75 3.75H9.81l1.018 1.018a.75.75 0 1 1-1.06 1.06L6.939 12.75l2.829-2.828a.75.75 0 1 1 1.06 1.06L9.811 12h2.439a2.25 2.25 0 0 0 2.25-2.25v-5a2.25 2.25 0 0 0-2.25-2.25z"}),i.createElement("path",{d:"M9.12 8V1H7.787c-.128.72-.76 1.293-1.787 1.313V3.36h1.57V8h1.55z"})),ce=(0,i.memo)(se);function le(e){return i.createElement(ie,{className:"npv-playback-controls__repeat",isActive:!!e.mode&&"off"!==e.mode},function(e){switch(e){case"all":return i.createElement(ae,{className:"npv-playback-controls__icon"});case"one":return i.createElement(ce,{className:"npv-playback-controls__icon"});default:return null}}(e.mode))}const ue=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M15.724 4.22A4.313 4.313 0 0 0 12.192.814a4.269 4.269 0 0 0-3.622 1.13.837.837 0 0 1-1.14 0 4.272 4.272 0 0 0-6.21 5.855l5.916 7.05a1.128 1.128 0 0 0 1.727 0l5.916-7.05a4.228 4.228 0 0 0 .945-3.577z"})),de=(0,i.memo)(ue);function pe(e){return i.createElement(ie,{className:"npv-playback-controls__heart",isActive:e.isActive,hideDot:!0},i.createElement(de,{className:"npv-playback-controls__icon"}))}const fe=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M3 1.713a.7.7 0 0 1 1.05-.607l10.89 6.288a.7.7 0 0 1 0 1.212L4.05 14.894A.7.7 0 0 1 3 14.288V1.713z"})),he=(0,i.memo)(fe);function me(e){const t=e.isPaused?"":"npv-playback-controls__play-pause--playing";return i.createElement("div",{className:`npv-playback-controls__action npv-playback-controls__play-pause ${t}`},i.createElement(he,{className:"npv-playback-controls__icon"}))}const ge=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M2.7 1a.7.7 0 0 0-.7.7v12.6a.7.7 0 0 0 .7.7h2.6a.7.7 0 0 0 .7-.7V1.7a.7.7 0 0 0-.7-.7H2.7zm8 0a.7.7 0 0 0-.7.7v12.6a.7.7 0 0 0 .7.7h2.6a.7.7 0 0 0 .7-.7V1.7a.7.7 0 0 0-.7-.7h-2.6z"})),_e=(0,i.memo)(ge);function ve(e){const t=e.isPaused?"npv-playback-controls__play-pause--paused":"";return i.createElement("div",{className:`npv-playback-controls__action npv-playback-controls__play-pause ${t}`},i.createElement(_e,{className:"npv-playback-controls__icon"}))}function ye(e){return i.createElement("svg",Object.assign({viewBox:"0 0 110 48",xmlns:"http://www.w3.org/2000/svg"},e),i.createElement("path",{d:"M0 4C0 1.79086 1.79086 0 4 0H106C108.209 0 110 1.79086 110 4V44C110 46.2091 108.209 48 106 48H4C1.79086 48 0 46.2091 0 44V4Z",fill:"black",fillOpacity:"0.5"}),i.createElement("path",{d:"M37.3917 32V16.6478H33.8429V22.6674H27.5265V16.6478H24V32H27.5265V25.8938H33.8429V32H37.3917Z",fill:"white"}),i.createElement("path",{d:"M43.9931 32V21.2383H40.6005V32H43.9931ZM40.3104 17.9271C40.3104 18.9882 41.2031 19.8543 42.2745 19.8543C43.3905 19.8543 44.2832 18.9882 44.2832 17.9271C44.2832 16.8661 43.3905 16 42.2745 16C41.2031 16 40.3104 16.8661 40.3104 17.9271Z",fill:"white"}),i.createElement("path",{d:"M50.762 32V26.2619H56.6097V23.1438H50.7397V19.8958H57.4132V16.6478H47.2132V32H50.762Z",fill:"white"}),i.createElement("path",{d:"M63.0432 32V21.2383H59.6506V32H63.0432ZM59.3604 17.9271C59.3604 18.9882 60.2532 19.8543 61.3246 19.8543C62.4406 19.8543 63.3333 18.9882 63.3333 17.9271C63.3333 16.8661 62.4406 16 61.3246 16C60.2532 16 59.3604 16.8661 59.3604 17.9271Z",fill:"white"}),i.createElement("circle",{cx:"78",cy:"24",r:"7",stroke:"white",strokeOpacity:"0.3",strokeWidth:"2"}))}function Ee(e){return i.createElement("svg",Object.assign({viewBox:"0 0 110 48",xmlns:"http://www.w3.org/2000/svg"},e),i.createElement("path",{d:"M0 4C0 1.79086 1.79086 0 4 0H106C108.209 0 110 1.79086 110 4V44C110 46.2091 108.209 48 106 48H4C1.79086 48 0 46.2091 0 44V4Z",fill:"black",fillOpacity:"0.5"}),i.createElement("path",{d:"M37.3917 32V16.6478H33.8429V22.6674H27.5265V16.6478H24V32H27.5265V25.8938H33.8429V32H37.3917Z"}),i.createElement("path",{d:"M43.9931 32V21.2383H40.6005V32H43.9931ZM40.3104 17.9271C40.3104 18.9882 41.2031 19.8543 42.2745 19.8543C43.3905 19.8543 44.2832 18.9882 44.2832 17.9271C44.2832 16.8661 43.3905 16 42.2745 16C41.2031 16 40.3104 16.8661 40.3104 17.9271Z"}),i.createElement("path",{d:"M50.762 32V26.2619H56.6097V23.1438H50.7397V19.8958H57.4132V16.6478H47.2132V32H50.762Z"}),i.createElement("path",{d:"M63.0432 32V21.2383H59.6506V32H63.0432ZM59.3605 17.9271C59.3605 18.9882 60.2532 19.8543 61.3246 19.8543C62.4406 19.8543 63.3333 18.9882 63.3333 17.9271C63.3333 16.8661 62.4406 16 61.3246 16C60.2532 16 59.3605 16.8661 59.3605 17.9271Z"}),i.createElement("circle",{cx:"80.2222",cy:"24",r:"8"}))}const be=i.memo(ye),Se=i.memo(Ee);function Ae(e){return!0===e.status?i.createElement(Se,{className:"npv-playback-controls__hifi--on"}):i.createElement(be,{className:"npv-playback-controls__hifi--off"})}function Te(e){return void 0===e.playbackHiFiStatus?null:i.createElement("div",{className:"npv-playback-controls__action npv-playback-controls__action--active npv-playback-controls__hifi"},i.createElement(Ae,{status:e.playbackHiFiStatus}))}function Oe(e){return i.createElement(p,{visible:e.isActive,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions},i.createElement("div",{className:"npv-playback-controls"},i.createElement("div",{className:"npv-playback-controls__area npv-playback-controls__area--left"},i.createElement(Te,{playbackHiFiStatus:e.playbackHiFiStatus}),i.createElement(pe,{isActive:null==e?void 0:e.isTrackLiked}),i.createElement(oe,{isActive:null==e?void 0:e.playbackIsShuffled}),i.createElement(le,{mode:null==e?void 0:e.playbackRepeatMode})),i.createElement("div",{className:"npv-playback-controls__area npv-playback-controls__area--center"}),i.createElement("div",{className:"npv-playback-controls__area npv-playback-controls__area--right"},i.createElement(me,{isPaused:null==e?void 0:e.isPaused}),i.createElement(ve,{isPaused:null==e?void 0:e.isPaused}))))}function Ie(e){var t;return null!==(t=e.CustomPlaybackControls)&&void 0!==t?t:i.createElement(Oe,Object.assign({},function(e){var t;const{playbackRepeatMode:n,playbackIsShuffled:i,playbackHiFiStatus:o,disableAnimationsAndTransitions:r}=e;return{playbackIsShuffled:i,playbackRepeatMode:n,isTrackLiked:null===(t=e.currentTrack)||void 0===t?void 0:t.isLiked,isPaused:e.playbackIsPaused||e.playbackIsBuffering,playbackHiFiStatus:o,isActive:!!e.controlsVisible,disableAnimationsAndTransitions:r}}(e)))}n(54487),n(53321);function Ce(e){var t,n,i;return{name:null===(t=e.currentTrack)||void 0===t?void 0:t.name,creatorName:null===(n=e.currentTrack)||void 0===n?void 0:n.creatorName,coverArtImageUrl:null===(i=e.currentTrack)||void 0===i?void 0:i.coverArtImageUrl,hidden:!e.trackMetadataVisible}}var Ne=n(2489),Le=n.n(Ne);const Re={UNKNOWN:"UNKNOWN",UNSYNCED:"UNSYNCED",LINE_SYNCED:"LINE_SYNCED",SYLLABLE_SYNCED:"SYLLABLE_SYNCED"};function Pe(e,t,n){const i=n/t,o=Math.floor(e.length*i);return Math.max(Math.min(o,e.length-4),0)}function ke(e){if(!e)return;const{provider:t,lines:n,syncType:i}=e;return n&&t&&i&&Object.values(Re).includes(i)&&function(e){return e.every((e=>void 0!==e.text&&void 0!==e.timestamp))&&!!e.length}(n)?{provider:t,lines:n,syncType:i}:void 0}const De=(e,t)=>{var n,i;const[o,r,a]=null!==(i=null===(n=Le().get(e))||void 0===n?void 0:n.value)&&void 0!==i?i:[0,0,0];return`rgba(${o}, ${r}, ${a}, ${t})`};n(27082),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);const we=140;function Me(e){return e.reduce(((e,t)=>e+t),0)}function xe(e,t,n,o){const r=(0,i.useRef)([]);return(0,i.useEffect)((()=>{r.current=[]}),[e]),(0,i.useCallback)((i=>{Me(r.current)>=we||(i.forEach((e=>{r.current[e.index]=e.text.length})),Me(r.current)>=we&&o(e,t,n))}),[o,e,t,n])}function Ue(e,t){const[n,o]=(0,i.useState)();return(0,i.useEffect)((()=>{var n,i;const r=Array.prototype.slice.call(null!==(i=null===(n=e.current)||void 0===n?void 0:n.querySelectorAll("[data-lyrics-line]"))&&void 0!==i?i:[]);o({key:t,value:r.map(((e,n)=>{const i=t[n];if(void 0!==i)return{element:e,text:i.text,index:n}})).filter((e=>void 0!==e))})}),[t]),(null==n?void 0:n.key)===t?n.value:[]}function Ve(e){const t=c(),n=(0,i.useMemo)((()=>function(e,t){for(let n=0;nt)return Math.max(0,n-1);return e.length-1}(e,t)),[t,e]);return{firstVisibleIndex:Math.max(n-1,0),currentIndex:n}}function Fe(e,t,n,o){const r=function(e){var t;const[n,o]=(0,i.useState)(null===(t=e.current)||void 0===t?void 0:t.getBoundingClientRect().height);return(0,i.useEffect)((()=>{const t=setInterval((()=>{var t;o(null===(t=e.current)||void 0===t?void 0:t.getBoundingClientRect().height)}),1e3);return()=>{clearInterval(t)}}),[]),n}(e);(0,i.useEffect)((()=>{if(!n.length||!r)return;const e=function(e,t,n){var i;const o=null===(i=e[t])||void 0===i?void 0:i.element.offsetTop;return e.filter((e=>e.element.offsetTop>=o&&e.element.offsetTop{const n=c();return(0,i.useMemo)((()=>{const i=Pe(e,t,n);return e.slice(i)}),[e,t,n])};const He=e=>{var t;const n=(()=>{var e,t;let n=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0];if(!n){const e=null===(t=document.getElementsByTagName("html"))||void 0===t?void 0:t[0];if(!e)return void console.error("Cannot creat head element since no html element found");n=document.createElement("head"),e.appendChild(n)}return n})();return n?k.createPortal(i.createElement("style",{type:null!==(t=e.type)&&void 0!==t?t:"text/css"},e.styles.map((e=>(({styles:e,selector:t})=>{if(0===e.length||0===t.length)return"";let n=`${t} {`;for(const t of e)for(const[e,i]of Object.entries(t))n+=`\n ${e}: ${i};`;return`${n}\n}`})(e)))),n):null},Ge=i.memo(He),Ke=e=>{const{showGradient:t,currentColor:n}=function(e){const[t,n]=(0,i.useState)(e),[o,r]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{n(e),r(!1);const t=setTimeout((()=>{r(!0)}),100);return()=>clearTimeout(t)}),[e]),{showGradient:o,currentColor:t}}(e.backgroundColor||""),o="npv-lyrics__gradient-background",r=De(n,0),a=De(n,.6),s=[{selector:`.${o}`,styles:[{background:`-webkit-gradient(linear, left top, left bottom, from(${r}), color-stop(30%, ${a}), color-stop(60%, ${n}))`},{background:`-webkit-linear-gradient(top, ${r} 0%, ${a} 30%, ${n} 60%)`},{background:`linear-gradient(to bottom, ${r} 0%, ${a} 30%, ${n} 60%)`}]}],c=`npv-lyrics__gradient ${o}\n ${t&&"npv-lyrics__gradient--shown"}\n ${e.fullScreen&&"npv-lyrics__gradient--full-screen"}\n `;return i.createElement(i.Fragment,null,i.createElement(Ge,{styles:s}),i.createElement("div",{className:c}))},We=(0,i.memo)(Ke);function Ye(e){return i.createElement("div",{className:"npv-lyrics__sentences",style:{transform:`translateY(${-e.offsetTop}px)`},dir:"auto"},e.lyrics.lines.map(((t,n,o)=>{const r=function(e,t,n,i){return[n===t&&"npv-lyrics__text-wrapper--current",n>t&&"npv-lyrics__text-wrapper--next",n!1!==e)).join(" ")}(e.firstVisibleIndex,e.currentIndex,n,o.length);return i.createElement("div",{className:`npv-lyrics__text-wrapper ${r}`,key:n},i.createElement("p",{"data-lyrics-line":!0,className:"npv-lyrics__text"},t.text||" "))})),i.createElement("p",{className:"npv-lyrics__text npv-lyrics__text--credits"},R("LYRICS_CREDITS",{PROVIDER:e.lyrics.provider})))}const je=e=>{var t;const{firstVisibleIndex:n,currentIndex:o}=Ve(e.lyrics.lines),r=Ue(e.containerRef,e.lyrics.lines),a=xe(e.trackUri,e.lyrics.provider,e.lyrics.syncType,e.onLyricsReport);Fe(e.containerRef,a,r,n);const s=null===(t=r[n])||void 0===t?void 0:t.element,c=(0,i.useMemo)((()=>{var e;return null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0}),[s]);return i.createElement(i.Fragment,null,i.createElement(Ye,{firstVisibleIndex:n,currentIndex:o,offsetTop:c,lyrics:e.lyrics}),i.createElement(We,{backgroundColor:e.backgroundColor,fullScreen:e.fullScreen}))},ze=100;function Je(e,t,n){const i=t.syllables||[],o=i[n];if(void 0!==o.duration)return o.duration;if(i.length>n+1){return i[n+1].timestamp-o.timestamp}return e.lines.length>t.index+1?e.lines[t.index+1].timestamp-o.timestamp:ze}function qe(e){const t=(0,i.useRef)(null),n=(0,i.useRef)(null),o=(0,i.useRef)({index:e.line.index,text:e.line.text}),[,r]=(0,i.useReducer)((e=>e+1),0),[a,s]=(0,i.useState)(0),[c,l]=(0,i.useState)(0),[u,d]=(0,i.useState)("");return(0,i.useEffect)((()=>{function i(){null!==n.current&&(clearTimeout(n.current),n.current=null)}if(o.current.index!==e.line.index||o.current.text!==e.line.text)l(0),s(0),d(""),i(),n.current=setTimeout((()=>{r()}),0),o.current={index:e.line.index,text:e.line.text};else{const{alreadyShownSyllablesLength:n,currentSyllableDurationMs:i}=function(e,t,n){const i=t.syllables||[];let o=null,r=0;for(let e=0;en)break;o=t,r+=t.length}return null===o?{alreadyShownSyllablesLength:0,currentSyllableDurationMs:0}:{alreadyShownSyllablesLength:r,currentSyllableDurationMs:Je(e,t,o.index)}}(e.lyrics,e.line,e.songProgressMs),o=e.line.text.slice(0,n);l(function(e,t,n){if(!e||!t||!t.current)return 0;const i=window.getComputedStyle(t.current);return e.style.position="absolute",e.style.visibility="hidden",e.style.fontFamily=i.fontFamily,e.style.fontSize=i.fontSize,e.style.fontWeight=i.fontWeight,e.innerText=n,e.getBoundingClientRect().width}(e.textMeasurer,t,o)),s(i),d(o)}return()=>{i()}}),[e.lyrics,e.songProgressMs,e.line.index,e.line.text,l,s,d,r]),i.createElement(i.Fragment,null,i.createElement("span",{ref:t,className:"syllable-synced-animated-lyrics__full-text"},e.line.text),i.createElement("span",{className:"syllable-synced-animated-lyrics__progressing-text",style:{width:`${c}px`,transitionDuration:""+(u?`${a}ms`:"0ms")}},u))}function Xe(e){const t=(0,i.useRef)(null),[n,o]=(0,i.useState)(null),[r,a]=(0,i.useState)(null),[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(null),[d,p]=(0,i.useState)(!1),f=(0,i.useCallback)((()=>{p(!1)}),[p]),h=xe(e.trackUri,e.lyrics.provider,e.lyrics.syncType,e.onLyricsReport);return(0,i.useEffect)((()=>(t.current=function(){const e=document.createElement("span");return document.body.appendChild(e),e}(),()=>{var e;t.current&&(null===(e=t.current.parentNode)||void 0===e||e.removeChild(t.current))})),[t]),(0,i.useEffect)((()=>{const{currentLine:t,nextLine:n,lineAfterTheNext:i}=function(e,t){const n=e.lines,i=n.length;let o=-1;if(i>0&&tt);++e)o=e;if(-1===o)return{currentLine:null,nextLine:null,lineAfterTheNext:null};const r=n[o+1],a=n[o+2];return{currentLine:Object.assign({index:o},n[o]),nextLine:r?Object.assign({index:o+1},r):null,lineAfterTheNext:a?Object.assign({index:o+2},a):null}}(e.lyrics,e.songProgressMs);(null==r?void 0:r.index)===(null==t?void 0:t.index)&&(null==r?void 0:r.text)===(null==t?void 0:t.text)||(o(r),a(t),c(n),u(i),r&&p(!0))}),[e.lyrics,e.songProgressMs,r,o,a,c,u,p]),function(e,t,n,o,r){const a=(0,i.useRef)(null),s=(0,i.useRef)(null);(0,i.useEffect)((()=>{a.current=new Set,s.current=[]}),[e]),(0,i.useEffect)((()=>{a.current&&s.current&&(void 0===n||a.current.has(n)||(a.current.add(n),s.current.push({index:n,text:t[n].text})),void 0===o||a.current.has(o)||(a.current.add(o),s.current.push({index:o,text:t[o].text})),r(s.current))}),[r,n,o])}(e.trackUri,e.lyrics.lines,null==r?void 0:r.index,null==s?void 0:s.index,h),i.createElement(i.Fragment,null,i.createElement("div",{className:"syllable-synced-lyrics__container",onTransitionEnd:f},i.createElement("div",{className:"syllable-synced-lyrics-scroller "+(d?"syllable-synced-lyrics-scroller-animation":"")},d&&n&&i.createElement("span",{className:"syllable-synced-lyrics__static-line"},n.text),i.createElement("div",{className:"syllable-synced-animated-lyrics"},r&&t.current&&i.createElement(qe,{textMeasurer:t.current,lyrics:e.lyrics,line:r,songProgressMs:e.songProgressMs})),s&&i.createElement("span",{className:"syllable-synced-lyrics__static-line"},s.text),l&&i.createElement("span",{className:"syllable-synced-lyrics__static-line"},l.text))),i.createElement(We,{backgroundColor:e.backgroundColor,fullScreen:e.fullScreen}))}function Ze(e){return i.createElement("div",{className:"npv-track-metadata","aria-hidden":e.hidden},i.createElement("div",{className:"npv-track-metadata__content-wrapper"},e.coverArtImageUrl&&i.createElement(Z,{className:"npv-track-metadata__cover-art",src:e.coverArtImageUrl,alt:""}),(e.name||e.creatorName)&&i.createElement("div",{className:"npv-track-metadata__text-wrapper"},e.name&&i.createElement("div",{className:"npv-track-metadata__name"},e.name),e.creatorName&&i.createElement("div",{className:"npv-track-metadata__creator-name"},e.creatorName))))}function Qe(e){return i.createElement("div",{className:"npv-lyrics__sentences",style:e.style,dir:"auto"},e.lyrics.lines.map(((e,t)=>i.createElement("p",{className:"npv-lyrics__text npv-lyrics__text--unsynced","data-lyrics-line":!0,key:t},e.text))),i.createElement("p",{className:"npv-lyrics__text npv-lyrics__text--credits"},R("LYRICS_CREDITS",{PROVIDER:e.lyrics.provider})))}function $e(e){const t=s(),n=function(e,t){const[n,o]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{const e=setTimeout((()=>o(!1)),100);return o(!0),()=>clearTimeout(e)}),[t]),(t,i,o)=>`${e}${n?"-reset":""} ${i}ms linear -${t}ms ${o?"paused":"running"}`}("slide-up",t),o=n(t,e.duration,e.isPaused),r={WebkitAnimation:o,animation:o};return i.createElement(Qe,Object.assign({},e,{style:r}))}function et(e){const t=Object.assign(Object.assign({},e.lyrics),{lines:Be(e.lyrics.lines,e.duration)});return i.createElement(Qe,Object.assign({},e,{lyrics:t}))}const tt=e=>{const t=e.disableAnimationsAndTransitions?et:$e,n=xe(e.trackUri,e.lyrics.provider,e.lyrics.syncType,e.onLyricsReport);return function(e,t,n,o){const r=Ue(e,n),a=c();Fe(e,t,r,(0,i.useMemo)((()=>Pe(n,o,a)),[n,o,a]))}(e.containerRef,n,e.lyrics.lines,e.duration),i.createElement(i.Fragment,null,i.createElement("p",{className:"npv-lyrics__text--unsynced-warning"},R("LYRICS_UNSYNCED")),i.createElement("div",{className:"npv-lyrics__container--unsynced"},i.createElement(t,{duration:e.duration,isPaused:e.isPaused,lyrics:e.lyrics})),i.createElement(We,{backgroundColor:e.backgroundColor,fullScreen:e.fullScreen}))},nt=e=>i.createElement("div",{className:"npv-lyrics__message"},i.createElement("p",{className:"npv-lyrics__text npv-lyrics__text--message"},e.children)),it=e=>{const[t,n]=(0,i.useState)("");return(0,i.useEffect)((()=>{const e=function(e){const t=["NO_LYRICS_MSG_1","NO_LYRICS_MSG_2","NO_LYRICS_MSG_3","NO_LYRICS_MSG_4"].filter((t=>t!==e));return t[Math.floor(Math.random()*(t.length-1))]}(t);n(e)}),[e.trackUri]),i.createElement(nt,null,t?R(t):"")},ot=e=>{const t=(0,i.useRef)(null);return i.createElement("div",{className:`npv-lyrics ${e.className}`},i.createElement($,{backgroundColor:e.backgroundColor,modifier:"noise"}),i.createElement(Ze,Object.assign({},e.trackMetadataProps)),i.createElement("div",{ref:t,className:`npv-lyrics__content ${e.fullScreen&&"npv-lyrics__content--full-screen"} ${e.lyricsContainerCustomClasses?e.lyricsContainerCustomClasses:""}`},!e.content&&"success"===e.status&&i.createElement(it,{trackUri:e.trackUri}),!e.content&&"error"===e.status&&i.createElement(nt,null,R("LYRICS_ERROR_MESSAGE")),e.trackUri&&e.content&&e.content.syncType===Re.LINE_SYNCED&&i.createElement(je,{lyrics:e.content,backgroundColor:e.backgroundColor,containerRef:t,onLyricsReport:e.onLyricsReport,trackUri:e.trackUri,fullScreen:e.fullScreen}),e.trackUri&&e.content&&e.content.syncType===Re.UNSYNCED&&i.createElement(tt,{lyrics:e.content,backgroundColor:e.backgroundColor,duration:e.duration,isPaused:e.isPaused,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,containerRef:t,onLyricsReport:e.onLyricsReport,trackUri:e.trackUri,fullScreen:e.fullScreen}),e.trackUri&&e.content&&e.content.syncType===Re.SYLLABLE_SYNCED&&i.createElement(Xe,{lyrics:e.content,backgroundColor:e.backgroundColor,songProgressMs:e.position||0,onLyricsReport:e.onLyricsReport,trackUri:e.trackUri,fullScreen:e.fullScreen})))};function rt(e){return i.createElement("div",{className:`npv-cover-art npv-cover-art--${e.mediaType}\n ${e.hasNoExpandedCover&&"npv-cover-art--not-expanded"}\n ${e.trackMetadataVisible&&"npv-cover-art--visible"}`},i.createElement(Z,{src:e.coverArtImageUrl,alt:"Cover Art"}))}function at(e){return i.createElement("div",{className:`npv-track npv-track--${e.mediaType} ${e.hasNoExpandedCover&&"npv-track--not-expanded"} ${e.trackMetadataVisible&&"npv-track--visible"}`},i.createElement("div",{className:"npv-track__name"},e.trackName),i.createElement("div",{className:"npv-track__creator-name"},e.trackCreatorName))}const st=e=>i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},e),i.createElement("path",{d:"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.669 11.539a.498.498 0 0 1-.686.166c-1.878-1.148-4.243-1.408-7.028-.772a.499.499 0 0 1-.222-.972c3.048-.696 5.662-.396 7.77.892a.5.5 0 0 1 .166.686zm.979-2.178a.624.624 0 0 1-.858.205c-2.15-1.322-5.428-1.705-7.972-.932a.624.624 0 1 1-.362-1.194c2.905-.882 6.517-.455 8.987 1.063a.624.624 0 0 1 .205.858zm.084-2.269C10.153 5.561 5.9 5.42 3.438 6.167a.748.748 0 1 1-.434-1.432c2.826-.857 7.523-.692 10.492 1.07a.748.748 0 0 1-.764 1.287z"})),ct=(0,i.memo)(st),lt=({src:e,className:t,focused:n})=>i.createElement("div",{className:`npv-avatar ${t}}`},e&&i.createElement("div",{className:"npv-avatar__image "+(n?"npv-avatar__image--focused":""),style:{backgroundImage:`url(${e})`}}));function ut({name:e,avatarImage:t}){return i.createElement("div",{className:"npv-guest"},i.createElement("p",{className:"npv-guest__name"},e),i.createElement(lt,{className:"npv-guest__avatar",src:t}))}function dt(e){var t;return i.createElement(p,{visible:null!==(t=e.contextMetadataVisible)&&void 0!==t&&t,disableAnimationsAndTransitions:e.disableAnimationsAndTransitions},i.createElement("div",{className:`npv-header npv-header--${e.mediaType}`},i.createElement(ct,{className:"npv-header__logo"}),i.createElement("div",{className:"npv-header__metadata placeholder"},e.l10n.playingFromContextType&&i.createElement("div",{className:"npv-header__context-type"},e.l10n.playingFromContextType),i.createElement("div",{className:"npv-header__context-name"},e.contextName)),e.isGuestMode&&i.createElement(ut,{name:e.guestName,avatarImage:e.guestAvatarImage})))}function pt(e){return i.createElement("div",{className:`npv-what-is-playing ${e.className}`},i.createElement(dt,Object.assign({},e.headerProps)),i.createElement("div",{className:`npv-what-is-playing__metadata ${e.progressBarVisible&&"npv-what-is-playing__metadata--docked"} npv-what-is-playing__metadata--${e.mediaType}`},i.createElement(rt,Object.assign({},e)),i.createElement(at,Object.assign({},e))))}var ft,ht,mt=n(14162),gt=(n(19036),n(85335)),_t=n(17468);var vt="out-in",yt="in-out",Et=function(e,t,n){return function(){var i;e.props[t]&&(i=e.props)[t].apply(i,arguments),n()}},bt=((ft={})[vt]=function(e){var t=e.current,n=e.changeState;return i.cloneElement(t,{in:!1,onExited:Et(t,"onExited",(function(){n(gt.d0,null)}))})},ft[yt]=function(e){var t=e.current,n=e.changeState,o=e.children;return[t,i.cloneElement(o,{in:!0,onEntered:Et(o,"onEntered",(function(){n(gt.d0)}))})]},ft),St=((ht={})[vt]=function(e){var t=e.children,n=e.changeState;return i.cloneElement(t,{in:!0,onEntered:Et(t,"onEntered",(function(){n(gt.cn,i.cloneElement(t,{in:!0}))}))})},ht[yt]=function(e){var t=e.current,n=e.children,o=e.changeState;return[i.cloneElement(t,{in:!1,onExited:Et(t,"onExited",(function(){o(gt.cn,i.cloneElement(n,{in:!0}))}))}),i.cloneElement(n,{in:!0})]},ht),At=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),o=0;o{const t=e.lyricsProps?"lyrics":"what-is-playing",n=e.disableAnimationsAndTransitions?0:500;return i.createElement(Tt,null,i.createElement(d.Z,{key:t,classNames:"npv-main-container__visibility-transition",timeout:n},e.lyricsProps?i.createElement(ot,Object.assign({},e.lyricsProps,{className:"npv-main-container__lyrics"})):i.createElement(pt,Object.assign({},e.whatIsPlayingProps,{className:"npv-main-container__what-is-playing"}))))};function It(e){var t,n;n=e.locale,N(n||navigator.language);const r=function(e){var t,n,i;if(e.lyrics&&e.onLyricsReport)return{trackUri:null===(t=e.currentTrack)||void 0===t?void 0:t.uri,content:"success"===e.lyrics.status?ke(e.lyrics.content):void 0,status:e.lyrics.status,onLyricsReport:e.onLyricsReport,position:e.position,trackMetadataProps:Ce(e),backgroundColor:"error"!==e.lyrics.status?e.backgroundColor:"#7F7F7F",duration:(null===(n=e.currentTrack)||void 0===n?void 0:n.duration)||0,isPaused:e.playbackIsPaused||!1,disableAnimationsAndTransitions:null!==(i=e.disableAnimationsAndTransitions)&&void 0!==i&&i,fullScreen:!e.controlsVisible,lyricsContainerCustomClasses:e.lyricsContainerCustomClasses}}(e),a=void 0!==r,s="video"===(null===(t=e.currentTrack)||void 0===t?void 0:t.mediaType),c=function(e){var t;return"video"===(null===(t=e.currentTrack)||void 0===t?void 0:t.mediaType)?{backgroundColor:"#000",animated:!1}:{backgroundColor:e.backgroundColor,modifier:"gradient",animated:!0}}(e),l=function(e,t){const{backgroundImageUrl:n}=e;return{backgroundImageUrl:n,showBackgroundImage:!t&&!!e.backgroundImageUrl}}(e,a),u=function(e){var t,n,i,o,r,a,s;return{canRender:!!((null===(t=e.nextTrack)||void 0===t?void 0:t.coverArtImageUrl)&&(null===(n=e.nextTrack)||void 0===n?void 0:n.name)&&(null===(i=e.nextTrack)||void 0===i?void 0:i.creatorName)),coverArtImageUrl:null===(o=e.nextTrack)||void 0===o?void 0:o.coverArtImageUrl,metadata:`${null===(r=e.nextTrack)||void 0===r?void 0:r.name} • ${null===(a=e.nextTrack)||void 0===a?void 0:a.creatorName}`,l10n:{upNext:R("NOTIFICATION_UP_NEXT")},disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,duration:null===(s=e.currentTrack)||void 0===s?void 0:s.duration,portal:e.upNextNotificationPortal,onVisibilityChanged:e.onUpNextVisibilityChanged}}(e),d=function(e,t){var n,i,o,r,a;const s=(null===(n=e.currentTrack)||void 0===n?void 0:n.mediaType)||"audio";return{coverArtImageUrl:null===(i=e.currentTrack)||void 0===i?void 0:i.coverArtImageUrl,trackName:null===(o=e.currentTrack)||void 0===o?void 0:o.name,trackCreatorName:null===(r=e.currentTrack)||void 0===r?void 0:r.creatorName,trackUri:null===(a=e.currentTrack)||void 0===a?void 0:a.uri,headerProps:W(e,s),hasNoExpandedCover:Y(e,t),progressBarVisible:!!e.progressBarVisible,trackMetadataVisible:!!e.trackMetadataVisible,mediaType:s}}(e,a),p=function(e,t){var n;return{duration:null===(n=e.currentTrack)||void 0===n?void 0:n.duration,isPaused:e.playbackIsPaused,isBuffering:e.playbackIsBuffering,playbackSpeed:e.playbackSpeed,progressBarVisible:!!e.progressBarVisible&&!e.CustomPlaybackControls,disableAnimationsAndTransitions:!!e.disableAnimationsAndTransitions,mediaType:t}}(e,d.mediaType),h=function(e){return{position:e.position,timestamp:e.timestamp,isPaused:e.playbackIsPaused,isBuffering:e.playbackIsBuffering,playbackSpeed:e.playbackSpeed}}(e),m=function(e,t){return{contextMetadataVisible:!!e.contextMetadataVisible,isActive:!!e.controlsVisible,trackMetadataVisible:!!e.trackMetadataVisible,mediaType:t}}(e,d.mediaType),g=function(e,t){const n={};return t&&(n.backgroundColor=e.backgroundColor),n}(e,a),_=j(e);return i.createElement("div",{className:_},i.createElement(F,Object.assign({},h),i.createElement($,Object.assign({},c)),s?i.createElement(o,Object.assign({},m)):i.createElement(Q,Object.assign({},l)),i.createElement("div",{className:"npv-main-container",style:g},i.createElement(Ot,{disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,lyricsProps:r,whatIsPlayingProps:d}),i.createElement(U,Object.assign({},u)),i.createElement(f,Object.assign({},p)),i.createElement(Ie,Object.assign({},e))),i.createElement(P,Object.assign({},e))))}It.defaultProps={contextMetadataVisible:!0,controlsVisible:!0,trackMetadataVisible:!0,progressBarVisible:!0}},17835:(e,t,n)=>{"use strict";n.d(t,{K:()=>hn});var i=n(7474),o=n.n(i),r=n(31770);class a{constructor(e){this.cosmos=e}getStopPosition(){return this.stopPosition}setMediaDuration(e){this.mediaDuration!==e&&(this.mediaDuration=e,this.tryScheduleInterruption())}setTimeObservable(e){this.timeObservable!==e&&(this.timeObservable=e,this.tryScheduleInterruption())}registerInterruptorWhenReadyAtPosition(e){this.stopPosition!==e&&(this.stopPosition=e,this.tryScheduleInterruption())}unregister(){void 0!==this.interruptToken&&void 0!==this.timeObservable&&this.timeObservable.removePositionObserver(this.interruptToken),this.stopPosition=void 0,this.interruptToken=void 0}tryScheduleInterruption(){if(void 0===this.mediaDuration||this.mediaDuration<0||void 0===this.stopPosition||this.stopPosition<0||void 0===this.timeObservable)return;const e=this.stopPosition/this.mediaDuration;void 0!==this.interruptToken&&this.timeObservable.removePositionObserver(this.interruptToken),this.interruptToken=this.timeObservable.addObserverForMediaPositions([e],(()=>{this.cosmos.post("sp://videoplayer/v1/advance",{reason:"finished"}),this.unregister()}))}}n(46758),n(53321),n(2836),n(45205);const s="cc",c={languageTag:""};function l(e){const t=e.languageTag.split("-"),n=[];for(const e of t){if(1===e.length)break;n.push(e)}return n.join("-")}function u(e){return e.languageTag.split("-")[0]}var d=n(3857),p=(n(27082),n(3959)),f=n(9590),h=n.n(f);const m={encode:(e,t=h().Writer.create())=>(void 0!==e.session_id&&t.uint32(10).string(e.session_id),void 0!==e.feature_identifier&&t.uint32(18).string(e.feature_identifier),void 0!==e.media_url&&t.uint32(26).string(e.media_url),void 0!==e.ms_start_position&&t.uint32(32).int64(e.ms_start_position),void 0!==e.start_bitrate&&t.uint32(40).int32(e.start_bitrate),void 0!==e.ms_duration&&t.uint32(48).int64(e.ms_duration),void 0!==e.ms_start_time&&t.uint32(56).int64(e.ms_start_time),void 0!==e.ms_manifest_load_time&&t.uint32(64).int64(e.ms_manifest_load_time),void 0!==e.ms_encryption_load_time&&t.uint32(72).int64(e.ms_encryption_load_time),void 0!==e.ms_initial_buffering&&t.uint32(80).int64(e.ms_initial_buffering),void 0!==e.ms_buffering_seek&&t.uint32(88).int64(e.ms_buffering_seek),void 0!==e.ms_buffering_seek_longest&&t.uint32(96).int64(e.ms_buffering_seek_longest),void 0!==e.ms_buffering_stall&&t.uint32(104).int64(e.ms_buffering_stall),void 0!==e.ms_buffering_stall_longest&&t.uint32(112).int64(e.ms_buffering_stall_longest),void 0!==e.n_stalls&&t.uint32(120).int32(e.n_stalls),void 0!==e.n_seekback&&t.uint32(128).int32(e.n_seekback),void 0!==e.n_seekforward&&t.uint32(136).int32(e.n_seekforward),void 0!==e.ms_played&&t.uint32(144).int64(e.ms_played),void 0!==e.ms_played_background&&t.uint32(152).int64(e.ms_played_background),void 0!==e.ms_played_fullscreen&&t.uint32(160).int64(e.ms_played_fullscreen),void 0!==e.ms_played_subtitles&&t.uint32(168).int64(e.ms_played_subtitles),void 0!==e.connection_type_start&&t.uint32(178).string(e.connection_type_start),void 0!==e.connection_type_end&&t.uint32(186).string(e.connection_type_end),void 0!==e.kbps_average_bandwidth&&t.uint32(192).int32(e.kbps_average_bandwidth),void 0!==e.encryption_type&&t.uint32(202).string(e.encryption_type),void 0!==e.kbytes_played&&t.uint32(208).int64(e.kbytes_played),void 0!==e.kbytes_downloaded&&t.uint32(216).int64(e.kbytes_downloaded),void 0!==e.n_view_transitions&&t.uint32(224).int32(e.n_view_transitions),void 0!==e.n_dropped_frames&&t.uint32(232).int64(e.n_dropped_frames),void 0!==e.average_device_orientation&&t.uint32(245).float(e.average_device_orientation),void 0!==e.exit_reason&&t.uint32(250).string(e.exit_reason),void 0!==e.aspect_ratio&&t.uint32(261).float(e.aspect_ratio),void 0!==e.last_used_subtitle&&t.uint32(266).string(e.last_used_subtitle),void 0!==e.ms_played_nominal&&t.uint32(272).int64(e.ms_played_nominal),void 0!==e.is_royalty_media&&t.uint32(280).bool(e.is_royalty_media),void 0!==e.streaming_type&&t.uint32(290).string(e.streaming_type),void 0!==e.desktop_ui&&t.uint32(298).string(e.desktop_ui),void 0!==e.ms_played_external&&t.uint32(304).int64(e.ms_played_external),void 0!==e.ms_buffering_stutter&&t.uint32(312).int64(e.ms_buffering_stutter),void 0!==e.ms_buffering_stutter_longest&&t.uint32(320).int64(e.ms_buffering_stutter_longest),void 0!==e.n_stutters&&t.uint32(328).int32(e.n_stutters),void 0!==e.n_forced_rebuffer&&t.uint32(336).int32(e.n_forced_rebuffer),void 0!==e.ms_played_video_disabled&&t.uint32(344).int64(e.ms_played_video_disabled),void 0!==e.ms_buffering_forced&&t.uint32(352).int64(e.ms_buffering_forced),void 0!==e.ms_buffering_forced_longest&&t.uint32(360).int64(e.ms_buffering_forced_longest),void 0!==e.media_type&&t.uint32(370).string(e.media_type),void 0!==e.ms_played_internal&&t.uint32(376).int64(e.ms_played_internal),Object.entries(e.client_metadata||{}).forEach((([e,n])=>{g.encode({key:e,value:n},t.uint32(386).fork()).ldelim()})),Object.entries(e.ms_played_per_surface||{}).forEach((([e,n])=>{_.encode({key:e,value:n},t.uint32(394).fork()).ldelim()})),void 0!==e.kbytes_from_cache&&t.uint32(400).int64(e.kbytes_from_cache),void 0!==e.ms_perceived_time_to_first_frame&&t.uint32(408).int64(e.ms_perceived_time_to_first_frame),void 0!==e.did_attempt_to_play&&t.uint32(416).bool(e.did_attempt_to_play),t),decode(e,t){const n=e instanceof h().Reader?e:h().Reader.create(e);let i=void 0===t?n.len:n.pos+t;const o={session_id:"",feature_identifier:"",media_url:"",ms_start_position:0,start_bitrate:0,ms_duration:0,ms_start_time:0,ms_manifest_load_time:0,ms_encryption_load_time:0,ms_initial_buffering:0,ms_buffering_seek:0,ms_buffering_seek_longest:0,ms_buffering_stall:0,ms_buffering_stall_longest:0,n_stalls:0,n_seekback:0,n_seekforward:0,ms_played:0,ms_played_background:0,ms_played_fullscreen:0,ms_played_subtitles:0,connection_type_start:"",connection_type_end:"",kbps_average_bandwidth:0,encryption_type:"",kbytes_played:0,kbytes_downloaded:0,n_view_transitions:0,n_dropped_frames:0,average_device_orientation:0,exit_reason:"",aspect_ratio:0,last_used_subtitle:"",ms_played_nominal:0,is_royalty_media:!1,streaming_type:"",desktop_ui:"",ms_played_external:0,ms_buffering_stutter:0,ms_buffering_stutter_longest:0,n_stutters:0,n_forced_rebuffer:0,ms_played_video_disabled:0,ms_buffering_forced:0,ms_buffering_forced_longest:0,media_type:"",ms_played_internal:0,client_metadata:{},ms_played_per_surface:{},kbytes_from_cache:0,ms_perceived_time_to_first_frame:0,did_attempt_to_play:!1};for(;n.pos>>3){case 1:if(10!==e)break;o.session_id=n.string();continue;case 2:if(18!==e)break;o.feature_identifier=n.string();continue;case 3:if(26!==e)break;o.media_url=n.string();continue;case 4:if(32!==e)break;o.ms_start_position=v(n.int64());continue;case 5:if(40!==e)break;o.start_bitrate=n.int32();continue;case 6:if(48!==e)break;o.ms_duration=v(n.int64());continue;case 7:if(56!==e)break;o.ms_start_time=v(n.int64());continue;case 8:if(64!==e)break;o.ms_manifest_load_time=v(n.int64());continue;case 9:if(72!==e)break;o.ms_encryption_load_time=v(n.int64());continue;case 10:if(80!==e)break;o.ms_initial_buffering=v(n.int64());continue;case 11:if(88!==e)break;o.ms_buffering_seek=v(n.int64());continue;case 12:if(96!==e)break;o.ms_buffering_seek_longest=v(n.int64());continue;case 13:if(104!==e)break;o.ms_buffering_stall=v(n.int64());continue;case 14:if(112!==e)break;o.ms_buffering_stall_longest=v(n.int64());continue;case 15:if(120!==e)break;o.n_stalls=n.int32();continue;case 16:if(128!==e)break;o.n_seekback=n.int32();continue;case 17:if(136!==e)break;o.n_seekforward=n.int32();continue;case 18:if(144!==e)break;o.ms_played=v(n.int64());continue;case 19:if(152!==e)break;o.ms_played_background=v(n.int64());continue;case 20:if(160!==e)break;o.ms_played_fullscreen=v(n.int64());continue;case 21:if(168!==e)break;o.ms_played_subtitles=v(n.int64());continue;case 22:if(178!==e)break;o.connection_type_start=n.string();continue;case 23:if(186!==e)break;o.connection_type_end=n.string();continue;case 24:if(192!==e)break;o.kbps_average_bandwidth=n.int32();continue;case 25:if(202!==e)break;o.encryption_type=n.string();continue;case 26:if(208!==e)break;o.kbytes_played=v(n.int64());continue;case 27:if(216!==e)break;o.kbytes_downloaded=v(n.int64());continue;case 28:if(224!==e)break;o.n_view_transitions=n.int32();continue;case 29:if(232!==e)break;o.n_dropped_frames=v(n.int64());continue;case 30:if(245!==e)break;o.average_device_orientation=n.float();continue;case 31:if(250!==e)break;o.exit_reason=n.string();continue;case 32:if(261!==e)break;o.aspect_ratio=n.float();continue;case 33:if(266!==e)break;o.last_used_subtitle=n.string();continue;case 34:if(272!==e)break;o.ms_played_nominal=v(n.int64());continue;case 35:if(280!==e)break;o.is_royalty_media=n.bool();continue;case 36:if(290!==e)break;o.streaming_type=n.string();continue;case 37:if(298!==e)break;o.desktop_ui=n.string();continue;case 38:if(304!==e)break;o.ms_played_external=v(n.int64());continue;case 39:if(312!==e)break;o.ms_buffering_stutter=v(n.int64());continue;case 40:if(320!==e)break;o.ms_buffering_stutter_longest=v(n.int64());continue;case 41:if(328!==e)break;o.n_stutters=n.int32();continue;case 42:if(336!==e)break;o.n_forced_rebuffer=n.int32();continue;case 43:if(344!==e)break;o.ms_played_video_disabled=v(n.int64());continue;case 44:if(352!==e)break;o.ms_buffering_forced=v(n.int64());continue;case 45:if(360!==e)break;o.ms_buffering_forced_longest=v(n.int64());continue;case 46:if(370!==e)break;o.media_type=n.string();continue;case 47:if(376!==e)break;o.ms_played_internal=v(n.int64());continue;case 48:if(386!==e)break;const t=g.decode(n,n.uint32());void 0!==t.value&&(o.client_metadata[t.key]=t.value);continue;case 49:if(394!==e)break;const i=_.decode(n,n.uint32());void 0!==i.value&&(o.ms_played_per_surface[i.key]=i.value);continue;case 50:if(400!==e)break;o.kbytes_from_cache=v(n.int64());continue;case 51:if(408!==e)break;o.ms_perceived_time_to_first_frame=v(n.int64());continue;case 52:if(416!==e)break;o.did_attempt_to_play=n.bool();continue}if(4==(7&e)||0===e)break;n.skipType(7&e)}return o},create:e=>m.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,i,o,r,a,s,c,l,u,d,p,f,h,m,g,_,v,y,E,b,S,A,T,O,I,C,N,L,R,P,k,D,w,M,x,U,V,F,B,H,G,K,W,Y,j,z,J,q,X,Z,Q;const $={session_id:"",feature_identifier:"",media_url:"",ms_start_position:0,start_bitrate:0,ms_duration:0,ms_start_time:0,ms_manifest_load_time:0,ms_encryption_load_time:0,ms_initial_buffering:0,ms_buffering_seek:0,ms_buffering_seek_longest:0,ms_buffering_stall:0,ms_buffering_stall_longest:0,n_stalls:0,n_seekback:0,n_seekforward:0,ms_played:0,ms_played_background:0,ms_played_fullscreen:0,ms_played_subtitles:0,connection_type_start:"",connection_type_end:"",kbps_average_bandwidth:0,encryption_type:"",kbytes_played:0,kbytes_downloaded:0,n_view_transitions:0,n_dropped_frames:0,average_device_orientation:0,exit_reason:"",aspect_ratio:0,last_used_subtitle:"",ms_played_nominal:0,is_royalty_media:!1,streaming_type:"",desktop_ui:"",ms_played_external:0,ms_buffering_stutter:0,ms_buffering_stutter_longest:0,n_stutters:0,n_forced_rebuffer:0,ms_played_video_disabled:0,ms_buffering_forced:0,ms_buffering_forced_longest:0,media_type:"",ms_played_internal:0,client_metadata:{},ms_played_per_surface:{},kbytes_from_cache:0,ms_perceived_time_to_first_frame:0,did_attempt_to_play:!1};return $.session_id=null!==(t=e.session_id)&&void 0!==t?t:"",$.feature_identifier=null!==(n=e.feature_identifier)&&void 0!==n?n:"",$.media_url=null!==(i=e.media_url)&&void 0!==i?i:"",$.ms_start_position=null!==(o=e.ms_start_position)&&void 0!==o?o:0,$.start_bitrate=null!==(r=e.start_bitrate)&&void 0!==r?r:0,$.ms_duration=null!==(a=e.ms_duration)&&void 0!==a?a:0,$.ms_start_time=null!==(s=e.ms_start_time)&&void 0!==s?s:0,$.ms_manifest_load_time=null!==(c=e.ms_manifest_load_time)&&void 0!==c?c:0,$.ms_encryption_load_time=null!==(l=e.ms_encryption_load_time)&&void 0!==l?l:0,$.ms_initial_buffering=null!==(u=e.ms_initial_buffering)&&void 0!==u?u:0,$.ms_buffering_seek=null!==(d=e.ms_buffering_seek)&&void 0!==d?d:0,$.ms_buffering_seek_longest=null!==(p=e.ms_buffering_seek_longest)&&void 0!==p?p:0,$.ms_buffering_stall=null!==(f=e.ms_buffering_stall)&&void 0!==f?f:0,$.ms_buffering_stall_longest=null!==(h=e.ms_buffering_stall_longest)&&void 0!==h?h:0,$.n_stalls=null!==(m=e.n_stalls)&&void 0!==m?m:0,$.n_seekback=null!==(g=e.n_seekback)&&void 0!==g?g:0,$.n_seekforward=null!==(_=e.n_seekforward)&&void 0!==_?_:0,$.ms_played=null!==(v=e.ms_played)&&void 0!==v?v:0,$.ms_played_background=null!==(y=e.ms_played_background)&&void 0!==y?y:0,$.ms_played_fullscreen=null!==(E=e.ms_played_fullscreen)&&void 0!==E?E:0,$.ms_played_subtitles=null!==(b=e.ms_played_subtitles)&&void 0!==b?b:0,$.connection_type_start=null!==(S=e.connection_type_start)&&void 0!==S?S:"",$.connection_type_end=null!==(A=e.connection_type_end)&&void 0!==A?A:"",$.kbps_average_bandwidth=null!==(T=e.kbps_average_bandwidth)&&void 0!==T?T:0,$.encryption_type=null!==(O=e.encryption_type)&&void 0!==O?O:"",$.kbytes_played=null!==(I=e.kbytes_played)&&void 0!==I?I:0,$.kbytes_downloaded=null!==(C=e.kbytes_downloaded)&&void 0!==C?C:0,$.n_view_transitions=null!==(N=e.n_view_transitions)&&void 0!==N?N:0,$.n_dropped_frames=null!==(L=e.n_dropped_frames)&&void 0!==L?L:0,$.average_device_orientation=null!==(R=e.average_device_orientation)&&void 0!==R?R:0,$.exit_reason=null!==(P=e.exit_reason)&&void 0!==P?P:"",$.aspect_ratio=null!==(k=e.aspect_ratio)&&void 0!==k?k:0,$.last_used_subtitle=null!==(D=e.last_used_subtitle)&&void 0!==D?D:"",$.ms_played_nominal=null!==(w=e.ms_played_nominal)&&void 0!==w?w:0,$.is_royalty_media=null!==(M=e.is_royalty_media)&&void 0!==M&&M,$.streaming_type=null!==(x=e.streaming_type)&&void 0!==x?x:"",$.desktop_ui=null!==(U=e.desktop_ui)&&void 0!==U?U:"",$.ms_played_external=null!==(V=e.ms_played_external)&&void 0!==V?V:0,$.ms_buffering_stutter=null!==(F=e.ms_buffering_stutter)&&void 0!==F?F:0,$.ms_buffering_stutter_longest=null!==(B=e.ms_buffering_stutter_longest)&&void 0!==B?B:0,$.n_stutters=null!==(H=e.n_stutters)&&void 0!==H?H:0,$.n_forced_rebuffer=null!==(G=e.n_forced_rebuffer)&&void 0!==G?G:0,$.ms_played_video_disabled=null!==(K=e.ms_played_video_disabled)&&void 0!==K?K:0,$.ms_buffering_forced=null!==(W=e.ms_buffering_forced)&&void 0!==W?W:0,$.ms_buffering_forced_longest=null!==(Y=e.ms_buffering_forced_longest)&&void 0!==Y?Y:0,$.media_type=null!==(j=e.media_type)&&void 0!==j?j:"",$.ms_played_internal=null!==(z=e.ms_played_internal)&&void 0!==z?z:0,$.client_metadata=Object.entries(null!==(J=e.client_metadata)&&void 0!==J?J:{}).reduce(((e,[t,n])=>(void 0!==n&&(e[t]=globalThis.String(n)),e)),{}),$.ms_played_per_surface=Object.entries(null!==(q=e.ms_played_per_surface)&&void 0!==q?q:{}).reduce(((e,[t,n])=>(void 0!==n&&(e[t]=globalThis.Number(n)),e)),{}),$.kbytes_from_cache=null!==(X=e.kbytes_from_cache)&&void 0!==X?X:0,$.ms_perceived_time_to_first_frame=null!==(Z=e.ms_perceived_time_to_first_frame)&&void 0!==Z?Z:0,$.did_attempt_to_play=null!==(Q=e.did_attempt_to_play)&&void 0!==Q&&Q,$}};const g={encode:(e,t=h().Writer.create())=>(void 0!==e.key&&t.uint32(10).string(e.key),void 0!==e.value&&t.uint32(18).string(e.value),t),decode(e,t){const n=e instanceof h().Reader?e:h().Reader.create(e);let i=void 0===t?n.len:n.pos+t;const o={key:"",value:""};for(;n.pos>>3){case 1:if(10!==e)break;o.key=n.string();continue;case 2:if(18!==e)break;o.value=n.string();continue}if(4==(7&e)||0===e)break;n.skipType(7&e)}return o},create:e=>g.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const i={key:"",value:""};return i.key=null!==(t=e.key)&&void 0!==t?t:"",i.value=null!==(n=e.value)&&void 0!==n?n:"",i}};const _={encode:(e,t=h().Writer.create())=>(void 0!==e.key&&t.uint32(10).string(e.key),void 0!==e.value&&t.uint32(16).int64(e.value),t),decode(e,t){const n=e instanceof h().Reader?e:h().Reader.create(e);let i=void 0===t?n.len:n.pos+t;const o={key:"",value:0};for(;n.pos>>3){case 1:if(10!==e)break;o.key=n.string();continue;case 2:if(16!==e)break;o.value=v(n.int64());continue}if(4==(7&e)||0===e)break;n.skipType(7&e)}return o},create:e=>_.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const i={key:"",value:0};return i.key=null!==(t=e.key)&&void 0!==t?t:"",i.value=null!==(n=e.value)&&void 0!==n?n:0,i}};function v(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}h().util.Long!==p.Z&&(h().util.Long=p.Z,h().configure());var y=n(83677);var E=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const b="playback_id",S="reason_start",A="feature_identifier",T="desktop_ui",O="referrer_version",I="feature_version",C="gaia_dev_id",N="view_uri",L="play_context",R="file_id",P="referrer",k="shuffle",D="play_track",w="provider",M="command_initiated_time_ms",x="client_offline",U=[b,S,A,I,O,R,C,N,L,P,k,D,w,M,x],V="endvideo_";function F(e){var t,n,i,o,r,a,s,c,l,u,p,f,h;const m=null!==(i=null===(n=null===(t=null==e?void 0:e.track)||void 0===t?void 0:t.track)||void 0===n?void 0:n.metadata)&&void 0!==i?i:{},g=function(e){var t,n,i,o,r,a,s,c,l,u,d,p,f,h,m,g,_,v,y,E,T,F,B,G,K,W,Y,j,z,J,q,X,Z,Q,$;const ee=null!==(n=null===(t=null==e?void 0:e.track)||void 0===t?void 0:t.playback_id)&&void 0!==n?n:"",te=null!==(a=null===(r=null===(o=null===(i=null==e?void 0:e.track)||void 0===i?void 0:i.track)||void 0===o?void 0:o.metadata)||void 0===r?void 0:r["media.manifest_id"])&&void 0!==a?a:"",ne=null!==(l=null===(c=null===(s=null==e?void 0:e.track)||void 0===s?void 0:s.play_origin)||void 0===c?void 0:c.feature_identifier)&&void 0!==l?l:"",ie=null!==(p=null===(d=null===(u=null==e?void 0:e.track)||void 0===u?void 0:u.play_origin)||void 0===d?void 0:d.feature_version)&&void 0!==p?p:"",oe=null!==(m=null===(h=null===(f=null==e?void 0:e.track)||void 0===f?void 0:f.play_origin)||void 0===h?void 0:h.view_uri)&&void 0!==m?m:"",re=null!==(v=null===(_=null===(g=null==e?void 0:e.track)||void 0===g?void 0:g.play_origin)||void 0===_?void 0:_.referrer_identifier)&&void 0!==v?v:"",ae=null!==(T=null===(E=null===(y=null==e?void 0:e.track)||void 0===y?void 0:y.play_origin)||void 0===E?void 0:E.device_identifier)&&void 0!==T?T:"",se=null!==(B=null===(F=null==e?void 0:e.player_options_override)||void 0===F?void 0:F.shuffling_context)&&void 0!==B&&B,ce=null!==(W=null===(K=null===(G=null==e?void 0:e.track)||void 0===G?void 0:G.track)||void 0===K?void 0:K.provider)&&void 0!==W?W:"",le=null!==(Y=null==e?void 0:e.start_reason)&&void 0!==Y?Y:"unknown",ue=null!==(z=null===(j=null==e?void 0:e.track)||void 0===j?void 0:j.context_uri)&&void 0!==z?z:"",de=null!==(X=null===(q=null===(J=null==e?void 0:e.track)||void 0===J?void 0:J.track)||void 0===q?void 0:q.uri)&&void 0!==X?X:"",pe=null!==(Q=null===(Z=null==e?void 0:e.logging_params)||void 0===Z?void 0:Z.command_initiated_time)&&void 0!==Q?Q:-1,fe=null!==($=null==e?void 0:e.client_offline)&&void 0!==$&&$,he={[b]:ee,[A]:ne,[O]:ie,[I]:ie,[N]:oe,[P]:re,[C]:ae,[w]:ce,[S]:le,[L]:ue,[k]:se?"true":"false",[D]:de,[M]:pe,[R]:te,[x]:fe?"true":"false"},me=H(U);return me(V)(he)}(e),_=null===(a=null===(r=null===(o=null==e?void 0:e.track)||void 0===o?void 0:o.track)||void 0===r?void 0:r.metadata)||void 0===a?void 0:a.interaction_id;_&&(m[d.I.INTERACTION_ID]=_);const v=null===(l=null===(c=null===(s=null==e?void 0:e.track)||void 0===s?void 0:s.track)||void 0===c?void 0:c.metadata)||void 0===l?void 0:l.page_instance_id;v&&(m[d.I.PAGE_INSTANCE_ID]=v);const y=null===(f=null===(p=null===(u=null==e?void 0:e.track)||void 0===u?void 0:u.track)||void 0===p?void 0:p.metadata)||void 0===f?void 0:f.feature_uuid;return y&&(m[d.I.FEATURE_UUID]=y),m.feature_identifier=function(e){const t="context-player",n=B(e);return n?`${t}-${n}`:t}(e),m.playback_id=e.track.playback_id,m[S]=null!==(h=null==e?void 0:e.start_reason)&&void 0!==h?h:"unknown",Object.assign(Object.assign({},m),g)}const B=e=>{if("mixed"===e.track.track.metadata["media.type"])return"vodcast";const t="video"===e.track.track.metadata["media.type"],n=e.track.track.uri.split(":"),i=n.length>=2&&"spotify"===n[0]&&n[1]?n[1]:void 0;return t&&"track"===i?"music-video":i};const H=e=>t=>n=>Object.entries(n).reduce(((n,[i,o])=>{const r=e.includes(i)?`${t}${i}`:i;return Object.assign(Object.assign({},n),{[r]:o})}),{});function G(e){const t=e["video.subtitles"],n=e["video.subtitles_cc"];return""===t?c:function(e,t){return e?{languageTag:t?`${e}-x-${s}`:e}:c}(t,n)}function K(e){return e["audio.episode.speed"]}const W=(e,t)=>{function n(t){return E(this,void 0,void 0,(function*(){const n=yield e();return yield n.send(t)}))}return{playbackSessionPendingLogger:(()=>{const e=new Map,n=e=>({protoName:"BetamaxPlaybackSession",protoData:m.encode(m.fromPartial(e)).finish()}),i=t=>{var n,i;const o=t?e.get(t):void 0;return{tokenEventName:null!==(n=null==o?void 0:o.tokenEventName)&&void 0!==n?n:"",tokenSequenceNo:null!==(i=null==o?void 0:o.tokenSequenceNo)&&void 0!==i?i:-1}};return{hasCreatedMessage:t=>!!t&&e.has(t),addPendingEvent:i=>E(void 0,void 0,void 0,(function*(){const o=yield t.addPendingEvent(n(i));return o.success&&i.session_id&&e.set(i.session_id,{tokenEventName:o.tokenEventName,tokenSequenceNo:o.tokenSequenceNo}),o})),replacePendingEvent:e=>t.replacePendingEvent(Object.assign(Object.assign({},n(e)),i(e.session_id))),commitPendingEvent:n=>{const o=t.commitPendingEvent(i(n));return n&&e.delete(n),o}}})(),playbackSessionLogger:{log:e=>n({name:"BetamaxPlaybackSession",environments:["device","desktop"],data:e})},playbackErrorLogger:{log:e=>n((0,y.c)(e))},downloadSessionLogger:{log:e=>n({name:"BetamaxDownloadSession",environments:["device","desktop"],data:e})},downloadErrorLogger:{log:e=>n({name:"BetamaxDownloadError",environments:["device","desktop"],data:e})}}};var Y=n(10783),j=n(12960);class z{constructor(e,t){this.productStateService=e,this.scrobbleService=t,this.rules="",this.productStateService.subValues(j.vH.fromPartial({}),(e=>{e.pairs["streaming-rules"]&&(this.rules=e.pairs["streaming-rules"])})),this.scrobbleService.subIncognitoMode(Y.IS.fromPartial({}),(e=>{this.incognito=e.incognitoMode}))}streamingRules(){return this.rules}}var J=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class q{constructor(e,t){this.mainPlayer=e,this.adPlayer=t}get muted(){return this.mainPlayer.muted}get volume(){return this.mainPlayer.volume}get started(){return this.mainPlayer.started}get ended(){return this.mainPlayer.ended}playerByPlaybackId(e){var t,n,i,o,r;return(null===(n=null===(t=this.mainPlayer.getPlaybackRequest())||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.playback_id)===e?this.mainPlayer:(null===(r=null===(o=null===(i=this.adPlayer)||void 0===i?void 0:i.getPlaybackRequest())||void 0===o?void 0:o.metadata)||void 0===r?void 0:r.playback_id)===e?this.adPlayer:void 0}getNonMatchingPlayerByPlaybackId(e){var t,n,i,o,r;return(null===(n=null===(t=this.mainPlayer.getPlaybackRequest())||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.playback_id)===e?this.adPlayer:(null===(r=null===(o=null===(i=this.adPlayer)||void 0===i?void 0:i.getPlaybackRequest())||void 0===o?void 0:o.metadata)||void 0===r?void 0:r.playback_id)===e?this.mainPlayer:void 0}hasPlaybackId(e){return!!this.playerByPlaybackId(e)}switchPlayer(e){return J(this,void 0,void 0,(function*(){const t=this.playerByPlaybackId(e);if(!t)return;t.attemptInsertVideoElement(),t.showNode();const n=this.getNonMatchingPlayerByPlaybackId(e);null==n||n.hideNode(),n===this.adPlayer&&(yield null==n?void 0:n.stop())}))}getPlaybackRequest(){return this.mainPlayer.getPlaybackRequest()}play(e,t){var n,i,o,r,a;return J(this,void 0,void 0,(function*(){return this.adPlayer?this.isAd(e)?(null===(n=this.mainPlayer)||void 0===n||n.pause(),null===(i=this.mainPlayer)||void 0===i||i.hideNode(),null===(o=this.adPlayer)||void 0===o||o.showNode(),this.adPlayer.play(e,t)):(yield null===(r=this.adPlayer)||void 0===r?void 0:r.stop(),null===(a=this.mainPlayer)||void 0===a||a.showNode(),this.mainPlayer.play(e,t)):this.mainPlayer.play(e,t)}))}resume(e){var t;return null===(t=this.playerByPlaybackId(e))||void 0===t?void 0:t.resume()}pause(e){var t;return null===(t=this.playerByPlaybackId(e))||void 0===t?void 0:t.pause()}setPreferredSubtitle(e){var t;return null===(t=this.adPlayer)||void 0===t||t.setPreferredSubtitle(e),this.mainPlayer.setPreferredSubtitle(e)}setPlaybackSpeed(e){var t;null===(t=this.adPlayer)||void 0===t||t.setPlaybackSpeed(e),this.mainPlayer.setPlaybackSpeed(e)}seekTo(e,t){var n;return null===(n=this.playerByPlaybackId(e))||void 0===n?void 0:n.seekTo(t)}setVolume(e){var t;return null===(t=this.adPlayer)||void 0===t||t.setVolume(e),this.mainPlayer.setVolume(e)}setMinimizeBitrate(e){this.mainPlayer.setMinimizeBitrate(e)}setWindow(e){this.mainPlayer.setWindow(e)}setFullscreen(e){var t;null===(t=this.adPlayer)||void 0===t||t.setFullscreen(e),this.mainPlayer.setFullscreen(e)}setPip(e){return J(this,void 0,void 0,(function*(){return this.mainPlayer.setPip(e)}))}setSurface(e){this.mainPlayer.setSurface(e)}getNode(){return this.mainPlayer.getNode()}stop(e){var t;return J(this,void 0,void 0,(function*(){yield null===(t=this.playerByPlaybackId(e))||void 0===t?void 0:t.stop()}))}stopAll(){var e;return J(this,void 0,void 0,(function*(){yield Promise.all([this.mainPlayer.stop(),null===(e=this.adPlayer)||void 0===e?void 0:e.stop()])}))}getSessionState(e){var t,n;return null!==(n=null===(t=e?this.playerByPlaybackId(e):this.mainPlayer)||void 0===t?void 0:t.getSessionState())&&void 0!==n?n:null}isAd(e){var t;return"true"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.is_advertisement)}}var X=n(86106);class Z{constructor(){this.sessionEvents=[]}onBuffering(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.BUFFERING})}onEncryptionKeyLoaded(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.ENCRYPTION_KEY_LOADED})}onDurationChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.DURATION_CHANGED})}onManifestLoaded(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.MANIFEST_LOADED})}onPlaybackError(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.ERROR})}onPlaybackCreated(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.CREATED})}onEndingPlayback(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.NEW_SESSION_LOADED})}onPlaybackEnded(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.ENDED})}onMediaMetadataChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.MEDIA_METADATA_CHANGED})}onReady(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.READY})}onStarted(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.STARTED})}onResumed(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.RESUMED})}onPaused(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.PAUSED})}onSeeking(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.SEEKING})}onSeeked(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.SEEKED})}onAudioFormatChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.AUDIO_FORMAT_CHANGED})}onVideoFormatChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.VIDEO_FORMAT_CHANGED})}onVolumeChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.VOLUME_CHANGED})}onManifestLoading(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:X.N8.MANIFEST_LOADING})}onEncryptionKeyLoading(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:X.N8.ENCRYPTION_KEY_LOADING})}onBytesTransferred(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.BYTES_TRANSFERRED})}onSubtitleChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.SUBTITLE_CHANGED})}onFullscreenChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.FULLSCREEN_CHANGED})}onSurfaceChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.SURFACE_CHANGED})}onMinimizeBitrateChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.MINIMIZE_BITRATE_CHANGED})}onPlaybackSpeedChanged(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.PLAYBACK_SPEED_CHANGED})}onDroppedVideoFrames(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:X.N8.DROPPED_FRAMES})}onResumeRequested(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:X.N8.RESUME_REQUESTED})}}const Q=-1,$=e=>Number.isFinite(e);function ee(e){return Object.entries(e).filter((([e])=>e.includes(V))).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t.replace(V,"")]:n})),{})}const te=e=>t=>t.type===e,ne=te(X.N8.STARTED),ie=te(X.N8.RESUMED),oe=te(X.N8.ENDED),re=te(X.N8.BUFFERING),ae=te(X.N8.DROPPED_FRAMES),se=te(X.N8.NEW_SESSION_LOADED),ce=te(X.N8.PAUSED),le=te(X.N8.CREATED),ue=te(X.N8.READY),de=te(X.N8.DURATION_CHANGED),pe=te(X.N8.AUDIO_FORMAT_CHANGED),fe=te(X.N8.VIDEO_FORMAT_CHANGED),he=te(X.N8.ENCRYPTION_KEY_LOADED),me=te(X.N8.SUBTITLE_CHANGED),ge=te(X.N8.MANIFEST_LOADED),_e=te(X.N8.MANIFEST_LOADING),ve=te(X.N8.SEEKING),ye=(te(X.N8.SEEKED),te(X.N8.PLAYBACK_SPEED_CHANGED)),Ee=te(X.N8.FULLSCREEN_CHANGED),be=te(X.N8.SURFACE_CHANGED),Se=te(X.N8.MINIMIZE_BITRATE_CHANGED),Ae=te(X.N8.BYTES_TRANSFERRED),Te=te(X.N8.ENCRYPTION_KEY_LOADING),Oe=te(X.N8.MEDIA_METADATA_CHANGED),Ie=te(X.N8.RESUME_REQUESTED),Ce=e=>(e=>{var t;return null!==(t=e[S])&&void 0!==t?t:""})(ee(e)),Ne=e=>t=>(ne(t)||ie(t))&&!e,Le=e=>t=>ve(t)&&e,Re=e=>t=>oe(t)&&e,Pe=e=>t=>(ve(t)||ce(t)||oe(t))&&e,ke=(e,t)=>{var n;return ne(e)||ie(e)?void 0===(null===(n=e.data)||void 0===n?void 0:n.position)?Object.assign(Object.assign({},t),{playing:!0}):Object.assign(Object.assign({},t),{playing:!0,playingPosition:e.data.position}):t};function De(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return 0;const n=t-e;return!Number.isFinite(n)||n<0?0:Math.round(1e3*n)}function we(e,t,n){const i=Math.round(n.timestamp-e.bufferingStart),o=Object.assign({},t);if($(i)&&i>0)switch(e.bufferingType){case X.w0.SEEK:o[d.k.MS_BUFFERING_SEEK]+=i,i>o[d.k.MS_BUFFERING_SEEK_LONGEST]&&(o[d.k.MS_BUFFERING_SEEK_LONGEST]=i);break;case X.w0.STALL:o[d.k.MS_BUFFERING_STALL]+=i,i>o[d.k.MS_BUFFERING_STALL_LONGEST]&&(o[d.k.MS_BUFFERING_STALL_LONGEST]=i);break;case X.w0.INITIAL:o[d.k.MS_INITIAL_BUFFERING]+=i}return o}const Me=(e,t,n)=>n>0?Math.round(De(t,xe(e))/n):0;function xe(e){if(e.data){const t=e.data.position;if($(t))return t;if(ve(e)&&$(e.data.fromPosition))return e.data.fromPosition}return 1/0}const Ue=(e,t)=>ye(e)?Object.assign(Object.assign({},t),{playbackSpeed:e.data.speed}):t,Ve=(e,t)=>{var n;return me(e)?Object.assign(Object.assign({},t),{subtitlesEnabled:!!(null===(n=e.data)||void 0===n?void 0:n.subtitle.languageTag)}):t},Fe=(e,t)=>Ee(e)?Object.assign(Object.assign({},t),{fullscreen:e.data.fullscreen}):t,Be=(e,t)=>be(e)?Object.assign(Object.assign({},t),{surfaceChanged:!0}):t,He=(e,t)=>Se(e)?Object.assign(Object.assign({},t),{minimizeBitrate:e.data.minimizeBitrate}):t,Ge=(e,t)=>le(e)?Object.assign(Object.assign({},t),{minimizeBitrate:e.data.initialConfiguration.minimizeBitrate}):t,Ke=(e,t)=>le(e)?Object.assign(Object.assign({},t),{fullscreen:e.data.initialConfiguration.fullscreen}):t,We=(e,t)=>le(e)?Object.assign(Object.assign({},t),{surface:e.data.initialConfiguration.surface}):t,Ye=(e,t)=>le(e)?Object.assign(Object.assign({},t),{playbackSpeed:e.data.initialConfiguration.playbackSpeed}):t,je=(e,t)=>{const n=Object.assign({},t),i=(e=>{const t=e.playing&&e.subtitlesEnabled,n=void 0!==e.playingWithSubtitlesPosition;return t&&!n?"started":!t&&n?"finished":t?"on":"off"})(n);return"started"===i&&(n.playingWithSubtitlesPosition=xe(e)),"finished"===i&&void 0!==n.playingWithSubtitlesPosition&&(n.msPlayedSubtitles+=Me(e,n.playingWithSubtitlesPosition,n.playbackSpeed),n.playingWithSubtitlesPosition=void 0),n},ze=(e,t)=>{const n=Object.assign({},t),i=(e=>{const t=e.playing&&e.fullscreen,n=void 0!==e.playingWhileFullscreenPosition;return t&&!n?"started":!t&&n?"finished":t?"on":"off"})(n);return"started"===i&&(n.playingWhileFullscreenPosition=xe(e)),"finished"===i&&void 0!==n.playingWhileFullscreenPosition&&(n.msPlayedFullscreen+=Me(e,n.playingWhileFullscreenPosition,n.playbackSpeed),n.playingWhileFullscreenPosition=void 0),n},Je=(e,t)=>{var n,i,o,r,a,s;const c=Object.assign({},t),l=(e=>{if(e.surfaceChanged)return"changed";const t=e.playing&&e.surface,n=void 0!==e.playingInSurfacePosition;return t&&!n?"started":!t&&n?"finished":t?"on":"off"})(c);return"started"===l&&(c.playingInSurfacePosition=xe(e)),"finished"===l&&void 0!==c.playingInSurfacePosition&&c.surface&&(null!==(n=(o=c.msPlayedPerSurface)[r=c.surface])&&void 0!==n||(o[r]=0),c.msPlayedPerSurface[c.surface]+=Me(e,c.playingInSurfacePosition,c.playbackSpeed),c.playingInSurfacePosition=void 0),"changed"===l&&be(e)&&(c.surface&&void 0!==c.playingInSurfacePosition&&(null!==(i=(a=c.msPlayedPerSurface)[s=c.surface])&&void 0!==i||(a[s]=0),c.msPlayedPerSurface[c.surface]+=Me(e,c.playingInSurfacePosition,c.playbackSpeed)),c.surface=e.data.surface,c.surfaceChanged=!1,c.playing&&(c.playingInSurfacePosition=xe(e))),c},qe=(e,t)=>{const n=Object.assign({},t),i=(e=>{const t=e.playing&&e.minimizeBitrate,n=void 0!==e.playingWithMinimizeBitratePosition;return t&&!n?"started":!t&&n?"finished":t?"on":"off"})(n);return"started"===i&&(n.playingWithMinimizeBitratePosition=xe(e)),"finished"===i&&void 0!==n.playingWithMinimizeBitratePosition&&(n.msPlayedDisabled+=Me(e,n.playingWithMinimizeBitratePosition,n.playbackSpeed),n.playingWithMinimizeBitratePosition=void 0),n},Xe=(e,t)=>{const n=De(t.playingPosition,xe(e)),i=Me(e,t.playingPosition,t.playbackSpeed);return Object.assign(Object.assign({},t),{msNominalPlayed:n+t.msNominalPlayed,msPlayed:i+t.msPlayed,playing:!1,playingPosition:0})},Ze=(e,t)=>{t[d.k.SESSION_ID]=e.data.playbackIdentity.sessionId,t[d.k.MEDIA_URL]=e.data.playbackIdentity.mediaUrl},Qe=(e,t)=>{t[d.k.MS_START_POSITION]=Math.round(1e3*e.data.position)},$e=(e,t)=>{t[d.k.MEDIA_TYPE]=e.data.mediaType,t[d.k.STREAMING_TYPE]=e.data.streamingType},et=(e,t)=>{t[d.k.MS_DURATION]=Math.round(1e3*e.data.duration)},tt=(e,t)=>le(e)?Object.assign(Object.assign({},t),{didAttemptToPlay:e.data.initialConfiguration.playWhenReady}):Ie(e)?Object.assign(Object.assign({},t),{didAttemptToPlay:!0}):t;const nt=(e,t)=>{t[d.k.N_DROPPED_FRAMES]=e.data.droppedFrames},it=(e,t)=>{t[d.k.EXIT_REASON]=e.data.reason},ot=(e,t)=>{t[d.k.ASPECT_RATIO]=e.data.format.width&&e.data.format.height?e.data.format.width/e.data.format.height:t[d.k.ASPECT_RATIO],t[d.k.START_BITRATE]=e.data.format.totalBitrate&&!t[d.k.START_BITRATE]?e.data.format.totalBitrate:t[d.k.START_BITRATE]};const rt=(e,t)=>{t[d.k.ENCRYPTION_TYPE]=e.data.encryptionType},at=(e,t)=>{t[d.k.LAST_USED_SUBTITLE]=e.data.subtitle.languageTag||t[d.k.LAST_USED_SUBTITLE]};const st=(e,t)=>{var n,i;e.data.fromPosition>e.data.toPosition?t[d.k.N_SEEKBACK]=(null!==(n=t[d.k.N_SEEKBACK])&&void 0!==n?n:0)+1:e.data.fromPosition<=e.data.toPosition&&(t[d.k.N_SEEKFORWARD]=(null!==(i=t[d.k.N_SEEKFORWARD])&&void 0!==i?i:0)+1)};const ct=()=>({playing:!1,subtitlesEnabled:!1,playingWithSubtitlesPosition:void 0,msPlayedSubtitles:0,msPlayed:0,msNominalPlayed:0,msPlayedRangeStartTime:0,playingPosition:0,fullscreen:!1,playingWhileFullscreenPosition:void 0,msPlayedFullscreen:0,minimizeBitrate:!1,playingWithMinimizeBitratePosition:void 0,msPlayedDisabled:0,playedRanges:[],unionPlayed:0,maxContinous:0,playbackSpeed:1,surfaceChanged:!1,msPlayedPerSurface:{},didAttemptToPlay:!1});function lt(e){let t=ct(),n={[d.k.ASPECT_RATIO]:0,[d.k.START_BITRATE]:0,[d.k.N_SEEKBACK]:0,[d.k.N_SEEKFORWARD]:0,[d.k.N_DROPPED_FRAMES]:0,[d.k.EXIT_REASON]:"",[d.k.ENCRYPTION_TYPE]:"",[d.k.LAST_USED_SUBTITLE]:"",[d.k.SESSION_ID]:"",[d.k.MEDIA_URL]:"",[d.k.MEDIA_TYPE]:"unknown",[d.k.STREAMING_TYPE]:"unknown",[d.k.MS_DURATION]:Q,[d.k.MS_START_POSITION]:Q,[d.k.MS_MANIFEST_LOAD_TIME]:Q,[d.k.MS_ENCRYPTION_LOAD_TIME]:Q},i=Q,o=Q,r=Q,a=Q,s=0,c=0;const l={buffering:!1,bufferingType:"",bufferingStart:0};let u={[d.k.N_STALLS]:0,[d.k.MS_BUFFERING_SEEK]:0,[d.k.MS_BUFFERING_SEEK_LONGEST]:0,[d.k.MS_BUFFERING_STALL]:0,[d.k.MS_INITIAL_BUFFERING]:0,[d.k.MS_BUFFERING_STALL_LONGEST]:0};return n=e.reduce(((e,n)=>(le(n)?(i===Q&&(i=n.monotonicTimestamp),t=Ye(n,t),t=Ke(n,t),t=Ge(n,t),t=We(n,t),Ze(n,e)):ue(n)?(o===Q&&(o=n.monotonicTimestamp),Qe(n,e)):Oe(n)?$e(n,e):ye(n)?t=Ue(n,t):me(n)?(t=Ve(n,t),at(n,e)):Ee(n)?t=Fe(n,t):Se(n)?t=He(n,t):be(n)?t=Be(n,t):Ae(n)?(s+=n.data.bytes,c+=n.data.timeMs):de(n)?et(n,e):fe(n)?ot(n,e):ae(n)?nt(n,e):he(n)?(rt(n,e),function(e,t,n){if(t!==Q){const i=n[d.k.MS_ENCRYPTION_LOAD_TIME],o=$(i)&&i!==Q?i:0;n[d.k.MS_ENCRYPTION_LOAD_TIME]=o+Math.round(e.monotonicTimestamp-t)}}(n,a,e),a=Q):Te(n)&&o===Q?a=n.monotonicTimestamp:ge(n)?(!function(e,t,n){if(t!==Q){const i=n[d.k.MS_MANIFEST_LOAD_TIME],o=$(i)&&i!==Q?i:0;n[d.k.MS_MANIFEST_LOAD_TIME]=o+Math.round(e.monotonicTimestamp-t)}}(n,r,e),r=Q):_e(n)?r=n.monotonicTimestamp:ve(n)?st(n,e):oe(n)&&it(n,e),Ne(t.playing)(n)?t=ke(n,t):Pe(t.playing)(n)&&(t=Xe(n,t)),t=je(n,t),t=ze(n,t),t=qe(n,t),t=Je(n,t),e[d.k.MS_PLAYED]=t.msPlayed,e[d.k.MS_PLAYED_NOMINAL]=t.msNominalPlayed,e[d.k.MS_PLAYED_SUBTITLES]=t.msPlayedSubtitles,e[d.k.MS_PLAYED_FULLSCREEN]=t.msPlayedFullscreen,e[d.k.MS_PLAYED_VIDEO_DISABLED]=t.msPlayedDisabled,e[d.k.MS_PLAYED_PER_SURFACE]=t.msPlayedPerSurface,t=tt(n,t),e[d.k.DID_ATTEMPT_TO_PLAY]=t.didAttemptToPlay,u=function(e,t,n){return re(e)&&(e.data.type===X.w0.STALL&&n[d.k.N_STALLS]++,t.buffering&&(n=we(t,n,e)),t.buffering=!0,t.bufferingType=e.data.type,t.bufferingStart=e.timestamp),(ue(e)||oe(e))&&t.buffering&&(n=we(t,n,e),t.buffering=!1,t.bufferingType="",t.bufferingStart=0),n}(n,l,u),e)),n),n=function(e,t,n){const i=t?e/(t/1e3):0;return n[d.k.KBYTES_DOWNLOADED]=Math.ceil(e/1e3),n[d.k.KBPS_AVERAGE_BANDWIDTH]=Math.ceil(.008*i),n}(s,c,n),n=function(e,t,n){if(e===Q||t===Q)return n[d.k.MS_START_TIME]=Q,n;let i=Math.round(t-e);return i=i>=0?i:Q,n[d.k.MS_START_TIME]=i,n}(i,o,n),Object.assign(Object.assign({},n),u)}const ut=()=>{var e;if(navigator.onLine){const t=null===(e=navigator.connection)||void 0===e?void 0:e.effectiveType;return t?`${t}-like`:"online"}return"none"};var dt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class pt extends Z{constructor(e,t){if(super(),this.loggers=e,this.playbackMetadataKeys=t,this.startConnectionType="unknown",this.endConnectionType="unknown",this.loggers.usePendingLogger){if(!this.loggers.pendingLogger)throw new Error("Pending logger not provided in PlaybackSessionLogger")}else if(!this.loggers.logger)throw new Error("Logger not provided in PlaybackSessionLogger")}onPlaybackCreated(e,t,n){const i=Object.create(null,{onPlaybackCreated:{get:()=>super.onPlaybackCreated}});return dt(this,void 0,void 0,(function*(){i.onPlaybackCreated.call(this,e,t,n),this.startConnectionType=ut(),this.playbackIdentity=e.playbackIdentity,this.sessionId=e.playbackIdentity.sessionId,yield this.addSessionMessage(),this.loggers.usePendingLogger&&(this.timeObservable=e.timeObservable,this.periodicObserverToken=e.timeObservable.addObserverForPeriodicEvents(15,(e=>this.replaceSessionMessage(e,t,n))))}))}onStarted(e,t,n){const i=Object.create(null,{onStarted:{get:()=>super.onStarted}});return dt(this,void 0,void 0,(function*(){i.onStarted.call(this,e,t,n),yield this.replaceSessionMessage(e.position,t,n)}))}onReady(e,t,n){const i=Object.create(null,{onReady:{get:()=>super.onReady}});return dt(this,void 0,void 0,(function*(){i.onReady.call(this,e,t,n),yield this.replaceSessionMessage(e.position,t,n)}))}onPaused(e,t,n){const i=Object.create(null,{onPaused:{get:()=>super.onPaused}});return dt(this,void 0,void 0,(function*(){i.onPaused.call(this,e,t,n),yield this.replaceSessionMessage(e.position,t,n)}))}onResumed(e,t,n){const i=Object.create(null,{onResumed:{get:()=>super.onResumed}});return dt(this,void 0,void 0,(function*(){i.onResumed.call(this,e,t,n),yield this.replaceSessionMessage(e.position,t,n)}))}onPlaybackEnded(e,t,n){const i=Object.create(null,{onPlaybackEnded:{get:()=>super.onPlaybackEnded}});return dt(this,void 0,void 0,(function*(){i.onPlaybackEnded.call(this,e,t,n),this.endConnectionType=ut(),this.playbackStats=e.playbackStats,this.timeObservable&&this.periodicObserverToken&&this.timeObservable.removePeriodicObserver(this.periodicObserverToken),yield this.commitSessionMessage()}))}addSessionMessage(){return dt(this,void 0,void 0,(function*(){if(!this.loggers.usePendingLogger||!this.loggers.pendingLogger)return;if(this.loggers.pendingLogger.hasCreatedMessage(this.sessionId))return void this.sendLoggingError("trying to add a new session message when a message has already been created.");const e=yield this.loggers.pendingLogger.addPendingEvent(this.generatePlaybackSessionMessage());if(e.success)return e;this.sendLoggingError("addSessionMessage",e.error)}))}replaceSessionMessage(e,t,n){return dt(this,void 0,void 0,(function*(){if(!this.loggers.usePendingLogger||!this.loggers.pendingLogger)return;if(!this.loggers.pendingLogger.hasCreatedMessage(this.sessionId))return void this.sendLoggingError("trying to update a session message before creating it.");const i=yield this.loggers.pendingLogger.replacePendingEvent(this.generatePlaybackSessionMessage(this.createSyntheticEndEvent(e,t,n)));if(i.success)return i;this.sendLoggingError("replaceSessionMessage",i.error)}))}commitSessionMessage(){var e;return dt(this,void 0,void 0,(function*(){if(!this.loggers.usePendingLogger)return void(yield null===(e=this.loggers.logger)||void 0===e?void 0:e.log(this.generatePlaybackSessionMessage()));if(!this.loggers.pendingLogger)return;if(!this.loggers.pendingLogger.hasCreatedMessage(this.sessionId))return void this.sendLoggingError("trying to commit a session message before creating it.");const t=yield this.loggers.pendingLogger.replacePendingEvent(this.generatePlaybackSessionMessage());if(!t.success)return void this.sendLoggingError("replacePendingEvent in commitSessionMessage",t.error);const n=yield this.loggers.pendingLogger.commitPendingEvent(this.sessionId);if(n.success)return n;this.sendLoggingError("commitPendingEvent in commitSessionMessage",n.error)}))}logClientMetadata(e){var t;if(void 0===this.playbackMetadataKeys)return;const n={};for(const[i,o]of Object.entries(null!==(t=null==e?void 0:e.metadata)&&void 0!==t?t:{}))this.playbackMetadataKeys.includes(i)&&(n[i]=o);return Object.entries(n).length>0?n:void 0}generatePlaybackSessionMessage(e){var t,n,i,o,r,a,s,c;const l=e?[...this.sessionEvents,e]:this.sessionEvents;return Object.assign(Object.assign({},lt(l)),{connection_type_start:this.startConnectionType,connection_type_end:this.endConnectionType,feature_identifier:null!==(i=null===(n=null===(t=this.playbackIdentity)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n[A])&&void 0!==i?i:"",desktop_ui:null!==(a=null===(r=null===(o=this.playbackIdentity)||void 0===o?void 0:o.metadata)||void 0===r?void 0:r[T])&&void 0!==a?a:"",ms_played_internal:void 0!==(null===(s=this.playbackStats)||void 0===s?void 0:s.playTime)?Math.round(this.playbackStats.playTime):void 0,is_royalty_media:null===(c=this.playbackIdentity)||void 0===c?void 0:c.isRoyaltyMedia,client_metadata:this.logClientMetadata(this.playbackIdentity)})}sendLoggingError(e,t){var n,i,o,r,a,s,c;null===(n=this.loggers.errorLogger)||void 0===n||n.log({feature_identifier:null===(o=null===(i=this.playbackIdentity)||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.feature_identifier,media_url:null===(r=this.playbackIdentity)||void 0===r?void 0:r.mediaUrl,session_id:null===(a=this.playbackIdentity)||void 0===a?void 0:a.sessionId,error_domain:"PlaybackSessionLogger",error_code:t,error_description:e,error_extra1:JSON.stringify({severity:"recoverable"}),desktop_ui:null===(c=null===(s=this.playbackIdentity)||void 0===s?void 0:s.metadata)||void 0===c?void 0:c[T]})}createSyntheticEndEvent(e,t,n){return{timestamp:t,monotonicTimestamp:n,type:X.N8.ENDED,data:{reason:X.n0.UNEXPECTED_EXIT,position:e}}}}var ft=n(94811),ht=n(72275);class mt{constructor(e){this.logger=e,this.buffering=!1,this.minimizeBitrate=!1,this.bitrate=-1,this.playbackCreated=!1}onPlaybackCreated({playbackIdentity:e,initialConfiguration:t}){var n;this.playbackIdentity=e,this.playbackSpeed=t.playbackSpeed,this.minimizeBitrate=null!==(n=t.minimizeBitrate)&&void 0!==n&&n,this.playbackCreated=!0}onPlaybackError({error:e,position:t}){this.logErrorMessage(e,t)}onPlaybackSpeedChanged({speed:e}){this.playbackSpeed=e}onBuffering(){this.buffering=!0}onReady(){this.buffering=!1}onMinimizeBitrateChanged({minimizeBitrate:e}){this.minimizeBitrate=e}onVideoFormatChanged({format:{totalBitrate:e}}){this.bitrate=e}logErrorMessage(e,t){var n,i,o,r,a,s,c;this.logger.log({error_domain:e.category,error_code:e.code,error_description:null===(n=e.internalDetails)||void 0===n?void 0:n.toString(),error_extra1:JSON.stringify(Object.assign({severity:e.severity,reason:0===e.code?"unknown":(0,ht.zq)(e.code).toLowerCase(),sdkVersion:ft.lB,internalPlayerVersion:ft.Tc},e.sessionContext)),error_extra2:JSON.stringify(e.clientContext),session_id:null===(i=this.playbackIdentity)||void 0===i?void 0:i.sessionId,media_url:null===(o=this.playbackIdentity)||void 0===o?void 0:o.mediaUrl,feature_identifier:null===(a=null===(r=this.playbackIdentity)||void 0===r?void 0:r.metadata)||void 0===a?void 0:a[A],desktop_ui:null===(c=null===(s=this.playbackIdentity)||void 0===s?void 0:s.metadata)||void 0===c?void 0:c[T],ms_position:this.playbackCreated?1e3*t:-1,buffering:this.buffering,video_disabled:this.minimizeBitrate,playback_speed:this.playbackSpeed,bitrate:this.bitrate,backgrounded:void 0})}}class gt{constructor(e){this.logger=e}onDownloadEvent(e){switch(e.name){case"created":{const{mediaUri:t}=e;this.ongoingDownload={mediaUri:t,startTime:(new Date).getTime(),connectionTypeStart:ut()};break}case"completed":{const{offlineAsset:t}=e;this.log(t,"completed"),this.ongoingDownload=void 0;break}case"error":{const{partialAsset:t}=e;this.log(t,"error"),this.ongoingDownload=void 0;break}case"cancelled":{const{partialAsset:t}=e;this.log(t,"cancelled"),this.ongoingDownload=void 0;break}}}log(e,t){var n,i,o,r;const a=Math.round((null!==(n=e.size)&&void 0!==n?n:0)/1e3),s=(null===(i=this.ongoingDownload)||void 0===i?void 0:i.startTime)?(new Date).getTime()-(null===(o=this.ongoingDownload)||void 0===o?void 0:o.startTime):0,c=null===(r=this.ongoingDownload)||void 0===r?void 0:r.connectionTypeStart,l=ut(),u={feature_identifier:"offline-coordinator",media_url:e.originalUrl,session_id:e.downloadSessionId,kbytes_downloaded:a,ms_download_time:s,reason_end:t,bitrate:0,connection_type_start:c,connection_type_end:l};this.logger.log(u)}}class _t{constructor(e){this.logger=e}onDownloadEvent(e){if("error"===e.name){const{partialAsset:t,error:n}=e;this.log(t,n)}}log(e,t){var n,i,o,r,a,s;const c={feature_identifier:"offline-coordinator",media_url:e.originalUrl,session_id:null!==(n=e.downloadSessionId)&&void 0!==n?n:"",error_description:null!==(i=t.reason)&&void 0!==i?i:"",error_code:null!==(o=t.code)&&void 0!==o?o:0,error_domain:null!==(r=t.category)&&void 0!==r?r:"",error_extra1:null!==(a=t.error_extra1)&&void 0!==a?a:"",error_extra2:null!==(s=t.error_extra2)&&void 0!==s?s:""};this.logger.log(c)}}var vt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function yt(e){return vt(this,void 0,void 0,(function*(){const t=yield function(e,t,n={headers:new Headers}){return vt(this,void 0,void 0,(function*(){const{accessToken:i,tokenType:o}=yield e(),r=`${o} ${i}`;return n.headers.append("Authorization",r),fetch(t,n)}))}(e,"https://spclient.wg.spotify.com/widevine-license/v1/application-certificate");if(t.ok){const e=yield t.arrayBuffer();return new Uint8Array(e)}throw new Error("Network response was not ok.")}))}var Et;!function(e){e.END_APPLOAD="appload",e.END_UNKNOWN="unknown",e.END_TRACK_DONE="trackdone",e.END_TRACK_ERROR="trackerror",e.END_PLAY="endplay",e.END_UNEXPECTED_EXIT="unexpected-exit",e.END_UNEXPECTED_EXIT_WHILE_PAUSED="unexpected-exit-while-paused"}(Et||(Et={}));var bt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);ot.to?-1:e.to{const o=parseFloat(n)*i/t;return Math.round(e+o)}),0)}const Ot=(e,t)=>{const n=Object.assign({},t);if(n.playing&&void 0!==n.bitrates[n.activeBitrate]){const t=De(n.playingTimestamp/1e3,e.timestamp/1e3);n.bitrates[n.activeBitrate]+=t,n.totalTimePlayedInKnownBitrate+=t,n.timeWeightedBitrate=Tt(n.bitrates,n.totalTimePlayedInKnownBitrate)}return n.playing=!1,n.playingTimestamp=0,n},It=(e,t)=>{const n=Object.assign({},t),{timestamp:i}=e;let{data:{format:{totalBitrate:o}}}=e;if(o=null!=o?o:0,n.bitrates[o]||(n.bitrates[o]=0),n.playing&&-1===n.activeBitrate)n.playingTimestamp=i;else if(n.playing&&o!==n.activeBitrate){const e=De(n.playingTimestamp/1e3,i/1e3);n.bitrates[n.activeBitrate]+=e,n.totalTimePlayedInKnownBitrate+=e,n.playingTimestamp=i,n.timeWeightedBitrate=Tt(n.bitrates,n.totalTimePlayedInKnownBitrate)}return n.playing||n.bitrates[o]||(n.bitrates[o]=0),n.activeBitrate=o,n},Ct=(e,t)=>Object.assign(Object.assign({},t),{playing:!0,playingTimestamp:e.timestamp}),Nt=(e,t)=>{if(e.type!==X.N8.SEEKING)return t;const n=e;return Object.assign(Object.assign({},t),{playingPosition:n.data.toPosition,playing:!1,playedRanges:[...t.playedRanges,{from:t.playingPosition,to:n.data.fromPosition}]})},Lt=(e,t)=>{if(e.type!==X.N8.SEEKING)return t;const n=e,i=1e3*(n.data.fromPosition-t.playingPosition),o=Math.round(Math.max(t.maxContinous,i));return Object.assign(Object.assign({},t),{playing:!1,playingPosition:n.data.toPosition,maxContinous:o})},Rt=(e,t)=>{if(e.type!==X.N8.ENDED)return t;const n=1e3*(e.data.position-t.playingPosition),i=Math.round(Math.max(t.maxContinous,n));return Object.assign(Object.assign({},t),{playing:!1,playingPosition:0,maxContinous:i})},Pt=(e,t)=>{if(e.type!==X.N8.ENDED)return t;const n=e,i=[...t.playedRanges,{from:t.playingPosition,to:n.data.position}],o=Math.round(1e3*(r=i).sort(At).reduce(((e,t,n)=>{if(0===e.length)return e.push(t),e;const i=r[n-1];return i.to===t.from||i.tot.from?(e[n-1]={from:i.from,to:t.to},e):i.toe+t.to-t.from),0));var r;return Object.assign(Object.assign({},t),{playedRanges:i,playing:!1,playingPosition:0,unionPlayed:o})};function kt(e){let t=Et.END_UNEXPECTED_EXIT;const n=ct();for(const i of e)Ne(n.playing)(i)||Re(n.playing)(i)?(n.playing=!0,t=Et.END_UNEXPECTED_EXIT):Pe(n.playing)(i)&&(n.playing=!1,t=Et.END_UNEXPECTED_EXIT_WHILE_PAUSED);const i=function(e){return e.filter(se).reduce(((e,{data:t})=>({startReason:t.playbackRequest.metadata?Ce(t.playbackRequest.metadata):""})),{startReason:""})}(e);return e.filter(oe).reduce(((e,{data:n})=>({[d.I.REASON_END]:i.startReason||St(n.reason,t)})),{[d.I.REASON_END]:""})}function Dt(e){return e[d.k.MS_PLAYED]-e[d.k.MS_PLAYED_VIDEO_DISABLED]}function wt(e,t){t||(t=lt(e));const n=Object.assign(Object.assign({},t),{[d.I.MS_PLAYED_BACKGROUND]:0,[d.I.FULL_SCREEN]:0,[d.I.PREFETCHED_BYTES]:0,[d.I.PREFETCHED_BYTES_LOADED]:-1,[d.I.REFERRER_VENDOR]:"com.spotify",[d.I.SHUFFLE]:!1,[d.I.LIVE]:!1,[d.I.SEQUENCE_NUMBER]:-1,[d.I.SEQUENCE_ID]:"",[d.I.CONNECTION_TYPE_START]:"",[d.I.CONNECTION_TYPE_END]:"",[d.I.STREAMING_RULE]:"",[d.I.INCOGNITO_MODE]:!1,[d.I.INTERACTION_ID]:void 0,[d.I.FEATURE_UUID]:void 0,[d.I.PAGE_INSTANCE_ID]:void 0,[d.I.MS_PLAYED_VIDEO]:Dt(t),[d.I.MS_NOMINAL_PLAYED]:t[d.k.MS_PLAYED_NOMINAL],[d.I.N_SEEKFWD]:t[d.k.N_SEEKFORWARD],[d.I.VIDEO_SESSION_ID]:t[d.k.SESSION_ID],[d.I.MS_TOTAL_EST]:t[d.k.MS_DURATION],[d.I.MS_MANIFEST_LATENCY]:t[d.k.MS_MANIFEST_LOAD_TIME],[d.I.START_OFFSET_MS]:t[d.k.MS_START_POSITION],[d.I.MS_SEEK_REBUFFERING]:t[d.k.MS_BUFFERING_SEEK],[d.I.MAX_MS_SEEK_REBUFFERING]:t[d.k.MS_BUFFERING_SEEK_LONGEST],[d.I.MS_STALLED]:t[d.k.MS_BUFFERING_STALL],[d.I.MAX_MS_STALLED]:t[d.k.MS_BUFFERING_STALL_LONGEST],[d.I.KEY_SYSTEM]:t[d.k.ENCRYPTION_TYPE],[d.I.MS_KEY_LATENCY]:t[d.k.MS_ENCRYPTION_LOAD_TIME],[d.I.MS_LATENCY]:t[d.k.MS_START_TIME],[d.I.TOTAL_BYTES]:Math.round(1e3*t[d.k.KBYTES_DOWNLOADED])});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),function(e){return e.filter(ve).reduce(((e,{data:t})=>t.fromPosition>t.toPosition?Object.assign(Object.assign({},e),{[d.I.MS_SEEKBACK]:Math.round(e[d.I.MS_SEEKBACK]+1e3*(t.fromPosition-t.toPosition))}):t.fromPosition<=t.toPosition?Object.assign(Object.assign({},e),{[d.I.MS_SEEKFWD]:Math.round(e[d.I.MS_SEEKFWD]+1e3*(t.toPosition-t.fromPosition))}):e),{[d.I.MS_SEEKBACK]:0,[d.I.MS_SEEKFWD]:0})}(e)),function(e){const t=e.filter(le).reduce(((e,{data:t})=>ee(t.playbackIdentity.metadata||{})),{}),n=k,i=t[n],o=bt(t,["symbol"==typeof n?n:n+""]),r=Object.assign({},o);return void 0!==i&&(r[d.I.SHUFFLE]="true"===i),r}(e)),function(e){var t,n;let i,o;for(const r of e)if(le(r)&&(i=null!==(n=ee(null!==(t=r.data.playbackIdentity.metadata)&&void 0!==t?t:{})[M])&&void 0!==n?n:void 0),ue(r)){void 0!==i&&i>0&&(o=Math.round(r.timestamp-i));break}return null!=o||(o=Q),{[d.I.UI_LATENCY]:o}}(e)),kt(e)),function(e){let t=ct();for(const n of e)!0===Ne(t.playing)(n)?t=ke(n,t):!0===Le(t.playing)(n)?t=Nt(n,t):!0===Re(t.playing)(n)&&(t=Pt(n,t));return{[d.I.UNION_PLAYED]:t.unionPlayed}}(e)),function(e){let t=ct();for(const n of e)!0===Ne(t.playing)(n)?t=ke(n,t):!0===Le(t.playing)(n)?t=Lt(n,t):Re(t.playing)(n)&&(t=Rt(n,t));return{[d.I.MAX_CONTINOUS]:t.maxContinous}}(e)),function(e){let t={activeBitrate:-1,currentPlayingBitrate:0,playing:!1,playingTimestamp:0,bitrates:{},totalTimePlayedInKnownBitrate:0,timeWeightedBitrate:0};for(const n of e)fe(n)?t=It(n,t):!0===Ne(t.playing)(n)?t=Ct(n,t):!0===Pe(t.playing)(n)&&(t=Ot(n,t));return{[d.I.TIME_WEIGHTED_BITRATE]:t.timeWeightedBitrate}}(e)),function(e){return e.filter(le).reduce(((e,{timestamp:t})=>({[d.I.LOCAL_TIME_MS]:Math.round(t)})),{[d.I.LOCAL_TIME_MS]:0})}(e)),function(e){return e.filter(pe).reduce(((e,{data:t})=>({[d.I.AUDIOCODEC]:t.format.audioCodec})),{[d.I.AUDIOCODEC]:""})}(e)),function(e){return e.filter(fe).reduce(((e,{data:t})=>({[d.I.VIDEOCODEC]:t.format.videoCodec})),{[d.I.VIDEOCODEC]:""})}(e))}var Mt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class xt extends Z{constructor(e,t,n){super(),this.endVideo=e,this.productStateProvider=t,this.logError=n,this.startConnectionType="unknown",this.endConnectionType="unknown",this.streamingRules=this.productStateProvider.streamingRules()}onPlaybackCreated(e,t,n){const i=Object.create(null,{onPlaybackCreated:{get:()=>super.onPlaybackCreated}});var o,r,a,s;return Mt(this,void 0,void 0,(function*(){i.onPlaybackCreated.call(this,e,t,n),this.incognito=this.productStateProvider.incognito||!1,this.interaction_id=null===(o=e.playbackIdentity.metadata)||void 0===o?void 0:o[d.I.INTERACTION_ID],this.page_instance_id=null===(r=e.playbackIdentity.metadata)||void 0===r?void 0:r[d.I.PAGE_INSTANCE_ID],this.feature_uuid=null===(a=e.playbackIdentity.metadata)||void 0===a?void 0:a[d.I.FEATURE_UUID],this.streamingRules=(null===(s=e.playbackIdentity.metadata)||void 0===s?void 0:s.endvideo_streaming_rule_override)||this.streamingRules,this.startConnectionType=ut();!(e.playbackIdentity.metadata&&e.playbackIdentity.metadata[V+S]===Et.END_APPLOAD)&&(yield this.updatePendingEndVideo(e.initialConfiguration.position,t,n)),this.timeObservable=e.timeObservable,this.periodicObserverToken=e.timeObservable.addObserverForPeriodicEvents(15,(e=>this.updatePendingEndVideo(e,t,n)))}))}onReady(e,t,n){const i=Object.create(null,{onReady:{get:()=>super.onReady}});return Mt(this,void 0,void 0,(function*(){i.onReady.call(this,e,t,n),yield this.updatePendingEndVideo(e.position,t,n)}))}onPaused(e,t,n){const i=Object.create(null,{onPaused:{get:()=>super.onPaused}});return Mt(this,void 0,void 0,(function*(){i.onPaused.call(this,e,t,n),yield this.updatePendingEndVideo(e.position,t,n)}))}onStarted(e,t,n){const i=Object.create(null,{onStarted:{get:()=>super.onStarted}});return Mt(this,void 0,void 0,(function*(){i.onStarted.call(this,e,t,n),yield this.updatePendingEndVideo(e.position,t,n)}))}onResumed(e,t,n){const i=Object.create(null,{onResumed:{get:()=>super.onResumed}});return Mt(this,void 0,void 0,(function*(){i.onResumed.call(this,e,t,n),yield this.updatePendingEndVideo(e.position,t,n)}))}onPlaybackEnded(e,t,n){const i=Object.create(null,{onPlaybackEnded:{get:()=>super.onPlaybackEnded}});return Mt(this,void 0,void 0,(function*(){i.onPlaybackEnded.call(this,e,t,n),this.endConnectionType=ut(),yield this.createAndUpdateMessage(this.sessionEvents),this.timeObservable&&this.periodicObserverToken&&this.timeObservable.removePeriodicObserver(this.periodicObserverToken),this.sequenceNumber&&this.endVideo.send(this.sequenceNumber)}))}createEndVideo(){return new Promise(((e,t)=>{this.endVideo.create(((n,i,o)=>{n&&(this.sequenceNumber=void 0,this.sequenceId=void 0,t(n)),this.sequenceNumber=i,this.sequenceId=o,e({sequenceNumber:i,sequenceId:o})}))}))}updateEndVideo(e){return new Promise(((t,n)=>{this.endVideo.update(this.sequenceNumber,e,(i=>{i&&(this.logError&&this.logError("logEndVideo, failed update:",i),n(i)),t(e)}))}))}endVideoFields(){return{[d.I.SEQUENCE_NUMBER]:this.sequenceNumber,[d.I.SEQUENCE_ID]:this.sequenceId,[d.I.CONNECTION_TYPE_START]:this.startConnectionType,[d.I.CONNECTION_TYPE_END]:this.endConnectionType,[d.I.STREAMING_RULE]:this.streamingRules,[d.I.INCOGNITO_MODE]:this.incognito,[d.I.INTERACTION_ID]:this.interaction_id,[d.I.PAGE_INSTANCE_ID]:this.page_instance_id,[d.I.FEATURE_UUID]:this.feature_uuid}}shouldLogEndVideo(e,t){return!(!e.did_attempt_to_play&&0===t[d.I.MS_PLAYED])&&!(t[d.I.REASON_START]===Et.END_APPLOAD&&t[d.I.MS_PLAYED]<100)}createAndUpdateMessage(e){return Mt(this,void 0,void 0,(function*(){const t=lt(e),n=wt(e,t);if(!this.shouldLogEndVideo(t,n))return;this.sequenceNumber||(yield this.createEndVideo());const i=Object.assign(Object.assign({},n),this.endVideoFields());yield this.updateEndVideo(i)}))}updatePendingEndVideo(e,t,n){return Mt(this,void 0,void 0,(function*(){const i={timestamp:t,monotonicTimestamp:n,type:X.N8.ENDED,data:{reason:X.n0.SHUTDOWN,position:e}};yield this.createAndUpdateMessage([...this.sessionEvents,i])}))}}n(86277);var Ut=n(30771);class Vt{constructor(e){this.factories=e,this.observers=[]}initiateObservers(e,t){this.observers=this.factories.map((n=>n(e,t))).filter((e=>!!e))}removeObservers(){this.observers=[]}onPlaybackCreated(e){(0,Ut.Y)("betamax::on_playback_created"),this.observers.forEach((t=>{var n;return null===(n=t.onPlaybackCreated)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())})),(0,Ut.Y)("betamax::on_playback_created_end")}onPlaybackEnded(e){this.observers.forEach((t=>{var n;return null===(n=t.onPlaybackEnded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())})),this.removeObservers()}onEndingPlayback(e){this.observers.forEach((t=>{var n;return null===(n=t.onEndingPlayback)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onVolumeChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onVolumeChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onStarted(e){this.observers.forEach((t=>{var n;return null===(n=t.onStarted)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onResumed(e){this.observers.forEach((t=>{var n;return null===(n=t.onResumed)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onSeeking(e){this.observers.forEach((t=>{var n;return null===(n=t.onSeeking)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onSeeked(e){this.observers.forEach((t=>{var n;return null===(n=t.onSeeked)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onPaused(e){this.observers.forEach((t=>{var n;return null===(n=t.onPaused)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onReady(e){(0,Ut.Y)("betamax::on_ready"),this.observers.forEach((t=>{var n;return null===(n=t.onReady)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onMediaMetadataChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onMediaMetadataChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onManifestLoaded(e){this.observers.forEach((t=>{var n;return null===(n=t.onManifestLoaded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onManifestLoading(){(0,Ut.Y)("betamax::onManifestLoading"),this.observers.forEach((e=>{var t;return null===(t=e.onManifestLoading)||void 0===t?void 0:t.call(e,Date.now(),performance.now())})),(0,Ut.Y)("betamax::onManifestLoading_end")}onPlaybackError(e){this.observers.forEach((t=>{var n;return null===(n=t.onPlaybackError)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onAudioFormatChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onAudioFormatChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onVideoFormatChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onVideoFormatChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onBuffering(e){this.observers.forEach((t=>{var n;return null===(n=t.onBuffering)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onDroppedVideoFrames(e){this.observers.forEach((t=>{var n;return null===(n=t.onDroppedVideoFrames)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onEncryptionKeyLoaded(e){this.observers.forEach((t=>{var n;return null===(n=t.onEncryptionKeyLoaded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onEncryptionKeyLoading(){this.observers.forEach((e=>{var t;return null===(t=e.onEncryptionKeyLoading)||void 0===t?void 0:t.call(e,Date.now(),performance.now())}))}onBytesTransferred(e){this.observers.forEach((t=>{var n;return null===(n=t.onBytesTransferred)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onDurationChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onDurationChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onSubtitleChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onSubtitleChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onFullscreenChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onFullscreenChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onPictureInPictureChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onPictureInPictureChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onSurfaceChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onSurfaceChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onMinimizeBitrateChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onMinimizeBitrateChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onPlaybackSpeedChanged(e){this.observers.forEach((t=>{var n;return null===(n=t.onPlaybackSpeedChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))}onResumeRequested(){this.observers.forEach((e=>{var t;return null===(t=e.onResumeRequested)||void 0===t?void 0:t.call(e,Date.now(),performance.now())}))}}n(39301),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);class Ft{constructor(){this.tokenCounter=1,this.positionObservers=[],this.absolutePositionObservers=[],this.periodicObservers=[]}initiateObservers(e){for(const t of this.periodicObservers)t.lastAbsoluteInterval=this.calculateAbsoluteInterval(t.intervalInSeconds,e)}handleTimeUpdate(e){this.processPeriodicObserverEvents(e),this.processPositionObserverEvents(e),this.processAbsolutePositionObserverEvents(e)}removePositionObserver(e){this.positionObservers=this.positionObservers.filter((t=>t.token!==e))}removeAbsolutePositionObserver(e){this.absolutePositionObservers=this.absolutePositionObservers.filter((t=>t.token!==e))}removePeriodicObserver(e){this.periodicObservers=this.periodicObservers.filter((t=>t.token!==e))}addObserverForMediaPositions(e,t){const n=this.nextToken();for(const i of e)this.positionObservers.push({callback:t,token:n,position:i});return n}addObserverForAbsoluteMediaPositions(e,t){const n=this.nextToken();for(const i of e)this.absolutePositionObservers.push({callback:t,token:n,position:i});return n}addObserverForPeriodicEvents(e,t){const n=this.nextToken();return this.periodicObservers.push({callback:t,intervalInSeconds:e,token:n}),n}nextToken(){return this.tokenCounter++,this.tokenCounter}getProgress(e){const t=e.target.currentTime,n=e.target.duration;return Math.min(Math.max(t/n,0),1)}processPositionObserverEvents(e){const t=this.getProgress(e);if(void 0!==this.lastProgress){for(const e of this.positionObservers){e.position>=this.lastProgress&&e.position=this.lastAbsoluteProgress&&e.position<=t&&(e.callback(t,e.position),this.removeAbsolutePositionObserverByReference(e))}this.lastAbsoluteProgress=t}else this.lastAbsoluteProgress=t}processPeriodicObserverEvents(e){for(const t of this.periodicObservers){const n=e.target.currentTime,i=this.calculateAbsoluteInterval(t.intervalInSeconds,n);i!==t.lastAbsoluteInterval&&(void 0!==t.lastAbsoluteInterval&&t.callback(n),t.lastAbsoluteInterval=i)}}removePositionObserverByReference(e){this.positionObservers=this.positionObservers.filter((t=>t!==e))}removeAbsolutePositionObserverByReference(e){this.absolutePositionObservers=this.absolutePositionObservers.filter((t=>t!==e))}calculateAbsoluteInterval(e,t){return Math.floor(t/e)}}var Bt=n(94758),Ht=n(15819),Gt=n(76155),Kt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Wt{constructor(e,t,n,i){var r,a;this.player=e,this.internalPlayer=t,this.videoElement=n,this.playbackSessionConfiguration=i,this.segmentsRetryCounter=0,this.subtitleUris=[],this.networkRequestFilter=(e,t)=>{e!==o().net.NetworkingEngine.RequestType.LICENSE&&e!==o().net.NetworkingEngine.RequestType.MANIFEST||"HEAD"!==t.method&&(this.latencyStartTimes[e]=Date.now(),e===o().net.NetworkingEngine.RequestType.MANIFEST&&this.internalObserver.onManifestLoading(),e===o().net.NetworkingEngine.RequestType.LICENSE&&this.internalObserver.onEncryptionKeyLoading())},this.networkResponseFilter=(e,t)=>{var n,i;if((null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.byteLength)&&t.timeMs){const n=t.uri.toString();if(this.internalObserver.onBytesTransferred({bytes:t.data.byteLength,timeMs:t.timeMs,uri:n,requestType:e}),e===o().net.NetworkingEngine.RequestType.SEGMENT){let e;try{e=new URL(n).hostname}catch(e){}e&&(null===(i=this.player.getMuxManager())||void 0===i||i.updateSession({video_cdn:e}))}}},this.handleEnded=()=>{(0,Ut.Y)("video::ended"),this.state.isEnded||this.emitEndedEvent(X.n0.PLAYED_TO_END,this.getCurrentPosition()),this.state.isEnded=!0,this.state.endReason=X.n0.PLAYED_TO_END,(0,Ut.Y)("video::ended_end")},this.handleDurationChange=()=>{var e;(0,Ut.Y)("video::durationchange");const t=this.videoElement.duration;if(-1===t&&(null===(e=this.playerConfiguration.experimental)||void 0===e?void 0:e.filterNegativeDuration))return;const n=this.getCurrentPosition();this.state.duration=t,this.state.progress=this.calculateProgress(n,t),this.internalObserver.onDurationChanged({duration:t}),(0,Ut.Y)("video::durationchange_end")},this.handleManifestParsed=()=>{(0,Ut.Y)("shaka::manifestParsed");const e=this.internalPlayer.getManifest();if(null===e)return;this.subtitleUris=(0,ht.SY)(e);const t=this.internalPlayer.getTextTracks().map((e=>({languageTag:e.language})));this.internalObserver.onManifestLoaded({availableSubtitles:t}),(0,Ut.Y)("shaka::manifestParsed_end")},this.handleRateChange=()=>{var e;const t=this.videoElement.playbackRate;t!==this.state.playbackSpeed&&0!==t&&(this.state.playbackSpeed=t,this.internalObserver.onPlaybackSpeedChanged({position:this.getCurrentPosition(),speed:t}),null===(e=this.player.getMuxManager())||void 0===e||e.updateSession({custom_1:t}))},this.handleTimeUpdate=e=>{if(!this.state.isLoaded||!this.state.isStarted||this.state.isEnded||this.state.isSeeking)return;const t=this.videoElement.currentTime||0;this.state.currentTime=this.videoElement.currentTime,this.state.progress=this.calculateProgress(t,this.videoElement.duration),this.playbackTimeObservable.handleTimeUpdate(e)},this.handleEnterPip=()=>{this.internalObserver.onPictureInPictureChanged({position:this.getCurrentPosition(),pictureInPicture:!0})},this.handleLeavePip=()=>{this.internalObserver.onPictureInPictureChanged({position:this.getCurrentPosition(),pictureInPicture:!1})},this.handleCanPlay=()=>{var e;if((0,Ut.Y)("video::canplay"),!this.state.hasInitiallyReadied){if((null===(e=this.playerConfiguration.experimental)||void 0===e?void 0:e.autoSeekToBufferedStartPositionOnLoad)&&this.isPositionOutsideBuffer())return void this.adjustPositionForBuffer();this.state.hasInitiallyReadied=!0,this.mediaType=this.internalPlayer.isAudioOnly()?"audio":"video",this.internalObserver.onMediaMetadataChanged({position:this.getCurrentPosition(),mediaType:this.mediaType,streamingType:this.streamingType})}this.internalObserver.onReady({position:this.getCurrentPosition(),playWhenReady:!this.state.isPaused,isPictureInPicture:this.player.isPictureInPicture()})},this.handlePlaying=()=>Kt(this,void 0,void 0,(function*(){if(this.state.isSeeking)return;(0,Ut.Y)("video::playing");const e=!this.state.isStarted;if(this.state=Object.assign(Object.assign({},this.state),{isPlaying:!0,isStarted:!0,isEnded:!1,isBuffering:!1}),e){if(this.internalObserver.onStarted({position:this.getCurrentPosition()}),!this.state.hasInitiallyReadied){const e={category:"unexpected-event-sequence",code:0,severity:"recoverable",internalDetails:["started-before-ready"]};yield this.handlePlaybackError(e,!1)}}else this.internalObserver.onResumed({position:this.getCurrentPosition()})})),this.handlePause=()=>{this.state.isPlaying=!1;const e=this.videoElement.currentTime;this.videoElement.duration&&e===this.videoElement.duration||this.internalObserver.onPaused({position:e})},this.handleVolumeChange=()=>{this.internalObserver.onVolumeChanged({position:this.getCurrentPosition(),volume:this.player.volume})},this.handleRequestRetry=e=>Kt(this,void 0,void 0,(function*(){if(null===e.error)return;const t=yield this.getPlaybackError(e.error),n=this.isFailedSegmentRequest(e);if(n){this.segmentsRetryCounter++;const n=this.internalPlayer.getConfiguration().manifest.retryParameters.maxAttempts;this.segmentsRetryCounter>=n?(this.state.unableToFetchLastSegments=!0,this.state.failedSegmentRetryError=e.error,this.state.bufferType!=X.w0.SEEK&&this.state.bufferType!=X.w0.STALL||(t.severity="fatal",yield this.handlePlaybackError(t,!1),yield this.stop(X.n0.FATAL_ERROR),this.state.unableToFetchLastSegments=!1)):yield this.handlePlaybackError(t)}const i=e.error.data,r=this.isSubtitleUri(i[0]);if(n&&(r||(e.error.severity=o().util.Error.Severity.CRITICAL)),!n){const t=yield this.getPlaybackError(e.error);yield this.handlePlaybackError(t)}n&&r&&this.removeSubtitle()})),this.handleShakaError=e=>Kt(this,void 0,void 0,(function*(){const t=yield this.getPlaybackError(e);yield this.handlePlaybackError(t)})),this.handlePlaybackError=(e,t=!0)=>Kt(this,void 0,void 0,(function*(){if(void 0!==e.clientContext&&void 0!==e.sessionContext||(e=yield this.hydrateErrorWithContext(e)),t&&(this.errorWillRecoverAutomatically(e)&&(e.severity="recoverable"),(this.errorMayRecoverOnReload(e)||"fatal"===e.severity&&this.state.attemptingErrorRecovery)&&(e.severity="unknown")),this.internalObserver.onPlaybackError({error:e,position:this.getCurrentPosition()}),"fatal"===e.severity){this.state.isError=!0;const t=(0,ht.tE)(e)?X.n0.NETWORK_ERROR:X.n0.FATAL_ERROR;this.state.isEnded||this.emitEndedEvent(t,this.getCurrentPosition()),this.state.isEnded=!0,this.state.endReason=t}})),this.handleAdaptation=e=>{var t,n,i,o;if(!this.internalPlayer)return;if("adaptation"!==e.type&&"variantchanged"!==e.type)return;const r=this.internalPlayer.getVariantTracks().find((e=>e.active));if(!r)return;if(this.state.bitrate=r.bandwidth,this.state.currentVariantId===r.id)return;const a={id:r.id,audioCodec:null!==(t=r.audioCodec)&&void 0!==t?t:"",audioBitrate:r.audioBandwidth,totalBitrate:r.bandwidth},s={id:r.id,width:r.width,height:r.height,videoCodec:null!==(n=r.videoCodec)&&void 0!==n?n:"",videoBitrate:r.videoBandwidth,totalBitrate:r.bandwidth};(null===(i=this.state.currentAudioFormat)||void 0===i?void 0:i.id)!==a.id&&this.internalObserver.onAudioFormatChanged({format:a,position:this.getCurrentPosition()}),(null===(o=this.state.currentVideoFormat)||void 0===o?void 0:o.id)!==s.id&&this.internalObserver.onVideoFormatChanged({format:s,position:this.getCurrentPosition()}),this.state.currentVariantId=r.id,this.state.currentAudioFormat=a,this.state.currentVideoFormat=s},this.handleSeeking=()=>{var e;this.state.hasInitiallyReadied&&(null===this.state.firstUnhandledSeek&&(this.state.firstUnhandledSeek=this.state.seekingFrom),this.state.isSeeking=!0,this.internalObserver.onSeeking({fromPosition:null!==(e=this.state.seekingFrom)&&void 0!==e?e:0,toPosition:this.getCurrentPosition()}))},this.handleSeeked=()=>{if(!this.state.hasInitiallyReadied)return;const e=null!==this.state.firstUnhandledSeek?this.state.firstUnhandledSeek:this.state.seekingFrom;this.state.isSeeking=!1,this.state.seekingFrom=null,this.state.progress=this.calculateProgress(this.state.currentTime,this.getCurrentPosition()),this.state.firstUnhandledSeek=null,this.internalObserver.onSeeked({fromPosition:null!=e?e:0,toPosition:this.getCurrentPosition()})},this.onBufferingStateChange=e=>Kt(this,void 0,void 0,(function*(){if(e.buffering){let e=X.w0.INITIAL;if(this.state.hasInitiallyReadied&&(e=this.state.isSeeking?X.w0.SEEK:X.w0.STALL),e===X.w0.STALL&&this.state.unableToFetchLastSegments){const e=yield this.getPlaybackError(this.state.failedSegmentRetryError);e.severity="fatal",yield this.handlePlaybackError(e,!1),yield this.stop(X.n0.FATAL_ERROR),this.state.failedSegmentRetryError=void 0}else this.state.isBuffering=!0,this.state.bufferType=e,this.state.lastBufferStart=Date.now(),this.state.isPlaying=!1,this.internalObserver.onBuffering({position:this.getCurrentPosition(),playWhenReady:this.state.playWhenReady,type:e})}else{const e=this.state.isBuffering&&this.state.bufferType===X.w0.STALL;this.state.isBuffering=!1,this.state.bufferType=null,e&&(this.videoElement.paused||(this.state.isPlaying=!0),this.internalObserver.onReady({position:this.getCurrentPosition(),playWhenReady:!this.state.isPaused,isPictureInPicture:this.player.isPictureInPicture()}))}})),this.onEncryptionKeyLoaded=()=>{(0,Ut.Y)("shaka::drmsessionupdate"),this.internalObserver.onEncryptionKeyLoaded({encryptionType:this.internalPlayer.keySystem()})},this.playerConfiguration=e.getConfiguration(),this.internalObserver=this.playbackSessionConfiguration.initiateInternalPlaybackObserver(),this.playbackTimeObservable=new Ft,this.state=this.getInitialState(),(null===(a=null===(r=this.playerConfiguration)||void 0===r?void 0:r.offline)||void 0===a?void 0:a.enabled)&&(this.offlineManager=new Bt.z({playerConfiguration:this.playerConfiguration})),this.playerConfiguration.containerElement&&(this.containerElement=this.playerConfiguration.containerElement),this.playerConfiguration.containerElementClass&&(this.containerElementClass=this.playerConfiguration.containerElementClass),this.checkContainerElementByClass=()=>{if(this.containerElementClass){const e=this.player.getWindow().document.getElementsByClassName(this.containerElementClass)[0];e&&(e.appendChild(this.videoElement),this.containerElementMutationObserver.disconnect())}},this.containerElementMutationObserver=new MutationObserver(this.checkContainerElementByClass),this.videoElementEventHandlers=[{event:"canplay",handler:this.handleCanPlay},{event:"ended",handler:this.handleEnded},{event:"durationchange",handler:this.handleDurationChange},{event:"timeupdate",handler:this.handleTimeUpdate},{event:"volumechange",handler:this.handleVolumeChange},{event:"playing",handler:this.handlePlaying},{event:"pause",handler:this.handlePause},{event:"seeking",handler:this.handleSeeking},{event:"seeked",handler:this.handleSeeked},{event:"ratechange",handler:this.handleRateChange},{event:"enterpictureinpicture",handler:this.handleEnterPip},{event:"leavepictureinpicture",handler:this.handleLeavePip}],this.shakaPlayerEventHandlers=[{event:"error",handler:this.handleShakaError},{event:"adaptation",handler:this.handleAdaptation},{event:"variantchanged",handler:this.handleAdaptation},{event:"buffering",handler:this.onBufferingStateChange},{event:"drmsessionupdate",handler:this.onEncryptionKeyLoaded},{event:"manifestparsed",handler:this.handleManifestParsed}],this.networkEngineEventHandlers=[{event:"retry",handler:this.handleRequestRetry}],this.mediaType="unknown",this.streamingType="unknown"}get started(){return this.state.isStarted}get duration(){return this.state.duration}get ended(){var e;return null===(e=this.state)||void 0===e?void 0:e.isEnded}static isBrowserSupported(){return o().Player.isBrowserSupported()}static probeSupport(){return o().Player.probeSupport()}resume(){return this.internalObserver.onResumeRequested(),this.setPaused(!1)}pause(){return this.setPaused(!0)}seekTo(e){let t=e;e<.1&&(t=.1);const n=this.videoElement.duration||0;return e>n&&(t=n),this.state.currentTime=this.videoElement.currentTime,this.state.isSeeking=!0,this.state.seekingFrom=this.videoElement.currentTime,this.state.currentTime=t,this.videoElement.currentTime=t,this}setPlaybackSpeed(e){void 0!==this.videoElement&&e>0&&(this.videoElement.defaultPlaybackRate=e,this.videoElement.playbackRate=e)}attemptInsertVideoElement(){this.player.isPictureInPicture()||(this.containerElement?this.containerElement.appendChild(this.videoElement):this.containerElementClass&&(this.containerElementMutationObserver.observe(this.player.getWindow().document.documentElement,{childList:!0,subtree:!0}),this.checkContainerElementByClass()))}play(e,t){return Kt(this,void 0,void 0,(function*(){try{return this.sessionPromise=new Promise((n=>n(this.initSession(e,t).then((()=>this.loadSession()))))),yield this.sessionPromise}catch(e){if(this.sessionPromise=void 0,(0,Gt.Ry)(e)&&this.errorMayRecoverOnReload(e)){this.errorMayRecoverOnDrmConfigRemoval(e)&&this.internalPlayer.configure({drm:void 0});try{return this.state.attemptingErrorRecovery=!0,yield this.reloadSession()}catch(t){return e.severity="fatal",yield this.handlePlaybackError(e,!1),yield Promise.reject(e)}finally{this.state.attemptingErrorRecovery=!1}}return Promise.reject(e)}}))}setPreferredSubtitle(e){if(e.languageTag===c.languageTag)return void this.removeSubtitle();const t=function(e,t){if(e.languageTag===c.languageTag)return;const n=t.find((t=>t.languageTag===e.languageTag));if(n)return n;const i=t.find((t=>l(t)===l(e)));if(i)return i;const o=t.find((t=>u(t)===u(e)));return o||void 0}(e,this.internalPlayer.getTextTracks().map((e=>({languageTag:e.language}))));if(void 0===t)return void this.removeSubtitle();const n=this.getSubtitleLanguageTag();t.languageTag!==n&&this.setSubtitle(t)}newSessionLoaded(e){this.state.isEnded||this.internalObserver.onEndingPlayback({playbackRequest:e})}getBandwidthEstimate(){var e;const t=this.getStats();return null!==(e=null==t?void 0:t.estimatedBandwidth)&&void 0!==e?e:void 0}stop(e){return this.unloadSession(e)}emitForPercentages(e){this.state.progressPercentages=[...Array.from(new Set([...this.state.progressPercentages,...e]))].sort()}clearEmittedPercentages(){this.state.progressPercentages=[]}getPlaybackId(e){var t;return(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.endvideo_playback_id)||""}getNode(){return this.videoElement}hideNode(){this.videoElement.style.display&&(this.storedDisplayStyle=this.videoElement.style.display),this.videoElement.style.display="none"}showNode(){this.storedDisplayStyle?this.videoElement.style.display=this.storedDisplayStyle:this.videoElement.style.display="inline"}getPlaybackStats(){return this.getStats()}setMinimizeBitrate(e){this.state.minimizeBitrate!==e&&(this.state.minimizeBitrate=e,this.internalPlayer&&(e?this.enableMinimizeBitrate():this.disableMinimizeBitrate()))}setFullscreen(e){this.state.fullscreen!==e&&(this.state.fullscreen=e,this.internalPlayer&&this.internalObserver.onFullscreenChanged({position:this.getCurrentPosition(),fullscreen:e}))}setSurface(e){this.internalObserver.onSurfaceChanged({surface:e,position:this.getCurrentPosition()})}isLive(){return this.internalPlayer.isLive()}isPlayableForRequest(e){var t,n;const i=null!==(n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.playback_id)&&void 0!==n?n:"";if(!this.validPlaybackId(i))return{playable:!1,reason:"playback_id must be valid"};if(!e.mediaUrl)return{playable:!1,reason:"mediaUrl must be set"};if(e.isRoyaltyMedia){if(!this.internalObserver.observers.some((e=>e instanceof xt)))return{playable:!1,reason:"media is royalty-generating but no royalty-generating observers have been provided"}}return{playable:!0}}initSession(e,t){var n,i,o,a,s,c;return Kt(this,void 0,void 0,(function*(){t=this.fixupPlaybackOptions(t),this.session=Object.assign(Object.assign({sessionId:(0,r.H7)()},e),t),this.streamingType=(yield null===(n=this.offlineManager)||void 0===n?void 0:n.isAssetOffline(e.mediaUrl))?"offline":"on_demand",this.internalObserver.initiateObservers(this.session,this.playbackSessionConfiguration),this.playbackTimeObservable.initiateObservers(this.session.initialPosition),this.internalObserver.onPlaybackCreated({playbackIdentity:Object.assign({},this.session),initialConfiguration:{playWhenReady:this.session.playWhenReady,position:this.session.initialPosition,volume:this.player.volume,playbackSpeed:this.session.playbackSpeed,preferredSubtitle:this.session.preferredSubtitle,minimizeBitrate:this.session.minimizeBitrate,fullscreen:this.session.fullscreen,surface:this.session.surface},timeObservable:this.playbackTimeObservable}),null===(i=this.player.getMuxManager())||void 0===i||i.newSession({view_session_id:this.session.sessionId,video_title:null===(o=this.session.metadata)||void 0===o?void 0:o.title,video_series:null===(a=this.session.metadata)||void 0===a?void 0:a.album_title,video_id:null===(s=this.session.metadata)||void 0===s?void 0:s["media.manifest_id"],video_stream_type:this.streamingType,video_source_url:e.mediaUrl,video_content_type:null===(c=this.session.metadata)||void 0===c?void 0:c.feature_identifier,custom_1:this.session.playbackSpeed}),this.latencyStartTimes={},this.state.playWhenReady=this.session.playWhenReady,this.state.currentTime=this.session.initialPosition,this.state.playbackSpeed=this.session.playbackSpeed,this.session.minimizeBitrate&&(this.state.minimizeBitrate=this.session.minimizeBitrate);const{playable:l,reason:u}=this.isPlayableForRequest(e);if(!l){const e={category:"misconfigured-betamax-sdk-error",code:0,severity:"fatal",internalDetails:[null!=u?u:"unknown reason"]};return yield this.handlePlaybackError(e,!1),Promise.reject(e)}this.manifestUri=yield this.getManifestUri(e)}))}getManifestUri(e){var t,n;return Kt(this,void 0,void 0,(function*(){if("offline"===this.streamingType){const n=yield null===(t=this.offlineManager)||void 0===t?void 0:t.getPlayableOfflineUrl(e.mediaUrl);if(n)return n}return null!==(n=(0,r.jj)(e.mediaUrl,this.playbackSessionConfiguration.mediaExtensions))&&void 0!==n?n:e.mediaUrl}))}loadSession(){var e,t,n,i,o,r,a,s,c,l,u;return Kt(this,void 0,void 0,(function*(){this.attemptInsertVideoElement(),this.videoElement.setAttribute("preload","auto"),this.videoElement.setAttribute("data-sessionId",this.session.sessionId),this.setPlaybackSpeed(null!==(e=this.session.playbackSpeed)&&void 0!==e?e:this.state.playbackSpeed),yield this.internalPlayer.attach(this.videoElement),(null===(n=null===(t=this.playerConfiguration)||void 0===t?void 0:t.adaptiveBitrate)||void 0===n?void 0:n.initialLowBitrate)&&this.internalPlayer.configure({abr:{restrictions:{maxPixels:1}}}),this.session.minimizeBitrate&&this.enableMinimizeBitrate();const d=this.internalPlayer.getNetworkingEngine();this.configureNetworkingEngine(d),this.startListeningForEvents(),(null===(o=null===(i=this.playerConfiguration)||void 0===i?void 0:i.streaming)||void 0===o?void 0:o.autoplayVideoOnLoad)||(this.videoElement.autoplay=this.session.playWhenReady,this.setPaused(!this.session.playWhenReady));try{yield this.internalPlayer.load(this.manifestUri,this.session.initialPosition)}catch(e){if(!(0,Gt.ZW)(e)){const t=yield this.getPlaybackError(e,"unknown-error-while-loading");return yield this.handlePlaybackError(t),Promise.reject(t)}if(!this.state.isEnded){const t=yield this.getPlaybackError(e);return yield this.handlePlaybackError(t),Promise.reject(t)}}return(null===(a=null===(r=this.playerConfiguration)||void 0===r?void 0:r.adaptiveBitrate)||void 0===a?void 0:a.initialLowBitrate)&&this.internalPlayer.configure({abr:{restrictions:{maxPixels:void 0}}}),this.state.keySystem=this.internalPlayer.keySystem(),(null===(c=null===(s=this.playerConfiguration)||void 0===s?void 0:s.subtitles)||void 0===c?void 0:c.enabled)&&void 0!==this.session.preferredSubtitle&&this.setPreferredSubtitle(this.session.preferredSubtitle),(null===(u=null===(l=this.playerConfiguration)||void 0===l?void 0:l.streaming)||void 0===u?void 0:u.autoplayVideoOnLoad)&&this.setPaused(!this.session.playWhenReady),this.state.isLoaded=!0,Promise.resolve(this)}))}unloadSession(e,t=!0){return Kt(this,void 0,void 0,(function*(){if(this.state.isLoaded||(yield this.sessionPromise),t){if(!this.state.isEnded){const e=this.getCurrentPosition();this.emitEndedEvent(X.n0.REQUESTED,e),this.state.isEnded=!0}this.state.endReason=e}this.stopListeningForEvents();try{yield this.internalPlayer.detach()}catch(e){if(!(0,Gt.ZW)(e)){const t=yield this.getPlaybackError(e,"unknown-error-while-stopping");yield this.handlePlaybackError(t)}}const n=this.internalPlayer.getNetworkingEngine();n&&(n.clearAllRequestFilters(),n.clearAllResponseFilters()),this.containerElementMutationObserver.disconnect(),this.player.isPictureInPicture()||this.videoElement.remove()}))}reloadSession(){return Kt(this,void 0,void 0,(function*(){return yield this.unloadSession(void 0,!1),this.loadSession()}))}fixupPlaybackOptions(e){return e.initialPosition<0&&(e.initialPosition=0),e}validPlaybackId(e){return 0!==e.length&&!!(0,r.vv)(e)}configureNetworkingEngine(e){this.playerConfiguration.networkConfiguration&&(0,Ht.K)(e,this.playerConfiguration.networkConfiguration),e&&(e.registerRequestFilter(this.networkRequestFilter),e.registerResponseFilter(this.networkResponseFilter))}startListeningForEvents(){if(this.videoElementEventHandlers.forEach((e=>{this.videoElement.addEventListener(e.event,e.handler)})),this.internalPlayer){this.shakaPlayerEventHandlers.forEach((e=>{this.internalPlayer.addEventListener(e.event,e.handler)}));const e=this.internalPlayer.getNetworkingEngine();e&&this.networkEngineEventHandlers.forEach((t=>{e.addEventListener(t.event,t.handler)}))}}stopListeningForEvents(){if(this.videoElementEventHandlers.forEach((e=>{this.videoElement.removeEventListener(e.event,e.handler)})),this.internalPlayer){this.shakaPlayerEventHandlers.forEach((e=>{this.internalPlayer.removeEventListener(e.event,e.handler)}));const e=this.internalPlayer.getNetworkingEngine();e&&this.networkEngineEventHandlers.forEach((t=>{e.removeEventListener(t.event,t.handler)}))}}getInitialState(){return{time:(new Date).getTime(),playWhenReady:!1,isStarted:!1,isPlaying:!1,isPaused:!1,isEnded:!1,isError:!1,isBuffering:!1,isLoaded:!1,isSeeking:!1,seekingFrom:0,firstUnhandledSeek:null,duration:-1,currentTime:0,progress:0,bitrate:0,currentAudioFormat:void 0,currentVideoFormat:void 0,endReason:void 0,hasInitiallyReadied:!1,currentVariantId:null,progressPercentages:[],playbackSpeed:1,preferredSubtitle:c,minimizeBitrate:!1,fullscreen:!1,bufferType:X.w0.INITIAL,lastBufferStart:0,timeUpdate:!1,attemptingErrorRecovery:!1,unableToFetchLastSegments:!1,failedSegmentRetryError:void 0}}getCurrentPosition(){return this.videoElement.currentTime?this.videoElement.currentTime:this.state.currentTime}isSubtitleUri(e){return!!e&&this.subtitleUris.some((t=>e.includes(t)))}emitEndedEvent(e,t){var n;const i=this.getStats(),o=i?i.droppedFrames:0;o>0&&this.internalObserver.onDroppedVideoFrames({droppedFrames:o});const r={playTime:1e3*(null!==(n=null==i?void 0:i.playTime)&&void 0!==n?n:0)};this.internalObserver.onPlaybackEnded({position:t,reason:e,playbackStats:r})}calculateProgress(e,t){let n=null;return t>0&&e>=0&&(n=e/t,n=Math.min(Math.max(n,0),1)),n}isPositionOutsideBuffer(){const e=this.internalPlayer.getBufferedInfo(),t=this.getCurrentPosition();return null!==e&&!(e.start<=t&&e.end>=t)}adjustPositionForBuffer(){var e;const t=null===(e=this.internalPlayer.getBufferedInfo())||void 0===e?void 0:e.start;t&&(this.videoElement.currentTime=t)}getSupportedMedia(e,t){return Object.entries(e).filter((([e,n])=>!0===n&&e.startsWith(t))).map((([e])=>e))}isFailedSegmentRequest(e){var t;return(null===(t=e.error)||void 0===t?void 0:t.category)===o().util.Error.Category.NETWORK}errorWillRecoverAutomatically(e){var t;return"NETWORK"===e.category&&"fatal"===e.severity&&this.isSubtitleUri(null===(t=e.network)||void 0===t?void 0:t.uri)}errorMayRecoverOnReload(e){return!this.state.attemptingErrorRecovery&&this.errorMayRecoverOnDrmConfigRemoval(e)}errorMayRecoverOnDrmConfigRemoval(e){return e.code===o().util.Error.Code.CONTENT_UNSUPPORTED_BY_BROWSER}getPlaybackError(e,t="unknown",n="unknown"){return Kt(this,void 0,void 0,(function*(){let i={category:t,code:0,severity:n};return i=(0,Gt.u6)(e)?this.hydrateErrorWithShakaError(i,e.detail):(0,Gt.ZW)(e)?this.hydrateErrorWithShakaError(i,e):this.hydrateErrorWithEventInfo(i,e),i=yield this.hydrateErrorWithContext(i),i}))}hydrateErrorWithShakaError(e,t){var n;const i={category:void 0!==t.category?(0,ht.J0)(t.category):"unknown",code:null!==(n=t.code)&&void 0!==n?n:0,severity:(0,ht.Ft)(t.severity),internalDetails:t.data};if(t.category===o().util.Error.Category.NETWORK&&t.data){const e=t.data;i.network={uri:e[0]},t.code===o().util.Error.Code.BAD_HTTP_STATUS&&(i.network.httpStatus=e[1],i.network.responseText=e[2],i.network.responseHeaders=e[3])}return Object.assign(Object.assign({},e),i)}hydrateErrorWithEventInfo(e,t){let n;try{n=[JSON.stringify(t)]}catch(e){t instanceof Error&&(n=[t.name,t.message])}return Object.assign(Object.assign({},e),{internalDetails:n})}hydrateErrorWithContext(e){return Kt(this,void 0,void 0,(function*(){const t=yield Wt.probeSupport(),n=t.drm["com.widevine.alpha"];return Object.assign(Object.assign({},e),{sessionContext:{audioFormat:this.state.currentAudioFormat,videoFormat:this.state.currentVideoFormat},clientContext:{browserSupported:Wt.isBrowserSupported(),widevineSupported:!!n,widevinePersistentLicenseSupported:!!(null==n?void 0:n.persistentState),supportedAudioWebmMedia:this.getSupportedMedia(t.media,"audio/webm"),supportedVideoWebmMedia:this.getSupportedMedia(t.media,"video/webm")}})}))}getStats(){return void 0!==this.internalPlayer&&this.state.isLoaded?this.internalPlayer.getStats():void 0}setPaused(e){return e?this.videoElement.pause():this.videoElement.play(),this.state.isPaused=e,this}enableMinimizeBitrate(){this.internalPlayer.configure({abr:{restrictions:{maxBandwidth:1}}}),this.internalObserver.onMinimizeBitrateChanged({position:this.getCurrentPosition(),minimizeBitrate:!0})}disableMinimizeBitrate(){var e,t,n;const i=null!==(n=null===(t=null===(e=this.playerConfiguration)||void 0===e?void 0:e.adaptiveBitrate)||void 0===t?void 0:t.maxBitrate)&&void 0!==n?n:void 0;this.internalPlayer.configure({abr:{restrictions:{maxBandwidth:i}}}),this.triggerQuickVariantChange(),this.internalObserver.onMinimizeBitrateChanged({position:this.getCurrentPosition(),minimizeBitrate:!1})}triggerQuickVariantChange(){var e,t,n;try{const i=this.player.getAbrManager().chooseVariant();if(!i)throw new Error("Recommended variant was not provided by the AbrManager");const o=null!==(n=null===(t=null===(e=this.playerConfiguration)||void 0===e?void 0:e.minimizeBitrate)||void 0===t?void 0:t.bufferMargin)&&void 0!==n?n:4;this.internalPlayer.selectVariantTrack((0,ht.Yt)(i),!0,o)}catch(e){if(e instanceof Error){const t={category:"failed-quick-variant-change",code:0,severity:"recoverable",internalDetails:[`${e.name}: ${e.message}`]};this.handlePlaybackError(t,!1)}}}getSubtitleLanguageTag(){if(this.internalPlayer.isTextTrackVisible()){const e=this.internalPlayer.getTextTracks().find((e=>e.active));return e?e.language:void 0}}setSubtitle(e){const t=e.languageTag;this.internalPlayer.selectTextLanguage(t),this.internalPlayer.configure({preferredTextLanguage:t}),this.internalPlayer.setTextTrackVisibility(""!==t),this.internalObserver.onSubtitleChanged({position:this.getCurrentPosition(),subtitle:{languageTag:t}})}removeSubtitle(){this.setSubtitle(c)}}class Yt{constructor(e){this.playerConfigurationDependencies=e}createPlaybackSession(e,t,n,i){let o=this.playerConfigurationDependencies.factories||[];if(e&&this.playerConfigurationDependencies.endVideo){const{endVideo:e,productStateProvider:t,logError:n}=this.playerConfigurationDependencies.endVideo;o=[...o,()=>new xt(e,t,n)]}return new Wt(t,n,i,Object.assign(Object.assign({},this.playerConfigurationDependencies),{initiateInternalPlaybackObserver:()=>new Vt(o)}))}}var jt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class zt{constructor(e){this.shakaInstance=new(o().Player)(e),window.shaka=o()}attach(e){return this.shakaInstance.attach(e)}detach(){return this.shakaInstance.detach()}destroy(){return this.shakaInstance.destroy()}configure(e){return this.shakaInstance.configure(e)}getNetworkingEngine(){return this.shakaInstance.getNetworkingEngine()}getManifest(){return this.shakaInstance.getManifest()}load(e,t,n){return this.shakaInstance.load(e,t,n)}unload(){return jt(this,void 0,void 0,(function*(){yield this.shakaInstance.unload()}))}keySystem(){return this.shakaInstance.keySystem()}getTextTracks(){return this.shakaInstance.getTextTracks()}getVariantTracks(){return this.shakaInstance.getVariantTracks()}getStats(){return this.shakaInstance.getStats()}addEventListener(e,t,n){this.shakaInstance.addEventListener(e,t,n)}removeEventListener(e,t,n){this.shakaInstance.removeEventListener(e,t,n)}selectTextLanguage(e,t){this.shakaInstance.selectTextLanguage(e,t)}setTextTrackVisibility(e){this.shakaInstance.setTextTrackVisibility(e)}isTextTrackVisible(){return this.shakaInstance.isTextTrackVisible()}selectVariantTrack(e,t,n){this.shakaInstance.selectVariantTrack(e,t,n)}isLive(){return this.shakaInstance.isLive()}getConfiguration(){return this.shakaInstance.getConfiguration()}isAudioOnly(){return this.shakaInstance.isAudioOnly()}getBufferedInfo(){var e,t;return null!==(t=null===(e=this.shakaInstance.getBufferedInfo())||void 0===e?void 0:e.total[0])&&void 0!==t?t:null}}class Jt extends o().abr.SimpleAbrManager{constructor(){super(...arguments),this.surfaceBasedBitrateCap=!1,this.resizeObserverTimer=new(o().util.Timer)((()=>{this.handleResizing()}))}configure(e){var t,n;e.restrictToElementSize&&(e.restrictToElementSize=!1,this.surfaceBasedBitrateCap=!0,this.externalMaxHeightRestriction=null!==(t=e.restrictions.maxHeight)&&void 0!==t?t:1/0,this.externalMaxWidthRestriction=null!==(n=e.restrictions.maxWidth)&&void 0!==n?n:1/0),this.config=e,super.configure(e)}init(e){super.init(e),this.switchCallback=e}setMediaElement(e){super.setMediaElement(e),this.mediaElement=null!=e?e:void 0,this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.mediaElement&&"ResizeObserver"in window&&(this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverTimer.tickAfter(1)})),this.resizeObserver.observe(this.mediaElement))}setVariants(e){super.setVariants(e),this.variants=e,this.surfaceBasedBitrateCap&&this.applyElementBasedSizeRestrictions()}chooseVariant(){return super.chooseVariant()}stop(){super.stop(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.resizeObserverTimer.stop()}handleResizing(){if(!this.surfaceBasedBitrateCap)return;this.applyElementBasedSizeRestrictions();const e=this.chooseVariant();e&&this.switchCallback&&this.switchCallback(e)}applyElementBasedSizeRestrictions(){var e,t,n,i,o,r,a;if(!this.variants||!this.mediaElement||!this.config)return;const s=(null===(e=this.config)||void 0===e?void 0:e.ignoreDevicePixelRatio)?1:window.devicePixelRatio,c=null!==(t=this.mediaElement.clientHeight*s)&&void 0!==t?t:1/0,l=null!==(n=this.mediaElement.clientWidth*s)&&void 0!==n?n:1/0;let u=this.variants;u=u.sort(((e,t)=>e.bandwidth-t.bandwidth));const d=u.map((e=>e.video)).find((e=>(null==e?void 0:e.height)&&e.width&&e.height>=c&&e.width>=l));this.config.restrictions.maxHeight=Math.min(null!==(i=null==d?void 0:d.height)&&void 0!==i?i:1/0,null!==(o=this.externalMaxHeightRestriction)&&void 0!==o?o:1/0),this.config.restrictions.maxWidth=Math.min(null!==(r=null==d?void 0:d.width)&&void 0!==r?r:1/0,null!==(a=this.externalMaxWidthRestriction)&&void 0!==a?a:1/0),super.configure(this.config)}}n(54487);var qt=n(17757),Xt=n.n(qt);class Zt{constructor(e,t){var n,i,o,r,a,s;this.muxMetadata={},this.shakaPlayerMux=Xt()(e.shakaInstance,{debug:!1,data:{env_key:null===(i=null===(n=null==t?void 0:t.analytics)||void 0===n?void 0:n.mux)||void 0===i?void 0:i.token,player_name:null===(r=null===(o=null==t?void 0:t.analytics)||void 0===o?void 0:o.mux)||void 0===r?void 0:r.playerName,player_version:ft.lB,viewer_application_name:null===(s=null===(a=null==t?void 0:t.analytics)||void 0===a?void 0:a.mux)||void 0===s?void 0:s.appName}})}newSession(e){var t;(function(e){return"context-player-vodcast"===e.video_content_type||"context-player-music-video"===e.video_content_type})(e)&&(this.muxMetadata=e,this.muxMetadata.video_content_type=function(e){switch(e){case"context-player-vodcast":return"Video Podcast";case"context-player-music-video":return"Music Video";default:return"Other"}}(this.muxMetadata.video_content_type),this.muxMetadata.custom_3=this.muxMetadata.video_content_type,null===(t=this.shakaPlayerMux)||void 0===t||t.emit("videochange",this.muxMetadata))}updateSession(e){Object.keys(e).every((t=>e[t]===this.muxMetadata[t]))||(this.muxMetadata=Object.assign(Object.assign({},this.muxMetadata),e),this.emitHeartbeat(this.muxMetadata))}emitHeartbeat(e){var t;null===(t=this.shakaPlayerMux)||void 0===t||t.emit("hb",e)}}var Qt=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class $t{constructor(e,t){var n,i,o;this.playerConfiguration=e,this.playbackSessionFactory=t,this.pipWindow=null,this.defaultPlayOptions={playWhenReady:!0,initialPosition:0,playbackSpeed:1,preferredSubtitle:c,minimizeBitrate:!1,fullscreen:!1,surface:void 0},this.currentWindow=null!==(n=e.window)&&void 0!==n?n:window,this.playOptions=this.defaultPlayOptions,this.abrManager=null!==(o=null===(i=this.playerConfiguration.adaptiveBitrate)||void 0===i?void 0:i.abrManager)&&void 0!==o?o:new Jt,this.internalPlayer=this.initInternalPlayer(),this.videoElement=this.initVideoElement()}get started(){var e,t;return null!==(t=null===(e=this.playbackSession)||void 0===e?void 0:e.started)&&void 0!==t?t:null}get ended(){var e,t;return null!==(t=null===(e=this.playbackSession)||void 0===e?void 0:e.ended)&&void 0!==t?t:null}get volume(){return this.videoElement.muted?0:this.videoElement.volume}get muted(){return this.videoElement.muted||0===this.videoElement.volume}static isBrowserSupported(){return Wt.isBrowserSupported()}static probeSupport(){return Wt.probeSupport()}play(e,t){return Qt(this,void 0,void 0,(function*(){return(0,Ut.Y)("betamax::start_play"),yield this.endPreviousPlaybackSession(e),this.playbackRequest=e,this.playbackSession=this.playbackSessionFactory.createPlaybackSession(e.isRoyaltyMedia,this,this.internalPlayer,this.videoElement),(null==t?void 0:t.volume)&&this.setVolume(null==t?void 0:t.volume),yield this.playbackSession.play(e,Object.assign(Object.assign({},this.playOptions),t)),(0,Ut.Y)("betamax::start_play_end"),this}))}getConfiguration(){return this.playerConfiguration}getPlaybackRequest(){return this.playbackRequest}getAbrManager(){return this.abrManager}resume(){var e;return null===(e=this.playbackSession)||void 0===e||e.resume(),this}pause(){var e;return null===(e=this.playbackSession)||void 0===e||e.pause(),this}seekTo(e){var t;return null===(t=this.playbackSession)||void 0===t||t.seekTo(e),this}setVolume(e){return this.videoElement.volume=Math.pow(e,3),this}setAudioDisabled(e){return this.videoElement.muted=e,this}getPreferredSubtitle(){return this.playOptions.preferredSubtitle}setPreferredSubtitle(e){var t;return this.playOptions.preferredSubtitle=e,null===(t=this.playbackSession)||void 0===t||t.setPreferredSubtitle(e),this}setPlaybackSpeed(e){var t;this.playOptions.playbackSpeed=e,null===(t=this.playbackSession)||void 0===t||t.setPlaybackSpeed(e)}setMinimizeBitrate(e){var t;this.playOptions.minimizeBitrate=e,null===(t=this.playbackSession)||void 0===t||t.setMinimizeBitrate(e)}setFullscreen(e){var t;this.playOptions.fullscreen=e,null===(t=this.playbackSession)||void 0===t||t.setFullscreen(e)}setSurface(e){var t;this.playOptions.surface=e,null===(t=this.playbackSession)||void 0===t||t.setSurface(e)}setPip(e){return Qt(this,void 0,void 0,(function*(){return this.isPictureInPicture()===e?this.pipWindow:e?(this.pipWindow=yield this.videoElement.requestPictureInPicture(),this.pipWindow):(yield this.getWindow().document.exitPictureInPicture(),null)}))}isPictureInPicture(){return this.getWindow().document.pictureInPictureElement===this.videoElement}attemptInsertVideoElement(){var e;null===(e=this.playbackSession)||void 0===e||e.attemptInsertVideoElement()}stop(e){var t;return Qt(this,void 0,void 0,(function*(){yield null===(t=this.playbackSession)||void 0===t?void 0:t.stop(null!=e?e:X.n0.REQUESTED),this.playbackSession=void 0}))}release(){return Qt(this,void 0,void 0,(function*(){yield this.stop(X.n0.REQUESTED),this.playbackSession=void 0,this.playbackRequest=void 0,this.playOptions=this.defaultPlayOptions}))}emitForPercentages(e){var t;null===(t=this.playbackSession)||void 0===t||t.emitForPercentages(e)}clearEmittedPercentages(){var e;null===(e=this.playbackSession)||void 0===e||e.clearEmittedPercentages()}getNode(){return this.videoElement}hideNode(){var e;null===(e=this.playbackSession)||void 0===e||e.hideNode()}showNode(){var e;null===(e=this.playbackSession)||void 0===e||e.showNode()}getSessionState(){return this.playbackSession?this.playbackSession.state:null}getWindow(){return this.currentWindow}setWindow(e){this.currentWindow=e}getDocument(){return this.getWindow().document}getMuxManager(){return this.muxManager}initInternalPlayer(){var e,t,n,i,o,r,a,s,c,l,u,d,p,f,h,m,g,_,v,y,E,b,S,A,T;const O={defaultBandwidthEstimate:(null===(t=null===(e=this.playerConfiguration)||void 0===e?void 0:e.adaptiveBitrate)||void 0===t?void 0:t.initialLowBitrate)?1e6:8e6,restrictToElementSize:null!==(i=null===(n=this.playerConfiguration.adaptiveBitrate)||void 0===n?void 0:n.surfaceBasedResolutionCap)&&void 0!==i&&i,restrictions:{maxBandwidth:null!==(r=null===(o=this.playerConfiguration.adaptiveBitrate)||void 0===o?void 0:o.maxBitrate)&&void 0!==r?r:1/0}},I=null!==(c=null===(s=null===(a=this.playerConfiguration)||void 0===a?void 0:a.streaming)||void 0===s?void 0:s.rebufferingGoal)&&void 0!==c?c:2,C=null!==(d=null===(u=null===(l=this.playerConfiguration)||void 0===l?void 0:l.retry)||void 0===u?void 0:u.attempts)&&void 0!==d?d:4;this.initialInternalPlayerConfiguration={abr:O,abrFactory:()=>this.abrManager,manifest:{retryParameters:{maxAttempts:C}},drm:{servers:null===(f=null===(p=this.playerConfiguration)||void 0===p?void 0:p.drm)||void 0===f?void 0:f.servers,advanced:null===(m=null===(h=this.playerConfiguration)||void 0===h?void 0:h.drm)||void 0===m?void 0:m.advanced,retryParameters:{maxAttempts:C}},streaming:{rebufferingGoal:I,retryParameters:{maxAttempts:C}},preferredAudioCodecs:null!==(v=null===(_=null===(g=this.playerConfiguration)||void 0===g?void 0:g.experimental)||void 0===_?void 0:_.preferredAudioCodecs)&&void 0!==v?v:[],preferredVideoCodecs:null!==(b=null===(E=null===(y=this.playerConfiguration)||void 0===y?void 0:y.experimental)||void 0===E?void 0:E.preferredVideoCodecs)&&void 0!==b?b:[]};const N=new zt;return N.configure(this.initialInternalPlayerConfiguration),(null===(T=null===(A=null===(S=this.playerConfiguration)||void 0===S?void 0:S.analytics)||void 0===A?void 0:A.mux)||void 0===T?void 0:T.enabled)&&(this.muxManager=new Zt(N,this.playerConfiguration)),N}initVideoElement(){const e=this.playerConfiguration.videoElement?this.playerConfiguration.videoElement:this.getWindow().document.createElement("video"),t=Object.assign(Object.assign({},{controls:!1,loop:!1,style:"",width:640}),this.playerConfiguration.videoElementConfig);return void 0!==t.controls&&(e.controls=t.controls),void 0!==t.loop&&(e.loop=t.loop),void 0!==t.style&&(e.style.cssText=t.style),void 0!==t.width&&(e.width=t.width),void 0!==t.height&&(e.height=t.height),e}_isLive(){var e,t;return null!==(t=null===(e=this.playbackSession)||void 0===e?void 0:e.isLive())&&void 0!==t&&t}endPreviousPlaybackSession(e){return Qt(this,void 0,void 0,(function*(){this.playbackSession&&!this.playbackSession.ended&&this.playbackSession.newSessionLoaded(e),yield this.stop()}))}}class en{constructor(e){this.playerConfigurationDependencies=e}createBetamaxPlayer(e){return new $t(e,new Yt(this.playerConfigurationDependencies))}}var tn=n(5538),nn=n(60690);class on{constructor(e,t,n){this.cosmosSender=e,this.playerInterruptor=t,this.stallTimeoutMs=n}onPlaybackCreated({playbackIdentity:e,timeObservable:t}){var n;this.playbackId=null===(n=e.metadata)||void 0===n?void 0:n.playback_id,this.cosmosSender.sendPlaybackState(this.playbackId),void 0!==this.playerInterruptor&&this.playerInterruptor.setTimeObservable(t)}onPlaybackEnded({reason:e}){switch(this.stopStallTimerIfRunning(),this.cosmosSender.sendPlaybackState(this.playbackId),e){case X.n0.PLAYED_TO_END:this.cosmosSender.sendAdvance("finished");break;case X.n0.NETWORK_ERROR:this.cosmosSender.sendContextPlayerError({type:"timeout"})}this.playbackId=void 0}onBuffering(){this.cosmosSender.sendPlaybackState(this.playbackId),this.shouldSetStallTimers()&&this.startStallTimer()}onDurationChanged({duration:e}){this.cosmosSender.sendPlaybackState(this.playbackId),void 0!==this.playerInterruptor&&this.playerInterruptor.setMediaDuration(e)}onPlaybackError({error:e}){this.cosmosSender.sendPlaybackState(this.playbackId),this.cosmosSender.sendPlaybackError(e)}onPaused(){this.stopStallTimerIfRunning(),this.cosmosSender.sendPlaybackState(this.playbackId)}onReady(){this.stopStallTimerIfRunning(),this.cosmosSender.sendPlaybackState(this.playbackId)}onStarted(){this.stopStallTimerIfRunning(),this.cosmosSender.sendPlaybackState(this.playbackId)}onResumed(){this.stopStallTimerIfRunning(),this.cosmosSender.sendPlaybackState(this.playbackId)}onSeeking(){this.cosmosSender.sendPlaybackState(this.playbackId)}onPlaybackSpeedChanged(){this.cosmosSender.sendPlaybackState(this.playbackId)}shouldSetStallTimers(){return void 0!==this.stallTimeoutMs&&this.stallTimeoutMs>0}startStallTimer(){this.stopStallTimerIfRunning(),this.stallTimeoutId=setTimeout((()=>{this.cosmosSender.sendContextPlayerError({type:"playback_stuck"})}),this.stallTimeoutMs)}stopStallTimerIfRunning(){void 0!==this.stallTimeoutId&&(clearTimeout(this.stallTimeoutId),this.stallTimeoutId=void 0)}}var rn=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class an{constructor(e,t,n){this.configuration=e,this.contextPlayerCoordinator=t,this.playerRouter=n,this.debugOverlay=e=>{var t,n,i,o,r,a,s,c,l;const u=null!==(n=null===(t=this.playerRouter.mainPlayer.getNode())||void 0===t?void 0:t.ownerDocument.getElementsByClassName("debugOverlay"))&&void 0!==n?n:[];if(0===u.length){const t=null!==(o=null===(i=this.playerRouter.mainPlayer.getNode())||void 0===i?void 0:i.ownerDocument.createElement("div"))&&void 0!==o?o:new HTMLDivElement,n=null!==(a=null===(r=this.playerRouter.mainPlayer.getNode())||void 0===r?void 0:r.ownerDocument.createElement("p"))&&void 0!==a?a:new HTMLParagraphElement;n.className="debugOverlay",t.appendChild(n),t.setAttribute("style","width: 100%; position: absolute; top: 0; left: 0; opacity: 1; background: yellow; color: black; font-size: 10px; font-weight: bold"),null===(l=null===(c=null===(s=this.playerRouter.mainPlayer.getNode())||void 0===s?void 0:s.parentNode)||void 0===c?void 0:c.parentNode)||void 0===l||l.append(t),sn(n,e)}else sn(u[0],e)}}initialize(){throw new Error("todo: subscribe onContextualPositionReceived via Player API")}release(){this.videoPositionSub&&(this.videoPositionSub.cancel(),this.videoPositionSub=void 0)}onContextualPositionReceived(e){return rn(this,void 0,void 0,(function*(){switch(this.inferPlaybackEvent(e)){case"start":yield this.startPlayback(e);break;case"stop-and-start":yield this.stopPlayback(),yield this.startPlayback(e);break;case"pause":this.pausePlayback();break;case"resume":this.resumePlayback();break;case"seek":this.playerRouter.mainPlayer.seekTo(e.position_as_of_timestamp)}}))}inferPlaybackEvent(e){var t,n,i;let o="none";return void 0===this.lastContextualPositionPayload?o="start":this.lastContextualPositionPayload.playback_id!==e.playback_id?o="stop-and-start":!(null===(t=this.lastContextualPositionPayload)||void 0===t?void 0:t.is_paused)&&e.is_paused?o="pause":(null===(n=this.lastContextualPositionPayload)||void 0===n?void 0:n.is_paused)&&!e.is_paused?o="resume":(null===(i=this.lastContextualPositionPayload)||void 0===i?void 0:i.is_buffering)&&!e.is_buffering&&(o="seek"),this.lastContextualPositionPayload=e,o}startPlayback(e){return rn(this,void 0,void 0,(function*(){const t=(e=>{var t;const n={type:"start",track:{}};return n.track.playback_id=e.playback_id,n.track.track={},n.track.track.metadata=null===(t=e.track)||void 0===t?void 0:t.metadata,n.config={},n.config["audio.episode.speed"]=e.playback_speed,n.position=e.timestamp,n})(e);yield this.contextPlayerCoordinator.startNewPlayback(t).then((e=>console.log("startNewPlayback done",e)),(e=>console.error("start new playback failed",e))),this.playerRouter.setVolume(0),this.listenToMediaPositionUpdates()}))}stopPlayback(){return rn(this,void 0,void 0,(function*(){yield this.playerRouter.mainPlayer.stop(),this.stopListeningToMediaPositionUpdates()}))}pausePlayback(){this.playerRouter.mainPlayer.pause(),this.stopListeningToMediaPositionUpdates()}resumePlayback(){this.playerRouter.mainPlayer.resume(),this.listenToMediaPositionUpdates()}listenToMediaPositionUpdates(){throw new Error("todo: poll onMediaPositionReceived via Player API")}stopListeningToMediaPositionUpdates(){this.mediaPositionIntervalId&&window.clearInterval(this.mediaPositionIntervalId),this.mediaPositionIntervalId=void 0}onMediaPositionReceived(e){var t,n,i;const o=null!==(i=null===(n=null===(t=this.playerRouter.mainPlayer)||void 0===t?void 0:t.getNode())||void 0===n?void 0:n.currentTime)&&void 0!==i?i:0,r=e.position,a=ln(o,r),s=r/1e3,c=1+(s-o)/100,l=un(o,r);if(this.debugOverlay({delta:l,adjustSpeed:!a,newSpeed:c}),0===e.playback_speed)this.pausePlayback();else if(a){const t=s,n=200*e.playback_speed/1e3;this.playerRouter.mainPlayer.seekTo(t+n)}else l>1?this.playerRouter.mainPlayer.setPlaybackSpeed(.9):c<2&&this.playerRouter.mainPlayer.setPlaybackSpeed(c)}}const sn=(e,{delta:t,adjustSpeed:n,newSpeed:i=0})=>{e.innerHTML=`d:${cn(t)}, s: ${n?"t":"f"}, speed: ${i}`,e.style.background=t>200?"pink":n?"yellow":"lightgreen"},cn=e=>e>1?"↑":e<1?"↓":"-",ln=(e,t)=>0!==e&&void 0!==e&&(0!==t&&void 0!==t&&Math.abs(un(e,t))>200),un=(e=0,t)=>t-1e3*e;var dn=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const pn=o().util.Error.Code,fn=o().util.Error.Category;class hn{constructor(e){var t,n,i,o,r,s,c,l,u,d,p;if(this.configuration=e,this.cosmosVideoPlayerEndpoint="sp://videoplayer/v1",this.cosmos=e.cosmos,this.spotifyProductState=e.productState,this.playerDependencies=e.playerDependencies,this.playerConfiguration=null!==(t=e.playerConfiguration)&&void 0!==t?t:{},this.authTokenCallback=()=>dn(this,void 0,void 0,(function*(){const{accessToken:t,tokenType:n}=yield e.getToken();return`${n} ${t}`})),(null!==(i=(u=null!==(n=(l=this.playerConfiguration).analytics)&&void 0!==n?n:l.analytics={}).playbackMetadataKeys)&&void 0!==i?i:u.playbackMetadataKeys=[]).push(S),(null!==(o=(d=e.playerDependencies).factories)&&void 0!==o?o:d.factories=[]).push((()=>new on(this,this.playerInterruptor,this.stallTimeoutMs))),e.eventSenderProvider&&e.pendingEventsService){const{playbackSessionLogger:t,playbackSessionPendingLogger:n,playbackErrorLogger:i,downloadSessionLogger:o,downloadErrorLogger:a}=W(e.eventSenderProvider,e.pendingEventsService);e.playerDependencies.factories.push((()=>{var o,r,a,s;return new pt({usePendingLogger:null!==(r=null===(o=e.logging)||void 0===o?void 0:o.usePendingStorage)&&void 0!==r&&r,logger:t,pendingLogger:n,errorLogger:i},null===(s=null===(a=this.playerConfiguration)||void 0===a?void 0:a.analytics)||void 0===s?void 0:s.playbackMetadataKeys)}),(()=>new mt(i))),(null===(s=null===(r=this.playerConfiguration)||void 0===r?void 0:r.offline)||void 0===s?void 0:s.enabled)&&(null!==(c=(p=this.playerConfiguration.offline).downloadObserverFactories)&&void 0!==c?c:p.downloadObserverFactories=[]).push((()=>new gt(o)),(()=>new _t(a)))}if(e.endVideoLogger){const t=new z(e.productStateService,e.scrobbleService);e.playerDependencies.endVideo={endVideo:e.endVideoLogger,productStateProvider:t}}const f=this.spotifyProductState["video-manifest-url"];this.playerDependencies.mediaExtensions=[new tn.P(f)],this.videoContextPlayerSub=void 0,this.contextPlayerVolumeSub=void 0,this.playerInterruptor=new a(this.cosmos),this.playbackService=e.playbackService}initialize(){var e,t,n;return dn(this,void 0,void 0,(function*(){const i=new en(this.playerDependencies);let o;null!==(e=(n=this.playerConfiguration).drm)&&void 0!==e||(n.drm={}),this.playerConfiguration.drm.vmpEnabled&&(o=yield yt(this.configuration.getToken));const a=this.spotifyProductState["widevine-license-url"];this.playerConfiguration.drm=Object.assign(Object.assign({},this.playerConfiguration.drm),{servers:Object.assign(Object.assign({},this.playerConfiguration.drm.servers),{"com.widevine.alpha":a}),advanced:Object.assign(Object.assign({},this.playerConfiguration.drm.advanced),{"com.widevine.alpha":{videoRobustness:"SW_SECURE_DECODE",serverCertificate:o}})});const s=i.createBetamaxPlayer(this.playerConfiguration),c=(null===(t=this.configuration.ads)||void 0===t?void 0:t.videoOnVideoSaiEnabled)?i.createBetamaxPlayer(this.playerConfiguration):void 0;this.playerRouter=new q(s,c),this.configuration.boomboxAudioSync?(this.audioSyncCoordinator=new an(this.configuration,this,this.playerRouter),this.audioSyncCoordinator.initialize()):this.videoContextPlayerSub=this.cosmos.sub(`${this.cosmosVideoPlayerEndpoint}/commands`,this.onCommandReceived.bind(this),r.wl),void 0!==this.playbackService&&this.playbackService.subVolume({},(({volume:e})=>{var t;null===(t=this.playerRouter)||void 0===t||t.setVolume(e)}))}))}release(){return dn(this,void 0,void 0,(function*(){this.videoContextPlayerSub&&(this.videoContextPlayerSub.cancel(),this.videoContextPlayerSub=void 0),this.contextPlayerVolumeSub&&(this.contextPlayerVolumeSub.cancel(),this.contextPlayerVolumeSub=void 0),yield this.stopAndUnloadCurrentTrack(),this.playerInterruptor=void 0,this.playerRouter=void 0,this.deferredStartPayload=void 0,this.audioSyncCoordinator&&this.audioSyncCoordinator.release()}))}onCommandReceived(e){var t,n,i,o;return dn(this,void 0,void 0,(function*(){const r=e;if(!this.playerRouter)return r;const a=null===(t=null==r?void 0:r.track)||void 0===t?void 0:t.playback_id;switch(void 0===a&&this.logBetamaxPlaybackError("context-player-invalid-command","playback_id is undefined",e),r.type){case"start":try{this.playerInterruptor&&this.playerInterruptor.unregister(),this.shouldResumeCurrentTrack(r,this.currentTrack)?yield this.resumeCurrentPlayback(this.playerRouter,r):yield this.startNewPlayback(r)}catch(e){yield this.playerRouter.stop(a),yield this.sendContextPlayerError({type:"video_playback_error"})}return this.shouldPrepareDeferredStart(r,a)&&(this.deferredStartPayload=r),r;case"stop":yield this.playerRouter.stop(a);break;case"pause":this.playerRouter.pause(a);break;case"resume":(null===(i=null===(n=this.currentTrack)||void 0===n?void 0:n.track)||void 0===i?void 0:i.metadata["media.live"])&&this.playerRouter.seekTo(a,0),this.deferredStartPayload&&this.shouldPerformDeferredStart(a)&&(this.deferredStartPayload.start_reason="unknown",yield this.startNewPlayback(this.deferredStartPayload)),this.playerRouter.resume(a);break;case"seek_to":{const e=r.position||0;this.isSeekPastStopPosition(e)&&void 0!==this.playerInterruptor&&this.playerInterruptor.unregister(),this.playerRouter.seekTo(a,e/1e3)}break;case"set_stop_position":{const e=r.stop_position;if(void 0!==this.playerInterruptor&&void 0!==e&&(this.playerInterruptor.registerInterruptorWhenReadyAtPosition(e/1e3),null===(o=this.configuration.experimental)||void 0===o?void 0:o.seekToAd)){const t=(e-5e3)/1e3;t>=0&&this.currentStopPosition!==t&&(this.currentStopPosition=t,setTimeout((()=>{var e;null===(e=this.playerRouter)||void 0===e||e.seekTo(a,t)}),1e3))}}break;case"subscribed":case"config":{const e=G(r.config);this.playerRouter.setPreferredSubtitle(e);const t=K(r.config);this.playerRouter.setPlaybackSpeed(t)}}return r}))}shouldPrepareDeferredStart(e,t){var n;return"appload"===e.start_reason&&null===(null===(n=this.playerRouter)||void 0===n?void 0:n.getSessionState(t))}shouldPerformDeferredStart(e){var t;return void 0!==this.deferredStartPayload&&null===(null===(t=this.playerRouter)||void 0===t?void 0:t.getSessionState(e))}sendPlaybackError(e){return dn(this,void 0,void 0,(function*(){const t=this.backendErrorToContextPlayerError(e);t&&(yield this.sendContextPlayerError(t))}))}sendContextPlayerError(e){return this.cosmos.post(`${this.cosmosVideoPlayerEndpoint}/error`,e)}startNewPlayback(e){var t,n,i,o,r,a;return dn(this,void 0,void 0,(function*(){if(!this.playerRouter)return Promise.reject("betamaxPlayer was not set");this.deferredStartPayload&&(this.deferredStartPayload=void 0);const s=null!==(n=null===(t=null==e?void 0:e.track)||void 0===t?void 0:t.track)&&void 0!==n?n:e,c=null!==(o=null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i["media.manifest_id"])&&void 0!==o?o:"";let l="";if(!c){try{l=(e=>{if(!Array.isArray(e)||!e.length)return null;const t=["video/webm"],n=e.filter((e=>t.indexOf(e.mimeType)>-1)).sort(((e,t)=>Math.abs(e.bitrate-640)-Math.abs(t.bitrate-640)));return n.length?n[0].url:null})(JSON.parse(s.metadata["media.manifest"]))||""}catch(e){l=""}l||(l=null!==(a=null===(r=null==s?void 0:s.metadata)||void 0===r?void 0:r.external_url)&&void 0!==a?a:"")}if(!c&&!l){const e=this.makeVideoContextPlayerCoordinatorError("no-source-url","Cannot find a manifest ID nor a source URL in payload");return Promise.reject(e)}const u=function(e){var t;return"true"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.is_advertisement)}(s),d=!u;u||(yield this.stopAndUnloadCurrentTrack());const p=c?this.authTokenCallback:void 0;this.playerConfiguration.networkConfiguration={getAuthorizationHeader:p};const f=F(e);f.desktop_ui="x";const h={mediaUrl:c?nn.E7.create(c):l,isRoyaltyMedia:d,metadata:f},m=K(e.config);this.playerRouter.setPlaybackSpeed(m),this.currentTrack=e.track,this.stallTimeoutMs=function(e){const t=e.track.track.metadata["video.seconds_before_track_stuck"];if(!t)return;const n=Number(t);return Number.isInteger(n)?1e3*n:void 0}(e);const g=(e.seek_to||0)/1e3,_=!e.initially_paused;return this.playerRouter.play(h,{playWhenReady:_,initialPosition:g})}))}getPlaybackRequest(){if(this.playerRouter)return this.playerRouter.getPlaybackRequest()}sendAdvance(e){const t={reason:e};return this.cosmos.post(`${this.cosmosVideoPlayerEndpoint}/advance`,t)}sendPlaybackState(e){var t;if(!e)return Promise.resolve({err:"playbackId is undefined"});const n=null===(t=this.playerRouter)||void 0===t?void 0:t.getSessionState(e);if(!n)return Promise.resolve({err:`no session state for playbackId: '${e}'`});const i=n.duration>-1?Math.floor(1e3*n.duration):-1;if(-1===i)return Promise.resolve({err:"negDuration"});const o=n.currentTime>-1?Math.floor(1e3*n.currentTime):-1,r=n.isPlaying&&!n.isPaused?n.playbackSpeed:0,a={timestamp:(new Date).getTime(),playback_id:e||"",is_paused:n.isPaused,is_buffering:n.isBuffering||!1,playback_speed:r,position_as_of_timestamp:o,duration:i};return this.cosmos.post(`${this.cosmosVideoPlayerEndpoint}/state`,a)}setMinimizeBitrate(e){var t;null===(t=this.playerRouter)||void 0===t||t.setMinimizeBitrate(e)}reportSurface(e){var t;null===(t=this.playerRouter)||void 0===t||t.setSurface(e)}setFullscreen(e){var t;null===(t=this.playerRouter)||void 0===t||t.setFullscreen(e)}setWindow(e){var t;null===(t=this.playerRouter)||void 0===t||t.setWindow(e)}setPip(e){var t,n;return null!==(n=null===(t=this.playerRouter)||void 0===t?void 0:t.setPip(e))&&void 0!==n?n:Promise.resolve(null)}isSeekPastStopPosition(e){const t=this.playerInterruptor?this.playerInterruptor.getStopPosition():void 0;return void 0!==t&&e>=t}shouldResumeCurrentTrack(e,t){return void 0!==t&&(void 0!==this.playerRouter&&this.playerRouter.hasPlaybackId(e.track.playback_id))}resumeCurrentPlayback(e,t){var n;return dn(this,void 0,void 0,(function*(){const i=t.track.playback_id;yield null===(n=this.playerRouter)||void 0===n?void 0:n.switchPlayer(i);const o=K(t.config);if(e.setPlaybackSpeed(o),e.resume(i),void 0!==t.seek_to&&t.seek_to>=0){const n=t.seek_to/1e3;e.seekTo(i,n)}}))}makeVideoContextPlayerCoordinatorError(e,t){const n=new Error(t);return n.name="VideoContextPlayerCoordinatorError",n.reason=e,n}backendErrorToContextPlayerError(e){var t,n;if(!(null===(t=e.network)||void 0===t?void 0:t.responseText)&&!(null===(n=e.network)||void 0===n?void 0:n.httpStatus))return e.code===pn.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE?{type:"video_unsupported_key_system"}:e.category===(0,ht.J0)(fn.DRM)?this.configuration.widevineVersionSupported?{type:"video_playback_error"}:{type:"video_unsupported_client_version"}:"recoverable"===e.severity?null:{type:"unknown"};if(401===e.network.httpStatus)return{type:"video_playback_error"};let i=null;try{if(e.network.responseHeaders&&"content-type"in e.network.responseHeaders){if("application/json"===e.network.responseHeaders["content-type"]&&e.network.responseText){i=JSON.parse(e.network.responseText).reason}}}catch(e){return{type:"unknown"}}switch(i){case"GEO_RESTRICTED":return{type:"video_georestricted"};case"UNSUPPORTED_CLIENT_VERSION":return{type:"video_unsupported_client_version"};case"UNSUPPORTED_PLATFORM_VERSION":return{type:"video_unsupported_platform_version"};case"COUNTRY_RESTRICTED":return{type:"video_country_restricted"};case"UNAVAILABLE":return{type:"video_unavailable"};case"CATALOGUE_RESTRICTED":return{type:"video_catalogue_restricted"};default:return{type:"unknown"}}}stopAndUnloadCurrentTrack(){return dn(this,void 0,void 0,(function*(){this.playerRouter&&(this.currentTrack&&!this.playerRouter.ended&&(yield this.playerRouter.stopAll()),this.currentTrack=void 0,this.stallTimeoutMs=void 0)}))}logBetamaxPlaybackError(e,t,n){var i,o;return dn(this,void 0,void 0,(function*(){const r=yield null===(o=(i=this.configuration).eventSenderProvider)||void 0===o?void 0:o.call(i);r&&(yield r.send((0,y.c)({error_domain:"ContextPlayerCoordinator",error_description:t,error_extra1:JSON.stringify({reason:e,severity:"recoverable"}),error_extra2:JSON.stringify({type:n.type})})))}))}}},202:(e,t,n)=>{"use strict";n.d(t,{l:()=>E});var i,o,r;!function(e){e[e.EMPTY=0]="EMPTY",e[e.TRACK=1]="TRACK",e[e.EPISODE=2]="EPISODE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i||(i={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.MISSING=1]="MISSING",e[e.COMPLETE=2]="COMPLETE",e[e.NOT_APPLICABLE=3]="NOT_APPLICABLE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(o||(o={})),function(e){e[e.OK=0]="OK",e[e.TEMPORARY_ERROR=1]="TEMPORARY_ERROR",e[e.PERMANENT_ERROR=2]="PERMANENT_ERROR",e[e.DISK_FULL=3]="DISK_FULL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(r||(r={}));var a=n(94758),s=n(5538),c=n(60690),l=n(31770),u=n(96015),d=n(7474),p=n.n(d);const f="betamax-offline",h=e=>{var t,n;return null!==(n=null===(t=e.metadata)||void 0===t?void 0:t.episodeUri)&&void 0!==n?n:""},m=({partialAsset:e,progress:t})=>{const n=h(e),i=e.size,o=t>0?Math.round(i/t):-1;return{id:f,download:{link:n,complete:!1,fileSize:o,bytesDownloaded:i,error:r.OK},identify:void 0,remove:void 0,stopDownload:void 0}},g=({offlineAsset:e})=>({id:f,download:{link:h(e),complete:!0,fileSize:e.size,bytesDownloaded:e.size,error:r.OK},identify:void 0,remove:void 0,stopDownload:void 0}),_=({partialAsset:e,error:t})=>{const n=v(t),i=h(e);return{id:f,download:{link:i,complete:!1,fileSize:e.size,bytesDownloaded:e.size,error:n},identify:void 0,remove:void 0,stopDownload:void 0}},v=e=>e.code===p().util.Error.Code.QUOTA_EXCEEDED_ERROR?r.DISK_FULL:r.PERMANENT_ERROR;var y=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class E{constructor(e){this.configuration=e,this.offlineCosmosEndpoint="sp://offline/v2/plugin",this.betamaxPluginId="betamax-offline",this.pluginHeaders={"content-type":"application/json",accept:"application/json"},this.show_service=e.show_service}initialize(){var e,t,n,i,o,r;if(!0!==(null===(t=null===(e=this.configuration.playerConfiguration)||void 0===e?void 0:e.offline)||void 0===t?void 0:t.enabled))return;const c=this.configuration.productState["widevine-license-url"];this.configuration.playerConfiguration.drm={servers:Object.assign(Object.assign({},null===(n=this.configuration.playerConfiguration.drm)||void 0===n?void 0:n.servers),{"com.widevine.alpha":c}),advanced:{"com.widevine.alpha":Object.assign(Object.assign({},null===(i=this.configuration.playerConfiguration.drm)||void 0===i?void 0:i.advanced),{videoRobustness:"SW_SECURE_DECODE"})}},null!==(o=(r=this.configuration.playerConfiguration.offline).downloadObserverFactories)&&void 0!==o||(r.downloadObserverFactories=[]),this.configuration.playerConfiguration.offline.downloadObserverFactories.push((()=>({onDownloadEvent:e=>this.onDownloadEvent(e)})));const u=new s.P(this.configuration.productState["video-manifest-url"]);this.offlineManager=new a.z({networkConfiguration:this.configuration.networkConfiguration,playerConfiguration:this.configuration.playerConfiguration,mediaExtensions:[u]});const d={id:this.betamaxPluginId};this.pluginCosmosSubscription=this.configuration.cosmos.sub(this.offlineCosmosEndpoint,this.onCommandReceived.bind(this),l.wl,d,this.pluginHeaders)}release(){this.offlineManager&&(this.offlineManager.release(),this.offlineManager=void 0),this.pluginCosmosSubscription&&(this.pluginCosmosSubscription.cancel(),this.pluginCosmosSubscription=void 0)}onDownloadEvent(e){return y(this,void 0,void 0,(function*(){const t=(e=>"progress"===e.name?m(e):"completed"===e.name?g(e):"error"===e.name?_(e):void 0)(e);t&&(yield this.configuration.cosmos.post(this.offlineCosmosEndpoint,t,this.pluginHeaders))}))}onCommandReceived(e){return y(this,void 0,void 0,(function*(){if(!this.offlineManager)return Promise.reject("not initialized");if(!e.download&&!e.identify&&!e.remove)return Promise.reject("unknown command");let t;e.download&&(t=yield this.onDownloadCommand(e.download)),e.identify&&(t=yield this.onIdentifyCommand(e.identify)),e.remove&&(yield this.onRemoveCommand(e.remove)),t&&(yield this.configuration.cosmos.post(this.offlineCosmosEndpoint,t,this.pluginHeaders))}))}onDownloadCommand(e){var t;return y(this,void 0,void 0,(function*(){const n={id:this.betamaxPluginId,download:{link:"",complete:!1,fileSize:0,bytesDownloaded:0,error:0},identify:void 0,remove:void 0,stopDownload:void 0},i=e.link,{mediaUri:o,mediaType:a}=yield this.getEpisodeMetadata(i).catch((()=>({mediaUri:void 0,mediaType:void 0})));return void 0===o||void 0===a?(n.download&&(n.download.error=r.TEMPORARY_ERROR),n):this.isVideo(a)?void(yield null===(t=this.offlineManager)||void 0===t?void 0:t.download(o,{episodeUri:i})):(n.download&&(n.download.error=r.PERMANENT_ERROR),n)}))}onIdentifyCommand(e){var t,n;return y(this,void 0,void 0,(function*(){const i={};for(const{link:r}of e.query){const e={status:o.UNRECOGNIZED,estimatedFileSize:0},{mediaUri:a,mediaType:s}=yield this.getEpisodeMetadata(r).catch((()=>({mediaUri:void 0,mediaType:void 0})));if(void 0!==a&&void 0!==s&&this.isVideo(s)){const i=yield null===(t=this.offlineManager)||void 0===t?void 0:t.getOfflineAsset(a);e.status=void 0===i?o.MISSING:o.COMPLETE,e.estimatedFileSize=null!==(n=null==i?void 0:i.size)&&void 0!==n?n:0}else e.status=o.NOT_APPLICABLE;i[r]=e}const r={id:this.betamaxPluginId,download:void 0,identify:{results:i},remove:void 0,stopDownload:void 0};return Promise.resolve(r)}))}onRemoveCommand(e){var t;return y(this,void 0,void 0,(function*(){for(const{link:n}of e.query){const{mediaUri:e,mediaType:i}=yield this.getEpisodeMetadata(n);void 0!==i&&void 0!==e&&this.isVideo(i)&&(yield null===(t=this.offlineManager)||void 0===t?void 0:t.delete(e))}}))}getEpisodeMetadata(e){var t,n,i,o;return y(this,void 0,void 0,(function*(){if(void 0===e.split(":").pop())return Promise.reject(`unexpected uri ${e}`);if(void 0===this.show_service)return Promise.reject("show service is not initialized");const r=yield this.show_service.getDecorate(u.jj.fromPartial({item:[e]})),a=null===(n=null===(t=r.response)||void 0===t?void 0:t.episode[0].episodeMetadata)||void 0===n?void 0:n.mediaTypeEnum,s=null===(o=null===(i=r.response)||void 0===i?void 0:i.episode[0].episodeMetadata)||void 0===o?void 0:o.manifestId;let l;return s&&(l=c.E7.create(s)),{mediaUri:l,mediaType:a}}))}isVideo(e){return 0===e||2===e}}},83677:(e,t,n)=>{"use strict";function i(e){return{name:"BetamaxPlaybackErrorDevice",environments:["device","desktop"],data:e}}n.d(t,{c:()=>i})},94811:(e,t,n)=>{"use strict";n.d(t,{OK:()=>a,Tc:()=>c,lB:()=>s});var i=n(7474),o=n.n(i);const r=n(99246),a=o().polyfill,s=r.version,c=o().Player.version},94758:(e,t,n)=>{"use strict";n.d(t,{z:()=>p});n(46758),n(53321),n(45205),n(27082),n(86277);var i=n(7474),o=n.n(i),r=n(15819),a=n(72275);const s=(e,t)=>t.filter((e=>"variant"===e.type)).sort(((t,n)=>{const i=Math.abs(e-t.bandwidth);return Math.abs(e-n.bandwidth)-i})).pop();var c=n(31770),l=n(76155),u=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const d=12e5;class p{constructor(e){var t,n,i,a,s,c,l;if(this.config=e,this.offlineBitrateTarget=d,this.shakaStorage=new(o().offline.Storage),this.ongoingDownloads=new Map,this.offlineBitrateTarget=(null===(n=null===(t=null==e?void 0:e.playerConfiguration)||void 0===t?void 0:t.offline)||void 0===n?void 0:n.targetBitrate)||d,this.shakaStorage.configure({offline:{trackSelectionCallback:this.selectTracks.bind(this),progressCallback:this.notifyDownloadProgress.bind(this)},drm:{servers:null===(a=null===(i=null==e?void 0:e.playerConfiguration)||void 0===i?void 0:i.drm)||void 0===a?void 0:a.servers,advanced:null===(c=null===(s=null==e?void 0:e.playerConfiguration)||void 0===s?void 0:s.drm)||void 0===c?void 0:c.advanced}}),null===(l=this.config)||void 0===l?void 0:l.networkConfiguration){const e=this.shakaStorage.getNetworkingEngine();(0,r.K)(e,this.config.networkConfiguration)}}release(){this.ongoingDownloads=new Map}download(e,t){var n,i,o,r,s,d,p;return u(this,void 0,void 0,(function*(){if(this.ongoingDownloads.has(e)){const t={reason:"Download already started",error_extra1:e};return Promise.reject(t)}const u=null!==(i=(0,c.jj)(e,null===(n=this.config)||void 0===n?void 0:n.mediaExtensions))&&void 0!==i?i:e;let f={offlineUrl:null,mediaUri:e,originalUrl:u,duration:0,size:0};const h={partialAsset:f,observers:null!==(p=null===(d=null===(s=null===(r=null===(o=this.config)||void 0===o?void 0:o.playerConfiguration)||void 0===r?void 0:r.offline)||void 0===s?void 0:s.downloadObserverFactories)||void 0===d?void 0:d.map((e=>e())))&&void 0!==p?p:[]};if(this.ongoingDownloads.set(e,h),this.notifyObservers(h,{name:"created",mediaUri:e}),yield this.isAssetOffline(e)){const t={reason:"Already downloaded"};return this.ongoingDownloads.delete(e),this.notifyObservers(h,{name:"error",partialAsset:f,error:t}),Promise.reject(t)}const m={mediaUri:e,downloadSessionId:(0,c.H7)(),downloadDate:new Date,consumerMetadata:t},g=this.shakaStorage.store(u,m);let _;h.shakaOperation=g,this.ongoingDownloads.set(e,h);try{if(_=yield g.promise,!this.isFullyDownloaded(_)){const t={reason:"Download completed but unavailable"};return this.ongoingDownloads.delete(e),this.notifyObservers(h,{name:"error",partialAsset:f,error:t}),yield Promise.reject(t)}return f=this.shakaStoredContentToOfflineAsset(_),this.ongoingDownloads.delete(e),this.notifyObservers(h,{name:"completed",offlineAsset:f}),f}catch(n){if((0,l.ZW)(n)){const i=function(e,t){return{reason:(0,a.zq)(e.code),code:e.code,category:(0,a.J0)(e.category),error_extra1:JSON.stringify(e.data),error_extra2:JSON.stringify(t)}}(n,t);return this.ongoingDownloads.delete(e),this.notifyObservers(h,{name:"error",partialAsset:f,error:i}),Promise.reject(i)}return Promise.reject(n)}}))}getOfflineAsset(e){return u(this,void 0,void 0,(function*(){return(yield this.getOfflineAssets()).find((t=>t.mediaUri===e))}))}getOngoingDownloads(){const e=[];return this.ongoingDownloads.forEach(((t,n)=>{e.push(n)})),e}isAssetOffline(e){return u(this,void 0,void 0,(function*(){return void 0!==(yield this.getOfflineAsset(e))}))}getPlayableOfflineUrl(e){var t;return u(this,void 0,void 0,(function*(){const n=yield this.getOfflineAsset(e);return null!==(t=null==n?void 0:n.offlineUrl)&&void 0!==t?t:null}))}getOfflineAssets(){return u(this,void 0,void 0,(function*(){return(yield this.shakaStorage.list()).filter(this.isFullyDownloaded).map(this.shakaStoredContentToOfflineAsset)}))}delete(e){var t;return u(this,void 0,void 0,(function*(){const n=this.ongoingDownloads.get(e);if(n){const i=n.partialAsset;return yield null===(t=n.shakaOperation)||void 0===t?void 0:t.abort(),this.ongoingDownloads.delete(e),this.notifyObservers(n,{name:"cancelled",partialAsset:i}),!0}const i=yield this.getOfflineAsset(e);return!!(null==i?void 0:i.offlineUrl)&&(yield this.shakaStorage.remove(i.offlineUrl),!0)}))}deleteAll(){return u(this,void 0,void 0,(function*(){yield o().offline.Storage.deleteAll()}))}notifyObservers(e,t){e.observers.forEach((e=>e.onDownloadEvent(t)))}notifyDownloadProgress(e,t){const n=e.appMetadata,i=null==n?void 0:n.mediaUri,o=this.shakaStoredContentToOfflineAsset(e),r=this.ongoingDownloads.get(i);r&&(r.partialAsset=o,this.notifyObservers(r,{name:"progress",partialAsset:o,progress:t}))}selectTracks(e){return[s(this.offlineBitrateTarget,e)]}isFullyDownloaded(e){return null!==e.offlineUri}shakaStoredContentToOfflineAsset(e){var t;const n=isFinite(e.expiration)?new Date(e.expiration):void 0,i=e.appMetadata;return{mediaUri:i.mediaUri,originalUrl:e.originalManifestUri,offlineUrl:null!==(t=e.offlineUri)&&void 0!==t?t:null,duration:e.duration,size:e.size,expirationDate:n,downloadSessionId:i.downloadSessionId,downloadDate:i.downloadDate,metadata:i.consumerMetadata}}}},15819:(e,t,n)=>{"use strict";n.d(t,{K:()=>a});n(46758),n(2836);var i=n(7474),o=n.n(i),r=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function a(e,t){null==e||e.registerRequestFilter(function(e){return(t,n)=>r(this,void 0,void 0,(function*(){if((t===o().net.NetworkingEngine.RequestType.LICENSE||t===o().net.NetworkingEngine.RequestType.MANIFEST)&&(e.getAuthorizationHeader&&(n.headers.Authorization=yield e.getAuthorizationHeader()),t===o().net.NetworkingEngine.RequestType.MANIFEST&&e.getWebgateHeaders)){const t=e.getWebgateHeaders().reduce(((e,t)=>(e[t[0]]=t[1],e)),{});n.headers=Object.assign(Object.assign({},n.headers),t)}}))}(t))}},72275:(e,t,n)=>{"use strict";n.d(t,{Ft:()=>s,J0:()=>a,SY:()=>l,Yt:()=>u,tE:()=>c,zq:()=>r});n(46758),n(53321),n(55115),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);var i=n(7474),o=n.n(i);function r(e){for(const[t,n]of Object.entries(o().util.Error.Code))if(n===e)return t;return"unknown"}function a(e){for(const[t,n]of Object.entries(o().util.Error.Category))if(n===e)return t;return"unknown"}function s(e){switch(e){case o().util.Error.Severity.CRITICAL:return"fatal";case o().util.Error.Severity.RECOVERABLE:return"recoverable";default:return"unknown"}}function c(e){switch(e.code){case o().util.Error.Code.TIMEOUT:case o().util.Error.Code.HTTP_ERROR:return!0}return!1}function l(e){var t;return(null!==(t=e.textStreams)&&void 0!==t?t:[]).flatMap((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.segmentIndex)||void 0===t?void 0:t.get(0))||void 0===n?void 0:n.getUris())&&void 0!==i?i:[]})).filter((e=>e))}const u=e=>{var t,n,i,o,r,a,s,c,l,u,d,p,f,h,m,g,_,v,y;const E=null==e?void 0:e.audio,b=null==e?void 0:e.video,S=[];(null==b?void 0:b.codecs)&&S.push(b.codecs),(null==E?void 0:E.codecs)&&S.push(E.codecs);const A=[];b&&A.push(b.mimeType),E&&A.push(E.mimeType);const T=[];E&&T.push(E.kind),b&&T.push(b.kind);const O=new Set;if(E)for(const e of E.roles)O.add(e);if(b)for(const e of b.roles)O.add(e);return{id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null!==(t=null==E?void 0:E.label)&&void 0!==t?t:null,kind:null!==(n=T[0])&&void 0!==n?n:null,width:null!==(i=null==b?void 0:b.width)&&void 0!==i?i:null,height:null!==(o=null==b?void 0:b.height)&&void 0!==o?o:null,frameRate:null!==(r=null==b?void 0:b.frameRate)&&void 0!==r?r:null,pixelAspectRatio:null!==(a=null==b?void 0:b.pixelAspectRatio)&&void 0!==a?a:null,hdr:null,mimeType:A[0]||null,audioMimeType:null!==(s=null==E?void 0:E.mimeType)&&void 0!==s?s:null,videoMimeType:null!==(c=null==b?void 0:b.mimeType)&&void 0!==c?c:null,codecs:S.join(", "),audioCodec:null!==(l=null==E?void 0:E.codecs)&&void 0!==l?l:null,videoCodec:null!==(u=null==b?void 0:b.codecs)&&void 0!==u?u:null,primary:e.primary,roles:Array.from(O),audioRoles:null!==(d=null==E?void 0:E.roles)&&void 0!==d?d:null,forced:!1,videoId:null!==(p=null==b?void 0:b.id)&&void 0!==p?p:null,audioId:null!==(f=null==E?void 0:E.id)&&void 0!==f?f:null,channelsCount:null!==(h=null==E?void 0:E.channelsCount)&&void 0!==h?h:null,audioSamplingRate:null!==(m=null==E?void 0:E.audioSamplingRate)&&void 0!==m?m:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null!==(g=null==E?void 0:E.bandwidth)&&void 0!==g?g:null,videoBandwidth:null!==(_=null==b?void 0:b.bandwidth)&&void 0!==_?_:null,originalVideoId:null!==(v=null==b?void 0:b.originalId)&&void 0!==v?v:null,originalAudioId:null!==(y=null==E?void 0:E.originalId)&&void 0!==y?y:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null}}},76155:(e,t,n)=>{"use strict";function i(e){return null!==e&&"object"==typeof e&&"category"in e&&"code"in e&&"severity"in e}function o(e){return null!==e&&"object"==typeof e&&"type"in e&&"detail"in e&&"error"===e.type}function r(e){return null!==e&&"object"==typeof e&&"category"in e&&"code"in e&&"severity"in e&&"handled"in e}n.d(t,{Ry:()=>i,ZW:()=>r,u6:()=>o})},5538:(e,t,n)=>{"use strict";n.d(t,{P:()=>c});var i=n(7474),o=n.n(i),r=(n(46758),n(53321),n(27082),n(86277),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527),n(30771));class a{constructor(){this.curId_=0,this.config_=null,this.data=null,this.profileInitSegmentReferences=new Map,this.UNSUPPORTED_MIME_TYPES=["video/mp2t"],this.PROFILE_ID_PLACEHOLDER="{{profile_id}}",this.FILE_TYPE_PLACEHOLDER="{{file_type}}",this.SEGMENT_TIMESTAMP_PLACEHOLDER="{{segment_timestamp}}",this.LANGUAGE_CODE_PLACEHOLDER="{{language_code}}",this.stop=()=>Promise.resolve(),this.loadData_=e=>{let t=null;if(e instanceof ArrayBuffer){const n=o().util.StringUtils.fromUTF8(e);try{t=JSON.parse(n)}catch(e){const t=e;throw new(o().util.Error)(o().util.Error.Severity.CRITICAL,o().util.Error.Category.MANIFEST,o().util.Error.Code.MISSING_TEXT_PLUGIN,`Exception parsing the Json manifest: ${t.message}`)}}else t=e;if(!t)throw new(o().util.Error)(o().util.Error.Severity.CRITICAL,o().util.Error.Category.MANIFEST,o().util.Error.Code.MISSING_TEXT_PLUGIN,"Invalid JSON");return t},this.groupProfiles_=e=>{const t=[],n=[];if(e.forEach((e=>{const i=e.mime_type.split("/")[0];"video"===i?t.push(e):"audio"===i&&n.push(e)})),!t.length&&!n.length)return[];if(t.length&&!n.length)return t.map((e=>({video:e,audio:null})));if(!t.length&&n.length)return n.map((e=>({video:null,audio:e})));const i=[];return t.forEach((e=>{n.forEach((t=>{i.push({video:e,audio:t})}))})),i}}configure(e){this.config_=e}start(e,t){if((0,r.Y)("betamax::manifestparser_start"),!this.config_)throw new Error("Must call configure() before start()");const n=o().net.NetworkingEngine.RequestType.MANIFEST,i={uris:[e],method:"GET",retryParameters:this.config_.retryParameters,allowCrossSiteCredentials:!1,headers:{},body:null,drmInfo:null,initData:null,initDataType:null,licenseRequestType:null,sessionId:null,streamDataCallback:null};return t.networkingEngine.request(n,i).promise.then((e=>this.loadManifest_(e.data)))}onExpirationUpdated(){}update(){}loadManifest_(e){(0,r.Y)("betamax::manifestparser_loadManifestStart"),this.data=this.loadData_(e);const t=new(o().media.PresentationTimeline)(null,0);t.setDuration(this.data.end_time_millis/1e3);const n=this.data.contents[0];this.profileInitSegmentReferences=new Map;const i=this.filterProfiles_(n.profiles),a={presentationTimeline:t,minBufferTime:0,offlineSessionIds:[],variants:this.groupProfiles_(i).map((e=>this.loadVariant_(n,e))),textStreams:this.loadTextStreams_(n),imageStreams:[],sequenceMode:!1,ignoreManifestTimestampsInSegmentsMode:!1,type:"",serviceDescription:{}};return(0,r.Y)("betamax::manifestparser_loadManifest_end"),a}filterProfiles_(e){return e.filter((e=>!this.UNSUPPORTED_MIME_TYPES.includes(e.mime_type)))}loadVariant_(e,t){const n=e.encryption_infos&&e.encryption_infos.length>0,i=(t.video?t.video.video_bitrate:0)+(t.audio?t.audio.audio_bitrate:0);return{id:this.curId_++,language:"und",primary:!1,audio:t.audio?this.loadStream_(e,t.audio,"audio",n):null,video:t.video?this.loadStream_(e,t.video,"video",n):null,bandwidth:i,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[],disabledUntilTime:0}}loadTextStreams_(e){var t,n;let i=[];return(null===(n=null===(t=this.data)||void 0===t?void 0:t.subtitle_language_codes)||void 0===n?void 0:n.length)&&(i=this.data.subtitle_language_codes.map((e=>({id:this.curId_++,mime_type:"text/vtt",file_type:"vtt",language:e})))),i.map((t=>this.loadStream_(e,t,"text",!1)))}loadStream_(e,t,n,i){const o=this.getSegmentIndex_(e,t,n);let r="";"video"===n&&(r=t.video_codec),"audio"===n&&(r=t.audio_codec);const a={keySystem:"com.widevine.alpha",licenseServerUri:"",audioRobustness:"",videoRobustness:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!0,initData:[],keyIds:new Set,serverCertificateUri:"",serverCertificate:null,sessionType:"temporary"},s=i?[a]:[];return{id:this.curId_++,createSegmentIndex:()=>Promise.resolve(),segmentIndex:o,mimeType:t.mime_type,codecs:r,bandwidth:t.max_bitrate,width:"video"===n?t.video_width:void 0,height:"video"===n?t.video_height:void 0,kind:"text"===n?"subtitles":void 0,encrypted:i,keyIds:new Set,language:"text"===n?t.language:"und",type:n,primary:!1,roles:[],drmInfos:s,closedCaptions:new Map,spatialAudio:!1,trickModeVideo:null,audioSamplingRate:null,forced:!1,channelsCount:null,label:null,emsgSchemeIdUris:null,originalId:null,external:!1,accessibilityPurpose:null,originalLanguage:null}}getInitSegmentReference_(e){if(this.profileInitSegmentReferences.has(e))return this.profileInitSegmentReferences.get(e);const t=new(o().media.InitSegmentReference)((()=>{var t,n;return null!==(n=null===(t=this.data)||void 0===t?void 0:t.base_urls.map((t=>{var n,i;return(t+(null!==(i=null===(n=this.data)||void 0===n?void 0:n.initialization_template)&&void 0!==i?i:"")).replace(this.PROFILE_ID_PLACEHOLDER,`${e.id}`).replace(this.FILE_TYPE_PLACEHOLDER,e.file_type)})))&&void 0!==n?n:[]}),0,null);return this.profileInitSegmentReferences.set(e,t),t}getSegmentIndex_(e,t,n){let i=[];const r=e.start_time_millis/1e3,a=e.end_time_millis/1e3;if("text"===n){const e=t,n=()=>{var t;return(null===(t=this.data)||void 0===t?void 0:t.subtitle_base_urls)?this.data.subtitle_base_urls.map((t=>{var n,i;return(t+(null!==(i=null===(n=this.data)||void 0===n?void 0:n.subtitle_template)&&void 0!==i?i:"")).replace(this.LANGUAGE_CODE_PLACEHOLDER,e.language)})):[]};i=[new(o().media.SegmentReference)(r,a,n,0,null,null,r,r,1/0)]}else{const n=e.segment_length;let o=r;for(;o{var n,i;return null!==(i=null===(n=this.data)||void 0===n?void 0:n.base_urls.map((n=>{var i,o;return(n+(null!==(o=null===(i=this.data)||void 0===i?void 0:i.segment_template)&&void 0!==o?o:"")).replace(this.PROFILE_ID_PLACEHOLDER,`${e.id}`).replace(this.FILE_TYPE_PLACEHOLDER,e.file_type).replace(this.SEGMENT_TIMESTAMP_PLACEHOLDER,`${t}`)})))&&void 0!==i?i:[]}),0,null,r,i,i,1/0)}}var s=n(60690);class c{constructor(e){this.manifestTemplate=e;const t=()=>new a;o().media.ManifestParser.registerParserByExtension("json",t),o().media.ManifestParser.registerParserByMime("application/json",t)}isPlayable(e){return e.startsWith(s.PE)}getMediaUrl(e){const t=e.replace(s.PE,"");return(0,s.qs)(this.manifestTemplate,"json",t)}}},60690:(e,t,n)=>{"use strict";n.d(t,{E7:()=>o,PE:()=>i,qs:()=>r});const i="spotify-video://";class o{static create(e){return`${i}${e}`}}function r(e,t,n){return e.replace(/\{type\}/i,t).replace(/\{source_id\}/i,encodeURIComponent(n))}},86106:(e,t,n)=>{"use strict";var i,o,r;n.d(t,{N8:()=>r,n0:()=>o,w0:()=>i}),function(e){e.INITIAL="initial",e.SEEK="seek",e.STALL="stall"}(i||(i={})),function(e){e.PLAYED_TO_END="played-to-end",e.FATAL_ERROR="error",e.REQUESTED="requested-end",e.SHUTDOWN="shutdown",e.NETWORK_ERROR="network-error",e.UNEXPECTED_EXIT="unexpected-exit"}(o||(o={})),function(e){e.CREATED="created",e.MANIFEST_LOADING="manifestLoading",e.MANIFEST_LOADED="manifestLoaded",e.ENCRYPTION_KEY_LOADING="encryptionKeyLoading",e.ENCRYPTION_KEY_LOADED="encryptionKeyLoaded",e.BUFFERING="buffering",e.DROPPED_FRAMES="droppedFrames",e.READY="ready",e.MEDIA_METADATA_CHANGED="mediaMetadataChanged",e.PAUSED="paused",e.STARTED="started",e.RESUMED="resumed",e.SEEKING="seeking",e.SEEKED="seeked",e.ENDED="ended",e.ERROR="error",e.BYTES_TRANSFERRED="bytesTransferred",e.SUBTITLE_CHANGED="subtitleChanged",e.VIDEO_FORMAT_CHANGED="videoFormatChanged",e.AUDIO_FORMAT_CHANGED="audioFormatChanged",e.FULLSCREEN_CHANGED="fullscreenChanged",e.SURFACE_CHANGED="surfaceChanged",e.MINIMIZE_BITRATE_CHANGED="minimizeBitrateChanged",e.VOLUME_CHANGED="volumeChanged",e.PROGRESS="progress",e.POSITION_UPDATE="positionUpdate",e.DURATION_CHANGED="durationChanged",e.NEW_SESSION_LOADED="newSessionLoaded",e.PLAYBACK_SPEED_CHANGED="playbackSpeedChanged",e.RESUME_REQUESTED="resumeRequested"}(r||(r={}))},69383:(e,t,n)=>{"use strict";n.d(t,{w:()=>m});var i=n(81337),o=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class r{constructor(e=!0){this.stopOnError=e,this.store=[],this.pendingPromise=!1,this.paused=!1,this.emptyQueueResolver=()=>{}}push(e,t){return new Promise(((n,i)=>{this.store.push({action:e,resolve:n,reject:i,preRunCheck:t}),this.pop()}))}unshift(e,t){return new Promise(((n,i)=>{this.store.unshift({action:e,resolve:n,reject:i,preRunCheck:t}),this.pop()}))}pause(){this.paused=!0}resume(){return o(this,void 0,void 0,(function*(){return this.paused=!1,this.pop()}))}waitForIdle(){return 0!==this.size()||this.pendingPromise?new Promise((e=>{const t=this.emptyQueueResolver;this.emptyQueueResolver=()=>{t(),e()}})):Promise.resolve()}size(){return this.store.length}clearPendingQueue(){const e=this.size();return this.store=[],e}pop(){return o(this,void 0,void 0,(function*(){if(this.paused)return!1;if(this.pendingPromise)return!1;const e=this.store.shift();if(!e)return!1;try{if(!e.preRunCheck||e.preRunCheck()){this.pendingPromise=!0;const t=yield e.action();this.pendingPromise=!1,e.resolve(t)}this.pop()}catch(t){this.pendingPromise=!1,e.reject(t),this.stopOnError||this.pop()}return 0!==this.size()||this.pendingPromise||this.emptyQueueResolver(),!0}))}}var a=n(86106);function s(e){switch(e){case"unknown":return i.VL.PLAY_REASON_UNKNOWN;case"appload":return i.VL.PLAY_REASON_APP_LOAD;case"backbtn":return i.VL.PLAY_REASON_BACK_BTN;case"clickrow":return i.VL.PLAY_REASON_CLICK_ROW;case"clickside":return i.VL.PLAY_REASON_CLICK_SIDE;case"endplay":return i.VL.PLAY_REASON_END_PLAY;case"fwdbtn":return i.VL.PLAY_REASON_FWD_BTN;case"interupted":return i.VL.PLAY_REASON_INTERRUPTED;case"logout":return i.VL.PLAY_REASON_LOGOUT;case"playbtn":return i.VL.PLAY_REASON_PLAY_BTN;case"popup":return i.VL.PLAY_REASON_POPUP;case"remote":return i.VL.PLAY_REASON_REMOTE;case"songdone":return i.VL.PLAY_REASON_SONG_DONE;case"trackdone":return i.VL.PLAY_REASON_TRACK_DONE;case"trackerror":return i.VL.PLAY_REASON_TRACK_ERROR;case"preview":return i.VL.PLAY_REASON_PREVIEW;case"uriopen":return i.VL.PLAY_REASON_URI_OPEN;case"backgrounded":return i.VL.PLAY_REASON_BACKGROUNDED;case"offline":return i.VL.PLAY_REASON_OFFLINE;case"unexpected-exit":return i.VL.PLAY_REASON_UNEXPECTED_EXIT;case"unexpected-exit-while-paused":return i.VL.PLAY_REASON_UNEXPECTED_EXIT_WHILE_PAUSED;default:return i.VL.UNRECOGNIZED}}function c(e){switch(e){case"none":case"":return i.lS.STREAMING_RULE_NONE;case"dmca-radio":return i.lS.STREAMING_RULE_DMCA_RADIO;case"preview":return i.lS.STREAMING_RULE_PREVIEW;case"wifi":return i.lS.STREAMING_RULE_WIFI;case"shuffle-mode":return i.lS.STREAMING_RULE_SHUFFLE_MODE;default:throw new Error(`Unrecognized StreamingRule ${e}`)}}function l(e){if(e.length%2!=0)throw new Error("Invalid encoding!");const t=e.length/2,n=new Array(t);for(let i=0,o=0;ip(this,void 0,void 0,(function*(){return void 0===this.streamHandle&&(yield Promise.reject("A valid stream handle does not exist")),e.streamHandle=this.streamHandle,e})),this.streamReportingService=e,this.requestQueue=new r,this.productStateProvider=t,this.eventSender=n}getHandle(){return this.streamHandle}onPlaybackCreated({playbackIdentity:e,initialConfiguration:t,timeObservable:n}){if(this.playbackSpeed=t.playbackSpeed,this.currentPositionMs=Math.round(t.position*this.SECONDS_TO_MILLISECONDS),this.playbackIdentity=e,this.metadata=e.metadata,!this.metadata)throw new Error("Metadata does not exist on PlaybackIdentity");this.timeObservable=n,this.nextPlaybackRequest=void 0,this.addPeriodicObserver()}onStarted({position:e},t){var n,o,r,a;if(this.paused=!1,this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS),!this.playbackIdentity)throw new Error("PlaybackIdentity not found on started event");if(!this.metadata)throw new Error("Metadata not found on started event");const u=i.Ce.fromPartial({playbackId:l(this.metadata.playback_id),playbackStack:i.dU.BETAMAX,videoSessionId:this.playbackIdentity.sessionId,playContext:this.metadata.endvideo_play_context,contentUri:this.metadata.endvideo_play_track,provider:this.metadata.endvideo_provider,referrer:this.metadata.endvideo_referrer,streamingRule:c(this.productStateProvider.streamingRules()),connectControllerDeviceId:this.metadata.endvideo_gaia_dev_id,pageInstanceId:null===(n=this.playbackIdentity.metadata)||void 0===n?void 0:n.page_instance_id,interactionId:null===(o=this.playbackIdentity.metadata)||void 0===o?void 0:o.interaction_id,reasonStart:s(this.metadata.endvideo_reason_start),isShuffle:"true"===this.metadata.endvideo_shuffle,isIncognito:this.productStateProvider.isIncognito(),clientOffline:"true"===this.metadata.endvideo_client_offline,mediaId:null===(r=this.metadata)||void 0===r?void 0:r["media.manifest_id"],mediaType:i.DD.VIDEO,playbackStartTime:t.toString(),startPosition:this.currentPositionMs.toString(),isLive:"live"===this.streamingType,contentIsDownloaded:"offline"===this.streamingType,featureUuid:null===(a=this.metadata)||void 0===a?void 0:a[d.I.FEATURE_UUID]});this.requestQueue.push((()=>this.streamReportingService.streamStart(u).then((e=>{var t,n;if((null===(t=e.status)||void 0===t?void 0:t.statusCode)!==i.GL.SUCCESS)throw new f("Error returned from StreamReportingService.StreamStart",null===(n=e.status)||void 0===n?void 0:n.statusCode);this.streamHandle=e.streamHandle})).catch((e=>this.handleFailure(e)))),(()=>!this.streamHandle)),this.enqueueStreamProgressRequest()}onResumed({position:e}){this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS),this.paused&&(this.paused=!1,this.enqueueStreamProgressRequest())}onPaused({position:e}){this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS),this.paused=!0,this.enqueueStreamProgressRequest()}onMediaMetadataChanged({streamingType:e}){this.streamingType=e}onSeeking(){this.seekInProgress=!0,this.requestQueue.pause()}onSeeked({fromPosition:e,toPosition:t}){this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS);const n=i.LI.fromPartial({fromPosition:Math.round(e*this.SECONDS_TO_MILLISECONDS).toString(),toPosition:Math.round(t*this.SECONDS_TO_MILLISECONDS).toString()});this.requestQueue.unshift((()=>this.streamHandleTask(n).then((e=>this.streamReportingService.streamSeek(e))).then((e=>this.handleStatusResponse(e,"StreamSeek"))).catch((e=>this.handleFailure(e)))),this.streamStartedPreRunCheck()),this.enqueueStreamProgressRequest(!0),this.seekInProgress=!1,this.requestQueue.resume()}onEndingPlayback({playbackRequest:e}){this.nextPlaybackRequest=e}onPlaybackEnded({reason:e,position:t}){var n,o,r;return p(this,void 0,void 0,(function*(){this.removePeriodicObserver(),yield this.requestQueue.resume(),this.currentPositionMs=Math.round(t*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest();const c=void 0!==(null===(o=null===(n=this.nextPlaybackRequest)||void 0===n?void 0:n.metadata)||void 0===o?void 0:o.endvideo_reason_start)?s(null===(r=this.nextPlaybackRequest.metadata)||void 0===r?void 0:r.endvideo_reason_start):function(e){switch(e){case a.n0.FATAL_ERROR:case a.n0.NETWORK_ERROR:return i.VL.PLAY_REASON_TRACK_ERROR;case a.n0.PLAYED_TO_END:return i.VL.PLAY_REASON_TRACK_DONE;case a.n0.REQUESTED:case a.n0.SHUTDOWN:return i.VL.PLAY_REASON_END_PLAY;default:throw new Error(`Unexpectedly hit unreachable code! Unhandled discriminated union member: ${JSON.stringify(e)}`)}}(e),l=i.OE.fromPartial({reasonEnd:c});this.requestQueue.push((()=>this.streamHandleTask(l).then((e=>this.streamReportingService.streamEnd(e))).then((e=>this.handleStatusResponse(e,"StreamEnd"))).catch((e=>this.handleFailure(e))).finally((()=>{this.streamHandle=void 0;const e=this.requestQueue.clearPendingQueue();if(e>0)throw new Error(`Cleared ${e} pending tasks after onPlaybackEnded. Once end is received, no additional updates are expected.`)}))),this.streamStartedPreRunCheck())}))}onFullscreenChanged({fullscreen:e,position:t}){this.fullscreen=e,this.currentPositionMs=Math.round(t*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest()}onPlaybackSpeedChanged({position:e,speed:t}){this.playbackSpeed=t,this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest()}queueWaitForIdle(){return this.requestQueue.waitForIdle()}addPeriodicObserver(){void 0===this.periodicEventsObserverToken&&void 0!==this.timeObservable&&(this.periodicEventsObserverToken=this.timeObservable.addObserverForPeriodicEvents(this.PERIODIC_STREAM_REPORTING_INTERVAL_IN_SEC,(e=>{this.seekInProgress||(this.currentPositionMs=Math.round(e*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest())})))}removePeriodicObserver(){void 0!==this.periodicEventsObserverToken&&void 0!==this.timeObservable&&(this.timeObservable.removePeriodicObserver(this.periodicEventsObserverToken),this.periodicEventsObserverToken=void 0)}sendPlaybackError(e,t,n){var i,o,r,a,s,c;this.eventSender.send((0,u.c)({feature_identifier:null===(o=null===(i=this.playbackIdentity)||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.feature_identifier,media_url:null===(r=this.metadata)||void 0===r?void 0:r.endvideo_play_track,session_id:null===(a=this.playbackIdentity)||void 0===a?void 0:a.sessionId,error_domain:"StreamReportingTracker",error_code:t,error_description:e,error_extra1:JSON.stringify({reason:n,severity:"recoverable"}),error_extra2:null===(s=this.metadata)||void 0===s?void 0:s.playback_id,desktop_ui:null===(c=this.metadata)||void 0===c?void 0:c.desktop_ui}))}handleStatusResponse(e,t){if(e.statusCode!==i.GL.SUCCESS)throw this.streamHandle=void 0,new f(`Error returned from StreamReportingService.${t}`,e.statusCode)}handleFailure(e){this.requestQueue.clearPendingQueue(),e instanceof f?this.sendPlaybackError(e.reason,e.responseStatusCode,e.responseReason):e instanceof Error?this.sendPlaybackError(e.message):this.sendPlaybackError(e)}streamStartedPreRunCheck(){return()=>!!this.streamHandle}enqueueStreamProgressRequest(e=!1){const t=i.Mk.fromPartial({currentPosition:this.currentPositionMs.toString(),isPaused:this.paused,isPlayingVideo:!0,isFullscreen:this.fullscreen,playbackSpeed:this.playbackSpeed,playbackState:this.paused?i.q9.PAUSED:i.q9.ACTIVE}),n=()=>this.streamHandleTask(t).then((e=>this.streamReportingService.streamProgress(e))).then((e=>this.handleStatusResponse(e,"StreamProgress"))).catch((e=>this.handleFailure(e)));e?this.requestQueue.unshift(n,this.streamStartedPreRunCheck()):this.requestQueue.push(n,this.streamStartedPreRunCheck())}}const m=(e,t,n)=>o=>o.isRoyaltyMedia?new h(new i.Dx(e),t,n):null},3857:(e,t,n)=>{"use strict";var i,o;n.d(t,{I:()=>o,k:()=>i}),function(e){e.SESSION_ID="session_id",e.MEDIA_URL="media_url",e.MS_START_POSITION="ms_start_position",e.MS_DURATION="ms_duration",e.MS_START_TIME="ms_start_time",e.MS_MANIFEST_LOAD_TIME="ms_manifest_load_time",e.MS_ENCRYPTION_LOAD_TIME="ms_encryption_load_time",e.MS_INITIAL_BUFFERING="ms_initial_buffering",e.MS_PLAYED="ms_played",e.MS_PLAYED_NOMINAL="ms_played_nominal",e.MS_PLAYED_SUBTITLES="ms_played_subtitles",e.MS_PLAYED_FULLSCREEN="ms_played_fullscreen",e.MS_PLAYED_PER_SURFACE="ms_played_per_surface",e.MS_PLAYED_VIDEO_DISABLED="ms_played_video_disabled",e.ENCRYPTION_TYPE="encryption_type",e.EXIT_REASON="exit_reason",e.LAST_USED_SUBTITLE="last_used_subtitle",e.N_STALLS="n_stalls",e.MS_BUFFERING_STALL="ms_buffering_stall",e.MS_BUFFERING_STALL_LONGEST="ms_buffering_stall_longest",e.N_SEEKBACK="n_seekback",e.N_SEEKFORWARD="n_seekforward",e.MS_BUFFERING_SEEK="ms_buffering_seek",e.MS_BUFFERING_SEEK_LONGEST="ms_buffering_seek_longest",e.KBPS_AVERAGE_BANDWIDTH="kbps_average_bandwidth",e.KBYTES_DOWNLOADED="kbytes_downloaded",e.N_DROPPED_FRAMES="n_dropped_frames",e.ASPECT_RATIO="aspect_ratio",e.FEATURE_IDENTIFIER="feature_identifier",e.START_BITRATE="start_bitrate",e.MS_PLAYED_BACKGROUND="ms_played_background",e.CONNECTION_TYPE_START="connection_type_start",e.CONNECTION_TYPE_END="connection_type_end",e.N_VIEW_TRANSITIONS="n_view_transitions",e.AVERAGE_DEVICE_ORIENTATION="average_device_orientation",e.KBYTES_PLAYED="kbytes_played",e.IS_ROYALTY_MEDIA="is_royalty_media",e.MEDIA_TYPE="media_type",e.STREAMING_TYPE="streaming_type",e.DESKTOP_UI="desktop_ui",e.DID_ATTEMPT_TO_PLAY="did_attempt_to_play"}(i||(i={})),function(e){e.PLAY_CONTEXT="play_context",e.REFERRER_VENDOR="referrer_vendor",e.PLAYBACK_ID="playback_id",e.MS_TOTAL_EST="ms_total_est",e.AUDIOCODEC="audiocodec",e.N_SEEKFWD="n_seekfwd",e.PREFETCHED_BYTES_LOADED="prefetched_bytes_loaded",e.TOTAL_BYTES="total_bytes",e.FEATURE_IDENTIFIER="feature_identifier",e.VIEW_URI="view_uri",e.START_BITRATE="start_bitrate",e.KEY_SYSTEM="key_system",e.CONNECTION_TYPE_END="connection_type_end",e.VIDEO_SESSION_ID="video_session_id",e.LOCAL_TIME_MS="local_time_ms",e.TIME_WEIGHTED_BITRATE="time_weighted_bitrate",e.MS_LATENCY="ms_latency",e.CONNECTION_TYPE_START="connection_type_start",e.MS_PLAYED_BACKGROUND="ms_played_background",e.FILE_ID="file_id",e.MS_SEEKFWD="ms_seekfwd",e.UI_LATENCY="ui_latency",e.REFERRER_VERSION="referrer_version",e.REASON_START="reason_start",e.N_STALLS="n_stalls",e.VIDEOCODEC="videocodec",e.FEATURE_VERSION="feature_version",e.N_SEEKBACK="n_seekback",e.MAX_MS_SEEK_REBUFFERING="max_ms_seek_rebuffering",e.INCOGNITO_MODE="incognito_mode",e.MAX_MS_STALLED="max_ms_stalled",e.MS_MANIFEST_LATENCY="ms_manifest_latency",e.PROVIDER="provider",e.SEQUENCE_ID="sequence_id",e.PLAY_TRACK="play_track",e.MS_STALLED="ms_stalled",e.LIVE="live",e.START_OFFSET_MS="start_offset_ms",e.MS_SEEK_REBUFFERING="ms_seek_rebuffering",e.GAIA_DEV_ID="gaia_dev_id",e.PREFETCHED_BYTES="prefetched_bytes",e.MS_KEY_LATENCY="ms_key_latency",e.MS_INITIAL_BUFFERING="ms_initial_buffering",e.SEQUENCE_NUMBER="sequence_number",e.REFERRER="referrer",e.MS_SEEKBACK="ms_seekback",e.UNION_PLAYED="union_played",e.STREAMING_RULE="streaming_rule",e.MS_PLAYED="ms_played",e.MS_PLAYED_VIDEO="ms_played_video",e.MS_NOMINAL_PLAYED="ms_nominal_played",e.REASON_END="reason_end",e.MAX_CONTINOUS="max_continous",e.SHUFFLE="shuffle",e.FULL_SCREEN="full_screen",e.PAGE_INSTANCE_ID="page_instance_id",e.INTERACTION_ID="interaction_id",e.FEATURE_UUID="feature_uuid",e.MEDIA_TYPE="media_type",e.DECISION_ID="decision_id",e.PLAY_CONTEXT_DECISION_ID="play_context_decision_id"}(o||(o={}))},31770:(e,t,n)=>{"use strict";n.d(t,{wl:()=>f,jj:()=>d,H7:()=>u,vv:()=>p});n(46758),n(45205);const i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const r=new Uint8Array(16);function a(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(r)}const s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function c(e,t=0){return s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]}const l=function(e,t,n){if(i.randomUUID&&!t&&!e)return i.randomUUID();const o=(e=e||{}).random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return c(o)},u=()=>l().replace(new RegExp("-","g"),"");function d(e,t){var n;return null===(n=null==t?void 0:t.find((t=>t.isPlayable(e))))||void 0===n?void 0:n.getMediaUrl(e)}function p(e){return/^[A-Za-z0-9]*$/.test(e)}const f=()=>{}},30771:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});const i=e=>{(null===performance||void 0===performance?void 0:performance.mark)&&(null===performance||void 0===performance||performance.mark(e))}},17909:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,vp:()=>p});class i{constructor(e,t){this.defaultPrevented=!1,this.immediateStopped=!1,this.stopped=!1,this.type=e,this.data=t}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.stopped=!0}stopImmediatePropagation(){this.immediateStopped=!0}}n(23012);const o="undefined"!=typeof window,r=[];function a(){var e;const t=r.splice(0);if(t.length)for(let n=0,i=t.length;n{const t=!r.length;r.push(e),t&&s()};function l(e,t,n){for(let i=0,o=e.length;ithis._dispatchFromStore(this._listeners,n))),n}emitSync(e,t){if(!e)throw new TypeError("Argument `eventType` is required.");const n=this.createEvent(e,t);return this._dispatchFromStore(this._listeners,n),n}emitEvent(e){return c((()=>this._dispatchFromStore(this._listeners,e))),e}emitEventSync(e){return this._dispatchFromStore(this._listeners,e),e}emitAndWait(e,t,n){if(!e)throw new TypeError("Argument `eventType` is required.");const i=this.createEvent(e,t);return c((()=>{this._dispatchFromStore(this._listeners,i),n.call(this,i)})),i}emitEventAndWait(e,t){return c((()=>{this._dispatchFromStore(this._listeners,e),t.call(this,e)})),e}proxyEmit(e,t,n){if(!e||"function"!=typeof e.on)throw new TypeError("Proxy source must be an EventEmitter");if(e===this)throw new ReferenceError("Cannot create recursive proxy.");if(!t||!n)throw new TypeError("Parameter sourceType and targetType are required.");const i=e=>{e.stopped||this.emitAndWait(n,e.data,(t=>{t.defaultPrevented&&e.preventDefault()}))};return e.on(t,i),i}proxyEmitSync(e,t,n){if(!e||"function"!=typeof e.on)throw new TypeError("Proxy source must be an EventEmitter");if(e===this)throw new ReferenceError("Cannot create recursive proxy.");if(!t||!n)throw new TypeError("Parameter sourceType and targetType are required.");const i=e=>{if(e.stopped)return;const t=this.createEvent(n,e.data);this.emitEventSync(t),t.defaultPrevented&&e.preventDefault()};return e.on(t,i),i}proxyEmitAll(e,t){for(const n in t)t.hasOwnProperty(n)&&this.proxyEmit(e,n,t[n])}proxyEmitAllSync(e,t){for(const n in t)t.hasOwnProperty(n)&&this.proxyEmitSync(e,n,t[n])}onAddListener(e,t,n={}){const i=this._metaListeners.add;return u(i,e,t,n)&&d(i,e,t,n),this}onRemoveListener(e,t,n={}){const i=this._metaListeners.remove;return u(i,e,t,n)&&d(i,e,t,n),this}}},56238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSemanticMetricClient=void 0,t.createSemanticMetricClient=function(e){return{name:"SemanticMetricClient",environments:["browser","device"],data:e}}},98074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSemanticMetricClientNonAuth=void 0,t.createSemanticMetricClientNonAuth=function(e){return{name:"SemanticMetricClientNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}},80982:(e,t)=>{"use strict";t.F=void 0,t.F=function(e){return{name:"ConfigurationApplied",environments:["device","browser"],data:e}}},39153:(e,t)=>{"use strict";t.k=void 0,t.k=function(e){return{name:"ConfigurationAppliedNonAuth",environments:["devicenonauth","browsernonauth"],data:e}}},95092:(e,t)=>{"use strict";t.T=void 0,t.T=function(e){return{name:"DefaultConfigurationApplied",environments:["device","browser"],data:e}}},56674:(e,t)=>{"use strict";t.$=void 0,t.$=function(e){return{name:"DefaultConfigurationAppliedNonAuth",environments:["devicenonauth","browsernonauth"],data:e}}},87475:(e,t)=>{"use strict";t.C=void 0,t.C=function(e){return{name:"SptCookieConsentClientNonAuth",environments:["browsernonauth"],data:e}}},21459:(e,t)=>{"use strict";t.i=void 0,t.i=function(e){return{name:"EventSenderStats2NonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},40705:(e,t)=>{"use strict";t.t=void 0,t.t=function(e){return{name:"RejectedClientEventNonAuth",environments:["browsernonauth","desktopnonauth","devicenonauth"],data:e}}},34826:(e,t)=>{"use strict";t.U=void 0,t.U=function(e){return{name:"UbiExpr2PageView",environments:["device","browser","desktop"],data:e}}},74072:(e,t)=>{"use strict";t.S=void 0,t.S=function(e){return{name:"UbiProd1Impression",environments:["device","browser","desktop"],data:e}}},43840:(e,t)=>{"use strict";t.E=void 0,t.E=function(e){return{name:"UbiProd1ImpressionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},25791:(e,t)=>{"use strict";t.E=void 0,t.E=function(e){return{name:"UbiProd1Interaction",environments:["device","browser","desktop"],data:e}}},20239:(e,t)=>{"use strict";t.b=void 0,t.b=function(e){return{name:"UbiProd1InteractionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},75208:(e,t)=>{"use strict";t.W=void 0,t.W=function(e){return{name:"UbiProd1PageTransitionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},12534:(e,t)=>{"use strict";t.x=void 0,t.x=function(e){return{name:"WwwExperiments",environments:["browser"],data:e}}},99288:(e,t)=>{"use strict";t.k=void 0,t.k=function(e){return{name:"WwwExperimentsNonAuth",environments:["browsernonauth"],data:e}}},33837:(e,t,n)=>{"use strict";function i(e){return{name:"AdDSAEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{u:()=>i})},67269:(e,t,n)=>{"use strict";function i(e){return{name:"AdError",environments:["device"],data:e}}n.d(t,{v:()=>i})},17837:(e,t,n)=>{"use strict";function i(e){return{name:"AdEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{X:()=>i})},50279:(e,t,n)=>{"use strict";function i(e){return{name:"AdFeedbackEvent",environments:["device"],data:e}}n.d(t,{Y:()=>i})},57028:(e,t,n)=>{"use strict";function i(e){return{name:"AdInStreamUBILinkerEvent",environments:["device"],data:e}}n.d(t,{F:()=>i})},23083:(e,t,n)=>{"use strict";function i(e){return{name:"AdViewContext",environments:["browser","device","desktop"],data:e}}n.d(t,{u:()=>i})},84820:(e,t,n)=>{"use strict";function i(e){return{name:"CastTransfer",environments:["device","browser"],data:e}}n.d(t,{I:()=>i})},49848:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableExtendedCredit",environments:["browser"],data:e}}n.d(t,{v:()=>i})},48651:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableExtendedCreditNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{Y:()=>i})},67341:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableTrackCredit",environments:["browser","device","desktop"],data:e}}n.d(t,{x:()=>i})},28730:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableTrackCreditNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{d:()=>i})},65796:(e,t,n)=>{"use strict";function i(e){return{name:"ClientCspViolated",environments:["browser","desktop"],data:e}}n.d(t,{H:()=>i})},62791:(e,t,n)=>{"use strict";function i(e){return{name:"ClientLoadSignals",environments:["browser","desktop"],data:e}}n.d(t,{w:()=>i})},28607:(e,t,n)=>{"use strict";function i(e){return{name:"ClientStreamSignals",environments:["browser","desktop"],data:e}}n.d(t,{m:()=>i})},90268:(e,t,n)=>{"use strict";function i(e){return{name:"ClientStreamSignalsExperiment",environments:["browser","desktop"],data:e}}n.d(t,{F:()=>i})},41689:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationCompleted",environments:["browser","desktop"],data:e}}n.d(t,{h:()=>i})},80944:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationPresented",environments:["browser","desktop"],data:e}}n.d(t,{x:()=>i})},32709:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationRequestFailed",environments:["browser","desktop"],data:e}}n.d(t,{b:()=>i})},70648:(e,t,n)=>{"use strict";function i(e){return{name:"ClientWebLoad",environments:["browser","desktop"],data:e}}n.d(t,{x:()=>i})},20298:(e,t,n)=>{"use strict";function i(e){return{name:"ConnectDevicePickerClosed",environments:["device","desktop","browser"],data:e}}n.d(t,{n:()=>i})},40337:(e,t,n)=>{"use strict";function i(e){return{name:"DeeplinkOpen",environments:["browser","device"],data:e}}n.d(t,{K:()=>i})},82408:(e,t,n)=>{"use strict";function i(e){return{name:"DeeplinkOpenNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{E:()=>i})},7025:(e,t,n)=>{"use strict";function i(e){return{name:"KmInteraction",environments:["browser"],data:e}}n.d(t,{p:()=>i})},553:(e,t,n)=>{"use strict";function i(e){return{name:"KmInteractionNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{w:()=>i})},77808:(e,t,n)=>{"use strict";function i(e){return{name:"KmPageView",environments:["browser"],data:e}}n.d(t,{v:()=>i})},97763:(e,t,n)=>{"use strict";function i(e){return{name:"KmPageViewNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{t:()=>i})},84231:(e,t,n)=>{"use strict";function i(e){return{name:"LeavebehindAdEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{a:()=>i})},90171:(e,t,n)=>{"use strict";function i(e){return{name:"MinimumLyricsCharactersSeen",environments:["device","desktop","browser"],data:e}}n.d(t,{N:()=>i})},96247:(e,t,n)=>{"use strict";function i(e){return{name:"PodcastAdCtaCardEvent",environments:["desktop"],data:e}}n.d(t,{createPodcastAdCtaCardEvent:()=>i})},34049:(e,t,n)=>{"use strict";function i(e){return{name:"ScrollTrackCredits",environments:["browser","desktop","device"],data:e}}n.d(t,{d:()=>i})},97231:(e,t,n)=>{"use strict";function i(e){return{name:"ScrollTrackCreditsNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{W:()=>i})},5417:(e,t,n)=>{"use strict";function i(e){return{name:"Share",environments:["browser","device"],data:e}}n.d(t,{G:()=>i})},39996:(e,t,n)=>{"use strict";function i(e){return{name:"SocialConnectSessionJoinResult",environments:["device"],data:e}}n.d(t,{G:()=>i})},49784:(e,t,n)=>{"use strict";function i(e){return{name:"SocialListeningClientSessionCreated",environments:["device"],data:e}}n.d(t,{Q:()=>i})},72626:(e,t,n)=>{"use strict";function i(e){return{name:"SocialListeningClientSessionEnded",environments:["device"],data:e}}n.d(t,{H:()=>i})},34811:(e,t,n)=>{"use strict";function i(e){return{name:"WindowSize",environments:["desktop","browser"],data:e}}n.d(t,{_:()=>i})},54182:(e,t,n)=>{"use strict";function i(e){return{name:"WwwAnalytics",environments:["browser"],data:e}}n.d(t,{t:()=>i})},71979:(e,t,n)=>{"use strict";function i(e){return{name:"WwwAnalyticsNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{w:()=>i})},1142:(e,t,n)=>{"use strict";function i(e){return{name:"WwwExperiments",environments:["browser"],data:e}}n.d(t,{x:()=>i})},48948:(e,t,n)=>{"use strict";function i(e){return{name:"WwwExperimentsNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{k:()=>i})},49877:(e,t,n)=>{"use strict";n(46758),n(86277),n(2836),Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBase64=void 0;var i=n(54787);t.hexToBase64=function(e){if(!e||e.length%2!=0)throw new TypeError("Invalid hexString value.");var t=e.split("").reduce((function(e,t,n){return n%2==0?(e.push(t),e):(e[e.length-1]=""+e[e.length-1]+t,e)}),[]),n=String.fromCharCode.apply(null,t.map((function(e){var t=parseInt(e,16);if(isNaN(t))throw new TypeError("Invalid hexString value.");return t})));return i.Base64.encode(n)}},69724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApplicationContext=void 0,t.createApplicationContext=function(e){return function(){return{name:"context_application",data:e}}}},56535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createApplicationDesktopContext=void 0,t.createApplicationDesktopContext=function(e){return function(){return{name:"context_application_desktop",data:e}}}},66937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCacheIdContext=void 0;var i=n(49877);t.createCacheIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_cache_id",data:{value:t}}}}},98217:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClientIdContext=void 0;var i=n(49877);t.createClientIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_client_id",data:{value:t}}}}},78885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClientIpContext=void 0,t.createClientIpContext=function(e){return function(){return{name:"context_client_ip",data:{value:e}}}}},43807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCorrelationIdContext=void 0,t.createCorrelationIdContext=function(e){return function(){return{name:"context_correlation_id",data:{value:e}}}}},11568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeviceContext=void 0,t.createDeviceContext=function(e){return function(){return{name:"context_device",data:e}}}},82224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeviceDesktopContext=void 0,t.createDeviceDesktopContext=function(e){return function(){return{name:"context_device_desktop",data:e}}}},93260:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(99938);i.__exportStar(n(69724),t),i.__exportStar(n(56535),t),i.__exportStar(n(66937),t),i.__exportStar(n(98217),t),i.__exportStar(n(78885),t),i.__exportStar(n(43807),t),i.__exportStar(n(11568),t),i.__exportStar(n(82224),t),i.__exportStar(n(21298),t),i.__exportStar(n(20724),t),i.__exportStar(n(41453),t)},21298:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInstallationIdContext=void 0;var i=n(49877);t.createInstallationIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_installation_id",data:{value:t}}}}},20724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOsContext=void 0,t.createOsContext=function(e){return function(){return{name:"context_os",data:e}}}},41453:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUserAgentContext=void 0,t.createUserAgentContext=function(e){if(!e&&"undefined"==typeof navigator)throw new Error("userAgent is not provided and navigator.UserAgent is not available");return function(){return{name:"context_user_agent",data:{value:e||navigator.userAgent}}}}},53003:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{Environment:()=>i,EventSenderEvent:()=>o,createEventSender:()=>O}),function(e){e.BACKEND="BACKEND",e.BROWSER="BROWSER",e.BROWSER_NON_AUTH="BROWSER_NON_AUTH",e.DESKTOP="DESKTOP",e.DESKTOP_NON_AUTH="DESKTOP_NON_AUTH",e.DEVICE="DEVICE",e.DEVICE_NON_AUTH="DEVICE_NON_AUTH"}(i||(i={}));n(86277);var o,r=n(99938),a=n(78168),s=n(52903),c=n(17909);!function(e){e.UPLOAD_SUCCEEDED="upload_succeeded",e.UPLOAD_FAILED="upload_failed",e.UPLOAD_REQUEST_FAILED="upload_request_failed"}(o||(o={}));const l=s.P.forTag("Uploader");function u(e,t){const{event_name:n,fragments:i}=e,{message:o}=i;return{reason:t,contexts:(0,r.__rest)(i,["message"]),event_data:{name:n,data:o}}}class d extends c.vp{constructor(e){var t;super(),this._suppressPersist=!1,this._backoff=!1,this._authorize=null===(t=e.authorize)||void 0===t||t,this._transport=e.transport,this._suppressPersist=!!e.suppressPersist,this._endpoint=this._authorize?"":""}_uploadBatch(e,t=!1){const n=this._transport,i=t&&this._authorize?n.appendLastTokenQuery(this._endpoint):this._endpoint;return this._transport.request(i,{method:a.Method.POST,metadata:{eventSenderEventNames:e.map((e=>e.event_name))},headers:{"content-type":"application/json"},responseType:"json",parseResponseHeaders:!0,payload:JSON.stringify({suppress_persist:this._suppressPersist,events:e}),forget:t,authorize:!t&&this._authorize}).then(this._parseUploadResponse.bind(this,e,t))}_parseUploadResponse(e,t,n){if(t)return Promise.resolve([]);const{body:i,headers:r,status:a}=n,s=this._authorize;if(200!==a||!i)return l.warn("Upload request failed",n),this.emit(o.UPLOAD_REQUEST_FAILED,{authorize:s,status:a}),this._backoff=!0,Promise.resolve(e);const c=[],d=[],p=[];if(i.error&&i.error.length){l.info("response errors",e,i.error);for(let t=0,n=i.error.length;t0&&this.emit(o.UPLOAD_FAILED,{authorize:s,rejected:p,will_retry:d}),h>0&&this.emit(o.UPLOAD_SUCCEEDED,{authorize:this._authorize,num_events:h}),Promise.resolve(c)}upload(e,t=[]){let n=t;if(!e.length)return Promise.resolve({nack:n,backoff:this._backoff});const i=[...e];return this._uploadBatch(i.splice(0,20)).then((e=>{if(n=[...n,...e],this._backoff)n=[...n,...i];else if(i.length)return this.upload(i,n);return{nack:n,backoff:this._backoff}}))}lastUpload(e){return e.length?this._uploadBatch(e.splice(0,100),!0).then((e=>0===e.length),(()=>!1)):Promise.resolve(!0)}shouldBackoff(){return this._backoff}}function p(e){return new d(e)}n(46758),n(54487);var f,h=n(39723),m=n(40705);!function(e){e.INVALID_PAYLOAD="INVALID_PAYLOAD",e.INVALID_NAME="INVALID_NAME",e.UNKNOWN_OWNER="UNKNOWN_OWNER",e.PAYLOAD_SIZE_LIMIT_EXCEEDED="PAYLOAD_SIZE_LIMIT_EXCEEDED"}(f||(f={}));const g="4.0.3";var _=n(21459);class v{static pushToArrIfMissing(e,t){-1===e.indexOf(t)&&e.push(t)}static isMissingFromArray(e,t){return-1===e.indexOf(t)}}class y{_addEventsToEventSenderStatsData(e,t){Object.keys(t).map((n=>{for(let i=0;i{if(v.isMissingFromArray(t.sequence_ids,e))t.sequence_ids.push(e),t.loss_stats_num_entries_per_sequence_id.push(Object.keys(n).length);else{const i=t.sequence_ids.indexOf(e);t.loss_stats_num_entries_per_sequence_id[i]+=Object.keys(n).length}Object.entries(n).map((([e,n])=>{v.pushToArrIfMissing(t.event_names,e);const i=t.event_names.indexOf(e);t.loss_stats_event_name_index.push(i);const o=Object.keys(n);for(let e=0;ee&&t)).catch((()=>!1))}initializeContexts(e){if(!(null==e?void 0:e.length))return;const t=this._instanceContexts;for(const n of e){const e=n();(null==e?void 0:e.name)&&(t[e.name]=e.data)}}initFlush(e){const t=this._uploaders[e].shouldBackoff(),{ceiling:n,maxDuration:i,baseTime:o}=this._backoffTimeSettings;return h.V.init((()=>this.upload(e)),{curve:"exponential",backoffInitial:t,retryPredicate:()=>this._transport.isOnline(),ceiling:n,baseTime:t?n:o,maxDuration:i})}waitForConnection(){return new Promise((e=>{this._transport.once(a.TransportEvent.CONNECTION_ONLINE,(()=>e()))}))}upload(e){return this._uploaders[e].upload(this._events[e].splice(0)).then((t=>{if(t.nack.length)throw this._events[e]=t.nack.concat(this._events[e]),new Error("Backoff requested");return t}))}sendToGabito(e){const t=e?"authorized":"unauthorized";this._transport.isOnline()||this._ongoingUploads[t]||(this._ongoingUploads[t]=this.waitForConnection());const n=this._ongoingUploads[t];if(n)return this._uploadWaiting[t]||(this._uploadWaiting[t]=!0,this._ongoingUploads[t]=n.then((()=>(this._ongoingUploads[t]=!1,this._uploadWaiting[t]=!1,this.sendToGabito(e))))),this._ongoingUploads[t];if(!this._events[t].length)return Promise.resolve({nack:this._events[t],backoff:this._uploaders[t].shouldBackoff()});if(!this._essLastSent||Date.now()-this._essLastSent.getTime()>3e5){const e=[this.makeEvent(this._statsSender.createESSEvent(this._events,this._sequenceIdGenerator.getAllSequenceNumberCounters(),this._sequenceIdGenerator.getSequenceId()))];this._uploaders.unauthorized.upload(e).finally((()=>{this._essLastSent=new Date}))}const i=this.initFlush(t).then((e=>(this._ongoingUploads[t]=!1,e))).catch((()=>(this._ongoingUploads[t]=!1,this._transport.isOnline()?(T.consoleLogger.warn(`The events in the queue could not be uploaded. Throwing away ${this._events[t].length} ${t} events.`),this._events[t]=[],{nack:this._events[t],backoff:this._uploaders[t].shouldBackoff()}):this.sendToGabito(e))));return this._ongoingUploads[t]=i,i}storeEvent(e,t){return;const n=this.makeEvent(t);this._events[e?"authorized":"unauthorized"].push(n)}makeEvent(e){const t=this._sequenceIdGenerator;return{sequence_id:t.getSequenceId(),sequence_number:t.nextSequenceNumber(e.name),event_name:e.name,fragments:Object.assign(Object.assign({context_sdk:{version_name:this._sdkVersion,type:"javascript"},context_time:{timestamp:Date.now()}},this._instanceContexts),{message:e.data})}}validateEventData(e,t,n){return e.name?function(e){let t=e.length,n=t;for(;n--;){const i=e.charCodeAt(n);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&n--}return t}(JSON.stringify(e.data))>5e3?f.PAYLOAD_SIZE_LIMIT_EXCEEDED:t&&n&&!n()?f.UNKNOWN_OWNER:null:f.INVALID_NAME}checkIsEventAuthorized(e){return!e.endsWith("NonAuth")}flush(e=!0){return this.sendToGabito(e).then((()=>{})).catch((()=>{}))}flushAll(){return Promise.all([this.sendToGabito(!0),this.sendToGabito(!1)]).then((()=>{})).catch((()=>{}))}finalFlush(){return this.uploadFlush()}log(e,t={}){this.send(e,t)}send(e,{flush:t=!0}={}){const n=this.checkIsEventAuthorized(e.name);let i=this.validateEventData(e,n,this._ownerProvider);if(i===f.UNKNOWN_OWNER&&(T.consoleLogger.warn(`Trying to send an authenticated event without a current owner: ${e.name}`),i=null),i){const t=(0,m.t)({event_name:e.name,reject_reason:i});return this.storeEvent(!1,t),Promise.reject(new TypeError(`The event is invalid and has been rejected for reason: ${i}`))}return this.storeEvent(n,e),t?this.flush(n):Promise.resolve()}hasContext(...e){return e.every((e=>!!this._instanceContexts[e]))}}function O(e){const t={suppressPersist:e.suppressPersist,transport:e.transport};return new T(Object.assign(Object.assign({},e),{uploaders:{authorized:p(t),unauthorized:p(Object.assign(Object.assign({},t),{authorize:!1}))}}))}T.consoleLogger=s.P.forTag("EventSender")},68246:(e,t,n)=>{"use strict";function i(e){return()=>({name:"context_application",data:e})}function o(e){return()=>({name:"context_application_desktop",data:e})}n.d(t,{UR:()=>i,UY:()=>o,jx:()=>s,sr:()=>c,CF:()=>l,IE:()=>u,Mb:()=>d});n(46758),n(86277),n(2836);var r=n(6714);function a(e){if(!e||e.length%2!=0)throw new TypeError("Invalid hexString value.");const t=e.split("").reduce(((e,t,n)=>n%2==0?(e.push(t),e):(e[e.length-1]=`${e[e.length-1]}${t}`,e)),[]),n=String.fromCharCode.apply(null,t.map((e=>{const t=parseInt(e,16);if(isNaN(t))throw new TypeError("Invalid hexString value.");return t})));return(0,r.encode)(n)}function s(e){const t=a(e);return()=>({name:"context_client_id",data:{value:t}})}function c(e){return()=>({name:"context_correlation_id",data:{value:e}})}function l(e){return()=>({name:"context_device_desktop",data:e})}function u(e){const t=a(e);return()=>({name:"context_installation_id",data:{value:t}})}function d(e){if(!e&&"undefined"==typeof navigator)throw new Error("userAgent is not provided and navigator.UserAgent is not available");return()=>({name:"context_user_agent",data:{value:e||navigator.userAgent}})}},85851:(e,t,n)=>{"use strict";n.d(t,{_S:()=>r,UY:()=>o.UY,jx:()=>o.jx,CF:()=>o.CF,mi:()=>oe,IE:()=>o.IE});var i,o=n(68246);!function(e){e.BACKEND="BACKEND",e.BROWSER="BROWSER",e.BROWSER_NON_AUTH="BROWSER_NON_AUTH",e.DESKTOP="DESKTOP",e.DESKTOP_NON_AUTH="DESKTOP_NON_AUTH",e.DEVICE="DEVICE",e.DEVICE_NON_AUTH="DEVICE_NON_AUTH"}(i||(i={}));n(46758),n(53321),n(27082),n(86277);var r,a=n(99938),s=n(78168),c=n(52903),l=n(17909);!function(e){e.UPLOAD_SUCCEEDED="upload_succeeded",e.UPLOAD_FAILED="upload_failed",e.UPLOAD_REQUEST_FAILED="upload_request_failed"}(r||(r={}));const u=c.P.forTag("Uploader");class d extends l.vp{constructor(e){var t;super(),this._suppressPersist=!1,this._backoff=!1,this._authorize=null===(t=e.authorize)||void 0===t||t,this._transport=e.transport,this._suppressPersist=!!e.suppressPersist,this._endpoint=this._authorize?"":""}_uploadBatch(e,t=!1){const n=this._transport,{events:i}=e,o=t&&this._authorize?n.appendLastTokenQuery(this._endpoint):this._endpoint;return this._transport.request(o,{method:s.Method.POST,metadata:{eventSenderEventNames:i.map((e=>e.event_name))},headers:{"content-type":"application/json"},responseType:"json",parseResponseHeaders:!0,payload:JSON.stringify({suppress_persist:this._suppressPersist,events:i}),forget:t,authorize:!t&&this._authorize}).then(this._parseUploadResponse.bind(this,e,t))}_parseUploadResponse(e,t,n){if(t)return Promise.resolve([]);const{events:i,keys:o}=e;if(!o.length)return Promise.resolve([]);const{body:s,headers:c,status:l}=n,d=this._authorize;if(200!==l||!s)return u.warn("Upload request failed",n),this.emit(r.UPLOAD_REQUEST_FAILED,{authorize:d,status:l}),this._backoff=!0,Promise.reject(o);const p=[],f=[],h=[],m=[],g=[],_=s.errors;_&&_.length&&(u.info("response errors",o,_),_.forEach((e=>{const{transient:t,index:n,reason:r}=e,s=o[n],c=function(e,t){const{event_name:n,fragments:i}=e,{message:o}=i;return{reason:t,contexts:(0,a.__rest)(i,["message"]),event_data:{name:n,data:o}}}(i[n],r);p.push(s),t?(h.push(s),m.push(c)):(f.push(s),g.push(c))})));const v=o.filter((e=>!p.includes(e)));this._backoff=!("true"!==(null==c?void 0:c.get("Spotify-Back-Off")));const y=f.length+h.length,E=v.length;y>0&&this.emit(r.UPLOAD_FAILED,{authorize:d,rejected:g,will_retry:m}),E>0&&this.emit(r.UPLOAD_SUCCEEDED,{authorize:this._authorize,num_events:E});const b=[...v,...f];return Promise.resolve(b)}upload(e){const{events:t}=e;return t.length?this._uploadBatch(e):Promise.resolve([])}lastUpload(e){const{events:t}=e;return t.length?this._uploadBatch(e,!0).then((()=>[])):Promise.resolve([])}shouldBackoff(){return this._backoff}}function p(e){return new d(e)}n(54487);var f,h,m,g,_=n(40705),v=n(39723);!function(e){e.JS_SDK_MULTI_ENV_TEST="JSSDKMultiEnvTest",e.JS_SDK_MULTI_ENV_TEST_NON_AUTH="JSSDKMultiEnvTestNonAuth"}(f||(f={})),function(e){e.AUTHORIZED="authorized",e.UNAUTHORIZED="unauthorized"}(h||(h={})),function(e){e.AUTH="Auth",e.NON_AUTH="NonAuth"}(m||(m={})),function(e){e.INVALID_PAYLOAD="INVALID_PAYLOAD",e.INVALID_NAME="INVALID_NAME",e.UNKNOWN_OWNER="UNKNOWN_OWNER",e.PAYLOAD_SIZE_LIMIT_EXCEEDED="PAYLOAD_SIZE_LIMIT_EXCEEDED"}(g||(g={}));const y="5.0.2";function E(e){let t=e.length,n=t;for(;n--;){const i=e.charCodeAt(n);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&n--}return t}var b;!function(e){e.IMMEDIATE="flush_strategy_kind_immediate",e.SCHEDULED="flush_strategy_kind_scheduled"}(b||(b={}));var S=n(6714);class A{static pushToArrIfMissing(e,t){-1===e.indexOf(t)&&e.push(t)}static isMissingFromArray(e,t){return-1===e.indexOf(t)}}class T{constructor(e){this.installationId=e}getIdHash(e){const t=(e=>{let t=0;for(let n=0;ne+t)),R="|";var P,k,D,w;function M(e){return e.split(R)}function x(e,t){return M(e)[t]}function U(...e){return e.join(R)}!function(e){e.EVENTS="EVENT",e.SEQ_NUM="SEQ_NUM",e.GLOBAL_SEQ_NUM="GLOBAL_SEQ_NUM",e.DROPPED_EVENT="DROPPED_EVENT"}(P||(P={})),function(e){e[e.ITEM_GROUP_ID=0]="ITEM_GROUP_ID",e[e.GLOBAL_SEQ_NUM=1]="GLOBAL_SEQ_NUM",e[e.SEQ_ID=2]="SEQ_ID",e[e.EVENT_NAME=3]="EVENT_NAME",e[e.EVENT_SEQ_NUM=4]="EVENT_SEQ_NUM"}(k||(k={})),function(e){e[e.ITEM_GROUP_ID=0]="ITEM_GROUP_ID",e[e.SEQ_ID=1]="SEQ_ID",e[e.EVENT_NAME=2]="EVENT_NAME"}(D||(D={})),function(e){e[e.ITEM_GROUP_ID=0]="ITEM_GROUP_ID",e[e.SEQ_ID=1]="SEQ_ID",e[e.EVENT_NAME=2]="EVENT_NAME"}(w||(w={}));const V="STORAGE_ID",F="INSTALLATION_ID";function B(e){let t=0;for(const n of e)localStorage.hasOwnProperty(n)&&(t+=2*(localStorage[n].length+n.length));return t}var H;!function(e){e.CUSTOM_STORAGE="CS",e.IN_MEMORY_STORAGE="IMS",e.LOCAL_STORAGE="LS"}(H||(H={}));class G{constructor(e){this.currentTotalSizeForEvents=0,this.currentTotalSizeForDroppedCounters=0,this.maxStorageCapacityForEventsInBytes=0,this.maxStorageCapacityForDroppedCountersInBytes=0;const t=e.storagePrefix.replace(/\|/g,"");this.storageKeyPrefix=`${U("ES",t)}${R}`,this.storage=this.createStorage(e),this.configureMaxStorageCapacity(e),this.configureMaxStorageCapacity=this.configureMaxStorageCapacity.bind(this),this.configureMaxStorageCapacity(e),this.setTotalEventStorageSizeAtStartup=this.setTotalEventStorageSizeAtStartup.bind(this),this.setTotalEventStorageSizeAtStartup(),this.setTotalDroppedCountersStorageSizeAtStartup=this.setTotalDroppedCountersStorageSizeAtStartup.bind(this)}configureMaxStorageCapacity(e){let t,n;this.storage.maxCapacityInBytes?t=this.storage.maxCapacityInBytes:e.maxCapacityInBytes&&(t=e.maxCapacityInBytes),this.storage.maxCapacityForDroppedInPercentage?n=this.storage.maxCapacityForDroppedInPercentage:e.maxStorageCapacityForDroppedInPercentage&&(n=e.maxStorageCapacityForDroppedInPercentage),void 0!==t&&void 0!==n?(this.maxStorageCapacityForDroppedCountersInBytes=t*n,this.maxStorageCapacityForEventsInBytes=t-this.maxStorageCapacityForDroppedCountersInBytes):(this.maxStorageCapacityForEventsInBytes=void 0,this.maxStorageCapacityForDroppedCountersInBytes=void 0)}setTotalEventStorageSizeAtStartup(){const e=this.getKeys(!0);this.currentTotalSizeForEvents=B(e)}setTotalDroppedCountersStorageSizeAtStartup(){const e=this.getKeys(!0).filter((e=>M(e)[w.ITEM_GROUP_ID]===P.DROPPED_EVENT));this.currentTotalSizeForDroppedCounters=B(e)}createStorage(e){if(e.storage)return e.storage;let t=2e6;void 0!==e.maxCapacityInBytes&&(t=e.maxCapacityInBytes);let n=.1;void 0!==e.maxStorageCapacityForDroppedInPercentage&&(n=e.maxStorageCapacityForDroppedInPercentage);const i={maxCapacityInBytes:t,adapter:new O,flushStrategy:{kind:b.SCHEDULED,interval:e.flushIntervalMs||1e4},maxCapacityForDroppedInPercentage:n},o={adapter:new I,flushStrategy:{kind:b.IMMEDIATE}};switch(N(L)){case C.OK:return i;case C.LOW_STORAGE_SPACE:return(e.requiredPersistentStorageItems||[]).every((e=>{const t=`${this.storageKeyPrefix}${e}`;return!!i.adapter.getItem(t)}))?i:o;case C.NOT_SUPPORTED:default:return o}}getItemSizeInBytes(e,t){return 2*e.length+2*t.length}canMakeEventsStorageFull(e){return void 0!==this.maxStorageCapacityForEventsInBytes&&e+this.currentTotalSizeForEvents>this.maxStorageCapacityForEventsInBytes}canMakeDroppedCountersStorageFull(e){return void 0!==this.maxStorageCapacityForDroppedCountersInBytes&&e+this.currentTotalSizeForDroppedCounters>this.maxStorageCapacityForDroppedCountersInBytes}get storageType(){return this.storageAdapter instanceof O?H.LOCAL_STORAGE:this.storageAdapter instanceof I?H.IN_MEMORY_STORAGE:H.CUSTOM_STORAGE}get storageAdapter(){return this.storage.adapter}get flushStrategy(){return this.storage.flushStrategy}getOrCreateId(e,t){const n=this.getItem(e);if(n)return n;const i=t||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return this.addItemInEventsStorage(e,i),i}updateItemInEventsStorage(e,t){if(void 0!==this.maxStorageCapacityForEventsInBytes){const n=this.getItem(e);let i=0;n&&(i=this.getItemSizeInBytes(e,n));const o=this.getItemSizeInBytes(e,t);return!(o>i&&this.canMakeEventsStorageFull(o-i))&&(!!this.setItem(e,t)&&(this.currentTotalSizeForEvents+=o-i,!0))}return this.setItem(e,t)}updateItemInDroppedCountersStorage(e,t){if(void 0!==this.maxStorageCapacityForDroppedCountersInBytes){const n=this.getItem(e);let i=0;n&&(i=this.getItemSizeInBytes(e,n));const o=this.getItemSizeInBytes(e,t);return!(o>i&&this.canMakeDroppedCountersStorageFull(o-i))&&(!!this.setItem(e,t)&&(this.currentTotalSizeForDroppedCounters+=o-i,!0))}return this.setItem(e,t)}addItemInEventsStorage(e,t){return;if(void 0!==this.maxStorageCapacityForEventsInBytes){const n=this.getItemSizeInBytes(e,t);return!this.canMakeEventsStorageFull(n)&&(!!this.setItem(e,t)&&(this.currentTotalSizeForEvents+=n,!0))}return this.setItem(e,t)}addItemInDroppedCountersStorage(e,t){if(void 0!==this.maxStorageCapacityForDroppedCountersInBytes){const n=this.getItemSizeInBytes(e,t);return!this.canMakeDroppedCountersStorageFull(n)&&(!!this.setItem(e,t)&&(this.currentTotalSizeForDroppedCounters+=n,!0))}return this.setItem(e,t)}setItem(e,t){return this.storageAdapter.setItem(`${this.storageKeyPrefix}${e}`,t)}getItem(e){return this.storageAdapter.getItem(`${this.storageKeyPrefix}${e}`)}removeItemInEventsStorage(e){if(void 0!==this.maxStorageCapacityForEventsInBytes){const t=this.getItem(e);let n=0;t&&(n=this.getItemSizeInBytes(e,t)),this.storageAdapter.removeItem(`${this.storageKeyPrefix}${e}`),this.currentTotalSizeForEvents-=n}else this.storageAdapter.removeItem(`${this.storageKeyPrefix}${e}`)}removeItemInDroppedCountersStorage(e){if(void 0!==this.maxStorageCapacityForDroppedCountersInBytes){const t=this.getItem(e);let n=0;t&&(n=this.getItemSizeInBytes(e,t)),this.storageAdapter.removeItem(`${this.storageKeyPrefix}${e}`),this.currentTotalSizeForEvents-=n}else this.storageAdapter.removeItem(`${this.storageKeyPrefix}${e}`)}getKeys(e=!1){const t=this.storageAdapter.getKeys(),n=[];for(const i of t)i.startsWith(this.storageKeyPrefix)&&(e?n.push(i):n.push(i.replace(this.storageKeyPrefix,"")));return n}clear(){return this.storageAdapter.clear()}setCounterItem(e,t,n=9){const i="string"==typeof t?t:String(t);"1"===i?this.addItemInEventsStorage(e,i.padStart(n,"0")):this.updateItemInEventsStorage(e,i.padStart(n,"0"))}}class K{constructor(e){this.storageManager=e}commitSequenceNumber(e,t){this.storageManager.setCounterItem(e,t)}getNextSequenceNumber(e){const t=this.storageManager.getItem(e);return(e=>{let t=1;return e&&(t=e+1),t})(Number(t))}generateNextSequenceNumber(e){const t=this.getNextSequenceNumber(e);return[t,()=>{this.commitSequenceNumber(e,t)}]}generateNextEventSequenceNumber(e,t){const n=U(P.SEQ_NUM,t,e);return this.generateNextSequenceNumber(n)}generateNextGlobalSequenceNumber(){const e=U(P.GLOBAL_SEQ_NUM);return this.generateNextSequenceNumber(e)}getEventsSequenceNumbers(e){const t={},n=this.storageManager.getKeys().filter((t=>((e,t)=>{const n=M(e);return n[D.ITEM_GROUP_ID]===P.SEQ_NUM&&n[D.SEQ_ID]===t})(t,e)));return n.forEach((e=>{const n=this.storageManager.getItem(e),i=x(e,D.EVENT_NAME);n&&(t[i]=Number(n))})),t}getSequenceNumbersPerSequenceId(e){const t={};return e.forEach((e=>{t[e]=this.getEventsSequenceNumbers(e)})),t}}var W=n(21459);class Y{getInitialESSData(e){const t={};for(const[n,i]of Object.entries(e)){Object.keys(t).includes(n)||(t[n]={});for(const[e,o]of Object.entries(i))t[n][e]={sequence_number_min:o+1,sequence_number_next:o+1,storage_size:0}}return t}addEventsToESSData(e,t){return;const n=Object.assign({},e);for(const[i]of Object.entries(e)){t[i].forEach((e=>{const t=x(e,k.EVENT_NAME),o=Number(x(e,k.EVENT_SEQ_NUM));o!i.includes(e)));return o.length&&(n=this.addDroppedEventsCounters(n,t,o),o.forEach((e=>{n.sequence_ids.push(e),n.loss_stats_num_entries_per_sequence_id.push(0)}))),n}addDroppedEventsCounters(e,t,n){const i=Object.assign({},e);return n.forEach((n=>{var o;const r=t[n];if(r&&Object.keys(r).length){i.drop_list_num_entries_per_sequence_id.push(r?Object.keys(r).length:0);for(const[t,n]of Object.entries(r)){i.drop_list_counts_unreported.push(n.unreported),i.drop_list_counts_total.push(n.total);const r=e.event_names.indexOf(t);r>-1?i.drop_list_event_name_index.push(r):(null===(o=i.event_names)||void 0===o||o.push(t),i.drop_list_event_name_index.push((null==i?void 0:i.event_names.length)-1))}}else i.drop_list_num_entries_per_sequence_id.push(0)})),i}provideEventSenderStats(e,t,n){const i=this.getInitialESSData(e),o=this.addEventsToESSData(i,t);let r=this.addLossStatsData(o);r=this.addDroppedEventsCountersData(r,n);return(0,W.i)(r)}}class j{constructor(e){this.storageManager=e.storageManager}updateDroppedEventCount(e,t){const n=U(P.DROPPED_EVENT,t,e),i=this.storageManager.getItem(n);if(i){const{unreported:e,total:t=e}=JSON.parse(i);void 0!==e&&this.storageManager.updateItemInDroppedCountersStorage(n,JSON.stringify({unreported:e+1,total:t+1}))}else this.storageManager.addItemInDroppedCountersStorage(n,JSON.stringify({unreported:1,total:1}))}getDroppedEventCounters(e){const t=this.storageManager.getKeys().filter((t=>((e,t)=>{const n=M(e);return n[w.ITEM_GROUP_ID]===P.DROPPED_EVENT&&n[w.SEQ_ID]===t})(t,e)));if(t.length>0){const e={};return t.forEach((t=>{const n=this.storageManager.getItem(t);if(n){const i=x(t,w.EVENT_NAME),{unreported:o,total:r=o}=JSON.parse(n);e[i]={unreported:o,total:r}}})),e}}getDroppedEventsCountersPerSequenceId(e){const t={};return e.forEach((e=>{const n=this.getDroppedEventCounters(e);n&&Object.keys(n).length&&(t[e]=n)})),t}updateReportedEventCounters(e){for(const[t,n]of Object.entries(e))for(const[e,i]of Object.entries(n)){const n=U(P.DROPPED_EVENT,t,e),o=this.storageManager.getItem(n);if(o){const{unreported:e,total:t=e}=JSON.parse(o);void 0!==e&&this.storageManager.updateItemInDroppedCountersStorage(n,JSON.stringify({total:t,unreported:e-i.unreported}))}}}}var z=n(20484);const J={encode:function(e){const t=(0,z.encode)(e);return(0,S.encode)(t)},decode(e){const t=(0,S.decode)(e);return(0,z.decode)(t)}},q=[28,43,34,35,35,12,43,43,16,5,23,13,24,36,10,4,41,3,12,2,36,43,39,12,10,23,44,42,22,3],X=function(e){let t="";for(let n=0;n{const n=M(e),i=M(t);return Number(n[k.GLOBAL_SEQ_NUM])-Number(i[k.GLOBAL_SEQ_NUM])};class ${constructor(e){this.storageManager=e.storageManager}getEvent(e){const t=this.storageManager.getItem(e);return t?function(e){try{const t=e.charAt(0),n=e.substring(1);let i;switch(t){case Z.XOR:i=X(n);break;default:{const{event:t}=JSON.parse(e);i=J.decode(t);break}}return JSON.parse(i)}catch(e){return null}}(t):null}getEventKey(e,t){return U(P.EVENTS,t.toString(),e.sequence_id,e.event_name,e.sequence_number.toString())}getGlobalSequenceNumberFromEventKey(e){const t=Number(x(e,k.GLOBAL_SEQ_NUM));if(Number.isNaN(t))throw new Error(`Unable to parse event key: ${e}`);return Number(t)}addEvent(e,t){const n=this.getEventKey(e,t),i=function(e){const t=JSON.stringify(e);return`${Z.XOR}${X(t)}`}(e);return this.storageManager.addItemInEventsStorage(n,i)}getEventsKeys(e){const t=this.storageManager.getKeys().filter((t=>((e,t)=>{const n=M(e);return n[k.ITEM_GROUP_ID]===P.EVENTS&&n[k.SEQ_ID]===t})(t,e)));return t}getEvents({minimumGlobalSequenceNumber:e=0,sequenceId:t,size:n=20}){const i=[],o=[],r=this.getEventsKeys(t),a=[],s=r.sort(Q).filter(e>0?t=>this.getGlobalSequenceNumberFromEventKey(t)>=e:()=>!0).slice(0,n);return s.length&&s.forEach((e=>{const t=this.getEvent(e);t?(o.push(t),i.push(e)):a.push(e)})),a.length&&this.removeEvents(a),{events:o,keys:i}}getEventsKeysPerSequenceId(e){const t={};return e.forEach((e=>{const n=this.getEventsKeys(e);t[e]=n})),t}removeEvents(e){e.forEach((e=>{this.storageManager.removeItemInEventsStorage(e)}))}}const ee=(e,t,n)=>{const i={};var o;return((e,t)=>{Object.entries(t).forEach((([t,n])=>{e[t]={},Object.entries(n).forEach((([n,i])=>{e[t][n]={sequence_number_min:i+1,sequence_number_next:i+1,storage_size:0}}))}))})(i,e),((e,t)=>{Object.keys(e).forEach((n=>{var i;(null!==(i=t[n])&&void 0!==i?i:[]).forEach((t=>{const i=x(t,k.EVENT_NAME),o=Number(x(t,k.EVENT_SEQ_NUM)),r=e[n][i];r.sequence_number_min=Math.min(o,r.sequence_number_min),r.storage_size++}))}))})(i,t),((e,t)=>{Object.entries(t).forEach((([t,n])=>{Object.entries(n).forEach((([n,i])=>{var o,r;const{total:a,unreported:s}=i,c=null!==(r=null===(o=e[t])||void 0===o?void 0:o[n])&&void 0!==r?r:{};e[t]=Object.assign(Object.assign({},e[t]),{[n]:Object.assign(Object.assign({},c),{drop_list_counts_total:a,drop_list_counts_unreported:s})})}))}))})(i,n),o=i,Object.entries(o).forEach((([e,t])=>{delete t.EventSenderStats2NonAuth,0===Object.keys(t).length&&delete o[e]})),i},te=e=>{const t=(e=>{const t={sequence_ids:[],event_names:[],loss_stats_num_entries_per_sequence_id:[],loss_stats_event_name_index:[],loss_stats_storage_sizes:[],loss_stats_sequence_number_mins:[],loss_stats_sequence_number_nexts:[],drop_list_counts_unreported:[],drop_list_counts_total:[],drop_list_event_name_index:[],drop_list_num_entries_per_sequence_id:[]};return Object.entries(e).forEach((([e,n])=>{t.sequence_ids.push(e);let i=0,o=0;Object.entries(n).forEach((([e,n])=>{let r=t.event_names.indexOf(e);-1===r&&(r=t.event_names.length,t.event_names.push(e)),"sequence_number_min"in n&&(t.loss_stats_sequence_number_mins.push(n.sequence_number_min),t.loss_stats_storage_sizes.push(n.storage_size),t.loss_stats_sequence_number_nexts.push(n.sequence_number_next),t.loss_stats_event_name_index.push(r),o++),void 0!==n.drop_list_counts_total&&void 0!==n.drop_list_counts_unreported&&(t.drop_list_counts_total.push(n.drop_list_counts_total),t.drop_list_counts_unreported.push(n.drop_list_counts_unreported),t.drop_list_event_name_index.push(r),i++)})),t.loss_stats_num_entries_per_sequence_id.push(o),t.drop_list_num_entries_per_sequence_id.push(i)})),t})(e);return(0,W.i)(t)},ne="FAKE_ESS_DB_KEY";class ie extends l.vp{constructor(e){var t;super(),this.instanceContexts={},this.uploadingInProgress=!1,this.transport=e.transport,this.ownerProvider=e.ownerProvider,this.uploaders=e.uploaders,"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.addEventListener("beforeunload",this.onBeforeDisconnect.bind(this)),this.useOptimizedESS2NA=null!==(t=e.useOptimizedESS2NA)&&void 0!==t&&t,this.sendESStats=this.sendESStats.bind(this),this.flush=this.flush.bind(this),this.initializeContexts(e.context),this.storageManager=new G({storage:e.storage,flushIntervalMs:e.flushIntervalMs,requiredPersistentStorageItems:[F,V],storagePrefix:e.storagePrefix,maxCapacityInBytes:e.maxStorageCapacityInBytes,maxStorageCapacityForDroppedInPercentage:e.maxStorageCapacityForDroppedInPercentage}),this.droppedEventsTracker=new j({storageManager:this.storageManager}),this.eventsManager=new $({storageManager:this.storageManager}),this.installationId=this.setupInstallationId(),this.sequenceIdProvider=new T(this.installationId),this.sequenceNumberProvider=new K(this.storageManager),this.statsProvider=new Y;const n={[r.UPLOAD_SUCCEEDED]:r.UPLOAD_SUCCEEDED,[r.UPLOAD_FAILED]:r.UPLOAD_FAILED,[r.UPLOAD_REQUEST_FAILED]:r.UPLOAD_REQUEST_FAILED};this.proxyEmitAll(this.uploaders.authorized,n),this.proxyEmitAll(this.uploaders.unauthorized,n),this.initSendingEvents(),this.storageManager.getOrCreateId(V)}initSendingEvents(){return;this.storageManager.flushStrategy.kind===b.SCHEDULED&&(this.sendEventsInterval=setInterval(this.flush,this.storageManager.flushStrategy.interval))}initializeContexts(e){if(!(null==e?void 0:e.length))return;const t=this.instanceContexts;for(const n of e){const e=n();(null==e?void 0:e.name)&&(t[e.name]=e.data)}}buildEvent(e,t){const n=this.sequenceIdProvider.getId(this.getStorageId(),t?this.ownerProvider():null),[i,o]=this.sequenceNumberProvider.generateNextEventSequenceNumber(e.name,n);return{event:{sequence_id:n,sequence_number:i,event_name:e.name,fragments:Object.assign(Object.assign({context_sdk:{version_name:this.getVersion(),type:"javascript"},context_time:{timestamp:Date.now()}},this.instanceContexts),{message:e.data})},commitEventSequenceNumber:o}}getSpecificContext(e){return this.instanceContexts[e]||null}setupInstallationId(){var e;const t=null===(e=this.getSpecificContext("context_correlation_id"))||void 0===e?void 0:e.value;return t?this.storageManager.getOrCreateId(F,t):this.storageManager.getOrCreateId(F)}getStorageId(){return this.storageManager.getOrCreateId(V)}onBeforeDisconnect(){this.destroy(),this.lastFlush()}lastFlush(){return Promise.resolve({fired:true});return(0,a.__awaiter)(this,void 0,void 0,(function*(){if(this.storageManager.flushStrategy.kind!==b.IMMEDIATE)return Promise.resolve({fired:!1,reason:`Events cannot be forcefully flushed with the current storage type (${this.storageManager.storageType})`});const e=[];if(e.push(this.sendESStats(!0)),this.ownerProvider()){const t=this.getEvents({owner:this.ownerProvider(),size:100});e.push(this.uploaders.authorized.lastUpload(t))}const t=this.getEvents({owner:null,size:100});return e.push(this.uploaders.unauthorized.lastUpload(t)),yield Promise.all(e),{fired:!0}}))}flush(){return(0,a.__awaiter)(this,void 0,void 0,(function*(){if(!this.uploadingInProgress)try{this.uploadingInProgress=!0;(void 0===this.essLastSent||Date.now()-this.essLastSent.getTime()>18e4)&&(yield this.sendESStats()),yield this.sendEvents(h.UNAUTHORIZED),this.ownerProvider()&&(yield this.sendEvents(h.AUTHORIZED))}catch(e){ie.consoleLogger.warn(e)}finally{this.uploadingInProgress=!1}}))}sendEvents(e){return;return(0,a.__awaiter)(this,void 0,void 0,(function*(){const t=e===h.AUTHORIZED?this.ownerProvider():null;let n,i=!1;for(;!i;){const o=this.getEvents({owner:t,minimumGlobalSequenceNumber:n});if(o.events.length){const t=o.keys[o.keys.length-1];n=this.eventsManager.getGlobalSequenceNumberFromEventKey(t)+1;const i=yield this.sendToGabito(e,o);this.eventsManager.removeEvents(i)}else i=!0}return Promise.resolve()}))}sendESStats(e=!1){const t=this.ownerProvider();let n=[this.sequenceIdProvider.getId(this.getStorageId(),null)];t&&(n=[...n,this.sequenceIdProvider.getId(this.getStorageId(),t)]);const i=this.sequenceNumberProvider.getSequenceNumbersPerSequenceId(n),o=this.eventsManager.getEventsKeysPerSequenceId(n),r=this.droppedEventsTracker.getDroppedEventsCountersPerSequenceId(n);if(this.useOptimizedESS2NA)return this.sendESS2NAWithOptimization(i,o,r,e);const a=this.statsProvider.provideEventSenderStats(i,o,r);return this.commitAndUploadESStats(a,e,r)}sendESS2NAWithOptimization(e,t,n,i){const o=ee(e,t,n),r=((e,t,n)=>!e&&!!t&&!(!n||Date.now()-n.getTime()>828e5))(i,this.previousESS2NA,this.fullESS2NALastSent),a=r?((e,t)=>{if(!t)return e;const n=Object.entries(e).reduce(((e,[n,i])=>{const o=Object.entries(i).reduce(((e,[i,o])=>{var r;const a=null===(r=t[n])||void 0===r?void 0:r[i];return JSON.stringify(a)===JSON.stringify(o)?e:Object.assign(Object.assign({},e),{[i]:o})}),{});return Object.keys(o).length?Object.assign(Object.assign({},e),{[n]:o}):e}),{});return Object.keys(n).length?n:null})(o,this.previousESS2NA):o;return a?this.commitAndUploadESStats(te(a),i,n,r,o):Promise.resolve()}commitAndUploadESStats(e,t,n,i=!1,o){const{event:r,commitEventSequenceNumber:a}=this.buildEvent(e,!1);a();return(t?this.uploaders.unauthorized.lastUpload.bind(this.uploaders.unauthorized):this.uploaders.unauthorized.upload.bind(this.uploaders.unauthorized))({events:[r],keys:[ne]}).then((e=>{e.includes(ne)&&(this.onSuccessfullySentESStats(n),this.essLastSent=new Date,this.previousESS2NA=o,i||(this.fullESS2NALastSent=new Date))}))}onSuccessfullySentESStats(e){this.droppedEventsTracker.updateReportedEventCounters(e)}sendToGabito(e,t){if(!this.transport.isOnline()&&!this.uploadingInProgress)throw Promise.resolve([]);return t.events.length?v.V.init((()=>this.uploaders[e].upload(t)),{backoffInitial:this.uploaders[e].shouldBackoff(),baseTime:1e4,curve:"static",jitter:!1,maxRetries:3,retryPredicate:()=>this.transport.isOnline()}).catch((()=>[])):Promise.resolve([])}getEvents({owner:e,size:t=20,minimumGlobalSequenceNumber:n}){const i=this.sequenceIdProvider.getId(this.getStorageId(),e);return this.eventsManager.getEvents({sequenceId:i,size:t,minimumGlobalSequenceNumber:n})}storeEvent(e,t){return;const{event:n,commitEventSequenceNumber:i}=this.buildEvent(t,e),[o,r]=this.sequenceNumberProvider.generateNextGlobalSequenceNumber();this.eventsManager.addEvent(n,o)?(i(),r()):this.droppedEventsTracker.updateDroppedEventCount(n.event_name,n.sequence_id)}validateEventData(e,t,n){let i=null;if(e.name){if(E(JSON.stringify(e.data))>5e3)i=g.PAYLOAD_SIZE_LIMIT_EXCEEDED;else if(t&&n&&!n())return g.UNKNOWN_OWNER}else i=g.INVALID_NAME;return i||null}send(e,t={}){const n=!e.name.endsWith(m.NON_AUTH);const i=this.validateEventData(e,n,this.ownerProvider);if(i){const t=(0,_.t)({event_name:e.name,reject_reason:i});return this.storeEvent(!1,t),Promise.reject(new TypeError(`The event is invalid and has been rejected for reason: ${i}`))}return this.storeEvent(n,e),this.storageManager.flushStrategy.kind===b.IMMEDIATE?this.flush():Promise.resolve()}hasContext(...e){return e.every((e=>!!this.instanceContexts[e]))}destroy(){this.sendEventsInterval&&clearInterval(this.sendEventsInterval)}getStorageType(){return this.storageManager.storageType}isUsingESS2NAOptimization(){return this.useOptimizedESS2NA}getVersion(){return`${y}-${this.storageManager.storageType}${this.isUsingESS2NAOptimization()?"-essopt":""}`}finalFlush(){return this.lastFlush()}}function oe(e){const t={suppressPersist:e.suppressPersist,transport:e.transport};return new ie(Object.assign(Object.assign({},e),{uploaders:{authorized:p(t),unauthorized:p(Object.assign(Object.assign({},t),{authorize:!1}))}}))}ie.consoleLogger=c.P.forTag("EventSender")},51934:(e,t,n)=>{"use strict";var i;n.d(t,{h:()=>i}),function(e){e.INCOMPATIBLE="incompatible",e.UNAVAILABLE="unavailable",e.AD_PLAYING="ad_playing",e.NARRATION="narration",e.WAKING_UP="waking_up",e.TIMED_OUT_WAKEUP="timed_out_wakeup",e.PREMIUM_REQUIRED="premium_required",e.NOT_INSTALLED="not_installed",e.UNSUPPORTED="unsupported",e.NOT_AUTHORIZED="not_authorized"}(i||(i={}))},90697:(e,t,n)=>{"use strict";var i;n.d(t,{_j:()=>Li,cI:()=>f,ih:()=>p,cJ:()=>An,zq:()=>h,nA:()=>On,BE:()=>Ri}),function(e){e.AD_MANIFEST_REQUEST_FAILED_WITH_STATUS="AD_MANIFEST_REQUEST_FAILED_WITH_STATUS",e.AD_MANIFEST_INVALID="AD_MANIFEST_INVALID",e.CAPPING_USER_IS_CAPPED="CAPPING_USER_IS_CAPPED",e.EME_API_NOT_SUPPORTED="EME_API_NOT_SUPPORTED",e.EME_MEDIA_KEYS_NOT_SUPPORTED="EME_MEDIA_KEYS_NOT_SUPPORTED",e.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED="EME_MEDIA_KEY_SESSION_NOT_SUPPORTED",e.EME_NO_SUPPORTED_KEYSYSTEM="EME_NO_SUPPORTED_KEYSYSTEM",e.EME_PLAYER_MEDIA_KEYS_SETTING_FAILED="EME_PLAYER_MEDIA_KEYS_SETTING_FAILED",e.EME_ERROR_UNKNOWN="EME_ERROR_UNKNOWN",e.EME_LICENSE_REQUEST_EMPTY_RESPONSE="EME_LICENSE_REQUEST_EMPTY_RESPONSE",e.EME_LICENSE_REQUEST_FAILED_WITH_STATUS="EME_LICENSE_REQUEST_FAILED_WITH_STATUS",e.EME_LICENSE_REQUEST_WIDEVINE_ERROR="EME_LICENSE_REQUEST_WIDEVINE_ERROR",e.EME_LICENSE_UPDATE_FAILED="EME_LICENSE_UPDATE_FAILED",e.EME_HEADER_KEY_VALUE_MISMATCH="EME_HEADER_KEY_VALUE_MISMATCH",e.EME_HEADER_MISSING_CHALLENGE="EME_HEADER_MISSING_CHALLENGE",e.EME_INIT_DATA_MALFORMED="EME_INIT_DATA_MALFORMED",e.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM="EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM",e.EME_MEDIA_KEY_SESSION_V0_1B_ERROR="EME_MEDIA_KEY_SESSION_V0_1B_ERROR",e.EME_MEDIA_KEY_SESSION_SAFARI_ERROR="EME_MEDIA_KEY_SESSION_SAFARI_ERROR",e.EME_NO_SUPPORTED_CONFIGURATION="EME_NO_SUPPORTED_CONFIGURATION",e.EME_NOT_SUPPORTED_ERROR="EME_NOT_SUPPORTED_ERROR",e.EME_INVALID_STATE_ERROR="EME_INVALID_STATE_ERROR",e.EME_UNKNOWN_ERROR="EME_UNKNOWN_ERROR",e.DISALLOW_PROTECTED_TRACK_ERROR="DISALLOW_PROTECTED_TRACK_ERROR",e.FILE_FORMAT_NOT_SUPPORTED="FILE_FORMAT_NOT_SUPPORTED",e.FILE_MALFORMED_SEEKTABLE="FILE_MALFORMED_SEEKTABLE",e.FILE_MALFORMED_PSSH="FILE_MALFORMED_PSSH",e.FILE_NOT_RESOLVED="FILE_NOT_RESOLVED",e.FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO="FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO="FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_REQUEST_FAILED_WITH_ZERO="FRAGMENT_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_REQUEST_FAILED_WITH_STATUS="FRAGMENT_REQUEST_FAILED_WITH_STATUS",e.FRAGMENT_REQUEST_EMPTY_RESPONSE="FRAGMENT_REQUEST_EMPTY_RESPONSE",e.FRAGMENT_REQUEST_UNEXPECTED_LENGTH="FRAGMENT_REQUEST_UNEXPECTED_LENGTH",e.INVALID_TRACK="INVALID_TRACK",e.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE="PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE",e.PLAYER_BUFFER_QUOTA_EXCEEDED="PLAYER_BUFFER_QUOTA_EXCEEDED",e.PLAYER_CANNOT_FIND_PLAYABLE_URI="PLAYER_CANNOT_FIND_PLAYABLE_URI",e.PLAYER_INVALID_INTERNAL_STATE="PLAYER_INVALID_INTERNAL_STATE",e.PLAYER_CONTAINER_ELEMENT_NOT_FOUND="PLAYER_CONTAINER_ELEMENT_NOT_FOUND",e.PLAYER_MEDIA_ERROR="PLAYER_MEDIA_ERROR",e.PLAYER_PLAYBACK_ERROR="PLAYER_PLAYBACK_ERROR",e.PLAYER_TIMEOUT_ERROR="PLAYER_TIMEOUT_ERROR",e.MEDIA_ABORTED="MEDIA_ABORTED",e.MEDIA_DECODING_ERROR="MEDIA_DECODING_ERROR",e.MEDIA_NETWORK_ERROR="MEDIA_NETWORK_ERROR",e.MEDIA_NOT_SUPPORTED="MEDIA_NOT_SUPPORTED",e.LICENSE_RESOLVE_INVALID_RESPONSE="LICENSE_RESOLVE_INVALID_RESPONSE",e.LICENSE_RESOLVER_CANT_RESOLVE_URL="LICENSE_RESOLVER_CANT_RESOLVE_URL",e.LICENSE_RESOLVER_DEPRECATED_VERSION="LICENSE_RESOLVER_DEPRECATED_VERSION",e.LIST_PLAYER_NO_TRACK_PLAYER="LIST_PLAYER_NO_TRACK_PLAYER",e.LIST_PLAYER_NO_LIST="LIST_PLAYER_NO_LIST",e.LIST_PLAYER_INVALID_ARGUMENT="LIST_PLAYER_INVALID_ARGUMENT",e.LIST_PLAYER_FORBIDDEN="LIST_PLAYER_FORBIDDEN",e.STORAGE_ERROR="STORAGE_ERROR",e.STORAGE_FAILED_WITH_STATUS="STORAGE_FAILED_WITH_STATUS",e.STORAGE_RETURNED_NO_TRACKS="STORAGE_RETURNED_NO_TRACKS",e.STORAGE_TRACK_MANIFEST_FAILED="STORAGE_TRACK_MANIFEST_FAILED",e.STORAGE_TRACK_MANIFEST_EMPTY="STORAGE_TRACK_MANIFEST_EMPTY",e.STORAGE_VIDEO_MANIFEST_FAILED="STORAGE_VIDEO_MANIFEST_FAILED",e.TRACK_DATA_ALREADY_FINALIZED="TRACK_DATA_ALREADY_FINALIZED",e.TSV_SENDING_FAILED="TSV_SENDING_FAILED",e.PLAYBACK_STATS_SENDING_FAILED="PLAYBACK_STATS_SENDING_FAILED",e.PLAYBACK_START_SENDING_FAILED="PLAYBACK_START_SENDING_FAILED",e.UNKNOWN="UNKNOWN"}(i||(i={}));var o,r=n(98777);!function(e){e.USER_INFO_REQUEST_EMPTY_RESPONSE="USER_INFO_REQUEST_EMPTY_RESPONSE",e.USER_INFO_REQUEST_FAILED_WITH_STATUS="USER_INFO_REQUEST_FAILED_WITH_STATUS",e.HARMONY_NO_TRACKS_LOADED="HARMONY_NO_TRACKS_LOADED",e.HARMONY_OPERATION_FORBIDDEN="HARMONY_OPERATION_FORBIDDEN",e.HARMONY_LOCAL_PLAYER_DISABLED="HARMONY_LOCAL_PLAYER_DISABLED",e.HARMONY_INVALID_DESCRIPTOR_ID="HARMONY_INVALID_DESCRIPTOR_ID",e.HARMONY_INVALID_MEDIA_TYPE="HARMONY_INVALID_MEDIA_TYPE",e.CONNECTAPI_CLIENT_INVALID_ARGUMENTS="CONNECTAPI_CLIENT_INVALID_ARGUMENTS",e.CONNECTAPI_CLIENT_MISSING_DEVICE_ID="CONNECTAPI_CLIENT_MISSING_DEVICE_ID",e.CONNECTAPI_CLIENT_NO_CONNECTION_ID="CONNECT_API_CLIENT_NO_CONNECTION_ID",e.CONNECTAPI_CLIENT_NO_DEVICE="CONNECTAPI_CLIENT_NO_DEVICE",e.CONNECTAPI_CLIENT_NO_SESSION_ID="CONNECTAPI_CLIENT_NO_SESSION_ID",e.CONNECTAPI_CLIENT_NO_STATE="CONNECTAPI_CLIENT_NO_STATE",e.CONNECTAPI_CLIENT_INVALID_POSITION="CONNECT_API_CLIENT_INVALID_POSITION",e.CONNECTAPI_CLIENT_INVALID_VOLUME="CONNECT_API_CLIENT_INVALID_VOLUME",e.CONNECTAPI_MAX_SUBSCRIPTIONS_REACHED="CONNECTAPI_MAX_SUBSCRIPTIONS_REACHED",e.CONNECTAPI_REGISTRATION_FAILED_WITH_STATUS="CONNECTAPI_REGISTRATION_FAILED_WITH_STATUS",e.CP_NO_DEVICE_DESCRIPTOR="CP_NO_DEVICE_DESCRIPTOR",e.CP_NO_CONNECTION_ID="CP_NO_CONNECTION_ID",e.CP_REGISTRATION_FAILED_WITH_STATUS="CP_REGISTRATION_FAILED_WITH_STATUS",e.CP_REGISTRATION_FAILED_NON_PREMIUM="CP_REGISTRATION_FAILED_NON_PREMIUM",e.CP_REQUEST_FAILED_WITH_STATUS="CP_REQUEST_FAILED_WITH_STATUS",e.CP_NO_DEVICE_ID="CP_NO_DEVICE_ID",e.CP_NO_RESPONSE_BODY="CP_NO_RESPONSE_BODY",e.CP_NO_TRACKING_DATA="CP_NO_TRACKING_DATA",e.CP_INVALID_STATE="CP_INVALID_STATE",e.CP_NO_PLAYBACK_ID="CP_NO_PLAYBACK_ID",e.QUEUE_MANAGER_NO_STATE="QUEUE_MANAGER_NO_STATE",e.QUEUE_OPERATION_STALE_REVISION="QUEUE_OPERATION_STALE_REVISION",e.TP_NO_RESPONSE_BODY="TP_NO_RESPONSE_BODY",e.TP_REGISTRATION_FAILED_NON_PREMIUM="TP_REGISTRATION_FAILED_NON_PREMIUM",e.TP_REGISTRATION_FAILED_WITH_STATUS="TP_REGISTRATION_FAILED_WITH_STATUS",e.TP_STATE_UPDATE_FAILED="TP_STATE_UPDATE_FAILED",e.TP_MAX_SUBSCRIPTIONS_REACHED="TP_MAX_SUBSCRIPTIONS_REACHED",e.TP_UPDATE_REQUEST_EMPTY_RESPONSE="TP_UPDATE_REQUEST_EMPTY_RESPONSE",e.TP_PARSE_STATE_UPDATE_FAILED_WITH_STATUS="TP_PARSE_STATE_UPDATE_FAILED_WITH_STATUS",e.TP_UNKNOWN_COMMAND="TP_UNKNOWN_COMMAND",e.TP_CANNOT_CREATE_STATE_REF="TP_CANNOT_CREATE_STATE_REF",e.TP_MISSING_INITIAL_STATE="TP_MISSING_INITIAL_STATE",e.TP_INVALID_STATE_REFERENCE="TP_INVALID_STATE_REFERENCE",e.TP_CONFLICT_REQUEST_FAILED_WITH_STATUS="TP_CONFLICT_REQUEST_FAILED_WITH_STATUS"}(o||(o={}));n(53381);var a=n(78168);n(86277);var s,c=n(17909);!function(e){e.APPLOAD="appload",e.BACK_BUTTON="backbtn",e.CLICK_ROW="clickrow",e.CLICK_SIDE="clickside",e.END_PLAY="endplay",e.FORWARD_BUTTON="fwdbtn",e.LOGOUT="logout",e.PLAY_BUTTON="playbtn",e.POPUP="popup",e.REMOTE="remote",e.TRACK_DONE="trackdone",e.TRACK_ERROR="trackerror",e.UNKNOWN="unknown",e.URI_OPEN="uriopen",e.CAPPED="capped",e.SEEK="seek"}(s||(s={}));var l=n(60045);const u="@local",d=65535;var p,f,h;!function(e){e.AUTHENTICATED="authenticated",e.AUTHENTICATION_ERROR="authentication_error",e.AUTOPLAY_FAILED="autoplay_failed",e.BEFORE_DISCONNECT="before_disconnect",e.BEFORE_VOLUME_CHANGE="before_volume_change",e.BUFFER_STALLED="stalled",e.BUFFERING_END="buffering_end",e.BUFFERING_START="buffering_start",e.REBUFFERING_END="rebuffering_end",e.REBUFFERING_START="rebuffering_start",e.CONNECTED="connected",e.CONNECTION_ERROR="connection_error",e.DEVICES_CHANGED="devices_changed",e.DEVICE_DEACTIVATED="device_deactivated",e.DEVICE_DESCRIPTOR_CHANGED="descriptor_changed",e.DISCONNECTED="disconnected",e.DISPLAYED_CUES_CHANGED="displayed_cues_changed",e.DURATION_CHANGED="duration_changed",e.ERROR="error",e.LAST_ACTIVE_DEVICE_INFO_CHANGED="last_active_device_info_changed",e.LOCAL_CONTEXT_ENDED="local_context_ended",e.LOCAL_PLAYER_DISABLED="local_player_disabled",e.LOCAL_PLAYER_ENABLED="local_player_enabled",e.LOCAL_PLAYER_LOGGED_OUT="local_player_logged_out",e.LOGGED_OUT="logged_out",e.MAX_LIST_ERRORS_REACHED="max_list_errors_reached",e.MAX_SUBSCRIPTIONS_REACHED="max_subscriptions_reached",e.PLAYBACK_CAPPED="playback_capped",e.PLAYER_INITIALIZATION_DONE="player_initialization_done",e.PLAYER_INITIALIZATION_FAILED="player_initialization_failed",e.PRODUCT_STATE_CHANGED="product_state_changed",e.PROGRESS="progress",e.PLAYER_QUEUE_CHANGED="player_queue_changed",e.RECONNECTED="reconnected",e.RECONNECTING="reconnecting",e.REMOTE_OBSERVER_DISABLED="remote_observer_disabled",e.REMOTE_OBSERVER_ENABLED="remote_observer_enabled",e.REPORTING_START="reporting_start",e.REPORTING_FIRST_QUARTILE="reporting_first_quartile",e.REPORTING_MIDPOINT="reporting_midpoint",e.REPORTING_THIRD_QUARTILE="reporting_third_quartile",e.REPORTING_COMPLETE="reporting_complete",e.REPORTING_PAUSE="reporting_pause",e.REPORTING_RESUME="reporting_resume",e.REPORTING_CREATIVE_VIEW="reporting_creative_view",e.REPORTING_ERROR="reporting_error",e.SERVICE_REGISTRATION_ERROR="service_registration_error",e.SPEED_CHANGED="speed_changed",e.STATE_CHANGED="state_changed",e.STOPPED_ON_BACKGROUND="stopped_on_background",e.SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded",e.TRACK_ENDED="track_ended",e.UNRECOVERABLE_FAILURE="unrecoverable_failure",e.VIDEO_ELEMENT_APPENDED="video_element_appended",e.VIDEO_ELEMENT_REMOVED="video_element_removed",e.VOLUME_CHANGED="volume_changed"}(p||(p={})),function(e){e.CLOUD_PLAYBACK="cloud-playback",e.CONNECT_API="connect-api",e.HARMONY="harmony",e.PLAYBACK="playback",e.TRACK_PLAYBACK="track-playback",e.TRANSPORT="transport"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.CONTEXT=1]="CONTEXT",e[e.TRACK=2]="TRACK"}(h||(h={}));var m=n(51934);class g extends Error{constructor(e,t){super(t),this.status=-1,this.unrecoverable=!1,this.debug={},this.code=e,this.name="HarmonyError"}static fatal(e,t){const n=new g(e,t);return n.unrecoverable=!0,n}}function _(e,t){return!e&&!t||!(!e||!t)&&(e.id===t.id&&e.is_active===t.is_active&&e.is_controllable===t.is_controllable&&e.is_observable===t.is_observable&&e.is_being_activated===t.is_being_activated&&e.local===t.local&&e.name===t.name&&e.type===t.type&&e.version===t.version&&e.volume===t.volume)}class v extends Error{constructor(e,t){super(t),this.unrecoverable=!1,this.code=e,this.name="PlayerQueueError"}}function y(e,t={isCurrentTrack:!1,ignoreMetaForTrack:!1}){var n,i,o,r,a,s;const c=[],l=[];let u=!1,d=!1;if(!(null==e?void 0:e.length))return{items:c,tracks:l,hasQueuedTracks:u};for(const p of e){const e="spotify:delimiter"===p.uri||/^spotify:meta:/.test(p.uri)?"meta":"track",f=`${p.uid}:::${null!==(i=null===(n=p.metadata)||void 0===n?void 0:n.iteration)&&void 0!==i?i:""}`,h={type:e,uri:p.uri,uid:p.uid,qid:f,metadata:p.metadata||{},hidden:"true"===(null===(o=p.metadata)||void 0===o?void 0:o.hidden),hidden_in_queue:"true"===(null===(r=p.metadata)||void 0===r?void 0:r.hidden_in_queue)&&!t.isCurrentTrack,queued:"true"===(null===(a=p.metadata)||void 0===a?void 0:a.is_queued),provider:p.provider,removed_reasons:p.removed,$blck_rs:p.blocked};h.queued&&(u=!0),c.push(h),"meta"===h.type?d=!0:!t.ignoreMetaForTrack&&d||"track"!==h.type||h.hidden||(null===(s=h.removed_reasons)||void 0===s?void 0:s.length)||h.hidden_in_queue||l.push(h)}return{items:c,tracks:l,hasQueuedTracks:u}}function E(e,t={}){if(!Array.isArray(e))throw new TypeError("Items is not an array.");if(!e.length)return[];const n=[];for(let i of e){if(!i)continue;"string"==typeof i&&(i={type:"track",uri:i});const e={uri:i.uri,uid:i.uid,metadata:i.metadata||{},removed:i.removed_reasons,blocked:i.$blck_rs,provider:i.provider};(i.queued||t.queued)&&(e.metadata.is_queued="true",e.provider="queue"),(i.hidden||"meta"===i.type)&&(e.metadata.hidden="true"),i.hidden_in_queue&&(e.metadata.hidden_in_queue="true"),n.push(e)}return n}function b(e){const[t,n]=e.split(":::"),i={type:"track",uid:t};return n&&(i.metadata={iteration:n}),i}class S extends c.vp{constructor(e){super(),this._hasInitialState=!1,this._reportInactiveQueues=!1,this._onlyLocalQueue=!1,this._currentPlayerState=null,this._currentInternalQueue=null,this._currentQueue=null,this._hasQueuedTracks=!1,this._connectClient=e.connectClient,this._runner=e.runner||(e=>e()),this._parsePlayerState=this._parsePlayerState.bind(this),this._onlyLocalQueue=!!e.onlyLocalQueue,this._reportInactiveQueues=!!e.reportInactiveQueues,this._connectClient.on("player_state_changed",this._onPlayerStateChanged.bind(this)),this._parsePlayerState(e.initialContextPlayerState)}static create(e){return new S(e)}_onPlayerStateChanged(e){const{playerState:t,orphaned:n,isLocal:i}=e.data;this._parsePlayerState(t,n,i)}_parsePlayerState(e,t,n){var i,o,r;if(this._hasInitialState=!0,this._onlyLocalQueue&&!n||!this._reportInactiveQueues&&t)this._currentPlayerState=null,this._currentInternalQueue=null,this._currentQueue=null;else if(this._currentPlayerState=null!=e?e:null,e){if(e.queue_revision===(null===(i=this._currentInternalQueue)||void 0===i?void 0:i.revision))return null;this._hasQueuedTracks=!1;const t={ignoreMetaForTrack:null===(o=e.options)||void 0===o?void 0:o.repeating_context},n=e.queue_revision,a=y([e.track],{isCurrentTrack:!0}).items[0],s=y(e.next_tracks,t),c=y(e.prev_tracks,t);this._hasQueuedTracks=s.hasQueuedTracks;const l={uri:e.context_uri,metadata:null!==(r=e.context_metadata)&&void 0!==r?r:void 0};this._currentInternalQueue={revision:n,context:l,current_track:a,next_items:s.items,previous_items:c.items},this._currentQueue={revision:n,context:l,current_track:a,next_tracks:s.tracks,previous_tracks:c.tracks}}else this._hasQueuedTracks=!1,this._currentInternalQueue=null,this._currentQueue=null;return this.emit(p.PLAYER_QUEUE_CHANGED,{internalPlayerQueue:this._currentInternalQueue,playerQueue:this._currentQueue}),this._currentInternalQueue}_setQueueNext(e,t){const n=this._currentPlayerState;if(!n)return Promise.reject(new v(o.QUEUE_MANAGER_NO_STATE,"Cannot perform operation; no current state."));const i={next_tracks:e,prev_tracks:n.prev_tracks,queue_revision:n.queue_revision};return this._runner((()=>this._connectClient.setQueue(i,t)),t)}_insertQueuedWhenEmpty(e,t,n){var i,o,r,a;const s="true"===(null===(o=null===(i=t[0])||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.is_narration),c="true"===(null===(r=null==n?void 0:n.metadata)||void 0===r?void 0:r.is_narration);if(c||s){if(!c||s){let n=-1;for(let e=0,i=t.length;e{this.on(p.PLAYER_QUEUE_CHANGED,(t=>{e(t.data.internalPlayerQueue)}))}))}getPlayerQueue(){return this._hasInitialState?Promise.resolve(this._currentQueue):new Promise((e=>{this.on(p.PLAYER_QUEUE_CHANGED,(t=>{e(t.data.playerQueue)}))}))}setInternalPlayerQueue(e,t,n={ignoreRevision:!1}){if(!this._currentPlayerState)return Promise.reject(new v(o.QUEUE_MANAGER_NO_STATE,"Cannot perform operation; no current state."));if(e.revision!==this._currentPlayerState.queue_revision&&!n.ignoreRevision)return Promise.reject(new v(o.QUEUE_OPERATION_STALE_REVISION,"Cannot perform operation; revision is stale."));const i={next_tracks:E(e.next_items),prev_tracks:E(e.previous_items),queue_revision:n.ignoreRevision?void 0:this._currentPlayerState.queue_revision};return this._runner((()=>this._connectClient.setQueue(i,t)),t)}addToQueue(e,t){if(!Array.isArray(e))return Promise.reject(new TypeError("Argument `items` must be an array."));const n=E(e,{queued:!0});return n.length?1===n.length?this._runner((()=>this._connectClient.addToQueue(n[0],t)),t):this._insertQueued(n,t):Promise.resolve(!1)}removeNext(e,t){var n,i,r;const a=this._currentPlayerState;if(!a)return Promise.reject(new v(o.QUEUE_MANAGER_NO_STATE,"Cannot perform operation; no current state."));let s;s="string"==typeof e?b(e):e;const c=Array.from(null!==(n=a.next_tracks)&&void 0!==n?n:[]),l=c.length;for(let e=0;e{this._onDeviceStateChanged(e.data)})),t.on("devices_changed",this._onDevicesChanged.bind(this)),t.on("state_changed",this._onPlayerStateChanged.bind(this)),t.on("progress",this._onControllerProgress.bind(this)),this.proxyEmitAll(t,{max_subscriptions_reached:p.MAX_SUBSCRIPTIONS_REACHED,device_deactivated:p.DEVICE_DEACTIVATED}),t.on("registered",this.emit.bind(this,p.REMOTE_OBSERVER_ENABLED,null)),t.on("deregistered",this.emit.bind(this,p.REMOTE_OBSERVER_DISABLED,null));const n=this._streamer;n?(n.on("deregistered",this._onStreamerDeregistered.bind(this)),n.on("registered",this._onStreamerRegistered.bind(this)),n.on("registration_aborted",this._onStreamerRegistrationAborted.bind(this)),n.on("state_changed",this._onStreamerStateChanged.bind(this)),n.on("stopped_on_background",this._onStreamerStoppedOnBackground.bind(this)),n.on("streamer_seek_handled",this._onSeekHandled.bind(this)),this.proxyEmitSync(n,"before_volume_change",p.BEFORE_VOLUME_CHANGE),this.proxyEmit(n,"autoplay_failed",p.AUTOPLAY_FAILED),this.proxyEmit(n,"stalled",p.BUFFER_STALLED),this.proxyEmit(n,"buffering_end",p.BUFFERING_END),this.proxyEmit(n,"buffering_start",p.BUFFERING_START),this.proxyEmit(n,"rebuffering_end",p.REBUFFERING_END),this.proxyEmit(n,"rebuffering_start",p.REBUFFERING_START),this.proxyEmit(n,"duration_changed",p.DURATION_CHANGED),this.proxyEmit(n,"max_list_errors_reached",p.MAX_LIST_ERRORS_REACHED),this.proxyEmit(n,"max_subscriptions_reached",p.MAX_SUBSCRIPTIONS_REACHED),this.proxyEmit(n,"playback_capped",p.PLAYBACK_CAPPED),this.proxyEmit(n,"player_initialization_done",p.PLAYER_INITIALIZATION_DONE),this.proxyEmit(n,"player_initialization_failed",p.PLAYER_INITIALIZATION_FAILED),this.proxyEmit(n,"progress",p.PROGRESS),this.proxyEmit(n,"registration_error",p.SERVICE_REGISTRATION_ERROR),this.proxyEmit(n,"track_ended",p.TRACK_ENDED),this.proxyEmit(n,"video_element_appended",p.VIDEO_ELEMENT_APPENDED),this.proxyEmit(n,"video_element_removed",p.VIDEO_ELEMENT_REMOVED),this.proxyEmit(n,"volume_changed",p.VOLUME_CHANGED),this.proxyEmit(n,"displayed_cues_changed",p.DISPLAYED_CUES_CHANGED),this.proxyEmit(n,"subtitle_languages_loaded",p.SUBTITLE_LANGUAGES_LOADED),this.proxyEmit(n,"speed_changed",p.SPEED_CHANGED),this.proxyEmitSync(n,"reporting_start",p.REPORTING_START),this.proxyEmitSync(n,"reporting_first_quartile",p.REPORTING_FIRST_QUARTILE),this.proxyEmitSync(n,"reporting_midpoint",p.REPORTING_MIDPOINT),this.proxyEmitSync(n,"reporting_third_quartile",p.REPORTING_THIRD_QUARTILE),this.proxyEmitSync(n,"reporting_complete",p.REPORTING_COMPLETE),this.proxyEmitSync(n,"reporting_pause",p.REPORTING_PAUSE),this.proxyEmitSync(n,"reporting_resume",p.REPORTING_RESUME),this.proxyEmitSync(n,"reporting_creative_view",p.REPORTING_CREATIVE_VIEW),this.proxyEmitSync(n,"reporting_error",p.REPORTING_ERROR),this.proxyEmitSync(n,"internal_endcontent","internal_endcontent"),n.on("context_ended",this.emit.bind(this,p.LOCAL_CONTEXT_ENDED,null)),n.on("logged_out",this.emit.bind(this,p.LOCAL_PLAYER_LOGGED_OUT,null))):(this._disableLocalTarget(),this.on(p.AUTHENTICATED,(()=>{this.emit(p.LOCAL_PLAYER_DISABLED,null)})))}_createStreamerDeferred(){this._deferredStreamer=(0,l.$)(),this._deferredStreamer.promise.catch((function(){}))}_isTargetIdLocal(e){return e?e===u?Promise.resolve(!0):this._client.getDeviceDescriptor().then((function(t){return e===t.getId()})):Promise.resolve(!!this._localPlayback)}_onStreamerRegistered(e){this._deferredStreamer.resolve(e.data),this._createStreamerDeferred(),this._deferredStreamer.resolve(e.data),this._localPlayerEnabled=!0,this._controller.register(),this.emit(p.LOCAL_PLAYER_ENABLED,null)}_onStreamerDeregistered(){this._disableLocalTarget(),this.emit(p.LOCAL_PLAYER_DISABLED,null)}_onStreamerRegistrationAborted(){this._disableLocalTarget(),this._enableControllerWithoutStreamer&&this._controller.register(),this.emit(p.LOCAL_PLAYER_DISABLED,null)}_disableLocalTarget(){this._localPlayerEnabled=!1;const e=new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"Cannot perform command; local player is disabled.");this._deferredStreamer.reject(e),this._createStreamerDeferred(),this._deferredStreamer.reject(e)}_onStreamerConnect(){return this._deferredStreamer.promise}_onDeviceStateChanged(e){var t;const n=!!this._localPlayback,i=(e=!1)=>{this._generateLocalDeviceInfo(e).then((e=>{this.emit(p.LAST_ACTIVE_DEVICE_INFO_CHANGED,{deviceInfo:e,hasOrphanedState:!1})}))};if(this._localPlayerEnabled&&e.hasOrphanedState&&this._claimInactivePlayerStates)return this._hasFakeState=!0,void i(!0);if(this._hasFakeState=!1,this._localPlayback=!(!e.deviceInfo||!e.deviceInfo.local),this._localPlayback){if(!n&&(null===(t=this._streamer)||void 0===t?void 0:t.hasOptimisticUpdates())&&this._streamer.getCurrentState().then((e=>{this.emit(p.STATE_CHANGED,{state:e})})),!this._streamer)throw new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled.");this._streamer.getVolume().then((t=>{e.deviceInfo&&(e.deviceInfo.volume=t),this.emit(p.LAST_ACTIVE_DEVICE_INFO_CHANGED,e)})).catch((function(){}))}else this._onlyLocalState?(this._localPlayback||n)&&i():this.emit(p.LAST_ACTIVE_DEVICE_INFO_CHANGED,e)}_onDevicesChanged(e){this._parseDeviceList(e.data).then((e=>{(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Invalid devices list.");if(e.length!==t.length)return!1;for(let n=0,i=e.length;nPromise.resolve(e)));return t.length&&e.localDevice?this._hasFakeState&&e.localDevice&&(e.localDevice.is_active=!0):t.push(this._generateLocalDeviceInfo(this._hasFakeState)),Promise.all(t).then((e=>e))}_triggerLocalStateChanges(e){this._generateLocalDeviceInfo().then((e=>{this._onDeviceStateChanged({deviceInfo:e,hasOrphanedState:!1})})),this.emit(p.STATE_CHANGED,e)}_canStartNewContext(e){return this._runOnDevice(e,(()=>this._streamer?Promise.resolve(!0):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))),(()=>Promise.resolve(!0)),{bypassFakeState:!0})}_activateElement(){this._autoActivateElement=!1,this._streamer&&this._streamer.activateElement().catch((()=>{}))}_runOnDevice(e=void 0,t,n,i){return this._hasFakeState&&!(null==i?void 0:i.bypassFakeState)?(this._autoActivateElement&&this._activateElement(),this._claimStateAndRun(n,i)):this._forceRemoteActions?n():this._isTargetIdLocal(e).then((e=>e?this._onStreamerConnect().then(t):n()))}_claimStateAndRun(e,t){return this._onStreamerConnect().then((()=>{this._hasFakeState=!1;const e={paused:!0};return(null==t?void 0:t.loggingParams)&&(e.loggingParams=t.loggingParams),Promise.all([this._controller.transfer(u,e),new Promise(((e,t)=>{this._streamer?this._streamer.once("track_loaded",e):t(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}))])})).then((()=>e()))}_generateLocalDeviceInfo(e=!1){const t=this._client,n=this._streamer;let i=Promise.resolve(!1),o=Promise.resolve(-1);return this._localPlayerEnabled&&(e?i=Promise.resolve(!0):n&&(i=n.getCurrentState().then((e=>!!e))),n&&(o=n.getVolume())),Promise.all([t.getClientDescriptor(),t.getSDKId(),i,o]).then((([e,t,n,i])=>{var o;const r={hifi_status:{fully_supported:void 0,user_eligible:void 0,device_supported:null===(o=e.capabilities)||void 0===o?void 0:o.lossless_playback}};return{hidden:this._hidden,id:e.id,is_active:n,is_group:!1,is_being_activated:!1,is_controllable:this._localPlayerEnabled,is_observable:!!this._localPlayerEnabled&&!this._hidden,local:!0,metadata:e.metadata||{},name:e.name,type:e.type,version:t,volume:i,capabilities:{supports_lossless_audio:!1},playback_features:r,has_inactive_player_state:this._hasFakeState,disallow_transfer_reason:m.h.UNAVAILABLE}}))}_movePosition(e,t){return this.getCurrentState().then((n=>{if(!n||isNaN(n.position))return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Seeking not allowed with invalid track."));if(n.disallows.seeking)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Seeking not allowed with current content."));const i=e,r=Math.min(n.duration,Math.max(0,n.position+i));return this.seek(r,t)}))}_prepareSkipTrack(e){let t;return t="string"==typeof e?b(e):e,t}_cycleRepeatMode(e){return this.getCurrentState().then((t=>{if(!t)return Promise.reject(new g(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"));let n=null;const i=t.disallows;switch(t.repeat_mode){case h.OFF:if(i.toggling_repeat_context){if(i.toggling_repeat_track)return Promise.resolve(!1);n=h.TRACK}else n=h.CONTEXT;break;case h.CONTEXT:n=i.toggling_repeat_track?h.OFF:h.TRACK;break;case h.TRACK:default:n=h.OFF}return this.setRepeatMode(n,e)}))}_onSeekHandled(e){this._controller.seek(e.data.position)}getClientDescriptor(){return this._client.getClientDescriptor()}getProductState(){return this._client.getProductState()}getPublicTransport(){return this._client.getPublicTransport()}getUserInfo(){return this._client.getUserInfo()}getVersionDescriptor(){return this._client.getVersionDescriptor()}logAppMetrics(e,t){return this._client.logAppMetrics(e,t)}setName(e){return this._client.setName(e)}setNameTemplate(e){return this._client.setNameTemplate(e)}getContextPlayerState(){return this._controller.getContextPlayerState()}updateCurrentContext(e,t){return this._controller.updateCurrentContext(e,t)}getLastActiveDevice(){return this._onlyLocalState||this._hasFakeState?this._generateLocalDeviceInfo(this._hasFakeState):this._controller.getActiveDevice().then((e=>(null==e?void 0:e.local)&&this._streamer?(e.hidden=this._hidden,this._streamer.getVolume().then((t=>(e.volume=t,e)))):e))}getCurrentState(){if(!this._onlyLocalState&&(this._preferController||!this._localPlayback)){const e=!this._localPlayerEnabled||!this._claimInactivePlayerStates;return this._controller.getCurrentState(e).then((e=>!this._preferController&&this._localPlayback?this.getCurrentState():e))}return this._onStreamerConnect().then(this._streamer.getCurrentState.bind(this._streamer))}pause(e,t){return this._runOnDevice(e,(()=>this._streamer.pause()),this._controller.pause.bind(this._controller,e,t),{loggingParams:null==t?void 0:t.loggingParams})}resume(e,t){return this._runOnDevice(e,(()=>this._streamer.resume()),this._controller.resume.bind(this._controller,e,t),{loggingParams:null==t?void 0:t.loggingParams})}togglePlay(e,t){return this._runOnDevice(e,(()=>this._streamer.togglePlay()),this._controller.togglePlay.bind(this._controller,e,t),{loggingParams:null==t?void 0:t.loggingParams})}playURI(e,t,n){return this._canStartNewContext(t).then((()=>(this._autoActivateElement&&this._activateElement(),this._controller.playURI(e,t,n))))}playPages(e,t,n){return this._canStartNewContext(t).then((()=>(this._autoActivateElement&&this._activateElement(),this._controller.playPages(e,t,n))))}playTracks(e,t,n){return this._canStartNewContext(t).then((()=>(this._autoActivateElement&&this._activateElement(),this._controller.playTracks(e,t,n))))}nextTrack(e,t){return this.getCurrentState().then((n=>{if(null==n?void 0:n.disallows.skipping_next)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Skipping is not allowed with current content."));const i={};let r=()=>this._streamer.nextTrack(s.FORWARD_BUTTON);const a=this._controller.nextTrack.bind(this._controller,e,i);return(null==t?void 0:t.track)&&(r=a,i.track=this._prepareSkipTrack(t.track)),(null==t?void 0:t.loggingParams)&&(i.loggingParams=t.loggingParams),this._runOnDevice(e,r,a,{loggingParams:null==t?void 0:t.loggingParams})}))}smartPreviousTrack(e,t){return this.getCurrentState().then((n=>{if(!n)return Promise.reject(new g(o.HARMONY_NO_TRACKS_LOADED,"No current state."));return(n.disallows||{}).seeking||n.position<3e3&&n.track_window&&n.track_window.previous_tracks&&n.track_window.previous_tracks.length>0?n.disallows.skipping_prev?Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Skipping is not allowed with current content.")):this.previousTrack(e,t):n.disallows.seeking?Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Seeking is not allowed with current content.")):this.seek(0,e)}))}previousTrack(e,t){return this.getCurrentState().then((n=>{if(null==n?void 0:n.disallows.skipping_prev)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Skipping is not allowed with current content."));const i={};let r=()=>this._streamer.previousTrack(s.FORWARD_BUTTON);const a=this._controller.previousTrack.bind(this._controller,e,i);return(null==t?void 0:t.track)&&(r=a,i.track=this._prepareSkipTrack(t.track)),(null==t?void 0:t.loggingParams)&&(i.loggingParams=t.loggingParams),this._runOnDevice(e,r,a,{loggingParams:null==t?void 0:t.loggingParams})}))}seek(e,t){return this._runOnDevice(t,(()=>this._streamer.seek(e)),this._controller.seek.bind(this._controller,e,t))}seekForward(e=15e3,t){return this._movePosition(e,t)}seekBackward(e=15e3,t){return this._movePosition(-1*e,t)}getVolume(){return this._streamer?this._streamer.getVolume():Promise.resolve(-1)}setVolume(e,t){return this._runOnDevice(t,(()=>this._streamer.setVolume(e)),this._controller.setVolume.bind(this._controller,e),{bypassFakeState:!0})}getVideoProfiles(){if(!this._streamer)throw new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled.");return this._streamer.getVideoVariants()}setPreferredBitrate(e){if(!this._streamer)throw new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled.");return this._streamer.setPreferredBitrate(e)}getDevices(){return this._controller.getDevices().then(this._parseDeviceList).then((e=>(this._lastDeviceList=e,e)))}setQueue(e,t,n){console.warn("Harmony.setQueue is deprecated; migrate to new PlayerQueue API");const i=this._controller.setQueue.bind(this._controller,e,t,n);return this._runOnDevice(n,i,i)}addToQueue(e,t){const n=e.map((e=>"string"==typeof e?e:e.uri));return this._controller.getQueueManager().addToQueue(n,t)}setShuffle(e,t,n){const i=this._controller.setShuffle.bind(this._controller,e,t,n);return this._runOnDevice(t,i,i,{loggingParams:null==n?void 0:n.loggingParams})}toggleShuffle(e,t){const n=this._controller.toggleShuffle.bind(this._controller,e,t);return this._runOnDevice(e,n,n,{loggingParams:null==t?void 0:t.loggingParams})}setRepeatMode(e,t){const n=this._controller.setRepeatMode.bind(this._controller,e,t);return this._runOnDevice(t,n,n)}cycleRepeatMode(e){const t=this._cycleRepeatMode.bind(this,e);return this._runOnDevice(e,t,t)}transfer(e,t){const n=e||u,i=this._controller.transfer.bind(this._controller,n,t);return this._autoActivateElement&&this._activateElement(),this._runOnDevice(n,i,i,{bypassFakeState:!0,loggingParams:null==t?void 0:t.loggingParams})}logout(e){return this._controller.logout(e||u)}activateElement(){return this._streamer?this._streamer.activateElement():Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}getQueueManager(){return this._controller.getQueueManager(((e,t)=>this._runOnDevice(t,e,e)),{reportInactiveQueues:this._claimInactivePlayerStates,onlyLocalQueue:this._onlyLocalState,reportInitial:this._hasFakeState||this._localPlayback})}hideSubtitles(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot hide subtitles on remote player."));const e=this._streamer;return e?this.getCurrentState().then((t=>{var n;return"video"!==(null===(n=null==t?void 0:t.track_window.current_track)||void 0===n?void 0:n.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):e.hideSubtitles()})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}showSubtitles(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot show subtitles on remote player."));const e=this._streamer;return e?this.getCurrentState().then((t=>{var n;return"video"!==(null===(n=null==t?void 0:t.track_window.current_track)||void 0===n?void 0:n.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):e.showSubtitles()})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}areSubtitlesShown(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot show subtitles on remote player."));const e=this._streamer;return e?this.getCurrentState().then((t=>{var n;return"video"!==(null===(n=null==t?void 0:t.track_window.current_track)||void 0===n?void 0:n.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):e.areSubtitlesShown()})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}getSubtitleLanguages(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot get subtitle languages on remote player."));const e=this._streamer;return e?this.getCurrentState().then((t=>{var n;return"video"!==(null===(n=null==t?void 0:t.track_window.current_track)||void 0===n?void 0:n.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):e.getSubtitleLanguages()})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}getActiveSubtitleLanguage(){if(!this._localPlayback)return Promise.resolve(null);const e=this._streamer;return e?this.getCurrentState().then((t=>{var n;return"video"!==(null===(n=null==t?void 0:t.track_window.current_track)||void 0===n?void 0:n.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):e.getActiveSubtitleLanguage()})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}setSubtitleLanguage(e){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot set subtitle languages on remote player."));const t=this._streamer;return t?this.getCurrentState().then((n=>{var i;return"video"!==(null===(i=null==n?void 0:n.track_window.current_track)||void 0===i?void 0:i.media_type)?Promise.reject(new g(o.HARMONY_INVALID_MEDIA_TYPE,"Content type does not allow subtitles.")):t.setSubtitleLanguage(e)})):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}deactivateSubtitleEvents(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot deactivate subtitle events on remote player."));const e=this._streamer;return e?e.deactivateSubtitleEvents():Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}activateSubtitleEvents(){if(!this._localPlayback)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot activate subtitle events on remote player."));const e=this._streamer;return e?e.activateSubtitleEvents():Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}setBackgrounded(e){return this._localPlayback?this._streamer?this._streamer.setBackgrounded(e):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled.")):Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot set background mode on remote player."))}setVideoResolution(e){return this._localPlayback?this._streamer?this._streamer.setVideoResolution(e):Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled.")):Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot set preferred video resolution on remote player."))}getMediaConfig(){return this._streamer?this._streamer.getMediaConfig():Promise.reject(new g(o.HARMONY_LOCAL_PLAYER_DISABLED,"The local player is not enabled."))}setPlaybackSpeed(e,t){return isNaN(e)||e<.5||e>3.5?Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,`Invalid playback speed: ${e}. Should be in range 0.5 - 3.5`)):this.getCurrentState().then((n=>!n||n.disallows.setting_playback_speed?Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Cannot change playback speed; content type is not allowed.")):this._runOnDevice(t,(()=>this._streamer.setPlaybackSpeed(e)),(()=>this._controller.setPlaybackSpeed(e,t)))))}sendCustomSignal(e,t,n){return this._controller.sendCustomSignal(e,t,n)}playAsNextInQueue(e,t,n){return this._controller.playAsNextInQueue(e,t,n)}}var T=n(92614),O=n(14297),I=n(95471);const C="spotify:user:attributes:mutated";class N extends c.vp{constructor(e){super(),this._currentState=null,this._transport=e.transport,this._endpoint=e.endpoint||"@webgate/melody",this._handleUserUpdate=this._handleUserUpdate.bind(this),this._init()}static create(e){return new N(e)}_init(){this.register()}_handleUserUpdate(){clearTimeout(this._debounce),this._debounce=setTimeout((()=>{this._transport.forceTokenRefresh().catch((function(){})),this.getCurrentState(!0).then((e=>{this.emit(I.j.PRODUCT_STATE_CHANGED,{productState:e})}))}),300)}_shouldRetry(e,t){const n=e.getStatusFamily();return n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}getCurrentState(e){return!e&&this._currentState?Promise.resolve(this._currentState):this._transport.request(`${this._endpoint}/v1/product_state`,{method:"GET",responseType:"json",retry:{condition:this._shouldRetry}}).then((e=>{if(e.status!==O.G.OK||!e.body)throw this._currentState=null,new Error("Cannot get the user's product state.");return this._currentState=e.body,e.body}))}register(){return this._transport.matchMessages(C,this._handleUserUpdate),Promise.resolve(!0)}deregister(){return this._transport.unmatchMessages(C,this._handleUserUpdate),Promise.resolve(!0)}}const L=/(edge)[\s\/:]([\w\d\.]+)/,R=new RegExp("(opera|ie|firefox|chrome|trident|crios|version)[\\s/:]([\\w\\d\\.]+)?.*?(safari|(?:rv[\\s\\/:]|version[\\s\\/:])([\\w\\d\\.]+)|$)"),P={};function k(e){if(!e)return e;const t=function(e,t){var n,i,o;const r=e.toLowerCase();let a=t?t.toLowerCase():"";const s=`${r}:${a}`,c=P[s];if(c)return c;const l=r.match(L),u=r.match(R)||[null,"unknown",0],d=l||u;"trident"===d[1]?(d[1]="ie",d[4]&&(d[2]=d[4])):"crios"===d[1]&&(d[1]="chrome"),a=r.match(/ip(?:ad|od|hone)/)?"ios":null!==(n=(r.match(/(?:webos|android)/)||r.match(/mac|win|linux|cros/)||[])[0])&&void 0!==n?n:"other","win"===a&&(a="windows");const p="version"===d[1]?d[3]:d[1],f="opera"===d[1]&&d[4]?d[4]:d[2],h={name:null!==(i=null==p?void 0:p.toString())&&void 0!==i?i:"unknown",version:null!==(o=null==f?void 0:f.toString())&&void 0!==o?o:"unknown",platform:a};return P[s]=h,h}(navigator.userAgent,navigator.platform);return e.replace(/\{\{([^}]+?)\}\}/g,(function(e,n){return i=n,(o=t)&&o.hasOwnProperty(i)?t[n]:"";var i,o}))}var D,w;!function(e){e.FILE_URLS_MP3="file_urls_mp3",e.FILE_URLS_EXTERNAL="file_urls_external",e.FILE_IDS_MP3="file_ids_mp3",e.FILE_IDS_MP4="file_ids_mp4",e.FILE_IDS_MP4_DUAL="file_ids_mp4_dual",e.FILE_IDS_CBCS="file_ids_mp4_cbcs",e.FILE_IDS_MP4FLAC="file_ids_mp4flac",e.MANIFEST_IDS_VIDEO="manifest_ids_video",e.MANIFEST_URLS_VIDEO_AD="manifest_urls_video_ad"}(D||(D={})),function(e){e.UNKNOWN="unknown",e.COMPUTER="computer",e.TABLET="tablet",e.SMARTPHONE="smartphone",e.SPEAKER="speaker",e.TV="tv",e.AVR="avr",e.STB="stb",e.AUDIO_DONGLE="audio_dongle",e.GAME_CONSOLE="game_console",e.CAST_VIDEO="cast_video",e.CAST_AUDIO="cast_audio",e.AUTOMOBILE="automobile",e.SMARTWATCH="smartwatch",e.CHROMEBOOK="chromebook"}(w||(w={}));var M=n(30622);function x(){const e=new Uint8Array(16);crypto.getRandomValues(e);return M.R.toHex(e.join(""),40).slice(0,40)}function U(){const e=new Array(27);let t=e.length;for(;t--;)e[t]=Math.floor(8*Math.random());return M.R.toHex(e.join(""),40)}const V="undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues?x:U,F="_spharmony_device_id";const B={get:function(e,t=!1){if(e&&"string"==typeof e)return e;if(t)return V();let n=localStorage.getItem(F);return n||(n=V(),localStorage.setItem(F,n)),n},generate:V,generateWithCrypto:x,generateWithRandom:U};class H extends c.vp{constructor(e){var t;if(super(),this._platformVersion="",this._metadata={},this._manifestPrependOffset=0,!e)throw new TypeError("Invalid argument `options`.");if(!e.id)throw new TypeError("Argument `options.id` is required.");if(!e.name||!e.model||!e.type)throw new TypeError("Incomplete `options` value.");this._id=e.id,this._type=e.type,this._brand=e.brand,this._model=e.model,this._isGroup=!!e.is_group,this._name=e.name,this._platformName=e.platform_name,this._platformIdentifier=e.platform_identifier,this._platformVersion=e.platform_version||"",this._metadata=e.metadata||{},this._capabilities=e.capabilities||{manifest_formats:[]},this._manifestPrependOffset=(null===(t=this._capabilities.manifest_formats)||void 0===t?void 0:t.length)||0}static create(e){return new H({id:B.get(e.id,e.randomizeId),model:e.model||k("harmony-{{name}}.{{version}}-{{platform}}").toLowerCase(),name:e.nameTemplate?k(e.nameTemplate):e.name||(t=k("Spotify ({{name}}/{{platform}})"),t.replace(/\b[a-z]/g,(e=>e.toUpperCase()))),type:e.type||w.COMPUTER,brand:e.brand||"SpotifyHarmonyGeneric",platform_name:e.platform_name,platform_identifier:e.platform_identifier,platform_version:e.platform_version,metadata:e.metadata||{},capabilities:e.capabilities||{},is_group:!!e.is_group});var t}getId(){return this._id}setCapability(e,t){if("manifest_formats"===e)throw new TypeError('Cannot change capability "manifest_formats"');return this._capabilities[e]=t,this.emit("descriptor_changed",{descriptor:this.toJSON()}),!0}getCapability(e){if("manifest_formats"===e)throw new TypeError("Use `descriptor.getManifestFormats()`.");return this._capabilities[e]}setName(e){return this._name=e,this.emit("descriptor_changed",{descriptor:this.toJSON()}),!0}getName(){return this._name}getType(){return this._type}getBrand(){return this._brand}getModel(){return this._model}getPlatformIdentifier(){return this._platformIdentifier||`Partner ${this._brand} ${this._model}`}getPlatformName(){return this._platformName||this.getPlatformIdentifier()}getPlatformVersion(){return this._platformVersion}getManifestFormats(){return this._capabilities.manifest_formats||[]}appendManifestFormat(...e){const t=this._capabilities.manifest_formats;Array.isArray(t)&&t.push(...e)}prependManifestFormat(...e){const t=this._capabilities.manifest_formats;Array.isArray(t)&&t.splice(this._manifestPrependOffset,0,...e)}supportsVideoManifestFormats(){const e=this._capabilities.manifest_formats;return-1!==(null==e?void 0:e.indexOf(D.MANIFEST_IDS_VIDEO))}toJSON(){return{brand:this._brand,capabilities:Object.assign({},this._capabilities),id:this._id,metadata:Object.assign({},this._metadata),model:this._model,name:this._name,platform_name:this._platformName,platform_identifier:this._platformIdentifier,platform_version:this._platformVersion,type:this._type}}toTrackPlaybackDeviceInfo(){return{brand:this._brand,capabilities:Object.assign({},this._capabilities),device_id:this._id,device_type:this._type,metadata:Object.assign({},this._metadata),model:this._model,name:this._name,platform_name:this._platformName,platform_identifier:this._platformIdentifier,is_group:this._isGroup}}}const G={tagged:"4.39.0-815fa275",version:"4.39.0",revision:"815fa275"};var K=n(98429);class W{constructor(e){this._melodyLogger=new K.Hx(e)}logClientEvent(e,t){return e?this._melodyLogger.sendLog("/v1/msg/batch",{type:"client_event",message:{source:e.source||K.eV.UNKNOWN,context:e.context||K.eV.UNKNOWN,event:e.event||K.eV.UNKNOWN,event_version:e.event_version||K.eV.EMPTY,test_version:e.test_version||K.eV.EMPTY,source_version:e.source_version||K.eV.UNKNOWN,source_vendor:e.source_vendor||K.eV.UNKNOWN,json_data:"json"===t?e.json_data||"{}":JSON.stringify(e.json_data||{})}},{batch:!0}):Promise.reject(new TypeError("Logger.logClientEvent `data` cannot be null."))}logMetrics(e,t){if(!e&&!t)return Promise.resolve(!0);const n=e||[],i=t||[];if(!n.length&&!i.length)return Promise.resolve(!0);if(!Array.isArray(n)||!Array.isArray(i))return Promise.reject(new TypeError("Logger.logMetrics `meters` and `timers` must be null or an array."));for(const e of n)if(!("what"in e)||!("result"in e)||!("reason"in e))return Promise.reject(new TypeError("Logger.logMetrics: Invalid meter format in `meters` array."));for(const e of i)if(!("what"in e)||!("duration"in e))return Promise.reject(new TypeError("Logger.logMetrics: Invalid timer format in `timers` array."));return this._melodyLogger.sendLog("/v1/metric",{sdk_id:void 0,platform:void 0,client_version:void 0,meters:n,timers:i})}logJSSDKError(e,t){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_error",message:{source:e.source||K.eV.UNKNOWN,source_version:e.source_version||K.eV.UNKNOWN,type:e.type||K.eV.UNKNOWN,message:e.message||K.eV.EMPTY,stack:JSON.stringify(e.stack||K.eV.EMPTY),json_data:"json"===t?e.json_data||"{}":JSON.stringify(e.json_data||{}),json_data_version:e.json_data_version||K.eV.EMPTY_VERSION}},{batch:!0})}logJSSDKContentRequest(e){var t;return this._melodyLogger.sendLog("/v1/msg/jssdk_content_request",{source:e.source||K.eV.UNKNOWN,type:e.type||K.eV.UNKNOWN,http_status:null!==(t=e.http_status)&&void 0!==t?t:void 0,ms_request_duration:e.ms_request_duration||K.eV.EMPTY,n_retries:e.n_retries||K.eV.ZERO,playback_id:e.playback_id||K.eV.EMPTY})}}const Y=T.P.forTag("harmonyclient"),j=/^[a-zA-Z0-9_%:-]{1,40}$/;class z extends c.vp{constructor(e){if(super(),this._platformIdentifier=(0,l.$)(),this._platformVersion=(0,l.$)(),!e)throw new TypeError("Argument `options` is not defined.");if(!e.transport)throw new TypeError("No Transport instance provided");if(!e.transport.hasPlugin("dealer"))throw new TypeError("Transport has no Dealer plugin.");this._transport=e.transport,this._deviceDescriptor=this._initDeviceDescriptor(e),this._logger=new W({transport:this._transport.toPublic(),sdkId:this.getSDKId(),platform:this._platformIdentifier.promise,clientVersion:this._platformVersion.promise}),this._productStateObserver=N.create({transport:this._transport}),this._onConnected=this._onConnected.bind(this),this._onAuthenticated=this._onAuthenticated.bind(this),this._onConnectionError=this._onConnectionError.bind(this),this._onAuthenticationError=this._onAuthenticationError.bind(this),this._onShortSessionDisconnect=this._onShortSessionDisconnect.bind(this),this._attachListeners()}static create(e){return new z(e)}static of(e){return e._client}_createDeviceDescriptor(e,t={}){var n,i;if((null==t?void 0:t.id)&&!j.test(t.id))throw g.fatal(o.HARMONY_INVALID_DESCRIPTOR_ID,"Invalid device id.");const r=t.capabilities||{},a={change_volume:null===(n=r.change_volume)||void 0===n||n,endsong_snooping:r.endsong_snooping,enable_play_token:!0,supports_file_media_type:!0,play_token_lost_behavior:e.playTokenLostBehavior||"pause",disable_connect:!!e.hidden,audio_podcasts:null===(i=r.audio_podcasts)||void 0===i||i,video_playback:r.video_playback,lossless_playback:r.lossless_playback,volume_steps:void 0!==r.volume_steps&&r.volume_steps>=0&&r.volume_steps(this._onError(f.HARMONY,{error:e}),Promise.reject(e))))}_attachListeners(){const e=this._transport;e.on(a.TransportEvent.CONNECTED,this._onConnected),e.on(a.TransportEvent.AUTHENTICATED,this._onAuthenticated),e.on(a.TransportEvent.CONNECTION_FAILED,this._onConnectionError),e.on(a.TransportEvent.AUTHENTICATION_FAILED,this._onAuthenticationError),this.proxyEmit(e,a.TransportEvent.RECONNECTING,"reconnecting"),this.proxyEmit(e,a.TransportEvent.RECONNECTED,"reconnected"),this.proxyEmit(e,a.TransportEvent.LOGGED_OUT,"logged_out"),this.proxyEmitSync(e,a.TransportEvent.BEFORE_OFFLINE_DISCONNECT,"before_offline_disconnect"),this.proxyEmitSync(e,a.TransportEvent.BEFORE_ONLINE_DISCONNECT,"before_disconnect"),e.on(a.TransportEvent.SHORT_SESSION_DISCONNECTED,this._onShortSessionDisconnect.bind(this)),this.proxyEmit(this._productStateObserver,a.TransportEvent.PRODUCT_STATE_CHANGED,"product_state_changed"),this.on("before_disconnect",(e=>{const t=this._productStateObserver.deregister().catch((()=>{}));e.data.awaitPromise(t)}))}_onError(e,t){this.emit("error",{source:e,error:t.error}),t.error&&t.error.unrecoverable&&this.emit("unrecoverable_failure",{source:e,error:t.error})}_onConnected(){this.emit("connected",null)}_onAuthenticated(){this.emit("authenticated",null)}_onConnectionError(e){this._onError(f.TRANSPORT,{error:e.data.error}),this.emit("connection_error",e.data)}_onAuthenticationError(e){this._onError(f.TRANSPORT,{error:e.data.error}),this.emit("authentication_error",e.data)}_onShortSessionDisconnect(e){this._logger.logClientEvent({source:"transport",source_version:G.tagged,source_vendor:"spotify",event:e.type,event_version:"1.0.0",json_data:{disconnectCount:e.data.disconnectCount,sessionLength:e.data.sessionLength}},"object").catch((t=>Y.warn(`${e.type} Logging Error:`,t)))}getVersionDescriptor(){return Object.assign({},G)}getSDKId(){return`harmony:${G.tagged}`}getUntaggedSDKId(){return`harmony:${G.version}`}getPlatformIdentifier(){return this._platformIdentifier.promise}getPlatformVersion(){return this._platformVersion.promise}getLogger(){return this._logger}logAppMetrics(e,t){if(!this._logger)throw new TypeError("Invalid logger instance");return this._logger.logMetrics(e,t)}request(e,t){return this._transport.request(e,t)}getPublicTransport(){return this._transport.toPublic()}getClientDescriptor(){return this._deviceDescriptor.then((e=>e.toJSON()))}getDeviceDescriptor(){return this._deviceDescriptor}getUserInfo(){return this._transport.request("@webapi/v1/me",{responseType:"json"}).then((e=>{const t=e.body;if(200!==e.status){const t=new g(o.USER_INFO_REQUEST_FAILED_WITH_STATUS,`User info request failed with status ${e.status}`);return t.status=e.status,Promise.reject(t)}return t?{display_name:t.display_name,followers:t.followers,id:t.id,images:t.images,uri:t.uri}:Promise.reject(new g(o.USER_INFO_REQUEST_EMPTY_RESPONSE,"Unexpected empty response."))}))}getProductState(){return this._productStateObserver.getCurrentState()}setName(e){return this._deviceDescriptor.then((function(t){return t.setName(e)}))}setNameTemplate(e){return this.setName(k(e))}setCapability(e,t){return this._deviceDescriptor.then((n=>n.setCapability(e,t)))}notifyError(e,t){this._onError(e,{error:t})}}var J,q=n(59797),X=(n(46758),n(27082),n(87493));!function(e){e.FRAGMENT_FETCHED="fragment_fetched",e.FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.VIDEO_PROFILE_CHANGED="video_profile"}(J||(J={}));var Z,Q,$,ee,te;!function(e){e.URL="URL",e.MSE="MSE"}(Z||(Z={})),function(e){e.KEY_SESSION_MESSAGE="message",e.KEY_SESSION_STATUSES_CHANGE="keystatuseschange",e.MEDIA_SOURCE_OPEN="sourceopen",e.MEDIA_SOURCE_CLOSE="sourceclose",e.SOURCE_BUFFER_UPDATE_END="updateend",e.MS_KEY_ADDED="mskeyadded",e.MS_KEY_ERROR="mskeyerror",e.MS_KEY_MESSAGE="mskeymessage",e.MS_NEEDKEY="msneedkey",e.WEBKIT_KEY_ADDED="webkitkeyadded",e.WEBKIT_KEY_ERROR="webkitkeyerror",e.WEBKIT_KEY_MESSAGE="webkitkeymessage",e.WEBKIT_NEEDKEY="webkitneedkey",e.V0_1B_KEY_ADDED="keyadded",e.V0_1B_KEY_ERROR="keyerror",e.V0_1B_KEY_MESSAGE="keymessage",e.V0_1B_NEEDKEY="needkey",e.MEDIA_CANPLAY="canplay",e.MEDIA_CANPLAYTHROUGH="canplaythrough",e.MEDIA_DURATIONCHANGE="durationchange",e.MEDIA_ENCRYPTED="encrypted",e.MEDIA_ENDED="ended",e.MEDIA_ERROR="error",e.MEDIA_LOADEDMETADATA="loadedmetadata",e.MEDIA_PAUSE="pause",e.MEDIA_PLAY="play",e.MEDIA_PLAYING="playing",e.MEDIA_SEEKING="seeking",e.MEDIA_TIMEUPDATE="timeupdate",e.MEDIA_WAITING="waiting",e.MEDIA_RATECHANGE="ratechange",e.MEDIA_RESIZE="resize",e.INTERNAL_ENCRYPTED="__encrypted",e.INTERNAL_PLAYER_CANPLAY="__canplay",e.INTERNAL_PLAYER_CANPLAYTHROUGH="__canplaythrough",e.INTERNAL_MEDIA_REQUIRES_DURATION="__requiresduration",e.INTERNAL_PLAYER_LOADED_METADATA="__loadedmetadata",e.BUFFER_APPEND_ERROR="append_error",e.BUFFER_STALLED="stalled",e.BUFFERING_START="buffering_start",e.BUFFERING_END="buffering_end",e.BUFFER_SOURCE_OPEN="source_open",e.BUFFER_SOURCE_CLOSE="source_close",e.BUFFER_UPDATE_END="update_end",e.BUFFER_QUOTA_EXCEEDED="quota_exceeded",e.EME_LICENSE_REQUEST_ERROR="license_request_error",e.EME_LICENSE_REQUEST_CAPPED="license_request_capped",e.LIST_PLAYER_AUTOPLAY_FAILED="player_autoplay_failed",e.LIST_PLAYER_BEFORE_LIST_CHANGE="before_list_change",e.LIST_PLAYER_BEFORE_NEXT="before_next",e.LIST_PLAYER_BEFORE_PLAYER_LOAD="before_player_load",e.LIST_PLAYER_BEFORE_PREVIOUS="before_previous",e.LIST_PLAYER_BEFORE_TRACK_LOAD="before_track_load",e.LIST_PLAYER_BEFORE_VOLUME_CHANGE="before_volume_change",e.LIST_PLAYER_BUFFER_STALLED="stalled",e.LIST_PLAYER_BUFFERING_START="buffering_start",e.LIST_PLAYER_BUFFERING_END="buffering_end",e.LIST_PLAYER_REBUFFERING_START="rebuffering_start",e.LIST_PLAYER_REBUFFERING_END="rebuffering_end",e.LIST_PLAYER_CAPPED="capped",e.LIST_PLAYER_CLEARED="cleared",e.LIST_PLAYER_DURATION_CHANGED="duration_changed",e.LIST_PLAYER_ERROR="error",e.LIST_PLAYER_ERROR_SYNC="error_sync",e.LIST_PLAYER_LIST_CHANGED="list_change",e.LIST_PLAYER_LIST_ENDED="list_ended",e.LIST_PLAYER_LOAD_VIDEO="load_video",e.LIST_PLAYER_MAX_LIST_ERRORS_REACHED="max_list_errors_reached",e.LIST_PLAYER_PAUSED="paused",e.LIST_PLAYER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.LIST_PLAYER_PLAYER_LOAD="player_load",e.LIST_PLAYER_PLAYING="playing",e.LIST_PLAYER_POSITION_CHANGED="position_changed",e.LIST_PLAYER_PROGRESS="progress",e.LIST_PLAYER_REPEAT_MODE_CHANGED="repeat_mode_changed",e.LIST_PLAYER_SHUFFLE_CHANGED="shuffle_changed",e.LIST_PLAYER_STOPPED="stopped",e.LIST_PLAYER_STOPPED_VIDEO="stopped_video",e.LIST_PLAYER_TRACKING_DATA_CREATED="tracking_data_created",e.LIST_PLAYER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.LIST_PLAYER_TRACK_ENDED="track_ended",e.LIST_PLAYER_TRACK_LOADED="track_loaded",e.LIST_PLAYER_TRACK_TIMEOUT="track_timeout",e.LIST_PLAYER_TRACK_UNPLAYABLE="track_unplayable",e.LIST_PLAYER_DATA_CREATED="tracking_data_created",e.LIST_PLAYER_DATA_FINALIZED="tracking_data_finalized",e.LIST_PLAYER_VOLUME_CHANGED="volume_changed",e.LIST_PLAYER_VIDEO_ELEMENT_APPENDED="video_element_appended",e.LIST_PLAYER_VIDEO_ELEMENT_REMOVED="video_element_removed",e.LIST_PLAYER_VIDEO_PROFILE_CHANGED="video_profile_changed",e.LIST_PLAYER_SEEK_HANDLED="list_player_seek_handled",e.LIST_PLAYER_DISPLAYED_CUES_CHANGED="displayed_cues_changed",e.LIST_PLAYER_PLAYBACK_SPEED_CHANGED="playback_speed_changed",e.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded",e.LOGGER_ERROR="error",e.PLAYER_AUTOPLAY_FAILED="player_autoplay_failed",e.PLAYER_BEFORE_LOAD="before_load",e.PLAYER_BEFORE_STOP="before_stop",e.PLAYER_BEFORE_VOLUME_CHANGE="before_volume_change",e.PLAYER_BUFFER_STALLED="stalled",e.PLAYER_BUFFERING_START="buffering_start",e.PLAYER_BUFFERING_END="buffering_end",e.PLAYER_CAN_PRELOAD="can_preload",e.PLAYER_CAPPED="capped",e.PLAYER_DURATION_CHANGED="duration_changed",e.PLAYER_ENDED="ended",e.PLAYER_ENDED_VIDEO="ended_video",e.PLAYER_ERROR="error",e.PLAYER_WARNING="warning",e.PLAYER_FIRST_BYTES="first_bytes",e.PLAYER_KEY_RECEIVED="key",e.PLAYER_LOAD="load",e.PLAYER_LOAD_VIDEO="load_video",e.PLAYER_LOADING_FAILED="loading_failed",e.PLAYER_PAUSED="paused",e.PLAYER_PLAY="play",e.PLAYER_PLAYING="playing",e.PLAYER_POSITION_CHANGED="position_changed",e.PLAYER_PRELOADING_ERROR="preloading_error",e.PLAYER_PROGRESS="progress",e.PLAYER_REBUFFERING_START="rebuffering_start",e.PLAYER_REBUFFERING_END="rebuffering_end",e.PLAYER_STALLED="stalled",e.PLAYER_STOPPED="stopped",e.PLAYER_STOPPED_VIDEO="stopped_video",e.PLAYER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.PLAYER_TIMEOUT="timeout",e.PLAYER_PLAYBACK_START="playback_start",e.PLAYER_TRACKING_DATA_CREATED="tracking_data_created",e.PLAYER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.PLAYER_VIDEO_ELEMENT_APPENDED="video_element_appended",e.PLAYER_VIDEO_ELEMENT_REMOVED="video_element_removed",e.PLAYER_VIDEO_PROFILE_CHANGED="video_profile_changed",e.PLAYER_DISPLAYED_CUES_CHANGED="displayed_cues_changed",e.PLAYER_SEEKING="seeking",e.PLAYER_FRAGMENT_FETCHED="fragment_fetched",e.PLAYER_FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.PLAYER_VIDEO_MANIFEST_RESOLVED="video_manifest_resolved",e.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED="video_manifest_resolve_failed",e.PLAYER_PLAYBACK_SPEED_CHANGED="playback_speed_changed",e.PLAYER_SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded",e.PLAYER_VIDEO_RESIZED="resize",e.PLAYER_MANAGER_READY="ready",e.TRACKER_PLAYBACK_START="playback_start",e.TRACKER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.TRACKER_TRACKING_DATA_CREATED="tracking_data_created",e.TRACKER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.TRACKER_FIRST_QUARTILE="tracking_first_quartile",e.TRACKER_MIDPOINT="tracking_midpoint",e.TRACKER_THIRD_QUARTILE="tracking_third_quartile",e.VIDEO_MANIFEST_RESOLVED="video_manifest_resolved",e.VIDEO_MANIFEST_RESOLVE_FAILED="video_manifest_resolve_failed",e.ABR_MANAGER_BITRATE_CHANGE="bitrate_change",e.REPORTING_START="reporting_start",e.REPORTING_CREATIVE_VIEW="reporting_creative_view",e.REPORTING_FIRST_QUARTILE="reporting_first_quartile",e.REPORTING_MIDPOINT="reporting_midpoint",e.REPORTING_THIRD_QUARTILE="reporting_third_quartile",e.REPORTING_COMPLETE="reporting_complete",e.REPORTING_PAUSE="reporting_pause",e.REPORTING_RESUME="reporting_resume",e.REPORTING_ERROR="reporting_error"}(Q||(Q={})),function(e){e.WIDEVINE="com.widevine.alpha",e.PLAYREADY="com.microsoft.playready",e.PLAYREADY_HARDWARE="com.microsoft.playready.hardware",e.FAIRPLAY="com.apple.fps.1_0",e.INVALID_SPOTIFY_KEY="com.spotify.invalid"}($||($={})),function(e){e.SUCCESS="RESULT_SUCCESS",e.INVALID="RESULT_INVALID",e.FORBIDDEN="RESULT_FORBIDDEN",e.OUT_OF_BOUNDS="RESULT_OUT_OF_BOUNDS",e.NO_LIST="RESULT_NO_LIST",e.NO_TRACK="RESULT_NO_TRACK",e.LIST_END="RESULT_LIST_END",e.INVALID_TRACK="RESULT_INVALID_TRACK",e.CANCELLED="CANCELLED",e.NO_TRACK_PLAYER="NO_TRACK_PLAYER"}(ee||(ee={})),function(e){e.MP3="MP3",e.MP4="MP4",e.MP4_DUAL="MP4_DUAL",e.MP4_CBCS="MP4_CBCS",e.MP4_FLAC="MP4_FLAC",e.MANIFEST_ID="MANIFEST_ID",e.AD_MANIFEST="AD_MANIFEST",e.GENERIC_MEDIA="GENERIC_MEDIA"}(te||(te={}));class ne extends Error{constructor(e,t){super(),this.unrecoverable=!1,this.listPlayerIgnore=!1,this.debug={},this.name="PlaybackError",this.code=e,this.message=t}static fatal(e,t){const n=new ne(e,t);return n.unrecoverable=!0,n}}n(31546);class ie extends Error{constructor(e=i.EME_ERROR_UNKNOWN,t){super(t),this.status=-1,this.licenseServer="",this.shouldRefreshEndpoint=!1,this.unrecoverable=!1,this.debug={},this.code=e,this.message=t,this.name="EMEError"}static fatal(e=i.EME_ERROR_UNKNOWN,t){const n=new ie(e,t);return n.unrecoverable=!0,n}}class oe extends Error{constructor(e,t){super(t),this.name="CappingError",this.message=t,this.code=e}}function re(e){const t=document.createEvent("Event");t.initEvent("encrypted",!1,!1),t.initDataType="cenc",t.initData=e.initData,t.fromPolyfill=!0,this.dispatchEvent(t)}class ae extends c.B{constructor(e){super(Q.KEY_SESSION_MESSAGE,null),this.messageType="license-request",this.message=e}}class se extends c.vp{constructor(e){super(),this._nativeKeySession=null,this._lastUpdateDeferred=(0,l.$)(),this._lastGenerateDeferred=(0,l.$)(),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener,this._nativeMediaKeys=e,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}_attach(){const e=this._nativeKeySession;e&&(e.addEventListener(Q.MS_KEY_ADDED,this._onKeyAdded),e.addEventListener(Q.MS_KEY_ERROR,this._onKeyError),e.addEventListener(Q.MS_KEY_MESSAGE,this._onKeyMessage))}_detach(){const e=this._nativeKeySession;e&&(e.removeEventListener(Q.MS_KEY_ADDED,this._onKeyAdded),e.removeEventListener(Q.MS_KEY_ERROR,this._onKeyError),e.removeEventListener(Q.MS_KEY_MESSAGE,this._onKeyMessage))}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new ae(e.message.buffer)),this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve(!0),this._lastGenerateDeferred=null))}_onKeyAdded(){this._lastUpdateDeferred&&(this._lastUpdateDeferred.resolve(!0),this._lastUpdateDeferred=null),this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve(!0),this._lastGenerateDeferred=null),this.emit(Q.KEY_SESSION_STATUSES_CHANGE,null)}_onKeyError(){const e=this._nativeKeySession&&this._nativeKeySession.error;this._lastGenerateDeferred&&(this._lastGenerateDeferred.reject(e),this._lastGenerateDeferred=null),this._lastUpdateDeferred&&(this._lastUpdateDeferred.reject(e),this._lastUpdateDeferred=null),this.emit(Q.KEY_SESSION_STATUSES_CHANGE,null)}generateRequest(e,t){return new Promise(((e,n)=>{this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve=e,this._lastGenerateDeferred.reject=n),this._nativeKeySession=this._nativeMediaKeys.createSession("audio/mp4",new Uint8Array(t),null),this._attach()}))}update(e){return new Promise(((t,n)=>{this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve=t,this._lastGenerateDeferred.reject=n),this._nativeKeySession&&this._nativeKeySession.update(new Uint8Array(e))}))}close(){return new Promise((e=>{this._nativeKeySession&&this._nativeKeySession.close(),this._detach(),e(!0)}))}}class ce{constructor(e){this._lastBoundSetter=null,this.shouldRefreshPerTrack=!0,this._nativeMediaKeys=new MSMediaKeys(e)}attach(e){return new Promise((t=>{if(e.readyState>=1)return e.msSetMediaKeys(this._nativeMediaKeys),void t();const n=()=>{e.removeEventListener(Q.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.msSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(Q.MEDIA_LOADEDMETADATA,n),e.addEventListener(Q.MS_NEEDKEY,re),t()}))}detach(e){this._lastBoundSetter&&(e.removeEventListener(Q.MS_NEEDKEY,re),e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(){return Promise.reject(new ie(i.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){return new se(this._nativeMediaKeys)}}function le(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e&&e.attach(this),Promise.resolve()}class ue{constructor(e,t){if(this._configuration=null,this.keySystem=e,!this._checkConfig(t))throw new ie(i.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations")}_checkConfig(e){var t,n;const i=this.keySystem;for(const o of e){const e={initDataTypes:o.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"],label:o.label};let r;if(o.audioCapabilities&&o.audioCapabilities.length&&e.audioCapabilities){r=!1;for(const n of o.audioCapabilities){const o=null===(t=n.contentType)||void 0===t?void 0:t.split(";")[0];MSMediaKeys.isTypeSupported(i,o)&&(e.audioCapabilities.push(n),r=!0)}}if(o.videoCapabilities&&o.videoCapabilities.length&&e.videoCapabilities){r=!1;for(const t of o.videoCapabilities){const o=null===(n=t.contentType)||void 0===n?void 0:n.split(";")[0];MSMediaKeys.isTypeSupported(i,o)&&(e.videoCapabilities.push(t),r=!0)}}if(r)return this._configuration=e,!0}return!1}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new ce(this.keySystem))}))}}const de=T.P.forTag("eme_polyfill.v0_1b");class pe extends c.vp{constructor(e,t,n){super(),this._mediaElement=null,this._lastUpdateDeferred=null,this._lastGenerateResolver=null,this.sessionId=null,this._keySystem=e,this._mediaElement=t,this._prefix=n,this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}_addPrefix(e){return this._prefix?this._prefix+e.replace(/\b[a-z]/,(function(e){return e.toUpperCase()})):e}generateComplete(e){this.emitEvent(new ae(e)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null)}updateComplete(){this._lastUpdateDeferred&&(this._lastUpdateDeferred.resolve(!0),this._lastUpdateDeferred=null),this.emit(Q.KEY_SESSION_STATUSES_CHANGE,null)}handleErrorEvent(e){const t=new ie(i.EME_MEDIA_KEY_SESSION_V0_1B_ERROR,"MediaKeySession v0.1b Error");t.debug.errorCode=e.errorCode,t.debug.systemCode=e.systemCode,!e.sessionId&&this._lastGenerateResolver?(this._lastGenerateResolver.reject(t),this._lastGenerateResolver=null):e.sessionId&&this._lastUpdateDeferred?(this._lastUpdateDeferred.reject(t),this._lastUpdateDeferred=null):this.emit(Q.KEY_SESSION_STATUSES_CHANGE,null)}generateRequest(e,t){return this._mediaElement?new Promise(((e,n)=>{this._lastGenerateResolver={resolve:e,reject:n};try{this._mediaElement[this._addPrefix("generateKeyRequest")](this._keySystem,new Uint8Array(t))}catch(e){n(e),this._lastGenerateResolver=null}})):Promise.reject(new ReferenceError("InvalidState: Media keys are not attached."))}update(e){if(!this._mediaElement)return Promise.reject(new ReferenceError("InvalidState: Media keys are not attached."));if(this._lastUpdateDeferred){const t=this.update.bind(this,e);return this._lastUpdateDeferred.promise.then(t,t)}const t=(0,l.$)();this._lastUpdateDeferred=t;try{this._mediaElement[this._addPrefix("addKey")](this._keySystem,new Uint8Array(e),null,this.sessionId)}catch(e){t.reject(e),this._lastUpdateDeferred=null}return t.promise}close(){if(this.sessionId&&this._mediaElement)try{this._mediaElement[this._addPrefix("cancelKeyRequest")](this._keySystem,this.sessionId)}catch(e){de.warn("Could not close keysession",e)}return Promise.resolve(!0)}}class fe{constructor(e,t=""){this._mediaElement=null,this._waitingForSessionIds=[],this._sessionMap={},this.shouldRefreshPerTrack=!0,this._keySystem=e,this._prefix=t,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}attach(e){this._mediaElement=e;const t=this._prefix;e.addEventListener(t+Q.V0_1B_NEEDKEY,re);const n=e.addEventListener.bind(e);n(t+Q.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+Q.V0_1B_KEY_ERROR,this._onKeyError),n(t+Q.V0_1B_KEY_MESSAGE,this._onKeyMessage)}detach(e){this._mediaElement=null;const t=this._prefix;e.removeEventListener(t+Q.V0_1B_NEEDKEY,re);const n=e.removeEventListener.bind(e);n(t+Q.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+Q.V0_1B_KEY_ERROR,this._onKeyError),n(t+Q.V0_1B_KEY_MESSAGE,this._onKeyMessage)}_getSession(e){const t=this._sessionMap[e];if(t)return t;const n=this._waitingForSessionIds.shift();return n?(n.sessionId=e,this._sessionMap[e]=n,n):null}_onKeyMessage(e){const t=this._getSession(e.sessionId);t?t.generateComplete(e.message):de.warn("Got keymessage without session.")}_onKeyAdded(e){const t=this._getSession(e.sessionId);t?t.updateComplete():de.warn("Got keyadded without session.")}_onKeyError(e){const t=this._getSession(e.sessionId);t?t.handleErrorEvent(e):de.warn("Got keyerror without session.")}setServerCertificate(){return Promise.reject(new ie(i.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){const e=new pe(this._keySystem,this._mediaElement,this._prefix);return this._waitingForSessionIds.push(e),e}}function he(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e&&e.attach(this),Promise.resolve()}class me{constructor(e,t,n){if(this._configuration=null,this.keySystem=e,this._prefix=n,!this._checkConfig(t))throw new ie(i.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations")}_checkConfig(e){var t,n;const i=this.keySystem,o=document.createElement("video");for(const r of e){const e={initDataTypes:r.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"],label:r.label};let a=!1;if(r.audioCapabilities&&r.audioCapabilities.length&&e.audioCapabilities){a=!1;for(const n of r.audioCapabilities){const r=null===(t=n.contentType)||void 0===t?void 0:t.split(";")[0];r&&o.canPlayType(r,i)&&(e.audioCapabilities.push(n),a=!0)}}if(r.videoCapabilities&&r.videoCapabilities.length&&e.videoCapabilities){a=!1;for(const t of r.videoCapabilities){const r=null===(n=t.contentType)||void 0===n?void 0:n.split(";")[0];r&&o.canPlayType(r,i)&&(e.videoCapabilities.push(t),a=!0)}}if(a)return this._configuration=e,!0}return!1}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new fe(this.keySystem,this._prefix))}))}}function ge(e){navigator.requestMediaKeySystemAccess=function(t,n){return new Promise((i=>{i(new me(t,n,e))}))};const t=HTMLMediaElement.prototype;delete t.mediaKeys,t.setMediaKeys=he}const _e=T.P.forTag("eme_polyfill.safari");class ve extends c.vp{constructor(e,t){super(),this._attached=!1,this._nativeKeySession=null,this._lastGenerateResolver=(0,l.$)(),this._lastUpdateResolver=(0,l.$)(),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener,this._nativeMediaKeys=e,this._serverCertificate=t,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}_attach(){if(this._attached)return;const e=this._nativeKeySession;e?(e.addEventListener(Q.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.addEventListener(Q.WEBKIT_KEY_ADDED,this._onKeyAdded),e.addEventListener(Q.WEBKIT_KEY_ERROR,this._onKeyError)):_e.warn("Tried to attach with no WebKitMediaKeySession")}_detach(){if(!this._attached)return;const e=this._nativeKeySession;e?(e.removeEventListener(Q.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.removeEventListener(Q.WEBKIT_KEY_ADDED,this._onKeyAdded),e.removeEventListener(Q.WEBKIT_KEY_ERROR,this._onKeyError)):_e.warn("Tried to detach with no WebKitMediaKeySession")}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new ae(e.message.buffer)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null))}_onKeyAdded(){this._lastUpdateResolver&&(this._lastUpdateResolver.resolve(!0),this._lastUpdateResolver=null),this.emit(Q.KEY_SESSION_STATUSES_CHANGE,null)}_onKeyError(){const e=this._nativeKeySession&&this._nativeKeySession.error,t=new ie(i.EME_MEDIA_KEY_SESSION_SAFARI_ERROR,e&&e.message||"MediaKeySession Safari Error");e&&(t.debug.errorCode=e.code,t.debug.systemCode=e.systemCode),this._lastGenerateResolver?(this._lastGenerateResolver.reject(t),this._lastGenerateResolver=null):this._lastUpdateResolver&&(this._lastUpdateResolver.reject(t),this._lastUpdateResolver=null)}_rebuildInitData(e){const t=new Uint8Array(e);if(new DataView(t.buffer).getUint32(0,!0)+4!==t.byteLength)throw new ie(i.EME_INIT_DATA_MALFORMED,"Malformed init data");const n=function(e){const t=Math.floor(e.byteLength/2),n=new Uint16Array(t),i=new DataView(e.buffer);for(let e=0;e{this._lastGenerateResolver={resolve:e,reject:n};try{const e=this._rebuildInitData(t);this._nativeKeySession=this._nativeMediaKeys.createSession("video/mp4",new Uint8Array(e),null),this._attach()}catch(e){this._lastGenerateResolver=null,n(e)}}))}update(e){const t=(0,l.$)();if(this._lastUpdateResolver=t,!this._nativeKeySession)return _e.warn("Tried to update with no WebKitMediaKeySession"),t.promise;try{this._nativeKeySession.update(new Uint8Array(e))}catch(e){t.reject(e)}return t.promise}close(){return new Promise((e=>{this._detach(),e(!0)}))}}class ye{constructor(e){this._lastBoundSetter=null,this._serverCertificate=null,this.shouldRefreshPerTrack=!0,this._nativeMediaKeys=new WebKitMediaKeys(e)}attach(e){return new Promise((t=>{if(e.readyState>=1)return e.webkitSetMediaKeys(this._nativeMediaKeys),void t();const n=()=>{e.removeEventListener(Q.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.webkitSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(Q.MEDIA_LOADEDMETADATA,n),e.addEventListener(Q.WEBKIT_NEEDKEY,re),t()}))}detach(e){e.removeEventListener(Q.WEBKIT_NEEDKEY,re),this._lastBoundSetter&&(e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(e){return this._serverCertificate=new Uint8Array(e),Promise.resolve(!0)}createSession(){if(!this._serverCertificate)throw new ie(i.EME_INVALID_STATE_ERROR,"The server certificate is not available");return new ve(this._nativeMediaKeys,this._serverCertificate)}}class Ee{constructor(e,t){this.keySystem=e;const n=this._checkConfig(t);if(!n)throw new ie(i.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations");this._configuration=n}_checkConfig(e){const t=this.keySystem;let n=!1;for(const i of e){const e={initDataTypes:i.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"]};if(i.audioCapabilities)for(const o of i.audioCapabilities){if(!o.contentType)continue;const i=o.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(t,i)&&(e.audioCapabilities.push(o),n=!0)}if(i.videoCapabilities)for(const o of i.videoCapabilities){if(!o.contentType)continue;const i=o.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(t,i)&&(e.videoCapabilities.push(o),n=!0)}if(n)return e}return null}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new ye(this.keySystem))}))}}function be(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e?e.attach(this):Promise.resolve()}const Se=T.P.forTag("eme_polyfills.tester");function Ae(){return"undefined"!=typeof navigator&&(null===navigator||void 0===navigator?void 0:navigator.requestMediaKeySystemAccess)&&"undefined"==typeof WebKitMediaKeys&&"undefined"!=typeof MediaKeySystemAccess&&(null===MediaKeySystemAccess||void 0===MediaKeySystemAccess?void 0:MediaKeySystemAccess.prototype.getConfiguration)?(Se.log("Using native EME implementation."),"native"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.webkitGenerateKeyRequest)?(Se.log('Detected "webkit" Prefixed EME v0.1b. Polyfilling.'),ge("webkit"),"v0.1b-webkit"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.generateKeyRequest)?(Se.log("Detected Unprefixed EME v0.1b. Polyfilling."),ge(),"v0.1b"):"undefined"!=typeof MSMediaKeys?(Se.log("Detected MS IE EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new ue(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=le}(),"ms-ie"):"function"==typeof WebKitMediaKeys?(Se.log("Detected Safari EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new Ee(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=be}(),"safari"):(Se.warn("Detected no EME APIs."),null)}const Te={[$.WIDEVINE]:{commonName:"widevine",licenseServer:"https://@webgate/widevine-license",withCertificate:!0,pssh_field:{audio:"pssh_widevine",video:"encryption_data"}},[$.PLAYREADY]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[$.PLAYREADY_HARDWARE]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[$.FAIRPLAY]:{commonName:"fairplay",licenseServer:"https://@webgate/fairplay-license",withCertificate:!0,pssh_field:{audio:"pssh_fairplay",video:"asset_id"}},[$.INVALID_SPOTIFY_KEY]:{commonName:"spotify-invalid",licenseServer:"https://@webgate",withCertificate:!1,pssh_field:{audio:"pssh_invalid",video:"encryption_data"}}},Oe=[{label:"video-sw-decode",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/webm; codecs="opus"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.64002a"',robustness:"SW_SECURE_DECODE"},{contentType:'video/mp4; codecs="avc1.4d402a"',robustness:"SW_SECURE_DECODE"},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:"SW_SECURE_DECODE"},{contentType:'video/webm; codecs="vp9"',robustness:"SW_SECURE_DECODE"},{contentType:'video/webm; codecs="vp8"',robustness:"SW_SECURE_DECODE"},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:"SW_SECURE_DECODE"}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"video-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/webm; codecs="opus"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.64002a"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp4; codecs="avc1.4d402a"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/webm; codecs="vp9"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/webm; codecs="vp8"',robustness:"SW_SECURE_CRYPTO"}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"video-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""},{contentType:'audio/webm; codecs="opus"',robustness:""}],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.64002a"',robustness:""},{contentType:'video/mp4; codecs="avc1.4d402a"',robustness:""},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:""},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:""},{contentType:'video/webm; codecs="vp9"',robustness:""},{contentType:'video/webm; codecs="vp8"',robustness:""}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-flac-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-flac-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]}];function Ie(e,t){var n,i;for(const o of e){const e={audioCapabilities:[],videoCapabilities:[]};let r,a=!1;if(null===(n=o.audioCapabilities)||void 0===n?void 0:n.length){a=!1;for(const n of o.audioCapabilities)r=n.contentType,r&&t(r)&&(e.audioCapabilities.push(n),a=!0)}if(null===(i=o.videoCapabilities)||void 0===i?void 0:i.length){a=!1;for(const n of o.videoCapabilities)r=n.contentType,r&&t(r)&&(e.videoCapabilities.push(n),a=!0)}if(a)return e}return null}const Ce=/([^;]+)(?:;\s?codecs="(.*)")?/;function Ne(e){var t;const[,n="unknown",i="unknown"]=null!==(t=e.match(Ce))&&void 0!==t?t:[];return{mimeType:n,codec:i,contentType:e}}const Le=/([^;]+)(?:;\s?codecs="(.*)")?/,Re=T.P.forTag("playback.eme_manager"),Pe={EMPTY:"-no-robustness",SW_CRYPTO:"-sw-crypto",SW_DECODE:"-sw-decode",HW_CRYPTO:"-hw-crypto",HW_DECODE:"-hw-decode",HW_ALL:"-hw-all"};function ke(e,t){var n;const i=[],o=new RegExp(`codecs="(${t.join("|")})"`);for(const t of e)o.test(null!==(n=t.contentType)&&void 0!==n?n:"")||i.push(t);return i.length?i:null}function De(e,{audio:t,video:n}){var i,o,r,a;if(!(null==t?void 0:t.length)&&!(null==n?void 0:n.length))return e;let{audioCapabilities:s,videoCapabilities:c}=e;return(null==t?void 0:t.length)&&(null===(i=e.audioCapabilities)||void 0===i?void 0:i.length)&&(s=null!==(o=ke(e.audioCapabilities,t))&&void 0!==o?o:void 0,!s)||(null==n?void 0:n.length)&&(null===(r=e.videoCapabilities)||void 0===r?void 0:r.length)&&(c=null!==(a=ke(e.videoCapabilities,n))&&void 0!==a?a:void 0,!c)?null:Object.assign(Object.assign({},e),{audioCapabilities:s,videoCapabilities:c})}class we extends c.vp{constructor(e){var t;super(),this._unauthServerCertificateBase="",this._disallowCodecs={},this._keySystemDeferred=(0,l.$)(),this._configuration=(0,l.$)(),this._keySystemSettings=null,this._keySessions=[],this._configs=[],this._pendingCertificateRequest=null,this._certificate=null,this._transport=e.transport,this._emeImpl=e.emeImpl,this._noServerCertificate=!!e.noServerCertificate,this._precacheServerCertificate=null===(t=e.precacheServerCertificate)||void 0===t||t,this._unauthServerCertificateBase=e.unauthServerCertificateBase||"https://spclient.wg.spotify.com",this._configFilter=function(e){const t=["--ensure-no-match--"];if(null==e?void 0:e.length){let n=e.length;for(;n--;){const i=e[n];i&&Pe.hasOwnProperty(i)&&t.push(Pe[i])}}return new RegExp(`(${t.join("|")})$`)}(e.disallowRobustnessValues||[]),this._disallowCodecs=e.disallowCodecs,this._preferredKeySystems=e.preferredKeySystems||[$.WIDEVINE,$.PLAYREADY,$.PLAYREADY_HARDWARE,$.FAIRPLAY]}static create(e){return new Promise((t=>{const n=Ae();if(!n)throw ie.fatal(i.EME_API_NOT_SUPPORTED,"Platform does not support navigator.requestMediaKeySystemAccess");t(new we(Object.assign(Object.assign({},e),{emeImpl:n})).init())}))}_prepareConfiguration(e){const t=e.getConfiguration();Re.info("KeySystem configured as",t.label),t.audioCapabilities&&t.audioCapabilities.length||this._appendProbableMediaCapabilities(e.keySystem,t);const n={keySystem:e.keySystem,keySystemImpl:this._emeImpl,audioFormats:this._parseCapabilities(t.audioCapabilities),videoFormats:this._parseCapabilities(t.videoCapabilities)};return this._keySystemSettings=Te[e.keySystem],this._configuration.resolve(n),n}_parseCapabilities(e){var t;if(!e)return[];const n=[];for(const i of e){if(!(null==i?void 0:i.contentType))continue;const[,e,o]=null!==(t=i.contentType.match(Le))&&void 0!==t?t:[];e&&n.push({contentType:i.contentType,mimeType:e,codec:null!=o?o:""})}return n}_appendProbableMediaCapabilities(e,t){const n=Ie(this._configs,(t=>(-1===t.indexOf("webm")||e!==$.PLAYREADY&&e!==$.PLAYREADY_HARDWARE)&&!!MediaSource.isTypeSupported(t)));n&&(t.audioCapabilities=n.audioCapabilities,t.videoCapabilities=n.videoCapabilities)}_trySetServerCertificate(e,t){const n=this._certificate;return(n&&n.expiry>Date.now()?Promise.resolve(n):this._requestServerCertificate(e)).then((e=>t.setServerCertificate(e.contents))).then((()=>this)).catch((e=>(Re.warn("Error from setting server certificate",e),this)))}_cacheServerCertificate(e){let t="";switch(e){case $.FAIRPLAY:t="fairplay";break;case $.WIDEVINE:t="widevine";break;default:return Promise.resolve(this)}return this._requestServerCertificate(`${this._unauthServerCertificateBase}/${t}-license`,!1).then((()=>this),(e=>(Re.warn("Cannot precache server certificate",e),this)))}_requestServerCertificate(e,t=!0){if(this._pendingCertificateRequest)return this._pendingCertificateRequest;return this._transport.request(`${e}/v1/application-certificate`,{authorize:t,responseType:"arraybuffer",parseResponseHeaders:!0,retry:{condition:(e,t)=>e.getStatusFamily()===t.SERVER_ERROR}}).then((e=>{var t;if(!e.body)throw new TypeError("Response body is invalid");this._pendingCertificateRequest=null;let n=3600;const i=null===(t=e.headers)||void 0===t?void 0:t.get("cache-control");if(i){const e=i.match(/(?:^|,|\s)max-age=(\d+)(?:,|$)/);e&&e[1]&&(n=1e3*parseInt(e[1],10))}return this._certificate={expiry:Date.now()+(n-600),contents:e.body},this._certificate}))}_extractPlayReadyChallenge(e,t){var n;let o=null;const r=new Uint16Array(e),a=String.fromCharCode.apply(null,r);if(-1===a.indexOf("PlayReadyKeyMessage"))return Re.info("Using unextracted PlayReady message."),e;const s=(new DOMParser).parseFromString(a,"application/xml"),c=s.getElementsByTagName("Challenge")[0],l=null===(n=null==c?void 0:c.childNodes[0])||void 0===n?void 0:n.nodeValue;if(l)try{o=atob(l);const e=s.getElementsByTagName("name"),t=s.getElementsByTagName("value");if(e.length!==t.length)throw new ie(i.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")}catch(e){this.emit(Q.EME_LICENSE_REQUEST_ERROR,{signal:t,error:e}),o=null}else this.emit(Q.EME_LICENSE_REQUEST_ERROR,{signal:t,error:new ie(i.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")});return o}_onMessage(e,t){e.timeMap.generate.end=Date.now();let n="message"in t?t.message:null;const i="messageType"in t?t.messageType:void 0;if(Re.info("Got EME message event with type",i),n&&e.keySystem===$.PLAYREADY&&(n=this._extractPlayReadyChallenge(n,e.signal)),!n)return void Re.info("Ignoring message event: no valid request payload");if(!e.licenseServer)return void Re.info("Ignoring message event: no licenseServer url");e.timeMap.request.start=Date.now();let o=e.licenseServer;e.keySystem===$.FAIRPLAY&&(o=`${o}${-1!==o.indexOf("?")?"&":"?"}assetId=hex`),this._transport.request(o,{method:"POST",payload:n,responseType:"arraybuffer",retry:{condition:(e,t)=>400!==e.status&&402!==e.status&&403!==e.status&&(!e.body||e.getStatusFamily()!==t.SUCCESS)}}).then(this._handleLicenseResponse.bind(this,e))}_handleLicenseResponse(e,t){const n=t=>{e.licenseServer&&(t.licenseServer=e.licenseServer),this.emit(Q.EME_LICENSE_REQUEST_ERROR,{signal:e.signal,error:t})};let o,r;if(e.timeMap.request.end=Date.now(),200!==t.status){try{if(t.body){const e=new Uint8Array(t.body),n=String.fromCharCode.apply(String,e);r=JSON.parse(n).errorMsg}}catch(e){}402===t.status?this.emit(Q.EME_LICENSE_REQUEST_CAPPED,{signal:e.signal,error:new oe(i.CAPPING_USER_IS_CAPPED,"User is capped.")}):400===t.status&&"widevine error"===r?(o=ie.fatal(i.EME_LICENSE_REQUEST_WIDEVINE_ERROR,"Widevine license server failed to parse request."),o.status=t.status,o.shouldRefreshEndpoint=!0,n(o)):(o=new ie(i.EME_LICENSE_REQUEST_FAILED_WITH_STATUS,`License request failed (${r||"unknown"})`),o.status=t.status,o.shouldRefreshEndpoint=400===t.status||403===t.status,n(o))}else{if(!t.body)return o=new ie(i.EME_LICENSE_REQUEST_EMPTY_RESPONSE,"Empty license response body"),o.status=t.status,void n(o);try{e.timeMap.update.start=Date.now(),e.keySession.update(t.body).catch((e=>{n(new ie(i.EME_LICENSE_UPDATE_FAILED,e.message||"License update failed."))})),Re.info("KeySession updated.")}catch(e){const{message:t}=e;n(new ie(i.EME_LICENSE_UPDATE_FAILED,t||"License update failed."))}}}_selectKeySystem(e){const t=this._preferredKeySystems;for(let n=0,i=t.length;n{t(e.createMediaKeys())})).then((t=>{if(!t)return Promise.reject(ie.fatal(i.EME_MEDIA_KEYS_NOT_SUPPORTED,"Cannot create MediaKeys from KeySystemAccess"));e.keySystem===$.FAIRPLAY&&t.setServerCertificate(new ArrayBuffer(0));try{if(!t.createSession())throw new Error("")}catch(e){const{message:t}=e;return Promise.reject(ie.fatal(i.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED,t||"Cannot create MediaKeySession from KeySystemAccess"))}return Promise.resolve(e)}),(e=>(Re.error(e.name),Promise.reject(ie.fatal(i.EME_MEDIA_KEYS_NOT_SUPPORTED,e.message||"Unknown error")))))}_saveSession(e){this._keySessions.push(e)}destroySessions(){const e=[],t=this._keySessions;for(const n of t)try{const t=n.keySession;if(!t)continue;n.onMessageListener&&t.removeEventListener(Q.KEY_SESSION_MESSAGE,n.onMessageListener),n.onKeyStatusChangeListener&&t.removeEventListener(Q.KEY_SESSION_STATUSES_CHANGE,n.onKeyStatusChangeListener);const i=Promise.resolve(t.close()).catch((e=>{Re.warn("Failed to close KeySession",e)}));e.push(i),n.keySession=null,n.onMessageListener=null,n.onKeyStatusChangeListener=null,Re.info("Closed KeySession")}catch(e){Re.warn("Failed to close KeySession",e)}return this._keySessions=[],Promise.all(e)}init(){const e=[];for(let t of Oe)if(!t.label||!this._configFilter.test(t.label)){if(this._disallowCodecs){const e=De(t,this._disallowCodecs);if(!e)continue;t=e}e.push(t)}return this._configs=e,this.requestMediaKeySystemAccess()}requestMediaKeySystemAccess(){const e=this._keySystemDeferred,t={},n=[];for(const e in $){if(!Object.prototype.hasOwnProperty.call($,e))continue;const i=e;n.push(navigator.requestMediaKeySystemAccess($[i],this._configs).then((e=>{t[e.keySystem]=e})).catch((()=>{})))}return Promise.all(n).then(this._selectKeySystem.bind(this,t)).then((e=>e?(Re.info("Supported keySystem: ",e.keySystem),this._testMediaKeys(e)):Promise.reject(new ie(i.EME_NO_SUPPORTED_KEYSYSTEM,"No supported keysystem was found.")))).then((t=>(this._prepareConfiguration(t),e.resolve(t),this._precacheServerCertificate?this._cacheServerCertificate(t.keySystem):this))).catch((t=>{const n=t.code||i.EME_NO_SUPPORTED_KEYSYSTEM,o=t.message||"No supported keysystem";return e.reject(ie.fatal(n,o)),e.promise.then((()=>this))}))}createMediaKeys(e){return this._keySystemDeferred.promise.then((e=>e.createMediaKeys())).then((t=>this.setMediaKeys(e,t))).then((()=>this._configuration.promise.then((()=>{const t=this._keySystemSettings;return t&&!this._noServerCertificate&&t.withCertificate?this._trySetServerCertificate(t.licenseServer,e.mediaKeys):this}))))}setMediaKeys(e,t){return e.setMediaKeys(t).then((()=>{if(!e.mediaKeys)throw new ie(i.EME_PLAYER_MEDIA_KEYS_SETTING_FAILED,"Failed to set MediaKeys on HTMLMediaElement");return this}))}removeMediaKeys(e){const t=e.mediaKeys;return Promise.resolve(e.setMediaKeys(null)).then((()=>t))}getKeySystemInfo(){return this._configuration.promise}getKeySystemImpl(){return this._emeImpl}createSessionWithParams(e){return new Promise(((t,n)=>{Re.info("Creating KeySession",e.keySystem);const o=e.mediaKeys.createSession(),r={generate:{start:0,end:0},request:{start:0,end:0},update:{start:0,end:0}},a=this._keySystemSettings&&this._keySystemSettings.licenseServer||void 0,s=this._onMessage.bind(this,{keySystem:e.keySystem,keySession:o,licenseServer:e.licenseServer||a,signal:e.signal,timeMap:r});o.addEventListener(Q.KEY_SESSION_MESSAGE,s);const c=()=>{Re.info("KeyStatus change"),r.update.end=Date.now(),t({elapsed:{generate:Math.max(r.generate.end-r.generate.start,0),request:Math.max(r.request.end-r.request.start,0),update:Math.max(r.update.end-r.update.start,0)}})};return o.addEventListener(Q.KEY_SESSION_STATUSES_CHANGE,c),this._saveSession({keySession:o,onMessageListener:s,onKeyStatusChangeListener:c}),Re.info("Generating KeySession request",e.keySystem),r.generate.start=Date.now(),Promise.resolve(o.generateRequest(e.initDataType,e.initData.buffer)).catch((e=>{if(!e)return;let t;switch(e.name){case"NotSupportedError":t=i.EME_NOT_SUPPORTED_ERROR;break;case"InvalidStateError":t=i.EME_INVALID_STATE_ERROR;break;default:t=i.EME_UNKNOWN_ERROR}n(new ie(t,e.message||"Unknown error message."))}))}))}}var Me;!function(e){e.SHOWING="showing",e.HIDDEN="hidden",e.DISABLED="disabled"}(Me||(Me={}));const xe=Array.prototype.slice,Ue="function"==typeof Array.from?e=>Array.from(e):e=>xe.call(e);function Ve(e,t){const n=Ue(e.getElementsByTagName(t));for(const t of n)e.removeChild(t)}function Fe(e){const t=e;return{id:t.id,text:t.text}}const Be="visible",He="hidden",Ge=/^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$|[A-Za-z]{2,3}-x-cc/;class Ke extends c.vp{constructor(e){super(),this._isVisible=!1,this._player=null,this._crossOrigin=null,this._currentVideoContent=null,this._unsubscribers=[],this._displayedCues=[],this._deactivateListeners=!1,this._activeLanguage=void 0,this._preferredLanguage=e.language.toLowerCase(),e.deactivateListeners&&(this._deactivateListeners=!0),this._onEnter=this._onEnter.bind(this),this._onExit=this._onExit.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),this.setPlayer(e.player)}_subscribeToCueEvents(e){var t;const{track:n}=e;if(!n)throw new Error("No track");if(null===(t=n.cues)||void 0===t?void 0:t.length){this._displayedCues=n.activeCues?Array.from(n.activeCues):[],this._emitDisplayedCues();for(let e=0;e{t.removeEventListener("enter",this._onEnter),t.removeEventListener("exit",this._onExit)})))}}else{const t=()=>{this._subscribeToCueEvents(e),e.removeEventListener("load",t)};e.addEventListener("load",t)}}_unsubscribeFromCueEvents(){this._unsubscribers.forEach((e=>e())),this._unsubscribers=[]}_onEnter(e){const t=e.target;this._displayedCues.indexOf(t)>-1||(this._displayedCues.push(t),this._emitDisplayedCues())}_onExit(e){const t=e.target,n=this._displayedCues.indexOf(t);n>-1&&(this._displayedCues.splice(n,1),this._emitDisplayedCues())}_emitDisplayedCues(){this.emit(Q.PLAYER_DISPLAYED_CUES_CHANGED,{cues:this._displayedCues.map(Fe)})}_updateVisibleState(){var e,t;if(!this._player)return;const n=this.getActiveLanguage();Array.from(null!==(t=null===(e=this._player)||void 0===e?void 0:e.querySelectorAll("track"))&&void 0!==t?t:[]).forEach((e=>{e.style.visibility=this._isVisible?Be:He}));const i=this._player.textTracks;for(let e=0,t=i.length;e=1?this._switchActiveTextTrack():this._currentVideoContent&&e.addEventListener(Q.MEDIA_LOADEDMETADATA,this._onLoadedMetadata)}_switchActiveTextTrack(){const e=this._player;if(!e||!this._currentVideoContent)return;const t=this._updateActiveLanguage();let n=null,i=null;Ue(e.getElementsByTagName("track")).forEach((e=>{e.default&&(n=e),e.srclang.toLowerCase()===t&&(i=e)})),n&&(n.default=!1,n.track.mode=Me.DISABLED,this._unsubscribeFromCueEvents()),i&&(i.default=!0,i.track.mode=this._isVisible?Me.SHOWING:Me.HIDDEN,this._deactivateListeners||this._subscribeToCueEvents(i))}_onLoadedMetadata(){const e=this._player;if(e&&(Ve(e,"track"),this._currentVideoContent)){e.crossOrigin="anonymous",this._updateActiveLanguage();for(const{lang:t,url:n}of this._currentVideoContent.getSubtitles()){const i=document.createElement("track");i.label=`${t} subtitles`,i.kind="subtitles",i.srclang=t,i.src=n,i.style.visibility=this._isVisible?Be:He,e.appendChild(i)}setTimeout((()=>this._switchActiveTextTrack()))}}_updateActiveLanguage(){if(!this._player||!this._currentVideoContent)return void(this._activeLanguage=void 0);const e=this._currentVideoContent.getSubtitleLanguages(),t=this._preferredLanguage.split("-")[0];let n=null;for(const i of e){const e=i.toLowerCase();if(e===this._preferredLanguage)return this._activeLanguage=e,this._activeLanguage;e.split("-")[0]===t&&null===n&&(n=e)}return this._activeLanguage=null!=n?n:"en-us",this._activeLanguage}getActiveLanguage(){if(this._player&&this._currentVideoContent)return this._activeLanguage}setVideoContent(e){var t;this._unsubscribeFromCueEvents(),this._displayedCues=[],this._currentVideoContent=e,e?this.emit(Q.PLAYER_SUBTITLE_LANGUAGES_LOADED,{languages:null!==(t=e.getSubtitleLanguages())&&void 0!==t?t:[]}):this.clear(),this._updateTextTracks()}setPlayer(e){var t;const n="VIDEO"===(null==e?void 0:e.tagName)?e:null;this._player!==n&&this.clear(),this._player=n||null,this._crossOrigin=null!==(t=null==n?void 0:n.crossOrigin)&&void 0!==t?t:null,this._updateTextTracks()}getAvailableLanguages(){var e,t;return null!==(t=null===(e=this._currentVideoContent)||void 0===e?void 0:e.getSubtitleLanguages())&&void 0!==t?t:[]}setLanguage(e){if(!e.length)throw new TypeError("Argument `code` must be a non-empty string. Hide subtitles using `hideSubtitles()`.");if(!Ge.test(e))throw new TypeError("Argument `code` must be a valid BCP 47 formatted language code");this._preferredLanguage!==e.toLowerCase()&&(this._preferredLanguage=e.toLowerCase(),this._switchActiveTextTrack())}hide(){this._isVisible=!1,this._updateVisibleState()}show(){this._isVisible=!0,this._updateVisibleState()}deactivateListeners(){if(this._deactivateListeners)return;this._player&&(this._deactivateListeners=!0,this._unsubscribeFromCueEvents())}activateListeners(){this._deactivateListeners&&(this._deactivateListeners=!1,this._updateTextTracks())}areListenersActivated(){return!this._deactivateListeners}clear(){const e=this._player;e&&(this._unsubscribeFromCueEvents(),this._currentVideoContent=null,this._displayedCues=[],Ve(e,"track"),e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.crossOrigin=this._crossOrigin)}visible(){return this._isVisible}}class We extends Error{constructor(e=i.STORAGE_ERROR,t="File Error"){super(t),this.canPlayNext=!0,this.debug={},this.code=e,this.message=t,this.name="FileError"}}class Ye{constructor(e){this._mediaType=e.mediaType,this._fileId=e.fileId,this._uri=e.uri,this._audioGain=e.audioGain,this._logData=e.logData,this._hasNonFatalErrors=!!e.hasNonFatalErrors,this._disableCache=e.disableCache,this._keySystem=e.keySystem,this._licenseEndpoint=e.licenseEndpoint,this._mediaFormat=e.mediaFormat,this._mediator=e.mediator,this._noAuth=e.noAuth,this._contentMetadata=e.contentMetadata}getFileId(){return this._fileId}getAudioGain(){return this._audioGain}getMediaType(){return this._mediaType}getLogData(){return this._logData}setLogData(e){this._logData=e}toLogJSON(){return{uri:this._uri,fileId:this._fileId,mediaFormat:this._mediaFormat,mediaURL:this._mediaURL}}hasNonFatalErrors(){return this._hasNonFatalErrors}getContentMetadata(){return this._contentMetadata||{}}getInitParams(){return this.isProtected()?{initDataType:this._protection,initData:this._pssh}:null}getKeySystem(){var e;return null!==(e=this._keySystem)&&void 0!==e?e:null}getLicenseEndpoint(){var e;return null!==(e=this._licenseEndpoint)&&void 0!==e?e:null}}function je(e){const t=M.D.decode(e),n=new Uint8Array(t.length);for(let e=0,i=t.length;e=parseInt(l,16)}function Xe(e,t){return e.sort(((e,n)=>"video_bitrate"in e&&"video_bitrate"in n?t?e.video_resolution===n.video_resolution?e.video_bitrate-n.video_bitrate:e.video_resolution-n.video_resolution:e.video_bitrate-n.video_bitrate:e.max_bitrate-n.max_bitrate))}function Ze(e,t){return void 0!==t&&Array.isArray(e.encryption_indices)&&-1===e.encryption_indices.indexOf(t)}function Qe(e,t){if(!t)return!1;return t(Object.assign({mimeType:e.mime_type},function(e){return"video_codec"in e}(e)?{type:"video",codec:e.video_codec,bitrate:e.video_bitrate,height:e.video_height,width:e.video_width,resolution:e.video_resolution}:{type:"audio",codec:e.audio_codec,bitrate:e.audio_bitrate}))}function $e(e){return"audio_codec"in e?e.audio_codec:e.video_codec}function et(e){const{codec:t,formats:n,profiles:i,encryptionIndex:o,disallowProfile:r,preferredVideoResolution:a,allowMixedAVC1Codecs:s}=e;for(const e of n){const n=[];let c="spotify/unknown-mimeType",l="unknown-codec";for(const a of i){const i=$e(a);!(t in a)||Ze(a,o)||Qe(a,r)||("unknown-codec"!==l||a.mime_type!==e.mimeType||i!==e.codec&&!qe(e.codec,i)?a.mime_type===c&&(i===l||s&&qe(l,i))&&(n.push(a),a.__effective_codec=l):(c=e.mimeType,l=s?e.codec:i,n.push(a),a.__effective_codec=e.codec))}if(n.length)return Xe(n,a)}return[]}function tt(e){if(!e)return;const t=e.__effective_codec||("audio_codec"in e?e.audio_codec:e.video_codec);return`${e.mime_type};codecs="${t}"`}class nt extends Ye{constructor(e){super(e),this._supportedFormats={audio:[],video:[]},this._baseURL="",this._fallbackURLs=[],this._loaded=!1,this._initTemplate="",this._segmentTemplate="",this._segmentLength=0,this._assetID="",this._segments=[],this._duration=0,this._videoProfiles={selected:null,available:[]},this._audioProfiles={selected:null,available:[]},this._subtitleLanguages=[],this._subtitleTemplate="",this._trackingData=null,this._resolver=e.resolver,this._keySystem=e.keySystem,this._keySystemSettings=e.keySystemSettings,this._disallowProfile=e.disallowProfile,this._supportedFormats=e.supportedFormats,this._videoResolution=e.videoResolution,this._allowMixedAVC1Codecs=e.allowMixedAVC1Codecs,this._trackingData=e.trackingData,this._contentMetadata=e.metadata}_calculateSegments(e){this._duration=e.end_time_millis/1e3;const t=this._segmentLength;this._initSegment={init:!0,cacheBufferSet:!1,timeStart:-1,timeEnd:-1,byteRanges:{}};const n=[];for(let e=0;e(e.resolveLatency=0,e.manifestLatency=Date.now()-t,this._parseManifest(n)))).then((()=>(this._loaded=!0,this)))}isProtected(){return!!this._protection&&!!this._pssh}setVideoResolution(e){this._videoResolution=e}getMediaProfileInfo(){return{audio:this._audioProfiles,video:this._videoProfiles}}getSubtitles(){return this._subtitleLanguages.map((e=>({lang:e,url:this._subtitleTemplate.replace("{{language_code}}",e)})))}getSubtitleLanguages(){return this._subtitleLanguages}getCurrentBitrates(){var e,t,n,i;return{audio:null!==(t=null===(e=this._audioProfiles.selected)||void 0===e?void 0:e.audio_bitrate)&&void 0!==t?t:0,video:null!==(i=null===(n=this._videoProfiles.selected)||void 0===n?void 0:n.video_bitrate)&&void 0!==i?i:0}}getTrackingEvents(){return this._trackingData}getTrackingEventData(e){const t=this._trackingData?this._trackingData[e]:null;return t?{tracking_event:e,urls:t.urls}:null}}function it(e){return!!e&&"getMediaProfileInfo"in e}function ot(e){return!!e&&"getCurrentBitrates"in e&&"canLowerBitrate"in e&&"adaptToBandwidth"in e}function rt(e){return!!e&&"getTrackingEventData"in e&&"getTrackingEvents"in e}class at{constructor(e){this.bandwidthEstimator=e.bandwidthEstimator}static create(e){return new at(e)}getSample(e,t){var n,i,o,r,a,s,c;const l=this.bandwidthEstimator.getBandwidthEstimate(),u=function(e,t){const n=e.length;for(let i=0;ie.video_bitrate)),height:null===(r=i.selected)||void 0===r?void 0:r.video_height,width:null===(a=i.selected)||void 0===a?void 0:a.video_width,resolution:null===(s=i.selected)||void 0===s?void 0:s.video_resolution,mimeType:tt(i.selected)},audio:{bitrate:null===(c=n.selected)||void 0===c?void 0:c.audio_bitrate,mimeType:tt(n.selected)}}}return null}}const st=T.P.forTag("playback.audio_processor");class ct{constructor(e){this._audioContext=null,this._mediaElementSource=null,this._gainNode=null,this._nodes=[],(null==e?void 0:e.disable)?st.info("AudioProcessor disabled"):(this._audioContext=(null==e?void 0:e.audioContext)||("undefined"!=typeof AudioContext?new AudioContext:null),this._audioContext?(this._gainNode=this._audioContext.createGain(),this._buildNodePipeline(null==e?void 0:e.nodes)):st.warn("The AudioContext API is not supported. Any future operation related to `AudioProcessor` will be skipped."))}static create(e){return new ct(e)}_setMediaElementSource(e){var t;this._audioContext&&(this._mediaElementSource&&(st.info("Disconnecting previous media element source"),this._mediaElementSource.disconnect()),st.info("Creating new media element source"),this._mediaElementSource=this._audioContext.createMediaElementSource(e)||null,this._mediaElementSource.connect(null!==(t=this._nodes[0])&&void 0!==t?t:this._audioContext.destination))}_buildNodePipeline(e=[]){var t;if(!this._audioContext)return;st.info("Disconnecting previous nodes");const n=this._nodes;for(const e of n)e.disconnect();const i=[this._gainNode,...e];let o=null;for(const e of i)o&&o.connect(e),o=e;null===(t=i[i.length-1])||void 0===t||t.connect(this._audioContext.destination),st.info("Node pipeline built"),this._nodes=i}setPlayer(e){var t;e&&((null===(t=this._mediaElementSource)||void 0===t?void 0:t.mediaElement)!==e?this._setMediaElementSource(e):st.info("The new player is the same as the current player"))}getPlayer(){var e;return(null===(e=this._mediaElementSource)||void 0===e?void 0:e.mediaElement)||null}setAudioGain(e=0){if(!this._gainNode)return st.info("The default gain node is not available"),!1;const t=Math.pow(10,e/20);return this._gainNode.gain.value=t,st.info("Main gain set to",t),!0}getAudioContext(){return this._audioContext}resume(){return this._audioContext&&"running"!==this._audioContext.state?this._audioContext.resume():Promise.resolve()}suspend(){return this._audioContext&&"suspended"!==this._audioContext.state?this._audioContext.suspend():Promise.resolve()}destroy(){var e;this._audioContext&&(null===(e=this._mediaElementSource)||void 0===e||e.connect(this._audioContext.destination)),this._nodes=[],this._audioContext=null,this._gainNode=null,this._mediaElementSource=null,st.info("The AudioProcessor is destroyed")}}const lt=T.P.forTag("playback.media_source_manager");function ut(e){if(!e)return"";const t=[];for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n]?`="${e[n]}"`:"";t.push(`${n}${i}`)}return t.length?`; ${t.join("; ")}`:""}class dt extends c.vp{constructor(e){super(),this._mediaSource=null,this._sourceBuffers={},this._currentInitSegments={},this._updateQueue=[],this._playId=0,this._lastBufferClearTime=Date.now(),this._customSourceBufferParams="";const{mimeTypes:t,customSourceBufferParams:n,disableBufferAbort:i}=e;this._mimeTypes=t,this._customSourceBufferParams=ut(n),this._disableBufferAbort=!!i,this._onSourceOpen=this._onSourceOpen.bind(this),this._onSourceClose=this._onSourceClose.bind(this),this._onUpdateEnd=this._onUpdateEnd.bind(this),this.dequeueUpdates=this.dequeueUpdates.bind(this),e.noInit||this._init()}static create(e){return new dt(e)}_init(){this._mediaSource=new MediaSource,this._mediaSource.addEventListener(Q.MEDIA_SOURCE_OPEN,this._onSourceOpen),this._mediaSource.addEventListener(Q.MEDIA_SOURCE_CLOSE,this._onSourceClose),this._sourceBuffers={},this._currentInitSegments={}}_onSourceOpen(){var e;lt.info("MediaSource opened.");const t=this._mediaSource;if(0===(null===(e=null==t?void 0:t.sourceBuffers)||void 0===e?void 0:e.length)&&"open"===(null==t?void 0:t.readyState)){const e=this._mimeTypes;lt.info("Creating source buffers for MIME types",e);for(const n of["video","audio"]){const i=e[n];if(i){const e=i+this._customSourceBufferParams,n=t.addSourceBuffer(e);n.addEventListener(Q.SOURCE_BUFFER_UPDATE_END,this._onUpdateEnd),this._sourceBuffers[i]=n}}}this.dequeueUpdates(),this.emit(Q.BUFFER_SOURCE_OPEN,null)}_onSourceClose(){lt.info("MediaSource closed."),this._destroySourceBuffers(),this.emit(Q.BUFFER_SOURCE_CLOSE,null)}_destroySourceBuffers(){const e=this._mediaSource;if(!e)return;const t=e.sourceBuffers;if(t.length)for(let n=0,i=t.length;n{n?setTimeout(e,1e3):e()})).then((()=>{var n;null===(n=e.reject)||void 0===n||n.call(e,t),this.dequeueUpdates()})).then((()=>{e.init&&this._updateQueue.push(e)}))}const r=o.byteLength>e.buffer.byteLength;(e.segment.init||r)&&(this._currentInitSegments[e.mimeType]=e.profileId),null===(n=e.resolve)||void 0===n||n.call(e,!0),r?lt.info(`Injected combined init segment and playable segment (${e.mimeType}, ${e.profileId})`):e.init&<.info(`Injected individual init segment (${e.mimeType}, ${e.profileId})`)}_abortUpdate(e){var t;null===(t=e.resolve)||void 0===t||t.call(e,!1),Promise.resolve().then(this.dequeueUpdates)}dequeueUpdates(){const e=this._updateQueue.shift();e&&this.tryUpdate(e)}tryUpdate(e){if(e.playId!==this._playId)return lt.info("Try update dropped: playId has changed"),void this._abortUpdate(e);if(e.timestamp{this.tryUpdate({playId:this._playId,timestamp:Date.now(),type:"duration",duration:e,resolve:t})}))}getMediaSource(){return this._mediaSource}setPlayId(e){this._playId=e}getPlayId(){return this._playId}}const pt=T.P.forTag("playback.buffer_fill_operation");class ft{constructor(e){var t;this._batchSize=1,this._prioritizeFirst=!1,this._segmentsToAppend=[],this._abortController=(0,a.createAbortControllerLike)(),this.status="pending",this.timeStart=e.timeStart,this.timeEnd=e.timeEnd,this.done=new Promise((e=>{this._resolveDone=e})),this._getBufferedTimeRanges=e.getBufferedTimeRanges,this._getBufferSetForSegment=e.getBufferSetForSegment,this._getSegmentsForRange=e.getSegmentsForRange,this._appendBufferData=e.appendBufferData,this._batchSize=null!==(t=e.batchSize)&&void 0!==t?t:1,this._prioritizeFirst=!!e.prioritizeFirst}_filterBufferedSegments(e){const t=this._getBufferedTimeRanges();let n=[];if(null==t?void 0:t.length)e:for(const i of e){let e=t.length;for(;e--;){if(t.start(e)<=i.timeStart&&t.end(e)>=i.timeEnd)continue e}n.push(i)}else n=e;return n}_fill(e,t=!1){var n;if(e.aborted)return;const i=this._segmentsToAppend,o=i.length,r=i.splice(0,t?1:Math.max(1,this._batchSize));if(!r.length)return this.status="ended",void(null===(n=this._resolveDone)||void 0===n||n.call(this));pt.log(`Segments to download: ${r.length}/${o}`);const s=Date.now();Promise.all(r.map((t=>this._getBufferSetForSegment(t,e).then((n=>e.aborted?Promise.resolve([!1]):this._appendBufferData(n,t,s)))))).then((t=>{var n,i;if(e.aborted)return;if(-1!==[].concat(...t).indexOf(!1))return this.status="failed",null===(n=this._resolveDone)||void 0===n||n.call(this),pt.warn(`Fill operation ${this.timeStart}-${this.timeEnd} append failed.`),void this._clear();this._segmentsToAppend.length?this._fill(e):(this.status="ended",null===(i=this._resolveDone)||void 0===i||i.call(this),this._clear())}),(e=>{var t;e.code!==a.TransportErrors.HTTP_REQUEST_ABORTED?(this.status="failed",null===(t=this._resolveDone)||void 0===t||t.call(this),this._clear(),pt.warn(`Fill operation ${this.timeStart}-${this.timeEnd} failed.`,"QuotaExceededError"===e.name?"Exceeded buffer quota":e)):this.status="aborted"}))}_clear(){this._segmentsToAppend=[]}start(){var e;if(this._abortController.signal.aborted||"pending"!==this.status)return this.done;this.status="started",pt.log("Starting fill operation for range",this.timeStart,this.timeEnd);const t=this._getSegmentsForRange(this.timeStart,this.timeEnd);return this._segmentsToAppend=this._filterBufferedSegments(t),this._segmentsToAppend.length?(this._fill(this._abortController.signal,this._prioritizeFirst),this.done):(pt.warn("Fill operation ended early: all segments are buffered."),this.status="ended",null===(e=this._resolveDone)||void 0===e||e.call(this),this.done)}abort(){var e;return"aborted"===this.status||("started"===this.status&&pt.info(`Fill operation ${this.timeStart}-${this.timeEnd} aborted.`),this.status="aborted",null===(e=this._resolveDone)||void 0===e||e.call(this),this._abortController.abort(),this._clear()),this}}var ht,mt;!function(e){e[e.AUDIO=12]="AUDIO",e[e.VIDEO=20]="VIDEO"}(ht||(ht={}));class gt extends c.vp{constructor(e,t={},n={}){var i,o;super(),this._bufferTarget={audio:ht.AUDIO,video:ht.VIDEO},this._currentFillOperation=null,this._tracker=e;const{customSourceBufferParams:r,noInit:a,disableBufferAbort:s}=n;this._bufferTarget.audio=(null===(i=n.bufferTarget)||void 0===i?void 0:i.audio)||ht.AUDIO,this._bufferTarget.video=(null===(o=n.bufferTarget)||void 0===o?void 0:o.video)||ht.VIDEO,this._mediaSourceManager=dt.create({mimeTypes:t,noInit:a,customSourceBufferParams:r,disableBufferAbort:s}),this.proxyEmitAll(this._mediaSourceManager,{[Q.BUFFER_SOURCE_OPEN]:Q.BUFFER_SOURCE_OPEN,[Q.BUFFER_SOURCE_CLOSE]:Q.BUFFER_SOURCE_CLOSE,[Q.BUFFER_QUOTA_EXCEEDED]:Q.BUFFER_QUOTA_EXCEEDED,[Q.BUFFER_UPDATE_END]:Q.BUFFER_UPDATE_END})}static create(e,t={},n={}){return new gt(e,t,n)}_trackBufferingProgress(e){e.audio&&e.audio.buffer&&this._tracker.trackBytesDownloaded(e.audio.buffer.byteLength),e.video&&e.video.buffer&&this._tracker.trackBytesDownloaded(e.video.buffer.byteLength)}_trackBufferURLs(e){var t,n,i,o,r,a;null!==(null===(t=e.audio)||void 0===t?void 0:t.bandwidth)&&this._tracker.trackBufferURL((null===(n=e.audio)||void 0===n?void 0:n.bufferURL)||"",{bandwidth:(null===(i=e.audio)||void 0===i?void 0:i.bandwidth)||0}),null!==(null===(o=e.video)||void 0===o?void 0:o.bandwidth)&&this._tracker.trackBufferURL((null===(r=e.video)||void 0===r?void 0:r.bufferURL)||"",{bandwidth:(null===(a=e.video)||void 0===a?void 0:a.bandwidth)||0})}dequeueUpdates(){this._mediaSourceManager.dequeueUpdates()}abort(e=!1){var t;null===(t=this._currentFillOperation)||void 0===t||t.abort(),this._currentFillOperation=null,this._mediaSourceManager.abort(e)}getMediaSource(){return this._mediaSourceManager.getMediaSource()}destroy(){this._mediaSourceManager.destroy()}checkBufferHealth(e,t,n){var i;const o=this._currentFillOperation;if(!n&&"started"===(null==o?void 0:o.status))return;const r=this._mediaSourceManager,s=r.getMediaSource();if(!s||"closed"===s.readyState)return;let c=t;if(c>=s.duration){const t=e.getFinalSegment();t&&(c=t.timeStart)}const l=function(e,t){var n;const i=null===(n=e.sourceBuffers[e.sourceBuffers.length-1])||void 0===n?void 0:n.buffered;if(i)for(let e=0;eu)return;const f=d+(u-p);if(!o||"started"!==o.status||o.timeStartf){null==o||o.abort();const t=r.getPlayId();this._currentFillOperation=new ft({timeStart:d,timeEnd:f,getBufferedTimeRanges:()=>{var e,t;return null!==(t=null===(e=s.sourceBuffers[s.sourceBuffers.length-1])||void 0===e?void 0:e.buffered)&&void 0!==t?t:null},getBufferSetForSegment:(n,i)=>e.getBufferSetForSegment(n,i).then((e=>(this._trackBufferingProgress(e),this._trackBufferURLs(e),e)),(n=>(t===r.getPlayId()&&n.code!==a.TransportErrors.HTTP_REQUEST_ABORTED&&this.emit(Q.BUFFER_APPEND_ERROR,{error:n,canPlayNext:!0,track:e.toLogJSON()}),Promise.reject(n)))),getSegmentsForRange:(t,n=1/0)=>e.getSegmentsForRange(t,n),appendBufferData:(e,n,i)=>r.appendBufferData(e,n,t,i).then((e=>(n.isFinal&&-1===(null==e?void 0:e.indexOf(!1))&&this._mediaSourceManager.endOfStream(t),e))),prioritizeFirst:!l}),this._currentFillOperation.start()}}isPositionInCurrentFillRange(e,t){const n=this._currentFillOperation;if("started"!==(null==n?void 0:n.status))return!1;const i=t+("video"===e.getMediaType()?this._bufferTarget.video:this._bufferTarget.audio);return n.timeStart>=t||n.timeEnd>=i}recreate(e){this._mediaSourceManager.recreate({mimeTypes:e})}injectInitSegment(e){const t=this._mediaSourceManager,n=t.getMediaSource();if(!n||"closed"===n.readyState)return Promise.resolve(!1);const i=e.getInitSegment();if(!i)return Promise.resolve(!1);const o=Date.now(),r=t.getPlayId();return e.getInitBufferSet().then((e=>t.appendBufferData(e,i,r,o))).then((()=>!0))}setDuration(e){return this._mediaSourceManager.setDuration(e)}setPlayId(e){this._mediaSourceManager.setPlayId(e)}getBufferTarget(){return this._bufferTarget}}class _t extends Ye{constructor(e){super(e),this.strategy=Z.URL,this._url=e.url,this._mimeType=e.mimeType}load(){if(this._mimeType){if(!(e=this._mimeType,t=this.getMediaType(),""!==document.createElement(t).canPlayType(e)))throw new We(i.FILE_FORMAT_NOT_SUPPORTED,"Content is not playable.")}var e,t;return Promise.resolve(this)}unload(){}isProtected(){return!1}getMediaTypeMimeTypes(){var e,t;return"video"===this._mediaType?{video:null!==(e=this._mimeType)&&void 0!==e?e:"video/mp4"}:{audio:null!==(t=this._mimeType)&&void 0!==t?t:"audio/mp3"}}getURL(){return this._url}getLoadingApproach(){return{approach:"src"}}}!function(e){e[e.MP3_256=3]="MP3_256",e[e.MP3_320=4]="MP3_320",e[e.MP3_160=5]="MP3_160",e[e.MP3_96=6]="MP3_96",e[e.MP4_128=10]="MP4_128",e[e.MP4_256=11]="MP4_256",e[e.MP4_128_DUAL=12]="MP4_128_DUAL",e[e.MP4_256_DUAL=13]="MP4_256_DUAL",e[e.MP4_128_CBCS=14]="MP4_128_CBCS",e[e.MP4_256_CBCS=15]="MP4_256_CBCS",e[e.MP4_FLAC=17]="MP4_FLAC"}(mt||(mt={}));const vt={[mt.MP3_256]:"audio/mp3",[mt.MP3_320]:"audio/mp3",[mt.MP3_160]:"audio/mp3",[mt.MP3_96]:"audio/mp3",[mt.MP4_128]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_256]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_128_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_256_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_128_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_256_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[mt.MP4_FLAC]:'audio/mp4; codecs="flac"'};class yt extends Ye{constructor(e){if(super(e),this._loaded=!1,this._lastResolveToken=0,this._lastResolveTimestamp=0,this._fallbackURLs=[],this._contentSegments=[],this._duration=0,this._segmentLength=0,this._protection="cenc",this._fileId=e.fileId,this._resolver=e.resolver,this._keySystem=e.keySystem,this._keySystemSettings=Te[this._keySystem],this._fileFormat=e.fileFormat,this._disableCache=e.disableCache,this._preloadedManifest=e.preloadedManifest,this._preresolvedURL=e.preresolvedURL,this._fileFormat)this._mimeType=vt[this._fileFormat];else switch(this._mediaFormat){case te.MP3:this._mimeType=vt[mt.MP3_160];break;case te.MP4:case te.MP4_DUAL:case te.MP4_CBCS:this._mimeType=vt[mt.MP4_128];break;default:throw new TypeError(`Unknown audio format ${this._mediaFormat}`)}}_getCDNURLs(e){if(this._preresolvedURL)return this._currentURL=this._preresolvedURL,this._fallbackURLs=[],e&&(e.resolveLatency=0),Promise.resolve(!0);const t=this._fileId;clearTimeout(this._lastResolveToken);const n=()=>(this._lastResolveTimestamp=Date.now(),this._resolver.getCDNURL(t,this._fileFormat).then((t=>(e&&(e.resolveLatency=Date.now()-this._lastResolveTimestamp),t)))),i=Date.now()-this._lastResolveTimestamp;let o;return o=i<1001?new Promise(((e,t)=>{this._lastResolveToken=setTimeout((()=>{n().then(e,t)}),1001-i)})):n(),o.then((e=>(this._fallbackURLs=e.uris,this._currentURL=this._fallbackURLs.shift(),!0))).catch((e=>(e&&(e.track=this.toLogJSON()),Promise.reject(e))))}_getManifest(e){if(this._preloadedManifest)return e&&(e.manifestLatency=0),Promise.resolve(this._preloadedManifest);const t=Date.now();return this._resolver.getManifest(this._fileId).then((n=>(e&&(e.manifestLatency=Date.now()-t),n)))}_calculateSegments(e){let t=e.offset;this._initSegment={init:!0,cacheBufferSet:!this._disableCache,timeStart:0,timeEnd:0,byteRanges:{audio:{start:0,end:t-1}}};const n=e.segments,i=e.timescale,o=n.length,r=new Array(o);let a=0,s=0;for(let e=0,c=o;ethis._segmentLength&&(this._segmentLength=Math.floor(u))}r[r.length-1].isFinal=!0,this._contentSegments=r,this._duration=s/i}_calculateSegmentsV1(e){let t=e.offset;this._initSegment={init:!0,cacheBufferSet:!this._disableCache,timeStart:0,timeEnd:0,byteRanges:{audio:{start:0,end:t-1}}};const n=e.references,i=e.timescale,o=n.length,r=new Array(o);let a=0,s=0;for(let e=0,c=o;ethis._segmentLength&&(this._segmentLength=Math.floor(c))}r[r.length-1].isFinal=!0,this._contentSegments=r,this._duration=a/i}load(e={resolveLatency:0,manifestLatency:0}){return this._loaded?(e.resolveLatency=0,e.manifestLatency=0,Promise.resolve(this)):Promise.all([this._getCDNURLs(e),this._getManifest(e)]).then((([e,t])=>{var n;if(this._loaded=!0,!e||!t)return this;if(this._keySystem===$.INVALID_SPOTIFY_KEY)return this._pssh=new Uint8Array(0),this;let o;const r=this._keySystemSettings.pssh_field.audio;let a=function(e,t){return t.hasOwnProperty(e)}(r,t)?t[r]:null;if(!a&&"pssh_widevine"===r&&"pssh"in t&&(a=null!==(n=t.pssh)&&void 0!==n?n:null),!a)return o=new We(i.FILE_FORMAT_NOT_SUPPORTED,"KeySystem does not support the file format."),o.track=this.toLogJSON(),Promise.reject(o);if(this._protection=t.protection||"cenc",this._pssh=je(a),"segments"in t&&t.segments)this._calculateSegments(t);else{if(!("references"in t)||!t.references)return o=new We(i.FILE_MALFORMED_SEEKTABLE,"Malformed seektable."),o.track=this.toLogJSON(),Promise.reject(o);this._calculateSegmentsV1(t)}return this}))}isProtected(){return!!this._protection&&!!this._pssh}getMediaTypeMimeTypes(){return{audio:this._mimeType}}}const Et="application/vnd.apple.mpegurl";function bt(e){var t;const n=function(e){return e.map((e=>{if(e.byteEnd&&void 0!==e.byteStart){let t=""+(1+e.byteEnd-e.byteStart);return t+=`@${e.byteStart}`,`#EXTINF:${e.duration},\n#EXT-X-BYTERANGE:${t}\n${e.url}`}return`#EXTINF:${e.duration},\n${e.url}`})).join("\n")}(e.segments),i=e.assetID?`#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://${e.assetID}",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"`:"";let o=e.map?`#EXT-X-MAP:URI="${e.map.url}"`:"";return(null===(t=e.map)||void 0===t?void 0:t.byteEnd)&&void 0!==e.map.byteStart&&(o+=`,BYTERANGE="${1+e.map.byteEnd}@${e.map.byteStart}"`),`#EXTM3U\n#EXT-X-VERSION:6\n#EXT-X-TARGETDURATION:${Math.floor(e.targetDuration)}\n#EXT-X-MEDIA-SEQUENCE:0\n#EXT-X-PLAYLIST-TYPE:VOD\n${o?`${i}\n${o}`:i}\n${n}\n#EXT-X-ENDLIST`}function St(e){return`data:application/vnd.apple.mpegurl;base64,${btoa(e)}`}function At(e){const t=new Blob([e],{type:Et});return URL.createObjectURL(t)}function Tt(e){return At(bt(e))}function Ot(e){return St(bt(e))}class It extends yt{constructor(){super(...arguments),this._hlsURL=null,this.strategy=Z.URL}unload(){this._hlsURL&&URL.revokeObjectURL(this._hlsURL),this._hlsURL=null}getURL(){var e,t;const n=this._currentURL,o=this._initSegment;if(!n||!o)throw new We(i.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.unload();const r={url:n,byteStart:null===(e=o.byteRanges.audio)||void 0===e?void 0:e.start,byteEnd:null===(t=o.byteRanges.audio)||void 0===t?void 0:t.end},a=this._contentSegments.map((e=>{var t,i;return{url:n,duration:e.timeEnd-e.timeStart,byteStart:null===(t=e.byteRanges.audio)||void 0===t?void 0:t.start,byteEnd:null===(i=e.byteRanges.audio)||void 0===i?void 0:i.end}})),s="undefined"==typeof MediaSource?Tt:Ot;return this._hlsURL=s({assetID:this._fileId,targetDuration:10,map:r,segments:a}),this._hlsURL}getLoadingApproach(){return{approach:"source",type:Et}}}class Ct extends Error{constructor(e,t,n,i={}){super(t),this.code=e,this.message=t,this.status=n,this.debug=i,this.name="FragmentError"}}class Nt extends yt{constructor(e){super(e),this._profileId=`${Date.now()}`,this._lastFetchedBuffer=null,this.strategy=Z.MSE,this._transport=e.transport,this._abrManager=e.abrManager,this._parseSegmentResponse=this._parseSegmentResponse.bind(this)}_parseSegmentResponse(e,t){const{requestURL:n,segment:o,byteRangeHeader:r,expectedLength:a}=e.metadata,s=`${o.timeStart}-${o.timeEnd}`;switch(e.status){case 0:{if(e.offline)return Promise.reject(new Ct(i.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0,{time_range:s,byte_range:r}));const a=new Ct(i.FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0);let c=!1;return this._currentURL!==n?c=!0:this._fallbackURLs.length&&this._currentURL===n&&(c=!0,this._currentURL=this._fallbackURLs.shift()),a.debug.has_fallback=c,c?this.getBufferSetForSegment(o,t):Promise.reject(a)}case 200:case 206:{const t=e.body;if(!t)return Promise.reject(new Ct(i.FRAGMENT_REQUEST_EMPTY_RESPONSE,"Empty response for successful buffer.",e.status,{time_range:s,byte_range:r}));if(t.byteLength!==a)return Promise.reject(new Ct(i.FRAGMENT_REQUEST_UNEXPECTED_LENGTH,"Received buffer of unexpected length.",e.status,{time_range:s,byte_range:r,received_length:t.byteLength,expected_length:a}));const c={audio:{profileId:this._profileId,bufferURL:n,byteStart:o.byteRanges.audio.start,byteEnd:o.byteRanges.audio.end,buffer:t,mimeType:this._mimeType,bandwidth:8e3*t.byteLength/e.timing.completed}};return o.cacheBufferSet&&t&&t.byteLength&&(o.bufferSet=c),this._abrManager.sample(t.byteLength,e.timing.completed),Promise.resolve(c)}case 403:return this._getCDNURLs().then((()=>this.getBufferSetForSegment(o,t)));default:{let a=!1;return this._currentURL!==n?a=!0:this._fallbackURLs.length&&this._currentURL===n&&(a=!0,this._currentURL=this._fallbackURLs.shift()),a?this.getBufferSetForSegment(o,t):Promise.reject(new Ct(i.FRAGMENT_REQUEST_FAILED_WITH_STATUS,`Buffer request failed with status ${e.status}`,e.status,{time_range:s,byte_range:r}))}}}unload(){this._lastFetchedBuffer=null,this._disableCache&&(this._initSegment&&(this._initSegment.bufferSet=null),this._contentSegments[0]&&(this._contentSegments[0].bufferSet=null))}getCalculatedDuration(){return this._duration}getSegmentLength(){return this._segmentLength}getInitSegment(){return this._initSegment}getSegmentForTime(e){var t,n;if(!(null===(t=this._contentSegments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return null!==(n=this._contentSegments[0])&&void 0!==n?n:null;for(const t of this._contentSegments)if(t.timeStart<=e&&t.timeEnd>=e)return t;return null}getSegmentAfterTime(e){var t,n;if(!(null===(t=this._contentSegments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return null!==(n=this._contentSegments[1])&&void 0!==n?n:null;for(const t of this._contentSegments)if(t.timeStart>e)return t;return null}getSegmentsForRange(e,t=1/0){var n;const i=[];if(null===(n=this._contentSegments)||void 0===n?void 0:n.length)for(const n of this._contentSegments)n.timeStart<=t&&n.timeEnd>=e&&i.push(n);return i}getFinalSegment(){var e,t;return null!==(t=null===(e=this._contentSegments)||void 0===e?void 0:e[this._contentSegments.length-1])&&void 0!==t?t:null}getInitBufferSet(e){var t,n;if(!this._initSegment)throw new We(i.FILE_NOT_RESOLVED,"Cannot return the init bufferset: file not resolved.");return(null===(n=null===(t=this._initSegment.bufferSet)||void 0===t?void 0:t.audio)||void 0===n?void 0:n.buffer.byteLength)?Promise.resolve(this._initSegment.bufferSet):(this._initBufferPromise||(this._initBufferPromise=this.getBufferSetForSegment(this._initSegment,e).then((e=>{var t;if(!(null===(t=e.audio)||void 0===t?void 0:t.buffer.byteLength))throw new Error("Empty initialization segment buffer");return e}))),this._initBufferPromise)}getBufferSetForSegment(e,t){var n;if((null===(n=this._lastFetchedBuffer)||void 0===n?void 0:n.segment)===e)return Promise.resolve(this._lastFetchedBuffer.bufferSet);if(e.bufferSet)return Promise.resolve(e.bufferSet);if(!this._currentURL)return Promise.reject(new We(i.FILE_NOT_RESOLVED,"Cannot fetch buffer: No resolved URL"));const o=e.byteRanges.audio,r=`${o.start}-${o.end}`,a=o.end+1-o.start,s=this._currentURL;return(e.init?Promise.resolve(null):this.getInitBufferSet(t)).then((n=>Promise.all([n,this._transport.request(s,{method:"GET",responseType:"arraybuffer",headers:{Range:`bytes=${r}`},signal:t,timing:!0,metadata:{requestURL:s,segment:e,byteRangeHeader:r,expectedLength:a},retry:{condition:(e,t)=>{if(0===e.status)return e.offline;const n=e.getStatusFamily();return n===t.CONNECTION_ERROR||n===t.SERVER_ERROR||!(n!==t.SUCCESS||!e.body)&&e.body.byteLength!==a}}}).then((e=>this._parseSegmentResponse(e,t)))]))).then((([t,n])=>{var i;return(null===(i=null==t?void 0:t.audio)||void 0===i?void 0:i.buffer)&&n.audio&&(n.audio.initBuffer=t.audio.buffer),this._lastFetchedBuffer={segment:e,bufferSet:n},n}))}}class Lt extends nt{constructor(e){super(e),this._hlsURLs=[],this.strategy=Z.URL,this._keySystem===$.FAIRPLAY&&this._supportedFormats.audio.unshift({mimeType:"audio/mp2t",codec:"mp4a.40.2"})}_getHLSURLForProfile(e,t){const n=this._duration,i=this._segmentLength,o=this._segmentTemplate,r=[];for(let t=0;tn?n-t:i,s=o.replace("{{profile_id}}",e.id.toString(10)).replace("{{segment_timestamp}}",t.toString(10)).replace("{{file_type}}",e.file_type);r.push({duration:a,url:`${this._baseURL}${s}`})}const a=("undefined"==typeof MediaSource?Tt:Ot)({assetID:this._assetID,targetDuration:i,map:t?{url:t}:void 0,segments:r});return this._hlsURLs.push(a),a}load(e={resolveLatency:0,manifestLatency:0}){return super.load(e).then((()=>{var e,t;return this._audioProfiles.selected=null!==(e=this._audioProfiles.available[0])&&void 0!==e?e:null,this._videoProfiles.selected=null!==(t=this._videoProfiles.available[0])&&void 0!==t?t:null,this}))}getURL(){var e,t;if(!this._baseURL)throw new We(i.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.unload();const n=[],o=this._audioProfiles.available[0];if(o){const e="ts"!==o.file_type?this._resolver.getInitSegmentURLs(this._baseURL,this._initTemplate,o,void 0).audio:"";n.push(`#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",LANGUAGE="eng",NAME="English",AUTOSELECT=YES,URI="${this._getHLSURLForProfile(o,e)}"`)}for(const i of this._videoProfiles.available){const r=(null!==(e=null==o?void 0:o.max_bitrate)&&void 0!==e?e:0)+i.max_bitrate,a=(null!==(t=null==o?void 0:o.audio_bitrate)&&void 0!==t?t:0)+i.video_bitrate,s="ts"!==i.file_type?this._resolver.getInitSegmentURLs(this._baseURL,this._initTemplate,void 0,i).video:"";n.push(`#EXT-X-STREAM-INF:BANDWIDTH=${r},AVERAGE-BANDWIDTH=${a},RESOLUTION=${i.video_width}x${i.video_height},CODECS="${(null==o?void 0:o.audio_codec)?`${o.audio_codec}, ${i.video_codec}`:i.video_codec}"${(null==o?void 0:o.audio_codec)?',AUDIO="audio"':""}\n${this._getHLSURLForProfile(i,s)}`)}const r=`#EXTM3U\n${n.join("\n")}`,a=("undefined"==typeof MediaSource?At:St)(r);return this._hlsURLs.push(a),a}unload(){for(const e of this._hlsURLs)URL.revokeObjectURL(e);this._hlsURLs=[]}getMediaTypeMimeTypes(){var e,t;return{audio:tt(null===(e=this._audioProfiles.available)||void 0===e?void 0:e[0]),video:tt(null===(t=this._videoProfiles.available)||void 0===t?void 0:t[0])}}getLoadingApproach(){return{approach:"source",type:Et}}adaptToBandwidth(){return Promise.resolve(!1)}canLowerBitrate(){return!1}}class Rt extends nt{constructor(e){super(e),this._initSegmentBuffers={},this.strategy=Z.MSE,this._transport=e.transport,this._abrManager=e.abrManager,this._parseSegmentResponse=this._parseSegmentResponse.bind(this)}_isQualityMatched(e,t,n){var i,o,r,a;if(this._videoResolution){const t=null!==(i=this._videoResolution.max)&&void 0!==i?i:9007199254740991,a=null!==(o=this._videoResolution.min)&&void 0!==o?o:0;if(n){const n=null!==(r=this._videoResolution.start)&&void 0!==r?r:t;return e.video_resolution<=n}return e.video_resolution>=a&&e.video_resolution<=t}const s=null!==(a=null==t?void 0:t.audio_bitrate)&&void 0!==a?a:0,c=this._abrManager.getBandwidthEstimate();return e.video_bitrate+s{if(0===e.status)return!0;const n=e.getStatusFamily();return n===t.CONNECTION_ERROR||n===t.SERVER_ERROR}},metadata:{timeStart:Date.now(),segment:t,profile:n,loggingURL:i}}).then(this._parseSegmentResponse)}_fetchInitSegmentBuffers(e,t,n){const o=this._initSegment;if(!o)return Promise.reject(new We(i.FILE_NOT_RESOLVED,"Cannot fetch Init Segment buffers: File not resolved."));let r;try{r=this._constructSegmentURL(o,e,t)}catch(e){return Promise.reject(e)}const a=this._initSegmentBuffers;let s=0,c=0;const l=Date.now(),u=e=>{c+=e,s--,s||(this._abrManager.sample(c,Date.now()-l),this._updateVariants())};let d=Promise.resolve(null);if(e){const t=a[e.id];(null==t?void 0:t.buffer.byteLength)?d=Promise.resolve(t):(null==r?void 0:r.audio)&&(s++,d=this._fetchBufferData(r.audio,o,e,r.audioLogging,n).then((t=>(a[e.id]=t,u(t.buffer.byteLength),t))))}let p=Promise.resolve(null);if(t){const e=a[t.id];(null==e?void 0:e.buffer.byteLength)?p=Promise.resolve(e):(null==r?void 0:r.video)&&(s++,p=this._fetchBufferData(r.video,o,t,r.videoLogging,n).then((e=>(a[t.id]=e,u(e.buffer.byteLength),e))))}return Promise.all([d,p]).then((([e,t])=>({audio:e,video:t})))}_fetchBufferSetForSegment(e,t,n,i){let o;try{o=this._constructSegmentURL(e,t,n)}catch(e){return Promise.reject(e)}return this._fetchInitSegmentBuffers(t,n,i).then((r=>{let a=0,s=0;const c=Date.now(),l=e=>{s+=e,a--,a||(this._abrManager.sample(s,Date.now()-c),this._updateVariants())};let u=null;!e.init&&(null==o?void 0:o.audio)&&(a++,u=this._fetchBufferData(o.audio,e,t,o.audioLogging,i).then((e=>(l(e.buffer.byteLength),e))));let d=null;return!e.init&&(null==o?void 0:o.video)&&(a++,d=this._fetchBufferData(o.video,e,n,o.videoLogging,i).then((e=>(l(e.buffer.byteLength),e)))),Promise.all([r,u,d])})).then((([t,n,i])=>{var o,r;let a;return e.init?a={audio:null!==(o=t.audio)&&void 0!==o?o:void 0,video:null!==(r=t.video)&&void 0!==r?r:void 0}:(a={audio:null!=n?n:void 0,video:null!=i?i:void 0},e.cacheBufferSet&&(e.bufferSet=a),a.audio&&(null==t?void 0:t.audio)&&(a.audio.initBuffer=t.audio.buffer),a.video&&(null==t?void 0:t.video)&&(a.video.initBuffer=t.video.buffer)),a})).catch((e=>Promise.reject(e)))}load(e={resolveLatency:0,manifestLatency:0}){return super.load(e).then((()=>(this._updateVariants(!0),this)))}adaptToBandwidth(){return this._updateVariants(),Promise.resolve(!0)}canLowerBitrate(){var e;const t=this._videoProfiles.available[0];return(null===(e=this._videoProfiles.selected)||void 0===e?void 0:e.id)!==(null==t?void 0:t.id)}getMediaTypeMimeTypes(){return{audio:tt(this._audioProfiles.selected),video:tt(this._videoProfiles.selected)}}unload(){this._initSegment&&(this._initSegmentBuffers={}),this._segments.forEach((e=>{e.bufferSet=null}))}getCalculatedDuration(){return this._duration}getSegmentLength(){return this._segmentLength}getInitSegment(){return this._initSegment}getInitBufferSet(){var e,t;const n=null!==(e=this._audioProfiles.selected)&&void 0!==e?e:void 0,i=null!==(t=this._videoProfiles.selected)&&void 0!==t?t:void 0;return this._fetchInitSegmentBuffers(n,i).then((e=>{var t,n;return{audio:null!==(t=e.audio)&&void 0!==t?t:void 0,video:null!==(n=e.video)&&void 0!==n?n:void 0}}))}getSegmentForTime(e){var t;if(!(null===(t=this._segments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return this._segments[0];for(const t of this._segments)if(t.timeStart<=e&&t.timeEnd>=e)return t;return null}getSegmentAfterTime(e){var t;if(!(null===(t=this._segments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return this._segments[1];for(const t of this._segments)if(t.timeStart>e)return t;return null}getSegmentsForRange(e,t){var n;const i=[];if(null===(n=this._segments)||void 0===n?void 0:n.length)for(const n of this._segments)n.timeStart<=t&&n.timeEnd>=e&&i.push(n);return i}getFinalSegment(){var e,t;return null!==(t=null===(e=this._segments)||void 0===e?void 0:e[this._segments.length-1])&&void 0!==t?t:null}getBufferSetForSegment(e,t){var n,i;if(!e)return Promise.reject(new TypeError("No segment provided"));const o=this._audioProfiles.selected,r=this._videoProfiles.selected,a=null===(i=null===(n=e.bufferSet)||void 0===n?void 0:n.video)||void 0===i?void 0:i.resolution;return e.bufferSet&&(!r||a&&a>=r.video_resolution)?Promise.resolve(e.bufferSet):this._fetchBufferSetForSegment(e,null!=o?o:void 0,null!=r?r:void 0,t)}}class Pt extends Ye{constructor(e){super(e),this._url="",this.strategy=Z.URL,this._fileId=e.fileId,this._resolver=e.resolver}_getCDNURLs(e){const t=this._fileId,n=Date.now();return this._resolver.getCDNURL(t).then((t=>(e&&(e.resolveLatency=Date.now()-n),t)))}load(e={resolveLatency:0,manifestLatency:0}){return this._getCDNURLs(e).then((e=>(this._url=e.uri,this)))}unload(){}isProtected(){return!1}getMediaTypeMimeTypes(){return{audio:"audio/mp3"}}getURL(){return this._url}getLoadingApproach(){return{approach:"source",type:"audio/mp3"}}}n(53321);class kt extends Error{constructor(e,t){super(),this.status=-1,this.debug={},this.canPlayNext=!0,this.unrecoverable=!1,this.name="AdManifestError",this.code=e,this.message=t}static fatal(e,t){const n=new kt(e,t);return n.unrecoverable=!1,n.canPlayNext=!0,n}}class Dt extends Ye{constructor(e){super(e),this._loaded=!1,this._playableContentSorted=[],this._mimeType="",this._manifestURL="",this._adURL="",this._audioFiles=[],this._videoFiles=[],this._trackingData=null,this.strategy=Z.URL,this._abrManager=e.abrManager,this._transport=e.transport,this._manifestURL=e.manifestURL,this._preloadedManifest=e.preloadedManifest,this._hasNonFatalErrors=!1,this._getManifest=this._getManifest.bind(this),this._parseManifest=this._parseManifest.bind(this),this._getPlayableContent=this._getPlayableContent.bind(this)}_isPlayable(e,t){return""!==document.createElement(t).canPlayType(e)}_parseManifest(e){if(!(null==e?void 0:e.manifest))throw new kt(i.STORAGE_TRACK_MANIFEST_EMPTY,"Received empty manifest.");const{manifest:t}=e;this._videoFiles=t.video_files,this._audioFiles=t.audio_files,this._contentMetadata=t.metadata,this._videoManifestId=t.video_manifest_id,this._trackingData=(e=>{const t={};for(const n in e){if(!e.hasOwnProperty(n))continue;const i=n;t[i]={urls:e[i]}}return t})(t.tracking_events)}_getManifest(e){if(this._preloadedManifest)return e&&(e.manifestLatency=0),Promise.resolve(this._preloadedManifest);const t=Date.now(),n=this._manifestURL;return this._transport.request(n,{responseType:"json",authorize:!0,retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS}}).then((o=>{if(200!==o.status){const e=new kt(i.AD_MANIFEST_REQUEST_FAILED_WITH_STATUS,`Ad manifest request failed with status code ${o.status}`);return e.debug.manifestURL=n,e.status=o.status,Promise.reject(e)}if(!o.body){const e=new kt(i.AD_MANIFEST_INVALID,"Received empty manifest.");return e.debug.manifestURL=n,e.status=o.status,Promise.reject(e)}e&&(e.manifestLatency=Date.now()-t);const r=o.body;return Promise.resolve(r)}))}_getPlayableContent(){if(this._videoManifestId)return;const e="audio"===this.getMediaType(),t=e?this._audioFiles:this._videoFiles;if(!t.length)throw new We(i.FILE_NOT_RESOLVED,`Manifest's ${e?"audio_files":"video_files"} array is empty.`);const n=t.filter((e=>this._isPlayable(e.type,this.getMediaType())));if(!n.length)throw new We(i.FILE_FORMAT_NOT_SUPPORTED,"No playable content found.");this._playableContentSorted=n.sort(((e,t)=>t.bitrate-e.bitrate))}load(e={resolveLatency:0,manifestLatency:0}){return this._loaded?(e.resolveLatency=0,e.manifestLatency=0,Promise.resolve(this)):this._getManifest(e).then(this._parseManifest).then(this._getPlayableContent).then((()=>(this._loaded=!0,Promise.resolve(this))))}unload(){this._adURL=""}isProtected(){return!1}getMediaTypeMimeTypes(){return{[this._mediaType]:this._mimeType}}getURL(){if(""!==this._adURL)return this._adURL;const e=this._abrManager.getBandwidthEstimate();let t=this._playableContentSorted[this._playableContentSorted.length-1];for(const n of this._playableContentSorted)if(n.bitrate<=e){t=n;break}return t&&(this._adURL=t.url,this._mimeType=t.type),this._adURL}getLoadingApproach(){return{approach:"src"}}getManifestId(){return this._videoManifestId}getTrackingEvents(){if(!this._trackingData)throw new We(i.FILE_NOT_RESOLVED,"Cannot return Tracking Events: File not resolved.");return this._trackingData}getTrackingEventData(e){const t=this._trackingData?this._trackingData[e]:null;return t?{tracking_event:e,urls:t.urls}:null}}function wt(e,t){var n;return{mediaType:e.mediaType,logData:e.logData,audioGain:e.audioGain,uri:e.uri,fileId:e.fileId,mediaFormat:e.format,hasNonFatalErrors:null!==(n=e.hasNonFatalErrors)&&void 0!==n?n:e.isAd,disableCache:t.disableCache,keySystem:t.keySystem,licenseEndpoint:e.licenseEndpoint,mediator:t.mediator,noAuth:e.noAuth,mimeType:e.mimeType}}function Mt(e,t,n){if(!e.fileId)return Promise.reject(new ne(i.INVALID_TRACK,`Invalid ${e.format} Track: No fileId.`));const o=Object.assign(Object.assign({},wt(e,t)),{transport:t.transport,abrManager:t.abrManager,supportedFormats:t.supportedFormats,fileId:e.fileId,keySystemSettings:Te[t.keySystem],resolver:t.videoResolver,disallowProfile:t.disallowProfile,allowMixedAVC1Codecs:t.allowMixedAVC1Codecs,trackingData:(null==n?void 0:n.trackingData)||null,metadata:null==n?void 0:n.metadata});return t.keySystem===$.FAIRPLAY?new Lt(o).load(t.measures):new Rt(o).load(t.measures)}const xt=T.P.forTag("playback.player"),Ut=/^blob:/,Vt={[te.MP4]:!0,[te.MP4_DUAL]:!0,[te.MP4_CBCS]:!0,[te.MP4_FLAC]:!0,[te.MP3]:!1,[te.MANIFEST_ID]:!0,[te.AD_MANIFEST]:!0,[te.GENERIC_MEDIA]:!0},Ft={start:Q.REPORTING_START,creative_view:Q.REPORTING_CREATIVE_VIEW,first_quartile:Q.REPORTING_FIRST_QUARTILE,midpoint:Q.REPORTING_MIDPOINT,third_quartile:Q.REPORTING_THIRD_QUARTILE,complete:Q.REPORTING_COMPLETE,pause:Q.REPORTING_PAUSE,resume:Q.REPORTING_RESUME,error:Q.REPORTING_ERROR},Bt={audio:2,video:2};function Ht(e){return Math.ceil(1e3*e)}function Gt(e){return e/1e3}function Kt(e){return document.createElement(e)}class Wt extends c.vp{constructor(e){var t,n,i,o,r;super(),this._cubicVolume=!1,this._player=null,this._emeManager=null,this._mediator=new c.vp,this._currentContent=null,this._upcomingContent=null,this._preloadingTracks={},this._playId=0,this._abortController=null,this._loaded=!1,this._licenseRequested=!1,this._playerActivated=!1,this._pauseToken=0,this._syntheticEndedToken=0,this._activeMimeTypes={},this._playerVolume=1,this._playerSpeed=1,this._fatalOnNextError=!1,this._canPreloadEmitted=!1,this._lastTimeUpdatePostion=0,this._rebuffering=!1,this._preferredBitrate=0,this._disableLicensePrefetch=!1,this._allowMixedAVC1Codecs=!0,this._disableBufferingBeforeLicense=!1,this._rebufferTarget=Bt,this._audioResolver=e.audioResolver,this._clearBufferOnSeek=!!e.clearBufferOnSeek,this._createPlayer=e.createPlayer||Kt,this._cubicVolume=e.cubicVolume,this._disableCache=!!e.disableCache,this._licenseURLResolver=e.licenseURLResolver,this._newBufferPerTrack=!!e.newBufferPerTrack,this._newElementPerTrack=!!e.newElementPerTrack,this._newMediaKeysPerTrack=e.newMediaKeysPerTrack,this._rebufferOnQuotaExceeded=!!e.rebufferOnQuotaExceeded,this._disableLicensePrefetch=!!e.disableLicensePrefetch,this._synthesizeEnded=!!e.synthesizeEnded,this._tracker=e.tracker,this._transport=e.transport,this._videoPlayerContainer=e.videoPlayerContainer,this._audioPlayerContainer=e.audioPlayerContainer,this._playerContainerManager=e.playerContainerManager||{inject:this._defaultPlayerContainerInjector.bind(this),eject:this._defaultPlayerContainerEjector.bind(this)},this._allowMixedAVC1Codecs=null===(t=e.allowMixedAVC1Codecs)||void 0===t||t,this._videoResolver=e.videoResolver,this._abrManager=e.abrManager,this._initialBandwidthSampler=e.initialBandwidthSampler,this._emeManager=e.disallowProtectedTracks?null:e.emeManager||null,this._disallowProfile=e.disallowProfile,this._disableBufferingBeforeLicense=!!e.disableBufferingBeforeLicense,this._cache=new X.z(e.trackCacheSize||2),this._subtitleManager=new Ke({language:e.preferredSubtitleLanguage||navigator.language,player:this._player}),this._videoResolution=e.videoResolution,xt.info("Setting Player track cache to:",e.trackCacheSize||2),this._bufferManager=gt.create(this._tracker,void 0,{disableBufferAbort:!!e.disableBufferAbort,reinjectInitsOnAbort:!!e.reinjectInitsOnAbort,noInit:!0,customSourceBufferParams:e.customSourceBufferParams,bufferTarget:e.bufferTarget}),this._statistics=at.create({bandwidthEstimator:this._abrManager}),this._newKeySystemAccessPerTrack=e.newKeySystemAccessPerTrack,this._loadingTimeout=e.loadingTimeout;const a=this._bufferManager.getBufferTarget();this._rebufferTarget={audio:Math.min(null!==(i=null===(n=e.rebufferTarget)||void 0===n?void 0:n.audio)&&void 0!==i?i:Bt.audio,a.audio),video:Math.min(null!==(r=null===(o=e.rebufferTarget)||void 0===o?void 0:o.video)&&void 0!==r?r:Bt.video,a.video)},this._audioProcessor=ct.create(e.audioProcessorOptions),this._preloadThreshold=e.preloadThreshold||10,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onTimeUpdate=this._onTimeUpdate.bind(this),this._onDurationChange=this._onDurationChange.bind(this),this._onPlay=this._onPlay.bind(this),this._onPlaying=this._onPlaying.bind(this),this._onPause=this._onPause.bind(this),this._onSeeking=this._onSeeking.bind(this),this._onEncrypted=this._onEncrypted.bind(this),this._onEnded=this._onEnded.bind(this),this._onError=this._onError.bind(this),this._onRequiresDuration=this._onRequiresDuration.bind(this),this._onQuotaExceeded=this._onQuotaExceeded.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),this._onWaiting=this._onWaiting.bind(this),this._onFragmentFetched=this._onFragmentFetched.bind(this),this._onProfileChanged=this._onProfileChanged.bind(this),this._onPlayedThresholdReached=this._onPlayedThresholdReached.bind(this),this._onSyntheticEnded=this._onSyntheticEnded.bind(this),this._onLicenseRequestCapped=this._onLicenseRequestCapped.bind(this),this._onLicenseRequestError=this._onLicenseRequestError.bind(this),this._onNavigatorOffline=this._onNavigatorOffline.bind(this),this._onBufferError=this._onBufferError.bind(this),this._onBufferUpdateEnd=this._onBufferUpdateEnd.bind(this),this._emitWarning=this._emitWarning.bind(this),this._handleLoadingComplete=this._handleLoadingComplete.bind(this),this._onRateChange=this._onRateChange.bind(this),this._onVideoResize=this._onVideoResize.bind(this),this._setAudioGain=this._setAudioGain.bind(this),this._init(),this._getCacheKey=this._getCacheKey.bind(this)}static create(e){const t=Object.assign({},e);return e.disallowProtectedTracks?Wt.createWithOptions(t):we.create({transport:e.transport,disallowRobustnessValues:e.disallowRobustnessValues,disallowCodecs:e.disallowCodecs,noServerCertificate:e.noServerCertificate,precacheServerCertificate:e.precacheServerCertificate,unauthServerCertificateBase:e.unauthServerCertificateBase,preferredKeySystems:e.preferredKeySystems}).then((e=>{t.emeManager=e;const n=new Wt(t);return t.preinitMediaElement?n._preinitMediaElement():n})).catch((n=>{if(e.enableWithoutEME)return Wt.createWithOptions(t);throw n}))}static createWithOptions(e){return new Promise((t=>{const n=new Wt(e);t(e.preinitMediaElement?n._preinitMediaElement():n)}))}_init(){this._disableCache&&xt.info("Cache disabled."),this._transport.on(this._transport.EVENT_CONNECTION_OFFLINE,this._onNavigatorOffline),this.proxyEmitAllSync(this._tracker,{[Q.TRACKER_TRACKING_DATA_CREATED]:Q.PLAYER_TRACKING_DATA_CREATED,[Q.TRACKER_TRACKING_DATA_FINALIZED]:Q.PLAYER_TRACKING_DATA_FINALIZED,[Q.TRACKER_PLAYBACK_START]:Q.PLAYER_PLAYBACK_START}),this._tracker.on(Q.TRACKER_PLAYED_THRESHOLD_REACHED,this._onPlayedThresholdReached),this._emeManager&&this._emeManager.addListeners({[Q.EME_LICENSE_REQUEST_CAPPED]:this._onLicenseRequestCapped,[Q.EME_LICENSE_REQUEST_ERROR]:this._onLicenseRequestError}),this._bufferManager.addListeners({[Q.BUFFER_APPEND_ERROR]:this._onBufferError,[Q.BUFFER_QUOTA_EXCEEDED]:this._onQuotaExceeded,[Q.BUFFER_UPDATE_END]:this._onBufferUpdateEnd}),this._mediator.addListeners({[J.FRAGMENT_FETCHED]:this._onFragmentFetched,[J.VIDEO_PROFILE_CHANGED]:this._onProfileChanged}),this.proxyEmitAll(this._mediator,{[J.FRAGMENT_FETCH_ERROR]:Q.PLAYER_FRAGMENT_FETCH_ERROR}),this.proxyEmitSync(this._subtitleManager,Q.PLAYER_DISPLAYED_CUES_CHANGED,Q.PLAYER_DISPLAYED_CUES_CHANGED),this.proxyEmit(this._subtitleManager,Q.PLAYER_SUBTITLE_LANGUAGES_LOADED,Q.PLAYER_SUBTITLE_LANGUAGES_LOADED),this.proxyEmitAll(this._videoResolver,{[Q.VIDEO_MANIFEST_RESOLVED]:Q.PLAYER_VIDEO_MANIFEST_RESOLVED,[Q.VIDEO_MANIFEST_RESOLVE_FAILED]:Q.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED}),this._tracker.addListeners({[Q.TRACKER_FIRST_QUARTILE]:()=>this._emitReporting("first_quartile"),[Q.TRACKER_MIDPOINT]:()=>this._emitReporting("midpoint"),[Q.TRACKER_THIRD_QUARTILE]:()=>this._emitReporting("third_quartile")}),this.addListeners({[Q.PLAYER_PLAYBACK_START]:()=>{this._emitReporting("start"),this._emitReporting("creative_view")},[Q.PLAYER_ENDED]:()=>this._emitReporting("complete"),[Q.PLAYER_ERROR]:()=>this._emitReporting("error")}),this._initialBandwidthSampler.sample().catch((()=>{}))}_onRateChange(){if(!this._player)return;const e=this._player.playbackRate;0!==e&&this._tracker.trackSpeedChanged(e),this.emit(Q.PLAYER_PLAYBACK_SPEED_CHANGED,{playback_speed:e,playback_speed_selected:this._playerSpeed,rebuffering:this._rebuffering})}_onLicenseRequestError(e){if(e.data.signal.aborted)return;const t=this._currentContent;if(!t)return;const n=e.data.error,i=t.getKeySystem();n.shouldRefreshEndpoint&&i&&this._licenseURLResolver.remove(i,t.getMediaType()),this._emitError(n,!n.unrecoverable,t.toLogJSON())}_onFragmentFetched(e){const{data:t}=e;this._tracker.trackFragment(t),this.emit(Q.PLAYER_FRAGMENT_FETCHED,t)}_onProfileChanged(e){const{data:t}=e;this._tracker.trackProfileChanged(t.profile),this.emit(Q.PLAYER_VIDEO_PROFILE_CHANGED,t)}_defaultPlayerContainerInjector(e,t){const n=this._getContainerElement("video"===t?this._videoPlayerContainer:this._audioPlayerContainer);n&&e.parentNode!==n&&(n.appendChild(e),"video"===t&&this.emit(Q.PLAYER_VIDEO_ELEMENT_APPENDED,null))}_defaultPlayerContainerEjector(e,t,n){const i=this._getContainerElement("video"===t?this._videoPlayerContainer:this._audioPlayerContainer);i&&e.parentNode===i&&(this._newElementPerTrack||n!==t)&&(i.removeChild(e),"video"===t&&(this._subtitleManager.setPlayer(null),this.emit(Q.PLAYER_VIDEO_ELEMENT_REMOVED,null)))}_onLicenseRequestCapped(e){if(e.data.signal.aborted)return;this._currentContent&&(this.pause(),this.emit(Q.PLAYER_CAPPED,null))}_shouldNextErrorBeFatal(){const e=this._currentContent;if(!e)return!1;if(e.hasNonFatalErrors()||!e.isProtected())return!1;if(!this._player)return!1;const t=this._player.error;if(!(t&&t instanceof MediaError))return this._fatalOnNextError=!1,!1;switch(t.code){case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:case MediaError.MEDIA_ERR_DECODE:return!0;default:return!1}}_onNavigatorOffline(){this._tracker.trackNavigatorOffline()}_onBufferError(e){this._emitError(e.data.error,e.data.canPlayNext,e.data.track)}_onBufferUpdateEnd(){var e;this._setRebufferingState(!0),this._rebuffering&&this._player&&(null===(e=this._currentContent)||void 0===e?void 0:e.strategy)===Z.MSE&&this._bufferManager.checkBufferHealth(this._currentContent,this._player.currentTime)}_addPlayerEvents(e){e.addEventListener(Q.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.addEventListener(Q.MEDIA_PLAY,this._onPlay),e.addEventListener(Q.MEDIA_PLAYING,this._onPlaying),e.addEventListener(Q.MEDIA_PAUSE,this._onPause),e.addEventListener(Q.MEDIA_SEEKING,this._onSeeking),e.addEventListener(Q.MEDIA_ENCRYPTED,this._onEncrypted),e.addEventListener(Q.MEDIA_ENDED,this._onEnded),e.addEventListener(Q.MEDIA_ERROR,this._onError),e.addEventListener(Q.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.addEventListener(Q.MEDIA_DURATIONCHANGE,this._onDurationChange),e.addEventListener(Q.MEDIA_WAITING,this._onWaiting),e.addEventListener(Q.MEDIA_CANPLAY,this._onCanPlay),e.addEventListener(Q.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.addEventListener(Q.MEDIA_RATECHANGE,this._onRateChange),e.addEventListener(Q.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.addEventListener(Q.MEDIA_RESIZE,this._onVideoResize)}_removePlayerEvents(e){e.removeEventListener(Q.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.removeEventListener(Q.MEDIA_PLAY,this._onPlay),e.removeEventListener(Q.MEDIA_PLAYING,this._onPlaying),e.removeEventListener(Q.MEDIA_PAUSE,this._onPause),e.removeEventListener(Q.MEDIA_SEEKING,this._onSeeking),e.removeEventListener(Q.MEDIA_ENCRYPTED,this._onEncrypted),e.removeEventListener(Q.MEDIA_ENDED,this._onEnded),e.removeEventListener(Q.MEDIA_ERROR,this._onError),e.removeEventListener(Q.MEDIA_WAITING,this._onWaiting),e.removeEventListener(Q.MEDIA_CANPLAY,this._onCanPlay),e.removeEventListener(Q.MEDIA_RATECHANGE,this._onRateChange),e.removeEventListener(Q.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.removeEventListener(Q.MEDIA_DURATIONCHANGE,this._onDurationChange),e.removeEventListener(Q.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.removeEventListener(Q.MEDIA_RESIZE,this._onVideoResize)}_recreateMediaElement(e,t,n,i){var o,r,a;if(i.aborted)return xt.info("Recreate player dropped: operation aborted."),Promise.resolve(null);const s=this._player;let c=Promise.resolve(null);if(s){const i=!this._newElementPerTrack&&!("AUDIO"===s.tagName&&"video"===t)&&!(s===this._audioProcessor.getPlayer()&&!(null===(o=this._upcomingContent)||void 0===o?void 0:o.isProtected()))&&function(e,t){let n=!0;return Object.keys(t).forEach((i=>{const o=t[i];'audio/mp2t;codecs="mp4a.40.2"'!==o&&o&&!e.canPlayType(o)&&(n=!1)})),n}(s,e);if(i){xt.info("Reusing media element.");return(!(e.audio===this._activeMimeTypes.audio&&e.video===this._activeMimeTypes.video)||this._newBufferPerTrack)&&n===Z.MSE&&(xt.info("Recreating buffer."),this._bufferManager.recreate(e),this._activeMimeTypes=e),Promise.resolve({player:s,mediaKeys:s.mediaKeys})}this._removePlayerEvents(s),s.pause(),c=this._cleanMediaKeys(s),this._player=null,null===(r=this._playerContainerManager)||void 0===r||r.eject(s,"video"),null===(a=this._playerContainerManager)||void 0===a||a.eject(s,"audio")}xt.info(`Creating new media element for media type ${t}.`);const l=this._createPlayer(t),u=this._playerVolume;return l.volume=this._cubicVolume?Math.pow(u,3):u,l.autoplay=!1,l.loop=!1,"playsInline"in l&&(l.playsInline=!0),this._player=l,this._playerActivated=!1,this._addPlayerEvents(l),n===Z.MSE&&this._bufferManager.recreate(e),this._activeMimeTypes=e,c.then((e=>({player:l,mediaKeys:e})))}_getContainerElement(e){var t;if("string"==typeof e){const n=document.querySelector(e);if(n)return n;const o=new ne(i.PLAYER_CONTAINER_ELEMENT_NOT_FOUND,"Container element was not found in the DOM");return o.listPlayerIgnore=!0,this._emitWarning(o,null===(t=this._currentContent)||void 0===t?void 0:t.toLogJSON()),null}return e||null}_onVideoResize(){if(!(this._player instanceof HTMLVideoElement))return;const{videoWidth:e,videoHeight:t}=this._player;this.emit(Q.PLAYER_VIDEO_RESIZED,{width:e,height:t})}_onDurationChange(){var e;const t=null===(e=this._abortController)||void 0===e?void 0:e.signal,n=()=>{if(!this._player)return;if(null==t?void 0:t.aborted)return void xt.info("Duration changed drop: operation aborted.");const e=Ht(this._player.duration),n=Ht(this._player.currentTime);this._tracker.setActualDuration(e),this.emit(Q.PLAYER_DURATION_CHANGED,{timestamp:Date.now(),position:n,duration:e})};this._loaded?n():this.once(Q.PLAYER_LOAD,n)}_onPlay(){var e;if(!this._player||!this._currentContent)return;const t=Ht(this._player.currentTime);this._tracker.trackPlay(t,this._player.playbackRate),this.emit(Q.PLAYER_PLAY,{timestamp:Date.now(),position:t,logData:null!==(e=this._currentContent.getLogData())&&void 0!==e?e:null})}_onPlaying(){if(!this._player)return;this._playerActivated=!0;const e=this._currentContent,t=Ht(this._player.currentTime);this._tracker.trackPlaying(t),this.emit(Q.PLAYER_PLAYING,{timestamp:Date.now(),position:t,logData:e?e.getLogData():null})}_onPause(){var e;if(!this._player)return;const t=Ht(this._player.currentTime);this._tracker.trackPaused(t);const n=this._currentContent?this._currentContent.getLogData():null;this._pauseToken=setTimeout((()=>{clearTimeout(this._syntheticEndedToken),this.emit(Q.PLAYER_PAUSED,{position:t,logData:n})}),10),this._player&&(null===(e=this._currentContent)||void 0===e?void 0:e.strategy)===Z.MSE&&this._bufferManager.checkBufferHealth(this._currentContent,this._player.currentTime)}_onSeeking(){var e;this.emit(Q.PLAYER_SEEKING,null),this._setRebufferingState(),(null===(e=this._currentContent)||void 0===e?void 0:e.strategy)===Z.MSE&&this._player&&!this._bufferManager.isPositionInCurrentFillRange(this._currentContent,this._player.currentTime)&&(xt.log("Aborting buffer operations."),this._bufferManager.abort(this._clearBufferOnSeek)),this._lastTimeUpdatePostion=0,this._onTimeUpdate()}_onRequiresDuration(){this._currentContent&&this._currentContent.isProtected()&&this._player&&(this._player.duration=this._currentContent.getCalculatedDuration())}_onQuotaExceeded(){this._player&&this._rebufferOnQuotaExceeded&&(xt.info("Exceeded quota: rebuffering current track."),this._bufferManager.abort(!0),this._player.currentTime=this._player.currentTime,this._onTimeUpdate())}_onEncrypted(e){xt.info("Got Encrypted event");this._currentContent&&this.emitSync(Q.INTERNAL_ENCRYPTED,{initData:e.initData,fromPolyfill:!!e.fromPolyfill})}_onEnded(){!this._currentContent||this._synthesizeEnded&&this._currentContent.isProtected()||(xt.info("Native ended emitted."),this._emitEnded())}_onSyntheticEnded(){this._synthesizeEnded&&this._currentContent&&this._currentContent.isProtected()&&(xt.info("Synthetic ended emitted."),this._emitEnded())}_onError(){if(!this._player)return;const e=this._player.error;let t,n=!1;const o=this._currentContent;let r,a,s,c=!1;o&&(n=o.isProtected(),t=o.toLogJSON(),c=o.hasNonFatalErrors(),o.unload());let l=!0;const u=!o||c||!this._fatalOnNextError,d=e&&e.msExtendedCode?`0x${(e.msExtendedCode>>>0).toString(16).toUpperCase()}`:null,p=`data:${(null==t?void 0:t.fileId)||"unknown"}`;if(e instanceof MediaError){switch(e.code){case MediaError.MEDIA_ERR_ABORTED:r=i.MEDIA_ABORTED,a="Media aborted.";break;case MediaError.MEDIA_ERR_NETWORK:r=i.MEDIA_NETWORK_ERROR,a="Network error.";break;case MediaError.MEDIA_ERR_DECODE:r=i.MEDIA_DECODING_ERROR,a="Media decoding error.",l=u;break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:r=i.MEDIA_NOT_SUPPORTED,a="Media not supported.",l=u;break;default:r=i.PLAYER_MEDIA_ERROR,a="Media error.",s=!0}a+=` (${e.message||d||p||e.toString()})`}else r=i.PLAYER_PLAYBACK_ERROR,a="Error message undefined",s=!0;this._bufferManager.abort(!0);const f=new ne(r,a);l||(f.unrecoverable=!0),f.listPlayerIgnore=c,f.debug.src_url=p,f.debug.protected=n,f.debug.extendedCode=d,f.debug.rawExCode=e&&e.msExtendedCode||null,s&&e&&(f.debug.nativeCode=e.code||null,f.debug.errorData=e),this._emitError(f,l,t)}_onLoadedMetadata(){this.emitSync(Q.INTERNAL_PLAYER_LOADED_METADATA,null)}_onCanPlay(){this._setRebufferingState(),this.emitSync(Q.INTERNAL_PLAYER_CANPLAY,null),this.emit(Q.PLAYER_FIRST_BYTES,null)}_onCanPlayThrough(){this._setRebufferingState(),this.emitSync(Q.INTERNAL_PLAYER_CANPLAYTHROUGH,null)}_onWaiting(){var e;clearTimeout(this._syntheticEndedToken);const t=this._player;if(!t||!this._currentContent)return;const n=t.seeking;this._setRebufferingState();const i=!!ot(this._currentContent)&&this._currentContent.canLowerBitrate(),o=this._tracker;this.emit(Q.PLAYER_BUFFERING_START,Object.assign({position:Ht(t.currentTime),msPlayed:this._tracker.getMSPlayed(),canLowerBitrate:i,seeking:n},o.getStallsInformation()));const r=null===(e=this._abortController)||void 0===e?void 0:e.signal;this._getRebufferingLatency().then((e=>{(null==r?void 0:r.aborted)||(n||this._tracker.trackMsStalled(e),this.emit(Q.PLAYER_BUFFERING_END,Object.assign({position:Ht(t.currentTime),msPlayed:this._tracker.getMSPlayed(),canLowerBitrate:i,msStalled:e,seeking:n},o.getStallsInformation())))}))}_onPlayedThresholdReached(e){this._currentContent&&this._player&&this.emit(Q.PLAYER_PLAYED_THRESHOLD_REACHED,{played:e.data.played,threshold:e.data.threshold,position:Ht(this._player.currentTime)})}_emitEnded(){this._currentContent&&"video"===this._currentContent.getMediaType()&&this.emit(Q.PLAYER_ENDED_VIDEO,null),clearTimeout(this._pauseToken),this.emit(Q.PLAYER_ENDED,null)}_emitError(e,t,n){xt.error("Player Error",e,n,t),this._tracker.setHadError(!0),!this._disableCache&&n&&n.fileId&&this._cache.remove(n.fileId),this.emit(Q.PLAYER_ERROR,{playId:this._playId,error:e,track:n,canPlayNext:t,position:this._player?Ht(this._player.currentTime):0})}_emitWarning(e,t){xt.error("Player Warning",e,t,!0),this._tracker.trackWarning(),this.emit(Q.PLAYER_WARNING,{playId:this._playId,error:e,track:t,canPlayNext:!0,position:this._player?Ht(this._player.currentTime):0})}_emitReporting(e){if(!rt(this._currentContent))return;const t=this._currentContent.getTrackingEventData(e);t&&0!==t.urls.length&&this.emitAndWait(Ft[e],t,(e=>{if(!e.defaultPrevented)for(const e of t.urls)this._transport.request(e,{forget:!0})}))}_prepareMediaElement(e,t){if(t.aborted||!this._upcomingContent)return xt.info("Loading content dropped: operation aborted."),Promise.resolve(!1);const n=this._upcomingContent.getMediaTypeMimeTypes();return this._recreateMediaElement(n,this._upcomingContent.getMediaType(),this._upcomingContent.strategy,t).then((n=>{var i;if(!n||t.aborted)return xt.info("Loading content dropped after recreate: operation aborted."),Promise.resolve(!1);const{player:o,mediaKeys:r}=n;if("VIDEO"===o.tagName&&(e.poster?o.poster=e.poster:o.removeAttribute("poster")),!this._emeManager||!(null===(i=this._upcomingContent)||void 0===i?void 0:i.isProtected()))return Promise.resolve(!0);const a=e=>{var t;return e.unrecoverable=!0,this._emitError(e,!1,null===(t=this._upcomingContent)||void 0===t?void 0:t.toLogJSON()),Promise.reject(e)};return!r||this._newMediaKeysPerTrack||void 0===this._newMediaKeysPerTrack&&!o.mediaKeys||(null==r?void 0:r.shouldRefreshPerTrack)?(xt.info("Creating media keys"),this._emeManager.createMediaKeys(o).then((()=>!0),a)):o.mediaKeys!==r?(xt.info("Reusing previous media keys"),this._emeManager.setMediaKeys(o,r).then((()=>!0),a)):Promise.resolve(!0)}))}_isRebufferingTargetReached(){var e;const t=this._player,n=this._currentContent;if(!t||!n)return!1;if(n.strategy!==Z.MSE)return!0;const i=null!==(e=this._rebufferTarget[n.getMediaType()])&&void 0!==e?e:0;if(!i)return!0;const o=Math.max(t.currentTime,1),r=Math.min(i,Math.floor(t.duration-o)),a=t.buffered;for(let e=0,t=a.length;e{e.aborted||(null==t||t.abort(),this._emitError(r,!0))}),o):void 0}_handleLoadingComplete(e,t){var n;clearTimeout(t);const i=this._currentContent&&this._currentContent.getMediaType();return this._player&&i&&(null===(n=this._playerContainerManager)||void 0===n||n.inject(this._player,i)),this._upcomingContent=null,e}_handleLoadingError(e,t,n,i,o){if(clearTimeout(i),this._upcomingContent=null,n.aborted)return Promise.resolve(!1);if(this._tracker.trackLoadFailed(),this.emit(Q.PLAYER_LOADING_FAILED,{uri:e,logData:t.logData}),o){const n=o.track||{uri:e,fileId:t.fileId,mediaFormat:t.format,deviceId:t.logData.deviceId};this._emitError(o,"StorageError"!==o.name||!!o.canPlayNext,n)}return Promise.reject(o)}_handleLoadedMetadata(e,t,n){if(e.aborted)return void xt.info("LoadedMetadata operations dropped: operation aborted.");this._loaded=!0;const i=this._player;if(!i)return;this._setRebufferingState(),this._bufferManager.dequeueUpdates();const o=n.position>i.duration?0:n.position;this._lastTimeUpdatePostion=0,(isNaN(i.currentTime)||i.currentTime{this._onTimeUpdate()}));let r=()=>{i.currentTime{if(i.currentTimethis._audioProcessor.resume().then((()=>e(this._player&&this._player.play()))))).catch((e=>{if(e){if("NotSupportedError"===e.name)return Promise.reject(e);if("NotAllowedError"===e.name)return this.emit(Q.PLAYER_AUTOPLAY_FAILED,null),Promise.reject(e)}return this._player?this._player.play():Promise.resolve()})).catch((()=>{this._onPause()}))}),i.readyState>2?(xt.info("Ready to play, triggering play."),r()):(xt.info("Waiting to be playable."),this.once(Q.INTERNAL_PLAYER_CANPLAY,r))}_handleCanPlayThrough(e){e.aborted?xt.info("CanPlayThrough operations dropped: operation aborted."):this._tracker.trackCanPlayThrough()}_loadContent(e,t){if(t.aborted||!this._upcomingContent)return xt.info("Loading content dropped: operation aborted."),Promise.resolve(!1);if(!this._player)throw new ne(i.PLAYER_INVALID_INTERNAL_STATE,"Cannot load content without an HTMLMediaElement");this._canPreloadEmitted=!1;const n=this._upcomingContent;this._upcomingContent=null,this._currentContent=n,this._setAudioGain(n),this._subtitleManager.setVideoContent(function(e){return!!e&&"getSubtitles"in e&&"getSubtitleLanguages"in e}(n)?n:null);const o=e.callback;o&&this.once(Q.PLAYER_LOAD,(()=>{t.aborted?xt.info("Load content event dropped: operation aborted."):o()})),this.once(Q.INTERNAL_PLAYER_LOADED_METADATA,this._handleLoadedMetadata.bind(this,t,this._currentContent.getLogData(),e)),this.once(Q.INTERNAL_PLAYER_CANPLAYTHROUGH,this._handleCanPlayThrough.bind(this,t));let r=e.position;const a="getCalculatedDuration"in n?n.getCalculatedDuration():1/0;a&&r>a&&(r=e.position=0);try{this._player.currentTime=r}catch(e){xt.warn("Cannot set initial position before loading.",e)}const s=e.playbackSpeed;return!e.useDefaultPlaybackSpeed&&s&&this.setPlaybackSpeed(s),this._tracker.setProtected(n.isProtected()),xt.info(`Detecting strategy for ${n.constructor.name}`),n.strategy===Z.MSE?this._loadMSEContent(n,e,t):this._loadURLContent(n,e,t)}_loadURLContent(e,t,n){var o,r,a;if(!this._player||!e)return Promise.reject(new ne(i.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));xt.info("Loading URL content.");const s=e.getURL();if(!s)return Promise.reject(new ne(i.PLAYER_INVALID_INTERNAL_STATE,"Content not loaded."));if(e.isProtected()){xt.info("URL content is protected");const e=t=>{t.data.fromPolyfill&&(this.removeListener(Q.INTERNAL_ENCRYPTED,e),this._requestLicense(n,{initData:t.data.initData}))};this.on(Q.INTERNAL_ENCRYPTED,e)}if("video"===e.getMediaType()&&it(e)){const t=e.getMediaProfileInfo();this._tracker.trackVideoLoadStart({bitrate:null===(o=t.video.selected)||void 0===o?void 0:o.video_bitrate,audioProfile:null!==(r=t.audio.selected)&&void 0!==r?r:void 0,videoProfile:null!==(a=t.video.selected)&&void 0!==a?a:void 0})}this._tracker.trackBufferLoadStart(),this._tracker.trackBufferURL(s,{bandwidth:0});const c=e.getLoadingApproach();if("src"===c.approach)xt.info("URL content loaded using src attribute"),this._player.src=s;else{xt.info("URL content loaded using source element");const e=document.createElement("source");e.src=s,e.type=c.type,this._player.appendChild(e)}return this._player.load(),Promise.resolve(!0)}_loadMSEContent(e,t,n){var o,r,a;if(!this._player||!e)return Promise.reject(new ne(i.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));if(xt.info(`Loading MSE Content: ${e.getFileId()}`),e.isProtected()){xt.log("MSE content is protected");const e=()=>this._requestLicense(n).then((()=>{n.aborted||(this._licenseRequested=!0,this._disableBufferingBeforeLicense&&this._onTimeUpdate())}));this._disableLicensePrefetch?this.once(Q.INTERNAL_ENCRYPTED,e):this._bufferManager.once(Q.BUFFER_SOURCE_OPEN,e)}const s=this._bufferManager,c=s.getMediaSource();if(!c)return Promise.reject(new ne(i.PLAYER_INVALID_INTERNAL_STATE,"No media source."));if("video"===e.getMediaType()&&it(e)){const t=e.getMediaProfileInfo();this._tracker.trackVideoLoadStart({bitrate:null===(o=t.video.selected)||void 0===o?void 0:o.video_bitrate,audioProfile:null!==(r=t.audio.selected)&&void 0!==r?r:void 0,videoProfile:null!==(a=t.video.selected)&&void 0!==a?a:void 0})}return this._player.src=URL.createObjectURL(c),this._setPlaybackRate(),new Promise(((i,o)=>{s.once(Q.BUFFER_SOURCE_OPEN,(()=>{this._tracker.trackBufferLoadStart(),this._getRebufferingLatency().then((e=>{n.aborted||this._tracker.trackInitialRebuffering(e)}));("video"===e.getMediaType()?s.setDuration(e.getCalculatedDuration()):Promise.resolve(!0)).then((()=>e.isProtected()&&this._disableBufferingBeforeLicense?s.injectInitSegment(e):(this._bufferManager.checkBufferHealth(e,t.position,!0),!0))).then(i,o)}))}))}_getRebufferingLatency(){return new Promise((e=>{if(!this._player)return void e(0);const t=Date.now();this.once(Q.PLAYER_REBUFFERING_END,(()=>{e(Date.now()-t)}))}))}_requestLicense(e,t={}){if(e.aborted){const e="Request license dropped: operation aborted.";return xt.info(e),Promise.resolve(!1)}if(!this._player||!this._currentContent||!this._emeManager)return Promise.resolve(!1);const n=Date.now(),i=this._player.mediaKeys,o=this._currentContent,r=o.getFileId(),a=o.getLogData(),s=o.toLogJSON(),c=o.getKeySystem();if(!c)return Promise.resolve(!1);const l=o.getLicenseEndpoint();let u;if(l)u=Promise.resolve(l);else{if(!r)return Promise.reject(new TypeError("Missing: fileId or licenseEndpoint"));u=this._licenseURLResolver.get(c,o.getMediaType()).then((e=>e.replace(/\{contentId\}/,r)))}const d=this._emeManager,p=this._tracker;return p.setKeySystem(c),p.setKeySystemImpl(d.getKeySystemImpl()),Promise.all([u,o.getInitParams()]).then((([o,r])=>{if(!r)return Promise.resolve(!1);p.setLicenseSessionLatency(Date.now()-n);const a=r.initDataType,s=t.initData||r.initData;if(i&&s&&a){const t={keySystem:c,signal:e,initData:s,mediaKeys:i,licenseServer:o,initDataType:a};return d.createSessionWithParams(t)}return Promise.resolve(!1)})).then((t=>{if(e.aborted)return xt.info("License tracking dropped: operation aborted."),Promise.resolve(!1);"boolean"!=typeof t&&"elapsed"in t&&(p.setLicenseGenerationLatency(t.elapsed.generate),p.setLicenseRequestLatency(t.elapsed.request),p.setLicenseUpdateLatency(t.elapsed.update));const i=Date.now()-n;return p.setKeyLatency(i),this.emit(Q.PLAYER_KEY_RECEIVED,{requestTime:i,logData:a}),xt.info("License updated."),Promise.resolve(!0)})).catch((t=>{if(e.aborted)return Promise.resolve(!1);const n=!t||!("canPlayNext"in t)||t.canPlayNext;return this._emitError(t,!!n,s),Promise.reject(t)}))}_onTimeUpdate(){var e;if(!this._loaded||!(null===(e=this._player)||void 0===e?void 0:e.readyState)||!this._currentContent)return;const t=this._currentContent,n=this._player.seeking,i=this._player.currentTime;if(t.isProtected()&&this._disableBufferingBeforeLicense&&!this._licenseRequested)return void xt.log("Dropping time update event: buffering before license disabled.");if(!n&&this._lastTimeUpdatePostion&&this._lastTimeUpdatePostion===i)return void xt.warn("Dropping duplicate time update.");this._lastTimeUpdatePostion=n?0:i,t.strategy===Z.MSE&&this._bufferManager.checkBufferHealth(t,i,n);const o=this._player.duration,r=Ht(i),a=t.getLogData();n?(this._tracker.trackPositionChanged(r),this.emit(Q.PLAYER_POSITION_CHANGED,{position:r,logData:a})):(this._tracker.trackProgress(r,ot(t)?t.getCurrentBitrates().video:0),this.emit(Q.PLAYER_PROGRESS,{timestamp:Date.now(),position:r,played:this._tracker.getMSPlayed(),interval:500,logData:a}));const s=o-i<=this._preloadThreshold;!this._canPreloadEmitted&&s?(this._canPreloadEmitted=!0,this.emit(Q.PLAYER_CAN_PRELOAD,null)):this._canPreloadEmitted&&!s&&(this._canPreloadEmitted=!1),clearTimeout(this._syntheticEndedToken),this._synthesizeEnded&&t.isProtected()&&this._isPlaying()&&(this._syntheticEndedToken=setTimeout(this._onSyntheticEnded,Ht(o-i)))}_isPlaying(){return!!this._player&&!this._player.paused}_cleanMediaKeys(e,t=this._emeManager){return t?t.removeMediaKeys(e).catch((e=>(xt.warn("Failed to remove current media keys.",e),null))):Promise.resolve(null)}_checkKeySystemAccess(){if(!this._newKeySystemAccessPerTrack||!this._player||!this._emeManager)return Promise.resolve();const e=this._player,t=this._emeManager;return this._cleanMediaKeys(e,t).then((()=>t.requestMediaKeySystemAccess())).then((()=>{})).catch((e=>(xt.warn("Failed to request new media key system access.",e),Promise.reject(e))))}_createContent(e,t={manifestLatency:0,resolveLatency:0},n=!1){return(this._emeManager?this._emeManager.getKeySystemInfo():this.getMediaConfig().then((e=>({keySystem:$.INVALID_SPOTIFY_KEY,audioFormats:e.formatsInfo.audio,videoFormats:e.formatsInfo.video})))).then((n=>function(e,t){var n,o,r;const a=wt(e,t);switch(e.format){case te.MP3:{const o=null!==(n=e.url)&&void 0!==n?n:e.resolvedURL;return o?new _t(Object.assign(Object.assign({},a),{url:o})).load():e.fileId?new Pt(Object.assign(Object.assign({},a),{fileId:e.fileId,resolver:t.audioResolver})).load():Promise.reject(new ne(i.INVALID_TRACK,`Invalid ${e.format} Track: No url or fileId.`))}case te.GENERIC_MEDIA:{const t=null!==(o=e.url)&&void 0!==o?o:e.resolvedURL;return t?new _t(Object.assign(Object.assign({},a),{url:t})).load():Promise.reject(new ne(i.INVALID_TRACK,`Invalid ${e.format} Track: No url.`))}case te.MP4:case te.MP4_DUAL:case te.MP4_CBCS:case te.MP4_FLAC:{if(!e.fileId)return Promise.reject(new ne(i.INVALID_TRACK,`Invalid ${e.format} Track: No fileId.`));const n=Object.assign(Object.assign({},a),{transport:t.transport,abrManager:t.abrManager,fileId:e.fileId,keySystemSettings:Te[t.keySystem],resolver:t.audioResolver,fileFormat:e.fileFormat,preloadedManifest:e.preloadedManifest,preresolvedURL:null!==(r=e.url)&&void 0!==r?r:e.resolvedURL});return t.keySystem===$.FAIRPLAY?new It(n).load(t.measures):new Nt(n).load(t.measures)}case te.MANIFEST_ID:return Mt(e,t);case te.AD_MANIFEST:{if(!e.url)return Promise.reject(new ne(i.INVALID_TRACK,`Invalid ${e.format} Track: No url.`));const n=Object.assign(Object.assign({},a),{abrManager:t.abrManager,transport:t.transport,manifestURL:e.url,preloadedManifest:e.preloadedManifest});return new Dt(n).load(t.measures).then((n=>{const i=n.getManifestId();if(!i)return n;const o=Object.assign(Object.assign({},e),{fileId:i,format:te.MANIFEST_ID}),r={trackingData:n.getTrackingEvents(),metadata:n.getContentMetadata()};return Mt(o,t,r)}))}default:return Promise.reject(new ne(i.INVALID_TRACK,"Cannot create PlayableContent: Invalid MediaFormat."))}}(e,{transport:this._transport,abrManager:this._abrManager,supportedFormats:{audio:n.audioFormats,video:n.videoFormats},mediator:this._mediator,keySystem:n.keySystem,audioResolver:this._audioResolver,videoResolver:this._videoResolver,disableCache:this._disableCache,disallowProfile:this._disallowProfile,allowMixedAVC1Codecs:this._allowMixedAVC1Codecs,measures:t}))).then((i=>{if(n)return i;const o=this._tracker;o.setResolveLatency(t.resolveLatency),o.setManifestLatency(t.manifestLatency);const r=this._getCacheKey(e);return r&&this._cache.set(r,i),i}))}_preinitMediaElement(){if(this._player||!this._emeManager)return Promise.resolve(this);const e=(0,a.createAbortControllerLike)();return this._emeManager.getKeySystemInfo().then((t=>{var n,i;const o={audio:null===(n=t.audioFormats[0])||void 0===n?void 0:n.contentType,video:null===(i=t.videoFormats[0])||void 0===i?void 0:i.contentType};return o.audio||o.video?this._recreateMediaElement(o,o.video?"video":"audio",t.keySystem===$.FAIRPLAY?Z.URL:Z.MSE,e.signal):null})).then((()=>this),(e=>(xt.warn("Cannot precreate media element:",null==e?void 0:e.message),this)))}_setAudioGain(e){var t;null===(t=this._audioProcessor)||void 0===t||t.setAudioGain(e.getAudioGain())}_getCacheKey({fileId:e,url:t,format:n}){var i;const o=null!==(i=null!=e?e:t)&&void 0!==i?i:null;return!this._disableCache&&Vt[n]?o:null}_getContentPromise(e,t){const n=this._cache,i=this._getCacheKey(e);if(i){const o=this._preloadingTracks[i],r=n.get(i);if(o)return xt.info("Waiting for preloading track.",i),o.then((e=>(xt.info("Preloading succeeded.",i),t.setResolveLatency(e.resolveLatency),t.setManifestLatency(e.manifestLatency),n.get(i)))).catch((()=>(xt.info("Preloading failed, creating new track",i),this._createContent(e))));if(r)return this._newKeySystemAccessPerTrack&&this._emeManager?this._emeManager.getKeySystemInfo().then((({keySystem:n})=>n===r.getKeySystem()?(xt.info("Using cached track.",i,r),t.setMemoryCached(!0),r):(xt.info("Mismatched keysystem for cached track. Creating new track",i),this._createContent(e)))):(xt.info("Using cached track.",i,r),t.setMemoryCached(!0),Promise.resolve(r))}return xt.info("Creating new content",i),this._createContent(e)}getMediaSource(){return this._bufferManager.getMediaSource()}load(e,t,n){var o,r,s,c;const l=function(e,t){return null==t?void 0:t.hasOwnProperty(e)}(t.uriProperty,e)?t.uriProperty:"uri",u=e[l];if(xt.info("load",u),!u)return Promise.reject(new ne(i.PLAYER_CANNOT_FIND_PLAYABLE_URI,"Cannot find a playable URI."));if(!e.logData)return Promise.reject(new Error("Invalid track: logging info not specified"));this.stop(e.logData,e.mediaType),this._loaded=!1,this._licenseRequested=!1,this._rebuffering=!0,this._currentContent=null,this._subtitleManager.setVideoContent(null),this._preloadThreshold=t.preloadThreshold||this._preloadThreshold;const d=++this._playId;this._abortController=(0,a.createAbortControllerLike)();const p=this._abortController.signal,f=this._tracker;f.trackLoadStart(u,e.fileId,d.toString(),e.logData,e.metadata);const h=this._configureLoadingTimeout(p,this._abortController,t.loadingTimeout);void 0!==h&&p.addEventListener("abort",(()=>clearTimeout(h))),this.emit(Q.PLAYER_BEFORE_LOAD,{track:e,options:t,logData:e.logData,uri:u,timestamp:Date.now()}),this._bufferManager.setPlayId(d);const m=(null===(o=e.options)||void 0===o?void 0:o.useDefaultPlaybackSpeed)?1:null!==(s=null===(r=e.options)||void 0===r?void 0:r.playbackSpeed)&&void 0!==s?s:this._playerSpeed;return this._loadingOptions={position:Gt(t.position||0),autoplay:!("autoplay"in t)||t.autoplay,poster:e.poster,useDefaultPlaybackSpeed:!!(null===(c=e.options)||void 0===c?void 0:c.useDefaultPlaybackSpeed),playbackSpeed:m,callback:n},f.setPlayIntended(this._loadingOptions.autoplay),f.setPlayedThreshold(t.playedThreshold),this._checkKeySystemAccess().then((()=>this._getContentPromise(e,f))).then((t=>{if(f.trackStrategy(t.strategy),t.isProtected()&&!this._emeManager)throw new ne(i.DISALLOW_PROTECTED_TRACK_ERROR,"Protected tracks not supported");t.setLogData(e.logData),t.strategy===Z.MSE&&f.setCalculatedDuration(Ht(t.getCalculatedDuration())),this._upcomingContent=t})).then(this._prepareMediaElement.bind(this,this._loadingOptions,p)).then((()=>{var e;this._subtitleManager.setPlayer(this._player),(null===(e=this._upcomingContent)||void 0===e?void 0:e.isProtected())&&(xt.info("Attaching HTMLMediaElement to the audio processor"),this._audioProcessor.setPlayer(this._player))})).then(this._loadContent.bind(this,this._loadingOptions,p)).then((e=>this._handleLoadingComplete(e,h)),this._handleLoadingError.bind(this,u,e,p,h))}preload(e){const t=this._getCacheKey(e),n=this._cache;if(!t||n.get(t)||!this._emeManager)return Promise.resolve(null);const i=this._preloadingTracks,o=i[t];if(o)return o;xt.info("Preloading track",t);const r={manifestLatency:0,resolveLatency:0},a=this._createContent(e,r,!0).then((e=>{if(e.strategy!==Z.MSE)return e;const t=e.getSegmentForTime(0);return t?e.getBufferSetForSegment(t).then((()=>e)):e})).then((e=>(n.set(t,e),delete i[t],xt.info("Cached",t),r))).catch((e=>(delete i[t],xt.warn("Preloading error",e),this.emit(Q.PLAYER_PRELOADING_ERROR,{error:e,track:e.track||null,canPlayNext:!("canPlayNext"in e)||e.canPlayNext,preloading:!0}),Promise.reject(e))));return i[t]=a,a}togglePlay(){return this._isPlaying()?this.pause():this.resume()}setSubtitleLanguage(e){this._subtitleManager.setLanguage(e)}getSubtitleLanguages(){return this._subtitleManager.getAvailableLanguages()}getActiveSubtitleLanguage(){return this._subtitleManager.getActiveLanguage()}deactivateCueEvents(){this._subtitleManager.deactivateListeners()}activateCueEvents(){this._subtitleManager.activateListeners()}setVolume(e,t){if(!this.emitSync(Q.PLAYER_BEFORE_VOLUME_CHANGE,{volume:e,options:t}).defaultPrevented){if(e<0||e>1)throw new ne(i.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE,"Volume should be in range [0, 1]");this._playerVolume=e,this._player&&(this._player.volume=this._cubicVolume?e*e*e:e)}}getVolume(){return this._playerVolume}getPlayerState(){var e,t,n;const i=this._player,o=this._currentContent,r={src:(null==i?void 0:i.src)?`data:${(null==o?void 0:o.getFileId())||"unknown"}`:void 0,height:(null==i?void 0:i.clientHeight)||0,width:(null==i?void 0:i.clientWidth)||0},a={};if(o){const e=o.getMediaTypeMimeTypes();a.audio_format=e.audio,a.video_format=e.video,"video"===o.getMediaType()&&i instanceof HTMLVideoElement&&(a.video_height=i.videoHeight,a.video_width=i.videoWidth,r.poster=i.poster)}let s=null;if(rt(o)){const e=o.getTrackingEvents();e&&(s={mute:e.mute,unmute:e.unmute,rewind:e.rewind,fullscreen:e.fullscreen,accept_invitation_linear:e.accept_invitation_linear,close_linear:e.close_linear,exit_fullscreen:e.exit_fullscreen})}return{playing:null!==(e=!(null==i?void 0:i.paused))&&void 0!==e&&e,position:i?Ht(i.currentTime):0,duration:i?Ht(i.duration):0,volume:null!==(t=this._playerVolume)&&void 0!==t?t:1,playback_speed:null!==(n=null==i?void 0:i.playbackRate)&&void 0!==n?n:0,playback_speed_selected:this._playerSpeed,buffering:this._rebuffering,media_type:(null==o?void 0:o.getMediaType())||null,media_info:a,player_element:r,content_metadata:(null==o?void 0:o.getContentMetadata())||{},tracking_data:s}}getPlayerPosition(){return this._player?Ht(this._player.currentTime):0}seek(e){var t;if(!this._player)return;const n=null===(t=this._abortController)||void 0===t?void 0:t.signal,i=()=>{if(!this._player||(null==n?void 0:n.aborted))return void xt.info("Seek dropped: operation aborted.");let t=Gt(e);t<0?t=0:t>=this._player.duration&&(t=this._player.duration),this._player.currentTime=t};this._loaded?i():this.once(Q.PLAYER_LOAD,i),this._getRebufferingLatency().then((e=>{(null==n?void 0:n.aborted)||this._tracker.trackSeekRebuffering(e)}))}pause(){return this._audioProcessor.suspend().then((()=>this._player&&this._isPlaying()?(this._emitReporting("pause"),Promise.resolve(this._player.pause())):Promise.resolve()))}resume(){return this._audioProcessor.resume().then((()=>this._player&&!this._isPlaying()?(this._emitReporting("resume"),Promise.resolve(this._player.play())):Promise.resolve()))}stop(e,t){var n,i,o;const r=[],a=e||{};this.emit(Q.PLAYER_BEFORE_STOP,{timestamp:Date.now(),logData:a}),null===(n=this._abortController)||void 0===n||n.abort(),this._tracker.trackStopped(this._player?Ht(this._player.currentTime):-1,e,this.getStatistics()||void 0),this._bufferManager.abort(!0),this._emeManager&&r.push(this._emeManager.destroySessions());const s=this._player;if(s){this._subtitleManager.clear(),this._fatalOnNextError=this._shouldNextErrorBeFatal(),this._fatalOnNextError&&xt.warn("MediaError detected: next immediate media error will be fatal.");const e=s.src;if(e)Ut.test(e)&&URL.revokeObjectURL(e),s.removeAttribute("src");else{const e=Ue(s.getElementsByTagName("source"));xt.info(`HTMLSourceElements to removed: ${e.length}`);for(const t of e)s.removeChild(t);xt.info("Releasing HLS URLs")}s.load()}null===(i=this._currentContent)||void 0===i||i.unload();const c=this._currentContent&&this._currentContent.getMediaType();return s&&c&&(null===(o=this._playerContainerManager)||void 0===o||o.eject(s,c,t)),this.emit(Q.PLAYER_STOPPED,null),Promise.all(r).then((()=>!0))}hideSubtitles(){this._subtitleManager.hide()}showSubtitles(){this._subtitleManager.show()}areSubtitlesShown(){return this._subtitleManager.visible()}getKeySystemInfo(){return this._emeManager?this._emeManager.getKeySystemInfo():Promise.resolve(null)}getVideoVariants(){const e=this._currentContent;if("video"!==(null==e?void 0:e.getMediaType()))return[];const t=[];if(!it(e))return t;const n=e.getMediaProfileInfo().video.available;for(const e of n)t.push({width:e.video_width,height:e.video_height,bitrate:e.video_bitrate});return t}setPreferredBitrate(e){return"number"!=typeof e?Promise.resolve(ee.INVALID):(this._preferredBitrate=e,this._currentContent&&"video"===this._currentContent.getMediaType()&&e>0&&this._bufferManager.abort(!0),this._abrManager.overrideBitrate(e),Promise.resolve(ee.SUCCESS))}getCurrentBandwidth(){return this._abrManager.getBandwidthEstimate()}setBackgrounded(e){this._abrManager.overrideBitrate(e?1e-32:this._preferredBitrate)}setVideoResolution(e){var t,n,i;this._videoResolution=Object.assign(Object.assign({},this._videoResolution),e),(i=this._currentContent)&&"setVideoResolution"in i&&(null===(n=(t=this._currentContent).setVideoResolution)||void 0===n||n.call(t,this._videoResolution))}activateElement(){var e;return this._playerActivated||!this._player||this._player.src?(this._audioProcessor.resume(),!1):(null===(e=this._player)||void 0===e||e.load(),this._playerActivated=!0,!0)}getMediaConfig(){return void 0===this._mediaConfig?function(e,t){const n=t||Kt("video"),i=e=>{n.canPlayType("audio/mp3")&&(e.formats.audio.push("audio/mp3"),e.formatsInfo.audio.push({mimeType:"audio/mp3",codec:"mp3",contentType:'audio/mp3; codecs="mp3"'}),e.supports.unprotected_audio=!0)};if(e)return e.getKeySystemInfo().then((e=>{const{audioFormats:t,videoFormats:n}=e,o={supports:{protected_audio:!!t.length,unprotected_audio:!0,protected_video:!!n.length,unprotected_video:!0},formats:{audio:t.map((e=>e.contentType)),video:n.map((e=>e.contentType))},formatsInfo:{audio:[...t],video:[...n]}};return o.keysystem=e.keySystem,o.keysystem_impl=e.keySystemImpl,i(o),o}));const o="undefined"!=typeof window&&window.MediaSource?e=>MediaSource.isTypeSupported(e):e=>"probably"===n.canPlayType(e)||"probably"===n.canPlayType(e.split(";")[0]),r=Ie([Oe[0]],o),a=[],s=[],c=[],l=[];if(r){const{audioCapabilities:e,videoCapabilities:t}=r;for(const t of e)a.push(t.contentType),c.push(Ne(t.contentType));for(const e of t)s.push(e.contentType),l.push(Ne(e.contentType))}const u={supports:{protected_audio:!1,unprotected_audio:!!a.length,protected_video:!1,unprotected_video:!!s.length},formats:{audio:a,video:s},formatsInfo:{audio:c,video:l}};return i(u),Promise.resolve(u)}(this._emeManager,this._player).then((e=>(this._mediaConfig=e,this._mediaConfig))):Promise.resolve(this._mediaConfig)}setPlaybackSpeed(e){return!(!isFinite(e)||e<=0)&&(this._playerSpeed=null!=e?e:1,this._setPlaybackRate(),!0)}getStatistics(){return this._player&&this._currentContent?this._statistics.getSample(this._player,this._currentContent):null}getAudioProcessor(){return this._audioProcessor}}class Yt extends Error{constructor(e,t){super(t),this.debug={},this.name="LoggingError",this.message=t,this.code=e}}const jt="7.35.3-4d38ee58",zt="7.35.3",Jt=T.P.forTag("playback.logger");class qt extends c.vp{constructor(e){super(),this._currentTrackingData=null,this._sequenceId=0,this._sequenceSessionStorage={},this._sessionId="0",this._transport=e.transport,this._logSender=e.logSender,this._player=e.player,this._init()}static create(e){return new qt(e)}_init(){const e=this._player;e.on(Q.PLAYER_LOAD,this._onPlayerLoad.bind(this)),e.on(Q.PLAYER_ERROR,this._onError.bind(this,!1)),e.on(Q.PLAYER_WARNING,this._onError.bind(this,!0)),e.on(Q.PLAYER_PRELOADING_ERROR,this._onError.bind(this,!1)),e.on(Q.PLAYER_TRACKING_DATA_CREATED,this._onTrackingDataCreated.bind(this)),e.on(Q.PLAYER_TRACKING_DATA_FINALIZED,this._onTrackingDataFinalized.bind(this)),e.on(Q.PLAYER_PLAYBACK_START,this._onPlaybackStart.bind(this))}_emitError(e,t){this.emit(Q.LOGGER_ERROR,{error:e,trackingData:t})}_onError(e,t){var n,o,r;const a=t.data,s=this._currentTrackingData;if(!s||s.noLog)return;const c=a.error,l=null!==(n=null==c?void 0:c.debug)&&void 0!==n?n:{};l.position="position"in a?a.position:0;const u={track:a.track||{},debug:l,preloading:"preloading"in a&&!!a.preloading,session_id:this._sessionId,playback_id:s.playbackId||null,player_play_id:"playId"in a?a.playId:null,http_status_code:null!==(o=null==c?void 0:c.status)&&void 0!==o?o:null,license_server:null!==(r=null==c?void 0:c.licenseServer)&&void 0!==r?r:null};this._logError(c.code||i.UNKNOWN,c,u,s,e)}_onPlayerLoad(e){const t=e.data.logData;if(t)if(t.impressionURLs)for(const e of t.impressionURLs)this._logImpression(e);else t.impressionURL&&this._logImpression(t.impressionURL)}_onPlaybackStart(e){const t=e.data.trackingData;t.noLog||t.noStats||this._logPlaybackStart(t)}_onTrackingDataCreated(e){const t=e.data.trackingData;t.noLog?this._currentTrackingData=null:(this._currentTrackingData=t,this._setSessionId(),t.noTSV||this._setSequenceId())}_setSessionId(){this._sessionId=this._transport.getInitTime().toString()}_setSequenceId(){this._sessionId&&(this._sequenceId=this._getSequenceId(this._sessionId))}_onTrackingDataFinalized(e){const t=e.data.trackingData;if(t.noLog)return;const n=this._sessionId!==this._transport.getInitTime().toString();if(n&&this._setSessionId(),t.playbackId&&!t.noTSV){if(n&&this._setSequenceId(),!t.playIntended&&!t.played)return void this._rollbackSequenceId(this._sessionId);this._logTrackStreamVerification(t)}t.noStats||this._logPlaybackStats(t)}_logTrackStreamVerification(e){const t={play_track:e.currentTrackUri,playback_id:e.playbackId,ms_played:e.msPlayed,ms_nominal_played:e.msNominalPlayed,session_id:this._sessionId,sequence_id:this._sequenceId,next_playback_id:e.nextPlaybackId,playback_service:e.playbackService};Jt.debug("Logged TrackStreamVerification",t),this._logSender.logTrackStreamVerification(t).catch((n=>{const o=new Yt(i.TSV_SENDING_FAILED,n.message||"Unknown reason.");this._logError(o.code,n,t,e,!1),this._emitError(o,e)}))}_logPlaybackStats(e){const t={play_track:e.currentTrackUri,file_id:e.fileId,playback_id:e.playbackId,internal_play_id:e.internalPlayId,memory_cached:e.memoryCached,persistent_cached:e.persistentCached,audio_format:e.audioCodec||"",video_format:e.videoCodec||"",manifest_id:e.fileId,protected:e.isProtected,key_system:e.keySystem,key_system_impl:e.keySystemImpl,urls_json:JSON.stringify(e.urls),start_time:e.loadTime,end_time:e.stopTime,external_start_time:e.externalLoadTime,ms_play_latency:e.msPlayLatency,ms_init_latency:e.msInitLatency,ms_head_latency:e.msHeadLatency,ms_manifest_latency:e.msManifestLatency,ms_resolve_latency:e.msResolveLatency,ms_license_session_latency:e.msLicenseSessionLatency,ms_license_generation_latency:e.msLicenseGenerationLatency,ms_license_request_latency:e.msLicenseRequestLatency,ms_license_update_latency:e.msLicenseUpdateLatency,ms_played:e.msPlayed,ms_nominal_played:e.msNominalPlayed,ms_file_duration:e.msFileDuration,ms_actual_duration:e.msActualDuration,ms_metadata_duration:e.msMetadataDuration,ms_start_position:e.startPosition,ms_end_position:e.position,ms_initial_rebuffer:e.msInitialRebuffering,ms_seek_rebuffer:e.msSeekRebuffering,ms_seek_rebuffer_longest:e.maxMsSeekRebuffering,ms_stall_rebuffer:e.msStalled,ms_stall_rebuffer_longest:e.maxMsStalled,n_stalls:e.nStalls,n_rendition_upgrade:e.nRenditionUpgrade,n_rendition_downgrade:e.nRenditionDowngrade,bps_bandwidth_max:e.bpsBandwidthMax,bps_bandwidth_min:e.bpsBandwidthMin,bps_bandwidth_avg:e.bpsBandwidthAvg,n_seekback:e.nSeeksBackward,n_seekforward:e.nSeeksForward,start_bitrate:e.startBitrate||e.bitrate||0,audio_quality:e.audioQuality,time_weighted_bitrate:e.timeWeightedBitrate,reason_start:e.reasonStart,reason_end:e.reasonEnd,initially_paused:!e.playIntended,had_error:e.hadError,n_warnings:e.nWarnings,n_navigator_offline:e.nOffline,session_id:this._sessionId,sequence_id:this._sequenceId,client_id:e.clientId,correlation_id:e.correlationId,n_dropped_video_frames:e.droppedVideoFrames,n_total_video_frames:e.totalVideoFrames,resolution_max:e.maxResolution||0,resolution_min:e.minResolution||0,total_bytes:e.totalBytes,strategy:e.strategy};Jt.info("Logging PlaybackStats"),this._logSender.logJSSDKPlaybackStats(t).catch((n=>{const o=new Yt(i.PLAYBACK_STATS_SENDING_FAILED,n.message||"Unknown reason.");this._logError(o.code,n,t,e,!1),this._emitError(o,e)}))}_logPlaybackStart(e){const t={play_track:e.currentTrackUri,file_id:e.fileId,playback_id:e.playbackId,session_id:this._sessionId,ms_start_position:e.startPosition,initially_paused:!e.playIntended,client_id:e.clientId,correlation_id:e.correlationId};Jt.info("Logging PlaybackStart"),this._logSender.logJSSDKPlaybackStart(t).catch((n=>{const o=new Yt(i.PLAYBACK_START_SENDING_FAILED,n.message||"Unknown reason.");this._logError(o.code,n,t,e,!1),this._emitError(o,e)}))}_getSequenceId(e){let t=this._sequenceSessionStorage[e];return t||(t=0),t+1>=9007199254740991&&(t=0),this._sequenceSessionStorage[e]=t+1,t}_rollbackSequenceId(e){const t=this._sequenceSessionStorage[e];t&&(this._sequenceSessionStorage[e]=Math.max(t-1,0))}_logImpression(e){return;this._transport.request(e,{forget:!0}).catch((function(e){Jt.warn("Unable to send impression request",e)}))}_logError(e,t,n,i,o){let r="";t&&(r=t.stack||"",r||(r=t.toString()));const a={source:"playback",source_version:jt||K.eV.UNKNOWN,type:e||K.eV.UNKNOWN,message:t&&t.message||K.eV.EMPTY,stack:JSON.stringify(r),json_data:JSON.stringify(n||{}),json_data_version:"1.0.0",client_id:i.clientId,correlation_id:i.correlationId};o?this._logSender.logJSSDKWarning(a).catch((e=>Jt.warn("Failed to log warning",a,e))):this._logSender.logJSSDKError(a).catch((e=>Jt.warn("Failed to log error",a,e)))}}class Xt extends Error{constructor(e=i.STORAGE_ERROR,t="Storage Error"){super(t),this.status=-1,this.fileId="",this.debug={},this.canPlayNext=!0,this.code=e,this.message=t,this.name="StorageError"}}const Zt=T.P.forTag("playback.storage_resolve");class Qt{constructor(e){this._transport=e}_parseResponse(e,t){var n;let o;if(200!==t.status)return o=new Xt(i.STORAGE_FAILED_WITH_STATUS,`Storage Resolve responded with ${t.status}`),o.status=t.status,o.fileId=e,Promise.reject(o);const r=t.body;if(!(null===(n=null==r?void 0:r.cdnurl)||void 0===n?void 0:n.length))return o=new Xt(i.STORAGE_RETURNED_NO_TRACKS,`Storage Resolve returned no tracks for fileId ${e}`),o.fileId=e,Promise.reject(o);const a={uri:r.cdnurl[0],uris:r.cdnurl,protection:"cenc"};return Promise.resolve(a)}getCDNURL(e,t){Zt.info("Requesting CDN URL for ",e);const n="files/audio/interactive",i=`@webgate/storage-resolve/${t?`v2/${n}/${t}/${e}`:`${n}/${e}`}?version=10000000&product=9&platform=39&alt=json`;return this._transport.request(i,{responseType:"json",retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS}}).then(this._parseResponse.bind(this,e))}getManifest(e){const t=`https://seektables.scdn.co/seektable/${e}.json`;return Zt.info("Requesting JSON manifest for ",e),this._transport.request(t,{responseType:"json",retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS}}).then((t=>{let n;return 200!==t.status?(n=new Xt(i.STORAGE_TRACK_MANIFEST_FAILED,`Track manifest request failed with status code ${t.status}`),n.debug.file_id=e,n.status=t.status,Promise.reject(n)):t.body?t.body:(n=new Xt(i.STORAGE_TRACK_MANIFEST_EMPTY,"Received empty manifest."),n.debug.file_id=e,n.status=t.status,Promise.reject(n))}))}}class $t extends Error{constructor(e,t){super(t),this.debug={},this.name="TrackingError",this.message=t,this.code=e}}class en{constructor(){this._version="1.0.0",this._map={}}clear(){this._map={}}track(e,t){let n=this._map[e];n||(n={url:e,segments:0,bandwidths:[],totalBandwidth:0},this._map[e]=n),n.segments+=1,n.bandwidths.push(t.bandwidth),n.totalBandwidth+=t.bandwidth}toJSON(){const e=[];for(const t in this._map){if(!this._map[t])continue;const n=this._map[t];n&&e.push({url:t,segments:n.segments,avg_bw:parseFloat((n.totalBandwidth/n.bandwidths.length).toFixed(7))})}return{version:this._version,urls:e}}}class tn{constructor(){this._bitrates={},this._isFinalized=!1,this._needsEndSegment=!1,this._segments=[],this._cdnURLTracker=new en,this.currentSpeed=1,this.audioCodec=null,this.bitrate=0,this.audioQuality=void 0,this.bufferLoadStartTime=0,this.urls={},this.currentTrackUri="",this.displayTrack="",this.externalLoadTime=0,this.fileId="",this.gaiaDevId="none",this.hadError=!1,this.internalPlayId="",this.isProtected=!1,this.keySystem="",this.keySystemImpl="",this.lastPlayPosition=-1,this.loadTime=0,this.localTimeMs=-1,this.maxContinuous=0,this.msInitialRebuffering=0,this.maxMsSeekRebuffering=0,this.maxMsStalled=0,this.memoryCached=!1,this.msActualDuration=0,this.msMetadataDuration=0,this.msFileDuration=0,this.msHeadLatency=0,this.msInitLatency=0,this.msKeyLatency=0,this.msLicenseGenerationLatency=0,this.msLicenseRequestLatency=0,this.msLicenseSessionLatency=0,this.msLicenseUpdateLatency=0,this.msManifestLatency=0,this.msPlayed=0,this.msNominalPlayed=0,this.msPlayedUnion=0,this.msPlayLatency=0,this.msResolveLatency=0,this.msSeekRebuffering=0,this.msSeeksBackward=0,this.msSeeksForward=0,this.nextPlaybackId="",this.nOffline=0,this.noLog=!1,this.noTSV=!1,this.noStats=!1,this.nWarnings=0,this.msStalled=0,this.nSeeksBackward=0,this.nSeeksForward=0,this.nSpeedChanges=0,this.nStalls=0,this.nRenditionUpgrade=0,this.nRenditionDowngrade=0,this.bpsBandwidthMax=0,this.bpsBandwidthMin=0,this.bpsBandwidthAvg=0,this.totalBandwidth=0,this.lastBitrate=0,this.persistentCached=!1,this.playbackId="",this.playContext="",this.played=!1,this.position=0,this.reasonEnd="unknown",this.reasonStart="unknown",this.referrer="unknown",this.referrerVendor="unknown",this.referrerVersion="unknown",this.sourceEnd="unknown",this.sourceStart="unknown",this.startPosition=0,this.stopTime=0,this.streamingRule="none",this.timeWeightedBitrate=0,this.totalBytes=0,this.playIntended=!1,this.videoCodec=null,this.clientId="unknown",this.correlationId="unknown",this.droppedVideoFrames=0,this.totalVideoFrames=0,this.maxResolution=0,this.minResolution=0,this.playbackService="",this.strategy=""}static create(){return new tn}_calculateUnion(){const e=this._segments.slice(0);let t=0,n=0,i=0,o=0,r=0,a=0,s=this.maxContinuous;for(;rs?a:s);for(this.maxContinuous=s,e.sort(((e,t)=>e.time-t.time));o0&&(n+=parseInt(i,10)*t[i]/e);return Math.round(n)}registerVideoVariant(e){const t=e.bitrate;t&&(this._bitrates[t]=this._bitrates[t]||0,this.startBitrate||(this.startBitrate=t)),e.audioProfile&&(this.audioCodec=e.audioProfile.audio_codec),e.videoProfile&&(this.videoCodec=e.videoProfile.video_codec,this.lastBitrate=e.videoProfile.video_bitrate,this.minResolution=e.videoProfile.video_resolution,this.maxResolution=e.videoProfile.video_resolution)}addStartSegment(){this._segments.push({type:"start",time:this.position}),this._needsEndSegment=!0}addEndSegment(){this._needsEndSegment&&(this._segments.push({type:"end",time:this.position}),this._needsEndSegment=!1)}addMSPlayed(e){if(e){if(e<0)throw new TypeError(`Cannot add negative msPlayed value: ${e}`);this.msPlayed+=e/this.currentSpeed,this.msNominalPlayed+=e}}addSpeedChange(e){++this.nSpeedChanges,this.currentSpeed=e}trackBitrate(e,t){const n=e||"dummy";this._bitrates[n]=this._bitrates[n]||0,this._bitrates[n]+=t}trackBufferURL(e,t){const n=e.substring(0,5);"data:"!==n&&"blob:"!==n&&this._cdnURLTracker.track(e,t)}finalize(){if(this._isFinalized)throw new $t(i.TRACK_DATA_ALREADY_FINALIZED,"TrackData already finalized.");this.msPlayedUnion=this._calculateUnion(),this.nSeeksBackward||this.nSeeksForward||this.nSpeedChanges||(this.msNominalPlayed=this.maxContinuous=this.msPlayedUnion,this.msPlayed=this.msNominalPlayed/this.currentSpeed,this.nSpeedChanges=0);const e=this.msPlayed;return this.timeWeightedBitrate=this._calculateWeightedBitrate(e),this.startBitrate||(this.startBitrate=this.bitrate),this.urls=this._cdnURLTracker.toJSON(),this._isFinalized=!0,!0}getURLsJSON(){var e,t;return null!==(t=null===(e=this._cdnURLTracker.toJSON().urls)||void 0===e?void 0:e.map((({url:e})=>e)))&&void 0!==t?t:[]}getPlaybackStats(){let e;switch(this.keySystem){case $.WIDEVINE:e="widevine";break;case $.PLAYREADY:case $.PLAYREADY_HARDWARE:e="playready";break;default:e="none"}return{ms_total_est:this.msActualDuration,ms_metadata_duration:this.msMetadataDuration,ms_manifest_latency:this.msManifestLatency,ms_latency:this.msPlayLatency,start_offset_ms:this.startPosition,ms_initial_buffering:this.msInitialRebuffering,ms_initial_rebuffer:this.msInitialRebuffering,ms_seek_rebuffering:this.msSeekRebuffering,ms_stalled:this.msStalled,max_ms_seek_rebuffering:this.maxMsSeekRebuffering,max_ms_stalled:this.maxMsStalled,n_stalls:this.nStalls,n_rendition_upgrade:this.nRenditionUpgrade,n_rendition_downgrade:this.nRenditionDowngrade,bps_bandwidth_max:this.bpsBandwidthMax,bps_bandwidth_min:this.bpsBandwidthMin,bps_bandwidth_avg:this.bpsBandwidthAvg,audiocodec:this.audioCodec?this.audioCodec.toLowerCase():void 0,videocodec:this.videoCodec?this.videoCodec.toLowerCase():void 0,start_bitrate:this.startBitrate||this.bitrate||void 0,full_screen:void 0,time_weighted_bitrate:this.timeWeightedBitrate,buffering_percentage:void 0,prefetched_bytes:void 0,prefetched_bytes_loaded:void 0,prefetched_initial_bitrate:void 0,key_system:e,ms_key_latency:this.msKeyLatency,total_bytes:this.totalBytes,local_time_ms:this.localTimeMs,ms_played_background:void 0,n_dropped_video_frames:this.droppedVideoFrames,n_total_video_frames:this.totalVideoFrames,resolution_max:this.maxResolution,resolution_min:this.minResolution,strategy:this.strategy}}isFinalized(){return this._isFinalized}}const nn=T.P.forTag("playback.tracker");class on extends c.vp{constructor(e={}){super(),this._playedThreshold=31e3,this._playedThresholdReached=!1,this._trackingData=null,this._quartileTrackingEvents={firstEventFired:!1,midEventFired:!1,thirdEventFired:!1},this._playedThreshold=e.playerThreshold||31e3}static create(e){return new on(e)}_checkPlayedThreshold(){const e=this._trackingData;!e||!this._playedThreshold||this._playedThresholdReached||e.msPlayed=n&&(this._quartileTrackingEvents.firstEventFired=!0,this.emit(Q.TRACKER_FIRST_QUARTILE,null)),!this._quartileTrackingEvents.midEventFired&&e.position>=2*n&&(this._quartileTrackingEvents.midEventFired=!0,this.emit(Q.TRACKER_MIDPOINT,null)),!this._quartileTrackingEvents.thirdEventFired&&e.position>=3*n&&(this._quartileTrackingEvents.thirdEventFired=!0,this.emit(Q.TRACKER_THIRD_QUARTILE,null))}getMSPlayed(){return this._trackingData?this._trackingData.msPlayed:0}getStallsInformation(){return this._trackingData?{nStalls:this._trackingData.nStalls,msTotalStalled:this._trackingData.msStalled}:{nStalls:0,msTotalStalled:0}}trackLoadStart(e,t,n,i,o){const r=tn.create();this._trackingData=r,this._playedThresholdReached=!1,this._quartileTrackingEvents={firstEventFired:!1,midEventFired:!1,thirdEventFired:!1},r.fileId=null!=t?t:"",r.currentTrackUri=e,r.loadTime=Date.now(),r.internalPlayId=n,r.externalLoadTime=i.externalLoadTime||0,r.displayTrack=i.displayTrack||"",r.playbackId=i.playbackId||"",r.playContext=i.playContext||"",r.reasonStart=i.reason||"unknown",r.sourceStart=i.source||"unknown",r.clientId=i.clientId||"",r.correlationId=i.correlationId||"",r.playbackService=i.playbackService||"";const a=i.referrer||{};r.referrer=void 0!==a.name?a.name:"unknown",r.referrerVersion=void 0!==a.version?a.version:"unknown",r.referrerVendor=void 0!==a.vendor?a.vendor:"unknown";const s=i.format||{};s.codec&&(r.audioCodec=s.codec.toLowerCase()),s.bitrate&&(r.bitrate=s.bitrate),s.audioQuality&&(r.audioQuality=s.audioQuality),r.gaiaDevId=i.deviceId||"none",r.noLog=i.noLog||!1,r.noTSV=i.noTSV||!1,r.noStats=i.noStats||!1,r.contentMetadata=o,"number"==typeof(null==o?void 0:o.displayDuration)&&(r.msMetadataDuration=o.displayDuration),this.emit(Q.TRACKER_TRACKING_DATA_CREATED,{trackingData:r})}trackBufferLoadStart(){const e=this._trackingData;e&&(e.bufferLoadStartTime=Date.now())}trackBytesDownloaded(e){const t=this._trackingData;t&&(t.totalBytes+=e)}trackLoadDone(e){const t=this._trackingData;if(!t)return;const n=Date.now();t.msInitLatency=n-t.bufferLoadStartTime,t.localTimeMs=n,t.position=e,t.addStartSegment()}trackPlay(e,t){const n=this._trackingData;n&&(n.played||this.emit(Q.TRACKER_PLAYBACK_START,{trackingData:n}),n.played=!0,n.position=e,n.startPosition=e,n.addSpeedChange(t||1))}trackCanPlayThrough(){if(!this._trackingData)return;const e=Date.now();this.trackPlayLatency(e),this.trackHeadLatency(e)}trackPlayLatency(e=Date.now()){const t=this._trackingData;!t||t.nSeeksBackward||t.nSeeksForward||(t.msPlayLatency=e-t.loadTime)}trackHeadLatency(e=Date.now()){const t=this._trackingData;t&&(t.msHeadLatency=e-t.bufferLoadStartTime)}trackBufferURL(e,t){const n=this._trackingData;n&&n.trackBufferURL(e,t)}trackNavigatorOffline(){const e=this._trackingData;e&&(e.nOffline+=1)}trackInitialRebuffering(e){const t=this._trackingData;t&&(t.msInitialRebuffering=e)}trackSeekRebuffering(e){const t=this._trackingData;t&&(e>t.maxMsSeekRebuffering&&(t.maxMsSeekRebuffering=e),t.msSeekRebuffering+=e)}trackMsStalled(e){const t=this._trackingData;t&&(e>t.maxMsStalled&&(t.maxMsStalled=e),t.msStalled+=e,t.nStalls++)}trackLoadFailed(){const e=this._trackingData;e&&(this.trackPlayLatency(),e.position=0,e.addStartSegment())}trackStopped(e,t,n){var i,o,r,a;const s=this._trackingData;if(!s||s.isFinalized())return;const c=Date.now();if(s.stopTime=c,s.lastPlayPosition>=0&&e>=0&&s.lastPlayPositionn?(t.nSeeksForward++,t.msSeeksForward+=e-n):e=0&&t.lastPlayPosition=0&&t.lastPlayPosition=0){if(i=e-n.lastPlayPosition,i<0)return void nn.warn("Skipping msPlayed calculation: late progress event.");n.addMSPlayed(i)}this._checkPlayedThreshold(),n.position=e,n.lastPlayPosition=e,this._checkPercentileThresholds(),t&&n.trackBitrate(t,i)}trackSpeedChanged(e){const t=this._trackingData;t&&t.addSpeedChange(e)}trackVideoLoadStart(e){const t=this._trackingData;t&&t.registerVideoVariant(e)}trackWarning(){const e=this._trackingData;e&&e.nWarnings++}trackOffline(){const e=this._trackingData;e&&e.nOffline++}trackStrategy(e){const t=this._trackingData;t&&(t.strategy=e)}setActualDuration(e){const t=this._trackingData;t&&(t.msActualDuration=e)}setKeySystem(e){const t=this._trackingData;t&&(t.keySystem=e)}setKeySystemImpl(e){const t=this._trackingData;t&&(t.keySystemImpl=e)}setManifestLatency(e){const t=this._trackingData;t&&(t.msManifestLatency=e)}setPlayIntended(e){const t=this._trackingData;t&&(t.playIntended=e)}setKeyLatency(e){const t=this._trackingData;t&&(t.msKeyLatency=e)}setMemoryCached(e){const t=this._trackingData;t&&(t.memoryCached=e)}setPersistentCached(e){const t=this._trackingData;t&&(t.persistentCached=e)}setProtected(e){const t=this._trackingData;t&&(t.isProtected=e)}setHadError(e){const t=this._trackingData;t&&(t.hadError=e)}setLicenseSessionLatency(e){const t=this._trackingData;t&&(t.msLicenseSessionLatency=e)}setLicenseGenerationLatency(e){const t=this._trackingData;t&&(t.msLicenseGenerationLatency=e)}setLicenseRequestLatency(e){const t=this._trackingData;t&&(t.msLicenseRequestLatency=e)}setLicenseUpdateLatency(e){const t=this._trackingData;t&&(t.msLicenseUpdateLatency=e)}setResolveLatency(e){const t=this._trackingData;t&&(t.msResolveLatency=e)}setCalculatedDuration(e){const t=this._trackingData;t&&(t.msFileDuration=e)}setPlayedThreshold(e){this._playedThreshold=e}trackFragment(e){const t=this._trackingData;if(!t)return;const{bandwidth:n,resolution:i}=e;i&&((it.maxResolution&&(t.maxResolution=i)),(nt.bpsBandwidthMax&&(t.bpsBandwidthMax=n),t.bpsBandwidthAvg=t.bpsBandwidthAvg?(t.bpsBandwidthAvg+n)/2:n}trackProfileChanged(e){const t=this._trackingData;if(!t)return;const{bitrate:n}=e;nt.lastBitrate&&t.nRenditionUpgrade++,t.lastBitrate=n}}class rn extends c.vp{constructor(e){super(),this._transport=e,this._parseManifestResponse=this._parseManifestResponse.bind(this)}static create(e){return new rn(e)}_parseManifestResponse(e){var t;const n=e.metadata.startTime;if(200!==e.status){const t=new Xt(i.STORAGE_VIDEO_MANIFEST_FAILED,`Video manifest request failed with status ${e.status}`);return t.status=e.status,this.emit(Q.VIDEO_MANIFEST_RESOLVE_FAILED,{url:e.url,error:t,start_time:n}),Promise.reject(t)}const o=e.body,r=null===(t=e.headers)||void 0===t?void 0:t.get("content-length");return this.emit(Q.VIDEO_MANIFEST_RESOLVED,{url:e.url,manifest_size:r?parseInt(r,10):JSON.stringify(o).length,start_time:n,end_time:Date.now()}),Promise.resolve(o)}getInitSegmentURLs(e,t,n,i){let o="";n&&(o=e+t.replace("{{profile_id}}",n.id.toString(10)).replace("{{file_type}}",n.file_type));let r="";return i&&(r=e+t.replace("{{profile_id}}",i.id.toString(10)).replace("{{file_type}}",i.file_type)),{audio:o,video:r,audioLogging:o,videoLogging:r}}getSegmentURLs(e,t,n,i,o){let r="";i&&(r=e+t.replace("{{profile_id}}",i.id.toString(10)).replace("{{file_type}}",i.file_type));let a="";return o&&(a=e+t.replace("{{profile_id}}",o.id.toString(10)).replace("{{file_type}}",o.file_type)),{audio:r.replace("{{segment_timestamp}}",n.toString()),video:a.replace("{{segment_timestamp}}",n.toString()),audioLogging:r,videoLogging:a}}getManifest(e,t=!1){const n=`${t?"@webgate/manifests/v8/unauth/json/sources":"@webgate/manifests/v7/json/sources"}/${e}/options/supports_drm`;return this._transport.request(n,{authorize:!t,responseType:"json",parseResponseHeaders:!0,retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS},metadata:{startTime:Date.now()}}).then(this._parseManifestResponse)}}class an extends Error{constructor(e,t){super(),this.status=-1,this.debug={},this.canPlayNext=!0,this.unrecoverable=!1,this.name="LicenseError",this.code=e,this.message=t}static fatal(e,t){const n=new an(e,t);return n.unrecoverable=!0,n.canPlayNext=!1,n}}class sn{constructor(e){this._sdk={name:"",version:""},this._securityLevel=null,this._urls={},e.sdk&&(this._sdk=e.sdk),e.securityLevel&&(this._securityLevel=e.securityLevel),this._transport=e.transport,this._useTestLicenseServer=!!e.useTestLicenseServer,this._transport.on(this._transport.EVENT_CONNECTION_ID,(()=>{this._urls={}}))}get(e,t){const n=`${e}:${t}`,o=this._urls[n];if(o&&o.expires>Date.now()+6e4)return Promise.resolve(o.uri);const r=this._useTestLicenseServer?"&use_test_license_server=true":"",a=`@webgate/melody/v1/license_url?keysystem=${e}&mediatype=${t}&sdk_name=${this._sdk.name}&sdk_version=${this._sdk.version}${r}`;return this._transport.request(a,{responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((e=>{const t=e.body;if(t&&200===e.status)return t.expires*=1e3,t.uri=`@webgate/${t.uri}`,this._securityLevel&&(t.uri+=[-1!==t.uri.indexOf("?")?"&":"?","sl=",this._securityLevel].join("")),this._urls[n]=t,t.uri;let o;return o=t?400===e.status&&t&&"deprecated-version"===t.code?an.fatal(i.LICENSE_RESOLVER_DEPRECATED_VERSION,"This version of the SDK is no longer supported. Please upgrade"):new an(i.LICENSE_RESOLVER_CANT_RESOLVE_URL,`License URL endpoint responded with status ${e.status}`):an.fatal(i.LICENSE_RESOLVE_INVALID_RESPONSE,"License URL endpoint responded with invalid response"),o.status=e.status,Promise.reject(o)}))}remove(e,t){this._urls[`${e}:${t}`]=null}}class cn{constructor(e){this._melodyLogger=new K.Hx(e)}logTrackStreamVerification(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"track_stream_verification",message:e},{batch:!0})}logJSSDKPlaybackStats(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_playback_stats",message:e},{batch:!0})}logJSSDKPlaybackStart(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_playback_start",message:e},{batch:!0})}logJSSDKError(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_error",message:e},{batch:!0})}logJSSDKWarning(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_warning",message:e},{batch:!0})}}var ln;!function(e){e[e.ABORTED=101]="ABORTED",e[e.NETWORK=102]="NETWORK",e[e.MEDIA_DECODING=103]="MEDIA_DECODING",e[e.SRC_NOT_SUPPORTED=104]="SRC_NOT_SUPPORTED",e[e.EME=105]="EME",e[e.GENERIC=100]="GENERIC"}(ln||(ln={}));const un={[i.MEDIA_ABORTED]:ln.ABORTED,[i.MEDIA_DECODING_ERROR]:ln.MEDIA_DECODING,[i.MEDIA_NOT_SUPPORTED]:ln.SRC_NOT_SUPPORTED,[i.MEDIA_NETWORK_ERROR]:ln.NETWORK};function dn(e){let t=un[e];return/_REQUEST_|_RESPONSE$/.test(e)?t=ln.NETWORK:t||(t=/^EME_/.test(e)?ln.EME:ln.GENERIC),t}function pn(e){var t;const n=e.match(/^https?:\/\/([^\/]+@)?([^\/?#]+)/);return null!==(t=null==n?void 0:n[2])&&void 0!==t?t:""}var fn;!function(e){e.READY="playerready",e.VIDEO_CHANGE="videochange",e.PLAY="play",e.PLAYING="playing",e.PAUSE="pause",e.TIMEUPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.ERROR="error",e.ENDED="ended",e.RENDITION_CHANGE="renditionchange",e.REQUEST_COMPLETED="requestcompleted",e.REQUEST_FAILED="requestfailed",e.REQUEST_CANCELED="requestcanceled"}(fn||(fn={}));const hn={player_is_paused:!0,player_width:0,player_height:0,video_source_height:0,video_source_width:0,player_is_fullscreen:void 0,player_autoplay_on:void 0,player_preload_on:void 0,video_source_url:void 0,video_source_mime_type:void 0,video_source_duration:void 0,video_poster_url:void 0,player_language_code:void 0};class mn{constructor(e){this._playerId=`spotify-playback-${Date.now()}`,this._currentContentInfo=null,this._readyDeferred=(0,l.$)(),this._isMuxInitialized=!1,this._muxInitData=null,this._player=e.player,this._mux=e.mux,this._getPlayheadTime=this._getPlayheadTime.bind(this),this._getStateData=this._getStateData.bind(this),this._init(e)}static create(e){return new mn(e)}_init(e){Promise.all([Promise.resolve(e.deviceInfo)]).then((([t])=>{var n;this._muxInitData={data:Object.assign({env_key:e.envKey||"2qbjhhcl4u87btjbo7dh8vi2n",player_name:null!==(n=null==t?void 0:t.platform_name)&&void 0!==n?n:null==t?void 0:t.platform,player_version:null==t?void 0:t.version,viewer_device_manufacturer:null==t?void 0:t.brand,viewer_device_category:null==t?void 0:t.type,viewer_device_name:null==t?void 0:t.model,player_software_name:e.sdk||"spotify-playback",player_software_version:e.sdkVersion||zt,player_mux_plugin_name:"spotify-playback-mux-reporter",player_mux_plugin_version:zt},e.muxCustomDimensions),getPlayheadTime:this._getPlayheadTime,getStateData:this._getStateData},this._player.addListeners({[Q.PLAYER_BEFORE_LOAD]:this._onBeforeLoad.bind(this),[Q.PLAYER_PLAY]:this._onPlay.bind(this),[Q.PLAYER_PLAYING]:this._onPlaying.bind(this),[Q.PLAYER_PAUSED]:this._onPause.bind(this),[Q.PLAYER_PROGRESS]:this._onProgress.bind(this),[Q.PLAYER_SEEKING]:this._onSeeking.bind(this),[Q.PLAYER_POSITION_CHANGED]:this._onPositionChanged.bind(this),[Q.PLAYER_ERROR]:this._onError.bind(this),[Q.PLAYER_ENDED]:this._onEnded.bind(this),[Q.PLAYER_DURATION_CHANGED]:this._onDurationChanged.bind(this),[Q.PLAYER_VIDEO_RESIZED]:this._onVideoResized.bind(this),[Q.PLAYER_VIDEO_PROFILE_CHANGED]:this._onVideoProfileChanged.bind(this),[Q.PLAYER_FRAGMENT_FETCHED]:this._onFragmentFetched.bind(this),[Q.PLAYER_FRAGMENT_FETCH_ERROR]:this._onFragmentFetchError.bind(this),[Q.PLAYER_VIDEO_MANIFEST_RESOLVED]:this._onVideoManifestResolved.bind(this),[Q.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED]:this._onVideoManifestResolveFailed.bind(this)})})).then(this._readyDeferred.resolve,this._readyDeferred.reject)}_getPlayheadTime(){return this._player.getPlayerPosition()}_getStateData(){return this._currentContentInfo?Object.assign(Object.assign({},this._currentContentInfo.stateData),{player_language_code:this._player.getActiveSubtitleLanguage()}):null}_onDurationChanged(e){this._currentContentInfo&&(this._currentContentInfo.stateData.video_source_duration=e.data.duration)}_onVideoResized(e){this._currentContentInfo&&(this._currentContentInfo.stateData.player_width=e.data.width,this._currentContentInfo.stateData.player_height=e.data.height)}_onBeforeLoad(e){const{track:t,options:n,logData:i}=e.data,o=!!this._currentContentInfo;if("video"!==t.mediaType||(null==i?void 0:i.noLog)||(null==i?void 0:i.noMuxEvents))return o&&this._mux.emit(this._playerId,fn.VIDEO_CHANGE,{}),void(this._currentContentInfo=null);const r={video_id:t.fileId,video_title:(null==i?void 0:i.displayTitle)||void 0,video_series:(null==i?void 0:i.displayGroup)||void 0,video_duration:(null==i?void 0:i.displayDuration)||void 0},a=Object.assign({},hn);this._currentContentInfo={track:t,options:n,videoData:r,stateData:a},!this._isMuxInitialized&&this._muxInitData?(this._mux.init(this._playerId,this._muxInitData),this._mux.emit(this._playerId,fn.READY),this._isMuxInitialized=!0):o&&this._mux.emit(this._playerId,fn.VIDEO_CHANGE,r)}_onPlay(){var e,t;if(!this._currentContentInfo)return;const n=this._currentContentInfo.stateData,i=this._player.getPlayerState(),o=i.media_info,r=(null===(t=null===(e=this._currentContentInfo)||void 0===e?void 0:e.options)||void 0===t?void 0:t.autoplay)||!1,{width:a,height:s,src:c,poster:l}=i.player_element;n.player_is_paused=!i.playing,n.player_width=a||0,n.player_height=s||0,n.video_source_height=o.video_height||0,n.video_source_width=o.video_width||0,n.player_autoplay_on=r,n.video_source_url=c,n.video_source_mime_type=o.video_format,n.video_source_duration=i.duration,n.video_poster_url=l,this._mux.emit(this._playerId,fn.PLAY,this._currentContentInfo.videoData)}_onPlaying(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!1,this._mux.emit(this._playerId,fn.PLAYING))}_onPause(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!0,this._mux.emit(this._playerId,fn.PAUSE))}_onProgress(e){this._currentContentInfo&&this._mux.emit(this._playerId,fn.TIMEUPDATE,{player_playhead_time:e.data.position})}_onSeeking(){this._currentContentInfo&&this._mux.emit(this._playerId,fn.SEEKING)}_onPositionChanged(){this._currentContentInfo&&this._mux.emit(this._playerId,fn.SEEKED)}_onError(e){var t,n;const i=null===(n=null===(t=e.data)||void 0===t?void 0:t.error)||void 0===n?void 0:n.code;this._currentContentInfo&&i&&this._mux.emit(this._playerId,fn.ERROR,{player_error_code:dn(i),player_error_message:i})}_onEnded(){this._currentContentInfo&&this._mux.emit(this._playerId,fn.ENDED)}_onVideoProfileChanged(e){if(!this._currentContentInfo)return;const t=e.data.profile,n=this._currentContentInfo.stateData;n.video_source_height=t.height||0,n.video_source_width=t.width||0,n.video_source_mime_type=t.mimeType,this._mux.emit(this._playerId,fn.RENDITION_CHANGE,{video_source_bitrate:t.bitrate,video_source_width:t.width,video_source_height:t.height})}_onFragmentFetched(e){const t=e.data;if(!this._currentContentInfo&&"video"!==t.media_type)return;const n=`${t.segment_type}${t.init?"_init":""}`;this._mux.emit(this._playerId,fn.REQUEST_COMPLETED,{request_type:n,request_hostname:pn(t.url),request_start:t.start_time,request_response_end:t.end_time,request_bytes_loaded:t.byte_length})}_onFragmentFetchError(e){const t=e.data;if(!this._currentContentInfo&&"video"!==t.media_type)return;const n=`${t.segment_type}${t.init?"_init":""}`;this._mux.emit(this._playerId,fn.REQUEST_FAILED,{request_type:n,request_hostname:pn(t.url),request_start:t.start_time,request_error:t.error.code,request_error_code:t.error.status,request_error_text:""})}_onVideoManifestResolved(e){const t=e.data;this._currentContentInfo&&this._mux.emit(this._playerId,fn.REQUEST_COMPLETED,{request_type:"manifest",request_hostname:pn(t.url),request_start:t.start_time,request_response_end:t.end_time,request_bytes_loaded:t.manifest_size})}_onVideoManifestResolveFailed(e){const t=e.data;this._currentContentInfo&&this._mux.emit(this._playerId,fn.REQUEST_FAILED,{request_type:"manifest",request_hostname:pn(t.url),request_start:t.start_time,request_error:t.error.code,request_error_code:t.error.status,request_error_text:""})}ready(){return this._readyDeferred.promise}}class gn{constructor(e){if(this._estimate=0,this._totalWeight=0,e<0)throw new TypeError("Halflife must be set to a positive value.");this._weightingDecrease=Math.exp(Math.log(.5)/e)}sample(e,t){const n=Math.pow(this._weightingDecrease,e),i=t*(1-n)+n*this._estimate;isNaN(i)||(this._estimate=i,this._totalWeight+=t)}getEstimate(){return this._estimate/1-Math.pow(this._weightingDecrease,this._totalWeight)}}class _n{constructor(e=4e5){this._totalBytes=0,this._overrideBitrate=0,this._currentBandwidth=e,this._short=new gn(2),this._long=new gn(5),this._init()}_init(){if("undefined"==typeof navigator)return;const e=navigator;e.connection&&e.connection.downlink&&(this._currentBandwidth=1e6*e.connection.downlink,this._onConnectionChange=this._onConnectionChange.bind(this),e.connection.addEventListener("change",this._onConnectionChange))}_onConnectionChange(e){const t=e.target.downlink||0;this._setBandwidth(t)}_setBandwidth(e){this._currentBandwidth=1e6*e}getBandwidthEstimate(){if(this._overrideBitrate)return this._overrideBitrate;if(this._totalBytes<128e3)return this._currentBandwidth;const e=this._short.getEstimate(),t=this._long.getEstimate();return Math.min(e,t)}sample(e,t){if(e<16e3)return;const n=t/1e3,i=8*e/n;this._totalBytes+=e,this._short.sample(n,i),this._long.sample(n,i)}overrideBitrate(e){this._overrideBitrate=e<=0?0:e}}const vn=function(e,t){try{if("number"==typeof e())return e}catch(e){}const n=t();let i=0;return()=>(i=Math.max(i,t()-n),i)}((()=>performance.now()),Date.now);class yn{constructor(e,t){this._transport=e,this._abrManager=t}_fetch(e,t){const n=vn();return this._transport.request(e,{responseType:"arraybuffer",headers:{Range:t}}).then((e=>e.ok&&e.body?{bytes:e.body.byteLength,time:vn()-n}:null))}sample(){const e=`https://web-sdk-assets.spotifycdn.com/bandwidth_sampling_data?no-cache=${Math.random()}`;return this._fetch(e,"bytes=0-0").then((()=>this._fetch(e,"bytes=0-"))).then((e=>{e&&this._abrManager.sample(e.bytes,e.time)}))}}const En=(e,t)=>new yn(e,t);var bn,Sn,An,Tn,On;function In(e){return"uri"in e}!function(e){e.NULL_VALUE="NULL_VALUE",e.LIST_START="LIST_START",e.LIST_END="LIST_END",e.FORBIDDEN="FORBIDDEN",e.IGNORE="IGNORE",e.PAUSE="PAUSE"}(bn||(bn={})),function(e){e.AAC_LC="mp4a.40.2",e.FLAC="flac",e.OPUS="opus",e.VP9="vp9",e.VP8="vp8",e.H264_31="avc1.4d401f"}(Sn||(Sn={})),function(e){e.UNKNOWN="UNKNOWN",e.DEFAULT="DEFAULT",e.LOW="LOW",e.NORMAL="NORMAL",e.HIGH="HIGH",e.VERY_HIGH="VERY_HIGH",e.HIFI="HIFI"}(An||(An={})),function(e){e.NONE="NONE",e.CONTEXT="CONTEXT",e.TRACK="TRACK"}(Tn||(Tn={})),function(e){e.EMPTY="EMPTY",e.SW_CRYPTO="SW_CRYPTO",e.SW_DECODE="SW_DECODE",e.HW_CRYPTO="HW_CRYPTO",e.HW_DECODE="HW_DECODE",e.HW_ALL="HW_ALL"}(On||(On={}));class Cn extends c.vp{constructor(e){if(super(),this._trackPlayerPromise=(0,l.$)(),this._maxListErrors=5,this._uid=0,this._loadedList=null,this._loadedOptions=null,this._currentTrack=null,this._currentTrackOptions=null,this._listPlayCount=0,this._listErrorCount=0,this._shuffled=!1,this._repeatMode=Tn.NONE,this._currentSeqId=0,!e.trackPlayer)throw new TypeError("Argument `options.trackPlayer` not found.");e.maxListErrors&&(this._maxListErrors=e.maxListErrors),this._setListOptions=this._setListOptions.bind(this),this._replaceCurrentList=this._replaceCurrentList.bind(this),this._handleCapped=this._handleCapped.bind(this),this._handlePlaying=this._handlePlaying.bind(this),this._handlePaused=this._handlePaused.bind(this),this._handleEnded=this._handleEnded.bind(this),this._handleCanPreload=this._handleCanPreload.bind(this),this._handleError=this._handleError.bind(this),this._handlePositionChanged=this._handlePositionChanged.bind(this),this._handleDurationChanged=this._handleDurationChanged.bind(this),this._handleTimeout=this._handleTimeout.bind(this),this._handlePlayerInitError=this._handlePlayerInitError.bind(this),this._handleProgress=this._handleProgress.bind(this),this._handlePlayedThresholdReached=this._handlePlayedThresholdReached.bind(this),this._handleBeforeLoad=this._handleBeforeLoad.bind(this),this._init(e.trackPlayer)}static create(e){return new Cn(e)}_init(e){this._trackPlayerPromise.promise.catch((()=>{})),Promise.resolve(e).then((e=>{this._attachPlayerEvents(e),this._trackPlayerPromise.resolve(e)})).catch(this._handlePlayerInitError)}_attachPlayerEvents(e){e.addListeners({[Q.PLAYER_CAN_PRELOAD]:this._handleCanPreload,[Q.PLAYER_CAPPED]:this._handleCapped,[Q.PLAYER_ENDED]:this._handleEnded,[Q.PLAYER_ERROR]:this._handleError,[Q.PLAYER_PAUSED]:this._handlePaused,[Q.PLAYER_PLAYING]:this._handlePlaying,[Q.PLAYER_TIMEOUT]:this._handleTimeout,[Q.PLAYER_POSITION_CHANGED]:this._handlePositionChanged,[Q.PLAYER_DURATION_CHANGED]:this._handleDurationChanged,[Q.PLAYER_PROGRESS]:this._handleProgress,[Q.PLAYER_BEFORE_LOAD]:this._handleBeforeLoad,[Q.PLAYER_PLAYED_THRESHOLD_REACHED]:this._handlePlayedThresholdReached}),this.proxyEmitAllSync(e,{[Q.PLAYER_BEFORE_VOLUME_CHANGE]:Q.LIST_PLAYER_BEFORE_VOLUME_CHANGE,[Q.PLAYER_LOAD]:Q.LIST_PLAYER_PLAYER_LOAD,[Q.REPORTING_START]:Q.REPORTING_START,[Q.REPORTING_CREATIVE_VIEW]:Q.REPORTING_CREATIVE_VIEW,[Q.REPORTING_FIRST_QUARTILE]:Q.REPORTING_FIRST_QUARTILE,[Q.REPORTING_MIDPOINT]:Q.REPORTING_MIDPOINT,[Q.REPORTING_THIRD_QUARTILE]:Q.REPORTING_THIRD_QUARTILE,[Q.REPORTING_COMPLETE]:Q.REPORTING_COMPLETE,[Q.REPORTING_PAUSE]:Q.REPORTING_PAUSE,[Q.REPORTING_RESUME]:Q.REPORTING_RESUME,[Q.REPORTING_ERROR]:Q.REPORTING_ERROR}),this.proxyEmitAll(e,{[Q.PLAYER_AUTOPLAY_FAILED]:Q.LIST_PLAYER_AUTOPLAY_FAILED,[Q.PLAYER_TRACKING_DATA_CREATED]:Q.LIST_PLAYER_TRACKING_DATA_CREATED,[Q.PLAYER_TRACKING_DATA_FINALIZED]:Q.LIST_PLAYER_TRACKING_DATA_FINALIZED,[Q.PLAYER_BUFFER_STALLED]:Q.LIST_PLAYER_BUFFER_STALLED,[Q.PLAYER_BUFFERING_START]:Q.LIST_PLAYER_BUFFERING_START,[Q.PLAYER_BUFFERING_END]:Q.LIST_PLAYER_BUFFERING_END,[Q.PLAYER_REBUFFERING_START]:Q.LIST_PLAYER_REBUFFERING_START,[Q.PLAYER_REBUFFERING_END]:Q.LIST_PLAYER_REBUFFERING_END,[Q.PLAYER_VIDEO_ELEMENT_APPENDED]:Q.LIST_PLAYER_VIDEO_ELEMENT_APPENDED,[Q.PLAYER_VIDEO_ELEMENT_REMOVED]:Q.LIST_PLAYER_VIDEO_ELEMENT_REMOVED,[Q.PLAYER_DISPLAYED_CUES_CHANGED]:Q.LIST_PLAYER_DISPLAYED_CUES_CHANGED,[Q.LIST_PLAYER_VIDEO_PROFILE_CHANGED]:Q.PLAYER_VIDEO_PROFILE_CHANGED,[Q.LIST_PLAYER_PLAYBACK_SPEED_CHANGED]:Q.PLAYER_PLAYBACK_SPEED_CHANGED,[Q.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED]:Q.PLAYER_SUBTITLE_LANGUAGES_LOADED})}_translatePosition(e){var t,n,i;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translatePosition)||void 0===n?void 0:n.call(t,e))&&void 0!==i?i:e}_translateDuration(e){var t,n,i;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translateDuration)||void 0===n?void 0:n.call(t,e))&&void 0!==i?i:e}_handleProgress(e){const{data:t}=e;this.emit(Q.LIST_PLAYER_PROGRESS,Object.assign(Object.assign({},t),{position:this._translatePosition(t.position)}))}_handleBeforeLoad(e){const{data:t}=e;this.emit(Q.LIST_PLAYER_BEFORE_PLAYER_LOAD,Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},t.options),{position:this._translatePosition(t.options.position)})}))}_handlePlayerInitError(e){this._trackPlayerPromise.reject(new ne(i.LIST_PLAYER_NO_TRACK_PLAYER,e.message||"Track player promise was rejected."))}_handleCapped(){const e=this._currentTrack;e&&this.emit(Q.LIST_PLAYER_CAPPED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList})}_handlePlaying(e){const t=this._currentTrack;t&&this.emit(Q.LIST_PLAYER_PLAYING,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handlePaused(e){const t=this._currentTrack;t&&this.emit(Q.LIST_PLAYER_PAUSED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handleCanPreload(){this._preloadUpcomingTrack().catch((()=>{}))}_handleEnded(){const e=this._currentTrack;e&&(this.emit(Q.LIST_PLAYER_TRACK_ENDED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(s.TRACK_DONE))}_handleTimeout(){const e=this._currentTrack;e&&(this.emit(Q.LIST_PLAYER_TRACK_TIMEOUT,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(s.TRACK_ERROR))}_handlePositionChanged(e){const t=this._currentTrack;t&&this.emit(Q.LIST_PLAYER_POSITION_CHANGED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handleDurationChanged(e){const t=this._currentTrack;t&&this.emit(Q.LIST_PLAYER_DURATION_CHANGED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position),duration:this._translateDuration(e.data.duration)})}_handlePlayedThresholdReached(e){const t=this._currentTrack;t&&this.emit(Q.LIST_PLAYER_PLAYED_THRESHOLD_REACHED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,threshold:e.data.threshold,position:this._translatePosition(e.data.position)})}_handleError(e){const t=this._currentTrack,n=e.data;if(!t)return;n.position=this._translatePosition(e.data.position),this.emit(Q.LIST_PLAYER_ERROR,n),this.emitSync(Q.LIST_PLAYER_ERROR_SYNC,n);const i=!!n.error&&n.error.listPlayerIgnore;i||this._listErrorCount++,n.canPlayNext&&(i||this._listErrorCount<=this._maxListErrors?this.next(s.TRACK_ERROR):this.emit(Q.LIST_PLAYER_MAX_LIST_ERRORS_REACHED,{count:this._listErrorCount,threshold:this._maxListErrors}))}_handleTrackLoaded(e){this.emitSync(Q.LIST_PLAYER_TRACK_LOADED,e)}_incrementSeqId(){return this._currentSeqId>=9007199254740991?this._currentSeqId=0:this._currentSeqId+=1,this._currentSeqId}_getTrackPlayer(){return this._trackPlayerPromise.promise}_setListIndex(e,t){const n=t.index&&-1!==t.index?t.index:0;return Promise.all([e,t,e.startAt(n)])}_setListOptions([e,t,n]){return Promise.all([e.setShuffle(!!this._shuffled),e.setRepeatMode(this._repeatMode)]).then((()=>[e,t]))}_replaceCurrentList([e,t]){return this.emitSync(Q.LIST_PLAYER_BEFORE_LIST_CHANGE,{newList:e,newOptions:t,oldList:this._loadedList,oldOptions:this._loadedOptions}),this._loadedList=e,this._loadedOptions=t,this._listPlayCount=0,this._listErrorCount=0,this.emit(Q.LIST_PLAYER_LIST_CHANGED,{list:e,options:t}),ee.SUCCESS}_changeTrack(e,t,n){if(this._currentSeqId!==n)return Promise.resolve(ee.CANCELLED);this.emitSync(Q.LIST_PLAYER_BEFORE_TRACK_LOAD,{list:this._loadedList,newTrack:e,oldTrack:this._currentTrack}),this._uid++;const i=++this._listPlayCount,o=this._loadedOptions;let r,a=!0,c=0,l=3e4;o&&(1===i?(a=!o.paused,c=o.initialPosition||o.position||0):c=o.position||0);const u=t===s.TRACK_DONE;if(e.options){const t=e.options;void 0!==t.paused&&(a=!t.paused),void 0!==t.position&&(c=t.position),void 0!==t.playedThreshold&&(l=t.playedThreshold),void 0!==t.loadingTimeout&&(r=t.loadingTimeout)}this._currentTrack=e,this._currentTrackOptions={reason:t,paused:!a,position:c,playedThreshold:l};const d=this._handleTrackLoaded.bind(this,{uid:this._uid,track:this._currentTrack,options:this._currentTrackOptions,list:this._loadedList});return this._getTrackPlayer().then((t=>this._currentSeqId!==n?ee.CANCELLED:(Promise.resolve(t.load(e,{uriProperty:"playableURI",autoplay:a,position:c,playedThreshold:l,continuePrevious:u,loadingTimeout:r},d)).catch((()=>{})),ee.SUCCESS)))}_preloadUpcomingTrack(){const e=this._loadedList;return e?e.peekNext({reason:s.TRACK_DONE,listConstants:bn}).then((e=>e===bn.FORBIDDEN?ee.FORBIDDEN:e===bn.NULL_VALUE?ee.INVALID:e===bn.LIST_END?ee.LIST_END:In(e)&&e.playable?this.preloadTrack(e):ee.INVALID)):Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}preloadTrack(e){return this._getTrackPlayer().then((t=>(t.preload(e).catch((()=>{})),ee.SUCCESS)))}activateElement(){return this._getTrackPlayer().then((e=>(e.activateElement(),ee.SUCCESS)))}load(e,t){const n=function(e={}){const t={index:-1,position:0,initialPosition:0,playbackSpeed:1,duration:-1,paused:!1,reason:s.UNKNOWN};return void 0!==e.index&&(t.index=e.index),void 0!==e.position&&(t.position=e.position),void 0!==e.initialPosition&&(t.initialPosition=e.initialPosition),void 0!==e.duration&&(t.duration=e.duration),void 0!==e.paused&&(t.paused=e.paused),void 0!==e.playbackSpeed&&(t.playbackSpeed=e.playbackSpeed),void 0!==e.reason&&(t.reason=e.reason),t}(t||this._loadedOptions||{});return this._setListIndex(e,n).then(this._setListOptions).then(this._replaceCurrentList)}play(e,t){return this.load(e,t).then((()=>{if(this._loadedList!==e)return ee.CANCELLED;const t=this._loadedOptions?this._loadedOptions.reason:s.UNKNOWN;return this.next(t)}))}canChangeTrack(){return this._loadedList?this._loadedList.peekNext({reason:s.FORWARD_BUTTON,listConstants:bn}).then((e=>e!==bn.FORBIDDEN)):Promise.resolve(!0)}next(e){if(!e)return Promise.reject(new ne(i.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(Q.LIST_PLAYER_BEFORE_NEXT,{list:t,reason:e});const n=this._incrementSeqId(),o={reason:e,listConstants:bn};return t.next(o).then((i=>this._currentSeqId!==n?ee.CANCELLED:i===bn.FORBIDDEN?ee.FORBIDDEN:i===bn.NULL_VALUE?this.next(e):i===bn.LIST_END?(this.emit(Q.LIST_PLAYER_LIST_ENDED,{list:t,reason:s.END_PLAY}),this.clear(e),ee.LIST_END):In(i)?i.playable?this._changeTrack(i,e,n):(this.emit(Q.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.next(e)):ee.INVALID))}previous(e){if(!e)return Promise.reject(new ne(i.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(Q.LIST_PLAYER_BEFORE_PREVIOUS,{list:t,reason:e});const n=this._incrementSeqId(),o={reason:e,listConstants:bn};return t.previous(o).then((i=>this._currentSeqId!==n?ee.CANCELLED:i===bn.FORBIDDEN?ee.FORBIDDEN:i===bn.NULL_VALUE?this.previous(e):i===bn.LIST_START?(this.emit(Q.LIST_PLAYER_LIST_ENDED,{list:t,reason:s.END_PLAY}),this.clear(e),ee.LIST_END):In(i)?i.playable?this._changeTrack(i,e,n):(this.emit(Q.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.previous(e)):ee.INVALID))}pause(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.pause().then((()=>ee.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?ee.CANCELLED:ee.FORBIDDEN)))):Promise.resolve(ee.SUCCESS):Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}resume(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.resume().then((()=>ee.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?ee.CANCELLED:ee.FORBIDDEN)))):Promise.resolve(ee.SUCCESS):Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}togglePlay(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.togglePlay().then((()=>ee.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?ee.CANCELLED:ee.FORBIDDEN)))):Promise.resolve(ee.SUCCESS):Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}stop(e){const t={reason:e||s.UNKNOWN},n=this._currentTrack;return n&&n.logData&&(t.source=n.logData.source,t.playbackService=n.logData.playbackService),this._incrementSeqId(),this._getTrackPlayer().then((e=>(e.stop(t),this.emit(Q.LIST_PLAYER_STOPPED,{uid:this._uid,options:this._currentTrackOptions,list:this._loadedList}),ee.SUCCESS)))}clear(e){return this.stop(e).then((()=>(this._loadedList=null,this._loadedOptions=null,this._currentTrack=null,this._currentTrackOptions=null,this.emit(Q.LIST_PLAYER_CLEARED,null),ee.SUCCESS)))}setShuffle(e){const t=!!e;if(this._shuffled!==t){this._shuffled=t,this.emit(Q.LIST_PLAYER_SHUFFLE_CHANGED,{player:this,shuffled:t});const e=this._loadedList;e&&e.setShuffle(this._shuffled)}return Promise.resolve(ee.SUCCESS)}setRepeatMode(e){if(!(e in Tn))return Promise.reject(new ne(i.LIST_PLAYER_INVALID_ARGUMENT,"The value of repeat mode is not a correct RepeatMode enum value"));if(this._repeatMode!==e){this._repeatMode=e,this.emit(Q.LIST_PLAYER_REPEAT_MODE_CHANGED,{player:this,repeatMode:e});const t=this._loadedList;t&&t.setRepeatMode(this._repeatMode)}return Promise.resolve(ee.SUCCESS)}getVolume(){return this._getTrackPlayer().then((e=>e.getVolume()))}setVolume(e,t=null){return this._getTrackPlayer().then((n=>(n.setVolume(e,{commandId:null!=t?t:void 0}),this.emit(Q.LIST_PLAYER_VOLUME_CHANGED,{volume:e,commandId:t}),ee.SUCCESS)))}seek(e,t=s.SEEK){var n,o;const r=this._loadedList;if(!r)return Promise.reject(new ne(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));if("function"==typeof r.allowSeeking&&!r.allowSeeking())return Promise.reject(new ne(i.LIST_PLAYER_FORBIDDEN,"The operation is not allowed."));const a=null!==(o=null===(n=r.handleSeek)||void 0===n?void 0:n.call(r,e,{reason:t,listConstants:bn}))&&void 0!==o?o:e;return a===bn.PAUSE?this.pause().then((t=>(this.emit(Q.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:a}),t))):a===bn.IGNORE?(this.emit(Q.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:a}),Promise.resolve(ee.SUCCESS)):this._currentTrack?this._getTrackPlayer().then((e=>(e.seek(a),ee.SUCCESS))):Promise.resolve(ee.SUCCESS)}getListConstants(){return bn}getLoadedList(){return this._loadedList}getLoadedOptions(){return this._loadedOptions}getPlayerState(){return this._getTrackPlayer().then((e=>{const t=e.getPlayerState();return Object.assign(Object.assign({},t),{position:this._translatePosition(t.position),duration:this._translateDuration(t.duration)})}))}getState(){return this.getPlayerState().then((e=>({playbackState:e,track:this._currentTrack,list:this._loadedList,options:this._loadedOptions})))}getMediaConfig(){return this._getTrackPlayer().then((e=>e.getMediaConfig()))}hideSubtitles(){return this._getTrackPlayer().then((e=>e.hideSubtitles())).then((()=>ee.SUCCESS))}showSubtitles(){return this._getTrackPlayer().then((e=>e.showSubtitles())).then((()=>ee.SUCCESS))}areSubtitlesShown(){return this._getTrackPlayer().then((e=>e.areSubtitlesShown()))}getSubtitleLanguages(){return this._getTrackPlayer().then((e=>e.getSubtitleLanguages()))}getActiveSubtitleLanguage(){return this._getTrackPlayer().then((e=>{var t;return null!==(t=e.getActiveSubtitleLanguage())&&void 0!==t?t:null}))}deactivateCueEvents(){return this._getTrackPlayer().then((e=>e.deactivateCueEvents())).then((()=>ee.SUCCESS))}activateCueEvents(){return this._getTrackPlayer().then((e=>e.activateCueEvents())).then((()=>ee.SUCCESS))}getCurrentBandwidth(){return this._getTrackPlayer().then((e=>e.getCurrentBandwidth()))}setSubtitleLanguage(e){return this._getTrackPlayer().then((t=>t.setSubtitleLanguage(e))).then((()=>ee.SUCCESS))}setPlaybackSpeed(e){return this._getTrackPlayer().then((t=>t.setPlaybackSpeed(e))).then((e=>e?ee.SUCCESS:ee.FORBIDDEN))}getStatistics(){return this._getTrackPlayer().then((e=>e.getStatistics()))}getAudioProcessor(){return this._getTrackPlayer().then((e=>e.getAudioProcessor()))}}const Nn=T.P.forTag("playback.init");function Ln(e){return new Promise(((t,n)=>{var i,o,r,a,s,c,l,u,d,p,f;if(!e.transport)return void n(new TypeError("Argument transport is required."));if("undefined"!=typeof window){("boolean"==typeof window.isSecureContext?window.isSecureContext:function(){if("undefined"==typeof window||!window.location)return!1;const e=window.location;if("https"===e.protocol||"file"===e.protocol)return!0;const t=e.hostname;return!!/^127(\.[0-255]){3}$|^locahost\.?$|\.localhost\.?$/.test(t)}())||null===(i=window.console)||void 0===i||i.warn("%cDRM might not be available from unsecure contexts","background: #222; color: #bada55; font-size: 40px")}if(e.playerContainerManager&&("function"!=typeof(null===(o=e.playerContainerManager)||void 0===o?void 0:o.eject)||"function"!=typeof(null===(r=e.playerContainerManager)||void 0===r?void 0:r.inject)))return void n(new TypeError("Both inject and eject PlayerContainerManager functions must be present."));const{transport:h}=e,[m="",g=""]=(e.sdkId||"").split(":"),_=new _n,v=Object.assign(Object.assign({},e),{abrManager:_,initialBandwidthSampler:En(h,_),tracker:on.create(),audioResolver:new Qt(h),videoResolver:new rn(h),licenseURLResolver:new sn({transport:h,sdk:{name:m,version:g},securityLevel:e.securityLevel,useTestLicenseServer:e.useTestLicenseServer}),newBufferPerTrack:null===(a=e.newBufferPerTrack)||void 0===a||a,preinitMediaElement:null===(s=e.preinitMediaElement)||void 0===s||s,audioProcessorOptions:Object.assign(Object.assign({},e.audioProcessorOptions),{disable:null!==(l=null===(c=e.audioProcessorOptions)||void 0===c?void 0:c.disable)&&void 0!==l?l:!!e.createPlayer})});e.unauthenticatedLogs&&!(null===(u=e.loggerOptions)||void 0===u?void 0:u.endpoint)&&(e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{endpoint:"https://spclient.wg.spotify.com/melody/unauth"})),(null===(d=null==e?void 0:e.loggerOptions)||void 0===d?void 0:d.deviceInfo)||Promise.all([null===(p=e.loggerOptions)||void 0===p?void 0:p.platform,null===(f=e.loggerOptions)||void 0===f?void 0:f.clientVersion]).then((([t,n])=>{e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{deviceInfo:{platform:t,version:n}})})),Wt.create(v).then((t=>{const n=Object.assign({disableMux:!0},e.loggerOptions),i=function(e){return new cn(e)}(Object.assign(Object.assign({},n),{transport:h,sdkId:e.sdkId,platform:Promise.resolve(n.deviceInfo).then((e=>{var t;return null!==(t=null==e?void 0:e.platform)&&void 0!==t?t:""})),clientVersion:Promise.resolve(n.deviceInfo).then((e=>{var t;return null!==(t=null==e?void 0:e.version)&&void 0!==t?t:""}))})),o=qt.create({transport:h,player:t,logSender:i});return n.disableMux||mn.create({player:t,mux:q,envKey:null==n?void 0:n.muxEnvKey,sdk:m,sdkVersion:g,deviceInfo:n.deviceInfo,muxCustomDimensions:n.muxCustomDimensions}).ready().then((()=>Nn.info("MuxReporter ready")),(e=>Nn.error("Failed to instantiate MuxReporter",null==e?void 0:e.message))),{player:t,logger:o}})).then(t,n)}))}const Rn=T.P.forTag("media_session");function Pn(e){return Math.round(1e3*e)}class kn{constructor(e){this._currentURI=null,this._streamer=e.streamer,this._handleAction=this._handleAction.bind(this),this._updateMediaSession=this._updateMediaSession.bind(this),this._updateMediaSessionMetadata=this._updateMediaSessionMetadata.bind(this),this._init()}static create(e){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&"mediaSession"in navigator&&"MediaMetadata"in window?new kn(e):(Rn.warn("The MediaSession API is not supported."),null)}_init(){this._streamer.on("state_changed",this._updateMediaSession)}_handleAction(e){switch(e.action){case"play":this._streamer.resume();break;case"pause":this._streamer.pause();break;case"seekto":{const t=e.seekTime;null!=t&&this._streamer.seek(Pn(t))}break;case"seekforward":{const t=e.seekOffset;this._streamer.getCurrentState().then((e=>{if(!e)return;const{position:n,duration:i}=e,o=Math.min(i,Math.max(0,t?n+Pn(t):n+15e3));this._streamer.seek(o)}))}break;case"seekbackward":{const t=e.seekOffset;this._streamer.getCurrentState().then((e=>{if(!e)return;const{position:n}=e,i=Math.max(0,t?n-Pn(t):n-15e3);this._streamer.seek(i)}))}break;case"nexttrack":this._streamer.nextTrack();break;case"previoustrack":this._smartPreviousTrack()}}_clearHandlers(){navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("seekto",null),navigator.mediaSession.setActionHandler("nexttrack",null),navigator.mediaSession.setActionHandler("previoustrack",null),navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("seekbackward",null)}_smartPreviousTrack(){this._streamer.getCurrentState().then((e=>{if(!e)return Promise.reject(new g(o.HARMONY_NO_TRACKS_LOADED,"No current state."));const{disallows:t,position:n,track_window:i}=e;return t.seeking||n<3e3&&i.previous_tracks.length>0?this._streamer.previousTrack():this._streamer.seek(0)}))}_updateMediaSessionMetadata({name:e,artists:t,album:n}){var i;const o=null===(i=null==n?void 0:n.images)||void 0===i?void 0:i.map((({url:e,width:t,height:n})=>({src:e,sizes:`${t}x${n}`}))),r={title:e||"",artist:(null==t?void 0:t.map((e=>null==e?void 0:e.name)).join(", "))||"",album:(null==n?void 0:n.name)||"",artwork:o};navigator.mediaSession.metadata=new window.MediaMetadata(r)}_updateMediaSession({data:e}){var t;const n=e.state,i=null===(t=null==n?void 0:n.track_window)||void 0===t?void 0:t.current_track;if(!n||!i)return this._currentURI=null,navigator.mediaSession.metadata=null,navigator.mediaSession.playbackState="none",void this._clearHandlers();navigator.mediaSession.playbackState=n.paused?"paused":"playing",this._currentURI!==i.uri&&(this._currentURI=i.uri,this._updateMediaSessionMetadata(i));const{position:o,duration:r}=n,a=Math.min(Math.max(0,o),r);r&&navigator.mediaSession.setPositionState({position:a,duration:r}),navigator.mediaSession.setActionHandler("play",this._handleAction),navigator.mediaSession.setActionHandler("pause",this._handleAction);const s=n.disallows;navigator.mediaSession.setActionHandler("seekto",s.seeking?null:this._handleAction),navigator.mediaSession.setActionHandler("nexttrack",s.skipping_next?null:this._handleAction),navigator.mediaSession.setActionHandler("previoustrack",this._handleAction),"episode"===i.type?(navigator.mediaSession.setActionHandler("seekforward",this._handleAction),navigator.mediaSession.setActionHandler("seekbackward",this._handleAction)):(navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("seekbackward",null))}}class Dn extends c.vp{constructor(e){super(),this._client=e.client,this._initialVolume=e.initialVolume,this._listPlayer=e.listPlayer,this._playerPromise=e.playerPromise,this._playbackServiceClient=e.playbackServiceClient,this._playbackStateObserver=e.playbackStateObserver,this._stopOnBackground=e.stopOnBackground,this._enableMediaSession=e.enableMediaSession,this._init()}_init(){this._client.addListeners({before_disconnect:this._onClientBeforeDisconnect.bind(this),before_offline_disconnect:this._onClientBeforeOfflineDisconnect.bind(this)});const e=this._listPlayer;e.addListeners({[Q.LIST_PLAYER_CAPPED]:this._onCapped.bind(this),[Q.LIST_PLAYER_TRACK_ENDED]:this._onTrackEnded.bind(this),[Q.LIST_PLAYER_BEFORE_VOLUME_CHANGE]:this._onBeforeVolumeChange.bind(this),[Q.LIST_PLAYER_VOLUME_CHANGED]:this._onVolumeChanged.bind(this),[Q.LIST_PLAYER_ERROR]:e=>{this._onError(e,f.PLAYBACK)}}),this.proxyEmitAll(e,{[Q.LIST_PLAYER_AUTOPLAY_FAILED]:"autoplay_failed",[Q.LIST_PLAYER_TRACK_LOADED]:"track_loaded",[Q.LIST_PLAYER_DURATION_CHANGED]:"duration_changed",[Q.LIST_PLAYER_POSITION_CHANGED]:"position_changed",[Q.LIST_PLAYER_PROGRESS]:"progress",[Q.LIST_PLAYER_BUFFER_STALLED]:"stalled",[Q.LIST_PLAYER_BUFFERING_END]:"buffering_end",[Q.LIST_PLAYER_BUFFERING_START]:"buffering_start",[Q.LIST_PLAYER_REBUFFERING_END]:"rebuffering_end",[Q.LIST_PLAYER_REBUFFERING_START]:"rebuffering_start",[Q.LIST_PLAYER_MAX_LIST_ERRORS_REACHED]:"max_list_errors_reached",[Q.LIST_PLAYER_VIDEO_ELEMENT_APPENDED]:"video_element_appended",[Q.LIST_PLAYER_VIDEO_ELEMENT_REMOVED]:"video_element_removed",[Q.LIST_PLAYER_LIST_ENDED]:"context_ended",[Q.LIST_PLAYER_SEEK_HANDLED]:"streamer_seek_handled",[Q.LIST_PLAYER_DISPLAYED_CUES_CHANGED]:"displayed_cues_changed",[Q.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED]:"subtitle_languages_loaded",[Q.LIST_PLAYER_PLAYBACK_SPEED_CHANGED]:"speed_changed"}),this.proxyEmitAllSync(e,{[Q.REPORTING_START]:"reporting_start",[Q.REPORTING_FIRST_QUARTILE]:"reporting_first_quartile",[Q.REPORTING_MIDPOINT]:"reporting_midpoint",[Q.REPORTING_THIRD_QUARTILE]:"reporting_third_quartile",[Q.REPORTING_COMPLETE]:"reporting_complete",[Q.REPORTING_PAUSE]:"reporting_pause",[Q.REPORTING_RESUME]:"reporting_resume",[Q.REPORTING_CREATIVE_VIEW]:"reporting_creative_view",[Q.REPORTING_ERROR]:"reporting_error"});const t=this._playbackServiceClient;t.addListeners({logout:this._onPlaybackClientLogout.bind(this),error:e=>{this._onError(e,e.data.source)}}),this.proxyEmitAll(t,{max_subscriptions_reached:"max_subscriptions_reached",deregistered:"deregistered",registered:"registered",registration_aborted:"registration_aborted",internal_endcontent:"internal_endcontent"}),this.proxyEmit(this._playbackStateObserver,"state_changed","state_changed"),this._stopOnBackground&&document.addEventListener&&document.addEventListener("visibilitychange",(()=>{document.hidden&&this.stop()&&this.emitSync("stopped_on_background",null)})),this._enableMediaSession&&kn.create({streamer:this}),this._playerPromise.then((e=>{e.setVolume(this._initialVolume),this.emit("player_initialization_done",null)}),(e=>{this.emit("player_initialization_failed",{reason:e.message,error:e})}))}_assertOperationSuccess(e){return e===ee.SUCCESS}_onTrackEnded(){this.emit("track_ended",null)}_onClientBeforeDisconnect(e){e.data.awaitPromise(this.deregister().catch((()=>{})))}_onClientBeforeOfflineDisconnect(e){e.data.awaitPromise(this.pause().catch((()=>{})))}_onBeforeVolumeChange(e){var t;this.emitSync("before_volume_change",{volume:e.data.volume,remote:!!(null===(t=e.data.options)||void 0===t?void 0:t.commandId)}).defaultPrevented&&e.preventDefault()}_onVolumeChanged(e){this.emit("volume_changed",{volume:e.data.volume,remote:!!e.data.commandId})}_onCapped(){this.emit("playback_capped",null)}_onError(e,t){const{error:n}=e.data;n&&(n.registration&&this.emit("registration_error",{error:n}),this.emit("error",{source:t,error:n}),this._client.notifyError(t,n))}_onPlaybackClientLogout(){this.emit("logged_out",null)}stop(){return this._playbackServiceClient.stop()}register(){return this._playbackServiceClient.register()}deregister(){return this._playbackServiceClient.deregister()}resume(){return this._listPlayer.resume().then(this._assertOperationSuccess)}pause(){return this._listPlayer.pause().then(this._assertOperationSuccess)}nextTrack(e=s.FORWARD_BUTTON){return this._listPlayer.next(e).then(this._assertOperationSuccess)}canChangeTrack(){return this._listPlayer.canChangeTrack()}previousTrack(e=s.BACK_BUTTON){return this._listPlayer.previous(e).then(this._assertOperationSuccess)}togglePlay(){return this._listPlayer.togglePlay().then(this._assertOperationSuccess)}setVolume(e){return this._listPlayer.setVolume(e).then(this._assertOperationSuccess)}getVolume(){return this._listPlayer.getVolume()}seek(e){return this._listPlayer.seek(e).then(this._assertOperationSuccess)}getCurrentState(){return this._playbackStateObserver.getCurrentState()}getVideoVariants(){return this._playerPromise.then((e=>e.getVideoVariants()))}setPreferredBitrate(e){return this._playerPromise.then((t=>t.setPreferredBitrate(e).then(this._assertOperationSuccess)))}setVideoResolution(e){return this._playerPromise.then((t=>t.setVideoResolution(e)))}setBackgrounded(e){return this._playerPromise.then((t=>t.setBackgrounded(e)))}activateElement(){return this._playerPromise.then((e=>e.activateElement()))}hideSubtitles(){return this._listPlayer.hideSubtitles().then(this._assertOperationSuccess)}showSubtitles(){return this._listPlayer.showSubtitles().then(this._assertOperationSuccess)}areSubtitlesShown(){return this._listPlayer.areSubtitlesShown()}getSubtitleLanguages(){return this._listPlayer.getSubtitleLanguages()}getActiveSubtitleLanguage(){return this._listPlayer.getActiveSubtitleLanguage()}setSubtitleLanguage(e){return this._listPlayer.setSubtitleLanguage(e).then(this._assertOperationSuccess)}getMediaConfig(){return this._listPlayer.getMediaConfig()}setPlaybackSpeed(e){return this._listPlayer.setPlaybackSpeed(e).then(this._assertOperationSuccess)}deactivateSubtitleEvents(){return this._listPlayer.deactivateCueEvents().then(this._assertOperationSuccess)}activateSubtitleEvents(){return this._listPlayer.activateCueEvents().then(this._assertOperationSuccess)}hasOptimisticUpdates(){return this._playbackServiceClient.hasOptimisticUpdates()}}var wn,Mn=n(11317);class xn extends Error{constructor(e,t){super(t),this.status=-1,this.maxedSubscriptions=!1,this.unrecoverable=!1,this.debug={},this.registration=!1,this.code=e,this.name="TrackPlayerAPIClientError"}static fatal(e,t){const n=new xn(e,t);return n.unrecoverable=!0,n}}class Un{constructor(e,t){this._stateMachine=null,this._currentState=null,this._currentStateIndex=null,this._pausedState=!1,this._initialPlaybackPosition=null,this._contextMetadata=null,this._uri=e,this._manifestTrackResolver=t}static create(e,t){return new Un(e,t)}setPaused(e){this._pausedState=e}isPaused(){return this._currentStateIndex&&this._currentStateIndex<0&&this._currentState&&this._currentState.transitions.advance?!!this._currentState.transitions.advance.paused:this._pausedState}setInitialPosition(e){this._initialPlaybackPosition=e}setStateMachine(e){this._stateMachine=e}setDeviceId(e){this._deviceId=e}setContextMetadata(e){this._contextMetadata=e}getContextMetadata(){return this._contextMetadata||{}}startAtState(e){const t=this._stateMachine&&this._stateMachine.states[e.state_index];if(!t)throw new xn(o.TP_MISSING_INITIAL_STATE,"Invalid state reference.");const n=t.transitions;this._currentStateIndex=-1,this._currentState={decoy:!0,paused:!!e.paused,track:-1,state_id:null,transitions:{advance:e,show_next:n.show_next,show_prev:n.show_prev,skip_next:e,skip_prev:n.skip_prev},options:t.options,duration_override:t.duration_override,position_offset:t.position_offset}}setCurrentState(e){const t=e.state_index;this._currentStateIndex=t,this._currentState=this._stateMachine&&this._stateMachine.states[t]}getStateMachine(){return this._stateMachine}getInternalStateRef(){let e=this._pausedState,t=this._currentStateIndex;if(!t)return null;if(t&&t<0){const n=this._currentState&&this._currentState.transitions.advance;n&&(t=n.state_index,e=!!n.paused)}return{paused:e,state_index:t}}getStateRef(){const e=this._stateMachine;if(!e||null===this._currentStateIndex)return null;let t,n;if(this._currentStateIndex<0){const i=this._currentState&&this._currentState.transitions.advance;i&&(t=e.states[i.state_index],n=i.paused)}else t=e.states[this._currentStateIndex],n=this._pausedState;return t?{state_machine_id:e.state_machine_id,state_id:t.state_id,paused:!!n}:null}getCurrentTrack(){const e=this._stateMachine;if(!e||null===this._currentStateIndex)return null;let t;if(this._currentStateIndex<0){const n=this._currentState&&this._currentState.transitions.advance;n&&(t=e.states[n.state_index])}else t=e.states[this._currentStateIndex];return t?e.tracks[t.track]:null}startAt(){return Promise.resolve(ee.SUCCESS)}setShuffle(){return Promise.resolve(ee.SUCCESS)}setRepeatMode(){return Promise.resolve(ee.SUCCESS)}next(e){const t=this._currentState;let n=null;if(t){const i=t.transitions;if(e.reason===s.FORWARD_BUTTON)"skip_next"in i&&(n=i.skip_next);else"advance"in i&&(n=i.advance)}return this._transitionTo(e,n,!1)}peekNext(e){const t=this._currentState;let n=null;if(t){const i=t.transitions;if(e.reason===s.FORWARD_BUTTON)"skip_next"in i&&(n=i.skip_next);else"advance"in i&&(n=i.advance)}return this._transitionTo(e,n,!0)}previous(e){const t=this._currentState;let n=null;if(t){n=t.transitions.skip_prev}return this._transitionTo(e,n,!1)}translatePosition(e){var t,n;return(null!==(n=null===(t=this._currentState)||void 0===t?void 0:t.position_offset)&&void 0!==n?n:0)+e}translateDuration(e){var t,n;return null!==(n=null===(t=this._currentState)||void 0===t?void 0:t.duration_override)&&void 0!==n?n:e}handleSeek(e,t){var n;return(null===(n=this._currentState)||void 0===n?void 0:n.duration_override)&&t.reason!==s.REMOTE?t.listConstants.IGNORE:e}allowSeeking(){return!!this._currentState&&!this._currentState.disallow_seeking}_transitionTo(e,t,n=!1){return new Promise((i=>{var o;const r=e.reason,a=e.listConstants;if(!t)return i(a.FORBIDDEN);const s=this._stateMachine;if(!s)return i(a.NULL_VALUE);const c=s.states[t.state_index];if(!c)return i(a.NULL_VALUE);const l=s.tracks[c.track];if(!(null===(o=null==l?void 0:l.metadata)||void 0===o?void 0:o.uri))return i(a.NULL_VALUE);if(!this._currentState)return i(a.NULL_VALUE);const u=this._currentState,d=u.decoy?!!u.paused:t.paused;n||(this._currentState=c,this._currentStateIndex=t.state_index,this._pausedState=!!d);let p=0;return n||null===this._initialPlaybackPosition?"initial_playback_position"in c&&(p=c.initial_playback_position||0):(p=this._initialPlaybackPosition,this._initialPlaybackPosition=null),this._manifestTrackResolver.resolveFromStateTrack(l).then((e=>{var t,n;if(!e)return i(a.NULL_VALUE);let o=this._uri;l.metadata&&l.metadata.context_uri&&(o=l.metadata.context_uri);const s=r,u=l.ms_played_until_update,f={playbackQuality:e.playbackQuality,hifiStatus:e.hifi_status},h={uri:e.uri,playableURI:e.uri,fileId:e.fileId,resolvedURL:e.resolvedURL,playable:e.playable,isAd:e.isAd,format:e.format,fileFormat:e.fileFormat,mediaType:e.mediaType,noManifest:e.noManifest,metadata:f,options:{position:p,paused:d,playedThreshold:u,useDefaultPlaybackSpeed:!(0,Mn.hn)(e.uri),playbackSpeed:null===(n=null===(t=this._currentState)||void 0===t?void 0:t.options)||void 0===n?void 0:n.playback_speed},logData:{noLog:!!e.noLog,noTSV:!!e.noTSV,deviceId:this._deviceId,playbackId:c.state_id?c.state_id:void 0,reason:s,displayTrack:e.uri,playContext:o,impressionURL:e.impressionURL,impressionURLs:e.impressionURLs,format:{codec:e.format,bitrate:e.bitrate},uriType:e.uriType,displayTitle:l.metadata.name,displayGroup:l.metadata.group_name,displayDuration:l.metadata.duration,playbackService:"track-playback"},stateId:c.state_id?c.state_id:void 0,audioGain:e.gainDb};return i(h)}))}))}getCurrentState(){return this._currentState}}!function(e){e.ON="ON",e.OFF="OFF",e.NONE="NONE"}(wn||(wn={}));const Vn=/^disallow_([^]+)_reasons$/;const Fn=T.P.forTag("tp.stream.PlaybackStateObserver");class Bn extends c.vp{constructor(e,t={}){super(),this._tpApiClient=e,this._numPreviousTracks=t.numPrevious||2,this._numNextTracks=t.numNextTracks||2,this._currentState=null,this._init()}static create(e,t){return new Bn(e,t)}_init(){this._tpApiClient.on("state_changed",this._onStateChanged.bind(this)),this._tpApiClient.on("state_cleared",this._onStateCleared.bind(this))}_onStateChanged(e){var t,n,i,o,r,a,s,c,l,u,d;const{stateMachine:p,stateRef:f,position:h,paused:m,loading:g,currentTrackInfo:_,contextMetadata:v}=e.data,y=null==p?void 0:p.states;if(!p||!(null==y?void 0:y.length)||!f)return void Fn.warn("_onStateChanged called with no current state",e);const E=y[f.state_index],b=p.tracks[null==E?void 0:E.track];if(!E||!b)return void Fn.warn("_onStateChanged called with no current state or track",e);let S=null!==(t=_.duration)&&void 0!==t?t:0;const A=this._createTrackWindow(p,E,S);S||(S=null!==(i=null===(n=A.current_track)||void 0===n?void 0:n.duration_ms)&&void 0!==i?i:0);!(null!==(r=!!(null===(o=E.options)||void 0===o?void 0:o.playback_speed))&&void 0!==r&&r)&&_.isPlaybackSpeedRestricted&&(E.restrictions=Object.assign({disallow_setting_playback_speed_reasons:["not_supported_by_content_type"]},E.restrictions));const T=function(e,t){const n={};for(const t in e)e.hasOwnProperty(t)&&"disallow_resuming_reasons"!==t&&"disallow_pausing_reasons"!==t&&(n[t]=e[t]);return t?n.disallow_pausing_reasons=["already_paused"]:n.disallow_resuming_reasons=["not_paused"],n}(E.restrictions||{},m),O=function(e){const t={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],o=!(!i||!i.length);t[n.replace(Vn,"$1")]=o}return t}(T),I={current:m?0:null!==(a=_.currentPlaybackSpeed)&&void 0!==a?a:1,selected:O.setting_playback_speed?1:null!==(s=_.selectedPlaybackSpeed)&&void 0!==s?s:1,restricted:!!O.setting_playback_speed},C={timestamp:Date.now(),context:{uri:null!==(l=null===(c=b.metadata)||void 0===c?void 0:c.context_uri)&&void 0!==l?l:null,metadata:v},position:h,duration:S,paused:m,playback_quality:null!==(u=_.playbackQuality)&&void 0!==u?u:An.UNKNOWN,playback_features:{hifi_status:null!==(d=_.hifiStatus)&&void 0!==d?d:wn.NONE,playback_speed:I,signal_ids:E.signals||[]},shuffle:this._getShuffleSetting(p),repeat_mode:this._getRepeatSetting(p),track_window:A,restrictions:T,disallows:O,loading:g,playback_speed:I.current,playback_id:E.state_id};this._currentState=C,this.emit("state_changed",{state:C?Object.assign({},C):null})}_createTrackWindow(e,t,n){const i=e.states;return{current_track:this._getTrackMetadata(e,t,n),next_tracks:this._getNextStates(t,i).map((t=>this._getTrackMetadata(e,t,null))).filter((e=>!!e)),previous_tracks:this._getPreviousStates(t,i).map((t=>this._getTrackMetadata(e,t,null))).filter((e=>!!e))}}_onStateCleared(){this._currentState=null,this.emit("state_changed",{state:null})}_getRepeatSetting(e){const t=e.attributes.options;return t.repeating_track?h.TRACK:t.repeating_context?h.CONTEXT:h.OFF}_getShuffleSetting(e){return e.attributes.options.shuffling_context}_getNextStates(e,t){const n=this._numNextTracks,i=[];let o=e;for(;o&&"show_next"in o.transitions&&o.transitions.show_next;){const e=t[o.transitions.show_next.state_index];if(e&&i.push(e),o=e,i.length>=n)break}return i}_getPreviousStates(e,t){const n=this._numPreviousTracks,i=[];let o=e;for(;o&&"show_prev"in o.transitions&&o.transitions.show_prev;){const e=t[o.transitions.show_prev.state_index];if(e&&i.unshift(e),o=e,i.length>=n)break}return i}_getTrackMetadata(e,t,n){var i;const o=null==e?void 0:e.tracks[t.track];if(!(null==o?void 0:o.metadata))return null;const r=o.metadata,a=o.manifest&&"manifest_ids_video"in o.manifest,s=o.track_type.toLowerCase(),c=(0,Mn.EC)(r.uri),l=r.linked_from_uri?(0,Mn.EC)(r.linked_from_uri):null,u=null===(i=r.episode_content_type)||void 0===i?void 0:i.toLowerCase(),d={episode:u||"unknown",track:"music",ad:"ad",interruption:"ad",media:"narration"};let p="unknown";return(null==c?void 0:c.type)&&c.type in d&&(p=d[c.type]),{id:c?c.id:null,uri:r.uri,type:(null==c?void 0:c.type)||"unknown",uid:t.track_uid,linked_from:{uri:r.linked_from_uri||null,id:l?l.id:null},media_type:a?"video":"audio",track_type:s,content_type:p,name:r.name,duration_ms:n||r.duration,artists:r.authors,album:{uri:r.group_uri,name:r.group_name,images:r.images},is_playable:!0,metadata:t.track_metadata||{}}}getCurrentState(){const e=this._currentState;if(e&&!e.paused){const t=Date.now(),n=e.position+(t-e.timestamp);e.position=n,e.timestamp=t}return Promise.resolve(this._currentState?Object.assign({},this._currentState):null)}}const Hn=/^https:\/\//,Gn={[D.FILE_URLS_MP3]:te.MP3,[D.FILE_URLS_EXTERNAL]:te.MP3,[D.FILE_IDS_MP3]:te.MP3,[D.FILE_IDS_MP4]:te.MP4,[D.FILE_IDS_MP4_DUAL]:te.MP4,[D.FILE_IDS_CBCS]:te.MP4_CBCS,[D.FILE_IDS_MP4FLAC]:te.MP4_FLAC,[D.MANIFEST_IDS_VIDEO]:te.MANIFEST_ID,[D.MANIFEST_URLS_VIDEO_AD]:te.AD_MANIFEST};class Kn{constructor(e){this._descriptor=e.descriptor,this._listPlayer=e.listPlayer}static create(e){return new Kn(e)}_resolveFromStateTrack(e,t,n){var i,o,r,a;const s=e.manifest,c=e.metadata.uri,l=(0,Mn.EC)(c);let u=null;for(const e of n){const n=s[e];if(n)for(const s of n){if(!s.file_id&&!Hn.test(null!==(i=s.file_url)&&void 0!==i?i:""))continue;const n=!(!l||l.type!==Mn.JM.AD&&l.type!==Mn.JM.INTERRUPTION);if(e===D.FILE_IDS_MP3&&!n)continue;let d,p;if(d=s.track_type?s.track_type.toLowerCase():e===D.MANIFEST_IDS_VIDEO?"video":"audio",s.format){const e=parseInt(s.format,10);mt[e]&&(p=e)}const f=null!==(o=s.bitrate)&&void 0!==o?o:e===D.FILE_IDS_MP4FLAC?1411200:128e3,h=null!==(r=s.bitrate)&&void 0!==r?r:e===D.FILE_IDS_MP4FLAC?7e5:128e3,m=Gn[e];if(u={uri:c,uriType:l&&l.type?l.type:void 0,fileId:null!==(a=s.file_id)&&void 0!==a?a:"",resolvedURL:s.file_url,mediaType:d,format:m,bitrate:h,fileFormat:null!=p?p:void 0,playbackQuality:s.audio_quality,hifi_status:s.hifi_status,impressionURL:s.impression_url,impressionURLs:s.impression_urls,gainDb:s.gain_db,isAd:n,noLog:!1,noTSV:n,noManifest:m===te.MP3,playable:!0},e===D.MANIFEST_IDS_VIDEO||f<=t)return u}}return u}resolveFromStateTrack(e){return Promise.all([Promise.resolve(this._descriptor),this._listPlayer.getCurrentBandwidth()]).then((([t,n])=>this._resolveFromStateTrack(e,n,t.getManifestFormats())))}}const Wn=1e3,Yn=0,jn=!1;class zn{constructor(e,t={}){this._cancelFn=null,this._deferredTimer=0,this._fn=e,this._cancelFn=t.cancel||null,this._threshold=t.threshold||Wn,this._ts=t.initialTimetamp||Yn,this._blockInital=t.blockInitial||jn}_deferFn(e){this._fn.apply(this._fn,e)}_deferPromise(e,t){this._fn.apply(this._fn,e).then((e=>{t.resolve(e)}))}sync(...e){const t=Date.now()-this._ts;if(this._ts=Date.now(),t{e.on("descriptor_changed",(()=>{this._parseDescriptor(e),this._updateDeviceInfo()}))}))}_onBeforeTrackChange(){var e,t;if(this._nextFinalizedDataPayload||this._switchingContext)return;const n=null!==(t=null===(e=this._currentContext)||void 0===e?void 0:e.getStateRef())&&void 0!==t?t:null,i=this._generateStatePayload(n,Jn.TRACK_DATA_FINALIZED);this._setSequenceNumber(i),this._nextFinalizedDataPayload=i}_onBeforeTrackLoad(e){var t;this._loading=!0,this._switchingContext=!1,this._currentTrackInfo.duration=void 0,this._stateEventPositionOverride=null===(t=e.data.newTrack.options)||void 0===t?void 0:t.position}_onBeforePlayerLoad(e){var t,n,i,o,r,a,s,c,l;const u=this._currentContext;if(!u)return;const d=u.getCurrentTrack(),p=u.getCurrentState(),f=null!==(n=null!==(t=null==p?void 0:p.duration_override)&&void 0!==t?t:null==d?void 0:d.metadata.duration)&&void 0!==n?n:0,{data:h}=e,m=h.track.metadata||{},g=null===(i=null==p?void 0:p.options)||void 0===i?void 0:i.playback_speed,_=null!==(o=!!g)&&void 0!==o&&o;this._currentTrackInfo={duration:f,mediaType:h.track.mediaType.toUpperCase(),fileFormat:h.track.fileFormat,bitrate:null===(a=null===(r=h.logData)||void 0===r?void 0:r.format)||void 0===a?void 0:a.bitrate,playbackQuality:m.playbackQuality,hifiStatus:m.hifiStatus,isPlaybackSpeedRestricted:_?!!(null===(c=null===(s=null==p?void 0:p.restrictions)||void 0===s?void 0:s.disallow_setting_playback_speed_reasons)||void 0===c?void 0:c.length):!!(null===(l=h.track.options)||void 0===l?void 0:l.useDefaultPlaybackSpeed),currentPlaybackSpeed:null!=g?g:this._currentTrackInfo.selectedPlaybackSpeed,selectedPlaybackSpeed:null!=g?g:this._currentTrackInfo.selectedPlaybackSpeed};const v=h.options;u.setPaused(!v.autoplay),this._setCurrentTrackPosition(v&&v.position||0),this._updateState(Jn.BEFORE_TRACK_LOAD),this._startedPlayingUpdateSent=!1,this._initialUpdateSent=!1}_onCapped(){this._listPlayer.clear(s.CAPPED),this._currentContext=null,this._updateState(Jn.CAPPED),this._setCurrentTrackPosition(void 0),this._lastProcessedStateId=null,this.emit("state_cleared",null)}_onConnectionId(e){this._connectionId=e.data.id,this._isDeregistering||(this._registered=!1,Promise.all([this._listPlayer.getVolume(),this._descriptorPromise.then(this._parseDescriptor)]).then(this.register,(e=>{qn.info("Skipping registration due to error",e),this.emit("registration_aborted",{reason_error:e,source:f.TRACK_PLAYBACK})})).catch((()=>{})))}_onDurationChanged(e){var t;const n=null===(t=this._currentContext)||void 0===t?void 0:t.getCurrentTrack();(null==n?void 0:n.metadata.uri)===e.data.track.uri&&this._currentTrackInfo.duration!==e.data.duration&&(this._currentTrackInfo.duration=e.data.duration,this._emitStateChanged())}_onError(e){"position"in e.data&&(this._setCurrentTrackPosition(e.data.position),this._updateState(Jn.ERROR))}_onSpeedChanged(e){this._currentTrackInfo.currentPlaybackSpeed=e.data.playback_speed,this._currentTrackInfo.selectedPlaybackSpeed=e.data.playback_speed_selected,this._updateState(Jn.SPEED_CHANGED)}_onPlayPause(e,t){const n=this._currentContext;n&&(n.setPaused(e),"position"in t.data&&this._setAllTrackPositions(t.data.position),t.data.track.stateId&&this._shouldSendUpdateForEvent(t.data.track.stateId)?this._updateState(e?Jn.PAUSE:Jn.RESUME):(this._lastProcessedStateId=null,this._emitStateChanged()))}_onPlayThresholdReached(e){this._initialUpdateSent=!0,this._setAllTrackPositions(e.data.position),this._updateState(Jn.PLAYED_THRESHOLD_REACHED)}_onPlayTokenLost(){this._listPlayer.pause().catch((function(){}))}_onPositionChanged(e){this._loading||(this._setCurrentTrackPosition(e.data.position),e.data.track&&this._shouldSendUpdateForEvent(e.data.track.stateId)?this._updateState(Jn.POSITION_CHANGED):(this._lastProcessedStateId=null,this._emitStateChanged()))}_onProgress(e){if(this._loading||!this._currentContext)return;this._setAllTrackPositions(e.data.position),!this._startedPlayingUpdateSent&&e.data.played>1e3&&(this._startedPlayingUpdateSent=!0,this._updateState(Jn.STARTED_PLAYING));if(!e.data.logData)return;const t=this._currentContext.getCurrentTrack(),n=t&&"number"==typeof t.ms_playing_update_interval?t.ms_playing_update_interval:null;this._initialUpdateSent&&null!==n&&n>0&&Date.now()-this._lastUpdateStateTime>n&&this._updateState(Jn.PROGRESS)}_onTrackDataCreatedEvent(){this._waitingForTrackingData=(0,l.$)()}_onTrackDataFinalizedEvent(e){const t=this._nextFinalizedDataPayload;t&&(t.playback_stats=e.data.playbackStats,this._updateState(Jn.TRACK_DATA_FINALIZED,t)),this._nextFinalizedDataPayload=null,this._waitingForTrackingData&&this._waitingForTrackingData.resolve(!0)}_onListPlayerLoad(e){this._loading=!1;const t=this._currentContext;t&&(t.setPaused(!e.data.autoplay),this._setCurrentTrackPosition(e.data.position||0))}_onTrackPlaybackMessage(e){const t=e.payloads;Array.isArray(t)&&t.length&&this._performCommand(t[0])}_onVolumeChanged(e){var t;if(this._currentGaiaVolume=e.data.volume*d,!this._registered)return;const n=null!==(t=e.data.commandId)&&void 0!==t?t:"",i={seq_num:void 0,volume:this._currentGaiaVolume,command_id:n};this._volumeDebouncer.async(i)}_clearSessionData(){this._connectionId=null,this._sequenceNumber=0,this._currentContext=null,this._lastSentStateUpdatePayload=null,this._isSendingConflict=!1,this._isSendingUpdate=!1,this._queueSendUpdate=[],this._previousTrackPosition=void 0,this._currentTrackPosition=void 0,this._currentTrackInfo={},this._lastProcessedStateId=null,this.emit("state_cleared",null)}_createStateRef(e,t){if(!t)return null;const n=e.states[t.state_index];if(!n)throw new xn(o.TP_CANNOT_CREATE_STATE_REF,"Invalid state reference.");return{state_machine_id:e.state_machine_id,state_id:n.state_id,paused:t.paused}}_deregisterFromService(e){let t=null;const n=this._currentContext;n&&(e&&(n.setPaused(!e.playing),this._setAllTrackPositions(e.position)),t=n.getStateRef());const i=this._generateStatePayload(t,Jn.DEREGISTER);this._setSequenceNumber(i);const o=`${this._endpoint}/v1/devices/${this._deviceId}`;return this._transport.request(o,{authorize:!0,method:"DELETE",payload:JSON.stringify(i),responseType:"json",retry:ni}).then((e=>{if(200!==e.status&&204!==e.status)return this._registered=!0,!1;const{body:t}=e;return t&&(t.endsong&&Xn.log(t.endsong),t.endsongs&&(Zn.log(t.endsongs),this.emit("internal_endcontent",{endcontents:t.endsongs}))),this._clearSessionData(),this.emit("deregistered",null),!0}))}_emitError(e,t={}){this.emit("error",{error:e,source:f.TRACK_PLAYBACK}),e.registration||this._logger.logJSSDKError({source:"tpapi-client",source_version:G.tagged,type:e.code,message:e&&e.message,stack:e&&e.stack,json_data:t,json_data_version:"1.0.0"},"object").catch((function(e){qn.error("Track-Playback Logging Error",e)}))}_emitStateChanged(){const e=this._currentContext;if(!e)return;let t=this._currentTrackPosition||0;void 0!==this._stateEventPositionOverride&&(t=this._stateEventPositionOverride,this._stateEventPositionOverride=void 0),this.emit("state_changed",{position:t,currentTrackInfo:this._currentTrackInfo,stateMachine:e.getStateMachine(),stateRef:e.getInternalStateRef(),paused:e.isPaused(),contextMetadata:e.getContextMetadata(),loading:this._loading})}_generateStatePayload(e,t){var n;const i=this._currentTrackInfo;return{seq_num:void 0,seq_nums:void 0,state_ref:e,sub_state:{playback_speed:(null==e?void 0:e.paused)?0:null!==(n=this._currentTrackInfo.currentPlaybackSpeed)&&void 0!==n?n:1,position:this._currentTrackPosition,duration:i.duration||void 0,media_type:i.mediaType,bitrate:i.bitrate,audio_quality:i.playbackQuality,format:i.fileFormat},previous_position:this._previousTrackPosition,playback_stats:void 0,rejected_state_refs:void 0,debug_source:t}}_handleRegisterResponse(e){let t;if(429===e.status)return t=xn.fatal(o.TP_MAX_SUBSCRIPTIONS_REACHED,"Max connections reached"),t.maxedSubscriptions=!0,t.status=e.status,this.emit("max_subscriptions_reached",{error:t}),Promise.reject(t);if(403===e.status&&e.body&&"PREMIUM_REQUIRED"===e.body.error_type?t=xn.fatal(o.TP_REGISTRATION_FAILED_NON_PREMIUM,"Cannot register to Track Playback with non-premium user."):200!==e.status?t=xn.fatal(o.TP_REGISTRATION_FAILED_WITH_STATUS,`track-playback service responded with status ${e.status} when registering device`):e.body||(t=xn.fatal(o.TP_NO_RESPONSE_BODY,"Unexpected empty response body from registration request.")),t)return t.status=e.status,Promise.reject(t);const n=e.body;return n.endsong&&Xn.log(n.endsong),n.endsongs&&(Zn.log(n.endsongs),this.emit("internal_endcontent",{endcontents:n.endsongs})),this._sequenceNumber=n.initial_seq_num,this._registered=!0,this.emit("registered",{deviceId:this._deviceId}),Promise.resolve(!0)}_handleStateConflictResponse(e){var t;if(e.status>=200&&e.status<300){const n=null===(t=e.body)||void 0===t?void 0:t.commands;if(!n||!n.length)return;for(let e=0,t=n.length;e{qn.error("Track-Playback Logging Error",e)}))}_logout(){this._listPlayer.pause().catch((()=>{})),this.emit("state_cleared",null),this.deregister().then((e=>{this._currentContext=null,this._setCurrentTrackPosition(void 0),e&&this.emit("logout",null)}))}_parseDescriptor(e){return this._deviceId=e.getId(),this._deviceInfo=e.toTrackPlaybackDeviceInfo(),!0}_performCommand(e){switch(e.type){case"set_volume":this._setVolume(e);break;case"log_out":this._logout();break;case"replace_state":this._replaceState(e);break;case"ping":this._updateState(Jn.PING);break;default:this._emitError(new xn(o.TP_UNKNOWN_COMMAND,"Received unknown command."),{command:e})}}_rejectState(e){const t=this._queuedRejectedStates;if(void 0!==e&&t.push(e),!this._registered||this._isSendingConflict||!t.length)return;this._isSendingConflict=!0;const n=t.splice(0,5),i=this._currentContext?this._currentContext.getStateRef():null,o=this._generateStatePayload(i);o.rejected_state_refs=n,this._setSequenceNumbers(o,n.length);const r=()=>{this._isSendingConflict=!1,this._rejectState()},a=`${this._endpoint}/v1/devices/${this._deviceId}/state_conflict`;this._transport.request(a,{authorize:!0,method:"POST",headers:{"Content-Type":"application/json"},responseType:"json",payload:JSON.stringify(o),retry:ni}).then(this._handleStateConflictResponse).then(r,r)}_replaceState(e){var t,n,i,o;const r=this._listPlayer,a=e.state_machine,c=e.state_ref,l=this._createStateRef(a,c);if(!this._isCurrentStateRef(e.prev_state_ref))return void this._rejectState(l);if(!c)return void this._clearContextAndState();const u=null!==(n=null===(t=this._currentContext)||void 0===t?void 0:t.getStateRef())&&void 0!==n?n:null;if(function(e,t){if(!e)throw new Error(`Assertion failed: ${t}`)}(null!==l,"New state reference is null"),this._currentContext&&(null==u?void 0:u.state_id)===l.state_id){const t=this._currentContext;t.setStateMachine(a),t.setCurrentState(c),t.setContextMetadata(e.context_metadata||null);let n=!1;t.isPaused()!==c.paused&&(n=!0),c.paused?(t.setPaused(!0),r.pause()):(t.setPaused(!1),r.resume());const o=a.states[c.state_index],l=null===(i=null==o?void 0:o.options)||void 0===i?void 0:i.playback_speed;l&&l!==this._currentTrackInfo.currentPlaybackSpeed&&(this._listPlayer.setPlaybackSpeed(l),n=!0);const u=parseInt(e.seek_to,10);t.allowSeeking()&&!isNaN(u)&&(r.seek(u,s.REMOTE),this._setCurrentTrackPosition(u),n=!0),n?this._emitStateChanged():(this._lastProcessedStateId=null,this._updateState(Jn.MODIFY_CURRENT_STATE))}else{this._lastProcessedStateId=null!==(o=l.state_id)&&void 0!==o?o:null,this._currentContext&&this._onBeforeTrackChange();const t=this._ListClass.create("spotify:app:jsspeaker",this._manifestTrackResolver);t.setStateMachine(a),t.startAtState(c),this._deviceId&&t.setDeviceId(this._deviceId),this._currentContext=t;const n=e.seek_to||0;t.setInitialPosition(n),this._loading=!0,this._switchingContext=!0,r.play(t,{reason:s.REMOTE})}}_clearContextAndState(){const e=this._listPlayer;e.pause().catch((function(){})),e.clear(s.REMOTE),this._currentContext=null,this._updateState(Jn.STATE_CLEAR),this._setAllTrackPositions(void 0),this._lastProcessedStateId=null,this.emit("state_cleared",null),this._loading=!0}_sendDevicesRequest(e,t){let n=`${this._endpoint}/v1/devices`;return"PUT"===e&&(n=`${n}/${this._deviceId}`),this._transport.request(n,{authorize:!0,method:e||"POST",headers:{"Content-Type":"application/json"},responseType:"json",payload:JSON.stringify(t),retry:ti})}_sendVolume(e){const t=`${this._endpoint}/v1/devices/${this._deviceId}/volume`;return this._setSequenceNumber(e),this._transport.request(t,{authorize:!0,method:"PUT",headers:{"Content-Type":"application/json"},payload:JSON.stringify(e)})}_setAllTrackPositions(e){this._previousTrackPosition=e,this._currentTrackPosition=e}_setCurrentTrackPosition(e){void 0!==e&&void 0!==this._currentTrackPosition&&e===this._currentTrackPosition||(this._previousTrackPosition=this._currentTrackPosition,this._currentTrackPosition=e)}_setSequenceNumber(e){return void 0===e.seq_num&&(e.seq_num=++this._sequenceNumber),e}_setSequenceNumbers(e,t){e.seq_nums=[];for(let n=0;n{204===e.status&&this.emit("registration_updated",null)}))}_updateState(e,t){var n,i;if(!this._registered)return;let r,a;if(t?(r=t.state_ref,a=t):(r=null!==(i=null===(n=this._currentContext)||void 0===n?void 0:n.getStateRef())&&void 0!==i?i:null,a=this._generateStatePayload(r,e)),!this._shouldSendPayload(a))return void qn.info("State update ignored (duplicate).",a);if(this._emitStateChanged(),this._isSendingUpdate&&this._limitStateUpdates)return this._logUnsentStateUpdate(a),void this._queueSendUpdate.push(e);this._isSendingUpdate=!0,this._queueSendUpdate=[],this._setSequenceNumber(a),this._lastSentStateUpdatePayload=a;const s=()=>{this._isSendingUpdate=!1,this._queueSendUpdate.length&&this._updateState(this._queueSendUpdate[this._queueSendUpdate.length-1]),qn.info("State update sent.",e,a)},c=`${this._endpoint}/v1/devices/${this._deviceId}/state`;this._lastUpdateStateTime=Date.now(),this._transport.request(c,{authorize:!0,method:"PUT",headers:{"Content-Type":"application/json"},responseType:"json",payload:JSON.stringify(a),retry:ti}).then(this._handleStateUpdateResponse.bind(this,r)).then(s,(e=>{!function(e){return"object"==typeof e&&null!==e&&"code"in e}(e)?this._emitError(new xn(o.TP_STATE_UPDATE_FAILED,`${e}`)):this._emitError(e),s()}))}_shouldSendPayload(e){const t=this._lastSentStateUpdatePayload;if(!t||!t.state_ref||!e.state_ref)return!0;const n=e.state_ref,i=t.state_ref;if(n.paused!==i.paused||n.state_id!==i.state_id||n.state_machine_id!==i.state_machine_id)return!0;const o=e.sub_state,r=t.sub_state;if(o.playback_speed!==r.playback_speed||o.position!==r.position)return!0;if(e.previous_position!==t.previous_position)return!0;return Math.abs((o.duration||0)-(r.duration||0))>=51}stop(){return!(!this._registered||!this._currentContext)&&(this._clearContextAndState(),!0)}deregister(){return this._registered?(this._isDeregistering=!0,this._registered=!1,this._listPlayer.getPlayerState().then((e=>Promise.all([this._deregisterFromService(e),this._waitingForTrackingData.promise,this._listPlayer.stop().catch((()=>{}))]).then((([e])=>(this._isDeregistering=!1,e)))),(()=>(this._isDeregistering=!1,this._registered=!0,!1)))):Promise.resolve(!1)}register(){if(this._registered)return Promise.resolve(!1);if(!this._deviceInfo)return Promise.reject(new Error("Need DeviceInfo for device registration."));if(!this._connectionId)return Promise.reject(new Error("Need connection-id for device registration"));let e;const t=this._currentContext;return t&&(e=this._generateStatePayload(t.getStateRef(),Jn.REGISTER),this._setSequenceNumber(e)),this._sendDevicesRequest("POST",{device:this._deviceInfo,outro_endcontent_snooping:"true"==={}.OUTRO_SNOOPING,connection_id:this._connectionId,client_version:this._clientVersion,previous_session_state:e,volume:this._currentGaiaVolume}).then(this._handleRegisterResponse).catch((e=>(e&&!e.maxedSubscriptions&&(e.registration=!0,this._emitError(e)),!1)))}hasOptimisticUpdates(){return!1}}function oi(e,t={}){return function(e,t,n={}){var i,o,r,a,s,c,l;const u=e.getSDKId(),d=e.getPublicTransport(),p=e.getLogger(),f=e.getDeviceDescriptor(),h=null!==(i=n.initialVolume)&&void 0!==i?i:1,m=Ln(Object.assign(Object.assign({},n),{transport:d,sdkId:e.getUntaggedSDKId(),loggerOptions:{disableMux:null===(a=null!==(r=null===(o=null==n?void 0:n.mux)||void 0===o?void 0:o.disable)&&void 0!==r?r:null==n?void 0:n.disableMux)||void 0===a||a,muxEnvKey:null!==(c=null===(s=null==n?void 0:n.mux)||void 0===s?void 0:s.envKey)&&void 0!==c?c:null==n?void 0:n.muxEnvKey,deviceInfo:f.then((e=>({platform_name:e.getPlatformName(),platform:e.getPlatformIdentifier(),version:e.getPlatformVersion(),brand:e.getBrand(),model:e.getModel(),type:e.getType()}))),muxCustomDimensions:null===(l=null==n?void 0:n.mux)||void 0===l?void 0:l.customDimensions,platform:e.getPlatformIdentifier(),clientVersion:e.getPlatformVersion()}})).then((({player:e})=>e)),g=m.then((e=>e.getMediaConfig())),_=Promise.all([f,g]).then((([e,t])=>(e.getCapability("audio_podcasts")&&!n.disableExternalFiles&&e.appendManifestFormat(D.FILE_URLS_EXTERNAL),t.keysystem===$.FAIRPLAY?e.appendManifestFormat(D.FILE_IDS_CBCS):t.keysystem!==$.WIDEVINE||n.preferMultiDRMFormat?e.appendManifestFormat(D.FILE_IDS_MP4_DUAL,D.FILE_IDS_MP4):(-1!==t.formats.audio.indexOf('audio/mp4; codecs="flac"')&&e.getCapability("lossless_playback")&&e.appendManifestFormat(D.FILE_IDS_MP4FLAC),e.appendManifestFormat(D.FILE_IDS_MP4,D.FILE_IDS_MP4_DUAL)),t.supports.protected_video&&e.getCapability("video_playback")&&e.prependManifestFormat(D.MANIFEST_IDS_VIDEO),t.supports.unprotected_video&&e.getCapability("video_ads")&&e.prependManifestFormat(D.MANIFEST_URLS_VIDEO_AD),e))),v=Cn.create({trackPlayer:m}),y=Kn.create({descriptor:f,listPlayer:v}),{playbackServiceClient:E,playbackStateObserver:b}=t({initialVolume:h,listPlayer:v,logger:p,transport:d,clientVersion:u,descriptor:_,endpoint:n.endpoint,manifestTrackResolver:y});return new Dn({client:e,playbackServiceClient:E,playbackStateObserver:b,initialVolume:h,playerPromise:m,listPlayer:v,stopOnBackground:n.stopOnBackground,enableMediaSession:n.enableMediaSession})}(e,(e=>{const t=ii.create(Object.assign(Object.assign({},e),{ListClass:Un}));return{playbackServiceClient:t,playbackStateObserver:Bn.create(t)}}),t)}var ri=n(97127);const ai=ri.P.forTag("transport.server_time");class si{constructor(e){this._serverTime=0,this._serverTimeFetchedAt=0,this._transport=e}static create(e){return new si(e)}_parseServiceResponse(e,t){const n=Date.now(),i=t.status;return i===O.G.OK?this._serverTime=parseInt(t.body.timestamp,10)+Math.round((n-e)/2):(ai.error(`Cannot fetch server time. Service responded with ${i}`),this._serverTime=n),this._serverTimeFetchedAt=n,this._serverTime}get(){const e=Date.now();return this._transport.request("@webgate/melody/v1/time",{responseType:"json"}).then(this._parseServiceResponse.bind(this,e))}getApproximate(){if(!this._serverTime)return this.get(),Date.now();const e=Date.now()-this._serverTimeFetchedAt;return e>18e4&&this.get(),this._serverTime+e}}var ci,li;!function(e){e.LOCAL_PLAYER_DISABLED="local_player_disabled",e.STOPPED="stopped",e.REMOTE_ACTIVATED="remote_activated",e.UNKNOWN="unknown"}(ci||(ci={})),function(e){e.PREMIUM="premium",e.ON_DEMAND="on-demand"}(li||(li={}));class ui extends Error{constructor(e,t){super(t),this.status=-1,this.maxedSubscriptions=!1,this.unrecoverable=!1,this.debug={},this.code=e,this.name="PlayerAPIClientError"}static fatal(e,t){const n=new ui(e,t);return n.unrecoverable=!0,n}}class di{constructor(e){this._transport=e.transport,this._metadataCache=new X.z(e.cacheSize||20)}static create(e){return new di(e)}_decorateTrackWindow(e){const t=this._metadataCache,n={current_track:null,next_tracks:[],previous_tracks:[]};let i,o,r;e.current_track&&(o=t&&e.current_track&&"uri"in e.current_track&&t.get(e.current_track.uri),n.current_track=Object.assign({uid:e.current_track.uid,metadata:e.current_track.metadata},o||e.current_track)),i=e.next_tracks.length;for(;i--;)r=e.next_tracks[i],o=t&&r&&"uri"in r&&t.get(r.uri),n.next_tracks[i]=Object.assign({uid:r.uid,metadata:r.metadata},o||r);for(i=e.previous_tracks.length;i--;)r=e.previous_tracks[i],o=t&&r&&"uri"in r&&t.get(r.uri),n.previous_tracks[i]=Object.assign({uid:r.uid,metadata:r.metadata},o||r);return n}_buildTrackList(e){const t=[],n={},i=[e.current_track,...e.next_tracks,...e.previous_tracks];for(const e of i)e&&!n[e.uri]&&t.push(e.uri);return t}_cacheMetadata(e,t){const n=[],i=[],o=[],r=this._metadataCache;for(const a of e){if(r.get(a))continue;const e=(0,Mn.EC)(a);e&&(e.type===Mn.JM.TRACK?i.push(e.id):"chapter"===(null==t?void 0:t.contentType)?o.push(e.id):e.type===Mn.JM.EPISODE&&n.push(e.id))}return n.length||i.length||o.length?Promise.all([this._requestMultiData("episodes",n),this._requestMultiData("tracks",i),this._requestMultiData("chapters",o)]).then((([e,t,n])=>!!e||!!t||!!n)):Promise.resolve(!0)}_requestMultiData(e,t){if(!t.length)return Promise.resolve(!1);const n=this._metadataCache,i=["https://@webapi/v1/",e,"?ids=",t.join(","),"&market=from_token"].join("");return this._transport.request(i,{responseType:"json"}).then((t=>{var i;if(200!==t.status)return!1;const o=null===(i=t.body)||void 0===i?void 0:i[e];if(!o)return!1;let r=o.length;for(;r--;){let t=o[r];t&&("episodes"===e?t=this._formatEpisodeData(t):"chapters"===e?t=this._formatChapterData(t):(t.track_type="audio",t.media_type="audio",t.content_type="tracks"===e?"music":"undefined"),n&&n.set(t.uri,t),n&&t.linked_from&&t.linked_from.uri&&n.set(t.linked_from.uri,t))}return!0}))}_formatEpisodeData(e){const t="audio"===e.show.media_type?"audio":"video";return{id:e.id,uri:e.uri,type:"episode",media_type:t,track_type:e.show.media_type,content_type:"podcast",name:e.name,artists:[{uri:e.show.uri,name:e.show.publisher}],album:{uri:e.show.uri,name:e.show.name,images:e.images},duration_ms:e.duration_ms||0,is_playable:!0}}_formatChapterData(e){return{id:e.id,uri:e.uri,type:"episode",name:e.name,media_type:e.audiobook.media_type,track_type:"audio",content_type:"chapter",artists:[{uri:e.audiobook.uri,name:e.audiobook.name}],album:{name:e.audiobook.name,uri:e.audiobook.uri,images:e.images},duration_ms:e.duration_ms||0,is_playable:!0}}formatLocalTrack(e,t){if(!e||e.type!==Mn.JM.LOCAL_TRACK)return null;return{uri:e.toURI(),type:"local",uid:t,media_type:"audio",track_type:"audio",content_type:"music",name:e.track,artists:[{uri:(0,Mn.ak)(e.artist).toURI(),name:e.artist}],album:{uri:(0,Mn.Jf)(e.artist,e.album).toURI(),name:e.album,images:[{url:""}]},duration_ms:e.duration?1e3*e.duration:0,is_playable:!1}}formatAd(e,t){if(!e||e.type!==Mn.JM.AD&&e.type!==Mn.JM.INTERRUPTION)return null;if(!t||!t.metadata)return null;const n=t.metadata;return{id:e.id,uri:e.toURI(),type:e.type,uid:t.uid,media_type:"audio",track_type:"audio",content_type:"ad",name:n.advertiser,artists:[{uri:n.click_url,name:n.buttonMessage||n.advertiser}],album:{uri:n.click_url,name:n.advertiser,images:[{url:n.image_url}]},duration_ms:parseInt(n.duration,10),is_playable:!1}}formatDJNarration(e,t){var n;if(!e||"true"!==(null===(n=t.metadata)||void 0===n?void 0:n.is_narration))return null;if(!t||!t.metadata)return null;const i=t.metadata;return{id:e.id,uri:e.toURI(),type:e.type,uid:t.uid,name:i.title,media_type:"audio",track_type:"audio",content_type:"narration",album:{name:i.album_title,images:[{url:i.image_url}]}}}decorateTrackWindow(e,t,n){const i=null!=t?t:this._buildTrackList(e);return this._cacheMetadata(i,{contentType:null==n?void 0:n.contentType}).then((t=>t?this._decorateTrackWindow(e):e))}}const pi=T.P.forTag("harmony.controller"),fi=/^disallow_([^]+)_reasons$/,hi={disallow_pausing_reasons:!0,disallow_peeking_next_reasons:!0,disallow_peeking_prev_reasons:!0,disallow_resuming_reasons:!0,disallow_seeking_reasons:!0,disallow_skipping_next_reasons:!0,disallow_skipping_prev_reasons:!0,disallow_toggling_repeat_context_reasons:!0,disallow_toggling_repeat_track_reasons:!0,disallow_toggling_shuffle_reasons:!0,disallow_transferring_playback_reasons:!0,disallow_setting_playback_speed_reasons:!0},mi={unknown:An.UNKNOWN,default:An.DEFAULT,low:An.LOW,normal:An.NORMAL,normalized:An.NORMAL,high:An.HIGH,veryhigh:An.VERY_HIGH,hifi:An.HIFI},gi={on:wn.ON,off:wn.OFF,none:wn.NONE};function _i(e,t){if(!e)return[];const n=[],i=[Mn.JM.TRACK,Mn.JM.EPISODE];for(let o=0,r=e.length;o{})))}_onDeviceStateChanged(e){var t,n;const{deviceState:i,hasOrphanedState:o}=e.data,r=!!(null===(n=null===(t=this._lastDeviceInfoData)||void 0===t?void 0:t.deviceInfo)||void 0===n?void 0:n.local);this._lastDeviceInfoData={deviceInfo:i,hasOrphanedState:o},r&&!(null==i?void 0:i.local)&&this._playerClient.getDevices().then((({localDevice:e})=>{let t=ci.STOPPED;o?e||(t=ci.LOCAL_PLAYER_DISABLED):t=ci.REMOTE_ACTIVATED,this.emit("device_deactivated",{reason:t})})).catch((e=>{pi.warn("Device deactivation checking failed.",e)})),this._suppressed||this.emit("device_info_changed",this._lastDeviceInfoData)}_startProgressTracking(){this._stopProgressTracking(),this._lastProgressTs=Date.now(),this._onProgressTracking(),this._trackingIntervalId=setInterval(this._onProgressTracking,500)}_stopProgressTracking(){this._trackingIntervalId&&(clearInterval(this._trackingIntervalId),this._trackingIntervalId=0)}_onProgressTracking(){var e;const t=Date.now(),n=(null===(e=this._lastPlayerState)||void 0===e?void 0:e.playback_speed)||1;this._progressPosition+=n*(t-this._lastProgressTs),this.emit("progress",{position:this._progressPosition,timestamp:Date.now()}),this._lastProgressTs=t}_getLicense(){return this._client.getProductState().then((e=>"premium"===e.product?li.PREMIUM:li.ON_DEMAND)).catch((()=>li.ON_DEMAND))}_generatePlayOptions(e,t){return this._getLicense().then((n=>{const i={license:n};if(!e)return i;if(("index"in e||"trackUID"in e||"trackURI"in e||"pageIndex"in e)&&(i.skip_to={track_uid:e.trackUID,track_index:e.index,track_uri:e.trackURI,page_index:e.pageIndex}),"initialOffset"in e&&(i.seek_to=e.initialOffset),"paused"in e&&(i.initially_paused=e.paused),"alwaysPlaySomething"in e&&(i.always_play_something=e.alwaysPlaySomething),t)return i;i.player_options_override={};const o=i.player_options_override;if("shuffle"in e&&(o.shuffling_context=e.shuffle),"repeatMode"in e)switch(e.repeatMode){case h.CONTEXT:o.repeating_context=!0,o.repeating_track=!1;break;case h.TRACK:o.repeating_track=!0,o.repeating_context=!1;break;case h.OFF:o.repeating_track=!1,o.repeating_context=!1}return i}))}_setFilterAndSort(e,t){t&&t.filter&&e.metadata&&(e.metadata["filtering.predicate"]=t.filter),t&&t.sort&&e.metadata&&(e.metadata["sorting.criteria"]=t.sort)}_setMetadataOptions(e,t){if(!t)return;const n=e.metadata||{};"autoplayCandidate"in t&&(n.autoplay_candidate=t.autoplayCandidate?"true":"false"),e.metadata=n}_generatePlayOrigin(e){if(e&&e.featureClasses&&!Array.isArray(e.featureClasses))throw new TypeError("PlayOptions playOrigin.featureClasses must be an array of strings.");return{feature_identifier:e&&e.featureIdentifier||"harmony",feature_version:e&&e.featureVersion||this._version,feature_classes:e&&e.featureClasses,view_uri:e&&e.viewURI,external_referrer:e&&e.externalReferrer,referrer_identifier:e&&e.referrerIdentifier}}_generateLoggingParams(e){if(!e)return;const{pageInstanceId:t,interactionId:n}=e;return{page_instance_ids:t?[t]:[],interaction_ids:n?[n]:[]}}_parseRestrictions(e){const t={};for(const n in e.restrictions)e.restrictions.hasOwnProperty(n)&&hi[n]?t[n]=e.restrictions[n]:hi[n]&&(t[n]=[]);return t}_parseDisallows(e){const t={},n=e.restrictions;for(const e in n)if(n.hasOwnProperty(e)&&hi[e]){const i=n[e],o=!(!i||!i.length);t[e.replace(fi,"$1")]=o}return t}_onPlayerStateChanged(e){this._isOrphanedState=e.data.orphaned,this._parsePlayerState(e.data.playerState).then((t=>{this._state=t,this._suppressed||this.emit("state_changed",{state:t?Object.assign({},t):null,orphaned:e.data.orphaned}),!this._disableProgress&&t&&(this._progressPosition=t.position,t.paused?this._stopProgressTracking():this._startProgressTracking())}))}_isUsingPlayerService(e){var t,n,i;const o=null===(n=null===(t=this._lastDeviceInfoData)||void 0===t?void 0:t.deviceInfo)||void 0===n?void 0:n.version,r=/\/(cloud|track)-playback$/.test(o||""),a=2===(null===(i=null==e?void 0:e.context_metadata)||void 0===i?void 0:i["player.arch"]);return r&&a}_parsePlayerState(e){return this._lastPlayerState=e,e?this._getTrackWindow(e).then((t=>{var n,i,o,r,a,s,c,l,u,d;const p=!!(null===(n=e.options)||void 0===n?void 0:n.playback_speed)||!1;if(!p){const t=(0,Mn.hn)(e.track.uri)?"not_supported_by_device":"not_supported_by_content_type";e.restrictions=Object.assign({disallow_setting_playback_speed_reasons:[t]},e.restrictions)}const f=this._parseDisallows(e);return{context:{uri:e.context_uri||null,metadata:e.context_metadata||{}},timestamp:e.timestamp,duration:e.duration||t.current_track&&"uri"in t.current_track&&t.current_track.duration_ms||0,position:e.is_paused?e.position_as_of_timestamp:this._offsetPosition(e.timestamp,e.position_as_of_timestamp,e.playback_speed),playback_id:this._isUsingPlayerService(e)?null:e.playback_id,playback_quality:null!==(r=mi[null!==(o=null===(i=e.playback_quality)||void 0===i?void 0:i.bitrate_level)&&void 0!==o?o:"unknown"])&&void 0!==r?r:An.UNKNOWN,playback_features:{hifi_status:gi[null!==(s=null===(a=e.playback_quality)||void 0===a?void 0:a.hifi_status)&&void 0!==s?s:"none"],playback_speed:{current:e.playback_speed,selected:null!==(l=null===(c=e.options)||void 0===c?void 0:c.playback_speed)&&void 0!==l?l:1,restricted:!p||!!(null==f?void 0:f.setting_playback_speed)},signal_ids:e.signals||[]},paused:!!e.is_paused,shuffle:!(!e.options||!e.options.shuffling_context),repeat_mode:this._getStateRepeatMode(e),restrictions:this._parseRestrictions(e),disallows:f,track_window:t,bitrate:null,loading:null!==(d=null===(u=this._state)||void 0===u?void 0:u.loading)&&void 0!==d&&d,playback_speed:e.playback_speed}})):Promise.resolve(null)}_offsetPosition(e,t,n=1,i){const o=t+((i||this._serverTime.getApproximate())-e)*n;return o<0?0:o}_isRestricted(e,t){if(!e||!e.restrictions)return!1;const n=`disallow_${t}_reasons`;return!!(e.restrictions[n]||[]).length}_getTrackWindow(e){var t,n;const i={current_track:null,next_tracks:[],previous_tracks:[]},o={},r=[];if(!e.track)return Promise.resolve(i);const a=e.track.uri;if(!a)return Promise.resolve(i);const s=(0,Mn.EC)(a),c=this._metadataDecorator,l=c.formatLocalTrack(s,e.track.uid),u=c.formatAd(s,e.track),d=c.formatDJNarration(s,e.track);i.current_track=l||u||d||{uri:a,uid:e.track.uid,type:s&&s.type?s.type:"unknown"},i.current_track.metadata=e.track.metadata||{},l||u||d||(o[a]=1,r.push(a)),this._isRestricted(e,"peeking_next")||this._fillWindow(r,i.next_tracks,o,e.next_tracks?e.next_tracks.slice(0,5):[]),this._isRestricted(e,"peeking_prev")||this._fillWindow(r,i.previous_tracks,o,e.prev_tracks?e.prev_tracks.slice(-5):[],!0);const p="true"===(null===(t=e.track.metadata)||void 0===t?void 0:t.is_audiobook_chapter)||"true"===(null===(n=e.track.metadata)||void 0===n?void 0:n.is_audiobook)?"chapter":"unknown";return this._decorate?this._metadataDecorator.decorateTrackWindow(i,r,{contentType:p}):Promise.resolve(i)}_fillWindow(e,t,n,i,o){o&&i.reverse();for(const r of i){const{metadata:i,uri:a,uid:s}=r;if("true"===(null==i?void 0:i.hidden_in_queue))continue;const c=(0,Mn.EC)(a);if(!a||"spotify:delimiter"===a||c&&(c.type===Mn.JM.AD||c.type===Mn.JM.INTERRUPTION))continue;const l=this._metadataDecorator.formatLocalTrack(c,s),u=l||{uri:a,uid:s,type:"unknown"};if(l||a in n||(n[a]=1,e.push(a)),o?t.unshift(Object.assign(Object.assign({},u),{metadata:i})):t.push(Object.assign(Object.assign({},u),{metadata:i})),2===t.length)break}}_getStateRepeatMode(e){const t=e.options;return t&&t.repeating_track?h.TRACK:t&&t.repeating_context?h.CONTEXT:h.OFF}_play(e,t,n){return this._setFilterAndSort(e,n),this._setMetadataOptions(e,n),this._generatePlayOptions(n).then((i=>{const o={context:e,play_origin:this._generatePlayOrigin(n&&n.playOrigin),options:i,logging_params:this._generateLoggingParams(null==n?void 0:n.loggingParams)};return this._playerClient.play(o,t)}))}getActiveDevice(){return this._playerClient.getActiveDevice()}getCurrentState(e){var t;if(e&&this._isOrphanedState)return Promise.resolve(null);const n=this._state;if(n&&!n.paused){const e=this._serverTime.getApproximate();n.position=this._offsetPosition(n.timestamp,n.position,null===(t=this._lastPlayerState)||void 0===t?void 0:t.playback_speed,e),n.timestamp=e}return Promise.resolve(n?Object.assign({},n):null)}getContextPlayerState(){return pi.warn("The `getContextPlayerState()` method is not well supported. Please avoid using it directly."),this._playerClient.getContextPlayerState()}getDevices(){return this._playerClient.getDevices()}playURI(e,t,n){if(!(0,Mn.EC)(e))return Promise.reject(new TypeError("Invalid Spotify URI"));const i={uri:e,url:`context://${e}`,metadata:n&&n.contextMetadata||{}};return this._play(i,t,n)}playPages(e,t,n){var i;if(!Array.isArray(e))return Promise.reject(new TypeError("Invalid pages array."));let o;try{o=function(e){var t,n,i;const o=[];for(const r of e)o.push({tracks:Array.isArray(r.tracks)?_i(r.tracks):void 0,page_url:null!==(t=vi(r.pageURL))&&void 0!==t?t:void 0,next_page_url:null!==(n=vi(r.nextPageURL))&&void 0!==n?n:void 0,metadata:null!==(i=r.metadata)&&void 0!==i?i:void 0});return o}(e)}catch(e){return Promise.reject(e)}const r={uri:null!==(i=null==n?void 0:n.contextURI)&&void 0!==i?i:"spotify:internal:harmony-play-pages",metadata:(null==n?void 0:n.contextMetadata)||{},pages:o};return this._play(r,t,n)}playTracks(e,t,n){var i;if(!Array.isArray(e))return Promise.reject(new TypeError("Invalid tracks array."));let o;try{o=_i(e)}catch(e){return Promise.reject(e)}const r={uri:null!==(i=null==n?void 0:n.contextURI)&&void 0!==i?i:"spotify:internal:harmony-play-tracks",metadata:(null==n?void 0:n.contextMetadata)||{},pages:[{tracks:o}]};return this._play(r,t,n)}updateCurrentContext(e,t={}){return this._playerClient.updateCurrentContext(e,t)}setQueue(e,t,n){if(!Array.isArray(e))return Promise.reject(new TypeError("Invalid nextTracks array."));if(!Array.isArray(t))return Promise.reject(new TypeError("Invalid previousTracks array."));let i,o;try{i=_i(e),o=_i(t)}catch(e){return Promise.reject(e)}const r={next_tracks:i.length?i:void 0,prev_tracks:o.length?o:void 0};return this._playerClient.setQueue(r,n)}transfer(e,t={}){return this._playerClient.transfer(e,t)}pause(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return this._playerClient.pause(e,n)}resume(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return this._playerClient.resume(e,n)}togglePlay(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return this._playerClient.togglePlay(e,n)}nextTrack(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return(null==t?void 0:t.track)&&(n.track=E([t.track])[0]),this._playerClient.nextTrack(e,n)}previousTrack(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return(null==t?void 0:t.track)&&(n.track=E([t.track])[0]),this._playerClient.previousTrack(e,n)}seek(e,t){return this._playerClient.seek(e,t)}setShuffle(e,t,n){const i={logging_params:this._generateLoggingParams(null==n?void 0:n.loggingParams)};return this._playerClient.setShuffle(e,t,i)}toggleShuffle(e,t){const n={logging_params:this._generateLoggingParams(null==t?void 0:t.loggingParams)};return this._playerClient.toggleShuffle(e,n)}setVolume(e,t){return this._playerClient.setVolume(e,t)}logout(e){return this._playerClient.logout(e)}setRepeatMode(e,t){return this.getCurrentState().then((n=>{if(!n)return Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"));const i=this._playerClient,r=n.disallows;switch(e){case h.OFF:return(!r.toggling_repeat_context||!r.toggling_repeat_track)&&i.setOptions({repeating_context:!!r.toggling_repeat_context&&void 0,repeating_track:!!r.toggling_repeat_track&&void 0},t);case h.CONTEXT:return!r.toggling_repeat_context&&i.setOptions({repeating_context:!0,repeating_track:!!r.toggling_repeat_track&&void 0},t);case h.TRACK:return!r.toggling_repeat_track&&i.setOptions({repeating_context:!r.toggling_repeat_context||void 0,repeating_track:!0},t);default:return Promise.reject(new TypeError("Unknown repeat mode."))}}))}setPlaybackSpeed(e,t){return this.getCurrentState().then((n=>{if(!n)return Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"));return this._playerClient.setOptions({playback_speed:e},t)}))}register(){return this._playerClient.register()}suppressEvents(){this._suppressed=!0}unsuppressEvents(){this._suppressed=!1,this._lastDeviceInfoData&&this.emit("device_info_changed",this._lastDeviceInfoData),this._state&&this.emit("state_changed",{state:this._state})}getQueueManager(e,t={}){if(!this._queue){const n=t.reportInitial?this._lastPlayerState:null;this._queue=new S(Object.assign({connectClient:this._playerClient,initialContextPlayerState:n,runner:e},t))}return this._queue}sendCustomSignal(e,t,n){return this._playerClient.sendCustomSignal(t,Object.assign(Object.assign({},n),{signal_id:e}))}playAsNextInQueue(e,t,n){const i={logging_params:this._generateLoggingParams(null==n?void 0:n.loggingParams)},o=_i(e);return this._playerClient.playAsNextInQueue(o,t,i)}}var Ei=n(53104);const bi=/connect-state\/v1\/cluster$/,Si=/^([a-zA-Z0-9_%:-]{1,40}).*$/;function Ai(e){var t,n,i;return!!e.track&&0===(null!==(i=null===(n=null===(t=e.restrictions)||void 0===t?void 0:t.disallow_transferring_playback_reasons)||void 0===n?void 0:n.length)&&void 0!==i?i:0)}const Ti="::a_";var Oi;!function(e){e.NOT_PLAYING_LOCALLY="not_playing_locally",e.NOT_PLAYING_CONTEXT="not_playing_context",e.NOT_PLAYING_TRACK="not_playing_track",e.NOT_PLAYING_MEDIA="not_playing_media",e.NO_PREV_TRACK="no_prev_track",e.NO_NEXT_TRACK="no_next_track",e.NO_SPECIFIC_TRACK="no_specific_track",e.ALREADY_PAUSED="already_paused",e.NOT_PAUSED="not_paused",e.NARRATION="narration",e.PLAYER_CONTEXT_DISALLOW="context_player_disallow",e.MFT_DISALLOW="mft_disallow",e.AD_DISALLOW="ad_disallow",e.PROTOCOL_LIMITATIONS="protocol_limitations",e.UNKNOWN="unknown",e.ALREADY_PLAYING="already_playing",e.THROTTLED="throttled",e.ENDLESS_CONTEXT="endless_context"}(Oi||(Oi={}));const Ii={[Oi.AD_DISALLOW]:m.h.AD_PLAYING,[Oi.NARRATION]:m.h.NARRATION};function Ci(e){if(!e)return{deviceId:null};const[t,n]=e.split(Ti);return{deviceId:t,aliasId:n?parseInt(n,10):void 0}}class Ni extends c.vp{constructor(e){super(),this._autoregister=!0,this._connectionId="",this._localDeviceId="",this._localObserverDeviceId=null,this._lastActiveDevice=null,this._lastKnownPlayerState=null,this._lastKnownDevices=[],this._localDevice=null,this._fetchedInitialState=!1,this._awaitingAcknowledgment={},this._acknowledgementMaps=[],this._lastProcessedTimestamp=0,this._descriptor=e.descriptor,this._transport=e.transport,this._endpoint=e.endpoint||"@webgate/connect-state",this._autoregister=!("autoregister"in e)||!!e.autoregister,this._onConnectionId=this._onConnectionId.bind(this),this._onClusterMessage=this._onClusterMessage.bind(this),this._awaitResponseWithAck=this._awaitResponseWithAck.bind(this),this._transport.on(this._transport.EVENT_CONNECTION_ID,(e=>{this._onConnectionId(e.data.id)})),this._transport.matchMessages(bi,this._onClusterMessage),this._descriptorPromise=Promise.resolve(this._descriptor).then((e=>(this._localDeviceId=e.id||"",this._localObserverDeviceId=("hobs_"+this._localDeviceId).replace(Si,"$1"),!0)))}static create(e){return new Ni(e)}_onConnectionId(e){this._connectionId=e,this._autoregister&&this.register()}_onClusterMessage(e){const t=e.payloads&&e.payloads[0];if(t){if(t.ack_id){const e=t.ack_id,n=this._awaitingAcknowledgment[e];if(n)n.resolve(!0);else{const t=this._acknowledgementMaps;for(const n of t)n[e]=(0,l.$)()}}this._parseCluster(t.cluster)}}_resolveTargetDevice(e){return this._descriptorPromise.then((()=>{const t=this._localDeviceId;return Ci(e?e===u?t:e:this._lastActiveDevice?this._lastActiveDevice.id:t)}))}_makeEndpoint(e,t,n){return this._descriptorPromise.then((()=>{const i=this._localDeviceId;return`${this._endpoint}/${e}/${t}/from/${i}/to/${n}`}))}_sendPlayerCommand(e,t=null,n={}){n.endpoint=e;const i={command:n};return this._resolveTargetDevice(t).then((e=>{if(!e.deviceId)throw new ui(o.CONNECTAPI_CLIENT_MISSING_DEVICE_ID,"Operation resulted in a null device id");return!i.target_alias_id&&e.aliasId&&(i.target_alias_id=e.aliasId),this._makeEndpoint("v1","player/command",e.deviceId)})).then((e=>this._sendRequest(Ei.n.POST,e,i))).then(this._awaitResponseWithAck)}_sendConnectCommand(e,t=null,n={}){const i="volume"===e?Ei.n.PUT:Ei.n.POST,r="volume"===e||"logout"===e;return this._resolveTargetDevice(t).then((t=>{if(!t.deviceId)throw new ui(o.CONNECTAPI_CLIENT_MISSING_DEVICE_ID,"Operation resulted in a null device id");return t.aliasId&&(r?n.command_options={target_alias_id:t.aliasId}:n.target_alias_id||(n.target_alias_id=t.aliasId)),this._makeEndpoint("v1",`connect/${e}`,t.deviceId)})).then((e=>this._sendRequest(i,e,n))).then(this._awaitResponseWithAck)}_sendRequest(e,t,n){const i=this._acknowledgementMaps,o={};i.push(o);const r=()=>{const e=i.indexOf(o);-1!==e&&i.splice(e,1)};return this._transport.request(t,{method:e,headers:{"Content-Type":"application/json"},payload:n?JSON.stringify(n):void 0,responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((e=>(r(),{response:e,map:o})),(e=>(r(),Promise.reject(e))))}_awaitResponseWithAck(e){var t,n;if(404===e.response.status)return Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_DEVICE,"No such device."));const i=null===(t=e.response.body)||void 0===t?void 0:t.ack_id;if(200===e.response.status&&i){if(null===(n=e.map)||void 0===n?void 0:n[i])return Promise.resolve(!0);const t=(0,l.$)();return this._awaitingAcknowledgment[i]=t,t.promise}return Promise.resolve(202===e.response.status&&!i)}_parseCluster(e){if(!e)return;const t=parseInt(e.timestamp,10);this._lastProcessedTimestamp>t||(this._lastProcessedTimestamp=t,this._parseClusterDevices(e),this._parseClusterPlayerState(e))}_parseClusterDevices(e){const t=this._lastActiveDevice;this._lastActiveDevice=null,this._lastKnownDevices=[],this._localDevice=null;const n=[];for(const t in e.devices)e.devices.hasOwnProperty(t)&&n.push(t);if(n.sort(),n.length)for(const t of n){const n=this._formatClusterDevice(e,t);this._lastKnownDevices.push(...n);for(const e of n)e.is_active&&(this._lastActiveDevice=e),e.local&&(this._localDevice=e)}if(!this._fetchedInitialState||!_(this._lastActiveDevice,t)){const n=e.player_state,i=n&&Ai(n);this.emit("device_state_changed",{deviceState:this._lastActiveDevice,hasOrphanedState:!this._lastActiveDevice&&!!i,disappeared:!!t&&!this._lastActiveDevice})}this.emit("devices_changed",{devices:this._lastKnownDevices,localDevice:this._localDevice})}_shouldDisallowTransfer(e,t){var n,i,o;const r=e.player_state;if(!r)return null;const{track:a,restrictions:s}=r;if(a){let e=(null===(n=a.metadata)||void 0===n?void 0:n["media.type"])||(null===(i=a.metadata)||void 0===i?void 0:i.track_player);const r=null===(o=(0,Mn.EC)(a.uri))||void 0===o?void 0:o.type;if(e&&"mixed"!==e||(e="audio"),-1===t.capabilities.supported_types.indexOf(`${e}/${r}`))return m.h.INCOMPATIBLE}if(s){const e=s.disallow_transferring_playback_reasons;if(null==e?void 0:e.length)for(const t of e)return Ii[t]?Ii[t]||null:m.h.UNSUPPORTED}const c=e.active_device_id;if(!t.can_play||c===t.device_id)return m.h.UNAVAILABLE;const l=e.devices[c];return(null==l?void 0:l.license)!==li.ON_DEMAND||t.license===li.ON_DEMAND&&t.device_type!==w.SMARTPHONE?null:m.h.PREMIUM_REQUIRED}_formatClusterDevice(e,t){const n=e.devices[t],i={};if(n&&Array.isArray(n.metadata))for(let e=0,t=n.metadata.length;e{429===e.status?this.emit("max_subscriptions_reached",{error:new ui(o.CONNECTAPI_MAX_SUBSCRIPTIONS_REACHED,"Max connections reached")}):200===e.status&&(this.emit("registered",null),e.body&&(this._parseCluster(e.body),this._fetchedInitialState=!0)),429!==e.status&&408!==e.status||(this._lastKnownDevices=this._lastKnownDevices.map((e=>(e.is_being_activated=!1,e))),this._localDevice&&(this._localDevice.is_being_activated=!1),this.emit("devices_changed",{devices:this._lastKnownDevices,localDevice:this._localDevice}))}))}register(){return this._connectionId?this._descriptorPromise.then(this._register.bind(this)):Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_CONNECTION_ID,"Cannot register: no connection id."))}deregister(){const e=`${this._endpoint}/v1/devices/${this._localObserverDeviceId}`;return this._transport.request(e,{method:"DELETE",responseType:"json"}).then((e=>{200===e.status&&this.emit("deregistered",null)}))}getDevices(){return this._fetchedInitialState?Promise.resolve({devices:this._lastKnownDevices,localDevice:this._localDevice}):new Promise((e=>{this.once("device_state_changed",(()=>{e({devices:this._lastKnownDevices,localDevice:this._localDevice})}))}))}getActiveDevice(){return this._fetchedInitialState?Promise.resolve(this._lastActiveDevice):new Promise((e=>{this.once("device_state_changed",(t=>{e(t.data.deviceState)}))}))}getContextPlayerState(){return this._fetchedInitialState?Promise.resolve(this._lastKnownPlayerState):new Promise((e=>{this.once("player_state_changed",(t=>{e(t.data.playerState)}))}))}play(e,t=null){return e?this._sendPlayerCommand("play",t,e):Promise.reject(new ui(o.CONNECTAPI_CLIENT_INVALID_ARGUMENTS,"Descriptor is required for play commands"))}updateCurrentContext(e=null,t){return this.getContextPlayerState().then((n=>n?n.session_id?n.context_url||t.forceNonUpdateable?this._sendPlayerCommand("update_context",e,{context:{url:t.contextURI?`context://${t.contextURI}`:n.context_url||`context://${n.context_uri}`},session_id:n.session_id}):Promise.resolve(!1):Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_SESSION_ID,"The current state does not have a session id")):Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"))))}setQueue(e,t){return this._sendPlayerCommand("set_queue",t,e)}addToQueue(e,t){return this._sendPlayerCommand("add_to_queue",t,{track:e})}transfer(e,t={}){var n,i;this._lastKnownDevices=this._lastKnownDevices.map((t=>(t.is_being_activated=t.id===e,t))),this._localDevice&&(this._localDevice.is_being_activated=e===u),this.emit("devices_changed",{devices:this._lastKnownDevices,localDevice:this._localDevice});const o={restore_paused:"restore"};return"paused"in t&&(o.restore_paused=t.paused?"pause":"resume"),this._sendConnectCommand("transfer",e||u,{transfer_options:o,page_instance_id:null===(n=t.loggingParams)||void 0===n?void 0:n.pageInstanceId,interaction_id:null===(i=t.loggingParams)||void 0===i?void 0:i.interactionId})}pause(e,t){return this._sendPlayerCommand("pause",e,t)}resume(e,t){return this._sendPlayerCommand("resume",e,t)}togglePlay(e,t){return this.getContextPlayerState().then((n=>n?n.is_paused?this.resume(e,t):this.pause(e,t):Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"))))}nextTrack(e,t){return this._sendPlayerCommand("skip_next",e,t)}previousTrack(e,t){return this._sendPlayerCommand("skip_prev",e,t)}seek(e,t){return isNaN(e)||e<0?Promise.reject(new ui(o.CONNECTAPI_CLIENT_INVALID_POSITION,"Invalid position.")):this._sendPlayerCommand("seek_to",t,{value:e})}setShuffle(e,t,n){return this._sendPlayerCommand("set_shuffling_context",t,Object.assign({value:!!e},n))}toggleShuffle(e,t){return this.getContextPlayerState().then((n=>{if(!n)return Promise.reject(new ui(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"));const i=n.options&&n.options.shuffling_context;return this.setShuffle(!i,e,t)}))}setRepeatingContext(e,t){return this._sendPlayerCommand("set_repeating_context",t,{value:e})}setRepeatingTrack(e,t){return this._sendPlayerCommand("set_repeating_track",t,{value:!!e})}setOptions(e,t){return this._sendPlayerCommand("set_options",t,Object.assign({},e))}setVolume(e,t){if(isNaN(e)||e<0)return Promise.reject(new ui(o.CONNECTAPI_CLIENT_INVALID_VOLUME,"Invalid volume."));const n=Math.round(e*d);return this._sendConnectCommand("volume",t,{volume:n})}logout(e){return this._sendConnectCommand("logout",e)}sendCustomSignal(e,t){return this._sendPlayerCommand("signal",e,t)}playAsNextInQueue(e,t,n){return this._sendPlayerCommand("play_as_next_in_queue",t,Object.assign({tracks:e},n))}}const Li=Object.assign(Object.assign(Object.assign({},o),r.J),i);function Ri(e){var t;const n=e.transport;if(!n)throw new TypeError("No Transport instance provided");const i=function(e){return z.create(e)}(Object.assign(Object.assign({},e.client),{transport:n,hidden:!!e.hidden,playTokenLostBehavior:e.playTokenLostBehavior||(e.hidden&&!e.onlyLocalState?"stop":"pause")})),o=e.streamer||{},r=e.controller||{};let a,s=!1;e.streamer&&e.streamer.disabled?(e.hidden=!0,e.onlyLocalState=!1,e.claimInactivePlayerStates=!1,s=!0):(a=oi(i,o),r.autoregister=!1,e.onlyLocalState&&(r.decorateTrackWindow=!1,r.disableProgress=!0));const c=function(e,t={}){const n=e.getPublicTransport(),i=e.getVersionDescriptor().tagged,o=Ni.create({autoregister:!("autoregister"in t)||t.autoregister,descriptor:e.getClientDescriptor(),transport:n});return yi.create({client:e,playerClient:o,version:i,serverTime:si.create(n),decorateTrackWindow:"boolean"!=typeof t.decorateTrackWindow||t.decorateTrackWindow,disableProgress:t.disableProgress})}(i,r);return A.create({transport:n,client:i,streamer:a,controller:c,enableControllerWithoutStreamer:s,hidden:e.hidden,onlyLocalState:e.onlyLocalState,claimInactivePlayerStates:e.claimInactivePlayerStates,forceRemoteActions:e.forceRemoteActions,autoActivateElement:null!==(t=e.autoActivateElement)&&void 0!==t?t:"undefined"!=typeof WebKitMediaKeys,experimentalDeactivateOnStop:e.experimentalDeactivateOnStop})}},45991:(e,t,n)=>{"use strict";n.d(t,{FP:()=>A,Of:()=>O});n(46758),n(53321),n(27082),n(86277),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);var i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},o=function(){for(var e=[],t=0;t0){var i=t[n[0]],o=i.click_actions,r=i.html_content,a=i.impression_url;return{actions:o,format:i.creative_type,htmlContent:r,impressionUrl:a}}}function s(e,t){var n={"App-Platform":e.platform,"Content-Type":"application/json","X-Client-Id":e.clientId};return t&&(n["X-Spotify-Quicksilver-Uri"]=t),{method:"GET",authorize:!0,headers:n,rejectNotOk:!0,responseType:"json"}}function c(e){return"prod"===e?"quicksilver/v2/":"quicksilverdev/v2/"}var l=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},u=function(){for(var e=[],t=0;t1&&r.push("Triggers must all be of the same type."),r}function p(e,t){var n=t.actions,i=t.app,o=t.appUri,l=t.enableLogs,p=t.formats,f=t.locale,h=t.env,m=t.triggers,g=d({formats:p,triggers:m});return g.length>0?(l&&console.error("In-App Messaging: Please fix the following request errors: "+g.join(" ")),Promise.resolve(void 0)):e.request.apply(e,u(function(e){var t=e.actions,n=e.app,i=e.appUri,o=e.formats,a=e.locale,l=e.env,u=e.triggers,d=c(l),p=u.map((function(e){return encodeURIComponent(e.pattern)})),f=r("trigger",p),h=r("ctv_type",o),m=r("action",t),g="@webgate/"+d+"messages?"+h+f+m+"locale="+a+"&trig_type="+u[0].type;return[g,s(n,i)]}({actions:n,app:i,appUri:o,formats:p,locale:f,env:h,triggers:m}))).then((function(e){return a(e)}))}var f=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},h=function(){for(var e=[],t=0;t0?(r&&console.error("In-App Messaging: Please fix the following preview request errors: "+d.join(" ")),Promise.resolve(void 0)):e.request.apply(e,h(function(e){var t=e.app,n=e.appUri,i=e.creativeId,o=e.locale,r=e.env,a=c(r),l=encodeURIComponent("spotify:home"),u="@webgate/"+a+"preview?trigger="+l+"&locale="+o+"&trig_type=URI&return_messages=true&relay_creative=true&creative_id="+i;return[u,s(t,n)]}({app:n,appUri:i,creativeId:o,locale:l,env:u}))).then((function(e){return a(e)}))}var g=function(e){var t=e.actions,n=e.app,i=e.enableLogs,o=e.formats,a=e.locale,l=e.transport;return{requestMessage:function(e){var r=e.appUri,s=e.env,c=e.triggers;return p(l,{actions:t,app:n,appUri:r,enableLogs:i,formats:o,locale:a,env:s,triggers:c})},previewMessage:function(e){var t=e.appUri,o=e.creativeId,r=e.env;return m(l,{app:n,appUri:t,creativeId:o,enableLogs:i,locale:a,env:r})},getTriggers:function(e,t){return function(e,t){var n=t.app,i=t.triggerTypes,o=t.env,a=t.formats,s="@webgate/"+c(o)+"triggers?"+r("trig_type",i)+r("ctv_type",a);return e.request(s,{method:"GET",authorize:!0,headers:{"App-Platform":n.platform,"Content-Type":"application/json","X-Client-Id":n.clientId},rejectNotOk:!0,responseType:"json"}).then((function(e){return function(e){return e.body||[]}(e)})).catch((function(){return[]}))}(l,{app:n,formats:o,env:t,triggerTypes:e})},track:function(e){return function(e,t,n){e.request(t,s(n))}(l,e,n)}}},_=["DISMISS","URL","EXTERNAL_URL","SELECT_OPTION"];function v(e,t,n){var i=document.createElement("iframe");return i.srcdoc=e.htmlContent,i.addEventListener("load",(function(){!function(e,t,n){var i=e.contentDocument,o=e.contentWindow;i&&i.querySelectorAll("[data-click-to-action-id]").forEach((function(e){o&&e instanceof o.HTMLElement&&e.addEventListener("click",(function(e){var i,r=e.currentTarget;if(r instanceof o.HTMLElement||r instanceof HTMLElement){var a=r.dataset.clickToActionId,s=a&&t[a];s&&(i=s.action,_.some((function(e){return e===i})))&&n(s)}}))}))}(i,e.actions,n),function(e){var t=e.contentDocument;t&&(e.style.width=(t.body.getAttribute("data-iframe-width")||y)+"px",e.style.height=t.body.scrollHeight+"px")}(i),t()}),{once:!0}),i}var y=500;var E=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},b=function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.silly=t.verbose=t.debug=t.info=t.warn=t.error=t.log=t.logger=void 0,t.logger={log:(...e)=>console.log(...e),error:(...e)=>console.error(...e),warn:(...e)=>console.warn(...e),info:(...e)=>console.info(...e),debug:(...e)=>console.debug(...e),verbose:(...e)=>console.log("verbose:",...e),silly:(...e)=>console.log("silly:",...e)},t.default=t.logger,t.log=t.logger.log.bind(t.logger),t.error=t.logger.error.bind(t.logger),t.warn=t.logger.warn.bind(t.logger),t.info=t.logger.info.bind(t.logger),t.debug=t.logger.debug.bind(t.logger),t.verbose=t.logger.verbose.bind(t.logger),t.silly=t.logger.silly.bind(t.logger)},87493:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});const i="Node already exists in another list!";class o{constructor(e){this.listId=null,this.key="",this.prev=null,this.next=null,this.value=null,this.value=e}}class r{constructor(){this._id={},this.length=0,this.first=null,this.last=null}append(e){if(e.listId)throw new Error(i);return e.listId=this._id,this.first?this.last&&(e.prev=this.last,e.next=null,this.last.next=e,this.last=e):(this.first=e,this.last=e),++this.length}insertAfter(e,t){if(t.listId)throw new Error(i);return t.listId=this._id,t.prev=e,t.next=e.next,e.next&&(e.next.prev=t),e.next=t,t.prev===this.last&&(this.last=t),++this.length}remove(e){return!(!this.length||e.listId!==this._id)&&(this.length>1?(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this.first?this.first=e.next:e===this.last&&(this.last=e.prev)):(this.first=null,this.last=null),e.listId=null,e.prev=null,e.next=null,this.length--,!0)}}class a{constructor(e){this._limit=100,this._list=new r,this._map={},this._limit=e}get(e){const t=this._map[e];if(!t)return null;const n=this._list;return n.remove(t),n.append(t),t.value}set(e,t){if(!e)throw new TypeError("Cache key cannot be empty.");const n=this._list,i=this._map;if(n.length>=this._limit){const e=n.first;i[e.key]=null,n.remove(e)}let r=i[e];r?(n.remove(r),r.value=t):(r=new o(t),r.key=e),n.append(r),i[e]=r}remove(e){const t=this._map,n=t[e];return n?(this._list.remove(n),t[e]=null,n.value):null}keys(){const e=[];let t=this._list.first;for(;t;)e.push(t.key),t=t.next;return e.reverse()}values(){const e=[];let t=this._list.first;for(;t;)e.push(t.value),t=t.next;return e.reverse()}size(){return this._list.length}clear(){const e=this._list.length;return this._list=new r,this._map={},e}}},69382:(e,t,n)=>{"use strict";n.d(t,{$_:()=>co,VB:()=>ee,Po:()=>lo});var i=n(11527),o=n(50959);function r(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function a(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]r||setTimeout(i,s,o)},onDiscarded:c,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:k?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:k?5e3:3e3,compare:function(e,t){return v(e)==v(t)},isPaused:function(){return!1},cache:G,mutate:K,fallback:{}},I),Y=function(e,t){var n=f(e,t);if(t){var i=e.use,o=e.fallback,r=t.use,a=t.fallback;i&&r&&(n.use=i.concat(r)),o&&a&&(n.fallback=f(o,a))}return n},j=(0,o.createContext)({}),z=function(e,t,n){var i=t[e]||(t[e]=[]);return i.push(n),function(){var e=i.indexOf(n);e>=0&&(i[e]=i[i.length-1],i.pop())}},J={dedupe:!0},q=(u.defineProperty((function(e){var t=e.value,n=Y((0,o.useContext)(j),t),i=t&&t.provider,r=(0,o.useState)((function(){return i?B(i(n.cache||G),t):l}))[0];return r&&(n.cache=r[0],n.mutate=r[1]),R((function(){return r?r[2]:l}),[]),(0,o.createElement)(j.Provider,f(e,{value:n}))}),"default",{value:W}),s=function(e,t,n){var i=n.cache,s=n.compare,c=n.fallbackData,u=n.suspense,h=n.revalidateOnMount,m=n.refreshInterval,g=n.refreshWhenHidden,_=n.refreshWhenOffline,v=w.get(i),y=v[0],E=v[1],b=v[2],S=v[3],A=D(e),T=A[0],O=A[1],I=A[2],C=(0,o.useRef)(!1),P=(0,o.useRef)(!1),k=(0,o.useRef)(T),x=(0,o.useRef)(t),F=(0,o.useRef)(n),B=function(){return F.current},H=function(){return B().isVisible()&&B().isOnline()},G=function(e){return i.set(I,f(i.get(I),e))},K=i.get(T),W=d(c)?n.fallback[T]:c,Y=d(K)?W:K,j=i.get(I)||{},q=j.error,X=!C.current,Z=function(){return X&&!d(h)?h:!B().isPaused()&&(u?!d(Y)&&n.revalidateIfStale:d(Y)||n.revalidateIfStale)},Q=!(!T||!t)&&(!!j.isValidating||X&&Z()),$=function(e,t){var n=(0,o.useState)({})[1],i=(0,o.useRef)(e),r=(0,o.useRef)({data:!1,error:!1,isValidating:!1}),a=(0,o.useCallback)((function(e){var o=!1,a=i.current;for(var s in e){var c=s;a[c]!==e[c]&&(a[c]=e[c],r.current[c]&&(o=!0))}o&&!t.current&&n({})}),[]);return R((function(){i.current=e})),[i,r.current,a]}({data:Y,error:q,isValidating:Q},P),ee=$[0],te=$[1],ne=$[2],ie=(0,o.useCallback)((function(e){return r(void 0,void 0,void 0,(function(){var t,o,r,c,u,f,h,m,g,_,v,y,E;return a(this,(function(a){switch(a.label){case 0:if(t=x.current,!T||!t||P.current||B().isPaused())return[2,!1];c=!0,u=e||{},f=!S[T]||!u.dedupe,h=function(){return!P.current&&T===k.current&&C.current},m=function(){var e=S[T];e&&e[1]===r&&delete S[T]},g={isValidating:!1},_=function(){G({isValidating:!1}),h()&&ne(g)},G({isValidating:!0}),ne({isValidating:!0}),a.label=1;case 1:return a.trys.push([1,3,,4]),f&&(M(i,T,ee.current.data,ee.current.error,!0),n.loadingTimeout&&!i.get(T)&&setTimeout((function(){c&&h()&&B().onLoadingSlow(T,n)}),n.loadingTimeout),S[T]=[t.apply(void 0,O),U()]),E=S[T],o=E[0],r=E[1],[4,o];case 2:return o=a.sent(),f&&setTimeout(m,n.dedupingInterval),S[T]&&S[T][1]===r?(G({error:l}),g.error=l,v=b[T],!d(v)&&(r<=v[0]||r<=v[1]||0===v[1])?(_(),f&&h()&&B().onDiscarded(T),[2,!1]):(s(ee.current.data,o)?g.data=ee.current.data:g.data=o,s(i.get(T),o)||i.set(T,o),f&&h()&&B().onSuccess(o,T,n),[3,4])):(f&&h()&&B().onDiscarded(T),[2,!1]);case 3:return y=a.sent(),m(),B().isPaused()||(G({error:y}),g.error=y,f&&h()&&(B().onError(y,T,n),("boolean"==typeof n.shouldRetryOnError&&n.shouldRetryOnError||p(n.shouldRetryOnError)&&n.shouldRetryOnError(y))&&H()&&B().onErrorRetry(y,T,n,ie,{retryCount:(u.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return c=!1,_(),h()&&f&&M(i,T,g.data,g.error,!1),[2,!0]}}))}))}),[T]),oe=(0,o.useCallback)(V.bind(l,i,(function(){return k.current})),[]);if(R((function(){x.current=t,F.current=n})),R((function(){if(T){var e=T!==k.current,t=ie.bind(l,J),n=0,i=z(T,E,(function(e,t,n){ne(f({error:t,isValidating:n},s(ee.current.data,e)?l:{data:e}))})),o=z(T,y,(function(e){if(0==e){var i=Date.now();B().revalidateOnFocus&&i>n&&H()&&(n=i+B().focusThrottleInterval,t())}else if(1==e)B().revalidateOnReconnect&&H()&&t();else if(2==e)return ie()}));return P.current=!1,k.current=T,C.current=!0,e&&ne({data:Y,error:q,isValidating:Q}),Z()&&(d(Y)||N?t():L(t)),function(){P.current=!0,i(),o()}}}),[T,ie]),R((function(){var e;function t(){var t=p(m)?m(Y):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){ee.current.error||!g&&!B().isVisible()||!_&&!B().isOnline()?t():ie(J).then(t)}return t(),function(){e&&(clearTimeout(e),e=-1)}}),[m,g,_,ie]),(0,o.useDebugValue)(Y),u&&d(Y)&&T)throw x.current=t,F.current=n,P.current=!1,d(q)?ie(J):q;return{mutate:oe,get data(){return te.data=!0,Y},get error(){return te.error=!0,q},get isValidating(){return te.isValidating=!0,Q}}},function(){for(var e=[],t=0;t0;)u=d[h](u);return u(r,a||l.fetcher,l)}),X=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};var Z=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const Q=(e,t,n)=>{const{data:i}=q("masthead-data",(()=>Z(void 0,void 0,void 0,(function*(){return yield(i={market:e,language:t,testFeature:n},X(void 0,void 0,void 0,(function*(){const{language:e,market:t,testFeature:n}=i,o=window.location.origin.includes(".com")?"https://www.spotify.com":"https://www-testing.spotify.net",r=n?`&testFeature=${n}`:"",a=yield fetch(`${o}/api/masthead/v1/masthead?market=${t}&language=${e}${r}`,{credentials:"include"});return yield a.json()})));var i}))),{errorRetryCount:2});return null!=i?i:null},$=(0,o.createContext)(null),ee=({market:e,language:t,children:n,testFeature:o})=>{const r=Q(e,t,o);return(0,i.jsx)($.Provider,Object.assign({value:r},{children:n}))};var te,ne,ie;!function(e){e.UNKNOWN="UNKNOWN",e.NORMAL="normal",e.CONDENSED="condensed",e.MESSAGES_ONLY="messagesOnly"}(te||(te={})),function(e){e.INSTAGRAM="Instagram",e.TWITTER="Twitter",e.FACEBOOK="Facebook"}(ne||(ne={})),function(e){e.CCPA="Ccpa"}(ie||(ie={}));ie.CCPA;var oe=n(42240);const re="#121212",ae="rgba(255, 255, 255, 0.1)",se="#000000",ce= getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),le="4px",ue="8px",de="12px",pe="16px",fe="20px",he="24px",me="32px",ge="40px",_e="48px",ve="56px",ye="768px",Ee="992px",be=ye;oe.ZP.div.withConfig({displayName:"Header__StyledHeader",componentId:"sc-1o8eth5-0"})(["background-color:",";height:56px;@media (min-width:","){height:53px;}@media (min-width:","){height:56px;}color:",";"],se,ye,Ee,ce);var Se=n(57873),Ae="buttonTertiary",Te="horizontalRule",Oe="icon",Ie="list",Ce="textLink",Ne="type",Le=function(){return(0,oe.iv)(["box-sizing:border-box;-webkit-tap-highlight-color:transparent;"])},Re=(n(46758),n(53321),n(27082),n(86277),n(2836),n(81485)),Pe=n(37628);const ke={base:{background:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight:"#f6f6f6",press:"#b7b7b7",elevated:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight:"#f6f6f6",press:"#b7b7b7"},tinted:{base:"rgba(0, 0, 0, 0.08)",highlight:"rgba(0, 0, 0, 0.05)",press:"rgba(0, 0, 0, 0.12)"},unsafeForSmallText:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),press: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()}},text:{base:"#000000",subdued:"#6a6a6a",brightAccent:"#117a37",negative:"#d31225",warning:"#9d5a00",positive:"#117a37",announcement:"#0c67d3"},essential:{base:"#000000",subdued:"#878787",brightAccent:"#169b45",negative:"#e91429",warning:"#c77200",positive:"#169b45",announcement:"#0d72ea"},decorative:{base:"#000000",subdued:"#dedede"}},brightAccent:{background:{base:"#1ed760",highlight:"#1fdf64",press:"#169c46",elevated:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"},tinted:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"},unsafeForSmallText:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"}},text:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},essential:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},decorative:{base:"#000000",subdued:"#1abc54"}},negative:{background:{base:"#e91429",highlight:"#de1327",press:"#920d1a",elevated:{base:"#e91429",highlight:"#e91429",press:"#e91429"},tinted:{base:"#e91429",highlight:"#e91429",press:"#e91429"},unsafeForSmallText:{base:"#e91429",highlight:"#e91429",press:"#e91429"}},text:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},essential:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},decorative:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#ee3a4c"}},warning:{background:{base:"#ffa42b",highlight:"#ffaf45",press:"#c57100",elevated:{base:"#ffa42b",highlight:"#ffa42b",press:"#ffa42b"},tinted:{base:"#ffa42b",highlight:"#ffa42b",press:"#ffa42b"},unsafeForSmallText:{base:"#ffa42b",highlight:"#ffa42b",press:"#ffa42b"}},text:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},essential:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},decorative:{base:"#000000",subdued:"#f18900"}},positive:{background:{base:"#1ed760",highlight:"#1fdf64",press:"#169c46",elevated:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"},tinted:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"},unsafeForSmallText:{base:"#1ed760",highlight:"#1ed760",press:"#1ed760"}},text:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},essential:{base:"#000000",subdued:"#000000",brightAccent:"#000000",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},decorative:{base:"#000000",subdued:"#1abc54"}},announcement:{background:{base:"#0d72ea",highlight:"#0c6ddf",press:"#084791",elevated:{base:"#0d72ea",highlight:"#0d72ea",press:"#0d72ea"},tinted:{base:"#0d72ea",highlight:"#0d72ea",press:"#0d72ea"},unsafeForSmallText:{base:"#0d72ea",highlight:"#0d72ea",press:"#0d72ea"}},text:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},essential:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},decorative:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#2a86f3"}},invertedDark:{background:{base:"#000000",highlight:"#0d0d0d",press:"#3f3f3f",elevated:{base:"#000000",highlight:"#000000",press:"#000000"},tinted:{base:"#000000",highlight:"#000000",press:"#000000"},unsafeForSmallText:{base:"#000000",highlight:"#000000",press:"#000000"}},text:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#8f8f8f",brightAccent:"#1ed760",negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},essential:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#5e5e5e",brightAccent:"#1ed760",negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},decorative:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#1f1f1f"}},invertedLight:{background:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight:"#f6f6f6",press:"#b7b7b7",elevated:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),press: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},tinted:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),press: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},unsafeForSmallText:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),highlight: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),press: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()}},text:{base:"#000000",subdued:"#5e5e5e",brightAccent:"#12833a",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},essential:{base:"#000000",subdued:"#8f8f8f",brightAccent:"#17a449",negative:"#000000",warning:"#000000",positive:"#000000",announcement:"#000000"},decorative:{base:"#000000",subdued:"#dedede"}},mutedAccent:{background:{base:"#121212",highlight:"#1a1a1a",press:"#000000",tinted:{base:"rgba(255, 255, 255, 0.07)",highlight:"rgba(255, 255, 255, 0.1)",press:"rgba(255, 255, 255, 0.04)"},elevated:{base:"#121212",highlight:"#121212",press:"#121212"},unsafeForSmallText:{base:"#121212",highlight:"#121212",press:"#121212"}},text:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#a7a7a7",brightAccent:"#1ed760",negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},essential:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#727272",brightAccent:"#1ed760",negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},decorative:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"#292929"}},overMedia:{background:{base:"rgba(0, 0, 0, 0.54)",highlight:"rgba(0, 0, 0, 0.56)",press:"rgba(0, 0, 0, 0.72)",unsafeForSmallText:{base:"rgba(0, 0, 0, 0.42)",highlight:"rgba(0, 0, 0, 0.44)",press:"rgba(0, 0, 0, 0.61)"},elevated:{base:"rgba(0, 0, 0, 0.54)",highlight:"rgba(0, 0, 0, 0.54)",press:"rgba(0, 0, 0, 0.54)"},tinted:{base:"rgba(0, 0, 0, 0.54)",highlight:"rgba(0, 0, 0, 0.54)",press:"rgba(0, 0, 0, 0.54)"}},text:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},essential:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),brightAccent: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),negative: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),warning: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),positive: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),announcement: getComputedStyle(document.body).getPropertyValue("--spice-text").trim()},decorative:{base: getComputedStyle(document.body).getPropertyValue("--spice-text").trim(),subdued:"rgba(255, 255, 255, 0.13)"}}};n(74654);function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function we(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(t).reduce((function(t,i){var o,r=(0,Pe.Z)(i,2),a=r[0],s=r[1],c=a;return""!==n&&(c="".concat(n).concat((o=a).charAt(0).toUpperCase()+o.slice(1))),"object"==typeof s?we(we({},t),e(s,c)):"string"==typeof s?(t[c]=s,t):t}),{})});function Ve(e){return e.replace(/[A-Z0-9]/g,(function(e){return"-".concat(e.toLowerCase())}))}function Fe(e){return"--".concat(Ve(e))}function Be(e,t){var n=Ue(xe)[e];return t&&(n=t),"var(".concat(Fe(e),", ").concat(n,")")}var He={textBase:"textBase",textSubdued:"textSubdued",textBrightAccent:"textBrightAccent",textNegative:"textNegative",textWarning:"textWarning",textPositive:"textPositive",textAnnouncement:"textAnnouncement"},Ge={essentialBase:"essentialBase",essentialSubdued:"essentialSubdued",essentialBrightAccent:"essentialBrightAccent",essentialNegative:"essentialNegative",essentialWarning:"essentialWarning",essentialPositive:"essentialPositive",essentialAnnouncement:"essentialAnnouncement"},Ke={decorativeBase:"decorativeBase",decorativeSubdued:"decorativeSubdued"},We=(we(we(we({},He),Ge),Ke),we(we(we(we({},{backgroundBase:"backgroundBase",backgroundHighlight:"backgroundHighlight",backgroundPress:"backgroundPress",backgroundElevatedBase:"backgroundElevatedBase",backgroundElevatedHighlight:"backgroundElevatedHighlight",backgroundElevatedPress:"backgroundElevatedPress",backgroundTintedBase:"backgroundTintedBase",backgroundTintedHighlight:"backgroundTintedHighlight",backgroundTintedPress:"backgroundTintedPress",backgroundUnsafeForSmallTextBase:"backgroundUnsafeForSmallTextBase",backgroundUnsafeForSmallTextHighlight:"backgroundUnsafeForSmallTextHighlight",backgroundUnsafeForSmallTextPress:"backgroundUnsafeForSmallTextPress"}),He),Ge),Ke));function Ye(e,t){return"var(--spacer-".concat(e,", ").concat(t,")")}var je=oe.ZP.hr.withConfig({displayName:"HorizontalRule__HorizontalRuleElement",componentId:"sc-198gjx4-0"})(["",";border:0;border-block-start:1px solid ",";margin-block-end:",";margin-block-start:",";"],Le(),Be(We.decorativeSubdued),Ye(1,he),Ye(1,he));const ze={fontSize:"1rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Je={fontSize:"1rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},qe={fontSize:"0.875rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Xe={fontSize:"0.875rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Ze={fontSize:"0.8125rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Qe={fontSize:"0.8125rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},$e={fontSize:"3.5rem",fontWeight:900,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},et={fontSize:"3rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},tt={fontSize:"2.5rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},nt={fontSize:"0.6875rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},it={fontSize:"0.6875rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},ot={fontSize:"0.625rem",fontWeight:400,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},rt={fontSize:"0.625rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},at={fontSize:"0.875rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},st={fontSize:"2rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},ct={fontSize:"2rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},lt={fontSize:"1.5rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},ut={fontSize:"1.125rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},dt={fontSize:"1.125rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},pt={fontSize:"1rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},ft={fontSize:"1rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},ht={fontSize:"0.875rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},mt={fontSize:"0.875rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},gt={fontSize:"0.875rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},_t={fontSize:"0.875rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},vt={fontSize:"6rem",fontWeight:900,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},yt={fontSize:"4.5rem",fontWeight:900,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Et={fontSize:"3rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},bt={fontSize:"0.875rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},St={fontSize:"0.75rem",fontWeight:400,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},At={fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Tt={fontSize:"0.6875rem",fontWeight:400,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Ot={fontSize:"0.6875rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},It={fontSize:"3rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Ct={fontSize:"2rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Nt={fontSize:"1.5rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Lt={fontSize:"1.5rem",fontWeight:700,fontFamily:"CircularSpTitle,CircularSpTitle-Tall,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"},Rt={fontSize:"1.125rem",fontWeight:700,fontFamily:"CircularSp,CircularSp-Arab,CircularSp-Hebr,CircularSp-Cyrl,CircularSp-Grek,CircularSp-Deva, var(--fallback-fonts, sans-serif)"};var Pt=function(e,t){var n=e.fontSize!==t.fontSize,i=e.fontWeight!==t.fontWeight,o=e.textTransform!==t.textTransform,r=e.letterSpacing!==t.letterSpacing,a=e.fontFamily!==t.fontFamily,s=n||i||a||o||r;return(0,oe.iv)(["font-size:",";font-weight:",";text-transform:",";letter-spacing:",";font-family:var(--font-family,",");",";"],e.fontSize,e.fontWeight,e.textTransform,e.letterSpacing,e.fontFamily,s&&(0,oe.iv)(["@media (min-width:","){font-size:",";font-weight:",";font-family:",";text-transform:",";letter-spacing:",";}"],be,n&&t.fontSize,i&&t.fontWeight,a&&"var(--font-family, ".concat(t.fontFamily,")"),o&&t.textTransform,r&&t.letterSpacing))},kt=function(){return Pt(dt,Rt)},Dt=function(){return Pt(Je,ft)},wt=function(){return Pt(qe,ht)},Mt=function(){return Pt(Xe,mt)},xt=function(){return Pt(Qe,_t)},Ut=function(){return Pt(it,Ot)},Vt=n(49),Ft={useBrowserDefaultFocusStyle:!1},Bt=o.createContext(Ft);Bt.displayName="BrowserDefault";var Ht={isUsingKeyboard:!0},Gt=o.createContext(Ht);Gt.displayName="KeyboardDetection";Be(We.essentialBase);var Kt="200ms",Wt="ease-in",Yt=(0,oe.iv)(["&:focus{outline:none;}"]);var jt,zt,Jt,qt=(0,oe.iv)(["display:block;position:absolute;pointer-events:none;transition:border-color "," ",";box-sizing:border-box;"],Kt,Wt),Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,oe.iv)(["position:relative;"," ",""],Yt,t&&(0,oe.iv)(["&::after{content:'';","}&:focus::after{border-color:inherit;}",""],function(e){return(0,oe.iv)([""," bottom:","px;border-bottom:","px solid transparent;width:100%;"],qt,e-6,3)}(e),n&&(0,oe.iv)(["&::after{border-color:inherit;}"])))},Zt=(jt="compact",zt=he,Jt?"calc(-1 * var(--layout-margin-".concat(jt,", ").concat(zt,"))"):"var(--layout-margin-".concat(jt,", ").concat(zt,")"),{experimental:"experimental",next:"next",deprecated:"deprecated"}),Qt="button",$t={experimental:[],next:[],deprecated:[]},en=o.createContext($t);en.displayName="Encore";var tn=function(e){return parseInt(e,10)},nn={sm:ue,md:"14px",lg:pe},on={sm:me,md:_e,lg:ve},rn={sm:le,md:ue,lg:de},an={sm:16,md:24,lg:24},sn={sm:pe,md:me,lg:_e},cn={sm:de,md:fe,lg:he},ln={sm:"5px",md:de,lg:"10px"},un=function(e,t){if(t===Zt.deprecated)return function(e){switch(e){case"sm":return Ut();case"md":default:return Mt();case"lg":return Dt()}}(e);switch(e){case"sm":return xt();case"md":default:return Dt();case"lg":return kt()}},dn=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t="".concat("deprecated"===(arguments.length>2?arguments[2]:void 0)?tn(nn[e])-n:tn(rn[e])-n,"px");var i="".concat(tn(sn[e])-n,"px"),o="".concat(function(e){var t=ln[e],n=an[e];return tn(cn[e])+n+tn(t)}(e)-n,"px");return{paddingTopBottom:t,paddingLeftRight:i,withIconPaddingLeftRight:o}},pn=(0,oe.iv)(["cursor:",";opacity:",";transform:scale(1);"],"not-allowed","0.3"),fn=(0,oe.iv)(["opacity:",";outline:none;transform:scale(1);"],"0.7"),hn=(0,oe.iv)(["transform:scale(",");"],"1.04"),mn=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,oe.iv)(["background-color:transparent;border:0;color:inherit;line-height:1;letter-spacing:inherit;padding:0;",""],!e&&Yt)},gn=["component","isUsingKeyboard","useBrowserDefaultFocusStyle","isHover","isFocus","isActive","standalone","semanticColor"],_n=function(e){var t=e.color;return(0,oe.iv)(["text-decoration:underline;color:",";"],t)},vn=(0,oe.iv)(["box-shadow:",";transition:box-shadow "," ",";&&{text-decoration:none;}"],"0 3px 0 0",Kt,Wt),yn=(0,oe.iv)(["color:",";"],Be(We.textBrightAccent)),En=(0,oe.iv)(["color:",";opacity:",";cursor:not-allowed;"],Be(We.textSubdued),"0.3"),bn=function(e){var t=e.semanticColor;return(0,oe.iv)(["text-decoration:underline;color:",";"],Be(t||We.textSubdued))},Sn=(0,oe.iv)(["color:",";"],Be(We.textBase)),An=function(e){var t=e.semanticColor;return(0,oe.iv)(["text-decoration:underline;color:",";"],Be(t||We.textBase))},Tn=(0,oe.iv)(["text-decoration:none;"]),On=(0,oe.ZP)(o.forwardRef((function(e,t){var n=e.component,i=(e.isUsingKeyboard,e.useBrowserDefaultFocusStyle,e.isHover,e.isFocus,e.isActive,e.standalone,e.semanticColor,(0,Vt.Z)(e,gn));return o.createElement(n,Object.assign({},i,{ref:t}))}))).withConfig({displayName:"Link",componentId:"sc-k8gsk-0"})(["",";",";"," align-items:center;text-decoration:none;&[href],&:hover:not([disabled]){text-decoration:underline;}&[href]:hover{",";}"," &[href]:active{",";}&&{",";",";",";}&[disabled],&[href][disabled],&[aria-disabled='true']{",";}",""],Le(),(function(e){return"button"===e.component&&(0,oe.iv)(["",";font-size:inherit;&:focus{","}"],mn(e.useBrowserDefaultFocusStyle),e.isUsingKeyboard&&!e.useBrowserDefaultFocusStyle&&vn)}),(function(e){return e.semanticColor?(0,oe.iv)(["color:",";"],Be(e.semanticColor)):(0,oe.iv)(["color:inherit;"])}),(function(e){return e.semanticColor?_n({color:Be(e.semanticColor)}):_n({color:Be(We.textBrightAccent)})}),(function(e){return!e.useBrowserDefaultFocusStyle&&(0,oe.iv)(["&[href]:focus{outline:none;",";}"],e.isUsingKeyboard&&vn)}),yn,(function(e){return e.isHover&&(e.semanticColor?_n({color:Be(e.semanticColor)}):_n({color:Be(We.textBrightAccent)}))}),(function(e){return e.isFocus&&!e.useBrowserDefaultFocusStyle&&vn}),(function(e){return e.isActive&&yn}),En,(function(e){return e.standalone&&(0,oe.iv)(["color:",";display:inline-flex;&,&[href]{text-decoration:none;}&[href]:hover,&[href]:hover:focus{",";}&[href]:focus{text-decoration:none;",";}&[href]:active{",";}&&{",";",";",";}&[disabled],&[href][disabled],&[aria-disabled='true']{",";}"],e.semanticColor?Be(e.semanticColor):Be(We.textSubdued),bn({semanticColor:e.semanticColor}),e.isUsingKeyboard&&Sn,An({semanticColor:e.semanticColor}),e.isHover&&bn({semanticColor:e.semanticColor}),e.isFocus&&Sn,e.isActive&&An({semanticColor:e.semanticColor}),Tn)})),In=["children","color","semanticColor","component","href","disabled","role"],Cn=o.forwardRef((function(e,t){var n=e.children,i=e.color,r=e.semanticColor,a=e.component,s=void 0===a?"a":a,c=e.href,l=e.disabled,u=e.role,d=(0,Vt.Z)(e,In),p=(0,o.useContext)(Gt).isUsingKeyboard,f=(0,o.useContext)(Bt).useBrowserDefaultFocusStyle;return o.createElement(On,Object.assign({component:s,isUsingKeyboard:p,useBrowserDefaultFocusStyle:f,color:i,semanticColor:r,ref:t,href:l?void 0:c,disabled:l,"aria-disabled":l,role:l&&"button"!==s?"link":u},d,{"data-encore-id":Ce}),n)})),Nn=(0,oe.ZP)(o.forwardRef((function(e,t){return o.createElement(Cn,Object.assign({semanticColor:"textBase",standalone:!0,ref:t},e))}))).withConfig({displayName:"Link",componentId:"sc-fe80qw-0"})(["display:block;",";"],Ut());var Ln=o.forwardRef((function(e,t){var n=e.target&&"_blank"===e.target?"noopener noreferrer":void 0;return o.createElement(Nn,Object.assign({},e,{ref:t,rel:n}))})),Rn=oe.ZP.ul.attrs((function(e){return{role:e.role||"list"}})).withConfig({displayName:"List__ListElement",componentId:"sc-64p3hb-0"})(["",";padding-inline-start:0;padding-inline-end:0;margin-block-start:0;margin-block-end:0;overflow-wrap:break-word;",";"],Le(),(function(e){return!1!==e.listStyleReset&&(0,oe.iv)(["list-style-type:none;"])})),Pn=o.forwardRef((function(e,t){var n=(0,Se.Z)({},e);return o.createElement(Rn,Object.assign({},n,{ref:t,"data-encore-id":Ie}))})),kn=function(e){switch(e){case"book":return 400;case"bold":return 700;case"black":return 900;default:return function(e){throw new Error("Unreachable value")}()}},Dn=function(e){switch(e){case"bass":return Pt($e,vt);case"forte":return Pt(et,yt);case"brio":return Pt(tt,Et);case"altoBrio":return Pt(st,It);case"alto":return Pt(ct,Ct);case"canon":return Pt(lt,Nt);case"celloCanon":return Pt(ut,Lt);case"cello":return kt();case"ballad":return Pt(ze,pt);case"balladBold":return Dt();case"viola":default:return wt();case"violaBold":return Mt();case"mesto":return Pt(Ze,gt);case"mestoBold":return xt();case"metronome":return Pt(at,bt);case"finale":return Pt(nt,Tt);case"finaleBold":return Ut();case"minuet":return Pt(ot,St);case"minuetBold":return Pt(rt,At)}},wn=oe.ZP.span.withConfig({displayName:"Type__TypeElement",componentId:"sc-goli3j-0"})(["",";margin-block-start:0;margin-block-end:0;",";",";"," ",";"],Le(),(function(e){return e.variant?Dn(e.variant):void 0}),(function(e){return e.paddingBottom&&(0,oe.iv)(["padding-block-end:",";"],e.paddingBottom)}),(function(e){return e.semanticColor?(0,oe.iv)(["color:",";"],Be(e.semanticColor)):(0,oe.iv)(["color:inherit;"])}),(function(e){return e.weight&&(0,oe.iv)(["font-weight:",";"],kn(e.weight))})),Mn=["color","semanticColor","paddingBottom","variant"];function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Un(e){for(var t=1;te.columnWidth?`width: ${e.columnWidth}`:"width: 40%"),(e=>e.columnGap?`margin-right: ${e.columnGap}`:`margin-right: ${he}`),(e=>e.columnGap?`margin-left: ${e.columnGap}`:`margin-left: ${he}`),Ee,(e=>e.columnWidth?`width: ${e.columnWidth}`:"width: 20%")),zn=(0,oe.ZP)(Ln).withConfig({displayName:"TopLinksGroup__MastheadFooterLink",componentId:"sc-100cyfq-1"})(["margin:"," 0;width:fit-content;span:hover{color:",";}"],ue,ce),Jn=({title:e,links:t,columnWidth:n,columnGap:o})=>e&&t?(0,i.jsx)(jn,Object.assign({columnWidth:n,columnGap:o},{children:(0,i.jsxs)(Pn,{children:[(0,i.jsx)(Bn,Object.assign({as:"p",variant:"balladBold"},{children:e})),t.map((e=>(0,i.jsx)(zn,Object.assign({role:"link",href:e.href,semanticColor:We.textSubdued,onClick:()=>{return t=e.href,n=e.dataAttributes["data-ga-action"],Kn({metric_type:Hn.MetricTypes.COUNTER,what:Yn.CTA_CLICK,value:1}),void(0,Gn.sendWwwAnalyticsAgnostic)({category:Wn.MASTHEAD,action:Yn.CLICK,label:n,destination_url:t});var t,n}},e.dataAttributes,{children:(0,i.jsx)(Bn,Object.assign({variant:"ballad",paddingBottom:ue},{children:e.title}))}),e.href)))]})})):null,qn=({columnWidth:e,columnGap:t})=>{var n,r,a,s;const c=(0,o.useContext)($),l=null===(r=null===(n=null==c?void 0:c.footer)||void 0===n?void 0:n.topLinkGroups[0])||void 0===r?void 0:r.title,u=null===(s=null===(a=null==c?void 0:c.footer)||void 0===a?void 0:a.topLinkGroups[0])||void 0===s?void 0:s.links;return(0,i.jsx)(Jn,{title:l,links:u,columnWidth:e,columnGap:t})},Xn=({columnWidth:e,columnGap:t})=>{var n,r,a,s;const c=(0,o.useContext)($),l=null===(r=null===(n=null==c?void 0:c.footer)||void 0===n?void 0:n.topLinkGroups[1])||void 0===r?void 0:r.title,u=null===(s=null===(a=null==c?void 0:c.footer)||void 0===a?void 0:a.topLinkGroups[1])||void 0===s?void 0:s.links;return(0,i.jsx)(Jn,{title:l,links:u,columnWidth:e,columnGap:t})},Zn=({hideWebPlayerLink:e,columnWidth:t,columnGap:n})=>{var r,a,s,c;const l=(0,o.useContext)($),u=null===(a=null===(r=null==l?void 0:l.footer)||void 0===r?void 0:r.topLinkGroups[2])||void 0===a?void 0:a.title,d=null===(c=null===(s=null==l?void 0:l.footer)||void 0===s?void 0:s.topLinkGroups[2])||void 0===c?void 0:c.links.filter((t=>!e||"https://open.spotify.com/"!==t.href));return(0,i.jsx)(Jn,{title:u,links:d,columnWidth:t,columnGap:n})};var Qn;!function(e){e.ADDITIONAL_CLASSES="additionalClassNames",e.ADDITIONAL_IDS="additionalIds"}(Qn||(Qn={}));const $n=(e,t)=>{var n;return e[t]?null===(n=e[t])||void 0===n?void 0:n.join(" "):""},ei=()=>(0,i.jsxs)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 30 14","aria-labelledby":"ccpa-svg-title",style:{width:"25px",paddingLeft:le,paddingBottom:le}},{children:[(0,i.jsx)("title",Object.assign({id:"ccpa-svg-title"},{children:"California Consumer Privacy Act (CCPA) Opt-Out Icon"})),(0,i.jsx)("path",{d:"M7.4 12.8h6.8l3.1-11.6H7.4C4.2 1.2 1.6 3.8 1.6 7s2.6 5.8 5.8 5.8z",style:{fillRule:"evenodd",clipRule:"evenodd",fill:"#fff"}}),(0,i.jsx)("path",{d:"M22.6 0H7.4c-3.9 0-7 3.1-7 7s3.1 7 7 7h15.2c3.9 0 7-3.1 7-7s-3.2-7-7-7zm-21 7c0-3.2 2.6-5.8 5.8-5.8h9.9l-3.1 11.6H7.4c-3.2 0-5.8-2.6-5.8-5.8z",style:{fillRule:"evenodd",clipRule:"evenodd",fill:"#06f"}}),(0,i.jsx)("path",{d:"M24.6 4c.2.2.2.6 0 .8L22.5 7l2.2 2.2c.2.2.2.6 0 .8-.2.2-.6.2-.8 0l-2.2-2.2-2.2 2.2c-.2.2-.6.2-.8 0-.2-.2-.2-.6 0-.8L20.8 7l-2.2-2.2c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0l2.2 2.2L23.8 4c.2-.2.6-.2.8 0z",style:{fill:"#fff"}}),(0,i.jsx)("path",{d:"M12.7 4.1c.2.2.3.6.1.8L8.6 9.8c-.1.1-.2.2-.3.2-.2.1-.5.1-.7-.1L5.4 7.7c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0L8 8.6l3.8-4.5c.2-.2.6-.2.9 0z",style:{fill:"#06f"}})]})),ti=({name:e})=>e===ie.CCPA?(0,i.jsx)(ei,{}):null,ni=(0,oe.ZP)(Cn).withConfig({displayName:"Link__BottomLink",componentId:"sc-j13lu8-0"})(["margin-bottom:"," !important;text-decoration:none !important;line-height:inherit !important;border:none !important;padding:0 !important;color:"," !important;&:hover{background-color:!important;}[dir='rtl'] &{margin-right:0;margin-left:"," !important;}",""],ue,Be(We.textSubdued),pe,(({$isSmall:e})=>!e&&`span:hover {\n color: ${ce};\n }`)),ii=oe.ZP.div.withConfig({displayName:"Link__Container",componentId:"sc-j13lu8-1"})(["margin-right:",";[dir='rtl'] &{margin-right:0 !important;}"],pe),oi=({link:e,isSmall:t})=>(0,i.jsxs)(ii,{children:[(0,i.jsx)(ni,Object.assign({href:e.href,semanticColor:We.textSubdued,standalone:!0,$isSmall:t,id:$n(e,Qn.ADDITIONAL_IDS),className:$n(e,Qn.ADDITIONAL_CLASSES)},{children:(0,i.jsx)(Bn,Object.assign({variant:t?"finale":"viola"},{children:e.title}))})),(0,i.jsx)(ti,{name:e.icon})]});var ri,ai,si=n(14224),ci="undefined"!=typeof MUTE_ENCORE_WARNINGS&&MUTE_ENCORE_WARNINGS||void 0!==si&&(null==si||null==(ri={})?void 0:ri.MUTE_ENCORE_WARNINGS)||void 0,li="undefined"!=typeof NODE_ENV&&NODE_ENV||void 0!==si&&(null==si||null==(ai={})?void 0:ai.NODE_ENV)||void 0;function ui(e){"true"!==ci&&"production"!==li&&console.warn(e)}var di=["component","semanticColor","condensed","condensedAll","iconLeading","iconTrailing","iconOnly","buttonSize","iconSize","hover","active","focus","isUsingKeyboard","useBrowserDefaultFocusStyle","status"],pi=(0,oe.ZP)(o.forwardRef((function(e,t){var n=e.component,i=void 0===n?"button":n,r=(e.semanticColor,e.condensed,e.condensedAll,e.iconLeading,e.iconTrailing,e.iconOnly,e.buttonSize,e.iconSize,e.hover,e.active,e.focus,e.isUsingKeyboard,e.useBrowserDefaultFocusStyle,e.status,(0,Vt.Z)(e,di));return o.createElement(i,Object.assign({},r,{ref:t}))}))).withConfig({displayName:"Button",componentId:"sc-1dqy6lx-0"})(["",""],(function(e){var t=e.buttonSize,n=e.semanticColor,i=void 0===n?"textSubdued":n,o=e.hover,r=e.active,a=e.focus,s=e.useBrowserDefaultFocusStyle,c=e.status,l=e.isUsingKeyboard,u=e.condensed,d=e.condensedAll,p=e.iconLeading,f=e.iconTrailing,h=e.iconOnly,m=e.iconSize,g=dn(t),_=g.paddingTopBottom,v=g.paddingLeftRight,y="md"===t&&(p||f)?-2:0,E="".concat(tn(_)+y,"px"),b=cn[t],S="".concat((tn(on[t])-m)/2,"px"),A=(0,oe.iv)([""," "," "," "," ",""],!d&&(0,oe.iv)(["padding-block-start:",";padding-block-end:",";min-block-size:",";"],h?S:E,h?S:E,on[t]),d&&(0,oe.iv)(["padding:0;"]),u&&(0,oe.iv)(["padding-inline-start:0;padding-inline-end:0;"]),!u&&!d&&!h&&(0,oe.iv)(["padding-inline-start:",";padding-inline-end:",";"],p?b:v,f?b:v),!u&&!d&&h&&(0,oe.iv)(["padding-inline-start:",";padding-inline-end:",";"],S,S)),T=(0,oe.iv)([""," ",""],hn,"textSubdued"===i&&(0,oe.iv)(["color:",";"],Be(We.textBase))),O=(0,oe.iv)([""," color:",";"],fn,Be(We.textSubdued)),I=(0,oe.iv)([""," color:",";&::before{background-color:transparent;}&::after{border-color:transparent;}"],pn,Be(We.textSubdued));return(0,oe.iv)([""," color:",";min-inline-size:0;",";",";display:inline-flex;align-items:center;justify-content:center;&:hover{","}"," &:active{","}"," "," &[disabled],&[aria-disabled='true'],fieldset[disabled] &{","}"],function(e,t,n){return(0,oe.iv)(["",";"," ",";background-color:transparent;border:0;border-radius:",";display:inline-block;position:relative;text-align:center;text-decoration:none;text-transform:",";touch-action:manipulation;transition-duration:",";transition-property:background-color,border-color,color,box-shadow,filter,transform;user-select:none;vertical-align:middle;transform:translate3d(0,0,0);"],Le(),!t&&Yt,un(e,n),"500px","none","33ms")}(t,s,c),Be(i),(0,oe.iv)(["@supports (overflow-wrap:anywhere){overflow-wrap:anywhere;}@supports not (overflow-wrap:anywhere){word-break:break-word;}"]),A,T,o&&T,O,r&&O,(function(){var e=(d?0:tn(E))+3,t=h?"".concat(m,"px"):"calc(100% - ".concat(u||d?0:2*tn(p||f?b:v),"px)");return(0,oe.iv)(["",";&::after{inline-size:",";}"],!s&&Xt(e,l,a),t)}),I)})),fi=oe.ZP.span.withConfig({displayName:"IconWrapper__Wrapper",componentId:"sc-16usrgb-0"})(["display:flex;",""],(function(e){var t=e.buttonSize,n=e.position;return(0,oe.iv)([""," ",""],"leading"===n&&(0,oe.iv)(["margin-inline-end:",";"],ln[t]),"trailing"===n&&(0,oe.iv)(["margin-inline-start:",";"],ln[t]))})),hi=function(e){var t=e.position,n=e.buttonSize,i=e.icon,r=e.iconSize,a=i;return o.createElement(fi,{position:t,buttonSize:n,"aria-hidden":"true"},o.createElement(a,{iconSize:r}))},mi=function(e){var t=e.iconOnly,n=e.iconLeading,i=e.iconTrailing,r=e.children,a=e.buttonSize,s=e.iconSize,c=function(e,t){return t&&o.createElement(hi,{icon:t,position:e,buttonSize:a,iconSize:s})};return t?o.createElement(o.Fragment,null,c("only",t)):o.createElement(o.Fragment,null,c("leading",n),r,c("trailing",i))},gi=["component","color","children","buttonSize","iconOnly","iconLeading","iconTrailing","aria-label","aria-labelledby"];function _i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vi(e){for(var t=1;t-1})(e,t[i])&&(n=i)})),n}(Qt,m),_=p.href&&"_blank"===p.target?"noopener noreferrer":null,v=s&&"lg"===a?32:an[a];return o.createElement(pi,Object.assign({},p,{rel:_,ref:t,component:!n&&p.href?"a":n,"aria-label":u,"aria-labelledby":d,buttonSize:a,iconSize:v,iconLeading:c,iconTrailing:l,iconOnly:s,isUsingKeyboard:f,useBrowserDefaultFocusStyle:h,status:g,"data-encore-id":Ae}),o.createElement(mi,{iconOnly:s,iconLeading:c,iconTrailing:l,iconSize:v,children:i,buttonSize:a}))})),Ei=vi(vi({},{sm:"sm",md:"md",lg:"lg"}),{},{displayName:"ButtonTertiary"}),bi=Object.assign(yi,Ei);const Si=(0,oe.ZP)(bi).withConfig({displayName:"Button__ButtonComponent",componentId:"sc-yof409-0"})(["text-decoration:none !important;margin-bottom:"," !important;line-height:inherit !important;border:none !important;padding:0 !important;color:"," !important;[dir='rtl'] &{margin-right:0;margin-left:"," !important;}&:hover{transform:none;cursor:pointer;background-color:transparent !important;}",""],le,Be(We.textSubdued),pe,(({$isSmall:e})=>!e&&`\n span:hover {\n color: ${ce};\n text-decoration:underline;\n text-decoration-color: ${Be("textSubdued")};\n } `)),Ai=oe.ZP.div.withConfig({displayName:"Button__Container",componentId:"sc-yof409-1"})(["display:flex;",";[dir='ltr'] &{margin-right:",";}[dir='rtl'] &{margin-right:0;}"],(({$isSmall:e})=>!e&&`margin-bottom: ${ue} !important`),pe),Ti=({button:e,isSmall:t})=>(0,i.jsxs)(Ai,Object.assign({$isSmall:t},{children:[(0,i.jsx)(Si,Object.assign({id:$n(e,Qn.ADDITIONAL_IDS),className:$n(e,Qn.ADDITIONAL_CLASSES),condensedAll:!0,buttonSize:"sm",semanticColor:We.textSubdued,$isSmall:t},{children:(0,i.jsx)(Bn,Object.assign({variant:t?"finale":"viola"},{children:e.title}))})),(0,i.jsx)(ti,{name:e.icon})]})),Oi=oe.ZP.div.withConfig({displayName:"BottomLinksList__Container",componentId:"sc-1li1pru-0"})(["display:flex;flex-wrap:wrap;"]),Ii=({isSmall:e,links:t})=>(0,i.jsx)(Oi,{children:t.map((t=>t.href?(0,i.jsx)(oi,{link:t,isSmall:e},null==t?void 0:t.href):(0,i.jsx)(Ti,{button:t,isSmall:e},null==t?void 0:t.title)))}),Ci=oe.ZP.div.withConfig({displayName:"BottomLinks__BottomLinksContainer",componentId:"sc-1g2bphb-0"})(["display:flex;flex-flow:row wrap;"]),Ni=()=>{var e;const t=(0,o.useContext)($),n=null===(e=null==t?void 0:t.footer)||void 0===e?void 0:e.bottomLinks;return n?(0,i.jsx)(Ci,{children:(0,i.jsx)(Ii,{links:n})}):null},Li=oe.ZP.div.withConfig({displayName:"CountryCopyright__CountryCopyrightContainer",componentId:"sc-1k7wleo-0"})(["flex:0 0 auto;display:flex;flex-flow:row nowrap;align-items:end;color:",";"],Be(We.textSubdued)),Ri=(0,oe.ZP)(Cn).withConfig({displayName:"CountryCopyright__StyledTextLink",componentId:"sc-1k7wleo-1"})(["span:hover{color:",";}"],ce),Pi=oe.ZP.svg.withConfig({displayName:"CountryCopyright__Globe",componentId:"sc-1k7wleo-2"})(["padding-right:",";width:auto;[dir='rtl'] &{padding-right:0;padding-left:",";}"],ue,ue),ki=oe.ZP.div.withConfig({displayName:"CountryCopyright__Copyright",componentId:"sc-1k7wleo-3"})(["padding-right:",";[dir='rtl'] &{padding-right:0;padding-left:",";}"],pe,pe),Di=({hideGeoIndicators:e})=>{var t,n;const r=(0,o.useContext)($),a=null===(t=null==r?void 0:r.footer)||void 0===t?void 0:t.country,s=null===(n=null==r?void 0:r.footer)||void 0===n?void 0:n.copyrightNotice;return a&&s?(0,i.jsxs)(Li,{children:[(0,i.jsx)(ki,{children:(0,i.jsx)(Bn,Object.assign({variant:"viola",as:"p"},{children:s}))}),!e&&(0,i.jsxs)(Ri,Object.assign({href:a.href,semanticColor:We.textSubdued,standalone:!0},{children:[(0,i.jsx)(Pi,Object.assign({width:"12",height:"13",viewBox:"0 0 12 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},{children:(0,i.jsx)("path",{fill:"currentColor",d:"M6 0.624023C8.07255 0.624023 9.90309 1.68041 10.9815 3.28299C10.9819 3.28367 10.9822 3.28403 10.9825 3.28438C11.0029 3.30998 11.0209 3.33677 11.0363 3.36446C11.6453 4.30352 12 5.42315 12 6.62402C12 9.92265 9.32436 12.6079 6.02962 12.624C6.02732 12.6241 6.02495 12.6241 6.02258 12.6241L6 12.624C2.69149 12.624 0 9.93253 0 6.62402C0 3.31571 2.69149 0.624023 6 0.624023ZM6 1.78528C5.80411 1.78528 5.61089 1.79698 5.42102 1.81972C5.39755 1.91375 5.34896 2.0023 5.2765 2.07641L3.75157 3.63714C3.64024 3.75103 3.48978 3.812 3.33616 3.812C3.26752 3.812 3.19848 3.7998 3.1318 3.77483C2.91623 3.69359 2.76891 3.49277 2.75652 3.26265L2.74444 3.04725C1.77228 3.93289 1.16125 5.20844 1.16125 6.62402C1.16125 6.90513 1.18535 7.1807 1.23158 7.44881L2.11909 8.18538C2.12814 8.19266 2.13699 8.20053 2.14564 8.20859L2.91981 8.93437C2.99003 9.00007 3.04274 9.08228 3.07323 9.17374L3.37633 10.0793L3.83343 10.3016H4.86133C5.01514 10.3016 5.16285 10.3625 5.27182 10.4715L6.25621 11.4561C8.80567 11.3224 10.8387 9.20617 10.8387 6.62402C10.8387 5.8726 10.6666 5.16063 10.3596 4.52549L9.45716 5.24616L9.62455 5.6122C9.65956 5.68812 9.67726 5.77053 9.67726 5.85393V6.60784C9.67726 6.78014 9.60075 6.94358 9.46857 7.05393C9.3362 7.16407 9.16154 7.2103 8.99219 7.17902L8.05556 7.00751L8.52643 8.28855C8.58347 8.44354 8.57167 8.61544 8.49417 8.76139L7.67162 10.3097C7.58211 10.4783 7.41628 10.5907 7.22969 10.6136L7.15866 10.6179C6.94387 10.6179 6.74659 10.4991 6.64589 10.3093L6.25231 9.56742C6.24563 9.55444 6.23913 9.54126 6.23323 9.52788L5.91027 8.78833L5.5222 8.25412L4.15443 8.44118C4.0551 8.45475 3.9538 8.44255 3.86057 8.40518L2.68811 7.93765C2.46526 7.84855 2.3201 7.632 2.32244 7.39204L2.33879 5.84783C2.34095 5.65035 2.44304 5.46763 2.61022 5.3624L4.57554 4.12641C4.81058 3.97869 5.11781 4.01783 5.30801 4.22062L5.95905 4.91395L6.7818 5.23062L7.05303 5.13365L5.90181 3.48933C5.77849 3.3131 5.76256 3.08317 5.86051 2.89179L6.41732 1.80311C6.27976 1.7913 6.14057 1.78528 6 1.78528Z"})})),(0,i.jsx)(Bn,Object.assign({variant:"viola"},{children:a.name}))]}))]}):null},wi=oe.ZP.svg.withConfig({displayName:"Svg",componentId:"sc-ytk21e-0"})(["*{vector-effect:non-scaling-stroke;}"," ",""],(function(e){return e.autoMirror&&(0,oe.iv)(["[dir='rtl'] &&{transform:scaleX(-1);}"])}),(function(e){return e.iconColor?(0,oe.iv)(["fill:","};"],Be(e.iconColor)):(0,oe.iv)(["fill:currentColor;"])}));var Mi=["iconSize","semanticColor","color","title","titleId","desc","descId","autoMirror"],xi=function(e,t){return e.sort((function(e,t){return e.size-t.size})).reduce((function(e,n){return n.size<=t&&n.size>e.size?n:e}))},Ui=function(e){var t=e.iconSize,n=void 0===t?24:t,i=e.semanticColor,r=(e.color,e.title),a=e.titleId,s=e.desc,c=e.descId,l=e.autoMirror,u=(0,Vt.Z)(e,Mi);return o.createElement(wi,Object.assign({role:"img",height:n,width:n,iconSize:n,iconColor:i,autoMirror:l,"aria-labelledby":r&&a?a:u["aria-labelledby"],"aria-describedby":s&&c?c:u["aria-describedby"],"aria-hidden":!r&&!a},u,{"data-encore-id":Oe}))};function Vi(e){var t,n,i,r,a,s=xi([{size:16,svgContent:""},{size:24,svgContent:""}],e.iconSize||24),c=null!==(t=e.autoMirror)&&void 0!==t&&t;return o.createElement(Ui,Object.assign({},e,{autoMirror:c,viewBox:"0 0 ".concat(s.size," ").concat(s.size),dangerouslySetInnerHTML:{__html:"".concat((r=e.title,a=e.titleId,r?"").concat(r,""):"")).concat((n=e.desc,i=e.descId,n?"").concat(n,""):"")).concat(s.svgContent)}}))}var Fi=["component","isUsingKeyboard","useBrowserDefaultFocusStyle","isHover","isActive","isFocus","semanticColor"],Bi=["semanticColor"],Hi=(0,oe.iv)(["color:",";"],Be(We.textBase)),Gi=(0,oe.iv)([""," color:",";"],fn,Be(We.textSubdued)),Ki=(0,oe.ZP)(o.forwardRef((function(e,t){var n=e.component,i=void 0===n?"button":n,r=(e.isUsingKeyboard,e.useBrowserDefaultFocusStyle,e.isHover,e.isActive,e.isFocus,e.semanticColor,(0,Vt.Z)(e,Fi));return o.createElement(i,Object.assign({},r,{ref:t}))}))).withConfig({displayName:"Button",componentId:"sc-me270r-0"})(["",""],(function(e){var t=e.semanticColor,n=void 0===t?"textSubdued":t,i=(0,Vt.Z)(e,Bi);return(0,oe.iv)(["",";",";cursor:inherit;display:inline-flex;align-items:center;color:",";&:hover{","}"," &:active{","}&[disabled],&[aria-disabled='true'],fieldset[disabled] &{"," color:",";}"," ",";"],Le(),(!i.component||"button"===i.component)&&mn(i.useBrowserDefaultFocusStyle),Be(n),Hi,i.isHover&&Hi,Gi,pn,Be(n),i.isActive&&Gi,!i.useBrowserDefaultFocusStyle&&Xt(0,i.isUsingKeyboard,i.isFocus))})),Wi=["type"],Yi=o.forwardRef((function(e,t){var n=e.type,i=void 0===n?"button":n,r=(0,Vt.Z)(e,Wi),a=(0,o.useContext)(Gt).isUsingKeyboard,s=(0,o.useContext)(Bt).useBrowserDefaultFocusStyle;return o.createElement(Ki,Object.assign({},r,{ref:t,type:i,isUsingKeyboard:a,useBrowserDefaultFocusStyle:s}))}));const ji=(0,oe.ZP)(Yi).withConfig({displayName:"styles__StyledLink",componentId:"sc-17pc5ri-0"})(["height:40px;width:40px;border-radius:50%;display:inline-flex;justify-content:center;align-items:center;background-color:",";:hover{background-color:",";}"],"#292929","#727272"),zi=({name:e,href:t})=>(0,i.jsx)(ji,Object.assign({component:"a",className:"encore-dark-theme",href:t,"aria-label":e,title:e,target:"_blank",rel:"noopener noreferrer"},{children:(0,i.jsx)(Vi,{iconSize:16,semanticColor:We.textBase})}));function Ji(e){var t,n,i,r,a,s=xi([{size:16,svgContent:""},{size:24,svgContent:""}],e.iconSize||24),c=null!==(t=e.autoMirror)&&void 0!==t&&t;return o.createElement(Ui,Object.assign({},e,{autoMirror:c,viewBox:"0 0 ".concat(s.size," ").concat(s.size),dangerouslySetInnerHTML:{__html:"".concat((r=e.title,a=e.titleId,r?"").concat(r,""):"")).concat((n=e.desc,i=e.descId,n?"").concat(n,""):"")).concat(s.svgContent)}}))}const qi=({name:e,href:t})=>(0,i.jsx)(ji,Object.assign({component:"a",className:"encore-dark-theme",href:t,"aria-label":e,title:e,target:"_blank",rel:"noopener noreferrer"},{children:(0,i.jsx)(Ji,{iconSize:16,semanticColor:We.textBase})}));function Xi(e){var t,n,i,r,a,s=xi([{size:16,svgContent:""},{size:24,svgContent:""}],e.iconSize||24),c=null!==(t=e.autoMirror)&&void 0!==t&&t;return o.createElement(Ui,Object.assign({},e,{autoMirror:c,viewBox:"0 0 ".concat(s.size," ").concat(s.size),dangerouslySetInnerHTML:{__html:"".concat((r=e.title,a=e.titleId,r?"").concat(r,""):"")).concat((n=e.desc,i=e.descId,n?"").concat(n,""):"")).concat(s.svgContent)}}))}const Zi=({name:e,href:t})=>(0,i.jsx)(ji,Object.assign({component:"a",className:"encore-dark-theme",href:t,"aria-label":e,title:e,semanticColor:We.textBase,target:"_blank",rel:"noopener noreferrer"},{children:(0,i.jsx)(Xi,{iconSize:16})})),Qi=({name:e,href:t})=>{switch(e){case ne.INSTAGRAM:return(0,i.jsx)(zi,{name:e,href:t});case ne.TWITTER:return(0,i.jsx)(qi,{name:e,href:t});case ne.FACEBOOK:return(0,i.jsx)(Zi,{name:e,href:t});default:return null}},$i=oe.ZP.div.withConfig({displayName:"SocialLinks__SocialContainer",componentId:"sc-kqbr2e-0"})(["margin-bottom:",";"],ge),eo=oe.ZP.div.withConfig({displayName:"SocialLinks__SocialLink",componentId:"sc-kqbr2e-1"})(["display:inline;padding-right:",";&:last-of-type{padding-right:0;}[dir='rtl'] &{padding-right:0;padding-left:",";&:last-of-type{padding-left:0;}}"],pe,pe),to=()=>{var e;const t=(0,o.useContext)($),n=null===(e=null==t?void 0:t.footer)||void 0===e?void 0:e.socialLinks;return n?(0,i.jsx)($i,{children:n.map((e=>(0,i.jsx)(eo,{children:Qi({name:e.name,href:e.href})},e.icon)))}):null},no=oe.ZP.nav.withConfig({displayName:"Footer__StyledFooter",componentId:"sc-xwm5vq-0"})(["background-color:",";padding:"," "," ",";width:100%;box-sizing:border-box;@media (min-width:","){padding-left:",";padding-right:",";}"],re,ue,pe,ge,Ee,me,me),io=oe.ZP.div.withConfig({displayName:"Footer__TopSection",componentId:"sc-xwm5vq-1"})(["display:flex;flex-direction:column;margin-top:",";@media (min-width:","){justify-content:space-between;flex-direction:row;}"],me,Ee),oo=oe.ZP.div.withConfig({displayName:"Footer__StyledTopLinks",componentId:"sc-xwm5vq-2"})(["display:flex;flex-flow:column wrap;@media (min-width:","){flex-direction:row;}@media (min-width:","){flex:50%;padding-bottom:0;}"],ye,Ee),ro=(0,oe.ZP)((function(e){var t=(0,Se.Z)({},e);return o.createElement(je,Object.assign({},t,{"data-encore-id":Te}))})).withConfig({displayName:"Footer__Line",componentId:"sc-xwm5vq-3"})(["border-color:",";margin-block-start:0;"],ae),ao=oe.ZP.div.withConfig({displayName:"Footer__StyledBottomLinks",componentId:"sc-xwm5vq-4"})(["display:flex;flex-flow:column wrap;justify-content:space-between;padding-top:",";@media (min-width:","){flex-flow:row nowrap;align-items:start;}"],pe,Ee),so=oe.ZP.div.withConfig({displayName:"Footer__LanguageSelectionButtonContainer",componentId:"sc-xwm5vq-5"})(["padding-top:",";@media (min-width:","){display:none;}"],pe,Ee),co=({hideWebPlayerLink:e,columnWidth:t,columnGap:n,languageSelectionButton:r,hideLegalLinks:a})=>(0,o.useContext)($)?(0,i.jsxs)(no,Object.assign({"data-testid":"footer-div"},{children:[(0,i.jsxs)(io,{children:[(0,i.jsxs)(oo,{children:[(0,i.jsx)(qn,{columnWidth:t,columnGap:n}),(0,i.jsx)(Xn,{columnWidth:t,columnGap:n}),(0,i.jsx)(Zn,{hideWebPlayerLink:e,columnWidth:t,columnGap:n})]}),(0,i.jsx)(to,{})]}),(0,i.jsx)(ro,{}),(0,i.jsxs)(ao,{children:[!a&&(0,i.jsx)(Ni,{}),(0,i.jsx)(Di,{hideGeoIndicators:e}),r&&(0,i.jsx)(so,{children:r})]})]})):null,lo=()=>{var e;const t=(0,o.useContext)($),n=null===(e=null==t?void 0:t.footer)||void 0===e?void 0:e.bottomLinks;return n?(0,i.jsx)(Ii,{links:n,isSmall:!0}):null}},87528:(e,t,n)=>{"use strict";n.d(t,{oQ:()=>Lt,zq:()=>St,Sy:()=>Ut,cr:()=>Vt,SK:()=>xt});var i,o,r,a,s,c,l=n(59797),u=n(92614),d=(n(86277),n(17909)),p=n(87493);!function(e){e.KEY_SESSION_MESSAGE="message",e.KEY_SESSION_STATUSES_CHANGE="keystatuseschange",e.MEDIA_SOURCE_OPEN="sourceopen",e.MEDIA_SOURCE_CLOSE="sourceclose",e.SOURCE_BUFFER_UPDATE_END="updateend",e.MS_KEY_ADDED="mskeyadded",e.MS_KEY_ERROR="mskeyerror",e.MS_KEY_MESSAGE="mskeymessage",e.MS_NEEDKEY="msneedkey",e.WEBKIT_KEY_ADDED="webkitkeyadded",e.WEBKIT_KEY_ERROR="webkitkeyerror",e.WEBKIT_KEY_MESSAGE="webkitkeymessage",e.WEBKIT_NEEDKEY="webkitneedkey",e.V0_1B_KEY_ADDED="keyadded",e.V0_1B_KEY_ERROR="keyerror",e.V0_1B_KEY_MESSAGE="keymessage",e.V0_1B_NEEDKEY="needkey",e.MEDIA_CANPLAY="canplay",e.MEDIA_CANPLAYTHROUGH="canplaythrough",e.MEDIA_DURATIONCHANGE="durationchange",e.MEDIA_ENCRYPTED="encrypted",e.MEDIA_ENDED="ended",e.MEDIA_ERROR="error",e.MEDIA_LOADEDMETADATA="loadedmetadata",e.MEDIA_PAUSE="pause",e.MEDIA_PLAY="play",e.MEDIA_PLAYING="playing",e.MEDIA_SEEKING="seeking",e.MEDIA_TIMEUPDATE="timeupdate",e.MEDIA_WAITING="waiting",e.MEDIA_RATECHANGE="ratechange",e.MEDIA_RESIZE="resize",e.INTERNAL_ENCRYPTED="__encrypted",e.INTERNAL_PLAYER_CANPLAY="__canplay",e.INTERNAL_PLAYER_CANPLAYTHROUGH="__canplaythrough",e.INTERNAL_MEDIA_REQUIRES_DURATION="__requiresduration",e.INTERNAL_PLAYER_LOADED_METADATA="__loadedmetadata",e.BUFFER_APPEND_ERROR="append_error",e.BUFFER_STALLED="stalled",e.BUFFERING_START="buffering_start",e.BUFFERING_END="buffering_end",e.BUFFER_SOURCE_OPEN="source_open",e.BUFFER_SOURCE_CLOSE="source_close",e.BUFFER_QUOTA_EXCEEDED="quota_exceeded",e.FRAGMENT_APPENDED="fragment_appended",e.EME_LICENSE_REQUEST_ERROR="license_request_error",e.EME_LICENSE_REQUEST_CAPPED="license_request_capped",e.LIST_PLAYER_AUTOPLAY_FAILED="player_autoplay_failed",e.LIST_PLAYER_BEFORE_LIST_CHANGE="before_list_change",e.LIST_PLAYER_BEFORE_NEXT="before_next",e.LIST_PLAYER_BEFORE_PLAYER_LOAD="before_player_load",e.LIST_PLAYER_BEFORE_PREVIOUS="before_previous",e.LIST_PLAYER_BEFORE_TRACK_LOAD="before_track_load",e.LIST_PLAYER_BEFORE_VOLUME_CHANGE="before_volume_change",e.LIST_PLAYER_BUFFER_STALLED="stalled",e.LIST_PLAYER_BUFFERING_START="buffering_start",e.LIST_PLAYER_BUFFERING_END="buffering_end",e.LIST_PLAYER_CAPPED="capped",e.LIST_PLAYER_CLEARED="cleared",e.LIST_PLAYER_DURATION_CHANGED="duration_changed",e.LIST_PLAYER_ERROR="error",e.LIST_PLAYER_ERROR_SYNC="error_sync",e.LIST_PLAYER_LIST_CHANGED="list_change",e.LIST_PLAYER_LIST_ENDED="list_ended",e.LIST_PLAYER_LOAD_VIDEO="load_video",e.LIST_PLAYER_MAX_LIST_ERRORS_REACHED="max_list_errors_reached",e.LIST_PLAYER_PAUSED="paused",e.LIST_PLAYER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.LIST_PLAYER_PLAYER_LOAD="player_load",e.LIST_PLAYER_PLAYING="playing",e.LIST_PLAYER_POSITION_CHANGED="position_changed",e.LIST_PLAYER_PROGRESS="progress",e.LIST_PLAYER_REPEAT_MODE_CHANGED="repeat_mode_changed",e.LIST_PLAYER_SHUFFLE_CHANGED="shuffle_changed",e.LIST_PLAYER_STOPPED="stopped",e.LIST_PLAYER_STOPPED_VIDEO="stopped_video",e.LIST_PLAYER_TRACKING_DATA_CREATED="tracking_data_created",e.LIST_PLAYER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.LIST_PLAYER_TRACK_ENDED="track_ended",e.LIST_PLAYER_TRACK_LOADED="track_loaded",e.LIST_PLAYER_TRACK_TIMEOUT="track_timeout",e.LIST_PLAYER_TRACK_UNPLAYABLE="track_unplayable",e.LIST_PLAYER_DATA_CREATED="tracking_data_created",e.LIST_PLAYER_DATA_FINALIZED="tracking_data_finalized",e.LIST_PLAYER_VOLUME_CHANGED="volume_changed",e.LIST_PLAYER_VIDEO_ELEMENT_APPENDED="video_element_appended",e.LIST_PLAYER_VIDEO_ELEMENT_REMOVED="video_element_removed",e.LIST_PLAYER_VIDEO_PROFILE_CHANGED="video_profile_changed",e.LIST_PLAYER_SEEK_HANDLED="list_player_seek_handled",e.LIST_PLAYER_DISPLAYED_CUES_CHANGED="displayed_cues_changed",e.LIST_PLAYER_PLAYBACK_SPEED_CHANGED="playback_speed_changed",e.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded",e.LOGGER_ERROR="error",e.PLAYER_AUTOPLAY_FAILED="player_autoplay_failed",e.PLAYER_BEFORE_LOAD="before_load",e.PLAYER_BEFORE_STOP="before_stop",e.PLAYER_BEFORE_VOLUME_CHANGE="before_volume_change",e.PLAYER_BUFFER_STALLED="stalled",e.PLAYER_BUFFERING_START="buffering_start",e.PLAYER_BUFFERING_END="buffering_end",e.PLAYER_CAN_PRELOAD="can_preload",e.PLAYER_CAPPED="capped",e.PLAYER_DURATION_CHANGED="duration_changed",e.PLAYER_ENDED="ended",e.PLAYER_ENDED_VIDEO="ended_video",e.PLAYER_ERROR="error",e.PLAYER_WARNING="warning",e.PLAYER_FIRST_BYTES="first_bytes",e.PLAYER_KEY_RECEIVED="key",e.PLAYER_LOAD="load",e.PLAYER_LOAD_VIDEO="load_video",e.PLAYER_LOADING_FAILED="loading_failed",e.PLAYER_PAUSED="paused",e.PLAYER_PLAY="play",e.PLAYER_PLAYING="playing",e.PLAYER_POSITION_CHANGED="position_changed",e.PLAYER_PRELOADING_ERROR="preloading_error",e.PLAYER_PROGRESS="progress",e.PLAYER_STALLED="stalled",e.PLAYER_STOPPED="stopped",e.PLAYER_STOPPED_VIDEO="stopped_video",e.PLAYER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.PLAYER_TIMEOUT="timeout",e.PLAYER_PLAYBACK_START="playback_start",e.PLAYER_TRACKING_DATA_CREATED="tracking_data_created",e.PLAYER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.PLAYER_VIDEO_ELEMENT_APPENDED="video_element_appended",e.PLAYER_VIDEO_ELEMENT_REMOVED="video_element_removed",e.PLAYER_VIDEO_PROFILE_CHANGED="video_profile_changed",e.PLAYER_DISPLAYED_CUES_CHANGED="displayed_cues_changed",e.PLAYER_SEEKING="seeking",e.PLAYER_FRAGMENT_FETCHED="fragment_fetched",e.PLAYER_FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.PLAYER_VIDEO_MANIFEST_RESOLVED="video_manifest_resolved",e.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED="video_manifest_resolve_failed",e.PLAYER_PLAYBACK_SPEED_CHANGED="playback_speed_changed",e.PLAYER_SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded",e.PLAYER_VIDEO_RESIZED="resize",e.PLAYER_MANAGER_READY="ready",e.TRACKER_PLAYBACK_START="playback_start",e.TRACKER_PLAYED_THRESHOLD_REACHED="played_threshold_reached",e.TRACKER_TRACKING_DATA_CREATED="tracking_data_created",e.TRACKER_TRACKING_DATA_FINALIZED="tracking_data_finalized",e.VIDEO_MANIFEST_RESOLVED="video_manifest_resolved",e.VIDEO_MANIFEST_RESOLVE_FAILED="video_manifest_resolve_failed",e.ABR_MANAGER_BITRATE_CHANGE="bitrate_change"}(i||(i={})),function(e){e.WIDEVINE="com.widevine.alpha",e.PLAYREADY="com.microsoft.playready",e.PLAYREADY_HARDWARE="com.microsoft.playready.hardware",e.FAIRPLAY="com.apple.fps.1_0",e.INVALID_SPOTIFY_KEY="com.spotify.invalid"}(o||(o={})),function(e){e.CAPPING_USER_IS_CAPPED="CAPPING_USER_IS_CAPPED",e.EME_API_NOT_SUPPORTED="EME_API_NOT_SUPPORTED",e.EME_MEDIA_KEYS_NOT_SUPPORTED="EME_MEDIA_KEYS_NOT_SUPPORTED",e.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED="EME_MEDIA_KEY_SESSION_NOT_SUPPORTED",e.EME_NO_SUPPORTED_KEYSYSTEM="EME_NO_SUPPORTED_KEYSYSTEM",e.EME_PLAYER_MEDIA_KEYS_SETTING_FAILED="EME_PLAYER_MEDIA_KEYS_SETTING_FAILED",e.EME_ERROR_UNKNOWN="EME_ERROR_UNKNOWN",e.EME_LICENSE_REQUEST_EMPTY_RESPONSE="EME_LICENSE_REQUEST_EMPTY_RESPONSE",e.EME_LICENSE_REQUEST_FAILED_WITH_STATUS="EME_LICENSE_REQUEST_FAILED_WITH_STATUS",e.EME_LICENSE_REQUEST_WIDEVINE_ERROR="EME_LICENSE_REQUEST_WIDEVINE_ERROR",e.EME_LICENSE_UPDATE_FAILED="EME_LICENSE_UPDATE_FAILED",e.EME_HEADER_KEY_VALUE_MISMATCH="EME_HEADER_KEY_VALUE_MISMATCH",e.EME_HEADER_MISSING_CHALLENGE="EME_HEADER_MISSING_CHALLENGE",e.EME_INIT_DATA_MALFORMED="EME_INIT_DATA_MALFORMED",e.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM="EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM",e.EME_MEDIA_KEY_SESSION_V0_1B_ERROR="EME_MEDIA_KEY_SESSION_V0_1B_ERROR",e.EME_MEDIA_KEY_SESSION_SAFARI_ERROR="EME_MEDIA_KEY_SESSION_SAFARI_ERROR",e.EME_NO_SUPPORTED_CONFIGURATION="EME_NO_SUPPORTED_CONFIGURATION",e.EME_NOT_SUPPORTED_ERROR="EME_NOT_SUPPORTED_ERROR",e.EME_INVALID_STATE_ERROR="EME_INVALID_STATE_ERROR",e.EME_UNKNOWN_ERROR="EME_UNKNOWN_ERROR",e.DISALLOW_PROTECTED_TRACK_ERROR="DISALLOW_PROTECTED_TRACK_ERROR",e.FILE_FORMAT_NOT_SUPPORTED="FILE_FORMAT_NOT_SUPPORTED",e.FILE_MALFORMED_SEEKTABLE="FILE_MALFORMED_SEEKTABLE",e.FILE_MALFORMED_PSSH="FILE_MALFORMED_PSSH",e.FILE_NOT_RESOLVED="FILE_NOT_RESOLVED",e.FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO="FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO="FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_REQUEST_FAILED_WITH_ZERO="FRAGMENT_REQUEST_FAILED_WITH_ZERO",e.FRAGMENT_REQUEST_FAILED_WITH_STATUS="FRAGMENT_REQUEST_FAILED_WITH_STATUS",e.FRAGMENT_REQUEST_EMPTY_RESPONSE="FRAGMENT_REQUEST_EMPTY_RESPONSE",e.FRAGMENT_REQUEST_UNEXPECTED_LENGTH="FRAGMENT_REQUEST_UNEXPECTED_LENGTH",e.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE="PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE",e.PLAYER_BUFFER_QUOTA_EXCEEDED="PLAYER_BUFFER_QUOTA_EXCEEDED",e.PLAYER_CANNOT_FIND_PLAYABLE_URI="PLAYER_CANNOT_FIND_PLAYABLE_URI",e.PLAYER_INVALID_INTERNAL_STATE="PLAYER_INVALID_INTERNAL_STATE",e.PLAYER_MEDIA_ERROR="PLAYER_MEDIA_ERROR",e.PLAYER_PLAYBACK_ERROR="PLAYER_PLAYBACK_ERROR",e.MEDIA_ABORTED="MEDIA_ABORTED",e.MEDIA_DECODING_ERROR="MEDIA_DECODING_ERROR",e.MEDIA_NETWORK_ERROR="MEDIA_NETWORK_ERROR",e.MEDIA_NOT_SUPPORTED="MEDIA_NOT_SUPPORTED",e.LICENSE_RESOLVE_INVALID_RESPONSE="LICENSE_RESOLVE_INVALID_RESPONSE",e.LICENSE_RESOLVER_CANT_RESOLVE_URL="LICENSE_RESOLVER_CANT_RESOLVE_URL",e.LICENSE_RESOLVER_DEPRECATED_VERSION="LICENSE_RESOLVER_DEPRECATED_VERSION",e.LIST_PLAYER_NO_TRACK_PLAYER="LIST_PLAYER_NO_TRACK_PLAYER",e.LIST_PLAYER_NO_LIST="LIST_PLAYER_NO_LIST",e.LIST_PLAYER_INVALID_ARGUMENT="LIST_PLAYER_INVALID_ARGUMENT",e.LIST_PLAYER_FORBIDDEN="LIST_PLAYER_FORBIDDEN",e.STORAGE_ERROR="STORAGE_ERROR",e.STORAGE_FAILED_WITH_STATUS="STORAGE_FAILED_WITH_STATUS",e.STORAGE_RETURNED_NO_TRACKS="STORAGE_RETURNED_NO_TRACKS",e.STORAGE_TRACK_MANIFEST_FAILED="STORAGE_TRACK_MANIFEST_FAILED",e.STORAGE_TRACK_MANIFEST_EMPTY="STORAGE_TRACK_MANIFEST_EMPTY",e.STORAGE_VIDEO_MANIFEST_FAILED="STORAGE_VIDEO_MANIFEST_FAILED",e.TRACK_DATA_ALREADY_FINALIZED="TRACK_DATA_ALREADY_FINALIZED",e.TSV_SENDING_FAILED="TSV_SENDING_FAILED",e.PLAYBACK_STATS_SENDING_FAILED="PLAYBACK_STATS_SENDING_FAILED",e.PLAYBACK_START_SENDING_FAILED="PLAYBACK_START_SENDING_FAILED",e.UNKNOWN="UNKNOWN"}(r||(r={})),function(e){e.SUCCESS="RESULT_SUCCESS",e.INVALID="RESULT_INVALID",e.FORBIDDEN="RESULT_FORBIDDEN",e.OUT_OF_BOUNDS="RESULT_OUT_OF_BOUNDS",e.NO_LIST="RESULT_NO_LIST",e.NO_TRACK="RESULT_NO_TRACK",e.LIST_END="RESULT_LIST_END",e.INVALID_TRACK="RESULT_INVALID_TRACK",e.CANCELLED="CANCELLED",e.NO_TRACK_PLAYER="NO_TRACK_PLAYER"}(a||(a={})),function(e){e.MP3="MP3",e.MP4="MP4",e.MP4_DUAL="MP4_DUAL",e.MP4_CBCS="MP4_CBCS",e.MP4_FLAC="MP4_FLAC",e.MANIFEST_ID="MANIFEST_ID"}(s||(s={})),function(e){e.FRAGMENT_FETCHED="fragment_fetched",e.FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.VIDEO_PROFILE_CHANGED="video_profile",e.SUBTITLE_LANGUAGES_LOADED="subtitle_languages_loaded"}(c||(c={}));class f extends Error{constructor(e,t){super(t),this.unrecoverable=!1,this.listPlayerIgnore=!1,this.debug={},this.code=e,this.message=t,this.name="PlaybackError"}static fatal(e,t){const n=new f(e,t);return n.unrecoverable=!0,n}}class h extends Error{constructor(e=r.STORAGE_ERROR,t="File Error"){super(t),this.canPlayNext=!0,this.debug={},this.code=e,this.message=t,this.name="FileError"}}n(31546);var m=n(60045);class g extends Error{constructor(e=r.EME_ERROR_UNKNOWN,t){super(t),this.status=-1,this.licenseServer="",this.shouldRefreshEndpoint=!1,this.unrecoverable=!1,this.debug={},this.code=e,this.message=t,this.name="EMEError"}static fatal(e=r.EME_ERROR_UNKNOWN,t){const n=new g(e,t);return n.unrecoverable=!0,n}}class _ extends Error{constructor(e,t){super(t),this.name="CappingError",this.message=t,this.code=e}}function v(e){const t=document.createEvent("Event");t.initEvent("encrypted",!1,!1),t.initDataType="cenc",t.initData=e.initData,t.fromPolyfill=!0,this.dispatchEvent(t)}class y extends d.B{constructor(e){super(i.KEY_SESSION_MESSAGE,null),this.messageType="license-request",this.message=e}}class E extends d.vp{constructor(e){super(),this._nativeKeySession=null,this._lastUpdateDeferred=(0,m.$)(),this._lastGenerateDeferred=(0,m.$)(),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener,this._nativeMediaKeys=e,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}_attach(){const e=this._nativeKeySession;e&&(e.addEventListener(i.MS_KEY_ADDED,this._onKeyAdded),e.addEventListener(i.MS_KEY_ERROR,this._onKeyError),e.addEventListener(i.MS_KEY_MESSAGE,this._onKeyMessage))}_detach(){const e=this._nativeKeySession;e&&(e.removeEventListener(i.MS_KEY_ADDED,this._onKeyAdded),e.removeEventListener(i.MS_KEY_ERROR,this._onKeyError),e.removeEventListener(i.MS_KEY_MESSAGE,this._onKeyMessage))}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new y(e.message.buffer)),this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve(!0),this._lastGenerateDeferred=null))}_onKeyAdded(){this._lastUpdateDeferred&&(this._lastUpdateDeferred.resolve(!0),this._lastUpdateDeferred=null),this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve(!0),this._lastGenerateDeferred=null),this.emit(i.KEY_SESSION_STATUSES_CHANGE,null)}_onKeyError(){const e=this._nativeKeySession&&this._nativeKeySession.error;this._lastGenerateDeferred&&(this._lastGenerateDeferred.reject(e),this._lastGenerateDeferred=null),this._lastUpdateDeferred&&(this._lastUpdateDeferred.reject(e),this._lastUpdateDeferred=null),this.emit(i.KEY_SESSION_STATUSES_CHANGE,null)}generateRequest(e,t){return new Promise(((e,n)=>{this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve=e,this._lastGenerateDeferred.reject=n),this._nativeKeySession=this._nativeMediaKeys.createSession("audio/mp4",new Uint8Array(t),null),this._attach()}))}update(e){return new Promise(((t,n)=>{this._lastGenerateDeferred&&(this._lastGenerateDeferred.resolve=t,this._lastGenerateDeferred.reject=n),this._nativeKeySession&&this._nativeKeySession.update(new Uint8Array(e))}))}close(){return new Promise((e=>{this._nativeKeySession&&this._nativeKeySession.close(),this._detach(),e(!0)}))}}class b{constructor(e){this._lastBoundSetter=null,this.shouldRefreshPerTrack=!0,this._nativeMediaKeys=new MSMediaKeys(e)}attach(e){return new Promise((t=>{if(e.readyState>=1)return e.msSetMediaKeys(this._nativeMediaKeys),void t();const n=()=>{e.removeEventListener(i.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.msSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(i.MEDIA_LOADEDMETADATA,n),e.addEventListener(i.MS_NEEDKEY,v),t()}))}detach(e){this._lastBoundSetter&&(e.removeEventListener(i.MS_NEEDKEY,v),e.removeEventListener(i.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(){return Promise.reject(new g(r.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){return new E(this._nativeMediaKeys)}}function S(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e&&e.attach(this),Promise.resolve()}class A{constructor(e,t){if(this._configuration=null,this.keySystem=e,!this._checkConfig(t))throw new g(r.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations")}_checkConfig(e){var t,n;const i=this.keySystem;for(const o of e){const e={initDataTypes:o.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"],label:o.label};let r;if(o.audioCapabilities&&o.audioCapabilities.length&&e.audioCapabilities){r=!1;for(const n of o.audioCapabilities){const o=null===(t=n.contentType)||void 0===t?void 0:t.split(";")[0];MSMediaKeys.isTypeSupported(i,o)&&(e.audioCapabilities.push(n),r=!0)}}if(o.videoCapabilities&&o.videoCapabilities.length&&e.videoCapabilities){r=!1;for(const t of o.videoCapabilities){const o=null===(n=t.contentType)||void 0===n?void 0:n.split(";")[0];MSMediaKeys.isTypeSupported(i,o)&&(e.videoCapabilities.push(t),r=!0)}}if(r)return this._configuration=e,!0}return!1}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new b(this.keySystem))}))}}const T=u.P.forTag("eme_polyfill.v0_1b");class O extends d.vp{constructor(e,t,n){super(),this._mediaElement=null,this._lastUpdateDeferred=null,this._lastGenerateResolver=null,this.sessionId=null,this._keySystem=e,this._mediaElement=t,this._prefix=n,this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}_addPrefix(e){return this._prefix?this._prefix+e.replace(/\b[a-z]/,(function(e){return e.toUpperCase()})):e}generateComplete(e){this.emitEvent(new y(e)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null)}updateComplete(){this._lastUpdateDeferred&&(this._lastUpdateDeferred.resolve(!0),this._lastUpdateDeferred=null),this.emit(i.KEY_SESSION_STATUSES_CHANGE,null)}handleErrorEvent(e){const t=new g(r.EME_MEDIA_KEY_SESSION_V0_1B_ERROR,"MediaKeySession v0.1b Error");t.debug.errorCode=e.errorCode,t.debug.systemCode=e.systemCode,!e.sessionId&&this._lastGenerateResolver?(this._lastGenerateResolver.reject(t),this._lastGenerateResolver=null):e.sessionId&&this._lastUpdateDeferred?(this._lastUpdateDeferred.reject(t),this._lastUpdateDeferred=null):this.emit(i.KEY_SESSION_STATUSES_CHANGE,null)}generateRequest(e,t){return this._mediaElement?new Promise(((e,n)=>{this._lastGenerateResolver={resolve:e,reject:n};try{this._mediaElement[this._addPrefix("generateKeyRequest")](this._keySystem,new Uint8Array(t))}catch(e){n(e),this._lastGenerateResolver=null}})):Promise.reject(new ReferenceError("InvalidState: Media keys are not attached."))}update(e){if(!this._mediaElement)return Promise.reject(new ReferenceError("InvalidState: Media keys are not attached."));if(this._lastUpdateDeferred){const t=this.update.bind(this,e);return this._lastUpdateDeferred.promise.then(t,t)}const t=(0,m.$)();this._lastUpdateDeferred=t;try{this._mediaElement[this._addPrefix("addKey")](this._keySystem,new Uint8Array(e),null,this.sessionId)}catch(e){t.reject(e),this._lastUpdateDeferred=null}return t.promise}close(){if(this.sessionId&&this._mediaElement)try{this._mediaElement[this._addPrefix("cancelKeyRequest")](this._keySystem,this.sessionId)}catch(e){T.warn("Could not close keysession",e)}return Promise.resolve(!0)}}class I{constructor(e,t=""){this._mediaElement=null,this._waitingForSessionIds=[],this._sessionMap={},this.shouldRefreshPerTrack=!0,this._keySystem=e,this._prefix=t,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}attach(e){this._mediaElement=e;const t=this._prefix;e.addEventListener(t+i.V0_1B_NEEDKEY,v);const n=e.addEventListener.bind(e);n(t+i.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+i.V0_1B_KEY_ERROR,this._onKeyError),n(t+i.V0_1B_KEY_MESSAGE,this._onKeyMessage)}detach(e){this._mediaElement=null;const t=this._prefix;e.removeEventListener(t+i.V0_1B_NEEDKEY,v);const n=e.removeEventListener.bind(e);n(t+i.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+i.V0_1B_KEY_ERROR,this._onKeyError),n(t+i.V0_1B_KEY_MESSAGE,this._onKeyMessage)}_getSession(e){const t=this._sessionMap[e];if(t)return t;const n=this._waitingForSessionIds.shift();return n?(n.sessionId=e,this._sessionMap[e]=n,n):null}_onKeyMessage(e){const t=this._getSession(e.sessionId);t?t.generateComplete(e.message):T.warn("Got keymessage without session.")}_onKeyAdded(e){const t=this._getSession(e.sessionId);t?t.updateComplete():T.warn("Got keyadded without session.")}_onKeyError(e){const t=this._getSession(e.sessionId);t?t.handleErrorEvent(e):T.warn("Got keyerror without session.")}setServerCertificate(){return Promise.reject(new g(r.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){const e=new O(this._keySystem,this._mediaElement,this._prefix);return this._waitingForSessionIds.push(e),e}}function C(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e&&e.attach(this),Promise.resolve()}class N{constructor(e,t,n){if(this._configuration=null,this.keySystem=e,this._prefix=n,!this._checkConfig(t))throw new g(r.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations")}_checkConfig(e){var t,n;const i=this.keySystem,o=document.createElement("video");for(const r of e){const e={initDataTypes:r.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"],label:r.label};let a=!1;if(r.audioCapabilities&&r.audioCapabilities.length&&e.audioCapabilities){a=!1;for(const n of r.audioCapabilities){const r=null===(t=n.contentType)||void 0===t?void 0:t.split(";")[0];r&&o.canPlayType(r,i)&&(e.audioCapabilities.push(n),a=!0)}}if(r.videoCapabilities&&r.videoCapabilities.length&&e.videoCapabilities){a=!1;for(const t of r.videoCapabilities){const r=null===(n=t.contentType)||void 0===n?void 0:n.split(";")[0];r&&o.canPlayType(r,i)&&(e.videoCapabilities.push(t),a=!0)}}if(a)return this._configuration=e,!0}return!1}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new I(this.keySystem,this._prefix))}))}}function L(e){navigator.requestMediaKeySystemAccess=function(t,n){return new Promise((i=>{i(new N(t,n,e))}))};const t=HTMLMediaElement.prototype;delete t.mediaKeys,t.setMediaKeys=C}const R=u.P.forTag("eme_polyfill.safari");class P extends d.vp{constructor(e,t){super(),this._attached=!1,this._nativeKeySession=null,this._lastGenerateResolver=(0,m.$)(),this._lastUpdateResolver=(0,m.$)(),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener,this._nativeMediaKeys=e,this._serverCertificate=t,this._onKeyMessage=this._onKeyMessage.bind(this),this._onKeyAdded=this._onKeyAdded.bind(this),this._onKeyError=this._onKeyError.bind(this)}_attach(){if(this._attached)return;const e=this._nativeKeySession;e?(e.addEventListener(i.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.addEventListener(i.WEBKIT_KEY_ADDED,this._onKeyAdded),e.addEventListener(i.WEBKIT_KEY_ERROR,this._onKeyError)):R.warn("Tried to attach with no WebKitMediaKeySession")}_detach(){if(!this._attached)return;const e=this._nativeKeySession;e?(e.removeEventListener(i.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.removeEventListener(i.WEBKIT_KEY_ADDED,this._onKeyAdded),e.removeEventListener(i.WEBKIT_KEY_ERROR,this._onKeyError)):R.warn("Tried to detach with no WebKitMediaKeySession")}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new y(e.message.buffer)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null))}_onKeyAdded(){this._lastUpdateResolver&&(this._lastUpdateResolver.resolve(!0),this._lastUpdateResolver=null),this.emit(i.KEY_SESSION_STATUSES_CHANGE,null)}_onKeyError(){const e=this._nativeKeySession&&this._nativeKeySession.error,t=new g(r.EME_MEDIA_KEY_SESSION_SAFARI_ERROR,e&&e.message||"MediaKeySession Safari Error");e&&(t.debug.errorCode=e.code,t.debug.systemCode=e.systemCode),this._lastGenerateResolver?(this._lastGenerateResolver.reject(t),this._lastGenerateResolver=null):this._lastUpdateResolver&&(this._lastUpdateResolver.reject(t),this._lastUpdateResolver=null)}_rebuildInitData(e){const t=new Uint8Array(e);if(new DataView(t.buffer).getUint32(0,!0)+4!==t.byteLength)throw new g(r.EME_INIT_DATA_MALFORMED,"Malformed init data");const n=function(e){const t=Math.floor(e.byteLength/2),n=new Uint16Array(t),i=new DataView(e.buffer);for(let e=0;e{this._lastGenerateResolver={resolve:e,reject:n};try{const e=this._rebuildInitData(t);this._nativeKeySession=this._nativeMediaKeys.createSession("video/mp4",new Uint8Array(e),null),this._attach()}catch(e){this._lastGenerateResolver=null,n(e)}}))}update(e){const t=(0,m.$)();if(this._lastUpdateResolver=t,!this._nativeKeySession)return R.warn("Tried to update with no WebKitMediaKeySession"),t.promise;try{this._nativeKeySession.update(new Uint8Array(e))}catch(e){t.reject(e)}return t.promise}close(){return new Promise((e=>{this._detach(),e(!0)}))}}class k{constructor(e){this._lastBoundSetter=null,this._serverCertificate=null,this.shouldRefreshPerTrack=!0,this._nativeMediaKeys=new WebKitMediaKeys(e)}attach(e){return new Promise((t=>{if(e.readyState>=1)return e.webkitSetMediaKeys(this._nativeMediaKeys),void t();const n=()=>{e.removeEventListener(i.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.webkitSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(i.MEDIA_LOADEDMETADATA,n),e.addEventListener(i.WEBKIT_NEEDKEY,v),t()}))}detach(e){e.removeEventListener(i.WEBKIT_NEEDKEY,v),this._lastBoundSetter&&(e.removeEventListener(i.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(e){return this._serverCertificate=new Uint8Array(e),Promise.resolve(!0)}createSession(){if(!this._serverCertificate)throw new g(r.EME_INVALID_STATE_ERROR,"The server certificate is not available");return new P(this._nativeMediaKeys,this._serverCertificate)}}class D{constructor(e,t){this.keySystem=e;const n=this._checkConfig(t);if(!n)throw new g(r.EME_NO_SUPPORTED_CONFIGURATION,"No supported configurations");this._configuration=n}_checkConfig(e){const t=this.keySystem;let n=!1;for(const i of e){const e={initDataTypes:i.initDataTypes,audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",sessionTypes:["temporary"]};if(i.audioCapabilities)for(const o of i.audioCapabilities){if(!o.contentType)continue;const i=o.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(t,i)&&(e.audioCapabilities.push(o),n=!0)}if(i.videoCapabilities)for(const o of i.videoCapabilities){if(!o.contentType)continue;const i=o.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(t,i)&&(e.videoCapabilities.push(o),n=!0)}if(n)return e}return null}getConfiguration(){return this._configuration}createMediaKeys(){return new Promise((e=>{e(new k(this.keySystem))}))}}function w(e){const t=this.mediaKeys;return t&&t!==e&&t.detach(this),delete this.mediaKeys,this.mediaKeys=e,e?e.attach(this):Promise.resolve()}const M=u.P.forTag("eme_polyfills.tester");function x(){return"undefined"!=typeof navigator&&(null===navigator||void 0===navigator?void 0:navigator.requestMediaKeySystemAccess)&&"undefined"==typeof WebKitMediaKeys&&"undefined"!=typeof MediaKeySystemAccess&&(null===MediaKeySystemAccess||void 0===MediaKeySystemAccess?void 0:MediaKeySystemAccess.prototype.getConfiguration)?(M.log("Using native EME implementation."),"native"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.webkitGenerateKeyRequest)?(M.log('Detected "webkit" Prefixed EME v0.1b. Polyfilling.'),L("webkit"),"v0.1b-webkit"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.generateKeyRequest)?(M.log("Detected Unprefixed EME v0.1b. Polyfilling."),L(),"v0.1b"):"undefined"!=typeof MSMediaKeys?(M.log("Detected MS IE EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new A(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=S}(),"ms-ie"):"function"==typeof WebKitMediaKeys?(M.log("Detected Safari EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new D(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=w}(),"safari"):(M.warn("Detected no EME APIs."),null)}const U={[o.WIDEVINE]:{commonName:"widevine",licenseServer:"https://@webgate/widevine-license",withCertificate:!0,pssh_field:{audio:"pssh_widevine",video:"encryption_data"}},[o.PLAYREADY]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[o.PLAYREADY_HARDWARE]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[o.FAIRPLAY]:{commonName:"fairplay",licenseServer:"https://@webgate/fairplay-license",withCertificate:!0,pssh_field:{audio:"pssh_fairplay",video:"asset_id"}},[o.INVALID_SPOTIFY_KEY]:{commonName:"spotify-invalid",licenseServer:"https://@webgate",withCertificate:!1,pssh_field:{audio:"pssh_invalid",video:"encryption_data"}}},V=[{label:"video-sw-decode",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/webm; codecs="opus"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/webm; codecs="vp9"',robustness:"SW_SECURE_DECODE"},{contentType:'video/webm; codecs="vp8"',robustness:"SW_SECURE_DECODE"},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:"SW_SECURE_DECODE"},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:"SW_SECURE_DECODE"}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"video-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/webm; codecs="opus"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/webm; codecs="vp9"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/webm; codecs="vp8"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:"SW_SECURE_CRYPTO"},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:"SW_SECURE_CRYPTO"}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"video-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/webm; codecs="opus"',robustness:""},{contentType:'audio/mp4; codecs="flac"',robustness:""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""}],videoCapabilities:[{contentType:'video/webm; codecs="vp9"',robustness:""},{contentType:'video/webm; codecs="vp8"',robustness:""},{contentType:'video/mp4; codecs="avc1.4d401f"',robustness:""},{contentType:'video/mp2t; codecs="avc1.4d401f"',robustness:""}],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-flac-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:"SW_SECURE_CRYPTO"},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-flac-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="flac"',robustness:""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-sw-crypto",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]},{label:"audio-no-robustness",initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]}];function F(e,t){var n,i;for(const o of e){const e={audioCapabilities:[],videoCapabilities:[]};let r,a=!1;if(null===(n=o.audioCapabilities)||void 0===n?void 0:n.length){a=!1;for(const n of o.audioCapabilities)r=n.contentType,r&&t(r)&&(e.audioCapabilities.push(n),a=!0)}if(null===(i=o.videoCapabilities)||void 0===i?void 0:i.length){a=!1;for(const n of o.videoCapabilities)r=n.contentType,r&&t(r)&&(e.videoCapabilities.push(n),a=!0)}if(a)return e}return null}const B=/([^;]+)(?:;\s?codecs="(.*)")?/;function H(e){var t;const[,n="unknown",i="unknown"]=null!==(t=e.match(B))&&void 0!==t?t:[];return{mimeType:n,codec:i,contentType:e}}const G=/([^;]+)(?:;\s?codecs="(.*)")?/,K=u.P.forTag("playback.eme_manager"),W={EMPTY:"-no-robustness",SW_CRYPTO:"-sw-crypto",SW_DECODE:"-sw-decode",HW_CRYPTO:"-hw-crypto",HW_DECODE:"-hw-decode",HW_ALL:"-hw-all"};function Y(e,t){var n;const i=[],o=new RegExp(`codecs="(${t.join("|")})"`);for(const t of e)o.test(null!==(n=t.contentType)&&void 0!==n?n:"")||i.push(t);return i.length?i:null}function j(e,{audio:t,video:n}){var i,o,r,a;if(!(null==t?void 0:t.length)&&!(null==n?void 0:n.length))return e;let{audioCapabilities:s,videoCapabilities:c}=e;return(null==t?void 0:t.length)&&(null===(i=e.audioCapabilities)||void 0===i?void 0:i.length)&&(s=null!==(o=Y(e.audioCapabilities,t))&&void 0!==o?o:void 0,!s)||(null==n?void 0:n.length)&&(null===(r=e.videoCapabilities)||void 0===r?void 0:r.length)&&(c=null!==(a=Y(e.videoCapabilities,n))&&void 0!==a?a:void 0,!c)?null:Object.assign(Object.assign({},e),{audioCapabilities:s,videoCapabilities:c})}class z extends d.vp{constructor(e){var t;super(),this._unauthServerCertificateBase="",this._disallowCodecs={},this._keySystemDeferred=(0,m.$)(),this._configuration=(0,m.$)(),this._keySystemSettings=null,this._keySessions=[],this._configs=[],this._pendingCertificateRequest=null,this._certificate=null,this._transport=e.transport,this._emeImpl=e.emeImpl,this._noServerCertificate=!!e.noServerCertificate,this._precacheServerCertificate=null===(t=e.precacheServerCertificate)||void 0===t||t,this._unauthServerCertificateBase=e.unauthServerCertificateBase||"https://spclient.wg.spotify.com",this._configFilter=function(e){const t=["--ensure-no-match--"];if(null==e?void 0:e.length){let n=e.length;for(;n--;){const i=e[n];i&&W.hasOwnProperty(i)&&t.push(W[i])}}return new RegExp(`(${t.join("|")})$`)}(e.disallowRobustnessValues||[]),this._disallowCodecs=e.disallowCodecs,this._preferredKeySystems=e.preferredKeySystems||[o.WIDEVINE,o.PLAYREADY,o.PLAYREADY_HARDWARE,o.FAIRPLAY]}static create(e){return new Promise((t=>{const n=x();if(!n)throw g.fatal(r.EME_API_NOT_SUPPORTED,"Platform does not support navigator.requestMediaKeySystemAccess");t(new z(Object.assign(Object.assign({},e),{emeImpl:n})).init())}))}_prepareConfiguration(e){const t=e.getConfiguration();K.info("KeySystem configured as ",t.label),t.audioCapabilities&&t.audioCapabilities.length||this._appendProbableMediaCapabilities(e.keySystem,t);const n={keySystem:e.keySystem,keySystemImpl:this._emeImpl,audioFormats:this._parseCapabilities(t.audioCapabilities),videoFormats:this._parseCapabilities(t.videoCapabilities)};return this._keySystemSettings=U[e.keySystem],this._configuration.resolve(n),n}_parseCapabilities(e){var t;if(!e)return[];const n=[];for(const i of e){if(!(null==i?void 0:i.contentType))continue;const[,e,o]=null!==(t=i.contentType.match(G))&&void 0!==t?t:[];e&&n.push({contentType:i.contentType,mimeType:e,codec:null!=o?o:""})}return n}_appendProbableMediaCapabilities(e,t){const n=F(this._configs,(t=>(-1===t.indexOf("webm")||e!==o.PLAYREADY&&e!==o.PLAYREADY_HARDWARE)&&!!MediaSource.isTypeSupported(t)));n&&(t.audioCapabilities=n.audioCapabilities,t.videoCapabilities=n.videoCapabilities)}_trySetServerCertificate(e,t){const n=this._certificate;return(n&&n.expiry>Date.now()?Promise.resolve(n):this._requestServerCertificate(e)).then((e=>t.setServerCertificate(e.contents))).then((()=>this)).catch((e=>(K.warn("Error from setting server certificate",e),this)))}_cacheServerCertificate(e){let t="";switch(e){case o.FAIRPLAY:t="fairplay";break;case o.WIDEVINE:t="widevine";break;default:return Promise.resolve(this)}return this._requestServerCertificate(`${this._unauthServerCertificateBase}/${t}-license`,!1).then((()=>this),(e=>(K.warn("Cannot precache server certificate",e),this)))}_requestServerCertificate(e,t=!0){if(this._pendingCertificateRequest)return this._pendingCertificateRequest;return this._transport.request(`${e}/v1/application-certificate`,{authorize:t,responseType:"arraybuffer",parseResponseHeaders:!0,retry:{condition:(e,t)=>e.getStatusFamily()===t.SERVER_ERROR}}).then((e=>{var t;if(!e.body)throw new TypeError("Response body is invalid");this._pendingCertificateRequest=null;let n=3600;const i=null===(t=e.headers)||void 0===t?void 0:t.get("cache-control");if(i){const e=i.match(/(?:^|,|\s)max-age=(\d+)(?:,|$)/);e&&e[1]&&(n=1e3*parseInt(e[1],10))}return this._certificate={expiry:Date.now()+(n-600),contents:e.body},this._certificate}))}_extractPlayReadyChallenge(e,t){var n;let o=null;const a=new Uint16Array(e),s=String.fromCharCode.apply(null,a);if(-1===s.indexOf("PlayReadyKeyMessage"))return K.info("Using unextracted PlayReady message."),e;const c=(new DOMParser).parseFromString(s,"application/xml"),l=c.getElementsByTagName("Challenge")[0],u=null===(n=null==l?void 0:l.childNodes[0])||void 0===n?void 0:n.nodeValue;if(u)try{o=atob(u);const e=c.getElementsByTagName("name"),t=c.getElementsByTagName("value");if(e.length!==t.length)throw new g(r.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")}catch(e){this.emit(i.EME_LICENSE_REQUEST_ERROR,{playId:t,error:e}),o=null}else this.emit(i.EME_LICENSE_REQUEST_ERROR,{playId:t,error:new g(r.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")});return o}_onMessage(e,t){e.timeMap.generate.end=Date.now();let n="message"in t?t.message:null;const i="messageType"in t?t.messageType:void 0;if(K.info("Got EME message event with type",i),n&&e.keySystem===o.PLAYREADY&&(n=this._extractPlayReadyChallenge(n,e.playId)),!n)return void K.info("Ignoring message event: no valid request payload");if(!e.licenseServer)return void K.info("Ignoring message event: no licenseServer url");e.timeMap.request.start=Date.now();let r=e.licenseServer;e.keySystem===o.FAIRPLAY&&(r=`${r}${-1!==r.indexOf("?")?"&":"?"}assetId=hex`),this._transport.request(r,{method:"POST",payload:n,responseType:"arraybuffer",retry:{condition:(e,t)=>400!==e.status&&402!==e.status&&403!==e.status&&(!e.body||e.getStatusFamily()!==t.SUCCESS)}}).then(this._handleLicenseResponse.bind(this,e))}_handleLicenseResponse(e,t){const n=t=>{t.playId=e.playId,e.licenseServer&&(t.licenseServer=e.licenseServer),this.emit(i.EME_LICENSE_REQUEST_ERROR,{playId:e.playId,error:t})};let o,a;if(e.timeMap.request.end=Date.now(),200!==t.status){try{if(t.body){const e=new Uint8Array(t.body),n=String.fromCharCode.apply(String,e);a=JSON.parse(n).errorMsg}}catch(e){}402===t.status?this.emit(i.EME_LICENSE_REQUEST_CAPPED,{playId:e.playId,error:new _(r.CAPPING_USER_IS_CAPPED,"User is capped.")}):400===t.status&&"widevine error"===a?(o=g.fatal(r.EME_LICENSE_REQUEST_WIDEVINE_ERROR,"Widevine license server failed to parse request."),o.status=t.status,o.shouldRefreshEndpoint=!0,n(o)):(o=new g(r.EME_LICENSE_REQUEST_FAILED_WITH_STATUS,`License request failed (${a||"unknown"})`),o.status=t.status,o.shouldRefreshEndpoint=400===t.status||403===t.status,n(o))}else{if(!t.body)return o=new g(r.EME_LICENSE_REQUEST_EMPTY_RESPONSE,"Empty license response body"),o.status=t.status,void n(o);try{e.timeMap.update.start=Date.now(),e.keySession.update(t.body).catch((e=>{n(new g(r.EME_LICENSE_UPDATE_FAILED,e.message||"License update failed."))})),K.info("KeySession updated.")}catch(e){const{message:t}=e;n(new g(r.EME_LICENSE_UPDATE_FAILED,t||"License update failed."))}}}_selectKeySystem(e){const t=this._preferredKeySystems;for(let n=0,i=t.length;n{t(e.createMediaKeys())})).then((t=>{if(!t)return Promise.reject(g.fatal(r.EME_MEDIA_KEYS_NOT_SUPPORTED,"Cannot create MediaKeys from KeySystemAccess"));e.keySystem===o.FAIRPLAY&&t.setServerCertificate(new ArrayBuffer(0));try{if(!t.createSession())throw new Error("")}catch(e){const{message:t}=e;return Promise.reject(g.fatal(r.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED,t||"Cannot create MediaKeySession from KeySystemAccess"))}return Promise.resolve(e)}),(e=>(K.error(e.name),Promise.reject(g.fatal(r.EME_MEDIA_KEYS_NOT_SUPPORTED,e.message||"Unknown error")))))}_saveSession(e){this._keySessions.push(e)}destroySessions(){const e=[],t=this._keySessions;for(const n of t)try{const t=n.keySession;if(!t)continue;n.onMessageListener&&t.removeEventListener(i.KEY_SESSION_MESSAGE,n.onMessageListener),n.onKeyStatusChangeListener&&t.removeEventListener(i.KEY_SESSION_STATUSES_CHANGE,n.onKeyStatusChangeListener);const o=Promise.resolve(t.close()).catch((e=>{K.warn("Failed to close KeySession",e)}));e.push(o),n.keySession=null,n.onMessageListener=null,n.onKeyStatusChangeListener=null,K.info("Closed KeySession")}catch(e){K.warn("Failed to close KeySession",e)}return this._keySessions=[],Promise.all(e)}init(){const e=this._keySystemDeferred,t={},n=[],i=[];for(let e of V)if(!e.label||!this._configFilter.test(e.label)){if(this._disallowCodecs){const t=j(e,this._disallowCodecs);if(!t)continue;e=t}i.push(e)}this._configs=i;for(const e in o){if(!Object.prototype.hasOwnProperty.call(o,e))continue;const r=e;n.push(navigator.requestMediaKeySystemAccess(o[r],i).then((e=>{t[e.keySystem]=e})).catch((()=>{})))}return Promise.all(n).then(this._selectKeySystem.bind(this,t)).then((e=>e?this._testMediaKeys(e):Promise.reject(new g(r.EME_NO_SUPPORTED_KEYSYSTEM,"No supported keysystem was found.")))).then((t=>(this._prepareConfiguration(t),e.resolve(t),this._precacheServerCertificate?this._cacheServerCertificate(t.keySystem):this))).catch((t=>{const n=t.code||r.EME_NO_SUPPORTED_KEYSYSTEM,i=t.message||"No supported keysystem";return e.reject(g.fatal(n,i)),e.promise.then((()=>this))}))}createMediaKeys(e){return this._keySystemDeferred.promise.then((e=>e.createMediaKeys())).then((t=>Promise.all([e.setMediaKeys(t),t]))).then((([t,n])=>{if(!e.mediaKeys)throw new g(r.EME_PLAYER_MEDIA_KEYS_SETTING_FAILED,"Failed to set MediaKeys on HTMLMediaElement");return this._configuration.promise.then((()=>{const e=this._keySystemSettings;return e&&!this._noServerCertificate&&e.withCertificate?this._trySetServerCertificate(e.licenseServer,n):this}))}))}removeMediaKeys(e){return Promise.resolve(e.setMediaKeys(null)).then((()=>this))}getKeySystemInfo(){return this._configuration.promise}getKeySystemImpl(){return this._emeImpl}createSessionWithParams(e){return new Promise(((t,n)=>{K.info("Creating KeySession",e.keySystem);const o=e.mediaKeys.createSession(),a={generate:{start:0,end:0},request:{start:0,end:0},update:{start:0,end:0}},s=this._keySystemSettings&&this._keySystemSettings.licenseServer||void 0,c=this._onMessage.bind(this,{keySystem:e.keySystem,keySession:o,licenseServer:e.licenseServer||s,playId:e.playId,timeMap:a});o.addEventListener(i.KEY_SESSION_MESSAGE,c);const l=()=>{K.info("KeyStatus change"),a.update.end=Date.now(),t({elapsed:{generate:Math.max(a.generate.end-a.generate.start,0),request:Math.max(a.request.end-a.request.start,0),update:Math.max(a.update.end-a.update.start,0)}})};return o.addEventListener(i.KEY_SESSION_STATUSES_CHANGE,l),this._saveSession({keySession:o,onMessageListener:c,onKeyStatusChangeListener:l}),K.info("Generating KeySession request",e.keySystem),a.generate.start=Date.now(),Promise.resolve(o.generateRequest(e.initDataType,e.initData.buffer)).catch((e=>{if(!e)return;let t;switch(e.name){case"NotSupportedError":t=r.EME_NOT_SUPPORTED_ERROR;break;case"InvalidStateError":t=r.EME_INVALID_STATE_ERROR;break;default:t=r.EME_UNKNOWN_ERROR}n(new g(t,e.message||"Unknown error message."))}))}))}}n(46758),n(53321),n(27082);class J extends Error{constructor(e,t,n,i={}){super(t),this.code=e,this.message=t,this.status=n,this.debug=i,this.name="FragmentError"}}var q=n(30622);class X{constructor(e){var t;if(this._fallbackURLs=[],this._fragments=[],this._loaded=!1,this._mediaType="audio",this._noAuth=!1,this._resolvedURLs=[],this._segmentLength=0,this._duration=0,!e.fileId&&!e.resolvedURL)throw new TypeError("Missing: provide either fileId or resolvedURL");this._abrManager=e.abrManager,this._mediator=e.mediator,this._disableCache=e.disableCache,this._fileId=e.fileId,this._format=e.format,this._isAd=e.isAd||!1,this._keySystem=e.keySystem,this._keySystemSettings=U[this._keySystem],this._licenseEndpoint=e.licenseEndpoint,this._logData=e.logData||{displayTrack:"",playbackId:""},this._resolver=e.resolver,this._resolvedURL=e.resolvedURL,this._noAuth=null!==(t=e.noAuth)&&void 0!==t&&t,this._transport=e.transport,this._uri=e.uri,this._audioGainDb=e.audioGain}_parsePSSHBox(e){const t=q.D.decode(e),n=new Uint8Array(t.length);for(let e=0,i=t.length;e{if(e.byteEnd&&void 0!==e.byteStart){let t=""+(1+e.byteEnd-e.byteStart);return t+=`@${e.byteStart}`,`#EXTINF:${e.duration},\n#EXT-X-BYTERANGE:${t}\n${e.url}`}return`#EXTINF:${e.duration},\n${e.url}`})).join("\n")}(e.segments),i=e.assetID?`#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://${e.assetID}",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"`:"";let o=e.map?`#EXT-X-MAP:URI="${e.map.url}"`:"";return(null===(t=e.map)||void 0===t?void 0:t.byteEnd)&&void 0!==e.map.byteStart&&(o+=`,BYTERANGE="${1+e.map.byteEnd}@${e.map.byteStart}"`),`#EXTM3U\n#EXT-X-VERSION:6\n#EXT-X-TARGETDURATION:${Math.floor(e.targetDuration)}\n#EXT-X-MEDIA-SEQUENCE:0\n#EXT-X-PLAYLIST-TYPE:VOD\n${o?`${i}\n${o}`:i}\n${n}\n#EXT-X-ENDLIST`}function $(e){return`data:application/vnd.apple.mpegurl;base64,${btoa(e)}`}function ee(e){const t=new Blob([e],{type:Z});return URL.createObjectURL(t)}function te(e){return ee(Q(e))}function ne(e){return $(Q(e))}const ie=/avc1\.(([0-9a-f]{2})[0-9a-f]{2}([0-9a-f]{2}))/,oe="4d";function re(e,t){const n=e.toLowerCase().match(ie),i=t.toLowerCase().match(ie);if(!n||!i)return!1;const[,o,r,a]=n,[,s,c,l]=i;return o===s||r===oe&&c===oe&&parseInt(a,16)>=parseInt(l,16)}function ae(e,t){return e.sort(((e,n)=>"video_bitrate"in e&&"video_bitrate"in n?t?e.video_resolution===n.video_resolution?e.video_bitrate-n.video_bitrate:e.video_resolution-n.video_resolution:e.video_bitrate-n.video_bitrate:e.max_bitrate-n.max_bitrate))}function se(e,t){return void 0!==t&&Array.isArray(e.encryption_indices)&&-1===e.encryption_indices.indexOf(t)}function ce(e,t){if(!t)return!1;return t(Object.assign({mimeType:e.mime_type},function(e){return"video_codec"in e}(e)?{type:"video",codec:e.video_codec,bitrate:e.video_bitrate,height:e.video_height,width:e.video_width,resolution:e.video_resolution}:{type:"audio",codec:e.audio_codec,bitrate:e.audio_bitrate}))}function le(e){return"audio_codec"in e?e.audio_codec:e.video_codec}function ue(e){const{codec:t,formats:n,profiles:i,encryptionIndex:r,disallowProfile:a,preferredKeySystem:s,preferredVideoResolution:c,allowMixedAVC1Codecs:l}=e;for(const e of n){const n=[];let u="spotify/unknown-mimetype",d="unknown-codec";for(const c of i){const i=le(c);!(t in c)||se(c,r)||s===o.FAIRPLAY&&"ts"!==c.file_type||ce(c,a)||(s!==o.FAIRPLAY||"ts"!==c.file_type?"unknown-codec"!==d||c.mime_type!==e.mimeType||i!==e.codec&&!re(e.codec,i)?c.mime_type===u&&(i===d||l&&re(d,i))&&(n.push(c),c.__effective_codec=d):(u=e.mimeType,d=l?e.codec:i,n.push(c),c.__effective_codec=e.codec):n.push(c))}if(n.length)return ae(n,c)}return[]}const de=u.P.forTag("playback.video_content");function pe(e){if(!e)return"";const t=e.__effective_codec||("audio_codec"in e?e.audio_codec:e.video_codec);return`${e.mime_type};codecs="${t}"`}const fe={method:"GET",responseType:"arraybuffer",timing:!0,retry:{condition:(e,t)=>{if(0===e.status)return!0;const n=e.getStatusFamily();return n===t.CONNECTION_ERROR||n===t.SERVER_ERROR}}};class he extends X{constructor(e){super(e),this._assetId="",this._endTime=0,this._videoFormats=[],this._audioFormats=[],this._subtitleLanguages=[],this._videoProfile=null,this._videoProfiles=[],this._audioProfile=null,this._audioProfiles=[],this._baseURL="",this._initTemplate="",this._segmentTemplate="",this._subtitleTemplate="",this._initSegments={},this._hlsURLs=[],this._allowMixedAVC1Codecs=!1,this._initTemplate="",this._isAd=e.isAd||!1,this._mediaType="video",this._resolver=e.resolver,this._videoFormats=e.videoFormats,this._audioFormats=e.audioFormats,this._disallowProfile=e.disallowProfile,this._videoResolution=e.videoResolution,this._allowMixedAVC1Codecs=!!e.allowMixedAVC1Codecs,this._keySystem===o.FAIRPLAY&&this._audioFormats.unshift({mimeType:"audio/mp2t",codec:"mp4a.40.2"}),this._parseFragmentResponse=this._parseFragmentResponse.bind(this)}static create(e){return new he(e)}_isQualityMatched(e,t,n){var i,o,r,a;if(this._videoResolution){const t=null!==(i=this._videoResolution.max)&&void 0!==i?i:9007199254740991,a=null!==(o=this._videoResolution.min)&&void 0!==o?o:0;if(n){const n=null!==(r=this._videoResolution.start)&&void 0!==r?r:t;return e.video_resolution<=n}return e.video_resolution>=a&&e.video_resolution<=t}const s=null!==(a=null==t?void 0:t.audio_bitrate)&&void 0!==a?a:0,c=this._abrManager.getBandwidthEstimate();return e.video_bitrate+s<2*c-1e5}_updateVariants(e){var t;const n=this._audioProfiles[0];this._audioProfile=null!=n?n:null;const i=this._videoProfiles,o=this._videoProfile;let r=null,a=i.length;if(a){for(;a--;){const t=i[a];if(t&&this._isQualityMatched(t,n,!!e)){r=t;break}}r||(r=i[0]),this._videoProfile=r,(null==o?void 0:o.id)!==r.id&&(de.log(`Video profile changed. ID ${r.id} (${r.video_codec}), Bitrate ${r.video_bitrate}, ${r.video_width}x${r.video_height}`),null===(t=this._mediator)||void 0===t||t.emit(c.VIDEO_PROFILE_CHANGED,{profile:{type:"video",mimeType:r.mime_type,codec:r.video_codec,bitrate:r.video_bitrate,height:r.video_height,width:r.video_width,resolution:r.video_resolution}}))}}_constructFragmentURL(e,t,n){if(!t&&!n)throw new Error("Both audioProfile and videoProfile is null");return e.init?this._resolver.getInitSegmentURLs(this._baseURL,this._initTemplate,t,n):this._resolver.getSegmentURLs(this._baseURL,this._segmentTemplate,e.timeStart,t,n)}_fetchBufferData(e,t,n,i){return this._transport.request(e,Object.assign(Object.assign({},fe),{metadata:{timeStart:Date.now(),fragment:t,profile:n,loggingURL:i}})).then(this._parseFragmentResponse)}_fetchInitSegmentBuffers(e,t){const n=this._initFragment;if(!n)return Promise.reject(new h(r.FILE_NOT_RESOLVED,"Cannot fetch Init Segment buffers: File not resolved."));let i;try{i=this._constructFragmentURL(n,e,t)}catch(e){return Promise.reject(e)}const o=this._initSegments;let a=Promise.resolve(null);if(e){const t=o[e.id];(null==t?void 0:t.buffer.byteLength)?a=Promise.resolve(t):(null==i?void 0:i.audio)&&(a=this._fetchBufferData(i.audio,n,e,i.audioLogging).then((t=>(o[e.id]=t,t))))}let s=Promise.resolve(null);if(t){const e=o[t.id];(null==e?void 0:e.buffer.byteLength)?s=Promise.resolve(e):(null==i?void 0:i.video)&&(s=this._fetchBufferData(i.video,n,t,i.videoLogging).then((e=>(o[t.id]=e,e))))}return Promise.all([a,s]).then((([e,t])=>({audio:e,video:t})))}_fetchBufferForFragment(e,t,n){let i;try{i=this._constructFragmentURL(e,t,n)}catch(e){return Promise.reject(e)}return Promise.all([this._fetchInitSegmentBuffers(t,n),!e.init&&i.audio?this._fetchBufferData(i.audio,e,t,i.audioLogging):null,!e.init&&i.video?this._fetchBufferData(i.video,e,n,i.videoLogging):null]).then((([t,n,i])=>{var o,r;let a;return e.init?a={audio:null!==(o=t.audio)&&void 0!==o?o:void 0,video:null!==(r=t.video)&&void 0!==r?r:void 0}:(a={audio:null!=n?n:void 0,video:null!=i?i:void 0},e.cacheBufferSet&&(e.bufferSet=a),a.audio&&(null==t?void 0:t.audio)&&(a.audio.initBuffer=t.audio.buffer),a.video&&(null==t?void 0:t.video)&&(a.video.initBuffer=t.video.buffer)),a})).catch((e=>Promise.reject(e)))}_parseFragmentResponse(e){var t,n,i,o;const{fragment:a,profile:s,timeStart:l,loggingURL:u}=e.metadata,d=pe(s),p=function(e){return e?"audio_bitrate"in e?e.audio_bitrate:e.video_bitrate:0}(s),f="video_resolution"in s?s.video_resolution:void 0,h=`${a.timeStart}-${a.timeEnd}`,m="video_resolution"in s?"video":"audio";switch(e.status){case 0:{const e=new J(r.FRAGMENT_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0,{time_range:h,mimetype:d,resolution:f,bitrate:p});return null===(t=this._mediator)||void 0===t||t.emit(c.FRAGMENT_FETCH_ERROR,{media_type:"video",segment_type:m,url:u,start_time:l,init:a.init,error:e}),Promise.reject(e)}case 200:case 206:{const t=e.body;if(!(null==t?void 0:t.byteLength)){const t=new J(r.FRAGMENT_REQUEST_EMPTY_RESPONSE,"Empty response for successful buffer.",e.status,{time_range:h,mimetype:d,resolution:f,bitrate:p});return null===(n=this._mediator)||void 0===n||n.emit(c.FRAGMENT_FETCH_ERROR,{media_type:"video",segment_type:m,url:u,start_time:l,init:a.init,error:t}),Promise.reject(t)}const o=t.byteLength;this._abrManager.sample(o,Date.now()-l),this._updateVariants();const g=8e3*o/e.timing.completed;return null===(i=this._mediator)||void 0===i||i.emit(c.FRAGMENT_FETCHED,{media_type:"video",segment_type:m,url:u,init:a.init,byte_length:o,start_time:l,end_time:Date.now(),resolution:f,bandwidth:g}),Promise.resolve({profileId:`${this._fileId}-${s.id}`,bufferURL:u,byteStart:0,byteEnd:o-1,buffer:t,mimetype:d,resolution:f,bitrate:p,bandwidth:g})}}const g=new J(r.FRAGMENT_REQUEST_FAILED_WITH_STATUS,`Buffer request failed with status ${e.status}`,e.status,{time_range:h,mimetype:d,resolution:f,bitrate:p});return null===(o=this._mediator)||void 0===o||o.emit(c.FRAGMENT_FETCH_ERROR,{media_type:"video",segment_type:m,url:u,init:a.init,start_time:l,error:g}),Promise.reject(g)}_getHLSURLForProfile(e){const t=this._duration,n=this._segmentLength,i=this._segmentTemplate,o=[];for(let r=0;rt?t-r:n,s=i.replace("{{profile_id}}",e.id.toString(10)).replace("{{segment_timestamp}}",r.toString(10)).replace("{{file_type}}",e.file_type);o.push({duration:a,url:`${this._baseURL}${s}`})}const r=("undefined"==typeof MediaSource?te:ne)({assetID:this._assetId,targetDuration:n,segments:o});return this._hlsURLs.push(r),r}_calculateFragments(e){this._duration=e.end_time_millis/1e3;const t=this._segmentLength;this._initFragment={init:!0,cacheBufferSet:!1,timeStart:-1,timeEnd:-1,byteRanges:{}};for(let e=0;e=o.video_resolution)?Promise.resolve(e.bufferSet):this._fetchBufferForFragment(e,null!=i?i:void 0,null!=o?o:void 0)}clearCachedBuffers(){this._initFragment&&(this._initSegments={}),this._fragments.forEach((e=>{e.bufferSet=null}))}getDuration(){return this._endTime}getFragmentAfterTime(e){var t;if(!(null===(t=this._fragments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return this._fragments[1];for(const t of this._fragments)if(t.timeStart>e)return t;return null}getFragmentForTime(e){var t;if(!(null===(t=this._fragments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return this._fragments[0];for(const t of this._fragments)if(t.timeStart<=e&&t.timeEnd>=e)return t;return null}getSubtitleLanguages(){return this._subtitleLanguages}getSubtitles(){return this._subtitleLanguages.map((e=>({lang:e,url:this._subtitleTemplate.replace("{{language_code}}",e)})))}load(e={resolveLatency:0,manifestLatency:0}){if(this._loaded)return e.resolveLatency=0,e.manifestLatency=0,Promise.resolve(this);if(!this._fileId)throw new TypeError("Missing: provide either fileId or resolvedURL");const t=Date.now();return this._resolver.getManifest(this._fileId,this._noAuth).then((n=>{var i,o,a;let s;e.resolveLatency=0,e.manifestLatency=Date.now()-t;const l=n.contents[0];if(!l)return s=new h(r.FILE_MALFORMED_SEEKTABLE,"Malformed seektable: no contents."),s.track=this.toLogJSON(),Promise.reject(s);this._resolvedURLs=n.base_urls.slice();const[u,...d]=n.base_urls;let p;if(u&&(this._baseURL=u,this._fallbackURLs=d),this._resolvedURL=this._baseURL,this._initTemplate=n.initialization_template,this._segmentTemplate=n.segment_template,this._segmentLength=l.segment_length,null===(i=l.encryption_infos)||void 0===i?void 0:i.length){const e=l.encryption_infos,t=this._keySystemSettings.commonName;let n;for(let i=0,o=e.length;i!!e))}getAudioProfile(){return this._audioProfile}getVideoProfile(){return this._videoProfile}getVideoProfiles(){return this._videoProfiles}getHLSURL(){if(!this._resolvedURL)throw new h(r.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.releaseHLSURL();const e=[],t=this._audioProfiles[0];t&&e.push(`#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",LANGUAGE="eng",NAME="English",AUTOSELECT=YES,URI="${this._getHLSURLForProfile(t)}"`);for(const n of this._videoProfiles)e.push(`#EXT-X-STREAM-INF:BANDWIDTH=${n.max_bitrate},RESOLUTION=${n.video_width}x${n.video_height},CODECS="${(null==t?void 0:t.audio_codec)?`mp4a.40.2, ${n.video_codec}`:n.video_codec}"${(null==t?void 0:t.audio_codec)?',AUDIO="audio"':""}\n${this._getHLSURLForProfile(n)}`);const n=`#EXTM3U\n${e.join("\n")}`,i=("undefined"==typeof MediaSource?ee:$)(n);return this._hlsURLs.push(i),i}releaseHLSURL(){for(const e of this._hlsURLs)URL.revokeObjectURL(e);this._hlsURLs=[]}canLowerBitrate(){var e;const t=this._videoProfiles[0];return(null===(e=this._videoProfile)||void 0===e?void 0:e.id)!==(null==t?void 0:t.id)}}var me;!function(e){e[e.MP3_256=3]="MP3_256",e[e.MP3_320=4]="MP3_320",e[e.MP3_160=5]="MP3_160",e[e.MP3_96=6]="MP3_96",e[e.MP4_128=10]="MP4_128",e[e.MP4_256=11]="MP4_256",e[e.MP4_128_DUAL=12]="MP4_128_DUAL",e[e.MP4_256_DUAL=13]="MP4_256_DUAL",e[e.MP4_128_CBCS=14]="MP4_128_CBCS",e[e.MP4_256_CBCS=15]="MP4_256_CBCS",e[e.MP4_FLAC=17]="MP4_FLAC"}(me||(me={}));const ge={[me.MP3_256]:"audio/mp3",[me.MP3_320]:"audio/mp3",[me.MP3_160]:"audio/mp3",[me.MP3_96]:"audio/mp3",[me.MP4_128]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_256]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_128_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_256_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_128_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_256_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[me.MP4_FLAC]:'audio/mp4; codecs="flac"'};class _e extends X{constructor(e){if(super(e),this._lastResolveTimestamp=0,this._profileId=`${Date.now()}`,this._initBufferPromise=null,this._lastFetchedBuffer=null,this._hlsURL=null,this._bypassResolve=!!this._resolvedURL,this._emitWarning=e.emitWarning||function(){},this._mediaType="audio",this._noManifest=!!e.noManifest,this._preloadedManifest=e.preloadedManifest,this._resolver=e.resolver,this._segmentLength=0,this._fileFormat=e.fileFormat,this._fileFormat)this._audioCodec=ge[this._fileFormat];else switch(this._format){case s.MP3:this._audioCodec=ge[me.MP3_160];break;case s.MP4:case s.MP4_DUAL:case s.MP4_CBCS:this._audioCodec=ge[me.MP4_128];break;default:throw new TypeError(`Unknown audio format ${this._format}`)}this._fileId&&(this._profileId=this._fileId),this._parseFragmentResponse=this._parseFragmentResponse.bind(this)}static create(e){return new _e(e)}_parseFragmentResponse(e){const{requestURL:t,fragment:n,byteRangeHeader:i,expectedLength:o}=e.metadata,a=`${n.timeStart}-${n.timeEnd}`;switch(e.status){case 0:{if(e.offline)return Promise.reject(new J(r.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0,{time_range:a,byte_range:i}));const o=new J(r.FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0);let s=!1;return this._resolvedURL!==t?s=!0:this._fallbackURLs.length&&this._resolvedURL===t&&(s=!0,this._resolvedURL=this._fallbackURLs.shift()),o.debug.has_fallback=s,s?(this._emitWarning(o,this.toLogJSON()),this.getBufferForFragment(n)):Promise.reject(o)}case 200:case 206:{const s=e.body;if(!s)return Promise.reject(new J(r.FRAGMENT_REQUEST_EMPTY_RESPONSE,"Empty response for successful buffer.",e.status,{time_range:a,byte_range:i}));if(s.byteLength!==o)return Promise.reject(new J(r.FRAGMENT_REQUEST_UNEXPECTED_LENGTH,"Received buffer of unexpected length.",e.status,{time_range:a,byte_range:i,received_length:s.byteLength,expected_length:o}));const c={audio:{profileId:this._profileId,bufferURL:t,byteStart:n.byteRanges.audio.start,byteEnd:n.byteRanges.audio.end,buffer:s,mimetype:this._audioCodec,bandwidth:8e3*s.byteLength/e.timing.completed}};if(n.cacheBufferSet&&s&&s.byteLength){n.bufferSet=c;const e=n.sliceInto;if(null==e?void 0:e.length)for(const t of e){const e=t.fragment;(null==e?void 0:e.cacheBufferSet)&&(e.bufferSet={audio:Object.assign(Object.assign({},c.audio),{buffer:s.slice(t.start,t.end),byteStart:e.byteRanges.audio.start,byteEnd:e.byteRanges.audio.end})})}}return this._abrManager.sample(s.byteLength,e.timing.completed),Promise.resolve(c)}case 403:return this.resolve().then((()=>this.getBufferForFragment(n)));default:{let o=!1;return this._resolvedURL!==t?o=!0:this._fallbackURLs.length&&this._resolvedURL===t&&(o=!0,this._resolvedURL=this._fallbackURLs.shift()),o?this.getBufferForFragment(n):Promise.reject(new J(r.FRAGMENT_REQUEST_FAILED_WITH_STATUS,`Buffer request failed with status ${e.status}`,e.status,{time_range:a,byte_range:i}))}}}_getInitBuffer(){var e,t;if(!this._initFragment)throw new h(r.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");return(null===(t=null===(e=this._initFragment.bufferSet)||void 0===e?void 0:e.audio)||void 0===t?void 0:t.buffer.byteLength)?Promise.resolve(this._initFragment.bufferSet.audio.buffer):(this._initBufferPromise||(this._initBufferPromise=this.getBufferForFragment(this._initFragment).then((e=>{var t;if(!(null===(t=e.audio)||void 0===t?void 0:t.buffer.byteLength))throw new Error("Empty initialization segment buffer");return e.audio.buffer}))),this._initBufferPromise)}_calculateFragments(e){let t=e.offset;this._initFragment={init:!0,cacheBufferSet:!this._disableCache,timeStart:0,timeEnd:0,byteRanges:{audio:{start:0,end:t-1}}};const n=e.segments,i=e.timescale,o=n.length,r=new Array(o);let a=0,s=0;for(let e=0,c=o;ethis._segmentLength&&(this._segmentLength=Math.floor(u))}r[r.length-1].isLastFragment=!0,this._fragments=r,this._duration=s/i}_calculateFragmentsV1(e){let t=e.offset;this._initFragment={init:!0,cacheBufferSet:!this._disableCache,timeStart:0,timeEnd:0,byteRanges:{audio:{start:0,end:t-1}}};const n=e.references,i=e.timescale,o=n.length,r=new Array(o);let a=0,s=0;for(let e=0,c=o;ethis._segmentLength&&(this._segmentLength=Math.floor(c))}r[r.length-1].isLastFragment=!0,this._fragments=r,this._duration=a/i}_getManifest(e){if(this._noManifest)return e&&(e.manifestLatency=0),Promise.resolve(null);if(this._preloadedManifest)return e&&(e.manifestLatency=0),Promise.resolve(this._preloadedManifest);if(!this._fileId)throw new TypeError("Missing: fileId");const t=Date.now();return this._resolver.getManifest(this._fileId).then((function(n){return e&&(e.manifestLatency=Date.now()-t),n}))}getHLSURL(){var e,t;const n=this._resolvedURL,i=this._initFragment;if(!n||!i)throw new h(r.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.releaseHLSURL();const o={url:n,byteStart:null===(e=i.byteRanges.audio)||void 0===e?void 0:e.start,byteEnd:null===(t=i.byteRanges.audio)||void 0===t?void 0:t.end},a=this._fragments.map((e=>{var t,i;return{url:n,duration:e.timeEnd-e.timeStart,byteStart:null===(t=e.byteRanges.audio)||void 0===t?void 0:t.start,byteEnd:null===(i=e.byteRanges.audio)||void 0===i?void 0:i.end}})),s="undefined"==typeof MediaSource?te:ne;return this._hlsURL=s({assetID:this._fileId,targetDuration:10,map:o,segments:a}),this._hlsURL}releaseHLSURL(){this._hlsURL&&URL.revokeObjectURL(this._hlsURL),this._hlsURL=null}clearCachedBuffers(){this._headFragment&&delete this._headFragment,this._initFragment&&(this._initFragment.bufferSet=null),this._fragments[0]&&(this._fragments[0].bufferSet=null),this._lastFetchedBuffer=null}getPlayableCodecs(){return[this._audioCodec]}getFirstFragment(){var e;return null!==(e=this._fragments[0])&&void 0!==e?e:null}getHeadFragment(){const e=this._initFragment,t=this._fragments[0];if(!(null==e?void 0:e.byteRanges.audio)||!(null==t?void 0:t.byteRanges.audio))throw new h(r.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");return this._headFragment||(this._headFragment={init:!0,cacheBufferSet:!0,timeStart:0,timeEnd:0,byteRanges:{audio:{start:e.byteRanges.audio.start,end:t.byteRanges.audio.end}},sliceInto:[{fragment:e,start:0,end:t.byteRanges.audio.start},{fragment:t,start:t.byteRanges.audio.start,end:void 0}]}),this._headFragment}getFragmentAfterTime(e){var t,n;if(!(null===(t=this._fragments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return null!==(n=this._fragments[1])&&void 0!==n?n:null;for(const t of this._fragments)if(t.timeStart>e)return t;return null}getFragmentForTime(e){var t,n;if(!(null===(t=this._fragments)||void 0===t?void 0:t.length))return null;if(0===e||.01===e)return null!==(n=this._fragments[0])&&void 0!==n?n:null;for(const t of this._fragments)if(t.timeStart<=e&&t.timeEnd>=e)return t;return null}getBufferForFragment(e){var t;if(!e)return Promise.reject(new Error("FIXME: error type?"));if((null===(t=this._lastFetchedBuffer)||void 0===t?void 0:t.fragment)===e)return Promise.resolve(this._lastFetchedBuffer.bufferSet);if(e.bufferSet)return Promise.resolve(e.bufferSet);if(!this._resolvedURL)return Promise.reject(new h(r.FILE_NOT_RESOLVED,"Cannot fetch buffer: No resolved URL"));const n=e.byteRanges.audio,i=`${n.start}-${n.end}`,o=n.end+1-n.start,a=this._resolvedURL,s=e.init?Promise.resolve(null):this._getInitBuffer();return Promise.all([s,this._transport.request(a,{method:"GET",responseType:"arraybuffer",headers:{Range:`bytes=${i}`},timing:!0,metadata:{requestURL:a,fragment:e,byteRangeHeader:i,expectedLength:o},retry:{condition:(e,t)=>{if(0===e.status)return e.offline;const n=e.getStatusFamily();return n===t.CONNECTION_ERROR||n===t.SERVER_ERROR||!(n!==t.SUCCESS||!e.body)&&e.body.byteLength!==o}}}).then(this._parseFragmentResponse)]).then((([t,n])=>(t&&n.audio&&(n.audio.initBuffer=t),this._lastFetchedBuffer={fragment:e,bufferSet:n},n)))}resolve(e){const t=this._fileId;if(this._bypassResolve)return e&&(e.resolveLatency=0),Promise.resolve({uri:this._resolvedURL,uris:[],protection:this._preloadedManifest||!this._noManifest?"cenc":void 0});if(!t)throw new TypeError("Missing: fileId is required to resolve content URL");clearTimeout(this._lastResolveToken);const n=()=>(this._lastResolveTimestamp=Date.now(),this._resolver.getCDNURL(t,this._fileFormat).then((t=>(e&&(e.resolveLatency=Date.now()-this._lastResolveTimestamp),t)))),i=Date.now()-this._lastResolveTimestamp;let o;return o=i<1001?new Promise(((e,t)=>{this._lastResolveToken=setTimeout((()=>{n().then(e,t)}),1001-i)})):n(),o.then((e=>{this._resolvedURLs=[];for(const t of e.uris){const e=t.split("?")[0];this._resolvedURLs.push(e)}return this._fallbackURLs=e.uris,this._resolvedURL=this._fallbackURLs.shift(),e})).catch((e=>(e&&(e.track=this.toLogJSON()),Promise.reject(e))))}load(e={resolveLatency:0,manifestLatency:0}){return this._loaded?(e.resolveLatency=0,e.manifestLatency=0,Promise.resolve(this)):Promise.all([this.resolve(e),this._getManifest(e)]).then((([e,t])=>{var n;if(this._loaded=!0,!e.protection||!t)return this;if(this._keySystem===o.INVALID_SPOTIFY_KEY)return this._protection=t.protection||"cenc",this._psshBox=new Uint8Array(0),this;let i;const a=this._keySystemSettings.pssh_field.audio;let s=function(e,t){return t.hasOwnProperty(e)}(a,t)?`${t[a]}`:null;if(!s&&"pssh_widevine"===a&&"pssh"in t&&(s=null!==(n=t.pssh)&&void 0!==n?n:null),!s)return i=new h(r.FILE_FORMAT_NOT_SUPPORTED,"KeySystem does not support the file format."),i.track=this.toLogJSON(),Promise.reject(i);if(this._protection=t.protection||"cenc",this._psshBox=this._parsePSSHBox(s),"segments"in t&&t.segments)this._calculateFragments(t);else{if(!("references"in t)||!t.references)return i=new h(r.FILE_MALFORMED_SEEKTABLE,"Malformed seektable."),i.track=this.toLogJSON(),Promise.reject(i);this._calculateFragmentsV1(t)}return this}))}adaptToBandwidth(){return Promise.resolve(!1)}}class ve{constructor(e){if(this._estimate=0,this._totalWeight=0,e<0)throw new TypeError("Halflife must be set to a positive value.");this._weightingDecrease=Math.exp(Math.log(.5)/e)}sample(e,t){const n=Math.pow(this._weightingDecrease,e),i=t*(1-n)+n*this._estimate;isNaN(i)||(this._estimate=i,this._totalWeight+=t)}getEstimate(){return this._estimate/1-Math.pow(this._weightingDecrease,this._totalWeight)}}class ye{constructor(e=4e5){this._totalBytes=0,this._overrideBitrate=0,this._currentBandwidth=e,this._short=new ve(2),this._long=new ve(5),this._init()}_init(){if("undefined"==typeof navigator)return;const e=navigator;e.connection&&e.connection.downlink&&(this._currentBandwidth=1e6*e.connection.downlink,this._onConnectionChange=this._onConnectionChange.bind(this),e.connection.addEventListener("change",this._onConnectionChange))}_onConnectionChange(e){const t=e.target.downlink||0;this._setBandwidth(t)}_setBandwidth(e){this._currentBandwidth=1e6*e}getBandwidthEstimate(){if(this._overrideBitrate)return this._overrideBitrate;if(this._totalBytes<128e3)return this._currentBandwidth;const e=this._short.getEstimate(),t=this._long.getEstimate();return Math.min(e,t)}sample(e,t){if(e<16e3)return;const n=t/1e3,i=8*e/n;this._totalBytes+=e,this._short.sample(n,i),this._long.sample(n,i)}overrideBitrate(e){this._overrideBitrate=e<=0?0:e}}var Ee;!function(e){e.SHOWING="showing",e.HIDDEN="hidden"}(Ee||(Ee={}));const be=Array.prototype.slice,Se="function"==typeof Array.from?e=>Array.from(e):e=>be.call(e);function Ae(e,t){const n=Se(e.getElementsByTagName(t));for(const t of n)e.removeChild(t)}function Te(e){const t=e;return{id:t.id,text:t.text}}const Oe="visible",Ie="hidden",Ce=/^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$/;class Ne extends d.vp{constructor(e){super(),this._isVisible=!1,this._player=null,this._crossOrigin=null,this._currentVideoContent=null,this._unsubscribers=[],this._displayedCues=[],this._deactivateListeners=!1,this._activeLanguage=void 0,this._preferredLanguage=e.language.toLowerCase(),e.deactivateListeners&&(this._deactivateListeners=!0),this._onEnter=this._onEnter.bind(this),this._onExit=this._onExit.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),this.setPlayer(e.player)}_subscribeToCueEvents(e){var t;const{track:n}=e;if(!n)throw new Error("No track");if(n.mode=this._isVisible?Ee.SHOWING:Ee.HIDDEN,null===(t=n.cues)||void 0===t?void 0:t.length){this._displayedCues=n.activeCues?Array.from(n.activeCues):[],this._emitDisplayedCues();for(let e=0;e{t.removeEventListener("enter",this._onEnter),t.removeEventListener("exit",this._onExit)})))}}else{const t=()=>{this._subscribeToCueEvents(e),e.removeEventListener("load",t)};e.addEventListener("load",t)}}_unsubscribeFromCueEvents(){this._unsubscribers.forEach((e=>e())),this._unsubscribers=[]}_onEnter(e){const t=e.target;this._displayedCues.indexOf(t)>-1||(this._displayedCues.push(t),this._emitDisplayedCues())}_onExit(e){const t=e.target,n=this._displayedCues.indexOf(t);n>-1&&(this._displayedCues.splice(n,1),this._emitDisplayedCues())}_emitDisplayedCues(){this.emit(i.PLAYER_DISPLAYED_CUES_CHANGED,{cues:this._displayedCues.map(Te)})}_updateVisibleState(){var e,t;if(!this._player)return;const n=this.getActiveLanguage();Array.from(null!==(t=null===(e=this._player)||void 0===e?void 0:e.querySelectorAll("track"))&&void 0!==t?t:[]).forEach((e=>{e.style.visibility=this._isVisible?Oe:Ie}));const i=this._player.textTracks;for(let e=0,t=i.length;e=1?this._onLoadedMetadata():this._currentVideoContent&&e.addEventListener(i.MEDIA_LOADEDMETADATA,this._onLoadedMetadata))}_onLoadedMetadata(){const e=this._player;if(!e)return;if(Ae(e,"track"),!this._currentVideoContent)return;e.crossOrigin="anonymous";const t=this._updateActiveLanguage();for(const{lang:n,url:i}of this._currentVideoContent.getSubtitles()){const o=n.toLowerCase()===t,r=document.createElement("track");r.label=`${n} subtitles`,r.kind="subtitles",r.srclang=n,r.src=i,r.default=o,r.style.visibility=this._isVisible?Oe:Ie,e.appendChild(r),o&&!this._deactivateListeners&&this._subscribeToCueEvents(r)}}_updateActiveLanguage(){if(!this._player||!this._currentVideoContent)return void(this._activeLanguage=void 0);const e=this._currentVideoContent.getSubtitleLanguages(),t=this._preferredLanguage.split("-")[0];let n=null;for(const i of e){const e=i.toLowerCase();if(e===this._preferredLanguage)return this._activeLanguage=e,this._activeLanguage;e.split("-")[0]===t&&null===n&&(n=e)}return this._activeLanguage=null!=n?n:"en-us",this._activeLanguage}getActiveLanguage(){if(this._player&&this._currentVideoContent)return this._activeLanguage}setVideoContent(e){this._unsubscribeFromCueEvents(),this._displayedCues=[],this._currentVideoContent=e,e||this.clear(),this._updateTextTracks()}setPlayer(e){var t;const n="VIDEO"===(null==e?void 0:e.tagName)?e:null;this._player!==n&&this.clear(),this._player=n||null,this._crossOrigin=null!==(t=null==n?void 0:n.crossOrigin)&&void 0!==t?t:null,this._updateTextTracks()}getAvailableLanguages(){var e,t;return null!==(t=null===(e=this._currentVideoContent)||void 0===e?void 0:e.getSubtitleLanguages())&&void 0!==t?t:[]}setLanguage(e){if(!e.length)throw new TypeError("Argument `code` must be a non-empty string. Hide subtitles using `hideSubtitles()`.");if(!Ce.test(e))throw new TypeError("Argument `code` must be a valid BCP 47 formatted language code");this._preferredLanguage=e.toLowerCase(),this._updateTextTracks()}hide(){this._isVisible=!1,this._updateVisibleState()}show(){this._isVisible=!0,this._updateVisibleState()}deactivateListeners(){if(this._deactivateListeners)return;this._player&&(this._deactivateListeners=!0,this._unsubscribeFromCueEvents())}activateListeners(){this._deactivateListeners&&(this._deactivateListeners=!1,this._updateTextTracks())}areListenersActivated(){return!this._deactivateListeners}clear(){const e=this._player;e&&(this._unsubscribeFromCueEvents(),this._currentVideoContent=null,this._displayedCues=[],Ae(e,"track"),e.removeEventListener(i.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.crossOrigin=this._crossOrigin)}visible(){return this._isVisible}}class Le{constructor(e){this.bandwidthEstimator=e.bandwidthEstimator}static create(e){return new Le(e)}getSample(e,t){var n,i;const o=this.bandwidthEstimator.getBandwidthEstimate(),r=function(e,t){const n=e.length;for(let i=0;ie.video_bitrate)),height:null==s?void 0:s.video_height,width:null==s?void 0:s.video_width,resolution:null==s?void 0:s.video_resolution,contentType:pe(null!=s?s:void 0)},audio:{bitrate:null==a?void 0:a.audio_bitrate,contentType:pe(null!=a?a:void 0)}}}}const Re=u.P.forTag("playback.audio_processor");class Pe{constructor(e){this._audioContext=null,this._mediaElementSource=null,this._gainNode=null,this._nodes=[],(null==e?void 0:e.disable)?Re.info("AudioProcessor disabled"):(this._audioContext=(null==e?void 0:e.audioContext)||("undefined"!=typeof AudioContext?new AudioContext:null),this._audioContext?(this._gainNode=this._audioContext.createGain(),this._buildNodePipeline(null==e?void 0:e.nodes)):Re.warn("The AudioContext API is not supported. Any future operation related to `AudioProcessor` will be skipped."))}static create(e){return new Pe(e)}_setMediaElementSource(e){var t;this._audioContext&&(this._mediaElementSource&&(Re.info("Disconnecting previous media element source"),this._mediaElementSource.disconnect()),Re.info("Creating new media element source"),this._mediaElementSource=this._audioContext.createMediaElementSource(e)||null,this._mediaElementSource.connect(null!==(t=this._nodes[0])&&void 0!==t?t:this._audioContext.destination))}_buildNodePipeline(e=[]){var t;if(!this._audioContext)return;Re.info("Disconnecting previous nodes");const n=this._nodes;for(const e of n)e.disconnect();const i=[this._gainNode,...e];let o=null;for(const e of i)o&&o.connect(e),o=e;null===(t=i[i.length-1])||void 0===t||t.connect(this._audioContext.destination),Re.info("Node pipeline built"),this._nodes=i}setPlayer(e){var t;e&&((null===(t=this._mediaElementSource)||void 0===t?void 0:t.mediaElement)!==e?this._setMediaElementSource(e):Re.info("The new player is the same as the current player"))}setAudioGain(e=0){if(!this._gainNode)return Re.info("The default gain node is not available"),!1;const t=Math.pow(10,e/20);return this._gainNode.gain.value=t,Re.info("Main gain set to",t),!0}getAudioContext(){return this._audioContext}resume(){return this._audioContext&&"running"!==this._audioContext.state?this._audioContext.resume():Promise.resolve()}suspend(){return this._audioContext&&"suspended"!==this._audioContext.state?this._audioContext.suspend():Promise.resolve()}destroy(){var e;this._audioContext&&(null===(e=this._mediaElementSource)||void 0===e||e.connect(this._audioContext.destination)),this._nodes=[],this._audioContext=null,this._gainNode=null,this._mediaElementSource=null,Re.info("The AudioProcessor is destroyed")}}const ke=u.P.forTag("playback.media_source_manager");function De(e){if(!e)return"";const t=[];for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n]?`="${e[n]}"`:"";t.push(`${n}${i}`)}return t.length?`; ${t.join("; ")}`:""}class we extends d.vp{constructor(e){super(),this._mediaSource=null,this._sourceBuffers={},this._currentInitSegments={},this._updateQueue=[],this._codecs=[],this._playId=0,this._lastBufferClearTime=Date.now(),this._customSourceBufferParams="";const{codecs:t,customSourceBufferParams:n,disableBufferAbort:i}=e;this._codecs=t,this._customSourceBufferParams=De(n),this._disableBufferAbort=!!i,this._onSourceOpen=this._onSourceOpen.bind(this),this._onSourceClose=this._onSourceClose.bind(this),this.dequeueUpdates=this.dequeueUpdates.bind(this),e.noInit||this._init()}static create(e){return new we(e)}_init(){this._mediaSource=new MediaSource,this._mediaSource.addEventListener(i.MEDIA_SOURCE_OPEN,this._onSourceOpen),this._mediaSource.addEventListener(i.MEDIA_SOURCE_CLOSE,this._onSourceClose),this._sourceBuffers={},this._currentInitSegments={}}_onSourceOpen(){var e;ke.info("MediaSource opened.");const t=this._mediaSource;if(0===(null===(e=null==t?void 0:t.sourceBuffers)||void 0===e?void 0:e.length)&&"open"===(null==t?void 0:t.readyState)){ke.info("Creating source buffers for codecs",this._codecs);for(const e of this._codecs){const n=t.addSourceBuffer(e+this._customSourceBufferParams);n.addEventListener(i.SOURCE_BUFFER_UPDATE_END,this.dequeueUpdates),this._sourceBuffers[e]=n}}this.dequeueUpdates(),this.emit(i.BUFFER_SOURCE_OPEN,null)}_onSourceClose(){ke.info("MediaSource closed."),this._destroySourceBuffers(),this.emit(i.BUFFER_SOURCE_CLOSE,null)}_destroySourceBuffers(){const e=this._mediaSource;if(!e)return;const t=e.sourceBuffers;if(t.length)for(let n=0,i=t.length;n{n?setTimeout(e,500):e()})).then((()=>{this.emitSync(i.FRAGMENT_APPENDED,e.fragment),this.dequeueUpdates()})).then((()=>{e.init&&this._updateQueue.push(e)}))}this.emitSync(i.FRAGMENT_APPENDED,e.fragment);const a=r.byteLength>e.buffer.byteLength;(e.fragment.init||a)&&(this._currentInitSegments[e.codec]=e.profileId),null===(n=e.resolve)||void 0===n||n.call(e,!0),a?ke.info(`Injected combined init segment and playable segment (${e.codec}, ${e.profileId})`):e.init&&ke.info(`Injected individual init segment (${e.codec}, ${e.profileId})`)}_abortUpdate(e){var t;"fragment"in e&&this.emitSync(i.FRAGMENT_APPENDED,e.fragment),null===(t=e.resolve)||void 0===t||t.call(e,!1),Promise.resolve().then(this.dequeueUpdates)}dequeueUpdates(){const e=this._updateQueue.shift();e&&this.tryUpdate(e)}tryUpdate(e){if(e.playId!==this._playId)return ke.info("Try update dropped: playId has changed"),void this._abortUpdate(e);if(e.timestamp{this.tryUpdate({playId:this._playId,timestamp:Date.now(),type:"duration",duration:e,resolve:t})}))}getMediaSource(){return this._mediaSource}setPlayId(e){this._playId=e}getPlayId(){return this._playId}}const Me=u.P.forTag("playback.content_buffer");var xe;function Ue(){}!function(e){e[e.AUDIO=10]="AUDIO",e[e.VIDEO=20]="VIDEO"}(xe||(xe={}));class Ve extends d.vp{constructor(e,t=[],n={}){super(),this._appendingFragments=[],this._tracker=e;const{customSourceBufferParams:o,noInit:r,disableBufferAbort:a}=n;this._mediaSourceManager=we.create({codecs:t,noInit:r,customSourceBufferParams:o,disableBufferAbort:a}),this._removeAppendingFragment=this._removeAppendingFragment.bind(this),this._mediaSourceManager.on(i.FRAGMENT_APPENDED,(({data:e})=>this._removeAppendingFragment(e))),this.proxyEmitAll(this._mediaSourceManager,{[i.BUFFER_SOURCE_OPEN]:i.BUFFER_SOURCE_OPEN,[i.BUFFER_SOURCE_CLOSE]:i.BUFFER_SOURCE_CLOSE,[i.BUFFER_QUOTA_EXCEEDED]:i.BUFFER_QUOTA_EXCEEDED})}static create(e,t=[],n={}){return new Ve(e,t,n)}_trackBufferingProgress(e){e.audio&&e.audio.buffer&&this._tracker.trackBytesDownloaded(e.audio.buffer.byteLength),e.video&&e.video.buffer&&this._tracker.trackBytesDownloaded(e.video.buffer.byteLength)}_checkStalling(e,t,n){var o,r;const a=t.byteRanges.video?t.byteRanges.video.start:null!==(r=null===(o=t.byteRanges.audio)||void 0===o?void 0:o.start)&&void 0!==r?r:-1;var s;e>9e3&&this.emit(i.BUFFER_STALLED,{byteStart:a,timeStart:(s=t.timeStart,Math.ceil(1e3*s)),stallAmount:e-9e3,didTimeout:n})}_removeAppendingFragment(e){if(!e)return;const t=this._appendingFragments,n=t.indexOf(e);-1!==n&&t.splice(n,1)}dequeueUpdates(){this._mediaSourceManager.dequeueUpdates()}appendFragment(e,t,n=!1){if(-1!==this._appendingFragments.indexOf(t))return Promise.resolve([]);this._appendingFragments.push(t),this.emit(i.BUFFERING_START,null);const o=Date.now(),r=this._mediaSourceManager.getPlayId(),a=e.toLogJSON();return e.getBufferForFragment(t).then((e=>{var a,s,c,l,u,d;return this._trackBufferingProgress(e),r!==this._mediaSourceManager.getPlayId()?(Me.info("Append fragment dropped: playId has changed."),[]):(n||this._checkStalling(Date.now()-o,t,!1),null!==(null===(a=e.audio)||void 0===a?void 0:a.bandwidth)&&this._tracker.trackBufferURL((null===(s=e.audio)||void 0===s?void 0:s.bufferURL)||"",{bandwidth:(null===(c=e.audio)||void 0===c?void 0:c.bandwidth)||0}),null!==(null===(l=e.video)||void 0===l?void 0:l.bandwidth)&&this._tracker.trackBufferURL((null===(u=e.video)||void 0===u?void 0:u.bufferURL)||"",{bandwidth:(null===(d=e.video)||void 0===d?void 0:d.bandwidth)||0}),this.emit(i.BUFFERING_END,null),this._mediaSourceManager.appendBufferData(e,t,r,o))})).catch((e=>(this._removeAppendingFragment(t),n||this._checkStalling(Date.now()-o,t,!0),this.emit(i.BUFFER_APPEND_ERROR,{error:e,canPlayNext:!0,track:a}),Promise.reject(e))))}abort(e=!1){this._appendingFragments=[],this._mediaSourceManager.abort(e)}getMediaSource(){return this._mediaSourceManager.getMediaSource()}destroy(){this._mediaSourceManager.destroy()}progress(e,t,n){const i=this._mediaSourceManager.getMediaSource();if(!i)return;const o="video"===e.getMediaType()?xe.VIDEO:xe.AUDIO;if("open"===i.readyState||"ended"===i.readyState){let r;const a=function(e,t){var n;const i=null===(n=e.sourceBuffers[e.sourceBuffers.length-1])||void 0===n?void 0:n.buffered;if(i){let e,n;for(let o=0;oi.duration)return void("open"===i.readyState&&this._mediaSourceManager.endOfStream());const s=e.getFragmentLength();Math.ceil(n/s)>Math.floor(a.end/s)&&(r=e.getFragmentForTime(n),r&&this.appendFragment(e,r,t).catch(Ue));const c=Math.floor(a.end-n);if(c>o)return;const l=Math.min(e.getFragmentLength(),o-c);if(l<1)return;const u=Math.floor(a.end+l);r=e.getFragmentForTime(u),r?this.appendFragment(e,r,t).catch(Ue):this._mediaSourceManager.endOfStream()}else if(r=e.getFragmentForTime(n),r){if(this.appendFragment(e,r,t).catch(Ue),r.timeEnd{t.emeManager=e;const n=new Ye(t);return t.preinitMediaElement?n._preinitMediaElement():n})).catch((n=>{if(e.enableWithoutEME)return Ye.createWithOptions(t);throw n}))}static createWithOptions(e){return new Promise((t=>{const n=new Ye(e);t(e.preinitMediaElement?n._preinitMediaElement():n)}))}_init(){this._disableCache&&Fe.info("Cache disabled."),this._transport.on(this._transport.EVENT_CONNECTION_OFFLINE,this._onNavigatorOffline),this.proxyEmitAllSync(this._tracker,{[i.TRACKER_TRACKING_DATA_CREATED]:i.PLAYER_TRACKING_DATA_CREATED,[i.TRACKER_TRACKING_DATA_FINALIZED]:i.PLAYER_TRACKING_DATA_FINALIZED,[i.TRACKER_PLAYBACK_START]:i.PLAYER_PLAYBACK_START}),this._tracker.on(i.TRACKER_PLAYED_THRESHOLD_REACHED,this._onPlayedThresholdReached),this._emeManager&&this._emeManager.addListeners({[i.EME_LICENSE_REQUEST_CAPPED]:this._onLicenseRequestCapped,[i.EME_LICENSE_REQUEST_ERROR]:this._onLicenseRequestError}),this._bufferManager.addListeners({[i.BUFFER_APPEND_ERROR]:this._onBufferError,[i.BUFFER_QUOTA_EXCEEDED]:this._onQuotaExceeded}),this.proxyEmitAll(this._bufferManager,{[i.BUFFER_STALLED]:i.PLAYER_BUFFER_STALLED}),this._mediator.addListeners({[c.FRAGMENT_FETCHED]:this._onFragmentFetched,[c.VIDEO_PROFILE_CHANGED]:this._onProfileChanged}),this.proxyEmitAll(this._mediator,{[c.FRAGMENT_FETCH_ERROR]:i.PLAYER_FRAGMENT_FETCH_ERROR,[c.SUBTITLE_LANGUAGES_LOADED]:i.PLAYER_SUBTITLE_LANGUAGES_LOADED}),this.proxyEmitSync(this._subtitleManager,i.PLAYER_DISPLAYED_CUES_CHANGED,i.PLAYER_DISPLAYED_CUES_CHANGED),this.proxyEmitAll(this._videoResolver,{[i.VIDEO_MANIFEST_RESOLVED]:i.PLAYER_VIDEO_MANIFEST_RESOLVED,[i.VIDEO_MANIFEST_RESOLVE_FAILED]:i.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED})}_onRateChange(){this._player&&(this._tracker.trackSpeedChanged(this._player.playbackRate),this.emit(i.PLAYER_PLAYBACK_SPEED_CHANGED,{playback_speed:this._player.playbackRate}))}_onLicenseRequestError(e){if(e.data.playId!==this._playId)return;const t=this._currentContent;if(!t)return;const n=e.data.error;n.shouldRefreshEndpoint&&this._licenseURLResolver.remove(t.getKeySystem(),t.getMediaType()),this._emitError(n,!n.unrecoverable,t.toLogJSON())}_onFragmentFetched(e){const{data:t}=e;this._tracker.trackFragment(t),this.emit(i.PLAYER_FRAGMENT_FETCHED,t)}_onProfileChanged(e){const{data:t}=e;this._tracker.trackProfileChanged(t.profile),this.emit(i.PLAYER_VIDEO_PROFILE_CHANGED,t)}_onLicenseRequestCapped(e){if(e.data.playId!==this._playId)return;this._currentContent&&(this.pause(),this.emit(i.PLAYER_CAPPED,null))}_shouldNextErrorBeFatal(){const e=this._currentContent;if(!e)return!1;if(e.isAd()||!e.isProtected())return!1;if(!this._player)return!1;const t=this._player.error;if(!(t&&t instanceof MediaError))return this._fatalOnNextError=!1,!1;switch(t.code){case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:case MediaError.MEDIA_ERR_DECODE:return!0;default:return!1}}_onNavigatorOffline(){this._tracker.trackNavigatorOffline()}_onBufferError(e){this._emitError(e.data.error,e.data.canPlayNext,e.data.track)}_addPlayerEvents(e){e.addEventListener(i.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.addEventListener(i.MEDIA_PLAY,this._onPlay),e.addEventListener(i.MEDIA_PLAYING,this._onPlaying),e.addEventListener(i.MEDIA_PAUSE,this._onPause),e.addEventListener(i.MEDIA_SEEKING,this._onSeeking),e.addEventListener(i.MEDIA_ENCRYPTED,this._onEncrypted),e.addEventListener(i.MEDIA_ENDED,this._onEnded),e.addEventListener(i.MEDIA_ERROR,this._onError),e.addEventListener(i.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.addEventListener(i.MEDIA_DURATIONCHANGE,this._onDurationChange),e.addEventListener(i.MEDIA_WAITING,this._onWaiting),e.addEventListener(i.MEDIA_CANPLAY,this._onCanPlay),e.addEventListener(i.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.addEventListener(i.MEDIA_RATECHANGE,this._onRateChange),e.addEventListener(i.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.addEventListener(i.MEDIA_RESIZE,this._onVideoResize)}_removePlayerEvents(e){e.removeEventListener(i.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.removeEventListener(i.MEDIA_PLAY,this._onPlay),e.removeEventListener(i.MEDIA_PLAYING,this._onPlaying),e.removeEventListener(i.MEDIA_PAUSE,this._onPause),e.removeEventListener(i.MEDIA_SEEKING,this._onSeeking),e.removeEventListener(i.MEDIA_ENCRYPTED,this._onEncrypted),e.removeEventListener(i.MEDIA_ENDED,this._onEnded),e.removeEventListener(i.MEDIA_ERROR,this._onError),e.removeEventListener(i.MEDIA_WAITING,this._onWaiting),e.removeEventListener(i.MEDIA_CANPLAY,this._onCanPlay),e.removeEventListener(i.MEDIA_RATECHANGE,this._onRateChange),e.removeEventListener(i.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.removeEventListener(i.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.removeEventListener(i.MEDIA_DURATIONCHANGE,this._onDurationChange),e.removeEventListener(i.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.removeEventListener(i.MEDIA_RESIZE,this._onVideoResize)}_recreateMediaElement(e,t,n,o){if(t!==this._playId)return Fe.info("Recreate player dropped: playId has changed."),Promise.resolve(!1);const r=this._player;if(r){if(!this._newElementPerTrack&&("AUDIO"!==r.tagName||"video"!==n)){let t=!0;for(const n of e)if('audio/mp2t;codecs="mp4a.40.2"'!==n&&!r.canPlayType(n)){t=!1;break}if(t)return Fe.info("Reusing media element."),e.join(",")===this._activeCodecs.join(",")&&!this._newBufferPerTrack||o||(Fe.info("Recreating buffer."),this._bufferManager.recreate(e),this._activeCodecs=e),Promise.resolve(!0)}this._removePlayerEvents(r),r.pause(),this._emeManager&&this._emeManager.removeMediaKeys(r).catch((function(e){Fe.warn("Failed to remove media keys.",e)})),this._player=null;const t=this._getContainerElement(this._videoPlayerContainer);t&&r.parentNode===t&&(t.removeChild(r),this.emit(i.PLAYER_VIDEO_ELEMENT_REMOVED,null));const a=this._getContainerElement(this._audioPlayerContainer);a&&r.parentNode===a&&a.removeChild(r)}Fe.info("Creating new media element.");const a=this._createPlayer(n),s=this._playerVolume;return a.volume=this._cubicVolume?s*s*s:s,a.autoplay=!1,a.loop=!1,"playsInline"in a&&(a.playsInline=!0),this._player=a,this._subtitleManager.setPlayer(a),this._playerActivated=!1,this._addPlayerEvents(a),o||this._bufferManager.recreate(e),this._activeCodecs=e,Promise.resolve(!0)}_getContainerElement(e){return"string"==typeof e?document.querySelector(e):e||null}_onVideoResize(){if(!(this._player instanceof HTMLVideoElement))return;const{videoWidth:e,videoHeight:t}=this._player;this.emit(i.PLAYER_VIDEO_RESIZED,{width:e,height:t})}_onDurationChange(){const e=this._playId,t=()=>{if(!this._player)return;if(e!==this._playId)return void Fe.info("Duration changed drop: playId has changed.");const t=Ge(this._player.duration),n=Ge(this._player.currentTime);this._tracker.setActualDuration(t),this.emit(i.PLAYER_DURATION_CHANGED,{timestamp:Date.now(),position:n,duration:t})};this._loaded?t():this.once(i.PLAYER_LOAD,t)}_onPlay(){var e;if(!this._player||!this._currentContent)return;const t=Ge(this._player.currentTime);this._tracker.trackPlay(t,this._player.playbackRate),this.emit(i.PLAYER_PLAY,{timestamp:Date.now(),position:t,logData:null!==(e=this._currentContent.getLogData())&&void 0!==e?e:null})}_onPlaying(){if(!this._player)return;this._playerActivated=!0;const e=this._currentContent,t=Ge(this._player.currentTime);this._tracker.trackPlaying(t),this.emit(i.PLAYER_PLAYING,{timestamp:Date.now(),position:t,logData:e?e.getLogData():null})}_onPause(){if(!this._player)return;const e=Ge(this._player.currentTime);this._tracker.trackPaused(e);const t=this._currentContent?this._currentContent.getLogData():null;this._pauseToken=setTimeout((()=>{clearTimeout(this._syntheticEndedToken),this.emit(i.PLAYER_PAUSED,{position:e,logData:t})}),10)}_onSeeking(){this.emit(i.PLAYER_SEEKING,null),this._bufferManager.abort(this._clearBufferOnSeek),this._lastTimeUpdatePostion=0,this._onTimeUpdate()}_onRequiresDuration(){this._currentContent&&this._currentContent.isProtected()&&this._player&&(this._player.duration=this._currentContent.getCalculatedDuration())}_onQuotaExceeded(){this._player&&this._rebufferOnQuotaExceeded&&(Fe.info("Exceeded quota: rebuffering current track."),this._bufferManager.abort(!0),this._player.currentTime=this._player.currentTime,this._onTimeUpdate())}_onEncrypted(e){Fe.info("Got Encrypted event");this._currentContent&&this.emitSync(i.INTERNAL_ENCRYPTED,{initData:e.initData,fromPolyfill:!!e.fromPolyfill})}_onEnded(){!this._currentContent||this._synthesizeEnded&&this._currentContent.isProtected()||(Fe.info("Native ended emitted."),this._emitEnded())}_onSyntheticEnded(){this._synthesizeEnded&&this._currentContent&&this._currentContent.isProtected()&&(Fe.info("Synthetic ended emitted."),this._emitEnded())}_onError(){if(!this._player)return;const e=this._player.error;let t,n=!1;const i=this._currentContent;let o,a,s,c=!1;i&&(n=i.isProtected(),t=i.toLogJSON(),c=i.isAd(),i.clearCachedBuffers());let l=!0;const u=!i||c||!this._fatalOnNextError,d=e&&e.msExtendedCode?`0x${(e.msExtendedCode>>>0).toString(16).toUpperCase()}`:null,p=`data:${(null==t?void 0:t.fileId)||"unknown"}`;if(e instanceof MediaError){switch(e.code){case MediaError.MEDIA_ERR_ABORTED:o=r.MEDIA_ABORTED,a="Media aborted.";break;case MediaError.MEDIA_ERR_NETWORK:o=r.MEDIA_NETWORK_ERROR,a="Network error.";break;case MediaError.MEDIA_ERR_DECODE:o=r.MEDIA_DECODING_ERROR,a="Media decoding error.",l=u;break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:o=r.MEDIA_NOT_SUPPORTED,a="Media not supported.",l=u;break;default:o=r.PLAYER_MEDIA_ERROR,a="Media error.",s=!0}a+=` (${e.message||d||p||e.toString()})`}else o=r.PLAYER_PLAYBACK_ERROR,a="Error message undefined",s=!0;this._bufferManager.abort(!0);const h=new f(o,a);l||(h.unrecoverable=!0),h.listPlayerIgnore=c,h.debug.src_url=p,h.debug.protected=n,h.debug.extendedCode=d,h.debug.rawExCode=e&&e.msExtendedCode||null,s&&e&&(h.debug.nativeCode=e.code||null,h.debug.errorData=e),this._emitError(h,l,t)}_onLoadedMetadata(){this.emitSync(i.INTERNAL_PLAYER_LOADED_METADATA,null)}_onCanPlay(){this._buffering=!1,this.emitSync(i.INTERNAL_PLAYER_CANPLAY,null),this.emit(i.PLAYER_FIRST_BYTES,null)}_onCanPlayThrough(){this.emitSync(i.INTERNAL_PLAYER_CANPLAYTHROUGH,null)}_onWaiting(){clearTimeout(this._syntheticEndedToken);const e=this._player;if(!e||!this._currentContent)return;const t=e.seeking;this._buffering=!0;const n=this._currentContent.canLowerBitrate(),o=this._tracker;this.emit(i.PLAYER_BUFFERING_START,Object.assign({position:Ge(e.currentTime),msPlayed:this._tracker.getMSPlayed(),canLowerBitrate:n,seeking:t},o.getStallsInformation())),this._getBufferingLatency().then((r=>{t||this._tracker.trackMsStalled(r),this.emit(i.PLAYER_BUFFERING_END,Object.assign({position:Ge(e.currentTime),msPlayed:this._tracker.getMSPlayed(),canLowerBitrate:n,msStalled:r,seeking:t},o.getStallsInformation()))}))}_onPlayedThresholdReached(e){this._currentContent&&this._player&&this.emit(i.PLAYER_PLAYED_THRESHOLD_REACHED,{played:e.data.played,threshold:e.data.threshold,position:Ge(this._player.currentTime)})}_emitEnded(){this._currentContent&&"video"===this._currentContent.getMediaType()&&this.emit(i.PLAYER_ENDED_VIDEO,null),clearTimeout(this._pauseToken),this.emit(i.PLAYER_ENDED,null)}_emitError(e,t,n){Fe.error("Player Error",e,n,t),this._tracker.setHadError(!0),!this._disableCache&&n&&n.fileId&&this._cache.remove(n.fileId),this.emit(i.PLAYER_ERROR,{playId:this._playId,error:e,track:n,canPlayNext:t,position:this._player?Ge(this._player.currentTime):0})}_emitWarning(e,t){Fe.error("Player Warning",e,t,!0),this._tracker.trackWarning(),this.emit(i.PLAYER_WARNING,{playId:this._playId,error:e,track:t,canPlayNext:!0,position:this._player?Ge(this._player.currentTime):0})}_prepareMediaElement(e,t){return t===this._playId&&this._upcomingContent?this._recreateMediaElement(this._upcomingContent.getPlayableCodecs(),t,this._upcomingContent.getMediaType(),this._upcomingContent.getKeySystem()===o.FAIRPLAY).then((n=>{var i;if(!n||t!==this._playId)return Fe.info("Loading content dropped after recreate: playId has changed."),Promise.resolve(!1);this._player.playbackRate=(null===(i=this._loadingOptions)||void 0===i?void 0:i.useDefaultPlaybackSpeed)?1:this._playerSpeed;const o=this._player;return"VIDEO"===(null==o?void 0:o.tagName)&&(e.poster?o.poster=e.poster:o.removeAttribute("poster")),o&&this._upcomingContent&&this._upcomingContent.isProtected()&&this._emeManager&&(!o.mediaKeys||o.mediaKeys.shouldRefreshPerTrack||this._newMediaKeysPerTrack)?(Fe.info("Creating media keys"),this._emeManager.createMediaKeys(o).then((()=>!0)).catch((e=>(e.unrecoverable=!0,this._emitError(e,!1,this._upcomingContent?this._upcomingContent.toLogJSON():void 0),Promise.reject(e))))):Promise.resolve(!0)})):(Fe.info("Loading content dropped: playId has changed."),Promise.resolve(!1))}_handleLoadingComplete(e){const t=this._currentContent&&this._currentContent.getMediaType(),n=this._getContainerElement("video"===t?this._videoPlayerContainer:this._audioPlayerContainer);return n&&this._player&&this._player.parentNode!==n&&(n.appendChild(this._player),"video"===t&&this.emit(i.PLAYER_VIDEO_ELEMENT_APPENDED,null)),this._upcomingContent=null,e}_handleLoadingError(e,t,n,o){if(this._upcomingContent=null,n!==this._playId)return Promise.resolve(!1);if(this._tracker.trackLoadFailed(),this.emit(i.PLAYER_LOADING_FAILED,{uri:e,logData:t.logData}),o){const n=o.track||{uri:e,fileId:t.fileId,format:t.format,deviceId:t.logData.deviceId};this._emitError(o,"StorageError"!==o.name||!!o.canPlayNext,n)}return Promise.reject(o)}_handleLoadedMetadata(e,t,n){if(e!==this._playId)return void Fe.info("LoadedMetadata operations dropped: playId has changed.");this._loaded=!0;const o=this._player;if(!o)return;this._bufferManager.dequeueUpdates();const r=n.position>o.duration?0:n.position;this._lastTimeUpdatePostion=0,(isNaN(o.currentTime)||o.currentTime{this._onTimeUpdate()}));let a=()=>{o.currentTime{if(o.currentTimee(this._player&&this._player.play()))).catch((e=>{if(e){if("NotSupportedError"===e.name)return Promise.reject(e);if("NotAllowedError"===e.name)return this.emit(i.PLAYER_AUTOPLAY_FAILED,null),Promise.reject(e)}return this._player?this._player.play():Promise.resolve()})).catch((()=>{this._onPause()}))}),o.readyState>2?(Fe.info("Ready to play, triggering play."),a()):(Fe.info("Waiting to be playable."),this.once(i.INTERNAL_PLAYER_CANPLAY,a))}_handleCanPlayThrough(e){e===this._playId?this._tracker.trackCanPlayThrough():Fe.info("CanPlayThrough operations dropped: playId has changed.")}_loadContent(e,t){if(t!==this._playId||!this._upcomingContent)return Fe.info("Loading content dropped: playId has changed."),Promise.resolve(!1);if(!this._player)throw new f(r.PLAYER_INVALID_INTERNAL_STATE,"Cannot load content without an HTMLMediaElement");this._canPreloadEmitted=!1;const n=this._upcomingContent;this._upcomingContent=null,this._currentContent=n,this._setAudioGain(n),this._subtitleManager.setVideoContent(n instanceof he?n:null);const a=e.callback;a&&this.once(i.PLAYER_LOAD,(()=>{this._playId&&t===this._playId?a():Fe.info("Load content event dropped: playId has changed.")})),this.once(i.INTERNAL_PLAYER_LOADED_METADATA,this._handleLoadedMetadata.bind(this,t,this._currentContent.getLogData(),e)),this.once(i.INTERNAL_PLAYER_CANPLAYTHROUGH,this._handleCanPlayThrough.bind(this,t));let s=e.position;const c=n.getCalculatedDuration();c&&s>c&&(s=e.position=0);try{this._player.currentTime=s}catch(e){Fe.warn("Cannot set initial position before loading.",e)}const l=n.isProtected();return this._tracker.setProtected(l),n.getKeySystem()===o.FAIRPLAY?n instanceof _e&&!l?Promise.resolve(this._loadUnprotectedTrack()):Promise.resolve(this._loadHLSProtectedTrack(e,t)):n instanceof he?this._loadVideoTrack(e,t):l?this._loadProtectedTrack(e,t):Promise.resolve(this._loadUnprotectedTrack())}_getBufferingLatency(){return new Promise((e=>{if(!this._player)return void e(0);const t=Date.now();this._player.addEventListener("canplaythrough",(function n(){this.removeEventListener("canplaythrough",n),e(Date.now()-t)}))}))}_loadVideoTrack(e,t){if(!(this._player&&this._currentContent&&this._currentContent instanceof he))return Promise.resolve(!1);const n=this._currentContent;Fe.info("_loadVideoTrack");const o=()=>{this._currentContent&&this._currentContent.isProtected()&&this._requestLicense(t).then((()=>{this._playId===t&&(this._licenseRequested=!0,this._disableBufferingBeforeLicense&&this._onTimeUpdate())}))};this._disableLicensePrefetch?this.once(i.INTERNAL_ENCRYPTED,o):this._bufferManager.once(i.BUFFER_SOURCE_OPEN,o);const a=this.getMediaSource();if(!a)throw new f(r.PLAYER_INVALID_INTERNAL_STATE,"No media source.");this._player.src=URL.createObjectURL(a);const s=n.getVideoProfile(),c=n.getAudioProfile();return c||s?(this._tracker.trackVideoLoadStart({bitrate:null==s?void 0:s.video_bitrate,audioProfile:null!=c?c:void 0,videoProfile:null!=s?s:void 0}),this._tracker.trackBufferLoadStart(),this._bufferManager.setDuration(n.getCalculatedDuration()).then((()=>this._bufferManager.appendFragment(n,n.getInitFragment()))).then(this._onAppendedHeadSegment(t))):Promise.resolve(!1)}_loadHLSProtectedTrack(e,t){if(Fe.info("Load HLS Protected Track"),!this._player||!this._currentContent)return!1;const n=this._currentContent.getResolvedURL();if(!n)throw new h(r.FILE_NOT_RESOLVED,"Cannot load HLS protected track: File not resolved.");const o=e=>{e.data.fromPolyfill&&(this.removeListener(i.INTERNAL_ENCRYPTED,o),this._requestLicense(t,{initData:e.data.initData}))};this.on(i.INTERNAL_ENCRYPTED,o);const a=this._currentContent;if(a instanceof he){const e=a.getVideoProfile(),t=a.getAudioProfile();this._tracker.trackVideoLoadStart({bitrate:null==e?void 0:e.video_bitrate,audioProfile:null!=t?t:void 0,videoProfile:null!=e?e:void 0})}this._tracker.trackBufferLoadStart(),this._tracker.trackBufferURL(n,{bandwidth:0});const s=document.createElement("source");return s.src=this._currentContent.getHLSURL(),s.type=Z,this._player.appendChild(s),this._player.load(),!0}_loadUnprotectedTrack(){if(!this._player||!this._currentContent)return!1;const e=this._currentContent.getResolvedURL();return!!e&&(Fe.info("_loadUnprotectedTrack",this._currentContent.getURI()),this._tracker.trackBufferLoadStart(),this._tracker.trackBufferURL(e,{bandwidth:0}),this._player.src=e,this._player.load(),!0)}_onAppendedHeadSegment(e){return()=>e===this._playId&&(this._player&&this._player.spload&&this._player.spload(),Fe.info("Head segment appended."),!0)}_loadProtectedTrack(e,t){if(!(this._currentContent&&this._player&&this._currentContent instanceof _e))return Promise.resolve(!1);const n=this._currentContent;Fe.info("_loadProtectedTrack",n.getURI());const o=()=>this._requestLicense(t).then((()=>{this._playId===t&&(this._licenseRequested=!0,this._disableBufferingBeforeLicense&&this._onTimeUpdate())}));this._disableLicensePrefetch?this.once(i.INTERNAL_ENCRYPTED,o):this._bufferManager.once(i.BUFFER_SOURCE_OPEN,o);const a=this.getMediaSource();if(!a)throw new f(r.PLAYER_INVALID_INTERNAL_STATE,"No media source.");this._player.src=URL.createObjectURL(a),this._tracker.trackBufferLoadStart();const s=n.getFragmentForTime(e.position);let c=null;return s===n.getFirstFragment()?(Fe.info("Appending combined init and playable fragment."),c=this._bufferManager.appendFragment(n,n.getHeadFragment())):(Fe.info("Appending split init and playable fragment."),c=this._bufferManager.appendFragment(n,s)),c.then(this._onAppendedHeadSegment(t)).then((()=>Promise.resolve(t===this._playId)))}_requestLicense(e,t={}){if(e!==this._playId){const e="Request license dropped: playId has changed.";return Fe.info(e),Promise.resolve(!1)}if(!this._player||!this._currentContent||!this._emeManager)return Promise.resolve(!1);const n=Date.now(),o=this._player.mediaKeys,r=this._currentContent,a=r.getFileId(),s=r.getLogData(),c=r.toLogJSON(),l=r.getKeySystem(),u=r.getLicenseEndpoint();let d;if(u)d=Promise.resolve(u);else{if(!a)return Promise.reject(new TypeError("Missing: fileId or licenseEndpoint"));d=this._licenseURLResolver.get(l,r.getMediaType()).then((e=>e.replace(/\{contentId\}/,a)))}const p=this._emeManager,f=this._tracker;return f.setKeySystem(l),f.setKeySystemImpl(p.getKeySystemImpl()),Promise.all([d,r.getInitParams()]).then((([i,r])=>{f.setLicenseSessionLatency(Date.now()-n);const a=r.initDataType,s=t.initData||r.initData;if(o&&s&&a){const t=Object.assign(Object.assign({},r),{playId:e,initData:s,mediaKeys:o,licenseServer:i,initDataType:a});return p.createSessionWithParams(t)}return Promise.resolve(!1)})).then((t=>{if(e!==this._playId)return Fe.info("License tracking dropped: playId has changed."),Promise.resolve(!1);"boolean"!=typeof t&&"elapsed"in t&&(f.setLicenseGenerationLatency(t.elapsed.generate),f.setLicenseRequestLatency(t.elapsed.request),f.setLicenseUpdateLatency(t.elapsed.update));const o=Date.now()-n;return f.setKeyLatency(o),this.emit(i.PLAYER_KEY_RECEIVED,{requestTime:o,logData:s}),Fe.info("License updated."),Promise.resolve(!0)})).catch((t=>{if(!t||e!==this._playId)return Promise.resolve(!1);const n=!t||!("canPlayNext"in t)||t.canPlayNext;return this._emitError(t,n,c),Promise.reject(t)}))}_onTimeUpdate(){var e;if(!this._loaded||!(null===(e=this._player)||void 0===e?void 0:e.readyState)||!this._currentContent)return;const t=this._currentContent,n=this._player.seeking,r=this._player.currentTime,a="video"===t.getMediaType();if(t.isProtected()&&this._disableBufferingBeforeLicense&&!this._licenseRequested)return void Fe.log("Dropping time update event: buffering before license disabled.");if(!n&&this._lastTimeUpdatePostion&&this._lastTimeUpdatePostion===r)return void Fe.warn("Dropping duplicate time update.");this._lastTimeUpdatePostion=n?0:r,t.getKeySystem()!==o.FAIRPLAY&&(a||t.isProtected())&&this._bufferManager.progress(t,n,r);const s=this._player.duration,c=Ge(r),l=t.getLogData();n?(this._tracker.trackPositionChanged(c),this.emit(i.PLAYER_POSITION_CHANGED,{position:c,logData:l})):(this._tracker.trackProgress(c,"getCurrentBitrate"in t?t.getCurrentBitrate():0),this.emit(i.PLAYER_PROGRESS,{timestamp:Date.now(),position:c,played:this._tracker.getMSPlayed(),interval:500,logData:l})),!this._canPreloadEmitted&&s-r<=10?(this._canPreloadEmitted=!0,this.emit(i.PLAYER_CAN_PRELOAD,null)):this._canPreloadEmitted=!1,clearTimeout(this._syntheticEndedToken),this._synthesizeEnded&&t.isProtected()&&this._isPlaying()&&(this._syntheticEndedToken=setTimeout(this._onSyntheticEnded,Ge(s-r)))}_isPlaying(){return!!this._player&&!this._player.paused}_createAudioContent(e,t){const n={manifestLatency:0,resolveLatency:0};return(this._emeManager?this._emeManager.getKeySystemInfo():Promise.resolve({keySystem:o.INVALID_SPOTIFY_KEY})).then((i=>_e.create({abrManager:this._abrManager,mediator:this._mediator,keySystem:i.keySystem,licenseEndpoint:t.licenseEndpoint,transport:this._transport,resolver:this._audioResolver,uri:e,fileId:t.fileId,fileFormat:t.fileFormat,format:t.format,isAd:t.isAd,resolvedURL:t.resolvedURL,noManifest:t.noManifest,preloadedManifest:t.preloadedManifest,logData:t.logData,disableCache:this._disableCache,emitWarning:this._emitWarning,audioGain:t.audioGain}).load(n))).then((e=>{const i=this._tracker;return i.setResolveLatency(n.resolveLatency),i.setManifestLatency(n.manifestLatency),e.isProtected()&&t.fileId&&!this._disableCache&&this._cache.set(t.fileId,e),e}))}_createVideoContent(e,t){const n={manifestLatency:0,resolveLatency:0},i=t.fileId;return(this._emeManager?this._emeManager.getKeySystemInfo():this.getMediaConfig().then((e=>({keySystem:o.INVALID_SPOTIFY_KEY,audioFormats:e.formatsInfo.audio,videoFormats:e.formatsInfo.video})))).then((o=>he.create({uri:e,abrManager:this._abrManager,mediator:this._mediator,resolver:this._videoResolver,keySystem:o.keySystem,licenseEndpoint:t.licenseEndpoint,fileId:i,noAuth:t.noAuth,format:s.MANIFEST_ID,isAd:t.isAd,transport:this._transport,videoFormats:o.videoFormats,videoResolution:this._videoResolution,audioFormats:o.audioFormats,disableCache:this._disableCache,disallowProfile:this._disallowProfile,allowMixedAVC1Codecs:this._allowMixedAVC1Codecs,audioGain:t.audioGain}).load(n))).then((e=>{const t=this._tracker;return t.setResolveLatency(n.resolveLatency),t.setManifestLatency(n.manifestLatency),e.isProtected()&&i&&!this._disableCache&&this._cache.set(i,e),e}))}_preinitMediaElement(){return this._player||!this._emeManager?Promise.resolve(this):this._emeManager.getKeySystemInfo().then((e=>{var t,n;const i=[];return(null===(t=e.audioFormats)||void 0===t?void 0:t[0])&&i.push(e.audioFormats[0].contentType),(null===(n=e.videoFormats)||void 0===n?void 0:n[0])&&i.push(e.videoFormats[0].contentType),!!i.length&&this._recreateMediaElement(i,this._playId,i.length>1?"video":"audio",e.keySystem!==o.FAIRPLAY)})).then((()=>this),(e=>(Fe.warn("Cannot precreate media element:",null==e?void 0:e.message),this)))}_setAudioGain(e){var t;null===(t=this._audioProcessor)||void 0===t||t.setAudioGain(e.getAudioGain())}getCodecInfo(){return{audiocodec:"mp3",bitrate:160}}getMediaSource(){return this._bufferManager.getMediaSource()}load(e,t,n){var o;const a=function(e,t){return t&&t.hasOwnProperty(e)}(t.uriProperty,e)?t.uriProperty:"uri",s=e[a];if(Fe.info("load",s),!s)return Promise.reject(new f(r.PLAYER_CANNOT_FIND_PLAYABLE_URI,"Cannot find a playable URI."));if(!e.logData)return Promise.reject(new Error("Invalid track: logging info not specified"));this.stop(e.logData,e.mediaType),this._loaded=!1,this._licenseRequested=!1,this._buffering=!0,this._currentContent=null,this._subtitleManager.setVideoContent(null);const c=++this._playId,l=this._tracker;let u;l.trackLoadStart(s,e.fileId,c.toString(),e.logData,e.metadata),this.emit(i.PLAYER_BEFORE_LOAD,{track:e,options:t,logData:e.logData,uri:s,timestamp:Date.now()}),this._bufferManager.setPlayId(c),this._loadingOptions={position:Ke(t.position||0),autoplay:!("autoplay"in t)||t.autoplay,poster:e.poster,useDefaultPlaybackSpeed:!!(null===(o=e.options)||void 0===o?void 0:o.useDefaultPlaybackSpeed),callback:n},l.setPlayIntended(this._loadingOptions.autoplay),l.setPlayedThreshold(t.playedThreshold);const d=this._cache,p="video"===e.mediaType?this._createVideoContent.bind(this,s,e):this._createAudioContent.bind(this,s,e,c);if(e.fileId){const t=e.fileId,n=this._preloadingTracks[t],i=this._disableCache?null:d.get(t);n?(Fe.info("Waiting for preloading track.",t),u=n.then((e=>(Fe.info("Preloading succeeded.",t),l.setResolveLatency(e.resolveLatency),l.setManifestLatency(e.manifestLatency),d.get(t))),(()=>(Fe.info("Preloading failed, creating new track",t),p())))):i?(Fe.info("Using cached track.",t,i),l.setMemoryCached(!0),u=Promise.resolve(i)):(Fe.info("Creating new track from fileId",t),u=p())}else Fe.info("Creating new track without fileId",e.resolvedURL),u=p();return u.then((t=>t.isProtected()&&!this._emeManager?Promise.reject(new f(r.DISALLOW_PROTECTED_TRACK_ERROR,"Protected tracks not supported")):(t.setLogData(e.logData),l.setCalculatedDuration(Ge(t.getCalculatedDuration())),this._upcomingContent=t,Promise.resolve()))).then(this._prepareMediaElement.bind(this,this._loadingOptions,c)).then((()=>{this._audioProcessor.setPlayer(this._player)})).then(this._loadContent.bind(this,this._loadingOptions,c)).then(this._handleLoadingComplete,this._handleLoadingError.bind(this,s,e,c))}preload(e){const t=!this._disableCache,n=e.uri,o=e.fileId,r=this._cache;if(!t||!o||!this._emeManager)return Promise.resolve(null);const a="video"===e.mediaType;if(!(He[e.format]&&!a)||r.get(o))return Promise.resolve(null);const s=this._preloadingTracks,c=s[o];if(c)return c;Fe.info("Preloading track",o);const l={manifestLatency:0,resolveLatency:0},u=this._emeManager.getKeySystemInfo().then((t=>_e.create({abrManager:this._abrManager,keySystem:t.keySystem,licenseEndpoint:e.licenseEndpoint,transport:this._transport,resolver:this._audioResolver,uri:n,fileId:o,format:e.format,fileFormat:e.fileFormat,isAd:e.isAd,resolvedURL:e.resolvedURL,noManifest:e.noManifest,preloadedManifest:e.preloadedManifest,logData:e.logData,disableCache:this._disableCache,emitWarning:this._emitWarning,audioGain:e.audioGain}).load(l))).then((t=>Promise.all([t,"MP4_CBCS"!==e.format?t.getBufferForFragment(t.getHeadFragment()):null]))).then((([e])=>(r.set(o,e),delete s[o],Fe.info("Cached",o),l))).catch((e=>(delete s[o],Fe.warn("Preloading error",e),this.emit(i.PLAYER_PRELOADING_ERROR,{error:e,track:e.track||null,canPlayNext:!("canPlayNext"in e)||e.canPlayNext,preloading:!0}),Promise.reject(e))));return s[o]=u,u}togglePlay(){return this._isPlaying()?this.pause():this.resume()}setSubtitleLanguage(e){this._subtitleManager.setLanguage(e)}getSubtitleLanguages(){return this._subtitleManager.getAvailableLanguages()}getActiveSubtitleLanguage(){return this._subtitleManager.getActiveLanguage()}deactivateCueEvents(){this._subtitleManager.deactivateListeners()}activateCueEvents(){this._subtitleManager.activateListeners()}setVolume(e,t){if(!this.emitSync(i.PLAYER_BEFORE_VOLUME_CHANGE,{volume:e,options:t}).defaultPrevented){if(e<0||e>1)throw new f(r.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE,"Volume should be in range [0, 1]");this._playerVolume=e,this._player&&(this._player.volume=this._cubicVolume?e*e*e:e)}}getVolume(){return this._playerVolume}getPlayerState(){var e,t,n;const i=this._player,o=this._currentContent,r={src:(null==i?void 0:i.src)?`data:${(null==o?void 0:o.getFileId())||"unknown"}`:void 0,height:(null==i?void 0:i.clientWidth)||0,width:(null==i?void 0:i.clientHeight)||0},a={};if(o){const[e,t]=o.getPlayableCodecs();a.audio_format=e,a.video_format=t,o instanceof he&&i instanceof HTMLVideoElement&&(a.video_height=i.videoHeight,a.video_width=i.videoWidth,r.poster=i.poster)}return{playing:null!==(e=!(null==i?void 0:i.paused))&&void 0!==e&&e,position:i?Ge(i.currentTime):0,duration:i?Ge(i.duration):0,volume:null!==(t=this._playerVolume)&&void 0!==t?t:1,playback_speed:null!==(n=null==i?void 0:i.playbackRate)&&void 0!==n?n:0,buffering:this._buffering,media_type:(null==o?void 0:o.getMediaType())||null,media_info:a,player_element:r}}getPlayerPosition(){return this._player?Ge(this._player.currentTime):0}seek(e){if(!this._player)return;const t=this._playId,n=()=>{if(!this._player||t!==this._playId)return void Fe.info("Seek dropped: playId has changed.");let n=Ke(e);n<0?n=0:n>=this._player.duration&&(n=this._player.duration),this._player.currentTime=n};this._loaded?n():this.once(i.PLAYER_LOAD,n),this._getBufferingLatency().then((e=>{this._tracker.trackSeekRebuffering(e)}))}pause(){return new Promise((e=>{this._player&&this._isPlaying()?e(this._player&&this._player.pause()):e()}))}resume(){return this._audioProcessor.resume().then((()=>{this._player&&!this._isPlaying()&&Promise.resolve(this._player.play())}))}stop(e,t){var n;const o=[],r=e||{};this.emit(i.PLAYER_BEFORE_STOP,{timestamp:Date.now(),logData:r}),this._tracker.trackStopped(this._player?Ge(this._player.currentTime):-1,e,this.getStatistics()||void 0),this._bufferManager.abort(!0),this._emeManager&&o.push(this._emeManager.destroySessions());const a=this._player;if(a){this._subtitleManager.clear(),this._fatalOnNextError=this._shouldNextErrorBeFatal(),this._fatalOnNextError&&Fe.warn("MediaError detected: next immediate media error will be fatal.");const e=a.src;if(e)Be.test(e)&&URL.revokeObjectURL(e),a.removeAttribute("src");else{const e=Se(a.getElementsByTagName("source"));Fe.info(`HTMLSourceElements to removed: ${e.length}`);for(const t of e)a.removeChild(t);Fe.info("Releasing HLS URLs"),null===(n=this._currentContent)||void 0===n||n.releaseHLSURL()}a.load()}if(this._currentContent&&this._disableCache&&this._currentContent.clearCachedBuffers(),a&&this._currentContent&&"video"===this._currentContent.getMediaType()){const e=this._getContainerElement(this._videoPlayerContainer);e&&a.parentNode===e&&(this._newElementPerTrack||"video"!==t)&&(this._subtitleManager.setPlayer(null),e.removeChild(a),this.emit(i.PLAYER_VIDEO_ELEMENT_REMOVED,null))}else if(a&&this._currentContent&&"audio"===this._currentContent.getMediaType()){const e=this._getContainerElement(this._audioPlayerContainer);e&&a.parentNode===e&&(this._newElementPerTrack||"audio"!==t)&&e.removeChild(a)}return this.emit(i.PLAYER_STOPPED,null),Promise.all(o).then((()=>!0))}hideSubtitles(){this._subtitleManager.hide()}showSubtitles(){this._subtitleManager.show()}areSubtitlesShown(){return this._subtitleManager.visible()}getKeySystemInfo(){return this._emeManager?this._emeManager.getKeySystemInfo():Promise.resolve(null)}getVideoVariants(){if(!(this._currentContent&&this._currentContent instanceof he))return[];const e=[],t=this._currentContent.getVideoProfiles();for(const n of t)e.push({width:n.video_width,height:n.video_height,bitrate:n.video_bitrate});return e}setPreferredBitrate(e){return"number"!=typeof e?Promise.resolve(a.INVALID):(this._preferredBitrate=e,this._currentContent&&"video"===this._currentContent.getMediaType()&&e>0&&this._bufferManager.abort(!0),this._abrManager.overrideBitrate(e),Promise.resolve(a.SUCCESS))}getCurrentBandwidth(){return this._abrManager.getBandwidthEstimate()}setBackgrounded(e){this._abrManager.overrideBitrate(e?1e-32:this._preferredBitrate)}setVideoResolution(e){this._videoResolution=Object.assign(Object.assign({},this._videoResolution),e),this._currentContent instanceof he&&this._currentContent.setVideoResolution(this._videoResolution)}activateElement(){return this._playerActivated||!this._player||this._player.src?(this._audioProcessor.resume(),!1):(this._audioProcessor.resume().then((()=>{var e;return null===(e=this._player)||void 0===e?void 0:e.load()})),this._playerActivated=!0,!0)}getMediaConfig(){return void 0===this._mediaConfig?function(e,t){const n=t||We("video"),i=e=>{n.canPlayType("audio/mp3")&&(e.formats.audio.push("audio/mp3"),e.formatsInfo.audio.push({mimeType:"audio/mp3",codec:"mp3",contentType:'audio/mp3; codecs="mp3"'}),e.supports.unprotected_audio=!0)};if(e)return e.getKeySystemInfo().then((e=>{const{audioFormats:t,videoFormats:n}=e,o={supports:{protected_audio:!!t.length,unprotected_audio:!0,protected_video:!!n.length,unprotected_video:!0},formats:{audio:t.map((e=>e.contentType)),video:n.map((e=>e.contentType))},formatsInfo:{audio:[...t],video:[...n]}};return o.keysystem=e.keySystem,o.keysystem_impl=e.keySystemImpl,i(o),o}));const o="undefined"!=typeof window&&window.MediaSource?e=>MediaSource.isTypeSupported(e):e=>"probably"===n.canPlayType(e)||"probably"===n.canPlayType(e.split(";")[0]),r=F([V[0]],o),a=[],s=[],c=[],l=[];if(r){const{audioCapabilities:e,videoCapabilities:t}=r;for(const t of e)a.push(t.contentType),c.push(H(t.contentType));for(const e of t)s.push(e.contentType),l.push(H(e.contentType))}const u={supports:{protected_audio:!1,unprotected_audio:!!a.length,protected_video:!1,unprotected_video:!!s.length},formats:{audio:a,video:s},formatsInfo:{audio:c,video:l}};return i(u),Promise.resolve(u)}(this._emeManager,this._player).then((e=>(this._mediaConfig=e,this._mediaConfig))):Promise.resolve(this._mediaConfig)}setPlaybackSpeed(e){var t;return!(!isFinite(e)||e<=0)&&(!(null===(t=this._loadingOptions)||void 0===t?void 0:t.useDefaultPlaybackSpeed)&&(this._playerSpeed=null!=e?e:1,this._player&&(this._player.playbackRate=this._playerSpeed,this._tracker.trackSpeedChanged(this._playerSpeed)),!0))}getStatistics(){return this._player&&this._currentContent?this._statistics.getSample(this._player,this._currentContent):null}getAudioProcessor(){return this._audioProcessor}}var je=n(98429);class ze extends Error{constructor(e,t){super(t),this.debug={},this.name="LoggingError",this.message=t,this.code=e}}const Je="7.21.2-8cb7697",qe="7.21.2",Xe=u.P.forTag("playback.logger");class Ze extends d.vp{constructor(e){super(),this._currentTrackingData=null,this._sequenceId=0,this._sequenceSessionStorage={},this._sessionId="0",this._transport=e.transport,this._logSender=e.logSender,this._player=e.player,this._init()}static create(e){return new Ze(e)}_init(){const e=this._player;e.on(i.PLAYER_LOAD,this._onPlayerLoad.bind(this)),e.on(i.PLAYER_ERROR,this._onError.bind(this,!1)),e.on(i.PLAYER_WARNING,this._onError.bind(this,!0)),e.on(i.PLAYER_PRELOADING_ERROR,this._onError.bind(this,!1)),e.on(i.PLAYER_TRACKING_DATA_CREATED,this._onTrackingDataCreated.bind(this)),e.on(i.PLAYER_TRACKING_DATA_FINALIZED,this._onTrackingDataFinalized.bind(this)),e.on(i.PLAYER_PLAYBACK_START,this._onPlaybackStart.bind(this))}_emitError(e,t){this.emit(i.LOGGER_ERROR,{error:e,trackingData:t})}_onError(e,t){var n,i,o;const a=t.data,s=this._currentTrackingData;if(!s||s.noLog)return;const c=a.error,l=null!==(n=null==c?void 0:c.debug)&&void 0!==n?n:{};l.position="position"in a?a.position:0;const u={track:a.track||{},debug:l,preloading:"preloading"in a&&!!a.preloading,session_id:this._sessionId,playback_id:s.playbackId||null,player_play_id:"playId"in a?a.playId:null,http_status_code:null!==(i=null==c?void 0:c.status)&&void 0!==i?i:null,license_server:null!==(o=null==c?void 0:c.licenseServer)&&void 0!==o?o:null};this._logError(c.code||r.UNKNOWN,c,u,s,e)}_onPlayerLoad(e){const t=e.data.logData;if(t)if(t.impressionURLs)for(const e of t.impressionURLs)this._logImpression(e);else t.impressionURL&&this._logImpression(t.impressionURL)}_onPlaybackStart(e){const t=e.data.trackingData;t.noLog||t.noStats||this._logPlaybackStart(t)}_onTrackingDataCreated(e){const t=e.data.trackingData;t.noLog?this._currentTrackingData=null:(this._currentTrackingData=t,this._setSessionId(),t.noTSV||this._setSequenceId())}_setSessionId(){this._sessionId=this._transport.getInitTime().toString()}_setSequenceId(){this._sessionId&&(this._sequenceId=this._getSequenceId(this._sessionId))}_onTrackingDataFinalized(e){const t=e.data.trackingData;if(t.noLog)return;const n=this._sessionId!==this._transport.getInitTime().toString();if(n&&this._setSessionId(),t.playbackId&&!t.noTSV){if(n&&this._setSequenceId(),!t.playIntended&&!t.played)return void this._rollbackSequenceId(this._sessionId);this._logTrackStreamVerification(t)}t.noStats||this._logPlaybackStats(t)}_logTrackStreamVerification(e){const t={play_track:e.currentTrackUri,playback_id:e.playbackId,ms_played:e.msPlayed,ms_nominal_played:e.msNominalPlayed,session_id:this._sessionId,sequence_id:this._sequenceId,next_playback_id:e.nextPlaybackId};Xe.debug("Logged TrackStreamVerification",t),this._logSender.logTrackStreamVerification(t).catch((n=>{const i=new ze(r.TSV_SENDING_FAILED,n.message||"Unknown reason.");this._logError(i.code,n,t,e,!1),this._emitError(i,e)}))}_logPlaybackStats(e){const t={play_track:e.currentTrackUri,file_id:e.fileId,playback_id:e.playbackId,internal_play_id:e.internalPlayId,memory_cached:e.memoryCached,persistent_cached:e.persistentCached,audio_format:e.audiocodec||"",video_format:e.videocodec||"",manifest_id:e.fileId,protected:!1,key_system:e.keySystem,key_system_impl:e.keySystemImpl,urls_json:JSON.stringify(e.urls),start_time:e.loadTime,end_time:e.stopTime,external_start_time:e.externalLoadTime,ms_play_latency:e.msPlayLatency,ms_init_latency:e.msInitLatency,ms_head_latency:e.msHeadLatency,ms_manifest_latency:e.msManifestLatency,ms_resolve_latency:e.msResolveLatency,ms_license_session_latency:e.msLicenseSessionLatency,ms_license_generation_latency:e.msLicenseGenerationLatency,ms_license_request_latency:e.msLicenseRequestLatency,ms_license_update_latency:e.msLicenseUpdateLatency,ms_played:e.msPlayed,ms_nominal_played:e.msNominalPlayed,ms_file_duration:e.msFileDuration,ms_actual_duration:e.msActualDuration,ms_metadata_duration:e.msMetadataDuration,ms_start_position:e.startPosition,ms_end_position:e.position,ms_seek_rebuffer:e.msSeekRebuffering,ms_seek_rebuffer_longest:e.maxMsSeekRebuffering,ms_stall_rebuffer:e.msStalled,ms_stall_rebuffer_longest:e.maxMsStalled,n_stalls:e.nStalls,n_rendition_upgrade:e.nRenditionUpgrade,n_rendition_downgrade:e.nRenditionDowngrade,bps_bandwidth_max:e.bpsBandwidthMax,bps_bandwidth_min:e.bpsBandwidthMin,bps_bandwidth_avg:e.bpsBandwidthAvg,n_seekback:e.nSeeksBackward,n_seekforward:e.nSeeksForward,start_bitrate:e.startBitrate||e.bitrate||0,audio_quality:e.audioQuality,time_weighted_bitrate:e.timeWeightedBitrate,reason_start:e.reasonStart,reason_end:e.reasonEnd,initially_paused:!e.playIntended,had_error:e.hadError,n_warnings:e.nWarnings,n_navigator_offline:e.nOffline,session_id:this._sessionId,sequence_id:this._sequenceId,client_id:e.clientId,correlation_id:e.correlationId,n_dropped_video_frames:e.droppedVideoFrames,n_total_video_frames:e.totalVideoFrames,resolution_max:e.maxResolution||0,resolution_min:e.minResolution||0};Xe.info("Logging PlaybackStats"),this._logSender.logJSSDKPlaybackStats(t).catch((n=>{const i=new ze(r.PLAYBACK_STATS_SENDING_FAILED,n.message||"Unknown reason.");this._logError(i.code,n,t,e,!1),this._emitError(i,e)}))}_logPlaybackStart(e){const t={play_track:e.currentTrackUri,file_id:e.fileId,playback_id:e.playbackId,session_id:this._sessionId,ms_start_position:e.startPosition,initially_paused:!e.playIntended,client_id:e.clientId,correlation_id:e.correlationId};Xe.info("Logging PlaybackStart"),this._logSender.logJSSDKPlaybackStart(t).catch((n=>{const i=new ze(r.PLAYBACK_START_SENDING_FAILED,n.message||"Unknown reason.");this._logError(i.code,n,t,e,!1),this._emitError(i,e)}))}_getSequenceId(e){let t=this._sequenceSessionStorage[e];return t||(t=0),t+1>=9007199254740991&&(t=0),this._sequenceSessionStorage[e]=t+1,t}_rollbackSequenceId(e){const t=this._sequenceSessionStorage[e];t&&(this._sequenceSessionStorage[e]=Math.max(t-1,0))}_logImpression(e){return;this._transport.request(e,{forget:!0}).catch((function(e){Xe.warn("Unable to send impression request",e)}))}_logError(e,t,n,i,o){let r="";t&&(r=t.stack||"",r||(r=t.toString()));const a={source:"playback",source_version:Je||je.eV.UNKNOWN,type:e||je.eV.UNKNOWN,message:t&&t.message||je.eV.EMPTY,stack:JSON.stringify(r),json_data:JSON.stringify(n||{}),json_data_version:"1.0.0",client_id:i.clientId,correlation_id:i.correlationId};o?this._logSender.logJSSDKWarning(a).catch((e=>Xe.warn("Failed to log warning",a,e))):this._logSender.logJSSDKError(a).catch((e=>Xe.warn("Failed to log error",a,e)))}}class Qe extends Error{constructor(e=r.STORAGE_ERROR,t="Storage Error"){super(t),this.status=-1,this.fileId="",this.debug={},this.canPlayNext=!0,this.code=e,this.message=t,this.name="StorageError"}}const $e=u.P.forTag("playback.storage_resolve");class et{constructor(e){this._transport=e}_parseResponse(e,t){var n;let i;if(200!==t.status)return i=new Qe(r.STORAGE_FAILED_WITH_STATUS,`Storage Resolve responded with ${t.status}`),i.status=t.status,i.fileId=e,Promise.reject(i);const o=t.body;if(!(null===(n=null==o?void 0:o.cdnurl)||void 0===n?void 0:n.length))return i=new Qe(r.STORAGE_RETURNED_NO_TRACKS,`Storage Resolve returned no tracks for fileId ${e}`),i.fileId=e,Promise.reject(i);const a={uri:o.cdnurl[0],uris:o.cdnurl,protection:"cenc"};return Promise.resolve(a)}getCDNURL(e,t){$e.info("Requesting CDN URL for ",e);const n="files/audio/interactive",i=`@webgate/storage-resolve/${t?`v2/${n}/${t}/${e}`:`${n}/${e}`}?version=10000000&product=9&platform=39&alt=json`;return this._transport.request(i,{responseType:"json",retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS}}).then(this._parseResponse.bind(this,e))}getManifest(e){const t=`https://seektables.scdn.co/seektable/${e}.json`;return $e.info("Requesting JSON manifest for ",e),this._transport.request(t,{responseType:"json",retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS}}).then((t=>{let n;return 200!==t.status?(n=new Qe(r.STORAGE_TRACK_MANIFEST_FAILED,`Track manifest request failed with status code ${t.status}`),n.debug.file_id=e,n.status=t.status,Promise.reject(n)):t.body?t.body:(n=new Qe(r.STORAGE_TRACK_MANIFEST_EMPTY,"Received empty manifest."),n.debug.file_id=e,n.status=t.status,Promise.reject(n))}))}}class tt extends Error{constructor(e,t){super(t),this.debug={},this.name="TrackingError",this.message=t,this.code=e}}class nt{constructor(){this._version="1.0.0",this._map={}}clear(){this._map={}}track(e,t){let n=this._map[e];n||(n={url:e,segments:0,bandwidths:[],totalBandwidth:0},this._map[e]=n),n.segments+=1,n.bandwidths.push(t.bandwidth),n.totalBandwidth+=t.bandwidth}toJSON(){const e=[];for(const t in this._map){if(!this._map[t])continue;const n=this._map[t];n&&e.push({url:t,segments:n.segments,avg_bw:parseFloat((n.totalBandwidth/n.bandwidths.length).toFixed(7))})}return{version:this._version,urls:e}}}class it{constructor(){this._bitrates={},this._isFinalized=!1,this._needsEndSegment=!1,this._segments=[],this._cdnURLTracker=new nt,this._currentSpeed=1,this.audiocodec=null,this.bitrate=0,this.audioQuality=void 0,this.bufferLoadStartTime=0,this.urls={},this.currentTrackUri="",this.displayTrack="",this.externalLoadTime=0,this.fileId="",this.gaiaDevId="none",this.hadError=!1,this.internalPlayId="",this.isProtected=!1,this.keySystem="",this.keySystemImpl="",this.lastPlayPosition=-1,this.loadTime=0,this.localTimeMs=-1,this.maxContinuous=0,this.maxMsSeekRebuffering=0,this.maxMsStalled=0,this.memoryCached=!1,this.msActualDuration=0,this.msMetadataDuration=0,this.msFileDuration=0,this.msHeadLatency=0,this.msInitLatency=0,this.msKeyLatency=0,this.msLicenseGenerationLatency=0,this.msLicenseRequestLatency=0,this.msLicenseSessionLatency=0,this.msLicenseUpdateLatency=0,this.msManifestLatency=0,this.msPlayed=0,this.msNominalPlayed=0,this.msPlayedUnion=0,this.msPlayLatency=0,this.msResolveLatency=0,this.msSeekRebuffering=0,this.msSeeksBackward=0,this.msSeeksForward=0,this.nextPlaybackId="",this.nOffline=0,this.noLog=!1,this.noTSV=!1,this.noStats=!1,this.nWarnings=0,this.msStalled=0,this.nSeeksBackward=0,this.nSeeksForward=0,this.nSpeedChanges=!1,this.nStalls=0,this.nRenditionUpgrade=0,this.nRenditionDowngrade=0,this.bpsBandwidthMax=0,this.bpsBandwidthMin=0,this.bpsBandwidthAvg=0,this.totalBandwidth=0,this.lastBitrate=0,this.persistentCached=!1,this.playbackId="",this.playContext="",this.played=!1,this.position=0,this.reasonEnd="unknown",this.reasonStart="unknown",this.referrer="unknown",this.referrerVendor="unknown",this.referrerVersion="unknown",this.sourceEnd="unknown",this.sourceStart="unknown",this.startPosition=0,this.stopTime=0,this.streamingRule="none",this.timeWeightedBitrate=0,this.totalBytes=0,this.playIntended=!1,this.videocodec=null,this.clientId="unknown",this.correlationId="unknown",this.droppedVideoFrames=0,this.totalVideoFrames=0,this.maxResolution=0,this.minResolution=0}static create(){return new it}_calculateUnion(){const e=this._segments.slice(0);let t=0,n=0,i=0,o=0,r=0,a=0,s=this.maxContinuous;for(;rs?a:s);for(this.maxContinuous=s,e.sort(((e,t)=>e.time-t.time));o0&&(n+=parseInt(i,10)*t[i]/e);return Math.round(n)}registerVideoVariant(e){const t=e.bitrate;t&&(this._bitrates[t]=this._bitrates[t]||0,this.startBitrate||(this.startBitrate=t)),e.audioProfile&&(this.audiocodec=e.audioProfile.audio_codec),e.videoProfile&&(this.videocodec=e.videoProfile.video_codec,this.lastBitrate=e.videoProfile.video_bitrate,this.minResolution=e.videoProfile.video_resolution,this.maxResolution=e.videoProfile.video_resolution)}addStartSegment(){this._segments.push({type:"start",time:this.position}),this._needsEndSegment=!0}addEndSegment(){this._needsEndSegment&&(this._segments.push({type:"end",time:this.position}),this._needsEndSegment=!1)}addMSPlayed(e){if(e){if(e<0)throw new TypeError(`Cannot add negative msPlayed value: ${e}`);this.msPlayed+=e/this._currentSpeed,this.msNominalPlayed+=e}}addSpeedChange(e){this.nSpeedChanges=!0,this._currentSpeed=e}trackBitrate(e,t){const n=e||"dummy";this._bitrates[n]=this._bitrates[n]||0,this._bitrates[n]+=t}trackBufferURL(e,t){this._cdnURLTracker.track(e,t)}finalize(){if(this._isFinalized)throw new tt(r.TRACK_DATA_ALREADY_FINALIZED,"TrackData already finalized.");this.msPlayedUnion=this._calculateUnion(),this.nSeeksBackward||this.nSeeksForward||this.nSpeedChanges||(this.msNominalPlayed=this.maxContinuous=this.msPlayedUnion,this.msPlayed=this.msNominalPlayed/this._currentSpeed,this.nSpeedChanges=!1);const e=this.msPlayed;return this.timeWeightedBitrate=this._calculateWeightedBitrate(e),this.startBitrate||(this.startBitrate=this.bitrate),this.urls=this._cdnURLTracker.toJSON(),this._isFinalized=!0,!0}getURLsJSON(){var e,t;return null!==(t=null===(e=this._cdnURLTracker.toJSON().urls)||void 0===e?void 0:e.map((({url:e})=>e)))&&void 0!==t?t:[]}getPlaybackStats(){let e;switch(this.keySystem){case o.WIDEVINE:e="widevine";break;case o.PLAYREADY:case o.PLAYREADY_HARDWARE:e="playready";break;default:e="none"}return{ms_total_est:this.msActualDuration,ms_metadata_duration:this.msMetadataDuration,ms_manifest_latency:this.msManifestLatency,ms_latency:this.msPlayLatency,start_offset_ms:this.startPosition,ms_initial_buffering:this.msPlayLatency,ms_seek_rebuffering:this.msSeekRebuffering,ms_stalled:this.msStalled,max_ms_seek_rebuffering:this.maxMsSeekRebuffering,max_ms_stalled:this.maxMsStalled,n_stalls:this.nStalls,n_rendition_upgrade:this.nRenditionUpgrade,n_rendition_downgrade:this.nRenditionDowngrade,bps_bandwidth_max:this.bpsBandwidthMax,bps_bandwidth_min:this.bpsBandwidthMin,bps_bandwidth_avg:this.bpsBandwidthAvg,audiocodec:this.audiocodec?this.audiocodec.toLowerCase():void 0,videocodec:this.videocodec?this.videocodec.toLowerCase():void 0,start_bitrate:this.startBitrate||this.bitrate||void 0,full_screen:void 0,time_weighted_bitrate:this.timeWeightedBitrate,buffering_percentage:void 0,prefetched_bytes:void 0,prefetched_bytes_loaded:void 0,prefetched_initial_bitrate:void 0,key_system:e,ms_key_latency:this.msKeyLatency,total_bytes:this.totalBytes,local_time_ms:this.localTimeMs,ms_played_background:void 0,n_dropped_video_frames:this.droppedVideoFrames,n_total_video_frames:this.totalVideoFrames,resolution_max:this.maxResolution,resolution_min:this.minResolution}}isFinalized(){return this._isFinalized}}const ot=u.P.forTag("playback.tracker");class rt extends d.vp{constructor(e={}){super(),this._playedThreshold=31e3,this._playedThresholdReached=!1,this._trackingData=null,this._playedThreshold=e.playerThreshold||31e3}static create(e){return new rt(e)}_checkPlayedThreshold(){const e=this._trackingData;!e||!this._playedThreshold||this._playedThresholdReached||e.msPlayedt.maxMsSeekRebuffering&&(t.maxMsSeekRebuffering=e),t.msSeekRebuffering+=e)}trackMsStalled(e){const t=this._trackingData;t&&(e>t.maxMsStalled&&(t.maxMsStalled=e),t.msStalled+=e,t.nStalls++)}trackLoadFailed(){const e=this._trackingData;e&&(e.msPlayLatency=Date.now()-e.loadTime,e.position=0,e.addStartSegment())}trackStopped(e,t,n){var o,r,a,s;const c=this._trackingData;if(!c||c.isFinalized())return;const l=Date.now();if(c.stopTime=l,c.lastPlayPosition>=0&&e>=0&&c.lastPlayPositionn?(t.nSeeksForward++,t.msSeeksForward+=e-n):e=0&&t.lastPlayPosition=0&&t.lastPlayPosition=0){if(i=e-n.lastPlayPosition,i<0)return void ot.warn("Skipping msPlayed calculation: late progress event.");n.addMSPlayed(i)}this._checkPlayedThreshold(),n.position=e,n.lastPlayPosition=e,t&&n.trackBitrate(t,i)}trackSpeedChanged(e){const t=this._trackingData;t&&t.addSpeedChange(e)}trackVideoLoadStart(e){const t=this._trackingData;t&&t.registerVideoVariant(e)}trackWarning(){const e=this._trackingData;e&&e.nWarnings++}trackOffline(){const e=this._trackingData;e&&e.nOffline++}setActualDuration(e){const t=this._trackingData;t&&(t.msActualDuration=e)}setKeySystem(e){const t=this._trackingData;t&&(t.keySystem=e)}setKeySystemImpl(e){const t=this._trackingData;t&&(t.keySystemImpl=e)}setManifestLatency(e){const t=this._trackingData;t&&(t.msManifestLatency=e)}setPlayIntended(e){const t=this._trackingData;t&&(t.playIntended=e)}setKeyLatency(e){const t=this._trackingData;t&&(t.msKeyLatency=e)}setMemoryCached(e){const t=this._trackingData;t&&(t.memoryCached=e)}setPersistentCached(e){const t=this._trackingData;t&&(t.persistentCached=e)}setProtected(e){const t=this._trackingData;t&&(t.isProtected=e)}setHadError(e){const t=this._trackingData;t&&(t.hadError=e)}setLicenseSessionLatency(e){const t=this._trackingData;t&&(t.msLicenseSessionLatency=e)}setLicenseGenerationLatency(e){const t=this._trackingData;t&&(t.msLicenseGenerationLatency=e)}setLicenseRequestLatency(e){const t=this._trackingData;t&&(t.msLicenseRequestLatency=e)}setLicenseUpdateLatency(e){const t=this._trackingData;t&&(t.msLicenseUpdateLatency=e)}setResolveLatency(e){const t=this._trackingData;t&&(t.msResolveLatency=e)}setCalculatedDuration(e){const t=this._trackingData;t&&(t.msFileDuration=e)}setPlayedThreshold(e){this._playedThreshold=e}trackFragment(e){const t=this._trackingData;if(!t)return;const{bandwidth:n,resolution:i}=e;i&&((it.maxResolution&&(t.maxResolution=i)),(nt.bpsBandwidthMax&&(t.bpsBandwidthMax=n),t.bpsBandwidthAvg=t.bpsBandwidthAvg?(t.bpsBandwidthAvg+n)/2:n}trackProfileChanged(e){const t=this._trackingData;if(!t)return;const{bitrate:n}=e;nt.lastBitrate&&t.nRenditionUpgrade++,t.lastBitrate=n}}class at extends d.vp{constructor(e){super(),this._transport=e,this._parseManifestResponse=this._parseManifestResponse.bind(this)}static create(e){return new at(e)}_parseManifestResponse(e){var t;const n=e.metadata.startTime;if(200!==e.status){const t=new Qe(r.STORAGE_VIDEO_MANIFEST_FAILED,`Video manifest request failed with status ${e.status}`);return t.status=e.status,this.emit(i.VIDEO_MANIFEST_RESOLVE_FAILED,{url:e.url,error:t,start_time:n}),Promise.reject(t)}const o=e.body,a=null===(t=e.headers)||void 0===t?void 0:t.get("content-length");return this.emit(i.VIDEO_MANIFEST_RESOLVED,{url:e.url,manifest_size:a?parseInt(a,10):JSON.stringify(o).length,start_time:n,end_time:Date.now()}),Promise.resolve(o)}getInitSegmentURLs(e,t,n,i){let o="";n&&(o=e+t.replace("{{profile_id}}",n.id.toString(10)).replace("{{file_type}}",n.file_type));let r="";return i&&(r=e+t.replace("{{profile_id}}",i.id.toString(10)).replace("{{file_type}}",i.file_type)),{audio:o,video:r,audioLogging:o,videoLogging:r}}getSegmentURLs(e,t,n,i,o){let r="";i&&(r=e+t.replace("{{profile_id}}",i.id.toString(10)).replace("{{file_type}}",i.file_type));let a="";return o&&(a=e+t.replace("{{profile_id}}",o.id.toString(10)).replace("{{file_type}}",o.file_type)),{audio:r.replace("{{segment_timestamp}}",n.toString()),video:a.replace("{{segment_timestamp}}",n.toString()),audioLogging:r,videoLogging:a}}getManifest(e,t=!1){const n=`${t?"@webgate/manifests/v8/unauth/json/sources":"@webgate/manifests/v7/json/sources"}/${e}/options/supports_drm`;return this._transport.request(n,{authorize:!t,responseType:"json",parseResponseHeaders:!0,retry:{condition:(e,t)=>e.getStatusFamily()!==t.SUCCESS},metadata:{startTime:Date.now()}}).then(this._parseManifestResponse)}}class st extends Error{constructor(e,t){super(),this.status=-1,this.debug={},this.canPlayNext=!0,this.unrecoverable=!1,this.name="LicenseError",this.code=e,this.message=t}static fatal(e,t){const n=new st(e,t);return n.unrecoverable=!0,n.canPlayNext=!1,n}}class ct{constructor(e){this._sdk={name:"",version:""},this._securityLevel=null,this._urls={},e.sdk&&(this._sdk=e.sdk),e.securityLevel&&(this._securityLevel=e.securityLevel),this._transport=e.transport,this._useTestLicenseServer=!!e.useTestLicenseServer,this._transport.on(this._transport.EVENT_CONNECTION_ID,(()=>{this._urls={}}))}get(e,t){const n=`${e}:${t}`,i=this._urls[n];if(i&&i.expires>Date.now()+6e4)return Promise.resolve(i.uri);const o=this._useTestLicenseServer?"&use_test_license_server=true":"",a=`@webgate/melody/v1/license_url?keysystem=${e}&mediatype=${t}&sdk_name=${this._sdk.name}&sdk_version=${this._sdk.version}${o}`;return this._transport.request(a,{responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((e=>{const t=e.body;if(t&&200===e.status)return t.expires*=1e3,t.uri=`@webgate/${t.uri}`,this._securityLevel&&(t.uri+=[-1!==t.uri.indexOf("?")?"&":"?","sl=",this._securityLevel].join("")),this._urls[n]=t,t.uri;let i;return i=t?400===e.status&&t&&"deprecated-version"===t.code?st.fatal(r.LICENSE_RESOLVER_DEPRECATED_VERSION,"This version of the SDK is no longer supported. Please upgrade"):new st(r.LICENSE_RESOLVER_CANT_RESOLVE_URL,`License URL endpoint responded with status ${e.status}`):st.fatal(r.LICENSE_RESOLVE_INVALID_RESPONSE,"License URL endpoint responded with invalid response"),i.status=e.status,Promise.reject(i)}))}remove(e,t){this._urls[`${e}:${t}`]=null}}class lt{constructor(e){this._melodyLogger=new je.Hx(e)}logTrackStreamVerification(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"track_stream_verification",message:e},{batch:!0})}logJSSDKPlaybackStats(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_playback_stats",message:e},{batch:!0})}logJSSDKPlaybackStart(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_playback_start",message:e},{batch:!0})}logJSSDKError(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_error",message:e},{batch:!0})}logJSSDKWarning(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_warning",message:e},{batch:!0})}}var ut;!function(e){e[e.ABORTED=101]="ABORTED",e[e.NETWORK=102]="NETWORK",e[e.MEDIA_DECODING=103]="MEDIA_DECODING",e[e.SRC_NOT_SUPPORTED=104]="SRC_NOT_SUPPORTED",e[e.EME=105]="EME",e[e.GENERIC=100]="GENERIC"}(ut||(ut={}));const dt={[r.MEDIA_ABORTED]:ut.ABORTED,[r.MEDIA_DECODING_ERROR]:ut.MEDIA_DECODING,[r.MEDIA_NOT_SUPPORTED]:ut.SRC_NOT_SUPPORTED,[r.MEDIA_NETWORK_ERROR]:ut.NETWORK};function pt(e){let t=dt[e];return/_REQUEST_|_RESPONSE$/.test(e)?t=ut.NETWORK:t||(t=/^EME_/.test(e)?ut.EME:ut.GENERIC),t}function ft(e){var t;const n=e.match(/^https?:\/\/([^\/]+@)?([^\/?#]+)/);return null!==(t=null==n?void 0:n[2])&&void 0!==t?t:""}var ht;!function(e){e.READY="playerready",e.VIDEO_CHANGE="videochange",e.PLAY="play",e.PLAYING="playing",e.PAUSE="pause",e.TIMEUPDATE="timeupdate",e.SEEKING="seeking",e.SEEKED="seeked",e.ERROR="error",e.ENDED="ended",e.RENDITION_CHANGE="renditionchange",e.REQUEST_COMPLETED="requestcompleted",e.REQUEST_FAILED="requestfailed",e.REQUEST_CANCELED="requestcanceled"}(ht||(ht={}));const mt={player_is_paused:!0,player_width:0,player_height:0,video_source_height:0,video_source_width:0,player_is_fullscreen:void 0,player_autoplay_on:void 0,player_preload_on:void 0,video_source_url:void 0,video_source_mime_type:void 0,video_source_duration:void 0,video_poster_url:void 0,player_language_code:void 0};class gt{constructor(e){this._playerId=`spotify-playback-${Date.now()}`,this._currentContentInfo=null,this._readyDeferred=(0,m.$)(),this._isMuxInitialized=!1,this._muxInitData=null,this._player=e.player,this._mux=e.mux,this._getPlayheadTime=this._getPlayheadTime.bind(this),this._getStateData=this._getStateData.bind(this),this._init(e)}static create(e){return new gt(e)}_init(e){Promise.all([Promise.resolve(e.deviceInfo)]).then((([t])=>{var n;this._muxInitData={data:Object.assign({env_key:e.envKey||"2qbjhhcl4u87btjbo7dh8vi2n",player_name:null!==(n=null==t?void 0:t.platform_name)&&void 0!==n?n:null==t?void 0:t.platform,player_version:null==t?void 0:t.version,viewer_device_manufacturer:null==t?void 0:t.brand,viewer_device_category:null==t?void 0:t.type,viewer_device_name:null==t?void 0:t.model,player_software_name:e.sdk||"spotify-playback",player_software_version:e.sdkVersion||qe,player_mux_plugin_name:"spotify-playback-mux-reporter",player_mux_plugin_version:qe},e.muxCustomDimensions),getPlayheadTime:this._getPlayheadTime,getStateData:this._getStateData},this._player.addListeners({[i.PLAYER_BEFORE_LOAD]:this._onBeforeLoad.bind(this),[i.PLAYER_PLAY]:this._onPlay.bind(this),[i.PLAYER_PLAYING]:this._onPlaying.bind(this),[i.PLAYER_PAUSED]:this._onPause.bind(this),[i.PLAYER_PROGRESS]:this._onProgress.bind(this),[i.PLAYER_SEEKING]:this._onSeeking.bind(this),[i.PLAYER_POSITION_CHANGED]:this._onPositionChanged.bind(this),[i.PLAYER_ERROR]:this._onError.bind(this),[i.PLAYER_ENDED]:this._onEnded.bind(this),[i.PLAYER_DURATION_CHANGED]:this._onDurationChanged.bind(this),[i.PLAYER_VIDEO_RESIZED]:this._onVideoResized.bind(this),[i.PLAYER_VIDEO_PROFILE_CHANGED]:this._onVideoProfileChanged.bind(this),[i.PLAYER_FRAGMENT_FETCHED]:this._onFragmentFetched.bind(this),[i.PLAYER_FRAGMENT_FETCH_ERROR]:this._onFragmentFetchError.bind(this),[i.PLAYER_VIDEO_MANIFEST_RESOLVED]:this._onVideoManifestResolved.bind(this),[i.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED]:this._onVideoManifestResolveFailed.bind(this)})})).then(this._readyDeferred.resolve,this._readyDeferred.reject)}_getPlayheadTime(){return this._player.getPlayerPosition()}_getStateData(){return this._currentContentInfo?Object.assign(Object.assign({},this._currentContentInfo.stateData),{player_language_code:this._player.getActiveSubtitleLanguage()}):null}_onDurationChanged(e){this._currentContentInfo&&(this._currentContentInfo.stateData.video_source_duration=e.data.duration)}_onVideoResized(e){this._currentContentInfo&&(this._currentContentInfo.stateData.player_width=e.data.width,this._currentContentInfo.stateData.player_height=e.data.height)}_onBeforeLoad(e){const{track:t,options:n,logData:i}=e.data,o=!!this._currentContentInfo;if("video"!==t.mediaType||(null==i?void 0:i.noLog)||(null==i?void 0:i.noMuxEvents))return o&&this._mux.emit(this._playerId,ht.VIDEO_CHANGE,{}),void(this._currentContentInfo=null);const r={video_id:t.fileId,video_title:(null==i?void 0:i.displayTitle)||void 0,video_series:(null==i?void 0:i.displayGroup)||void 0,video_duration:(null==i?void 0:i.displayDuration)||void 0},a=Object.assign({},mt);this._currentContentInfo={track:t,options:n,videoData:r,stateData:a},!this._isMuxInitialized&&this._muxInitData?(this._mux.init(this._playerId,this._muxInitData),this._mux.emit(this._playerId,ht.READY),this._isMuxInitialized=!0):o&&this._mux.emit(this._playerId,ht.VIDEO_CHANGE,r)}_onPlay(){var e,t;if(!this._currentContentInfo)return;const n=this._currentContentInfo.stateData,i=this._player.getPlayerState(),o=i.media_info,r=(null===(t=null===(e=this._currentContentInfo)||void 0===e?void 0:e.options)||void 0===t?void 0:t.autoplay)||!1,{width:a,height:s,src:c,poster:l}=i.player_element;n.player_is_paused=!i.playing,n.player_width=a||0,n.player_height=s||0,n.video_source_height=o.video_height||0,n.video_source_width=o.video_width||0,n.player_autoplay_on=r,n.video_source_url=c,n.video_source_mime_type=o.video_format,n.video_source_duration=i.duration,n.video_poster_url=l,this._mux.emit(this._playerId,ht.PLAY,this._currentContentInfo.videoData)}_onPlaying(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!1,this._mux.emit(this._playerId,ht.PLAYING))}_onPause(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!0,this._mux.emit(this._playerId,ht.PAUSE))}_onProgress(e){this._currentContentInfo&&this._mux.emit(this._playerId,ht.TIMEUPDATE,{player_playhead_time:e.data.position})}_onSeeking(){this._currentContentInfo&&this._mux.emit(this._playerId,ht.SEEKING)}_onPositionChanged(){this._currentContentInfo&&this._mux.emit(this._playerId,ht.SEEKED)}_onError(e){var t,n;const i=null===(n=null===(t=e.data)||void 0===t?void 0:t.error)||void 0===n?void 0:n.code;this._currentContentInfo&&i&&this._mux.emit(this._playerId,ht.ERROR,{player_error_code:pt(i),player_error_message:i})}_onEnded(){this._currentContentInfo&&this._mux.emit(this._playerId,ht.ENDED)}_onVideoProfileChanged(e){if(!this._currentContentInfo)return;const t=e.data.profile,n=this._currentContentInfo.stateData;n.video_source_height=t.height||0,n.video_source_width=t.width||0,n.video_source_mime_type=t.mimeType,this._mux.emit(this._playerId,ht.RENDITION_CHANGE,{video_source_bitrate:t.bitrate,video_source_width:t.width,video_source_height:t.height})}_onFragmentFetched(e){const t=e.data;if(!this._currentContentInfo&&"video"!==t.media_type)return;const n=`${t.segment_type}${t.init?"_init":""}`;this._mux.emit(this._playerId,ht.REQUEST_COMPLETED,{request_type:n,request_hostname:ft(t.url),request_start:t.start_time,request_response_end:t.end_time,request_bytes_loaded:t.byte_length})}_onFragmentFetchError(e){const t=e.data;if(!this._currentContentInfo&&"video"!==t.media_type)return;const n=`${t.segment_type}${t.init?"_init":""}`;this._mux.emit(this._playerId,ht.REQUEST_FAILED,{request_type:n,request_hostname:ft(t.url),request_start:t.start_time,request_error:t.error.code,request_error_code:t.error.status,request_error_text:""})}_onVideoManifestResolved(e){const t=e.data;this._currentContentInfo&&this._mux.emit(this._playerId,ht.REQUEST_COMPLETED,{request_type:"manifest",request_hostname:ft(t.url),request_start:t.start_time,request_response_end:t.end_time,request_bytes_loaded:t.manifest_size})}_onVideoManifestResolveFailed(e){const t=e.data;this._currentContentInfo&&this._mux.emit(this._playerId,ht.REQUEST_FAILED,{request_type:"manifest",request_hostname:ft(t.url),request_start:t.start_time,request_error:t.error.code,request_error_code:t.error.status,request_error_text:""})}ready(){return this._readyDeferred.promise}}var _t,vt,yt,Et,bt,St,At;!function(e){e.NULL_VALUE="NULL_VALUE",e.LIST_START="LIST_START",e.LIST_END="LIST_END",e.FORBIDDEN="FORBIDDEN",e.IGNORE="IGNORE",e.PAUSE="PAUSE"}(_t||(_t={})),function(e){e.MP4_AUDIO="audio/mp4",e.MP4_VIDEO="video/mp4",e.MTS_VIDEO="video/mp2t",e.WEBM_AUDIO="audio/webm",e.WEBM_VIDEO="video/webm"}(vt||(vt={})),function(e){e.AAC_LC="mp4a.40.2",e.FLAC="flac",e.OPUS="opus",e.VP9="vp9",e.VP8="vp8",e.H264_31="avc1.4d401f"}(yt||(yt={})),function(e){e.APPLOAD="appload",e.BACK_BUTTON="backbtn",e.CLICK_ROW="clickrow",e.CLICK_SIDE="clickside",e.END_PLAY="endplay",e.FORWARD_BUTTON="fwdbtn",e.LOGOUT="logout",e.PLAY_BUTTON="playbtn",e.POPUP="popup",e.REMOTE="remote",e.TRACK_DONE="trackdone",e.TRACK_ERROR="trackerror",e.UNKNOWN="unknown",e.URI_OPEN="uriopen",e.CAPPED="capped",e.SEEK="seek"}(Et||(Et={})),function(e){e.UNKNOWN="UNKNOWN",e.DEFAULT="DEFAULT",e.LOW="LOW",e.NORMAL="NORMAL",e.HIGH="HIGH",e.VERY_HIGH="VERY_HIGH",e.HIFI="HIFI"}(bt||(bt={})),function(e){e.NONE="NONE",e.CONTEXT="CONTEXT",e.TRACK="TRACK"}(St||(St={})),function(e){e.EMPTY="EMPTY",e.SW_CRYPTO="SW_CRYPTO",e.SW_DECODE="SW_DECODE",e.HW_CRYPTO="HW_CRYPTO",e.HW_DECODE="HW_DECODE",e.HW_ALL="HW_ALL"}(At||(At={}));class Tt extends Error{constructor(e,t){super(),this.unrecoverable=!1,this.listPlayerIgnore=!1,this.debug={},this.name="PlaybackError",this.code=e,this.message=t}static fatal(e,t){const n=new Tt(e,t);return n.unrecoverable=!0,n}}function Ot(e){return"uri"in e}class It extends d.vp{constructor(e){if(super(),this._trackPlayerPromise=(0,m.$)(),this._maxListErrors=5,this._uid=0,this._loadedList=null,this._loadedOptions=null,this._currentTrack=null,this._currentTrackOptions=null,this._listPlayCount=0,this._listErrorCount=0,this._shuffled=!1,this._repeatMode=St.NONE,this._currentSeqId=0,!e.trackPlayer)throw new TypeError("Argument `options.trackPlayerManager` not found.");e.maxListErrors&&(this._maxListErrors=e.maxListErrors),this._setListOptions=this._setListOptions.bind(this),this._replaceCurrentList=this._replaceCurrentList.bind(this),this._handleCapped=this._handleCapped.bind(this),this._handlePlaying=this._handlePlaying.bind(this),this._handlePaused=this._handlePaused.bind(this),this._handleEnded=this._handleEnded.bind(this),this._handleCanPreload=this._handleCanPreload.bind(this),this._handleError=this._handleError.bind(this),this._handlePositionChanged=this._handlePositionChanged.bind(this),this._handleDurationChanged=this._handleDurationChanged.bind(this),this._handleTimeout=this._handleTimeout.bind(this),this._handlePlayerInitError=this._handlePlayerInitError.bind(this),this._handleProgress=this._handleProgress.bind(this),this._handlePlayedThresholdReached=this._handlePlayedThresholdReached.bind(this),this._handleBeforeLoad=this._handleBeforeLoad.bind(this),this._init(e.trackPlayer)}static create(e){return new It(e)}_init(e){this._trackPlayerPromise.promise.catch((()=>{})),Promise.resolve(e).then((e=>{this._attachPlayerEvents(e),this._trackPlayerPromise.resolve(e)})).catch(this._handlePlayerInitError)}_attachPlayerEvents(e){e.addListeners({[i.PLAYER_CAN_PRELOAD]:this._handleCanPreload,[i.PLAYER_CAPPED]:this._handleCapped,[i.PLAYER_ENDED]:this._handleEnded,[i.PLAYER_ERROR]:this._handleError,[i.PLAYER_PAUSED]:this._handlePaused,[i.PLAYER_PLAYING]:this._handlePlaying,[i.PLAYER_TIMEOUT]:this._handleTimeout,[i.PLAYER_POSITION_CHANGED]:this._handlePositionChanged,[i.PLAYER_DURATION_CHANGED]:this._handleDurationChanged,[i.PLAYER_PROGRESS]:this._handleProgress,[i.PLAYER_BEFORE_LOAD]:this._handleBeforeLoad,[i.PLAYER_PLAYED_THRESHOLD_REACHED]:this._handlePlayedThresholdReached}),this.proxyEmitAllSync(e,{[i.PLAYER_BEFORE_VOLUME_CHANGE]:i.LIST_PLAYER_BEFORE_VOLUME_CHANGE,[i.PLAYER_LOAD]:i.LIST_PLAYER_PLAYER_LOAD}),this.proxyEmitAll(e,{[i.PLAYER_AUTOPLAY_FAILED]:i.LIST_PLAYER_AUTOPLAY_FAILED,[i.PLAYER_TRACKING_DATA_CREATED]:i.LIST_PLAYER_TRACKING_DATA_CREATED,[i.PLAYER_TRACKING_DATA_FINALIZED]:i.LIST_PLAYER_TRACKING_DATA_FINALIZED,[i.PLAYER_BUFFER_STALLED]:i.LIST_PLAYER_BUFFER_STALLED,[i.PLAYER_BUFFERING_START]:i.LIST_PLAYER_BUFFERING_START,[i.PLAYER_BUFFERING_END]:i.LIST_PLAYER_BUFFERING_END,[i.PLAYER_VIDEO_ELEMENT_APPENDED]:i.LIST_PLAYER_VIDEO_ELEMENT_APPENDED,[i.PLAYER_VIDEO_ELEMENT_REMOVED]:i.LIST_PLAYER_VIDEO_ELEMENT_REMOVED,[i.PLAYER_DISPLAYED_CUES_CHANGED]:i.LIST_PLAYER_DISPLAYED_CUES_CHANGED,[i.LIST_PLAYER_VIDEO_PROFILE_CHANGED]:i.PLAYER_VIDEO_PROFILE_CHANGED,[i.LIST_PLAYER_PLAYBACK_SPEED_CHANGED]:i.PLAYER_PLAYBACK_SPEED_CHANGED,[i.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED]:i.PLAYER_SUBTITLE_LANGUAGES_LOADED})}_translatePosition(e){var t,n,i;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translatePosition)||void 0===n?void 0:n.call(t,e))&&void 0!==i?i:e}_translateDuration(e){var t,n,i;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translateDuration)||void 0===n?void 0:n.call(t,e))&&void 0!==i?i:e}_handleProgress(e){const{data:t}=e;this.emit(i.LIST_PLAYER_PROGRESS,Object.assign(Object.assign({},t),{position:this._translatePosition(t.position)}))}_handleBeforeLoad(e){const{data:t}=e;this.emit(i.LIST_PLAYER_BEFORE_PLAYER_LOAD,Object.assign(Object.assign({},t),{options:Object.assign(Object.assign({},t.options),{position:this._translatePosition(t.options.position)})}))}_handlePlayerInitError(e){this._trackPlayerPromise.reject(new Tt(r.LIST_PLAYER_NO_TRACK_PLAYER,e.message||"Track player promise was rejected."))}_handleCapped(){const e=this._currentTrack;e&&this.emit(i.LIST_PLAYER_CAPPED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList})}_handlePlaying(e){const t=this._currentTrack;t&&this.emit(i.LIST_PLAYER_PLAYING,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handlePaused(e){const t=this._currentTrack;t&&this.emit(i.LIST_PLAYER_PAUSED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handleCanPreload(){this._preloadUpcomingTrack().catch((()=>{}))}_handleEnded(){const e=this._currentTrack;e&&(this.emit(i.LIST_PLAYER_TRACK_ENDED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(Et.TRACK_DONE))}_handleTimeout(){const e=this._currentTrack;e&&(this.emit(i.LIST_PLAYER_TRACK_TIMEOUT,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(Et.TRACK_ERROR))}_handlePositionChanged(e){const t=this._currentTrack;t&&this.emit(i.LIST_PLAYER_POSITION_CHANGED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position)})}_handleDurationChanged(e){const t=this._currentTrack;t&&this.emit(i.LIST_PLAYER_DURATION_CHANGED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,position:this._translatePosition(e.data.position),duration:this._translateDuration(e.data.duration)})}_handlePlayedThresholdReached(e){const t=this._currentTrack;t&&this.emit(i.LIST_PLAYER_PLAYED_THRESHOLD_REACHED,{uid:this._uid,track:t,options:this._currentTrackOptions,list:this._loadedList,threshold:e.data.threshold,position:this._translatePosition(e.data.position)})}_handleError(e){const t=this._currentTrack,n=e.data;if(!t)return;n.position=this._translatePosition(e.data.position),this.emit(i.LIST_PLAYER_ERROR,n),this.emitSync(i.LIST_PLAYER_ERROR_SYNC,n);const o=!!n.error&&n.error.listPlayerIgnore;o||this._listErrorCount++,n.canPlayNext&&(o||this._listErrorCount<=this._maxListErrors?this.next(Et.TRACK_ERROR):this.emit(i.LIST_PLAYER_MAX_LIST_ERRORS_REACHED,{count:this._listErrorCount,threshold:this._maxListErrors}))}_handleTrackLoaded(e){this.emitSync(i.LIST_PLAYER_TRACK_LOADED,e)}_incrementSeqId(){return this._currentSeqId>=9007199254740991?this._currentSeqId=0:this._currentSeqId+=1,this._currentSeqId}_getTrackPlayer(){return this._trackPlayerPromise.promise}_setListIndex(e,t){const n=t.index&&-1!==t.index?t.index:0;return Promise.all([e,t,e.startAt(n)])}_setListOptions([e,t,n]){return Promise.all([e.setShuffle(!!this._shuffled),e.setRepeatMode(this._repeatMode)]).then((()=>[e,t]))}_replaceCurrentList([e,t]){return this.emitSync(i.LIST_PLAYER_BEFORE_LIST_CHANGE,{newList:e,newOptions:t,oldList:this._loadedList,oldOptions:this._loadedOptions}),this._loadedList=e,this._loadedOptions=t,this._listPlayCount=0,this._listErrorCount=0,this.emit(i.LIST_PLAYER_LIST_CHANGED,{list:e,options:t}),a.SUCCESS}_preloadTrack(e){return this._getTrackPlayer().then((t=>(t.preload(e).catch((()=>{})),a.SUCCESS)))}_changeTrack(e,t,n){if(this._currentSeqId!==n)return Promise.resolve(a.CANCELLED);this.emitSync(i.LIST_PLAYER_BEFORE_TRACK_LOAD,{list:this._loadedList,newTrack:e,oldTrack:this._currentTrack}),this._uid++;const o=++this._listPlayCount,r=this._loadedOptions;let s=!0,c=0,l=3e4;r&&(1===o?(s=!r.paused,c=r.initialPosition||r.position||0):c=r.position||0);const u=t===Et.TRACK_DONE;if(e.options){const t=e.options;void 0!==t.paused&&(s=!t.paused),void 0!==t.position&&(c=t.position),void 0!==t.playedThreshold&&(l=t.playedThreshold)}this._currentTrack=e,this._currentTrackOptions={reason:t,paused:!s,position:c,playedThreshold:l};const d=this._handleTrackLoaded.bind(this,{uid:this._uid,track:this._currentTrack,options:this._currentTrackOptions,list:this._loadedList});return this._getTrackPlayer().then((t=>this._currentSeqId!==n?a.CANCELLED:(Promise.resolve(t.load(e,{uriProperty:"playableURI",autoplay:s,position:c,playedThreshold:l,continuePrevious:u},d)).catch((()=>{})),a.SUCCESS)))}_preloadUpcomingTrack(){const e=this._loadedList;if(!e)return Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));const t={reason:Et.TRACK_DONE,listConstants:_t};return e.peekNext(t).then((e=>e===_t.FORBIDDEN?a.FORBIDDEN:e===_t.NULL_VALUE?this._preloadUpcomingTrack():e===_t.LIST_END?a.LIST_END:Ot(e)&&e.playable?this._preloadTrack(e):a.INVALID))}activateElement(){return this._getTrackPlayer().then((e=>(e.activateElement(),a.SUCCESS)))}load(e,t){const n=function(e={}){const t={index:-1,position:0,initialPosition:0,duration:-1,paused:!1,reason:Et.UNKNOWN};return void 0!==e.index&&(t.index=e.index),void 0!==e.position&&(t.position=e.position),void 0!==e.initialPosition&&(t.initialPosition=e.initialPosition),void 0!==e.duration&&(t.duration=e.duration),void 0!==e.paused&&(t.paused=e.paused),void 0!==e.reason&&(t.reason=e.reason),t}(t||this._loadedOptions||{});return this._setListIndex(e,n).then(this._setListOptions).then(this._replaceCurrentList)}play(e,t){return this.load(e,t).then((()=>{if(this._loadedList!==e)return a.CANCELLED;const t=this._loadedOptions?this._loadedOptions.reason:Et.UNKNOWN;return this.next(t)}))}canChangeTrack(){return this._loadedList?this._loadedList.peekNext({reason:Et.FORWARD_BUTTON,listConstants:_t}).then((e=>e!==_t.FORBIDDEN)):Promise.resolve(!0)}next(e){if(!e)return Promise.reject(new Tt(r.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(i.LIST_PLAYER_BEFORE_NEXT,{list:t,reason:e});const n=this._incrementSeqId(),o={reason:e,listConstants:_t};return t.next(o).then((o=>this._currentSeqId!==n?a.CANCELLED:o===_t.FORBIDDEN?a.FORBIDDEN:o===_t.NULL_VALUE?this.next(e):o===_t.LIST_END?(this.emit(i.LIST_PLAYER_LIST_ENDED,{list:t,reason:Et.END_PLAY}),this.clear(e),a.LIST_END):Ot(o)?o.playable?this._changeTrack(o,e,n):(this.emit(i.LIST_PLAYER_TRACK_UNPLAYABLE,{track:o,list:t}),this.next(e)):a.INVALID))}previous(e){if(!e)return Promise.reject(new Tt(r.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(i.LIST_PLAYER_BEFORE_PREVIOUS,{list:t,reason:e});const n=this._incrementSeqId(),o={reason:e,listConstants:_t};return t.previous(o).then((o=>this._currentSeqId!==n?a.CANCELLED:o===_t.FORBIDDEN?a.FORBIDDEN:o===_t.NULL_VALUE?this.previous(e):o===_t.LIST_START?(this.emit(i.LIST_PLAYER_LIST_ENDED,{list:t,reason:Et.END_PLAY}),this.clear(e),a.LIST_END):Ot(o)?o.playable?this._changeTrack(o,e,n):(this.emit(i.LIST_PLAYER_TRACK_UNPLAYABLE,{track:o,list:t}),this.previous(e)):a.INVALID))}pause(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.pause().then((()=>a.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?a.CANCELLED:a.FORBIDDEN)))):Promise.resolve(a.SUCCESS):Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}resume(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.resume().then((()=>a.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?a.CANCELLED:a.FORBIDDEN)))):Promise.resolve(a.SUCCESS):Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}togglePlay(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.togglePlay().then((()=>a.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?a.CANCELLED:a.FORBIDDEN)))):Promise.resolve(a.SUCCESS):Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}stop(e){const t={reason:e||Et.UNKNOWN},n=this._currentTrack;return n&&n.logData&&(t.source=n.logData.source),this._incrementSeqId(),this._getTrackPlayer().then((e=>(e.stop(t),this.emit(i.LIST_PLAYER_STOPPED,{uid:this._uid,options:this._currentTrackOptions,list:this._loadedList}),a.SUCCESS)))}clear(e){return this.stop(e).then((()=>(this._loadedList=null,this._loadedOptions=null,this._currentTrack=null,this._currentTrackOptions=null,this.emit(i.LIST_PLAYER_CLEARED,null),a.SUCCESS)))}setShuffle(e){const t=!!e;if(this._shuffled!==t){this._shuffled=t,this.emit(i.LIST_PLAYER_SHUFFLE_CHANGED,{player:this,shuffled:t});const e=this._loadedList;e&&e.setShuffle(this._shuffled)}return Promise.resolve(a.SUCCESS)}setRepeatMode(e){if(!(e in St))return Promise.reject(new Tt(r.LIST_PLAYER_INVALID_ARGUMENT,"The value of repeat mode is not a correct RepeatMode enum value"));if(this._repeatMode!==e){this._repeatMode=e,this.emit(i.LIST_PLAYER_REPEAT_MODE_CHANGED,{player:this,repeatMode:e});const t=this._loadedList;t&&t.setRepeatMode(this._repeatMode)}return Promise.resolve(a.SUCCESS)}getVolume(){return this._getTrackPlayer().then((e=>e.getVolume()))}setVolume(e,t=null){return this._getTrackPlayer().then((n=>(n.setVolume(e,{commandId:null!=t?t:void 0}),this.emit(i.LIST_PLAYER_VOLUME_CHANGED,{volume:e,commandId:t}),a.SUCCESS)))}seek(e,t=Et.SEEK){var n,o;const s=this._loadedList;if(!s)return Promise.reject(new Tt(r.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));if("function"==typeof s.allowSeeking&&!s.allowSeeking())return Promise.reject(new Tt(r.LIST_PLAYER_FORBIDDEN,"The operation is not allowed."));const c=null!==(o=null===(n=s.handleSeek)||void 0===n?void 0:n.call(s,e,{reason:t,listConstants:_t}))&&void 0!==o?o:e;return c===_t.PAUSE?this.pause().then((t=>(this.emit(i.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:c}),t))):c===_t.IGNORE?(this.emit(i.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:c}),Promise.resolve(a.SUCCESS)):this._currentTrack?this._getTrackPlayer().then((e=>(e.seek(c),a.SUCCESS))):Promise.resolve(a.SUCCESS)}getListConstants(){return _t}getLoadedList(){return this._loadedList}getLoadedOptions(){return this._loadedOptions}getPlayerState(){return this._getTrackPlayer().then((e=>{const t=e.getPlayerState();return Object.assign(Object.assign({},t),{position:this._translatePosition(t.position),duration:this._translateDuration(t.duration)})}))}getState(){return this.getPlayerState().then((e=>({playbackState:e,track:this._currentTrack,list:this._loadedList,options:this._loadedOptions})))}getMediaConfig(){return this._getTrackPlayer().then((e=>e.getMediaConfig()))}hideSubtitles(){return this._getTrackPlayer().then((e=>e.hideSubtitles())).then((()=>a.SUCCESS))}showSubtitles(){return this._getTrackPlayer().then((e=>e.showSubtitles())).then((()=>a.SUCCESS))}areSubtitlesShown(){return this._getTrackPlayer().then((e=>e.areSubtitlesShown()))}getSubtitleLanguages(){return this._getTrackPlayer().then((e=>e.getSubtitleLanguages()))}getActiveSubtitleLanguage(){return this._getTrackPlayer().then((e=>{var t;return null!==(t=e.getActiveSubtitleLanguage())&&void 0!==t?t:null}))}deactivateCueEvents(){return this._getTrackPlayer().then((e=>e.deactivateCueEvents())).then((()=>a.SUCCESS))}activateCueEvents(){return this._getTrackPlayer().then((e=>e.activateCueEvents())).then((()=>a.SUCCESS))}getCurrentBandwidth(){return this._getTrackPlayer().then((e=>e.getCurrentBandwidth()))}setSubtitleLanguage(e){return this._getTrackPlayer().then((t=>t.setSubtitleLanguage(e))).then((()=>a.SUCCESS))}setPlaybackSpeed(e){return this._getTrackPlayer().then((t=>t.setPlaybackSpeed(e))).then((e=>e?a.SUCCESS:a.FORBIDDEN))}getStatistics(){return this._getTrackPlayer().then((e=>e.getStatistics()))}getAudioProcessor(){return this._getTrackPlayer().then((e=>e.getAudioProcessor()))}}const Ct=u.P.forTag("playback.init");function Nt(e){return new Promise(((t,n)=>{var i,o,r,a,s,c,u;if(!e.transport)return void n(new TypeError("Argument transport is required."));if("undefined"!=typeof window){("boolean"==typeof window.isSecureContext?window.isSecureContext:function(){if("undefined"==typeof window||!window.location)return!1;const e=window.location;if("https"===e.protocol||"file"===e.protocol)return!0;const t=e.hostname;return!!/^127(\.[0-255]){3}$|^locahost\.?$|\.localhost\.?$/.test(t)}())||null===(i=window.console)||void 0===i||i.warn("%cDRM might not be available from unsecure contexts","background: #222; color: #bada55; font-size: 40px")}const{transport:d}=e,[p="",f=""]=(e.sdkId||"").split(":"),h=Object.assign(Object.assign({},e),{tracker:rt.create(),audioResolver:new et(d),videoResolver:new at(d),licenseURLResolver:new ct({transport:d,sdk:{name:p,version:f},securityLevel:e.securityLevel,useTestLicenseServer:e.useTestLicenseServer}),newBufferPerTrack:null===(o=e.newBufferPerTrack)||void 0===o||o,preinitMediaElement:null===(r=e.preinitMediaElement)||void 0===r||r});e.unauthenticatedLogs&&!(null===(a=e.loggerOptions)||void 0===a?void 0:a.endpoint)&&(e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{endpoint:"https://spclient.wg.spotify.com/melody/unauth"})),(null===(s=null==e?void 0:e.loggerOptions)||void 0===s?void 0:s.deviceInfo)||Promise.all([null===(c=e.loggerOptions)||void 0===c?void 0:c.platform,null===(u=e.loggerOptions)||void 0===u?void 0:u.clientVersion]).then((([t,n])=>{e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{deviceInfo:{platform:t,version:n}})})),Ye.create(h).then((t=>{const n=Object.assign({disableMux:!0},e.loggerOptions),i=function(e){return new lt(e)}(Object.assign(Object.assign({},n),{transport:d,sdkId:e.sdkId,platform:Promise.resolve(n.deviceInfo).then((e=>{var t;return null!==(t=null==e?void 0:e.platform)&&void 0!==t?t:""})),clientVersion:Promise.resolve(n.deviceInfo).then((e=>{var t;return null!==(t=null==e?void 0:e.version)&&void 0!==t?t:""}))})),o=Ze.create({transport:d,player:t,logSender:i});return n.disableMux||gt.create({player:t,mux:l,envKey:null==n?void 0:n.muxEnvKey,sdk:p,sdkVersion:f,deviceInfo:n.deviceInfo,muxCustomDimensions:n.muxCustomDimensions}).ready().then((()=>Ct.info("MuxReporter ready")),(e=>Ct.error("Failed to instantiate MuxReporter",null==e?void 0:e.message))),{player:t,logger:o}})).then(t,n)}))}var Lt,Rt=n(78168);!function(e){e.PLAYER_INITIALIZATION_DONE="PLAYER_INITIALIZATION_DONE",e.PLAYER_INITIALIZATION_FAILED="PLAYER_INITIALIZATION_FAILED",e.STATE_CHANGED="STATE_CHANGED",e.AUTOPLAY_FAILED="AUTOPLAY_FAILED",e.BEFORE_LIST_CHANGE="BEFORE_LIST_CHANGE",e.BEFORE_NEXT="BEFORE_NEXT",e.BEFORE_PREVIOUS="BEFORE_PREVIOUS",e.BEFORE_TRACK_LOAD="BEFORE_TRACK_LOAD",e.BUFFER_STALLED="BUFFER_STALLED",e.BUFFERING_START="BUFFERING_START",e.BUFFERING_END="BUFFERING_END",e.CAPPED="CAPPED",e.CLEARED="CLEARED",e.DISPLAYED_CUES_CHANGED="DISPLAYED_CUES_CHANGED",e.SUBTITLE_LANGUAGES_LOADED="SUBTITLE_LANGUAGES_LOADED",e.DURATION_CHANGED="DURATION_CHANGED",e.ERROR="ERROR",e.ERROR_SYNC="ERROR_SYNC",e.LIST_CHANGED="LIST_CHANGED",e.LIST_ENDED="LIST_ENDED",e.LOAD_VIDEO="LOAD_VIDEO",e.MAX_LIST_ERRORS_REACHED="MAX_LIST_ERRORS_REACHED",e.PAUSED="PAUSED",e.PLAYING="PLAYING",e.PLAYED_THRESHOLD_REACHED="PLAYED_THRESHOLD_REACHED",e.POSITION_CHANGED="POSITION_CHANGED",e.PROGRESS="PROGRESS",e.REPEAT_MODE_CHANGED="REPEAT_MODE_CHANGED",e.SHUFFLE_CHANGED="SHUFFLE_CHANGED",e.STOPPED="STOPPED",e.STOPPED_VIDEO="STOPPED_VIDEO",e.TRACKING_DATA_CREATED="TRACKING_DATA_CREATED",e.TRACKING_DATA_FINALIZED="TRACKING_DATA_FINALIZED",e.TRACK_ENDED="TRACK_ENDED",e.TRACK_LOADED="TRACK_LOADED",e.TRACK_TIMEOUT="TRACK_TIMEOUT",e.TRACK_UNPLAYABLE="TRACK_UNPLAYABLE",e.VOLUME_CHANGED="VOLUME_CHANGED",e.VIDEO_ELEMENT_APPENDED="VIDEO_ELEMENT_APPENDED",e.VIDEO_ELEMENT_REMOVED="VIDEO_ELEMENT_REMOVED",e.SPEED_CHANGED="SPEED_CHANGED"}(Lt||(Lt={}));const Pt={MP3:s.MP3,MP4:s.MP4,MP4_DUAL:s.MP4_DUAL,MP4_CBCS:s.MP4_CBCS,MP4_FLAC:s.MP4_FLAC,MANIFEST_ID:s.MANIFEST_ID};class kt{constructor(e){var t,n,i,o;if(this.isAd=!1,!e.uri)throw new TypeError("Missing required `uri` option.");if(!e.fileId&&!e.resolvedURL)throw new TypeError("Missing: provide either fileId or resolvedURL");this.uri=e.uri,this.playableURI=this.uri,this.fileId=e.fileId||"",this.playable=null===(t=e.playable)||void 0===t||t,this.mediaType=e.mediaType||"audio",this.metadata=e.metadata||{},this.resolvedURL=e.resolvedURL,this.noManifest=null!==(n=e.noManifest)&&void 0!==n?n:!!this.resolvedURL,this.noAuth=null!==(i=e.noAuth)&&void 0!==i&&i,this.preloadedManifest=e.preloadedManifest,this.licenseEndpoint=e.licenseEndpoint,this.fileFormat=e.fileFormat,this.poster=e.poster,this.options=e.options;const r=null!==(o=e.format)&&void 0!==o?o:"MP4";if(!Pt.hasOwnProperty(r))throw new TypeError("Invalid `format` option.");this.format=Pt[r],this.logData=Object.assign(Object.assign({},e.logData),{noLog:!1,noTSV:!0,noStats:!1})}static create(e){return new kt(e)}}class Dt{constructor(e){this._index=-1,this._tracks=[],this._tracks=e.tracks}static create(e){const t=[];for(const n of e.tracks)n instanceof kt?t.push(n):t.push(kt.create(n));return new Dt({tracks:t})}startAt(e){return e>this._tracks.length||e<0?this._index=-1:this._index=e-1,Promise.resolve(a.SUCCESS)}next(e,t){const n=this._index+1;if(n>=this._tracks.length)return Promise.resolve(e.listConstants.LIST_END);const i=this._tracks[n];return t||(this._index=n),i?Promise.resolve(i):Promise.reject(_t.NULL_VALUE)}peekNext(e){return this.next(e,!0)}allowSeeking(){return!0}previous(e){const t=this._index-1;if(t<0)return Promise.resolve(e.listConstants.LIST_START);const n=this._tracks[t];return this._index=t,n?Promise.resolve(n):Promise.reject(_t.NULL_VALUE)}setShuffle(){return Promise.resolve(a.SUCCESS)}setRepeatMode(){return Promise.resolve(a.SUCCESS)}}class wt extends d.vp{constructor(e){super(),this._playerPromise=e.playerPromise,this._listPlayer=e.listPlayer,this._transport=e.transport,this._autoActivateElement=!!e.autoActivateElement,this._init()}static create(e){return new wt(e)}_init(){const e=this._listPlayer;this.proxyEmitAll(e,{[i.LIST_PLAYER_AUTOPLAY_FAILED]:Lt.AUTOPLAY_FAILED,[i.LIST_PLAYER_BEFORE_LIST_CHANGE]:Lt.BEFORE_LIST_CHANGE,[i.LIST_PLAYER_BUFFER_STALLED]:Lt.BUFFER_STALLED,[i.LIST_PLAYER_BUFFERING_START]:Lt.BUFFERING_START,[i.LIST_PLAYER_BUFFERING_END]:Lt.BUFFERING_END,[i.LIST_PLAYER_CLEARED]:Lt.CLEARED,[i.LIST_PLAYER_DURATION_CHANGED]:Lt.DURATION_CHANGED,[i.LIST_PLAYER_ERROR]:Lt.ERROR,[i.LIST_PLAYER_LIST_CHANGED]:Lt.LIST_CHANGED,[i.LIST_PLAYER_LIST_ENDED]:Lt.LIST_ENDED,[i.LIST_PLAYER_MAX_LIST_ERRORS_REACHED]:Lt.MAX_LIST_ERRORS_REACHED,[i.LIST_PLAYER_PAUSED]:Lt.PAUSED,[i.LIST_PLAYER_PLAYING]:Lt.PLAYING,[i.LIST_PLAYER_PLAYED_THRESHOLD_REACHED]:Lt.PLAYED_THRESHOLD_REACHED,[i.LIST_PLAYER_POSITION_CHANGED]:Lt.POSITION_CHANGED,[i.LIST_PLAYER_PROGRESS]:Lt.PROGRESS,[i.LIST_PLAYER_REPEAT_MODE_CHANGED]:Lt.REPEAT_MODE_CHANGED,[i.LIST_PLAYER_SHUFFLE_CHANGED]:Lt.SHUFFLE_CHANGED,[i.LIST_PLAYER_STOPPED]:Lt.STOPPED,[i.LIST_PLAYER_TRACKING_DATA_CREATED]:Lt.TRACKING_DATA_CREATED,[i.LIST_PLAYER_TRACKING_DATA_FINALIZED]:Lt.TRACKING_DATA_FINALIZED,[i.LIST_PLAYER_TRACK_ENDED]:Lt.TRACK_ENDED,[i.LIST_PLAYER_TRACK_LOADED]:Lt.TRACK_LOADED,[i.LIST_PLAYER_TRACK_TIMEOUT]:Lt.TRACK_TIMEOUT,[i.LIST_PLAYER_TRACK_UNPLAYABLE]:Lt.TRACK_UNPLAYABLE,[i.LIST_PLAYER_VOLUME_CHANGED]:Lt.VOLUME_CHANGED,[i.LIST_PLAYER_VIDEO_ELEMENT_APPENDED]:Lt.VIDEO_ELEMENT_APPENDED,[i.LIST_PLAYER_VIDEO_ELEMENT_REMOVED]:Lt.VIDEO_ELEMENT_REMOVED,[i.LIST_PLAYER_AUTOPLAY_FAILED]:Lt.AUTOPLAY_FAILED,[i.PLAYER_DISPLAYED_CUES_CHANGED]:Lt.DISPLAYED_CUES_CHANGED,[i.PLAYER_SUBTITLE_LANGUAGES_LOADED]:Lt.SUBTITLE_LANGUAGES_LOADED,[i.PLAYER_PLAYBACK_SPEED_CHANGED]:Lt.SPEED_CHANGED}),this.proxyEmitAllSync(e,{[i.LIST_PLAYER_BEFORE_NEXT]:Lt.BEFORE_NEXT,[i.LIST_PLAYER_BEFORE_PREVIOUS]:Lt.BEFORE_PREVIOUS,[i.LIST_PLAYER_BEFORE_TRACK_LOAD]:Lt.BEFORE_TRACK_LOAD,[i.LIST_PLAYER_ERROR_SYNC]:Lt.ERROR_SYNC}),this._emitStateChanged=this._emitStateChanged.bind(this),this.on(Lt.CLEARED,this._emitStateChanged),this.on(Lt.PAUSED,this._emitStateChanged),this.on(Lt.PLAYING,this._emitStateChanged),this.on(Lt.POSITION_CHANGED,this._emitStateChanged),this.on(Lt.STOPPED,this._emitStateChanged),this.on(Lt.LIST_CHANGED,this._emitStateChanged),this.on(Lt.VOLUME_CHANGED,this._emitStateChanged),this.on(Lt.SPEED_CHANGED,this._emitStateChanged),this._playerPromise.then((()=>this.emit(Lt.PLAYER_INITIALIZATION_DONE,null))).catch((e=>this.emit(Lt.PLAYER_INITIALIZATION_FAILED,{error:e}))),this._transport.on(Rt.TransportEvent.BEFORE_ONLINE_DISCONNECT,(e=>{e.data.awaitPromise(this._listPlayer.stop(Et.END_PLAY).catch((e=>{})))}))}_emitStateChanged(){this._listPlayer.getState().then((e=>{this.emit(Lt.STATE_CHANGED,{state:e})}))}playTracks(e,t){return this._autoActivateElement&&this._listPlayer.activateElement(),new Promise((t=>{t(Dt.create({tracks:e}))})).then((e=>this._listPlayer.play(e,t)))}playList(e,t){return this._autoActivateElement&&this._listPlayer.activateElement(),this._listPlayer.play(e,t)}getState(){return this.getCurrentState()}getCurrentState(){return this._listPlayer.getState()}pause(){return this._listPlayer.pause()}resume(){return this._listPlayer.resume()}togglePlay(){return this._listPlayer.togglePlay()}stop(){return this._listPlayer.stop(Et.END_PLAY)}seek(e){return this._listPlayer.seek(e)}nextTrack(){return this._listPlayer.next(Et.FORWARD_BUTTON)}previousTrack(){return this._listPlayer.previous(Et.BACK_BUTTON)}getVolume(){return this._listPlayer.getVolume()}setVolume(e){return this._listPlayer.setVolume(e)}setPlaybackSpeed(e){return this._listPlayer.setPlaybackSpeed(e)}activateElement(){return this._listPlayer.activateElement()}hideSubtitles(){return this._listPlayer.hideSubtitles()}showSubtitles(){return this._listPlayer.showSubtitles()}getSubtitleLanguages(){return this._listPlayer.getSubtitleLanguages()}setSubtitleLanguage(e){return this._listPlayer.setSubtitleLanguage(e)}areSubtitlesShown(){return this._listPlayer.areSubtitlesShown()}getActiveSubtitleLanguage(){return this._listPlayer.getActiveSubtitleLanguage()}getMediaConfig(){return this._listPlayer.getMediaConfig()}deactivateSubtitleEvents(){return this._listPlayer.deactivateCueEvents()}activateSubtitleEvents(){return this._listPlayer.activateCueEvents()}}const Mt={tagged:"2.17.0-84926a3",version:"2.17.0",revision:"84926a3"},xt=(Object.assign(Object.assign({},Rt.TransportErrors),r),kt.create),Ut=Dt.create;function Vt(e){var t,n,i;const{transport:o,autoActivateElement:r,config:a}=e,s=null==a?void 0:a.mux,c=Nt(Object.assign(Object.assign({},e.config),{loggerOptions:{platform:e.platform_identifier,disableMux:null===(n=null!==(t=null==s?void 0:s.disable)&&void 0!==t?t:null==a?void 0:a.disableMux)||void 0===n||n,muxEnvKey:null!==(i=null==s?void 0:s.envKey)&&void 0!==i?i:null==a?void 0:a.muxEnvKey,muxCustomDimensions:null==s?void 0:s.customDimensions,deviceInfo:null==s?void 0:s.deviceInfo},sdkId:`overture:${Mt.version}`,transport:o.toPublic(),audioProcessorOptions:{disable:!0}})).then((e=>e.player)),l=It.create({trackPlayer:c});return wt.create({listPlayer:l,playerPromise:c,transport:o,autoActivateElement:r})}},72232:(e,t,n)=>{"use strict";n.d(t,{B3:()=>ue,_c:()=>y,ow:()=>ie,Ky:()=>re,Op:()=>J,vY:()=>q,Sh:()=>T,hA:()=>se,rf:()=>I});n(46758),n(27082),n(86277),n(2836);var i=n(3959),o=n(9590),r=n.n(o);const a={encode:(e,t=r().Writer.create())=>(void 0!==e.identifier&&""!==e.identifier&&t.uint32(10).string(e.identifier),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={identifier:""};for(;n.pos>>3==1)o.identifier=n.string();else n.skipType(7&e)}return o},fromJSON:e=>({identifier:d(e.identifier)?String(e.identifier):""}),toJSON(e){const t={};return void 0!==e.identifier&&(t.identifier=e.identifier),t},fromPartial(e){const t={identifier:""};return t.identifier=e.identifier??"",t}};function s(){return{identifier:"",revision:new Uint8Array}}const c={encode:(e,t=r().Writer.create())=>(void 0!==e.identifier&&""!==e.identifier&&t.uint32(10).string(e.identifier),void 0!==e.revision&&0!==e.revision.length&&t.uint32(18).bytes(e.revision),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=s();for(;n.pos>>3){case 1:o.identifier=n.string();break;case 2:o.revision=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({identifier:d(e.identifier)?String(e.identifier):"",revision:d(e.revision)?u(e.revision):new Uint8Array}),toJSON(e){const t={};return void 0!==e.identifier&&(t.identifier=e.identifier),void 0!==e.revision&&(t.revision=function(e){if(l.Buffer)return l.Buffer.from(e).toString("base64");{const t=[];return e.forEach((e=>{t.push(String.fromCharCode(e))})),l.btoa(t.join(""))}}(void 0!==e.revision?e.revision:new Uint8Array)),t},fromPartial(e){const t=s();return t.identifier=e.identifier??"",t.revision=e.revision??new Uint8Array,t}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function u(e){if(l.Buffer)return Uint8Array.from(l.Buffer.from(e,"base64"));{const t=l.atob(e),n=new Uint8Array(t.length);for(let e=0;e>>3){case 1:o.canView=n.bool();break;case 2:o.canAdministratePermissions=n.bool();break;case 3:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({canView:!!_(e.canView)&&Boolean(e.canView),canAdministratePermissions:!!_(e.canAdministratePermissions)&&Boolean(e.canAdministratePermissions),grantableLevel:Array.isArray(e?.grantableLevel)?e.grantableLevel.map((e=>f(e))):[],canEditMetadata:!!_(e.canEditMetadata)&&Boolean(e.canEditMetadata),canEditItems:!!_(e.canEditItems)&&Boolean(e.canEditItems),canCancelMembership:!!_(e.canCancelMembership)&&Boolean(e.canCancelMembership)}),toJSON(e){const t={};return void 0!==e.canView&&(t.canView=e.canView),void 0!==e.canAdministratePermissions&&(t.canAdministratePermissions=e.canAdministratePermissions),e.grantableLevel?t.grantableLevel=e.grantableLevel.map((e=>h(e))):t.grantableLevel=[],void 0!==e.canEditMetadata&&(t.canEditMetadata=e.canEditMetadata),void 0!==e.canEditItems&&(t.canEditItems=e.canEditItems),void 0!==e.canCancelMembership&&(t.canCancelMembership=e.canCancelMembership),t},fromPartial(e){const t={canView:!1,canAdministratePermissions:!1,grantableLevel:[],canEditMetadata:!1,canEditItems:!1,canCancelMembership:!1};return t.canView=e.canView??!1,t.canAdministratePermissions=e.canAdministratePermissions??!1,t.grantableLevel=e.grantableLevel?.map((e=>e))||[],t.canEditMetadata=e.canEditMetadata??!1,t.canEditItems=e.canEditItems??!1,t.canCancelMembership=e.canCancelMembership??!1,t}};var g=(()=>{if(void 0!==g)return g;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function _(e){return null!=e}r().util.Long!==i.Z&&(r().util.Long=i.Z,r().configure());var v=n(26285);let y=function(e){return e[e.LIST_UNKNOWN=0]="LIST_UNKNOWN",e[e.LIST_NAME=1]="LIST_NAME",e[e.LIST_DESCRIPTION=2]="LIST_DESCRIPTION",e[e.LIST_PICTURE=3]="LIST_PICTURE",e[e.LIST_COLLABORATIVE=4]="LIST_COLLABORATIVE",e[e.LIST_PL3_VERSION=5]="LIST_PL3_VERSION",e[e.LIST_DELETED_BY_OWNER=6]="LIST_DELETED_BY_OWNER",e[e.LIST_CLIENT_ID=10]="LIST_CLIENT_ID",e[e.LIST_FORMAT=11]="LIST_FORMAT",e[e.LIST_FORMAT_ATTRIBUTES=12]="LIST_FORMAT_ATTRIBUTES",e[e.LIST_PICTURE_SIZE=13]="LIST_PICTURE_SIZE",e[e.LIST_SEQUENCE_CONTEXT_TEMPLATE=14]="LIST_SEQUENCE_CONTEXT_TEMPLATE",e[e.LIST_AI_CURATION_REFERENCE_ID=15]="LIST_AI_CURATION_REFERENCE_ID",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});let E=function(e){return e[e.ITEM_UNKNOWN=0]="ITEM_UNKNOWN",e[e.ITEM_ADDED_BY=1]="ITEM_ADDED_BY",e[e.ITEM_TIMESTAMP=2]="ITEM_TIMESTAMP",e[e.ITEM_SEEN_AT=9]="ITEM_SEEN_AT",e[e.ITEM_PUBLIC=10]="ITEM_PUBLIC",e[e.ITEM_FORMAT_ATTRIBUTES=11]="ITEM_FORMAT_ATTRIBUTES",e[e.ITEM_ID=12]="ITEM_ID",e[e.ITEM_SOURCE_LENS=13]="ITEM_SOURCE_LENS",e[e.ITEM_AVAILABLE_SIGNALS=14]="ITEM_AVAILABLE_SIGNALS",e[e.ITEM_RECOMMENDATION_INFO=15]="ITEM_RECOMMENDATION_INFO",e[e.ITEM_SEQUENCE_CHILD_TEMPLATE=16]="ITEM_SEQUENCE_CHILD_TEMPLATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});let b=function(e){return e[e.GEOBLOCK_BLOCKING_TYPE_UNSPECIFIED=0]="GEOBLOCK_BLOCKING_TYPE_UNSPECIFIED",e[e.GEOBLOCK_BLOCKING_TYPE_TITLE=1]="GEOBLOCK_BLOCKING_TYPE_TITLE",e[e.GEOBLOCK_BLOCKING_TYPE_DESCRIPTION=2]="GEOBLOCK_BLOCKING_TYPE_DESCRIPTION",e[e.GEOBLOCK_BLOCKING_TYPE_IMAGE=3]="GEOBLOCK_BLOCKING_TYPE_IMAGE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function S(e){switch(e){case 0:case"GEOBLOCK_BLOCKING_TYPE_UNSPECIFIED":return b.GEOBLOCK_BLOCKING_TYPE_UNSPECIFIED;case 1:case"GEOBLOCK_BLOCKING_TYPE_TITLE":return b.GEOBLOCK_BLOCKING_TYPE_TITLE;case 2:case"GEOBLOCK_BLOCKING_TYPE_DESCRIPTION":return b.GEOBLOCK_BLOCKING_TYPE_DESCRIPTION;case 3:case"GEOBLOCK_BLOCKING_TYPE_IMAGE":return b.GEOBLOCK_BLOCKING_TYPE_IMAGE;default:return b.UNRECOGNIZED}}function A(e){switch(e){case b.GEOBLOCK_BLOCKING_TYPE_UNSPECIFIED:return 0;case b.GEOBLOCK_BLOCKING_TYPE_TITLE:return 1;case b.GEOBLOCK_BLOCKING_TYPE_DESCRIPTION:return 2;case b.GEOBLOCK_BLOCKING_TYPE_IMAGE:return 3;case b.UNRECOGNIZED:default:return-1}}let T=function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.ADD=2]="ADD",e[e.REM=3]="REM",e[e.MOV=4]="MOV",e[e.UPDATE_ITEM_ATTRIBUTES=5]="UPDATE_ITEM_ATTRIBUTES",e[e.UPDATE_LIST_ATTRIBUTES=6]="UPDATE_LIST_ATTRIBUTES",e[e.UPDATE_ITEM_URIS=7]="UPDATE_ITEM_URIS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function O(e){switch(e){case 0:case"KIND_UNKNOWN":return T.KIND_UNKNOWN;case 2:case"ADD":return T.ADD;case 3:case"REM":return T.REM;case 4:case"MOV":return T.MOV;case 5:case"UPDATE_ITEM_ATTRIBUTES":return T.UPDATE_ITEM_ATTRIBUTES;case 6:case"UPDATE_LIST_ATTRIBUTES":return T.UPDATE_LIST_ATTRIBUTES;case 7:case"UPDATE_ITEM_URIS":return T.UPDATE_ITEM_URIS;default:return T.UNRECOGNIZED}}let I=function(e){return e[e.CLIENT_UNKNOWN=0]="CLIENT_UNKNOWN",e[e.NATIVE_HERMES=1]="NATIVE_HERMES",e[e.CLIENT=2]="CLIENT",e[e.PYTHON=3]="PYTHON",e[e.JAVA=4]="JAVA",e[e.WEBPLAYER=5]="WEBPLAYER",e[e.LIBSPOTIFY=6]="LIBSPOTIFY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function C(e){switch(e){case 0:case"CLIENT_UNKNOWN":return I.CLIENT_UNKNOWN;case 1:case"NATIVE_HERMES":return I.NATIVE_HERMES;case 2:case"CLIENT":return I.CLIENT;case 3:case"PYTHON":return I.PYTHON;case 4:case"JAVA":return I.JAVA;case 5:case"WEBPLAYER":return I.WEBPLAYER;case 6:case"LIBSPOTIFY":return I.LIBSPOTIFY;default:return I.UNRECOGNIZED}}const N={encode:(e,t=r().Writer.create())=>(void 0!==e.uri&&""!==e.uri&&t.uint32(10).string(e.uri),void 0!==e.attributes&&V.encode(e.attributes,t.uint32(18).fork()).ldelim(),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={uri:"",attributes:void 0};for(;n.pos>>3){case 1:o.uri=n.string();break;case 2:o.attributes=V.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({uri:me(e.uri)?String(e.uri):"",attributes:me(e.attributes)?V.fromJSON(e.attributes):void 0}),toJSON(e){const t={};return void 0!==e.uri&&(t.uri=e.uri),void 0!==e.attributes&&(t.attributes=e.attributes?V.toJSON(e.attributes):void 0),t},fromPartial(e){const t={uri:"",attributes:void 0};return t.uri=e.uri??"",t.attributes=void 0!==e.attributes&&null!==e.attributes?V.fromPartial(e.attributes):void 0,t}};function L(){return{revision:new Uint8Array,attributes:void 0,length:0,timestamp:"0",ownerUsername:"",abuseReportingEnabled:!1,capabilities:void 0,geoblock:[]}}const R={encode(e,t=r().Writer.create()){if(void 0!==e.revision&&0!==e.revision.length&&t.uint32(10).bytes(e.revision),void 0!==e.attributes&&x.encode(e.attributes,t.uint32(18).fork()).ldelim(),void 0!==e.length&&0!==e.length&&t.uint32(24).int32(e.length),void 0!==e.timestamp&&"0"!==e.timestamp&&t.uint32(32).int64(e.timestamp),void 0!==e.ownerUsername&&""!==e.ownerUsername&&t.uint32(42).string(e.ownerUsername),!0===e.abuseReportingEnabled&&t.uint32(48).bool(e.abuseReportingEnabled),void 0!==e.capabilities&&m.encode(e.capabilities,t.uint32(58).fork()).ldelim(),void 0!==e.geoblock&&0!==e.geoblock.length){t.uint32(66).fork();for(const n of e.geoblock)t.int32(n);t.ldelim()}return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=L();for(;n.pos>>3){case 1:o.revision=n.bytes();break;case 2:o.attributes=x.decode(n,n.uint32());break;case 3:o.length=n.int32();break;case 4:o.timestamp=he(n.int64());break;case 5:o.ownerUsername=n.string();break;case 6:o.abuseReportingEnabled=n.bool();break;case 7:o.capabilities=m.decode(n,n.uint32());break;case 8:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({revision:me(e.revision)?pe(e.revision):new Uint8Array,attributes:me(e.attributes)?x.fromJSON(e.attributes):void 0,length:me(e.length)?Number(e.length):0,timestamp:me(e.timestamp)?String(e.timestamp):"0",ownerUsername:me(e.ownerUsername)?String(e.ownerUsername):"",abuseReportingEnabled:!!me(e.abuseReportingEnabled)&&Boolean(e.abuseReportingEnabled),capabilities:me(e.capabilities)?m.fromJSON(e.capabilities):void 0,geoblock:Array.isArray(e?.geoblock)?e.geoblock.map((e=>S(e))):[]}),toJSON(e){const t={};return void 0!==e.revision&&(t.revision=fe(void 0!==e.revision?e.revision:new Uint8Array)),void 0!==e.attributes&&(t.attributes=e.attributes?x.toJSON(e.attributes):void 0),void 0!==e.length&&(t.length=Math.round(e.length)),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.ownerUsername&&(t.ownerUsername=e.ownerUsername),void 0!==e.abuseReportingEnabled&&(t.abuseReportingEnabled=e.abuseReportingEnabled),void 0!==e.capabilities&&(t.capabilities=e.capabilities?m.toJSON(e.capabilities):void 0),e.geoblock?t.geoblock=e.geoblock.map((e=>A(e))):t.geoblock=[],t},fromPartial(e){const t=L();return t.revision=e.revision??new Uint8Array,t.attributes=void 0!==e.attributes&&null!==e.attributes?x.fromPartial(e.attributes):void 0,t.length=e.length??0,t.timestamp=e.timestamp??"0",t.ownerUsername=e.ownerUsername??"",t.abuseReportingEnabled=e.abuseReportingEnabled??!1,t.capabilities=void 0!==e.capabilities&&null!==e.capabilities?m.fromPartial(e.capabilities):void 0,t.geoblock=e.geoblock?.map((e=>e))||[],t}};const P={encode(e,t=r().Writer.create()){if(void 0!==e.pos&&0!==e.pos&&t.uint32(8).int32(e.pos),!0===e.truncated&&t.uint32(16).bool(e.truncated),void 0!==e.items&&0!==e.items.length)for(const n of e.items)N.encode(n,t.uint32(26).fork()).ldelim();if(void 0!==e.metaItems&&0!==e.metaItems.length)for(const n of e.metaItems)R.encode(n,t.uint32(34).fork()).ldelim();if(void 0!==e.availableSignals&&0!==e.availableSignals.length)for(const n of e.availableSignals)v.MZ.encode(n,t.uint32(42).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={pos:0,truncated:!1,items:[],metaItems:[],availableSignals:[]};for(;n.pos>>3){case 1:o.pos=n.int32();break;case 2:o.truncated=n.bool();break;case 3:o.items.push(N.decode(n,n.uint32()));break;case 4:o.metaItems.push(R.decode(n,n.uint32()));break;case 5:o.availableSignals.push(v.MZ.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON:e=>({pos:me(e.pos)?Number(e.pos):0,truncated:!!me(e.truncated)&&Boolean(e.truncated),items:Array.isArray(e?.items)?e.items.map((e=>N.fromJSON(e))):[],metaItems:Array.isArray(e?.metaItems)?e.metaItems.map((e=>R.fromJSON(e))):[],availableSignals:Array.isArray(e?.availableSignals)?e.availableSignals.map((e=>v.MZ.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.pos&&(t.pos=Math.round(e.pos)),void 0!==e.truncated&&(t.truncated=e.truncated),e.items?t.items=e.items.map((e=>e?N.toJSON(e):void 0)):t.items=[],e.metaItems?t.metaItems=e.metaItems.map((e=>e?R.toJSON(e):void 0)):t.metaItems=[],e.availableSignals?t.availableSignals=e.availableSignals.map((e=>e?v.MZ.toJSON(e):void 0)):t.availableSignals=[],t},fromPartial(e){const t={pos:0,truncated:!1,items:[],metaItems:[],availableSignals:[]};return t.pos=e.pos??0,t.truncated=e.truncated??!1,t.items=e.items?.map((e=>N.fromPartial(e)))||[],t.metaItems=e.metaItems?.map((e=>R.fromPartial(e)))||[],t.availableSignals=e.availableSignals?.map((e=>v.MZ.fromPartial(e)))||[],t}};const k={encode:(e,t=r().Writer.create())=>(void 0!==e.key&&""!==e.key&&t.uint32(10).string(e.key),void 0!==e.value&&""!==e.value&&t.uint32(18).string(e.value),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={key:"",value:""};for(;n.pos>>3){case 1:o.key=n.string();break;case 2:o.value=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({key:me(e.key)?String(e.key):"",value:me(e.value)?String(e.value):""}),toJSON(e){const t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.value&&(t.value=e.value),t},fromPartial(e){const t={key:"",value:""};return t.key=e.key??"",t.value=e.value??"",t}};const D={encode:(e,t=r().Writer.create())=>(void 0!==e.targetName&&""!==e.targetName&&t.uint32(10).string(e.targetName),void 0!==e.url&&""!==e.url&&t.uint32(18).string(e.url),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={targetName:"",url:""};for(;n.pos>>3){case 1:o.targetName=n.string();break;case 2:o.url=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({targetName:me(e.targetName)?String(e.targetName):"",url:me(e.url)?String(e.url):""}),toJSON(e){const t={};return void 0!==e.targetName&&(t.targetName=e.targetName),void 0!==e.url&&(t.url=e.url),t},fromPartial(e){const t={targetName:"",url:""};return t.targetName=e.targetName??"",t.url=e.url??"",t}};const w={encode:(e,t=r().Writer.create())=>(!0===e.isRecommendation&&t.uint32(8).bool(e.isRecommendation),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={isRecommendation:!1};for(;n.pos>>3==1)o.isRecommendation=n.bool();else n.skipType(7&e)}return o},fromJSON:e=>({isRecommendation:!!me(e.isRecommendation)&&Boolean(e.isRecommendation)}),toJSON(e){const t={};return void 0!==e.isRecommendation&&(t.isRecommendation=e.isRecommendation),t},fromPartial(e){const t={isRecommendation:!1};return t.isRecommendation=e.isRecommendation??!1,t}};function M(){return{name:"",description:"",picture:new Uint8Array,collaborative:!1,pl3Version:"",deletedByOwner:!1,clientId:"",format:"",formatAttributes:[],pictureSize:[],sequenceContextTemplate:new Uint8Array,aiCurationReferenceId:new Uint8Array}}const x={encode(e,t=r().Writer.create()){if(void 0!==e.name&&""!==e.name&&t.uint32(10).string(e.name),void 0!==e.description&&""!==e.description&&t.uint32(18).string(e.description),void 0!==e.picture&&0!==e.picture.length&&t.uint32(26).bytes(e.picture),!0===e.collaborative&&t.uint32(32).bool(e.collaborative),void 0!==e.pl3Version&&""!==e.pl3Version&&t.uint32(42).string(e.pl3Version),!0===e.deletedByOwner&&t.uint32(48).bool(e.deletedByOwner),void 0!==e.clientId&&""!==e.clientId&&t.uint32(82).string(e.clientId),void 0!==e.format&&""!==e.format&&t.uint32(90).string(e.format),void 0!==e.formatAttributes&&0!==e.formatAttributes.length)for(const n of e.formatAttributes)k.encode(n,t.uint32(98).fork()).ldelim();if(void 0!==e.pictureSize&&0!==e.pictureSize.length)for(const n of e.pictureSize)D.encode(n,t.uint32(106).fork()).ldelim();return void 0!==e.sequenceContextTemplate&&0!==e.sequenceContextTemplate.length&&t.uint32(114).bytes(e.sequenceContextTemplate),void 0!==e.aiCurationReferenceId&&0!==e.aiCurationReferenceId.length&&t.uint32(122).bytes(e.aiCurationReferenceId),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=M();for(;n.pos>>3){case 1:o.name=n.string();break;case 2:o.description=n.string();break;case 3:o.picture=n.bytes();break;case 4:o.collaborative=n.bool();break;case 5:o.pl3Version=n.string();break;case 6:o.deletedByOwner=n.bool();break;case 10:o.clientId=n.string();break;case 11:o.format=n.string();break;case 12:o.formatAttributes.push(k.decode(n,n.uint32()));break;case 13:o.pictureSize.push(D.decode(n,n.uint32()));break;case 14:o.sequenceContextTemplate=n.bytes();break;case 15:o.aiCurationReferenceId=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({name:me(e.name)?String(e.name):"",description:me(e.description)?String(e.description):"",picture:me(e.picture)?pe(e.picture):new Uint8Array,collaborative:!!me(e.collaborative)&&Boolean(e.collaborative),pl3Version:me(e.pl3Version)?String(e.pl3Version):"",deletedByOwner:!!me(e.deletedByOwner)&&Boolean(e.deletedByOwner),clientId:me(e.clientId)?String(e.clientId):"",format:me(e.format)?String(e.format):"",formatAttributes:Array.isArray(e?.formatAttributes)?e.formatAttributes.map((e=>k.fromJSON(e))):[],pictureSize:Array.isArray(e?.pictureSize)?e.pictureSize.map((e=>D.fromJSON(e))):[],sequenceContextTemplate:me(e.sequenceContextTemplate)?pe(e.sequenceContextTemplate):new Uint8Array,aiCurationReferenceId:me(e.aiCurationReferenceId)?pe(e.aiCurationReferenceId):new Uint8Array}),toJSON(e){const t={};return void 0!==e.name&&(t.name=e.name),void 0!==e.description&&(t.description=e.description),void 0!==e.picture&&(t.picture=fe(void 0!==e.picture?e.picture:new Uint8Array)),void 0!==e.collaborative&&(t.collaborative=e.collaborative),void 0!==e.pl3Version&&(t.pl3Version=e.pl3Version),void 0!==e.deletedByOwner&&(t.deletedByOwner=e.deletedByOwner),void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.format&&(t.format=e.format),e.formatAttributes?t.formatAttributes=e.formatAttributes.map((e=>e?k.toJSON(e):void 0)):t.formatAttributes=[],e.pictureSize?t.pictureSize=e.pictureSize.map((e=>e?D.toJSON(e):void 0)):t.pictureSize=[],void 0!==e.sequenceContextTemplate&&(t.sequenceContextTemplate=fe(void 0!==e.sequenceContextTemplate?e.sequenceContextTemplate:new Uint8Array)),void 0!==e.aiCurationReferenceId&&(t.aiCurationReferenceId=fe(void 0!==e.aiCurationReferenceId?e.aiCurationReferenceId:new Uint8Array)),t},fromPartial(e){const t=M();return t.name=e.name??"",t.description=e.description??"",t.picture=e.picture??new Uint8Array,t.collaborative=e.collaborative??!1,t.pl3Version=e.pl3Version??"",t.deletedByOwner=e.deletedByOwner??!1,t.clientId=e.clientId??"",t.format=e.format??"",t.formatAttributes=e.formatAttributes?.map((e=>k.fromPartial(e)))||[],t.pictureSize=e.pictureSize?.map((e=>D.fromPartial(e)))||[],t.sequenceContextTemplate=e.sequenceContextTemplate??new Uint8Array,t.aiCurationReferenceId=e.aiCurationReferenceId??new Uint8Array,t}};function U(){return{addedBy:"",timestamp:"0",seenAt:"0",public:!1,formatAttributes:[],itemId:new Uint8Array,sourceLens:void 0,availableSignals:[],recommendationInfo:void 0,sequenceChildTemplate:new Uint8Array}}const V={encode(e,t=r().Writer.create()){if(void 0!==e.addedBy&&""!==e.addedBy&&t.uint32(10).string(e.addedBy),void 0!==e.timestamp&&"0"!==e.timestamp&&t.uint32(16).int64(e.timestamp),void 0!==e.seenAt&&"0"!==e.seenAt&&t.uint32(72).int64(e.seenAt),!0===e.public&&t.uint32(80).bool(e.public),void 0!==e.formatAttributes&&0!==e.formatAttributes.length)for(const n of e.formatAttributes)k.encode(n,t.uint32(90).fork()).ldelim();if(void 0!==e.itemId&&0!==e.itemId.length&&t.uint32(98).bytes(e.itemId),void 0!==e.sourceLens&&a.encode(e.sourceLens,t.uint32(106).fork()).ldelim(),void 0!==e.availableSignals&&0!==e.availableSignals.length)for(const n of e.availableSignals)v.MZ.encode(n,t.uint32(114).fork()).ldelim();return void 0!==e.recommendationInfo&&w.encode(e.recommendationInfo,t.uint32(122).fork()).ldelim(),void 0!==e.sequenceChildTemplate&&0!==e.sequenceChildTemplate.length&&t.uint32(130).bytes(e.sequenceChildTemplate),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=U();for(;n.pos>>3){case 1:o.addedBy=n.string();break;case 2:o.timestamp=he(n.int64());break;case 9:o.seenAt=he(n.int64());break;case 10:o.public=n.bool();break;case 11:o.formatAttributes.push(k.decode(n,n.uint32()));break;case 12:o.itemId=n.bytes();break;case 13:o.sourceLens=a.decode(n,n.uint32());break;case 14:o.availableSignals.push(v.MZ.decode(n,n.uint32()));break;case 15:o.recommendationInfo=w.decode(n,n.uint32());break;case 16:o.sequenceChildTemplate=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({addedBy:me(e.addedBy)?String(e.addedBy):"",timestamp:me(e.timestamp)?String(e.timestamp):"0",seenAt:me(e.seenAt)?String(e.seenAt):"0",public:!!me(e.public)&&Boolean(e.public),formatAttributes:Array.isArray(e?.formatAttributes)?e.formatAttributes.map((e=>k.fromJSON(e))):[],itemId:me(e.itemId)?pe(e.itemId):new Uint8Array,sourceLens:me(e.sourceLens)?a.fromJSON(e.sourceLens):void 0,availableSignals:Array.isArray(e?.availableSignals)?e.availableSignals.map((e=>v.MZ.fromJSON(e))):[],recommendationInfo:me(e.recommendationInfo)?w.fromJSON(e.recommendationInfo):void 0,sequenceChildTemplate:me(e.sequenceChildTemplate)?pe(e.sequenceChildTemplate):new Uint8Array}),toJSON(e){const t={};return void 0!==e.addedBy&&(t.addedBy=e.addedBy),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.seenAt&&(t.seenAt=e.seenAt),void 0!==e.public&&(t.public=e.public),e.formatAttributes?t.formatAttributes=e.formatAttributes.map((e=>e?k.toJSON(e):void 0)):t.formatAttributes=[],void 0!==e.itemId&&(t.itemId=fe(void 0!==e.itemId?e.itemId:new Uint8Array)),void 0!==e.sourceLens&&(t.sourceLens=e.sourceLens?a.toJSON(e.sourceLens):void 0),e.availableSignals?t.availableSignals=e.availableSignals.map((e=>e?v.MZ.toJSON(e):void 0)):t.availableSignals=[],void 0!==e.recommendationInfo&&(t.recommendationInfo=e.recommendationInfo?w.toJSON(e.recommendationInfo):void 0),void 0!==e.sequenceChildTemplate&&(t.sequenceChildTemplate=fe(void 0!==e.sequenceChildTemplate?e.sequenceChildTemplate:new Uint8Array)),t},fromPartial(e){const t=U();return t.addedBy=e.addedBy??"",t.timestamp=e.timestamp??"0",t.seenAt=e.seenAt??"0",t.public=e.public??!1,t.formatAttributes=e.formatAttributes?.map((e=>k.fromPartial(e)))||[],t.itemId=e.itemId??new Uint8Array,t.sourceLens=void 0!==e.sourceLens&&null!==e.sourceLens?a.fromPartial(e.sourceLens):void 0,t.availableSignals=e.availableSignals?.map((e=>v.MZ.fromPartial(e)))||[],t.recommendationInfo=void 0!==e.recommendationInfo&&null!==e.recommendationInfo?w.fromPartial(e.recommendationInfo):void 0,t.sequenceChildTemplate=e.sequenceChildTemplate??new Uint8Array,t}};const F={encode(e,t=r().Writer.create()){if(void 0!==e.fromIndex&&0!==e.fromIndex&&t.uint32(8).int32(e.fromIndex),void 0!==e.items&&0!==e.items.length)for(const n of e.items)N.encode(n,t.uint32(18).fork()).ldelim();return!0===e.addLast&&t.uint32(32).bool(e.addLast),!0===e.addFirst&&t.uint32(40).bool(e.addFirst),void 0!==e.addBeforeItem&&N.encode(e.addBeforeItem,t.uint32(50).fork()).ldelim(),void 0!==e.addAfterItem&&N.encode(e.addAfterItem,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={fromIndex:0,items:[],addLast:!1,addFirst:!1,addBeforeItem:void 0,addAfterItem:void 0};for(;n.pos>>3){case 1:o.fromIndex=n.int32();break;case 2:o.items.push(N.decode(n,n.uint32()));break;case 4:o.addLast=n.bool();break;case 5:o.addFirst=n.bool();break;case 6:o.addBeforeItem=N.decode(n,n.uint32());break;case 7:o.addAfterItem=N.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({fromIndex:me(e.fromIndex)?Number(e.fromIndex):0,items:Array.isArray(e?.items)?e.items.map((e=>N.fromJSON(e))):[],addLast:!!me(e.addLast)&&Boolean(e.addLast),addFirst:!!me(e.addFirst)&&Boolean(e.addFirst),addBeforeItem:me(e.addBeforeItem)?N.fromJSON(e.addBeforeItem):void 0,addAfterItem:me(e.addAfterItem)?N.fromJSON(e.addAfterItem):void 0}),toJSON(e){const t={};return void 0!==e.fromIndex&&(t.fromIndex=Math.round(e.fromIndex)),e.items?t.items=e.items.map((e=>e?N.toJSON(e):void 0)):t.items=[],void 0!==e.addLast&&(t.addLast=e.addLast),void 0!==e.addFirst&&(t.addFirst=e.addFirst),void 0!==e.addBeforeItem&&(t.addBeforeItem=e.addBeforeItem?N.toJSON(e.addBeforeItem):void 0),void 0!==e.addAfterItem&&(t.addAfterItem=e.addAfterItem?N.toJSON(e.addAfterItem):void 0),t},fromPartial(e){const t={fromIndex:0,items:[],addLast:!1,addFirst:!1,addBeforeItem:void 0,addAfterItem:void 0};return t.fromIndex=e.fromIndex??0,t.items=e.items?.map((e=>N.fromPartial(e)))||[],t.addLast=e.addLast??!1,t.addFirst=e.addFirst??!1,t.addBeforeItem=void 0!==e.addBeforeItem&&null!==e.addBeforeItem?N.fromPartial(e.addBeforeItem):void 0,t.addAfterItem=void 0!==e.addAfterItem&&null!==e.addAfterItem?N.fromPartial(e.addAfterItem):void 0,t}};const B={encode(e,t=r().Writer.create()){if(void 0!==e.fromIndex&&0!==e.fromIndex&&t.uint32(8).int32(e.fromIndex),void 0!==e.length&&0!==e.length&&t.uint32(16).int32(e.length),void 0!==e.items&&0!==e.items.length)for(const n of e.items)N.encode(n,t.uint32(26).fork()).ldelim();return!0===e.itemsAsKey&&t.uint32(56).bool(e.itemsAsKey),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={fromIndex:0,length:0,items:[],itemsAsKey:!1};for(;n.pos>>3){case 1:o.fromIndex=n.int32();break;case 2:o.length=n.int32();break;case 3:o.items.push(N.decode(n,n.uint32()));break;case 7:o.itemsAsKey=n.bool();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({fromIndex:me(e.fromIndex)?Number(e.fromIndex):0,length:me(e.length)?Number(e.length):0,items:Array.isArray(e?.items)?e.items.map((e=>N.fromJSON(e))):[],itemsAsKey:!!me(e.itemsAsKey)&&Boolean(e.itemsAsKey)}),toJSON(e){const t={};return void 0!==e.fromIndex&&(t.fromIndex=Math.round(e.fromIndex)),void 0!==e.length&&(t.length=Math.round(e.length)),e.items?t.items=e.items.map((e=>e?N.toJSON(e):void 0)):t.items=[],void 0!==e.itemsAsKey&&(t.itemsAsKey=e.itemsAsKey),t},fromPartial(e){const t={fromIndex:0,length:0,items:[],itemsAsKey:!1};return t.fromIndex=e.fromIndex??0,t.length=e.length??0,t.items=e.items?.map((e=>N.fromPartial(e)))||[],t.itemsAsKey=e.itemsAsKey??!1,t}};const H={encode(e,t=r().Writer.create()){if(void 0!==e.fromIndex&&0!==e.fromIndex&&t.uint32(8).int32(e.fromIndex),void 0!==e.length&&0!==e.length&&t.uint32(16).int32(e.length),void 0!==e.toIndex&&0!==e.toIndex&&t.uint32(24).int32(e.toIndex),void 0!==e.items&&0!==e.items.length)for(const n of e.items)N.encode(n,t.uint32(34).fork()).ldelim();return void 0!==e.addBeforeItem&&N.encode(e.addBeforeItem,t.uint32(42).fork()).ldelim(),void 0!==e.addAfterItem&&N.encode(e.addAfterItem,t.uint32(50).fork()).ldelim(),!0===e.addFirst&&t.uint32(56).bool(e.addFirst),!0===e.addLast&&t.uint32(64).bool(e.addLast),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={fromIndex:0,length:0,toIndex:0,items:[],addBeforeItem:void 0,addAfterItem:void 0,addFirst:!1,addLast:!1};for(;n.pos>>3){case 1:o.fromIndex=n.int32();break;case 2:o.length=n.int32();break;case 3:o.toIndex=n.int32();break;case 4:o.items.push(N.decode(n,n.uint32()));break;case 5:o.addBeforeItem=N.decode(n,n.uint32());break;case 6:o.addAfterItem=N.decode(n,n.uint32());break;case 7:o.addFirst=n.bool();break;case 8:o.addLast=n.bool();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({fromIndex:me(e.fromIndex)?Number(e.fromIndex):0,length:me(e.length)?Number(e.length):0,toIndex:me(e.toIndex)?Number(e.toIndex):0,items:Array.isArray(e?.items)?e.items.map((e=>N.fromJSON(e))):[],addBeforeItem:me(e.addBeforeItem)?N.fromJSON(e.addBeforeItem):void 0,addAfterItem:me(e.addAfterItem)?N.fromJSON(e.addAfterItem):void 0,addFirst:!!me(e.addFirst)&&Boolean(e.addFirst),addLast:!!me(e.addLast)&&Boolean(e.addLast)}),toJSON(e){const t={};return void 0!==e.fromIndex&&(t.fromIndex=Math.round(e.fromIndex)),void 0!==e.length&&(t.length=Math.round(e.length)),void 0!==e.toIndex&&(t.toIndex=Math.round(e.toIndex)),e.items?t.items=e.items.map((e=>e?N.toJSON(e):void 0)):t.items=[],void 0!==e.addBeforeItem&&(t.addBeforeItem=e.addBeforeItem?N.toJSON(e.addBeforeItem):void 0),void 0!==e.addAfterItem&&(t.addAfterItem=e.addAfterItem?N.toJSON(e.addAfterItem):void 0),void 0!==e.addFirst&&(t.addFirst=e.addFirst),void 0!==e.addLast&&(t.addLast=e.addLast),t},fromPartial(e){const t={fromIndex:0,length:0,toIndex:0,items:[],addBeforeItem:void 0,addAfterItem:void 0,addFirst:!1,addLast:!1};return t.fromIndex=e.fromIndex??0,t.length=e.length??0,t.toIndex=e.toIndex??0,t.items=e.items?.map((e=>N.fromPartial(e)))||[],t.addBeforeItem=void 0!==e.addBeforeItem&&null!==e.addBeforeItem?N.fromPartial(e.addBeforeItem):void 0,t.addAfterItem=void 0!==e.addAfterItem&&null!==e.addAfterItem?N.fromPartial(e.addAfterItem):void 0,t.addFirst=e.addFirst??!1,t.addLast=e.addLast??!1,t}};const G={encode(e,t=r().Writer.create()){if(void 0!==e.values&&V.encode(e.values,t.uint32(10).fork()).ldelim(),void 0!==e.noValue&&0!==e.noValue.length){t.uint32(18).fork();for(const n of e.noValue)t.int32(n);t.ldelim()}return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={values:void 0,noValue:[]};for(;n.pos>>3){case 1:o.values=V.decode(n,n.uint32());break;case 2:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({values:me(e.values)?V.fromJSON(e.values):void 0,noValue:Array.isArray(e?.noValue)?e.noValue.map((e=>function(e){switch(e){case 0:case"ITEM_UNKNOWN":return E.ITEM_UNKNOWN;case 1:case"ITEM_ADDED_BY":return E.ITEM_ADDED_BY;case 2:case"ITEM_TIMESTAMP":return E.ITEM_TIMESTAMP;case 9:case"ITEM_SEEN_AT":return E.ITEM_SEEN_AT;case 10:case"ITEM_PUBLIC":return E.ITEM_PUBLIC;case 11:case"ITEM_FORMAT_ATTRIBUTES":return E.ITEM_FORMAT_ATTRIBUTES;case 12:case"ITEM_ID":return E.ITEM_ID;case 13:case"ITEM_SOURCE_LENS":return E.ITEM_SOURCE_LENS;case 14:case"ITEM_AVAILABLE_SIGNALS":return E.ITEM_AVAILABLE_SIGNALS;case 15:case"ITEM_RECOMMENDATION_INFO":return E.ITEM_RECOMMENDATION_INFO;case 16:case"ITEM_SEQUENCE_CHILD_TEMPLATE":return E.ITEM_SEQUENCE_CHILD_TEMPLATE;default:return E.UNRECOGNIZED}}(e))):[]}),toJSON(e){const t={};return void 0!==e.values&&(t.values=e.values?V.toJSON(e.values):void 0),e.noValue?t.noValue=e.noValue.map((e=>function(e){switch(e){case E.ITEM_UNKNOWN:return 0;case E.ITEM_ADDED_BY:return 1;case E.ITEM_TIMESTAMP:return 2;case E.ITEM_SEEN_AT:return 9;case E.ITEM_PUBLIC:return 10;case E.ITEM_FORMAT_ATTRIBUTES:return 11;case E.ITEM_ID:return 12;case E.ITEM_SOURCE_LENS:return 13;case E.ITEM_AVAILABLE_SIGNALS:return 14;case E.ITEM_RECOMMENDATION_INFO:return 15;case E.ITEM_SEQUENCE_CHILD_TEMPLATE:return 16;case E.UNRECOGNIZED:default:return-1}}(e))):t.noValue=[],t},fromPartial(e){const t={values:void 0,noValue:[]};return t.values=void 0!==e.values&&null!==e.values?V.fromPartial(e.values):void 0,t.noValue=e.noValue?.map((e=>e))||[],t}};const K={encode(e,t=r().Writer.create()){if(void 0!==e.values&&x.encode(e.values,t.uint32(10).fork()).ldelim(),void 0!==e.noValue&&0!==e.noValue.length){t.uint32(18).fork();for(const n of e.noValue)t.int32(n);t.ldelim()}return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={values:void 0,noValue:[]};for(;n.pos>>3){case 1:o.values=x.decode(n,n.uint32());break;case 2:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({values:me(e.values)?x.fromJSON(e.values):void 0,noValue:Array.isArray(e?.noValue)?e.noValue.map((e=>function(e){switch(e){case 0:case"LIST_UNKNOWN":return y.LIST_UNKNOWN;case 1:case"LIST_NAME":return y.LIST_NAME;case 2:case"LIST_DESCRIPTION":return y.LIST_DESCRIPTION;case 3:case"LIST_PICTURE":return y.LIST_PICTURE;case 4:case"LIST_COLLABORATIVE":return y.LIST_COLLABORATIVE;case 5:case"LIST_PL3_VERSION":return y.LIST_PL3_VERSION;case 6:case"LIST_DELETED_BY_OWNER":return y.LIST_DELETED_BY_OWNER;case 10:case"LIST_CLIENT_ID":return y.LIST_CLIENT_ID;case 11:case"LIST_FORMAT":return y.LIST_FORMAT;case 12:case"LIST_FORMAT_ATTRIBUTES":return y.LIST_FORMAT_ATTRIBUTES;case 13:case"LIST_PICTURE_SIZE":return y.LIST_PICTURE_SIZE;case 14:case"LIST_SEQUENCE_CONTEXT_TEMPLATE":return y.LIST_SEQUENCE_CONTEXT_TEMPLATE;case 15:case"LIST_AI_CURATION_REFERENCE_ID":return y.LIST_AI_CURATION_REFERENCE_ID;default:return y.UNRECOGNIZED}}(e))):[]}),toJSON(e){const t={};return void 0!==e.values&&(t.values=e.values?x.toJSON(e.values):void 0),e.noValue?t.noValue=e.noValue.map((e=>function(e){switch(e){case y.LIST_UNKNOWN:return 0;case y.LIST_NAME:return 1;case y.LIST_DESCRIPTION:return 2;case y.LIST_PICTURE:return 3;case y.LIST_COLLABORATIVE:return 4;case y.LIST_PL3_VERSION:return 5;case y.LIST_DELETED_BY_OWNER:return 6;case y.LIST_CLIENT_ID:return 10;case y.LIST_FORMAT:return 11;case y.LIST_FORMAT_ATTRIBUTES:return 12;case y.LIST_PICTURE_SIZE:return 13;case y.LIST_SEQUENCE_CONTEXT_TEMPLATE:return 14;case y.LIST_AI_CURATION_REFERENCE_ID:return 15;case y.UNRECOGNIZED:default:return-1}}(e))):t.noValue=[],t},fromPartial(e){const t={values:void 0,noValue:[]};return t.values=void 0!==e.values&&null!==e.values?x.fromPartial(e.values):void 0,t.noValue=e.noValue?.map((e=>e))||[],t}};const W={encode:(e,t=r().Writer.create())=>(void 0!==e.index&&0!==e.index&&t.uint32(8).int32(e.index),void 0!==e.newAttributes&&G.encode(e.newAttributes,t.uint32(18).fork()).ldelim(),void 0!==e.oldAttributes&&G.encode(e.oldAttributes,t.uint32(26).fork()).ldelim(),void 0!==e.item&&N.encode(e.item,t.uint32(34).fork()).ldelim(),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={index:0,newAttributes:void 0,oldAttributes:void 0,item:void 0};for(;n.pos>>3){case 1:o.index=n.int32();break;case 2:o.newAttributes=G.decode(n,n.uint32());break;case 3:o.oldAttributes=G.decode(n,n.uint32());break;case 4:o.item=N.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({index:me(e.index)?Number(e.index):0,newAttributes:me(e.newAttributes)?G.fromJSON(e.newAttributes):void 0,oldAttributes:me(e.oldAttributes)?G.fromJSON(e.oldAttributes):void 0,item:me(e.item)?N.fromJSON(e.item):void 0}),toJSON(e){const t={};return void 0!==e.index&&(t.index=Math.round(e.index)),void 0!==e.newAttributes&&(t.newAttributes=e.newAttributes?G.toJSON(e.newAttributes):void 0),void 0!==e.oldAttributes&&(t.oldAttributes=e.oldAttributes?G.toJSON(e.oldAttributes):void 0),void 0!==e.item&&(t.item=e.item?N.toJSON(e.item):void 0),t},fromPartial(e){const t={index:0,newAttributes:void 0,oldAttributes:void 0,item:void 0};return t.index=e.index??0,t.newAttributes=void 0!==e.newAttributes&&null!==e.newAttributes?G.fromPartial(e.newAttributes):void 0,t.oldAttributes=void 0!==e.oldAttributes&&null!==e.oldAttributes?G.fromPartial(e.oldAttributes):void 0,t.item=void 0!==e.item&&null!==e.item?N.fromPartial(e.item):void 0,t}};const Y={encode:(e,t=r().Writer.create())=>(void 0!==e.newAttributes&&K.encode(e.newAttributes,t.uint32(10).fork()).ldelim(),void 0!==e.oldAttributes&&K.encode(e.oldAttributes,t.uint32(18).fork()).ldelim(),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={newAttributes:void 0,oldAttributes:void 0};for(;n.pos>>3){case 1:o.newAttributes=K.decode(n,n.uint32());break;case 2:o.oldAttributes=K.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({newAttributes:me(e.newAttributes)?K.fromJSON(e.newAttributes):void 0,oldAttributes:me(e.oldAttributes)?K.fromJSON(e.oldAttributes):void 0}),toJSON(e){const t={};return void 0!==e.newAttributes&&(t.newAttributes=e.newAttributes?K.toJSON(e.newAttributes):void 0),void 0!==e.oldAttributes&&(t.oldAttributes=e.oldAttributes?K.toJSON(e.oldAttributes):void 0),t},fromPartial(e){const t={newAttributes:void 0,oldAttributes:void 0};return t.newAttributes=void 0!==e.newAttributes&&null!==e.newAttributes?K.fromPartial(e.newAttributes):void 0,t.oldAttributes=void 0!==e.oldAttributes&&null!==e.oldAttributes?K.fromPartial(e.oldAttributes):void 0,t}};const j={encode(e,t=r().Writer.create()){if(void 0!==e.uriReplacements&&0!==e.uriReplacements.length)for(const n of e.uriReplacements)z.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={uriReplacements:[]};for(;n.pos>>3==1)o.uriReplacements.push(z.decode(n,n.uint32()));else n.skipType(7&e)}return o},fromJSON:e=>({uriReplacements:Array.isArray(e?.uriReplacements)?e.uriReplacements.map((e=>z.fromJSON(e))):[]}),toJSON(e){const t={};return e.uriReplacements?t.uriReplacements=e.uriReplacements.map((e=>e?z.toJSON(e):void 0)):t.uriReplacements=[],t},fromPartial(e){const t={uriReplacements:[]};return t.uriReplacements=e.uriReplacements?.map((e=>z.fromPartial(e)))||[],t}};const z={encode:(e,t=r().Writer.create())=>(void 0!==e.index&&0!==e.index&&t.uint32(8).int32(e.index),void 0!==e.item&&N.encode(e.item,t.uint32(18).fork()).ldelim(),void 0!==e.newUri&&""!==e.newUri&&t.uint32(26).string(e.newUri),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={index:0,item:void 0,newUri:""};for(;n.pos>>3){case 1:o.index=n.int32();break;case 2:o.item=N.decode(n,n.uint32());break;case 3:o.newUri=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({index:me(e.index)?Number(e.index):0,item:me(e.item)?N.fromJSON(e.item):void 0,newUri:me(e.newUri)?String(e.newUri):""}),toJSON(e){const t={};return void 0!==e.index&&(t.index=Math.round(e.index)),void 0!==e.item&&(t.item=e.item?N.toJSON(e.item):void 0),void 0!==e.newUri&&(t.newUri=e.newUri),t},fromPartial(e){const t={index:0,item:void 0,newUri:""};return t.index=e.index??0,t.item=void 0!==e.item&&null!==e.item?N.fromPartial(e.item):void 0,t.newUri=e.newUri??"",t}};const J={encode:(e,t=r().Writer.create())=>(void 0!==e.kind&&0!==e.kind&&t.uint32(8).int32(e.kind),void 0!==e.add&&F.encode(e.add,t.uint32(18).fork()).ldelim(),void 0!==e.rem&&B.encode(e.rem,t.uint32(26).fork()).ldelim(),void 0!==e.mov&&H.encode(e.mov,t.uint32(34).fork()).ldelim(),void 0!==e.updateItemAttributes&&W.encode(e.updateItemAttributes,t.uint32(42).fork()).ldelim(),void 0!==e.updateListAttributes&&Y.encode(e.updateListAttributes,t.uint32(50).fork()).ldelim(),void 0!==e.updateItemUris&&j.encode(e.updateItemUris,t.uint32(58).fork()).ldelim(),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={kind:0,add:void 0,rem:void 0,mov:void 0,updateItemAttributes:void 0,updateListAttributes:void 0,updateItemUris:void 0};for(;n.pos>>3){case 1:o.kind=n.int32();break;case 2:o.add=F.decode(n,n.uint32());break;case 3:o.rem=B.decode(n,n.uint32());break;case 4:o.mov=H.decode(n,n.uint32());break;case 5:o.updateItemAttributes=W.decode(n,n.uint32());break;case 6:o.updateListAttributes=Y.decode(n,n.uint32());break;case 7:o.updateItemUris=j.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({kind:me(e.kind)?O(e.kind):0,add:me(e.add)?F.fromJSON(e.add):void 0,rem:me(e.rem)?B.fromJSON(e.rem):void 0,mov:me(e.mov)?H.fromJSON(e.mov):void 0,updateItemAttributes:me(e.updateItemAttributes)?W.fromJSON(e.updateItemAttributes):void 0,updateListAttributes:me(e.updateListAttributes)?Y.fromJSON(e.updateListAttributes):void 0,updateItemUris:me(e.updateItemUris)?j.fromJSON(e.updateItemUris):void 0}),toJSON(e){const t={};return void 0!==e.kind&&(t.kind=function(e){switch(e){case T.KIND_UNKNOWN:return 0;case T.ADD:return 2;case T.REM:return 3;case T.MOV:return 4;case T.UPDATE_ITEM_ATTRIBUTES:return 5;case T.UPDATE_LIST_ATTRIBUTES:return 6;case T.UPDATE_ITEM_URIS:return 7;case T.UNRECOGNIZED:default:return-1}}(e.kind)),void 0!==e.add&&(t.add=e.add?F.toJSON(e.add):void 0),void 0!==e.rem&&(t.rem=e.rem?B.toJSON(e.rem):void 0),void 0!==e.mov&&(t.mov=e.mov?H.toJSON(e.mov):void 0),void 0!==e.updateItemAttributes&&(t.updateItemAttributes=e.updateItemAttributes?W.toJSON(e.updateItemAttributes):void 0),void 0!==e.updateListAttributes&&(t.updateListAttributes=e.updateListAttributes?Y.toJSON(e.updateListAttributes):void 0),void 0!==e.updateItemUris&&(t.updateItemUris=e.updateItemUris?j.toJSON(e.updateItemUris):void 0),t},fromPartial(e){const t={kind:0,add:void 0,rem:void 0,mov:void 0,updateItemAttributes:void 0,updateListAttributes:void 0,updateItemUris:void 0};return t.kind=e.kind??0,t.add=void 0!==e.add&&null!==e.add?F.fromPartial(e.add):void 0,t.rem=void 0!==e.rem&&null!==e.rem?B.fromPartial(e.rem):void 0,t.mov=void 0!==e.mov&&null!==e.mov?H.fromPartial(e.mov):void 0,t.updateItemAttributes=void 0!==e.updateItemAttributes&&null!==e.updateItemAttributes?W.fromPartial(e.updateItemAttributes):void 0,t.updateListAttributes=void 0!==e.updateListAttributes&&null!==e.updateListAttributes?Y.fromPartial(e.updateListAttributes):void 0,t.updateItemUris=void 0!==e.updateItemUris&&null!==e.updateItemUris?j.fromPartial(e.updateItemUris):void 0,t}};const q={encode(e,t=r().Writer.create()){if(void 0!==e.ops&&0!==e.ops.length)for(const n of e.ops)J.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={ops:[]};for(;n.pos>>3==1)o.ops.push(J.decode(n,n.uint32()));else n.skipType(7&e)}return o},fromJSON:e=>({ops:Array.isArray(e?.ops)?e.ops.map((e=>J.fromJSON(e))):[]}),toJSON(e){const t={};return e.ops?t.ops=e.ops.map((e=>e?J.toJSON(e):void 0)):t.ops=[],t},fromPartial(e){const t={ops:[]};return t.ops=e.ops?.map((e=>J.fromPartial(e)))||[],t}};const X={encode:(e,t=r().Writer.create())=>(void 0!==e.user&&""!==e.user&&t.uint32(10).string(e.user),void 0!==e.timestamp&&"0"!==e.timestamp&&t.uint32(16).int64(e.timestamp),!0===e.admin&&t.uint32(24).bool(e.admin),!0===e.undo&&t.uint32(32).bool(e.undo),!0===e.redo&&t.uint32(40).bool(e.redo),!0===e.merge&&t.uint32(48).bool(e.merge),!0===e.compressed&&t.uint32(56).bool(e.compressed),!0===e.migration&&t.uint32(64).bool(e.migration),void 0!==e.splitId&&0!==e.splitId&&t.uint32(72).int32(e.splitId),void 0!==e.source&&Z.encode(e.source,t.uint32(82).fork()).ldelim(),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={user:"",timestamp:"0",admin:!1,undo:!1,redo:!1,merge:!1,compressed:!1,migration:!1,splitId:0,source:void 0};for(;n.pos>>3){case 1:o.user=n.string();break;case 2:o.timestamp=he(n.int64());break;case 3:o.admin=n.bool();break;case 4:o.undo=n.bool();break;case 5:o.redo=n.bool();break;case 6:o.merge=n.bool();break;case 7:o.compressed=n.bool();break;case 8:o.migration=n.bool();break;case 9:o.splitId=n.int32();break;case 10:o.source=Z.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({user:me(e.user)?String(e.user):"",timestamp:me(e.timestamp)?String(e.timestamp):"0",admin:!!me(e.admin)&&Boolean(e.admin),undo:!!me(e.undo)&&Boolean(e.undo),redo:!!me(e.redo)&&Boolean(e.redo),merge:!!me(e.merge)&&Boolean(e.merge),compressed:!!me(e.compressed)&&Boolean(e.compressed),migration:!!me(e.migration)&&Boolean(e.migration),splitId:me(e.splitId)?Number(e.splitId):0,source:me(e.source)?Z.fromJSON(e.source):void 0}),toJSON(e){const t={};return void 0!==e.user&&(t.user=e.user),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.admin&&(t.admin=e.admin),void 0!==e.undo&&(t.undo=e.undo),void 0!==e.redo&&(t.redo=e.redo),void 0!==e.merge&&(t.merge=e.merge),void 0!==e.compressed&&(t.compressed=e.compressed),void 0!==e.migration&&(t.migration=e.migration),void 0!==e.splitId&&(t.splitId=Math.round(e.splitId)),void 0!==e.source&&(t.source=e.source?Z.toJSON(e.source):void 0),t},fromPartial(e){const t={user:"",timestamp:"0",admin:!1,undo:!1,redo:!1,merge:!1,compressed:!1,migration:!1,splitId:0,source:void 0};return t.user=e.user??"",t.timestamp=e.timestamp??"0",t.admin=e.admin??!1,t.undo=e.undo??!1,t.redo=e.redo??!1,t.merge=e.merge??!1,t.compressed=e.compressed??!1,t.migration=e.migration??!1,t.splitId=e.splitId??0,t.source=void 0!==e.source&&null!==e.source?Z.fromPartial(e.source):void 0,t}};const Z={encode:(e,t=r().Writer.create())=>(void 0!==e.client&&0!==e.client&&t.uint32(8).int32(e.client),void 0!==e.app&&""!==e.app&&t.uint32(26).string(e.app),void 0!==e.source&&""!==e.source&&t.uint32(34).string(e.source),void 0!==e.version&&""!==e.version&&t.uint32(42).string(e.version),void 0!==e.serverDomain&&""!==e.serverDomain&&t.uint32(50).string(e.serverDomain),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={client:0,app:"",source:"",version:"",serverDomain:""};for(;n.pos>>3){case 1:o.client=n.int32();break;case 3:o.app=n.string();break;case 4:o.source=n.string();break;case 5:o.version=n.string();break;case 6:o.serverDomain=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({client:me(e.client)?C(e.client):0,app:me(e.app)?String(e.app):"",source:me(e.source)?String(e.source):"",version:me(e.version)?String(e.version):"",serverDomain:me(e.serverDomain)?String(e.serverDomain):""}),toJSON(e){const t={};return void 0!==e.client&&(t.client=function(e){switch(e){case I.CLIENT_UNKNOWN:return 0;case I.NATIVE_HERMES:return 1;case I.CLIENT:return 2;case I.PYTHON:return 3;case I.JAVA:return 4;case I.WEBPLAYER:return 5;case I.LIBSPOTIFY:return 6;case I.UNRECOGNIZED:default:return-1}}(e.client)),void 0!==e.app&&(t.app=e.app),void 0!==e.source&&(t.source=e.source),void 0!==e.version&&(t.version=e.version),void 0!==e.serverDomain&&(t.serverDomain=e.serverDomain),t},fromPartial(e){const t={client:0,app:"",source:"",version:"",serverDomain:""};return t.client=e.client??0,t.app=e.app??"",t.source=e.source??"",t.version=e.version??"",t.serverDomain=e.serverDomain??"",t}};function Q(){return{baseVersion:new Uint8Array,ops:[],info:void 0}}const $={encode(e,t=r().Writer.create()){if(void 0!==e.baseVersion&&0!==e.baseVersion.length&&t.uint32(10).bytes(e.baseVersion),void 0!==e.ops&&0!==e.ops.length)for(const n of e.ops)J.encode(n,t.uint32(18).fork()).ldelim();return void 0!==e.info&&X.encode(e.info,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=Q();for(;n.pos>>3){case 1:o.baseVersion=n.bytes();break;case 2:o.ops.push(J.decode(n,n.uint32()));break;case 4:o.info=X.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({baseVersion:me(e.baseVersion)?pe(e.baseVersion):new Uint8Array,ops:Array.isArray(e?.ops)?e.ops.map((e=>J.fromJSON(e))):[],info:me(e.info)?X.fromJSON(e.info):void 0}),toJSON(e){const t={};return void 0!==e.baseVersion&&(t.baseVersion=fe(void 0!==e.baseVersion?e.baseVersion:new Uint8Array)),e.ops?t.ops=e.ops.map((e=>e?J.toJSON(e):void 0)):t.ops=[],void 0!==e.info&&(t.info=e.info?X.toJSON(e.info):void 0),t},fromPartial(e){const t=Q();return t.baseVersion=e.baseVersion??new Uint8Array,t.ops=e.ops?.map((e=>J.fromPartial(e)))||[],t.info=void 0!==e.info&&null!==e.info?X.fromPartial(e.info):void 0,t}};function ee(){return{fromRevision:new Uint8Array,ops:[],toRevision:new Uint8Array}}const te={encode(e,t=r().Writer.create()){if(void 0!==e.fromRevision&&0!==e.fromRevision.length&&t.uint32(10).bytes(e.fromRevision),void 0!==e.ops&&0!==e.ops.length)for(const n of e.ops)J.encode(n,t.uint32(18).fork()).ldelim();return void 0!==e.toRevision&&0!==e.toRevision.length&&t.uint32(26).bytes(e.toRevision),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=ee();for(;n.pos>>3){case 1:o.fromRevision=n.bytes();break;case 2:o.ops.push(J.decode(n,n.uint32()));break;case 3:o.toRevision=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({fromRevision:me(e.fromRevision)?pe(e.fromRevision):new Uint8Array,ops:Array.isArray(e?.ops)?e.ops.map((e=>J.fromJSON(e))):[],toRevision:me(e.toRevision)?pe(e.toRevision):new Uint8Array}),toJSON(e){const t={};return void 0!==e.fromRevision&&(t.fromRevision=fe(void 0!==e.fromRevision?e.fromRevision:new Uint8Array)),e.ops?t.ops=e.ops.map((e=>e?J.toJSON(e):void 0)):t.ops=[],void 0!==e.toRevision&&(t.toRevision=fe(void 0!==e.toRevision?e.toRevision:new Uint8Array)),t},fromPartial(e){const t=ee();return t.fromRevision=e.fromRevision??new Uint8Array,t.ops=e.ops?.map((e=>J.fromPartial(e)))||[],t.toRevision=e.toRevision??new Uint8Array,t}};function ne(){return{baseRevision:new Uint8Array,deltas:[],wantResultingRevisions:!1,wantSyncResult:!1,nonces:[]}}const ie={encode(e,t=r().Writer.create()){if(void 0!==e.baseRevision&&0!==e.baseRevision.length&&t.uint32(10).bytes(e.baseRevision),void 0!==e.deltas&&0!==e.deltas.length)for(const n of e.deltas)$.encode(n,t.uint32(18).fork()).ldelim();if(!0===e.wantResultingRevisions&&t.uint32(24).bool(e.wantResultingRevisions),!0===e.wantSyncResult&&t.uint32(32).bool(e.wantSyncResult),void 0!==e.nonces&&0!==e.nonces.length){t.uint32(50).fork();for(const n of e.nonces)t.int64(n);t.ldelim()}return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=ne();for(;n.pos>>3){case 1:o.baseRevision=n.bytes();break;case 2:o.deltas.push($.decode(n,n.uint32()));break;case 3:o.wantResultingRevisions=n.bool();break;case 4:o.wantSyncResult=n.bool();break;case 6:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({baseRevision:me(e.baseRevision)?pe(e.baseRevision):new Uint8Array,deltas:Array.isArray(e?.deltas)?e.deltas.map((e=>$.fromJSON(e))):[],wantResultingRevisions:!!me(e.wantResultingRevisions)&&Boolean(e.wantResultingRevisions),wantSyncResult:!!me(e.wantSyncResult)&&Boolean(e.wantSyncResult),nonces:Array.isArray(e?.nonces)?e.nonces.map((e=>String(e))):[]}),toJSON(e){const t={};return void 0!==e.baseRevision&&(t.baseRevision=fe(void 0!==e.baseRevision?e.baseRevision:new Uint8Array)),e.deltas?t.deltas=e.deltas.map((e=>e?$.toJSON(e):void 0)):t.deltas=[],void 0!==e.wantResultingRevisions&&(t.wantResultingRevisions=e.wantResultingRevisions),void 0!==e.wantSyncResult&&(t.wantSyncResult=e.wantSyncResult),e.nonces?t.nonces=e.nonces.map((e=>e)):t.nonces=[],t},fromPartial(e){const t=ne();return t.baseRevision=e.baseRevision??new Uint8Array,t.deltas=e.deltas?.map((e=>$.fromPartial(e)))||[],t.wantResultingRevisions=e.wantResultingRevisions??!1,t.wantSyncResult=e.wantSyncResult??!1,t.nonces=e.nonces?.map((e=>e))||[],t}};function oe(){return{baseRevision:new Uint8Array,emittedSignals:[]}}const re={encode(e,t=r().Writer.create()){if(void 0!==e.baseRevision&&0!==e.baseRevision.length&&t.uint32(10).bytes(e.baseRevision),void 0!==e.emittedSignals&&0!==e.emittedSignals.length)for(const n of e.emittedSignals)v.MZ.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=oe();for(;n.pos>>3){case 1:o.baseRevision=n.bytes();break;case 2:o.emittedSignals.push(v.MZ.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON:e=>({baseRevision:me(e.baseRevision)?pe(e.baseRevision):new Uint8Array,emittedSignals:Array.isArray(e?.emittedSignals)?e.emittedSignals.map((e=>v.MZ.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.baseRevision&&(t.baseRevision=fe(void 0!==e.baseRevision?e.baseRevision:new Uint8Array)),e.emittedSignals?t.emittedSignals=e.emittedSignals.map((e=>e?v.MZ.toJSON(e):void 0)):t.emittedSignals=[],t},fromPartial(e){const t=oe();return t.baseRevision=e.baseRevision??new Uint8Array,t.emittedSignals=e.emittedSignals?.map((e=>v.MZ.fromPartial(e)))||[],t}};function ae(){return{revision:new Uint8Array,length:0,attributes:void 0,contents:void 0,diff:void 0,syncResult:void 0,resultingRevisions:[],multipleHeads:!1,upToDate:!1,nonces:[],timestamp:"0",ownerUsername:"",abuseReportingEnabled:!1,capabilities:void 0,geoblock:[],changesRequireResync:!1,createdAt:"0",appliedLenses:void 0}}const se={encode(e,t=r().Writer.create()){if(void 0!==e.revision&&0!==e.revision.length&&t.uint32(10).bytes(e.revision),void 0!==e.length&&0!==e.length&&t.uint32(16).int32(e.length),void 0!==e.attributes&&x.encode(e.attributes,t.uint32(26).fork()).ldelim(),void 0!==e.contents&&P.encode(e.contents,t.uint32(42).fork()).ldelim(),void 0!==e.diff&&te.encode(e.diff,t.uint32(50).fork()).ldelim(),void 0!==e.syncResult&&te.encode(e.syncResult,t.uint32(58).fork()).ldelim(),void 0!==e.resultingRevisions&&0!==e.resultingRevisions.length)for(const n of e.resultingRevisions)t.uint32(66).bytes(n);if(!0===e.multipleHeads&&t.uint32(72).bool(e.multipleHeads),!0===e.upToDate&&t.uint32(80).bool(e.upToDate),void 0!==e.nonces&&0!==e.nonces.length){t.uint32(114).fork();for(const n of e.nonces)t.int64(n);t.ldelim()}if(void 0!==e.timestamp&&"0"!==e.timestamp&&t.uint32(120).int64(e.timestamp),void 0!==e.ownerUsername&&""!==e.ownerUsername&&t.uint32(130).string(e.ownerUsername),!0===e.abuseReportingEnabled&&t.uint32(136).bool(e.abuseReportingEnabled),void 0!==e.capabilities&&m.encode(e.capabilities,t.uint32(146).fork()).ldelim(),void 0!==e.geoblock&&0!==e.geoblock.length){t.uint32(154).fork();for(const n of e.geoblock)t.int32(n);t.ldelim()}return!0===e.changesRequireResync&&t.uint32(160).bool(e.changesRequireResync),void 0!==e.createdAt&&"0"!==e.createdAt&&t.uint32(168).int64(e.createdAt),void 0!==e.appliedLenses&&ce.encode(e.appliedLenses,t.uint32(178).fork()).ldelim(),t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=ae();for(;n.pos>>3){case 1:o.revision=n.bytes();break;case 2:o.length=n.int32();break;case 3:o.attributes=x.decode(n,n.uint32());break;case 5:o.contents=P.decode(n,n.uint32());break;case 6:o.diff=te.decode(n,n.uint32());break;case 7:o.syncResult=te.decode(n,n.uint32());break;case 8:o.resultingRevisions.push(n.bytes());break;case 9:o.multipleHeads=n.bool();break;case 10:o.upToDate=n.bool();break;case 14:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos({revision:me(e.revision)?pe(e.revision):new Uint8Array,length:me(e.length)?Number(e.length):0,attributes:me(e.attributes)?x.fromJSON(e.attributes):void 0,contents:me(e.contents)?P.fromJSON(e.contents):void 0,diff:me(e.diff)?te.fromJSON(e.diff):void 0,syncResult:me(e.syncResult)?te.fromJSON(e.syncResult):void 0,resultingRevisions:Array.isArray(e?.resultingRevisions)?e.resultingRevisions.map((e=>pe(e))):[],multipleHeads:!!me(e.multipleHeads)&&Boolean(e.multipleHeads),upToDate:!!me(e.upToDate)&&Boolean(e.upToDate),nonces:Array.isArray(e?.nonces)?e.nonces.map((e=>String(e))):[],timestamp:me(e.timestamp)?String(e.timestamp):"0",ownerUsername:me(e.ownerUsername)?String(e.ownerUsername):"",abuseReportingEnabled:!!me(e.abuseReportingEnabled)&&Boolean(e.abuseReportingEnabled),capabilities:me(e.capabilities)?m.fromJSON(e.capabilities):void 0,geoblock:Array.isArray(e?.geoblock)?e.geoblock.map((e=>S(e))):[],changesRequireResync:!!me(e.changesRequireResync)&&Boolean(e.changesRequireResync),createdAt:me(e.createdAt)?String(e.createdAt):"0",appliedLenses:me(e.appliedLenses)?ce.fromJSON(e.appliedLenses):void 0}),toJSON(e){const t={};return void 0!==e.revision&&(t.revision=fe(void 0!==e.revision?e.revision:new Uint8Array)),void 0!==e.length&&(t.length=Math.round(e.length)),void 0!==e.attributes&&(t.attributes=e.attributes?x.toJSON(e.attributes):void 0),void 0!==e.contents&&(t.contents=e.contents?P.toJSON(e.contents):void 0),void 0!==e.diff&&(t.diff=e.diff?te.toJSON(e.diff):void 0),void 0!==e.syncResult&&(t.syncResult=e.syncResult?te.toJSON(e.syncResult):void 0),e.resultingRevisions?t.resultingRevisions=e.resultingRevisions.map((e=>fe(void 0!==e?e:new Uint8Array))):t.resultingRevisions=[],void 0!==e.multipleHeads&&(t.multipleHeads=e.multipleHeads),void 0!==e.upToDate&&(t.upToDate=e.upToDate),e.nonces?t.nonces=e.nonces.map((e=>e)):t.nonces=[],void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.ownerUsername&&(t.ownerUsername=e.ownerUsername),void 0!==e.abuseReportingEnabled&&(t.abuseReportingEnabled=e.abuseReportingEnabled),void 0!==e.capabilities&&(t.capabilities=e.capabilities?m.toJSON(e.capabilities):void 0),e.geoblock?t.geoblock=e.geoblock.map((e=>A(e))):t.geoblock=[],void 0!==e.changesRequireResync&&(t.changesRequireResync=e.changesRequireResync),void 0!==e.createdAt&&(t.createdAt=e.createdAt),void 0!==e.appliedLenses&&(t.appliedLenses=e.appliedLenses?ce.toJSON(e.appliedLenses):void 0),t},fromPartial(e){const t=ae();return t.revision=e.revision??new Uint8Array,t.length=e.length??0,t.attributes=void 0!==e.attributes&&null!==e.attributes?x.fromPartial(e.attributes):void 0,t.contents=void 0!==e.contents&&null!==e.contents?P.fromPartial(e.contents):void 0,t.diff=void 0!==e.diff&&null!==e.diff?te.fromPartial(e.diff):void 0,t.syncResult=void 0!==e.syncResult&&null!==e.syncResult?te.fromPartial(e.syncResult):void 0,t.resultingRevisions=e.resultingRevisions?.map((e=>e))||[],t.multipleHeads=e.multipleHeads??!1,t.upToDate=e.upToDate??!1,t.nonces=e.nonces?.map((e=>e))||[],t.timestamp=e.timestamp??"0",t.ownerUsername=e.ownerUsername??"",t.abuseReportingEnabled=e.abuseReportingEnabled??!1,t.capabilities=void 0!==e.capabilities&&null!==e.capabilities?m.fromPartial(e.capabilities):void 0,t.geoblock=e.geoblock?.map((e=>e))||[],t.changesRequireResync=e.changesRequireResync??!1,t.createdAt=e.createdAt??"0",t.appliedLenses=void 0!==e.appliedLenses&&null!==e.appliedLenses?ce.fromPartial(e.appliedLenses):void 0,t}};const ce={encode(e,t=r().Writer.create()){if(void 0!==e.states&&0!==e.states.length)for(const n of e.states)c.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={states:[]};for(;n.pos>>3==1)o.states.push(c.decode(n,n.uint32()));else n.skipType(7&e)}return o},fromJSON:e=>({states:Array.isArray(e?.states)?e.states.map((e=>c.fromJSON(e))):[]}),toJSON(e){const t={};return e.states?t.states=e.states.map((e=>e?c.toJSON(e):void 0)):t.states=[],t},fromPartial(e){const t={states:[]};return t.states=e.states?.map((e=>c.fromPartial(e)))||[],t}};function le(){return{uri:"",revision:new Uint8Array}}const ue={encode:(e,t=r().Writer.create())=>(void 0!==e.uri&&""!==e.uri&&t.uint32(10).string(e.uri),void 0!==e.revision&&0!==e.revision.length&&t.uint32(18).bytes(e.revision),t),decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=le();for(;n.pos>>3){case 1:o.uri=n.string();break;case 2:o.revision=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({uri:me(e.uri)?String(e.uri):"",revision:me(e.revision)?pe(e.revision):new Uint8Array}),toJSON(e){const t={};return void 0!==e.uri&&(t.uri=e.uri),void 0!==e.revision&&(t.revision=fe(void 0!==e.revision?e.revision:new Uint8Array)),t},fromPartial(e){const t=le();return t.uri=e.uri??"",t.revision=e.revision??new Uint8Array,t}};var de=(()=>{if(void 0!==de)return de;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function pe(e){if(de.Buffer)return Uint8Array.from(de.Buffer.from(e,"base64"));{const t=de.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(String.fromCharCode(e))})),de.btoa(t.join(""))}}function he(e){return e.toString()}function me(e){return null!=e}r().util.Long!==i.Z&&(r().util.Long=i.Z,r().configure())},69130:(e,t,n)=>{"use strict";n.d(t,{bu:()=>u,mn:()=>c});n(46758),n(27082),n(86277);var i=n(3959),o=n(9590),r=n.n(o),a=n(72232);function s(){return{uri:new Uint8Array,newRevision:new Uint8Array,parentRevision:new Uint8Array,ops:[]}}const c={encode(e,t=r().Writer.create()){if(void 0!==e.uri&&0!==e.uri.length&&t.uint32(10).bytes(e.uri),void 0!==e.newRevision&&0!==e.newRevision.length&&t.uint32(18).bytes(e.newRevision),void 0!==e.parentRevision&&0!==e.parentRevision.length&&t.uint32(26).bytes(e.parentRevision),void 0!==e.ops&&0!==e.ops.length)for(const n of e.ops)a.Op.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=s();for(;n.pos>>3){case 1:o.uri=n.bytes();break;case 2:o.newRevision=n.bytes();break;case 3:o.parentRevision=n.bytes();break;case 4:o.ops.push(a.Op.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON:e=>({uri:h(e.uri)?p(e.uri):new Uint8Array,newRevision:h(e.newRevision)?p(e.newRevision):new Uint8Array,parentRevision:h(e.parentRevision)?p(e.parentRevision):new Uint8Array,ops:Array.isArray(e?.ops)?e.ops.map((e=>a.Op.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.uri&&(t.uri=f(void 0!==e.uri?e.uri:new Uint8Array)),void 0!==e.newRevision&&(t.newRevision=f(void 0!==e.newRevision?e.newRevision:new Uint8Array)),void 0!==e.parentRevision&&(t.parentRevision=f(void 0!==e.parentRevision?e.parentRevision:new Uint8Array)),e.ops?t.ops=e.ops.map((e=>e?a.Op.toJSON(e):void 0)):t.ops=[],t},fromPartial(e){const t=s();return t.uri=e.uri??new Uint8Array,t.newRevision=e.newRevision??new Uint8Array,t.parentRevision=e.parentRevision??new Uint8Array,t.ops=e.ops?.map((e=>a.Op.fromPartial(e)))||[],t}};function l(){return{newRevision:new Uint8Array,parentRevision:new Uint8Array,ops:[]}}const u={encode(e,t=r().Writer.create()){if(void 0!==e.newRevision&&0!==e.newRevision.length&&t.uint32(10).bytes(e.newRevision),void 0!==e.parentRevision&&0!==e.parentRevision.length&&t.uint32(18).bytes(e.parentRevision),void 0!==e.ops&&0!==e.ops.length)for(const n of e.ops)a.Op.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof r().Reader?e:new(r().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o=l();for(;n.pos>>3){case 1:o.newRevision=n.bytes();break;case 2:o.parentRevision=n.bytes();break;case 3:o.ops.push(a.Op.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON:e=>({newRevision:h(e.newRevision)?p(e.newRevision):new Uint8Array,parentRevision:h(e.parentRevision)?p(e.parentRevision):new Uint8Array,ops:Array.isArray(e?.ops)?e.ops.map((e=>a.Op.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.newRevision&&(t.newRevision=f(void 0!==e.newRevision?e.newRevision:new Uint8Array)),void 0!==e.parentRevision&&(t.parentRevision=f(void 0!==e.parentRevision?e.parentRevision:new Uint8Array)),e.ops?t.ops=e.ops.map((e=>e?a.Op.toJSON(e):void 0)):t.ops=[],t},fromPartial(e){const t=l();return t.newRevision=e.newRevision??new Uint8Array,t.parentRevision=e.parentRevision??new Uint8Array,t.ops=e.ops?.map((e=>a.Op.fromPartial(e)))||[],t}};var d=(()=>{if(void 0!==d)return d;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function p(e){if(d.Buffer)return Uint8Array.from(d.Buffer.from(e,"base64"));{const t=d.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(String.fromCharCode(e))})),d.btoa(t.join(""))}}function h(e){return null!=e}r().util.Long!==i.Z&&(r().util.Long=i.Z,r().configure())},26285:(e,t,n)=>{"use strict";n.d(t,{MZ:()=>a,wN:()=>c});n(46758),n(27082);var i=n(9590),o=n.n(i);function r(){return{identifier:"",data:new Uint8Array}}const a={encode:(e,t=o().Writer.create())=>(void 0!==e.identifier&&""!==e.identifier&&t.uint32(10).string(e.identifier),void 0!==e.data&&0!==e.data.length&&t.uint32(18).bytes(e.data),t),decode(e,t){const n=e instanceof o().Reader?e:new(o().Reader)(e);let i=void 0===t?n.len:n.pos+t;const a=r();for(;n.pos>>3){case 1:a.identifier=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(7&e)}}return a},fromJSON:e=>({identifier:p(e.identifier)?String(e.identifier):"",data:p(e.data)?u(e.data):new Uint8Array}),toJSON(e){const t={};return void 0!==e.identifier&&(t.identifier=e.identifier),void 0!==e.data&&(t.data=d(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial(e){const t=r();return t.identifier=e.identifier??"",t.data=e.data??new Uint8Array,t}};function s(){return{lensIdentifier:"",uri:"",itemId:new Uint8Array,additionalData:new Uint8Array}}const c={encode:(e,t=o().Writer.create())=>(void 0!==e.lensIdentifier&&""!==e.lensIdentifier&&t.uint32(10).string(e.lensIdentifier),void 0!==e.uri&&""!==e.uri&&t.uint32(18).string(e.uri),void 0!==e.itemId&&0!==e.itemId.length&&t.uint32(26).bytes(e.itemId),void 0!==e.additionalData&&0!==e.additionalData.length&&t.uint32(34).bytes(e.additionalData),t),decode(e,t){const n=e instanceof o().Reader?e:new(o().Reader)(e);let i=void 0===t?n.len:n.pos+t;const r=s();for(;n.pos>>3){case 1:r.lensIdentifier=n.string();break;case 2:r.uri=n.string();break;case 3:r.itemId=n.bytes();break;case 4:r.additionalData=n.bytes();break;default:n.skipType(7&e)}}return r},fromJSON:e=>({lensIdentifier:p(e.lensIdentifier)?String(e.lensIdentifier):"",uri:p(e.uri)?String(e.uri):"",itemId:p(e.itemId)?u(e.itemId):new Uint8Array,additionalData:p(e.additionalData)?u(e.additionalData):new Uint8Array}),toJSON(e){const t={};return void 0!==e.lensIdentifier&&(t.lensIdentifier=e.lensIdentifier),void 0!==e.uri&&(t.uri=e.uri),void 0!==e.itemId&&(t.itemId=d(void 0!==e.itemId?e.itemId:new Uint8Array)),void 0!==e.additionalData&&(t.additionalData=d(void 0!==e.additionalData?e.additionalData:new Uint8Array)),t},fromPartial(e){const t=s();return t.lensIdentifier=e.lensIdentifier??"",t.uri=e.uri??"",t.itemId=e.itemId??new Uint8Array,t.additionalData=e.additionalData??new Uint8Array,t}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function u(e){if(l.Buffer)return Uint8Array.from(l.Buffer.from(e,"base64"));{const t=l.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(String.fromCharCode(e))})),l.btoa(t.join(""))}}function p(e){return null!=e}},54799:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>w});n(46758),n(53321),n(27082);var i=n(50959),o=n(92797),r=n(36353),a=n(49739),s=n(97154),c=n(9967),l=n(78496),u=n(75322),d=n(85866),p=n(49),f=n(28028),h=n(52744),m=n(91735),g=["type"],_=i.forwardRef((function(e,t){var n=e.type,r=void 0===n?"button":n,a=(0,p.Z)(e,g),s=(0,i.useContext)(o.t).isUsingKeyboard,c=(0,i.useContext)(f.W).useBrowserDefaultFocusStyle;return i.createElement(h.z,Object.assign({},a,{ref:t,type:r,isUsingKeyboard:s,useBrowserDefaultFocusStyle:c,"data-encore-id":m.e.ButtonIcon}))})),v=n(7863),y=n(86353);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b(e){for(var t=1;t{"use strict";n.d(t,{lb:()=>oe,jl:()=>v,pB:()=>ne,kI:()=>r,y8:()=>l,nK:()=>c,uS:()=>i});var i={};n.r(i),n.d(i,{Zc:()=>L,tI:()=>D,yV:()=>w});n(46758),n(53321);var o=n(51479);function r(e){let t=!0;const n=(0,o.h64)();return a((e=>{n.update(e),t=!1}),e),t?void 0:n.digest().toString(16)}function a(e,t){switch(typeof t){case"boolean":return void function(e,t){e(`boolean:${t}`)}(e,t);case"number":return void function(e,t){e(`number:${t}`)}(e,t);case"string":return void function(e,t){e(`string:${t.length}:${t}`)}(e,t);case"object":return null===t?void s(e):Array.isArray(t)?void function(e,t){e(`array:${t.length}:`);for(const n of t)void 0===n?s(e):a(e,n)}(e,t):"toJSON"in t&&"function"==typeof t.toJSON?void a(e,t.toJSON()):void function(e,t){const n=Object.keys(t).filter((e=>void 0!==t[e]));n.sort(),e(`object:${n.length}:`);for(const i of n)e(`${i}:`),a(e,t[i])}(e,t);default:return}}function s(e){e("null")}function c(e,t,n=new Error("Timeout")){return t===Number.POSITIVE_INFINITY?e:t<=0?Promise.reject(n):new Promise(((i,o)=>{setTimeout((()=>{o(n)}),t),e.then(i,o)}))}function l(e){return function(e){return null!==e&&"object"==typeof e}(e)&&"function"==typeof e.then}n(2836);const u=["error","warn","info","debug"];const d="",p=["0","1","2","3","4","5","6","7","8"];let f=e=>{console[e.level](function(e){let t=0;for(let n=0;n{};function m(e,t){const n=u.indexOf(t);return u.reduce(((t,i,o)=>(t[i]=o<=n?function(e,t){return(...n)=>{if("object"==typeof n[0]){const[i,o,...r]=n;return f({name:t,level:e,timestamp:Date.now(),data:Object.create(null,i),msg:o,args:r})}const[i,...o]=n;return f({name:t,level:e,timestamp:Date.now(),data:Object.create(null),msg:i,args:o})}}(i,e):h,t)),{})}const g=function(){let e;return e="undefined"!=typeof localStorage?localStorage.getItem("rcLogLevel"):{}.RC_LOG_LEVEL,e?"string"==typeof(t=e)&&u.includes(t)?e:"error":"error";var t}(),_=new Map;function v(e){const t=_.get(e);if(t)return t;const n=m(e,g);return _.set(e,n),n}n(86277);var y=n(29168),E=n.n(y),b=n(9590),S=n.n(b);var A;!function(e){e[e.APP_PLATFORM_UNKNOWN=0]="APP_PLATFORM_UNKNOWN",e[e.APP_PLATFORM_ANDROID=1]="APP_PLATFORM_ANDROID",e[e.APP_PLATFORM_IOS=2]="APP_PLATFORM_IOS",e[e.APP_PLATFORM_WEB=3]="APP_PLATFORM_WEB",e[e.APP_PLATFORM_DESKTOP=4]="APP_PLATFORM_DESKTOP",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(A||(A={}));const T={encode:(e,t=S().Writer.create())=>(""!==e.scope&&t.uint32(10).string(e.scope),""!==e.name&&t.uint32(18).string(e.name),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={scope:"",name:""};for(;n.pos>>3){case 1:o.scope=n.string();break;case 2:o.name=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({scope:N(e.scope)?String(e.scope):"",name:N(e.name)?String(e.name):""}),toJSON(e){const t={};return void 0!==e.scope&&(t.scope=e.scope),void 0!==e.name&&(t.name=e.name),t},fromPartial(e){var t,n;const i={scope:"",name:""};return i.scope=null!==(t=e.scope)&&void 0!==t?t:"",i.name=null!==(n=e.name)&&void 0!==n?n:"",i}};const O={encode:(e,t=S().Writer.create())=>(""!==e.system&&t.uint32(10).string(e.system),""!==e.serviceName&&t.uint32(18).string(e.serviceName),void 0!==e.staticContext&&I.encode(e.staticContext,t.uint32(26).fork()).ldelim(),void 0!==e.surfaceMetadata&&C.encode(e.surfaceMetadata,t.uint32(82).fork()).ldelim(),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={system:"",serviceName:"",staticContext:void 0,surfaceMetadata:void 0};for(;n.pos>>3){case 1:o.system=n.string();break;case 2:o.serviceName=n.string();break;case 3:o.staticContext=I.decode(n,n.uint32());break;case 10:o.surfaceMetadata=C.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({system:N(e.system)?String(e.system):"",serviceName:N(e.serviceName)?String(e.serviceName):"",staticContext:N(e.staticContext)?I.fromJSON(e.staticContext):void 0,surfaceMetadata:N(e.surfaceMetadata)?C.fromJSON(e.surfaceMetadata):void 0}),toJSON(e){const t={};return void 0!==e.system&&(t.system=e.system),void 0!==e.serviceName&&(t.serviceName=e.serviceName),void 0!==e.staticContext&&(t.staticContext=e.staticContext?I.toJSON(e.staticContext):void 0),void 0!==e.surfaceMetadata&&(t.surfaceMetadata=e.surfaceMetadata?C.toJSON(e.surfaceMetadata):void 0),t},fromPartial(e){var t,n;const i={system:"",serviceName:"",staticContext:void 0,surfaceMetadata:void 0};return i.system=null!==(t=e.system)&&void 0!==t?t:"",i.serviceName=null!==(n=e.serviceName)&&void 0!==n?n:"",i.staticContext=void 0!==e.staticContext&&null!==e.staticContext?I.fromPartial(e.staticContext):void 0,i.surfaceMetadata=void 0!==e.surfaceMetadata&&null!==e.surfaceMetadata?C.fromPartial(e.surfaceMetadata):void 0,i}};const I={encode:(e,t=S().Writer.create())=>(""!==e.system&&t.uint32(10).string(e.system),""!==e.serviceName&&t.uint32(18).string(e.serviceName),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={system:"",serviceName:""};for(;n.pos>>3){case 1:o.system=n.string();break;case 2:o.serviceName=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({system:N(e.system)?String(e.system):"",serviceName:N(e.serviceName)?String(e.serviceName):""}),toJSON(e){const t={};return void 0!==e.system&&(t.system=e.system),void 0!==e.serviceName&&(t.serviceName=e.serviceName),t},fromPartial(e){var t,n;const i={system:"",serviceName:""};return i.system=null!==(t=e.system)&&void 0!==t?t:"",i.serviceName=null!==(n=e.serviceName)&&void 0!==n?n:"",i}};const C={encode:(e,t=S().Writer.create())=>(""!==e.backendSdkVersion&&t.uint32(10).string(e.backendSdkVersion),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={backendSdkVersion:""};for(;n.pos>>3==1)o.backendSdkVersion=n.string();else n.skipType(7&e)}return o},fromJSON:e=>({backendSdkVersion:N(e.backendSdkVersion)?String(e.backendSdkVersion):""}),toJSON(e){const t={};return void 0!==e.backendSdkVersion&&(t.backendSdkVersion=e.backendSdkVersion),t},fromPartial(e){var t;const n={backendSdkVersion:""};return n.backendSdkVersion=null!==(t=e.backendSdkVersion)&&void 0!==t?t:"",n}};function N(e){return null!=e}var L,R;function P(e){switch(e){case 0:case"BLOCKING":return L.BLOCKING;case 1:case"BACKGROUND_SYNC":return L.BACKGROUND_SYNC;case 2:case"ASYNC":return L.ASYNC;case 3:case"PUSH_INITIATED":return L.PUSH_INITIATED;case 4:case"RECONNECT":return L.RECONNECT;default:return L.UNRECOGNIZED}}function k(e){switch(e){case 0:case"KNOWN_CONTEXT_INVALID":return R.KNOWN_CONTEXT_INVALID;case 1:case"KNOWN_CONTEXT_USER_ID":return R.KNOWN_CONTEXT_USER_ID;case 2:case"KNOWN_CONTEXT_INSTALLATION_ID":return R.KNOWN_CONTEXT_INSTALLATION_ID;case 3:case"KNOWN_CONTEXT_VERSION":return R.KNOWN_CONTEXT_VERSION;default:return R.UNRECOGNIZED}}!function(e){e[e.BLOCKING=0]="BLOCKING",e[e.BACKGROUND_SYNC=1]="BACKGROUND_SYNC",e[e.ASYNC=2]="ASYNC",e[e.PUSH_INITIATED=3]="PUSH_INITIATED",e[e.RECONNECT=4]="RECONNECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(L||(L={})),function(e){e[e.KNOWN_CONTEXT_INVALID=0]="KNOWN_CONTEXT_INVALID",e[e.KNOWN_CONTEXT_USER_ID=1]="KNOWN_CONTEXT_USER_ID",e[e.KNOWN_CONTEXT_INSTALLATION_ID=2]="KNOWN_CONTEXT_INSTALLATION_ID",e[e.KNOWN_CONTEXT_VERSION=3]="KNOWN_CONTEXT_VERSION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(R||(R={}));const D={encode:(e,t=S().Writer.create())=>(""!==e.propertySetId&&t.uint32(10).string(e.propertySetId),void 0!==e.fetchType&&H.encode(e.fetchType,t.uint32(18).fork()).ldelim(),void 0!==e.context&&G.encode(e.context,t.uint32(90).fork()).ldelim(),void 0!==e.backendContext&&O.encode(e.backendContext,t.uint32(98).fork()).ldelim(),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={propertySetId:"",fetchType:void 0,context:void 0,backendContext:void 0};for(;n.pos>>3){case 1:o.propertySetId=n.string();break;case 2:o.fetchType=H.decode(n,n.uint32());break;case 11:o.context=G.decode(n,n.uint32());break;case 12:o.backendContext=O.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({propertySetId:j(e.propertySetId)?String(e.propertySetId):"",fetchType:j(e.fetchType)?H.fromJSON(e.fetchType):void 0,context:j(e.context)?G.fromJSON(e.context):void 0,backendContext:j(e.backendContext)?O.fromJSON(e.backendContext):void 0}),toJSON(e){const t={};return void 0!==e.propertySetId&&(t.propertySetId=e.propertySetId),void 0!==e.fetchType&&(t.fetchType=e.fetchType?H.toJSON(e.fetchType):void 0),void 0!==e.context&&(t.context=e.context?G.toJSON(e.context):void 0),void 0!==e.backendContext&&(t.backendContext=e.backendContext?O.toJSON(e.backendContext):void 0),t},fromPartial(e){var t;const n={propertySetId:"",fetchType:void 0,context:void 0,backendContext:void 0};return n.propertySetId=null!==(t=e.propertySetId)&&void 0!==t?t:"",n.fetchType=void 0!==e.fetchType&&null!==e.fetchType?H.fromPartial(e.fetchType):void 0,n.context=void 0!==e.context&&null!==e.context?G.fromPartial(e.context):void 0,n.backendContext=void 0!==e.backendContext&&null!==e.backendContext?O.fromPartial(e.backendContext):void 0,n}};const w={encode:(e,t=S().Writer.create())=>(void 0!==e.configuration&&M.encode(e.configuration,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={configuration:void 0};for(;n.pos>>3==1)o.configuration=M.decode(n,n.uint32());else n.skipType(7&e)}return o},fromJSON:e=>({configuration:j(e.configuration)?M.fromJSON(e.configuration):void 0}),toJSON(e){const t={};return void 0!==e.configuration&&(t.configuration=e.configuration?M.toJSON(e.configuration):void 0),t},fromPartial(e){const t={configuration:void 0};return t.configuration=void 0!==e.configuration&&null!==e.configuration?M.fromPartial(e.configuration):void 0,t}};const M={encode(e,t=S().Writer.create()){""!==e.configurationAssignmentId&&t.uint32(10).string(e.configurationAssignmentId),0!==e.fetchTimeMillis&&t.uint32(16).int64(e.fetchTimeMillis);for(const n of e.assignedValues)x.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={configurationAssignmentId:"",fetchTimeMillis:0,assignedValues:[]};for(;n.pos>>3){case 1:o.configurationAssignmentId=n.string();break;case 2:o.fetchTimeMillis=Y(n.int64());break;case 3:o.assignedValues.push(x.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON:e=>({configurationAssignmentId:j(e.configurationAssignmentId)?String(e.configurationAssignmentId):"",fetchTimeMillis:j(e.fetchTimeMillis)?Number(e.fetchTimeMillis):0,assignedValues:Array.isArray(null==e?void 0:e.assignedValues)?e.assignedValues.map((e=>x.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.configurationAssignmentId&&(t.configurationAssignmentId=e.configurationAssignmentId),void 0!==e.fetchTimeMillis&&(t.fetchTimeMillis=Math.round(e.fetchTimeMillis)),e.assignedValues?t.assignedValues=e.assignedValues.map((e=>e?x.toJSON(e):void 0)):t.assignedValues=[],t},fromPartial(e){var t,n,i;const o={configurationAssignmentId:"",fetchTimeMillis:0,assignedValues:[]};return o.configurationAssignmentId=null!==(t=e.configurationAssignmentId)&&void 0!==t?t:"",o.fetchTimeMillis=null!==(n=e.fetchTimeMillis)&&void 0!==n?n:0,o.assignedValues=(null===(i=e.assignedValues)||void 0===i?void 0:i.map((e=>x.fromPartial(e))))||[],o}};const x={encode:(e,t=S().Writer.create())=>(void 0!==e.propertyId&&T.encode(e.propertyId,t.uint32(10).fork()).ldelim(),void 0!==e.metadata&&U.encode(e.metadata,t.uint32(18).fork()).ldelim(),void 0!==e.boolValue&&V.encode(e.boolValue,t.uint32(26).fork()).ldelim(),void 0!==e.intValue&&F.encode(e.intValue,t.uint32(34).fork()).ldelim(),void 0!==e.enumValue&&B.encode(e.enumValue,t.uint32(42).fork()).ldelim(),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={propertyId:void 0,metadata:void 0,boolValue:void 0,intValue:void 0,enumValue:void 0};for(;n.pos>>3){case 1:o.propertyId=T.decode(n,n.uint32());break;case 2:o.metadata=U.decode(n,n.uint32());break;case 3:o.boolValue=V.decode(n,n.uint32());break;case 4:o.intValue=F.decode(n,n.uint32());break;case 5:o.enumValue=B.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({propertyId:j(e.propertyId)?T.fromJSON(e.propertyId):void 0,metadata:j(e.metadata)?U.fromJSON(e.metadata):void 0,boolValue:j(e.boolValue)?V.fromJSON(e.boolValue):void 0,intValue:j(e.intValue)?F.fromJSON(e.intValue):void 0,enumValue:j(e.enumValue)?B.fromJSON(e.enumValue):void 0}),toJSON(e){const t={};return void 0!==e.propertyId&&(t.propertyId=e.propertyId?T.toJSON(e.propertyId):void 0),void 0!==e.metadata&&(t.metadata=e.metadata?U.toJSON(e.metadata):void 0),void 0!==e.boolValue&&(t.boolValue=e.boolValue?V.toJSON(e.boolValue):void 0),void 0!==e.intValue&&(t.intValue=e.intValue?F.toJSON(e.intValue):void 0),void 0!==e.enumValue&&(t.enumValue=e.enumValue?B.toJSON(e.enumValue):void 0),t},fromPartial(e){const t={propertyId:void 0,metadata:void 0,boolValue:void 0,intValue:void 0,enumValue:void 0};return t.propertyId=void 0!==e.propertyId&&null!==e.propertyId?T.fromPartial(e.propertyId):void 0,t.metadata=void 0!==e.metadata&&null!==e.metadata?U.fromPartial(e.metadata):void 0,t.boolValue=void 0!==e.boolValue&&null!==e.boolValue?V.fromPartial(e.boolValue):void 0,t.intValue=void 0!==e.intValue&&null!==e.intValue?F.fromPartial(e.intValue):void 0,t.enumValue=void 0!==e.enumValue&&null!==e.enumValue?B.fromPartial(e.enumValue):void 0,t}};const U={encode:(e,t=S().Writer.create())=>(0!==e.policyId&&t.uint32(8).int64(e.policyId),""!==e.externalRealm&&t.uint32(18).string(e.externalRealm),0!==e.externalRealmId&&t.uint32(24).int64(e.externalRealmId),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={policyId:0,externalRealm:"",externalRealmId:0};for(;n.pos>>3){case 1:o.policyId=Y(n.int64());break;case 2:o.externalRealm=n.string();break;case 3:o.externalRealmId=Y(n.int64());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({policyId:j(e.policyId)?Number(e.policyId):0,externalRealm:j(e.externalRealm)?String(e.externalRealm):"",externalRealmId:j(e.externalRealmId)?Number(e.externalRealmId):0}),toJSON(e){const t={};return void 0!==e.policyId&&(t.policyId=Math.round(e.policyId)),void 0!==e.externalRealm&&(t.externalRealm=e.externalRealm),void 0!==e.externalRealmId&&(t.externalRealmId=Math.round(e.externalRealmId)),t},fromPartial(e){var t,n,i;const o={policyId:0,externalRealm:"",externalRealmId:0};return o.policyId=null!==(t=e.policyId)&&void 0!==t?t:0,o.externalRealm=null!==(n=e.externalRealm)&&void 0!==n?n:"",o.externalRealmId=null!==(i=e.externalRealmId)&&void 0!==i?i:0,o}};const V={encode:(e,t=S().Writer.create())=>(!0===e.value&&t.uint32(8).bool(e.value),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={value:!1};for(;n.pos>>3==1)o.value=n.bool();else n.skipType(7&e)}return o},fromJSON:e=>({value:!!j(e.value)&&Boolean(e.value)}),toJSON(e){const t={};return void 0!==e.value&&(t.value=e.value),t},fromPartial(e){var t;const n={value:!1};return n.value=null!==(t=e.value)&&void 0!==t&&t,n}};const F={encode:(e,t=S().Writer.create())=>(0!==e.value&&t.uint32(8).int32(e.value),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={value:0};for(;n.pos>>3==1)o.value=n.int32();else n.skipType(7&e)}return o},fromJSON:e=>({value:j(e.value)?Number(e.value):0}),toJSON(e){const t={};return void 0!==e.value&&(t.value=Math.round(e.value)),t},fromPartial(e){var t;const n={value:0};return n.value=null!==(t=e.value)&&void 0!==t?t:0,n}};const B={encode:(e,t=S().Writer.create())=>(""!==e.value&&t.uint32(10).string(e.value),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={value:""};for(;n.pos>>3==1)o.value=n.string();else n.skipType(7&e)}return o},fromJSON:e=>({value:j(e.value)?String(e.value):""}),toJSON(e){const t={};return void 0!==e.value&&(t.value=e.value),t},fromPartial(e){var t;const n={value:""};return n.value=null!==(t=e.value)&&void 0!==t?t:"",n}};const H={encode:(e,t=S().Writer.create())=>(0!==e.type&&t.uint32(8).int32(e.type),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={type:0};for(;n.pos>>3==1)o.type=n.int32();else n.skipType(7&e)}return o},fromJSON:e=>({type:j(e.type)?P(e.type):0}),toJSON(e){const t={};return void 0!==e.type&&(t.type=function(e){switch(e){case L.BLOCKING:return"BLOCKING";case L.BACKGROUND_SYNC:return"BACKGROUND_SYNC";case L.ASYNC:return"ASYNC";case L.PUSH_INITIATED:return"PUSH_INITIATED";case L.RECONNECT:return"RECONNECT";case L.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.type)),t},fromPartial(e){var t;const n={type:0};return n.type=null!==(t=e.type)&&void 0!==t?t:0,n}};const G={encode(e,t=S().Writer.create()){for(const n of e.context)K.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={context:[]};for(;n.pos>>3==1)o.context.push(K.decode(n,n.uint32()));else n.skipType(7&e)}return o},fromJSON:e=>({context:Array.isArray(null==e?void 0:e.context)?e.context.map((e=>K.fromJSON(e))):[]}),toJSON(e){const t={};return e.context?t.context=e.context.map((e=>e?K.toJSON(e):void 0)):t.context=[],t},fromPartial(e){var t;const n={context:[]};return n.context=(null===(t=e.context)||void 0===t?void 0:t.map((e=>K.fromPartial(e))))||[],n}};const K={encode:(e,t=S().Writer.create())=>(void 0!==e.knownContext&&t.uint32(8).int32(e.knownContext),void 0!==e.policyInputName&&t.uint32(18).string(e.policyInputName),""!==e.value&&t.uint32(82).string(e.value),t),decode(e,t){const n=e instanceof S().Reader?e:new(S().Reader)(e);let i=void 0===t?n.len:n.pos+t;const o={knownContext:void 0,policyInputName:void 0,value:""};for(;n.pos>>3){case 1:o.knownContext=n.int32();break;case 2:o.policyInputName=n.string();break;case 10:o.value=n.string();break;default:n.skipType(7&e)}}return o},fromJSON:e=>({knownContext:j(e.knownContext)?k(e.knownContext):void 0,policyInputName:j(e.policyInputName)?String(e.policyInputName):void 0,value:j(e.value)?String(e.value):""}),toJSON(e){const t={};return void 0!==e.knownContext&&(t.knownContext=void 0!==e.knownContext?function(e){switch(e){case R.KNOWN_CONTEXT_INVALID:return"KNOWN_CONTEXT_INVALID";case R.KNOWN_CONTEXT_USER_ID:return"KNOWN_CONTEXT_USER_ID";case R.KNOWN_CONTEXT_INSTALLATION_ID:return"KNOWN_CONTEXT_INSTALLATION_ID";case R.KNOWN_CONTEXT_VERSION:return"KNOWN_CONTEXT_VERSION";case R.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.knownContext):void 0),void 0!==e.policyInputName&&(t.policyInputName=e.policyInputName),void 0!==e.value&&(t.value=e.value),t},fromPartial(e){var t,n,i;const o={knownContext:void 0,policyInputName:void 0,value:""};return o.knownContext=null!==(t=e.knownContext)&&void 0!==t?t:void 0,o.policyInputName=null!==(n=e.policyInputName)&&void 0!==n?n:void 0,o.value=null!==(i=e.value)&&void 0!==i?i:"",o}};var W=(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();function Y(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new W.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}function j(e){return null!=e}S().util.Long!==E()&&(S().util.Long=E(),S().configure());var z=(()=>{if(void 0!==z)return z;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw"Unable to locate global object"})();z.atob;z.btoa;S().util.Long!==E()&&(S().util.Long=E(),S().configure());const J={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let q;const X=new Uint8Array(16);function Z(){if(!q&&(q="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!q))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(X)}const Q=[];for(let e=0;e<256;++e)Q.push((e+256).toString(16).slice(1));function $(e,t=0){return(Q[e[t+0]]+Q[e[t+1]]+Q[e[t+2]]+Q[e[t+3]]+"-"+Q[e[t+4]]+Q[e[t+5]]+"-"+Q[e[t+6]]+Q[e[t+7]]+"-"+Q[e[t+8]]+Q[e[t+9]]+"-"+Q[e[t+10]]+Q[e[t+11]]+Q[e[t+12]]+Q[e[t+13]]+Q[e[t+14]]+Q[e[t+15]]).toLowerCase()}const ee=function(e,t,n){if(J.randomUUID&&!t&&!e)return J.randomUUID();const i=(e=e||{}).random||(e.rng||Z)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=i[e];return t}return $(i)},te=v("common");function ne(){try{return ee()}catch(e){return te.debug("creating uuid failed, trying with custom rng",e),ee({rng:()=>{const e=new Array(16);let t;for(let n=0;n<16;n++)0==(3&n)&&(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}})}}const ie="object"==typeof performance&&"function"==typeof performance.now?()=>performance.now():()=>Date.now();class oe{constructor(e){this.millisecondStart=e}duration(){return Math.round(1e6*(ie()-this.millisecondStart))}static start(){return new oe(ie())}}},59989:(e,t,n)=>{"use strict";n.d(t,{CK:()=>i,XH:()=>s,dM:()=>u,tI:()=>c,yV:()=>l,hh:()=>f});n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527),n(46758),n(53321),n(27082),n(86277),n(2836);var i,o=n(82445),r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);oe,isIdentifier:!0},user_catalogue:{policyInputName:"/spotify-user/catalogue",encode:e=>e,isIdentifier:!1},user_country:{policyInputName:"/spotify-user/country",encode:e=>e,isIdentifier:!1},geoip_country:{policyInputName:"/client/geo-ip-country",encode:e=>e,isIdentifier:!1},user_is_employee:{policyInputName:"/spotify-user/is-employee",encode:e=>e,isIdentifier:!1},installationId:{policyInputName:"/remote-config/installation-id",encode:e=>e,isIdentifier:!0},sp_t_cookie:{policyInputName:"/client/sp-t-cookie",encode:e=>e,isIdentifier:!0},version:{policyInputName:"/remote-config/rc-client-version",encode:e=>e,isIdentifier:!1},artist_id:{policyInputName:"/artist/artist-id",encode:e=>e,isIdentifier:!0},advisor_id:{policyInputName:"/advisor/advisor-id",encode:e=>e,isIdentifier:!0},show_id:{policyInputName:"/spotify-podcast-show/show-id",encode:e=>e,isIdentifier:!0},episode_id:{policyInputName:"/spotify-podcast-episode/episode-id",encode:e=>e,isIdentifier:!0},adstudio_advertiser_account_id:{policyInputName:"/adstudio-advertiser-account/account-id",encode:e=>e,isIdentifier:!0},oauth_client_id:{policyInputName:"/client/oauth-client-id",encode:e=>e,isIdentifier:!1}};var s,c;!function(e){function t(e){return Object.entries(e).filter((([e])=>e in a)).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}function n(e,t){return Object.entries(e).filter((([e])=>e in a)).forEach((([e,n])=>t(e,n,a[e])))}e.definitions=a,e.defaultIdentifiers=Object.freeze(["user_id","sp_t_cookie"]),e.declarableIdentifiers=Object.freeze(Object.entries(e.definitions).filter((([t,{isIdentifier:n}])=>n&&!e.defaultIdentifiers.includes(t))).map((([e])=>e))),e.extract=t,e.forEach=n,e.map=function(e,t){return Object.entries(e).filter((([e])=>e in a)).map((([e,n])=>t(e,n,a[e])))},e.extractIdentifiersMap=function(e){const t={};return n(e,((e,n,i)=>{if(i.isIdentifier){const e=i.encode(n);"string"==typeof e&&""!==e&&(t[i.policyInputName]=e)}})),a.sp_t_cookie.policyInputName in t&&!(a.installationId.policyInputName in t)?t[a.installationId.policyInputName]=t[a.sp_t_cookie.policyInputName]:a.installationId.policyInputName in t&&!(a.sp_t_cookie.policyInputName in t)&&(t[a.sp_t_cookie.policyInputName]=t[a.installationId.policyInputName]),t},e.extractDeclaredIdentifiers=function(t){return Object.keys(t).filter((t=>e.declarableIdentifiers.includes(t)))},e.hash=function(e){return e.username?(0,o.kI)(Object.assign(Object.assign({},t(e)),{username:e.username})):(0,o.kI)(t(e))}}(s||(s={})),function(e){function t(e){var{propertySetId:t,fetchType:o=i.BLOCKING}=e;return{propertySetId:t,context:n(r(e,["propertySetId","fetchType"])),fetchType:c(o)}}function n(e){const t=[];return s.forEach(e,((e,n,{policyInputName:i,encode:o})=>{const r=o(n);"string"==typeof r&&""!==r&&(i===a.sp_t_cookie.policyInputName&&t.push({knownContext:void 0,policyInputName:a.installationId.policyInputName,value:r}),t.push({knownContext:void 0,policyInputName:i,value:r}))})),{context:t}}function c(e){switch(e){case i.BACKGROUND_SYNC:return{type:o.uS.Zc.BACKGROUND_SYNC};case i.BLOCKING:return{type:o.uS.Zc.BLOCKING};case i.DELAYED:return{type:o.uS.Zc.ASYNC};default:throw new Error(`Unknown FetchType (${e})`)}}e.toPayload=t,e.encode=function(e){return o.uS.tI.encode(t(e)).finish()}}(c||(c={}));var l,u,d=n(54960);!function(e){e.configurationAssignmentId=(0,d.Vo)({name:"#configurationAssignmentId",description:"Unique ID for the specific resolver call this configuration originates from.",default:""}),e.fetchTimeMillis=(0,d.Vo)({name:"#fetchTimeMillis",description:"Server reported time when this configuration was fetched.",default:0}),e.groupIds=(0,d.Vo)({name:"#groupIds",description:"An object mapping property name to group-id.",default:void 0}),e.getGroupId=(t,n)=>{var i;return null===(i=n.getValue(e.groupIds))||void 0===i?void 0:i[t]},e.toConfiguration=function(t){t instanceof Uint8Array&&(t=o.uS.yV.decode(t));const{configuration:n}=o.uS.yV.fromJSON(t);if(!n)throw new Error("Bad response payload");const i=d.VK.builder(),r={};for(const{propertyId:e,metadata:t,boolValue:o,intValue:a,enumValue:s}of n.assignedValues){const n=e.name,c=(0,d.jf)(n);c&&(t&&(r[n]=t.externalRealmId),o?i.setValue(c,o.value):a?i.setValue(c,a.value):s&&i.setValue(c,s.value))}return i.setValue(e.configurationAssignmentId,n.configurationAssignmentId),i.setValue(e.groupIds,r),i.setValue(e.fetchTimeMillis,n.fetchTimeMillis),i}}(l||(l={})),function(e){e.apply=function(e,t){return n=>e(t(n))(n)},e.compose=function(...e){return e.reduce(((e,t)=>n=>i=>e(t(n)(i))(i)))}}(u||(u={}));const p=(0,o.jl)("core");function f(e){return h(e)}function h(e){return class{constructor(t){this.onDestroyListeners=new Set,this.logger=(0,o.jl)("core");const n={onDestroy:e=>{this.onDestroyListeners.add(e)}};this.delegate=e(Object.assign(Object.assign({},t),n))}resolve(e){return Promise.resolve().then((()=>this.delegate(e))).then((e=>e.build())).catch((e=>(this.logger.warn("Uncaught error in resolve chain:",e),d.VK.empty())))}destroy(){this.delegate=()=>{throw new Error("Resolver instance has been destroyed")};for(const e of this.onDestroyListeners)try{e()}catch(e){p.warn("uncaught error in onDestroy listener",e)}this.onDestroyListeners.clear()}static addMiddleware(t){return h(u.apply(t,e))}static withIdentifier(e){return this}static withContext(e){return this}}}},10226:(e,t,n)=>{"use strict";n.d(t,{jj:()=>c,W6:()=>l});var i=n(50959),o=n(54960);const r=(0,i.createContext)(new o.VK.Delegate((()=>{throw new Error("Please wrap your component in RemoteConfig Provider")})));var a=n(82445);class s extends o.VK.Delegate{constructor(){super((()=>{if(!this.delegate)throw this.suspendedPromise;return this.delegate})),this.suspendedPromise=new Promise((e=>{this.resolveSuspense=t=>{if(this.delegate)throw new Error("Already resolved");this.delegate=t,e()}}))}get isSuspended(){return!this.delegate}static isSuspended(e){return e instanceof s&&e.isSuspended}}const c=({children:e,configuration:t})=>{const[n,o]=(0,i.useState)(new s);return function(e,t){const n=(0,i.useRef)(null);if(!e||n.current===e)return;if(n.current=e,!(0,a.y8)(e))return void t(e);e.then(t)}(t,(e=>{s.isSuspended(n)&&n.resolveSuspense(e),o(e)})),i.createElement(r.Provider,{value:n},e)};n(86277);function l(e,t){const n=function(e={}){const{Context:t=r}=e,n=(0,i.useContext)(t);if(!n)throw new Error("RemoteConfigContext is undefined");return n}(t);try{return n.getValue(e)}catch(e){if(t&&"loadingValue"in t&&(0,a.y8)(e))return t.loadingValue;throw e}}},17765:(e,t,n)=>{"use strict";n.d(t,{dB:()=>d});var i=n(59989),o=n(54960),r=n(82445),a=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const s=new Map,c=(0,o.Vo)({name:"#contextHash",description:"Hash of the context when passing through initial-config-middleware",default:""}),l=(0,r.jl)("middleware:initial-configuration"),u=["geoip_country","user_country","user_catalogue","user_id","username","user_is_employee"];const d=e=>t=>n=>a(void 0,void 0,void 0,(function*(){const a=(0,r.kI)(Object.assign(Object.assign({},i.XH.extract(function(e){const t=Object.assign({},e);return u.forEach((e=>{delete t[e]})),t}(n))),{auth:n.auth}));if(t.initialConfiguration&&a===t.initialConfiguration.getValue(c))return o.VK.builder(t.initialConfiguration);const d=yield e(n);return l.info("Setting hash: '%s' on configuration",a),d.setValue(c,a),n.req&&(!function(e){const t=e.getValue(i.yV.configurationAssignmentId);t&&s.set(t,e)}(d),n.req.on("close",(()=>{!function(e){s.delete(e.getValue(i.yV.configurationAssignmentId))}(d)}))),d}))},97692:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});const i=(0,n(82445).jl)("middleware:version"),o=e=>({version:t})=>n=>(i.debug("Setting version: %s",t),e(Object.assign(Object.assign({},n),{version:t})))},54960:(e,t,n)=>{"use strict";n.d(t,{VK:()=>E,Z9:()=>a,JP:()=>m,VL:()=>_,z8:()=>g,Vo:()=>v,jf:()=>h,OT:()=>f,y6:()=>p});n(46758),n(2836),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);var i=n(82445),o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);oe.upper)throw new TypeError(`Expected value in range [${e.lower},${e.upper}]`);break;case"internal":break;default:throw new TypeError(`Unknown property type "${e.type}"`)}}e.match=function(e){return t=>{var{type:n}=t,i=o(t,["type"]);return e[n](i)}},e.assertValue=t,e.validateValue=function(e,n){try{return t(e,n),!0}catch(e){return!1}},e.getPropertySetId=function(e,t,n=[]){const a=[e,Array.from(t).reduce(((e,t)=>{var{name:n}=t,i=o(t,["name"]);return Object.assign(Object.assign({},e),{[n]:i})}),{})],s=new Set(n);return s.size&&a.push(Array.from(s).sort()),r.debug("property-set-id sources",...a),(0,i.kI)(a)}}(a||(a={}));var s=n(3341),c=n.n(s),l=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);oe.toBuilder())).reduce(((e,t)=>e.merge(t)),new i).build()},e.empty=function(){return new t};class i extends t{setValues(e){for(const[t,n]of e)this.setValue(t,n);return this}withAccessListener(e){return this.accessListeners.add(e),this}setValue(e,t){return f(e),this.values.set(e,t),this}merge(e){for(const[t,n]of e.values)this.values.set(t,n);for(const t of e.accessListeners)this.accessListeners.add(t);return this}getValue(e){const t=f(e);return this.values.has(e)?this.values.get(e):t.default}build(){return new t(this.values,this.accessListeners)}[Symbol.iterator](){return this.values.entries()}static fromJSON(e){return new i(n(e))}}e.Builder=i;e.Delegate=class{constructor(e){this.provider=e}getValue(e){return this.provider().getValue(e)}toJSON(e){return this.provider().toJSON(e)}toBuilder(){return this.provider().toBuilder()}}}(E||(E={}))},39576:(e,t,n)=>{"use strict";n.d(t,{LN:()=>H,Qx:()=>L,ae:()=>P,Vj:()=>U,H4:()=>B});var i=n(59989),o=n(82445);const r=6e5;let a;var s=n(54960),c=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const l=e=>"getConfig"in e,u=(0,o.jl)("middleware:caching");class d{constructor(e,t){this.storageKey=e,this.storage=t}getConfig(e){return c(this,void 0,void 0,(function*(){const t=this.storage.getItem(this.storageKey);if("string"==typeof t){const n=JSON.parse(t);if(n.key===e)return s.VK.fromJSON(n.value)}return null}))}setConfig(e,t){return c(this,void 0,void 0,(function*(){this.storage.setItem(this.storageKey,JSON.stringify({key:e,value:t.toJSON()}))}))}}var p=n(85851),f=n(80982),h=n(39153);n(46758),n(53321),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);var m=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const g=new WeakMap;const _={debounceTimeout:400,exposeOnGc:!0};function v(e,t){return(...n)=>(t(...n),e(...n))}function y(e,t){let n=(...i)=>(n=e,t(...i),e(...i));return(...e)=>n(...e)}function E(e){return"number"==typeof e}n(2836);const b=function(e,t=_,n){return r=>a=>{const{clientId:s,semanticMetrics:c,exposureStrategy:l="access"}=a,u=e(a);if("resolve"===l)return function(e,t,n,o,r){return a=>m(this,void 0,void 0,(function*(){const s=yield e(a);n&&n.sendMetric({metric_type:"counter",what:"remote-config-exposure-counter",tags:{strategy:"resolve"},value:1});const c=(l=Object.values(s.getValue(i.yV.groupIds)||{}),Array.from(new Set(l))).filter(E);var l;const u={clientId:t,configuration:s,policyGroupIds:c,context:a};return r.debug("sending resolve exposure event",u),o(u),s}))}(r,s,c,u,n);if("access"===l)return function(e,t,n,r,a,s){return c=>m(this,void 0,void 0,(function*(){const l=yield e(c),u=o.lb.start();return l.withAccessListener(function(e,t,n){const{debounceTimeout:o,exposeOnGc:r=!1}=t,a=new Set;let s=[],c=t=>{n.debug("Flushing exposure events, with signal %s for pending group ids: %o",t,s),s.length&&(e(s,t),s=[])},l=(e,t)=>{const o=i.yV.getGroupId(e,t);n.info('Access listener called for ref: "%s", with group id: "%s"',e,o),o&&!a.has(o)&&(a.add(o),s.push(o))};if(l=y(l,((e,t)=>{g.set(t,(()=>{c("manual")}))})),o>=0&&o{clearTimeout(e),e=setTimeout((()=>{c("timeout")}),o)})),c=v(c,(()=>{clearTimeout(e)}))}const u=function(){if("function"==typeof FinalizationRegistry)return new FinalizationRegistry((e=>{e()}))}();r&&u&&(n.debug("Adding GC cleanup function"),l=y(l,((e,t)=>{u.register(t,(()=>{c("gc")}))})));return l}(((e,i)=>{n&&(n.sendMetric({metric_type:"counter",what:"remote-config-exposure-counter",tags:{strategy:"access"},value:1}),n.sendMetric({metric_type:"timer",what:"remote-config-time-to-exposure",tags:{signal:i},value:u.duration()}));const o={clientId:t,configuration:l,policyGroupIds:e,context:c};s.debug("sending access exposure event",o),r(o)}),a,s)),l}))}(r,s,c,u,t,n);throw new Error("exposure strategy not defined")}}((e=>{const t=e.eventSender;return({context:e,clientId:n,configuration:o,policyGroupIds:r})=>{const a=e.auth,s=function(e,t,n,o){const r=n.getValue(i.yV.fetchTimeMillis),a=n.getValue(i.yV.configurationAssignmentId);return{platform:"WEB",rc_client_id:e,configuration_assignment_id:a,fetch_type:t.fetchType,installation_id:t.sp_t_cookie,last_rcs_fetch_time:r,policy_group_ids:o,identifiers:i.XH.extractIdentifiersMap(t)}}(n,e,o,r);return a?t.send((0,f.F)(s)):t.send((0,h.k)(s))}}),void 0,(0,o.jl)("middleware:exposure"));var S=n(95092),A=n(56674);n(86277);var T=n(87475),O=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const I=function(){try{return n(23335)}catch(e){}return}();var C=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o({eventSender:t,onDestroy:n})=>{if(!I)return e;let o;const r=e=>{if(!o||!e)return;const n={spt_cookie:o,consent_groups:Object.entries(e.groups).map((([e,t])=>`${e}:${t?"1":"0"}`)).join(","),datetime:e.date.getTime()};t.send((0,T.C)(n))};return I.addConsentListener(r,!0),n((()=>{I.removeConsentListener(r)})),t=>O(void 0,void 0,void 0,(function*(){const n=yield e(t),a=i.XH.extractIdentifiersMap(t)["/client/sp-t-cookie"];if(a&&o!==a){o=a;const e=I.getConsentInfo();e&&r(e)}return n}))}),b,(e=>({clientId:t,eventSender:n})=>o=>e(o).catch((e=>{const r=(s="message",("object"==typeof(a=e)&&null!==a||"function"==typeof a)&&s in a?String(e.message):void 0);var a,s;throw n.send((({context:e,clientId:t,reason:n})=>{const o=Boolean(e.auth),r={installation_id:e.sp_t_cookie,rc_client_id:t,platform:"WEB",fetch_type:e.fetchType,reason:n,identifiers:i.XH.extractIdentifiersMap(e)};return o?(0,S.T)(r):(0,A.$)(r)})({context:o,reason:r,clientId:t})),e})))),L=e=>t=>{var{transport:n,eventSender:i=R(n)}=t,o=C(t,["transport","eventSender"]);return N(e)(Object.assign({eventSender:i},o))};function R(e){if(!e)throw new Error('Either "transport" or "eventSender" must be provided.');return(0,p.mi)({transport:e})}const P=e=>({clientId:t,properties:n})=>{const r=(0,o.jl)("middleware:properties");let a;return o=>(null!=a||(a=(e=>s.Z9.getPropertySetId({clientId:t},n?n.map(s.OT):(0,s.y6)(),i.XH.extractDeclaredIdentifiers(e)))(o)),r.info("Property Set ID: %s",a),e(Object.assign(Object.assign({},o),{propertySetId:a})))};var k=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const D=(0,o.jl)("middleware:session-config");function w(e){for(var t=1;tt=>{const n=(0,o.jl)("middleware:sptcookie"),i=function(e){return e||M.get(x)}(t.sp_t_cookie);if(!("string"==typeof(r=i)&&r.length>5)){const t=(0,o.pB)();try{(e=>{if(!M.set(x,e,{expires:Date.now()+316224e5,path:"/"}))throw new Error("Unable to set sp_t cookie")})(t)}catch(e){n.error("error writing spt cookie",e)}return n=>e(Object.assign(Object.assign({},n),{sp_t_cookie:t}))}var r;return t=>e(Object.assign(Object.assign({},t),{sp_t_cookie:i}))};var V=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);on=>{var{timeout:r=t}=n,a=V(n,["timeout"]);0===r&&F.warn("Resolving with a timeout of zero, response will be discarded."),F.debug("resolve context",a);const s=i.tI.toPayload(a),c=a.auth;F.debug("User is authenticated? %s",c),F.debug("resolve request",s);const l=e.request(c?"@webgate/remote-config-resolver/v3/configuration":"@webgate/remote-config-resolver/v3/unauth/configuration",{method:"POST",headers:{"Content-Type":"application/json"},payload:JSON.stringify(s),responseType:"json",authorize:c,rejectNotOk:!0}).then((({body:e})=>(F.info("resolve response",e),i.yV.toConfiguration(e)))).catch((e=>{throw F.error("resolve error",e),e}));return(0,o.nK)(l,r)},H=(0,i.hh)(B).addMiddleware(P).addMiddleware((e=>({clientId:t,storage:n=localStorage,cacheFactory:r,timeout:a})=>{if(!n)return e;const p=function(e,t,n){if(l(e)&&n)throw new Error("[Remote-Configuration] Both storage as a cache and a cacheFactory supplied to Caching middleware, only one or the other is supported.");if(l(e))return e;if(n)return n(e,t);return new d(`com.spotify.single.item.cache:${t}`,e)}(n,t,r);return t=>c(void 0,void 0,void 0,(function*(){const n=i.XH.hash(t);let{timeout:r=a}=t,l=Number.POSITIVE_INFINITY;"number"==typeof r&&(l=r,r=Number.POSITIVE_INFINITY);const d=e(Object.assign(Object.assign({},t),{timeout:r}));try{const e=yield p.getConfig(n);if(u.info("cache %s for key %s",e?"hit":"miss",n),e)return s.VK.builder(e)}catch(e){u.warn("Error reading from cache.",e)}finally{d.then((e=>c(void 0,void 0,void 0,(function*(){try{yield p.setConfig(n,e)}catch(e){u.error("Error writing to cache.",e)}}))))}return(0,o.nK)(d,l)}))})).addMiddleware((e=>({backgroundFetchInterval:t=36e5})=>{const n=(0,o.jl)("middleware:background-fetch");if(t{return r=e(o),s=()=>{var r,s;r=()=>{e(Object.assign(Object.assign({},o),{fetchType:i.CK.BACKGROUND_SYNC})).catch((e=>{n.warn("Background fetch failed",e)}))},s=t,clearInterval(a),a=setInterval(r,s)},r.then((e=>(s(),e)),(e=>{throw s(),e}));var r,s}})).addMiddleware(L).addMiddleware(U).addMiddleware((e=>()=>{let t=null,n="";return o=>k(void 0,void 0,void 0,(function*(){const r=i.XH.hash(o);return n===r?(D.debug('Session matching hash: "%s" will be used. %o',r,t),t):(t=yield e(o),D.debug('Setting session hash: "%s"',r),n=r,t)}))})).addMiddleware((e=>()=>t=>e(Object.assign(Object.assign({},t),{auth:Boolean(null==t?void 0:t.username)}))))},17015:function(e,t,n){"use strict";n(86277);var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendMetric=t.reportMetrics=t.createSemanticMetrics=t.asNanoseconds=t.MetricTypes=void 0;const r=o(n(88216)),a=n(97594);t.MetricTypes={COUNTER:"counter",GAUGE:"gauge",TIMER:"timer"},t.asNanoseconds=function(e){return e};const s=(e,t)=>i(void 0,void 0,void 0,(function*(){if(Array.isArray(t.reporter)){const n=t.reporter.map((t=>t.send(e)));yield Promise.all(n)}else yield t.reporter.send(e)}));t.reportMetrics=s;const c=e=>{void 0!==e.dev&&e.dev&&(e.reporter=new a.NoopReporter);const t={queue:[],timeout:void 0,flush(){return i(this,void 0,void 0,(function*(){yield s(this.queue,e),this.queue=[],this.timeout=void 0}))}};let n=!1;void 0===e.batching&&(e.batching={delay:4e3}),e.batching&&"object"==typeof window&&"function"==typeof window.addEventListener&&window.addEventListener("beforeunload",(()=>{n=!0,t.flush()}));return{sendMetric:o=>i(void 0,void 0,void 0,(function*(){var i,r;const a=Object.assign({},o);if(o.tags&&(a.tags=Object.assign({},o.tags)),a.key=a.key||e.key,!a.key)throw new Error(`metric.key is required. Got: "${a.key}". Set it in createSemanticMetrics(...) or pass it to sendMetric(...).`);a.tags=Object.assign({app:null!==(i=e.app)&&void 0!==i?i:a.key,application:null!==(r=e.app)&&void 0!==r?r:a.key},a.tags),e.component_id?a.component_id=a.component_id||e.component_id:a.component_id=e.key,e.batching&&!n?(t.queue.push(a),t.timeout||(t.timeout=setTimeout((()=>t.flush()),e.batching.delay))):yield s([a],e)})),config:e,isWindowUnloading:n,flush:()=>e.batching?t.flush():(r.default.warn("Manual flushing only supported in batch mode. Set config.batching: true"),Promise.resolve())}};t.createSemanticMetrics=c;class l{static init(e){l.config&&r.default.error("SemanticMetrics has already been initialized. This may lead to dangerous side effects such as your metrics disappearing from Grafana due to the `key` value being overwritten by something else"),r.default.warn("The singleton usage of SemanticMetrics will be deprecated. Please use createSemanticMetrics()"),l.config=e;const{sendMetric:t,isWindowUnloading:n}=c(e);l.sendMetric=t,l.isWindowUnloading=n}}t.default=l;t.sendMetric=e=>i(void 0,void 0,void 0,(function*(){if(!l.config)throw new Error("SemanticMetrics has not been initialized. Call SemanticMetrics.init()");return l.sendMetric(e)}))},2297:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WEBAPI_URL=t.INTERNAL_WEBGATE_URL=void 0,t.INTERNAL_WEBGATE_URL="https://wgint.spotify.net",t.WEBAPI_URL="https://api.spotify.com"},83242:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o(n(45491),t),o(n(84949),t),o(n(23263),t);var a=n(17015);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r(a).default}})},45491:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Time=t.Timer=void 0,o(n(17015),t),o(n(51883),t),o(n(10856),t),o(n(41739),t);var r=n(15085);Object.defineProperty(t,"Timer",{enumerable:!0,get:function(){return r.Timer}});var a=n(41540);Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return a.Time}})},23263:(e,t,n)=>{"use strict";n(46758),n(45205),Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserMetrics=void 0;const i=n(17015),o=n(41540);function r(){const[e]=window.performance.getEntriesByType("navigation");return e}function a(e){return new Promise(((t,n)=>window.performance&&"function"==typeof performance.getEntriesByType?window.addEventListener("load",(()=>{const i=performance.getEntriesByType("paint"),o=i.find((({name:t})=>t===e));return void 0!==i&&o?t(o.startTime):n("Time to paint api is not supported on this browser")})):n("window.performance api is not supported in this browser")))}function s({name:e,label:t,value:n},i){let r;return r="cls"===e.toLowerCase()?{metric_type:"gauge",value:n}:{metric_type:"timer",value:o.Time.fromMillis(Math.round(n)).asNanos()},Object.assign(Object.assign({what:`web_vitals_${e.toLowerCase()}`},r),{tags:Object.assign({name:e,label:t},i)})}const c={getPageLoadTime:function(){return new Promise(((e,t)=>{if(!window.performance||"function"!=typeof performance.getEntriesByType)return t("window.performance api is not supported in this browser");if(void 0===r())return t("navigationTiming api is not supported in this browser");const{loadEventEnd:n}=r();return n>0?e(n):window.addEventListener("load",(()=>{setTimeout((()=>{const{loadEventEnd:t}=r();return e(t)}),0)}))}))},getResourceTiming:function(){return window.performance.getEntriesByType("resource")},getTimeToFirstPaint:function(){return a("first-paint")},getTimeToFirstContentfulPaint:function(){return a("first-contentful-paint")},sendWebVitalsMetric:function(e,t){return i.sendMetric(s(e,t))},getWebVitalsMetric:s};t.BrowserMetrics=c},41739:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleReporter=void 0;const r=o(n(88216));t.ConsoleReporter=class{constructor(e=2,t="info"){this.spacingLevel=e,this.logLevel=t}send(e){return i(this,void 0,void 0,(function*(){r.default.log(this.logLevel,`[semantic-metrics] ${JSON.stringify(e,null,this.spacingLevel)}`)}))}}},10856:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventSenderReporter=void 0;const r=n(53003),a=n(56238),s=n(98074),c=o(n(88216)),l=n(78168),u=n(2297);function d(e){return t=>e.isAuthenticated()?a.createSemanticMetricClient(t):s.createSemanticMetricClientNonAuth(t)}class p{constructor(e,t,n="browser",i){this.eventSender=e,this.createEvent=t,this.environment=n,this.transport=i}static create(e){const t="getToken"in e?e.getToken:null,n="ownerProvider"in e?e.ownerProvider:null,o=e.context?[...e.context]:void 0,a=e.environment,s=l.createBaseTransport({providers:{endpoints:(()=>{const t=l.createXResolveProvider();return n=>i(this,void 0,void 0,(function*(){const i=yield t(n);return Object.assign(Object.assign({},i),e.internal&&{webgate:u.INTERNAL_WEBGATE_URL})}))})(),token:()=>new Promise((e=>{t?t(((t,n)=>{e(void 0===n?t:[t,n])})):e("")}))}});t&&(s.on(l.TransportEvent.CONNECTED,(()=>{s.authenticate().catch((e=>{var t,n;c.default.debug("authentication fail.",null!==(n=null!==(t=null==e?void 0:e.message)&&void 0!==t?t:null==e?void 0:e.code)&&void 0!==n?n:"")}))})),s.on(l.TransportEvent.AUTHENTICATED,(()=>{c.default.debug("created authenticated browser transport")})),s.on(l.TransportEvent.TOKEN_PROVIDER_ERROR,(()=>{c.default.debug("the token provided isn't working.")}))),s.connect();const f=r.createEventSender(Object.assign({transport:s,context:o},n&&{ownerProvider:n})),h=d(s);return new p(f,h,a,s)}static createWithCustomTransport(e){const t="ownerProvider"in e?e.ownerProvider:null,n=e.context?[...e.context]:void 0,i=r.createEventSender(Object.assign({transport:e.transport,context:n},t&&{ownerProvider:t})),o=d(e.transport);return new p(i,o,e.environment,e.transport)}send(e){return i(this,void 0,void 0,(function*(){for(const t of e){const e=Object.assign({},t);e.tags=Object.assign({},e.tags),e.tags.environment&&c.default.error("`tags.environment` must not be set. It is a reserved tag and will be overwritten."),e.tags.environment=this.environment;const n=this.createEvent(Object.assign({},e));this.eventSender.send(n,{flush:!1})}return this.eventSender.flush(this.transport.isAuthenticated())}))}}t.EventSenderReporter=p},97594:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopReporter=void 0;t.NoopReporter=class{send(e){return n(this,void 0,void 0,(function*(){}))}}},51883:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},41540:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;class n{constructor(e=0){this.nanos=e}static fromNanos(e){return new n(e)}static fromMicros(e){return new n(1e3*e)}static fromMillis(e){return new n(1e6*e)}static fromSeconds(e){return new n(1e9*e)}static from(e){return new n(e.asNanos())}asSeconds(){return this.nanos/1e9}asMillis(){return this.nanos/1e6}asMicros(){return this.nanos/1e3}asNanos(){return Math.round(this.nanos)}}t.Time=n,n.ZERO=new n(0)},15085:(e,t,n)=>{"use strict";var i=n(14224);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=t.getHighResolutionTime=t.getLowResolutionTime=t.getTime=t.getBrowserTime=t.supportsHighResolutionTime=void 0;const o=n(41540),r=n(17015);t.supportsHighResolutionTime=()=>"undefined"==typeof window&&"function"==typeof i.hrtime;t.getBrowserTime=()=>"undefined"!=typeof performance?performance.now():Date.now();t.getTime=()=>t.supportsHighResolutionTime()?i.hrtime():t.getBrowserTime();t.getLowResolutionTime=e=>{const n=t.getTime()-e,i=o.Time.fromMillis(n);return{nanoseconds:r.asNanoseconds(i.asNanos()),milliseconds:i.asMillis(),seconds:i.asSeconds()}};t.getHighResolutionTime=e=>{const[t,n]=i.hrtime(e),o=1e9*t+n,a=o/1e6,s=o/1e9;return{nanoseconds:r.asNanoseconds(o),milliseconds:a,seconds:s}};class a{constructor(e){this.startTime=e}static start(){return new a(t.getTime())}end(){return t.supportsHighResolutionTime()?t.getHighResolutionTime(this.startTime):t.getLowResolutionTime(this.startTime)}}t.Timer=a},84949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUniversalReporter=void 0;const i=n(10856),o=n(93260);t.createUniversalReporter=function(e={}){const t=e.context?[o.createUserAgentContext(),...e.context]:[o.createUserAgentContext()];return i.EventSenderReporter.create(Object.assign(Object.assign({environment:"browser"},e),{context:t}))}},88292:(e,t,n)=>{"use strict";t.hb=t.wm=void 0;var i=n(85828);Object.defineProperty(t,"wm",{enumerable:!0,get:function(){return i.logPageActionForTestStep}}),Object.defineProperty(t,"hb",{enumerable:!0,get:function(){return i.setUpSpektrumLogging}})},85828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testables=t.setUpSpektrumLogging=t.logPageActionForTestStep=void 0;const n=[];function i(){const e=globalThis.spektrumLoggingInternals;e&&(n.forEach((t=>{e.logPageActionForTestStep({title:t.title,timestamp:t.timestamp})})),n.length=0)}t.logPageActionForTestStep=function(e){const t={title:e,timestamp:Date.now()};n.push(t),i()},t.setUpSpektrumLogging=function(){globalThis.spektrumLoggingInternalsFromApp={reportPageActions(){i()}}},t.testables={resetForTesting(){n.length=0},getPageActionsToReport:()=>n}},23335:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GTM_SHA_HASH:()=>s,OPTIMIZE_SHA_HASH:()=>T,addConsentListener:()=>b,getConsentInfo:()=>A,removeConsentListener:()=>S,track:()=>C});n(46758),n(27082);function i(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}function o(){window.dataLayer=window.dataLayer||[],window.dataLayer.push(arguments)}n(86277);function r({async:e,dataset:t,onError:n,onLoad:i,src:o,nonce:r}){const a=document.createElement("script");e&&(a.async=e),t&&Object.keys(t).map((e=>{a.dataset[e]=t[e]})),n&&a.addEventListener("error",n),i&&a.addEventListener("load",i),r&&a.setAttribute("nonce",r),a.src=o,document.head.appendChild(a)}function a({innerHTML:e,nonce:t}){const n=document.createElement("script");t&&n.setAttribute("nonce",t),n.innerHTML=e,document.head.appendChild(n)}const s="'sha256-WfsTi7oVogdF9vq5d14s2birjvCglqWF842fyHhzoNw='";function c({id:e,additionalData:t,nonce:n}){window.__gtm_additional_data=t||"",window.__gtm_track_id=e,a({innerHTML:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl+window.__gtm_additional_data;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer',window.__gtm_track_id);",nonce:n})}n(2836),n(92372),n(70069),n(44227),n(91499),n(68856),n(18004),n(16527);const l="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js";const u=e=>e.slice(e.indexOf("."));var d=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};const p="50da44be-0564-43df-b139-329aedcf267b",f=new Set,h=new Set;function m({timeout:e=5e3,oneTrustDomainScript:t}){return d(this,void 0,void 0,(function*(){let n;return window.OptanonWrapper=g,new Promise(((i,o)=>{r({dataset:{domainScript:t||p,documentLanguage:"true"},onError:o,onLoad:i,src:l}),n=setTimeout(o,e)})).then((()=>clearTimeout(n)))}))}function g(){var e,t;window.gtag||(window.gtag=o);const n=A();var r;n&&f.forEach((e=>{try{e(n)}catch(e){}})),null===(e=window.OneTrust)||void 0===e||e.OnConsentChanged(E),(window.__cmp||window.__tcfapi)&&window.OptanonActiveGroups&&(null===(t=n)||void 0===t?void 0:t.consentId)&&(r=n.consentId,window.__tcfapi?window.__tcfapi("getTCData",2,function(e){return function(t,n){if(!n)return;const o=JSON.stringify({id:e,iab:t.tcString,cate:window.OptanonActiveGroups});y(),i({consentData:o})}}(r)):window.__cmp("getVendorConsents",{},function(e){return function(t){const n=JSON.stringify({id:e,iab:t.metadata,cate:window.OptanonActiveGroups});y(),i({consentData:n})}}(r)))}const _="sp_consent",v=-1e3;function y(){const e=u(window.location.hostname);document.cookie=[`${_}=`,`max-age=${v}`,`domain=${e}`,"path=/"].join("; ")}function E(){const e=A();e&&h.forEach((t=>{try{t(e)}catch(e){}}))}function b(e,t){t&&f.add(e),h.add(e)}function S(e){f.delete(e),h.delete(e)}function A(){const e=function(e){const t=`${e}=`,n=decodeURIComponent(document.cookie).split(";");for(let e=0;e{const[n,i]=t.split("=");return n&&(e[n]=decodeURIComponent(i)),e}),{}))||{};var o;if(!n||!i||""===i)return;const r=function(e){if(!e)return{};return e.split(",").reduce(((e,t)=>{const[n,i]=t.split(":");return e[n]="1"===i,e}),{})}(t);return{groups:r,consentId:n,date:function(e){const t=e.replace(/\+/g," ");return new Date(t)}(i)}}const T="'sha256-KRzjHxCdT8icNaDOqPBdY0AlKiIh5F8r4bnbe1PQwss='";function O({id:e,timeout:t=4e3,nonce:n}){window.__optimize_timeout=t,window.__optimize_options={},window.__optimize_options[e]=!0,function({innerHTML:e}){const t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t)}({innerHTML:".async-hide { opacity: 0 !important}"}),a({innerHTML:'(function(a,s,y,n,c,h,i,d,e){d=true;s.className+=\' \'+y;h.start=1*new Date;h.end=i=function(t){s.className=s.className.replace(RegExp(" ?"+y),""),e=new Date-h.start,(ewindow.dataLayer&&window.dataLayer.hide&&window.dataLayer.hide.end&&window.dataLayer.hide.end(),src:`https://www.googleoptimize.com/optimize.js?id=${e}`,nonce:n})}var I=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function C(e){return I(this,void 0,void 0,(function*(){if(!e)return Promise.resolve();const t=function(e){const{dataLayerPushInitial:t,googleOptimizeId:n,googleTagManagerId:i,language:o,market:r,oneTrust:a}=e;return{loadGoogleOptimize:!!n,loadGoogleTagManager:!!i,loadOneTrust:a&&r,pushInitialData:t&&o&&r}}(e);return function({language:e,loggedIn:t=!1,pushInitialData:n,market:o,userCountry:r=""}){n&&i({language:e,loggedIn:t,market:o,userCountry:r})}(Object.assign(Object.assign({},t),e)),yield function({loadGoogleOptimize:e,loadGoogleTagManager:t,loadOneTrust:n,googleOptimizeId:i,googleOptimizeTimeout:o,googleTagManagerId:r,googleTagManagerAdditionalData:a,oneTrustDomainScript:s,nonce:l}){return I(this,void 0,void 0,(function*(){const u=[];return e&&u.push(O({id:i,timeout:o})),t&&n?u.push(m({oneTrustDomainScript:s}).then((()=>c({id:r,additionalData:a,nonce:l})))):n?u.push(m({oneTrustDomainScript:s})):t&&u.push(c({id:r,additionalData:a,nonce:l})),Promise.all(u)}))}(Object.assign(Object.assign({},t),e))}))}},98777:(e,t,n)=>{"use strict";var i;n.d(t,{J:()=>i}),function(e){e.HTTP_REQUEST_ABORTED="HTTP_REQUEST_ABORTED",e.HTTP_REQUEST_FAILED="HTTP_REQUEST_FAILED",e.LOGGING_REQUEST_FAILED="LOGGING_REQUEST_FAILED",e.TRANSPORT_ENDPOINTS_PROVIDER_ERROR="TRANSPORT_ENDPOINTS_PROVIDER_ERROR",e.TRANSPORT_INVALID_STATE="TRANSPORT_INVALID_STATE",e.TRANSPORT_INVALID_TOKEN="TRANSPORT_INVALID_TOKEN",e.TRANSPORT_STALE_TOKEN="TRANSPORT_STALE_TOKEN ",e.TRANSPORT_TOKEN_PROVIDER_ERROR="TRANSPORT_TOKEN_PROVIDER_ERROR",e.TRANSPORT_LIFECYCLE_DISABLED="TRANSPORT_LIFECYCLE_DISABLED",e.TRANSPORT_UNSUPPORTED_OPTION="TRANSPORT_UNSUPPORTED_OPTION",e.XRESOLVE_INCOMPLETE_RESPONSE="XRESOLVE_INCOMPLETE_RESPONSE",e.XRESOLVE_INVALID_RESPONSE="XRESOLVE_INVALID_RESPONSE",e.XRESOLVE_REQUEST_FAILED_WITH_STATUS="XRESOLVE_REQUEST_FAILED_WITH_STATUS"}(i||(i={}))},95471:(e,t,n)=>{"use strict";var i;n.d(t,{j:()=>i}),function(e){e.CONNECTION_ONLINE="online",e.CONNECTION_OFFLINE="offline",e.PRODUCT_STATE_CHANGED="product_state_changed",e.ACCESS_TOKEN="access_token",e.AUTHENTICATED="authenticated",e.AUTHENTICATION_FAILED="authentication_failed",e.BEFORE_OFFLINE_DISCONNECT="before_offline_disconnect",e.BEFORE_ONLINE_DISCONNECT="before_online_disconnect",e.CONNECTED="connected",e.CONNECTION_FAILED="connection_failed",e.CONNECTION_ID="connection_id",e.DISCONNECTED="disconnected",e.ENDPOINTS_RESOLVED="endpoints_resolved",e.LOGGED_OUT="logged_out",e.SHORT_SESSION_DISCONNECTED="short_session_disconnected",e.TOKEN_PROVIDER_ERROR="token_provider_error",e.RECONNECTED="reconnected",e.RECONNECTING="reconnecting",e.WINDOW_BEFORE_UNLOAD="beforeunload"}(i||(i={}))},82094:(e,t,n)=>{"use strict";var i;n.d(t,{r:()=>i}),function(e){e[e.CLOSE=4e3]="CLOSE",e[e.TIMEOUT=4001]="TIMEOUT"}(i||(i={}))},53104:(e,t,n)=>{"use strict";var i;n.d(t,{n:()=>i}),function(e){e.DELETE="DELETE",e.GET="GET",e.OPTIONS="OPTIONS",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.TRACE="TRACE"}(i||(i={}))},77202:(e,t,n)=>{"use strict";var i;n.d(t,{t:()=>i}),function(e){e.TRANSPORT_AUTHENTICATE="transport_authenticate",e.TRANSPORT_AUTHENTICATE_FAILED="transport_authenticate_failed",e.TRANSPORT_CONNECT="transport_connect",e.TRANSPORT_DISCONNECT="transport_disconnect",e.TRANSPORT_ENDPOINTS_RESOLVED="transport_endpoints_resolved",e.TRANSPORT_BEFORE_PROCESS_REQUEST="transport_before_process_request",e.TRANSPORT_BEFORE_SEND_REQUEST="transport_before_send_request",e.TRANSPORT_BEFORE_RETURN_RESPONSE="transport_before_return_response",e.TRANSPORT_REQUEST="transport_request",e.PLUGIN_CONNECTION_INFO="plugin_connection_info",e.PLUGIN_DISCONNECTED="plugin_disconnected",e.PLUGIN_MESSAGE="plugin_message",e.PLUGIN_REQUEST="plugin_request",e.PLUGIN_ERROR="plugin_error"}(i||(i={}))},14297:(e,t,n)=>{"use strict";var i;n.d(t,{G:()=>i}),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.TIMED_OUT=408]="TIMED_OUT",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_ENTITY_TOO_LARGE=413]="REQUEST_ENTITY_TOO_LARGE",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED"}(i||(i={}))},78168:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConnectionObserver:()=>d,DEALER_PLUGIN_NAME:()=>_.hI,DealerErrors:()=>_.G7,DisconnectionReason:()=>r,Method:()=>c.n,PluginEvent:()=>l.t,REQUEST_TRANSFORMER_PLUGIN_NAME:()=>he,TransportErrors:()=>a.J,TransportEvent:()=>s.j,createAbortControllerLike:()=>g,createBaseTransport:()=>_e,createSpotifyComEndpointsProvider:()=>de,createSpotifyComProviders:()=>fe,createSpotifyComTokenProvider:()=>pe,createTransport:()=>ve,createXResolveProvider:()=>ue.Q,dealerCreator:()=>_.dv,requestTransformerCreator:()=>ge});var i={};n.r(i),n.d(i,{isSupported:()=>C,request:()=>N});var o={};n.r(o),n.d(o,{request:()=>le});var r,a=n(98777),s=n(95471),c=n(53104),l=n(77202);!function(e){e.RECONNECTION_FAILED="reconnection_failed",e.EXPLICIT="explicit",e.LOG_OUT="log_out",e.WINDOW_BEFORE_UNLOAD="window_before_unload"}(r||(r={}));var u=n(17909);class d extends u.vp{}class p extends d{constructor(e){super();const t="undefined"!=typeof window,n=e&&e.notifyBeforeUnload;this._navigator=t&&window.navigator||null,t&&"function"==typeof window.addEventListener&&(window.addEventListener("online",this.emitSync.bind(this,s.j.CONNECTION_ONLINE,null)),window.addEventListener("offline",this.emitSync.bind(this,s.j.CONNECTION_OFFLINE,null)),n&&window.addEventListener(s.j.WINDOW_BEFORE_UNLOAD,this.emitSync.bind(this,s.j.WINDOW_BEFORE_UNLOAD,null)))}static create(e){return new p(e)}isOnline(){const e=this._navigator;return!e||!("onLine"in e)||e.onLine}}class f extends u.vp{constructor(){super(),this._aborted=!1,this.onabort=null,this.on("abort",(()=>{var e;return null===(e=this.onabort)||void 0===e?void 0:e.call(this)}))}static abort(){const e=new f;return e._aborted=!0,e}static signalAbort(e){"_aborted"in e&&!e._aborted&&(e._aborted=!0,e.emit("abort",null))}get aborted(){return this._aborted}set aborted(e){}addEventListener(e,t){this.addListener(e,t)}removeEventListener(e,t){this.removeListener(e,t)}dispatchEvent(){}}class h{constructor(){this.signal=new f}abort(){const e=this.signal;f.signalAbort(e)}}function m(){return"undefined"!=typeof window&&"function"==typeof window.AbortController}const g=m()?()=>new AbortController:()=>new h;var _=n(27532),v=n(97127);const y={POST:!0,PUT:!0,DELETE:!0};var E=n(14297);class b extends Error{constructor(e,t,n,i){super(e),this.name="RequestError",this.message=e,this.code=t,this.status=n||0,this.url=i}}class S extends b{constructor(e){super("Request aborted by signal.",a.J.HTTP_REQUEST_ABORTED,0,e),this.name="RequestAbortedError",this.message="Request aborted by signal."}}class A{constructor(e){this.get=e.get.bind(e),this.has=e.has.bind(e)}get(e){return null}has(e){return!1}}class T{constructor(e,t=0){this.url="",this.status=0,this.headers=null,this.body=null,this.offline=!1,this.timing=null,this.metadata=null,this.retries={count:0},this.url=e,this.status=t,this.ok=t>=200&&t<=299}getStatusFamily(){return 0|this.status/100}}const O=v.P.forTag("transport.http.fetch"),I={json:!0,text:!0,arraybuffer:!0,blob:!0};function C(){return"function"==typeof fetch}function N(e){if(!C())return Promise.reject(new TypeError("Fetch is not supported"));const t=e.options.signal;if(null==t?void 0:t.aborted)return Promise.reject(new S(e.url));if(!e.url)return Promise.reject(new TypeError("Request URL cannot be blank."));const n=e.method||"GET";let i=e.url,o=null;if(n in y&&e.payload?o=e.payload:e.payload&&(i+=`?${e.payload}`),e.options.responseType&&!(e.options.responseType in I))return Promise.reject(new TypeError("Cannot set responseType: not supported in browser."));const r={mode:e.options.mode||"cors",credentials:e.options.credentials||"same-origin",redirect:e.options.redirect||"follow",signal:t,method:n};e.headers.count()&&(r.headers=e.headers.toJSON()),o&&(r.body=o);const a=Date.now();return fetch(i,r).then((function(t){let n;n=e.options.ignoreResponseBody||t.status===E.G.NO_CONTENT?null:"json"===e.options.responseType?t.json().catch((function(e){return O.warn("Could not parse response as JSON:",e),null})):"arraybuffer"===e.options.responseType?t.arrayBuffer():"blob"===e.options.responseType?t.blob():t.text();const i=e.options.parseResponseHeaders||t.status>299?new A(t.headers):null;return Promise.all([t.url,t.status,i,n])})).then((function([t,n,i,o]){const r=new T(t,n);if(r.body=o,r.headers=i,e.options.timing){const e=Date.now()-a;r.timing={completed:e}}return r})).catch((function(t){if("AbortError"===(null==t?void 0:t.name))throw new S(i);const n=new T(i);if(e.options.timing){const e=Date.now()-a;n.timing={completed:e}}return n})).then((function(t){return e.options.connectionObserver&&(t.offline=!e.options.connectionObserver.isOnline()),t}))}var L=n(99938),R=n(843);const P=200,k=0,D="linear",w=!0;class M{constructor(e={}){this._curve=e.curve||D,this._baseTime=e.baseTime||P,this._ceiling=e.ceiling||k,this._jitter="jitter"in e?!!e.jitter:w}getTime(e){let t;switch(this._curve){case"static":t=1;break;case"logarithmic":t=Math.log(e);break;case"exponential":t=Math.pow(Math.E,e);break;default:t=e+1}let n=Math.min(4294967296,Math.floor(t*this._baseTime));return this._ceiling&&(n=Math.min(n,this._ceiling)),this._jitter?function(e){const t=e/5;return Math.floor(e-t/2+Math.random()*t)}(n):n}}const x={backoffInitial:!1,baseTime:200,ceiling:0,curve:"linear",jitter:!0,maxDuration:1/0,maxRetries:1/0,maxTime:1/0,retryPredicate:()=>!0};class U{constructor(e,t){this._resolver=(0,R.$)(),this._ts=0,this._callCount=0,this._tickInterval=0,this._isRunning=!1,this._isDestroyed=!1;const n=Object.assign(Object.assign({},x),t),{backoffInitial:i,maxDuration:o,maxRetries:r,maxTime:a,retryPredicate:s}=n,c=(0,L.__rest)(n,["backoffInitial","maxDuration","maxRetries","maxTime","retryPredicate"]);this._fn=e,this._backoffInitial=i,this._maxDuration=o,this._maxRetries=r,this._maxTime=a,this._retryPredicate=s,this._backoffInitial=i,this._counter=new M(c),this._backoffInitial&&(this._maxRetries+=1)}static init(e,t={}){return new U(e,t).start()}_destroy(){this._isRunning=!1,this._isDestroyed=!0}_failure(e){if(!this._isDestroyed)if(e&&"retryAfter"in e)this._retryAfter(e);else{const t=this._counter.getTime(this._callCount);this._shouldRetry(t,e)?(this._callCount++,this._tickInterval=setTimeout((()=>this._tick()),t)):(this._resolver.reject(e),this._destroy())}}_retryAfter(e){this._callCount++,this._tickInterval=setTimeout((()=>this._tick()),e.retryAfter)}_success(...e){this._isDestroyed||(this._resolver.resolve(...e),this._destroy())}_shouldRetry(e,t){const n=Date.now()-this._ts+e;return this._callCountthis._success(...e))).catch((e=>this._failure(e)))}getResolver(){return this._resolver.promise}start(){return this._isDestroyed?Promise.reject(new Error("Backoff already consumed")):(this._isRunning||(this._ts=Date.now(),this._isRunning=!0,this._backoffInitial?(this._callCount=1,this._tickInterval=setTimeout((()=>this._tick()),this._counter.getTime(0))):this._tick()),this._resolver.promise)}stop(){clearTimeout(this._tickInterval),this._destroy()}getRetryCount(){return this._callCount}}var V,F,B=n(82094);!function(e){e[e.CONNECTION_ERROR=0]="CONNECTION_ERROR",e[e.INFORMATIONAL=1]="INFORMATIONAL",e[e.SUCCESS=2]="SUCCESS",e[e.REDIRECTION=3]="REDIRECTION",e[e.CLIENT_ERROR=4]="CLIENT_ERROR",e[e.SERVER_ERROR=5]="SERVER_ERROR"}(V||(V={}));class H extends Error{constructor(e,t,n=null){super(t),this.name="TransportError",this.message=t,this.code=e,this.origin=n}}class G{constructor(e){this._headers={},this._count=0,this._setAll(e)}_setAll(e){let t=0;for(const n in e)e.hasOwnProperty(n)&&e[n]&&(this._headers[n.toLowerCase()]=e[n],t++);this._count=t}get(e){return this._headers[e.toLowerCase()]||null}has(e){return!!this._headers[e.toLowerCase()]}set(e,t){this._headers[e.toLowerCase()]=t,this._count++}delete(e){const t=e.toLowerCase();this._headers[t]&&this._count--,delete this._headers[e.toLowerCase()]}count(){return this._count}toJSON(){return Object.assign({},this._headers)}}class K{constructor(e,t){this.url=e,this.method=(null==t?void 0:t.method)||"GET",this.headers=new G(null==t?void 0:t.headers),this.options=(null==t?void 0:t.options)||{},this.payload=null==t?void 0:t.payload,this.urlExpanded=(null==t?void 0:t.urlExpanded)||!1,this.retryOptions=(null==t?void 0:t.retryOptions)||{}}static create(e,t){return new K(e,t)}clone(){const e=new K(this.url);return e.method=this.method,e.headers=new G(this.headers.toJSON()),e.options=this.options,e.payload=this.payload,e.urlExpanded=this.urlExpanded,e.retryOptions=this.retryOptions,e}}!function(e){e.EVENT_ACCESS_TOKEN="access_token",e.EVENT_CONNECTION_ID="connection_id",e.EVENT_CONNECTION_OFFLINE="connection_offline",e.EVENT_CONNECTION_ONLINE="connection_online",e.EVENT_ENDPOINTS_RESOLVED="endpoints_resolved"}(F||(F={}));class W extends u.vp{constructor(e,t){super(),this.EVENT_ACCESS_TOKEN=F.EVENT_ACCESS_TOKEN,this.EVENT_CONNECTION_ID=F.EVENT_CONNECTION_ID,this.EVENT_CONNECTION_OFFLINE=F.EVENT_CONNECTION_OFFLINE,this.EVENT_CONNECTION_ONLINE=F.EVENT_CONNECTION_ONLINE,this.EVENT_ENDPOINTS_RESOLVED=F.EVENT_ENDPOINTS_RESOLVED,this.StatusCode=E.G,this.StatusFamily=V,this.getConnectionId=e.getConnectionId.bind(e),this.getEndpoints=e.getEndpoints.bind(e),this.getInitTime=e.getInitTime.bind(e),this.getLastToken=e.getLastToken.bind(e),this.matchMessages=e.matchMessages.bind(e),this.unmatchMessages=e.unmatchMessages.bind(e),this.handlePushRequests=e.handlePushRequests.bind(e),this.unhandlePushRequests=e.unhandlePushRequests.bind(e),this.hasPlugin=e.hasPlugin.bind(e),this.getPluginAPI=e.getPluginAPI.bind(e);const n=e.request.bind(e);(null==t?void 0:t.requestOptions)?this.request=(e,i)=>n(e,i?Object.assign(Object.assign(Object.assign({},null==t?void 0:t.requestOptions),i),{metadata:Object.assign(Object.assign({},t.requestOptions.metadata),null==i?void 0:i.metadata),retry:Object.assign(Object.assign({},t.requestOptions.retry),null==i?void 0:i.retry)}):t.requestOptions):this.request=n,this.proxyEmit(e,s.j.ACCESS_TOKEN,F.EVENT_ACCESS_TOKEN),this.proxyEmit(e,s.j.CONNECTION_OFFLINE,F.EVENT_CONNECTION_OFFLINE),this.proxyEmit(e,s.j.CONNECTION_ONLINE,F.EVENT_CONNECTION_ONLINE),this.proxyEmit(e,s.j.ENDPOINTS_RESOLVED,F.EVENT_ENDPOINTS_RESOLVED),this.onAddListener(F.EVENT_CONNECTION_ID,this._onAddConnectionIdListener.bind(this,e.on.bind(e))),this.onRemoveListener(F.EVENT_CONNECTION_ID,this._onRemoveConnectionIdListener.bind(this,e.removeListener.bind(e)))}_onAddConnectionIdListener(e,t){t.preventDefault();const n=t.data.listener,i=e=>{const t=this.createEvent(F.EVENT_CONNECTION_ID,e.data);n.call(this,t)};n.$proxy_wrapper=i,e(s.j.CONNECTION_ID,i,t.data.options)}_onRemoveConnectionIdListener(e,t){t.preventDefault();const n=t.data.listener;n.$proxy_wrapper&&e(s.j.CONNECTION_ID,n.$proxy_wrapper,t.data.options)}removeAllListeners(){return this}}class Y{constructor(){this._startTime=null,this._endTime=null}static create(){return new Y}start(){if(null!==this._startTime)throw new Error("Measurement is already in progress.");this._startTime=Date.now()}end(){if(null===this._startTime||null!==this._endTime)throw new Error("Measurement is not in progress.");this._endTime=Date.now()}getMetrics(){if(null===this._startTime||null===this._endTime)throw new Error("Measurement is not done.");return{start_time:this._startTime,end_time:this._endTime}}}const j=v.P.forTag("transport.transport"),z=/^(?:https?:\/\/)?@([^\/]+)\//,J=/^(ws|http)s?:\/\/.*[^\/]$/,q=/^([a-zA-Z]{3},\ \d{1,2}\ [a-zA-Z]{3}\ (\d{1,2}.){3})/,X={xhr:!0,fetch:!0},Z=1,Q=4;function $(e,t){const n=`access_token=${encodeURIComponent(t)}`,[i,o]=e.split("?");if(!o)return`${i}?${n}`;const r=o.replace(/access_token=[^&]*(&|$)/,`${n}$1`);return r!==o?`${i}?${r}`:`${i}?${n}&${o}`}class ee extends u.vp{constructor(e){if(super(),this._plugins={},this._pluginMediator=new u.vp,this._connectCalled=!1,this._authenticateCalled=!1,this._endpoints=null,this._lastToken=null,this._lastTokenExpiry=0,this._refreshTokenPromise=null,this._authenticationPromise=null,this._reconnectTimeout=0,this._isReconnecting=!1,this._initTime=0,this._lastDisconnect=0,this._stateMask=0,this._quickDisconnectCount=0,this._counter=new M({curve:"exponential",baseTime:5e3,ceiling:15e3}),this._stateAwareListeners={connected:[],authenticated:[],connection_id:[],transport_connect:[],transport_authenticate:[]},this._stateAwareOperationMetrics={authenticated:null},this._stateAwareRunners={connected:null,authenticated:null,connection_id:null,transport_connect:null,transport_authenticate:null},!e)throw new TypeError("Argument `options` for Transport cannot be null.");if(!e.providers)throw new TypeError("Argument `options.providers` for Transport cannot be null.");this._ownerRef="ownerRef"in e?Object(e.ownerRef):{},this._tokenProvider=e.providers.token,this._endpointsProvider=e.providers.endpoints,this._XHR=e.XHR,this._Fetch=e.Fetch,this._reconnectionRetries=e.reconnectionRetries>=0?e.reconnectionRetries:3,this._requestMode=e.requestMode in X?e.requestMode:"xhr",this._forcePolyfillTypes=e.forcePolyfillTypes||{},this._disableAutoLogout="disableAutoLogout"in e&&!!e.disableAutoLogout,this._disconnectBeforeUnload=e.disconnectBeforeUnload||!1;const t=e.createConnectionObserver||p.create;this._connectionObserver=t({notifyBeforeUnload:this._disconnectBeforeUnload}),this.authenticate=this.authenticate.bind(this),this._authenticateWithToken=this._authenticateWithToken.bind(this),this._connectToEndpoints=this._connectToEndpoints.bind(this),this._parseProvidedToken=this._parseProvidedToken.bind(this),this._onConnected=this._onConnected.bind(this),this._onAuthenticated=this._onAuthenticated.bind(this),this._onAuthenticationFailed=this._onAuthenticationFailed.bind(this),this._init()}static create(e){return new ee(e)}_init(){this.onAddListener(s.j.CONNECTED,this._onAddListener.bind(this,"connected")),this.onAddListener(s.j.AUTHENTICATED,this._onAddListener.bind(this,"authenticated")),this.onAddListener(s.j.CONNECTION_ID,this._onAddListener.bind(this,"connection_id")),this.onRemoveListener(s.j.CONNECTED,this._onRemoveListener.bind(this,"connected")),this.onRemoveListener(s.j.AUTHENTICATED,this._onRemoveListener.bind(this,"authenticated")),this.onRemoveListener(s.j.CONNECTION_ID,this._onRemoveListener.bind(this,"connection_id")),this._pluginMediator.onAddListener(l.t.TRANSPORT_CONNECT,this._onAddListener.bind(this,"transport_connect")),this._pluginMediator.onAddListener(l.t.TRANSPORT_AUTHENTICATE,this._onAddListener.bind(this,"transport_authenticate")),this._pluginMediator.onRemoveListener(l.t.TRANSPORT_CONNECT,this._onRemoveListener.bind(this,"transport_connect")),this._pluginMediator.onRemoveListener(l.t.TRANSPORT_AUTHENTICATE,this._onRemoveListener.bind(this,"transport_authenticate")),"fetch"!==this._requestMode||this._Fetch&&this._Fetch.isSupported()||(j.warn('Default "fetch" request mode unavailable; Fallback to "xhr"'),this._requestMode="xhr");const e=this._pluginMediator;e.addListeners({[l.t.PLUGIN_DISCONNECTED]:this._onPluginDisconnected.bind(this)}),this.proxyEmit(e,l.t.PLUGIN_CONNECTION_INFO,s.j.CONNECTION_ID),this._disableAutoLogout||this.matchMessages("client:logout",(()=>this._onLogout())),this._connectionObserver.on(s.j.CONNECTION_ONLINE,(()=>this._onOnline())),this._connectionObserver.on(s.j.CONNECTION_OFFLINE,(()=>this._onOffline())),this._connectionObserver.on(s.j.WINDOW_BEFORE_UNLOAD,(()=>this._disconnect(r.WINDOW_BEFORE_UNLOAD)))}_runStateAwareQueues(e,t){const n=this._stateAwareListeners[e].splice(0);for(const e of n)e.call(this,t);this._stateAwareRunners[e]=null}_connect(){return this._stateMask&Z?Promise.resolve(!1):this._connectionObserver.isOnline()?this._performConnect():new Promise(((e,t)=>{j.info("Waiting to go online before connecting"),this._connectionObserver.once(s.j.CONNECTION_ONLINE,(()=>{this._performConnect().then(e,t)}))}))}_performConnect(){return new Promise((e=>{j.info("Resolving endpoints"),e(this._endpointsProvider(this.toPublic()))})).catch((e=>{const t=(null==e?void 0:e.code)?e:new H(a.J.TRANSPORT_ENDPOINTS_PROVIDER_ERROR,(null==e?void 0:e.message)||"Endpoints provider error",null!=e?e:null);return j.error("Endpoints resolution failed",t),Promise.reject(t)})).then(this._connectToEndpoints).then(this._onConnected).catch((e=>{const t=e&&e.error?e.error:e;return this.emit(s.j.CONNECTION_FAILED,{error:t}),j.error("Connection failed",t),Promise.reject(t)}))}_connectToEndpoints(e){const t={webgate:"",webapi:""};for(const n in e){if(!e.hasOwnProperty(n))continue;let i=e[n];i&&(J.test(i)&&(i+="/"),t[n]=i)}this._endpoints=t,this.emit(s.j.ENDPOINTS_RESOLVED,{endpoints:Object.assign({},t)}),j.info("Endpoints resolved");const n=[],i=e=>{n.push(e)};return j.info("Waiting for plugins to connect"),new Promise(((e,o)=>{this._pluginMediator.emitAndWait(l.t.TRANSPORT_CONNECT,{endpoints:Object.assign({},t),awaitPromise:i},(()=>{Promise.all(n).then((()=>e(!0)),o)}))}))}_refreshToken(e=!1){if(this._refreshTokenPromise)return this._refreshTokenPromise;if(!e&&this._lastToken&&this._lastTokenExpiry>Date.now())return Promise.resolve(this._lastToken);this._refreshTokenPromise=new Promise((e=>{j.info("Requesting token from provider"),e(this._tokenProvider())})).then(this._parseProvidedToken);const t=()=>{this._refreshTokenPromise=null};return this._refreshTokenPromise.then(t,t),this._refreshTokenPromise.catch((e=>{const t=(null==e?void 0:e.code)?e:new H(a.J.TRANSPORT_TOKEN_PROVIDER_ERROR,(null==e?void 0:e.message)||"Token provider error",e);return this.emit(s.j.TOKEN_PROVIDER_ERROR,{error:t}),j.error("Token provider error",t),Promise.reject(t)}))}_parseProvidedToken(e){let t,n;if(Array.isArray(e)?(t=e[0],n=parseInt(e[1],10),isNaN(n)&&(n=3540)):(t=e,n=3540),!t)throw this._lastToken=null,this._lastTokenExpiry=0,j.error("No token was provided"),new H(a.J.TRANSPORT_INVALID_TOKEN,`Token provider returned an invalid token, "${t}"`);if(this._lastToken===t){j.error("TokenProvider returned same token twice.");const e=new H(a.J.TRANSPORT_STALE_TOKEN,"Token provider returned the same token twice.");throw this._lastToken=null,this._lastTokenExpiry=0,e}return this._lastToken=t,this._lastTokenExpiry=Date.now()+1e3*n,this.emit(s.j.ACCESS_TOKEN,{token:t}),j.info("Access token set"),t}_authenticateWithToken(e){if(!this._endpoints)return Promise.resolve(!0);const t=[],n=e=>{t.push(e)};return j.info("Waiting for plugins to authenticate"),new Promise(((i,o)=>{this._pluginMediator.emitAndWait(l.t.TRANSPORT_AUTHENTICATE,{token:e,awaitPromise:n},(()=>{Promise.all(t).then((()=>i(!0)),o)}))}))}_authenticate(e){if(!(this._stateMask&Z))return Promise.reject(new H(a.J.TRANSPORT_INVALID_STATE,"Cannot authenticate disconnected transport."));if(this._authenticationPromise)return this._authenticationPromise;const t=Y.create();return t.start(),this._authenticationPromise=U.init((()=>(j.info("Authenticating"),this._refreshToken(e).then(this._authenticateWithToken))),{curve:"exponential",maxRetries:2,baseTime:500,retryPredicate:e=>(j.warn("Retrying authentication due to failure",e),!0)}).then((()=>this._onAuthenticated(t))).catch((e=>this._onAuthenticationFailed(e,t))),this._authenticationPromise}_performDisconnect(e){this._stateMask=0;const t=!e;return e&&(this.emit(s.j.DISCONNECTED,{reason:e}),j.info("Disconnected")),j.info("Waiting for plugins to disconnect."),this._pluginMediator.emitSync(l.t.TRANSPORT_DISCONNECT,{supressed:t}),!0}_createReconnector(){let e=!1;return()=>(this._isReconnecting=!0,this.emit(s.j.RECONNECTING,null),j.info("Reconnecting"),this._performDisconnect(),this._connect().then((()=>!!this._authenticateCalled&&this._authenticate(e).then((t=>(e=!1,t)),(t=>(e=!0,Promise.reject(t)))))).then((()=>(this._isReconnecting=!1,this.emit(s.j.RECONNECTED,null),j.info("Reconnected"),!0))))}_tryToReconnect(){this._isReconnecting?j.warn("Reconnection triggered while already reconnecting"):(this._stateMask=0,U.init(this._createReconnector(),{baseTime:1e3,maxTime:15e3,maxRetries:this._reconnectionRetries,retryPredicate:e=>(j.warn("Retrying reconnection due to failure",e),!0)}).catch((()=>{this._stateMask=0,this._isReconnecting=!1,this.emit(s.j.DISCONNECTED,{reason:r.RECONNECTION_FAILED}),j.info("Disconnected: reconnection failed")})))}_sendRequest(e,t={},n={}){const i=t.signal;return(null==i?void 0:i.aborted)?Promise.reject(new S(e)):this._processRequestArgs(e,t).then((t=>(null==i?void 0:i.aborted)?Promise.reject(new S(e)):t.options.forget?this._sendFireAndForgetRequest(t):this._sendRetriedRequest(t,n)))}_processRequestArgs(e,t={}){var n,i;if(null===(n=t.signal)||void 0===n?void 0:n.aborted)return Promise.reject(new S(e));let o=e,r=!1;const a=Object.assign(Object.assign({},t),{forcePolyfill:!(!t.responseType||!(t.responseType in this._forcePolyfillTypes)),requestMode:null!==(i=null==t?void 0:t.requestMode)&&void 0!==i?i:this._requestMode,connectionObserver:this._connectionObserver,metadata:(null==t?void 0:t.metadata)||null});if((null==t?void 0:t.signal)&&!m()&&("fetch"===t.requestMode?j.warn("Request with `{requestMode: fetch}` but no native AbortController."):a.requestMode="xhr"),z.test(o)){r=!0;try{o=this._tryExpandSpecialURL(o)}catch(e){return Promise.reject(e)}"authorize"in a||(a.authorize=!0,a.autoAuthorized=!0)}const s=Object.assign(Object.assign({maxRetries:2,curve:"exponential"},t.retry),{retryPredicate:e=>!(e instanceof S)});return Promise.resolve(K.create(o,{method:t.method,headers:t.headers,payload:t.payload,options:a,urlExpanded:r,retryOptions:s}))}_tryExpandSpecialURL(e){const t=this._endpoints;return e.replace(z,((e,n)=>{if(!t.hasOwnProperty(n))throw new TypeError(`Cannot replace endpoint @${n}: endpoint not defined.`);return t[n]}))}_sendFireAndForgetRequest(e){var t;const{url:n,method:i,options:o}=e;if(null===(t=o.signal)||void 0===t?void 0:t.aborted)return Promise.reject(new S(n));if("GET"!==i&&"POST"!==i)return Promise.reject(new H(a.J.TRANSPORT_UNSUPPORTED_OPTION,`Option 'forget' cannot be used for ${i} request.`));if(!o.autoAuthorized&&o.authorize)return Promise.reject(new H(a.J.TRANSPORT_UNSUPPORTED_OPTION,"Option 'forget' cannot be used for authorized request."));if(o.requestMode="xhr",o.authorize=!1,o.ignoreResponseBody=!0,"GET"===i)if("function"==typeof fetch){const e={mode:"no-cors"};o.signal&&m()&&(e.signal=o.signal),fetch(n,e).catch((()=>{}))}else"function"==typeof Image?(new Image).src=n:this._sendRetriedRequest(e,{}).catch((()=>{}));else if("POST"===i)if("undefined"!=typeof navigator&&(null===navigator||void 0===navigator?void 0:navigator.sendBeacon)){const t=e.headers.get("content-type");navigator.sendBeacon(e.url,"string"==typeof e.payload&&t?new Blob([e.payload],{type:t}):e.payload)}else if("function"==typeof fetch){const t=e.headers.get("content-type"),i={method:"POST",body:e.payload,headers:t?{"content-type":t}:void 0};o.signal&&m()&&(i.signal=o.signal),fetch(n,i).catch((()=>{}))}else this._sendRetriedRequest(e,{}).catch((()=>{}));return Promise.resolve(new T(n,0))}_sendRetriedRequest(e,t){const n=e.retryOptions,i=e.options.signal;let o=!1;const r=()=>(null==i?void 0:i.aborted)?Promise.reject(new S(e.url)):this._setAuthHeader(e,o),a=this._connectionObserver,c=new U((()=>{let c;return c=a.isOnline()||e.options.allowOffline?r():new Promise(((e,t)=>{a.once(s.j.CONNECTION_ONLINE,(()=>{r().then(e,t)}))})),c.then((()=>{if(null==i?void 0:i.aborted)return Promise.reject(new S(e.url));let n;if(this._pluginMediator.emitSync(l.t.TRANSPORT_BEFORE_SEND_REQUEST,{request:e,context:t}),"fetch"===e.options.requestMode&&this._Fetch&&this._Fetch.isSupported())n=this._Fetch.request(e);else{if(!this._XHR)throw new Error("No available request mechanisms.");n=this._XHR.request(e)}return n})).then((t=>{if(null==i?void 0:i.aborted)return Promise.reject(new S(e.url));let r=null;if(t.headers&&(r=t.headers.get("Retry-After")),t.status===E.G.UNAUTHORIZED&&!e.options.ignoreUnauthorized)return o=!0,Promise.reject(t);if("function"==typeof(null==n?void 0:n.condition)&&(n.condition(t,V)||r)){if(null!==r)if(q.test(r))t.retryAfter=new Date(r).getTime()-Date.now();else{const e=parseInt(r,10);e>0&&(t.retryAfter=1e3*e)}return Promise.reject(t)}return Promise.resolve(t)}))}),n);return c.start().catch(this._handleRetriedRequestError).then((n=>(null==i?void 0:i.aborted)?Promise.reject(new S(e.url)):(n.metadata=e.options.metadata,n.retries=n.retries||{count:0},n.retries.count=c.getRetryCount(),this._pluginMediator.emitSync(l.t.TRANSPORT_BEFORE_RETURN_RESPONSE,{context:t,response:n}),e.options.rejectNotOk&&!n.ok?Promise.reject(n):n)))}_setAuthHeader(e,t){if(!e.options.authorize)return Promise.resolve(e);const n=()=>this._refreshToken(t).then((t=>(e.headers.set("Authorization",`Bearer ${t}`),e)));return this._stateMask&Q?n():new Promise(((e,t)=>{j.info("Auth header setting awaiting authentication."),this.once(s.j.AUTHENTICATED,(()=>{j.info("Auth header set after authentication."),n().then(e,t)}))}))}_handleRetriedRequestError(e){return e instanceof T?Promise.resolve(e):Promise.reject(e)}_onAddListener(e,t){const n=t.data.options;if(n.ignoreCurrentState)return;let i;switch(e){case"connected":if(!this.isConnected())return;i=Promise.resolve(this.createEvent(s.j.CONNECTED,null));break;case"authenticated":{if(!this.isAuthenticated())return;const e=this._stateAwareOperationMetrics.authenticated;i=Promise.resolve(this.createEvent(s.j.AUTHENTICATED,{timing:e}));break}case"connection_id":{const e=this.getPluginAPI("dealer");if(!e||!e.hasConnectionInfo())return;i=e.getConnectionInfo().then((e=>this.createEvent(s.j.CONNECTION_ID,e)));break}case"transport_connect":if(!this.isConnected()||!this._endpoints)return;i=Promise.resolve(this._pluginMediator.createEvent(l.t.TRANSPORT_CONNECT,{endpoints:Object.assign({},this._endpoints),awaitPromise:e=>{}}));break;case"transport_authenticate":if(!this.isAuthenticated())return;i=this._refreshToken().then((e=>this._pluginMediator.createEvent(l.t.TRANSPORT_AUTHENTICATE,{token:e,awaitPromise:e=>{}})));break;default:return}const o=t.data.listener;this._stateAwareListeners[e].push(o);const r=this._stateAwareRunners;r[e]||(r[e]=i.then(this._runStateAwareQueues.bind(this,e)),n.once&&t.preventDefault())}_onRemoveListener(e,t){const n=t.data.options;if(n.ignoreCurrentState||n.once)return;const i=t.data.listener,o=this._stateAwareListeners[e].indexOf(i);-1!==o&&this._stateAwareListeners[e].splice(o,1)}_getQuickDisconnectTimeout(){return this._counter.getTime(this._quickDisconnectCount)}_onPluginDisconnected(e){const t=Date.now(),n=t-this._lastDisconnect;if(this._performDisconnect(),e.data.code===B.r.CLOSE)return j.info(`Plugin "${e.data.plugin}" explicitly disconnected`),void(this._quickDisconnectCount=0);this._connectionObserver.isOnline()&&(j.info(`Plugin "${e.data.plugin}" unexpectedly disconnect; trying to reconnect`),n<5e3?(this._reconnectTimeout&&clearTimeout(this._reconnectTimeout),this._quickDisconnectCount++,this.emit(s.j.SHORT_SESSION_DISCONNECTED,{disconnectCount:this._quickDisconnectCount,sessionLength:n}),this._reconnectTimeout=setTimeout(this._tryToReconnect.bind(this),this._getQuickDisconnectTimeout())):(this._quickDisconnectCount=0,this._lastDisconnect=t,this._tryToReconnect()))}_onOnline(){this.emit(s.j.CONNECTION_ONLINE,null),j.info("ConnectionObserver online"),this._connectCalled&&this._tryToReconnect()}_onOffline(){this.emit(s.j.CONNECTION_OFFLINE,null),j.info("ConnectioObserver offline"),this._performDisconnect()}_onConnected(){return this._stateMask|=Z,this.emit(s.j.CONNECTED,null),j.info("Connected"),Promise.resolve(!0)}_onAuthenticated(e){e.end(),clearTimeout(this._reconnectTimeout),this._authenticationPromise=null,this._stateMask|=Q,this._initTime=Date.now();const t=e.getMetrics();return this.emit(s.j.AUTHENTICATED,{timing:t}),this._stateAwareOperationMetrics.authenticated=t,j.info("Authenticated"),Promise.resolve(!0)}_onAuthenticationFailed(e,t){t.end();const n=e&&e.error?e.error:e;this._authenticationPromise=null,this._stateMask&=~Q;const i={error:n,timing:t.getMetrics()};return this.emit(s.j.AUTHENTICATION_FAILED,i),this._pluginMediator.emit(l.t.TRANSPORT_AUTHENTICATE_FAILED,i),j.info("Authentication failed",n),Promise.reject(n)}_onLogout(){const e=()=>{this._lastToken=null,this._lastTokenExpiry=0,this.emit(s.j.LOGGED_OUT,null)};this._disconnect(r.LOG_OUT).then(e,e)}_disconnect(e){if(!this._connectCalled)return Promise.resolve(!1);this._connectCalled=!1,this._authenticateCalled=!1;const t=this.isConnected()?s.j.BEFORE_ONLINE_DISCONNECT:s.j.BEFORE_OFFLINE_DISCONNECT,n=[];return this.emitSync(t,{awaitPromise:e=>{n.push(e.catch((()=>{})))}}),Promise.all(n).then((()=>this._performDisconnect(e)))}isConnected(){return!!(this._stateMask&Z)}isAuthenticated(){return!!(this._stateMask&Q)}isReconnecting(){return this._isReconnecting}isOnline(){return this._connectionObserver.isOnline()}connect(){return this._connectCalled=!0,this._connect()}authenticate(){return this._authenticateCalled=!0,this._authenticate(!0)}disconnect(){return this._disconnect(r.EXPLICIT)}forceDisconnect(){return this._connectCalled?(this._connectCalled=!1,this._authenticateCalled=!1,this._performDisconnect(r.EXPLICIT),Promise.resolve(!0)):Promise.resolve(!1)}forceTokenRefresh(){return this._refreshToken(!0).then((()=>!0))}getInitTime(){return this._initTime}getEndpoints(){return this._endpoints?Object.assign({},this._endpoints):null}getLastToken(){return this._lastToken}toPublic(e){return new W(this,e)}hasOwnerRef(e){return this._ownerRef===e}appendTokenQuery(e){return this._refreshToken().then((t=>$(e,t)))}appendLastTokenQuery(e){return this._lastToken?$(e,this._lastToken):e}matchMessages(e,t,n){if(!e)throw new TypeError('Message "matcher" cannot be null.');if("function"!=typeof t)throw new TypeError("Message callback cannot be null.");const i=i=>{const o=i.data.message;!o.uri||!o.uri.match(e)||n&&n!==i.data.plugin||t(o)};i.__matchMessagesExp=e,i.__matchMessagesPlugin=n,t.__matchMessagesWrapper=i,this._pluginMediator.on(l.t.PLUGIN_MESSAGE,i)}unmatchMessages(e,t,n){if("function"!=typeof t)throw new TypeError("Message callback cannot be null.");const i=t.__matchMessagesWrapper;return!(!i||i.__matchMessagesExp!==e||i.__matchMessagesPlugin!==n)&&(this._pluginMediator.removeListener(l.t.PLUGIN_MESSAGE,i),!0)}handlePushRequests(e,t,n){if(!e)throw new TypeError('Push request "matcher" cannot be null.');if("function"!=typeof t)throw new TypeError("Push request callback cannot be null.");const i=i=>{const o=i.data.request;!o.message_ident||!o.message_ident.match(e)||n&&n!==i.data.plugin||Promise.resolve(t(o)).then(i.data.reply)};i.__matchRequestExp=e,i.__matchRequestPlugin=n,t.__matchRequestWrapper=i,this._pluginMediator.on(l.t.PLUGIN_REQUEST,i)}unhandlePushRequests(e,t,n){if("function"!=typeof t)throw new TypeError("Push request callback cannot be null.");const i=t.__matchRequestWrapper;return!(!i||i.__matchRequestExp!==e||i.__matchRequestPlugin!==n)&&(this._pluginMediator.removeListener(l.t.PLUGIN_REQUEST,i),!0)}request(e,t){var n;const i={uri:e,options:t,context:{}};this._pluginMediator.emitSync(l.t.TRANSPORT_BEFORE_PROCESS_REQUEST,i);const o=this._sendRequest.bind(this,i.uri,i.options,i.context);if(!this._endpoints&&z.test(i.uri))return j.info("Request queued until endpoints resolved",i.uri),new Promise(((e,t)=>{this.once(s.j.ENDPOINTS_RESOLVED,(()=>{j.info("Sending endpoints-queued request",i.uri),o().then(e,t)}))}));return!this._connectionObserver.isOnline()&&!(null===(n=i.options)||void 0===n?void 0:n.allowOffline)?(j.info("Request queued until online",i.uri),new Promise(((e,t)=>{this.once(s.j.CONNECTION_ONLINE,(()=>{j.info("Sending offline-queued request",i.uri),o().then(e,t)}))}))):o()}addPlugin(e,t){const n=e(this,t),i=n.name;if(this._plugins[i])throw new TypeError("Plugin is already added.");return n.attach(this,this._pluginMediator),this._plugins[i]=n,i}removePlugin(e){const t=this._plugins[e];return!!t&&(t.detach(this,this._pluginMediator),this._plugins[e]=void 0,!0)}hasPlugin(e){return!!this._plugins[e]}getPluginAPI(e){const t=this._plugins[e];return t&&t.api?t.api:null}getConnectionId(e="dealer"){const t=this._plugins[e];return t?t.api&&function(e){return"getConnectionInfo"in e.api}(t)?t.api.getConnectionInfo().then((e=>e.id)):Promise.reject(new TypeError(`Plugin ${t} is not a socket plugin.`)):Promise.reject(new TypeError(`Cannot retrieve connection id for plugin ${t}.`))}removeAllListeners(){return this}}class te{constructor(e){this._headers={},this._init(e)}_init(e){if(e){const t=e.split("\r\n");for(const e of t){const t=e.indexOf(": ");if(t>0){const n=e.substring(0,t).toLowerCase(),i=e.substring(t+2);this._headers[n]=i}}}}get(e){return this._headers[e.toLowerCase()]||null}has(e){return this._headers.hasOwnProperty(e.toLowerCase())}}const ne=v.P.forTag("transport.http.xhr"),ie=function(){},oe={json:!0,text:!0,document:!0};function re(){this.onabort=ie,this.onerror=ie,this.onload=ie,this.onloadend=ie}function ae(e,t,n){var i,o;if(null===(i=e.options.signal)||void 0===i?void 0:i.aborted)return;const r=Date.now(),a=this.status,s=new T(this.responseURL||e.url,a);s.body=null;const c=e.options;if(c.timing&&(s.timing={completed:r-t}),(null===(o=c.connectionObserver)||void 0===o?void 0:o.isOnline)&&(s.offline=!c.connectionObserver.isOnline()),(c.parseResponseHeaders||a>299)&&(s.headers=new te(this.getAllResponseHeaders())),!c.ignoreResponseBody&&a!==E.G.NO_CONTENT){const e=c.responseType||"";if(!c.forcePolyfill&&"response"in this&&e===this.responseType)s.body=this.response;else if("document"===e)s.body=this.responseXML;else if("json"===e)try{s.body=JSON.parse(this.responseText)}catch(e){ne.warn("Could not parse response as JSON:",e),s.body=null}else"text"!==e&&""!==e||(s.body=this.responseText)}n(s)}function se(e,t,n){4===this.readyState?t(new T(this.responseURL||e,this.status)):n(new b("Request cannot be completed.",a.J.HTTP_REQUEST_FAILED,this.status,e))}function ce(e){const t=e.options.signal;return new Promise(((n,i)=>{if(null==t?void 0:t.aborted)return void i(new S(e.url));const o=new XMLHttpRequest;let r=e.url;if(!r)return void i(new TypeError("Request URL cannot be blank."));let a=null;const s=e.method||"GET",c=e.payload||"";s in y&&c?a=c:c&&(r+=`?${c}`),o.open(s,r,!0),o.onerror=se.bind(o,r,n,i),o.onabort=re,o.onloadend=re,o.onprogress=ie;const l=e.options;"include"===l.credentials&&(o.withCredentials=!0);const u=l.responseType;if(u)if(l.forcePolyfill){if(!(u in oe))return void i(new TypeError(`Cannot polyfill responseType "${u}"`))}else{if(!("responseType"in o)&&!(u in oe))return void i(new TypeError("Cannot set responseType: not supported in browser."));try{o.responseType=u}catch(e){return void i(new TypeError(`Unknown responseType "${u}".`))}if(o&&u!==o.responseType&&!(u in oe))return void i(new TypeError(`Unknown responseType "${u}".`))}const d=e.headers.count()?e.headers.toJSON():null;if(d)for(const e in d)if(d.hasOwnProperty(e)&&d[e])try{o.setRequestHeader(e,d[e])}catch(e){return void i(e)}t&&t.addEventListener("abort",(function e(){t.removeEventListener("abort",e),o.abort(),i(new S(r))})),o.onload=ae.bind(o,e,Date.now(),n);try{o.send(a)}catch(e){return void i(e)}}))}function le(e){return ce(e)}var ue=n(53381);function de(){return()=>Promise.resolve({webgate:"https://www.spotify.com/api/",webapi:"https://api.spotify.com"})}function pe(){return()=>Promise.resolve("NOT_A_TOKEN")}function fe(){return{endpoints:de(),token:pe()}}const he="request-transformer";class me{constructor(e){this.name=he,this._uriTransformer=e.uriTransformer,this._optionsOverrides=e.optionsOverrides,this._include=e.include,this._processRequest=this._processRequest.bind(this)}_processRequest(e){var t,n;const i=e.data;if((null===(n=null===(t=i.options)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.noRequestTransform)||this._include&&!this._include(i.uri,i.options))return;this._uriTransformer&&(i.uri=this._uriTransformer(i.uri));const o=this._optionsOverrides;if(o)if(i.options){const e=Object.assign(Object.assign(Object.assign({},i.options),o),{metadata:Object.assign(Object.assign({},i.options.metadata),o.metadata),retry:Object.assign(Object.assign({},i.options.retry),o.retry),headers:Object.assign(Object.assign({},i.options.headers),o.headers)});i.options=e}else i.options=o}attach(e,t){t.on(l.t.TRANSPORT_BEFORE_PROCESS_REQUEST,this._processRequest)}detach(e,t){t.removeListener(l.t.TRANSPORT_BEFORE_PROCESS_REQUEST,this._processRequest)}}function ge(e,t){return new me(t)}function _e(e){const t=Object.assign({},e);return t.XHR||(t.XHR=o),t.Fetch=i,ee.create(t)}function ve(e){const t=_e(e);return t.addPlugin(_.dv,{WebSocket}),t}},21306:(e,t,n)=>{"use strict";n.d(t,{Mb:()=>c});n(46758),n(86277),n(39301);var i=n(97127),o=n(77202);const r=i.P.forTag("transport.client_token");function a(e,t){const n=e.getStatusFamily();return n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}class s{constructor(e){this._inFlightPromise=null,this.name="client-token",this._clientInfo=e.clientInfo,this._onBeforeSendRequest=this._onBeforeSendRequest.bind(this),this._onAuthenticate=this._onAuthenticate.bind(this)}_fetchClientToken(e){if(null!==this._inFlightPromise)return this._inFlightPromise;const{clientVersion:t,clientID:n,deviceBrand:i,deviceModel:o,os:s,osVersion:c,containerVersion:l,deviceID:u,deviceType:d,platformIdentifier:p}=this._clientInfo,f={client_data:{client_version:t,client_id:n,js_sdk_data:{device_brand:i,device_model:o,os:s,os_version:c,container_version:l,device_id:u,device_type:d,platform_identifier:p}}};return this._inFlightPromise=e.request("https://clienttoken.spotify.com/v1/clienttoken",{method:"POST",responseType:"json",payload:JSON.stringify(f),headers:{"content-type":"application/json",accept:"application/json"},retry:{maxRetries:2,condition:a},authorize:!1,metadata:{skipClientToken:!0}}).then((e=>{var t;const n=(new Date).getTime()/1e3,i=null===(t=e.body)||void 0===t?void 0:t.granted_token;i&&(this._clientToken=i.token,this._refresh=n+i.refresh_after_seconds,this._domains=i.domains.map((e=>e.domain))),this._inFlightPromise=null})).catch((e=>{r.warn(`could not fetch client token for ${JSON.stringify(this._clientInfo)}`),r.warn(e),this._inFlightPromise=null})),this._inFlightPromise}_onAuthenticate(e){this._transport&&e.data.awaitPromise(this._fetchClientToken(this._transport))}_onBeforeSendRequest(e){var t,n;const i=e.data.request;if(null===(n=null===(t=i.options)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.skipClientToken)return;const o=(new Date).getTime()/1e3;(!this._refresh||this._refresh{return n=e,(t=r).length>=n.length&&t.lastIndexOf(n)===t.length-n.length;var t,n}))&&i.headers.set("client-token",this._clientToken)}getClientToken(){return this._clientToken}getTokenRefresh(){return this._refresh}getTokenDomains(){return this._domains}attach(e,t){t.on(o.t.TRANSPORT_AUTHENTICATE,this._onAuthenticate),t.on(o.t.TRANSPORT_BEFORE_SEND_REQUEST,this._onBeforeSendRequest),this._transport=e}detach(e,t){t.removeListener(o.t.TRANSPORT_AUTHENTICATE,this._onAuthenticate),t.removeListener(o.t.TRANSPORT_BEFORE_SEND_REQUEST,this._onBeforeSendRequest),this._clientToken=void 0,this._refresh=void 0,this._transport=void 0,this._domains=void 0}}function c(e,t){return new s(t)}},27532:(e,t,n)=>{"use strict";var i;n.d(t,{hI:()=>m,G7:()=>i,dv:()=>_}),function(e){e.DEALER_CONNECTION_ERROR="DEALER_CONNECTION_ERROR",e.DEALER_AUTHENTICATION_FAILED="DEALER_AUTHENTICATION_FAILED",e.DEALER_ERROR="DEALER_ERROR",e.ENDPOINT_NOT_DEFINED="ENDPOINT_NOT_DEFINED",e.INVALID_ENDPOINT="INVALID_ENDPOINT"}(i||(i={}));var o,r=n(77202);class a extends Error{constructor(e=i.DEALER_ERROR,t,n={}){super(t),this.name="DealerError",this.message=t,this.code=e,this.raw=n,this.wsCode=n.code||null,this.wsReason=n.reason||null}}!function(e){e.AUTHENTICATED="authenticated",e.AUTHENTICATION_FAILED="authentication_failed",e.CONNECTED="connected",e.CONNECTION_ID="connection_id",e.ERROR="error",e.DISCONNECTED="disconnected",e.MESSAGE="message",e.REQUEST="request"}(o||(o={}));var s=n(17909),c=n(843),l=n(82094),u=n(55872).lW;const d=function(){},p=/hm:\/\/pusher\/(?:[^]+)?\/connections\/([^]+)/,f="undefined"!=typeof window;class h extends s.vp{constructor(e){super(),this._socket=null,this._lastPingDeferred=null,this._waitingForConnectionId=!0,this._connectionId=null,this._connectionURI=null,this._heartbeatToken=0,this._heartbeatTimeoutToken=0,this._connected=!1,this._endpoint=null,this._WebSocket=e.WebSocket||WebSocket,this._heartbeatTimeout=e.heartbeatTimeout||1e4}static create(e){return new h(e)}_startHeartbeat(e){const t=()=>{this.ping().then((()=>this._onHeartbeatSuccess()),(()=>this._onHeartbeatError())),this._heartbeatTimeoutToken=setTimeout((()=>this._onHeartbeatError()),this._heartbeatTimeout)};e?t():this._heartbeatToken=setTimeout((()=>t()),3e4)}_onHeartbeatError(){this._stopHeartbeat(),this._socket&&this._socket.close(l.r.TIMEOUT,"internal-timeout")}_onHeartbeatSuccess(){this._stopHeartbeat(),this._startHeartbeat()}_stopHeartbeat(){null!==this._heartbeatToken&&clearTimeout(this._heartbeatToken),null!==this._heartbeatTimeoutToken&&clearTimeout(this._heartbeatTimeoutToken)}_prepareConnectionId(e){var t;if(!e.uri)return!1;const[,n]=null!==(t=e.uri.match(p))&&void 0!==t?t:[];if(!n)return!1;let i;return i=e.headers&&e.headers["Spotify-Connection-Id"]?e.headers["Spotify-Connection-Id"]:decodeURIComponent(n),this._connectionId=i,this._connectionURI=e.uri,this.emit(o.CONNECTION_ID,{id:i,uri:e.uri}),!0}_reply(e,t){if(!e)throw new TypeError("Invalid key.");const n=this._socket;if(!n||1!==n.readyState)return;const i={type:"reply",key:e,payload:t};n.send(JSON.stringify(i))}_parseMessage(e){let t;try{t=JSON.parse(e)}catch(e){return}if("message"===t.type)this._waitingForConnectionId&&this._prepareConnectionId(t)?(this._waitingForConnectionId=!1,this._startHeartbeat(!0)):this.emit(o.MESSAGE,{message:t});else if("pong"===t.type&&this._lastPingDeferred)this._lastPingDeferred.resolve(!0),this._lastPingDeferred=null;else if("request"===t.type){const e=t.key;e&&this.emit(o.REQUEST,{request:t,reply:this._reply.bind(this,e)})}}_handleOpen(e){e.resolve(!0),this._connected=!0,this.emit(o.AUTHENTICATED,null)}_handleMessage(e){const t=this,n=e.data;if(f&&window.Blob&&n instanceof window.Blob){const e=new FileReader;e.onloadend=function(){if(!this.result)return;let e;if(this.result instanceof ArrayBuffer){e="";const t=new Uint8Array(this.result);for(let n=0;n{this.once(o.CONNECTION_ID,(t=>{e(t.data.id)}))})):Promise.resolve(this._connectionId)}getConnectionInfo(){return this._waitingForConnectionId?new Promise((e=>{this.once(o.CONNECTION_ID,(t=>{e({id:t.data.id,uri:t.data.uri})}))})):Promise.resolve({id:this._connectionId,uri:this._connectionURI})}hasConnectionId(){return!this._waitingForConnectionId&&!!this._connectionId}}const m="dealer";class g{constructor(e){this.name=m,this._dealer=new h(e),this.api={hasConnectionInfo:()=>this._dealer.hasConnectionId(),getConnectionInfo:()=>this._dealer.getConnectionInfo().then((e=>Object.assign({plugin:this.name},e)))},this._onDealerConnectionId=this._onDealerConnectionId.bind(this),this._onDealerDisconnected=this._onDealerDisconnected.bind(this),this._onDealerMessage=this._onDealerMessage.bind(this),this._onDealerRequest=this._onDealerRequest.bind(this),this._onTransportConnect=this._onTransportConnect.bind(this),this._onTransportAuthenticate=this._onTransportAuthenticate.bind(this),this._onTransportDisconnect=this._onTransportDisconnect.bind(this)}_onDealerConnectionId(e){this._mediator&&this._mediator.emit(r.t.PLUGIN_CONNECTION_INFO,Object.assign({plugin:this.name},e.data))}_onDealerDisconnected(e){if(!this._mediator)return;const t=e.data;this._mediator.emit(r.t.PLUGIN_DISCONNECTED,{plugin:this.name,code:t.wsCode,reason:t.reason})}_onDealerMessage(e){this._mediator&&this._mediator.emit(r.t.PLUGIN_MESSAGE,Object.assign({plugin:this.name},e.data))}_onDealerRequest(e){this._mediator&&this._mediator.emit(r.t.PLUGIN_REQUEST,Object.assign({plugin:this.name},e.data))}_onTransportConnect(e){const t=e.data.endpoints,n=e.data.awaitPromise;t.dealer?/^wss:/.test(t.dealer)?n(this._dealer.connect(t.dealer)):n(Promise.reject(new a(i.INVALID_ENDPOINT,"Dealer endpoint needs to be wss://"))):n(Promise.reject(new a(i.ENDPOINT_NOT_DEFINED,'No "dealer" endpoint defined.')))}_onTransportAuthenticate(e){const t=e.data;t.awaitPromise(this._dealer.authenticate(t.token))}_onTransportDisconnect(){this._dealer.disconnect()}_onDealerError(e){var t;null===(t=this._mediator)||void 0===t||t.emit(r.t.PLUGIN_ERROR,{plugin:this.name,error:e.data.error})}attach(e,t){this._mediator=t,t.addListeners({[r.t.TRANSPORT_CONNECT]:this._onTransportConnect,[r.t.TRANSPORT_AUTHENTICATE]:this._onTransportAuthenticate,[r.t.TRANSPORT_DISCONNECT]:this._onTransportDisconnect}),this._dealer.addListeners({[o.DISCONNECTED]:this._onDealerDisconnected,[o.CONNECTION_ID]:this._onDealerConnectionId,[o.MESSAGE]:this._onDealerMessage,[o.REQUEST]:this._onDealerRequest,[o.ERROR]:this._onDealerError})}detach(e,t){this._mediator=void 0,t.removeListeners({[r.t.TRANSPORT_CONNECT]:this._onTransportConnect,[r.t.TRANSPORT_AUTHENTICATE]:this._onTransportAuthenticate,[r.t.TRANSPORT_DISCONNECT]:this._onTransportDisconnect}),this._dealer.removeListeners({[o.DISCONNECTED]:this._onDealerDisconnected,[o.CONNECTION_ID]:this._onDealerConnectionId,[o.MESSAGE]:this._onDealerMessage,[o.REQUEST]:this._onDealerRequest,[o.ERROR]:this._onDealerError})}}function _(e,t){return new g(t)}},31032:(e,t,n)=>{"use strict";n.d(t,{Q:()=>s});const i="https://spclient.wg.spotify.com/",o="https://api.spotify.com/",r="wss://dealer.spotify.com:443/";function a(e){return void 0===e||!!e}function s(e){const t={};return a(e.dealer)&&(t.dealer=r),a(e.webgate)&&(t.webgate=i),a(e.webapi)&&(t.webapi=o),function(){return Promise.resolve(t)}}},53381:(e,t,n)=>{"use strict";n.d(t,{Q:()=>u});var i=n(98777);class o extends Error{constructor(e,t,n=-1){super(t),this.name="XResolveError",this.message=t,this.code=e,this.status=n}}const r="https://apresolve.spotify.com/",a={DEALER:"dealer",WEBGATE:"spclient"},s="dealer.spotify.com",c="https://api.spotify.com/",l={spclient:"spclient.wg.spotify.com",exp:"exp.wg.spotify.com",partners:"partners.wg.spotify.com"};function u(e={}){const t=e.dealer||a.DEALER,n=e.webgate||a.WEBGATE,u=`${r}?type=${t}&type=${n}`;return function(e){return e.request(u,{forcePolyfill:!0,responseType:"json",retry:{maxRetries:3,curve:"exponential",condition:function(e,t){return e.getStatusFamily()!==t.SUCCESS}},metadata:{noRequestTransform:!0}}).then((e=>{var r,a,u,d,p;const f=e.body,h={dealer:null!==(a=null===(r=null==f?void 0:f[t])||void 0===r?void 0:r[0])&&void 0!==a?a:s,webgate:null!==(p=null!==(d=null===(u=null==f?void 0:f[n])||void 0===u?void 0:u[0])&&void 0!==d?d:l[n])&&void 0!==p?p:l.spclient,webapi:c};if(!h.dealer||!h.webgate)throw new o(i.J.XRESOLVE_INCOMPLETE_RESPONSE,"X-Resolve responded with incomplete results.",e.status);return h})).then((e=>(e.dealer=`wss://${e.dealer.replace(/:443$/,"")}`,e.webgate=`https://${e.webgate.replace(/:443$/,"")}`,e)))}}},11129:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});n(46758),n(27082);const i={threshold:.5};class o{constructor(e,t){this.isIOSupported=!0,this.ubiLogger=e,this.isIOSupported="IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype,this.isIOSupported&&(this.observer=new IntersectionObserver((e=>{e.forEach((e=>{var t;const n=null===(t=this._observableEntities)||void 0===t?void 0:t.get(e.target);n&&e.intersectionRatio>=.5&&(this.ubiLogger.logImpression(n.impression()),this.removeFromObservableEntities(n.element))}))}),i),this._observableEntities=null!=t?t:new Map)}removeFromObservableEntities(e){var t,n;this.isIOSupported&&(null===(t=this.observer)||void 0===t||t.unobserve(e),null===(n=this._observableEntities)||void 0===n||n.delete(e))}addToObservableEntities(e){var t,n;if(!this.isIOSupported)return null;const i=e.element;return null===(t=this._observableEntities)||void 0===t||t.set(i,e),null===(n=this.observer)||void 0===n||n.observe(i),()=>{this.removeFromObservableEntities(i)}}}},44016:(e,t,n)=>{"use strict";n.d(t,{RK:()=>w});var i=n(74072),o=n(43840);n(46758),n(86277),n(2836);const r="",a="UBI|";function s(e){return e.reduce(((e,t)=>e.concat(t)),[])}function c(e){var t;const n={element_path_names:[],element_path_pos:[],element_path_ids:[],element_path_uris:[],element_path_reasons:[]};for(const i of e)n.element_path_names.push(i.name),n.element_path_pos.push((null===(t=i.position)||void 0===t?void 0:t.toString())||r),n.element_path_ids.push(i.identifier||r),n.element_path_uris.push(i.uri||r),n.element_path_reasons.push(i.reason||r);return n}function l(e){return e?s(e.locations.map((e=>e.pathNodes))):[]}function u(e){return e?s(e.locations.map((e=>e.specVersion))):[]}function d(e){return e?s(e.locations.map((e=>e.specMode))):[]}var p=n(92674);const f={createGabitoEvent:function(e,t,n){var a,s,f,h;const m=c(e.location.pathNodes),g=c(l(e.parentAbsoluteLocation)),_=u(e.parentAbsoluteLocation),v=d(e.parentAbsoluteLocation);let y={annotator_configuration_version:r,annotator_version:r,app:e.app,element_path_ids:m.element_path_ids,element_path_names:m.element_path_names,element_path_pos:m.element_path_pos,element_path_reasons:m.element_path_reasons,element_path_uris:m.element_path_uris,generator_version:e.generatorVersion,impression_id:(0,p.v4)(),parent_modes:v,parent_path_ids:g.element_path_ids,parent_path_names:g.element_path_names,parent_path_pos:g.element_path_pos,parent_path_reasons:g.element_path_reasons,parent_path_uris:g.element_path_uris,parent_specification_versions:_,specification_version:e.specificationVersion,specification_mode:e.specificationMode};if(n.pageInstanceIdProvider&&(y=Object.assign(Object.assign({},y),{page_instance_id:n.pageInstanceIdProvider.getPageInstanceId()||null})),n.playbackIdProvider&&(y=Object.assign(Object.assign({},y),{playback_id:(null===(a=n.playbackIdProvider)||void 0===a?void 0:a.getPlaybackId())||null})),n.playContextUriProvider&&(y=Object.assign(Object.assign({},y),{play_context_uri:(null===(s=n.playContextUriProvider)||void 0===s?void 0:s.getPlayContextUri())||null})),n.pageUriProvider&&(y=Object.assign(Object.assign({},y),{page_uri:(null===(f=n.pageUriProvider)||void 0===f?void 0:f.getPageUri())||null})),t.isAuthenticated())return(0,i.S)(y);const E=Object.assign(Object.assign({},y),{flow_id:(null===(h=n.flowIdProvider)||void 0===h?void 0:h.getFlowId())||null});return(0,o.E)(E)}};var h=n(25791),m=n(20239);const g={createGabitoEvent:function(e,t,n){var i,o,a,s;const f=c(e.location.pathNodes),g=c(l(e.parentAbsoluteLocation)),_=u(e.parentAbsoluteLocation),v=d(e.parentAbsoluteLocation);let y={action_parameter_names:e.actionParameterNames,action_parameter_values:e.actionParameterValues,action_name:e.actionName,action_version:e.actionVersion,annotator_configuration_version:r,annotator_version:r,app:e.app,element_path_ids:f.element_path_ids,element_path_names:f.element_path_names,element_path_pos:f.element_path_pos,element_path_reasons:f.element_path_reasons,element_path_uris:f.element_path_uris,generator_version:e.generatorVersion,interaction_id:(0,p.v4)(),interaction_type:e.interactionType,parent_modes:v,parent_path_ids:g.element_path_ids,parent_path_names:g.element_path_names,parent_path_pos:g.element_path_pos,parent_path_reasons:g.element_path_reasons,parent_path_uris:g.element_path_uris,parent_specification_versions:_,specification_version:e.specificationVersion,specification_mode:e.specificationMode};if(n.pageInstanceIdProvider&&(y=Object.assign(Object.assign({},y),{page_instance_id:n.pageInstanceIdProvider.getPageInstanceId()||null})),n.playbackIdProvider&&(y=Object.assign(Object.assign({},y),{playback_id:(null===(i=n.playbackIdProvider)||void 0===i?void 0:i.getPlaybackId())||null})),n.playContextUriProvider&&(y=Object.assign(Object.assign({},y),{play_context_uri:(null===(o=n.playContextUriProvider)||void 0===o?void 0:o.getPlayContextUri())||null})),n.pageUriProvider&&(y=Object.assign(Object.assign({},y),{page_uri:(null===(a=n.pageUriProvider)||void 0===a?void 0:a.getPageUri())||null})),t.isAuthenticated())return(0,h.E)(y);const E=Object.assign(Object.assign({},y),{flow_id:(null===(s=n.flowIdProvider)||void 0===s?void 0:s.getFlowId())||null});return(0,m.b)(E)}},_="CURRENT_PAGE_INSTANCE_ID";class v{constructor(e){this.storageManager=e.storageManager}getPageInstanceId(){return this.storageManager.getItem(_)}setPageInstanceId(e){this.storageManager.setItem(_,e)}}var y,E,b=n(34826),S=n(75208),A=n(75095);!function(e){e.NAVIGATION_IDLE="navigation_idle",e.NAVIGATION_STARTED="navigation_started",e.NAVIGATION_COMPLETED="navigation_completed"}(y||(y={})),function(e){e.CURRENT_PAGE_ID="CURRENT_PAGE_ID",e.CURRENT_PAGE_INSTANCE_ID="CURRENT_PAGE_INSTANCE_ID",e.CURRENT_ENTITY_URI="CURRENT_ENTITY_URI",e.CURRENT_NAV_ROOT="CURRENT_NAV_ROOT",e.PENDING_NAV_ROOT="PENDING_NAV_ROOT",e.PENDING_INTERACTION_ID="PENDING_INTERACTION_ID",e.PENDING_NAV_REASON="PENDING_NAV_REASON",e.NAVIGATION_STATUS="NAV_STATUS"}(E||(E={}));class T{constructor(e){this.eventSender=e.eventSender,this.pageInstanceIdProvider=e.pageInstanceIdProvider,this.pageUriProvider=e.pageUriProvider,this.flowIdProvider=e.flowIdProvider,this.authenticationProvider=e.authenticationProvider,this.disableAutoBackgroundMonitoring=e.disableAutoBackgroundMonitoring,this.storageManager=e.storageManager,this.handleBackgroundStates=this.handleBackgroundStates.bind(this),this.setNavigationStatus(y.NAVIGATION_IDLE)}getCurrentPageId(){return this.storageManager.getItem(E.CURRENT_PAGE_ID)}setCurrentPageId(e){this.storageManager.setItem(E.CURRENT_PAGE_ID,e)}getCurrentPageInstanceId(){return this.pageInstanceIdProvider.getPageInstanceId()}setCurrentPageInstanceId(e){this.pageInstanceIdProvider.setPageInstanceId(e)}getCurrentEntityUri(){return this.pageUriProvider.getPageUri()}setCurrentEntityUri(e){this.pageUriProvider.setPageUri(e)}getCurrentNavigationalRoot(){return this.storageManager.getItem(E.CURRENT_NAV_ROOT)}setCurrentNavigationalRoot(e){this.storageManager.setItem(E.CURRENT_NAV_ROOT,e)}getNavigationStatus(){return this.storageManager.getItem(E.NAVIGATION_STATUS)}setNavigationStatus(e){this.storageManager.setItem(E.NAVIGATION_STATUS,e)}getPendingNavigationalRoot(){return this.storageManager.getItem(E.PENDING_NAV_ROOT)}setPendingNavigationalRoot(e){this.storageManager.setItem(E.PENDING_NAV_ROOT,e)}getPendingInteractionId(){return this.storageManager.getItem(E.PENDING_INTERACTION_ID)}setPendingInteractionId(e){this.storageManager.setItem(E.PENDING_INTERACTION_ID,e)}getPendingNavigationReason(){return this.storageManager.getItem(E.PENDING_NAV_REASON)}setPendingNavigationReason(e){this.storageManager.setItem(E.PENDING_NAV_REASON,e)}resetNavStartInfo(){this.setPendingInteractionId(null),this.setPendingNavigationReason(null),this.setPendingNavigationalRoot(null)}populateNavigationReason(){const e=this.getPendingInteractionId();if(e){const t=`user_interaction(${e})`;return this.setPendingInteractionId(null),t}return this.getPendingNavigationReason()}generatePageInstanceId(){return(0,p.v4)()}setCurrent(e,t,n,i){this.setCurrentPageId(e),this.setCurrentPageInstanceId(t),this.setCurrentEntityUri(n),this.setCurrentNavigationalRoot(i)}handleBackgroundStates(){return;document.hidden?this.logClientLostFocus():this.logClientGainedFocus()}startNavigation(e){const{navigationalRoot:t}=e;if((0,A.Oq)(e)){const{interactionId:t}=e;this.setPendingInteractionId(t)}if((0,A.AG)(e)){const{navigationReason:t}=e;this.setPendingNavigationReason(t)}this.setPendingNavigationalRoot(t),this.setNavigationStatus(y.NAVIGATION_STARTED)}completeNavigation(e){var t;const{pageId:n,entityUri:i}=e;if(this.getCurrentEntityUri()!==i&&this.getNavigationStatus()===y.NAVIGATION_STARTED){const e=this.generatePageInstanceId(),o={page_instance_id:e,page_id:n,entity_uri:i,navigational_root:this.getPendingNavigationalRoot(),from_page_instance_id:this.getCurrentPageInstanceId(),from_page_id:this.getCurrentPageId(),from_entity_uri:this.getCurrentEntityUri(),from_navigational_root:this.getCurrentNavigationalRoot(),navigation_reason:this.populateNavigationReason()};if(this.authenticationProvider.isAuthenticated()){const e=(0,b.U)(o);this.eventSender.send(e)}else{const e=Object.assign(Object.assign({},o),{flow_id:(null===(t=this.flowIdProvider)||void 0===t?void 0:t.getFlowId())||null}),n=(0,S.W)(e);this.eventSender.send(n)}this.setCurrent(n,e,i,this.getPendingNavigationalRoot())}else this.resetNavStartInfo();this.setNavigationStatus(y.NAVIGATION_IDLE)}logClientLostFocus(){var e;const t=this.generatePageInstanceId(),n={page_instance_id:t,page_id:null,entity_uri:null,navigational_root:null,from_page_instance_id:this.getCurrentPageInstanceId(),from_page_id:this.getCurrentPageId(),from_entity_uri:this.getCurrentEntityUri(),from_navigational_root:this.getCurrentNavigationalRoot(),navigation_reason:A.hw.CLIENT_LOST_FOCUS};if(this.authenticationProvider.isAuthenticated()){const e=(0,b.U)(n);this.eventSender.send(e)}else{const t=Object.assign(Object.assign({},n),{flow_id:(null===(e=this.flowIdProvider)||void 0===e?void 0:e.getFlowId())||null}),i=(0,S.W)(t);this.eventSender.send(i)}this.setCurrent(this.getCurrentPageId(),t,this.getCurrentEntityUri(),this.getCurrentNavigationalRoot())}logClientGainedFocus(){var e;const t=this.generatePageInstanceId(),n={page_instance_id:t,page_id:this.getCurrentPageId(),entity_uri:this.getCurrentEntityUri(),navigational_root:this.getCurrentNavigationalRoot(),from_page_instance_id:this.getCurrentPageInstanceId(),from_page_id:null,from_entity_uri:null,from_navigational_root:null,navigation_reason:A.hw.CLIENT_GAINED_FOCUS};if(this.authenticationProvider.isAuthenticated()){const e=(0,b.U)(n);this.eventSender.send(e)}else{const t=Object.assign(Object.assign({},n),{flow_id:(null===(e=this.flowIdProvider)||void 0===e?void 0:e.getFlowId())||null}),i=(0,S.W)(t);this.eventSender.send(i)}this.setCurrent(this.getCurrentPageId(),t,this.getCurrentEntityUri(),this.getCurrentNavigationalRoot())}addEventListeners(){this.disableAutoBackgroundMonitoring||null===document||void 0===document||document.addEventListener("visibilitychange",this.handleBackgroundStates)}removeEventListeners(){this.disableAutoBackgroundMonitoring||null===document||void 0===document||document.removeEventListener("visibilitychange",this.handleBackgroundStates)}}class O{constructor(){this.items=new Map([])}setItem(e,t){try{return this.items.set(e,t),!0}catch(e){return!1}}getItem(e){const t=this.items.get(e);return null!=t?t:null}removeItem(e){this.items.delete(e)}clear(){this.items.clear()}}class I{setItem(e,t){try{return window.sessionStorage.setItem(e,t),!0}catch(e){return!1}}getItem(e){return window.sessionStorage.getItem(e)}removeItem(e){window.sessionStorage.removeItem(e)}clear(){window.sessionStorage.clear()}}function C(e){let t=e.length,n=t;for(;n--;){const i=e.charCodeAt(n);i>127&&i<=2047?t++:i>2047&&i<=65535&&(t+=2),i>=56320&&i<=57343&&n--}return t}const N={requiresPersistingState:!1};var L;!function(e){e.IN_MEMORY="in-memory",e.SESSION_STORAGE="session-storage",e.CUSTOM_STORAGE="custom-storage"}(L||(L={}));class R{constructor(e=N){this.storageAdapter=new O,e.requiresPersistingState&&(e.storageAdapter?this.storageAdapter=e.storageAdapter:function(){const e={"UBI|CURRENT_PAGE_ID":"playlist","UBI|CURRENT_PAGE_INSTANCE_ID":"bc33087f-b95a-4b15-bd48-0277666f303c","UBI|CURRENT_ENTITY_URI":"spotify:playlist:37i9dQZF1DX5trt9i14X7j","UBI|CURRENT_NAV_ROOT":"playlists-sidebar","UBI|PENDING_NAV_ROOT":"playlists-sidebar","UBI|PENDING_INTERACTION_ID":"8dbc8e4d-b4f7-4870-ab9e-a3238307ea6d","UBI|PENDING_NAV_REASON":"user_interaction(8dbc8e4d-b4f7-4870-ab9e-a3238307ea6d)","UBI|NAVIGATION_STATUS":y.NAVIGATION_COMPLETED,"UBI|PROVIDER_CURRENT_PAGE_INSTANCE_ID":"bc33087f-b95a-4b15-bd48-0277666f303c"},t=4*Object.keys(e).map((t=>C(t)+C(e[t]))).reduce(((e,t)=>e+t));try{const e="__UBI_STORAGE_TEST__",n="x".repeat(t);return window.sessionStorage.setItem(e,n),window.sessionStorage.removeItem(e),!0}catch(e){return!1}}()&&(this.storageAdapter=new I))}getItem(e){return this.storageAdapter.getItem(`${a}${e}`)}setItem(e,t){const n=t||"";this.storageAdapter.setItem(`${a}${e}`,n)}removeItem(e){this.storageAdapter.removeItem(`${a}${e}`)}clear(){this.storageAdapter.clear()}getStorageType(){return this.storageAdapter instanceof O?L.IN_MEMORY:this.storageAdapter instanceof I?L.SESSION_STORAGE:L.CUSTOM_STORAGE}}const P="CURRENT_PAGE_URI";class k{constructor(e){this.storageManager=e.storageManager}getPageUri(){return this.storageManager.getItem(P)}setPageUri(e){this.storageManager.setItem(P,e)}}class D{constructor(e){var t,n;this.eventSender=e.eventSender,this.disableAutoBackgroundMonitoring=null===(t=e.disableAutoBackgroundMonitoring)||void 0===t||t,this.storageManager=new R({storageAdapter:e.storageAdapter,requiresPersistingState:e.requiresPersistingState}),this.authenticationProvider=e.authenticationProvider,this.pageInstanceIdProvider=new v({storageManager:this.storageManager}),this.pageUriProvider=new k({storageManager:this.storageManager}),this.contextualProviders=e.contextualProviders,this.pageViewLogger=new T({eventSender:e.eventSender,pageInstanceIdProvider:this.pageInstanceIdProvider,pageUriProvider:this.pageUriProvider,disableAutoBackgroundMonitoring:this.disableAutoBackgroundMonitoring,storageManager:this.storageManager,authenticationProvider:this.authenticationProvider,flowIdProvider:null===(n=this.contextualProviders)||void 0===n?void 0:n.flowIdProvider})}registerEventListeners(){return;this.pageViewLogger.addEventListeners()}unregisterEventListeners(){return;this.pageViewLogger.removeEventListeners()}logInteraction(e){return {interactionId:null,pageInstanceId:null};const t=g.createGabitoEvent(e,this.authenticationProvider,Object.assign(Object.assign({},this.contextualProviders),{pageInstanceIdProvider:this.pageInstanceIdProvider,pageUriProvider:this.pageUriProvider}));return this.eventSender.send(t),t.data.interaction_id||""}logImpression(e){return;const t=f.createGabitoEvent(e,this.authenticationProvider,Object.assign(Object.assign({},this.contextualProviders),{pageInstanceIdProvider:this.pageInstanceIdProvider,pageUriProvider:this.pageUriProvider}));return this.eventSender.send(t),t.data.impression_id||""}logNavigationStart(e){this.pageViewLogger.startNavigation(e)}logNavigationEnd(e){this.pageViewLogger.completeNavigation(e)}logNavigation(e,t){return;this.logNavigationStart(e),this.logNavigationEnd(t)}logClientLostFocus(){this.disableAutoBackgroundMonitoring&&this.pageViewLogger.logClientLostFocus()}logClientGainedFocus(){this.disableAutoBackgroundMonitoring&&this.pageViewLogger.logClientGainedFocus()}getPageInstanceId(){return this.pageInstanceIdProvider.getPageInstanceId()}}const w=function(){let e;return{getUBILogger:function(t){return function(t){return e&&e.unregisterEventListeners(),e=new D(t),e.registerEventListeners(),e}(t)}}}()},22085:function(e,t,n){"use strict";n(86277);var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n{"use strict";var i,o;function r(e){return"interactionId"in e}function a(e){return"navigationReason"in e}n.d(t,{hw:()=>i,Wg:()=>o,Oq:()=>r,AG:()=>a}),function(e){e.CLIENT_LOST_FOCUS="client_lost_focus",e.CLIENT_GAINED_FOCUS="client_gained_focus",e.CLIENT_STARTED="client_started",e.DEEP_LINK="deep_link",e.BACK="back",e.FORWARD="forward",e.UNKNOWN="unknown"}(i||(i={})),function(e){e.ACCOUNTSWITCHING_PICKACCOUNT="accountswitching/pickaccount",e.AD_BASED_ON_DEMAND="ad-based-on-demand",e.ADAPTIVEAUTHENTICATION_START="adaptiveauthentication/start",e.AGE_VERIFICATION="age-verification",e.ALBUM="album",e.ANCHORFUNNEL="anchorfunnel",e.APPRATER="apprater",e.AUDIOBOOK_DIRECTSALES_SUCCESS="audiobook/directsales/success",e.AUDIOBOOK_DIRECTSALES_INAPPWEBCHECKOUTOVERLAY="audiobook/directsales/inappwebcheckoutoverlay",e.AAA_CON="aaa/con",e.AAA_CON_T="aaa/con/t",e.AAA_T="aaa/t",e.AUDIOBOOK_CONSUMPTIONCAP="audiobook/consumptioncap",e.AUDIOBOOK_SUPPLEMENTARYMATERIAL="audiobook/supplementarymaterial",e.AUDIOBOOK_TOPUP_PRODUCTPAGE="audiobook/topup/productpage",e.AUDIOBOOK_TOPUP_SUCCESS="audiobook/topup/success",e.ACTIVATION_AUTO_TRIAL="activation/auto-trial",e.ALLBOARDING_CONTENTPICKER="allboarding/contentpicker",e.ALLBOARDING_SINGLEITEMPICKER="allboarding/singleitempicker",e.ALLBOARDING_SEARCH="allboarding/search",e.ALLBOARDING_SEND="allboarding/send",e.ALLBOARDING_PLACEHOLDER="allboarding/placeholder",e.ARTIST="artist",e.ARTIST_ABOUT="artist/about",e.ARTIST_APPEARS_ON="artist/appears-on",e.ARTIST_ABOUT_WEBVIEW="artist/about/webview",e.ARTIST_ALBUMS="artist/albums",e.ARTIST_CONCERTS="artist/concerts",e.ARTIST_DISCOVERED_ON="artist/discovered-on",e.ARTIST_FEATURING="artist/featuring",e.ARTIST_GALLERY="artist/gallery",e.ARTIST_PLAYLISTS="artist/playlists",e.ARTIST_RELATED="artist/related",e.ARTIST_RELEASES="artist/releases",e.ARTIST_SAVED_TRACKS="artist/saved-tracks",e.ARTIST_RELATED_VIDEOS="artist/related-videos",e.CREATORFOLLOW_SLATE="creatorfollow/slate",e.ARTIST_PATRON="artist/patron",e.ARTIST_STORE="artist/store",e.ARSENAL="arsenal",e.ASSISTED_CURATION="assisted-curation",e.ASSISTED_CURATION_NAMING="assisted-curation/naming",e.ASSISTED_CURATION_SEARCH="assisted-curation/search",e.ASSISTED_CURATION_SEARCH_SONGS="assisted-curation/search/songs",e.ASSISTED_CURATION_SEARCH_ALBUMS="assisted-curation/search/albums",e.ASSISTED_CURATION_SEARCH_ARTISTS="assisted-curation/search/artists",e.ASSISTED_CURATION_SEARCH_EPISODES="assisted-curation/search/episodes",e.ASSISTED_CURATION_SEARCH_SHOWS="assisted-curation/search/shows",e.ASSISTED_CURATION_SEARCH_ALBUM_ENTITY="assisted-curation/search/album-entity",e.ASSISTED_CURATION_SEARCH_ARTIST_ENTITY="assisted-curation/search/artist-entity",e.ASSISTED_CURATION_SEARCH_SHOW_ENTITY="assisted-curation/search/show-entity",e.ADS="ads",e.ADSDISPLAY_CTAWIDGETNPV_SEEALL="adsdisplay/ctawidgetnpv/seeall",e.ADSDISPLAY_DSA="adsdisplay/dsa",e.BACKGROUND="background",e.BIRTHDAYS_GIFT="birthdays/gift",e.BLEND_ENTITY="blend/entity",e.BLEND_ENTITY_EDITNAME="blend/entity/editname",e.BLEND_ENTITY_MEMBERS="blend/entity/members",e.BLEND_ENTITY_TRACKAFFILIATION="blend/entity/trackaffiliation",e.BLEND_INVITATION="blend/invitation",e.BLEND_INVITATION_GROUPBLENDSJOIN="blend/invitation/groupblendsjoin",e.BLEND_TASTE_MATCH="blend/taste-match",e.BLEND_DATA_STORY="blend/data-story",e.BLEND_PARTY="blend/party",e.JAM_STORIES="jam/stories",e.BOOKMARKS="bookmarks",e.BOOTCAMP_CHORDS="bootcamp/chords",e.BOOTCAMP_EASTEREGGS="bootcamp/eastereggs",e.BOOTCAMP_MASHUP="bootcamp/mashup",e.BOOTCAMP_TOPTRACKS="bootcamp/toptracks",e.BOOTCAMP_TFB_TOPTRACKS="bootcamp/tfb/toptracks",e.BOOTCAMP_TOP50PLAYLIST="bootcamp/top50playlist",e.BOOTCAMP_TOPCOUNTRYPLAYLIST="bootcamp/topcountryplaylist",e.BROWSE="browse",e.BROWSE_DISCOVER="browse/discover",e.BROWSE_GENRES="browse/genres",e.BROWSE_NEWRELEASES="browse/newreleases",e.BROWSE_PODCASTS="browse/podcasts",e.BROWSE_TOPPODCAST="browse/toppodcast",e.BUNDLING="bundling",e.BUNDLING_WEBVIEW="bundling/webview",e.BUNDLING_SURVEY_WEBVIEW="bundling/survey/webview",e.BUNDLING_OFFER="bundling/offer",e.BUNDLING_OFFER_WEBVIEW="bundling/offer/webview",e.BUNDLING_PLACEBO="bundling/placebo",e.BUNDLING_PLACEBO_WEBVIEW="bundling/placebo/webview",e.BUSINESSMANAGER="businessmanager",e.BUSINESSMANAGER_BUSINESSDETAILS="businessmanager/businessdetails",e.CACHED_FILES="cached-files",e.CACHED_FILES_SEARCH="cached-files/search",e.CALLING_CODE_PICKER="calling-code-picker",e.CALIFORNIA="california",e.CALIFORNIA_NOARGS="california/noargs",e.CANVAS_NOWPLAYING="canvas/nowplaying",e.CAPPED_OFFLINE_DIALOG="capped-offline/dialog",e.CAPPED_ONDEMAND_DIALOG="capped-ondemand/dialog",e.CAR_MODE_ENTITY="car-mode/entity",e.CAR_MODE_HOME="car-mode/home",e.CAR_MODE_YOURLIBRARY="car-mode/yourLibrary",e.DRIVING_DRIVINGMODE="driving/drivingMode",e.CARS_MEDIASERVICE="cars/mediaservice",e.CARS_ANDROIDAUTO="cars/androidauto",e.CARS_APPPROTOCOL="cars/appprotocol",e.CARS_BMW="cars/bmw",e.CARS_LOCKSCREEN="cars/lockscreen",e.CARS_MYSPIN="cars/myspin",e.CARS_WAZE="cars/waze",e.CARTHING="carthing",e.CARTHING_SETTINGS="carthing/settings",e.CARTHING_PRESETS="carthing/presets",e.CARTHING_PRESETS_HOWTO="carthing/presets/howto",e.CARTHING_PRESETS_SAVE="carthing/presets/save",e.CELEBRITYBLEND_ENTITY="celebrityblend/entity",e.CHALLENGE_DUMMY="challenge/dummy",e.CHALLENGE_TOTP="challenge/totp",e.CHALLENGE_EMAIL_VERIFICATION="challenge/email-verification",e.CHARTS="charts",e.CHARTS_CHART="charts/chart",e.CHARTS_REGIONAL="charts/regional",e.CHARTS_UNKNOWN="charts/unknown",e.CHARTS_VIRAL="charts/viral",e.CHARTS_WEEKLY="charts/weekly",e.CHARTS_ALBUMS="charts/albums",e.CHARTS_ALBUM="charts/album",e.CHARTS_MERCH="charts/merch",e.CHARTS_MERCHCOLLECTION="charts/merchcollection",e.CHECKOUT="checkout",e.CHECKOUT_CODEREDEMPTION="checkout/coderedemption",e.CHECKOUT_GPB="checkout/gpb",e.CHECKOUT_CHOICESCREEN="checkout/choicescreen",e.CHECKOUT_UNIFIEDCHECKOUT="checkout/unifiedcheckout",e.CHURNLOCK="churnlock",e.COLLECTION="collection",e.COLLECTION_ALBUMS="collection/albums",e.COLLECTION_ALBUMS_ALBUM="collection/albums/album",e.COLLECTION_ARTISTS="collection/artists",e.COLLECTION_ARTISTS_ARTIST="collection/artists/artist",e.COLLECTION_EPISODES_REMOVEALL="collection/episodes/removeall",e.COLLECTION_FILEPICKER="collection/filepicker",e.COLLECTION_FOLDER="collection/folder",e.COLLECTION_OFFLINELIBRARY="collection/offlinelibrary",e.COLLECTION_PLAYLISTS="collection/playlists",e.COLLECTION_PODCASTS="collection/podcasts",e.COLLECTION_PODCASTSONLY="collection/podcastsonly",e.COLLECTION_PODCASTS_FOLLOWING="collection/podcasts/following",e.COLLECTION_PODCASTS_EPISODES_UNPLAYED="collection/podcasts/episodes/unplayed",e.COLLECTION_PODCASTS_EPISODES_OFFLINE="collection/podcasts/episodes/offline",e.COLLECTION_PODCASTS_EPISODES_UNFINISHED="collection/podcasts/episodes/unfinished",e.COLLECTION_PODCASTS_EPISODES_LISTENLATER="collection/podcasts/episodes/listenlater",e.COLLECTION_PODCASTS_EPISODES="collection/podcasts/episodes",e.COLLECTION_RADIO="collection/radio",e.COLLECTION_RECENTLYPLAYED="collection/recentlyplayed",e.COLLECTION_SONGS="collection/songs",e.COLLECTION_VIDEO="collection/video",e.COLLECTION_YOUREPISODES="collection/yourepisodes",e.COLLECTION_YOUREPISODES_SETTINGS="collection/yourepisodes/settings",e.COLLECTION_YOUREPISODES_SETTINGS_REMOVEPLAYED="collection/yourepisodes/settings/removeplayed",e.COLLECTION_YOUREPISODES_SETTINGS_REMOVEUNPLAYED="collection/yourepisodes/settings/removeunplayed",e.COLLECTION_YOUREPISODES_SETTINGS_AUTODOWNLOAD="collection/yourepisodes/settings/autodownload",e.COLLECTION_YOUREPISODES_SETTINGS_AUTODOWNLOADLIMIT="collection/yourepisodes/settings/autodownloadlimit",e.COLLECTION_SAVEDEPISODES="collection/savedepisodes",e.COMMENTS="comments",e.COMMENTS_SECTION="comments/section",e.COMMENTS_SETTINGS="comments/settings",e.COMMUNITY_LISTENING_ACTIVITY="community/listening-activity",e.CONTENT_FEED="content-feed",e.CULTURALMOMENTSHUB="culturalmomentshub",e.SETTINGS_APP_ICON="settings/app-icon",e.YOURLIBRARY="yourlibrary",e.YOURLIBRARY_ALBUMS="yourlibrary/albums",e.YOURLIBRARY_ARTISTS="yourlibrary/artists",e.YOURLIBRARY_AUDIOBOOKS="yourlibrary/audiobooks",e.YOURLIBRARY_PLAYLISTS="yourlibrary/playlists",e.YOURLIBRARY_EPISODES="yourlibrary/episodes",e.YOURLIBRARY_DOWNLOADS="yourlibrary/downloads",e.YOURLIBRARY_SHOWS="yourlibrary/shows",e.YOURLIBRARY_HIDDEN_CONTENT="yourlibrary/hidden-content",e.YOURLIBRARY_SEARCH="yourlibrary/search",e.YOURLIBRARY_TAG="yourlibrary/tag",e.YOURLIBRARY_PROONBOARDING="yourlibrary/proonboarding",e.YOURLIBRARYTAGS_YOURTAGSPAGE="yourlibrarytags/yourtagspage",e.CONCERTS="concerts",e.CONCERTS_CITYSEARCH="concerts/citysearch",e.CONCERTS_CONCERT="concerts/concert",e.CONCERTS_CONCERT_WEBVIEW="concerts/concert/webview",e.CONCERTS_GROUP="concerts/group",e.CONCERTS_ARTIST="concerts/artist",e.CONNECT_CONTEXTMENU="connect/contextmenu",e.CONNECT_DEVICEPICKER="connect/devicepicker",e.CONNECT_OVERLAY_NEWDEVICE="connect/overlay/newdevice",e.CONNECT_OVERLAY_SWITCHDEVICE="connect/overlay/switchdevice",e.CONNECT_OVERLAY_VOLUME="connect/overlay/volume",e.CONNECT_TUTORIALDESKTOP="connect/tutorialdesktop",e.CONNECT_TUTORIALSPEAKER="connect/tutorialspeaker",e.CONNECT_TUTORIALTV="connect/tutorialtv",e.CONNECT_TUTORIALGAMECONSOLE="connect/tutorialgameconsole",e.CONNECT_TUTORIALCHROMECAST="connect/tutorialchromecast",e.CONNECT_TUTORIALBLUETOOTH="connect/tutorialbluetooth",e.CONNECT_EDUCATIONPAGE="connect/educationpage",e.CONTEXTDISPATCH_ERROR="contextdispatch/error",e.CONTEXTDISPATCH_OFFLINE="contextdispatch/offline",e.CONTEXTMENU="contextmenu",e.CONTEXTMENU_TRACK="contextmenu/track",e.CONTEXTMENU_ALBUM="contextmenu/album",e.CONTEXTMENU_ARTIST="contextmenu/artist",e.CONTEXTMENU_PLAYLIST="contextmenu/playlist",e.CONTEXTMENU_EPISODE="contextmenu/episode",e.CONTEXTMENU_LIVEROOM="contextmenu/liveroom",e.CONTEXTMENU_EXPRESSIONVIDEO="contextMenu/expressionvideo",e.CONTEXTMENU_SHOWSCANNABLECODE="contextmenu/showscannablecode",e.CONTEXTMENU_VIEWARTISTS="contextmenu/viewartists",e.CONTEXTMENU_AUDIOSETTINGS="contextmenu/audiosettings",e.CONTEXTMENU_VIDEOSETTINGS="contextmenu/videosettings",e.CONTEXTMENU_EPISODE_SLEEPTIMER="contextmenu/episode/sleeptimer",e.CONTEXTMENU_EPISODE_SPEEDCONTROL="contextmenu/episode/speedcontrol",e.CONTEXTMENU_SHOW="contextmenu/show",e.CONTEXTMENU_SHARE="contextmenu/share",e.CONTEXTMENU_POSTTO="contextmenu/postto",e.CONTEXTMENU_SENDTO="contextmenu/sendto",e.CONTEXTMENU_REMOTEDOWNLOADS="contextmenu/remotedownloads",e.CONTEXTMENU_MERCH="contextmenu/merch",e.COVERIMAGE="coverimage",e.DAILYMIXHUB="dailymixhub",e.DATASAVERMODE="datasavermode",e.DATASAVERMODE_SETTINGS="datasavermode/settings",e.DEBUG="debug",e.DIALOG_COLLECTION_INSUFFICIENTSTORAGE="dialog/collection/insufficientstorage",e.DIALOG_CONNECT_NOMUSIC="dialog/connect/nomusic",e.DIALOG_DISKALMOSTFULL="dialog/diskalmostfull",e.DIALOG_FINDFRIENDS_CONFIRMALL="dialog/findfriends/confirmall",e.DIALOG_LOCALFILESIMPORT_OK="dialog/localfilesimport/ok",e.DIALOG_LOCALFILESIMPORT_DISCARD="dialog/localfilesimport/discard",e.DIALOG_LOCALFILESIMPORT_SONGS="dialog/localfilesimport/songs",e.DIALOG_CONNECTFACEBOOK="dialog/connectfacebook",e.DIALOG_CONNECTXAUTH="dialog/connectxauth",e.DIALOG_CONNECTOAUTH="dialog/connectoauth",e.DIALOG_SHOW_VIDEOUNAVAILABLE="dialog/show/videounavailable",e.DIALOG_REQUESTPERMISSIONS_SHOWRATIONALE="dialog/requestpermissions/showrationale",e.DIALOG_PROFILE_ACTIVITY_ONDEMANDUNAVAILABLE="dialog/profile/activity/ondemandunavailable",e.DIALOG_TERMS_TERMSCHANGED="dialog/terms/termschanged",e.DIALOG_TERMS_TERMSPOSTPONED="dialog/terms/termspostponed",e.DIALOG_CONNECT_PLAYBACK_ERROR="dialog/connect/playback/error",e.DIALOG_SEARCH_FEEDBACK="dialog/search/feedback",e.DIALOG_MARKETOPPORTUNITIES_SHOWCASE="dialog/marketopportunities/showcase",e.DIALOG_AGELIMITDIALOG="dialog/agelimitdialog",e.DIALOG_PAYWALL="dialog/paywall",e.DISCOVERWEEKLY="discoverweekly",e.DISCOVERWEEKLY_SWIPE="discoverweekly/swipe",e.DISCOVERNOW="discovernow",e.DISCOVERNOWMUSIC="discovernowmusic",e.DOWNLOAD_DESKTOP="download/desktop",e.DRIVINGMODE="drivingmode",e.ENHANCED_SESSION="enhanced-session",e.DYNAMIC_SESSION_ENTITY="dynamic-session/entity",e.EMAIL_EDIT="email/edit",e.EMAIL_EDIT_SSO="email/edit/sso",e.EMAIL_EDIT_RESETPASSWORD="email/edit/resetpassword",e.EMAIL_VERIFY_BLOCKING="email/verify/blocking",e.ENTERPRISEPODCASTS="enterprisepodcasts",e.EPISODE="episode",e.EVENTSENDER_DEBUG="eventsender/debug",e.EVENTSENDER_ITGC_DEBUG="eventsender/itgc/debug",e.EXPERIMENTAL="experimental",e.EXPERIMENTAL_AUDIOPLAYBACK="experimental/audioplayback",e.EXPERIMENTAL_COUNTRYTOPTEN="experimental/countrytopten",e.EXPERIMENTAL_LISTENINGHISTORY="experimental/listeninghistory",e.FACEBOOK_CONNECT="facebook/connect",e.FACEBOOK_PERMISSIONS="facebook/permissions",e.FACEBOOK_WEBVIEWPERMISSIONS="facebook/webviewpermissions",e.FINDFRIENDS="findfriends",e.FANDOM_TOPARTISTS="fandom/topartists",e.FANDOM_ARTISTMIX="fandom/artistmix",e.FANDOM_ARTISTBLEND="fandom/artistblend",e.FANDOM_TOPTRACKS="fandom/toptracks",e.FIND="find",e.FOLLOWFEED="followfeed",e.FORMATLISTPLATFORM="formatlistplatform",e.FORMATLISTPLATFORM_OFFLINE="formatlistplatform/offline",e.FRIENDSACTIVITY="friendsactivity",e.FRIENDSACTIVITY_FRIENDSLIST="friendsactivity/friendslist",e.FRIENDSACTIVITY_STORY="friendsactivity/story",e.FRIENDSHOME="friendshome",e.FRIENDSHOME_ENTITY="friendshome/entity",e.FRIENDSHOME_LISTENERS="friendshome/listeners",e.FRIENDSHOME_FINDFRIENDS="friendshome/findfriends",e.FRIENDSHOME_SEARCHFRIENDS="friendshome/searchfriends",e.FRIENDRECOMMENDATIONS="friendrecommendations",e.GIFT_SHARE="gift-share",e.UNBOXING_HUB="unboxing-hub",e.KID_ACCOUNT_CREATION_LEGAL_CONSENT="kid-account-creation/legal-consent",e.KID_ACCOUNT_CREATION_PARENTAL_CONTROL="kid-account-creation/parental-control",e.KID_ACCOUNT_CREATION_PIN="kid-account-creation/pin",e.KID_ACCOUNT_CREATION_NAME="kid-account-creation/name",e.KID_ACCOUNT_CREATION_BIRTHDAY="kid-account-creation/birthday",e.KID_ACCOUNT_CREATION_SUBMIT="kid-account-creation/submit",e.KID_ACCOUNT_CREATION_EDUCATION="kid-account-creation/education",e.KID_ACCOUNT_SELECTION="kid-account-selection",e.KID_PARENTAL_BLOCKING_TRACK="kid-parental-blocking/track",e.KID_PARENTAL_BLOCKING_ARTIST="kid-parental-blocking/artist",e.PARENTALCONTROL="parentalcontrol",e.PARENTAL_CONTROL_UPDATE_NAME="parental-control/update-name",e.PARENTAL_CONTROL_UPDATE_BIRTHDAY="parental-control/update-birthday",e.CHANGEPIN="changepin",e.PIN_GATE="pin-gate",e.ADD_MEMBER="add-member",e.FULLSCREEN_STORY="fullscreen-story",e.FULLSCREEN_STORY_SHARE="fullscreen-story-share",e.FULLSCREEN_VIDEOPLAYER="fullscreen/videoplayer",e.HOLIDAYCAMPAIGN="holidaycampaign",e.INBOX="inbox",e.INVITE_HAVEINVITE="invite/haveinvite",e.GOOGLEASSISTANT="googleassistant",e.GUEST_LIBRARYTABWALL="guest/librarytabwall",e.GUEST_LOGINTABWALL="guest/logintabwall",e.HOMEMIX_ENTITY="homemix/entity",e.HOMEMIX_TASTEONBOARDING="homemix/tasteonboarding",e.HOMEMIX_GENRESPAGE="homemix/genrespage",e.HOMEMIX_GENREDETAIL="homemix/genredetail",e.HOMEMIX_ABOUT="homemix/about",e.HOMEMIX_ABOUTVIDEO="homemix/aboutvideo",e.HOMEMIX_USERTOGGLE="homemix/usertoggle",e.HOMEMIX_FACEPILEDETAIL="homemix/facepiledetail",e.HOMETHING="homething",e.HOMETHING_ACTIVATION_WELCOME="homething/activation/welcome",e.HOMETHING_ACTIVATION_SCANDEVICES="homething/activation/scandevices",e.HOMETHING_ACTIVATION_CONNECTING="homething/activation/connecting",e.HOMETHING_ACTIVATION_WIFI="homething/activation/wifi",e.HOMETHING_ACTIVATION_ERROR="homething/activation/error",e.HOMETHING_ACTIVATION_CONNECTED="homething/activation/connected",e.HOMETHING_SETTINGS="homething/settings",e.INSPIRECREATION="inspirecreation",e.IMAGERECS="imagerecs",e.LANGUAGEPICKER="languagepicker",e.LANGUAGEPICKER_NOSKIPDIALOG="languagepicker/noskipdialog",e.LINGO_HOME="lingo/home",e.LISTENINGHISTORY="listeninghistory",e.LISTENINGHISTORY_PLAYSFROMCONTEXT="listeninghistory/playsfromcontext",e.LISTENINGSTATS="listeningstats",e.LOCALFILESIMPORT="localfilesimport",e.LOCALFILES="localfiles",e.LOGIN="login",e.LOGIN_WELCOME="login/welcome",e.LOGIN_SETTINGS="login/settings",e.LOGIN_ACCOUNTRECOVERY_REQUESTEMAIL="login/accountrecovery/requestemail",e.LOGIN_ACCOUNTRECOVERY_REQUESTEMAILCONFIRMATION="login/accountrecovery/requestemailconfirmation",e.LOGIN_ACCOUNTRECOVERY_RESETPASSWORD="login/accountrecovery/resetpassword",e.LOGIN_ACCOUNTRECOVERY_RESETPASSWORDCONFIRMATION="login/accountrecovery/resetpasswordconfirmation",e.LOGIN_ACCOUNTRECOVERY_COLLECTEMAIL="login/accountrecovery/collectemail",e.LOGIN_CONTINUEWITH="login/continuewith",e.LOGIN_CONTINUEWITH_EMAIL="login/continuewith/email",e.LOGIN_CONNECT="login/connect",e.LOGIN_PIN="login/pin",e.LOGIN_MULTIUSER="login/multiuser",e.PHONENUMBERSIGNUP="phonenumbersignup",e.PHONENUMBERSIGNUP_CALLINGCODEPICKER="phonenumbersignup/callingcodepicker",e.PHONENUMBERSIGNUP_PHONENUMBERENTRY="phonenumbersignup/phonenumberentry",e.PHONENUMBERSIGNUP_VALIDATEOTP="phonenumbersignup/validateotp",e.LYRICS="lyrics",e.LYRICS_FULLSCREEN="lyrics/fullscreen",e.LYRICS_SHARE="lyrics/share",e.LYRICS_SHEET="lyrics/sheet",e.MADE_FOR_YOU="made-for-you",e.MARKETOPPORTUNITIES_PRECACHING="marketopportunities/precaching",e.MERCH_DETAILS="merch-details",e.MERCH_HUB="merch-hub",e.MISSEDCONNECTIONS="missedconnections",e.MOMENTS="moments",e.MOMENTS_CATEGORY="moments/category",e.MUSIC="music",e.MUSIC_CATEGORY="music/category",e.NOTIFICATIONS="notifications",e.NOTIFICATIONS_ACTIVITY="notifications/activity",e.NOW="now",e.HOME="home",e.HOME_DRILLDOWN="home/drilldown",e.HOME_FUNKIS="home-funkis",e.NEWRELEASESFEED="newreleasesfeed",e.NOTIFICATIONS_CENTER="notifications-center",e.NOWPLAYING="nowplaying",e.NOWPLAYINGV2="nowplayingv2",e.NOWPLAYING_GENIUSCARDS="nowplaying/geniuscards",e.NOWPLAYING_NOWPLAYINGBAR="nowplaying/nowplayingbar",e.NOWPLAYING_LIVEROOMNOWPLAYINGBAR="nowplaying/liveroomnowplayingbar",e.NOWPLAYING_NOWPLAYINGSIDEBAR="nowplaying/nowplayingsidebar",e.NOWPLAYING_QUEUE="nowplaying/queue",e.NOWPLAYING_HISTORY="nowplaying/history",e.NOWPLAYING_UPNEXT="nowplaying/upnext",e.NFT_MIX="nft-mix",e.OFFLINE="offline",e.OFFLINE_SYNC_ERROR="offline-sync/error",e.OFFLINE_MIX_ENTITY="offline-mix/entity",e.OFFLINE_USER_MIX_ENTITY="offline-user-mix/entity",e.OVERLAY_SHUFFLEPLAYLIST="overlay/shuffleplaylist",e.OVERLAY_DATASAVERPLAYLIST="overlay/datasaverplaylist",e.ONBOARDING_OVERLAY="onboarding/overlay",e.ONETAPBROWSE="onetapbrowse",e.ONLYYOU_DATASTORIES="onlyyou/datastories",e.OPEN_ACCESS_PREVIEW="open-access-preview",e.OURDJ="ourdj",e.PAYMENTFAILURE_RESUBSCRIPTIONMODAL="paymentfailure/resubscriptionmodal",e.PERSONALISED_SET="personalised-set",e.PLAN_MEMBER_INVITATION="plan-member-invitation",e.PLAYLIST="playlist",e.PLAYLIST_NOTLOADED="playlist/notloaded",e.PLAYLIST_ONDEMAND="playlist/ondemand",e.PLAYLIST_DATA_SAVER="playlist/data-saver",e.PLAYLIST_ADDTOPLAYLIST="playlist/addtoplaylist",e.PLAYLIST_ADDTOPLAYLIST_ADDONTOPDIALOG="playlist/addtoplaylist/addontopdialog",e.PLAYLIST_ADDTOPLAYLIST_ADDTOBOTTOMDIALOG="playlist/addtoplaylist/addtobottomdialog",e.PLAYLIST_ADDTOPLAYLIST_DUPLICATEDIALOG="playlist/addtoplaylist/duplicatedialog",e.PLAYLIST_ADDTOPLAYLISTBOTTOMSHEET="playlist/addtoplaylistbottomsheet",e.PLAYLIST_ANNOTATE="playlist/annotate",e.PLAYLIST_CONFIRMDELETE="playlist/confirmdelete",e.PLAYLIST_CREATE="playlist/create",e.PLAYLIST_FOLDER="playlist/folder",e.PLAYLIST_FOLDER_TRACKS="playlist/folder/tracks",e.PLAYLIST_RENAME="playlist/rename",e.PLAYLIST_EDIT="playlist/edit",e.PLAYLIST_EDIT_DISCARD="playlist/edit/discard",e.PLAYLIST_EDIT_CROP="playlist/edit/crop",e.PLAYLIST_ALLSONGS="playlist/allsongs",e.PLAYLIST_PARTICIPANTS="playlist/participants",e.PLAYLIST_PERMISSIONS="playlist/permissions",e.PLAYLIST_PERMISSIONS_CLAIMDIALOG="playlist/permissions/claimdialog",e.PLAYLIST_PERMISSIONS_INVITESTORY="playlist/permissions/invitestory",e.PLAYLIST_STORY="playlist/story",e.PLAYLIST_WRAPPEDLIVE="playlist/wrappedlive",e.PLAYLIST_WEBVIEW="playlist/webview",e.PLAYLIST_FILTER="playlist/filter",e.PLAYLIST_COVER_ART_SNAKE="playlist/cover-art-snake",e.PLAYLIST_CREATE_EUTERPE="playlist/create/euterpe",e.PLAYLIST_TUNER="playlist/tuner",e.PLAYLISTPRO="playlistpro",e.PLAYLISTPRO_PREVIEW="playlistpro/preview",e.PODCAST="podcast",e.PODCAST_LOADING="podcast/loading",e.PODCAST_EPISODE="podcast/episode",e.PODCAST_EPISODE_AUDIOBOOK="podcast/episode/audiobook",e.PODCAST_EPISODE_DESCRIPTION="podcast/episode/description",e.PODCAST_EPISODE_LOADING="podcast/episode/loading",e.PODCAST_EPISODE_TIMELINE="podcast/episode/timeline",e.PODCAST_EPISODE_TRANSCRIPT="podcast/episode/transcript",e.PODCAST_EPISODE_COMMENTS="podcast/episode/comments",e.PODCAST_SHOW_AUDIOBOOK="podcast/show/audiobook",e.PODCAST_SHOW_LOADING="podcast/show/loading",e.PODCAST_SHOW_AUDIOBOOK_GATEDACCESSEDUCATION="podcast/show/audiobook/gatedaccesseducation",e.PODCAST_SHOW_COMMUNITY="podcast/show/community",e.PODCAST_SHOW_GATEDACCESSEDUCATION="podcast/show/gatedaccesseducation",e.PODCAST_SHOW_INTERACTIVEAUDIOBOOK="podcast/show/interactiveaudiobook",e.PODCAST_SHOW_RECOMMENDATIONS="podcast/show/recommendations",e.PODCAST_SHOW_SEARCH="podcast/show/search",e.PODCAST_STORYLINE="podcast/storyline",e.PODCAST_SHOW_SETTINGS="podcast/show/settings",e.PODCAST_SHOW_SETTINGS_MARKASPLAYED="podcast/show/settings/markasplayed",e.PODCAST_SPEED="podcast/speed",e.PODCAST_SPONSORS="podcast/sponsors",e.PODCAST_PEPAREPISODE="podcast/peparepisode",e.PODCAST_IMPORT="podcast/import",e.PODCAST_PREVIEW="podcast/preview",e.PODCAST_CREATOR="podcast/creator",e.PODCAST_CREATOR_SHOWS="podcast/creator/shows",e.PODCASTCHARTS="podcastcharts",e.PODCASTCHARTS_CATEGORIES="podcastcharts/categories",e.PODCASTCHARTS_REGIONS="podcastcharts/regions",e.PODCASTCHARTS_CHART="podcastcharts/chart",e.PODCASTCLIPS="podcastclips",e.PODCASTINTERACTIVITY_POLL="podcastinteractivity/poll",e.PODCASTONBOARDING_TOPICPICKER="podcastonboarding/topicpicker",e.PODCASTONBOARDING_SENDTOPICS="podcastonboarding/sendtopics",e.PODCAST_NEW_EPISODE_NOTIFICATIONS_SETTINGS="podcast-new-episode-notifications/settings",e.RATINGS_AND_REVIEWS_RATINGS="ratings-and-reviews/ratings",e.RATINGS_AND_REVIEWS_RATINGS_AUDIOBOOK="ratings-and-reviews/ratings/audiobook",e.PREMIUM="premium",e.PREMIUM_ACCOUNT_MANAGEMENT="premium-account-management",e.PREMIUM_ACCOUNT_MANAGEMENT_ALL_PLANS="premium-account-management/all-plans",e.PREMIUM_ACCOUNT_MANAGEMENT_AVAILABLE_PLANS="premium-account-management/available-plans",e.PREMIUM_ACCOUNT_MANAGEMENT_BILLING="premium-account-management/billing",e.PREMIUM_ACCOUNT_MANAGEMENT_PLAN_DETAILS="premium-account-management/plan-details",e.PREMIUM_ACCOUNT_MANAGEMENT_NEMO_CONSIDERATION="premium-account-management/nemo-consideration",e.PREMIUM_DESTINATION="premium-destination",e.PREMIUM_DESTINATION_PREMIUM_PLANS="premium-destination/premium-plans",e.PREMIUMHUB="premiumhub",e.PREMIUM_MINI_DOWNLOADED_ENTITY="premium-mini/downloaded-entity",e.PREMIUM_MINI_REWARDS="premium-mini/rewards",e.PREMIUM_MESSAGING="premium-messaging",e.PREMIUM_SIGNUP="premium-signup",e.PRERELEASE="prerelease",e.PROACTIVE_PLATFORMS_RECOMMENDATIONS_WIDGET="proactive-platforms/recommendations-widget",e.PROACTIVE_PLATFORMS_NPV_WIDGET="proactive-platforms/npv-widget",e.PROACTIVE_PLATFORMS_COVER_SCREEN_WIDGET="proactive-platforms/cover-screen-widget",e.PROFILE="profile",e.PROFILE_ACTIVITY="profile/activity",e.PROFILE_ACTIVITY_REPLAYS="profile/activity/replays",e.PROFILE_ARTISTS="profile/artists",e.PROFILE_BLOCKED_LIST="profile/blocked-list",e.PROFILE_FOLLOWERS="profile/followers",e.PROFILE_FOLLOWING="profile/following",e.PROFILE_PLAYLISTS="profile/playlists",e.PROFILE_EPISODES="profile/episodes",e.PROFILE_EDIT="profile/edit",e.PROFILE_FOLLOW_SUGGESTIONS="profile/follow-suggestions",e.PROFILE_IMAGEPREVIEW="profile/imagepreview",e.PROFILE_RECENTLY_PLAYED_ARTISTS="profile/recently-played-artists",e.PROFILE_TOP_TRACKS="profile/top-tracks",e.PROFILE_TOP_ARTISTS="profile/top-artists",e.PROFILE_PRONOUNS="profile/pronouns",e.PROFILE_IMAGE_PICKER="profile/image-picker",e.REFRESHEDPROFILE_FOLLOW_SUGGESTIONS="refreshedprofile/follow-suggestions",e.PICKINSIGHTS="pickinsights",e.PROMODISCLOSURE="promodisclosure",e.PUSHOPTIN="pushoptin",e.RADIO="radio",e.RADIO_DAILY_MIX_SURVEY="radio/daily-mix-survey",e.RADIO_DAILY_MIXES="radio/daily-mixes",e.RADIO_DASHBOARD_MIXES="radio/dashboard/mixes",e.RADIO_STATION="radio/station",e.RADIO_STATION_CREATE="radio/station/create",e.RADIO_STATION_CREATE_ALBUMS="radio/station/create/albums",e.RADIO_STATION_CREATE_ARTISTS="radio/station/create/artists",e.RADIO_STATION_CREATE_PLAYLISTS="radio/station/create/playlists",e.RADIO_STATION_CREATE_SHOWS="radio/station/create/shows",e.RADIO_STATION_CREATE_TRACKS="radio/station/create/tracks",e.RECENTLYPLAYED="recentlyplayed",e.RECENTS="recents",e.REMOTECONFIGURATION_DEBUG="remoteconfiguration/debug",e.REQUESTPERMISSIONS="requestpermissions",e.RESETPASSWORD="resetpassword",e.RESETPASSWORD_EMAILSENT="resetpassword/emailsent",e.RESETPASSWORD_EMAILLANDING="resetpassword/emaillanding",e.RESETPASSWORD_CHANGEPASSWORD="resetpassword/changepassword",e.RESETPASSWORD_SUCCESS="resetpassword/success",e.RUNNING="running",e.RUNNING_CATEGORY="running/category",e.RUNNING_SETUP="running/setup",e.RUNNING_SETUP_MANUAL="running/setup/manual",e.SAYIT="sayit",e.SCANNABLES_SCANNER="scannables/scanner",e.SCANNABLES_IMAGEPICKERCONTROLLER="scannables/imagepickercontroller",e.SEARCH="search",e.SEARCH_ALBUMS="search/albums",e.SEARCH_ARTISTS="search/artists",e.SEARCH_AUDIOBOOKS="search/audiobooks",e.SEARCH_AUDIOS="search/audios",e.SEARCH_AUTOCOMPLETE="search/autocomplete",e.SEARCH_EPISODES="search/episodes",e.SEARCH_GENRES="search/genres",e.SEARCH_PLAYLISTS="search/playlists",e.SEARCH_PODCASTS_AND_EPISODES="search/podcasts_and_episodes",e.SEARCH_PROFILES="search/profiles",e.SEARCH_SHOWS="search/shows",e.SEARCH_SONGS="search/songs",e.SEARCH_VIDEOS="search/videos",e.SEARCH_RECENT="search/recent",e.SETTINGS="settings",e.SETTINGS_ABOUT="settings/about",e.SETTINGS_ACCOUNT="settings/account",e.SETTINGS_ACCOUNT_UPSELL="settings/account/upsell",e.SETTINGS_ADS="settings/ads",e.SETTINGS_CONTENT_LANGUAGES="settings/content-languages",e.SETTINGS_LANGUAGE_SETTINGS_ROOT="settings/language-settings-root",e.SETTINGS_LANGUAGES_ROOT="settings/languages/root",e.SETTINGS_LANGUAGES_MUSIC="settings/languages/music",e.SETTINGS_LANGUAGES_CONTENT="settings/languages/content",e.SETTINGS_LANGUAGES_CONTENT_SEEALL="settings/languages/content/seeAll",e.SETTINGS_EQUALIZER="settings/equalizer",e.SETTINGS_FEATURES="settings/features",e.SETTINGS_IMPORT="settings/import",e.SETTINGS_LOCAL_FILES="settings/local-files",e.SETTINGS_NEARBY="settings/nearby",e.SETTINGS_NOTIFICATIONS="settings/notifications",e.SETTINGS_NOTIFICATIONS_CHANNELS="settings/notifications/channels",e.SETTINGS_NOTIFICATIONS_CHANNEL_DETAILS="settings/notifications/channel-details",e.SETTINGS_NOTIFICATIONS_CATEGORIES="settings/notifications/categories",e.SETTINGS_NOTIFICATIONS_CATEGORY_DETAILS="settings/notifications/category-details",e.SETTINGS_PLAYBACK="settings/playback",e.SETTINGS_QUALITY="settings/quality",e.SETTINGS_VIDEOQUALITY="settings/videoquality",e.SETTINGS_SOCIAL="settings/social",e.SETTINGS_APPS="settings/apps",e.SETTINGS_STORAGE="settings/storage",e.SETTINGS_THIRD_PARTY_LIBRARIES="settings/third-party-libraries",e.SETTINGS_DEVICES="settings/devices",e.SETTINGS_SIRIINTENTS="settings/siriintents",e.SETTINGS_UPDATE_EMAIL_ADDRESS="settings/update-email-address",e.SETTINGS_VOICE_ASSISTANTS="settings/voice-assistants",e.SETTINGS_IGNORED_IN_RECOMMENDATIONS="settings/ignored-in-recommendations",e.SETTINGS_CONTENTPREFERENCES="settings/contentpreferences",e.SARABANDA="sarabanda",e.SHARE="share",e.LEGACYSHARE="legacyshare",e.INTERIMSHARE="interimshare",e.LEGACYSHARE_POSTTO="legacyshare/postto",e.LEGACYSHARE_SENDTO="legacyshare/sendto",e.SHARE_FACEBOOK="share/facebook",e.SHARE_FACEBOOKFEED="share/facebookfeed",e.SHARE_INSTAGRAM="share/instagram",e.SHARE_SNAPCHAT="share/snapchat",e.SHARE_MESSENGER="share/messenger",e.SHARE_MESSENGER_COMPOSE="share/messenger/compose",e.SHARE_MISSINGUSER="share/missinguser",e.SHARE_MENU="share-menu",e.SHARE_MENU_COMPOSER="share-menu/composer",e.SHOWCASE="showcase",e.MARQUEE="marquee",e.SHOWS="shows",e.SHOWS_FORMAT_LIST="shows/format/list",e.SHOWS_FORMAT_NOWPLAYING="shows/format/nowplaying",e.SHOWS_FORMAT_ITEM="shows/format/item",e.SHOWS_FORMAT_SHARE="shows/format/share",e.SHOWS_AUDIO="shows/audio",e.SHOWS_RESOLVER="shows/resolver",e.SHUFFLE_TOGGLE_UPSELL="shuffle-toggle-upsell",e.REINVENTFREE_TIME_CAP_UPSELL="reinventfree-time-cap-upsell",e.REINVENTFREE_SKIP_LIMIT_UPSELL="reinventfree-skip-limit-upsell",e.REINVENTFREE_UPNEXT="reinventfree-upnext",e.REINVENTFREE_INDIA_EDUCATION_UPSELL="reinventfree-india-education-upsell",e.SKIP_LIMIT_PIVOT="skip-limit-pivot",e.SKIP_LIMIT_PIVOT_TRACKS="skip-limit-pivot-tracks",e.SPONSORED_RECOMMENDATION="sponsored-recommendation",e.SPOTIT="spotit",e.SPOTIT_STRONGRESULT="spotit/strongresult",e.SPOTIT_WEAKRESULT="spotit/weakresult",e.SPOTIT_ERROR="spotit/error",e.SUPPORT_HOME="support/home",e.SUPPORT_CATEGORY="support/category",e.SUPPORT_ARTICLE="support/article",e.SUPPORT_SITE_HOME="support-site/home",e.SUPPORT_SITE_CATEGORY="support-site/category",e.SUPPORT_SITE_ARTICLE="support-site/article",e.SUPPORT_SITE_CONTACT="support-site/contact",e.SUPPORT_SITE_OLD_HOME="support-site/old/home",e.SUPPORT_SITE_OLD_ARTICLE="support-site/old/article",e.SUPPORT_SITE_OLD_CHILDCATEGORY="support-site/old/childcategory",e.SUPPORT_SITE_OLD_CONTACT="support-site/old/contact",e.WWW_ACCOUNT_PAGES_ACCOUNTSETTINGS="www-account-pages/accountsettings",e.WWW_ACCOUNT_PAGES_ACTIVATIONHUB="www-account-pages/activationhub",e.WWW_ACCOUNT_PAGES_ADDRESS="www-account-pages/address",e.WWW_ACCOUNT_PAGES_AUDIOBOOK_LISTENING_TIME="www-account-pages/audiobook-listening-time",e.WWW_ACCOUNT_PAGES_AUTHENTICATIONSETTINGS="www-account-pages/authenticationsettings",e.WWW_ACCOUNT_PAGES_AVAILABLEPLANS="www-account-pages/availableplans",e.WWW_ACCOUNT_PAGES_CANCELLATIONOFFLINE="www-account-pages/cancellationoffline",e.WWW_ACCOUNT_PAGES_COLLECT_ACCOUNT_DETAILS="www-account-pages/collect-account-details",e.WWW_ACCOUNT_PAGES_DYNAMICHERO="www-account-pages/dynamichero",e.WWW_ACCOUNT_PAGES_EMAIL_VERIFICATION="www-account-pages/email-verification",e.WWW_ACCOUNT_PAGES_FAMILYDUO="www-account-pages/familyduo",e.WWW_ACCOUNT_PAGES_HERO="www-account-pages/hero",e.WWW_ACCOUNT_PAGES_LANDING="www-account-pages/landing",e.WWW_ACCOUNT_PAGES_LOGIN_METHODS="www-account-pages/login-methods",e.WWW_ACCOUNT_PAGES_MANAGEYOURPLAN="www-account-pages/manageyourplan",e.WWW_ACCOUNT_PAGES_NOTIFICATIONS="www-account-pages/notifications",e.WWW_ACCOUNT_PAGES_ORDER_HISTORY="www-account-pages/order-history",e.WWW_ACCOUNT_PAGES_OVERVIEW="www-account-pages/overview",e.WWW_ACCOUNT_PAGES_PREMIUM_SUBSCRIPTION_MANAGEMENT_COMPONENTS="www-account-pages/premium-subscription-management-components",e.WWW_ACCOUNT_PAGES_PRICECHANGE="www-account-pages/pricechange",e.WWW_ACCOUNT_PAGES_PRIVACY="www-account-pages/privacy",e.WWW_ACCOUNT_PAGES_RECEIPTS="www-account-pages/receipts",e.WWW_ACCOUNT_PAGES_RECOVERPLAYLISTS="www-account-pages/recoverplaylists",e.WWW_ACCOUNT_PAGES_RESUBSCRIPTIONMODAL="www-account-pages/resubscriptionmodal",e.WWW_ACCOUNT_PAGES_SAMPLEINAPP="www-account-pages/sampleinapp",e.WWW_ACCOUNT_PAGES_SAVEDPAYMENTCARDS="www-account-pages/savedpaymentcards",e.WWW_ACCOUNT_PAGES_SIGNEDOUT_CANCEL_SUBSCRIPTION="www-account-pages/signedout-cancel-subscription",e.WWW_ACCOUNT_PAGES_STUDENT="www-account-pages/student",e.WWW_ACCOUNT_PAGES_UPDATEPAYMENTDETAILS="www-account-pages/updatepaymentdetails",e.WWW_ACCOUNT_PAGES_YOURPLAN="www-account-pages/yourplan",e.SHOWS_CATEGORY="shows/category",e.SHOWS_MIXED="shows/mixed",e.SHOWS_NETWORK="shows/network",e.SHOWS_VIDEO="shows/video",e.SIDEDRAWER="sidedrawer",e.SOCIAL_LISTENING_IPLONBOARDINGDIALOG="social-listening/iplonboardingdialog",e.SOCIAL_LISTENING_ENDSESSIONDIALOG="social-listening/endsessiondialog",e.SOCIAL_LISTENING_JOINCONFIRMATIONDIALOG="social-listening/joinconfirmationdialog",e.SOCIAL_LISTENING_NOTIFICATIONDIALOG="social-listening/notificationdialog",e.SOCIAL_LISTENING_PARTICIPANTLIST="social-listening/participantlist",e.SOCIAL_LISTENING_EDUCATION="social-listening/education",e.SOCIAL_LISTENING_TAPTOQUEUE="social-listening/taptoqueue",e.SOCIAL_LISTENING_SETTINGS="social-listening/settings",e.SOCIAL_LISTENING_IPLSESSIONSHARING="social-listening/iplsessionsharing",e.SIGNUP="signup",e.SOCIAL_LISTENING_SHAREOPTIONS="social-listening/shareoptions",e.SSO="sso",e.SSO_PARTNERACCOUNTLINKING="sso/partneraccountlinking",e.PARTNERACCOUNTLINKING="partneraccountlinking",e.PARTNERSCOPESCONSENT="partnerscopesconsent",e.TASTE_ONBOARDING="taste-onboarding",e.TERMS="terms",e.TERMS_TERMSOFSERVICE="terms/termsofservice",e.TERMS_TERMSOFSERVICE_REACCEPT="terms/termsofservice/reaccept",e.TERMS_TERMSINFO="terms/termsinfo",e.TERMS_PRIVACYPOLICY="terms/privacypolicy",e.TRACK_CREDITS_CREDITS="track-credits/credits",e.TRAVEL_WITH_MUSIC="travel-with-music",e.TRACK="track",e.UNKNOWN="unknown",e.UNKNOWN_LEGACYHUB="unknown/legacyhub",e.UNKNOWN_NOTLOADED="unknown/notloaded",e.UNKNOWN_UNCOVERED="unknown/uncovered",e.UPDATE_DIALOG="update-dialog",e.UPSELL="upsell",e.VIDEO_DEBUG="video/debug",e.VOICE="voice",e.VOICE_LISTENING="voice/listening",e.VOICE_ONBOARDING="voice/onboarding",e.VOICE_ALTERNATIVESEARCHRESULTS="voice/alternativesearchresults",e.VOICETIPS="voicetips",e.WATCHFEED="watchfeed",e.YOURSPOTIFY="yourspotify",e.YOURSPOTIFY_PROFILE="yourspotify/profile",e.YOURSPOTIFY_FORYOU="yourspotify/foryou",e.YOURSPOTIFY_DISCOVEREDFEATURES="yourspotify/discoveredfeatures",e.DISCOVERYFEED="discoveryfeed",e.VTEC="vtec",e.EXPRESSIVE_PLAYLISTS="expressive-playlists",e.EXPRESSIVE_PLAYLISTS_EDIT="expressive-playlists-edit",e.FREE_TIER_PLAYLIST="free-tier-playlist",e.FREE_TIER_PLAYLIST_ONDEMAND="free-tier-playlist/ondemand",e.FREE_TIER_COLLECTION="free-tier-collection",e.FREE_TIER_LIKES="free-tier-likes",e.FREE_TIER_LIKES_SONGS="free-tier-likes/songs",e.FREE_TIER_PROFILE="free-tier-profile",e.FREE_TIER_OTHER_USER_PROFILE="free-tier-other-user-profile",e.FREE_TIER_ALL_SONGS_DIALOG="free-tier-all-songs-dialog",e.FREE_TIER_EDIT_PLAYLIST="free-tier-edit-playlist",e.FREE_TIER_SEARCH_PLAYLIST="free-tier-search-playlist",e.FREE_TIER_ARTIST="free-tier-artist",e.FREE_TIER_ARTIST_SUBPAGE="free-tier-artist/subpage",e.FREE_TIER_ALBUM="free-tier-album",e.FREE_TIER_TRACK="free-tier-track",e.FREE_TIER_HOME="free-tier-home",e.FREE_TIER_HOME_DRILLDOWN="free-tier-home/drilldown",e.CATEGORIES_ONBOARDING="categories/onboarding",e.CATEGORIES_ONBOARDING_LOADING="categories/onboarding/loading",e.FREETIER_TASTEONBOARDING_LIKEDARTISTS="freetier/tasteonboarding/likedartists",e.FREETIER_TASTEONBOARDING_ARTISTPICKERCONTAINER="freetier/tasteonboarding/artistpickercontainer",e.FREETIER_TASTEONBOARDING_ARTISTPICKER="freetier/tasteonboarding/artistpicker",e.FREETIER_TASTEONBOARDING_ARTISTSEARCH="freetier/tasteonboarding/artistsearch",e.FREETIER_TASTEONBOARDING_SWIPETRACKS="freetier/tasteonboarding/swipetracks",e.FREETIER_TASTEONBOARDING_UPDATETASTE="freetier/tasteonboarding/updatetaste",e.FREETIER_TASTEONBOARDING_SKIPDIALOG="freetier/tasteonboarding/skipdialog",e.FREETIER_DATASAVER="freetier/datasaver",e.FREETIER_DATASAVER_LEARNMORE="freetier/datasaver/learnmore",e.FREETIER_DATASAVER_STATUS="freetier/datasaver/status",e.FREETIER_CHARTS_CHART="freetier/charts/chart",e.INAPPMESSAGE_MODAL="inappmessage/modal",e.INAPPMESSAGE_FULLSCREEN="inappmessage/fullscreen",e.INAPPMESSAGE_WEBVIEW="inappmessage/webview",e.INAPPMESSAGE="inappmessage",e.STATIONSPROMO="stationspromo",e.QUICKPLAY="quickplay",e.LIVESTREAMING="livestreaming",e.LIVE_ENTITY="live/entity",e.LIVE_LEGALDISCLOSURE="live/legaldisclosure",e.LIVE_AUDIO_ENTITY="live-audio/entity",e.SPOTIFLY="spotifly",e.CAREPACKAGE="carepackage",e.OURSONG_INVITE="oursong/invite",e.OURSONG_RECEIVER="oursong/receiver",e.OURSONG_SHARE="oursong/share",e.WRAPPED_DATASTORIES="wrapped/datastories",e.WRAPPED_HOME="wrapped/home",e.WRAPPED_ENTITY="wrapped/entity",e.MRKT_ARTIST_AUDIENCE="mrkt/artist/audience",e.MRKT_ARTIST_AUDIENCE_WEB_VIEW="mrkt/artist/audience-web-view",e.MRKT_ARTIST_AUDIENCE_CITIES="mrkt/artist/audience/cities",e.MRKT_ARTIST_AUDIENCE_COUNTRIES="mrkt/artist/audience/countries",e.MRKT_ARTIST_AUDIENCE_ACTIVE_AUDIENCE="mrkt/artist/audience/active-audience",e.MRKT_ARTIST_AUDIENCE_ACTIVE_AUDIENCE_NO_ARTIST_REDIRECT="mrkt/artist/audience/active-audience/no-artist-redirect",e.MRKT_ARTIST_AUDIENCE_SEGMENTS="mrkt/artist/audience/segments",e.MRKT_ARTIST_AUDIENCE_SEGMENTS_NO_ARTIST_REDIRECT="mrkt/artist/audience/segments/no-artist-redirect",e.MRKT_ARTIST_AUDIENCE_DEMOGRAPHIC="mrkt/artist/audience/demographic",e.MRKT_ARTIST_AUDIENCE_ENGAGEMENT="mrkt/artist/audience/engagement",e.MRKT_ARTIST_AUDIENCE_LOCATION="mrkt/artist/audience/location",e.MRKT_ARTIST_AUDIENCE_RELATED="mrkt/artist/audience/related",e.MRKT_ARTIST_AUDIENCE_RELEASE_ENGAGEMENT="mrkt/artist/audience/release-engagement",e.MRKT_ARTIST_AUDIENCE_SOURCE_OF_STREAMS="mrkt/artist/audience/source-of-streams",e.MRKT_ARTIST_HOME="mrkt/artist/home",e.MRKT_ARTIST_PROFILE_MERCH="mrkt/artist/profile/merch",e.MRKT_ARTIST_PROFILE_MERCH_DETAILS="mrkt/artist/profile/merch/details",e.MRKT_ARTIST_MERCH="mrkt/artist/merch",e.MRKT_ARTIST_MERCH_DETAILS="mrkt/artist/merch/details",e.MRKT_ARTIST_MERCH_NO_ARTIST_REDIRECT="mrkt/artist/merch/no-artist-redirect",e.MRKT_ARTIST_MUSIC="mrkt/artist/music",e.MRKT_ARTIST_PLAYLIST="mrkt/artist/playlist",e.MRKT_ARTIST_PLAYLISTS="mrkt/artist/playlists",e.MRKT_ARTIST_PROFILE="mrkt/artist/profile",e.MRKT_ARTIST_PROFILE_ABOUT="mrkt/artist/profile/about",e.MRKT_ARTIST_PROFILE_ABOUT_EDIT="mrkt/artist/profile/about/edit",e.MRKT_ARTIST_PROFILE_ARTISTPICK_PICK="mrkt/artist/profile/artistpick/pick",e.MRKT_ARTIST_PROFILE_ARTISTPICK_EDIT="mrkt/artist/profile/artistpick/edit",e.MRKT_ARTIST_PROFILE_AVATAR="mrkt/artist/profile/avatar",e.MRKT_ARTIST_PROFILE_AVATAR_EDIT="mrkt/artist/profile/avatar/edit",e.MRKT_ARTIST_PROFILE_CATALOG_ALBUMS="mrkt/artist/profile/catalog/albums",e.MRKT_ARTIST_PROFILE_CATALOG_RELEASE="mrkt/artist/profile/catalog/release",e.MRKT_ARTIST_PROFILE_CATALOG_SINGLES="mrkt/artist/profile/catalog/singles",e.MRKT_ARTIST_PROFILE_IMAGE_GALLERY="mrkt/artist/profile/image-gallery",e.MRKT_ARTIST_PROFILE_IMAGE_GALLERY_ADD="mrkt/artist/profile/image-gallery/add",e.MRKT_ARTIST_PROFILE_IMAGE_GALLERY_ADD_PREVIEW="mrkt/artist/profile/image-gallery/add/preview",e.MRKT_ARTIST_PROFILE_IMAGES_EDIT="mrkt/artist/profile/images/edit",e.MRKT_ARTIST_PROFILE_PLAYLISTS="mrkt/artist/profile/playlists";e.MRKT_ARTIST_PROFILE_PLAYLISTS_EDIT="mrkt/artist/profile/playlists/edit",e.MRKT_ARTIST_PROFILE_FUNDRAISING="mrkt/artist/profile/fundraising",e.MRKT_ARTIST_SONG_CITIES="mrkt/artist/song/cities",e.MRKT_ARTIST_SONG_COUNTRIES="mrkt/artist/song/countries",e.MRKT_ARTIST_SONG_LOCATION="mrkt/artist/song/location",e.MRKT_ARTIST_SONG_PLAYLIST="mrkt/artist/song/playlist",e.MRKT_ARTIST_SONG_PLAYLISTS="mrkt/artist/song/playlists",e.MRKT_ARTIST_SONG_STATS="mrkt/artist/song/stats",e.MRKT_ARTIST_SONGS="mrkt/artist/songs",e.MRKT_SUBMISSION_CREATE="mrkt/submission/create",e.MRKT_ARTIST_CAMPAIGNS="mrkt/artist/campaigns",e.MRKT_ARTIST_CAMPAIGNS_TEAM="mrkt/artist/campaigns/team",e.MRKT_ARTIST_CAMPAIGNS_PREVIEW="mrkt/artist/campaigns/preview",e.MRKT_ARTIST_CAMPAIGNS_BILLING="mrkt/artist/campaigns/billing",e.MRKT_ARTIST_CAMPAIGNS_BUDGET="mrkt/artist/campaigns/budget",e.MRKT_ARTIST_CAMPAIGNS_DRAFT="mrkt/artist/campaigns/draft",e.MRKT_ARTIST_CAMPAIGNS_REVIEW="mrkt/artist/campaigns/review",e.MRKT_ARTIST_CAMPAIGNS_SETUP="mrkt/artist/campaigns/setup",e.MRKT_ARTIST_CAMPAIGNS_SUCCESS="mrkt/artist/campaigns/success",e.MRKT_ARTIST_CAMPAIGNS_DETAIL="mrkt/artist/campaigns/detail",e.MRKT_ARTIST_CAMPAIGNS_REPORTING="mrkt/artist/campaigns/reporting",e.MRKT_ARTIST_CAMPAIGNS_OVERVIEW="mrkt/artist/campaigns/overview",e.MRKT_ARTIST_CAMPAIGNS_PITCHING="mrkt/artist/campaigns/pitching",e.MRKT_ARTIST_CAMPAIGNS_COUNTDOWN="mrkt/artist/campaigns/countdown",e.MRKT_ARTIST_CAMPAIGNS_DM="mrkt/artist/campaigns/dm",e.MRKT_ARTIST_CAMPAIGNS_DM_CREATION="mrkt/artist/campaigns/dm/creation",e.MRKT_ARTIST_CAMPAIGNS_DM_REPORT="mrkt/artist/campaigns/dm/report",e.MRKT_ARTIST_CAMPAIGNS_DM_REVIEW="mrkt/artist/campaigns/dm/review",e.MRKT_ARTIST_CAMPAIGNS_NO_ARTIST_REDIRECT="mrkt/artist/campaigns/no-artist-redirect",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE="mrkt/artist/campaigns/showcase",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_RELEASE="mrkt/artist/campaigns/showcase/release",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_TEAM="mrkt/artist/campaigns/showcase/team",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_SETUP="mrkt/artist/campaigns/showcase/setup",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_BILLING="mrkt/artist/campaigns/showcase/billing",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_REVIEW="mrkt/artist/campaigns/showcase/review",e.MRKT_ARTIST_CAMPAIGNS_SHOWCASE_SUCCESS="mrkt/artist/campaigns/showcase/success",e.MRKT_ARTIST_CAMPAIGN_ADMIN="mrkt/artist/campaign-admin",e.MRKT_CANVAS_EDIT="mrkt/canvas/edit",e.MRKT_CHARTS_OVERVIEW="mrkt/charts/overview",e.MRKT_CHARTS_VIEW="mrkt/charts/view",e.MRKT_CHARTS_ONBOARDING="mrkt/charts/onboarding",e.MRKT_DEBUG_HUBS_COMPONENT_INFO="mrkt/debug/hubs/component-info",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_OVERVIEW="mrkt/debug/hubs/component-reference/overview",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_ROWS="mrkt/debug/hubs/component-reference/rows",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_ROWS_DARK="mrkt/debug/hubs/component-reference/rows-dark",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_BUTTONS="mrkt/debug/hubs/component-reference/buttons",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_BUTTONS_DARK="mrkt/debug/hubs/component-reference/buttons-dark",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_TILES="mrkt/debug/hubs/component-reference/tiles",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_TILES_DARK="mrkt/debug/hubs/component-reference/tiles-dark",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_SECTION_HEADERS="mrkt/debug/hubs/component-reference/section-headers",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_SECTION_HEADERS_DARK="mrkt/debug/hubs/component-reference/section-headers-dark",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_PAGE_HEADERS="mrkt/debug/hubs/component-reference/page-headers",e.MRKT_DEBUG_HUBS_COMPONENT_REFERENCE_PAGE_HEADERS_DARK="mrkt/debug/hubs/component-reference/page-headers-dark",e.MRKT_DEBUG_KAIZEN_COMPONENT_REFERENCE="mrkt/debug/kaizen/component-reference",e.MRKT_DEBUG_S4P_COMPONENT_REFERENCE="mrkt/debug/s4p/component-reference",e.MRKT_DISCOVERYMODE="mrkt/discoverymode",e.MRKT_DISCOVERYMODE_CREATE="mrkt/discoverymode/create",e.MRKT_DISCOVERYMODE_EDIT="mrkt/discoverymode/edit",e.MRKT_EXPRESSION_VIDEO_WRAPPED_DASHBOARD="mrkt/expression-video/wrapped-dashboard",e.MRKT_EXPRESSION_VIDEO_DASHBOARD="mrkt/expression-video/dashboard",e.MRKT_EXPRESSION_VIDEO_DETAIL="mrkt/expression-video/detail",e.MRKT_EXPRESSION_VIDEO_FORMAT="mrkt/expression-video/format",e.MRKT_EXPRESSION_VIDEO_UPLOAD="mrkt/expression-video/upload",e.MRKT_EXPRESSION_VIDEO_YOUR_ARTIST_MESSAGE="mrkt/expression-video/your-artist-message",e.MRKT_HELP="mrkt/help",e.MRKT_LEGAL_PRIVACY_POLICY="mrkt/legal/privacy-policy",e.MRKT_LEGAL_TERMS_AND_CONDITIONS="mrkt/legal/terms-and-conditions",e.MRKT_LEGAL_THIRD_PARTY_LICENSES="mrkt/legal/third-party-licenses",e.MRKT_LOGIN="mrkt/login",e.MRKT_MOBILE_STATS_LATEST_ALBUM="mrkt/mobile-stats/latest-album",e.MRKT_MOBILE_STATS_OVERVIEW="mrkt/mobile-stats/overview",e.MRKT_REQUEST_ACCESS_MOBILE_LAUNCHER="mrkt/request-access/mobile-launcher",e.MRKT_ROSTER="mrkt/roster",e.MRKT_APP_SETTINGS="mrkt/app-settings",e.MRKT_APP_SETTINGS_SELECT_ARTIST="mrkt/app-settings/select-artist",e.MRKT_APP_SETTINGS_PUSH_NOTIFICATIONS="mrkt/app-settings/push-notifications",e.MRKT_WAITING_ROOM_HOME="mrkt/waiting-room/home",e.MRKT_WAITING_ROOM_MUSIC="mrkt/waiting-room/music",e.MRKT_WAITING_ROOM_AUDIENCE="mrkt/waiting-room/audience",e.MRKT_WAITING_ROOM_PROFILE="mrkt/waiting-room/profile",e.MRKT_WAITING_ROOM_STATS="mrkt/waiting-room/stats",e.MRKT_WELCOME="mrkt/welcome",e.MRKT_ACTIVITY="mrkt/activity",e.MRKT_ADD_TEAM="mrkt/add-team",e.MRKT_ARTIST_NMS="mrkt/artist/nms",e.MRKT_ARTIST_NMS_CREATE="mrkt/artist/nms/create",e.MRKT_ARTIST_NMS_EDIT="mrkt/artist/nms/edit",e.MRKT_ARTIST_PROFILE_CONCERTS="mrkt/artist/profile/concerts",e.MRKT_ARTIST_RELEASES="mrkt/artist/releases",e.MRKT_ARTIST_RELEASE_STATS="mrkt/artist/release/stats",e.MRKT_ARTIST_UPCOMING="mrkt/artist/upcoming",e.MRKT_CONTENT_MISMATCH="mrkt/content-mismatch",e.MRKT_DISTRIBUTOR_INVITE="mrkt/distributor-invite",e.MRKT_LABS="mrkt/labs",e.MRKT_LABS_ARTIST_HISTORY="mrkt/labs/artist-history",e.MRKT_NOT_FOUND="mrkt/not-found",e.MRKT_TEAM_ACCESS_ARTIST="mrkt/team/access/artist",e.MRKT_TEAM_ACCESS_LABEL="mrkt/team/access/label",e.MRKT_TEAM_LABEL_ARTISTS="mrkt/team/label/artists",e.MRKT_TEAM_MANAGEMENT="mrkt/team-management",e.MRKT_TEAM_MANAGEMENT_SELECT_TEAM="mrkt/team-management/select-team",e.MRKT_TEAM_MANAGEMENT_ACCEPT_INVITE="mrkt/team-management/accept-invite",e.MRKT_TEAM_MANAGEMENT_ACTIVITY="mrkt/team-management/activity",e.MRKT_TEAM_MANAGEMENT_BULK_INVITE="mrkt/team-management/bulk-invite",e.MRKT_TEAM_MANAGEMENT_DETAILS="mrkt/team-management/details",e.MRKT_TEAM_MANAGEMENT_TEAM_DETAILS="mrkt/team-management/team-details",e.MRKT_TEAM_MANAGEMENT_INVITE="mrkt/team-management/invite",e.MRKT_TEAM_MANAGEMENT_BILLING="mrkt/team-management/billing",e.MRKT_TEAM_MANAGEMENT_PAYOUTS="mrkt/team-management/payouts",e.MRKT_TEAM_SWITCHER_DEBUG_SETTINGS="mrkt/team-switcher/debug-settings",e.MRKT_USER_SETTINGS="mrkt/user-settings",e.MRKT_SONGWRITER_PROFILE="mrkt/songwriter/profile",e.MRKT_FAN_ENGAGEMENT="mrkt/fan-engagement",e.MRKT_LIVE_ARTIST_ROOM_CREATE="mrkt/live-artist-room/create",e.MRKT_LIVE_ARTIST_ROOM_EDIT="mrkt/live-artist-room/edit",e.MRKT_VIDEO="mrkt/video",e.MRKT_VIDEO_CREATE="mrkt/video/create",e.MRKT_VIDEO_EDIT="mrkt/video/edit",e.MRKT_VIDEO_WRAPPED="mrkt/video/wrapped",e.MRKT_WRAPPED="mrkt/wrapped",e.MRKT_PRE_RELEASE_CREATE="mrkt/pre-release/create",e.MRKT_PRE_RELEASE_VIDEO_CREATE="mrkt/pre-release/video/create",e.MRKT_PRE_RELEASE_EDIT="mrkt/pre-release/edit",e.MRKT_FRONTDOOR_HOME="mrkt/frontdoor/home",e.MRKT_FRONTDOOR_CLAIM="mrkt/frontdoor/claim",e.MRKT_FRONTDOOR_GET_STARTED="mrkt/frontdoor/get-started",e.MRKT_FRONTDOOR_BLOG="mrkt/frontdoor/blog",e.MRKT_FRONTDOOR_BLOG_CONTENT="mrkt/frontdoor/blog/content",e.MRKT_FRONTDOOR_PROVIDERS="mrkt/frontdoor/providers",e.MRKT_FRONTDOOR_FEATURES="mrkt/frontdoor/features",e.MRKT_FRONTDOOR_PLAYLISTING="mrkt/frontdoor/playlisting",e.MRKT_FRONTDOOR_VIDEOS="mrkt/frontdoor/videos",e.MRKT_FRONTDOOR_VIDEOS_CONTENT="mrkt/frontdoor/videos/content",e.MRKT_FRONTDOOR_MARQUEE="mrkt/frontdoor/marquee",e.MRKT_FRONTDOOR_MERCH="mrkt/frontdoor/merch",e.MRKT_FRONTDOOR_STREAM_ON="mrkt/frontdoor/stream-on",e.MRKT_FRONTDOOR_YOUR_WRAPPED="mrkt/frontdoor/your-wrapped",e.MRKT_FRONTDOOR_GET_READY_FOR_WRAPPED="mrkt/frontdoor/get-ready-for-wrapped",e.MRKT_FRONTDOOR_CAMPAIGN_KIT="mrkt/frontdoor/campaign-kit",e.MRKT_FRONTDOOR_ANALYTICS="mrkt/frontdoor/analytics",e.MRKT_FRONTDOOR_EVENTS="mrkt/frontdoor/events",e.MRKT_FRONTDOOR_DISCOVERY_MODE="mrkt/frontdoor/discovery-mode",e.MRKT_FRONTDOOR_UNKNOWN="mrkt/frontdoor/unknown",e.S4P_HOME="s4p/home",e.S4P_WEB_VIEW_HOW_TO_GROW_AN_AUDIENCE="s4p/web-view/how-to-grow-an-audience",e.S4P_PODCAST_EPISODE="s4p/podcast/episode",e.S4P_PODCAST_EPISODE_ADDITIONAL_DETAILS="s4p/podcast/episode/additional-details",e.S4P_PODCAST_EPISODE_ALL="s4p/podcast/episode/all",e.S4P_PODCAST_EPISODE_OPTIONS="s4p/podcast/episode/options",e.S4P_ANALYTICS="s4p/analytics",e.S4P_ANALYTICS_IMPRESSIONS="s4p/analytics/impressions",e.S4P_SHOWS_RECENT="s4p/shows/recent",e.S4P_SHOWS_ALL="s4p/shows/all",e.S4P_SETTINGS="s4p/settings",e.S4P_SETTINGS_EMAIL_NOTIFICATION="s4p/settings/email-notification",e.S4P_SETTINGS_PODCAST="s4p/settings/podcast",e.S4P_SETTINGS_PODCAST_PROFILE="s4p/settings/podcast/profile",e.S4P_SETTINGS_PUSH_NOTIFICATION="s4p/settings/push-notification",e.S4P_SETTINGS_THEME="s4p/settings/theme",e.S4P_SETUP_SHOW_ZERO_STATE="s4p/setup-show/zero-state",e.S4P_SETUP_SHOW_TABLE_OF_CONTENTS="s4p/setup-show/table-of-contents",e.S4P_SETUP_SHOW_NAME="s4p/setup-show/name",e.S4P_SETUP_SHOW_DESCRIPTION="s4p/setup-show/description",e.S4P_SETUP_SHOW_AUTHOR="s4p/setup-show/author",e.S4P_SETUP_SHOW_CATEGORY_LANGUAGE="s4p/setup-show/category-language",e.S4P_SETUP_SHOW_COVER_ART="s4p/setup-show/cover-art",e.S4P_SETUP_SHOW_CROP_COVER_ART="s4p/setup-show/crop-cover-art",e.S4P_SETUP_SHOW_SUMMARY="s4p/setup-show/summary",e.S4P_SETUP_SHOW_DONE="s4p/setup-show/done",e.S4P_LOGIN="s4p/login",e.S4P_EPISODES_SELECT="s4p/episodes/select",e.S4P_EPISODES_SELECT_POLL="s4p/episodes/select/poll",e.S4P_EPISODES_SELECT_QNA="s4p/episodes/select/qna",e.S4P_BLOCKED_USERS="s4p/blocked-users",e.S4P_QNA_RESPONSES="s4p/qna-responses",e.S4P_INTERACT="s4p/interact",e.S4P_INTERACT_SETTINGS="s4p/interact/settings",e.S4P_POLL_EDIT="s4p/poll/edit",e.S4P_QNA_EDIT="s4p/qna/edit",e.S4P_CREATION_AUDIO_TRIMMER="s4p/creation/audio-trimmer",e.S4P_CREATION_ENTRY="s4p/creation/entry",e.S4P_CREATION_IMPORT="s4p/creation/import",e.S4P_SHARING_SHARE="s4p/sharing/share",e.S4P_CREATION_RECORDER="s4p/creation/recorder",e.S4P_CREATION_RECORDING_TERMS="s4p/creation/recording-terms",e.S4P_DEBUG_MENU="s4p/debug/menu",e.S4P_DEBUG_EXPERIMENTS="s4p/debug/experiments",e.S4P_DEBUG_CONSOLE_LOGGER="s4p/debug/console-logger",e.S4P_DEBUG_KAIZEN_COMPONENTS="s4p/debug/kaizen-components",e.S4P_DEBUG_S4P_COMPONENTS="s4p/debug/s4p-components",e.S4P_DEBUG_TEST_ACCOUNT_SWITCHER="s4p/debug/test-account-switcher",e.SOULSEEKER_SIMILAR_PROFILES="soulseeker-similar-profiles",e.SOULSEEKER_PROFILE_TRACKS="soulseeker-profile-tracks",e.PODCASTMIX_ENTITY="podcastmix/entity",e.PODCASTMIX_CONTROLS="podcastmix/controls",e.PODCASTMIX_CONTROLS_TOPICS="podcastmix/controls/topics",e.PODCASTMIX_CONTROLS_SHOWS="podcastmix/controls/shows",e.PODCASTMIX_CONTROLS_MUSIC="podcastmix/controls/music",e.TOPIC="topic",e.THESTAGE="thestage",e.USERPLAYLISTRESOLVER="userplaylistresolver",e.GENRE="genre",e.FORCEUPGRADE="forceupgrade",e.IMAGE_PICKER="image-picker",e.SUPERBIRD_SETUP_WELCOME="superbird/setup/welcome",e.SUPERBIRD_SETUP_BLUETOOTHCONNECT="superbird/setup/bluetoothconnect",e.SUPERBIRD_SETUP_BLUETOOTHSETTINGS="superbird/setup/bluetoothsettings",e.SUPERBIRD_SETUP_SEARCHING="superbird/setup/searching",e.SUPERBIRD_SETUP_CONNECTED="superbird/setup/connected",e.SUPERBIRD_SETUP_CHECKFORUPDATES="superbird/setup/checkforupdates",e.SUPERBIRD_SETUP_CONNECTTOCAR="superbird/setup/connecttocar",e.SUPERBIRD_SETUP_CONNECTTOWIFI="superbird/setup/connecttowifi",e.SUPERBIRD_SETUP_DOWNLOADED="superbird/setup/downloaded",e.SUPERBIRD_SETUP_DOWNLOADING="superbird/setup/downloading",e.SUPERBIRD_SETUP_EVERYTHINGCONNECTED="superbird/setup/everythingconnected",e.SUPERBIRD_SETUP_READY="superbird/setup/ready",e.SUPERBIRD_SETUP_RECONNECTING="superbird/setup/reconnecting",e.SUPERBIRD_SETUP_TESTSOUND="superbird/setup/testsound",e.SUPERBIRD_SETUP_MOUNTSELECTION="superbird/setup/mountselection",e.SUPERBIRD_SETUP_MOUNTINSTRUCTIONS="superbird/setup/mountinstructions",e.SUPERBIRD_SETUP_CONTROLOTHERMEDIA="superbird/setup/controlothermedia",e.SUPERBIRD_SETUP_CONTROLOTHERMEDIADECLINED="superbird/setup/controlothermediadeclined",e.SPOTIFYBUTTON_ACTIVATION_WELCOME="spotifybutton/activation/welcome",e.SPOTIFYBUTTON_ACTIVATION_DEVICESCANNING="spotifybutton/activation/devicescanning",e.SPOTIFYBUTTON_ACTIVATION_SETUP="spotifybutton/activation/setup",e.SPOTIFYBUTTON_ACTIVATION_READY="spotifybutton/activation/ready",e.IRONCHEF_ENTITY="ironchef/entity",e.IRONCHEF_PREVIEWSONGS="ironchef/previewsongs",e.IRONCHEF_CHOOSEKIND="ironchef/choosekind",e.IRONCHEF_CREATE="ironchef/create",e.IRONCHEF_EDIT="ironchef/edit",e.IRONCHEF_SEARCH="ironchef/search",e.IRONCHEF_NAMING="ironchef/naming",e.ENDLESS_FEED="endless-feed",e.HIFI_ONBOARDING="hifi/onboarding",e.HIFI_SESSION_INFO="hifi/session-info",e.HIFI_TOGGLE="hifi/toggle",e.HARMONYPLAYER_NPV="harmonyplayer/npv",e.HARMONYPLAYER_PLAYLISTS="harmonyplayer/playlists",e.CAMPAIGNS_DATASTORIES="campaigns/datastories",e.PUFFIN_AUTODETECT="puffin/autodetect",e.PUFFIN_MANUAL_SELECT="puffin/manual-select",e.PUFFIN_MANUAL_SELECT_REDUCED="puffin/manual-select-reduced",e.PUFFIN_MANAGEMENT="puffin/management",e.PUFFIN_ONBOARDING="puffin/onboarding",e.PUFFIN_PIGEON_ONBOARDING="puffin/pigeon-onboarding",e.PUFFIN_CLOUD="puffin/cloud",e.SHARECARD_PLAYLIST="sharecard/playlist",e.GUILTYPLEASURE_LIST="guiltypleasure/list",e.WEB3_NFTSHOWCASEGRID="web3/nftshowcasegrid",e.WEB3_NFTSHOWCASEPREVIEW="web3/nftshowcasepreview",e.WEB3_TOKENENABLED_PLAYLIST="web3/tokenenabled/playlist",e.MANAGE_TEAMS_PAGE="manage/teams-page",e.READALONG="readalong",e.READALONG_FULLSCREEN="readalong/fullscreen",e.ADSTUDIO_DASHBOARD_CAMPAIGNS="adstudio/dashboard/campaigns",e.ADSTUDIO_DASHBOARD_CAMPAIGN_DRAFTS="adstudio/dashboard/campaign-drafts",e.ADSTUDIO_DASHBOARD_AD_SETS="adstudio/dashboard/ad-sets",e.ADSTUDIO_DASHBOARD_AD_SET_DRAFTS="adstudio/dashboard/ad-set-drafts",e.ADSTUDIO_DASHBOARD_ADS="adstudio/dashboard/ads",e.ADSTUDIO_DASHBOARD_AD_DRAFTS="adstudio/dashboard/ad-drafts",e.ADSTUDIO_ASSET_LIBRARY="adstudio/asset-library",e.ADSTUDIO_USER_SETTINGS="adstudio/user-settings",e.ADSTUDIO_ACCOUNT_MANAGEMENT="adstudio/account-management",e.ADSTUDIO_AD_ACCOUNTS="adstudio/ad-accounts",e.ADSTUDIO_ACCOUNT_DETAILS="adstudio/account-details",e.ADSTUDIO_BILLING_CENTER="adstudio/billing-center",e.ADSTUDIO_ACCOUNT_SETTINGS="adstudio/account-settings",e.ADSTUDIO_PIXELS="adstudio/pixels",e.ADSTUDIO_APPS="adstudio/apps",e.ADSTUDIO_AD_SET_REPORT="adstudio/ad-set/report",e.ADSTUDIO_AD_SET_DETAILS="adstudio/ad-set/details",e.ADSTUDIO_AD_SET_ADS="adstudio/ad-set/ads",e.ADSTUDIO_AD_DETAILS="adstudio/ad/details",e.ADSTUDIO_AD_REPORT="adstudio/ad/report",e.ADSTUDIO_AD_AD_SETS="adstudio/ad/ad-sets",e.ADSTUDIO_COLD_START_CAMPAIGN="adstudio/cold-start/campaign",e.ADSTUDIO_COLD_START_AD_SET="adstudio/cold-start/ad-set",e.ADSTUDIO_COLD_START_AD="adstudio/cold-start/ad",e.ADSTUDIO_COLD_START_REVIEW_AND_SUBMIT="adstudio/cold-start/review-and-submit",e.ADSTUDIO_EDIT_CAMPAIGN="adstudio/edit/campaign",e.ADSTUDIO_EDIT_AD_SET="adstudio/edit/ad-set",e.ADSTUDIO_EDIT_AD="adstudio/edit/ad",e.ADSTUDIO_ADD_TO_EXISTING_CAMPAIGN_AD_SET="adstudio/add-to-existing-campaign/ad-set",e.ADSTUDIO_ADD_TO_EXISTING_CAMPAIGN_AD="adstudio/add-to-existing-campaign/ad",e.ADSTUDIO_ADD_TO_EXISTING_CAMPAIGN_REVIEW_AND_SUBMIT="adstudio/add-to-existing-campaign/review-and-submit",e.ADSTUDIO_ADD_TO_EXISTING_AD_SET_AD="adstudio/add-to-existing-ad-set/ad",e.ADSTUDIO_ADD_TO_EXISTING_AD_SET_REVIEW_AND_SUBMIT="adstudio/add-to-existing-ad-set/review-and-submit",e.ADSTUDIO_DUPLICATE_AD_SET_WITH_ADS_AD_SET="adstudio/duplicate-ad-set-with-ads/ad-set",e.ADSTUDIO_DUPLICATE_AD_SET_WITH_ADS_AD="adstudio/duplicate-ad-set-with-ads/ad",e.ADSTUDIO_DUPLICATE_AD_SET_WITH_ADS_REVIEW_AND_SUBMIT="adstudio/duplicate-ad-set-with-ads/review-and-submit",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_AD_SET="adstudio/duplicate-ad-set-only/ad-set",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_AD="adstudio/duplicate-ad-set-only/ad",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_REVIEW_AND_SUBMIT="adstudio/duplicate-ad-set-only/review-and-submit",e.ADSTUDIO_DUPLICATE_AD_AD="adstudio/duplicate-ad/ad",e.YOUR_SOUND="your-sound",e.EPISODECHAPTERS_NPV="episodechapters/npv",e.EPISODECHAPTERS_NPV_FULLSCREEN="episodechapters/npv/fullscreen",e.EPISODECHAPTERS_CONTENTS="episodechapters/contents",e.EPISODECHAPTERS_EPISODECHAPTER_CONTEXTMENU="episodechapters/episodechapter/contextmenu",e.EPISODECHAPTERS_SEARCH="episodechapters/search",e.HACKWEEK2023_SYNC_LIGHTS="hackweek2023/sync-lights",e.HACKWEEK2023_PRERELEASE_EVENT="hackweek2023/prerelease-event"}(o||(o={}))},11317:(e,t,n)=>{"use strict";n.d(t,{JM:()=>i,jy:()=>f,vU:()=>h,WN:()=>m,zJ:()=>v,g8:()=>y,wG:()=>g,g3:()=>E,YD:()=>b,ir:()=>S,KO:()=>re,HB:()=>oe,QS:()=>ie,mg:()=>de,YF:()=>pe,Ue:()=>fe,OB:()=>he,yF:()=>ge,aE:()=>_e,zO:()=>me,NZ:()=>ve,hn:()=>ye,L0:()=>Ee,dB:()=>be,nK:()=>Te,WP:()=>Se,CA:()=>Ae,Kv:()=>Oe,oi:()=>Ie,U4:()=>ne,RS:()=>Ce,_s:()=>Ne,ie:()=>Le,wj:()=>Re,Jf:()=>T,ak:()=>O,EC:()=>ue,_b:()=>le,FW:()=>I,vo:()=>C,QK:()=>N,U7:()=>_,ix:()=>L,xt:()=>R,lP:()=>P,AB:()=>k,tn:()=>w,qC:()=>M});const i={AD:"ad",ALBUM:"album",GENRE:"genre",QUEUE:"queue",APPLICATION:"application",ARTIST:"artist",ARTIST_TOPLIST:"artist-toplist",ARTIST_CONCERTS:"artist-concerts",AUDIO_FILE:"audiofile",COLLECTION:"collection",COLLECTION_ALBUM:"collection-album",COLLECTION_ARTIST:"collection-artist",COLLECTION_MISSING_ALBUM:"collection-missing-album",COLLECTION_TRACK_LIST:"collectiontracklist",CONCEPT:"concept",CONCERT:"concert",CONTEXT_GROUP:"context-group",CULTURAL_MOMENT:"cultural-moment",DAILY_MIX:"dailymix",EMPTY:"empty",EPISODE:"episode",FACEBOOK:"facebook",FOLDER:"folder",FOLLOWERS:"followers",FOLLOWING:"following",IMAGE:"image",INBOX:"inbox",INTERRUPTION:"interruption",LIBRARY:"library",LIVE:"live",ROOM:"room",EXPRESSION:"expression",LOCAL:"local",LOCAL_TRACK:"local",LOCAL_ALBUM:"local-album",LOCAL_ARTIST:"local-artist",MERCH:"merch",MERCHHUB:"merchhub",MOSAIC:"mosaic",PLAYLIST:"playlist",PLAYLIST_V2:"playlist-v2",PRERELEASE:"prerelease",PROFILE:"profile",PUBLISHED_ROOTLIST:"published-rootlist",RADIO:"radio",ROOTLIST:"rootlist",SEARCH:"search",SHOW:"show",SOCIAL_SESSION:"socialsession",SPECIAL:"special",STARRED:"starred",STATION:"station",TEMP_PLAYLIST:"temp-playlist",TOPLIST:"toplist",TRACK:"track",TRACKSET:"trackset",USER_TOPLIST:"user-toplist",USER_TOP_TRACKS:"user-top-tracks",UNKNOWN:"unknown",VIDEO:"video",MEDIA:"media",QUESTION:"question",POLL:"poll",RESPONSE:"response",COURSE:"course",LESSON:"lesson",CANVAS:"canvas"};var o,r=n(99938);!function(e){e[e.URI=0]="URI",e[e.URL=1]="URL"}(o||(o={}));const a="spotify:",s="http://play.spotify.com/",c="https://play.spotify.com/",l="http://open.spotify.com/",u="https://open.spotify.com/",d="/",p={APP:"app",FACEBOOK:"facebook",GLOBAL:"global",TOP:"top",USER:"user",CONCERTS:"concerts",HUB:"hub"};n(46758),n(2836);function f(e,t){return ce(i.ALBUM,{id:e,disc:t,hasBase62Id:!0})}function h(e,t){return ce(i.APPLICATION,{id:e,args:Array.isArray(t)?t:[]})}function m(e){return ce(i.ARTIST,{id:e,hasBase62Id:!0})}function g(e,t){return ce(i.COLLECTION,{username:e,category:t})}function _(){return ce(i.QUEUE,{})}function v(e,t){return ce(i.COLLECTION_ALBUM,{id:t,username:e,hasBase62Id:!0})}function y(e,t){return ce(i.COLLECTION_ARTIST,{id:t,username:e,hasBase62Id:!0})}function E(e){return ce(i.CONCERT,{id:e,hasBase62Id:!0})}function b(e,t,n){return ce(i.EPISODE,{id:e,context:t?le(t):null,play:n,hasBase62Id:!0})}function S(e,t){return ce(i.FOLDER,{id:t,username:e,hasBase62Id:!0})}function A(e,t,n,o){return ce(i.LOCAL_TRACK,{artist:e,album:t,track:n,duration:o})}function T(e,t){return ce(i.LOCAL_ALBUM,{artist:e,album:t})}function O(e){return ce(i.LOCAL_ARTIST,{artist:e})}function I(e){return ce(i.PLAYLIST_V2,{id:e,hasBase62Id:!0})}function C(e){return ce(i.PRERELEASE,{id:e,hasBase62Id:!0})}function N(e,t){return ce(i.PROFILE,{username:e,args:null!=t?t:[]})}function L(e){return ce(i.SEARCH,{query:e})}function R(e){return ce(i.SHOW,{id:e,hasBase62Id:!0})}function P(e){return ce(i.SOCIAL_SESSION,{id:e,hasBase62Id:!0})}function k(e){return ce(i.STATION,{args:null!=e?e:[]})}function D(e,t,n){return ce(i.TOPLIST,{toplist:e,country:t,global:Boolean(n)})}function w(e,t,n,o){return ce(i.TRACK,{id:e,anchor:t,context:n?le(n):null,play:o,hasBase62Id:!0})}function M(e,t){return ce(i.USER_TOPLIST,{username:e,toplist:t})}function x(e,t){if(!e)return"";let n=encodeURIComponent(e);return t===o.URI&&(n=n.replace(/%20/g,"+")),n=n.replace(/[!'()]/g,escape),n=n.replace(/\*/g,"%2A"),n}function U(e,t,n=[]){for(let i=0,o=e.length;i1&&(t+="&");const i=e[n];void 0!==i&&(t+=`${n}=${encodeURIComponent(i)}`)}return t}const B=/^intl-[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$/;const H=()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]},[G,K]=H();G(i.PLAYLIST,((e,t,{username:n})=>function(e,t){return ce(i.PLAYLIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getBase62IdComponent()))),G(i.FOLDER,((e,t,{username:n})=>S(n,e.getIdComponent()))),G(i.COLLECTION_TRACK_LIST,((e,t,{username:n})=>function(e,t){return ce(i.COLLECTION_TRACK_LIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),G(i.COLLECTION,((e,t,{username:n})=>{const o=e.getNextComponent();if(o===i.ALBUM){const t=e.getIdComponent();return"missing"===e.getNextComponent()?function(e,t){return ce(i.COLLECTION_MISSING_ALBUM,{id:t,username:e,hasBase62Id:!0})}(n,t):v(n,t)}return o===i.ARTIST?y(n,e.getIdComponent()):g(n,o)})),G(i.STARRED,((e,t,{username:n})=>function(e){return ce(i.STARRED,{username:e})}(n))),G(i.FOLLOWERS,((e,t,{username:n})=>function(e){return ce(i.FOLLOWERS,{username:e})}(n))),G(i.FOLLOWING,((e,t,{username:n})=>function(e){return ce(i.FOLLOWING,{username:e})}(n))),G(p.TOP,((e,t,{username:n})=>M(n,e.getNextRequiredComponent()))),G(i.INBOX,((e,t,{username:n})=>function(e){return ce(i.INBOX,{username:e})}(n))),G(i.ROOTLIST,((e,t,{username:n})=>function(e){return ce(i.ROOTLIST,{username:e})}(n))),G(i.PUBLISHED_ROOTLIST,((e,t,{username:n})=>function(e){return ce(i.PUBLISHED_ROOTLIST,{username:e})}(n))),G(i.TOPLIST,((e,t,{username:n})=>function(e){return ce(i.USER_TOP_TRACKS,{username:e})}(n))),G(i.LIBRARY,((e,t,{username:n})=>function(e,t){return ce(i.LIBRARY,{username:e,category:t})}(n,e.getNextComponent())));const[W,Y]=H();function j(e){let t,n,i,r,p=e;const[f,h]=p.split("?");if(f&&h){p=f;const[e,t]=h.split("#");e&&(i=function(e){return e.split("&").reduce(((e,t)=>{const[n,i]=t.split("=");return n&&i&&(e[n]=decodeURIComponent(i)),e}),{})}(e),r=t)}const m=p.split("#");if(m.length>1&&(p=m.shift(),r=m.pop()),0===p.indexOf(a))t=p.slice(a.length).split(":"),n=o.URI;else{const[e]=p.split("?");if(0===(null==e?void 0:e.indexOf(s)))t=e.slice(s.length).split("/");else if(0===(null==e?void 0:e.indexOf(c)))t=e.slice(c.length).split("/");else if(0===(null==e?void 0:e.indexOf(l)))t=e.slice(l.length).split("/");else if(0===(null==e?void 0:e.indexOf(u)))t=e.slice(u.length).split("/");else{if(0!==(null==e?void 0:e.indexOf(d)))throw new TypeError("Invalid Spotify URI!");t=e.slice(d.length).split("/")}n=o.URL}return r&&t.push(r),{format:n,components:t,query:i}}function z(e,t,n,r){let a=0;const s=()=>{const t=e[a++];if(t&&/\s/.test(t))throw new TypeError("Invalid Spotify URI!");return t},c=()=>{const e=s();if(!e)throw new TypeError("Invalid Spotify URI!");return e},l={getAllComponents:()=>e,getQueryParams:()=>n,getNextComponent:s,getNextRequiredComponent:c,getIdComponent:()=>{const e=c();if(e.length>22)throw new TypeError("Invalid Spotify URI!");return e},getHexIdComponent:e=>{const t=c();if(t.length!==e)throw new TypeError("Invalid Spotify URI!");if(!/^[a-fA-F0-9]+$/.test(t))throw new Error("Invalid Hex ID");return t},getBase62IdComponent:()=>{const e=c();if(22!==e.length)throw new TypeError("Invalid Spotify URI!");if(!/^[a-zA-Z0-9]+$/.test(e))throw new Error("Invalid ID");return e},getRemainingComponents:()=>e.slice(a),getRemainingString:()=>{const n=t===o.URI?":":"/";return e.slice(a).join(n)}};let u=c(),d=Y[u];if(!d){const e=function(e){return B.test(e)}(u);e&&(u=c(),d=Y[u])}if(d)return d(l,t,{});if(r)return Y[i.UNKNOWN](l,t,{});throw new TypeError("Invalid or unknown Spotify URI!")}W(i.ALBUM,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return f(t,n?parseInt(n,10):void 0)})),W(p.APP,((e,t)=>{const n=e.getNextRequiredComponent();if(x(V(n,t),t)!==n)throw new TypeError("Invalid or unknown Spotify URI!");const i=e.getRemainingComponents();for(let e=0,n=i.length;e{return t=e.getNextRequiredComponent(),ce(i.AD,{id:t});var t})),W(i.ARTIST,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return n===p.TOP?function(e,t){return ce(i.ARTIST_TOPLIST,{id:e,toplist:t,hasBase62Id:!0})}(t,e.getNextRequiredComponent()):n===p.CONCERTS?function(e){return ce(i.ARTIST_CONCERTS,{id:e,hasBase62Id:!0})}(t):m(t)})),W(i.AUDIO_FILE,(e=>{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),ce(i.AUDIO_FILE,{id:n,extension:t});var t,n})),W(i.DAILY_MIX,(e=>{return t=e.getIdComponent(),ce(i.DAILY_MIX,{id:t,hasBase62Id:!0});var t})),W(i.TEMP_PLAYLIST,(e=>{return t=e.getNextRequiredComponent(),n=e.getRemainingString(),ce(i.TEMP_PLAYLIST,{origin:t,data:n});var t,n})),W(i.PLAYLIST,(e=>I(e.getBase62IdComponent()))),W(i.SEARCH,((e,t)=>L(V(e.getRemainingString(),t)))),W(i.TRACK,(e=>{const t=e.getQueryParams();return w(e.getBase62IdComponent(),e.getNextComponent(),null==t?void 0:t.context,null==t?void 0:t.play)})),W(i.TRACKSET,(e=>{var t;const n=V(e.getNextComponent());let o=e.getNextRequiredComponent();const r=e.getNextComponent();let a=parseInt(null!==(t=e.getNextComponent())&&void 0!==t?t:"",10);("%23"!==r||isNaN(a))&&(a=null);const s=[];if(o){o=V(o).split(",");for(let e=0,t=o.length;e{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),ce(i.CONTEXT_GROUP,{origin:t,name:n,hasBase62Id:!0});var t,n})),W(p.TOP,(e=>{const t=e.getNextRequiredComponent();return e.getNextComponent()===p.GLOBAL?D(t,void 0,!0):D(t,e.getNextComponent(),!1)})),W(i.LOCAL_TRACK,((e,t)=>{const n=V(e.getNextComponent(),t),i=e.getNextComponent(),o=V(i,t),r=e.getNextComponent(),a=V(r,t),s=e.getNextComponent(),c=s?parseInt(s,10):void 0;return void 0!==r?A(n,o,a,c):void 0!==i?T(n,o):O(n)})),W(i.IMAGE,(e=>{return t=e.getHexIdComponent(40),ce(i.IMAGE,{id:t});var t})),W(i.MOSAIC,(e=>{return t=e.getRemainingComponents(),ce(i.MOSAIC,{ids:t});var t})),W(i.RADIO,(e=>{return t=e.getRemainingString(),ce(i.RADIO,{args:null!=t?t:""});var t})),W(i.SPECIAL,((e,t)=>{const n=e.getRemainingComponents();for(let e=0,i=n.length;ek(e.getRemainingComponents()))),W(i.EPISODE,(e=>{const t=e.getQueryParams();return b(e.getBase62IdComponent(),null==t?void 0:t.context,null==t?void 0:t.play)})),W(i.SHOW,(e=>R(e.getBase62IdComponent()))),W(i.LIVE,(e=>{return t=e.getIdComponent(),ce(i.LIVE,{id:t,hasBase62Id:!0});var t})),W(i.ROOM,(e=>{return t=e.getIdComponent(),ce(i.ROOM,{id:t,hasBase62Id:!0});var t})),W(i.EXPRESSION,(e=>{return t=e.getIdComponent(),ce(i.EXPRESSION,{id:t,hasBase62Id:!0});var t})),W(i.CONCEPT,(e=>{return t=e.getIdComponent(),ce(i.CONCEPT,{id:t,hasBase62Id:!0});var t})),W(i.CONCERT,(e=>E(e.getIdComponent()))),W(i.MERCH,(e=>{return t=e.getIdComponent(),ce(i.MERCH,{id:t,hasBase62Id:!0});var t})),W(i.MERCHHUB,(()=>ce(i.MERCHHUB,{}))),W(i.PRERELEASE,(e=>C(e.getIdComponent()))),W(i.SOCIAL_SESSION,(e=>P(e.getNextRequiredComponent()))),W(i.INTERRUPTION,(e=>{return t=e.getNextRequiredComponent(),ce(i.INTERRUPTION,{id:t});var t})),W(i.COLLECTION,(e=>g(void 0,e.getNextComponent()))),W(i.GENRE,(e=>{return t=e.getNextRequiredComponent(),ce(i.GENRE,{genre:t});var t})),W(i.QUEUE,(()=>_())),W(p.USER,((e,t)=>{const n=V(e.getNextRequiredComponent(),t),o=e.getNextComponent();if(n===i.FACEBOOK&&o)return r=o,ce(i.FACEBOOK,{uid:r});if(o&&K[o]){const i=K[o];if(!i)throw new TypeError("Invalid Spotify URI!");return i(e,t,{username:n})}var r;const a=e.getRemainingComponents();return N(n,o?[o].concat(a):void 0)})),W(i.UNKNOWN,(e=>function(e){return ce(i.UNKNOWN,{args:null!=e?e:[]})}(e.getAllComponents()))),W(i.MEDIA,(e=>{return t=e.getIdComponent(),ce(i.MEDIA,{id:t,hasBase62Id:!0});var t})),W(i.POLL,(e=>{return t=e.getIdComponent(),ce(i.POLL,{id:t,hasBase62Id:!0});var t})),W(i.QUESTION,(e=>{return t=e.getIdComponent(),ce(i.QUESTION,{id:t,hasBase62Id:!0});var t})),W(i.RESPONSE,(e=>{return t=e.getIdComponent(),ce(i.RESPONSE,{id:t,hasBase62Id:!0});var t})),W(i.CULTURAL_MOMENT,(e=>{if(e.getNextComponent()!==p.HUB)throw new TypeError("Invalid or unknown Spotify URI!");return t=e.getIdComponent(),ce(i.CULTURAL_MOMENT,{id:t});var t})),W(i.VIDEO,(e=>{return t=e.getIdComponent(),ce(i.VIDEO,{id:t,hasBase62Id:!0});var t})),W(i.CANVAS,(e=>{return t=e.getIdComponent(),ce(i.CANVAS,{id:t,hasBase62Id:!0});var t})),W(i.COURSE,(e=>{return t=e.getIdComponent(),ce(i.COURSE,{id:t,hasBase62Id:!0});var t})),W(i.LESSON,(e=>{return t=e.getIdComponent(),ce(i.LESSON,{id:t,hasBase62Id:!0});var t}));const[J,q]=(()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]})();function X(e,t){const n=q[e.type];if(!n)throw new TypeError("Invalid Spotify URI!");return n(e,t)}J(i.ALBUM,(e=>{const t=[i.ALBUM,e.id];return e.disc&&t.push(e.disc),t})),J(i.AD,(e=>[i.AD,e.id])),J(i.ARTIST,(e=>[i.ARTIST,e.id])),J(i.QUEUE,(()=>[i.QUEUE])),J(i.GENRE,(e=>[i.GENRE,e.genre])),J(i.ARTIST_TOPLIST,(e=>[i.ARTIST,e.id,p.TOP,e.toplist])),J(i.ARTIST_CONCERTS,(e=>[i.ARTIST,e.id,p.CONCERTS])),J(i.DAILY_MIX,(e=>[i.DAILY_MIX,e.id])),J(i.SEARCH,((e,t)=>[i.SEARCH,x(e.query,t)])),J(i.TRACK,(e=>{let t=e.id;return(e.context||e.play)&&(t+=F({context:e.context,play:e.play})),e.anchor&&(t+=`#${e.anchor}`),[i.TRACK,t]})),J(i.TRACKSET,(e=>{let t=[];if(e.tracks)for(let n=0,i=e.tracks.length;n[p.USER,i.FACEBOOK,e.uid])),J(i.AUDIO_FILE,(e=>[i.AUDIO_FILE,e.extension,e.id])),J(i.FOLDER,((e,t)=>[p.USER,x(e.username,t),i.FOLDER,e.id])),J(i.FOLLOWERS,((e,t)=>[p.USER,x(e.username,t),i.FOLLOWERS])),J(i.FOLLOWING,((e,t)=>[p.USER,x(e.username,t),i.FOLLOWING])),J(i.PLAYLIST,((e,t)=>[p.USER,x(e.username,t),i.PLAYLIST,e.id])),J(i.PLAYLIST_V2,(e=>[i.PLAYLIST,e.id])),J(i.STARRED,((e,t)=>[p.USER,x(e.username,t),i.STARRED])),J(i.TEMP_PLAYLIST,(e=>[i.TEMP_PLAYLIST,e.origin,e.data])),J(i.CONTEXT_GROUP,(e=>[i.CONTEXT_GROUP,e.origin,e.name])),J(i.USER_TOPLIST,((e,t)=>[p.USER,x(e.username,t),p.TOP,e.toplist])),J(i.USER_TOP_TRACKS,((e,t)=>[p.USER,x(e.username,t),i.TOPLIST])),J(i.TOPLIST,(e=>[p.TOP,e.toplist].concat(e.global||!e.country?[p.GLOBAL]:["country",e.country]))),J(i.INBOX,((e,t)=>[p.USER,x(e.username,t),i.INBOX])),J(i.ROOTLIST,((e,t)=>[p.USER,x(e.username,t),i.ROOTLIST])),J(i.PUBLISHED_ROOTLIST,((e,t)=>[p.USER,x(e.username,t),i.PUBLISHED_ROOTLIST])),J(i.COLLECTION_TRACK_LIST,((e,t)=>[p.USER,x(e.username,t),i.COLLECTION_TRACK_LIST,e.id])),J(i.PROFILE,((e,t)=>e.args&&e.args.length>0?[p.USER,x(e.username,t)].concat(e.args):[p.USER,x(e.username,t)])),J(i.LOCAL_ARTIST,((e,t)=>[i.LOCAL_TRACK,x(e.artist,t)])),J(i.LOCAL_ALBUM,((e,t)=>[i.LOCAL_TRACK,x(e.artist,t),x(e.album,t)])),J(i.LOCAL_TRACK,((e,t)=>[i.LOCAL_TRACK,x(e.artist,t),x(e.album,t),x(e.track,t),e.duration])),J(i.LIBRARY,((e,t)=>[p.USER,x(e.username,t),i.LIBRARY].concat(e.category?[e.category]:[]))),J(i.IMAGE,(e=>[i.IMAGE,e.id])),J(i.MOSAIC,(e=>{let t=[];return e.ids&&(t=e.ids.slice(0)),t.unshift(i.MOSAIC),t})),J(i.RADIO,((e,t)=>U(e.args,t,[i.RADIO]))),J(i.SPECIAL,((e,t)=>U(e.args,t,[i.SPECIAL]))),J(i.STATION,((e,t)=>U(e.args,t,[i.STATION]))),J(i.APPLICATION,((e,t)=>U(e.args,t,[p.APP,e.id]))),J(i.COLLECTION_ALBUM,((e,t)=>[p.USER,x(e.username,t),i.COLLECTION,i.ALBUM,e.id])),J(i.COLLECTION_MISSING_ALBUM,((e,t)=>[p.USER,x(e.username,t),i.COLLECTION,i.ALBUM,e.id,"missing"])),J(i.COLLECTION_ARTIST,((e,t)=>[p.USER,x(e.username,t),i.COLLECTION,i.ARTIST,e.id])),J(i.COLLECTION,((e,t)=>{const n=[i.COLLECTION].concat(e.category?[e.category]:[]);return e.username?[p.USER,x(e.username,t)].concat(n):n})),J(i.EPISODE,(e=>{let t=e.id;return(e.context||e.play)&&(t+=F({context:e.context,play:e.play})),[i.EPISODE,t]})),J(i.SHOW,(e=>[i.SHOW,e.id])),J(i.LIVE,(e=>[i.LIVE,e.id])),J(i.ROOM,(e=>[i.ROOM,e.id])),J(i.EXPRESSION,(e=>[i.EXPRESSION,e.id])),J(i.CONCEPT,(e=>[i.CONCEPT,e.id])),J(i.CONCERT,(e=>[i.CONCERT,e.id])),J(i.SOCIAL_SESSION,(e=>[i.SOCIAL_SESSION,e.id])),J(i.INTERRUPTION,(e=>[i.INTERRUPTION,e.id])),J(i.MERCH,(e=>[i.MERCH,e.id])),J(i.MERCHHUB,(()=>[i.MERCHHUB])),J(i.PRERELEASE,(e=>[i.PRERELEASE,e.id])),J(i.UNKNOWN,((e,t)=>U(e.args,t))),J(i.MEDIA,(e=>[i.MEDIA,e.id])),J(i.POLL,(e=>[i.POLL,e.id])),J(i.QUESTION,(e=>[i.QUESTION,e.id])),J(i.RESPONSE,(e=>[i.RESPONSE,e.id])),J(i.CULTURAL_MOMENT,(e=>[i.CULTURAL_MOMENT,p.HUB,e.id])),J(i.VIDEO,(e=>[i.VIDEO,e.id])),J(i.CANVAS,(e=>[i.CANVAS,e.id])),J(i.COURSE,(e=>[i.COURSE,e.id])),J(i.LESSON,(e=>[i.LESSON,e.id]));const Z="0123456789abcdef",Q="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",$=[];$.length=256;for(let e=0;e<256;e++)$[e]=Z[e>>4]+Z[15&e];const ee=[];ee.length=128;for(let e=0;e>>24]+$[s>>>16&255]+$[s>>>8&255]+$[255&s]+$[a>>>24]+$[a>>>16&255]+$[a>>>8&255]+$[255&a]+$[r>>>24]+$[r>>>16&255]+$[r>>>8&255]+$[255&r]+$[o>>>24]+$[o>>>16&255]+$[o>>>8&255]+$[255&o]}(e):e}function oe(e){return 32===e.length?function(e){let t,n=0,i=0,o=0;for(t=0;t<10;t++)o=16*o+te[e.charCodeAt(t)];for(t=0;t<11;t++)i=16*i+te[e.charCodeAt(t+10)];for(t=0;t<11;t++)n=16*n+te[e.charCodeAt(t+21)];if(isNaN(n+i+o))return null;const r=17592186044416,a=1/62;let s,c="";for(t=0;t<7;++t)s=o,o=Math.floor(s*a),s=(s-62*o)*r+i,i=Math.floor(s*a),s=(s-62*i)*r+n,n=Math.floor(s*a),c=Q[s-62*n]+c;for(i+=o*r;t<15;++t)s=i,i=Math.floor(s*a),s=(s-62*i)*r+n,n=Math.floor(s*a),c=Q[s-62*n]+c;for(n+=i*r;t<21;++t)s=n,n=Math.floor(s*a),c=Q[s-62*n]+c;return Q[n]+c}(e):e}function re(e){return V(e,o.URI)}const ae="function"==typeof Object.assign?(e,t)=>{Object.assign(e,t)}:(e,t)=>{for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};class se{constructor(e,t={}){this.type=e,this.hasBase62Id=!!t.hasBase62Id,ae(this,t)}toURI(){return`spotify:${X(this,o.URI).join(":")}`}toString(){return this.toURI()}toURLPath(e=!1){let t=X(this,o.URL);t[0]===p.APP&&t.shift();const n=t[0]===i.TRACKSET,r=t[0]===i.LOCAL_TRACK;if(!n&&!r){const e=[];for(let n=0,i=t.length;n{"use strict";n.d(t,{hn:()=>B});const i={AD:"ad",ALBUM:"album",GENRE:"genre",QUEUE:"queue",APPLICATION:"application",ARTIST:"artist",ARTIST_TOPLIST:"artist-toplist",ARTIST_CONCERTS:"artist-concerts",AUDIO_FILE:"audiofile",COLLECTION:"collection",COLLECTION_ALBUM:"collection-album",COLLECTION_ARTIST:"collection-artist",COLLECTION_MISSING_ALBUM:"collection-missing-album",COLLECTION_TRACK_LIST:"collectiontracklist",CONCEPT:"concept",CONCERT:"concert",CONTEXT_GROUP:"context-group",CULTURAL_MOMENT:"cultural-moment",DAILY_MIX:"dailymix",EMPTY:"empty",EPISODE:"episode",FACEBOOK:"facebook",FOLDER:"folder",FOLLOWERS:"followers",FOLLOWING:"following",IMAGE:"image",INBOX:"inbox",INTERRUPTION:"interruption",LIBRARY:"library",LIVE:"live",ROOM:"room",EXPRESSION:"expression",LOCAL:"local",LOCAL_TRACK:"local",LOCAL_ALBUM:"local-album",LOCAL_ARTIST:"local-artist",MERCH:"merch",MERCHHUB:"merchhub",MOSAIC:"mosaic",PLAYLIST:"playlist",PLAYLIST_V2:"playlist-v2",PRERELEASE:"prerelease",PROFILE:"profile",PUBLISHED_ROOTLIST:"published-rootlist",RADIO:"radio",ROOTLIST:"rootlist",SEARCH:"search",SHOW:"show",SOCIAL_SESSION:"socialsession",SPECIAL:"special",STARRED:"starred",STATION:"station",TEMP_PLAYLIST:"temp-playlist",TOPLIST:"toplist",TRACK:"track",TRACKSET:"trackset",USER_TOPLIST:"user-toplist",USER_TOP_TRACKS:"user-top-tracks",UNKNOWN:"unknown",VIDEO:"video",MEDIA:"media",QUESTION:"question",POLL:"poll",RESPONSE:"response",COURSE:"course",LESSON:"lesson",CANVAS:"canvas"};let o=function(e){return e[e.URI=0]="URI",e[e.URL=1]="URL",e}({});const r="spotify:",a="http://play.spotify.com/",s="https://play.spotify.com/",c="http://open.spotify.com/",l="https://open.spotify.com/",u="/",d={APP:"app",FACEBOOK:"facebook",GLOBAL:"global",TOP:"top",USER:"user",CONCERTS:"concerts",HUB:"hub"};n(46758),n(2836);function p(e,t){return V(i.COLLECTION,{username:e,category:t})}function f(e,t,n,o){return V(i.LOCAL_TRACK,{artist:e,album:t,track:n,duration:o})}function h(e,t,n){return V(i.TOPLIST,{toplist:e,country:t,global:Boolean(n)})}function m(e,t,n,o){return V(i.TRACK,{id:e,anchor:t,context:n?F(n):null,play:o,hasBase62Id:!0})}function g(e,t){if(!e)return"";let n=encodeURIComponent(e);return t===o.URI&&(n=n.replace(/%20/g,"+")),n=n.replace(/[!'()]/g,escape),n=n.replace(/\*/g,"%2A"),n}function _(e,t,n=[]){for(let i=0,o=e.length;i1&&(t+="&");const i=e[n];void 0!==i&&(t+=`${n}=${encodeURIComponent(i)}`)}return t}const E=/^intl-[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$/;const b=()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]},[S,A]=b();S(i.PLAYLIST,((e,t,{username:n})=>function(e,t){return V(i.PLAYLIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getBase62IdComponent()))),S(i.FOLDER,((e,t,{username:n})=>function(e,t){return V(i.FOLDER,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),S(i.COLLECTION_TRACK_LIST,((e,t,{username:n})=>function(e,t){return V(i.COLLECTION_TRACK_LIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),S(i.COLLECTION,((e,t,{username:n})=>{const o=e.getNextComponent();if(o===i.ALBUM){const t=e.getIdComponent();return"missing"===e.getNextComponent()?function(e,t){return V(i.COLLECTION_MISSING_ALBUM,{id:t,username:e,hasBase62Id:!0})}(n,t):function(e,t){return V(i.COLLECTION_ALBUM,{id:t,username:e,hasBase62Id:!0})}(n,t)}return o===i.ARTIST?function(e,t){return V(i.COLLECTION_ARTIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()):p(n,o)})),S(i.STARRED,((e,t,{username:n})=>function(e){return V(i.STARRED,{username:e})}(n))),S(i.FOLLOWERS,((e,t,{username:n})=>function(e){return V(i.FOLLOWERS,{username:e})}(n))),S(i.FOLLOWING,((e,t,{username:n})=>function(e){return V(i.FOLLOWING,{username:e})}(n))),S(d.TOP,((e,t,{username:n})=>function(e,t){return V(i.USER_TOPLIST,{username:e,toplist:t})}(n,e.getNextRequiredComponent()))),S(i.INBOX,((e,t,{username:n})=>function(e){return V(i.INBOX,{username:e})}(n))),S(i.ROOTLIST,((e,t,{username:n})=>function(e){return V(i.ROOTLIST,{username:e})}(n))),S(i.PUBLISHED_ROOTLIST,((e,t,{username:n})=>function(e){return V(i.PUBLISHED_ROOTLIST,{username:e})}(n))),S(i.TOPLIST,((e,t,{username:n})=>function(e){return V(i.USER_TOP_TRACKS,{username:e})}(n))),S(i.LIBRARY,((e,t,{username:n})=>function(e,t){return V(i.LIBRARY,{username:e,category:t})}(n,e.getNextComponent())));const[T,O]=b();function I(e){let t,n,i,d,p=e;const[f,h]=p.split("?");if(f&&h){p=f;const[e,t]=h.split("#");e&&(i=function(e){return e.split("&").reduce(((e,t)=>{const[n,i]=t.split("=");return n&&i&&(e[n]=decodeURIComponent(i)),e}),{})}(e),d=t)}const m=p.split("#");if(m.length>1&&(p=m.shift(),d=m.pop()),0===p.indexOf(r))t=p.slice(r.length).split(":"),n=o.URI;else{const[e]=p.split("?");if(0===e?.indexOf(a))t=e.slice(a.length).split("/");else if(0===e?.indexOf(s))t=e.slice(s.length).split("/");else if(0===e?.indexOf(c))t=e.slice(c.length).split("/");else if(0===e?.indexOf(l))t=e.slice(l.length).split("/");else{if(0!==e?.indexOf(u))throw new TypeError("Invalid Spotify URI!");t=e.slice(u.length).split("/")}n=o.URL}return d&&t.push(d),{format:n,components:t,query:i}}function C(e,t,n,r){let a=0;const s=()=>{const t=e[a++];if(t&&/\s/.test(t))throw new TypeError("Invalid Spotify URI!");return t},c=()=>{const e=s();if(!e)throw new TypeError("Invalid Spotify URI!");return e},l={getAllComponents:()=>e,getQueryParams:()=>n,getNextComponent:s,getNextRequiredComponent:c,getIdComponent:()=>{const e=c();if(e.length>22)throw new TypeError("Invalid Spotify URI!");return e},getHexIdComponent:e=>{const t=c();if(t.length!==e)throw new TypeError("Invalid Spotify URI!");if(!/^[a-fA-F0-9]+$/.test(t))throw new Error("Invalid Hex ID");return t},getBase62IdComponent:()=>{const e=c();if(22!==e.length)throw new TypeError("Invalid Spotify URI!");if(!/^[a-zA-Z0-9]+$/.test(e))throw new Error("Invalid ID");return e},getRemainingComponents:()=>e.slice(a),getRemainingString:()=>{const n=t===o.URI?":":"/";return e.slice(a).join(n)}};let u=c(),d=O[u];if(!d){const e=function(e){return E.test(e)}(u);e&&(u=c(),d=O[u])}if(d)return d(l,t,{});if(r)return O[i.UNKNOWN](l,t,{});throw new TypeError("Invalid or unknown Spotify URI!")}T(i.ALBUM,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return function(e,t){return V(i.ALBUM,{id:e,disc:t,hasBase62Id:!0})}(t,n?parseInt(n,10):void 0)})),T(d.APP,((e,t)=>{const n=e.getNextRequiredComponent();if(g(v(n,t),t)!==n)throw new TypeError("Invalid or unknown Spotify URI!");const o=e.getRemainingComponents();for(let e=0,n=o.length;e{return t=e.getNextRequiredComponent(),V(i.AD,{id:t});var t})),T(i.ARTIST,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return n===d.TOP?function(e,t){return V(i.ARTIST_TOPLIST,{id:e,toplist:t,hasBase62Id:!0})}(t,e.getNextRequiredComponent()):n===d.CONCERTS?function(e){return V(i.ARTIST_CONCERTS,{id:e,hasBase62Id:!0})}(t):function(e){return V(i.ARTIST,{id:e,hasBase62Id:!0})}(t)})),T(i.AUDIO_FILE,(e=>{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),V(i.AUDIO_FILE,{id:n,extension:t});var t,n})),T(i.DAILY_MIX,(e=>{return t=e.getIdComponent(),V(i.DAILY_MIX,{id:t,hasBase62Id:!0});var t})),T(i.TEMP_PLAYLIST,(e=>{return t=e.getNextRequiredComponent(),n=e.getRemainingString(),V(i.TEMP_PLAYLIST,{origin:t,data:n});var t,n})),T(i.PLAYLIST,(e=>{return t=e.getBase62IdComponent(),V(i.PLAYLIST_V2,{id:t,hasBase62Id:!0});var t})),T(i.SEARCH,((e,t)=>{return n=v(e.getRemainingString(),t),V(i.SEARCH,{query:n});var n})),T(i.TRACK,(e=>{const t=e.getQueryParams();return m(e.getBase62IdComponent(),e.getNextComponent(),t?.context,t?.play)})),T(i.TRACKSET,(e=>{const t=v(e.getNextComponent());let n=e.getNextRequiredComponent();const o=e.getNextComponent();let r=parseInt(e.getNextComponent()??"",10);("%23"!==o||isNaN(r))&&(r=null);const a=[];if(n){n=v(n).split(",");for(let e=0,t=n.length;e{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),V(i.CONTEXT_GROUP,{origin:t,name:n,hasBase62Id:!0});var t,n})),T(d.TOP,(e=>{const t=e.getNextRequiredComponent();return e.getNextComponent()===d.GLOBAL?h(t,void 0,!0):h(t,e.getNextComponent(),!1)})),T(i.LOCAL_TRACK,((e,t)=>{const n=v(e.getNextComponent(),t),o=e.getNextComponent(),r=v(o,t),a=e.getNextComponent(),s=v(a,t),c=e.getNextComponent(),l=c?parseInt(c,10):void 0;return void 0!==a?f(n,r,s,l):void 0!==o?(u=n,d=r,V(i.LOCAL_ALBUM,{artist:u,album:d})):function(e){return V(i.LOCAL_ARTIST,{artist:e})}(n);var u,d})),T(i.IMAGE,(e=>{return t=e.getHexIdComponent(40),V(i.IMAGE,{id:t});var t})),T(i.MOSAIC,(e=>{return t=e.getRemainingComponents(),V(i.MOSAIC,{ids:t});var t})),T(i.RADIO,(e=>{return t=e.getRemainingString(),V(i.RADIO,{args:t??""});var t})),T(i.SPECIAL,((e,t)=>{const n=e.getRemainingComponents();for(let e=0,i=n.length;e{return t=e.getRemainingComponents(),V(i.STATION,{args:t??[]});var t})),T(i.EPISODE,(e=>{const t=e.getQueryParams();return function(e,t,n){return V(i.EPISODE,{id:e,context:t?F(t):null,play:n,hasBase62Id:!0})}(e.getBase62IdComponent(),t?.context,t?.play)})),T(i.SHOW,(e=>{return t=e.getBase62IdComponent(),V(i.SHOW,{id:t,hasBase62Id:!0});var t})),T(i.LIVE,(e=>{return t=e.getIdComponent(),V(i.LIVE,{id:t,hasBase62Id:!0});var t})),T(i.ROOM,(e=>{return t=e.getIdComponent(),V(i.ROOM,{id:t,hasBase62Id:!0});var t})),T(i.EXPRESSION,(e=>{return t=e.getIdComponent(),V(i.EXPRESSION,{id:t,hasBase62Id:!0});var t})),T(i.CONCEPT,(e=>{return t=e.getIdComponent(),V(i.CONCEPT,{id:t,hasBase62Id:!0});var t})),T(i.CONCERT,(e=>{return t=e.getIdComponent(),V(i.CONCERT,{id:t,hasBase62Id:!0});var t})),T(i.MERCH,(e=>{return t=e.getIdComponent(),V(i.MERCH,{id:t,hasBase62Id:!0});var t})),T(i.MERCHHUB,(()=>V(i.MERCHHUB,{}))),T(i.PRERELEASE,(e=>{return t=e.getIdComponent(),V(i.PRERELEASE,{id:t,hasBase62Id:!0});var t})),T(i.SOCIAL_SESSION,(e=>{return t=e.getNextRequiredComponent(),V(i.SOCIAL_SESSION,{id:t,hasBase62Id:!0});var t})),T(i.INTERRUPTION,(e=>{return t=e.getNextRequiredComponent(),V(i.INTERRUPTION,{id:t});var t})),T(i.COLLECTION,(e=>p(void 0,e.getNextComponent()))),T(i.GENRE,(e=>{return t=e.getNextRequiredComponent(),V(i.GENRE,{genre:t});var t})),T(i.QUEUE,(()=>V(i.QUEUE,{}))),T(d.USER,((e,t)=>{const n=v(e.getNextRequiredComponent(),t),o=e.getNextComponent();if(n===i.FACEBOOK&&o)return r=o,V(i.FACEBOOK,{uid:r});if(o&&A[o]){const i=A[o];if(!i)throw new TypeError("Invalid Spotify URI!");return i(e,t,{username:n})}var r;const a=e.getRemainingComponents();return function(e,t){return V(i.PROFILE,{username:e,args:t??[]})}(n,o?[o].concat(a):void 0)})),T(i.UNKNOWN,(e=>function(e){return V(i.UNKNOWN,{args:e??[]})}(e.getAllComponents()))),T(i.MEDIA,(e=>{return t=e.getIdComponent(),V(i.MEDIA,{id:t,hasBase62Id:!0});var t})),T(i.POLL,(e=>{return t=e.getIdComponent(),V(i.POLL,{id:t,hasBase62Id:!0});var t})),T(i.QUESTION,(e=>{return t=e.getIdComponent(),V(i.QUESTION,{id:t,hasBase62Id:!0});var t})),T(i.RESPONSE,(e=>{return t=e.getIdComponent(),V(i.RESPONSE,{id:t,hasBase62Id:!0});var t})),T(i.CULTURAL_MOMENT,(e=>{if(e.getNextComponent()!==d.HUB)throw new TypeError("Invalid or unknown Spotify URI!");return t=e.getIdComponent(),V(i.CULTURAL_MOMENT,{id:t});var t})),T(i.VIDEO,(e=>{return t=e.getIdComponent(),V(i.VIDEO,{id:t,hasBase62Id:!0});var t})),T(i.CANVAS,(e=>{return t=e.getIdComponent(),V(i.CANVAS,{id:t,hasBase62Id:!0});var t})),T(i.COURSE,(e=>{return t=e.getIdComponent(),V(i.COURSE,{id:t,hasBase62Id:!0});var t})),T(i.LESSON,(e=>{return t=e.getIdComponent(),V(i.LESSON,{id:t,hasBase62Id:!0});var t}));const[N,L]=(()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]})();function R(e,t){const n=L[e.type];if(!n)throw new TypeError("Invalid Spotify URI!");return n(e,t)}N(i.ALBUM,(e=>{const t=[i.ALBUM,e.id];return e.disc&&t.push(e.disc),t})),N(i.AD,(e=>[i.AD,e.id])),N(i.ARTIST,(e=>[i.ARTIST,e.id])),N(i.QUEUE,(()=>[i.QUEUE])),N(i.GENRE,(e=>[i.GENRE,e.genre])),N(i.ARTIST_TOPLIST,(e=>[i.ARTIST,e.id,d.TOP,e.toplist])),N(i.ARTIST_CONCERTS,(e=>[i.ARTIST,e.id,d.CONCERTS])),N(i.DAILY_MIX,(e=>[i.DAILY_MIX,e.id])),N(i.SEARCH,((e,t)=>[i.SEARCH,g(e.query,t)])),N(i.TRACK,(e=>{let t=e.id;return(e.context||e.play)&&(t+=y({context:e.context,play:e.play})),e.anchor&&(t+=`#${e.anchor}`),[i.TRACK,t]})),N(i.TRACKSET,(e=>{let t=[];if(e.tracks)for(let n=0,i=e.tracks.length;n[d.USER,i.FACEBOOK,e.uid])),N(i.AUDIO_FILE,(e=>[i.AUDIO_FILE,e.extension,e.id])),N(i.FOLDER,((e,t)=>[d.USER,g(e.username,t),i.FOLDER,e.id])),N(i.FOLLOWERS,((e,t)=>[d.USER,g(e.username,t),i.FOLLOWERS])),N(i.FOLLOWING,((e,t)=>[d.USER,g(e.username,t),i.FOLLOWING])),N(i.PLAYLIST,((e,t)=>[d.USER,g(e.username,t),i.PLAYLIST,e.id])),N(i.PLAYLIST_V2,(e=>[i.PLAYLIST,e.id])),N(i.STARRED,((e,t)=>[d.USER,g(e.username,t),i.STARRED])),N(i.TEMP_PLAYLIST,(e=>[i.TEMP_PLAYLIST,e.origin,e.data])),N(i.CONTEXT_GROUP,(e=>[i.CONTEXT_GROUP,e.origin,e.name])),N(i.USER_TOPLIST,((e,t)=>[d.USER,g(e.username,t),d.TOP,e.toplist])),N(i.USER_TOP_TRACKS,((e,t)=>[d.USER,g(e.username,t),i.TOPLIST])),N(i.TOPLIST,(e=>[d.TOP,e.toplist].concat(e.global||!e.country?[d.GLOBAL]:["country",e.country]))),N(i.INBOX,((e,t)=>[d.USER,g(e.username,t),i.INBOX])),N(i.ROOTLIST,((e,t)=>[d.USER,g(e.username,t),i.ROOTLIST])),N(i.PUBLISHED_ROOTLIST,((e,t)=>[d.USER,g(e.username,t),i.PUBLISHED_ROOTLIST])),N(i.COLLECTION_TRACK_LIST,((e,t)=>[d.USER,g(e.username,t),i.COLLECTION_TRACK_LIST,e.id])),N(i.PROFILE,((e,t)=>e.args&&e.args.length>0?[d.USER,g(e.username,t)].concat(e.args):[d.USER,g(e.username,t)])),N(i.LOCAL_ARTIST,((e,t)=>[i.LOCAL_TRACK,g(e.artist,t)])),N(i.LOCAL_ALBUM,((e,t)=>[i.LOCAL_TRACK,g(e.artist,t),g(e.album,t)])),N(i.LOCAL_TRACK,((e,t)=>[i.LOCAL_TRACK,g(e.artist,t),g(e.album,t),g(e.track,t),e.duration])),N(i.LIBRARY,((e,t)=>[d.USER,g(e.username,t),i.LIBRARY].concat(e.category?[e.category]:[]))),N(i.IMAGE,(e=>[i.IMAGE,e.id])),N(i.MOSAIC,(e=>{let t=[];return e.ids&&(t=e.ids.slice(0)),t.unshift(i.MOSAIC),t})),N(i.RADIO,((e,t)=>_(e.args,t,[i.RADIO]))),N(i.SPECIAL,((e,t)=>_(e.args,t,[i.SPECIAL]))),N(i.STATION,((e,t)=>_(e.args,t,[i.STATION]))),N(i.APPLICATION,((e,t)=>_(e.args,t,[d.APP,e.id]))),N(i.COLLECTION_ALBUM,((e,t)=>[d.USER,g(e.username,t),i.COLLECTION,i.ALBUM,e.id])),N(i.COLLECTION_MISSING_ALBUM,((e,t)=>[d.USER,g(e.username,t),i.COLLECTION,i.ALBUM,e.id,"missing"])),N(i.COLLECTION_ARTIST,((e,t)=>[d.USER,g(e.username,t),i.COLLECTION,i.ARTIST,e.id])),N(i.COLLECTION,((e,t)=>{const n=[i.COLLECTION].concat(e.category?[e.category]:[]);return e.username?[d.USER,g(e.username,t)].concat(n):n})),N(i.EPISODE,(e=>{let t=e.id;return(e.context||e.play)&&(t+=y({context:e.context,play:e.play})),[i.EPISODE,t]})),N(i.SHOW,(e=>[i.SHOW,e.id])),N(i.LIVE,(e=>[i.LIVE,e.id])),N(i.ROOM,(e=>[i.ROOM,e.id])),N(i.EXPRESSION,(e=>[i.EXPRESSION,e.id])),N(i.CONCEPT,(e=>[i.CONCEPT,e.id])),N(i.CONCERT,(e=>[i.CONCERT,e.id])),N(i.SOCIAL_SESSION,(e=>[i.SOCIAL_SESSION,e.id])),N(i.INTERRUPTION,(e=>[i.INTERRUPTION,e.id])),N(i.MERCH,(e=>[i.MERCH,e.id])),N(i.MERCHHUB,(()=>[i.MERCHHUB])),N(i.PRERELEASE,(e=>[i.PRERELEASE,e.id])),N(i.UNKNOWN,((e,t)=>_(e.args,t))),N(i.MEDIA,(e=>[i.MEDIA,e.id])),N(i.POLL,(e=>[i.POLL,e.id])),N(i.QUESTION,(e=>[i.QUESTION,e.id])),N(i.RESPONSE,(e=>[i.RESPONSE,e.id])),N(i.CULTURAL_MOMENT,(e=>[i.CULTURAL_MOMENT,d.HUB,e.id])),N(i.VIDEO,(e=>[i.VIDEO,e.id])),N(i.CANVAS,(e=>[i.CANVAS,e.id])),N(i.COURSE,(e=>[i.COURSE,e.id])),N(i.LESSON,(e=>[i.LESSON,e.id]));const P="0123456789abcdef",k="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",D=[];D.length=256;for(let e=0;e<256;e++)D[e]=P[e>>4]+P[15&e];const w=[];w.length=128;for(let e=0;e<62;++e)w[k.charCodeAt(e)]=e;const M=[];for(let e=0;e<16;e++)M[P.charCodeAt(e)]=e;for(let e=0;e<6;e++)M["ABCDEF".charCodeAt(e)]=10+e;const x="function"==typeof Object.assign?(e,t)=>{Object.assign(e,t)}:(e,t)=>{for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};class U{constructor(e,t={}){this.type=e,this.hasBase62Id=!!t.hasBase62Id,x(this,t)}toURI(){return`spotify:${R(this,o.URI).join(":")}`}toString(){return this.toURI()}toURLPath(e=!1){let t=R(this,o.URL);t[0]===d.APP&&t.shift();const n=t[0]===i.TRACKSET,r=t[0]===i.LOCAL_TRACK;if(!n&&!r){const e=[];for(let n=0,i=t.length;nn(this,void 0,void 0,(function*(){try{yield t(e,i,o)}catch(e){throw new Error(e)}}))}},4826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Endpoints=void 0,function(e){e.WwwAnalytics="wwwanalytics",e.WwwAnalyticsAgnostic="wwwanalyticsagnostic",e.WwwAnalyticsNonAuth="wwwanalyticsnonauth",e.WwwExperiments="wwwexperiments",e.WwwExperimentsAgnostic="wwwexperimentsagnostic",e.WwwExperimentsNonAuth="wwwexperimentsnonauth",e.WwwWebFraudLogs="wwwwebfraudlogs",e.WwwWebFraudLogsNonAuth="wwwwebfraudlogsnonauth"}(t.Endpoints||(t.Endpoints={}))},6714:function(e,t,n){var i;e=n.nmd(e),function(o){var r=t,a=(e&&e.exports,"object"==typeof n.g&&n.g);a.global!==a&&a.window;var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var c=function(e){throw new s(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&c("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,i,o,r=e.length%3,a="",s=-1,u=e.length-r;++s>18&63)+l.charAt(o>>12&63)+l.charAt(o>>6&63)+l.charAt(63&o);return 2==r?(t=e.charCodeAt(s)<<8,n=e.charCodeAt(++s),a+=l.charAt((o=t+n)>>10)+l.charAt(o>>4&63)+l.charAt(o<<2&63)+"="):1==r&&(o=e.charCodeAt(s),a+=l.charAt(o>>2)+l.charAt(o<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&c("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,o=0,r="",a=-1;++a>(-2*o&6)));return r},version:"1.0.0"};void 0===(i=function(){return d}.call(t,n,t,e))||(e.exports=i)}()},65415:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,r=s(e),a=r[0],c=r[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),u=0,d=c>0?a-4:a;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===c&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[u++]=255&t);1===c&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,o=i%3,r=[],a=16383,s=0,l=i-o;sl?l:s+a));1===o?(t=e[i-1],r.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[i-2]<<8)+e[i-1],r.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return r.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=r[a],i[r.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,i){for(var o,r,a=[],s=t;s>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},19496:function(e){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i=n(18),o=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},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,n,i){void 0===i&&(i=!1);var o=e.getVersionPrecision(t),r=e.getVersionPrecision(n),a=Math.max(o,r),s=0,c=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=a-Math.min(o,r)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]1?o-1:0),a=1;a0){var a=Object.keys(n),c=s.default.find(a,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(void 0!==l)return l}var u=s.default.find(a,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(void 0!==d)return d}}if(r>0){var p=Object.keys(o),f=s.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(o[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),o=s.default.getBrowserTypeByAlias(i);return t&&o&&(i=o.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(o,n,i))>-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=l,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,o=(i=n(17))&&i.__esModule?i:{default:i},r=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=o.default.getFirstMatch(r,e)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=o.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(t,e),version:o.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,o=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=o.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=o.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=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=o.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},n=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=o.default.getMacOSVersionName(t),i={name:r.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=o.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),n=e.test(/android/i);return t&&n},describe:function(e){var t=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=o.default.getAndroidVersionName(t),i={name:r.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:r.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||o.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=o.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=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,o=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=o.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{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),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=o.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=a,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i,o=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),a=[{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=o.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},n=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},n=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},n=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),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},n=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})},55872:(e,t,n)=>{"use strict";const i=n(65415),o=n(30551),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let i=s(n);const o=i.write(e,t);o!==n&&(i=i.slice(0,o));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return p(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(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return c.from(i,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(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 d(e){return u(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),n=s(t);for(let i=0;i=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(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 n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(o)return i?-1:j(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function _(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function v(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,i,o){let r,a=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let i=-1;for(r=n;rs&&(n=s-c),r=n;r>=0;r--){let n=!0;for(let i=0;io&&(i=o):i=o;const r=t.length;let a;for(i>r/2&&(i=r/2),a=0;a>8,o=n%256,r.push(o),r.push(i);return r}(t,e.length-n),e,n,i)}function O(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);const i=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,i,s,c;switch(a){case 1:t<128&&(r=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(r=c));break;case 3:n=e[o+1],i=e[o+2],128==(192&n)&&128==(192&i)&&(c=(15&t)<<12|(63&n)<<6|63&i,c>2047&&(c<55296||c>57343)&&(r=c));break;case 4:n=e[o+1],i=e[o+2],s=e[o+3],128==(192&n)&&128==(192&i)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&s,c>65535&&c<1114112&&(r=c))}}null===r?(r=65533,a=1):r>65535&&(r-=65536,i.push(r>>>10&1023|55296),r=56320|1023&r),i.push(r),o+=a}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let n="",i=0;for(;ii.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(i,o)):Uint8Array.prototype.set.call(i,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,o)}o+=t.length}return i},c.byteLength=m,c.prototype._isBuffer=!0,c.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;tn&&(e+=" ... "),""},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(e,t,n,i,o){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.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===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let r=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(r,a),l=this.slice(i,o),u=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let r=!1;for(;;)switch(i){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function N(e,t,n){let i="";n=Math.min(e.length,n);for(let o=t;oi)&&(n=i);let o="";for(let i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,i,o,r){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function w(e,t,n,i,o){G(t,i,o,e,n,7);let r=Number(t&BigInt(4294967295));e[n++]=r,r>>=8,e[n++]=r,r>>=8,e[n++]=r,r>>=8,e[n++]=r;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function M(e,t,n,i,o){G(t,i,o,e,n,7);let r=Number(t&BigInt(4294967295));e[n+7]=r,r>>=8,e[n+6]=r,r>>=8,e[n+5]=r,r>>=8,e[n+4]=r;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function x(e,t,n,i,o,r){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,i,r){return t=+t,n>>>=0,r||x(e,0,n,4),o.write(e,t,n,i,23,4),n+4}function V(e,t,n,i,r){return t=+t,n>>>=0,r||x(e,0,n,8),o.write(e,t,n,i,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||k(e,t,this.length);let i=this[e],o=1,r=0;for(;++r>>=0,t>>>=0,n||k(e,t,this.length);let i=this[e+--t],o=1;for(;t>0&&(o*=256);)i+=this[e+--t]*o;return i},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<>>=0,t>>>=0,n||k(e,t,this.length);let i=this[e],o=1,r=0;for(;++r=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let i=t,o=1,r=this[e+--i];for(;i>0&&(o*=256);)r+=this[e+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q((function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<>>=0,t||k(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){D(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,r=0;for(this[t]=255&e;++r>>=0,n>>>=0,!i){D(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,r=1;for(this[t+o]=255&e;--o>=0&&(r*=256);)this[t+o]=e/r&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(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},c.prototype.writeBigUInt64LE=Q((function(e,t=0){return w(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}let o=0,r=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}let o=n-1,r=1,a=0;for(this[t+o]=255&e;--o>=0&&(r*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/r>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(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},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(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},c.prototype.writeBigInt64LE=Q((function(e,t=0){return w(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function G(e,t,n,i,o,r){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(r+1)}${i}`:`>= -(2${i} ** ${8*(r+1)-1}${i}) and < 2 ** ${8*(r+1)-1}${i}`:`>= ${t}${i} and <= ${n}${i}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(i,o,r)}function K(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new F.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,n){let i=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=H(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=H(o)),o+="n"),i+=` It must be ${t}. Received ${o}`,i}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function j(e,t){let n;t=t||1/0;const i=e.length;let o=null;const r=[];for(let a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&r.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;r.push(n)}else if(n<2048){if((t-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function z(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,i){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let o=0;o<16;++o)t[i+o]=e[n]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},44589:(e,t,n)=>{var i=n(13337),o={};for(var r in i)i.hasOwnProperty(r)&&(o[i[r]]=r);var a=e.exports={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"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var c=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:c}),Object.defineProperty(a[s],"labels",{value:l})}a.rgb.hsl=function(e){var t,n,i=e[0]/255,o=e[1]/255,r=e[2]/255,a=Math.min(i,o,r),s=Math.max(i,o,r),c=s-a;return s===a?t=0:i===s?t=(o-r)/c:o===s?t=2+(r-i)/c:r===s&&(t=4+(i-o)/c),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+s)/2,[t,100*(s===a?0:n<=.5?c/(s+a):c/(2-s-a)),100*n]},a.rgb.hsv=function(e){var t,n,i,o,r,a=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(a,s,c),u=l-Math.min(a,s,c),d=function(e){return(l-e)/6/u+.5};return 0===u?o=r=0:(r=u/l,t=d(a),n=d(s),i=d(c),a===l?o=i-n:s===l?o=1/3+t-i:c===l&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*r,100*l]},a.rgb.hwb=function(e){var t=e[0],n=e[1],i=e[2];return[a.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,i))),100*(i=1-1/255*Math.max(t,Math.max(n,i)))]},a.rgb.cmyk=function(e){var t,n=e[0]/255,i=e[1]/255,o=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-i,1-o)))/(1-t)||0),100*((1-i-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var t=o[e];if(t)return t;var n,r,a,s=1/0;for(var c in i)if(i.hasOwnProperty(c)){var l=i[c],u=(r=e,a=l,Math.pow(r[0]-a[0],2)+Math.pow(r[1]-a[1],2)+Math.pow(r[2]-a[2],2));u.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*t+.7152*n+.0722*i),100*(.0193*t+.1192*n+.9505*i)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),n=t[0],i=t[1],o=t[2];return i/=100,o/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},a.hsl.rgb=function(e){var t,n,i,o,r,a=e[0]/360,s=e[1]/100,c=e[2]/100;if(0===s)return[r=255*c,r,r];t=2*c-(n=c<.5?c*(1+s):c+s-c*s),o=[0,0,0];for(var l=0;l<3;l++)(i=a+1/3*-(l-1))<0&&i++,i>1&&i--,r=6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t,o[l]=255*r;return o},a.hsl.hsv=function(e){var t=e[0],n=e[1]/100,i=e[2]/100,o=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,o*=r<=1?r:2-r,[t,100*(0===i?2*o/(r+o):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,i=e[2]/100,o=Math.floor(t)%6,r=t-Math.floor(t),a=255*i*(1-n),s=255*i*(1-n*r),c=255*i*(1-n*(1-r));switch(i*=255,o){case 0:return[i,c,a];case 1:return[s,i,a];case 2:return[a,i,c];case 3:return[a,s,i];case 4:return[c,a,i];case 5:return[i,a,s]}},a.hsv.hsl=function(e){var t,n,i,o=e[0],r=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return i=(2-r)*a,n=r*s,[o,100*(n=(n/=(t=(2-r)*s)<=1?t:2-t)||0),100*(i/=2)]},a.hwb.rgb=function(e){var t,n,i,o,r,a,s,c=e[0]/360,l=e[1]/100,u=e[2]/100,d=l+u;switch(d>1&&(l/=d,u/=d),i=6*c-(t=Math.floor(6*c)),0!=(1&t)&&(i=1-i),o=l+i*((n=1-u)-l),t){default:case 6:case 0:r=n,a=o,s=l;break;case 1:r=o,a=n,s=l;break;case 2:r=l,a=n,s=o;break;case 3:r=l,a=o,s=n;break;case 4:r=o,a=l,s=n;break;case 5:r=n,a=l,s=o}return[255*r,255*a,255*s]},a.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,i=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,i*(1-o)+o))]},a.xyz.rgb=function(e){var t,n,i,o=e[0]/100,r=e[1]/100,a=e[2]/100;return n=-.9689*o+1.8758*r+.0415*a,i=.0557*o+-.204*r+1.057*a,t=(t=3.2406*o+-1.5372*r+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(e){var t=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(e){var t,n,i,o=e[0];t=e[1]/500+(n=(o+16)/116),i=n-e[2]/200;var r=Math.pow(n,3),a=Math.pow(t,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[t*=95.047,n*=100,i*=108.883]},a.lab.lch=function(e){var t,n=e[0],i=e[1],o=e[2];return(t=360*Math.atan2(o,i)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(i*i+o*o),t]},a.lch.lab=function(e){var t,n=e[0],i=e[1];return t=e[2]/360*2*Math.PI,[n,i*Math.cos(t),i*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],i=e[2],o=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var r=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===o&&(r+=60),r},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],i=e[2];return t===n&&n===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(e){var 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},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(e){var t,n=e[0]/255,i=e[1]/255,o=e[2]/255,r=Math.max(Math.max(n,i),o),a=Math.min(Math.min(n,i),o),s=r-a;return t=s<=0?0:r===n?(i-o)/s%6:r===i?2+(o-n)/s:4+(n-i)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=1,o=0;return(i=n<.5?2*t*n:2*t*(1-n))<1&&(o=(n-.5*i)/(1-i)),[e[0],100*i,100*o]},a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=t*n,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],100*i,100*o]},a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,i=e[2]/100;if(0===n)return[255*i,255*i,255*i];var o,r=[0,0,0],a=t%1*6,s=a%1,c=1-s;switch(Math.floor(a)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=c,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=c,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=c}return o=(1-n)*i,[255*(n*r[0]+o),255*(n*r[1]+o),255*(n*r[2]+o)]},a.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),i=0;return n>0&&(i=t/n),[e[0],100*i,100*n]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],100*i,100*n]},a.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},a.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,i=n-t,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],100*i,100*o]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},18358:(e,t,n)=>{var i=n(44589),o=n(3314),r={};Object.keys(i).forEach((function(e){r[e]={},Object.defineProperty(r[e],"channels",{value:i[e].channels}),Object.defineProperty(r[e],"labels",{value:i[e].labels});var t=o(e);Object.keys(t).forEach((function(n){var i=t[n];r[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,o=0;o1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(i)}))})),e.exports=r},3314:(e,t,n)=>{var i=n(44589);function o(e){var t=function(){for(var e={},t=Object.keys(i),n=t.length,o=0;o{"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]}},99419:e=>{"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]}},2489:(e,t,n)=>{var i=n(99419),o=n(27933),r=Object.hasOwnProperty,a=Object.create(null);for(var s in i)r.call(i,s)&&(a[i[s]]=s);var c=e.exports={to:{},get:{}};function l(e,t,n){return Math.min(Math.max(t,e),n)}function u(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}c.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=c.get.hsl(e),n="hsl";break;case"hwb":t=c.get.hwb(e),n="hwb";break;default:t=c.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},c.get.rgb=function(e){if(!e)return null;var t,n,o,a=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(t.slice(s,s+2),16)}o&&(a[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],n=0;n<3;n++)a[n]=parseInt(t[n]+t[n],16);o&&(a[3]=parseInt(o+o,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(t[n+1],0);t[4]&&(t[5]?a[3]=.01*parseFloat(t[4]):a[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(i,t[1])?((a=i[t[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?a[3]=.01*parseFloat(t[4]):a[3]=parseFloat(t[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},c.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 n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},c.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 n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},c.to.hex=function(){var e=o(arguments);return"#"+u(e[0])+u(e[1])+u(e[2])+(e[3]<1?u(Math.round(255*e[3])):"")},c.to.rgb=function(){var e=o(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]+")"},c.to.rgb.percent=function(){var e=o(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),i=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+i+"%)":"rgba("+t+"%, "+n+"%, "+i+"%, "+e[3]+")"},c.to.hsl=function(){var e=o(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},c.to.hwb=function(){var e=o(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},c.to.keyword=function(e){return a[e.slice(0,3)]}},74654:(e,t,n)=>{"use strict";var i=n(2489),o=n(18358),r=[].slice,a=["keyword","gray","hex"],s={};Object.keys(o).forEach((function(e){s[r.call(o[e].labels).sort().join("")]=e}));var c={};function l(e,t){if(!(this instanceof l))return new l(e,t);if(t&&t in a&&(t=null),t&&!(t in o))throw new Error("Unknown model: "+t);var n,u;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof l)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var d=i.get(e);if(null===d)throw new Error("Unable to parse color from string: "+e);this.model=d.model,u=o[this.model].channels,this.color=d.value.slice(0,u),this.valpha="number"==typeof d.value[u]?d.value[u]:1}else if(e.length){this.model=t||"rgb",u=o[this.model].channels;var f=r.call(e,0,u);this.color=p(f,u),this.valpha="number"==typeof e[u]?e[u]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var h=Object.keys(e);"alpha"in e&&(h.splice(h.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var m=h.sort().join("");if(!(m in s))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=s[m];var g=o[this.model].labels,_=[];for(n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return l.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),n=t.color[0];return n=(n=(n+e)%360)<0?360+n:n,t.color[0]=n,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var n=e.rgb(),i=this.rgb(),o=void 0===t?.5:t,r=2*o-1,a=n.alpha()-i.alpha(),s=((r*a==-1?r:(r+a)/(1+r*a))+1)/2,c=1-s;return l.rgb(s*n.red()+c*i.red(),s*n.green()+c*i.green(),s*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(e){if(-1===a.indexOf(e)){var t=o[e].channels;l.prototype[e]=function(){if(this.model===e)return new l(this);if(arguments.length)return new l(arguments,e);var n,i="number"==typeof arguments[t]?t:this.valpha;return new l((n=o[this.model][e].raw(this.color),Array.isArray(n)?n:[n]).concat(i),e)},l[e]=function(n){return"number"==typeof n&&(n=p(r.call(arguments),t)),new l(n,e)}}})),e.exports=l},24574:(e,t,n)=>{var i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g,o=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n&&n,i="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,r="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,s="ArrayBuffer"in n;if(s)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&r&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=_(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=_(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=h(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(g)}),this.text=function(){var e,t,n,i=h(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=m(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})},v.call(E.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];S.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,i){return new Promise((function(o,a){var c=new E(e,i);if(c.signal&&c.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function u(){l.abort()}l.onload=function(){var e,t,n={status:l.status,statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var o=n.join(":").trim();t.append(i,o)}})),t)};n.url="responseURL"in l?l.responseURL:n.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;setTimeout((function(){o(new S(i,n))}),0)},l.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.onabort=function(){setTimeout((function(){a(new t.DOMException("Aborted","AbortError"))}),0)},l.open(c.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?l.withCredentials=!0:"omit"===c.credentials&&(l.withCredentials=!1),"responseType"in l&&(r?l.responseType="blob":s&&c.headers.get("Content-Type")&&-1!==c.headers.get("Content-Type").indexOf("application/octet-stream")&&(l.responseType="arraybuffer")),!i||"object"!=typeof i.headers||i.headers instanceof f?c.headers.forEach((function(e,t){l.setRequestHeader(t,e)})):Object.getOwnPropertyNames(i.headers).forEach((function(e){l.setRequestHeader(e,d(i.headers[e]))})),c.signal&&(c.signal.addEventListener("abort",u),l.onreadystatechange=function(){4===l.readyState&&c.signal.removeEventListener("abort",u)}),l.send(void 0===c._bodyInit?null:c._bodyInit)}))}T.polyfill=!0,n.fetch||(n.fetch=T,n.Headers=f,n.Request=E,n.Response=S),t.Headers=f,t.Request=E,t.Response=S,t.fetch=T}({})}(o),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var r=i.fetch?i:o;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},29215:(e,t,n)=>{t.UINT32=n(8397),t.UINT64=n(49364)},8397:function(e,t){var n;!function(i){o(Math.pow(36,5)),o(Math.pow(16,7)),o(Math.pow(10,9)),o(Math.pow(2,30)),o(36),o(16),o(10),o(2);function o(e,t){return this instanceof o?(this._low=0,this._high=0,this.remainder=null,void 0===t?a.call(this,e):"string"==typeof e?s.call(this,e,t):void r.call(this,e,t)):new o(e,t)}function r(e,t){return this._low=0|e,this._high=0|t,this}function a(e){return this._low=65535&e,this._high=e>>>16,this}function s(e,t){var n=parseInt(e,t||10);return this._low=65535&n,this._high=n>>>16,this}o.prototype.fromBits=r,o.prototype.fromNumber=a,o.prototype.fromString=s,o.prototype.toNumber=function(){return 65536*this._high+this._low},o.prototype.toString=function(e){return this.toNumber().toString(e||10)},o.prototype.add=function(e){var t=this._low+e._low,n=t>>>16;return n+=this._high+e._high,this._low=65535&t,this._high=65535&n,this},o.prototype.subtract=function(e){return this.add(e.clone().negate())},o.prototype.multiply=function(e){var t,n,i=this._high,o=this._low,r=e._high,a=e._low;return t=(n=o*a)>>>16,t+=i*a,t&=65535,t+=o*r,this._low=65535&n,this._high=65535&t,this},o.prototype.div=function(e){if(0==e._low&&0==e._high)throw Error("division by zero");if(0==e._high&&1==e._low)return this.remainder=new o(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new o(0),this._low=1,this._high=0,this;for(var t=e.clone(),n=-1;!this.lt(t);)t.shiftLeft(1,!0),n++;for(this.remainder=this.clone(),this._low=0,this._high=0;n>=0;n--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),n>=16?this._high|=1<>>16)&65535,this},o.prototype.equals=o.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},o.prototype.greaterThan=o.prototype.gt=function(e){return this._high>e._high||!(this._highe._low},o.prototype.lessThan=o.prototype.lt=function(e){return this._highe._high)&&this._low16?(this._low=this._high>>e-16,this._high=0):16==e?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},o.prototype.shiftLeft=o.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<>16-e,this._low=this._low<>>32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.rotateRight=o.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.clone=function(){return new o(this._low,this._high)},void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},49364:function(e,t){var n;!function(i){var o={16:a(Math.pow(16,5)),10:a(Math.pow(10,5)),2:a(Math.pow(2,5))},r={16:a(16),10:a(10),2:a(2)};function a(e,t,n,i){return this instanceof a?(this.remainder=null,"string"==typeof e?l.call(this,e,t):void 0===t?c.call(this,e):void s.apply(this,arguments)):new a(e,t,n,i)}function s(e,t,n,i){return void 0===n?(this._a00=65535&e,this._a16=e>>>16,this._a32=65535&t,this._a48=t>>>16,this):(this._a00=0|e,this._a16=0|t,this._a32=0|n,this._a48=0|i,this)}function c(e){return this._a00=65535&e,this._a16=e>>>16,this._a32=0,this._a48=0,this}function l(e,t){t=t||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var n=o[t]||new a(Math.pow(t,5)),i=0,r=e.length;i=0&&(n.div(t),i[o]=n.remainder.toNumber().toString(e),n.gt(t));o--);return i[o-1]=n.toNumber().toString(e),i.join("")},a.prototype.add=function(e){var t=this._a00+e._a00,n=t>>>16,i=(n+=this._a16+e._a16)>>>16,o=(i+=this._a32+e._a32)>>>16;return o+=this._a48+e._a48,this._a00=65535&t,this._a16=65535&n,this._a32=65535&i,this._a48=65535&o,this},a.prototype.subtract=function(e){return this.add(e.clone().negate())},a.prototype.multiply=function(e){var t=this._a00,n=this._a16,i=this._a32,o=this._a48,r=e._a00,a=e._a16,s=e._a32,c=t*r,l=c>>>16,u=(l+=t*a)>>>16;l&=65535,u+=(l+=n*r)>>>16;var d=(u+=t*s)>>>16;return u&=65535,d+=(u+=n*a)>>>16,u&=65535,d+=(u+=i*r)>>>16,d+=t*e._a48,d&=65535,d+=n*s,d&=65535,d+=i*a,d&=65535,d+=o*r,this._a00=65535&c,this._a16=65535&l,this._a32=65535&u,this._a48=65535&d,this},a.prototype.div=function(e){if(0==e._a16&&0==e._a32&&0==e._a48){if(0==e._a00)throw Error("division by zero");if(1==e._a00)return this.remainder=new a(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new a(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),n=-1;!this.lt(t);)t.shiftLeft(1,!0),n++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;n>=0;n--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),n>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&e,e=(65535&~this._a32)+(e>>>16),this._a32=65535&e,this._a48=~this._a48+(e>>>16)&65535,this},a.prototype.equals=a.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},a.prototype.greaterThan=a.prototype.gt=function(e){return this._a48>e._a48||!(this._a48e._a32||!(this._a32e._a16||!(this._a16e._a00))},a.prototype.lessThan=a.prototype.lt=function(e){return this._a48e._a48)&&(this._a32e._a32)&&(this._a16e._a16)&&this._a00=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=65535&(this._a32>>e|this._a48<<16-e),this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=65535&(this._a16>>e|this._a32<<16-e),this._a16=65535&(this._a32>>e|this._a48<<16-e),this._a32=this._a48>>e&65535,this._a48=0):(this._a00=65535&(this._a00>>e|this._a16<<16-e),this._a16=65535&(this._a16>>e|this._a32<<16-e),this._a32=65535&(this._a32>>e|this._a48<<16-e),this._a48=this._a48>>e&65535),this},a.prototype.shiftLeft=a.prototype.shiftl=function(e,t){return(e%=64)>=48?(this._a48=this._a00<=32?(e-=32,this._a48=this._a16<>16-e,this._a32=this._a00<=16?(e-=16,this._a48=this._a32<>16-e,this._a32=65535&(this._a16<>16-e),this._a16=this._a00<>16-e,this._a32=65535&(this._a32<>16-e),this._a16=65535&(this._a16<>16-e),this._a00=this._a00<=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var n=this._a48<<16|this._a32,i=this._a16<<16|this._a00,o=n<>>32-e,r=i<>>32-e;return this._a00=65535&r,this._a16=r>>>16,this._a32=65535&o,this._a48=o>>>16,this},a.prototype.rotateRight=a.prototype.rotr=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var n=this._a48<<16|this._a32,i=this._a16<<16|this._a00,o=n>>>e|i<<32-e,r=i>>>e|n<<32-e;return this._a00=65535&r,this._a16=r>>>16,this._a32=65535&o,this._a48=o>>>16,this},a.prototype.clone=function(){return new a(this._a00,this._a16,this._a32,this._a48)},void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},35529:(e,t,n)=>{var i=n(14224);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(o=i))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==i&&"env"in i&&(e="false");return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(52456)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},52456:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,r,a=null;function s(...e){if(!s.enabled)return;const i=s,o=Number(new Date),r=o-(n||o);i.diff=r,i.prev=n,i.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";a++;const r=t.formatters[o];if("function"==typeof r){const t=e[a];n=r.call(i,t),e.splice(a,1),a--}return n})),t.formatArgs.call(i,e);(i.log||t.log).apply(i,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=i,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,r=t.enabled(e)),r),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),o=i.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"use strict";function t(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function n(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var i=Object.getOwnPropertyDescriptor(e,t);if(!i)throw new TypeError("must call property on owner object");if(!i.configurable)throw new TypeError("property must be configurable")}e.exports=function(e){if(!e)throw new TypeError("argument namespace is required");function i(e){}return i._file=void 0,i._ignored=!0,i._namespace=e,i._traced=!1,i._warned=Object.create(null),i.function=t,i.property=n,i}},13706:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},91612:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=n(13706),a=n(4409);o(n(4409),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},c=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,i=new a.Element(e,t,void 0,n);this.addNode(i),this.tagStack.push(i)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new a.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=c,t.default=c},4409:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=h;var m=function(e){function t(t,n,i,o){void 0===i&&(i=[]),void 0===o&&(o="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var r=e.call(this,i)||this;return r.name=t,r.attribs=n,r.type=o,r}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,i;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(i=e["x-attribsPrefix"])||void 0===i?void 0:i[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,a.isTag)(e)}function _(e){return e.type===a.ElementType.CDATA}function v(e){return e.type===a.ElementType.Text}function y(e){return e.type===a.ElementType.Comment}function E(e){return e.type===a.ElementType.Directive}function b(e){return e.type===a.ElementType.Root}function S(e,t){var n;if(void 0===t&&(t=!1),v(e))n=new l(e.data);else if(y(e))n=new u(e.data);else if(g(e)){var i=t?A(e.children):[],o=new m(e.name,r({},e.attribs),i);i.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=r({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=r({},e["x-attribsPrefix"])),n=o}else if(_(e)){i=t?A(e.children):[];var a=new f(i);i.forEach((function(e){return e.parent=a})),n=a}else if(b(e)){i=t?A(e.children):[];var s=new h(i);i.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!E(e))throw new Error("Not implemented yet: ".concat(e.type));var c=new d(e.name,e.data);null!=e["x-name"]&&(c["x-name"]=e["x-name"],c["x-publicId"]=e["x-publicId"],c["x-systemId"]=e["x-systemId"]),n=c}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function A(e){for(var t=e.map((function(e){return S(e,!0)})),n=1;n{var i;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(i=function(){return r}.call(t,n,t,e))||(e.exports=i)}()},3341:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,o,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(o=i;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;for(o=i;0!=o--;){var a=r[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},47196:function(e){e.exports=function(){"use strict";function e(e){return Number.isInteger(e)&&e>=0}function t(e){this.name="ArgumentError",this.message=e}return function(n,i){if(i=i||{},"function"!=typeof n)throw new t("fetch must be a function");if("object"!=typeof i)throw new t("defaults must be an object");if(void 0!==i.retries&&!e(i.retries))throw new t("retries must be a positive integer");if(void 0!==i.retryDelay&&!e(i.retryDelay)&&"function"!=typeof i.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==i.retryOn&&!Array.isArray(i.retryOn)&&"function"!=typeof i.retryOn)throw new t("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(o,r){var a=i.retries,s=i.retryDelay,c=i.retryOn;if(r&&void 0!==r.retries){if(!e(r.retries))throw new t("retries must be a positive integer");a=r.retries}if(r&&void 0!==r.retryDelay){if(!e(r.retryDelay)&&"function"!=typeof r.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");s=r.retryDelay}if(r&&r.retryOn){if(!Array.isArray(r.retryOn)&&"function"!=typeof r.retryOn)throw new t("retryOn property expects an array or function");c=r.retryOn}return new Promise((function(e,t){var i=function(i){var s="undefined"!=typeof Request&&o instanceof Request?o.clone():o;n(s,r).then((function(n){if(Array.isArray(c)&&-1===c.indexOf(n.status))e(n);else if("function"==typeof c)try{return Promise.resolve(c(i,null,n)).then((function(t){t?l(i,null,n):e(n)})).catch(t)}catch(e){t(e)}else i{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n element.");return c.cloneElement(t,{ref:function(n){var i=e.props.containerElements;t&&("function"==typeof t.ref?t.ref(n):t.ref&&(t.ref.current=n)),e.focusTrapElements=i||[n]}})}return null}}])&&o(t.prototype,n),i&&o(t,i),u}(c.Component),f="undefined"==typeof Element?Function:Element;p.propTypes={active:u.bool,paused:u.bool,focusTrapOptions:u.shape({document:u.object,onActivate:u.func,onPostActivate:u.func,checkCanFocusTrap:u.func,onDeactivate:u.func,onPostDeactivate:u.func,checkCanReturnFocus:u.func,initialFocus:u.oneOfType([u.instanceOf(f),u.string,u.func,u.bool]),fallbackFocus:u.oneOfType([u.instanceOf(f),u.string,u.func]),escapeDeactivates:u.oneOfType([u.bool,u.func]),clickOutsideDeactivates:u.oneOfType([u.bool,u.func]),returnFocusOnDeactivate:u.bool,setReturnFocus:u.oneOfType([u.instanceOf(f),u.string,u.func]),allowOutsideClick:u.oneOfType([u.bool,u.func]),preventScroll:u.bool}),containerElements:u.arrayOf(u.instanceOf(f)),children:u.oneOfType([u.element,u.instanceOf(f)])},p.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:d},e.exports=p},45523:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createFocusTrap:()=>T});var i=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],o=i.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,a=function(e,t,n){var i=Array.prototype.slice.apply(e.querySelectorAll(o));return t&&r.call(e,o)&&i.unshift(e),i=i.filter(n)},s=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:"AUDIO"!==e.nodeName&&"VIDEO"!==e.nodeName&&"DETAILS"!==e.nodeName||null!==e.getAttribute("tabindex")?e.tabIndex:0:t},c=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},l=function(e){return"INPUT"===e.tagName},u=function(e){return function(e){return l(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||e.ownerDocument,i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(r.call(n,"details:not([open]) *"))return!0;if(t&&"full"!==t){if("non-zero-area"===t){var i=e.getBoundingClientRect(),o=i.width,a=i.height;return 0===o&&0===a}}else for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(t,e.displayCheck)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(l(e)||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"BUTTON"===e.tagName)for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n0){var t=v[v.length-1];t!==e&&t.pause()}var n=v.indexOf(e);-1===n||v.splice(n,1),v.push(e)},deactivateTrap:function(e){var t=v.indexOf(e);-1!==t&&v.splice(t,1),v.length>0&&v[v.length-1].unpause()}}),E=function(e){return setTimeout(e,0)},b=function(e,t){var n=-1;return e.every((function(e,i){return!t(e)||(n=i,!1)})),n},S=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?n-1:0),a=1;a0)return{container:e,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1],nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=r.findIndex((function(t){return t===e}));return t?r.slice(n+1).find((function(e){return f(e)})):r.slice(0,n).reverse().find((function(e){return f(e)}))}}})).filter((function(e){return!!e})),r.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},O=function e(t){!1!==t&&t!==i.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),r.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(v()))},I=function(e){var t=h("setReturnFocus",e);return t||!1!==t&&e},C=function(e){var t=A(e);u(t)||(S(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!m(t)}):S(o.allowOutsideClick,e)||e.preventDefault())},N=function(e){var t=A(e),n=u(t);n||t instanceof Document?n&&(r.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),O(r.mostRecentlyFocusedNode||v()))},L=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==S(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=A(e);T();var n=null;if(r.tabbableGroups.length>0){var i=b(r.tabbableGroups,(function(e){return e.container.contains(t)})),o=i>=0?r.tabbableGroups[i]:void 0;if(i<0)n=e.shiftKey?r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:r.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var a=b(r.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(a<0&&(o.container===t||m(t)&&!f(t)&&!o.nextTabbableNode(t,!1))&&(a=i),a>=0){var s=0===a?r.tabbableGroups.length-1:a-1;n=r.tabbableGroups[s].lastTabbableNode}}else{var c=b(r.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(c<0&&(o.container===t||m(t)&&!f(t)&&!o.nextTabbableNode(t))&&(c=i),c>=0){var l=c===r.tabbableGroups.length-1?0:c+1;n=r.tabbableGroups[l].firstTabbableNode}}}else n=h("fallbackFocus");n&&(e.preventDefault(),O(n))}(e)},R=function(e){if(!S(o.clickOutsideDeactivates,e)){var t=A(e);u(t)||S(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}},P=function(){if(r.active)return y.activateTrap(n),r.delayInitialFocusTimer=o.delayInitialFocus?E((function(){O(v())})):O(v()),i.addEventListener("focusin",N,!0),i.addEventListener("mousedown",C,{capture:!0,passive:!1}),i.addEventListener("touchstart",C,{capture:!0,passive:!1}),i.addEventListener("click",R,{capture:!0,passive:!1}),i.addEventListener("keydown",L,{capture:!0,passive:!1}),n},k=function(){if(r.active)return i.removeEventListener("focusin",N,!0),i.removeEventListener("mousedown",C,!0),i.removeEventListener("touchstart",C,!0),i.removeEventListener("click",R,!0),i.removeEventListener("keydown",L,!0),n};return(n={activate:function(e){if(r.active)return this;var t=l(e,"onActivate"),n=l(e,"onPostActivate"),o=l(e,"checkCanFocusTrap");o||T(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=i.activeElement,t&&t();var a=function(){o&&T(),P(),n&&n()};return o?(o(r.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!r.active)return this;clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,k(),r.active=!1,r.paused=!1,y.deactivateTrap(n);var t=l(e,"onDeactivate"),i=l(e,"onPostDeactivate"),o=l(e,"checkCanReturnFocus");t&&t();var a=l(e,"returnFocus","returnFocusOnDeactivate"),s=function(){E((function(){a&&O(I(r.nodeFocusedBeforeActivation)),i&&i()}))};return a&&o?(o(I(r.nodeFocusedBeforeActivation)).then(s,s),this):(s(),this)},pause:function(){return r.paused||!r.active||(r.paused=!0,k()),this},unpause:function(){return r.paused&&r.active?(r.paused=!1,T(),P(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return r.containers=t.map((function(e){return"string"==typeof e?i.querySelector(e):e})),r.active&&T(),this}}).updateContainerElements(e),n}},46731:(e,t,n)=>{const i=n(84842),o=n(23392).a,r=n(41966).a,a=n(9981),s=n(61329).Base64,c=new a(s.toUint8Array(o)),l=new a(s.toUint8Array(r));function u(e,t){return 0!=(e&t)}const d=0,p=1,f=2;function h(e,t){const n=e.length;let o=0,r=d;for(let a=t;a+165535?2:1,n.push(t)}for(let o=0;o{e.exports={Other:0,CR:1,LF:2,Control:4,Extend:8,ZWJ:16,Regional_Indicator:32,Prepend:64,SpacingMark:128,L:256,V:512,T:1024,LV:2048,LVT:4096,Extended_Pictographic:8192}},38366:(e,t,n)=>{"use strict";n.d(t,{lX:()=>O,PP:()=>L});var i=n(56962),o=n.n(i),r=n(53670),a=n.n(r);function s(e){return"/"===e.charAt(0)}function c(e,t){for(var n=t,i=n+1,o=e.length;i1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],i=t&&t.split("/")||[],o=e&&s(e),r=t&&s(t),a=o||r;if(e&&s(e)?i=n:n.length&&(i.pop(),i=i.concat(n)),!i.length)return"/";var l=void 0;if(i.length){var u=i[i.length-1];l="."===u||".."===u||""===u}else l=!1;for(var d=0,p=i.length;p>=0;p--){var f=i[p];"."===f?c(i,p):".."===f?(c(i,p),d++):d&&(c(i,p),d--)}if(!a)for(;d--;d)i.unshift("..");!a||""===i[0]||i[0]&&s(i[0])||i.unshift("");var h=i.join("/");return l&&"/"!==h.substr(-1)&&(h+="/"),h};"function"==typeof Symbol&&Symbol.iterator;var u=function(e){return"/"===e.charAt(0)?e:"/"+e},d=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)},p=function(e){var t=e.pathname,n=e.search,i=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(o+="#"===i.charAt(0)?i:"#"+i),o},f=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};a()(g,"Browser history needs a DOM");var t,n,i=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,s=!(-1===window.navigator.userAgent.indexOf("Trident")),c=e.forceRefresh,l=void 0!==c&&c,f=e.getUserConfirmation,O=void 0===f?y:f,I=e.keyLength,C=void 0===I?6:I,N=e.basename?"/"===(n=u(e.basename)).charAt(n.length-1)?n.slice(0,-1):n:"",L=function(e){var t=e||{},n=t.key,i=t.state,r=window.location,a=r.pathname+r.search+r.hash;return o()(!N||d(a,N),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+N+'".'),N&&(a=function(e,t){return d(e,t)?e.substr(t.length):e}(a,N)),h(a,i,n)},R=function(){return Math.random().toString(36).substr(2,C)},P=m(),k=function(e){b(Y,e),Y.length=i.length,P.notifyListeners(Y.location,Y.action)},D=function(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||x(L(e.state))},w=function(){x(L(T()))},M=!1,x=function(e){if(M)M=!1,k();else{P.confirmTransitionTo(e,"POP",O,(function(t){t?k({action:"POP",location:e}):U(e)}))}},U=function(e){var t=Y.location,n=F.indexOf(t.key);-1===n&&(n=0);var i=F.indexOf(e.key);-1===i&&(i=0);var o=n-i;o&&(M=!0,H(o))},V=L(T()),F=[V.key],B=function(e){return N+p(e)},H=function(e){i.go(e)},G=0,K=function(e){1===(G+=e)?(_(window,S,D),s&&_(window,A,w)):0===G&&(v(window,S,D),s&&v(window,A,w))},W=!1,Y={length:i.length,action:"POP",location:V,createHref:B,push:function(e,t){o()(!("object"===(void 0===e?"undefined":E(e))&&void 0!==e.state&&void 0!==t),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var n="PUSH",a=h(e,t,R(),Y.location);P.confirmTransitionTo(a,n,O,(function(e){if(e){var t=B(a),s=a.key,c=a.state;if(r)if(i.pushState({key:s,state:c},null,t),l)window.location.href=t;else{var u=F.indexOf(Y.location.key),d=F.slice(0,-1===u?0:u+1);d.push(a.key),F=d,k({action:n,location:a})}else o()(void 0===c,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=t}}))},replace:function(e,t){o()(!("object"===(void 0===e?"undefined":E(e))&&void 0!==e.state&&void 0!==t),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var n="REPLACE",a=h(e,t,R(),Y.location);P.confirmTransitionTo(a,n,O,(function(e){if(e){var t=B(a),s=a.key,c=a.state;if(r)if(i.replaceState({key:s,state:c},null,t),l)window.location.replace(t);else{var u=F.indexOf(Y.location.key);-1!==u&&(F[u]=a.key),k({action:n,location:a})}else o()(void 0===c,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(t)}}))},go:H,goBack:function(){return H(-1)},goForward:function(){return H(1)},block:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=P.setPrompt(e);return W||(K(1),W=!0),function(){return W&&(W=!1,K(-1)),t()}},listen:function(e){var t=P.appendListener(e);return K(1),function(){K(-1),t()}}};return Y};Object.assign;var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.getUserConfirmation,n=e.initialEntries,i=void 0===n?["/"]:n,r=e.initialIndex,a=void 0===r?0:r,s=e.keyLength,c=void 0===s?6:s,l=m(),u=function(e){C(y,e),y.length=y.entries.length,l.notifyListeners(y.location,y.action)},d=function(){return Math.random().toString(36).substr(2,c)},f=N(a,0,i.length-1),g=i.map((function(e){return h(e,void 0,"string"==typeof e?d():e.key||d())})),_=p,v=function(e){var n=N(y.index+e,0,y.entries.length-1),i=y.entries[n];l.confirmTransitionTo(i,"POP",t,(function(e){e?u({action:"POP",location:i,index:n}):u()}))},y={length:g.length,action:"POP",location:g[f],index:f,entries:g,createHref:_,push:function(e,n){o()(!("object"===(void 0===e?"undefined":I(e))&&void 0!==e.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i="PUSH",r=h(e,n,d(),y.location);l.confirmTransitionTo(r,i,t,(function(e){if(e){var t=y.index+1,n=y.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),u({action:i,location:r,index:t,entries:n})}}))},replace:function(e,n){o()(!("object"===(void 0===e?"undefined":I(e))&&void 0!==e.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i="REPLACE",r=h(e,n,d(),y.location);l.confirmTransitionTo(r,i,t,(function(e){e&&(y.entries[y.index]=r,u({action:i,location:r}))}))},go:v,goBack:function(){return v(-1)},goForward:function(){return v(1)},canGo:function(e){var t=y.index+e;return t>=0&&t0&&void 0!==arguments[0]&&arguments[0];return l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return y}},72535:(e,t,n)=>{"use strict";var i=n(56237),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return i.isMemo(e)?a:s[e.$$typeof]||o}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,i){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,i)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=c(t),m=c(n),g=0;g{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce((function(e,t){return e[t.toLowerCase()]=t,e}),{})},86516:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="html",i="head",o="body",r=/<([a-zA-Z]+[0-9]?)/,a=//i,s=//i,c=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},l=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;c=l=function(e,t){return t&&(e="<".concat(t,">").concat(e,"")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var p=document.implementation.createHTMLDocument();c=function(e,t){if(t){var n=p.documentElement.querySelector(t);return n&&(n.innerHTML=e),p}return p.documentElement.innerHTML=e,p}}var f,h="object"==typeof document&&document.createElement("template");h&&h.content&&(f=function(e){return h.innerHTML=e,h.content.childNodes}),t.default=function(e){var t,u,d=e.match(r),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var h=l(e);if(!a.test(e))null===(t=null==(g=h.querySelector(i))?void 0:g.parentNode)||void 0===t||t.removeChild(g);if(!s.test(e))null===(u=null==(g=h.querySelector(o))?void 0:g.parentNode)||void 0===u||u.removeChild(g);return h.querySelectorAll(n);case i:case o:var m=c(e).querySelectorAll(p);return s.test(e)&&a.test(e)?m[0].parentNode.childNodes:m;default:return f?f(e):(g=c(e,o).querySelector(o)).childNodes;var g}}},94944:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(86516)),r=n(80713),a=/<(![a-zA-Z\s]+)>/;t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(a),n=t?t[1]:void 0;return(0,r.formatDOM)((0,o.default)(e),null,n)}},80713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDOM=t.formatAttributes=void 0;var i=n(91612),o=n(13525);function r(e){for(var t={},n=0,i=e.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(27068),o=n(770),r=["checked","value"],a=["input","select","textarea"],s={reset:!0,submit:!0};function c(e){return i.possibleStandardNames[e]}t.default=function(e,t){void 0===e&&(e={});var n={},l=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,i.isCustomAttribute)(u))n[u]=d;else{var p=u.toLowerCase(),f=c(p);if(f){var h=(0,i.getPropertyInfo)(f);switch(r.includes(f)&&a.includes(t)&&!l&&(f=c("default"+p)),n[f]=d,h&&h.type){case i.BOOLEAN:n[f]=!0;break;case i.OVERLOADED_BOOLEAN:""===d&&(n[f]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n}},72720:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(50959),r=i(n(36796)),a=n(770),s={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function c(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,a.isCustomComponent)(e.name,e.attribs)}t.default=function e(t,n){for(var i=[],o="function"==typeof(null==n?void 0:n.replace),l=(null==n?void 0:n.transform)||a.returnFirstArg,u=(null==n?void 0:n.library)||s,d=u.cloneElement,p=u.createElement,f=u.isValidElement,h=t.length,m=0;m1&&(_=d(_,{key:_.key||m})),i.push(l(_,g,m));continue}}if("text"!==g.type){var v=g,y={};c(v)?((0,a.setStyleProp)(v.attribs.style,v.attribs),y=v.attribs):v.attribs&&(y=(0,r.default)(v.attribs,v.name));var E=void 0;switch(g.type){case"script":case"style":g.children[0]&&(y.dangerouslySetInnerHTML={__html:g.children[0].data});break;case"tag":"textarea"===g.name&&g.children[0]?y.defaultValue=g.children[0].data:g.children&&g.children.length&&(E=e(g.children,n));break;default:continue}h>1&&(y.key=m),i.push(l(p(g.name,y,E),g,m))}else{var b=!g.data.trim().length;if(b&&g.parent&&!(0,a.canTextBeChildOfNode)(g.parent))continue;if((null==n?void 0:n.trim)&&b)continue;i.push(l(g.data,g,m))}}return 1===i.length?i[0]:i}},99035:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0;var o=i(n(94944));t.htmlToDOM=o.default;var r=i(n(36796));t.attributesToProps=r.default;var a=i(n(72720));t.domToReact=a.default;var s=n(91612);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};t.default=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,a.default)((0,o.default)(e,(null==t?void 0:t.htmlparser2)||c),t):[]}},770:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=t.setStyleProp=t.isCustomComponent=void 0;var o=n(50959),r=i(n(7065)),a=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);t.isCustomComponent=function(e,t){return e.includes("-")?!a.has(e):Boolean(t&&"string"==typeof t.is)};var s={reactCompat:!0};t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,r.default)(e,s)}catch(e){t.style={}}else t.style={}},t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)};t.returnFirstArg=function(e){return e}},43183:function(e,t,n){e.exports=function(e){"use strict";function t(e,t,i,o){return void 0===t&&(t={}),Object.keys(t).reduce((function(r,a){if(/^on.*/.test(a))return r;var s=a;/^(data|aria)-/.test(a)||0===i.filter((function(e){return e instanceof RegExp?e.test(a):e===a})).length&&(s=n(a));var c,l,u=o(e,s);if("style"===u.name)r[u.name]=(c=t.style,l={},c.split(";").filter((function(e){return""!==e.trim()})).forEach((function(e){var t,i=e.split(":");if(i.length>1){var o=function(e){return/^-ms-/.test(e)&&(e=e.substr(1)),e.startsWith("--")?e:n(e)}(i[0].trim()),r=(t=i.slice(1).join(":").trim(),/^\d+$/.test(t)?Number(t):t.replace(/'/g,'"'));l[o]=r}})),l);else{var d=t[a],p=""===d||String(d).toLowerCase()===s.toLowerCase();r[u.name]=u.isBoolean?p:d}return r}),{})}function n(e){return e.replace(/(-|:)(.)/g,(function(e,t,n){return n.toUpperCase()}))}e=e&&e.hasOwnProperty("default")?e.default:e;var i=["table","tbody","thead","tfoot","tr"],o={for:"htmlFor",class:"className",allowfullscreen:["allowFullScreen","allowFullscreen"],autocomplete:"autoComplete",autofocus:["autoFocus"],contenteditable:"contentEditable",spellcheck:"spellCheck",srcdoc:"srcDoc",srcset:"srcSet",itemscope:"itemScope",itemprop:"itemProp",itemtype:"itemType"};function r(e,t){var n=o[t],i=document.createElement(e);if(n)return{name:Array.isArray(n)?n[0]:n,isBoolean:a(i,Array.isArray(n)?n[1]||t:n)};for(var r in i)if(r.toLowerCase()===t.toLowerCase())return{name:r,isBoolean:a(i,r)};return{name:t,isBoolean:a(i,t)}}function a(e,t){return e.setAttribute(t,""),!0===e[t]||s.indexOf(t)>-1}var s=["itemScope"];function c(t,n,i,o){void 0===o&&(o=null);var r=i[t],a=i._;return r?e.createElement(r,n,o):a?a(t,n,o):e.createElement(t,n,o)}return function(e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new TypeError("Expected HTML string");var o=document.createElement("div");o.innerHTML=e.trim();var a=Array.from(o.childNodes).map((function(e,o){return function e(n,o,a){var s=a.transform||{},l=a.preserveAttributes||[],u=a.dangerouslySetChildren||["style"],d=s._;if(8===n.nodeType)return null;if(3===n.nodeType){var p=n.textContent;return d?d(p):p}for(var f={},h=n.attributes,m=0;m-1&&3===t.nodeType&&(t.textContent=t.textContent.trim(),""===t.textContent)?null:e(t,o+"."+n,a)})).filter(Boolean);if(u.indexOf(g)>-1){var y=n.innerHTML;return y&&("style"!==g&&"script"!==g&&(y=y.replace(/"/g,""")),_.dangerouslySetInnerHTML={__html:y.trim()}),c(g,_,s)}var E=0===v.length?null:v;return c(g,_,s,E)}(e,String(o),n)})).filter(Boolean);return 1===a.length?a[0]:a}}(n(50959))},16556:(e,t,n)=>{"use strict";var i,o=n(74622)("http-errors"),r=n(75561),a=n(14435),s=n(2937),c=n(66730);function l(e){return Number(String(e).charAt(0)+"00")}function u(e,t){var n=Object.getOwnPropertyDescriptor(e,"name");n&&n.configurable&&(n.value=t,Object.defineProperty(e,"name",n))}function d(e){return"Error"!==e.substr(-5)?e+"Error":e}e.exports=function e(){for(var t,n,i=500,r={},s=0;s=600)&&o("non-error status code; use only 4xx or 5xx status codes");("number"!=typeof i||!a.message[i]&&(i<400||i>=600))&&(i=500);var d=e[i]||e[l(i)];t||(t=d?new d(n):new Error(n||a.message[i]),Error.captureStackTrace(t,e));d&&t instanceof d&&t.status===i||(t.expose=i<500,t.status=t.statusCode=i);for(var p in r)"status"!==p&&"statusCode"!==p&&(t[p]=r[p]);return t},e.exports.HttpError=function(){function e(){throw new TypeError("cannot construct abstract class")}return s(e,Error),e}(),e.exports.isHttpError=(i=e.exports.HttpError,function(e){return!(!e||"object"!=typeof e)&&(e instanceof i||e instanceof Error&&"boolean"==typeof e.expose&&"number"==typeof e.statusCode&&e.status===e.statusCode)}),function(e,t,n){t.forEach((function(t){var i,o=c(a.message[t]);switch(l(t)){case 400:i=function(e,t,n){var i=d(t);function o(e){var t=null!=e?e:a.message[n],s=new Error(t);return Error.captureStackTrace(s,o),r(s,o.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:i,writable:!0}),s}return s(o,e),u(o,i),o.prototype.status=n,o.prototype.statusCode=n,o.prototype.expose=!0,o}(n,o,t);break;case 500:i=function(e,t,n){var i=d(t);function o(e){var t=null!=e?e:a.message[n],s=new Error(t);return Error.captureStackTrace(s,o),r(s,o.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:i,writable:!0}),s}return s(o,e),u(o,i),o.prototype.status=n,o.prototype.statusCode=n,o.prototype.expose=!1,o}(n,o,t)}i&&(e[t]=i,e[o]=i)}))}(e.exports,a.codes,e.exports.HttpError)},30551:(e,t)=>{t.read=function(e,t,n,i,o){var r,a,s=8*o-i-1,c=(1<>1,u=-7,d=n?o-1:0,p=n?-1:1,f=e[t+d];for(d+=p,r=f&(1<<-u)-1,f>>=-u,u+=s;u>0;r=256*r+e[t+d],d+=p,u-=8);for(a=r&(1<<-u)-1,r>>=-u,u+=i;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===r)r=1-l;else{if(r===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),r-=l}return(f?-1:1)*a*Math.pow(2,r-i)},t.write=function(e,t,n,i,o,r){var a,s,c,l=8*r-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,h=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+f]=255&s,f+=h,s/=256,o-=8);for(a=a<0;e[n+f]=255&a,f+=h,a/=256,l-=8);e[n+f-h]|=128*m}},2937:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},4651:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,c=/^\s+|\s+$/g,l="";function u(e){return e?e.replace(c,l):l}e.exports=function(e,c){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];c=c||{};var d=1,p=1;function f(e){var t=e.match(n);t&&(d+=t.length);var i=e.lastIndexOf("\n");p=~i?e.length-i:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),y(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=c.source}m.prototype.content=e;var g=[];function _(t){var n=new Error(c.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=c.source,n.line=d,n.column=p,n.source=e,!c.silent)throw n;g.push(n)}function v(t){var n=t.exec(e);if(n){var i=n[0];return f(i),e=e.slice(i.length),n}}function y(){v(i)}function E(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;l!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,l===e.charAt(n-1))return _("End of comment missing");var i=e.slice(2,n-2);return p+=2,f(i),e=e.slice(n),p+=2,t({type:"comment",comment:i})}}function S(){var e=h(),n=v(o);if(n){if(b(),!v(r))return _("property missing ':'");var i=v(a),c=e({type:"declaration",property:u(n[0].replace(t,l)),value:i?u(i[0].replace(t,l)):l});return v(s),c}}return y(),function(){var e,t=[];for(E(t);e=S();)!1!==e&&(t.push(e),E(t));return t}()}},34758:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>Ce});var i,o,r,a=n(99938);function s(e){return e.type===o.literal}function c(e){return e.type===o.argument}function l(e){return e.type===o.number}function u(e){return e.type===o.date}function d(e){return e.type===o.time}function p(e){return e.type===o.select}function f(e){return e.type===o.plural}function h(e){return e.type===o.pound}function m(e){return e.type===o.tag}function g(e){return!(!e||"object"!=typeof e||e.type!==r.number)}function _(e){return!(!e||"object"!=typeof e||e.type!==r.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(i||(i={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(o||(o={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(r||(r={}));var v=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,y=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function E(e){var t={};return e.replace(y,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"long":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var b=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var S=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,A=/^(@+)?(\+|#+)?[rs]?$/g,T=/(\*)(0+)|(#+)(0+)|(0+)/g,O=/^(0+)$/;function I(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(A,(function(e,n,i){return"string"!=typeof i?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===i?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof i?i.length:0)),""})),t}function C(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function N(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!O.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function L(e){var t=C(e);return t||{}}function R(e){for(var t={},n=0,i=e;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(T,(function(e,n,i,o,r,a){if(n)t.minimumIntegerDigits=i.length;else{if(o&&r)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(O.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(S.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(S,(function(e,n,i,o,r,a){return"*"===i?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:r&&a?(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var r=o.options[0];"w"===r?t=(0,a.__assign)((0,a.__assign)({},t),{trailingZeroDisplay:"stripIfInteger"}):r&&(t=(0,a.__assign)((0,a.__assign)({},t),I(r)))}else if(A.test(o.stem))t=(0,a.__assign)((0,a.__assign)({},t),I(o.stem));else{var s=C(o.stem);s&&(t=(0,a.__assign)((0,a.__assign)({},t),s));var c=N(o.stem);c&&(t=(0,a.__assign)((0,a.__assign)({},t),c))}}return t}var P,k={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function D(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,i=e.language;return"root"!==i&&(n=e.maximize().region),(k[n||""]||k[i||""]||k["".concat(i,"-001")]||k["001"])[0]}var w=new RegExp("^".concat(v.source,"*")),M=new RegExp("".concat(v.source,"*$"));function x(e,t){return{start:e,end:t}}var U=!!String.prototype.startsWith&&"_a".startsWith("a",1),V=!!String.fromCodePoint,F=!!Object.fromEntries,B=!!String.prototype.codePointAt,H=!!String.prototype.trimStart,G=!!String.prototype.trimEnd,K=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},W=!0;try{W="a"===(null===(P=Q("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===P?void 0:P[0])}catch(e){W=!1}var Y,j=U?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},z=V?String.fromCodePoint:function(){for(var e=[],t=0;tr;){if((n=e[r++])>1114111)throw RangeError(n+" is not a valid code point");i+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return i},J=F?Object.fromEntries:function(e){for(var t={},n=0,i=e;n=n)){var i,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(i=e.charCodeAt(t+1))<56320||i>57343?o:i-56320+(o-55296<<10)+65536}},X=H?function(e){return e.trimStart()}:function(e){return e.replace(w,"")},Z=G?function(e){return e.trimEnd()}:function(e){return e.replace(M,"")};function Q(e,t){return new RegExp(e,t)}if(W){var $=Q("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Y=function(e,t){var n;return $.lastIndex=t,null!==(n=$.exec(e)[1])&&void 0!==n?n:""}}else Y=function(e,t){for(var n=[];;){var i=q(e,t);if(void 0===i||ie(i)||oe(i))break;n.push(i),t+=i>=65536?2:1}return z.apply(void 0,n)};var ee=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var a=this.char();if(123===a){if((s=this.parseArgument(e,n)).err)return s;r.push(s.val)}else{if(125===a&&e>0)break;if(35!==a||"plural"!==t&&"selectordinal"!==t){if(60===a&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(i.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&te(this.peek()||0)){if((s=this.parseTag(e,t)).err)return s;r.push(s.val)}else{var s;if((s=this.parseLiteral(e,t)).err)return s;r.push(s.val)}}else{var c=this.clonePosition();this.bump(),r.push({type:o.pound,location:x(c,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:o.literal,value:"<".concat(r,"/>"),location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var a=this.parseMessage(e+1,t,!0);if(a.err)return a;var s=a.val,c=this.clonePosition();if(this.bumpIf("")?{val:{type:o.tag,value:r,children:s,location:x(n,this.clonePosition())},err:null}:this.error(i.INVALID_TAG,x(c,this.clonePosition())))}return this.error(i.UNCLOSED_TAG,x(n,this.clonePosition()))}return this.error(i.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&ne(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),i="";;){var r=this.tryParseQuote(t);if(r)i+=r;else{var a=this.tryParseUnquoted(e,t);if(a)i+=a;else{var s=this.tryParseLeftAngleBracket();if(!s)break;i+=s}}}var c=x(n,this.clonePosition());return{val:{type:o.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(te(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return z.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),z(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(i.EMPTY_ARGUMENT,x(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(i.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:o.argument,value:r,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(i.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Y(this.message,t),i=t+n.length;return this.bumpTo(i),{value:n,location:x(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,s){var c,l=this.clonePosition(),u=this.parseIdentifierIfPossible().value,d=this.clonePosition();switch(u){case"":return this.error(i.EXPECT_ARGUMENT_TYPE,x(l,d));case"number":case"date":case"time":this.bumpSpace();var p=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition();if((S=this.parseSimpleArgStyleIfPossible()).err)return S;if(0===(_=Z(S.val)).length)return this.error(i.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));p={style:_,styleLocation:x(f,this.clonePosition())}}if((A=this.tryParseArgumentClose(s)).err)return A;var h=x(s,this.clonePosition());if(p&&j(null==p?void 0:p.style,"::",0)){var m=X(p.style.slice(2));if("number"===u)return(S=this.parseNumberSkeletonFromString(m,p.styleLocation)).err?S:{val:{type:o.number,value:n,location:h,style:S.val},err:null};if(0===m.length)return this.error(i.EXPECT_DATE_TIME_SKELETON,h);var g=m;this.locale&&(g=function(e,t){for(var n="",i=0;i>1),c=D(t);for("H"!=c&&"k"!=c||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=c+n}else n+="J"===o?"H":o}return n}(m,this.locale));var _={type:r.dateTime,pattern:g,location:p.styleLocation,parsedOptions:this.shouldParseSkeletons?E(g):{}};return{val:{type:"date"===u?o.date:o.time,value:n,location:h,style:_},err:null}}return{val:{type:"number"===u?o.number:"date"===u?o.date:o.time,value:n,location:h,style:null!==(c=null==p?void 0:p.style)&&void 0!==c?c:null},err:null};case"plural":case"selectordinal":case"select":var v=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(i.EXPECT_SELECT_ARGUMENT_OPTIONS,x(v,(0,a.__assign)({},v)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),b=0;if("select"!==u&&"offset"===y.value){if(!this.bumpIf(":"))return this.error(i.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));var S;if(this.bumpSpace(),(S=this.tryParseDecimalInteger(i.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,i.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return S;this.bumpSpace(),y=this.parseIdentifierIfPossible(),b=S.val}var A,T=this.tryParsePluralOrSelectOptions(e,u,t,y);if(T.err)return T;if((A=this.tryParseArgumentClose(s)).err)return A;var O=x(s,this.clonePosition());return"select"===u?{val:{type:o.select,value:n,options:J(T.val),location:O},err:null}:{val:{type:o.plural,value:n,options:J(T.val),offset:b,pluralType:"plural"===u?"cardinal":"ordinal",location:O},err:null};default:return this.error(i.INVALID_ARGUMENT_TYPE,x(l,d))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(i.EXPECT_ARGUMENT_CLOSING_BRACE,x(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(i.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,i=e.split(b).filter((function(e){return e.length>0}));n=48&&a<=57))break;o=!0,r=10*r+(a-48),this.bump()}var s=x(i,this.clonePosition());return o?K(r*=n)?{val:r,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=q(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(j(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ie(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function te(e){return e>=97&&e<=122||e>=65&&e<=90}function ne(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ie(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function oe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function re(e){e.forEach((function(e){if(delete e.location,p(e)||f(e))for(var t in e.options)delete e.options[t].location,re(e.options[t].value);else l(e)&&g(e.style)||(u(e)||d(e))&&_(e.style)?delete e.style.location:m(e)&&re(e.children)}))}function ae(e,t){void 0===t&&(t={}),t=(0,a.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ee(e,t).parse();if(n.err){var o=SyntaxError(i[n.err.kind]);throw o.location=n.err.location,o.originalMessage=n.err.message,o}return(null==t?void 0:t.captureLocation)||re(n.val),n.val}function se(e,t){var n=t&&t.cache?t.cache:me,i=t&&t.serializer?t.serializer:pe;return(t&&t.strategy?t.strategy:de)(e,{cache:n,serializer:i})}function ce(e,t,n,i){var o,r=null==(o=i)||"number"==typeof o||"boolean"==typeof o?i:n(i),a=t.get(r);return void 0===a&&(a=e.call(this,i),t.set(r,a)),a}function le(e,t,n){var i=Array.prototype.slice.call(arguments,3),o=n(i),r=t.get(o);return void 0===r&&(r=e.apply(this,i),t.set(o,r)),r}function ue(e,t,n,i,o){return n.bind(t,e,i,o)}function de(e,t){return ue(e,this,1===e.length?ce:le,t.cache.create(),t.serializer)}var pe=function(){return JSON.stringify(arguments)};function fe(){this.cache=Object.create(null)}fe.prototype.get=function(e){return this.cache[e]},fe.prototype.set=function(e,t){this.cache[e]=t};var he,me={create:function(){return new fe}},ge={variadic:function(e,t){return ue(e,this,le,t.cache.create(),t.serializer)},monadic:function(e,t){return ue(e,this,ce,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(he||(he={}));var _e,ve=function(e){function t(t,n,i){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=i,o}return(0,a.__extends)(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),ye=function(e){function t(t,n,i,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),he.INVALID_VALUE,o)||this}return(0,a.__extends)(t,e),t}(ve),Ee=function(e){function t(t,n,i){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),he.INVALID_VALUE,i)||this}return(0,a.__extends)(t,e),t}(ve),be=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),he.MISSING_VALUE,n)||this}return(0,a.__extends)(t,e),t}(ve);function Se(e){return"function"==typeof e}function Ae(e,t,n,i,o,r,a){if(1===e.length&&s(e[0]))return[{type:_e.literal,value:e[0].value}];for(var v=[],y=0,E=e;y0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=ae,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ce=Ie},53670:e=>{"use strict";e.exports=function(e,t,n,i,o,r,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,i,o,r,a,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},48254:e=>{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},61329:function(e,t,n){var i=n(55872).lW;"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g&&n.g,e.exports=function(){"use strict";var e,t="3.7.2",n=t,o="function"==typeof atob,r="function"==typeof btoa,a="function"==typeof i,s="function"==typeof TextDecoder?new TextDecoder:void 0,c="function"==typeof TextEncoder?new TextEncoder:void 0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=Array.prototype.slice.call(l),d=(e={},u.forEach((function(t,n){return e[t]=n})),e),p=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,f=String.fromCharCode.bind(String),h="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e,t){return void 0===t&&(t=function(e){return e}),new Uint8Array(Array.prototype.slice.call(e,0).map(t))},m=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},g=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},_=function(e){for(var t,n,i,o,r="",a=e.length%3,s=0;s255||(i=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");r+=u[(t=n<<16|i<<8|o)>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}return a?r.slice(0,a-3)+"===".substring(a):r},v=r?function(e){return btoa(e)}:a?function(e){return i.from(e,"binary").toString("base64")}:_,y=a?function(e){return i.from(e).toString("base64")}:function(e){for(var t=4096,n=[],i=0,o=e.length;i>>6)+f(128|63&t):f(224|t>>>12&15)+f(128|t>>>6&63)+f(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return f(240|t>>>18&7)+f(128|t>>>12&63)+f(128|t>>>6&63)+f(128|63&t)},S=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(e){return e.replace(S,b)},T=a?function(e){return i.from(e,"utf8").toString("base64")}:c?function(e){return y(c.encode(e))}:function(e){return v(A(e))},O=function(e,t){return void 0===t&&(t=!1),t?m(T(e)):T(e)},I=function(e){return O(e,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,N=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return f(55296+(t>>>10))+f(56320+(1023&t));case 3:return f((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return f((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},L=function(e){return e.replace(C,N)},R=function(e){if(e=e.replace(/\s+/g,""),!p.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var t,n,i,o="",r=0;r>16&255):64===i?f(t>>16&255,t>>8&255):f(t>>16&255,t>>8&255,255&t);return o},P=o?function(e){return atob(g(e))}:a?function(e){return i.from(e,"base64").toString("binary")}:R,k=a?function(e){return h(i.from(e,"base64"))}:function(e){return h(P(e),(function(e){return e.charCodeAt(0)}))},D=function(e){return k(M(e))},w=a?function(e){return i.from(e,"base64").toString("utf8")}:s?function(e){return s.decode(k(e))}:function(e){return L(P(e))},M=function(e){return g(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},x=function(e){return w(M(e))},U=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},V=function(){var e=function(e,t){return Object.defineProperty(String.prototype,e,U(t))};e("fromBase64",(function(){return x(this)})),e("toBase64",(function(e){return O(this,e)})),e("toBase64URI",(function(){return O(this,!0)})),e("toBase64URL",(function(){return O(this,!0)})),e("toUint8Array",(function(){return D(this)}))},F=function(){var e=function(e,t){return Object.defineProperty(Uint8Array.prototype,e,U(t))};e("toBase64",(function(e){return E(this,e)})),e("toBase64URI",(function(){return E(this,!0)})),e("toBase64URL",(function(){return E(this,!0)}))},B=function(){V(),F()},H={version:t,VERSION:n,atob:P,atobPolyfill:R,btoa:v,btoaPolyfill:_,fromBase64:x,toBase64:O,encode:O,encodeURI:I,encodeURL:I,utob:A,btou:L,decode:x,isValid:function(e){if("string"!=typeof e)return!1;var t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:E,toUint8Array:D,extendString:V,extendUint8Array:F,extendBuiltins:B,Base64:{}};return Object.keys(H).forEach((function(e){return H.Base64[e]=H[e]})),H}()},93602:(e,t,n)=>{var i,o=n(14224);!function(){"use strict";var t="input is invalid type",r="object"==typeof window,a=r?window:{};a.JS_MD5_NO_WINDOW&&(r=!1);var s=!r&&"object"==typeof self,c=!a.JS_MD5_NO_NODE_JS&&"object"==typeof o&&o.versions&&o.versions.node;c?a=n.g:s&&(a=self);var l,u=!a.JS_MD5_NO_COMMON_JS&&e.exports,d=n.amdO,p=!a.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[128,32768,8388608,-2147483648],m=[0,8,16,24],g=["hex","array","digest","buffer","arrayBuffer","base64"],_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),v=[];if(p){var y=new ArrayBuffer(68);l=new Uint8Array(y),v=new Uint32Array(y)}var E=Array.isArray;!a.JS_MD5_NO_NODE_JS&&E||(E=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var b=ArrayBuffer.isView;!p||!a.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&b||(b=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var S=function(e){var n=typeof e;if("string"===n)return[e,!0];if("object"!==n||null===e)throw new Error(t);if(p&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!E(e)&&!b(e))throw new Error(t);return[e,!1]},A=function(e){return function(t){return new I(!0).update(t)[e]()}},T=function(e){var i,o=n(1068),r=n(46223).Buffer;i=r.from&&!a.JS_MD5_NO_BUFFER_FROM?r.from:function(e){return new r(e)};return function(n){if("string"==typeof n)return o.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),E(n)||b(n)||n.constructor===r?o.createHash("md5").update(i(n)).digest("hex"):e(n)}},O=function(e){return function(t,n){return new C(t,!0).update(n)[e]()}};function I(e){if(e)v[0]=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0,this.blocks=v,this.buffer8=l;else if(p){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function C(e,t){var n,i=S(e);if(e=i[0],i[1]){var o,r=[],a=e.length,s=0;for(n=0;n>>6,r[s++]=128|63&o):o<55296||o>=57344?(r[s++]=224|o>>>12,r[s++]=128|o>>>6&63,r[s++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),r[s++]=240|o>>>18,r[s++]=128|o>>>12&63,r[s++]=128|o>>>6&63,r[s++]=128|63&o);e=r}e.length>64&&(e=new I(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}I.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}I.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=S(e);e=t[0];for(var n,i,o=t[1],r=0,a=e.length,s=this.blocks,c=this.buffer8;r>>6,c[i++]=128|63&n):n<55296||n>=57344?(c[i++]=224|n>>>12,c[i++]=128|n>>>6&63,c[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),c[i++]=240|n>>>18,c[i++]=128|n>>>12&63,c[i++]=128|n>>>6&63,c[i++]=128|63&n);else for(i=this.start;r>>2]|=n<>>2]|=(192|n>>>6)<>>2]|=(128|63&n)<=57344?(s[i>>>2]|=(224|n>>>12)<>>2]|=(128|n>>>6&63)<>>2]|=(128|63&n)<>>2]|=(240|n>>>18)<>>2]|=(128|n>>>12&63)<>>2]|=(128|n>>>6&63)<>>2]|=(128|63&n)<>>2]|=e[r]<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},I.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=h[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},I.prototype.hash=function(){var e,t,n,i,o,r,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(i=((i=(-1732584194^2004318071&e)+a[1]-117830708)<<12|i>>>20)+e<<0)&(-271733879^e))+a[2]-1126478375)<<17|n>>>15)+i<<0)&(i^e))+a[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((i=this.h3)^t&(n^i))+a[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+a[1]-389564586)<<12|i>>>20)+e<<0)&(e^t))+a[2]+606105819)<<17|n>>>15)+i<<0)&(i^e))+a[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(i^t&(n^i))+a[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+a[5]+1200080426)<<12|i>>>20)+e<<0)&(e^t))+a[6]-1473231341)<<17|n>>>15)+i<<0)&(i^e))+a[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+a[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+a[9]-1958414417)<<12|i>>>20)+e<<0)&(e^t))+a[10]-42063)<<17|n>>>15)+i<<0)&(i^e))+a[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+a[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+a[13]-40341101)<<12|i>>>20)+e<<0)&(e^t))+a[14]-1502002290)<<17|n>>>15)+i<<0)&(i^e))+a[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+a[1]-165796510)<<5|e>>>27)+t<<0)^t))+a[6]-1069501632)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+a[11]+643717713)<<14|n>>>18)+i<<0)^i))+a[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+a[5]-701558691)<<5|e>>>27)+t<<0)^t))+a[10]+38016083)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+a[15]-660478335)<<14|n>>>18)+i<<0)^i))+a[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+a[9]+568446438)<<5|e>>>27)+t<<0)^t))+a[14]-1019803690)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+a[3]-187363961)<<14|n>>>18)+i<<0)^i))+a[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+a[13]-1444681467)<<5|e>>>27)+t<<0)^t))+a[2]-51403784)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+a[7]+1735328473)<<14|n>>>18)+i<<0)^i))+a[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+a[5]-378558)<<4|e>>>28)+t<<0))+a[8]-2022574463)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+a[11]+1839030562)<<16|n>>>16)+i<<0))+a[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+a[1]-1530992060)<<4|e>>>28)+t<<0))+a[4]+1272893353)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+a[7]-155497632)<<16|n>>>16)+i<<0))+a[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+a[13]+681279174)<<4|e>>>28)+t<<0))+a[0]-358537222)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+a[3]-722521979)<<16|n>>>16)+i<<0))+a[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+a[9]-640364487)<<4|e>>>28)+t<<0))+a[12]-421815835)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+a[15]+530742520)<<16|n>>>16)+i<<0))+a[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+a[0]-198630844)<<6|e>>>26)+t<<0)|~n))+a[7]+1126891415)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+a[14]-1416354905)<<15|n>>>17)+i<<0)|~e))+a[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+a[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+a[3]-1894986606)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+a[10]-1051523)<<15|n>>>17)+i<<0)|~e))+a[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+a[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+a[15]-30611744)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+a[6]-1560198380)<<15|n>>>17)+i<<0)|~e))+a[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+a[4]-145523070)<<6|e>>>26)+t<<0)|~n))+a[11]-1120210379)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+a[2]+718787259)<<15|n>>>17)+i<<0)|~e))+a[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},I.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return f[e>>>4&15]+f[15&e]+f[e>>>12&15]+f[e>>>8&15]+f[e>>>20&15]+f[e>>>16&15]+f[e>>>28&15]+f[e>>>24&15]+f[t>>>4&15]+f[15&t]+f[t>>>12&15]+f[t>>>8&15]+f[t>>>20&15]+f[t>>>16&15]+f[t>>>28&15]+f[t>>>24&15]+f[n>>>4&15]+f[15&n]+f[n>>>12&15]+f[n>>>8&15]+f[n>>>20&15]+f[n>>>16&15]+f[n>>>28&15]+f[n>>>24&15]+f[i>>>4&15]+f[15&i]+f[i>>>12&15]+f[i>>>8&15]+f[i>>>20&15]+f[i>>>16&15]+f[i>>>28&15]+f[i>>>24&15]},I.prototype.toString=I.prototype.hex,I.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&i,i>>>8&255,i>>>16&255,i>>>24&255]},I.prototype.array=I.prototype.digest,I.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},I.prototype.buffer=I.prototype.arrayBuffer,I.prototype.base64=function(){for(var e,t,n,i="",o=this.array(),r=0;r<15;)e=o[r++],t=o[r++],n=o[r++],i+=_[e>>>2]+_[63&(e<<4|t>>>4)]+_[63&(t<<2|n>>>6)]+_[63&n];return e=o[r],i+=_[e>>>2]+_[e<<4&63]+"=="},C.prototype=new I,C.prototype.finalize=function(){if(I.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();I.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),I.prototype.finalize.call(this)}};var N=function(){var e=A("hex");c&&(e=T(e)),e.create=function(){return new I},e.update=function(t){return e.create().update(t)};for(var t=0;t{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},r={};function a(e,t){var n,i,a;return t?(a=0<=(e>>>=0)&&e<256)&&(i=r[e])?i:(n=c(e,(0|e)<0?-1:0,!0),a&&(r[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(i=o[e])?i:(n=c(e,e<0?-1:0,!1),a&&(o[e]=n),n)}function s(e,t){if(isNaN(e))return t?_:g;if(t){if(e<0)return _;if(e>=f)return S}else{if(e<=-h)return A;if(e+1>=h)return b}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,i){return new n(e,t,i)}n.fromInt=a,n.fromNumber=s,n.fromBits=c;var l=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var o=s(l(n,8)),r=g,a=0;a>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((r=c).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(v)},T.neg=T.negate,T.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,r=65535&this.low,a=e.high>>>16,s=65535&e.high,l=e.low>>>16,u=0,p=0,f=0,h=0;return f+=(h+=r+(65535&e.low))>>>16,p+=(f+=o+l)>>>16,u+=(p+=n+s)>>>16,u+=t+a,c((f&=65535)<<16|(h&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},T.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(A))return e.isOdd()?A:g;if(e.eq(A))return this.isOdd()?A:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,r=this.low>>>16,a=65535&this.low,l=e.high>>>16,u=65535&e.high,p=e.low>>>16,f=65535&e.low,h=0,_=0,v=0,y=0;return v+=(y+=a*f)>>>16,_+=(v+=r*f)>>>16,v&=65535,_+=(v+=a*p)>>>16,h+=(_+=o*f)>>>16,_&=65535,h+=(_+=r*p)>>>16,_&=65535,h+=(_+=a*u)>>>16,h+=n*f+o*p+r*u+a*l,c((v&=65535)<<16|(y&=65535),(h&=65535)<<16|(_&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,o,r;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?_:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return y;r=_}else{if(this.eq(A))return e.eq(v)||e.eq(E)?A:e.eq(A)?v:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:E:(o=this.sub(e.mul(n)),r=n.add(o.div(e)));if(e.eq(A))return this.unsigned?_:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=g}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:l(2,a-48),p=s(n),f=p.mul(e);f.isNegative()||f.gt(o);)f=(p=s(n-=u,this.unsigned)).mul(e);p.isZero()&&(p=v),r=r.add(p),o=o.sub(f)}return r},T.div=T.divide,T.modulo=function(e){return i(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return c(~this.low,~this.high,this.unsigned)},T.and=function(e){return i(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return i(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return i(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<>>32-e,this.unsigned):c(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,i){return i?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3524:()=>{},1170:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});const i={}},4461:()=>{},66685:(e,t,n)=>{var i;!function(o,r,a){if(o){for(var s,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},l={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p=1;p<20;++p)c[111+p]="f"+p;for(p=0;p<=9;++p)c[p+96]=p.toString();y.prototype.bind=function(e,t,n){var i=this;return e=e instanceof Array?e:[e],i._bindMultiple.call(i,e,t,n),i},y.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},y.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(v(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);s=null},y.init=function(){var e=y(r);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),o.Mousetrap=y,e.exports&&(e.exports=y),void 0===(i=function(){return y}.call(t,n,t,e))||(e.exports=i)}function f(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function h(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:l[e.which]?l[e.which]:String.fromCharCode(e.which).toLowerCase()}function m(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function g(e,t,n){return n||(n=function(){if(!s)for(var e in s={},c)e>95&&e<112||c.hasOwnProperty(e)&&(s[c[e]]=e);return s}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function _(e,t){var n,i,o,r=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?p(e,s,n,i):(a=_(e,i),t._callbacks[a.key]=t._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},o,e,r),t._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:r,combo:e}))}t._handleKey=function(e,t,n){var i,o=l(e,t,n),r={},d=0,p=!1;for(i=0;i{var t=1e3,n=60*t,i=60*n,o=24*i,r=7*o,a=365.25*o;function s(e,t,n,i){var o=t>=1.5*n;return Math.round(e/n)+" "+i+(o?"s":"")}e.exports=function(e,c){c=c||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===l&&isFinite(e))return c.long?function(e){var r=Math.abs(e);if(r>=o)return s(e,r,o,"day");if(r>=i)return s(e,r,i,"hour");if(r>=n)return s(e,r,n,"minute");if(r>=t)return s(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=o)return Math.round(e/o)+"d";if(r>=i)return Math.round(e/i)+"h";if(r>=n)return Math.round(e/n)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},26275:(e,t,n)=>{"use strict";n.d(t,{wT:()=>He,uT:()=>x,sy:()=>Re,Ds:()=>Ge});var i=n(50959),o=n(10422);function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||s,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,u=/\/\*[^]*?\*\/| +/g,d=/\n+/g,p=(e,t)=>{let n="",i="",o="";for(let r in e){let a=e[r];"@"==r[0]?"i"==r[1]?n=r+" "+a+";":i+="f"==r[1]?p(a,r):r+"{"+p(a,"k"==r[1]?"":t)+"}":"object"==typeof a?i+=p(a,t?t.replace(/([^,])+/g,(e=>r.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):r):null!=a&&(r=/^--/.test(r)?r:r.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=p.p?p.p(r,a):r+":"+a+";")}return n+(t&&o?t+"{"+o+"}":o)+i},f={},h=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+h(e[n]);return t}return e},m=(e,t,n,i,o)=>{let r=h(e),a=f[r]||(f[r]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(r));if(!f[a]){let t=r!==e?e:(e=>{let t,n,i=[{}];for(;t=l.exec(e.replace(u,""));)t[4]?i.shift():t[3]?(n=t[3].replace(d," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(d," ").trim();return i[0]})(e);f[a]=p(o?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&f.g?f.g:null;return n&&(f.g=f[a]),((e,t,n,i)=>{i?t.data=t.data.replace(i,e):-1===t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(f[a],t,i,s),a},g=(e,t,n)=>e.reduce(((e,i,o)=>{let r=t[o];if(r&&r.call){let e=r(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;r=t?"."+t:e&&"object"==typeof e?e.props?"":p(e,""):!1===e?"":e}return e+i+(null==r?"":r)}),"");function _(e){let t=this||{},n=e.call?e(t.p):e;return m(n.unshift?n.raw?g(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,c(t.target),t.g,t.o,t.k)}_.bind({g:1}),_.bind({k:1});function v(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var T=function(){return""},O=i.createContext({enqueueSnackbar:T,closeSnackbar:T}),I="@media (max-width:599.95px)",C="@media (min-width:600px)",N=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},L=function(e){return""+N(e.vertical)+N(e.horizontal)},R=function(e){return!!e||0===e},P="unmounted",k="exited",D="entering",w="entered",M="exiting",x=function(e){function t(t){var n;n=e.call(this,t)||this;var i,o=t.appear;return n.appearStatus=null,t.in?o?(i=k,n.appearStatus=D):i=w:i=t.unmountOnExit||t.mountOnEnter?P:k,n.state={status:i},n.nextCallback=null,n}b(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===P?{status:k}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==D&&n!==w&&(t=D):n!==D&&n!==w||(t=M)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===D?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===k&&this.setState({status:P})},n.performEnter=function(e){var t=this,n=this.props.enter,i=e,o=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,i),this.safeSetState({status:D},(function(){t.props.onEntering&&t.props.onEntering(t.node,i),t.onTransitionEnd(o.enter,(function(){t.safeSetState({status:w},(function(){t.props.onEntered&&t.props.onEntered(t.node,i)}))}))}))):this.safeSetState({status:w},(function(){t.props.onEntered&&t.props.onEntered(t.node,i)}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:M},(function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:k},(function(){e.props.onExited&&e.props.onExited(e.node)}))}))}))):this.safeSetState({status:k},(function(){e.props.onExited&&e.props.onExited(e.node)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;this.node&&!n?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===P)return null;var t=this.props;return(0,t.children)(e,S(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},y(t,[{key:"node",get:function(){var e,t=null===(e=this.props.nodeRef)||void 0===e?void 0:e.current;if(!t)throw new Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(i.Component);function U(){}function V(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function F(e,t){return(0,i.useMemo)((function(){return null==e&&null==t?null:function(n){V(e,n),V(t,n)}}),[e,t])}function B(e){var t=e.timeout,n=e.style,i=void 0===n?{}:n,o=e.mode;return{duration:"object"==typeof t?t[o]||0:t,easing:i.transitionTimingFunction,delay:i.transitionDelay}}x.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:U,onEntering:U,onEntered:U,onExit:U,onExiting:U,onExited:U};var H="cubic-bezier(0.4, 0, 0.2, 1)",G="cubic-bezier(0.0, 0, 0.2, 1)",K="cubic-bezier(0.4, 0, 0.6, 1)",W=function(e){e.scrollTop=e.scrollTop},Y=function(e){return Math.round(e)+"ms"};function j(e,t){void 0===e&&(e=["all"]);var n=t||{},i=n.duration,o=void 0===i?300:i,r=n.easing,a=void 0===r?H:r,s=n.delay,c=void 0===s?0:s;return(Array.isArray(e)?e:[e]).map((function(e){var t="string"==typeof o?o:Y(o),n="string"==typeof c?c:Y(c);return e+" "+t+" "+a+" "+n})).join(",")}function z(e){var t=function(e){return e&&e.ownerDocument||document}(e);return t.defaultView||window}function J(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),o=z(t);if(t.fakeTransform)n=t.fakeTransform;else{var r=o.getComputedStyle(t);n=r.getPropertyValue("-webkit-transform")||r.getPropertyValue("transform")}var a=0,s=0;if(n&&"none"!==n&&"string"==typeof n){var c=n.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),s=parseInt(c[5],10)}switch(e){case"left":return"translateX("+(o.innerWidth+a-i.left)+"px)";case"right":return"translateX(-"+(i.left+i.width-a)+"px)";case"up":return"translateY("+(o.innerHeight+s-i.top)+"px)";default:return"translateY(-"+(i.top+i.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var q=(0,i.forwardRef)((function(e,t){var n=e.children,o=e.direction,r=void 0===o?"down":o,a=e.in,s=e.style,c=e.timeout,l=void 0===c?0:c,u=e.onEnter,d=e.onEntered,p=e.onExit,f=e.onExited,h=S(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),m=(0,i.useRef)(null),g=F(n.ref,m),_=F(g,t),v=(0,i.useCallback)((function(){m.current&&J(r,m.current)}),[r]);return(0,i.useEffect)((function(){if(!a&&"down"!==r&&"right"!==r){var e=function(e,t){var n;function i(){for(var i=this,o=arguments.length,r=new Array(o),a=0;a-1,r=e.snacks.findIndex(t)>-1;if(i||r)return e}return n.handleDisplaySnack(E({},e,{queue:[].concat(e.queue,[p])}))})),u},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?E({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some((function(e){return!e.open||e.requestClose})))return e;var t=!1,i=!1;e.snacks.reduce((function(e,t){return e+(t.open&&t.persist?1:0)}),0)===n.maxSnack&&(i=!0);var o=e.snacks.map((function(e){return t||e.persist&&!i?E({},e):(t=!0,e.entered?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),E({},e,{open:!1})):E({},e,{requestClose:!0}))}));return E({},e,{snacks:o})},n.handleEnteredSnack=function(e,t,i){if(!R(i))throw new Error("handleEnteredSnack Cannot be called with undefined key");n.setState((function(e){return{snacks:e.snacks.map((function(e){return e.id===i?E({},e,{entered:!0}):E({},e)}))}}))},n.handleCloseSnack=function(e,t,i){n.props.onClose&&n.props.onClose(e,t,i);var o=void 0===i;n.setState((function(e){var t=e.snacks,n=e.queue;return{snacks:t.map((function(e){return o||e.id===i?e.entered?E({},e,{open:!1}):E({},e,{requestClose:!0}):E({},e)})),queue:n.filter((function(e){return e.id!==i}))}}))},n.closeSnackbar=function(e){var t=n.state.snacks.find((function(t){return t.id===e}));R(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!R(t))throw new Error("handleExitedSnack Cannot be called with undefined key");n.setState((function(e){var i=n.processQueue(E({},e,{snacks:e.snacks.filter((function(e){return e.id!==t}))}));return 0===i.queue.length?i:n.handleDismissOldest(i)}))},n.enqueueSnackbar,Re=n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(A(n)),closeSnackbar:n.closeSnackbar.bind(A(n))}},n}return b(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,a=n.children,s=n.dense,c=void 0!==s&&s,l=n.Components,u=void 0===l?{}:l,d=n.classes,p=this.state.snacks.reduce((function(e,t){var n,i=L(t.anchorOrigin),o=e[i]||[];return E({},e,((n={})[i]=[].concat(o,[t]),n))}),{}),f=Object.keys(p).map((function(t){var n=p[t],o=n[0];return i.createElement(Fe,{key:t,dense:c,anchorOrigin:o.anchorOrigin,classes:d},n.map((function(t){return i.createElement(De,{key:t.id,snack:t,classes:d,Component:u[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:me([e.handleExitedSnack,e.props.onExited],t.id),onEntered:me([e.handleEnteredSnack,e.props.onEntered],t.id)})})))}));return i.createElement(O.Provider,{value:t},a,r?(0,o.createPortal)(f,r):f)},y(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||te.maxSnack}}]),t}(i.Component),Ge=function(){return(0,i.useContext)(O)}},37885:(e,t,n)=>{"use strict";n.d(t,{E:()=>a});var i=n(50959),o=n(67446),r=n.n(o);class a extends i.Component{constructor(e){super(e),this._osInstance=null,this._osTargetRef=i.createRef()}osInstance(){return this._osInstance}osTarget(){return this._osTargetRef.current||null}componentDidMount(){this._osInstance=r()(this.osTarget(),this.props.options||{},this.props.extensions),s(this._osInstance,this.props.className)}componentWillUnmount(){r().valid(this._osInstance)&&(this._osInstance.destroy(),this._osInstance=null)}componentDidUpdate(e){r().valid(this._osInstance)&&(this._osInstance.options(this.props.options),e.className!==this.props.className&&s(this._osInstance,this.props.className))}render(){const e=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);oe.match(i))).join(" ");n.className=`${o} ${t||""}`}}},67446:function(e,t,n){var i;!function(o,r){i=function(){return function(e,t,n){"use strict";var i="OverlayScrollbars",o={o:"object",f:"function",a:"array",s:"string",b:"boolean",n:"number",u:"undefined",z:"null"},r={c:"class",s:"style",i:"id",l:"length",p:"prototype",ti:"tabindex",oH:"offsetHeight",cH:"clientHeight",sH:"scrollHeight",oW:"offsetWidth",cW:"clientWidth",sW:"scrollWidth",hOP:"hasOwnProperty",bCR:"getBoundingClientRect"},a=function(){var i={},o={},s=["-webkit-","-moz-","-o-","-ms-"],c=["WebKit","Moz","O","MS"];function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}return{_cssPrefixes:s,_jsPrefixes:c,_cssProperty:function(e){var i=o[e];if(o[r.hOP](e))return i;for(var a,c,u,d=l(e),p=t.createElement("div")[r.s],f=0;f0&&t-1 in e)}function A(e){return(e.match(i)||[]).join(a)}function T(e,n){for(var i=(e.parentNode||t).querySelectorAll(n)||[],o=i[r.l];o--;)if(i[o]==e)return!0;return!1}function O(e,t,n){if(s.isA(n))for(var i=0;i0?(i=e.q[0],R(e.el,i.props,i.duration,i.easing,i.complete,!0)):(n=_(e,f))>-1&&f.splice(n,1)}function L(e,t,n){t===d||t===p?e[t]=n:I(e,t,n)}function R(e,t,i,o,a,l){var h,m,g,b,S,A,T=E(i),O={},I={},C=0;for(T?(o=i.easing,i.start,g=i.progress,b=i.step,S=i.specialEasing,a=i.complete,A=i.duration):A=i,S=S||{},A=A||400,o=o||"swing",l=l||!1;C0)U=s.now(),V=function(){for(h in R=s.now(),F=R-U,P=H.stop||F>=A,k=1-(c.max(0,U+A-R)/A||0),I)w=parseFloat(O[h]),M=parseFloat(I[h]),x=(M-w)*u[S[h]||o](k,k*A,0,1,A)+w,L(e,h,x),v(b)&&b(x,{elem:e,prop:h,start:w,now:x,end:M,pos:k,options:{easing:o,speacialEasing:S,duration:A,complete:a,step:b},startTime:U});v(g)&&g({},k,c.max(0,A-F)),P?(N(m),v(a)&&a()):H.frame=s.rAF()(V)},H.frame=s.rAF()(V);else{for(h in I)L(e,h,I[h]);N(m)}}}function P(e,t,n){for(var i,o,a,c=0;c0){if((o=i.q[0]).stop=!0,s.cAF()(o.frame),i.q.splice(0,1),n)for(a in o.props)L(e,a,o.props[a]);t?i.q=[]:N(i,!1)}break}}function k(e){return!!(e[r.oW]||e[r.oH]||e.getClientRects()[r.l])}function D(n){if(0===arguments[r.l])return this;var i,a,s=new D,c=n,l=0;if(h(n)==o.s)for(c=[],"<"===n.charAt(0)?((a=t.createElement("div")).innerHTML=n,i=a.children):i=t.querySelectorAll(n);l0;)o=o.childNodes[0];for(t=0;n[r.l]-t;o.firstChild===n[0]&&t++)o.appendChild(n[t]);var c=s?s.nextSibling:a.firstChild;return a.insertBefore(i,c),this},wrapInner:function(e){return this.each((function(){var t=D(this),n=t.contents();n[r.l]?n.wrapAll(e):t.append(e)}))},wrap:function(e){return this.each((function(){D(this).wrapAll(e)}))},css:function(t,i){var a,s,c,l=e.getComputedStyle;return h(t)==o.s?i===n?(a=this[0],c=l?l(a,null):a.currentStyle[t],l?null!=c?c.getPropertyValue(t):a[r.s][t]:c):this.each((function(){I(this,t,i)})):this.each((function(){for(s in t)I(this,s,t[s])}))},hasClass:function(e){for(var t,n,i=0,o=a+e+a;t=this[i++];){if((n=t.classList)&&n.contains(e))return!0;if(1===t.nodeType&&(a+A(t.className+l)+a).indexOf(o)>-1)return!0}return!1},addClass:function(e){var t,o,r,s,c,u,d,p,f=0,h=0;if(e)for(t=e.match(i)||[];o=this[f++];)if(p=o.classList,d===n&&(d=p!==n),d)for(;c=t[h++];)p.add(c);else if(s=o.className+l,r=1===o.nodeType&&a+A(s)+a){for(;c=t[h++];)r.indexOf(a+c+a)<0&&(r+=c+a);s!==(u=A(r))&&(o.className=u)}return this},removeClass:function(e){var t,o,r,s,c,u,d,p,f=0,h=0;if(e)for(t=e.match(i)||[];o=this[f++];)if(p=o.classList,d===n&&(d=p!==n),d)for(;c=t[h++];)p.remove(c);else if(s=o.className+l,r=1===o.nodeType&&a+A(s)+a){for(;c=t[h++];)for(;r.indexOf(a+c+a)>-1;)r=r.replace(a+c+a,a);s!==(u=A(r))&&(o.className=u)}return this},hide:function(){return this.each((function(){this[r.s].display="none"}))},show:function(){return this.each((function(){this[r.s].display="block"}))},attr:function(e,t){for(var i,o=0;i=this[o++];){if(t===n)return i.getAttribute(e);i.setAttribute(e,t)}return this},removeAttr:function(e){return this.each((function(){this.removeAttribute(e)}))},offset:function(){var n=this[0][r.bCR](),i=e.pageXOffset||t.documentElement[d],o=e.pageYOffset||t.documentElement[p];return{top:n.top+o,left:n.left+i}},position:function(){var e=this[0];return{top:e.offsetTop,left:e.offsetLeft}},scrollLeft:function(e){for(var t,i=0;t=this[i++];){if(e===n)return t[d];t[d]=e}return this},scrollTop:function(e){for(var t,i=0;t=this[i++];){if(e===n)return t[p];t[p]=e}return this},val:function(e){var t=this[0];return e?(t.value=e,this):t.value},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){return D(this[e>=0?e:this[r.l]+e])},find:function(e){var t,n=[];return this.each((function(){var i=this.querySelectorAll(e);for(t=0;t-1){if(!(n>1))return h[i][m];delete e[m],h.splice(i,1)}}}),f=function(){var u,f,h,m,g,_,v,y,E,b,S,A,T,O,I,C,N=[],L=(m=s.type,g=[o.b,o.n,o.s,o.a,o.o,o.f,o.z],_=" ",v=":",y=[o.z,o.s],E=o.n,b=[o.z,o.b],S=[!0,o.b],A=[!1,o.b],T=[null,[o.z,o.f]],O="v-h:visible-hidden v-s:visible-scroll s:scroll h:hidden",I={className:["os-theme-dark",y],resize:["none","n:none b:both h:horizontal v:vertical"],sizeAutoCapable:S,clipAlways:S,normalizeRTL:S,paddingAbsolute:A,autoUpdate:[null,b],autoUpdateInterval:[33,E],updateOnLoad:[["img"],[o.s,o.a,o.z]],nativeScrollbarsOverlaid:{showNativeScrollbars:A,initialize:S},overflowBehavior:{x:["scroll",O],y:["scroll",O]},scrollbars:{visibility:["auto","v:visible h:hidden a:auto"],autoHide:["never","n:never s:scroll l:leave m:move"],autoHideDelay:[800,E],dragScrolling:S,clickScrolling:A,touchSupport:S,snapHandle:A},textarea:{dynWidth:A,dynHeight:A,inheritedAttrs:[["style","class"],[o.s,o.a,o.z]]},callbacks:{onInitialized:T,onInitializationWithdrawn:T,onDestroyed:T,onScrollStart:T,onScroll:T,onScrollStop:T,onOverflowChanged:T,onOverflowAmountChanged:T,onDirectionChanged:T,onContentSizeChanged:T,onHostSizeChanged:T,onUpdated:T}},{_defaults:(C=function(e){var t=function(n){var i,a,s;for(i in n)n[r.hOP](i)&&(a=n[i],(s=m(a))==o.a?n[i]=a[e?1:0]:s==o.o&&(n[i]=t(a)));return n};return t(d.extend(!0,{},I))})(),_template:C(!0),_validate:function(t,i,a,c){var l={},u={},p=d.extend(!0,{},t),f=d.inArray,h=d.isEmptyObject,y=function(e,t,i,c,l,u){for(var p in t)if(t[r.hOP](p)&&e[r.hOP](p)){var E,b,S,A,T,O,I,C,N=!1,L=!1,R=t[p],P=m(R),k=P==o.o,D=s.isA(R)?R:[R],w=i[p],M=e[p],x=m(M),U=u?u+".":"",V='The option "'+U+p+"\" wasn't set, because",F=[],B=[];if(w=w===n?{}:w,k&&x==o.o)c[p]={},l[p]={},y(M,R,w,c[p],l[p],U+p),d.each([e,c,l],(function(e,t){h(t[p])&&delete t[p]}));else if(!k){for(O=0;O0?"\r\nValid strings are: [ "+B.join(", ").split(v).join(", ")+" ].":"")),delete e[p]}}};return y(p,i,c||{},l,u),!h(p)&&a&&console.warn("The following options are discarded due to invalidity:\r\n"+e.JSON.stringify(p,null,2)),{_default:l,_prepared:u}}});function R(){f||(f=new P(L._defaults)),h||(h=new k(f))}function P(t){var n=this,i="overflow",o="hidden",l="scroll",u=d("body"),f=d('
'),h=f[0],m=d(f.children("div").eq(0));u.append(f),f.hide().show();var g=y(h),_={x:0===g.x,y:0===g.y},v=function(){var t,n=e.navigator.userAgent,i="indexOf",o="substring",r=n[i]("MSIE "),a=n[i]("Trident/"),s=n[i]("Edge/"),c=n[i]("rv:"),l=parseInt;return r>0?t=l(n[o](r+5,n[i](".",r)),10):a>0?t=l(n[o](c+3,n[i](".",c)),10):s>0&&(t=l(n[o](s+5,n[i](".",s)),10)),t}();function y(e){return{x:e[r.oH]-e[r.cH],y:e[r.oW]-e[r.cW]}}d.extend(n,{defaultOptions:t,msie:v,autoUpdateLoop:!1,autoUpdateRecommended:!s.mO(),nativeScrollbarSize:g,nativeScrollbarIsOverlaid:_,nativeScrollbarStyling:function(){var t=!1;f.addClass("os-viewport-native-scrollbars-invisible");try{t="none"===f.css("scrollbar-width")&&(v>9||!v)||"none"===e.getComputedStyle(h,"::-webkit-scrollbar").getPropertyValue("display")}catch(e){}return t}(),overlayScrollbarDummySize:{x:30,y:30},cssCalc:a._cssPropertyValue("width","calc","(1px)")||null,restrictedMeasuring:function(){f.css(i,o);var e={w:h[r.sW],h:h[r.sH]};f.css(i,"visible");var t={w:h[r.sW],h:h[r.sH]};return e.w-t.w!=0||e.h-t.h!=0}(),rtlScrollBehavior:function(){f.css({"overflow-y":o,"overflow-x":l,direction:"rtl"}).scrollLeft(0);var e=f.offset(),t=m.offset();f.scrollLeft(-999);var n=m.offset();return{i:e.left===t.left,n:t.left!==n.left}}(),supportTransform:!!a._cssProperty("transform"),supportTransition:!!a._cssProperty("transition"),supportPassiveEvents:function(){var t=!1;try{e.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){t=!0}}))}catch(e){}return t}(),supportResizeObserver:!!s.rO(),supportMutationObserver:!!s.mO()}),f.removeAttr(r.s).remove(),function(){if(!_.x||!_.y){var t=c.abs,i=s.wW(),o=s.wH(),r=h(),a=function(){if(p().length>0){var e=s.wW(),a=s.wH(),m=e-i,g=a-o;if(0===m&&0===g)return;var _,v=c.round(e/(i/100)),E=c.round(a/(o/100)),b=t(m),S=t(g),A=t(v),T=t(E),O=h(),I=b>2&&S>2,C=!l(A,T),N=I&&C&&(O!==r&&r>0),L=n.nativeScrollbarSize;N&&(u.append(f),_=n.nativeScrollbarSize=y(f[0]),f.remove(),L.x===_.x&&L.y===_.y||d.each(p(),(function(){p(this)&&p(this).update("zoom")}))),i=e,o=a,r=O}};d(e).on("resize",a)}function l(e,n){var i=t(e),o=t(n);return!(i===o||i+1===o||i-1===o)}function h(){var t=e.screen.deviceXDPI||0,n=e.screen.logicalXDPI||1;return e.devicePixelRatio||t/n}}()}function k(e){var t,i=this,o=d.inArray,a=s.now,l="autoUpdate",u=l+"Interval",p=r.l,f=[],h=[],m=!1,g=33,_=g,v=a(),y=function(){if(f[p]>0&&m){t=s.rAF()((function(){y()}));var e,i,o,r,d,E,b=a(),S=b-v;if(S>_){v=b-S%_,e=g;for(var A=0;Ad&&(i.update("auto"),h[A]=new Date(E+=d)),e=c.max(1,c.min(e,d)));_=e}}else _=g};i.add=function(t){-1===o(t,f)&&(f.push(t),h.push(a()),f[p]>0&&!m&&(m=!0,e.autoUpdateLoop=m,y()))},i.remove=function(i){var r=o(i,f);r>-1&&(h.splice(r,1),f.splice(r,1),0===f[p]&&m&&(m=!1,e.autoUpdateLoop=m,t!==n&&(s.cAF()(t),t=-1)))}}function D(i,f,h,m,g){var _=s.type,v=d.inArray,y=d.each,E=new u,b=d[r.p];if(_o(i)){if(p(i)){var S=p(i);return S.options(f),S}var A,T,O,I,C,N,R,P,k,D,w,M,x,U,V,F,B,H,G,K,W,Y,j,z,J,q,X,Z,Q,$,ee,te,ne,ie,oe,re,ae,se,ce,le,ue,de,pe,fe,he,me,ge,_e,ve,ye,Ee,be,Se,Ae,Te,Oe,Ie,Ce,Ne,Le,Re,Pe,ke,De,we,Me,xe,Ue,Ve,Fe,Be,He,Ge,Ke,We,Ye,je,ze,Je,qe,Xe,Ze,Qe,$e,et,tt,nt,it,ot,rt,at,st,ct,lt,ut,dt,pt,ft,ht,mt,gt,_t,vt,yt,Et,bt,St,At,Tt,Ot,It,Ct,Nt,Lt,Rt,Pt,kt,Dt,wt,Mt,xt={},Ut={},Vt={},Ft={},Bt={},Ht="-hidden",Gt="margin-",Kt="padding-",Wt="border-",Yt="top",jt="right",zt="bottom",Jt="left",qt="min-",Xt="max-",Zt="width",Qt="height",$t="float",en="",tn="auto",nn="sync",on="scroll",rn="100%",an="x",sn="y",cn=".",ln=" ",un="scrollbar",dn="-horizontal",pn="-vertical",fn=on+"Left",hn=on+"Top",mn="mousedown touchstart",gn="mouseup touchend touchcancel",_n="mousemove touchmove",vn="mouseenter",yn="mouseleave",En="keydown",bn="keyup",Sn="selectstart",An="transitionend webkitTransitionEnd oTransitionEnd",Tn="__overlayScrollbarsRO__",On="os-",In=On+"html",Cn=On+"host",Nn=Cn+"-foreign",Ln=Cn+"-textarea",Rn=Cn+"-"+un+dn+Ht,Pn=Cn+"-"+un+pn+Ht,kn=Cn+"-transition",Dn=Cn+"-rtl",wn=Cn+"-resize-disabled",Mn=Cn+"-scrolling",xn=Cn+"-overflow",Un=(xn=Cn+"-overflow")+"-x",Vn=xn+"-y",Fn=On+"textarea",Bn=Fn+"-cover",Hn=On+"padding",Gn=On+"viewport",Kn=Gn+"-native-scrollbars-invisible",Wn=Gn+"-native-scrollbars-overlaid",Yn=On+"content",jn=On+"content-arrange",zn=On+"content-glue",Jn=On+"size-auto-observer",qn=On+"resize-observer",Xn=On+"resize-observer-item",Zn=Xn+"-final",Qn=On+"text-inherit",$n=On+un,ei=$n+"-track",ti=ei+"-off",ni=$n+"-handle",ii=ni+"-off",oi=$n+"-unusable",ri=$n+"-"+tn+Ht,ai=$n+"-corner",si=ai+"-resize",ci=si+"-both",li=si+dn,ui=si+pn,di=$n+dn,pi=$n+pn,fi=On+"dragging",hi=On+"theme-none",mi=[Kn,Wn,ti,ii,oi,ri,si,ci,li,ui,fi].join(ln),gi=[],_i=[r.ti],vi={},yi="added removed on contract",Ei={},bi=42,Si="load",Ai=[],Ti={},Oi=["wrap","cols","rows"],Ii=[r.i,r.c,r.s,"open"].concat(_i),Ci=[];return E.sleep=function(){Q=!0},E.update=function(e){var t,i,r,a,s;if(!V)return _(e)==o.s?e===tn?(t=Yi(),i=Wi(),(r=t||i)&&qi({_contentSizeChanged:i,_changedOptions:U?n:te})):e===nn?bt?(a=yt(_t.takeRecords()),s=Et(vt.takeRecords())):a=E.update(tn):"zoom"===e&&qi({_hostSizeChanged:!0,_contentSizeChanged:!0}):(e=Q||e,Q=!1,E.update(nn)&&!e||qi({_force:e})),Xi(),r||a||s},E.options=function(e,t){var n,i={};if(d.isEmptyObject(e)||!d.isPlainObject(e)){if(_(e)!=o.s)return ee;if(!(arguments.length>1))return Oo(ee,e);Io(i,e,t),n=Zi(i)}else n=Zi(e);d.isEmptyObject(n)||qi({_changedOptions:n})},E.destroy=function(){if(!V){for(var e in g.remove(E),Di(),Ri(de),Ri(ue),vi)E.removeExt(e);for(;Ci[r.l]>0;)Ci.pop()();Bi(!0),ge&&Do(ge),me&&Do(me),W&&Do(ue),eo(!0),co(!0),Qi(!0);for(var t=0;t2&&(s=t.substr(0,2),v(s,M)>-1&&(i=s)),t=(t=i?t.substr(2):t)[g](/min/g,0)[g](//g,(m?"-":en)+rn)[g](/px/g,en)[g](/%/g,f+p*(h&&O.n?-1:1)/100)[g](/vw/g,f+Ft.w)[g](/vh/g,f+Ft.h),r=yo(isNaN(t)?yo(y(t),!0).toFixed():t)):r=t,r!==n&&!isNaN(r)&&_(r)==o.n){var E=P&&h,b=d*(E&&O.n?-1:1),S=E&&O.i,A=E&&O.n;switch(b=S?p-b:b,i){case"+=":a=b+r;break;case"-=":a=b-r;break;case"*=":a=b*r;break;case"/=":a=b/r;break;default:a=r}a=S?p-a:a,a*=A?-1:1,a=h&&O.n?c.min(0,c.max(p,a)):c.max(0,c.min(p,a))}return a===d?n:a}function se(e,t,n,i){var r,a,s=[n,n],c=_(e);if(c==t)e=[e,e];else if(c==o.a){if((r=e[z])>2||r<1)e=s;else for(1===r&&(e[1]=n),b=0;b0){ue=_e==o.n||_e==o.b?ce([ue,ue,ue,ue]):_e==o.a?2===(le=ue[z])?ce([ue[0],ue[1],ue[0],ue[1]]):le>=4?ce(ue):ge:_e==o.o?ce([ue[Yt],ue[jt],ue[zt],ue[Jt]]):ge,I=oe(de,J)?de:"xy",C=se(he,o.s,W,X),N=se(me,o.s,H,q),L=ue;var ve={l:Ut._currentScroll,t:Vt._currentScroll},ye=pe.offset(),Ee=R.offset(),be={x:C.x==Y||I==sn,y:C.y==Y||I==an};Ee[Yt]-=L[0],Ee[Jt]-=L[3];var Se={x:c.round(Ee[Jt]-ye[Jt]+ve.l),y:c.round(Ee[Yt]-ye[Yt]+ve.t)};if(Z&&(O.n||O.i||(Se.x=c.round(ye[Jt]-Ee[Jt]+ve.l)),O.n&&P&&(Se.x*=-1),O.i&&P&&(Se.x=c.round(ye[Jt]-Ee[Jt]+(Ut._maxScroll-ve.l)))),N.x!=H||N.y!=H||C.x==j||C.y==j||Z){var Ae=R[0],Te=D?Ae[r.bCR]():{width:Ae[r.oW],height:Ae[r.oH]},Oe={w:Te[Zt]+L[3]+L[1],h:Te[Qt]+L[0]+L[2]},Ie=function(e){var t=so(e),n=t._w_h,i=t._left_top,o=t._x_y,r=N[o]==(e&&Z?H:B),a=N[o]==G,s=N[o]==K,c=C[o]==Y,l=C[o]==j,u=Ft[n],d=ye[i],p=Oe[n],f=Ee[i],h=a?2:1,m=f+p/2,g=d+u/2,_=p<=u&&f>=d&&f+p<=d+u;c?be[o]=!0:be[o]||((s||l)&&(be[o]=!!l&&_,r=pg:m0||x)?x?(t.complete=ie,fe.animate(V,t)):(T={duration:t,complete:ie},s.isA(i)||d.isPlainObject(i)?(F[fn]=i[0]||i.x,F[hn]=i[1]||i.y,T.specialEasing=F):T.easing=i,fe.animate(V,T)):(S&&fe[fn](V[fn]),A&&fe[hn](V[hn]),ne())},E.scrollStop=function(e,t,n){return fe.stop(e,t,n),E},E.getElements=function(e){var t={target:Ce,host:Ne,padding:Pe,viewport:ke,content:De,scrollbarHorizontal:{scrollbar:ye[0],track:Ee[0],handle:be[0]},scrollbarVertical:{scrollbar:Se[0],track:Ae[0],handle:Te[0]},scrollbarCorner:ve[0]};return _(e)==o.s?Oo(t,e):t},E.getState=function(e){function t(e){if(!d.isPlainObject(e))return e;var t=Lo({},e),n=function(e,n){t[r.hOP](e)&&(t[n]=t[e],delete t[e])};return n("w",Zt),n("h",Qt),delete t.c,t}var n={destroyed:!!t(V),sleeping:!!t(Q),autoUpdate:t(!bt),widthAuto:t(Fe),heightAuto:t(Be),padding:t(Ge),overflowAmount:t(Ze),hideOverflow:t(Ve),hasOverflow:t(Ue),contentScrollSize:t(Me),viewportSize:t(Ft),hostSize:t(we),documentMixed:t(H)};return _(e)==o.s?Oo(n,e):n},E.ext=function(e){var t,n=yi.split(" "),i=0;if(_(e)==o.s){if(vi[r.hOP](e))for(t=Lo({},vi[e]);i9||!I){e.prepend(Ao(qn,Ao({c:Xn,dir:"ltr"},Ao(Xn,Ao(Zn))+Ao(Xn,Ao({c:Zn,style:"width: 200%; height: 200%"})))));var p,f,h,g,_=e[0][c][0][c][0],v=d(_[c][1]),y=d(_[c][0]),E=d(y[0][c][0]),b=_[r.oW],S=_[r.oH],A=2,T=m.nativeScrollbarSize,N=function(){y[fn](l)[hn](l),v[fn](l)[hn](l)},L=function(){f=0,p&&(b=h,S=g,u())},R=function(e){return h=_[r.oW],g=_[r.oH],p=h!=b||g!=S,e&&p&&!f?(s.cAF()(f),f=s.rAF()(L)):e||L(),N(),e&&(s.prvD(e),s.stpP(e)),!1},P={},k={};po(k,en,[-(T.y+1)*A,T.x*-A,T.y*-A,-(T.x+1)*A]),d(_).css(k),y.on(on,R),v.on(on,R),e.on(a,(function(){R(!1)})),P[Zt]=l,P[Qt]=l,E.css(P),N()}else{var D=Ie.attachEvent,w=C!==n;if(D)e.prepend(Ao(qn)),wo(e,cn+qn)[0].attachEvent("onresize",u);else{var x=Ie.createElement(o.o);x.setAttribute(r.ti,"-1"),x.setAttribute(r.c,qn),x.onload=function(){var e=this.contentDocument.defaultView;e.addEventListener("resize",u),e.document.documentElement.style.display="none"},x.type="text/html",w&&e.prepend(x),x.data="about:blank",w||e.prepend(x),e.on(a,u)}}if(e[0]===Re){var U=function(){var e=le.css("direction"),t={},n=0,i=!1;return e!==je&&("ltr"===e?(t[Jt]=0,t[jt]=tn,n=l):(t[Jt]=tn,t[jt]=0,n=O.n?-l:O.i?0:l),de.children().eq(0).css(t),de[fn](n)[hn](l),je=e,i=!0),i};U(),Li(e,on,(function(e){return U()&&qi(),s.prvD(e),s.stpP(e),!1}))}}else if(M){var V,F=(V=e.contents()[0])[Tn];F&&(F.disconnect(),delete V[Tn])}else Do(e.children(cn+qn).eq(0))}}function Pi(){if(x){var e,t,n,i,o,a,c,l,u,d,p=11,f=s.mO(),h=s.now();Et=function(e){var t=!1;return U&&!Q&&(y(e,(function(){return!(t=Ki(this))})),t&&(l=s.now(),u=Be||Fe,d=function(){V||(h=l,F&&Ji(),u?qi():E.update(tn))},clearTimeout(c),p<=0||l-h>p||!u?d():c=setTimeout(d,p))),t},_t=new f(yt=function(s){var c,l=!1,u=!1,d=[];return U&&!Q&&(y(s,(function(){e=(c=this).target,t=c.attributeName,n=t===r.c,i=c.oldValue,o=e.className,G&&n&&!u&&i.indexOf(Nn)>-1&&o.indexOf(Nn)<0&&(a=mo(!0),Ne.className=o.split(ln).concat(i.split(ln).filter((function(e){return e.match(a)}))).join(ln),l=u=!0),l||(l=n?Gi(i,o):t!==r.s||i!==e[r.s].cssText),d.push(t)})),zi(d),l&&E.update(u||tn)),l}),vt=new f(Et)}}function ki(){x&&!bt&&(_t.observe(Ne,{attributes:!0,attributeOldValue:!0,attributeFilter:Ii}),vt.observe(F?Ce:De,{attributes:!0,attributeOldValue:!0,subtree:!F,childList:!F,characterData:!F,attributeFilter:F?Oi:Ii}),bt=!0)}function Di(){x&&bt&&(_t.disconnect(),vt.disconnect(),bt=!1)}function wi(){if(!Q){var e,t={w:Re[r.sW],h:Re[r.sH]};e=No(t,nt),nt=t,e&&qi({_hostSizeChanged:!0})}}function Mi(){Lt&&io(!0)}function xi(){Lt&&!se.hasClass(fi)&&io(!1)}function Ui(){Nt&&(io(!0),clearTimeout(Tt),Tt=setTimeout((function(){Nt&&!V&&io(!1)}),100))}function Vi(e){return s.prvD(e),!1}function Fi(e){if(!V){var t=e.target,n=d(e.target),i=d.inArray(t,Ai);i>-1&&Ai.splice(i,1),Co((function(e,t){n.is(t)&&qi({_contentSizeChanged:!0})}))}}function Bi(e){e||Bi(!0),Ni(le,_n.split(ln)[0],Ui,!Nt||e,!0),Ni(le,[vn,yn],[Mi,xi],!Lt||e,!0),U||e||le.one("mouseover",Mi)}function Hi(){var e={};return B&&me&&(e.w=yo(me.css(qt+Zt)),e.h=yo(me.css(qt+Qt)),e.c=No(e,gt),e.f=!0),gt=e,!!e.c}function Gi(e,t){var n,i,a=typeof t==o.s?t.split(ln):[],s=vo(typeof e==o.s?e.split(ln):[],a),c=v(hi,s);if(c>-1&&s.splice(c,1),s[r.l]>0)for(i=mo(!0,!0),n=0;n0}}function ji(e){if(!U)return!0;var t="flex-grow",n="flex-shrink",i="flex-basis",o=[Zt,qt+Zt,Xt+Zt,Gt+Jt,Gt+jt,Jt,jt,"font-weight","word-spacing",t,n,i],a=[Kt+Jt,Kt+jt,Wt+Jt+Zt,Wt+jt+Zt],s=[Qt,qt+Qt,Xt+Qt,Gt+Yt,Gt+zt,Yt,zt,"line-height",t,n,i],c=[Kt+Yt,Kt+zt,Wt+Yt+Zt,Wt+zt+Zt],l="s",u="v-s",d=Xe.x===l||Xe.x===u,p=!1,f=function(e,t){for(var n=0;n-1){var n=ce.attr(t);_(n)==o.s?fe.attr(t,n):fe.removeAttr(t)}}))}function Ji(){if(!Q){var e,t,n,i,o=!dt,a=Ft.w,s=Ft.h,l={},u=Fe||o;return l[qt+Zt]=en,l[qt+Qt]=en,l[Zt]=tn,ce.css(l),e=Ce[r.oW],t=u?c.max(e,Ce[r.sW]-1):1,l[Zt]=Fe?tn:rn,l[qt+Zt]=rn,l[Qt]=tn,ce.css(l),n=Ce[r.oH],i=c.max(n,Ce[r.sH]-1),l[Zt]=t,l[Qt]=i,_e.css(l),l[qt+Zt]=a,l[qt+Qt]=s,ce.css(l),{_originalWidth:e,_originalHeight:n,_dynamicWidth:t,_dynamicHeight:i}}}function qi(e){clearTimeout(ie),e=e||{},Ei._hostSizeChanged|=e._hostSizeChanged,Ei._contentSizeChanged|=e._contentSizeChanged,Ei._force|=e._force;var t,i=s.now(),o=!!Ei._hostSizeChanged,l=!!Ei._contentSizeChanged,u=!!Ei._force,p=e._changedOptions,f=bi>0&&U&&!V&&!u&&!p&&i-ne0?x:hi)),Ae&&(!0===Se||null===Se&&I?(Di(),g.add(E)):(g.remove(E),ki())),ye)if(se)if(ge?ge.show():(ge=d(Ao(zn)),pe.before(ge)),W)ue.show();else{ue=d(Ao(Jn)),Le=ue[0],ge.before(ue);var tt={w:-1,h:-1};Ri(ue,(function(){var e={w:Le[r.oW],h:Le[r.oH]};No(e,tt)&&(U&&Be&&e.h>0||Fe&&e.w>0||U&&!Be&&0===e.h||!Fe&&0===e.w)&&qi(),tt=e})),W=!0,null!==R&&ue.css(Qt,R+"(100% + 1px)")}else W&&ue.hide(),ge&&ge.hide();u&&(de.find("*").trigger(on),W&&ue.find("*").trigger(on)),t=t===n?le.is(":hidden"):t;var nt,_t=!!F&&"off"!==ce.attr("wrap"),vt=h(_t,dt),yt=le.css("direction"),Et=h(yt,Ye),At=le.css("box-sizing"),Tt=h(At,He),Rt=fo(Kt);try{nt=W?Le[r.bCR]():null}catch(e){return}K="border-box"===At;var Pt=(Z="rtl"===yt)?Jt:jt,Ut=Z?jt:Jt,Vt=!1,Ht=!(!W||"none"===le.css($t))&&(0===c.round(nt.right-nt.left)&&(!!ee||Ne[r.cW]-Y>0));if(se&&!Ht){var nn=Ne[r.oW],an=ge.css(Zt);ge.css(Zt,tn);var sn=Ne[r.oW];ge.css(Zt,an),(Vt=nn!==sn)||(ge.css(Zt,nn+1),sn=Ne[r.oW],ge.css(Zt,an),Vt=nn!==sn)}var cn=(Ht||Vt)&&se&&!t,un=h(cn,Fe),dn=!cn&&Fe,pn=!(!W||!se||t)&&0===c.round(nt.bottom-nt.top),mn=h(pn,Be),gn=!pn&&Be,_n=fo(Wt,"-"+Zt,!(cn&&K||!K),!(pn&&K||!K)),vn=fo(Gt),yn={},En={},bn=function(){return{w:Ne[r.cW],h:Ne[r.cH]}},Sn=function(){return{w:Pe[r.oW]+c.max(0,De[r.cW]-De[r.sW]),h:Pe[r.oH]+c.max(0,De[r.cH]-De[r.sH])}},An=Y=Rt.l+Rt.r,Tn=j=Rt.t+Rt.b;if(An*=ee?1:0,Tn*=ee?1:0,Rt.c=h(Rt,Ge),z=_n.l+_n.r,J=_n.t+_n.b,_n.c=h(_n,Ke),q=vn.l+vn.r,X=vn.t+vn.b,vn.c=h(vn,We),dt=_t,Ye=yt,He=At,Fe=cn,Be=pn,Ge=Rt,Ke=_n,We=vn,Et&&W&&ue.css($t,Ut),Rt.c||Et||oe||un||mn||Tt||ye){var On={},In={},Cn=[Rt.t,Rt.r,Rt.b,Rt.l];po(En,Gt,[-Rt.t,-Rt.r,-Rt.b,-Rt.l]),ee?(po(On,en,Cn),po(F?In:yn,Kt)):(po(On,en),po(F?In:yn,Kt,Cn)),pe.css(On),ce.css(In)}Ft=Sn();var Nn=!!F&&Ji(),Ln=F&&h(Nn,ft),Rn=F&&Nn?{w:Ie?Nn._dynamicWidth:Nn._originalWidth,h:Re?Nn._dynamicHeight:Nn._originalHeight}:{};if(ft=Nn,pn&&(mn||oe||Tt||Rt.c||_n.c)?yn[Qt]=tn:(mn||oe)&&(yn[Qt]=rn),cn&&(un||oe||Tt||Rt.c||_n.c||Et)?(yn[Zt]=tn,En[Xt+Zt]=rn):(un||oe)&&(yn[Zt]=rn,yn[$t]=en,En[Xt+Zt]=en),cn?(En[Zt]=tn,yn[Zt]=a._cssPropertyValue(Zt,"max-content intrinsic")||tn,yn[$t]=Ut):En[Zt]=en,En[Qt]=pn?Rn.h||De[r.cH]:en,se&&ge.css(En),he.css(yn),yn={},En={},o||l||Ln||Et||Tt||oe||un||cn||mn||pn||be||Oe||ae||$||S||L||M||D||Ce||je||vt){var Pn="overflow",kn=Pn+"-x",Fn=Pn+"-y",Bn="hidden",Hn="visible";if(!N){var Gn={},Wn=Ue.y&&Ve.ys&&!Ee?A.y?fe.css(Pt):-P.y:0,Yn=Ue.x&&Ve.xs&&!Ee?A.x?fe.css(zt):-P.x:0;po(Gn,en),fe.css(Gn)}var qn=So(),Xn={w:Rn.w||qn[r.cW],h:Rn.h||qn[r.cH]},Zn={w:qn[r.sW],h:qn[r.sH]};N||(Gn[zt]=gn?en:Yn,Gn[Pt]=dn?en:Wn,fe.css(Gn)),Ft=Sn();var Qn=bn(),$n={w:Qn.w-q-z-(K?0:Y),h:Qn.h-X-J-(K?0:j)},ei={w:c.max((cn?Xn.w:Zn.w)+An,$n.w),h:c.max((pn?Xn.h:Zn.h)+Tn,$n.h)};if(ei.c=h(ei,qe),qe=ei,se){(ei.c||pn||cn)&&(En[Zt]=ei.w,En[Qt]=ei.h,F||(Xn={w:qn[r.cW],h:qn[r.cH]}));var ti={},ni=function(e){var t=so(e),n=t._w_h,i=t._width_height,o=e?cn:pn,r=e?z:J,a=e?Y:j,s=e?q:X,l=Ft[n]-r-s-(K?0:a);(!o||!o&&_n.c)&&(En[i]=$n[n]-1),!(o&&Xn[n]0&&(En[i]=c.max(1,En[i]))};ni(!0),ni(!1),F&&_e.css(ti),ge.css(En)}cn&&(yn[Zt]=rn),!cn||K||bt||(yn[$t]="none"),he.css(yn),yn={};var ii={w:qn[r.sW],h:qn[r.sH]};ii.c=l=h(ii,Me),Me=ii,Ft=Sn(),o=h(Qn=bn(),we),we=Qn;var oi=F&&(0===Ft.w||0===Ft.h),ri=Ze,ai={},di={},pi={},fi={},mi={},gi={},_i={},vi=Pe[r.bCR](),yi=function(e){var t=so(e),n=so(!e)._x_y,i=t._x_y,o=t._w_h,r=t._width_height,a=on+t._Left_Top+"Max",s=vi[r]?c.abs(vi[r]-Ft[o]):0,l=ri&&ri[i]>0&&0===ke[a];ai[i]="v-s"===Te[i],di[i]="v-h"===Te[i],pi[i]="s"===Te[i],fi[i]=c.max(0,c.round(100*(ii[o]-Ft[o]))/100),fi[i]*=oi||l&&s>0&&s<1?0:1,mi[i]=fi[i]>0,gi[i]=ai[i]||di[i]?mi[n]&&!ai[n]&&!di[n]:mi[i],gi[i+"s"]=!!gi[i]&&(pi[i]||ai[i]),_i[i]=mi[i]&&gi[i+"s"]};if(yi(!0),yi(!1),fi.c=h(fi,Ze),Ze=fi,mi.c=h(mi,Ue),Ue=mi,gi.c=h(gi,Ve),Ve=gi,A.x||A.y){var Si,Ai="px solid transparent",Ti={},Oi={},Ii=u;(mi.x||mi.y)&&(Oi.w=A.y&&mi.y?ii.w+T.y:en,Oi.h=A.x&&mi.x?ii.h+T.x:en,Ii=h(Oi,xe),xe=Oi),(mi.c||gi.c||ii.c||Et||un||mn||cn||pn||be)&&(yn[Gt+Ut]=yn[Wt+Ut]=en,Si=function(e){var t=so(e),n=so(!e),i=t._x_y,o=e?zt:Pt,r=e?pn:cn;A[i]&&mi[i]&&gi[i+"s"]?(yn[Gt+o]=r?Ee?en:T[i]:en,yn[Wt+o]=e&&r||Ee?en:T[i]+Ai):(Oi[n._w_h]=yn[Gt+o]=yn[Wt+o]=en,Ii=!0)},N?ko(fe,Kn,!Ee):(Si(!0),Si(!1))),Ee&&(Oi.w=Oi.h=en,Ii=!0),Ii&&!N&&(Ti[Zt]=gi.y?Oi.w:en,Ti[Qt]=gi.x?Oi.h:en,me||(me=d(Ao(jn)),fe.prepend(me)),me.css(Ti)),he.css(yn)}var Ci,Ni={};On={};if((o||mi.c||gi.c||ii.c||Oe||Tt||be||Et||ae||mn)&&(Ni[Ut]=en,(Ci=function(e){var t=so(e),n=so(!e),i=t._x_y,o=t._X_Y,r=e?zt:Pt,a=function(){Ni[r]=en,xt[n._w_h]=0};mi[i]&&gi[i+"s"]?(Ni[Pn+o]=on,Ee||N?a():(Ni[r]=-(A[i]?T[i]:P[i]),xt[n._w_h]=A[i]?T[n._x_y]:0)):(Ni[Pn+o]=en,a())})(!0),Ci(!1),!N&&(Ft.h=Mi._cursorMax&&St,Yi={x:_t||Vi!==Ki||Ui!==Fi?-1:Ze.x,y:(_t?Wi||xi&&ri&&_.y===ri.y:(Wi||xi)&&Ui===Gi)?Ze.y:-1};_.x=Yi.x>-1?Z&&ct&&O.i?0:Yi.x:_.x,_.y=Yi.y>-1?Yi.y:_.y}pt=Mi}Z&&O.i&&A.y&&mi.x&&ct&&(_.x+=xt.w||0),cn&&le[fn](0),pn&&le[hn](0),fe[fn](_.x)[hn](_.y);var ji="v"===b,zi="h"===b,Zi="a"===b,Qi=function(e,t){t=t===n?e:t,no(!0,e,_i.x),no(!1,t,_i.y)};ko(le,xn,gi.x||gi.y),ko(le,Un,gi.x),ko(le,Vn,gi.y),Et&&!B&&ko(le,Dn,Z),B&&Ro(le,wn),$&&(ko(le,wn,kt),ko(ve,si,!kt),ko(ve,ci,Dt),ko(ve,li,wt),ko(ve,ui,Mt)),(S||Oe||gi.c||mi.c||be)&&(Ee?be&&(Po(le,Mn),Ee&&Qi(!1)):Zi?Qi(_i.x,_i.y):ji?Qi(!0):zi&&Qi(!1)),(L||be)&&(Bi(!Lt&&!Nt),io(It,!It)),(o||fi.c||mn||un||$||Tt||oe||be||Et)&&(oo(!0),ro(!0),oo(!1),ro(!1)),D&&ao(!0,k),M&&ao(!1,w),uo("onDirectionChanged",{isRTL:Z,dir:yt},Et),uo("onHostSizeChanged",{width:we.w,height:we.h},o),uo("onContentSizeChanged",{width:Me.w,height:Me.h},l),uo("onOverflowChanged",{x:mi.x,y:mi.y,xScrollable:gi.xs,yScrollable:gi.ys,clipped:gi.x||gi.y},mi.c||gi.c),uo("onOverflowAmountChanged",{x:fi.x,y:fi.y},fi.c)}B&>&&(Ue.c||gt.c)&&(gt.f||Hi(),A.y&&Ue.x&&he.css(qt+Zt,gt.w+T.y),A.x&&Ue.y&&he.css(qt+Qt,gt.h+T.x),gt.c=!1),U&&p.updateOnLoad&&Xi(),uo("onUpdated",{forced:u})}}function Xi(){F||Co((function(e,t){he.find(t).each((function(e,t){s.inA(t,Ai)<0&&(Ai.push(t),d(t).off(Si,Fi).on(Si,Fi))}))}))}function Zi(e){var t=L._validate(e,L._template,!0,ee);return ee=Lo({},ee,t._default),te=Lo({},te,t._prepared),t._prepared}function Qi(e){var t="parent",i="os-resize-observer-host",a=Fn+ln+Qn,c=F?ln+Qn:en,l=te.textarea.inheritedAttrs,u={},p=function(){var t=e?ce:le;y(u,(function(e,n){_(n)==o.s&&(e==r.c?t.addClass(n):t.attr(e,n))}))},f=[Cn,Nn,Ln,wn,Dn,Rn,Pn,kn,Mn,xn,Un,Vn,hi,Fn,Qn,lt].join(ln),h={};le=le||(F?G?ce[t]()[t]()[t]()[t]():d(Ao(Ln)):ce),he=he||To(Yn+c),fe=fe||To(Gn+c),pe=pe||To(Hn+c),de=de||To(i),_e=_e||(F?To(Bn):n),G&&Ro(le,Nn),e&&Po(le,f),l=_(l)==o.s?l.split(ln):l,s.isA(l)&&F&&y(l,(function(t,n){_(n)==o.s&&(u[n]=e?le.attr(n):ce.attr(n))})),e?(G&&U?(de.children().remove(),y([pe,fe,he,_e],(function(e,t){t&&Po(t.removeAttr(r.s),mi)})),Ro(le,F?Ln:Cn)):(Do(de),he.contents().unwrap().unwrap().unwrap(),F&&(ce.unwrap(),Do(le),Do(_e),p())),F&&ce.removeAttr(r.s),B&&Po(ae,In)):(F&&(te.sizeAutoCapable||(h[Zt]=ce.css(Zt),h[Qt]=ce.css(Qt)),G||ce.addClass(Qn).wrap(le),le=ce[t]().css(h)),G||(Ro(ce,F?a:Cn),le.wrapInner(he).wrapInner(fe).wrapInner(pe).prepend(de),he=wo(le,cn+Yn),fe=wo(le,cn+Gn),pe=wo(le,cn+Hn),F&&(he.prepend(_e),p())),N&&Ro(fe,Kn),A.x&&A.y&&Ro(fe,Wn),B&&Ro(ae,In),Re=de[0],Ne=le[0],Pe=pe[0],ke=fe[0],De=he[0],zi())}function $i(){var e,t,i=[112,113,114,115,116,117,118,119,120,121,123,33,34,37,38,39,40,16,17,18,19,20,144],o=[],a=175,c="focus";function l(t){Ji(),E.update(tn),t&&I&&clearInterval(e)}function u(e){return ce[fn](O.i&&ct?9999999:0),ce[hn](0),s.prvD(e),s.stpP(e),!1}function d(e){setTimeout((function(){V||l()}),50)}function p(){St=!0,Ro(le,c)}function f(){St=!1,o=[],Po(le,c),l(!0)}function h(t){var n=t.keyCode;v(n,i)<0&&(o[r.l]||(l(),e=setInterval(l,1e3/60)),v(n,o)<0&&o.push(n))}function m(e){var t=e.keyCode,n=v(t,o);v(t,i)<0&&(n>-1&&o.splice(n,1),o[r.l]||l(!0))}function g(e){!0!==$e&&ji((e=e.originalEvent||e).propertyName)&&E.update(tn)}function _(e){Q||(t!==n?clearTimeout(t):((Ct||Nt)&&io(!0),bo()||Ro(le,Mn),uo("onScrollStart",e)),Pt||(ro(!0),ro(!1)),uo("onScroll",e),t=setTimeout((function(){V||(clearTimeout(t),t=n,(Ct||Nt)&&io(!1),bo()||Po(le,Mn),uo("onScrollStop",e))}),a))}F?(C>9||!I?Li(ce,"input",l):Li(ce,[En,bn],[h,m]),Li(ce,[on,"drop",c,c+"out"],[u,d,p,f])):Li(he,An,g),Li(fe,on,_,!0)}function eo(e){var t,n,i=function(t){var n=To($n+ln+(t?di:pi),!0),i=To(ei,n),o=To(ni,n);return G||e||(n.append(i),i.append(o)),{_scrollbar:n,_track:i,_handle:o}};function o(e){var t=so(e),n=t._scrollbar,o=t._track,a=t._handle;G&&U?y([n,o,a],(function(e,t){Po(t.removeAttr(r.s),mi)})):Do(n||i(e)._scrollbar)}e?(o(!0),o()):(t=i(!0),n=i(),ye=t._scrollbar,Ee=t._track,be=t._handle,Se=n._scrollbar,Ae=n._track,Te=n._handle,G||(pe.after(Se),pe.after(ye)))}function to(e){var t,i,o,a,l=so(e),u=l._info,d=Oe.top!==Oe,p=l._x_y,f=l._X_Y,h=on+l._Left_Top,m="active",g="snapHandle",_="click",y=1,b=[16,17];function S(e){return C&&d?e["screen"+f]:s.page(e)[p]}function A(e){return te.scrollbars[e]}function T(){y=.5}function I(){y=1}function N(e){s.stpP(e)}function L(e){v(e.keyCode,b)>-1&&T()}function R(e){v(e.keyCode,b)>-1&&I()}function P(e){var t=(e.originalEvent||e).touches!==n;return!(Q||V||bo()||!at||t&&!A("touchSupport"))&&(1===s.mBtn(e)||t)}function D(t){if(P(t)){var n=u._trackLength,r=u._handleLength,l=u._maxScroll*((S(t)-o)*a/(n-r));l=isFinite(l)?l:0,Z&&e&&!O.i&&(l*=-1),fe[h](c.round(i+l)),Pt&&ro(e,i+l),w||s.prvD(t)}else M(t)}function M(c){if(c=c||c.originalEvent,Ni(re,[_n,gn,En,bn,Sn],[D,M,L,R,Vi],!0),s.rAF()((function(){Ni(re,_,N,!0,{_capture:!0})})),Pt&&ro(e,!0),Pt=!1,Po(se,fi),Po(l._handle,m),Po(l._track,m),Po(l._scrollbar,m),i=n,o=n,a=1,I(),t!==n&&(E.scrollStop(),clearTimeout(t),t=n),c){var u=Ne[r.bCR]();c.clientX>=u.left&&c.clientX<=u.right&&c.clientY>=u.top&&c.clientY<=u.bottom||xi(),(Ct||Nt)&&io(!1)}}function x(e){P(e)&&U(e)}function U(t){i=fe[h](),i=isNaN(i)?0:i,(Z&&e&&!O.n||!Z)&&(i=i<0?0:i),a=go()[p],o=S(t),Pt=!A(g),Ro(se,fi),Ro(l._handle,m),Ro(l._scrollbar,m),Ni(re,[_n,gn,Sn],[D,M,Vi]),s.rAF()((function(){Ni(re,_,N,!1,{_capture:!0})})),!C&&H||s.prvD(t),s.stpP(t)}function F(i){if(P(i)){var r,d=l._info._handleLength/Math.round(c.min(1,Ft[l._w_h]/Me[l._w_h])*l._info._trackLength),f=c.round(Ft[l._w_h]*d),_=270*d,v=400*d,b=l._track.offset()[l._left_top],S=i.ctrlKey,I=i.shiftKey,C=I&&S,N=!0,k="linear",D=function(t){Pt&&ro(e,t)},w=function(){D(),U(i)},x=function(){if(!V){var i=(o-b)*a,s=u._handleOffset,l=u._trackLength,d=u._handleLength,m=u._maxScroll,g=u._currentScroll,S=_*y,A=N?c.max(v,S):S,T=m*((i-d/2)/(l-d)),L=Z&&e&&(!O.i&&!O.n||ct),R=L?si,P={},M={easing:k,step:function(t){Pt&&(fe[h](t),ro(e,t))}};T=isFinite(T)?T:0,T=Z&&e&&!O.i?m-T:T,I?(fe[h](T),C?(T=fe[h](),fe[h](g),T=L&&O.i?m-T:T,T=L&&O.n?-T:T,P[p]=T,E.scroll(P,Lo(M,{duration:130,complete:w}))):w()):(r=N?R:r,(L?r?s+d>=i:s<=i:r?s<=i:s+d>=i)?(clearTimeout(t),E.scrollStop(),t=n,D(!0)):(t=setTimeout(x,A),P[p]=(r?"-=":"+=")+f,E.scroll(P,Lo(M,{duration:S}))),N=!1)}};S&&T(),a=go()[p],o=s.page(i)[p],Pt=!A(g),Ro(se,fi),Ro(l._track,m),Ro(l._scrollbar,m),Ni(re,[gn,En,bn,Sn],[M,L,R,Vi]),x(),s.prvD(i),s.stpP(i)}}function B(e){Rt=!0,(Ct||Nt)&&io(!0)}function G(e){Rt=!1,(Ct||Nt)&&io(!1)}function K(e){s.stpP(e)}Li(l._handle,mn,x),Li(l._track,[mn,vn,yn],[F,B,G]),Li(l._scrollbar,mn,K),k&&Li(l._scrollbar,An,(function(t){t.target===l._scrollbar[0]&&(oo(e),ro(e))}))}function no(e,t,n){var i=e?ye:Se;ko(le,e?Rn:Pn,!t),ko(i,oi,!n)}function io(e,t){if(clearTimeout(At),e)Po(ye,ri),Po(Se,ri);else{var n,i="active",o=function(){Rt||V||(!(n=be.hasClass(i)||Te.hasClass(i))&&(Ct||Nt||Lt)&&Ro(ye,ri),!n&&(Ct||Nt||Lt)&&Ro(Se,ri))};Ot>0&&!0!==t?At=setTimeout(o,Ot):o()}}function oo(e){var t={},n=so(e),i=n._info,o=1e6,r=c.min(1,Ft[n._w_h]/Me[n._w_h]);t[n._width_height]=c.floor(100*r*o)/o+"%",bo()||n._handle.css(t),i._handleLength=n._handle[0]["offset"+n._Width_Height],i._handleLengthRatio=r}function ro(e,t){var i,r,s=_(t)==o.b,l=250,u=Z&&e,d=so(e),p=d._info,f="translate(",h=a._cssProperty("transform"),m=a._cssProperty("transition"),g=e?fe[fn]():fe[hn](),v=t===n||s?g:t,y=p._handleLength,E=d._track[0]["offset"+d._Width_Height],b=E-y,S={},A=(ke[on+d._Width_Height]-ke["client"+d._Width_Height])*(O.n&&u?-1:1),T=function(e){return isNaN(e/A)?0:c.max(0,c.min(1,e/A))},I=function(e){var t=b*e;return t=isNaN(t)?0:t,t=u&&!O.i?E-y-t:t,t=c.max(0,t)},C=T(g),N=I(T(v)),L=I(C);p._maxScroll=A,p._currentScroll=g,p._currentScrollRatio=C,D?(i=u?-(E-y-N):N,r=e?f+i+"px, 0)":f+"0, "+i+"px)",S[h]=r,k&&(S[m]=s&&c.abs(N-p._handleOffset)>1?ho(d._handle)+", "+(h+ln+l)+"ms":en)):S[d._left_top]=N,bo()||(d._handle.css(S),D&&k&&s&&d._handle.one(An,(function(){V||d._handle.css(m,en)}))),p._handleOffset=N,p._snappedHandleOffset=L,p._trackLength=E}function ao(e,t){var n=t?"removeClass":"addClass",i=e?Ae:Te,o=e?ti:ii;(e?Ee:be)[n](o),i[n](o)}function so(e){return{_width_height:e?Zt:Qt,_Width_Height:e?"Width":"Height",_left_top:e?Jt:Yt,_Left_Top:e?"Left":"Top",_x_y:e?an:sn,_X_Y:e?"X":"Y",_w_h:e?"w":"h",_l_t:e?"l":"t",_track:e?Ee:Ae,_handle:e?be:Te,_scrollbar:e?ye:Se,_info:e?Ut:Vt}}function co(e){ve=ve||To(ai,!0),e?G&&U?Po(ve.removeAttr(r.s),mi):Do(ve):G||le.append(ve)}function lo(){var e,t=Oe.top!==Oe,i={},o={},a={};function c(e){if(u(e)){var t=d(e),n={};(wt||Dt)&&(n[Zt]=o.w+(t.x-i.x)*a.x),(Mt||Dt)&&(n[Qt]=o.h+(t.y-i.y)*a.y),le.css(n),s.stpP(e)}else l(e)}function l(t){var i=t!==n;Ni(re,[Sn,_n,gn],[Vi,c,l],!0),Po(se,fi),ve.releaseCapture&&ve.releaseCapture(),i&&(e&&ki(),E.update(tn)),e=!1}function u(e){var t=(e.originalEvent||e).touches!==n;return!Q&&!V&&(1===s.mBtn(e)||t)}function d(e){return C&&t?{x:e.screenX,y:e.screenY}:s.page(e)}Li(ve,mn,(function(t){u(t)&&!kt&&(bt&&(e=!0,Di()),i=d(t),o.w=Ne[r.oW]-(K?0:Y),o.h=Ne[r.oH]-(K?0:j),a=go(),Ni(re,[Sn,_n,gn],[Vi,c,l]),Ro(se,fi),ve.setCapture&&ve.setCapture(),s.prvD(t),s.stpP(t))}))}function uo(e,t,n){if(!1!==n)if(U){var i,r=te.callbacks[e],a=e;"on"===a.substr(0,2)&&(a=a.substr(2,1).toLowerCase()+a.substr(3)),_(r)==o.f&&r.call(E,t),y(vi,(function(){_((i=this).on)==o.f&&i.on(a,t)}))}else V||gi.push({n:e,a:t})}function po(e,t,n){n=n||[en,en,en,en],e[(t=t||en)+Yt]=n[0],e[t+jt]=n[1],e[t+zt]=n[2],e[t+Jt]=n[3]}function fo(e,t,n,i){return t=t||en,e=e||en,{t:i?0:yo(le.css(e+Yt+t)),r:n?0:yo(le.css(e+jt+t)),b:i?0:yo(le.css(e+zt+t)),l:n?0:yo(le.css(e+Jt+t))}}function ho(e){var t=a._cssProperty("transition"),n=e.css(t);if(n)return n;for(var i,o,s,c="\\s*(([^,(]+(\\(.+?\\))?)+)[\\s,]*",l=new RegExp(c),u=new RegExp("^("+c+")+$"),d="property duration timing-function delay".split(" "),p=[],f=0,h=function(e){if(i=[],!e.match(u))return e;for(;e.match(l);)i.push(RegExp.$1),e=e.replace(l,en);return i};fd&&(u=i+1,d=t);return{_cursorRow:p,_cursorColumn:f,_rows:c,_columns:d,_widestRow:u,_cursorPosition:e,_cursorMax:a}}}function bo(){return Qe&&A.x&&A.y}function So(){return F?_e[0]:De}function Ao(e,t){return"
"+(t||en)+"
"}function To(e,t){var n=_(t)==o.b,i=n?le:t||le;return G&&!i[r.l]?null:G?i[n?"children":"find"](cn+e.replace(/\s/g,cn)).eq(0):d(Ao(e))}function Oo(e,t){for(var n,i=t.split(cn),a=0;a0&&(m?d.each(e,(function(e,o){(a=o)!==n&&l.push(D(a,t,i,f,h))})):d.each(e,(function(e,i){a=p(i),("!"===t&&u.valid(a)||s.type(t)==o.f&&t(i,a)||t===n)&&l.push(a)})),c=1===l[r.l]?l[0]:l),c):m||!t?c:l},u.globals=function(){R();var e=d.extend(!0,{},f);return delete e.msie,e},u.defaultOptions=function(e){R();var t=f.defaultOptions;if(e===n)return d.extend(!0,{},t);f.defaultOptions=d.extend(!0,{},t,L._validate(e,L._template,!0,t)._default)},u.valid=function(e){return e instanceof u&&!e.getState().destroyed},u.extension=function(e,t,n){var i=s.type(e)==o.s,a=arguments[r.l],c=0;if(a<1||!i)return d.extend(!0,{length:N[r.l]},N);if(i)if(s.type(t)==o.f)N.push({name:e,extensionFactory:t,defaultOptions:n});else for(;c1))return d.extend(!0,{},N[c]);N.splice(c,1)}},u}();var h,m;var g;l&&l.fn&&(l.fn.overlayScrollbars=function(e,t){var n=this;return l.isPlainObject(e)?(l.each(n,(function(){f(this,e,t)})),n):f(n,e)});return f}(o,o.document,void 0)}.call(t,n,t,e),void 0===i||(e.exports=i)}("undefined"!=typeof window?window:this)},14224:e=>{var t,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var s,c=[],l=!1,u=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(s=c,c=[];++u1)for(var n=1;n{"use strict";var i=n(22134);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,a){if(a!==i){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={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:o};return n.PropTypes=n,n}},19036:(e,t,n)=>{e.exports=n(6132)()},22134:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},74049:(e,t,n)=>{"use strict";var i=n(36257);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,a){if(a!==i){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint: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:o};return n.PropTypes=n,n}},40507:(e,t,n)=>{e.exports=n(74049)()},36257:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9590:(e,t,n)=>{"use strict";e.exports=n(2465)},2465:(e,t,n)=>{"use strict";var i=t;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=n(44549),i.BufferWriter=n(61764),i.Reader=n(36475),i.BufferReader=n(17906),i.util=n(11999),i.rpc=n(86100),i.roots=n(79703),i.configure=o,o()},36475:(e,t,n)=>{"use strict";e.exports=c;var i,o=n(11999),r=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var l,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new i(e):u(e)})(e)}:u};function p(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new r(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return l}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=o.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){i=e,c.create=d(),i._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},17906:(e,t,n)=>{"use strict";e.exports=r;var i=n(36475);(r.prototype=Object.create(i.prototype)).constructor=r;var o=n(11999);function r(e){i.call(this,e)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure()},79703:e=>{"use strict";e.exports={}},86100:(e,t,n)=>{"use strict";t.Service=n(38115)},38115:(e,t,n)=>{"use strict";e.exports=o;var i=n(11999);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,r,a){if(!r)throw TypeError("request must be specified");var s=this;if(!a)return i.asPromise(e,s,t,n,o,r);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](r).finish(),(function(e,n){if(e)return s.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",n,t),a(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},15742:(e,t,n)=>{"use strict";e.exports=o;var i=n(11999);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return r;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new o(n,i)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(i.isString(e)){if(!i.Long)return o.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):r},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?r:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},11999:function(e,t,n){"use strict";var i=t;function o(e,t,n){for(var i=Object.keys(t),o=0;o0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var n=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},i.merge=o,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n{"use strict";e.exports=d;var i,o=n(11999),r=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function l(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(l,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(d.create=function(){return new i})()}:function(){return new d}};function f(e,t,n){t[n]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=p(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},h.prototype=Object.create(c.prototype),h.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,r.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=r.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=r.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var _=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i>>0;if(!t)return this._push(f,1,0);if(o.isString(e)){var n=d.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(_,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(l,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(l,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){i=e,d.create=p(),i._configure()}},61764:(e,t,n)=>{"use strict";e.exports=r;var i=n(44549);(r.prototype=Object.create(i.prototype)).constructor=r;var o=n(11999);function r(){i.call(this)}function a(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i>>0;return this.uint32(t),t&&this._push(r.writeBytesBuffer,t,e),this},r.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},r._configure()},57044:(e,t,n)=>{"use strict";t.ZP=void 0;var i,o=(i=n(81244))&&i.__esModule?i:{default:i};var r,a,s,c,l,u,d,p,f,h=(r={blacklistedNodeNames:["STYLE"]},a={strategy:"accented"},s=!1,c=null,l={characterData:!0,childList:!0,subtree:!0},u=function(e){return!!e&&"string"==typeof e},d=function(e){var t=function(e){for(var t,n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(function(e){return e.nodeValue&&!/[^\s]/.test(e.nodeValue)||e.parentElement&&r.blacklistedNodeNames.includes(e.parentElement.nodeName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT})),i=[];t=n.nextNode();)i.push(t);return i}(e),n=!0,i=!1,s=void 0;try{for(var c,l=t[Symbol.iterator]();!(n=(c=l.next()).done);n=!0){var d=c.value,p=d.nodeValue;u(p)&&(d.nodeValue=(0,o.default)(p,a))}}catch(e){i=!0,s=e}finally{try{n||null==l.return||l.return()}finally{if(i)throw s}}},p=function(e){if(c){var t=!0,n=!1,i=void 0;try{for(var s,p=e[Symbol.iterator]();!(t=(s=p.next()).done);t=!0){var f=s.value;if("childList"===f.type&&f.addedNodes.length>0)c.disconnect(),f.addedNodes.forEach(d),c.observe(document.body,l);else if("characterData"===f.type){var h=f.target.nodeValue,m=!!f.target.parentElement&&r.blacklistedNodeNames.includes(f.target.parentElement.nodeName);u(h)&&!m&&(c.disconnect(),f.target.nodeValue=(0,o.default)(h,a),c.observe(document.body,l))}}}catch(e){n=!0,i=e}finally{try{t||null==p.return||p.return()}finally{if(n)throw i}}}},{start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.strategy,n=void 0===t?"accented":t,i=e.blacklistedNodeNames,o=void 0===i?r.blacklistedNodeNames:i;f()?console.error("pseudo-localization is already enabled"):(r.blacklistedNodeNames=o,a.strategy=n,d(document.body),(c=new MutationObserver(p)).observe(document.body,l),s=!0)},stop:function(){f()?(c&&c.disconnect(),s=!1):console.error("pseudo-localization is already disabled")},isEnabled:f=function(){return s},localize:o.default});t.ZP=h},81244:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={accented:{prefix:"",postfix:"",map:{a:"ȧ",A:"Ȧ",b:"ƀ",B:"Ɓ",c:"ƈ",C:"Ƈ",d:"ḓ",D:"Ḓ",e:"ḗ",E:"Ḗ",f:"ƒ",F:"Ƒ",g:"ɠ",G:"Ɠ",h:"ħ",H:"Ħ",i:"ī",I:"Ī",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"ŀ",L:"Ŀ",m:"ḿ",M:"Ḿ",n:"ƞ",N:"Ƞ",o:"ǿ",O:"Ǿ",p:"ƥ",P:"Ƥ",q:"ɋ",Q:"Ɋ",r:"ř",R:"Ř",s:"ş",S:"Ş",t:"ŧ",T:"Ŧ",v:"ṽ",V:"Ṽ",u:"ŭ",U:"Ŭ",w:"ẇ",W:"Ẇ",x:"ẋ",X:"Ẋ",y:"ẏ",Y:"Ẏ",z:"ẑ",Z:"Ẑ"},elongate:!0},bidi:{prefix:"‮",postfix:"‬",map:{a:"ɐ",A:"∀",b:"q",B:"Ԑ",c:"ɔ",C:"Ↄ",d:"p",D:"ᗡ",e:"ǝ",E:"Ǝ",f:"ɟ",F:"Ⅎ",g:"ƃ",G:"⅁",h:"ɥ",H:"H",i:"ı",I:"I",j:"ɾ",J:"ſ",k:"ʞ",K:"Ӽ",l:"ʅ",L:"⅂",m:"ɯ",M:"W",n:"u",N:"N",o:"o",O:"O",p:"d",P:"Ԁ",q:"b",Q:"Ò",r:"ɹ",R:"ᴚ",s:"s",S:"S",t:"ʇ",T:"⊥",u:"n",U:"∩",v:"ʌ",V:"Ʌ",w:"ʍ",W:"M",x:"x",X:"X",y:"ʎ",Y:"⅄",z:"z",Z:"Z"},elongate:!1}},i=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).strategy,i=n[void 0===t?"accented":t],o="",r=!0,a=!1,s=void 0;try{for(var c,l=e[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var u=c.value;if(u in i.map){var d=u,p=d.toLowerCase();!i.elongate||"a"!==p&&"e"!==p&&"o"!==p&&"u"!==p?o+=i.map[d]:o+=i.map[d]+i.map[d]}else o+=u}}catch(e){a=!0,s=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw s}}return o.startsWith(i.prefix)&&o.endsWith(i.postfix)?o:i.prefix+o+i.postfix};t.default=i},31688:(e,t,n)=>{var i=n(45478);function o(e){this.mode=i.MODE_8BIT_BYTE,this.data=e}o.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t{function t(){this.buffer=new Array,this.length=0}t.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},12538:e=>{e.exports={L:1,M:0,Q:3,H:2}},14382:(e,t,n)=>{var i=n(4897);function o(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n{var i=n(31688),o=n(77515),r=n(77572),a=n(62739),s=n(14382);function c(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var l=c.prototype;l.addData=function(e){var t=new i(e);this.dataList.push(t),this.dataCache=null},l.isDark=function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},l.getModuleCount=function(){return this.moduleCount},l.make=function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=o.getRSBlocks(e,this.errorCorrectLevel),n=new r,i=0,s=0;s=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=c.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},l.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},l.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=a.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},l.createMovieClip=function(e,t,n){var i=e.createEmptyMovieClip(t,n);this.make();for(var o=0;o>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++){i=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}},l.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,i=a.getBCHTypeInfo(n),o=0;o<15;o++){var r=!e&&1==(i>>o&1);o<6?this.modules[o][8]=r:o<8?this.modules[o+1][8]=r:this.modules[this.moduleCount-15+o][8]=r}for(o=0;o<15;o++){r=!e&&1==(i>>o&1);o<8?this.modules[8][this.moduleCount-o-1]=r:o<9?this.modules[8][15-o-1+1]=r:this.modules[8][15-o-1]=r}this.modules[this.moduleCount-8][8]=!e},l.mapData=function(e,t){for(var n=-1,i=this.moduleCount-1,o=7,r=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var c=0;c<2;c++)if(null==this.modules[i][s-c]){var l=!1;r>>o&1)),a.getMask(t,i,s-c)&&(l=!l),this.modules[i][s-c]=l,-1==--o&&(r++,o=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}},c.PAD0=236,c.PAD1=17,c.createData=function(e,t,n){for(var i=o.getRSBlocks(e,t),s=new r,l=0;l8*d)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*d+")");for(s.getLengthInBits()+4<=8*d&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*d||(s.put(c.PAD0,8),s.getLengthInBits()>=8*d));)s.put(c.PAD1,8);return c.createBytes(s,i)},c.createBytes=function(e,t){for(var n=0,i=0,o=0,r=new Array(t.length),c=new Array(t.length),l=0;l=0?h.get(m):0}}var g=0;for(p=0;p{var i=n(12538);function o(e,t){this.totalCount=e,this.dataCount=t}o.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],o.getRSBlocks=function(e,t){var n=o.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var i=n.length/3,r=new Array,a=0;a{for(var t={glog:function(e){if(e<1)throw new Error("glog("+e+")");return t.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},n=0;n<8;n++)t.EXP_TABLE[n]=1<{e.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},62739:(e,t,n)=>{var i=n(45478),o=n(14382),r=n(4897),a=0,s=1,c=2,l=3,u=4,d=5,p=6,f=7,h={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;h.getBCHDigit(t)-h.getBCHDigit(h.G15)>=0;)t^=h.G15<=0;)t^=h.G18<>>=1;return t},getPatternPosition:function(e){return h.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case s:return t%2==0;case c:return n%3==0;case l:return(t+n)%3==0;case u:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case d:return t*n%2+t*n%3==0;case p:return(t*n%2+t*n%3)%2==0;case f:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new o([1],0),n=0;n5&&(n+=3+r-5)}for(i=0;i{"use strict";n.d(t,{_W:()=>on});var i=n(50959);const o={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function r(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const a={date:r({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:r({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:r({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},s={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function c(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;i=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function l(e){return(t,n={})=>{const i=n.width,o=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(o);if(!r)return null;const a=r[0],s=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(let n=0;ne.test(a))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(a)));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(a.length)}}}var u;const d={code:"en-US",formatDistance:(e,t,n)=>{let i;const r=o[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:a,formatRelative:(e,t,n,i)=>s[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:c({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:c({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:c({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:c({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:c({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(u={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(u.matchPattern);if(!n)return null;const i=n[0],o=e.match(u.parsePattern);if(!o)return null;let r=u.valueCallback?u.valueCallback(o[0]):o[0];return r=t.valueCallback?t.valueCallback(r):r,{value:r,rest:e.slice(i.length)}}),era:l({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:l({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:l({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:l({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:l({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let p={};function f(){return p}Math.pow(10,8);const h=6048e5,m=864e5;var g=n(17350),_=n(27769);function v(e){const t=(0,_.Q)(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function y(e,t){const n=(0,g.b)(e),i=(0,g.b)(t),o=+n-v(n),r=+i-v(i);return Math.round((o-r)/m)}function E(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function b(e){const t=(0,_.Q)(e),n=E(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function S(e){const t=(0,_.Q)(e);return y(t,b(t))+1}function A(e,t){const n=f(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=(0,_.Q)(e),r=o.getDay(),a=(r=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function I(e){const t=O(e),n=E(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),T(n)}function C(e){const t=(0,_.Q)(e),n=+T(t)-+I(t);return Math.round(n/h)+1}function N(e,t){const n=(0,_.Q)(e),i=n.getFullYear(),o=f(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=E(e,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const s=A(a,t),c=E(e,0);c.setFullYear(i,0,r),c.setHours(0,0,0,0);const l=A(c,t);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function L(e,t){const n=f(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=N(e,t),r=E(e,0);r.setFullYear(o,0,i),r.setHours(0,0,0,0);return A(r,t)}function R(e,t){const n=(0,_.Q)(e),i=+A(n,t)-+L(n,t);return Math.round(i/h)+1}var P=n(44567);const k={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return(0,P.r)("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):(0,P.r)(n+1,2)},d:(e,t)=>(0,P.r)(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>(0,P.r)(e.getHours()%12||12,t.length),H:(e,t)=>(0,P.r)(e.getHours(),t.length),m:(e,t)=>(0,P.r)(e.getMinutes(),t.length),s:(e,t)=>(0,P.r)(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds(),o=Math.trunc(i*Math.pow(10,n-3));return(0,P.r)(o,t.length)}},D="midnight",w="noon",M="morning",x="afternoon",U="evening",V="night",F={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return k.y(e,t)},Y:function(e,t,n,i){const o=N(e,i),r=o>0?o:1-o;if("YY"===t){const e=r%100;return(0,P.r)(e,2)}return"Yo"===t?n.ordinalNumber(r,{unit:"year"}):(0,P.r)(r,t.length)},R:function(e,t){const n=O(e);return(0,P.r)(n,t.length)},u:function(e,t){const n=e.getFullYear();return(0,P.r)(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return(0,P.r)(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return(0,P.r)(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return k.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return(0,P.r)(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const o=R(e,i);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):(0,P.r)(o,t.length)},I:function(e,t,n){const i=C(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):(0,P.r)(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):k.d(e,t)},D:function(e,t,n){const i=S(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):(0,P.r)(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const o=e.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return(0,P.r)(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const o=e.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return(0,P.r)(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),o=0===i?7:i;switch(t){case"i":return String(o);case"ii":return(0,P.r)(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let o;switch(o=12===i?w:0===i?D:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let o;switch(o=i>=17?U:i>=12?x:i>=4?M:V,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return k.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):k.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):(0,P.r)(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):(0,P.r)(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):k.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):k.s(e,t)},S:function(e,t){return k.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return H(i);case"XXXX":case"XX":return G(i);default:return G(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return H(i);case"xxxx":case"xx":return G(i);default:return G(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+B(i,":");default:return"GMT"+G(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+B(i,":");default:return"GMT"+G(i,":")}},t:function(e,t,n){const i=Math.trunc(e.getTime()/1e3);return(0,P.r)(i,t.length)},T:function(e,t,n){const i=e.getTime();return(0,P.r)(i,t.length)}};function B(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),o=Math.trunc(i/60),r=i%60;return 0===r?n+String(o):n+String(o)+t+(0,P.r)(r,2)}function H(e,t){if(e%60==0){return(e>0?"-":"+")+(0,P.r)(Math.abs(e)/60,2)}return G(e,t)}function G(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+(0,P.r)(Math.trunc(i/60),2)+t+(0,P.r)(i%60,2)}const K=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},W=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Y={p:W,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return K(e,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",K(i,t)).replace("{{time}}",W(o,t))}},j=/^D+$/,z=/^Y+$/,J=["D","DD","YY","YYYY"];function q(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function X(e){if(!q(e)&&"number"!=typeof e)return!1;const t=(0,_.Q)(e);return!isNaN(Number(t))}const Z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Q=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$=/^'([^]*?)'?$/,ee=/''/g,te=/[a-zA-Z]/;function ne(e,t,n){const i=f(),o=n?.locale??i.locale??d,r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=(0,_.Q)(e);if(!X(s))throw new RangeError("Invalid time value");let c=t.match(Q).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Y[t])(e,o.formatLong)}return e})).join("").match(Z).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ie(e)};if(F[t])return{isToken:!0,value:e};if(t.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(c=o.localize.preprocessor(s,c));const l={firstWeekContainsDate:r,weekStartsOn:a,locale:o};return c.map((i=>{if(!i.isToken)return i.value;const r=i.value;(!n?.useAdditionalWeekYearTokens&&function(e){return z.test(e)}(r)||!n?.useAdditionalDayOfYearTokens&&function(e){return j.test(e)}(r))&&function(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),J.includes(e))throw new RangeError(i)}(r,t,String(e));return(0,F[r[0]])(s,r,o.localize,l)})).join("")}function ie(e){const t=e.match($);return t?t[1].replace(ee,"'"):e}function oe(e){const t=(0,_.Q)(e);return t.setDate(1),t.setHours(0,0,0,0),t}function re(e){const t=(0,_.Q)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ae(e,t){const n=(0,_.Q)(e),i=(0,_.Q)(t);return n.getFullYear()===i.getFullYear()}function se(e){const t=(0,_.Q)(e),n=t.getFullYear(),i=t.getMonth(),o=E(e,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function ce(e,t){const n=(0,_.Q)(e),i=n.getFullYear(),o=n.getDate(),r=E(e,0);r.setFullYear(i,t,15),r.setHours(0,0,0,0);const a=se(r);return n.setMonth(t,Math.min(o,a)),n}function le(e,t){const n=(0,_.Q)(e);return isNaN(+n)?E(e,NaN):(n.setFullYear(t),n)}function ue(e,t){const n=(0,_.Q)(e),i=(0,_.Q)(t);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}function de(e,t){const n=(0,_.Q)(e);if(isNaN(t))return E(e,NaN);if(!t)return n;const i=n.getDate(),o=E(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return i>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function pe(e,t){const n=(0,_.Q)(e),i=(0,_.Q)(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}function fe(e,t){return+(0,_.Q)(e)<+(0,_.Q)(t)}function he(e,t){const n=(0,_.Q)(e);return isNaN(t)?E(e,NaN):t?(n.setDate(n.getDate()+t),n):n}var me=n(44242);function ge(e,t){const n=(0,_.Q)(e),i=(0,_.Q)(t);return n.getTime()>i.getTime()}function _e(e,t){return he(e,-t)}function ve(e,t){return he(e,7*t)}function ye(e,t){return de(e,12*t)}function Ee(e,t){const n=f(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=(0,_.Q)(e),r=o.getDay(),a=6+(r{const n=(0,_.Q)(e);(!t||t>n||isNaN(+n))&&(t=n)})),t||new Date(NaN)}function Te(e){return Math.trunc(+(0,_.Q)(e)/1e3)}function Oe(e,t,n){const i=A(e,n),o=A(t,n),r=+i-v(i),a=+o-v(o);return Math.round((r-a)/h)}function Ie(e){const t=(0,_.Q)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Ce(e,t){return Oe(Ie(e),oe(e),t)+1}var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,i=arguments.length;n1&&(c||!l),d=t>1&&(l||!c);return De.jsx(it,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:i,onPreviousClick:function(){i&&r(i)},onNextClick:function(){o&&r(o)}})}function rt(e){var t,n,i=Ke(),o=i.classNames,r=i.disableNavigation,a=i.styles,s=i.captionLayout,c=i.components,l=null!==(t=null==c?void 0:c.CaptionLabel)&&void 0!==t?t:We;return n=r?De.jsx(l,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===s?De.jsx($e,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===s?De.jsxs(De.Fragment,{children:[De.jsx($e,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),De.jsx(ot,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):De.jsxs(De.Fragment,{children:[De.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),De.jsx(ot,{displayMonth:e.displayMonth,id:e.id})]}),De.jsx("div",{className:o.caption,style:a.caption,children:n})}function at(e){var t=Ke(),n=t.footer,i=t.styles,o=t.classNames.tfoot;return n?De.jsx("tfoot",{className:o,style:i.tfoot,children:De.jsx("tr",{children:De.jsx("td",{colSpan:8,children:n})})}):De.jsx(De.Fragment,{})}function st(){var e=Ke(),t=e.classNames,n=e.styles,i=e.showWeekNumber,o=e.locale,r=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,l=function(e,t,n){for(var i=n?T(new Date):A(new Date,{locale:e,weekStartsOn:t}),o=[],r=0;r<7;r++){var a=he(i,r);o.push(a)}return o}(o,r,a);return De.jsxs("tr",{style:n.head_row,className:t.head_row,children:[i&&De.jsx("td",{style:n.head_cell,className:t.head_cell}),l.map((function(e,i){return De.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(e,{locale:o}),children:s(e,{locale:o})},i)}))]})}function ct(){var e,t=Ke(),n=t.classNames,i=t.styles,o=t.components,r=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:st;return De.jsx("thead",{style:i.head,className:n.head,children:De.jsx(r,{})})}function lt(e){var t=Ke(),n=t.locale,i=t.formatters.formatDay;return De.jsx(De.Fragment,{children:i(e.date,{locale:n})})}var ut=(0,i.createContext)(void 0);function dt(e){if(!we(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return De.jsx(ut.Provider,{value:t,children:e.children})}return De.jsx(pt,{initialProps:e.initialProps,children:e.children})}function pt(e){var t=e.initialProps,n=e.children,i=t.selected,o=t.min,r=t.max,a={disabled:[]};i&&a.disabled.push((function(e){var t=r&&i.length>r-1,n=i.some((function(t){return(0,me.K)(t,e)}));return Boolean(t&&!n)}));var s={selected:i,onDayClick:function(e,n,a){var s,c;if((null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,a),!Boolean(n.selected&&o&&(null==i?void 0:i.length)===o))&&!Boolean(!n.selected&&r&&(null==i?void 0:i.length)===r)){var l=i?Le([],i,!0):[];if(n.selected){var u=l.findIndex((function(t){return(0,me.K)(e,t)}));l.splice(u,1)}else l.push(e);null===(c=t.onSelect)||void 0===c||c.call(t,l,e,n,a)}},modifiers:a};return De.jsx(ut.Provider,{value:s,children:n})}function ft(){var e=(0,i.useContext)(ut);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var ht,mt=(0,i.createContext)(void 0);function gt(e){if(!Me(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return De.jsx(mt.Provider,{value:t,children:e.children})}return De.jsx(_t,{initialProps:e.initialProps,children:e.children})}function _t(e){var t=e.initialProps,n=e.children,i=t.selected,o=i||{},r=o.from,a=o.to,s=t.min,c=t.max,l={range_start:[],range_end:[],range_middle:[],disabled:[]};if(r?(l.range_start=[r],a?(l.range_end=[a],(0,me.K)(r,a)||(l.range_middle=[{after:r,before:a}])):l.range_end=[r]):a&&(l.range_start=[a],l.range_end=[a]),s&&(r&&!a&&l.disabled.push({after:_e(r,s-1),before:he(r,s-1)}),r&&a&&l.disabled.push({after:r,before:he(r,s-1)}),!r&&a&&l.disabled.push({after:_e(a,s-1),before:he(a,s-1)})),c){if(r&&!a&&(l.disabled.push({before:he(r,1-c)}),l.disabled.push({after:he(r,c-1)})),r&&a){var u=c-(y(a,r)+1);l.disabled.push({before:_e(r,u)}),l.disabled.push({after:he(a,u)})}!r&&a&&(l.disabled.push({before:he(a,1-c)}),l.disabled.push({after:he(a,c-1)}))}return De.jsx(mt.Provider,{value:{selected:i,onDayClick:function(e,n,o){var r,a;null===(r=t.onDayClick)||void 0===r||r.call(t,e,n,o);var s=function(e,t){var n=t||{},i=n.from,o=n.to;if(i&&o){if((0,me.K)(o,e)&&(0,me.K)(i,e))return;if((0,me.K)(o,e))return{from:o,to:void 0};if((0,me.K)(i,e))return;return ge(i,e)?{from:e,to:o}:{from:i,to:e}}return o?ge(e,o)?{from:o,to:e}:{from:e,to:o}:i?fe(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0}}(e,i);null===(a=t.onSelect)||void 0===a||a.call(t,s,e,n,o)},modifiers:l},children:n})}function vt(){var e=(0,i.useContext)(mt);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function yt(e){return Array.isArray(e)?Le([],e,!0):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(ht||(ht={}));var Et=ht.Selected,bt=ht.Disabled,St=ht.Hidden,At=ht.Today,Tt=ht.RangeEnd,Ot=ht.RangeMiddle,It=ht.RangeStart,Ct=ht.Outside;var Nt=(0,i.createContext)(void 0);function Lt(e){var t=Ke(),n=function(e,t,n){var i,o=((i={})[Et]=yt(e.selected),i[bt]=yt(e.disabled),i[St]=yt(e.hidden),i[At]=[e.today],i[Tt]=[],i[Ot]=[],i[It]=[],i[Ct]=[],i);return e.fromDate&&o[bt].push({before:e.fromDate}),e.toDate&&o[bt].push({after:e.toDate}),we(e)?o[bt]=o[bt].concat(t.modifiers[bt]):Me(e)&&(o[bt]=o[bt].concat(n.modifiers[bt]),o[It]=n.modifiers[It],o[Ot]=n.modifiers[Ot],o[Tt]=n.modifiers[Tt]),o}(t,ft(),vt()),i=function(e){var t={};return Object.entries(e).forEach((function(e){var n=e[0],i=e[1];t[n]=yt(i)})),t}(t.modifiers),o=Ne(Ne({},n),i);return De.jsx(Nt.Provider,{value:o,children:e.children})}function Rt(){var e=(0,i.useContext)(Nt);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Pt(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(q(t))return(0,me.K)(e,t);if(function(e){return Array.isArray(e)&&e.every(q)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return function(e,t){var n,i=t.from,o=t.to;return i&&o?(y(o,i)<0&&(i=(n=[o,i])[0],o=n[1]),y(e,i)>=0&&y(o,e)>=0):o?(0,me.K)(o,e):!!i&&(0,me.K)(i,e)}(e,t);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var n=y(t.before,e)>0,i=y(t.after,e)<0;return ge(t.before,t.after)?i&&n:n||i}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?y(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?y(t.before,e)>0:"function"==typeof t&&t(e)}))}function kt(e,t,n){var i=Object.keys(t).reduce((function(n,i){var o=t[i];return Pt(e,o)&&n.push(i),n}),[]),o={};return i.forEach((function(e){return o[e]=!0})),n&&!pe(e,n)&&(o.outside=!0),o}var Dt=365;function wt(e,t){var n=t.moveBy,i=t.direction,o=t.context,r=t.modifiers,a=t.retry,s=void 0===a?{count:0,lastFocused:e}:a,c=o.weekStartsOn,l=o.fromDate,u=o.toDate,d=o.locale,p={day:he,week:ve,month:de,year:ye,startOfWeek:function(e){return o.ISOWeek?T(e):A(e,{locale:d,weekStartsOn:c})},endOfWeek:function(e){return o.ISOWeek?be(e):Ee(e,{locale:d,weekStartsOn:c})}}[n](e,"after"===i?1:-1);"before"===i&&l?p=Se([l,p]):"after"===i&&u&&(p=Ae([u,p]));var f=!0;if(r){var h=kt(p,r);f=!h.disabled&&!h.hidden}return f?p:s.count>Dt?s.lastFocused:wt(p,{moveBy:n,direction:i,context:o,modifiers:r,retry:Ne(Ne({},s),{count:s.count+1})})}var Mt=(0,i.createContext)(void 0);function xt(e){var t=Qe(),n=Rt(),o=(0,i.useState)(),r=o[0],a=o[1],s=(0,i.useState)(),c=s[0],l=s[1],u=function(e,t){for(var n,i,o=oe(e[0]),r=re(e[e.length-1]),a=o;a<=r;){var s=kt(a,t);if(s.disabled||s.hidden)a=he(a,1);else{if(s.selected)return a;s.today&&!i&&(i=a),n||(n=a),a=he(a,1)}}return i||n}(t.displayMonths,n),d=(null!=r?r:c&&t.isDateDisplayed(c))?c:u,p=function(e){a(e)},f=Ke(),h=function(e,i){if(r){var o=wt(r,{moveBy:e,direction:i,context:f,modifiers:n});(0,me.K)(r,o)||(t.goToDate(o,r),p(o))}},m={focusedDay:r,focusTarget:d,blur:function(){l(r),a(void 0)},focus:p,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}};return De.jsx(Mt.Provider,{value:m,children:e.children})}function Ut(){var e=(0,i.useContext)(Mt);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var Vt=(0,i.createContext)(void 0);function Ft(e){if(!xe(e.initialProps)){var t={selected:void 0};return De.jsx(Vt.Provider,{value:t,children:e.children})}return De.jsx(Bt,{initialProps:e.initialProps,children:e.children})}function Bt(e){var t=e.initialProps,n=e.children,i={selected:t.selected,onDayClick:function(e,n,i){var o,r,a;null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,i),!n.selected||t.required?null===(a=t.onSelect)||void 0===a||a.call(t,e,e,n,i):null===(r=t.onSelect)||void 0===r||r.call(t,void 0,e,n,i)}};return De.jsx(Vt.Provider,{value:i,children:n})}function Ht(){var e=(0,i.useContext)(Vt);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Gt(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var i=e.modifiersClassNames[t];if(i)n.push(i);else if(function(e){return Object.values(ht).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function Kt(e,t,n){var o,r,a,s=Ke(),c=Ut(),l=function(e,t){return kt(e,Rt(),t)}(e,t),u=function(e,t){var n=Ke(),i=Ht(),o=ft(),r=vt(),a=Ut(),s=a.focusDayAfter,c=a.focusDayBefore,l=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,p=a.focus,f=a.focusMonthBefore,h=a.focusMonthAfter,m=a.focusYearBefore,g=a.focusYearAfter,_=a.focusStartOfWeek,v=a.focusEndOfWeek,y={onClick:function(a){var s,c,l,u;xe(n)?null===(s=i.onDayClick)||void 0===s||s.call(i,e,t,a):we(n)?null===(c=o.onDayClick)||void 0===c||c.call(o,e,t,a):Me(n)?null===(l=r.onDayClick)||void 0===l||l.call(r,e,t,a):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,a)},onFocus:function(i){var o;p(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,i)},onBlur:function(i){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,i)},onKeyDown:function(i){var o;switch(i.key){case"ArrowLeft":i.preventDefault(),i.stopPropagation(),"rtl"===n.dir?s():c();break;case"ArrowRight":i.preventDefault(),i.stopPropagation(),"rtl"===n.dir?c():s();break;case"ArrowDown":i.preventDefault(),i.stopPropagation(),l();break;case"ArrowUp":i.preventDefault(),i.stopPropagation(),u();break;case"PageUp":i.preventDefault(),i.stopPropagation(),i.shiftKey?m():f();break;case"PageDown":i.preventDefault(),i.stopPropagation(),i.shiftKey?g():h();break;case"Home":i.preventDefault(),i.stopPropagation(),_();break;case"End":i.preventDefault(),i.stopPropagation(),v()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,i)},onKeyUp:function(i){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,i)},onMouseEnter:function(i){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,i)},onMouseLeave:function(i){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,i)},onPointerEnter:function(i){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,i)},onPointerLeave:function(i){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,i)},onTouchCancel:function(i){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,i)},onTouchEnd:function(i){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,i)},onTouchMove:function(i){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,i)},onTouchStart:function(i){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,i)}};return y}(e,l),d=function(){var e=Ke(),t=Ht(),n=ft(),i=vt();return xe(e)?t.selected:we(e)?n.selected:Me(e)?i.selected:void 0}(),p=Boolean(s.onDayClick||"default"!==s.mode);(0,i.useEffect)((function(){var t;l.outside||c.focusedDay&&p&&(0,me.K)(c.focusedDay,e)&&(null===(t=n.current)||void 0===t||t.focus())}),[c.focusedDay,e,n,p,l.outside]);var f=Gt(s,l).join(" "),h=function(e,t){var n=Ne({},e.styles.day);return Object.keys(t).forEach((function(t){var i;n=Ne(Ne({},n),null===(i=e.modifiersStyles)||void 0===i?void 0:i[t])})),n}(s,l),m=Boolean(l.outside&&!s.showOutsideDays||l.hidden),g=null!==(a=null===(r=s.components)||void 0===r?void 0:r.DayContent)&&void 0!==a?a:lt,_={style:h,className:f,children:De.jsx(g,{date:e,displayMonth:t,activeModifiers:l}),role:"gridcell"},v=c.focusTarget&&(0,me.K)(c.focusTarget,e)&&!l.outside,y=c.focusedDay&&(0,me.K)(c.focusedDay,e),E=Ne(Ne(Ne({},_),((o={disabled:l.disabled,role:"gridcell"})["aria-selected"]=l.selected,o.tabIndex=y||v?0:-1,o)),u);return{isButton:p,isHidden:m,activeModifiers:l,selectedDays:d,buttonProps:E,divProps:_}}function Wt(e){var t=(0,i.useRef)(null),n=Kt(e.date,e.displayMonth,t);return n.isHidden?De.jsx("div",{role:"gridcell"}):n.isButton?De.jsx(nt,Ne({name:"day",ref:t},n.buttonProps)):De.jsx("div",Ne({},n.divProps))}function Yt(e){var t=e.number,n=e.dates,i=Ke(),o=i.onWeekNumberClick,r=i.styles,a=i.classNames,s=i.locale,c=i.labels.labelWeekNumber,l=(0,i.formatters.formatWeekNumber)(Number(t),{locale:s});if(!o)return De.jsx("span",{className:a.weeknumber,style:r.weeknumber,children:l});var u=c(Number(t),{locale:s});return De.jsx(nt,{name:"week-number","aria-label":u,className:a.weeknumber,style:r.weeknumber,onClick:function(e){o(t,n,e)},children:l})}function jt(e){var t,n,i,o=Ke(),r=o.styles,a=o.classNames,s=o.showWeekNumber,c=o.components,l=null!==(t=null==c?void 0:c.Day)&&void 0!==t?t:Wt,u=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:Yt;return s&&(i=De.jsx("td",{className:a.cell,style:r.cell,children:De.jsx(u,{number:e.weekNumber,dates:e.dates})})),De.jsxs("tr",{className:a.row,style:r.row,children:[i,e.dates.map((function(t){return De.jsx("td",{className:a.cell,style:r.cell,role:"presentation",children:De.jsx(l,{displayMonth:e.displayMonth,date:t})},Te(t))}))]})}function zt(e,t,n){for(var i=(null==n?void 0:n.ISOWeek)?be(t):Ee(t,n),o=(null==n?void 0:n.ISOWeek)?T(e):A(e,n),r=y(i,o),a=[],s=0;s<=r;s++)a.push(he(o,s));return a.reduce((function(e,t){var i=(null==n?void 0:n.ISOWeek)?C(t):R(t,n),o=e.find((function(e){return e.weekNumber===i}));return o?(o.dates.push(t),e):(e.push({weekNumber:i,dates:[t]}),e)}),[])}function Jt(e){var t,n,i,o=Ke(),r=o.locale,a=o.classNames,s=o.styles,c=o.hideHead,l=o.fixedWeeks,u=o.components,d=o.weekStartsOn,p=o.firstWeekContainsDate,f=o.ISOWeek,h=function(e,t){var n=zt(oe(e),re(e),t);if(null==t?void 0:t.useFixedWeeks){var i=Ce(e,t);if(i<6){var o=n[n.length-1],r=o.dates[o.dates.length-1],a=ve(r,6-i),s=zt(ve(r,1),a,t);n.push.apply(n,s)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(l),ISOWeek:f,locale:r,weekStartsOn:d,firstWeekContainsDate:p}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:ct,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:jt,_=null!==(i=null==u?void 0:u.Footer)&&void 0!==i?i:at;return De.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&De.jsx(m,{}),De.jsx("tbody",{className:a.tbody,style:s.tbody,children:h.map((function(t){return De.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)}))}),De.jsx(_,{displayMonth:e.displayMonth})]})}var qt="undefined"!=typeof window&&window.document&&window.document.createElement?i.useLayoutEffect:i.useEffect,Xt=!1,Zt=0;function Qt(){return"react-day-picker-".concat(++Zt)}function $t(e){var t,n,o=Ke(),r=o.dir,a=o.classNames,s=o.styles,c=o.components,l=Qe().displayMonths,u=function(e){var t,n=null!=e?e:Xt?Qt():null,o=(0,i.useState)(n),r=o[0],a=o[1];return qt((function(){null===r&&a(Qt())}),[]),(0,i.useEffect)((function(){!1===Xt&&(Xt=!0)}),[]),null!==(t=null!=e?e:r)&&void 0!==t?t:void 0}(o.id?"".concat(o.id,"-").concat(e.displayIndex):void 0),d=o.id?"".concat(o.id,"-grid-").concat(e.displayIndex):void 0,p=[a.month],f=s.month,h=0===e.displayIndex,m=e.displayIndex===l.length-1,g=!h&&!m;"rtl"===r&&(m=(t=[h,m])[0],h=t[1]),h&&(p.push(a.caption_start),f=Ne(Ne({},f),s.caption_start)),m&&(p.push(a.caption_end),f=Ne(Ne({},f),s.caption_end)),g&&(p.push(a.caption_between),f=Ne(Ne({},f),s.caption_between));var _=null!==(n=null==c?void 0:c.Caption)&&void 0!==n?n:rt;return De.jsxs("div",{className:p.join(" "),style:f,children:[De.jsx(_,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),De.jsx(Jt,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function en(e){var t=Ke(),n=t.classNames,i=t.styles;return De.jsx("div",{className:n.months,style:i.months,children:e.children})}function tn(e){var t,n,o=e.initialProps,r=Ke(),a=Ut(),s=Qe(),c=(0,i.useState)(!1),l=c[0],u=c[1];(0,i.useEffect)((function(){r.initialFocus&&a.focusTarget&&(l||(a.focus(a.focusTarget),u(!0)))}),[r.initialFocus,l,a.focus,a.focusTarget,a]);var d=[r.classNames.root,r.className];r.numberOfMonths>1&&d.push(r.classNames.multiple_months),r.showWeekNumber&&d.push(r.classNames.with_weeknumber);var p=Ne(Ne({},r.styles.root),r.style),f=Object.keys(o).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return Ne(Ne({},e),((n={})[t]=o[t],n))}),{}),h=null!==(n=null===(t=o.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:en;return De.jsx("div",Ne({className:d.join(" "),style:p,dir:r.dir,id:r.id,nonce:o.nonce,title:o.title,lang:o.lang},f,{children:De.jsx(h,{children:s.displayMonths.map((function(e,t){return De.jsx($t,{displayIndex:t,displayMonth:e},t)}))})}))}function nn(e){var t=e.children,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o{"use strict";var i=n(50959);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n