(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[4151],{34143:(e,t,n)=>{"use strict";n.d(t,{A:()=>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(y,--E):0,_--,10===v&&(_=1,m--),v}function A(){return v=E2||R(v)>3?"":" "}function w(e,t){for(;--t&&A()&&!(v<48||v>102||v>57&&v<65||v>70&&v<97););return C(e,O()+(t<6&&32==I()&&32==A()))}function D(e){for(;A();)switch(v){case e:return E;case 34:case 39:34!==e&&39!==e&&D(v);break;case 40:41===e&&D(e);break;case 92:A()}return E}function M(e,t){for(;A()&&e+v!==57&&(e+v!==84||47!==I()););return"/*"+C(t,E-1)+"*"+r(47===e?e:A())}function x(e){for(;!R(I());)A();return C(e,E)}var U="-ms-",V="-moz-",F="-webkit-",B="comm",H="rule",G="decl",W="@keyframes";function j(e,t){for(var n="",i=h(e),o=0;o0&&p(V)-g&&f(v>32?X(V+";",i,n,g-1):X(c(V," ","")+";",i,n,g-2),h);break;case 59:V+=";";default:if(f(U=J(V,t,n,m,_,o,d,N,P=[],D=[],g),a),123===R)if(0===_)K(V,t,U,U,P,a,g,d,D);else switch(99===E&&110===u(V,3)?100:E){case 100:case 108:case 109:case 115:K(e,U,U,i&&f(J(e,U,U,0,0,o,d,N,o,P=[],g),D),o,D,g,d,i?P:D);break;default:K(V,U,U,U,[""],D,0,d,D)}}m=_=v=0,b=C=1,N=V="",g=s;break;case 58:g=1+p(V),v=y;default:if(b<1)if(123==R)--b;else if(125==R&&0==b++&&125==T())continue;switch(V+=r(R),R*b){case 38:C=_>0?1:(V+="\f",-1);break;case 44:d[m++]=(p(V)-1)*C,C=1;break;case 64:45===I()&&(V+=L(A())),E=I(),_=g=p(N=V+=x(O())),R++;break;case 45:45===y&&2==p(V)&&(b=0)}}return a}function J(e,t,n,i,r,a,l,u,p,f,m){for(var _=r-1,g=0===r?a:[""],E=h(g),v=0,y=0,S=0;v0?g[T]+" "+A:c(A,/&\f/g,g[T])))&&(p[S++]=I);return b(e,t,n,0===r?H:u,p,f,m)}function q(e,t,n){return b(e,t,n,B,r(v),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 $=function(e,t,n){for(var i=0,o=0;i=o,o=I(),38===i&&12===o&&(t[n]=1),!R(o);)A();return C(e,E)},Z=function(e,t){return P(function(e,t){var n=-1,i=44;do{switch(R(i)){case 0:38===i&&12===I()&&(t[n]=1),e[n]+=$(E-1,t,n);break;case 2:e[n]+=L(i);break;case 4:if(44===i){e[++n]=58===I()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=r(i)}}while(i=A());return e}(N(e),t))},Q=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)||Q.get(n))&&!i){Q.set(e,!0);for(var o=[],r=Z(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 W:return j([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 j([S(e,{props:[c(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return j([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,{A:()=>i})},97848:(e,t,n)=>{"use strict";n.d(t,{C:()=>u,E:()=>_,c:()=>f,h:()=>c});var i=n(30758),o=n(34143);var r=function(e,t,n){var i=e.key+"-"+t.name;!1===n&&void 0===e.registered[i]&&(e.registered[i]=t.styles)},a=n(91761),s=n(14958),c={}.hasOwnProperty,l=i.createContext("undefined"!=typeof HTMLElement?(0,o.A)({key:"css"}):null);var u=l.Provider,d=function(e){return(0,i.forwardRef)((function(t,n){var o=(0,i.useContext)(l);return e(t,o,n)}))};var p=i.createContext({});var h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",f=function(e,t){var n={};for(var i in t)c.call(t,i)&&(n[i]=t[i]);return n[h]=e,n},m=function(e){var t=e.cache,n=e.serialized,i=e.isStringTag;return r(t,n,i),(0,s.s)((function(){return function(e,t,n){r(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 _=d((function(e,t,n){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var r=e[h],s=[o],l="";"string"==typeof e.className?l=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,s,e.className):null!=e.className&&(l=e.className+" ");var u=(0,a.J)(s,void 0,i.useContext(p));l+=t.key+"-"+u.name;var d={};for(var f in e)c.call(e,f)&&"css"!==f&&f!==h&&(d[f]=e[f]);return d.ref=n,d.className=l,i.createElement(i.Fragment,null,i.createElement(m,{cache:t,serialized:u,isStringTag:"string"==typeof r}),i.createElement(r,d))}))},29778:(e,t,n)=>{"use strict";n.d(t,{AH:()=>s,Y:()=>a,i7:()=>c});var i=n(97848),o=n(30758),r=(n(14958),n(91761)),a=(n(34143),n(31035),function(e,t){var n=arguments;if(null==t||!i.h.call(t,"css"))return o.createElement.apply(void 0,n);var r=n.length,a=new Array(r);a[0]=i.E,a[1]=(0,i.c)(e,t);for(var s=2;s{"use strict";n.d(t,{J:()=>f});var i={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},o=n(4498),r=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!=typeof e},l=(0,o.A)((function(e){return s(e)?e:e.replace(r,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===i[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(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 p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)p={name:i.name,styles:i.styles,next:p},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:p}}},14958:(e,t,n)=>{"use strict";var i;n.d(t,{s:()=>a});var o=n(30758),r=!!(i||(i=n.t(o,2))).useInsertionEffect&&(i||(i=n.t(o,2))).useInsertionEffect,a=r||function(e){return e()};r||o.useLayoutEffect},94462:(e,t,n)=>{var i;i=function(){return function(){var e={254:function(e,t,n){e.exports=n(615).default},615:function(e,t,i){"use strict";i.d(t,{default:function(){return Xt}});var o=i(48),r=i.n(o),a=i(153),s=i.n(a),c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,p=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,f=function(e,t){return function(){return e&&(t=e(e=0)),t}},m=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},_=function(e,t,n){return n=null!=e?c(p(e)):{},function(e,t,n,i){if(t&&"object"==typeof t||"function"==typeof t)for(var o,r=d(t),a=0,s=r.length;a=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(r=n,!1!==o&&function(e){var n=(i[e]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":E(window))!==t&&c){try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}}(n),s.call(a,n,e),("undefined"==typeof console?"undefined":E(console))===t&&n1){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-1?a.push(" />"):(a.push(">"),t.childNodes.length?a.push.apply(a,t.childNodes.map(e)):t.textContent||t.innerText?a.push(r(t.textContent||t.innerText)):t.innerHTML&&a.push(t.innerHTML),a.push("")),a.join("")}(t)}};var n=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function i(e,t){var n=E(e[t]);return"style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===n||"boolean"===n||"number"===n)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function o(e){var t=[];return e.forEach((function(e){var n=e.name,i=e.value;"style"===n&&(i=function(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach((function(n){var i=e[n];n=n.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})),t+=n+":"+i+";"})),t}(i)),t.push(n+'="'+function(e){return r(e).replace(/"/g,""")}(i)+'"')})),t.length?" "+t.join(" "):""}function r(e){var t="";return"string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&").replace(//g,">")}})),k=m((function(e,t){S();var n=I(),i=R(),o=N(),r=P(),a=L(),s="http://www.w3.org/1999/xhtml";function c(e,t,n){if(!b(this,c))return new c(e);var i=void 0===n?s:n||null;this.tagName=i===s?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=i,this._attributes={},"INPUT"===this.tagName&&(this.type="text")}t.exports=c,c.prototype.type="DOMElement",c.prototype.nodeType=1,c.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e},c.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[n]=e,e.parentNode=this,t},c.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e},c.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var n=null==t?-1:this.childNodes.indexOf(t);return n>-1?this.childNodes.splice(n,0,e):this.childNodes.push(e),e.parentNode=this,e},c.prototype.setAttributeNS=function(e,t,n){var i=null,o=t,r=t.indexOf(":");r>-1&&(i=t.substr(0,r),o=t.substr(r+1)),"INPUT"===this.tagName&&"type"===t?this.type=n:(this._attributes[e]||(this._attributes[e]={}))[o]={value:n,prefix:i}},c.prototype.getAttributeNS=function(e,t){var n=this._attributes[e],i=n&&n[t]&&n[t].value;return"INPUT"===this.tagName&&"type"===t?this.type:"string"!=typeof i?null:i},c.prototype.removeAttributeNS=function(e,t){var n=this._attributes[e];n&&delete n[t]},c.prototype.hasAttributeNS=function(e,t){var n=this._attributes[e];return!!n&&t in n},c.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)},c.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)},c.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)},c.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)},c.prototype.removeEventListener=r,c.prototype.addEventListener=o,c.prototype.dispatchEvent=i,c.prototype.focus=function(){},c.prototype.toString=function(){return a(this)},c.prototype.getElementsByClassName=function(e){var t=e.split(" "),i=[];return n(this,(function(e){if(1===e.nodeType){var n=(e.className||"").split(" ");t.every((function(e){return-1!==n.indexOf(e)}))&&i.push(e)}})),i},c.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var t=[];return n(this.childNodes,(function(n){1===n.nodeType&&("*"===e||n.tagName.toLowerCase()===e)&&t.push(n)})),t},c.prototype.contains=function(e){return n(this,(function(t){return e===t}))||!1}})),w=m((function(e,t){S();var n=k();function i(e){if(!b(this,i))return new i;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}t.exports=i,i.prototype.type="DocumentFragment",i.prototype.nodeType=11,i.prototype.nodeName="#document-fragment",i.prototype.appendChild=n.prototype.appendChild,i.prototype.replaceChild=n.prototype.replaceChild,i.prototype.removeChild=n.prototype.removeChild,i.prototype.toString=function(){return this.childNodes.map((function(e){return String(e)})).join("")}})),D=m((function(e,t){function n(e){}t.exports=n,n.prototype.initEvent=function(e,t,n){this.type=e,this.bubbles=t,this.cancelable=n},n.prototype.preventDefault=function(){}})),M=m((function(e,t){S();var n=I(),i=O(),o=C(),r=k(),a=w(),s=D(),c=R(),l=N(),u=P();function d(){if(!b(this,d))return new d;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}t.exports=d;var p=d.prototype;p.createTextNode=function(e){return new o(e,this)},p.createElementNS=function(e,t){var n=null===e?null:String(e);return new r(t,this,n)},p.createElement=function(e){return new r(e,this)},p.createDocumentFragment=function(){return new a(this)},p.createEvent=function(e){return new s(e)},p.createComment=function(e){return new i(e,this)},p.getElementById=function(e){return e=String(e),n(this.childNodes,(function(t){if(String(t.id)===e)return t}))||null},p.getElementsByClassName=r.prototype.getElementsByClassName,p.getElementsByTagName=r.prototype.getElementsByTagName,p.contains=r.prototype.contains,p.removeEventListener=u,p.addEventListener=l,p.dispatchEvent=c})),x=m((function(e,t){var n=M();t.exports=new n})),U=m((function(e,t){var i,o=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},r=x();"undefined"!=typeof document?i=document:(i=o["__GLOBAL_DOCUMENT_CACHE@4"])||(i=o["__GLOBAL_DOCUMENT_CACHE@4"]=r),t.exports=i}));function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0||0===i.toLowerCase().indexOf("x-litix-"))&&(t[i]=n.join(": "))}})),t}function Ee(e){if(e){var t=me.find((function(t){return void 0!==e[t]}));return t?e[t]:void 0}}var ve=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},ye=function(e){if(!e)return{};var t=de(),n=e.loading,i=n?n.start:e.trequest,o=n?n.first:e.tfirst,r=n?n.end:e.tload;return{bytesLoaded:e.total,requestStart:Math.round(t+i),responseStart:Math.round(t+o),responseEnd:Math.round(t+r)}},be=function(e){if(e&&"function"==typeof e.getAllResponseHeaders)return ge(e.getAllResponseHeaders())},Se=function(e,t){if(!e||!e.requestEndDate)return{};var n,i=ae(e.url),o=e.url,r=e.bytesLoaded,a=new Date(e.requestStartDate).getTime(),s=new Date(e.firstByteDate).getTime(),c=new Date(e.requestEndDate).getTime(),l=isNaN(e.duration)?0:e.duration,u="function"==typeof t.getMetricsFor?t.getMetricsFor(e.mediaType).HttpList:t.getDashMetrics().getHttpRequests(e.mediaType);return u.length>0&&(n=ge(u[u.length-1]._responseHeaders||"")),{requestStart:a,requestResponseStart:s,requestResponseEnd:c,requestBytesLoaded:r,requestResponseHeaders:n,requestMediaDuration:l,requestHostname:i,requestUrl:o,requestId:n?Ee(n):void 0}},Te=function(e){var t;return null===(t=e.match(/.*codecs\*?="(.*)"/))||void 0===t?void 0:t[1]},Ae=0,Ie=function(){function e(){Q(this,e),ne(this,"_listeners",void 0)}return te(e,[{key:"on",value:function(e,t,n){return t._eventEmitterGuid=t._eventEmitterGuid||++Ae,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||++Ae;var o=function(){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)}}}]),e}(),Oe=Ie,Ce=_(g()),Re=function(){function e(t){var n=this;Q(this,e),ne(this,"_playbackHeartbeatInterval",void 0),ne(this,"_playheadShouldBeProgressing",void 0),ne(this,"pm",void 0),this.pm=t,this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,t.on("playing",(function(){n._playheadShouldBeProgressing=!0})),t.on("play",this._startPlaybackHeartbeatInterval.bind(this)),t.on("playing",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adbreakstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adplay",this._startPlaybackHeartbeatInterval.bind(this)),t.on("adplaying",this._startPlaybackHeartbeatInterval.bind(this)),t.on("devicewake",this._startPlaybackHeartbeatInterval.bind(this)),t.on("viewstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("rebufferstart",this._startPlaybackHeartbeatInterval.bind(this)),t.on("pause",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("ended",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("viewend",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("error",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("aderror",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adpause",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adended",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("adbreakend",this._stopPlaybackHeartbeatInterval.bind(this)),t.on("seeked",(function(){t.data.player_is_paused?n._stopPlaybackHeartbeatInterval():n._startPlaybackHeartbeatInterval()})),t.on("timeupdate",(function(){null!==n._playbackHeartbeatInterval&&t.emit("playbackheartbeat")})),t.on("devicesleep",(function(e,i){null!==n._playbackHeartbeatInterval&&(Ce.default.clearInterval(n._playbackHeartbeatInterval),t.emit("playbackheartbeatend",{viewer_time:i.viewer_time}),n._playbackHeartbeatInterval=null)}))}return te(e,[{key:"_startPlaybackHeartbeatInterval",value:function(){var e=this;null===this._playbackHeartbeatInterval&&(this.pm.emit("playbackheartbeat"),this._playbackHeartbeatInterval=Ce.default.setInterval((function(){e.pm.emit("playbackheartbeat")}),this.pm.playbackHeartbeatTime))}},{key:"_stopPlaybackHeartbeatInterval",value:function(){this._playheadShouldBeProgressing=!1,null!==this._playbackHeartbeatInterval&&(Ce.default.clearInterval(this._playbackHeartbeatInterval),this.pm.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)}}]),e}(),Ne=function e(t){var n=this;Q(this,e),ne(this,"viewErrored",void 0),t.on("viewinit",(function(){n.viewErrored=!1})),t.on("error",(function(e,i){try{var o=t.errorTranslator({player_error_code:i.player_error_code,player_error_message:i.player_error_message,player_error_context:i.player_error_context,player_error_severity:i.player_error_severity,player_error_business_exception:i.player_error_business_exception});o&&(t.data.player_error_code=o.player_error_code||i.player_error_code,t.data.player_error_message=o.player_error_message||i.player_error_message,t.data.player_error_context=o.player_error_context||i.player_error_context,t.data.player_error_severity=o.player_error_severity||i.player_error_severity,t.data.player_error_business_exception=o.player_error_business_exception||i.player_error_business_exception,n.viewErrored=!0)}catch(e){t.mux.log.warn("Exception in error translator callback.",e),n.viewErrored=!0}})),t.on("aftererror",(function(){var e,n,i,o,r;null===(e=t.data)||void 0===e||delete e.player_error_code,null===(n=t.data)||void 0===n||delete n.player_error_message,null===(i=t.data)||void 0===i||delete i.player_error_context,null===(o=t.data)||void 0===o||delete o.player_error_severity,null===(r=t.data)||void 0===r||delete r.player_error_business_exception}))},Pe=function(){function e(t){Q(this,e),ne(this,"_watchTimeTrackerLastCheckedTime",void 0),ne(this,"pm",void 0),this.pm=t,this._watchTimeTrackerLastCheckedTime=null,t.on("playbackheartbeat",this._updateWatchTime.bind(this)),t.on("playbackheartbeatend",this._clearWatchTimeState.bind(this))}return te(e,[{key:"_updateWatchTime",value:function(e,t){var n=t.viewer_time;null===this._watchTimeTrackerLastCheckedTime&&(this._watchTimeTrackerLastCheckedTime=n),pe(this.pm.data,"view_watch_time",n-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=n}},{key:"_clearWatchTimeState",value:function(e,t){this._updateWatchTime(e,t),this._watchTimeTrackerLastCheckedTime=null}}]),e}(),Le=function(){function e(t){var n=this;Q(this,e),ne(this,"_playbackTimeTrackerLastPlayheadPosition",void 0),ne(this,"_lastTime",void 0),ne(this,"_isAdPlaying",void 0),ne(this,"_callbackUpdatePlaybackTime",void 0),ne(this,"pm",void 0),this.pm=t,this._playbackTimeTrackerLastPlayheadPosition=-1,this._lastTime=$.now(),this._isAdPlaying=!1,this._callbackUpdatePlaybackTime=null;var i=this._startPlaybackTimeTracking.bind(this);t.on("playing",i),t.on("adplaying",i),t.on("seeked",i);var o=this._stopPlaybackTimeTracking.bind(this);t.on("playbackheartbeatend",o),t.on("seeking",o),t.on("adplaying",(function(){n._isAdPlaying=!0})),t.on("adended",(function(){n._isAdPlaying=!1})),t.on("adpause",(function(){n._isAdPlaying=!1})),t.on("adbreakstart",(function(){n._isAdPlaying=!1})),t.on("adbreakend",(function(){n._isAdPlaying=!1})),t.on("adplay",(function(){n._isAdPlaying=!1})),t.on("viewinit",(function(){n._playbackTimeTrackerLastPlayheadPosition=-1,n._lastTime=$.now(),n._isAdPlaying=!1,n._callbackUpdatePlaybackTime=null}))}return te(e,[{key:"_startPlaybackTimeTracking",value:function(){null===this._callbackUpdatePlaybackTime&&(this._callbackUpdatePlaybackTime=this._updatePlaybackTime.bind(this),this._playbackTimeTrackerLastPlayheadPosition=this.pm.data.player_playhead_time,this.pm.on("playbackheartbeat",this._callbackUpdatePlaybackTime))}},{key:"_stopPlaybackTimeTracking",value:function(){this._callbackUpdatePlaybackTime&&(this._updatePlaybackTime(),this.pm.off("playbackheartbeat",this._callbackUpdatePlaybackTime),this._callbackUpdatePlaybackTime=null,this._playbackTimeTrackerLastPlayheadPosition=-1)}},{key:"_updatePlaybackTime",value:function(){var e=this.pm.data.player_playhead_time,t=$.now(),n=-1;this._playbackTimeTrackerLastPlayheadPosition>=0&&e>this._playbackTimeTrackerLastPlayheadPosition?n=e-this._playbackTimeTrackerLastPlayheadPosition:this._isAdPlaying&&(n=t-this._lastTime),n>0&&n<=1e3&&pe(this.pm.data,"view_content_playback_time",n),this._playbackTimeTrackerLastPlayheadPosition=e,this._lastTime=t}}]),e}(),ke=function(){function e(t){Q(this,e),ne(this,"pm",void 0),this.pm=t;var n=this._updatePlayheadTime.bind(this);t.on("playbackheartbeat",n),t.on("playbackheartbeatend",n),t.on("timeupdate",n),t.on("destroy",(function(){t.off("timeupdate",n)}))}return te(e,[{key:"_updateMaxPlayheadPosition",value:function(){this.pm.data.view_max_playhead_position=void 0===this.pm.data.view_max_playhead_position?this.pm.data.player_playhead_time:Math.max(this.pm.data.view_max_playhead_position,this.pm.data.player_playhead_time)}},{key:"_updatePlayheadTime",value:function(e,t){var n=this,i=function(){n.pm.currentFragmentPDT&&n.pm.currentFragmentStart&&(n.pm.data.player_program_time=n.pm.currentFragmentPDT+n.pm.data.player_playhead_time-n.pm.currentFragmentStart)};if(t&&t.player_playhead_time)this.pm.data.player_playhead_time=t.player_playhead_time,i(),this._updateMaxPlayheadPosition();else if(this.pm.getPlayheadTime){var o=this.pm.getPlayheadTime();void 0!==o&&(this.pm.data.player_playhead_time=o,i(),this._updateMaxPlayheadPosition())}}}]),e}(),we=3e5,De=function e(t){if(Q(this,e),!t.disableRebufferTracking){var n,i=function(e,t){o(t),n=void 0},o=function(e){if(n){var i=e.viewer_time-n;pe(t.data,"view_rebuffer_duration",i),n=e.viewer_time,t.data.view_rebuffer_duration>we&&(t.emit("viewend"),t.send("viewend"),t.mux.log.warn("Ending view after rebuffering for longer than ".concat(we,"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||(pe(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)}))}},Me=function(){function e(t){var n=this;Q(this,e),ne(this,"_lastCheckedTime",void 0),ne(this,"_lastPlayheadTime",void 0),ne(this,"_lastPlayheadTimeUpdatedTime",void 0),ne(this,"_rebuffering",void 0),ne(this,"pm",void 0),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:$.now()})})))}return te(e,[{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()}}]),e}(),xe=Me,Ue=function(){function e(t){var n=this;Q(this,e),ne(this,"NAVIGATION_START",void 0),ne(this,"pm",void 0),this.pm=t,t.on("viewinit",(function(){var e=t.data,i=e.view_id;if(!e.view_program_changed){var o=function(e,o){var r=o.viewer_time;("playing"===e.type&&void 0===t.data.view_time_to_first_frame||"adplaying"===e.type&&(void 0===t.data.view_time_to_first_frame||n._inPrerollPosition()))&&n.calculateTimeToFirstFrame(r||$.now(),i)};t.one("playing",o),t.one("adplaying",o),t.one("viewend",(function(){t.off("playing",o),t.off("adplaying",o)}))}}))}return te(e,[{key:"_inPrerollPosition",value:function(){return void 0===this.pm.data.view_content_playback_time||this.pm.data.view_content_playback_time<=1e3}},{key:"calculateTimeToFirstFrame",value:function(e,t){t===this.pm.data.view_id&&(this.pm.watchTimeTracker._updateWatchTime(null,{viewer_time:e}),this.pm.data.view_time_to_first_frame=this.pm.data.view_watch_time,(this.pm.data.player_autoplay_on||this.pm.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.pm.data.view_aggregate_startup_time=this.pm.data.view_start+this.pm.data.view_watch_time-this.NAVIGATION_START))}}]),e}(),Ve=function e(t){var n=this;Q(this,e),ne(this,"_lastPlayerHeight",void 0),ne(this,"_lastPlayerWidth",void 0),ne(this,"_lastPlayheadPosition",void 0),ne(this,"_lastSourceHeight",void 0),ne(this,"_lastSourceWidth",void 0),t.on("viewinit",(function(){n._lastPlayheadPosition=-1})),["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach((function(e){t.on(e,(function(){if(n._lastPlayheadPosition>=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),pe(t.data,"view_total_content_playback_time",e),pe(t.data,"view_total_upscaling",o*e),pe(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}))}))},Fe=function e(t){var n=this;Q(this,e),ne(this,"isSeeking",void 0),this.isSeeking=!1;var i=-1,o=function(){var e=$.now(),o=(t.data.viewer_time||e)-(i||e);pe(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,pe(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}))},Be=function(e,t){e.push(t),e.sort((function(e,t){return e.viewer_time-t.viewer_time}))},He=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror","adclicked","adskipped"],Ge=function(){function e(t){var n=this;Q(this,e),ne(this,"_adHasPlayed",void 0),ne(this,"_adRequests",void 0),ne(this,"_adResponses",void 0),ne(this,"_currentAdRequestNumber",void 0),ne(this,"_currentAdResponseNumber",void 0),ne(this,"_prerollPlayTime",void 0),ne(this,"_wouldBeNewAdPlay",void 0),ne(this,"isAdBreak",void 0),ne(this,"pm",void 0),this.pm=t,t.on("viewinit",(function(){n.isAdBreak=!1,n._currentAdRequestNumber=0,n._currentAdResponseNumber=0,n._adRequests=[],n._adResponses=[],n._adHasPlayed=!1,n._wouldBeNewAdPlay=!0,n._prerollPlayTime=void 0})),He.forEach((function(e){return t.on(e,n._updateAdData.bind(n))}));var i=function(){n.isAdBreak=!1};t.on("adbreakstart",(function(){n.isAdBreak=!0})),t.on("play",i),t.on("playing",i),t.on("viewend",i),t.on("adrequest",(function(e,i){i=Object.assign({ad_request_id:"generatedAdRequestId"+n._currentAdRequestNumber++},i),Be(n._adRequests,i),pe(t.data,"view_ad_request_count"),n.inPrerollPosition()&&(t.data.view_preroll_requested=!0,n._adHasPlayed||pe(t.data,"view_preroll_request_count"))})),t.on("adresponse",(function(e,i){i=Object.assign({ad_request_id:"generatedAdRequestId"+n._currentAdResponseNumber++},i),Be(n._adResponses,i);var o=n.findAdRequest(i.ad_request_id);o&&pe(t.data,"view_ad_request_time",Math.max(0,i.viewer_time-o.viewer_time))})),t.on("adplay",(function(e,i){n._adHasPlayed=!0,n._wouldBeNewAdPlay&&(n._wouldBeNewAdPlay=!1,pe(t.data,"view_ad_played_count")),n.inPrerollPosition()&&!t.data.view_preroll_played&&(t.data.view_preroll_played=!0,n._adRequests.length>0&&(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||pe(t.data,"view_ad_clicked_count")})),t.on("adskipped",(function(e,i){n._wouldBeNewAdPlay||pe(t.data,"view_ad_skipped_count")})),t.on("adended",(function(){n._wouldBeNewAdPlay=!0})),t.on("aderror",(function(){n._wouldBeNewAdPlay=!0}))}return te(e,[{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)}))},ze=_(g()),Ke=_(T()),Je=_(A()),qe="muxData",Xe=function(){var e;try{e=Ke.default.parse(Je.default.get(qe)||"")}catch(t){e={}}return e},$e=function(e){try{Je.default.set(qe,Ke.default.stringify(e),{expires:365})}catch(e){}},Ze=_(g()),Qe=function(){var e;switch(et()){case"cellular":e="cellular";break;case"ethernet":e="wired";break;case"wifi":e="wifi";break;case void 0:break;default:e="other"}return e},et=function(){var e=Ze.default.navigator,t=e&&(e.connection||e.mozConnection||e.webkitConnection);return t&&t.type};Qe.getConnectionFromAPI=et;var tt=Qe,nt=ot({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"}),it=ot({ad:"ad",ag:"aggregate",ap:"api",al:"application",ar:"architecture",as:"asset",au:"autoplay",av:"average",bi:"bitrate",br:"break",bw:"browser",by:"bytes",bz:"business",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",ep:"experiments",es:"errorcode",et:"errortext",ee:"event",ev:"events",ex:"expires",ez:"exception",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",sy:"severity",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 ot(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function rt(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=nt[a];s||(K.info("Data key word `"+r[0]+"` not expected in "+i),s=a+"_"),r.splice(1).forEach((function(e){"url"===e&&(o=!0),it[e]?s+=it[e]:Number(e)&&Math.floor(Number(e))===Number(e)?s+=e:(K.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 at=_(g()),st={maxBeaconSize:300,maxQueueLength:3600,baseTimeBetweenBeacons:1e4,maxPayloadKBSize:500},ct=["hb","requestcompleted","requestfailed","requestcanceled"],lt=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({},st,t)};lt.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)},lt.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())},lt.prototype.destroy=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.destroyed=!0,e?this._clearBeaconQueue():this.flushEvents(),at.default.clearTimeout(this._sendTimeout)},lt.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],rt({mux_view_message:"event queue truncated"}));var n=this._createPayload(t);dt(this._beaconUrl,n,!0,(function(){}))},lt.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=$.now();dt(this._beaconUrl,n,!1,(function(n,o){o?(e._eventQueue=t.concat(e._eventQueue),e._failureCount+=1,K.info("Error sending beacon: "+o)):e._failureCount=0,e._roundTripTime=$.now()-i,e._postInFlight=!1}))}},lt.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},lt.prototype._startBeaconSending=function(){var e=this;at.default.clearTimeout(this._sendTimeout),!this.destroyed&&(this._sendTimeout=at.default.setTimeout((function(){e._eventQueue.length&&e._sendBeaconQueue(),e._startBeaconSending()}),this._getNextBeaconTime()))},lt.prototype._createPayload=function(e){var t=this,n={transmission_timestamp:Math.round($.now())};this._roundTripTime&&(n.rtt_ms=Math.round(this._roundTripTime));var i,o,r,a=function(){i=JSON.stringify({metadata:n,events:o||e}),r=i.length/1024},s=function(){return r<=t._options.maxPayloadKBSize};return a(),s()||(K.info("Payload size is too big ("+r+" kb). Removing unnecessary events."),o=e.filter((function(e){return-1===ct.indexOf(e.e)})),a()),s()||(K.info("Payload size still too big ("+r+" kb). Cropping fields.."),o.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()),i};var ut=function(e){return e.length<=57344},dt=function(e,t,n,i){if(n&&navigator&&navigator.sendBeacon&&navigator.sendBeacon(e,t))i();else if(at.default.fetch)at.default.fetch(e,{method:"POST",body:t,headers:{"Content-Type":"text/plain"},keepalive:ut(t)}).then((function(e){return i(null,e.ok?null:"Error")})).catch((function(e){return i(null,e)}));else{if(at.default.XMLHttpRequest){var o=new at.default.XMLHttpRequest;return o.onreadystatechange=function(){if(4===o.readyState)return i(null,200!==o.status?"error":void 0)},o.open("POST",e),o.setRequestHeader("Content-Type","text/plain"),void o.send(t)}i()}},pt=lt,ht=["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","player_error_code","player_error_message","player_error_context","player_error_severity","player_error_business_exception"],ft=["adplay","adplaying","adpause","adfirstquartile","admidpoint","adthirdquartile","adended","adresponse","adrequest"],mt=["ad_id","ad_creative_id","ad_universal_id"],_t=["viewstart","error","ended","viewend"],gt=function(){function e(t,n){var i,o,r,a,s,c,l,u,d,p,h,f,m,_,g,E=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Q(this,e),ne(this,"mux",void 0),ne(this,"envKey",void 0),ne(this,"options",void 0),ne(this,"eventQueue",void 0),ne(this,"sampleRate",void 0),ne(this,"disableCookies",void 0),ne(this,"respectDoNotTrack",void 0),ne(this,"previousBeaconData",void 0),ne(this,"lastEventTime",void 0),ne(this,"rateLimited",void 0),ne(this,"pageLevelData",void 0),ne(this,"viewerData",void 0),this.mux=t,this.envKey=n,this.options=E,this.previousBeaconData=null,this.lastEventTime=0,this.rateLimited=!1,this.eventQueue=new pt(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!==(m=this.options.sampleRate)&&void 0!==m?m:1,this.disableCookies=null!==(_=this.options.disableCookies)&&void 0!==_&&_,this.respectDoNotTrack=null!==(g=this.options.respectDoNotTrack)&&void 0!==g&&g,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===(i=this.options.platform)||void 0===i?void 0:i.name,viewer_application_version:null===(o=this.options.platform)||void 0===o?void 0:o.version,viewer_application_engine:null===(r=this.options.platform)||void 0===r?void 0:r.layout,viewer_device_name:null===(a=this.options.platform)||void 0===a?void 0:a.product,viewer_device_category:"",viewer_device_manufacturer:null===(s=this.options.platform)||void 0===s?void 0:s.manufacturer,viewer_os_family:null===(l=this.options.platform)||void 0===l||null===(c=l.os)||void 0===c?void 0:c.family,viewer_os_architecture:null===(d=this.options.platform)||void 0===d||null===(u=d.os)||void 0===u?void 0:u.architecture,viewer_os_version:null===(h=this.options.platform)||void 0===h||null===(p=h.os)||void 0===p?void 0:p.version,viewer_connection_type:tt(),page_url:null===ze.default||void 0===ze.default||null===(f=ze.default.location)||void 0===f?void 0:f.href},this.viewerData=this.disableCookies?{}:function(){var e=Xe();return e.mux_viewer_id=e.mux_viewer_id||H(),e.msn=e.msn||Math.random(),$e(e),{mux_viewer_id:e.mux_viewer_id,mux_sample_number:e.msn}}()}return te(e,[{key:"send",value:function(e,t){if(e&&null!=t&&t.view_id){if(this.respectDoNotTrack&&q())return K.info("Not sending `"+e+"` because Do Not Track is enabled");if(!t||"object"!=typeof t)return K.error("A data object was expected in send() but was not provided");var n=this.disableCookies?{}:function(){var e=Xe(),t=$.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.sex=this.sampleRate,a=rt(this._deduplicateBeaconData(e,i));if(this.lastEventTime=this.mux.utils.now(),r)return K.info("Not sending event due to sample rate restriction",e,i,a);if(this.envKey||K.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",e,i,a),!this.rateLimited)if(K.info("Sending event",e,i,a),this.rateLimited=!this.eventQueue.queueEvent(e,a),this.mux.WINDOW_UNLOADING&&"viewend"===e)this.eventQueue.destroy(!0);else if(this.mux.WINDOW_HIDDEN&&"hb"===e?this.eventQueue.flushEvents(!0):_t.indexOf(e)>=0&&this.eventQueue.flushEvents(),this.rateLimited)return i.event="eventrateexceeded",a=rt(i),this.eventQueue.queueEvent(i.event,a),K.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=he({},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=F(t,2),a=o[0],s=o[1];n.previousBeaconData&&(s!==n.previousBeaconData[a]||ht.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"==typeof n&&"object"==typeof i&&Object.keys(n||{}).length===Object.keys(i||{}).length)}},{key:"eventRequiresKey",value:function(e,t){return!!("renditionchange"===e&&0===t.indexOf("video_source_")||mt.includes(t)&&ft.includes(e))}}]),e}(),Et=function e(t){Q(this,e);var n=0,i=0,o=0,r=0,a=0,s=0,c=0;t.on("requestcompleted",(function(e,s){var c,l,u=s.request_start,d=s.request_response_start,p=s.request_response_end,h=s.request_bytes_loaded;if(r++,d?(c=d-(null!=u?u:0),l=(null!=p?p:0)-d):l=(null!=p?p:0)-(null!=u?u:0),l>0&&h&&h>0){var f=h/l*8e3;a++,i+=h,o+=l,t.data.view_min_request_throughput=Math.min(t.data.view_min_request_throughput||1/0,f),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}))},vt=function e(t){var n=this;Q(this,e),ne(this,"_lastEventTime",void 0),t.on("before*",(function(e,i){var o=i.viewer_time,r=$.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,ne({},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}))}}))},yt=["viewstart","ended","loadstart","pause","play","playing","ratechange","waiting","adplay","adpause","adended","aderror","adplaying","adrequest","adresponse","adbreakstart","adbreakend","adfirstquartile","admidpoint","adthirdquartile","rebufferstart","rebufferend","seeked","error","hb","requestcompleted","requestfailed","requestcanceled","renditionchange"],bt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ie(e,t)}(n,e);var t=re(n);function n(e,i,o){var r;Q(this,n),ne(Z(r=t.call(this)),"DOM_CONTENT_LOADED_EVENT_END",void 0),ne(Z(r),"NAVIGATION_START",void 0),ne(Z(r),"_destroyed",void 0),ne(Z(r),"_heartBeatTimeout",void 0),ne(Z(r),"adTracker",void 0),ne(Z(r),"dashjs",void 0),ne(Z(r),"data",void 0),ne(Z(r),"disablePlayheadRebufferTracking",void 0),ne(Z(r),"disableRebufferTracking",void 0),ne(Z(r),"errorTracker",void 0),ne(Z(r),"errorTranslator",void 0),ne(Z(r),"getAdData",void 0),ne(Z(r),"getPlayheadTime",void 0),ne(Z(r),"getStateData",void 0),ne(Z(r),"hlsjs",void 0),ne(Z(r),"id",void 0),ne(Z(r),"longResumeTracker",void 0),ne(Z(r),"minimumRebufferDuration",void 0),ne(Z(r),"mux",void 0),ne(Z(r),"oldEmit",void 0),ne(Z(r),"playbackEventDispatcher",void 0),ne(Z(r),"playbackHeartbeat",void 0),ne(Z(r),"playbackHeartbeatTime",void 0),ne(Z(r),"playheadTime",void 0),ne(Z(r),"seekingTracker",void 0),ne(Z(r),"sustainedRebufferThreshold",void 0),ne(Z(r),"watchTimeTracker",void 0),ne(Z(r),"currentFragmentPDT",void 0),ne(Z(r),"currentFragmentStart",void 0),r.DOM_CONTENT_LOADED_EVENT_END=ue(),r.NAVIGATION_START=de(),r.mux=e,r.id=i,null!=o&&o.beaconDomain&&r.mux.log.warn("The `beaconDomain` setting has been deprecated in favor of `beaconCollectionDomain`. Please change your integration to use `beaconCollectionDomain` instead of `beaconDomain`."),(o=Object.assign({debug:!1,minimumRebufferDuration:250,sustainedRebufferThreshold:1e3,playbackHeartbeatTime:25,beaconDomain:"litix.io",sampleRate:1,disableCookies:!1,respectDoNotTrack:!1,disableRebufferTracking:!1,disablePlayheadRebufferTracking:!1,errorTranslator:function(e){return e}},o)).data=o.data||{},o.data.property_key&&(o.data.env_key=o.data.property_key,delete o.data.property_key),K.setLevel(o.debug?"debug":"warn"),r.getPlayheadTime=o.getPlayheadTime,r.getStateData=o.getStateData||function(){return{}},r.getAdData=o.getAdData||function(){},r.minimumRebufferDuration=o.minimumRebufferDuration,r.sustainedRebufferThreshold=o.sustainedRebufferThreshold,r.playbackHeartbeatTime=o.playbackHeartbeatTime,r.disableRebufferTracking=o.disableRebufferTracking,r.disableRebufferTracking&&r.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."),r.disablePlayheadRebufferTracking=o.disablePlayheadRebufferTracking,r.errorTranslator=o.errorTranslator,r.playbackEventDispatcher=new gt(e,o.data.env_key,o),r.data={player_instance_id:H(),mux_sample_rate:o.sampleRate,beacon_domain:o.beaconCollectionDomain||o.beaconDomain},r.data.view_sequence_number=1,r.data.player_sequence_number=1,r.oldEmit=r.emit,r.emit=function(e,t){t=Object.assign({viewer_time:this.mux.utils.now()},t),this.oldEmit(e,t)};var a=function(){void 0===this.data.view_start&&(this.data.view_start=this.mux.utils.now(),this.emit("viewstart"))}.bind(Z(r));r.on("viewinit",(function(e,t){this._resetVideoData(),this._resetViewData(),this._resetErrorData(),this._updateStateData(),Object.assign(this.data,t),this._initializeViewData(),this.one("play",a),this.one("adbreakstart",a)}));var s=function(e){this.emit("viewend"),this.send("viewend"),this.emit("viewinit",e)}.bind(Z(r));if(r.on("videochange",(function(e,t){s(t)})),r.on("programchange",(function(e,t){this.data.player_is_paused&&this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."),s(Object.assign(t,{view_program_changed:!0})),a(),this.emit("play"),this.emit("playing")})),r.on("fragmentchange",(function(e,t){this.currentFragmentPDT=t.currentFragmentPDT,this.currentFragmentStart=t.currentFragmentStart})),r.on("destroy",r.destroy),"undefined"!=typeof window&&"function"==typeof window.addEventListener&&"function"==typeof window.removeEventListener){var c=function(){var e=void 0!==r.data.view_start;r.mux.WINDOW_HIDDEN="hidden"===document.visibilityState,e&&r.mux.WINDOW_HIDDEN&&(r.data.player_is_paused||r.emit("hb"))};window.addEventListener("visibilitychange",c,!1);var l=function(e){e.persisted||r.destroy()};window.addEventListener("pagehide",l,!1),r.on("destroy",(function(){window.removeEventListener("visibilitychange",c),window.removeEventListener("pagehide",l)}))}return r.on("playerready",(function(e,t){Object.assign(this.data,t)})),yt.forEach((function(e){r.on(e,(function(t,n){0!==e.indexOf("ad")&&this._updateStateData(),Object.assign(this.data,n),this._sanitizeData()})),r.on("after"+e,(function(){("error"!==e||this.errorTracker.viewErrored)&&this.send(e)}))})),r.on("viewend",(function(e,t){Object.assign(r.data,t)})),r.one("playerready",(function(e){var t=this.mux.utils.now();this.data.player_init_time&&(this.data.player_startup_time=t-this.data.player_init_time),!this.mux.PLAYER_TRACKED&&this.NAVIGATION_START&&(this.mux.PLAYER_TRACKED=!0,(this.data.player_init_time||this.DOM_CONTENT_LOADED_EVENT_END)&&(this.data.page_load_time=Math.min(this.data.player_init_time||1/0,this.DOM_CONTENT_LOADED_EVENT_END||1/0)-this.NAVIGATION_START)),this.send("playerready"),delete this.data.player_startup_time,delete this.data.page_load_time})),r.longResumeTracker=new vt(Z(r)),r.errorTracker=new Ne(Z(r)),new Ye(Z(r)),r.seekingTracker=new Fe(Z(r)),r.playheadTime=new ke(Z(r)),r.playbackHeartbeat=new Re(Z(r)),new Ve(Z(r)),r.watchTimeTracker=new Pe(Z(r)),new Le(Z(r)),r.adTracker=new Ge(Z(r)),new xe(Z(r)),new De(Z(r)),new Ue(Z(r)),new je(Z(r)),new Et(Z(r)),o.hlsjs&&r.addHLSJS(o),o.dashjs&&r.addDashJS(o),r.emit("viewinit",o.data),r}return te(n,[{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,void 0!==this.data.view_start&&(this.emit("viewend"),this.send("viewend")),this.playbackEventDispatcher.destroy(),this.removeHLSJS(),this.removeDashJS(),window.clearTimeout(this._heartBeatTimeout))}},{key:"send",value:function(e){if(this.data.view_id){var t=Object.assign({},this.data);if(void 0===t.video_source_is_live&&(t.player_source_duration===1/0||t.video_source_duration===1/0?t.video_source_is_live=!0:(t.player_source_duration>0||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=F(se(t.video_source_url),2),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(){var e=this;Object.keys(this.data).forEach((function(t){0===t.indexOf("video_")&&delete e.data[t]}))}},{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(){delete this.data.player_error_code,delete this.data.player_error_message,delete this.data.player_error_context,delete this.data.player_error_severity,delete this.data.player_error_business_exception}},{key:"_initializeViewData",value:function(){var e=this,t=this.data.view_id=H(),n=function(){t===e.data.view_id&&pe(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._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(le()){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=ye(r),p=d.bytesLoaded,h=d.requestStart,f=d.responseStart,m=d.responseEnd;s("requestcompleted",fe(he({},ve(c)),{request_event_type:e,request_bytes_loaded:p,request_start:h,request_response_start:f,request_response_end:m,request_type:"manifest",request_hostname:ae(o),request_response_headers:be(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=ye(c),u=l.bytesLoaded,d=l.requestStart,p=l.responseStart,h=l.responseEnd,f=n.fragments[n.fragments.length-1],m=a(f)+r(f.duration);s("requestcompleted",{request_event_type:e,request_bytes_loaded:u,request_start:d,request_response_start:p,request_response_end:h,request_current_level:i,request_type:"manifest",request_hostname:ae(n.url),request_response_headers:be(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(m)?void 0:m})};n.on(i.Events.LEVEL_LOADED,l);var u=function(e,t){var n=t.details,i=t.networkDetails,o=t.stats,r=ye(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:ae(n.url),request_response_headers:be(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=ye(i),c=a.bytesLoaded,l=a.requestStart,u=a.responseStart,d=a.responseEnd,p=o?be(o):void 0,h={request_event_type:e,request_bytes_loaded:c,request_start:l,request_response_start:u,request_response_end:d,request_hostname:o?ae(o.responseURL):void 0,request_id:p?Ee(p):void 0,request_response_headers:p,request_media_duration:r.duration,request_url:null==o?void 0:o.responseURL};"main"===r.type?(h.request_type="media",h.request_current_level=r.level,h.request_video_width=(n.levels[r.level]||{}).width,h.request_video_height=(n.levels[r.level]||{}).height,h.request_labeled_bitrate=(n.levels[r.level]||{}).bitrate):h.request_type=r.type,s("requestcompleted",h)};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 h=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?be(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:ae(u),request_id:d?Ee(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,h="".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:h})}};n.on(i.Events.ERROR,h);var f=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:ae(i)})};n.on(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,f);var m=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,m),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,h),n.off(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,f),n.off(i.Events.LEVEL_SWITCHED,m),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(){this.hlsjs&&(function(e){e&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor()}(this.hlsjs),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(e){try{var t,n;return null===(n=e.getVersion)||void 0===n||null===(t=n.call(e))||void 0===t?void 0:t.split(".").map((function(e){return parseInt(e)}))[0]}catch(e){return!1}}(n),r=function(n,i){return e.emit(t,n,i)},a=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:ae(n),request_url:n})};n.on("manifestLoaded",a);var s={},c=function(e){if("function"!=typeof e.getRequests)return null;var t=e.getRequests({state:"executed"});return 0===t.length?null:t[t.length-1]},l=function(e){var t=e.type,i=e.chunk,o=e.request,a=(i||{}).mediaInfo||{},c=a.type,l=a.bitrateList,u={};(l=l||[]).forEach((function(e,t){u[t]={},u[t].width=e.width,u[t].height=e.height,u[t].bitrate=e.bandwidth,u[t].attrs={}})),"video"===c?s.video=u:"audio"===c?s.audio=u:s.media=u;var d=Se(o,n),p=d.requestStart,h=d.requestResponseStart,f=d.requestResponseEnd,m=d.requestResponseHeaders,_=d.requestMediaDuration,g=d.requestHostname,E=d.requestUrl,v=d.requestId;r("requestcompleted",{request_event_type:t,request_start:p,request_response_start:h,request_response_end:f,request_bytes_loaded:-1,request_type:c+"_init",request_response_headers:m,request_hostname:g,request_id:v,request_url:E,request_media_duration:_,request_rendition_lists:s})};o>=4?n.on("initFragmentLoaded",l):n.on("initFragmentLoaded",(function(e){var t=e.type,n=e.fragmentModel,i=e.chunk,o=c(n);l({type:t,request:o,chunk:i})}));var u=function(e){var t=e.type,i=e.chunk,o=e.request,a=i||{},s=a.mediaInfo,c=a.start,l=(s||{}).type,u=Se(o,n),d=u.requestStart,p=u.requestResponseStart,h=u.requestResponseEnd,f=u.requestBytesLoaded,m=u.requestResponseHeaders,_=u.requestMediaDuration,g=u.requestHostname,E=u.requestUrl,v=u.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}:{}}(l,n),b=y.currentLevel,S=y.renditionWidth,T=y.renditionHeight,A=y.renditionBitrate;r("requestcompleted",{request_event_type:t,request_start:d,request_response_start:p,request_response_end:h,request_bytes_loaded:f,request_type:l,request_response_headers:m,request_hostname:g,request_id:v,request_url:E,request_media_start_time:c,request_media_duration:_,request_current_level:b,request_labeled_bitrate:A,request_video_width:S,request_video_height:T})};o>=4?n.on("mediaFragmentLoaded",u):n.on("mediaFragmentLoaded",(function(e){var t=e.type,n=e.fragmentModel,i=e.chunk,o=c(n);u({type:t,request:o,chunk:i})}));var d={video:void 0,audio:void 0,totalBitrate:void 0},p=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 ".concat(a));d[a]=fe(he({},s),{codec:n.getCurrentTrackFor(a).codec});var c=function(){if(d.video&&"number"==typeof d.video.bitrate){if(!d.video.width||!d.video.height)return void i.warn("have bitrate info for video but missing width/height");var e=d.video.bitrate;if(d.audio&&"number"==typeof d.audio.bitrate&&(e+=d.audio.bitrate),e!==d.totalBitrate)return d.totalBitrate=e,{video_source_bitrate:e,video_source_height:d.video.height,video_source_width:d.video.width,video_source_codec:Te(d.video.codec)}}}();c&&r("renditionchange",c)}}else i.warn("missing evt.newQuality in qualityChangeRendered event",e)};n.on("qualityChangeRendered",p);var h=function(e){var t=e.request,n=e.mediaType;r("requestcanceled",{request_event_type:(t=t||{}).type+"_"+t.action,request_url:t.url,request_type:n,request_hostname:ae(t.url)})};n.on("fragmentLoadingAbandoned",h);var f=function(e){var t,n,i=e.error,o=(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)&&r("requestfailed",{request_error:o.type+"_"+o.action,request_url:o.url,request_hostname:ae(o.url),request_type:o.mediaType,request_error_code:a.status,request_error_text:a.statusText});var s="".concat(null!=o&&o.url?"url: ".concat(o.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"):"");r("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",f),n._stopMuxMonitor=function(){n.off("manifestLoaded",a),n.off("initFragmentLoaded",l),n.off("mediaFragmentLoaded",u),n.off("qualityChangeRendered",p),n.off("error",f),n.off("fragmentLoadingAbandoned",h),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(){this.dashjs&&(function(e){e&&"function"==typeof e._stopMuxMonitor&&e._stopMuxMonitor()}(this.dashjs),this.dashjs=void 0)}}]),n}(Oe),St=bt;v();var Tt,At=_(U()),It=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],Ot={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},Ct=_(g());Ct.default&&Ct.default.WeakMap&&(Tt=new WeakMap);var Rt=function(e){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(e),this.manifest};Rt.prototype.process=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.processLine(this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},Rt.prototype.processLine=function(e){var t=e.indexOf(":"),n=Mt(e,t),i=n[0],o=2===n.length?Lt(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":Nt(this.manifest,n),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case"#EXT-X-SERVER-CONTROL":Nt(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":Nt(this.manifest,n);break;case"#EXT-X-SESSION-DATA":var s=xt(n[1]),c=ve(s);Object.assign(this.manifest.sessionData,c)}},Rt.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[Pt(n[0])]=Lt(n[1])),t},wt=function(e){for(var t=e.split(","),n={},i=0;t.length>i;i++){var o=t[i],r=kt(o);n=Object.assign(r,n)}return n},Dt=function(e){return e.indexOf("=")>-1},Mt=function(e,t){return-1===t?[e]:[e.substring(0,t),e.substring(t+1)]},xt=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;o0){var s=o.getStartDate();if(s&&"function"==typeof s.getTime&&s.getTime()){var u=s.getTime();if(r.player_program_time=u+a,o.seekable.length>0){var d=u+o.seekable.end(o.seekable.length-1);r.player_live_edge_program_time=d}}}return r},o.mux=o.mux||{},o.mux.deleted=!1,o.mux.emit=function(t,n){e.emit(r,t,n)};var u=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=u,o.mux.swapElement=u,o.mux.emit=u,o.mux.addHLSJS=u,o.mux.addDashJS=u,o.mux.removeHLSJS=u,o.mux.removeDashJS=u,o.mux.deleted=!0,e.emit(r,"destroy")},o.mux.swapElement=function(t){var n=F(j(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={},It.forEach((function(t){"error"===t&&!n.automaticErrorTracking||(o.mux.listeners[t]=function(){var n={};if("error"===t){if(!o.error||1===o.error.code)return;n.player_error_code=o.error.code,n.player_error_message=Ot[o.error.code]||o.error.message}e.emit(r,t,n)},o.addEventListener(t,o.mux.listeners[t],!1))}))}(Bt,e,t)},destroyMonitor:function(e){var t=F(j(e),1)[0];t&&t.mux&&"function"==typeof t.mux.destroy?t.mux.destroy():K.error("A video element monitor for `"+e+"` has not been initialized via `mux.monitor`.")},addHLSJS:function(e,t){var n=W(e);Ft[n]?Ft[n].addHLSJS(t):K.error("A monitor for `"+n+"` has not been initialized.")},addDashJS:function(e,t){var n=W(e);Ft[n]?Ft[n].addDashJS(t):K.error("A monitor for `"+n+"` has not been initialized.")},removeHLSJS:function(e){var t=W(e);Ft[t]?Ft[t].removeHLSJS():K.error("A monitor for `"+t+"` has not been initialized.")},removeDashJS:function(e){var t=W(e);Ft[t]?Ft[t].removeDashJS():K.error("A monitor for `"+t+"` has not been initialized.")},init:function(e,t){q()&&t&&t.respectDoNotTrack&&K.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");var n=W(e);Ft[n]=new St(Bt,n,t)},emit:function(e,t,n){var i=W(e);Ft[i]?(Ft[i].emit(t,n),"destroy"===t&&delete Ft[i]):K.error("A monitor for `"+i+"` has not been initialized.")},checkDoNotTrack:q,log:K,utils:Vt,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(Bt,Ht),void 0!==B.default&&"function"==typeof B.default.addEventListener&&B.default.addEventListener("pagehide",(function(e){e.persisted||(Bt.WINDOW_UNLOADING=!0)}),!1);var Gt=Bt;function Wt(e){return Wt="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},Wt(e)}var jt=Gt.log,Yt=Gt.utils.secondsToMs,zt=Gt.utils.assign,Kt=Gt.utils.getComputedStyle,Jt=Gt.utils.extractHostname,qt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r().shaka;if("object"!==Wt(e)||void 0===e.constructor.version)return jt.warn("[shakaPlayer-mux] You must provide a valid shakaPlayer to initShakaPlayerMux."),{emit:function(){jt.warn("[shakaPlayer-mux] emit is a no-op because initShakaPlayerMux was not initialized correctly")},loadErrorHandler:function(){jt.warn("[shakaPlayer-mux] loadErrorHandler is a no-op because initShakaPlayerMux was not initialized correctly")}};var i=function(t){return e.getMediaElement()&&e.getMediaElement()[t]},o=function(t){var n=e.getMediaElement();if(n)return parseInt(Kt(n,t))},a=function(){var e=i("preload");return"auto"===e||"metadata"===e};function c(){var t=s().fullscreenElement||s().webkitFullscreenElement||s().mozFullScreenElement||s().msFullscreenElement;return t?t===e.getMediaElement():void 0}(t=zt({automaticErrorTracking:!0},t)).data=zt({player_software_name:"Shaka Player",player_software_version:e.constructor.version,player_mux_plugin_name:"shakaplayer-mux",player_mux_plugin_version:"5.12.4"},t.data);var l=Gt.utils.generateShortID();e.mux={},e.mux.emit=function(e,t){Gt.emit(l,e,t)},t.getPlayheadTime=function(){return Yt(i("currentTime"))},t.getStateData=function(){var t=e.getStats();return{player_is_paused:i("paused"),player_width:o("width"),player_height:o("height"),video_source_height:t.height,video_source_width:t.width,player_is_fullscreen:c(),player_autoplay_on:i("autoplay"),player_preload_on:a(),video_source_url:e.getAssetUri(),video_source_duration:Yt(i("duration")),view_dropped_frame_count:t.droppedFrames,video_poster_url:i("poster"),player_language_code:i("lang")}};var u=["pause","play","playing","seeking","seeked","timeupdate","stalled","waiting","ended"],d={},p={},h=!1;p.onstatechange=function(t){!h&&e.getMediaElement()&&function(){h=!0;var t=e.getMediaElement();if(!t)return jt.warn("[shakaPlayer-mux] Unable to getMediaElement() on shaka.Player instance when attempting to attachMediaElementEvents()");u.forEach((function(n){d[n]=function(){var i={};"timeupdate"===n&&(i.player_playhead_time=t.currentTime),e.mux.emit(n,i)},t.addEventListener(n,d[n],!1)}))}(),"load"===t.state&&e.mux.emit("playerready")};var f={video_source_bitrate:void 0,video_source_codec:void 0,video_source_fps:void 0},m=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})),a=r&&r.reduce((function(e,t){return e+t}),0);return{video_source_bitrate:a,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(f)&&(f=t,e.mux.emit("renditionchange",t))};p.adaptation=function(){m()},p.variantchanged=function(){m()},e.addEventListener("onstatechange",p.onstatechange),e.addEventListener("adaptation",p.adaptation),e.addEventListener("variantchanged",p.variantchanged);var _=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},g=function(t){if(2===(null==t?void 0:t.severity)){var n;try{n=JSON.stringify(t.data||null)}catch(e){n=null}e.mux.emit("error",{player_error_code:t.code,player_error_message:_(t),player_error_context:n})}};p.error=function(e){if(t.automaticErrorTracking){var n=e.detail;g(n)}},e.addEventListener("error",p.error),e.mux.destroy=function(){Object.keys(p).forEach((function(t){e.removeEventListener(t,p[t]),delete p[t]})),Object.keys(d).forEach((function(t){var n=e.getMediaElement();n&&n.removeEventListener(t,d[t],!1),delete d[t]})),e.mux.emit("destroy")};var E={0:"manifest",1:"media",6:"encryption"};return e.getNetworkingEngine().registerResponseFilter((function(t,n){var i,o=Gt.utils.now();if(!n.fromCache){var r=E[t&&t.toString()];if(r){var a={request_bytes_loaded:null===(i=n.data)||void 0===i?void 0:i.byteLength,request_hostname:Jt(n.uri),request_url:n.uri,request_response_headers:n.headers,request_type:r,request_start:n.timeMs?o-n.timeMs:void 0,request_response_end:o};e.mux.emit("requestcompleted",a)}}})),Gt.init(l,t),{emit:e.mux.emit,loadErrorHandler:g}};qt.utils=Gt.utils;var Xt=qt},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},558:function(){}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}return i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i(254)}()},e.exports=i()},87168:(e,t,n)=>{"use strict";function i(e){return e?(e.nodeName||"").toLowerCase():null}n.d(t,{A:()=>i})},70271:(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,{A:()=>i})},27777:(e,t,n)=>{"use strict";n.d(t,{Ng:()=>a,sb:()=>r,vq:()=>o});var i=n(70271);function o(e){return e instanceof(0,i.A)(e).Element||e instanceof Element}function r(e){return e instanceof(0,i.A)(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof(0,i.A)(e).ShadowRoot||e instanceof ShadowRoot)}},31819:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(87168),o=n(27777);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.sb)(a)&&(0,i.A)(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.sb)(r)&&(0,i.A)(r)&&(Object.assign(r.style,s),Object.keys(a).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]}},84729:(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,{n4:()=>Ee});var o=n(70271);function r(e){var t=(0,o.A)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}var a=n(27777);var s=n(87168);function c(e){return(((0,a.vq)(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.A)(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.sb)(t),p=(0,a.sb)(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),h=c(t),f=i(e,p),m={scrollLeft:0,scrollTop:0},_={x:0,y:0};return(u||!u&&!n)&&(("body"!==(0,s.A)(t)||d(h))&&(m=function(e){return e!==(0,o.A)(e)&&(0,a.sb)(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:r(e);var t}(t)),(0,a.sb)(t)?((_=i(t,!0)).x+=t.clientLeft,_.y+=t.clientTop):h&&(_.x=l(h))),{x:f.left+m.scrollLeft-_.x,y:f.top+m.scrollTop-_.y,width:f.width,height:f.height}}function h(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 f(e){return"html"===(0,s.A)(e)?e:e.assignedSlot||e.parentNode||((0,a.Ng)(e)?e.host:null)||c(e)}function m(e){return["html","body","#document"].indexOf((0,s.A)(e))>=0?e.ownerDocument.body:(0,a.sb)(e)&&d(e)?e:m(f(e))}function _(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.A)(i),s=r?[a].concat(a.visualViewport||[],d(i)?i:[]):i,c=t.concat(s);return r?c:c.concat(_(f(s)))}function g(e){return["table","td","th"].indexOf((0,s.A)(e))>=0}function E(e){return(0,a.sb)(e)&&"fixed"!==u(e).position?e.offsetParent:null}function v(e){for(var t=(0,o.A)(e),n=E(e);n&&g(n)&&"static"===u(n).position;)n=E(n);return n&&("html"===(0,s.A)(n)||"body"===(0,s.A)(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.sb)(e)&&"fixed"===u(e).position)return null;for(var n=f(e);(0,a.sb)(n)&&["html","body"].indexOf((0,s.A)(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 y="top",b="bottom",S="right",T="left",A="auto",I=[y,b,S,T],O="start",C="end",R="clippingParents",N="viewport",P="popper",L="reference",k=I.reduce((function(e,t){return e.concat([t+"-"+O,t+"-"+C])}),[]),w=[].concat(I,[A]).reduce((function(e,t){return e.concat([t,t+"-"+O,t+"-"+C])}),[]),D=["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 j(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 y: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 T:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var l=r?W(r):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case O: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]=j({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var z=Math.max,K=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,h=e.roundOffsets,f=!0===h?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 h?h(s):s,m=f.x,_=void 0===m?0:m,g=f.y,E=void 0===g?0:g,A=s.hasOwnProperty("x"),I=s.hasOwnProperty("y"),O=T,R=y,N=window;if(p){var P=v(n),L="clientHeight",k="clientWidth";P===(0,o.A)(n)&&"static"!==u(P=c(n)).position&&"absolute"===l&&(L="scrollHeight",k="scrollWidth"),r!==y&&(r!==T&&r!==S||a!==C)||(R=b,E-=P[L]-i.height,E*=d?1:-1),r!==T&&(r!==y&&r!==b||a!==C)||(O=S,_-=P[k]-i.width,_*=d?1:-1)}var w,D=Object.assign({position:l},p&&q);return d?Object.assign({},D,((w={})[R]=I?"0":"",w[O]=A?"0":"",w.transform=(N.devicePixelRatio||1)<=1?"translate("+_+"px, "+E+"px)":"translate3d("+_+"px, "+E+"px, 0)",w)):Object.assign({},D,((t={})[R]=I?E+"px":"",t[O]=A?_+"px":"",t.transform="",t))}const $={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 Z=n(31819);const Q={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=w.reduce((function(e,n){return e[n]=function(e,t,n){var i=H(e),o=[T,y].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,[T,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.Ng)(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===N?re(function(e){var t=(0,o.A)(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.sb)(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=z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=z(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+=z(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=_(f(e)),n=["absolute","fixed"].indexOf(u(e).position)>=0&&(0,a.sb)(e)?v(e):e;return(0,a.vq)(n)?t.filter((function(e){return(0,a.vq)(e)&&oe(e,n)&&"body"!==(0,s.A)(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=z(i.top,t.top),t.right=K(i.right,t.right),t.bottom=K(i.bottom,t.bottom),t.left=z(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?R:s,u=n.rootBoundary,d=void 0===u?N:u,p=n.elementContext,h=void 0===p?P:p,f=n.altBoundary,m=void 0!==f&&f,_=n.padding,g=void 0===_?0:_,E=ce("number"!=typeof g?g:le(g,I)),v=h===P?L:P,T=e.rects.popper,A=e.elements[m?v:h],O=se((0,a.vq)(A)?A:A.contextElement||c(e.elements.popper),l,d),C=i(e.elements.reference),k=j({reference:C,element:T,strategy:"absolute",placement:r}),w=re(Object.assign({},T,k)),D=h===P?w:C,M={top:O.top-D.top+E.top,bottom:D.bottom-O.bottom+E.bottom,left:O.left-D.left+E.left,right:D.right-O.right+E.right},x=e.modifiersData.offset;if(h===P&&x){var U=x[r];Object.keys(M).forEach((function(e){var t=[S,b].indexOf(e)>=0?1:-1,n=[y,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,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,_=t.options.placement,g=H(_),E=c||(g===_||!f?[te(_)]:function(e){if(H(e)===A)return[];var t=te(e);return[ie(e),t,ie(t)]}(_)),v=[_].concat(E).reduce((function(e,n){return e.concat(H(n)===A?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?w:c,u=G(i),d=u?s?k:k.filter((function(e){return G(e)===u})):I,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=ue(e,{placement:n,boundary:o,rootBoundary:r,padding:a})[H(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),C=t.rects.reference,R=t.rects.popper,N=new Map,P=!0,L=v[0],D=0;D=0,F=V?"width":"height",B=ue(t,{placement:M,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),W=V?U?S:T:U?b:y;C[F]>R[F]&&(W=te(W));var j=te(W),Y=[];if(r&&Y.push(B[x]<=0),s&&Y.push(B[W]<=0,B[j]<=0),Y.every((function(e){return e}))){L=M,P=!1;break}N.set(M,Y)}if(P)for(var z=function(e){var t=v.find((function(t){var n=N.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return L=t,"break"},K=f?3:1;K>0;K--){if("break"===z(K))break}t.placement!==L&&(t.modifiersData[i]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function pe(e,t,n){return z(e,K(t,n))}const he={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,f=void 0===p||p,m=n.tetherOffset,_=void 0===m?0:m,g=ue(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),E=H(t.placement),A=G(t.placement),I=!A,C=W(E),R="x"===C?"y":"x",N=t.modifiersData.popperOffsets,P=t.rects.reference,L=t.rects.popper,k="function"==typeof _?_(Object.assign({},t.rects,{placement:t.placement})):_,w={x:0,y:0};if(N){if(r||s){var D="y"===C?y:T,M="y"===C?b:S,x="y"===C?"height":"width",U=N[C],V=N[C]+g[D],F=N[C]-g[M],B=f?-L[x]/2:0,j=A===O?P[x]:L[x],Y=A===O?-L[x]:-P[x],J=t.elements.arrow,q=f&&J?h(J):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=X[D],Z=X[M],Q=pe(0,P[x],q[x]),ee=I?P[x]/2-B-Q-$-k:j-Q-$-k,te=I?-P[x]/2+B+Q+Z+k:Y+Q+Z+k,ne=t.elements.arrow&&v(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=N[C]+ee-oe-ie,ae=N[C]+te-oe;if(r){var se=pe(f?K(V,re):V,U,f?z(F,ae):F);N[C]=se,w[C]=se-U}if(s){var ce="x"===C?y:T,le="x"===C?b:S,de=N[R],he=de+g[ce],fe=de-g[le],me=pe(f?K(he,re):he,de,f?z(fe,ae):fe);N[R]=me,w[R]=me-de}}t.modifiersData[i]=w}},requiresIfExists:["offset"]};const fe={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=W(s),l=[T,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,I))}(o.padding,n),d=h(r),p="y"===c?y:T,f="y"===c?b:S,m=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],_=a[c]-n.rects.reference[c],g=v(r),E=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,A=m/2-_/2,O=u[p],C=E-d[l]-u[f],R=E/2-d[l]/2+A,N=pe(O,R,C),P=c;n.modifiersData[i]=((t={})[P]=N,t.centerOffset=N-R,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 _e(e){return[y,S,b,T].some((function(t){return e[t]>=0}))}const ge={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=_e(c),d=_e(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 Ee=V({defaultModifiers:[B,Y,$,Z.A,Q,de,he,fe,ge]})},68315: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)}},25985: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)},47789: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},35057: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}}},32025:(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}},30296:(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:h(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 h(e){return W&&e instanceof Set}function f(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[K];for(var n=q(t),i=0;i1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&a(e,(function(e,t){return _(t,!0)}),!0)),e}function g(){i(2)}function E(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function v(e){var t=$[e];return t||i(18,e),t}function y(e,t){$[e]||($[e]=t)}function b(){return B}function S(e,t){t&&(v("Patches"),e.u=[],e.s=[],e.v=t)}function T(e){A(e),e.p.forEach(O),e.p=null}function A(e){e===B&&(B=e.l)}function I(e){return B={p:[],l:B,h:e,m:!0,_:0}}function O(e){var t=e[K];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||v("ES5").S(t,e,o),o?(n[K].P&&(T(t),i(4)),r(e)&&(e=R(t,e),t.l||P(t,e)),t.u&&v("Patches").M(n[K].t,e,t.u,t.s)):e=R(t,n,[]),T(t),t.u&&t.v(t.u,t.s),e!==Y?e:void 0}function R(e,t,n){if(E(t))return t;var i=t[K];if(!i)return a(t,(function(o,r){return N(e,i,t,o,r,n)}),!0),t;if(i.A!==e)return t;if(!i.P)return P(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 N(e,i,o,t,r,n,s)})),P(e,o,!1),n&&e.u&&v("Patches").N(i,n,e.u,e.s)}return i.o}function N(e,t,n,i,a,s,l){if(o(a)){var d=R(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)&&!E(a)){if(!e.h.D&&e._<1)return;R(e,a),t&&t.A.l||P(e,a)}}function P(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&_(t,n)}function L(e,t){var n=e[K];return(n?f(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 w(e){e.P||(e.P=!0,e.l&&w(e.l))}function D(e){e.o||(e.o=m(e.t))}function M(e,t,n){var i=p(t)?v("MapSet").F(t,n):h(t)?v("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=Z;n&&(o=[i],r=Q);var a=Proxy.revocable(o,r),s=a.revoke,c=a.proxy;return i.k=c,i.j=s,c}(t,n):v("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[K],o=s(t);if(i){if(!i.P&&(i.i<4||!v("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[K];return Z.get(t,e)},set:function(t){var n=this[K];Z.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][K];if(!o.P)switch(o.i){case 5:i(o)&&w(o);break;case 4:n(o)&&w(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!==K){var a=t[r];if(void 0===a&&!c(t,r))return!0;var s=n[r],l=s&&s[K];if(l?l.t!==a:!d(s,a))return!0}}var u=!!t[K];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;ive,vy:()=>Se,Z0:()=>Te});var F,B,H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),G="undefined"!=typeof Map,W="undefined"!=typeof Set,j="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Y=H?Symbol.for("immer-nothing"):((F={})["immer-nothing"]=!0,F),z=H?Symbol.for("immer-draftable"):"__$immer_draftable",K=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={get:function(e,t){if(t===K)return e;var n=f(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===L(e.t,t)?(D(e),e.o[t]=M(e.A.h,i,e)):i},has:function(e,t){return t in f(e)},ownKeys:function(e){return Reflect.ownKeys(f(e))},set:function(e,t,n){var i=k(f(e),t);if(null==i?void 0:i.set)return i.set.call(e.k,n),!0;if(!e.P){var o=L(f(e),t),r=null==o?void 0:o[K];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;D(e),w(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!==L(e.t,t)||t in e.t?(e.R[t]=!1,D(e),w(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=f(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)}},Q={};a(Z,(function(e,t){Q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Q.deleteProperty=function(e,t){return Q.set.call(this,e,t,void 0)},Q.set=function(e,t,n){return Z.set.call(this,e[0],t,n,e[0])};var ee=function(){function e(e){var t=this;this.O=j,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=v("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(333),ae=(n(68558),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,B6:()=>A,Gh:()=>P,HS:()=>L,Oi:()=>r,Rr:()=>c,pX:()=>x,pb:()=>O,rc:()=>o,tH:()=>M,tW:()=>T,ue:()=>u,yD:()=>N}),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){return void 0===n&&(n="/"),d(e,t,n,!1)}function d(e,t,n,i){let o=O(("string"==typeof t?c(t):t).pathname||"/",n);if(null==o)return null;let r=p(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)))))}(r);let a=null;for(let e=0;null==a&&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=L([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+'".'),p(e.children,t,l,c)),(null!=e.path||e.index)&&t.push({path:c,score:b(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 h(e.path))o(e,t,n);else o(e,t)})),t}function h(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=h(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-]+$/,m=3,_=2,g=1,E=10,v=-2,y=e=>"*"===e;function b(e,t){let n=e.split("/"),i=n.length;return n.some(y)&&(i+=v),t&&(i+=_),n.filter((e=>!y(e))).reduce(((e,t)=>e+(f.test(t)?m:""===t?g:E)),i)}function S(e,t,n){void 0===n&&(n=!1);let{routesMeta:i}=e,o={},r="/",a=[];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 a=c[n];return e[i]=o&&!a?void 0:(a||"").replace(/%2F/g,"/"),e}),{}),pathname:r,pathnameBase:s,pattern:e}}function I(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}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 C(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 R(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function N(e,t){let n=R(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function P(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("?"),C("?","pathname","search",a)),r(!a.pathname||!a.pathname.includes("#"),C("#","pathname","hash",a)),r(!a.search||!a.search.includes("#"),C("#","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:w(i),hash:D(o)}}(a,s),p=u&&"/"!==u&&u.endsWith("/"),h=(l||"."===u)&&n.endsWith("/");return d.pathname.endsWith("/")||!p&&!h||(d.pathname+="/"),d}const L=e=>e.join("/").replace(/\/\/+/g,"/"),k=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),w=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",D=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class M extends Error{}function x(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const U=["post","put","patch","delete"],V=(new Set(U),["get",...U]);new Set(V),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},31999:(e,t,n)=>{"use strict";n.d(t,{Ts:()=>$t});var i=n(50853),o=n(28041),r=n(76444),a=n(54457),s=n(5934),c=n(67148);const l=[];function u(e){const t=e.defaultIntegrations||[],n=e.integrations;let i;t.forEach((e=>{e.isDefaultInstance=!0})),i=Array.isArray(n)?[...t,...n]:"function"==typeof n?(0,o.k9)(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]))}(i),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 d(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function p(e,t,n){if(n[t.name])a.T&&i.vF.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===l.indexOf(t.name)&&(t.setupOnce(s.lb,c.BF),l.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)}a.T&&i.vF.log(`Integration installed: ${t.name}`)}}function h(e,t){return Object.assign((function(...e){return t(...e)}),{id:e})}const f=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],m=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],_="InboundFilters",g=(e={})=>({name:_,setupOnce(){},processEvent(t,n,s){const c=s.getOptions(),l=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:f],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:m],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,c);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return a.T&&i.vF.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,o.$X)(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.T&&0===t.length&&i.vF.error(`Could not extract message for event ${(0,o.$X)(e)}`);return t}(e).some((e=>(0,r.Xr)(e,t)))}(e,t.ignoreErrors))return a.T&&i.vF.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,o.$X)(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&(0,r.Xr)(n,t)}(e,t.ignoreTransactions))return a.T&&i.vF.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,o.$X)(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=E(e);return!!n&&(0,r.Xr)(n,t)}(e,t.denyUrls))return a.T&&i.vF.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,o.$X)(e)}.\nUrl: ${E(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=E(e);return!n||(0,r.Xr)(n,t)}(e,t.allowUrls))return a.T&&i.vF.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,o.$X)(e)}.\nUrl: ${E(e)}`),!0;return!1}(t,l)?null:t}});h(_,g);function E(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.T&&i.vF.error(`Cannot extract url for event ${(0,o.$X)(e)}`),null}}var v=n(41310),y=n(46588);let b;const S="FunctionToString",T=new WeakMap,A=()=>({name:S,setupOnce(){b=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=(0,v.sp)(this),n=T.has((0,y.KU)())&&void 0!==t?t:this;return b.apply(n,e)}}catch(e){}},setup(e){T.set(e,!0)}});h(S,A);function I(e,t){!0===t.debug&&(a.T?i.vF.enable():(0,i.pq)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));(0,y.o5)().update(t.initialScope);const n=new e(t);!function(e){const t=(0,c.BF)().getStackTop();t.client=e,t.scope.setClient(e)}(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}var O=n(72024),C=n(5635),R=n(61534);const N=(0,R.VZ)();function P(){if(!("fetch"in N))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function L(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const k=(0,R.VZ)();const w={},D={};function M(e,t){w[e]=w[e]||[],w[e].push(t)}function x(e,t){D[e]||(t(),D[e]=!0)}function U(e,t){const n=e&&w[e];if(n)for(const o of n)try{o(t)}catch(t){C.T&&i.vF.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,O.qQ)(o)}\nError:`,t)}}const V=R.OW;let F;function B(e){const t="history";M(t,e),x(t,H)}function H(){if(!function(){const e=k.chrome,t=e&&e.app&&e.app.runtime,n="history"in k&&!!k.history.pushState&&!!k.history.replaceState;return!t&&n}())return;const e=V.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=F,t=String(n);F=t;U("history",{from:e,to:t})}return e.apply(this,t)}}V.onpopstate=function(...t){const n=V.location.href,i=F;F=n;if(U("history",{from:i,to:n}),e)try{return e.apply(this,t)}catch(e){}},(0,v.GS)(V.history,"pushState",t),(0,v.GS)(V.history,"replaceState",t)}const G=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function W(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 j(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Y(e){const t="string"==typeof e?function(e){const t=G.exec(e);if(!t)return void(0,i.pq)((()=>{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 j({host:a,pass:r,path:l,projectId:u,port:s,protocol:n,publicKey:o})}(e):j(e);if(t&&function(e){if(!C.T)return!0;const{port:t,projectId:n,protocol:o}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(i.vF.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(o)?t&&isNaN(parseInt(t,10))&&(i.vF.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(i.vF.error(`Invalid Sentry Dsn: Invalid protocol ${o}`),1):(i.vF.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var z=n(28445),K=n(55693),J=n(42456);function q(e,t=[]){return[e,t]}function X(e,t){const[n,i]=e;return[n,[...i,t]]}function $(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 Q(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,J.S8)(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 ee(e,t){const n="string"==typeof e.data?Z(e.data,t):e.data;return[(0,v.Ce)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const te={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",span:"span",statsd:"metric_bucket"};function ne(e){return te[e]}function ie(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}class oe 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 re="7";function ae(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function se(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`${ae(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return(0,v.u4)({sentry_key:e.publicKey,sentry_version:re,...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,i)}`}function ce(e,t,n,i){const o=ie(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:W(i)},...o&&{trace:(0,v.Ce)({...o})}}}(e,o,i,t);delete e.sdkProcessingMetadata;return q(a,[[{type:r},e]])}function le(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=W(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 q(o,[r])}var ue=n(77683),de=n(53599),pe=n(76756);const he="Not capturing exception because it's already been captured.";class fe{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Y(e.dsn):a.T&&i.vF.warn("No DSN provided, client will not send events."),this._dsn){const t=se(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if((0,o.GR)(e))return void(a.T&&i.vF.log(he));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,z.NF)(e)?e:String(e),a=(0,z.sO)(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.GR)(t.originalException))return void(a.T&&i.vF.log(he));let r=t&&t.event_id;const s=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,s||n).then((e=>{r=e}))),r}captureSession(e){"string"!=typeof e.release?a.T&&i.vF.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,ue.qO)(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,K.XW)(!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.T&&i.vF.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];p(this,e,this._integrations),t||d(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=ce(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=X(n,ee(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=ie(n);return q({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!i&&t&&{dsn:W(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.T&&i.vF.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){a.T&&i.vF.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=le(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=function(e,t){const n={};return t.forEach((t=>{t&&p(e,t,n)})),n}(this,e),d(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,ue.qO)(e,{...n&&{status:"crashed"},errors:e.errors||Number(i||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new K.T2((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,c.rm)()){const o=this.getOptions(),r=Object.keys(this._integrations);return!t.integrations&&r.length>0&&(t.integrations=r),this.emit("preprocessEvent",e,t),(0,pe.mG)(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,de.l)(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.T){const t=e;"log"===t.logLevel?i.vF.log(t.message):i.vF.warn(t)}}))}_processEvent(e,t,n){const i=this.getOptions(),{sampleRate:o}=i,r=_e(e),a=me(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,K.xg)(new oe(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,e),new oe("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(me(t)&&i)return i(t,n);if(_e(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,z.Qg)(e))return e.then((e=>{if(!(0,z.Qd)(e)&&null!==e)throw new oe(n);return e}),(e=>{throw new oe(`${t} rejected with ${e}`)}));if(!(0,z.Qd)(e)&&null!==e)throw new oe(n);return e}(o,c)})).then((i=>{if(null===i)throw this.recordDroppedEvent("before_send",l,e),new oe(`${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 oe)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new oe(`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.T&&i.vF.error("Error while sending event:",e)}));a.T&&i.vF.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 me(e){return void 0===e.type}function _e(e){return"transaction"===e.type}var ge=n(80043);var Ee=n(52900);const ve="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function ye(e,t){const n=Se(e,t),i={type:t&&t.name,value:Ae(t)};return n.length&&(i.stacktrace={frames:n}),void 0===i.type&&""===i.value&&(i.value="Unrecoverable error caught"),i}function be(e,t){return{exception:{values:[ye(e,t)]}}}function Se(e,t){const n=t.stacktrace||t.stack||"",i=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Te.test(e.message))return 1}return 0}(t);try{return e(n,i)}catch(e){}return[]}const Te=/Minified React error #\d+;/i;function Ae(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Ie(e,t,n,i,r){let a;if((0,z.T2)(t)&&t.error){return be(e,t.error)}if((0,z.BD)(t)||(0,z.W6)(t)){const r=t;if("stack"in t)a=be(e,t);else{const t=r.name||((0,z.BD)(r)?"DOMError":"DOMException"),s=r.message?`${t}: ${r.message}`:t;a=Oe(e,s,n,i),(0,o.gO)(a,s)}return"code"in r&&(a.tags={...a.tags,"DOMException.code":`${r.code}`}),a}if((0,z.bJ)(t))return be(e,t);if((0,z.Qd)(t)||(0,z.xH)(t)){return a=function(e,t,n,i){const o=(0,y.KU)(),r=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:(0,z.xH)(t)?t.constructor.name:i?"UnhandledRejection":"Error",value:Ce(t,{isUnhandledRejection:i})}]},extra:{__serialized__:(0,J.cd)(t,r)}};if(n){const t=Se(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,r),(0,o.M6)(a,{synthetic:!0}),a}return a=Oe(e,t,n,i),(0,o.gO)(a,`${t}`,void 0),(0,o.M6)(a,{synthetic:!0}),a}function Oe(e,t,n,i){const o={};if(i&&n){const i=Se(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}if((0,z.NF)(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 Ce(e,{isUnhandledRejection:t}){const n=(0,v.HF)(e),i=t?"promise rejection":"exception";if((0,z.T2)(e))return`Event \`ErrorEvent\` captured as ${i} with message \`${e.message}\``;if((0,z.xH)(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 Re=R.OW;let Ne=0;function Pe(){return Ne>0}function Le(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if((0,v.sp)(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=>Le(e,t)));return e.apply(this,o)}catch(e){throw Ne++,setTimeout((()=>{Ne--})),(0,y.v4)((n=>{n.addEventProcessor((e=>(t.mechanism&&((0,o.gO)(e,void 0,void 0),(0,o.M6)(e,t.mechanism)),e.extra={...e.extra,arguments:i},e))),(0,y.Cp)(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t])}catch(e){}(0,v.pO)(i,e),(0,v.my)(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:()=>e.name})}catch(e){}return i}class ke extends fe{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:ge.M}))),version:ge.M}),e._metadata=o}(e,"browser",["browser"],Re.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Re.document&&Re.document.addEventListener("visibilitychange",(()=>{"hidden"===Re.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,i){const r=Ie(e,t,n&&n.syntheticException||void 0,i);return(0,o.M6)(r),r.level="error",n&&n.event_id&&(r.event_id=n.event_id),(0,K.XW)(r)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",i,o){const r=Oe(e,t,i&&i.syntheticException||void 0,o);return r.level=n,i&&i.event_id&&(r.event_id=i.event_id),(0,K.XW)(r)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(ve&&i.vF.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:W(i)}},r=function(e){return[{type:"user_report"},e]}(e);return q(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(ve&&i.vF.log("No outcomes to send"));if(!this._dsn)return void(ve&&i.vF.log("No dsn provided, will not send outcomes"));ve&&i.vF.log("Sending outcomes:",e);const t=(n=e,q((o=this._options.tunnel&&W(this._dsn))?{dsn:o}:{},[[{type:"client_report"},{timestamp:r||(0,Ee.lu)(),discarded_events:n}]]));var n,o,r;this._sendEnvelope(t)}}function we(){"console"in R.OW&&i.Ow.forEach((function(e){e in R.OW.console&&(0,v.GS)(R.OW.console,e,(function(t){return i.Z9[e]=t,function(...t){U("console",{args:t,level:e});const n=i.Z9[e];n&&n.apply(R.OW.console,t)}}))}))}const De=R.OW,Me=1e3;let xe,Ue,Ve;function Fe(){if(!De.document)return;const e=U.bind(null,"dom"),t=Be(e,!0);De.document.addEventListener("click",t,!1),De.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=De[t]&&De[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,v.GS)(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=Be(e);a.handler=i,t.call(this,n,i,o)}a.refCount++}catch(e){}return t.call(this,n,i,o)}})),(0,v.GS)(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 Be(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,v.my)(n,"_sentryCaptured",!0),i&&!i._sentryId&&(0,v.my)(i,"_sentryId",(0,o.eJ)());const r="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==Ue)return!1;try{if(!e.target||e.target._sentryId!==Ve)return!1}catch(e){}return!0}(n)){e({event:n,name:r,global:t}),Ue=n.type,Ve=i?i._sentryId:void 0}clearTimeout(xe),xe=De.setTimeout((()=>{Ve=void 0,Ue=void 0}),Me)}}const He=R.OW,Ge="__sentry_xhr_v3__";function We(){if(!He.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;(0,v.GS)(e,"open",(function(e){return function(...t){const n=Date.now(),i=(0,z.Kg)(t[0])?t[0].toUpperCase():void 0,o=function(e){if((0,z.Kg)(e))return e;try{return e.toString()}catch(e){}return}(t[1]);if(!i||!o)return e.apply(this,t);this[Ge]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const r=()=>{const e=this[Ge];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}U("xhr",{args:[i,o],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?(0,v.GS)(this,"onreadystatechange",(function(e){return function(...t){return r(),e.apply(this,t)}})):this.addEventListener("readystatechange",r),(0,v.GS)(this,"setRequestHeader",(function(e){return function(...t){const[n,i]=t,o=this[Ge];return o&&(0,z.Kg)(n)&&(0,z.Kg)(i)&&(o.request_headers[n.toLowerCase()]=i),e.apply(this,t)}})),e.apply(this,t)}})),(0,v.GS)(e,"send",(function(e){return function(...t){const n=this[Ge];if(!n)return e.apply(this,t);void 0!==t[0]&&(n.body=t[0]);return U("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}function je(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!P())return!1;if(L(N.fetch))return!0;let e=!1;const t=N.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=L(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){C.T&&i.vF.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&(0,v.GS)(R.OW,"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:ze(t),method:Ye(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:ze(t),method:Ye(t,"method")?String(t.method).toUpperCase():"GET"}}(t),o={args:t,fetchData:{method:n,url:i},startTimestamp:Date.now()};return U("fetch",{...o}),e.apply(R.OW,t).then((e=>(U("fetch",{...o,endTimestamp:Date.now(),response:e}),e)),(e=>{throw U("fetch",{...o,endTimestamp:Date.now(),error:e}),e}))}}))}function Ye(e,t){return!!e&&"object"==typeof e&&!!e[t]}function ze(e){return"string"==typeof e?e:e?Ye(e,"url")?e.url:e.toString?e.toString():"":""}var Ke=n(33885);const Je=["fatal","error","warning","log","info","debug"];function qe(e){return"warn"===e?"warning":Je.includes(e)?e:"log"}function Xe(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 $e=1024,Ze="Breadcrumbs",Qe=(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";M(t,e),x(t,we)}(function(e){return function(t){if((0,y.KU)()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:qe(t.level),message:(0,r.gt)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${(0,r.gt)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}(0,y.ZQ)(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if((0,y.KU)()!==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>$e&&(ve&&i.vF.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=$e),"string"==typeof a&&(a=[a]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;o=(0,Ke.Hd)(t,{keyAttrs:a,maxStringLength:s}),r=(0,Ke.xE)(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,y.ZQ)(c,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),M("dom",n),x("dom",Fe)),t.xhr&&function(e){M("xhr",e),x("xhr",We)}(function(e){return function(t){if((0,y.KU)()!==e)return;const{startTimestamp:n,endTimestamp:i}=t,o=t.xhr[Ge];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,y.ZQ)({category:"xhr",data:l,type:"http"},u)}}(e)),t.fetch&&function(e){const t="fetch";M(t,e),x(t,je)}(function(e){return function(t){if((0,y.KU)()!==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,y.ZQ)({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,y.ZQ)({category:"fetch",data:o,type:"http"},r)}}}(e)),t.history&&B(function(e){return function(t){if((0,y.KU)()!==e)return;let n=t.from,i=t.to;const o=Xe(Re.location.href);let r=n?Xe(n):void 0;const a=Xe(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,y.ZQ)({category:"navigation",data:{from:n,to:i}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){(0,y.KU)()===e&&(0,y.ZQ)({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,o.$X)(t)},{event:t})}}(e))}}};h(Ze,Qe);const et="Dedupe",tt=()=>{let e;return{name:et,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(!it(e,t))return!1;if(!nt(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=ot(t),i=ot(e);if(!n||!i)return!1;if(n.type!==i.type||n.value!==i.value)return!1;if(!it(e,t))return!1;if(!nt(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return ve&&i.vF.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};h(et,tt);function nt(e,t){let n=rt(e),i=rt(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:ut,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";M(t,e),x(t,st)}((t=>{const{stackParser:n,attachStacktrace:i}=ft();if((0,y.KU)()!==e||Pe())return;const{msg:o,url:r,line:a,column:s,error:c}=t,l=void 0===c&&(0,z.Kg)(o)?function(e,t,n,i){const o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let r=(0,z.T2)(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 pt(c,t,n,i)}(o,r,a,s):pt(Ie(n,c||o,void 0,i,!1),r,a,s);l.level="error",(0,y.r)(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}(e),ht("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";M(t,e),x(t,lt)}((t=>{const{stackParser:n,attachStacktrace:i}=ft();if((0,y.KU)()!==e||Pe())return;const o=function(e){if((0,z.sO)(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,z.sO)(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Ie(n,o,void 0,i,!0);r.level="error",(0,y.r)(r,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),ht("onunhandledrejection"))}}};h(ut,dt);function pt(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,z.Kg)(t)&&t.length>0?t:(0,Ke.$N)();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),e}function ht(e){ve&&i.vF.log(`Global Handler attached: ${e}`)}function ft(){const e=(0,y.KU)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const mt="HttpContext",_t=()=>({name:mt,setupOnce(){},preprocessEvent(e){if(!Re.navigator&&!Re.location&&!Re.document)return;const t=e.request&&e.request.url||Re.location&&Re.location.href,{referrer:n}=Re.document||{},{userAgent:i}=Re.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}});h(mt,_t);function gt(e,t,n=250,i,o,a,s){if(!(a.exception&&a.exception.values&&s&&(0,z.tH)(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=Et(e,t,o,s.originalException,i,a.exception.values,c,0),u=n,l.map((e=>(e.value&&(e.value=(0,r.xv)(e.value,u)),e)))))}function Et(e,t,n,i,o,r,a,s){if(r.length>=n+1)return r;let c=[...r];if((0,z.tH)(i[o],Error)){vt(a,s);const r=e(t,i[o]),l=c.length;yt(r,o,l,s),c=Et(e,t,n,i[o],o,[r,...c],r,l)}return Array.isArray(i.errors)&&i.errors.forEach(((i,r)=>{if((0,z.tH)(i,Error)){vt(a,s);const l=e(t,i),u=c.length;yt(l,`errors[${r}]`,u,s),c=Et(e,t,n,i,o,[l,...c],l,u)}})),c}function vt(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function yt(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 bt="LinkedErrors",St=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:bt,setupOnce(){},preprocessEvent(e,i,o){const r=o.getOptions();gt(ye,r.stackParser,r.maxValueLength,n,t,e,i)}}},Tt=(h(bt,St),["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"]),At="TryCatch",It=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:At,setupOnce(){t.setTimeout&&(0,v.GS)(Re,"setTimeout",Ot),t.setInterval&&(0,v.GS)(Re,"setInterval",Ot),t.requestAnimationFrame&&(0,v.GS)(Re,"requestAnimationFrame",Ct),t.XMLHttpRequest&&"XMLHttpRequest"in Re&&(0,v.GS)(XMLHttpRequest.prototype,"send",Rt);const e=t.eventTarget;if(e){(Array.isArray(e)?e:Tt).forEach(Nt)}}}};h(At,It);function Ot(e){return function(...t){const n=t[0];return t[0]=Le(n,{mechanism:{data:{function:(0,O.qQ)(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Ct(e){return function(t){return e.apply(this,[Le(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,O.qQ)(e)},handled:!1,type:"instrument"}})])}}function Rt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&(0,v.GS)(n,e,(function(t){const n={mechanism:{data:{function:e,handler:(0,O.qQ)(t)},handled:!1,type:"instrument"}},i=(0,v.sp)(t);return i&&(n.mechanism.data.handler=(0,O.qQ)(i)),Le(t,n)}))})),e.apply(this,t)}}function Nt(e){const t=Re,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,v.GS)(n,"addEventListener",(function(t){return function(n,i,o){try{"function"==typeof i.handleEvent&&(i.handleEvent=Le(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,O.qQ)(i),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,Le(i,{mechanism:{data:{function:"addEventListener",handler:(0,O.qQ)(i),target:e},handled:!1,type:"instrument"}}),o])}})),(0,v.GS)(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 Pt="?";function Lt(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 kt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Dt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ut=[[30,e=>{const t=kt.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=wt.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Ft(t[1]||Pt,t[2]);return Lt(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{const t=Dt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Mt.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]||Pt;return[n,e]=Ft(n,e),Lt(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,e=>{const t=xt.exec(e);return t?Lt(t[2],t[1]||Pt,+t[3],t[4]?+t[4]:void 0):void 0}]],Vt=(0,O.gd)(...Ut),Ft=(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]:Pt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function Bt(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 K.T2(((n,i)=>{let o=t.length;if(!o)return n(!0);const r=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{(0,K.XW)(e).then((()=>{--o||(clearTimeout(r),n(!0))}),i)}))}))}}}const Ht=6e4;function Gt(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,,,r]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(n)for(const e of n.split(";"))"metric_bucket"===e&&r&&!r.split(";").includes("custom")||(o[e]=i+s);else o.all=i+s}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)?Ht:i-t}(a,i):429===t&&(o.all=i+6e4);return o}const Wt=30;function jt(e,t,n=Bt(e.bufferSize||Wt)){let o={};function r(r){const s=[];if($(r,((t,n)=>{const i=ne(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=Yt(t,n);e.recordDroppedEvent("ratelimit_backoff",i,o)}else s.push(t)})),0===s.length)return(0,K.XW)();const c=q(r[0],s),l=t=>{$(c,((n,i)=>{const o=Yt(n,i);e.recordDroppedEvent(t,ne(i),o)}))};return n.add((()=>t({body:Q(c,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&a.T&&i.vF.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),o=Gt(o,e),e)),(e=>{throw l("network_error"),e})))).then((e=>e),(e=>{if(e instanceof oe)return a.T&&i.vF.error("Skipped sending event because buffer is full."),l("queue_overflow"),(0,K.XW)();throw e}))}return r.__sentry__baseTransport__=!0,{send:r,flush:e=>n.drain(e)}}function Yt(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let zt;function Kt(e,t=function(){if(zt)return zt;if(L(Re.fetch))return zt=Re.fetch.bind(Re);const e=Re.document;let t=Re.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){ve&&i.vF.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return zt=t.bind(Re)}()){let n=0,o=0;return jt(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 zt=void 0,n-=r,o--,(0,K.xg)(e)}}))}const Jt=4;function qt(e){return jt(e,(function(t){return new K.T2(((n,i)=>{const o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=()=>{o.readyState===Jt&&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 Xt=[g(),A(),It(),Qe(),dt(),St(),tt(),_t()];function $t(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Xt]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Re.SENTRY_RELEASE&&Re.SENTRY_RELEASE.id&&(e.release=Re.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(0,O.vk)(e.stackParser||Vt),integrations:u(e),transport:e.transport||(P()?Kt:qt)};I(ke,t),e.autoSessionTracking&&function(){if(void 0===Re.document)return void(ve&&i.vF.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));(0,y.J0)({ignoreDuration:!0}),(0,y.J5)(),B((({from:e,to:t})=>{void 0!==e&&e!==t&&((0,y.J0)({ignoreDuration:!0}),(0,y.J5)())}))}()}},53974:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});const i="production"},54457:(e,t,n)=>{"use strict";n.d(t,{T:()=>i});const i="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},5934:(e,t,n)=>{"use strict";n.d(t,{jB:()=>u,lG:()=>c,lb:()=>l});var i=n(61534),o=n(55693),r=n(50853),a=n(28445),s=n(54457);function c(){return(0,i.BY)("globalEventProcessors",(()=>[]))}function l(e){c().push(e)}function u(e,t,n,i=0){return new o.T2(((o,c)=>{const l=e[i];if(null===t||"function"!=typeof l)o(t);else{const d=l({...t},n);s.T&&l.id&&null===d&&r.vF.log(`Event processor "${l.id}" dropped event`),(0,a.Qg)(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)}}))}},46588:(e,t,n)=>{"use strict";n.d(t,{Cp:()=>c,J0:()=>m,J5:()=>E,KU:()=>h,PN:()=>u,ZQ:()=>d,o5:()=>f,r:()=>l,v4:()=>p});var i=n(61534),o=n(53974),r=n(67148),a=n(77683),s=n(76756);function c(e,t){return(0,r.BF)().captureException(e,(0,s.li)(t))}function l(e,t){return(0,r.BF)().captureEvent(e,t)}function u(e){(0,r.BF)().configureScope(e)}function d(e,t){(0,r.BF)().addBreadcrumb(e,t)}function p(...e){const t=(0,r.BF)();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 h(){return(0,r.BF)().getClient()}function f(){return(0,r.BF)().getScope()}function m(e){const t=h(),n=(0,r.rm)(),s=f(),{release:c,environment:l=o.U}=t&&t.getOptions()||{},{userAgent:u}=i.OW.navigator||{},d=(0,a.fj)({release:c,environment:l,user:s.getUser()||n.getUser(),...u&&{userAgent:u},...e}),p=n.getSession();return p&&"ok"===p.status&&(0,a.qO)(p,{status:"exited"}),_(),n.setSession(d),s.setSession(d),d}function _(){const e=(0,r.rm)(),t=f(),n=t.getSession()||e.getSession();n&&(0,a.Vu)(n),g(),e.setSession(),t.setSession()}function g(){const e=(0,r.rm)(),t=f(),n=h(),i=t.getSession()||e.getSession();i&&n&&n.captureSession&&n.captureSession(i)}function E(e=!1){e?_():g()}},67148:(e,t,n)=>{"use strict";n.d(t,{BF:()=>E,rm:()=>v});var i=n(28445),o=n(28041),r=n(52900),a=n(50853),s=n(61534),c=n(53974),l=n(54457),u=n(52595),d=n(77683),p=n(80043);const h=parseFloat(p.M),f=100;class m{constructor(e,t,n,i=h){let o,r;this._version=i,t?o=t:(o=new u.HG,o.setClient(e)),n?r=n:(r=new u.HG,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.eJ)(),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.eJ)(),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.eJ)();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=f}=i.getOptions&&i.getOptions()||{};if(s<=0)return;const c={timestamp:(0,r.lu)(),...e},l=o?(0,a.pq)((()=>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=g(this);try{e(this)}finally{g(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return l.T&&a.vF.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(l.T&&!n){this.getClient()?a.vF.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):a.vF.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.Vu)(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:i,environment:o=c.U}=n&&n.getOptions()||{},{userAgent:r}=s.OW.navigator||{},a=(0,d.fj)({release:i,environment:o,user:t.getUser(),...r&&{userAgent:r},...e}),l=t.getSession&&t.getSession();return l&&"ok"===l.status&&(0,d.qO)(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=_().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);l.T&&a.vF.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function _(){return s.OW.__SENTRY__=s.OW.__SENTRY__||{extensions:{},hub:void 0},s.OW}function g(e){const t=_(),n=S(t);return T(t,e),n}function E(){const e=_();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return y(e)}function v(){return E().getIsolationScope()}function y(e=_()){return b(e)&&!S(e).isOlderThan(h)||T(e,new m),S(e)}function b(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function S(e){return(0,s.BY)("hub",(()=>new m),e)}function T(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}},52595:(e,t,n)=>{"use strict";n.d(t,{HG:()=>d,m6:()=>p});var i=n(28445),o=n(52900),r=n(28041),a=n(50853),s=n(5934),c=n(77683),l=n(7334);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=h()}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.qO)(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;const t="function"==typeof e?e(this):e;if(t instanceof d){const e=t.getScopeData();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.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if((0,i.Qd)(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return 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=h(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const i={timestamp:(0,o.lu)(),...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.e2)(e,this.getScopeData());const i=[...n,...(0,s.lG)(),...this._eventProcessors];return(0,s.jB)(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.eJ)();if(!this._client)return a.vF.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.eJ)();if(!this._client)return a.vF.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.eJ)();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(a.vF.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 h(){return{traceId:(0,r.eJ)(),spanId:(0,r.eJ)().substring(16)}}},77683:(e,t,n)=>{"use strict";n.d(t,{Vu:()=>c,fj:()=>a,qO:()=>s});var i=n(52900),o=n(28041),r=n(41310);function a(e){const t=(0,i.zf)(),n={sid:(0,o.eJ)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return(0,r.Ce)({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.zf)(),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.eJ)()),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)}},53599:(e,t,n)=>{"use strict";n.d(t,{k:()=>l,l:()=>c});var i=n(41310),o=n(53974),r=n(46588),a=n(6665),s=n(74600);function c(e,t,n){const r=t.getOptions(),{publicKey:a}=t.getDsn()||{},{segment:s}=n&&n.getUser()||{},c=(0,i.Ce)({environment:r.environment||o.U,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.KU)();if(!t)return{};const n=c((0,s.et)(e).trace_id||"",t,(0,r.o5)()),i=(0,a.z)(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.et)(i);return u&&"url"!==u&&(n.transaction=d.description),n.sampled=String((0,s.pK)(i)),t.emit&&t.emit("createDsc",n),n}},7334:(e,t,n)=>{"use strict";n.d(t,{Rg:()=>l,e2:()=>c});var i=n(41310),o=n(28041),r=n(53599),a=n(6665),s=n(74600);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.Ce)(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const u=(0,i.Ce)(o);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});const d=(0,i.Ce)(r);d&&Object.keys(d).length&&(e.user={...d,...e.user});const p=(0,i.Ce)(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.kX)(t),...e.contexts};const n=(0,a.z)(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:(0,r.k)(t),...e.sdkProcessingMetadata};const i=(0,s.et)(n).description;i&&(e.tags={transaction:i,...e.tags})}}(e,c),function(e,t){e.fingerprint=e.fingerprint?(0,o.k9)(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:h,transactionName:f,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),f&&(e.transactionName=f),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,...h}}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])}}},6665:(e,t,n)=>{"use strict";function i(e){return e.transaction}n.d(t,{z:()=>i})},76756:(e,t,n)=>{"use strict";n.d(t,{li:()=>m,mG:()=>h});var i=n(28041),o=n(52900),r=n(76444),a=n(61534),s=n(42456),c=n(53974),l=n(5934),u=n(52595),d=n(7334),p=n(74600);function h(e,t,n,h,m,_){const{normalizeDepth:g=3,normalizeMaxBreadth:E=1e3}=e,v={...t,event_id:t.event_id||n.event_id||(0,i.eJ)(),timestamp:t.timestamp||(0,o.lu)()},y=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.U);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.xv)(e.message,a));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=(0,r.xv)(s.value,a));const l=e.request;l&&l.url&&(l.url=(0,r.xv)(l.url,a))}(v,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(v,y),void 0===t.type&&function(e,t){const n=a.OW._sentryDebugIds;if(!n)return;let i;const o=f.get(t);o?i=o:(i=new Map,f.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){}}(v,e.stackParser);const b=function(e,t){if(!t)return e;const n=e?e.clone():new u.HG;return n.update(t),n}(h,n.captureContext);n.mechanism&&(0,i.M6)(v,n.mechanism);const S=m&&m.getEventProcessors?m.getEventProcessors():[],T=(0,u.m6)().getScopeData();if(_){const e=_.getScopeData();(0,d.Rg)(T,e)}if(b){const e=b.getScopeData();(0,d.Rg)(T,e)}const A=[...n.attachments||[],...T.attachments];A.length&&(n.attachments=A),(0,d.e2)(v,T);const I=[...S,...(0,l.lG)(),...T.eventProcessors];return(0,l.jB)(I,v,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 g&&g>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.S8)(e.data,t,n)}})))},...e.user&&{user:(0,s.S8)(e.user,t,n)},...e.contexts&&{contexts:(0,s.S8)(e.contexts,t,n)},...e.extra&&{extra:(0,s.S8)(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.S8)(e.contexts.trace.data,t,n)));e.spans&&(i.spans=e.spans.map((e=>{const i=(0,p.et)(e).data;return i&&(e.data=(0,s.S8)(i,t,n)),e})));return i}(e,g,E):e)))}const f=new WeakMap;function m(e){if(e)return function(e){return e instanceof u.HG||"function"==typeof e}(e)||function(e){return Object.keys(e).some((e=>_.includes(e)))}(e)?{captureContext:e}:e}const _=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},74600:(e,t,n)=>{"use strict";n.d(t,{et:()=>a,kX:()=>r,pK:()=>s});var i=n(41310);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.Ce)({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)}},80043:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});const i="7.113.0"},8700:(e,t,n)=>{"use strict";n.d(t,{T:()=>o});const i="SessionTiming",o=(r=i,a=()=>{const e=Date.now();return{name:i,setupOnce(){},processEvent(t){const n=Date.now();return{...t,extra:{...t.extra,"session:start":e,"session:duration":n-e,"session:end":n}}}}},Object.assign((function(...e){return a(...e)}),{id:r}));var r,a},33885:(e,t,n)=>{"use strict";n.d(t,{$N:()=>c,Hd:()=>a,xE:()=>l});var i=n(28445);const o=(0,n(61534).VZ)(),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,h=!Array.isArray(t)&&t.maxStringLength||r;for(;n&&a++1&&c+o.length*u+d.length>=h));)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.Kg)(a))for(s=a.split(/\s+/),u=0;u{"use strict";n.d(t,{T:()=>i});const i="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},28445:(e,t,n)=>{"use strict";n.d(t,{BD:()=>s,Kg:()=>l,L2:()=>y,NF:()=>u,Qd:()=>p,Qg:()=>_,T2:()=>a,W6:()=>c,bJ:()=>o,gd:()=>m,mE:()=>g,sO:()=>d,tH:()=>v,vq:()=>f,xH:()=>h,yr:()=>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 v(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 h(e){return"undefined"!=typeof Event&&v(e,Event)}function f(e){return"undefined"!=typeof Element&&v(e,Element)}function m(e){return r(e,"RegExp")}function _(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function g(e){return p(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function E(e){return"number"==typeof e&&e!=e}function v(e,t){try{return e instanceof t}catch(e){return!1}}function y(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}},50853:(e,t,n)=>{"use strict";n.d(t,{Ow:()=>r,Z9:()=>a,pq:()=>s,vF:()=>c});var i=n(5635),o=n(61534);const r=["debug","info","warn","error","log","assert","trace"],a={};function s(e){if(!("console"in o.OW))return e();const t=o.OW.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.T?r.forEach((n=>{t[n]=(...t)=>{e&&s((()=>{o.OW.console[n](`Sentry Logger [${n}]:`,...t)}))}})):r.forEach((e=>{t[e]=()=>{}})),t}()},28041:(e,t,n)=>{"use strict";n.d(t,{$X:()=>s,GR:()=>u,M6:()=>l,eJ:()=>r,gO:()=>c,k9:()=>d});var i=n(41310),o=n(61534);function r(){const e=o.OW,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.my)(e,"__sentry_captured__",!0)}catch(e){}return!1}function d(e){return Array.isArray(e)?e:[e]}},42456:(e,t,n)=>{"use strict";n.d(t,{S8:()=>a,cd:()=>s});var i=n(28445);var o=n(41310),r=n(72024);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=g[e];m[e]=c(e,t,h-1,s,l),_++}return d(t),m}},41310:(e,t,n)=>{"use strict";n.d(t,{Ce:()=>g,GS:()=>c,HF:()=>_,W4:()=>h,my:()=>l,pO:()=>u,sp:()=>d,u4:()=>p});var i=n(33885),o=n(5635),r=n(28445),a=n(50853),s=n(76444);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.T&&a.vF.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 h(e){if((0,r.bJ)(e))return{message:e.message,name:e.name,stack:e.stack,...m(e)};if((0,r.xH)(e)){const t={type:e.type,target:f(e.target),currentTarget:f(e.currentTarget),...m(e)};return"undefined"!=typeof CustomEvent&&(0,r.tH)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function f(e){try{return(0,r.vq)(e)?(0,i.Hd)(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 _(e,t=40){const n=Object.keys(h(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,s.xv)(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.xv)(i,t)}return""}function g(e){return E(e,new Map)}function E(e,t){if(function(e){if(!(0,r.Qd)(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]=E(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(E(e,t))})),i}return e}},72024:(e,t,n)=>{"use strict";n.d(t,{gd:()=>a,qQ:()=>l,vk:()=>s});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}}},76444:(e,t,n)=>{"use strict";n.d(t,{Xr:()=>a,gt:()=>r,xv:()=>o});var i=n(28445);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.Kg)(e)&&((0,i.gd)(t)?t.test(e):!!(0,i.Kg)(t)&&(n?e===t:e.includes(t)))}(e,t,n)))}},55693:(e,t,n)=>{"use strict";n.d(t,{T2:()=>s,XW:()=>r,xg:()=>a});var i,o=n(28445);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.Qg)(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)}))}}}},52900:(e,t,n)=>{"use strict";n.d(t,{lu:()=>r,zf:()=>a});var i=n(61534);const o=1e3;function r(){return Date.now()/o}const a=function(){const{performance:e}=i.OW;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.OW;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,{BY:()=>a,OW:()=>o,VZ:()=>r});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())}},23137:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>fe});var i=n(84729),o=n(31819),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 h(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(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 _(e,t){-1===e.indexOf(t)&&e.push(t)}function g(e){return e.split("-")[0]}function E(e){return[].slice.call(e)}function v(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function y(){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 T(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function A(e){return b(e)?[e]:function(e){return p(e,"NodeList")}(e)?E(e):Array.isArray(e)?e:E(document.querySelectorAll(e))}function I(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function O(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 R(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function N(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 P={isTouch:!1},L=0;function k(){P.isTouch||(P.isTouch=!0,window.performance&&document.addEventListener("mousemove",w))}function w(){var e=performance.now();e-L<20&&(P.isTouch=!1,document.removeEventListener("mousemove",w)),L=e}function D(){var e=document.activeElement;if(T(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:h(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 W(e){var t=y();return!0===e?t.className=s:(t.className=c,b(e)?t.appendChild(e):G(t,e)),t}function j(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=E(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 z(e){var t=y(),n=y();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=y();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||j(a,e.props),i.arrow?s?n.arrow!==i.arrow&&(r.removeChild(s),r.appendChild(W(i.arrow))):r.appendChild(W(i.arrow)):s&&r.removeChild(s)}return i.className=r,i.setAttribute("data-state","hidden"),j(i,e.props),t.appendChild(n),n.appendChild(i),o(e.props,e.props),{popper:t,onUpdate:o}}z.$$tippy=!0;var K=1,J=[],q=[];function X(e,t){var n,o,r,a,s,c,p,b,T=B(e,Object.assign({},U,F(v(t)))),A=!1,L=!1,k=!1,w=!1,D=[],x=f(ye,T.interactiveDebounce),V=K++,H=(b=T.plugins).filter((function(e,t){return b.indexOf(e)===t})),G={id:V,reference:e,popper:y(),popperInstance:null,props:T,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]),Ee();var n=G.props,i=B(e,Object.assign({},n,v(t),{ignoreAttributes:!0}));G.props=i,ge(),n.interactiveDebounce!==i.interactiveDebounce&&(le(),x=f(ye,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?m(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):i.triggerTarget&&e.removeAttribute("aria-expanded");ce(),re(),z&&z(n,i);G.popperInstance&&(Ae(),Oe().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=P.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()&&(j.style.visibility="visible");re(),he(),G.state.isMounted||(j.style.transition="none");if(ee()){var r=ie();I([r.box,r.content],0)}c=function(){var e;if(G.state.isVisible&&!w){if(w=!0,j.offsetHeight,j.style.transition=G.props.moveTransition,ee()&&G.props.animation){var t=ie(),n=t.box,i=t.content;I([n,i],o),O([n,i],"visible")}se(),ce(),_(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:h(t,[n]);e.contains(j)||e.appendChild(j);G.state.isMounted=!0,Ae(),!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,w=!1,A=!1,ee()&&(j.style.visibility="hidden");if(le(),fe(),re(!0),ee()){var o=ie(),r=o.box,a=o.content;G.props.animation&&(I([r,a],i),O([r,a],"hidden"))}se(),ce(),G.props.animation?ee()&&function(e,t){me(e,(function(){!G.state.isVisible&&j.parentNode&&j.parentNode.contains(j)&&t()}))}(i,G.unmount):G.unmount()},hideWithInteractivity:function(e){0;ne().addEventListener("mousemove",x),_(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;Ie(),Oe().forEach((function(e){e._tippy.unmount()})),j.parentNode&&j.parentNode.removeChild(j);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(),Ee(),delete e._tippy,G.state.isDestroyed=!0,ae("onDestroy",[G])}};if(!T.render)return G;var W=T.render(G),j=W.popper,z=W.onUpdate;j.setAttribute("data-tippy-root",""),j.id="tippy-"+G.id,G.popper=j,e._tippy=G,j._tippy=G;var X=H.map((function(e){return e.fn(G)})),$=e.hasAttribute("aria-expanded");return ge(),ce(),re(),ae("onCreate",[G]),T.showOnCreate&&Ce(),j.addEventListener("mouseenter",(function(){G.props.interactive&&G.state.isVisible&&G.clearDelayTimeouts()})),j.addEventListener("mouseleave",(function(){G.props.interactive&&G.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",x)})),G;function Z(){var e=G.props.touch;return Array.isArray(e)?e:[e,0]}function Q(){return"hold"===Z()[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(j)}function oe(e){return G.state.isMounted&&!G.state.isVisible||P.isTouch||a&&"focus"===a.type?0:d(G.props.delay,e?0:1,U.delay)}function re(e){void 0===e&&(e=!1),j.style.pointerEvents=G.props.interactive&&!e?"":"none",j.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=j.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(){!$&&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(!P.isTouch||!k&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!G.props.interactive||!N(j,n)){if(m(G.props.triggerTarget||e).some((function(e){return N(e,n)}))){if(P.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(),L=!0,setTimeout((function(){L=!1})),G.state.isMounted||fe())}}}function de(){k=!0}function pe(){k=!1}function he(){var e=ne();e.addEventListener("mousedown",ue,!0),e.addEventListener("touchend",ue,l),e.addEventListener("touchstart",pe,l),e.addEventListener("touchmove",de,l)}function fe(){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&&(R(n,"remove",i),t())}if(0===e)return t();R(n,"remove",s),R(n,"add",i),s=i}function _e(t,n,i){void 0===i&&(i=!1),m(G.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),D.push({node:e,eventType:t,handler:n,options:i})}))}function ge(){var e;Q()&&(_e("touchstart",ve,{passive:!0}),_e("touchend",be,{passive:!0})),(e=G.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_e(e,ve),e){case"mouseenter":_e("mouseleave",be);break;case"focus":_e(M?"focusout":"blur",Se);break;case"focusin":_e("focusout",Se)}}))}function Ee(){D.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),D=[]}function ve(e){var t,n=!1;if(G.state.isEnabled&&!Te(e)&&!L){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||A)&&!1!==G.props.hideOnClick&&G.state.isVisible?n=!0:Ce(e),"click"===e.type&&(A=!n),n&&!i&&Re(e)}}function ye(e){var t=e.target,n=te().contains(t)||j.contains(t);if("mousemove"!==e.type||!n){var i=Oe().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:T}: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=g(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,h=i-t.bottom-l>r,f=t.left-n+u>r,m=n-t.right-d>r;return p||h||f||m}))})(i,e)&&(le(),Re(e))}}function be(e){Te(e)||G.props.trigger.indexOf("click")>=0&&A||(G.props.interactive?G.hideWithInteractivity(e):Re(e))}function Se(e){G.props.trigger.indexOf("focusin")<0&&e.target!==te()||G.props.interactive&&e.relatedTarget&&j.contains(e.relatedTarget)||Re(e)}function Te(e){return!!P.isTouch&&Q()!==e.type.indexOf("touch")>=0}function Ae(){Ie();var t=G.props,n=t.popperOptions,o=t.placement,r=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,l=ee()?Y(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)||[]),G.popperInstance=(0,i.n4)(u,j,Object.assign({},n,{placement:o,onFirstUpdate:c,modifiers:p}))}function Ie(){G.popperInstance&&(G.popperInstance.destroy(),G.popperInstance=null)}function Oe(){return E(j.querySelectorAll("[data-tippy-root]"))}function Ce(e){G.clearDelayTimeouts(),e&&ae("onTrigger",[G,e]),he();var t=oe(!0),i=Z(),o=i[0],r=i[1];P.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){G.show()}),t):G.show()}function Re(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&&A)){var t=oe(!1);t?o=setTimeout((function(){G.state.isVisible&&G.hide()}),t):r=requestAnimationFrame((function(){G.hide()}))}}else fe()}}function $(e,t){void 0===t&&(t={});var n=U.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",k,l),window.addEventListener("blur",D);var i=Object.assign({},t,{plugins:n}),o=A(e).reduce((function(e,t){var n=t&&X(t,i);return n&&e.push(n),e}),[]);return b(e)?o[0]:o}$.defaultProps=U,Spicetify.Tippy=$;$.setDefaultProps=function(e){Object.keys(e).forEach((function(t){U[t]=e[t]}))},$.currentInput=P;Object.assign({},o.A,{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)}});$.setDefaultProps({render:z});const Z=$;var Q=n(30758),ee=n(8143);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?Q.useLayoutEffect:Q.useEffect;function le(e){var t=(0,Q.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"])),h=void 0!==o,f=void 0!==r,m=(0,Q.useState)(!1),_=m[0],g=m[1],E=(0,Q.useState)({}),v=E[0],y=E[1],b=(0,Q.useState)(),S=b[0],T=b[1],A=le((function(){return{container:oe(),renders:1}})),I=Object.assign({ignoreAttributes:d},p,{content:A.container});h&&(I.trigger="manual",I.hideOnClick=!1),f&&(l=!0);var O=I,C=I.plugins||[];a&&(O=Object.assign({},I,{plugins:f&&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,T(n.content)}}}}]):C,render:function(){return{popper:A.container}}}));var R=[s].concat(n?[n.type]:[]);return ce((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||A.ref||oe(),Object.assign({},O,{plugins:[de].concat(I.plugins||[])}));return A.instance=n,l&&n.disable(),o&&n.show(),f&&r.hook({instance:n,content:i,props:O,setSingletonContent:T}),g(!0),function(){n.destroy(),null==r||r.cleanup(n)}}),R),ce((function(){var e;if(1!==A.renders){var t=A.instance;t.setProps(se(t.props,O)),null==(e=t.popperInstance)||e.forceUpdate(),l?t.disable():t.enable(),h&&(o?t.show():t.hide()),f&&r.hook({instance:t,content:i,props:O,setSingletonContent:T})}else A.renders++})),ce((function(){var e;if(a){var t=A.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;v.placement===n.placement&&v.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&v.escaped===(null==i?void 0:i.hasPopperEscaped)||y({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[v.placement,v.referenceHidden,v.escaped].concat(R)),Q.createElement(Q.Fragment,null,n?(0,Q.cloneElement)(n,{ref:function(e){A.ref=e,ie(n.ref,e)}}):null,_&&(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}(v),S,A.instance):i,A.container))}}var he=function(e,t){return(0,Q.forwardRef)((function(n,i){var o=n.children,r=te(n,["children"]);return Q.createElement(e,Object.assign({},t,r),o?(0,Q.cloneElement)(o,{ref:function(e){ie(i,e),ie(o.ref,e)}}):null)}))};const fe=he(pe(Z))},3956:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>le});var i=n(84729),o=n(31819),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 h(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(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 _(e,t){-1===e.indexOf(t)&&e.push(t)}function g(e){return e.split("-")[0]}function E(e){return[].slice.call(e)}function v(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function y(){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 T(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function A(e){return b(e)?[e]:function(e){return p(e,"NodeList")}(e)?E(e):Array.isArray(e)?e:E(document.querySelectorAll(e))}function I(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function O(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 R(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function N(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 P={isTouch:!1},L=0;function k(){P.isTouch||(P.isTouch=!0,window.performance&&document.addEventListener("mousemove",w))}function w(){var e=performance.now();e-L<20&&(P.isTouch=!1,document.removeEventListener("mousemove",w)),L=e}function D(){var e=document.activeElement;if(T(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:h(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=E(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,W=[],j=[];function Y(e,t){var n,o,r,a,s,c,p,b,T=B(e,Object.assign({},U,F(v(t)))),A=!1,L=!1,k=!1,w=!1,D=[],x=f(ye,T.interactiveDebounce),V=G++,Y=(b=T.plugins).filter((function(e,t){return b.indexOf(e)===t})),z={id:V,reference:e,popper:y(),popperInstance:null,props:T,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(z.state.isDestroyed)return;ae("onBeforeUpdate",[z,t]),Ee();var n=z.props,i=B(e,Object.assign({},n,v(t),{ignoreAttributes:!0}));z.props=i,ge(),n.interactiveDebounce!==i.interactiveDebounce&&(le(),x=f(ye,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);z.popperInstance&&(Ae(),Oe().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[z,t])},setContent:function(e){z.setProps({content:e})},show:function(){0;var e=z.state.isVisible,t=z.state.isDestroyed,n=!z.state.isEnabled,i=P.isTouch&&!z.props.touch,o=d(z.props.duration,0,U.duration);if(e||t||n||i)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[z],!1),!1===z.props.onShow(z))return;z.state.isVisible=!0,ee()&&(J.style.visibility="visible");re(),he(),z.state.isMounted||(J.style.transition="none");if(ee()){var r=ie();I([r.box,r.content],0)}c=function(){var e;if(z.state.isVisible&&!w){if(w=!0,J.offsetHeight,J.style.transition=z.props.moveTransition,ee()&&z.props.animation){var t=ie(),n=t.box,i=t.content;I([n,i],o),O([n,i],"visible")}se(),ce(),_(j,z),null==(e=z.popperInstance)||e.forceUpdate(),ae("onMount",[z]),z.props.animation&&ee()&&function(e,t){me(e,t)}(o,(function(){z.state.isShown=!0,ae("onShown",[z])}))}},function(){var e,t=z.props.appendTo,n=te();e=z.props.interactive&&t===u||"parent"===t?n.parentNode:h(t,[n]);e.contains(J)||e.appendChild(J);z.state.isMounted=!0,Ae(),!1}()},hide:function(){0;var e=!z.state.isVisible,t=z.state.isDestroyed,n=!z.state.isEnabled,i=d(z.props.duration,1,U.duration);if(e||t||n)return;if(ae("onHide",[z],!1),!1===z.props.onHide(z))return;z.state.isVisible=!1,z.state.isShown=!1,w=!1,A=!1,ee()&&(J.style.visibility="hidden");if(le(),fe(),re(!0),ee()){var o=ie(),r=o.box,a=o.content;z.props.animation&&(I([r,a],i),O([r,a],"hidden"))}se(),ce(),z.props.animation?ee()&&function(e,t){me(e,(function(){!z.state.isVisible&&J.parentNode&&J.parentNode.contains(J)&&t()}))}(i,z.unmount):z.unmount()},hideWithInteractivity:function(e){0;ne().addEventListener("mousemove",x),_(W,x),x(e)},enable:function(){z.state.isEnabled=!0},disable:function(){z.hide(),z.state.isEnabled=!1},unmount:function(){0;z.state.isVisible&&z.hide();if(!z.state.isMounted)return;Ie(),Oe().forEach((function(e){e._tippy.unmount()})),J.parentNode&&J.parentNode.removeChild(J);j=j.filter((function(e){return e!==z})),z.state.isMounted=!1,ae("onHidden",[z])},destroy:function(){0;if(z.state.isDestroyed)return;z.clearDelayTimeouts(),z.unmount(),Ee(),delete e._tippy,z.state.isDestroyed=!0,ae("onDestroy",[z])}};if(!T.render)return z;var K=T.render(z),J=K.popper,q=K.onUpdate;J.setAttribute("data-tippy-root",""),J.id="tippy-"+z.id,z.popper=J,e._tippy=z,J._tippy=z;var X=Y.map((function(e){return e.fn(z)})),$=e.hasAttribute("aria-expanded");return ge(),ce(),re(),ae("onCreate",[z]),T.showOnCreate&&Ce(),J.addEventListener("mouseenter",(function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()})),J.addEventListener("mouseleave",(function(){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",x)})),z;function Z(){var e=z.props.touch;return Array.isArray(e)?e:[e,0]}function Q(){return"hold"===Z()[0]}function ee(){var e;return!(null==(e=z.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 z.state.isMounted&&!z.state.isVisible||P.isTouch||a&&"focus"===a.type?0:d(z.props.delay,e?0:1,U.delay)}function re(e){void 0===e&&(e=!1),J.style.pointerEvents=z.props.interactive&&!e?"":"none",J.style.zIndex=""+z.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=z.props)[e].apply(i,t)}function se(){var t=z.props.aria;if(t.content){var n="aria-"+t.content,i=J.id;m(z.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(z.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.props.aria.expanded&&m(z.props.triggerTarget||e).forEach((function(e){z.props.interactive?e.setAttribute("aria-expanded",z.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function le(){ne().removeEventListener("mousemove",x),W=W.filter((function(e){return e!==x}))}function ue(t){if(!P.isTouch||!k&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!z.props.interactive||!N(J,n)){if(m(z.props.triggerTarget||e).some((function(e){return N(e,n)}))){if(P.isTouch)return;if(z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[z,t]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),L=!0,setTimeout((function(){L=!1})),z.state.isMounted||fe())}}}function de(){k=!0}function pe(){k=!1}function he(){var e=ne();e.addEventListener("mousedown",ue,!0),e.addEventListener("touchend",ue,l),e.addEventListener("touchstart",pe,l),e.addEventListener("touchmove",de,l)}function fe(){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&&(R(n,"remove",i),t())}if(0===e)return t();R(n,"remove",s),R(n,"add",i),s=i}function _e(t,n,i){void 0===i&&(i=!1),m(z.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),D.push({node:e,eventType:t,handler:n,options:i})}))}function ge(){var e;Q()&&(_e("touchstart",ve,{passive:!0}),_e("touchend",be,{passive:!0})),(e=z.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_e(e,ve),e){case"mouseenter":_e("mouseleave",be);break;case"focus":_e(M?"focusout":"blur",Se);break;case"focusin":_e("focusout",Se)}}))}function Ee(){D.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,o=e.options;t.removeEventListener(n,i,o)})),D=[]}function ve(e){var t,n=!1;if(z.state.isEnabled&&!Te(e)&&!L){var i="focus"===(null==(t=a)?void 0:t.type);a=e,p=e.currentTarget,ce(),!z.state.isVisible&&S(e)&&W.forEach((function(t){return t(e)})),"click"===e.type&&(z.props.trigger.indexOf("mouseenter")<0||A)&&!1!==z.props.hideOnClick&&z.state.isVisible?n=!0:Ce(e),"click"===e.type&&(A=!n),n&&!i&&Re(e)}}function ye(e){var t=e.target,n=te().contains(t)||J.contains(t);if("mousemove"!==e.type||!n){var i=Oe().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:T}: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=g(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,h=i-t.bottom-l>r,f=t.left-n+u>r,m=n-t.right-d>r;return p||h||f||m}))})(i,e)&&(le(),Re(e))}}function be(e){Te(e)||z.props.trigger.indexOf("click")>=0&&A||(z.props.interactive?z.hideWithInteractivity(e):Re(e))}function Se(e){z.props.trigger.indexOf("focusin")<0&&e.target!==te()||z.props.interactive&&e.relatedTarget&&J.contains(e.relatedTarget)||Re(e)}function Te(e){return!!P.isTouch&&Q()!==e.type.indexOf("touch")>=0}function Ae(){Ie();var t=z.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)||[]),z.popperInstance=(0,i.n4)(u,J,Object.assign({},n,{placement:o,onFirstUpdate:c,modifiers:p}))}function Ie(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function Oe(){return E(J.querySelectorAll("[data-tippy-root]"))}function Ce(e){z.clearDelayTimeouts(),e&&ae("onTrigger",[z,e]),he();var t=oe(!0),i=Z(),o=i[0],r=i[1];P.isTouch&&"hold"===o&&r&&(t=r),t?n=setTimeout((function(){z.show()}),t):z.show()}function Re(e){if(z.clearDelayTimeouts(),ae("onUntrigger",[z,e]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&A)){var t=oe(!1);t?o=setTimeout((function(){z.state.isVisible&&z.hide()}),t):r=requestAnimationFrame((function(){z.hide()}))}}else fe()}}function z(e,t){void 0===t&&(t={});var n=U.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",k,l),window.addEventListener("blur",D);var i=Object.assign({},t,{plugins:n}),o=A(e).reduce((function(e,t){var n=t&&Y(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=P;Object.assign({},o.A,{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({animation:!1});const K=z;var J=n(30758),q=n(8143);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 $="undefined"!=typeof window&&"undefined"!=typeof document;function Z(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Q(){return $&&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=$?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"])),h=void 0!==o,f=void 0!==r,m=(0,J.useState)(!1),_=m[0],g=m[1],E=(0,J.useState)({}),v=E[0],y=E[1],b=(0,J.useState)(),S=b[0],T=b[1],A=oe((function(){return{container:Q(),renders:1}})),I=Object.assign({ignoreAttributes:d},p,{content:A.container});h&&(I.trigger="manual",I.hideOnClick=!1),f&&(l=!0);var O=I,C=I.plugins||[];a&&(O=Object.assign({},I,{plugins:f&&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,T(n.content)}}}}]):C,render:function(){return{popper:A.container}}}));var R=[s].concat(n?[n.type]:[]);return ie((function(){var t=s;s&&s.hasOwnProperty("current")&&(t=s.current);var n=e(t||A.ref||Q(),Object.assign({},O,{plugins:[ae].concat(I.plugins||[])}));return A.instance=n,l&&n.disable(),o&&n.show(),f&&r.hook({instance:n,content:i,props:O,setSingletonContent:T}),g(!0),function(){n.destroy(),null==r||r.cleanup(n)}}),R),ie((function(){var e;if(1!==A.renders){var t=A.instance;t.setProps(ne(t.props,O)),null==(e=t.popperInstance)||e.forceUpdate(),l?t.disable():t.enable(),h&&(o?t.show():t.hide()),f&&r.hook({instance:t,content:i,props:O,setSingletonContent:T})}else A.renders++})),ie((function(){var e;if(a){var t=A.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;v.placement===n.placement&&v.referenceHidden===(null==i?void 0:i.isReferenceHidden)&&v.escaped===(null==i?void 0:i.hasPopperEscaped)||y({placement:n.placement,referenceHidden:null==i?void 0:i.isReferenceHidden,escaped:null==i?void 0:i.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[v.placement,v.referenceHidden,v.escaped].concat(R)),J.createElement(J.Fragment,null,n?(0,J.cloneElement)(n,{ref:function(e){A.ref=e,Z(n.ref,e)}}):null,_&&(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}(v),S,A.instance):i,A.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){Z(i,e),Z(o.ref,e)}}):null)}))};const le=ce(se(K),{render:function(){return""}})},97191:(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,{Op:()=>h,U4:()=>m,kp:()=>s}),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 h(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],h={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,f=s.value,m=s.context,_=u(n),g=e.states[f];if(g.on){var E=a(g.on[_.type]);"*"in g.on&&E.push.apply(E,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.")}(E),y=v.next();!y.done;y=v.next()){var b=y.value;if(void 0===b)return d(f,m);var S="string"==typeof b?{target:b}:b,T=S.target,A=S.actions,I=void 0===A?[]:A,O=S.cond,C=void 0===O?function(){return!0}:O,R=void 0===T,N=null!=T?T:f,P=e.states[N];if(C(m,_)){var L=i(p((R?a(I):[].concat(g.exit,I,P.entry).filter((function(e){return e}))).map((function(e){return c(e,h._options.actions)})),m,_),3),k=L[0],w=L[1],D=L[2],M=null!=T?T:f;return{value:M,context:w,actions:k,changed:T!==f||k.length>0||D,matches:l(M)}}}}catch(e){o={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(o)throw o.error}}}return d(f,m)}};return h}var f=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),f(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,f(t,r),a},stop:function(){return n=o.Stopped,i.clear(),a},get state(){return t},get status(){return n}};return a}},59208: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},44511:(e,t,n)=>{"use strict";n.d(t,{p:()=>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}}},12650:(e,t,n)=>{"use strict";n.d(t,{n:()=>a});var i=n(83422);var o=n(44511);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.p(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}}},80117:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var i,o={};n.r(o),n.d(o,{disable:()=>_,disableAll:()=>v,enable:()=>m,enableAll:()=>E,forTag:()=>y,intercept:()=>p,list:()=>f,remove:()=>b,setLevel:()=>g,unintercept:()=>h}),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"}(i||(i={}));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 h(){s.loggingPredicate=()=>{}}function f(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 _(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 g(e){d=e;let t=l.length;for(;t--;){const n=l[t];n&&n.setLevel(e)}}function E(){let e=l.length;for(;e--;)l[e]&&l[e].enable()}function v(){let e=l.length;for(;e--;)l[e]&&l[e].disable()}function y(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)}},44584:(e,t,n)=>{"use strict";n.r(t),n.d(t,{decode:()=>s,encode:()=>a});n(28360);const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=4096,r=(()=>{const e=[];for(let t=0;t<256;++t)e[t]=255;for(let t=0;t<64;++t)e[i.charCodeAt(t)]=t;return String.fromCharCode(...e)})();let a=function(e){const t=String(e),n=[],o=t.length;let r=0;for(;r>2),i.charAt((3&e)<<4),"==");break}const a=t.charCodeAt(r++);if(r===o){n.push(i.charAt(e>>2),i.charAt((3&e)<<4|(240&a)>>4),i.charAt((15&a)<<2),"=");break}const s=t.charCodeAt(r++);n.push(i.charAt(e>>2),i.charAt((3&e)<<4|(240&a)>>4),i.charAt((15&a)<<2|(192&s)>>6),i.charAt(63&s))}return n.join("")},s=function(e){const t=String(e),n=[],i=t.length;let a,s,c=0;for(;;){do{a=r.charCodeAt(255&t.charCodeAt(c++))}while(255===a&&c>4));do{a=r.charCodeAt(255&t.charCodeAt(c++))}while(255===a&&c>2));do{s=r.charCodeAt(255&t.charCodeAt(c++))}while(255===s&&cwindow.btoa(e),s=e=>window.atob(e))},82620:(e,t,n)=>{"use strict";n.d(t,{X:()=>a});const i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",o={},r={};!function(){for(let e=0,t=62;e{"use strict";n.d(t,{r:()=>o,X:()=>i});const i=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),o=(e,t=i())=>Math.round(Math.abs(t-e))},30353:(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,{u:()=>i})},71774:(e,t,n)=>{"use strict";n.d(t,{m:()=>i});var i={};n.r(i),n.d(i,{disable:()=>_,disableAll:()=>v,enable:()=>m,enableAll:()=>E,forTag:()=>y,intercept:()=>p,list:()=>f,remove:()=>b,setLevel:()=>g,unintercept:()=>h});var o;n(68558);!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(68558);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 h(){s.loggingPredicate=()=>{}}function f(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 _(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 g(e){d=e;let t=l.length;for(;t--;){const n=l[t];n&&n.setLevel(e)}}function E(){let e=l.length;for(;e--;)l[e]&&l[e].enable()}function v(){let e=l.length;for(;e--;)l[e]&&l[e].disable()}function y(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)}},72714:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Base62:()=>i,Base64:()=>o});var i={};n.r(i),n.d(i,{fromBytes:()=>h,fromHex:()=>_,toBytes:()=>f,toHex:()=>m});var o={};n.r(o),n.d(o,{decode:()=>b,encode:()=>y});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[g.charCodeAt(t)]=t;return String.fromCharCode(...e)})();let y=function(e){const t=String(e),n=[],i=t.length;let o=0;for(;o>2),g.charAt((3&e)<<4),"==");break}const r=t.charCodeAt(o++);if(o===i){n.push(g.charAt(e>>2),g.charAt((3&e)<<4|(240&r)>>4),g.charAt((15&r)<<2),"=");break}const a=t.charCodeAt(o++);n.push(g.charAt(e>>2),g.charAt((3&e)<<4|(240&r)>>4),g.charAt((15&r)<<2|(192&a)>>6),g.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=v.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>4));do{o=v.charCodeAt(255&t.charCodeAt(a++))}while(255===o&&a>2));do{r=v.charCodeAt(255&t.charCodeAt(a++))}while(255===r&&awindow.btoa(e),b=e=>window.atob(e))},36858:(e,t,n)=>{"use strict";n.d(t,{Z7:()=>r,nj:()=>l});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"};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))))}}},57128:e=>{"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 E(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return!!e&&"object"==typeof e}function y(e){return f(e)?o(e):a(e)}var b=9007199254740991,S="[object Arguments]",T="[object Function]",A="[object GeneratorFunction]",I=/^(?:0|[1-9]\d*)$/,O=Object.prototype,C=O.hasOwnProperty,R=O.toString,N=O.propertyIsEnumerable,P=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),L=Math.max,k=!N.call({valueOf:1},"valueOf"),w=Array.isArray,D=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={},h="undefined"==typeof Uint8Array?void 0:d(Uint8Array),f={"%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%":h,"%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 f[t]=n,n},_={"%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"]},g=n(10),E=n(49),v=g.call(Function.call,Array.prototype.concat),y=g.call(Function.apply,Array.prototype.splice),b=g.call(Function.call,String.prototype.replace),S=g.call(Function.call,String.prototype.slice),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,I=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,T,(function(e,t,n,i){o[o.length]=n?b(i,A,"$1"):t||e})),o},O=function(e,t){var n,o=e;if(E(_,o)&&(o="%"+(n=_[o])[0]+"%"),E(f,o)){var a=f[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=I(e),o=n.length>0?n[0]:"",a=O("%"+o+"%",t),c=a.name,l=a.value,u=!1,d=a.alias;d&&(o=d[0],y(n,v([0,1],d)));for(var p=1,h=!0;p=n.length){var b=s(l,m);l=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[m]}else h=E(l,m),l=l[m];h&&!u&&(f[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},h=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()},L.prototype._updateStateData=function(){(0,a.default)(this.data,this.getStateData()),this.getPlayheadTime&&(this.data.player_playhead_time=this.getPlayheadTime()),this._sanitizeData()},L.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")}}))},L.prototype._resetVideoData=function(e,t){var n=this;Object.keys(this.data).forEach((function(e){0===e.indexOf("video_")&&delete n.data[e]}))},L.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},L.prototype._resetErrorData=function(e,t){delete this.data.player_error_code,delete this.data.player_error_message},L.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()},L.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))},L.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,h.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.")},L.prototype.removeHLSJS=function(){this.hlsjs&&((0,h.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},L.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,f.monitorDashJS)(this.mux,this.id,e.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},L.prototype.removeDashJS=function(){this.dashjs&&((0,f.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},t.default=L},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 h=s(r),f=h.bytesLoaded,m=h.requestStart,_=h.responseStart,g=h.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:f,request_start:m,request_response_start:_,request_response_end:g,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,h=u.responseStart,f=u.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:d,request_start:p,request_response_start:h,request_response_end:f,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,h=r.responseEnd;l("requestcompleted",{request_event_type:e,request_bytes_loaded:u,request_start:d,request_response_start:p,request_response_end:h,request_type:"manifest",request_hostname:(0,a.extractHostname)(n.url),request_response_headers:c(i)})};n.on(i.Events.AUDIO_TRACK_LOADED,p);var h=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,h);var f=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,f);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 _=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,_),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,h),n.off(i.Events.ERROR,f),n.off(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,m),n.off(i.Events.LEVEL_SWITCHED,_),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),h=void 0;return p.length>0&&(h=(0,r.default)(p[p.length-1]._responseHeaders||"")),{requestStart:c,requestResponseStart:l,requestResponseEnd:u,requestBytesLoaded:s,requestResponseHeaders:h,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,h=d.requestResponseStart,f=d.requestResponseEnd,m=d.requestResponseHeaders,_=d.requestMediaDuration,g=d.requestHostname;r("requestcompleted",{request_event_type:t,request_start:p,request_response_start:h,request_response_end:f,request_bytes_loaded:-1,request_type:a+"_init",request_response_headers:m,request_hostname:g,request_media_duration:_,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,h=d.requestResponseStart,f=d.requestResponseEnd,m=d.requestBytesLoaded,_=d.requestResponseHeaders,g=d.requestMediaDuration,E=d.requestHostname,v=c(u,n),y=v.currentLevel,b=v.renditionWidth,S=v.renditionHeight,T=v.renditionBitrate;r("requestcompleted",{request_event_type:t,request_start:p,request_response_start:h,request_response_end:f,request_bytes_loaded:m,request_type:u,request_response_headers:_,request_hostname:E,request_media_start_time:l,request_media_duration:g,request_current_level:y,request_labeled_bitrate:T,request_video_width:b,request_video_height:S})};n.on("mediaFragmentLoaded",p);var h={video:void 0,audio:void 0,totalBitrate:void 0},f=function(){if(h.video&&"number"==typeof h.video.bitrate){if(!h.video.width||!h.video.height)return void i.warn("have bitrate info for video but missing width/height");var e=h.video.bitrate;return h.audio&&"number"==typeof h.audio.bitrate&&(e+=h.audio.bitrate),e!==h.totalBitrate?(h.totalBitrate=e,{video_source_bitrate:e,video_source_height:h.video.height,video_source_width:h.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);h[a]=s;var c=f();c&&r("renditionchange",c)}}else i.warn("missing evt.newQuality in qualityChangeRendered event",e)};n.on("qualityChangeRendered",m);var _=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",_),n._stopMuxMonitor=function(){n.off("manifestLoaded",l),n.off("initFragmentLoaded",d),n.off("mediaFragmentLoaded",p),n.off("qualityChangeRendered",m),n.off("error",_),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)),h=i(n(1)),f=["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"],_=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,h.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)()};_.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,h.default)(i,this.pageLevelData),(0,h.default)(i,t),(0,h.default)(i,n),(0,h.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.")}},_.prototype.destroy=function(){this.eventQueue.destroy(!1)};var g=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)},E=function(e,t){return"renditionchange"===e&&0===t.indexOf("video_source_")};_.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,h.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]||f.indexOf(o)>-1||g(r,o,a,n.previousBeaconData[o])||E(e,o))&&(i[o]=a,n.previousBeaconData[o]=a)}))}return i},t.default=_},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))T=d;else{var I=Object.keys(S);T=p?I.sort(p):I}for(var O=0;O0?E+g:""}},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),h=o("Map.prototype.set",!0),f=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},_=function(e,t){var n=m(e,t);return n&&n.value},g=function(e,t,n){var i=m(e,t);i?i.value=n:e.next={key:t,next:e.next,value:n}},E=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 _(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 f(t,i)}else if(n)return E(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),h(t,i,o)):(n||(n={key:{},next:null}),g(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($)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 h(e){if(!e||"object"!=typeof e||!J)return!1;try{return J.call(e),!0}catch(e){}return!1}function f(e,t){return ie.call(e,t)}function m(e){return Y.call(e)}function _(e){if(e.name)return e.name;var t=K.call(z.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function g(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 A(e.slice(0,t.maxStringLength),t)+o}return i(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,I),"single",t)}function I(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 O(e){return"Object("+e+")"}function C(e){return e+" { ? }"}function R(e,t,n,i){return e+" ("+t+") {"+(i?L(n,i):n.join(", "))+"}"}function N(e){for(var t=0;t=0)return!1;return!0}function P(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 L(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 A(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===I&&(I=0),I>=H&&H>0&&"object"==typeof t)return r(t)?"[Array]":"[Object]";var G=P(U,I);if(void 0===w)w=[];else if(g(w,t)>=0)return"[Circular]";if("function"==typeof t){var W=_(t),Y=k(t,D);return"[Function"+(W?": "+W:" (anonymous)")+"]"+(Y.length>0?" { "+Y.join(", ")+" }":"")}if(p(t)){var z=$?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(t);return"object"!=typeof t||$?z:O(z)}if(T(t)){for(var K="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],Z=0;Z"}if(r(t)){if(0===t.length)return"[]";var ee=k(t,D);return G&&!N(ee)?"["+L(ee,G)+"]":"[ "+ee.join(", ")+" ]"}if(c(t)){var ie=k(t,D);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(E(t)){var oe=[];return x.call(t,(function(e,n){oe.push(D(n,t,!0)+" => "+D(e,t))})),R("Map",M.call(t),oe,G)}if(b(t)){var re=[];return B.call(t,(function(e){re.push(D(e,t))})),R("Set",F.call(t),re,G)}if(v(t))return C("WeakMap");if(S(t))return C("WeakSet");if(y(t))return C("WeakRef");if(u(t))return O(D(Number(t)));if(h(t))return O(D(J.call(t)));if(d(t))return O(j.call(t));if(l(t))return O(D(String(t)));if(!a(t)&&!s(t)){var ae=k(t,D),se=Q?Q(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+"{"+L(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),h=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(_=r(_)?[_]:_),o.call(l,m)?l[m]=i.combine(l[m],_):l[m]=_}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 h=u/p*8e3;s++,o+=u,r+=p,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,h),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],h=u[2],f=e.log,m=e.utils.getComputedStyle,_=e.utils.secondsToMs,g={automaticErrorTracking:!0};if(!d)return f.error("No element was found with the `"+p+"` query selector.");if("video"!==h&&"audio"!==h)return f.error("The element of `"+p+"` was not a media element.");(n=(0,a.default)(g,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 _(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:_(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:_(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 E=function(){f.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=E,d.mux.swapElement=E,d.mux.emit=E,d.mux.addHLSJS=E,d.mux.addDashJS=E,d.mux.removeHLSJS=E,d.mux.removeDashJS=E,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}])},6367:(e,t,n)=>{"use strict";n.d(t,{ArtistNpv:()=>Ot});var i=n(30758);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(94079);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.A,{in:e,appear:!0,mountOnEnter:!0,unmountOnExit:!0,classNames:o,timeout:r,onEnter:a,onEntered:s,onExit:c,onExited:l},t):null;function h(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(f,{duration:e.duration})),i.createElement("time",{className:"npv-progress-bar__time npv-progress-bar__duration"},l(e.duration)))))}function f({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"})),_=(0,i.memo)(m),g=e=>{var t;return i.createElement(i.Fragment,null,i.createElement(_,{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))},E=({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}`})),v=()=>i.createElement(E,null),y=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)(y),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))},T={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":"無法載入這首歌曲的歌詞。請稍後再試。"}')},A=T.en;let I="en",O=A;const C={},R=e=>{if(e===I)return;const t=e.replace("_","-");O=T[t]||A,I=e},N=(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(I)}catch(t){return e.toString()}})(t[n]):t[n]||O[n]||n,e.replace(`{${n}}`,i)}),e),P=(e,t={})=>{if(!e)return"???";let n=O[e]||A[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"}})(I,parseInt(t.N,10));n[e]?n=n[e]:n.other&&(n=n.other)}return N(n,t)};function L(e){const t=function(e){return e.hasError?{className:"npv-modal__error",component:g,props:{errorDetails:e.errorDetails,l10n:{title:P("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:v}:e.isOffline?{className:"npv-modal__offline",component:S,props:{l10n:{title:P("OFFLINE")}}}:{hidden:!0}}(e),n=null==t?void 0:t.component,o=e.disableAnimationsAndTransitions?0:1e3;return i.createElement(d.A,{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(8143);const w=()=>{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)}},D=({children:e,className:t})=>{const n=(0,i.useRef)(null),o=(0,i.useRef)(null);return((e,t,n)=>{const o=w();(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(D);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(61544);const H=B.NQ,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 W(e){return G.includes(e)}function j(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 W(e)?`CONTEXT_${e.replace(/\-.*/,"").toUpperCase()}`:(console.warn(`Context type not allowed: ${e}`),"")}(i):function(e){if(!e)return"";const t=(0,B.o_)(e);return t?W(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=P("PLAYING_FROM_X",{CONTEXT:P(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 z=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(45603);const K={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 $=i.memo((e=>{const t=(0,i.useRef)(),[n,o]=(0,i.useState)(K),[r,a]=(0,i.useState)({current:e.src}),s=(0,i.useCallback)((()=>{a({previous:t.current,current:e.src}),o(K),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 Z(e){return i.createElement("div",{className:`npv-background-image ${e.showBackgroundImage&&"npv-background-image--active"}`},i.createElement($,{src:e.backgroundImageUrl}),i.createElement("div",{className:"npv-background-image__overlay"}))}function Q(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 he=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"})),fe=(0,i.memo)(he);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(fe,{className:"npv-playback-controls__icon"}))}const _e=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"})),ge=(0,i.memo)(_e);function Ee(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(ge,{className:"npv-playback-controls__icon"}))}function ve(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 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"}),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(ve),Se=i.memo(ye);function Te(e){return!0===e.status?i.createElement(Se,{className:"npv-playback-controls__hifi--on"}):i.createElement(be,{className:"npv-playback-controls__hifi--off"})}function Ae(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(Te,{status:e.playbackHiFiStatus}))}function Ie(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(Ae,{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(Ee,{isPaused:null==e?void 0:e.isPaused}))))}function Oe(e){var t;return null!==(t=e.CustomPlaybackControls)&&void 0!==t?t:i.createElement(Ie,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)))}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 Re=n(66138),Ne=n.n(Re);const Pe={UNKNOWN:"UNKNOWN",UNSYNCED:"UNSYNCED",LINE_SYNCED:"LINE_SYNCED",SYLLABLE_SYNCED:"SYLLABLE_SYNCED"};function Le(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(Pe).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 we=(e,t)=>{var n,i;const[o,r,a]=null!==(i=null===(n=Ne().get(e))||void 0===n?void 0:n.value)&&void 0!==i?i:[0,0,0];return`rgba(${o}, ${r}, ${a}, ${t})`},De=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)>=De||(i.forEach((e=>{r.current[e.index]=e.text.length})),Me(r.current)>=De&&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=Le(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),We=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=we(n,0),a=we(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}))},je=(0,i.memo)(We);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"},P("LYRICS_CREDITS",{PROVIDER:e.lyrics.provider})))}const ze=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(je,{backgroundColor:e.backgroundColor,fullScreen:e.fullScreen}))},Ke=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:Ke}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),h=(0,i.useCallback)((()=>{p(!1)}),[p]),f=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,f),i.createElement(i.Fragment,null,i.createElement("div",{className:"syllable-synced-lyrics__container",onTransitionEnd:h},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(je,{backgroundColor:e.backgroundColor,fullScreen:e.fullScreen}))}function $e(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($,{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 Ze(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"},P("LYRICS_CREDITS",{PROVIDER:e.lyrics.provider})))}function Qe(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(Ze,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(Ze,Object.assign({},e,{lyrics:t}))}const tt=e=>{const t=e.disableAnimationsAndTransitions?et:Qe,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)((()=>Le(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"},P("LYRICS_UNSYNCED")),i.createElement("div",{className:"npv-lyrics__container--unsynced"},i.createElement(t,{duration:e.duration,isPaused:e.isPaused,lyrics:e.lyrics})),i.createElement(je,{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?P(t):"")},ot=e=>{const t=(0,i.useRef)(null);return i.createElement("div",{className:`npv-lyrics ${e.className}`},i.createElement(Q,{backgroundColor:e.backgroundColor,modifier:"noise"}),i.createElement($e,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,P("LYRICS_ERROR_MESSAGE")),e.trackUri&&e.content&&e.content.syncType===Pe.LINE_SYNCED&&i.createElement(ze,{lyrics:e.content,backgroundColor:e.backgroundColor,containerRef:t,onLyricsReport:e.onLyricsReport,trackUri:e.trackUri,fullScreen:e.fullScreen}),e.trackUri&&e.content&&e.content.syncType===Pe.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===Pe.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($,{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 ht,ft,mt=n(57878),_t=n(17988),gt=n(20224);var Et="out-in",vt="in-out",yt=function(e,t,n){return function(){var i;e.props[t]&&(i=e.props)[t].apply(i,arguments),n()}},bt=((ht={})[Et]=function(e){var t=e.current,n=e.changeState;return i.cloneElement(t,{in:!1,onExited:yt(t,"onExited",(function(){n(_t.ns,null)}))})},ht[vt]=function(e){var t=e.current,n=e.changeState,o=e.children;return[t,i.cloneElement(o,{in:!0,onEntered:yt(o,"onEntered",(function(){n(_t.ns)}))})]},ht),St=((ft={})[Et]=function(e){var t=e.children,n=e.changeState;return i.cloneElement(t,{in:!0,onEntered:yt(t,"onEntered",(function(){n(_t._K,i.cloneElement(t,{in:!0}))}))})},ft[vt]=function(e){var t=e.current,n=e.children,o=e.changeState;return[i.cloneElement(t,{in:!1,onExited:yt(t,"onExited",(function(){o(_t._K,i.cloneElement(n,{in:!0}))}))}),i.cloneElement(n,{in:!0})]},ft),Tt=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(At,null,i.createElement(d.A,{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 Ot(e){var t,n;n=e.locale,R(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:P("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:j(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),f=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),_=function(e,t){const n={};return t&&(n.backgroundColor=e.backgroundColor),n}(e,a),g=z(e);return i.createElement("div",{className:g},i.createElement(F,Object.assign({},f),i.createElement(Q,Object.assign({},c)),s?i.createElement(o,Object.assign({},m)):i.createElement(Z,Object.assign({},l)),i.createElement("div",{className:"npv-main-container",style:_},i.createElement(It,{disableAnimationsAndTransitions:e.disableAnimationsAndTransitions,lyricsProps:r,whatIsPlayingProps:d}),i.createElement(U,Object.assign({},u)),i.createElement(h,Object.assign({},p)),i.createElement(Oe,Object.assign({},e))),i.createElement(L,Object.assign({},e))))}Ot.defaultProps={contextMetadataVisible:!0,controlsVisible:!0,trackMetadataVisible:!0,progressBarVisible:!0}},85403:(e,t,n)=>{"use strict";n.d(t,{N:()=>ne});var i,o=n(36601),r=n.n(o),a=n(34521),s=function(){function e(e){this.cosmos=e}return e.prototype.getStopPosition=function(){return this.stopPosition},e.prototype.setMediaDuration=function(e){this.mediaDuration!==e&&(this.mediaDuration=e,this.tryScheduleInterruption())},e.prototype.setTimeObservable=function(e){this.timeObservable!==e&&(this.timeObservable=e,this.tryScheduleInterruption())},e.prototype.registerInterruptorWhenReadyAtPosition=function(e){this.stopPosition!==e&&(this.stopPosition=e,this.tryScheduleInterruption())},e.prototype.unregister=function(){void 0!==this.interruptToken&&void 0!==this.timeObservable&&this.timeObservable.removePositionObserver(this.interruptToken),this.stopPosition=void 0,this.interruptToken=void 0},e.prototype.tryScheduleInterruption=function(){var e=this;if(!(void 0===this.mediaDuration||this.mediaDuration<0||void 0===this.stopPosition||this.stopPosition<0||void 0===this.timeObservable)){var t=this.stopPosition/this.mediaDuration;void 0!==this.interruptToken&&this.timeObservable.removePositionObserver(this.interruptToken),this.interruptToken=this.timeObservable.addObserverForMediaPositions([t],(function(){e.cosmos.post("sp://videoplayer/v1/advance",{reason:"finished"}),e.unregister()}))}},e}(),c=n(15999),l=n(50822),u=n(5681),d=function(){function e(e,t){var n=this;this.productStateService=e,this.scrobbleService=t,this.rules="",this.productStateService.subValues(u.cF.fromPartial({}),(function(e){e.pairs["streaming-rules"]&&(n.rules=e.pairs["streaming-rules"])})),this.scrobbleService.subIncognitoMode(l.lX.fromPartial({}),(function(e){n.incognito=e.incognitoMode}))}return e.prototype.streamingRules=function(){return this.rules},e}(),p=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())}))},h=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&-1===this.perceivedTimeToFirstFrameTimestamp&&(this.perceivedTimeToFirstFrameTimestamp=Math.round(n-this.beginTrackingPerceivedTimeToFirstFrameTimestamp)),[4,this.replaceSessionMessage(t.position,n,i)];case 1:return o.sent(),[2]}}))}))},t.prototype.onPaused=function(t,n,i){return T(this,void 0,void 0,(function(){return A(this,(function(o){switch(o.label){case 0:return e.prototype.onPaused.call(this,t,n,i),[4,this.replaceSessionMessage(t.position,n,i)];case 1:return o.sent(),[2]}}))}))},t.prototype.onResumed=function(t,n,i){return T(this,void 0,void 0,(function(){return A(this,(function(o){switch(o.label){case 0:return e.prototype.onResumed.call(this,t,n,i),[4,this.replaceSessionMessage(t.position,n,i)];case 1:return o.sent(),[2]}}))}))},t.prototype.onPlaybackEnded=function(t,n,i){return T(this,void 0,void 0,(function(){return A(this,(function(o){switch(o.label){case 0:return e.prototype.onPlaybackEnded.call(this,t,n,i),this.endConnectionType=(0,E.Z)(),this.playbackStats=t.playbackStats,this.timeObservable&&this.periodicObserverToken&&this.timeObservable.removePeriodicObserver(this.periodicObserverToken),[4,this.commitSessionMessage()];case 1:return o.sent(),[2]}}))}))},t.prototype.addSessionMessage=function(){return T(this,void 0,void 0,(function(){var e;return A(this,(function(t){switch(t.label){case 0:return this.loggers.usePendingLogger&&this.loggers.pendingLogger?this.loggers.pendingLogger.hasCreatedMessage(this.sessionId)?(this.sendLoggingError("trying to add a new session message when a message has already been created."),[2]):[4,this.loggers.pendingLogger.addPendingEvent(this.generatePlaybackSessionMessage())]:[2];case 1:return(e=t.sent()).success?[2,e]:(this.sendLoggingError("addSessionMessage",e.error),[2])}}))}))},t.prototype.replaceSessionMessage=function(e,t,n){return T(this,void 0,void 0,(function(){var i;return A(this,(function(o){switch(o.label){case 0:return this.loggers.usePendingLogger&&this.loggers.pendingLogger?this.loggers.pendingLogger.hasCreatedMessage(this.sessionId)?[4,this.loggers.pendingLogger.replacePendingEvent(this.generatePlaybackSessionMessage(this.createSyntheticEndEvent(e,t,n)))]:(this.sendLoggingError("trying to update a session message before creating it."),[2]):[2];case 1:return(i=o.sent()).success?[2,i]:(this.sendLoggingError("replaceSessionMessage",i.error),[2])}}))}))},t.prototype.commitSessionMessage=function(){return T(this,void 0,void 0,(function(){var e,t,n;return A(this,(function(i){switch(i.label){case 0:return this.loggers.usePendingLogger?[3,2]:[4,null===(n=this.loggers.logger)||void 0===n?void 0:n.log(this.generatePlaybackSessionMessage())];case 1:return i.sent(),[2];case 2:return this.loggers.pendingLogger?this.loggers.pendingLogger.hasCreatedMessage(this.sessionId)?[4,this.loggers.pendingLogger.replacePendingEvent(this.generatePlaybackSessionMessage())]:(this.sendLoggingError("trying to commit a session message before creating it."),[2]):[2];case 3:return(e=i.sent()).success?[4,this.loggers.pendingLogger.commitPendingEvent(this.sessionId)]:(this.sendLoggingError("replacePendingEvent in commitSessionMessage",e.error),[2]);case 4:return(t=i.sent()).success?[2,t]:(this.sendLoggingError("commitPendingEvent in commitSessionMessage",t.error),[2])}}))}))},t.prototype.logClientMetadata=function(e){var t;if(void 0!==this.playbackMetadataKeys){for(var n={},i=0,o=Object.entries(null!==(t=null==e?void 0:e.metadata)&&void 0!==t?t:{});i0?n:void 0}},t.prototype.generatePlaybackSessionMessage=function(e){var t,n,i,o,r,a,s,l,u=e?I(I([],this.sessionEvents,!0),[e],!1):this.sessionEvents;return S(S({},(0,g.fi)(u)),{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[c.b9])&&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[c.ap])&&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===(l=this.playbackIdentity)||void 0===l?void 0:l.isRoyaltyMedia,client_metadata:this.logClientMetadata(this.playbackIdentity),ms_perceived_time_to_first_frame:this.perceivedTimeToFirstFrameTimestamp,playback_id:this.playbackId})},t.prototype.sendLoggingError=function(e,t){var n,i,o,r,a,s,l;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===(l=null===(s=this.playbackIdentity)||void 0===s?void 0:s.metadata)||void 0===l?void 0:l[c.ap],playback_id:this.playbackId})},t.prototype.createSyntheticEndEvent=function(e,t,n){return{timestamp:t,monotonicTimestamp:n,type:_.Tl.ENDED,data:{reason:_.mT.UNEXPECTED_EXIT,position:e}}},t}(m._),C=n(36867),R=n(42450),N=function(){return N=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0},e.prototype.startStallTimer=function(){var e=this;this.stopStallTimerIfRunning(),this.stallTimeoutId=setTimeout((function(){e.cosmosSender.sendContextPlayerError({type:"playback_stuck"})}),this.stallTimeoutMs)},e.prototype.stopStallTimerIfRunning=function(){void 0!==this.stallTimeoutId&&(clearTimeout(this.stallTimeoutId),this.stallTimeoutId=void 0)},e}(),G=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())}))},W=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]1?this.playerRouter.mainPlayer.setPlaybackSpeed(.9):c<2&&this.playerRouter.mainPlayer.setPlaybackSpeed(c)},e}(),Y=function(e,t){var n=t.delta,i=t.adjustSpeed,o=t.newSpeed,r=void 0===o?0:o;e.innerHTML="d:".concat(z(n),", s: ").concat(i?"t":"f",", speed: ").concat(r),e.style.background=n>200?"pink":i?"yellow":"lightgreen"},z=function(e){return e>1?"↑":e<1?"↓":"-"},K=function(e,t){return 0!==e&&void 0!==e&&(0!==t&&void 0!==t&&Math.abs(J(e,t))>200)},J=function(e,t){return void 0===e&&(e=0),t-1e3*e},q=n(8672),X=function(){return X=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=0&&this.currentStopPosition!==r&&(this.currentStopPosition=r,setTimeout((function(){var e;null===(e=h.playerRouter)||void 0===e||e.seekTo(n,r)}),1e3))),[3,20];case 18:return a=(0,c.jb)(t.config),this.playerRouter.setPreferredSubtitle(a),s=(0,c.nm)(t.config),this.playerRouter.setPlaybackSpeed(s),[3,20];case 19:return[3,20];case 20:return[2,t]}}))}))},e.prototype.shouldPrepareDeferredStart=function(e,t){var n;return"appload"===e.start_reason&&null===(null===(n=this.playerRouter)||void 0===n?void 0:n.getSessionState(t))},e.prototype.shouldPerformDeferredStart=function(e){var t;return void 0!==this.deferredStartPayload&&null===(null===(t=this.playerRouter)||void 0===t?void 0:t.getSessionState(e))},e.prototype.sendPlaybackError=function(e){return $(this,void 0,void 0,(function(){var t;return Z(this,(function(n){switch(n.label){case 0:return(t=this.backendErrorToContextPlayerError(e))?[4,this.sendContextPlayerError(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.sendContextPlayerError=function(e){return this.cosmos.post("".concat(this.cosmosVideoPlayerEndpoint,"/error"),e)},e.prototype.startNewPlayback=function(e){return $(this,void 0,void 0,(function(){var t,n,i,o,r,a,s,l,u,d,p,h,f,m,_,g,E,v,y,b;return Z(this,(function(S){switch(S.label){case 0:if(!this.playerRouter)return[2,Promise.reject("betamaxPlayer was not set")];if(this.deferredStartPayload&&(this.deferredStartPayload=void 0),t=null!==(g=null===(_=null==e?void 0:e.track)||void 0===_?void 0:_.track)&&void 0!==g?g:e,n=null!==(v=null===(E=null==t?void 0:t.metadata)||void 0===E?void 0:E["media.manifest_id"])&&void 0!==v?v:"",i="",!n){try{o=JSON.parse(t.metadata["media.manifest"]),i=(0,c.$x)(o)||""}catch(e){i=""}i||(i=null!==(b=null===(y=null==t?void 0:t.metadata)||void 0===y?void 0:y.external_url)&&void 0!==b?b:"")}return n||i?(a=(0,c.Ms)(t),s=!a,a?[3,2]:[4,this.stopAndUnloadCurrentTrack()]):(r=this.makeVideoContextPlayerCoordinatorError("no-source-url","Cannot find a manifest ID nor a source URL in payload"),[2,Promise.reject(r)]);case 1:S.sent(),S.label=2;case 2:return l=n?this.authTokenCallback:void 0,this.playerConfiguration.networkConfiguration={getAuthorizationHeader:l},(u=(0,c.wR)(e)).desktop_ui="x",d=n?B.DJ.create(n):i,p={mediaUrl:d,isRoyaltyMedia:s,metadata:u},h=(0,c.nm)(e.config),this.playerRouter.setPlaybackSpeed(h),this.currentTrack=e.track,this.stallTimeoutMs=(0,c.Q8)(e),f=(e.seek_to||0)/1e3,m=!e.initially_paused,[2,this.playerRouter.play(p,{playWhenReady:m,initialPosition:f})]}}))}))},e.prototype.getPlaybackRequest=function(){if(this.playerRouter)return this.playerRouter.getPlaybackRequest()},e.prototype.sendAdvance=function(e){var t={reason:e};return this.cosmos.post("".concat(this.cosmosVideoPlayerEndpoint,"/advance"),t)},e.prototype.sendPlaybackState=function(e){var t;if(!e)return Promise.resolve({err:"playbackId is undefined"});var n=null===(t=this.playerRouter)||void 0===t?void 0:t.getSessionState(e);if(!n)return Promise.resolve({err:"no session state for playbackId: '".concat(e,"'")});var i=n.duration>-1?Math.floor(1e3*n.duration):-1;if(-1===i)return Promise.resolve({err:"negDuration"});var 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("".concat(this.cosmosVideoPlayerEndpoint,"/state"),a)},e.prototype.setMinimizeBitrate=function(e){var t;null===(t=this.playerRouter)||void 0===t||t.setMinimizeBitrate(e)},e.prototype.reportSurface=function(e){var t;null===(t=this.playerRouter)||void 0===t||t.setSurface(e)},e.prototype.setFullscreen=function(e){var t;null===(t=this.playerRouter)||void 0===t||t.setFullscreen(e)},e.prototype.setWindow=function(e){var t;null===(t=this.playerRouter)||void 0===t||t.setWindow(e)},e.prototype.setPip=function(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)},e.prototype.pausePlayback=function(e){var t;null===(t=this.playerRouter)||void 0===t||t.pause(e)},e.prototype.isSeekPastStopPosition=function(e){var t=this.playerInterruptor?this.playerInterruptor.getStopPosition():void 0;return void 0!==t&&e>=t},e.prototype.shouldResumeCurrentTrack=function(e,t){return void 0!==t&&(void 0!==this.playerRouter&&this.playerRouter.hasPlaybackId(e.track.playback_id))},e.prototype.resumeCurrentPlayback=function(e,t){return $(this,void 0,void 0,(function(){var n,i,o,r;return Z(this,(function(a){switch(a.label){case 0:return n=t.track.playback_id,[4,null===(r=this.playerRouter)||void 0===r?void 0:r.switchPlayer(n)];case 1:return a.sent(),i=(0,c.nm)(t.config),e.setPlaybackSpeed(i),e.resume(n),void 0!==t.seek_to&&t.seek_to>=0&&(o=t.seek_to/1e3,e.seekTo(n,o)),[2]}}))}))},e.prototype.makeVideoContextPlayerCoordinatorError=function(e,t){var n=new Error(t);return n.name="VideoContextPlayerCoordinatorError",n.reason=e,n},e.prototype.backendErrorToContextPlayerError=function(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===ee.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE?{type:"video_unsupported_key_system"}:e.category===(0,R.eG)(te.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"};var 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"}}},e.prototype.stopAndUnloadCurrentTrack=function(){return $(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return this.playerRouter?!this.currentTrack||this.playerRouter.ended?[3,2]:[4,this.playerRouter.stopAll()]:[2];case 1:e.sent(),e.label=2;case 2:return this.currentTrack=void 0,this.stallTimeoutMs=void 0,[2]}}))}))},e.prototype.logBetamaxPlaybackError=function(e,t,n){return $(this,void 0,void 0,(function(){var i,o,r;return Z(this,(function(a){switch(a.label){case 0:return[4,null===(r=(o=this.configuration).eventSenderProvider)||void 0===r?void 0:r.call(o)];case 1:return(i=a.sent())?[4,i.send((0,q.G)({error_domain:"ContextPlayerCoordinator",error_description:t,error_extra1:JSON.stringify({reason:e,severity:"recoverable"}),error_extra2:JSON.stringify({type:n.type})}))]:[2];case 2:return a.sent(),[2]}}))}))},e}()},15999:(e,t,n)=>{"use strict";n.d(t,{V2:()=>L,ap:()=>y,nU:()=>D,b9:()=>v,kM:()=>E,ki:()=>R,kR:()=>G,wR:()=>M,nm:()=>H,$x:()=>F,Q8:()=>U,jb:()=>B,Ms:()=>W});var i=n(45076),o=n(30131),r=n(21364),a=n(24848),s=n.n(a);function c(){return{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,ms_played_audible:0,playback_id:new Uint8Array(0)}}var l={encode:function(e,t){return void 0===t&&(t=s().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((function(e){var n=e[0],i=e[1];u.encode({key:n,value:i},t.uint32(386).fork()).ldelim()})),Object.entries(e.ms_played_per_surface||{}).forEach((function(e){var n=e[0],i=e[1];d.encode({key:n,value:i},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),void 0!==e.ms_played_audible&&t.uint32(424).int64(e.ms_played_audible),void 0!==e.playback_id&&t.uint32(434).bytes(e.playback_id),t},decode:function(e,t){for(var n=e instanceof s().Reader?e:s().Reader.create(e),i=void 0===t?n.len:n.pos+t,o=c();n.pos>>3){case 1:if(10!==r)break;o.session_id=n.string();continue;case 2:if(18!==r)break;o.feature_identifier=n.string();continue;case 3:if(26!==r)break;o.media_url=n.string();continue;case 4:if(32!==r)break;o.ms_start_position=p(n.int64());continue;case 5:if(40!==r)break;o.start_bitrate=n.int32();continue;case 6:if(48!==r)break;o.ms_duration=p(n.int64());continue;case 7:if(56!==r)break;o.ms_start_time=p(n.int64());continue;case 8:if(64!==r)break;o.ms_manifest_load_time=p(n.int64());continue;case 9:if(72!==r)break;o.ms_encryption_load_time=p(n.int64());continue;case 10:if(80!==r)break;o.ms_initial_buffering=p(n.int64());continue;case 11:if(88!==r)break;o.ms_buffering_seek=p(n.int64());continue;case 12:if(96!==r)break;o.ms_buffering_seek_longest=p(n.int64());continue;case 13:if(104!==r)break;o.ms_buffering_stall=p(n.int64());continue;case 14:if(112!==r)break;o.ms_buffering_stall_longest=p(n.int64());continue;case 15:if(120!==r)break;o.n_stalls=n.int32();continue;case 16:if(128!==r)break;o.n_seekback=n.int32();continue;case 17:if(136!==r)break;o.n_seekforward=n.int32();continue;case 18:if(144!==r)break;o.ms_played=p(n.int64());continue;case 19:if(152!==r)break;o.ms_played_background=p(n.int64());continue;case 20:if(160!==r)break;o.ms_played_fullscreen=p(n.int64());continue;case 21:if(168!==r)break;o.ms_played_subtitles=p(n.int64());continue;case 22:if(178!==r)break;o.connection_type_start=n.string();continue;case 23:if(186!==r)break;o.connection_type_end=n.string();continue;case 24:if(192!==r)break;o.kbps_average_bandwidth=n.int32();continue;case 25:if(202!==r)break;o.encryption_type=n.string();continue;case 26:if(208!==r)break;o.kbytes_played=p(n.int64());continue;case 27:if(216!==r)break;o.kbytes_downloaded=p(n.int64());continue;case 28:if(224!==r)break;o.n_view_transitions=n.int32();continue;case 29:if(232!==r)break;o.n_dropped_frames=p(n.int64());continue;case 30:if(245!==r)break;o.average_device_orientation=n.float();continue;case 31:if(250!==r)break;o.exit_reason=n.string();continue;case 32:if(261!==r)break;o.aspect_ratio=n.float();continue;case 33:if(266!==r)break;o.last_used_subtitle=n.string();continue;case 34:if(272!==r)break;o.ms_played_nominal=p(n.int64());continue;case 35:if(280!==r)break;o.is_royalty_media=n.bool();continue;case 36:if(290!==r)break;o.streaming_type=n.string();continue;case 37:if(298!==r)break;o.desktop_ui=n.string();continue;case 38:if(304!==r)break;o.ms_played_external=p(n.int64());continue;case 39:if(312!==r)break;o.ms_buffering_stutter=p(n.int64());continue;case 40:if(320!==r)break;o.ms_buffering_stutter_longest=p(n.int64());continue;case 41:if(328!==r)break;o.n_stutters=n.int32();continue;case 42:if(336!==r)break;o.n_forced_rebuffer=n.int32();continue;case 43:if(344!==r)break;o.ms_played_video_disabled=p(n.int64());continue;case 44:if(352!==r)break;o.ms_buffering_forced=p(n.int64());continue;case 45:if(360!==r)break;o.ms_buffering_forced_longest=p(n.int64());continue;case 46:if(370!==r)break;o.media_type=n.string();continue;case 47:if(376!==r)break;o.ms_played_internal=p(n.int64());continue;case 48:if(386!==r)break;var a=u.decode(n,n.uint32());void 0!==a.value&&(o.client_metadata[a.key]=a.value);continue;case 49:if(394!==r)break;var l=d.decode(n,n.uint32());void 0!==l.value&&(o.ms_played_per_surface[l.key]=l.value);continue;case 50:if(400!==r)break;o.kbytes_from_cache=p(n.int64());continue;case 51:if(408!==r)break;o.ms_perceived_time_to_first_frame=p(n.int64());continue;case 52:if(416!==r)break;o.did_attempt_to_play=n.bool();continue;case 53:if(424!==r)break;o.ms_played_audible=p(n.int64());continue;case 54:if(434!==r)break;o.playback_id=n.bytes();continue}if(4==(7&r)||0===r)break;n.skipType(7&r)}return o},create:function(e){return l.fromPartial(null!=e?e:{})},fromPartial:function(e){var t,n,i,o,r,a,s,l,u,d,p,h,f,m,_,g,E,v,y,b,S,T,A,I,O,C,R,N,P,L,k,w,D,M,x,U,V,F,B,H,G,W,j,Y,z,K,J,q,X,$,Z,Q,ee,te,ne=c();return ne.session_id=null!==(t=e.session_id)&&void 0!==t?t:"",ne.feature_identifier=null!==(n=e.feature_identifier)&&void 0!==n?n:"",ne.media_url=null!==(i=e.media_url)&&void 0!==i?i:"",ne.ms_start_position=null!==(o=e.ms_start_position)&&void 0!==o?o:0,ne.start_bitrate=null!==(r=e.start_bitrate)&&void 0!==r?r:0,ne.ms_duration=null!==(a=e.ms_duration)&&void 0!==a?a:0,ne.ms_start_time=null!==(s=e.ms_start_time)&&void 0!==s?s:0,ne.ms_manifest_load_time=null!==(l=e.ms_manifest_load_time)&&void 0!==l?l:0,ne.ms_encryption_load_time=null!==(u=e.ms_encryption_load_time)&&void 0!==u?u:0,ne.ms_initial_buffering=null!==(d=e.ms_initial_buffering)&&void 0!==d?d:0,ne.ms_buffering_seek=null!==(p=e.ms_buffering_seek)&&void 0!==p?p:0,ne.ms_buffering_seek_longest=null!==(h=e.ms_buffering_seek_longest)&&void 0!==h?h:0,ne.ms_buffering_stall=null!==(f=e.ms_buffering_stall)&&void 0!==f?f:0,ne.ms_buffering_stall_longest=null!==(m=e.ms_buffering_stall_longest)&&void 0!==m?m:0,ne.n_stalls=null!==(_=e.n_stalls)&&void 0!==_?_:0,ne.n_seekback=null!==(g=e.n_seekback)&&void 0!==g?g:0,ne.n_seekforward=null!==(E=e.n_seekforward)&&void 0!==E?E:0,ne.ms_played=null!==(v=e.ms_played)&&void 0!==v?v:0,ne.ms_played_background=null!==(y=e.ms_played_background)&&void 0!==y?y:0,ne.ms_played_fullscreen=null!==(b=e.ms_played_fullscreen)&&void 0!==b?b:0,ne.ms_played_subtitles=null!==(S=e.ms_played_subtitles)&&void 0!==S?S:0,ne.connection_type_start=null!==(T=e.connection_type_start)&&void 0!==T?T:"",ne.connection_type_end=null!==(A=e.connection_type_end)&&void 0!==A?A:"",ne.kbps_average_bandwidth=null!==(I=e.kbps_average_bandwidth)&&void 0!==I?I:0,ne.encryption_type=null!==(O=e.encryption_type)&&void 0!==O?O:"",ne.kbytes_played=null!==(C=e.kbytes_played)&&void 0!==C?C:0,ne.kbytes_downloaded=null!==(R=e.kbytes_downloaded)&&void 0!==R?R:0,ne.n_view_transitions=null!==(N=e.n_view_transitions)&&void 0!==N?N:0,ne.n_dropped_frames=null!==(P=e.n_dropped_frames)&&void 0!==P?P:0,ne.average_device_orientation=null!==(L=e.average_device_orientation)&&void 0!==L?L:0,ne.exit_reason=null!==(k=e.exit_reason)&&void 0!==k?k:"",ne.aspect_ratio=null!==(w=e.aspect_ratio)&&void 0!==w?w:0,ne.last_used_subtitle=null!==(D=e.last_used_subtitle)&&void 0!==D?D:"",ne.ms_played_nominal=null!==(M=e.ms_played_nominal)&&void 0!==M?M:0,ne.is_royalty_media=null!==(x=e.is_royalty_media)&&void 0!==x&&x,ne.streaming_type=null!==(U=e.streaming_type)&&void 0!==U?U:"",ne.desktop_ui=null!==(V=e.desktop_ui)&&void 0!==V?V:"",ne.ms_played_external=null!==(F=e.ms_played_external)&&void 0!==F?F:0,ne.ms_buffering_stutter=null!==(B=e.ms_buffering_stutter)&&void 0!==B?B:0,ne.ms_buffering_stutter_longest=null!==(H=e.ms_buffering_stutter_longest)&&void 0!==H?H:0,ne.n_stutters=null!==(G=e.n_stutters)&&void 0!==G?G:0,ne.n_forced_rebuffer=null!==(W=e.n_forced_rebuffer)&&void 0!==W?W:0,ne.ms_played_video_disabled=null!==(j=e.ms_played_video_disabled)&&void 0!==j?j:0,ne.ms_buffering_forced=null!==(Y=e.ms_buffering_forced)&&void 0!==Y?Y:0,ne.ms_buffering_forced_longest=null!==(z=e.ms_buffering_forced_longest)&&void 0!==z?z:0,ne.media_type=null!==(K=e.media_type)&&void 0!==K?K:"",ne.ms_played_internal=null!==(J=e.ms_played_internal)&&void 0!==J?J:0,ne.client_metadata=Object.entries(null!==(q=e.client_metadata)&&void 0!==q?q:{}).reduce((function(e,t){var n=t[0],i=t[1];return void 0!==i&&(e[n]=globalThis.String(i)),e}),{}),ne.ms_played_per_surface=Object.entries(null!==(X=e.ms_played_per_surface)&&void 0!==X?X:{}).reduce((function(e,t){var n=t[0],i=t[1];return void 0!==i&&(e[n]=globalThis.Number(i)),e}),{}),ne.kbytes_from_cache=null!==($=e.kbytes_from_cache)&&void 0!==$?$:0,ne.ms_perceived_time_to_first_frame=null!==(Z=e.ms_perceived_time_to_first_frame)&&void 0!==Z?Z:0,ne.did_attempt_to_play=null!==(Q=e.did_attempt_to_play)&&void 0!==Q&&Q,ne.ms_played_audible=null!==(ee=e.ms_played_audible)&&void 0!==ee?ee:0,ne.playback_id=null!==(te=e.playback_id)&&void 0!==te?te:new Uint8Array(0),ne}};var u={encode:function(e,t){return void 0===t&&(t=s().Writer.create()),""!==e.key&&t.uint32(10).string(e.key),""!==e.value&&t.uint32(18).string(e.value),t},decode:function(e,t){for(var n=e instanceof s().Reader?e:s().Reader.create(e),i=void 0===t?n.len:n.pos+t,o={key:"",value:""};n.pos>>3){case 1:if(10!==r)break;o.key=n.string();continue;case 2:if(18!==r)break;o.value=n.string();continue}if(4==(7&r)||0===r)break;n.skipType(7&r)}return o},create:function(e){return u.fromPartial(null!=e?e:{})},fromPartial:function(e){var t,n,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}};var d={encode:function(e,t){return void 0===t&&(t=s().Writer.create()),""!==e.key&&t.uint32(10).string(e.key),0!==e.value&&t.uint32(16).int64(e.value),t},decode:function(e,t){for(var n=e instanceof s().Reader?e:s().Reader.create(e),i=void 0===t?n.len:n.pos+t,o={key:"",value:0};n.pos>>3){case 1:if(10!==r)break;o.key=n.string();continue;case 2:if(16!==r)break;o.value=p(n.int64());continue}if(4==(7&r)||0===r)break;n.skipType(7&r)}return o},create:function(e){return d.fromPartial(null!=e?e:{})},fromPartial:function(e){var t,n,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 p(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(e.lt(globalThis.Number.MIN_SAFE_INTEGER))throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return e.toNumber()}s().util.Long!==r.A&&(s().util.Long=r.A,s().configure());var h=n(8672);var f=function(){return f=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=2&&"spotify"===n[0]&&n[1]?n[1]:void 0;return t&&"track"===i?"music-video":i};function U(e){var t=e.track.track.metadata["video.seconds_before_track_stuck"];if(t){var n=Number(t);return Number.isInteger(n)?1e3*n:void 0}}var V=function(e){return function(t){return function(n){return Object.entries(n).reduce((function(n,i){var o,r=i[0],a=i[1],s=e.includes(r)?"".concat(t).concat(r):r;return f(f({},n),((o={})[s]=a,o))}),{})}}};var F=function(e){if(!Array.isArray(e)||!e.length)return null;var t=["video/webm"],n=e.filter((function(e){return t.indexOf(e.mimeType)>-1})).sort((function(e,t){return Math.abs(e.bitrate-640)-Math.abs(t.bitrate-640)}));return n.length?n[0].url:null};function B(e){var t=e["video.subtitles"],n=e["video.subtitles_cc"];return""===t?i.ib:(0,i.h$)(t,n)}function H(e){return e["audio.episode.speed"]}var G=function(e,t){function n(t){return m(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return[4,n.sent().send(t)];case 2:return[2,n.sent()]}}))}))}var i,o,r;return{playbackSessionPendingLogger:(i=new Map,o=function(e){return{protoName:"BetamaxPlaybackSession",protoData:l.encode(l.fromPartial(e)).finish()}},r=function(e){var t,n,o=e?i.get(e):void 0;return{tokenEventName:null!==(t=null==o?void 0:o.tokenEventName)&&void 0!==t?t:"",tokenSequenceNo:null!==(n=null==o?void 0:o.tokenSequenceNo)&&void 0!==n?n:-1}},{hasCreatedMessage:function(e){return!!e&&i.has(e)},addPendingEvent:function(e){return m(void 0,void 0,void 0,(function(){var n;return _(this,(function(r){switch(r.label){case 0:return[4,t.addPendingEvent(o(e))];case 1:return(n=r.sent()).success&&e.session_id&&i.set(e.session_id,{tokenEventName:n.tokenEventName,tokenSequenceNo:n.tokenSequenceNo}),[2,n]}}))}))},replacePendingEvent:function(e){return t.replacePendingEvent(f(f({},o(e)),r(e.session_id)))},commitPendingEvent:function(e){var n=t.commitPendingEvent(r(e));return e&&i.delete(e),n}}),playbackSessionLogger:{log:function(e){return n({name:"BetamaxPlaybackSession",environments:["device","desktop"],data:e})}},playbackErrorLogger:{log:function(e){return n((0,h.G)(e))}},downloadSessionLogger:{log:function(e){return n({name:"BetamaxDownloadSession",environments:["device","desktop"],data:e})}},downloadErrorLogger:{log:function(e){return n({name:"BetamaxDownloadError",environments:["device","desktop"],data:e})}}}};function W(e){var t;return"true"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.is_advertisement)}},31249:(e,t,n)=>{"use strict";n.d(t,{Y:()=>y});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(72672),s=n(71287),c=n(39894),l=n(34521),u=n(87172),d=n(36601),p=n.n(d),h="betamax-offline",f=function(e){var t,n;return null!==(n=null===(t=e.metadata)||void 0===t?void 0:t.episodeUri)&&void 0!==n?n:""},m=function(e){var t=e.partialAsset,n=function(e){return e.code===p().util.Error.Code.QUOTA_EXCEEDED_ERROR?r.DISK_FULL:r.PERMANENT_ERROR}(e.error),i=f(t);return{id:h,download:{link:i,complete:!1,fileSize:t.size,bytesDownloaded:t.size,error:n},identify:void 0,remove:void 0,stopDownload:void 0}},_=function(e){return"progress"===e.name?(n=(t=e).partialAsset,i=t.progress,o=f(n),a=n.size,s=i>0?Math.round(a/i):-1,{id:h,download:{link:o,complete:!1,fileSize:s,bytesDownloaded:a,error:r.OK},identify:void 0,remove:void 0,stopDownload:void 0}):"completed"===e.name?function(e){var t=e.offlineAsset;return{id:h,download:{link:f(t),complete:!0,fileSize:t.size,bytesDownloaded:t.size,error:r.OK},identify:void 0,remove:void 0,stopDownload:void 0}}(e):"error"===e.name?m(e):void 0;var t,n,i,o,a,s},g=function(){return g=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";function i(e){return{name:"BetamaxPlaybackErrorDevice",environments:["device","desktop"],data:e}}n.d(t,{G:()=>i})},36867:(e,t,n)=>{"use strict";n.d(t,{BN:()=>c,Mw:()=>a,XL:()=>s});var i=n(36601),o=n.n(i),r=n(52588),a=o().polyfill,s=r.version,c=o().Player.version},72672:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var i=n(36601),o=n.n(i),r=n(80083),a=n(42450);var s=function(e,t){return t.filter((function(e){return"variant"===e.type})).sort((function(t,n){var i=Math.abs(e-t.bandwidth);return Math.abs(e-n.bandwidth)-i})).pop()},c=n(34521),l=n(79356),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())}))},d=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";n.d(t,{M:()=>T});var i,o=n(60547),r=n(45076),a=n(65994),s=n(48055),c=n(36601),l=n.n(c),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())}))},d=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=l&&e.width>=u}));this.config.restrictions.maxHeight=Math.min(null!==(o=null==p?void 0:p.height)&&void 0!==o?o:1/0,null!==(r=this.externalMaxHeightRestriction)&&void 0!==r?r:1/0),this.config.restrictions.maxWidth=Math.min(null!==(a=null==p?void 0:p.width)&&void 0!==a?a:1/0,null!==(s=this.externalMaxWidthRestriction)&&void 0!==s?s:1/0),e.prototype.configure.call(this,this.config)}},t}(l().abr.SimpleAbrManager),m=n(94462),_=n.n(m),g=n(36867),E=function(){return E=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";n.d(t,{A:()=>d});var i=n(51930),o=n(48055),r=function(){function e(e){this.factories=e,this.observers=[]}return e.prototype.initiateObservers=function(e,t){this.observers=this.factories.map((function(n){return n(e,t)})).filter((function(e){return!!e}))},e.prototype.removeObservers=function(){this.observers=[]},e.prototype.onPlaybackCreated=function(e){(0,o.u)("betamax::on_playback_created"),this.observers.forEach((function(t){var n;return null===(n=t.onPlaybackCreated)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())})),(0,o.u)("betamax::on_playback_created_end")},e.prototype.onPlaybackEnded=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onPlaybackEnded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())})),this.removeObservers()},e.prototype.onEndingPlayback=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onEndingPlayback)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onVolumeChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onVolumeChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onStarted=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onStarted)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onResumed=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onResumed)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onSeeking=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onSeeking)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onSeeked=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onSeeked)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onPaused=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onPaused)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onReady=function(e){(0,o.u)("betamax::on_ready"),this.observers.forEach((function(t){var n;return null===(n=t.onReady)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onMediaMetadataChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onMediaMetadataChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onManifestLoaded=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onManifestLoaded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onManifestLoading=function(){(0,o.u)("betamax::onManifestLoading"),this.observers.forEach((function(e){var t;return null===(t=e.onManifestLoading)||void 0===t?void 0:t.call(e,Date.now(),performance.now())})),(0,o.u)("betamax::onManifestLoading_end")},e.prototype.onPlaybackError=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onPlaybackError)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onAudioFormatChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onAudioFormatChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onVideoFormatChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onVideoFormatChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onBuffering=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onBuffering)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onDroppedVideoFrames=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onDroppedVideoFrames)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onEncryptionKeyLoaded=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onEncryptionKeyLoaded)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onEncryptionKeyLoading=function(){this.observers.forEach((function(e){var t;return null===(t=e.onEncryptionKeyLoading)||void 0===t?void 0:t.call(e,Date.now(),performance.now())}))},e.prototype.onBytesTransferred=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onBytesTransferred)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onDurationChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onDurationChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onSubtitleChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onSubtitleChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onFullscreenChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onFullscreenChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onPictureInPictureChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onPictureInPictureChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onSurfaceChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onSurfaceChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onMinimizeBitrateChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onMinimizeBitrateChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onPlaybackSpeedChanged=function(e){this.observers.forEach((function(t){var n;return null===(n=t.onPlaybackSpeedChanged)||void 0===n?void 0:n.call(t,e,Date.now(),performance.now())}))},e.prototype.onResumeRequested=function(){this.observers.forEach((function(e){var t;return null===(t=e.onResumeRequested)||void 0===t?void 0:t.call(e,Date.now(),performance.now())}))},e}(),a=n(60547),s=function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n{"use strict";n.d(t,{c:()=>y});var i=n(65994),o=n(36867),r=n(51930),a=function(){function e(){this.tokenCounter=1,this.positionObservers=[],this.absolutePositionObservers=[],this.periodicObservers=[]}return e.prototype.initiateObservers=function(e){for(var t=0,n=this.periodicObservers;t=this.lastProgress&&o.position=this.lastAbsoluteProgress&&o.position<=t&&(o.callback(t,o.position),this.removeAbsolutePositionObserverByReference(o))}this.lastAbsoluteProgress=t}else this.lastAbsoluteProgress=t},e.prototype.processPeriodicObserverEvents=function(e){for(var t=0,n=this.periodicObservers;t0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=o?(this.state.unableToFetchLastSegments=!0,this.state.failedSegmentRetryError=e.error,this.state.bufferType!==i.NZ.SEEK&&this.state.bufferType!==i.NZ.STALL?[3,4]:(t.severity="fatal",[4,this.handlePlaybackError(t,!1)])):[3,5]):[3,7];case 2:return c.sent(),[4,this.stop(i.mT.FATAL_ERROR)];case 3:c.sent(),this.state.unableToFetchLastSegments=!1,c.label=4;case 4:return[3,7];case 5:return[4,this.handlePlaybackError(t)];case 6:c.sent(),c.label=7;case 7:return r=e.error.data,a=this.isSubtitleUri(r[0]),n&&(a||(e.error.severity=p().util.Error.Severity.CRITICAL)),n?[3,10]:(s=this.handlePlaybackError,[4,this.getPlaybackError(e.error)]);case 8:return[4,s.apply(this,[c.sent()])];case 9:c.sent(),c.label=10;case 10:return n&&a&&this.removeSubtitle(),[2]}}))}))},this.handleShakaError=function(e){return g(d,void 0,void 0,(function(){var t;return E(this,(function(n){switch(n.label){case 0:return[4,this.getPlaybackError(e)];case 1:return t=n.sent(),[4,this.handlePlaybackError(t)];case 2:return n.sent(),[2]}}))}))},this.handlePlaybackError=function(e){for(var t=[],n=1;nn&&(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},e.prototype.setPlaybackSpeed=function(e){void 0!==this.videoElement&&e>0&&(this.videoElement.defaultPlaybackRate=e,this.videoElement.playbackRate=e)},e.prototype.attemptInsertVideoElement=function(){this.player.isPictureInPicture()||(this.containerElement?this.appendVideoElement(this.containerElement):this.containerElementClass&&(this.containerElementMutationObserver.observe(this.player.getWindow().document.documentElement,{childList:!0,subtree:!0}),this.checkContainerElementByClass()))},e.prototype.play=function(e,t){return g(this,void 0,void 0,(function(){var n,i=this;return E(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,10]),this.sessionPromise=new Promise((function(n){return n(i.initSession(e,t).then((function(){return i.loadSession()})))})),[4,this.sessionPromise];case 1:return[2,o.sent()];case 2:if(n=o.sent(),this.sessionPromise=void 0,!(0,m.aL)(n)||!this.errorMayRecoverOnReload(n))return[3,9];this.errorMayRecoverOnDrmConfigRemoval(n)&&this.internalPlayer.configure({drm:void 0}),o.label=3;case 3:return o.trys.push([3,5,8,9]),this.state.attemptingErrorRecovery=!0,[4,this.reloadSession()];case 4:return[2,o.sent()];case 5:return o.sent(),n.severity="fatal",[4,this.handlePlaybackError(n,!1)];case 6:return o.sent(),[4,Promise.reject(n)];case 7:return[2,o.sent()];case 8:return this.state.attemptingErrorRecovery=!1,[7];case 9:return[2,Promise.reject(n)];case 10:return[2]}}))}))},e.prototype.setPreferredSubtitle=function(e){if(e.languageTag!==f.ib.languageTag){var t=this.internalPlayer.getTextTracks().map((function(e){return{languageTag:e.language}})),n=(0,f.UC)(e,t);if(void 0!==n){var i=this.getSubtitleLanguageTag();n.languageTag!==i&&this.setSubtitle(n)}else this.removeSubtitle()}else this.removeSubtitle()},e.prototype.newSessionLoaded=function(e){this.state.isEnded||this.internalObserver.onEndingPlayback({playbackRequest:e})},e.prototype.getBandwidthEstimate=function(){var e,t=this.getStats();return null!==(e=null==t?void 0:t.estimatedBandwidth)&&void 0!==e?e:void 0},e.prototype.stop=function(e){return this.unloadSession(e)},e.prototype.emitForPercentages=function(e){this.state.progressPercentages=v([],Array.from(new Set(v(v([],this.state.progressPercentages,!0),e,!0))),!0).sort()},e.prototype.clearEmittedPercentages=function(){this.state.progressPercentages=[]},e.prototype.getPlaybackId=function(e){var t;return(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.endvideo_playback_id)||""},e.prototype.getNode=function(){return this.videoElement},e.prototype.hideNode=function(){this.videoElement.style.display&&(this.storedDisplayStyle=this.videoElement.style.display),this.videoElement.style.display="none"},e.prototype.showNode=function(){this.storedDisplayStyle?this.videoElement.style.display=this.storedDisplayStyle:this.videoElement.style.display="inline"},e.prototype.getPlaybackStats=function(){return this.getStats()},e.prototype.setMinimizeBitrate=function(e){this.state.minimizeBitrate!==e&&(this.state.minimizeBitrate=e,this.internalPlayer&&(e?this.enableMinimizeBitrate():this.disableMinimizeBitrate()))},e.prototype.setFullscreen=function(e){this.state.fullscreen!==e&&(this.state.fullscreen=e,this.internalPlayer&&this.internalObserver.onFullscreenChanged({position:this.getCurrentPosition(),fullscreen:e}))},e.prototype.setSurface=function(e){this.internalObserver.onSurfaceChanged({surface:e,position:this.getCurrentPosition()})},e.prototype.isLive=function(){return this.internalPlayer.isLive()},e.prototype.isPlayableForRequest=function(e){var t,n,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&&!this.internalObserver.observers.some((function(e){return e instanceof r.D})))return{playable:!1,reason:"media is royalty-generating but no royalty-generating observers have been provided"};return{playable:!0}},e.prototype.initSession=function(e,t){return g(this,void 0,void 0,(function(){var n,i,o,r,a,s,l,u,d,p,h,f;return E(this,(function(m){switch(m.label){case 0:return this.session=_(_({sessionId:(0,c.NH)()},e),this.fixupPlaybackOptions(t)),n=this,[4,null===(l=this.offlineManager)||void 0===l?void 0:l.isAssetOffline(e.mediaUrl)];case 1:return n.streamingType=m.sent()?"offline":"on_demand",this.internalObserver.initiateObservers(this.session,this.playbackSessionConfiguration),this.playbackTimeObservable.initiateObservers(this.session.initialPosition),this.internalObserver.onPlaybackCreated({playbackIdentity:_({},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,stopPlayback:this.stop.bind(this)}),null===(u=this.player.getMuxManager())||void 0===u||u.newSession({view_session_id:this.session.sessionId,video_title:null===(d=this.session.metadata)||void 0===d?void 0:d.title,video_series:null===(p=this.session.metadata)||void 0===p?void 0:p.album_title,video_id:null===(h=this.session.metadata)||void 0===h?void 0:h["media.manifest_id"],video_stream_type:this.streamingType,video_source_url:e.mediaUrl,video_content_type:null===(f=this.session.metadata)||void 0===f?void 0:f.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),i=this.isPlayableForRequest(e),o=i.playable,r=i.reason,o?[3,3]:(a={category:"misconfigured-betamax-sdk-error",code:0,severity:"fatal",internalDetails:[null!=r?r:"unknown reason"]},[4,this.handlePlaybackError(a,!1)]);case 2:return m.sent(),[2,Promise.reject(a)];case 3:return s=this,[4,this.getManifestUri(e)];case 4:return s.manifestUri=m.sent(),[2]}}))}))},e.prototype.getManifestUri=function(e){return g(this,void 0,void 0,(function(){var t,n,i;return E(this,(function(o){switch(o.label){case 0:return"offline"!==this.streamingType?[3,2]:[4,null===(n=this.offlineManager)||void 0===n?void 0:n.getPlayableOfflineUrl(e.mediaUrl)];case 1:if(t=o.sent())return[2,t];o.label=2;case 2:return[2,null!==(i=(0,c.eN)(e.mediaUrl,this.playbackSessionConfiguration.mediaExtensions))&&void 0!==i?i:e.mediaUrl]}}))}))},e.prototype.loadSession=function(){return g(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,l,u,d,p,h;return E(this,(function(f){switch(f.label){case 0:return this.attemptInsertVideoElement(),this.videoElement.setAttribute("preload","auto"),this.videoElement.setAttribute("data-sessionId",this.session.sessionId),this.setPlaybackSpeed(null!==(i=this.session.playbackSpeed)&&void 0!==i?i:this.state.playbackSpeed),[4,this.internalPlayer.attach(this.videoElement)];case 1:f.sent(),(null===(r=null===(o=this.playerConfiguration)||void 0===o?void 0:o.adaptiveBitrate)||void 0===r?void 0:r.initialLowBitrate)&&this.internalPlayer.configure({abr:{restrictions:{maxPixels:1}}}),this.session.minimizeBitrate&&this.enableMinimizeBitrate(),e=this.internalPlayer.getNetworkingEngine(),this.configureNetworkingEngine(e),this.startListeningForEvents(),(null===(s=null===(a=this.playerConfiguration)||void 0===a?void 0:a.streaming)||void 0===s?void 0:s.autoplayVideoOnLoad)||(this.videoElement.autoplay=this.session.playWhenReady,this.setPaused(!this.session.playWhenReady)),f.label=2;case 2:return f.trys.push([2,4,,12]),[4,this.internalPlayer.load(this.manifestUri,this.session.initialPosition)];case 3:return f.sent(),[3,12];case 4:return t=f.sent(),(0,m.Pf)(t)?this.state.isEnded?[3,7]:[4,this.getPlaybackError(t)]:[3,8];case 5:return n=f.sent(),[4,this.handlePlaybackError(n)];case 6:return f.sent(),[2,Promise.reject(n)];case 7:return[3,11];case 8:return[4,this.getPlaybackError(t,"unknown-error-while-loading")];case 9:return n=f.sent(),[4,this.handlePlaybackError(n)];case 10:return f.sent(),[2,Promise.reject(n)];case 11:return[3,12];case 12:return(null===(l=null===(c=this.playerConfiguration)||void 0===c?void 0:c.adaptiveBitrate)||void 0===l?void 0:l.initialLowBitrate)&&this.internalPlayer.configure({abr:{restrictions:{maxPixels:void 0}}}),this.state.keySystem=this.internalPlayer.keySystem(),(null===(d=null===(u=this.playerConfiguration)||void 0===u?void 0:u.subtitles)||void 0===d?void 0:d.enabled)&&void 0!==this.session.preferredSubtitle&&this.setPreferredSubtitle(this.session.preferredSubtitle),(null===(h=null===(p=this.playerConfiguration)||void 0===p?void 0:p.streaming)||void 0===h?void 0:h.autoplayVideoOnLoad)&&this.setPaused(!this.session.playWhenReady),this.state.isLoaded=!0,[2,Promise.resolve(this)]}}))}))},e.prototype.unloadSession=function(e){return g(this,arguments,void 0,(function(e,t){var n,o,r,a,s,c;return void 0===t&&(t=!0),E(this,(function(l){switch(l.label){case 0:return this.state.isLoaded?[3,2]:[4,this.sessionPromise];case 1:l.sent(),l.label=2;case 2:t&&(this.state.isEnded||(n=this.getCurrentPosition(),this.emitEndedEvent(i.mT.REQUESTED,n),this.state.isEnded=!0),this.state.endReason=e),this.stopListeningForEvents(),l.label=3;case 3:return l.trys.push([3,5,,9]),[4,this.internalPlayer.detach()];case 4:return l.sent(),[3,9];case 5:return o=l.sent(),(0,m.Pf)(o)?[3,8]:[4,this.getPlaybackError(o,"unknown-error-while-stopping")];case 6:return r=l.sent(),[4,this.handlePlaybackError(r)];case 7:l.sent(),l.label=8;case 8:return[3,9];case 9:return(a=this.internalPlayer.getNetworkingEngine())&&(a.clearAllRequestFilters(),a.clearAllResponseFilters()),this.containerElementMutationObserver.disconnect(),this.player.isPictureInPicture()||((null===(c=null===(s=this.playerConfiguration)||void 0===s?void 0:s.experimental)||void 0===c?void 0:c.showDebugOverlay)&&this.debugOverlay?this.debugOverlay.remove():this.videoElement.remove()),[2]}}))}))},e.prototype.reloadSession=function(){return g(this,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return[4,this.unloadSession(void 0,!1)];case 1:return e.sent(),[2,this.loadSession()]}}))}))},e.prototype.fixupPlaybackOptions=function(e){return e.initialPosition<0&&(e.initialPosition=0),e},e.prototype.validPlaybackId=function(e){return 0!==e.length&&!!(0,c.dY)(e)},e.prototype.configureNetworkingEngine=function(e){this.playerConfiguration.networkConfiguration&&(0,u.L)(e,this.playerConfiguration.networkConfiguration),e&&(e.registerRequestFilter(this.networkRequestFilter),e.registerResponseFilter(this.networkResponseFilter))},e.prototype.startListeningForEvents=function(){var e=this;if(this.videoElementEventHandlers.forEach((function(t){e.videoElement.addEventListener(t.event,t.handler)})),this.internalPlayer){this.shakaPlayerEventHandlers.forEach((function(t){e.internalPlayer.addEventListener(t.event,t.handler)}));var t=this.internalPlayer.getNetworkingEngine();t&&this.networkEngineEventHandlers.forEach((function(e){t.addEventListener(e.event,e.handler)}))}},e.prototype.stopListeningForEvents=function(){var e=this;if(this.videoElementEventHandlers.forEach((function(t){e.videoElement.removeEventListener(t.event,t.handler)})),this.internalPlayer){this.shakaPlayerEventHandlers.forEach((function(t){e.internalPlayer.removeEventListener(t.event,t.handler)}));var t=this.internalPlayer.getNetworkingEngine();t&&this.networkEngineEventHandlers.forEach((function(e){t.removeEventListener(e.event,e.handler)}))}},e.prototype.getInitialState=function(){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:f.ib,minimizeBitrate:!1,fullscreen:!1,bufferType:i.NZ.INITIAL,lastBufferStart:0,timeUpdate:!1,attemptingErrorRecovery:!1,unableToFetchLastSegments:!1,failedSegmentRetryError:void 0}},e.prototype.getCurrentPosition=function(){return this.videoElement.currentTime?this.videoElement.currentTime:this.state.currentTime},e.prototype.isSubtitleUri=function(e){return!!e&&this.subtitleUris.some((function(t){return e.includes(t)}))},e.prototype.emitEndedEvent=function(e,t){var n,i=this.getStats(),o=i?i.droppedFrames:0;o>0&&this.internalObserver.onDroppedVideoFrames({droppedFrames:o});var 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})},e.prototype.calculateProgress=function(e,t){var n=null;return t>0&&e>=0&&(n=e/t,n=Math.min(Math.max(n,0),1)),n},e.prototype.isPositionOutsideBuffer=function(){var e=this.internalPlayer.getBufferedInfo(),t=this.getCurrentPosition();return null!==e&&!(e.start<=t&&e.end>=t)},e.prototype.adjustPositionForBuffer=function(){var e,t=null===(e=this.internalPlayer.getBufferedInfo())||void 0===e?void 0:e.start;t&&(this.videoElement.currentTime=t)},e.prototype.getSupportedMedia=function(e,t){return Object.entries(e).filter((function(e){var n=e[0];return!0===e[1]&&n.startsWith(t)})).map((function(e){return e[0]}))},e.prototype.isFailedSegmentRequest=function(e){var t;return(null===(t=e.error)||void 0===t?void 0:t.category)===p().util.Error.Category.NETWORK},e.prototype.errorWillRecoverAutomatically=function(e){var t;return"NETWORK"===e.category&&"fatal"===e.severity&&this.isSubtitleUri(null===(t=e.network)||void 0===t?void 0:t.uri)},e.prototype.errorMayRecoverOnReload=function(e){return!this.state.attemptingErrorRecovery&&this.errorMayRecoverOnDrmConfigRemoval(e)},e.prototype.errorMayRecoverOnDrmConfigRemoval=function(e){return e.code===p().util.Error.Code.CONTENT_UNSUPPORTED_BY_BROWSER},e.prototype.getPlaybackError=function(e){return g(this,arguments,void 0,(function(e,t,n){var i;return void 0===t&&(t="unknown"),void 0===n&&(n="unknown"),E(this,(function(o){switch(o.label){case 0:return i={category:t,code:0,severity:n},i=(0,m.v4)(e)?this.hydrateErrorWithShakaError(i,e.detail):(0,m.Pf)(e)?this.hydrateErrorWithShakaError(i,e):this.hydrateErrorWithEventInfo(i,e),[4,this.hydrateErrorWithContext(i)];case 1:return[2,i=o.sent()]}}))}))},e.prototype.hydrateErrorWithShakaError=function(e,t){var n,i={category:void 0!==t.category?(0,h.eG)(t.category):"unknown",code:null!==(n=t.code)&&void 0!==n?n:0,severity:(0,h.s7)(t.severity),internalDetails:t.data};if(t.category===p().util.Error.Category.NETWORK&&t.data){var o=t.data;i.network={uri:o[0]},t.code===p().util.Error.Code.BAD_HTTP_STATUS&&(i.network.httpStatus=o[1],i.network.responseText=o[2],i.network.responseHeaders=o[3])}return _(_({},e),i)},e.prototype.hydrateErrorWithEventInfo=function(e,t){var n=void 0;try{n=[JSON.stringify(t)]}catch(e){t instanceof Error&&(n=[t.name,t.message])}return _(_({},e),{internalDetails:n})},e.prototype.hydrateErrorWithContext=function(t){return g(this,void 0,void 0,(function(){var n,i;return E(this,(function(o){switch(o.label){case 0:return[4,e.probeSupport()];case 1:return n=o.sent(),i=n.drm["com.widevine.alpha"],[2,_(_({},t),{sessionContext:{audioFormat:this.state.currentAudioFormat,videoFormat:this.state.currentVideoFormat},clientContext:{browserSupported:e.isBrowserSupported(),widevineSupported:!!i,widevinePersistentLicenseSupported:!!(null==i?void 0:i.persistentState),supportedAudioWebmMedia:this.getSupportedMedia(n.media,"audio/webm"),supportedVideoWebmMedia:this.getSupportedMedia(n.media,"video/webm")}})]}}))}))},e.prototype.getStats=function(){return void 0!==this.internalPlayer&&this.state.isLoaded?this.internalPlayer.getStats():void 0},e.prototype.setPaused=function(e){return e?this.videoElement.pause():this.videoElement.play(),this.state.isPaused=e,this},e.prototype.enableMinimizeBitrate=function(){this.internalPlayer.configure({abr:{restrictions:{maxBandwidth:1}}}),this.internalObserver.onMinimizeBitrateChanged({position:this.getCurrentPosition(),minimizeBitrate:!0})},e.prototype.disableMinimizeBitrate=function(){var e,t,n,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})},e.prototype.triggerQuickVariantChange=function(){var e,t,n;try{var i=this.player.getAbrManager().chooseVariant();if(!i)throw new Error("Recommended variant was not provided by the AbrManager");var 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,h.YY)(i),!0,o)}catch(e){if(e instanceof Error){var r={category:"failed-quick-variant-change",code:0,severity:"recoverable",internalDetails:["".concat(e.name,": ").concat(e.message)]};this.handlePlaybackError(r,!1)}}},e.prototype.getSubtitleLanguageTag=function(){if(this.internalPlayer.isTextTrackVisible()){var e=this.internalPlayer.getTextTracks().find((function(e){return e.active}));return e?e.language:void 0}},e.prototype.setSubtitle=function(e){var 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}})},e.prototype.removeSubtitle=function(){this.setSubtitle(f.ib)},e.prototype.appendVideoElement=function(e){var t;if(null===(t=this.playerConfiguration.experimental)||void 0===t?void 0:t.showDebugOverlay){this.debugOverlay=this.player.getWindow().document.createElement("div");var n=this.player.getWindow().document.createElement("span");this.debugOverlay.style.position="relative",this.debugOverlay.id="video-debug-overlay",this.debugTextSpan=n,this.debugTextSpan.style.position="absolute",this.debugTextSpan.style.bottom="8px",this.debugTextSpan.style.right="8px",this.debugTextSpan.style.color="#ffd11a",this.debugTextSpan.style.fontWeight="bold",this.debugTextSpan.style.fontSize="24pt",this.debugTextSpan.textContent="Video Debug Overlay",this.debugOverlay.appendChild(this.debugTextSpan),this.debugOverlay.appendChild(this.videoElement),e.appendChild(this.debugOverlay)}else e.appendChild(this.videoElement)},e}()},80083:(e,t,n)=>{"use strict";n.d(t,{L:()=>c});var i=n(36601),o=n.n(i),r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";n.d(t,{YY:()=>u,_k:()=>l,du:()=>r,eG:()=>a,s7:()=>s,vZ:()=>c});var i=n(36601),o=n.n(i);function r(e){for(var t=0,n=Object.entries(o().util.Error.Code);t{"use strict";n.d(t,{UC:()=>s,h$:()=>c,ib:()=>o});var i="cc",o={languageTag:""};function r(e){for(var t=[],n=0,i=e.languageTag.split("-");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,{Pf:()=>r,aL:()=>i,v4:()=>o})},71287:(e,t,n)=>{"use strict";n.d(t,{h:()=>l});var i=n(36601),o=n.n(i),r=n(48055),a=n(44584),s=function(){function e(){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=function(){return Promise.resolve()},this.loadData_=function(e){var t=null;if(e instanceof ArrayBuffer){var n=o().util.StringUtils.fromUTF8(e);try{t=JSON.parse(n)}catch(e){var i=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: ".concat(i.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_=function(e){var t=[],n=[];if(e.forEach((function(e){var 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((function(e){return{video:e,audio:null}}));if(!t.length&&n.length)return n.map((function(e){return{video:null,audio:e}}));var i=[];return t.forEach((function(e){n.forEach((function(t){i.push({video:e,audio:t})}))})),i}}return e.prototype.configure=function(e){this.config_=e},e.prototype.start=function(e,t){var n=this;if((0,r.u)("betamax::manifestparser_start"),!this.config_)throw new Error("Must call configure() before start()");var i=o().net.NetworkingEngine.RequestType.MANIFEST,a={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(i,a).promise.then((function(e){return n.loadManifest_(e.data)}))},e.prototype.onExpirationUpdated=function(){},e.prototype.update=function(){},e.prototype.loadManifest_=function(e){var t=this;(0,r.u)("betamax::manifestparser_loadManifestStart"),this.data=this.loadData_(e);var n=new(o().media.PresentationTimeline)(null,0);n.setDuration(this.data.end_time_millis/1e3);var i=this.data.contents[0];this.profileInitSegmentReferences=new Map;var a=this.filterProfiles_(i.profiles),s={presentationTimeline:n,minBufferTime:0,offlineSessionIds:[],variants:this.groupProfiles_(a).map((function(e){return t.loadVariant_(i,e)})),textStreams:this.loadTextStreams_(i),imageStreams:[],sequenceMode:!1,ignoreManifestTimestampsInSegmentsMode:!1,type:"",serviceDescription:{}};return(0,r.u)("betamax::manifestparser_loadManifest_end"),s},e.prototype.filterProfiles_=function(e){var t=this;return e.filter((function(e){return!t.UNSUPPORTED_MIME_TYPES.includes(e.mime_type)}))},e.prototype.loadVariant_=function(e,t){var n=(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"):null,video:t.video?this.loadStream_(e,t.video,"video"):null,bandwidth:n,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[],disabledUntilTime:0}},e.prototype.loadTextStreams_=function(e){var t,n,i=this,o=[];return(null===(n=null===(t=this.data)||void 0===t?void 0:t.subtitle_language_codes)||void 0===n?void 0:n.length)&&(o=this.data.subtitle_language_codes.map((function(e){return{id:i.curId_++,mime_type:"text/vtt",file_type:"vtt",language:e}}))),o.map((function(t){return i.loadStream_(e,t,"text")}))},e.prototype.decodePSSH=function(e){for(var t=(0,a.decode)(e),n=new Uint8Array(t.length),i=0,o=t.length;i0;if(a)for(var s=0,c=e.encryption_infos;s{"use strict";n.d(t,{DJ:()=>o,iy:()=>r,t5:()=>i});var i="spotify-video://",o=function(){function e(){}return e.create=function(e){return"".concat(i).concat(e)},e}();function r(e,t,n){return e.replace(/\{type\}/i,t).replace(/\{source_id\}/i,encodeURIComponent(n))}},4010:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var i=n(65994),o=function(){function e(){this.sessionEvents=[]}return e.prototype.onBuffering=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.BUFFERING})},e.prototype.onEncryptionKeyLoaded=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.ENCRYPTION_KEY_LOADED})},e.prototype.onDurationChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.DURATION_CHANGED})},e.prototype.onManifestLoaded=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.MANIFEST_LOADED})},e.prototype.onPlaybackError=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.ERROR})},e.prototype.onPlaybackCreated=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.CREATED})},e.prototype.onEndingPlayback=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.NEW_SESSION_LOADED})},e.prototype.onPlaybackEnded=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.ENDED})},e.prototype.onMediaMetadataChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.MEDIA_METADATA_CHANGED})},e.prototype.onReady=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.READY})},e.prototype.onStarted=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.STARTED})},e.prototype.onResumed=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.RESUMED})},e.prototype.onPaused=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.PAUSED})},e.prototype.onSeeking=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.SEEKING})},e.prototype.onSeeked=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.SEEKED})},e.prototype.onAudioFormatChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.AUDIO_FORMAT_CHANGED})},e.prototype.onVideoFormatChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.VIDEO_FORMAT_CHANGED})},e.prototype.onVolumeChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.VOLUME_CHANGED})},e.prototype.onManifestLoading=function(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:i.Tl.MANIFEST_LOADING})},e.prototype.onEncryptionKeyLoading=function(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:i.Tl.ENCRYPTION_KEY_LOADING})},e.prototype.onBytesTransferred=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.BYTES_TRANSFERRED})},e.prototype.onSubtitleChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.SUBTITLE_CHANGED})},e.prototype.onFullscreenChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.FULLSCREEN_CHANGED})},e.prototype.onSurfaceChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.SURFACE_CHANGED})},e.prototype.onMinimizeBitrateChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.MINIMIZE_BITRATE_CHANGED})},e.prototype.onPlaybackSpeedChanged=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.PLAYBACK_SPEED_CHANGED})},e.prototype.onDroppedVideoFrames=function(e,t,n){this.sessionEvents.push({timestamp:t,monotonicTimestamp:n,data:e,type:i.Tl.DROPPED_FRAMES})},e.prototype.onResumeRequested=function(e,t){this.sessionEvents.push({timestamp:e,monotonicTimestamp:t,data:void 0,type:i.Tl.RESUME_REQUESTED})},e}()},65994:(e,t,n)=>{"use strict";var i,o,r;n.d(t,{NZ:()=>i,Tl:()=>r,mT:()=>o}),function(e){e.UNINITIALIZED="",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={}))},489:(e,t,n)=>{"use strict";n.d(t,{_T:()=>M,fi:()=>x});var i=n(30131),o=n(65994),r=n(86639),a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0)switch(e.bufferingType){case o.NZ.SEEK:c[i.S.MS_BUFFERING_SEEK]+=s,s>c[i.S.MS_BUFFERING_SEEK_LONGEST]&&(c[i.S.MS_BUFFERING_SEEK_LONGEST]=s);break;case o.NZ.STALL:c[i.S.MS_BUFFERING_STALL]+=s,s>c[i.S.MS_BUFFERING_STALL_LONGEST]&&(c[i.S.MS_BUFFERING_STALL_LONGEST]=s);break;case o.NZ.INITIAL:c[i.S.MS_INITIAL_BUFFERING]+=s}return c}var c=function(e,t,n){return n>0?Math.round((0,r.T8)(t,l(e))/n):0};function l(e){if(e.data){var t=e.data.position;if((0,r.Et)(t))return t;if((0,r.d$)(e)&&(0,r.Et)(e.data.fromPosition))return e.data.fromPosition}return 1/0}var u=function(e,t){return(0,r.$S)(e)?a(a({},t),{playbackSpeed:e.data.speed}):t},d=function(e,t){var n;return(0,r.hX)(e)?a(a({},t),{subtitlesEnabled:!!(null===(n=e.data)||void 0===n?void 0:n.subtitle.languageTag)}):t},p=function(e,t){return(0,r.Y5)(e)?a(a({},t),{fullscreen:e.data.fullscreen}):t},h=function(e,t){return(0,r.sz)(e)?a(a({},t),{surfaceChanged:!0}):t},f=function(e,t){return(0,r.UG)(e)?a(a({},t),{minimizeBitrate:e.data.minimizeBitrate}):t},m=function(e,t){return(0,r.zu)(e)?a(a({},t),{minimizeBitrate:e.data.initialConfiguration.minimizeBitrate}):t},_=function(e,t){return(0,r.zu)(e)?a(a({},t),{fullscreen:e.data.initialConfiguration.fullscreen}):t},g=function(e,t){return(0,r.zu)(e)?a(a({},t),{surface:e.data.initialConfiguration.surface}):t},E=function(e,t){return(0,r.zu)(e)?a(a({},t),{playbackSpeed:e.data.initialConfiguration.playbackSpeed}):t},v=function(e,t){var n=a({},t),i=function(e){var 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=l(e)),"finished"===i&&void 0!==n.playingWithSubtitlesPosition&&(n.msPlayedSubtitles+=c(e,n.playingWithSubtitlesPosition,n.playbackSpeed),n.playingWithSubtitlesPosition=void 0),n},y=function(e,t){var n=a({},t),i=function(e){var 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=l(e)),"finished"===i&&void 0!==n.playingWhileFullscreenPosition&&(n.msPlayedFullscreen+=c(e,n.playingWhileFullscreenPosition,n.playbackSpeed),n.playingWhileFullscreenPosition=void 0),n},b=function(e,t){var n,i,o,s,u,d,p=a({},t),h=function(e){if(e.surfaceChanged)return"changed";var t=e.playing&&e.surface,n=void 0!==e.playingInSurfacePosition;return t&&!n?"started":!t&&n?"finished":t?"on":"off"}(p);return"started"===h&&(p.playingInSurfacePosition=l(e)),"finished"===h&&void 0!==p.playingInSurfacePosition&&p.surface&&(null!==(n=(o=p.msPlayedPerSurface)[s=p.surface])&&void 0!==n||(o[s]=0),p.msPlayedPerSurface[p.surface]+=c(e,p.playingInSurfacePosition,p.playbackSpeed),p.playingInSurfacePosition=void 0),"changed"===h&&(0,r.sz)(e)&&(p.surface&&void 0!==p.playingInSurfacePosition&&(null!==(i=(u=p.msPlayedPerSurface)[d=p.surface])&&void 0!==i||(u[d]=0),p.msPlayedPerSurface[p.surface]+=c(e,p.playingInSurfacePosition,p.playbackSpeed)),p.surface=e.data.surface,p.surfaceChanged=!1,p.playing&&(p.playingInSurfacePosition=l(e))),p},S=function(e,t){var n=a({},t),i=function(e){var 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=l(e)),"finished"===i&&void 0!==n.playingWithMinimizeBitratePosition&&(n.msPlayedDisabled+=c(e,n.playingWithMinimizeBitratePosition,n.playbackSpeed),n.playingWithMinimizeBitratePosition=void 0),n},T=function(e,t){var n=(0,r.T8)(t.playingPosition,l(e)),i=c(e,t.playingPosition,t.playbackSpeed);return a(a({},t),{msNominalPlayed:n+t.msNominalPlayed,msPlayed:i+t.msPlayed,playing:!1,playingPosition:0})},A=function(e,t){t[i.S.SESSION_ID]=e.data.playbackIdentity.sessionId,t[i.S.MEDIA_URL]=e.data.playbackIdentity.mediaUrl},I=function(e,t){t[i.S.MS_START_POSITION]=Math.round(1e3*e.data.position)},O=function(e,t){t[i.S.MEDIA_TYPE]=e.data.mediaType,t[i.S.STREAMING_TYPE]=e.data.streamingType},C=function(e,t){t[i.S.MS_DURATION]=Math.round(1e3*e.data.duration)},R=function(e,t){return(0,r.zu)(e)?a(a({},t),{didAttemptToPlay:e.data.initialConfiguration.playWhenReady}):(0,r.Oh)(e)?a(a({},t),{didAttemptToPlay:!0}):t};var N=function(e,t){t[i.S.N_DROPPED_FRAMES]=e.data.droppedFrames},P=function(e,t){t[i.S.EXIT_REASON]=e.data.reason},L=function(e,t){t[i.S.ASPECT_RATIO]=e.data.format.width&&e.data.format.height?e.data.format.width/e.data.format.height:t[i.S.ASPECT_RATIO],t[i.S.START_BITRATE]=e.data.format.totalBitrate&&!t[i.S.START_BITRATE]?e.data.format.totalBitrate:t[i.S.START_BITRATE]};var k=function(e,t){t[i.S.ENCRYPTION_TYPE]=e.data.encryptionType},w=function(e,t){t[i.S.LAST_USED_SUBTITLE]=e.data.subtitle.languageTag||t[i.S.LAST_USED_SUBTITLE]};var D=function(e,t){var n,o;e.data.fromPosition>e.data.toPosition?t[i.S.N_SEEKBACK]=(null!==(n=t[i.S.N_SEEKBACK])&&void 0!==n?n:0)+1:e.data.fromPosition<=e.data.toPosition&&(t[i.S.N_SEEKFORWARD]=(null!==(o=t[i.S.N_SEEKFORWARD])&&void 0!==o?o:0)+1)};var M=function(){return{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 x(e){var t,n,c=M(),l=((t={})[i.S.ASPECT_RATIO]=0,t[i.S.START_BITRATE]=0,t[i.S.N_SEEKBACK]=0,t[i.S.N_SEEKFORWARD]=0,t[i.S.N_DROPPED_FRAMES]=0,t[i.S.EXIT_REASON]="",t[i.S.ENCRYPTION_TYPE]="",t[i.S.LAST_USED_SUBTITLE]="",t[i.S.SESSION_ID]="",t[i.S.MEDIA_URL]="",t[i.S.MEDIA_TYPE]="unknown",t[i.S.STREAMING_TYPE]="unknown",t[i.S.MS_DURATION]=r.y3,t[i.S.MS_START_POSITION]=r.y3,t[i.S.MS_MANIFEST_LOAD_TIME]=r.y3,t[i.S.MS_ENCRYPTION_LOAD_TIME]=r.y3,t),x=r.y3,U=r.y3,V=r.y3,F=r.y3,B=0,H=0,G={buffering:!1,bufferingType:o.NZ.UNINITIALIZED,bufferingStart:0},W=((n={})[i.S.N_STALLS]=0,n[i.S.MS_BUFFERING_SEEK]=0,n[i.S.MS_BUFFERING_SEEK_LONGEST]=0,n[i.S.MS_BUFFERING_STALL]=0,n[i.S.MS_INITIAL_BUFFERING]=0,n[i.S.MS_BUFFERING_STALL_LONGEST]=0,n);return l=e.reduce((function(e,t){return(0,r.zu)(t)?(x===r.y3&&(x=t.monotonicTimestamp),c=E(t,c),c=_(t,c),c=m(t,c),c=g(t,c),A(t,e)):(0,r.Gc)(t)?(U===r.y3&&(U=t.monotonicTimestamp),I(t,e)):(0,r.Y6)(t)?O(t,e):(0,r.$S)(t)?c=u(t,c):(0,r.hX)(t)?(c=d(t,c),w(t,e)):(0,r.Y5)(t)?c=p(t,c):(0,r.UG)(t)?c=f(t,c):(0,r.sz)(t)?c=h(t,c):(0,r.Es)(t)?(B+=t.data.bytes,H+=t.data.timeMs):(0,r.p0)(t)?C(t,e):(0,r.Xc)(t)?L(t,e):(0,r.ld)(t)?N(t,e):(0,r.WD)(t)?(k(t,e),function(e,t,n){if(t!==r.y3){var o=n[i.S.MS_ENCRYPTION_LOAD_TIME],a=(0,r.Et)(o)&&o!==r.y3?o:0;n[i.S.MS_ENCRYPTION_LOAD_TIME]=a+Math.round(e.monotonicTimestamp-t)}}(t,F,e),F=r.y3):(0,r.RQ)(t)&&U===r.y3?F=t.monotonicTimestamp:(0,r.pI)(t)?(!function(e,t,n){if(t!==r.y3){var o=n[i.S.MS_MANIFEST_LOAD_TIME],a=(0,r.Et)(o)&&o!==r.y3?o:0;n[i.S.MS_MANIFEST_LOAD_TIME]=a+Math.round(e.monotonicTimestamp-t)}}(t,V,e),V=r.y3):(0,r.im)(t)?V=t.monotonicTimestamp:(0,r.d$)(t)?D(t,e):(0,r.v6)(t)&&P(t,e),(0,r.Ko)(c.playing)(t)?c=(0,r.w5)(t,c):(0,r.sF)(c.playing)(t)&&(c=T(t,c)),c=v(t,c),c=y(t,c),c=S(t,c),c=b(t,c),e[i.S.MS_PLAYED]=c.msPlayed,e[i.S.MS_PLAYED_NOMINAL]=c.msNominalPlayed,e[i.S.MS_PLAYED_SUBTITLES]=c.msPlayedSubtitles,e[i.S.MS_PLAYED_FULLSCREEN]=c.msPlayedFullscreen,e[i.S.MS_PLAYED_VIDEO_DISABLED]=c.msPlayedDisabled,e[i.S.MS_PLAYED_PER_SURFACE]=c.msPlayedPerSurface,c=R(t,c),e[i.S.DID_ATTEMPT_TO_PLAY]=c.didAttemptToPlay,W=function(e,t,n){var a=n;return(0,r.F0)(e)&&(e.data.type===o.NZ.STALL&&n[i.S.N_STALLS]++,t.buffering&&(a=s(t,a,e)),t.buffering=!0,t.bufferingType=e.data.type,t.bufferingStart=e.timestamp),((0,r.Gc)(e)||(0,r.v6)(e))&&t.buffering&&(a=s(t,a,e),t.buffering=!1,t.bufferingType=o.NZ.UNINITIALIZED,t.bufferingStart=0),a}(t,G,W),e}),l),l=function(e,t,n){var o=t?e/(t/1e3):0;return n[i.S.KBYTES_DOWNLOADED]=Math.ceil(e/1e3),n[i.S.KBPS_AVERAGE_BANDWIDTH]=Math.ceil(.008*o),n}(B,H,l),l=function(e,t,n){if(e===r.y3||t===r.y3)return n[i.S.MS_START_TIME]=r.y3,n;var o=Math.round(t-e);return o=o>=0?o:r.y3,n[i.S.MS_START_TIME]=o,n}(x,U,l),a(a({},l),W)}},51930:(e,t,n)=>{"use strict";n.d(t,{D:()=>L});var i,o=n(4010),r=n(30131),a=n(65994),s=n(15999),c=n(489),l=n(86639);!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"}(i||(i={}));var u=function(){return u=Object.assign||function(e){for(var t,n=1,i=arguments.length;nt.to?-1:e.tot.from?(e[i-1]={from:o.from,to:t.to},e):o.too.toPosition?u(u({},e),((n={})[r.P.MS_SEEKBACK]=Math.round(e[r.P.MS_SEEKBACK]+1e3*(o.fromPosition-o.toPosition)),n)):o.fromPosition<=o.toPosition?u(u({},e),((i={})[r.P.MS_SEEKFWD]=Math.round(e[r.P.MS_SEEKFWD]+1e3*(o.toPosition-o.fromPosition)),i)):e}),((t={})[r.P.MS_SEEKBACK]=0,t[r.P.MS_SEEKFWD]=0,t))}(e)),function(e){var t=e.filter(l.zu).reduce((function(e,t){var n=t.data;return(0,l._2)(n.playbackIdentity.metadata||{})}),{}),n=t,i=s.ki,o=n[i],a=d(n,["symbol"==typeof i?i:i+""]),c=u({},a);return void 0!==o&&(c[r.P.SHUFFLE]="true"===o),c}(e)),function(e){for(var t,n,i,o,a,c=0,u=e;c0&&(a=Math.round(d.timestamp-o));break}}return null!=a||(a=l.y3),(t={})[r.P.UI_LATENCY]=a,t}(e)),S(e)),function(e){for(var t,n=(0,c._T)(),i=0,o=e;i0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";n.d(t,{C:()=>r,TV:()=>a,uJ:()=>s,xJ:()=>c});var i=n(544),o=n(65994);function r(e){switch(e){case"unknown":default:return i.lV.PLAY_REASON_UNKNOWN;case"appload":return i.lV.PLAY_REASON_APP_LOAD;case"backbtn":return i.lV.PLAY_REASON_BACK_BTN;case"clickrow":return i.lV.PLAY_REASON_CLICK_ROW;case"clickside":return i.lV.PLAY_REASON_CLICK_SIDE;case"endplay":return i.lV.PLAY_REASON_END_PLAY;case"fwdbtn":return i.lV.PLAY_REASON_FWD_BTN;case"interupted":return i.lV.PLAY_REASON_INTERRUPTED;case"logout":return i.lV.PLAY_REASON_LOGOUT;case"playbtn":return i.lV.PLAY_REASON_PLAY_BTN;case"popup":return i.lV.PLAY_REASON_POPUP;case"remote":return i.lV.PLAY_REASON_REMOTE;case"songdone":return i.lV.PLAY_REASON_SONG_DONE;case"trackdone":return i.lV.PLAY_REASON_TRACK_DONE;case"trackerror":return i.lV.PLAY_REASON_TRACK_ERROR;case"preview":return i.lV.PLAY_REASON_PREVIEW;case"uriopen":return i.lV.PLAY_REASON_URI_OPEN;case"backgrounded":return i.lV.PLAY_REASON_BACKGROUNDED;case"offline":return i.lV.PLAY_REASON_OFFLINE;case"unexpected-exit":return i.lV.PLAY_REASON_UNEXPECTED_EXIT;case"unexpected-exit-while-paused":return i.lV.PLAY_REASON_UNEXPECTED_EXIT_WHILE_PAUSED}}function a(e){switch(e){case o.mT.FATAL_ERROR:case o.mT.NETWORK_ERROR:return i.lV.PLAY_REASON_TRACK_ERROR;case o.mT.PLAYED_TO_END:return i.lV.PLAY_REASON_TRACK_DONE;case o.mT.REQUESTED:case o.mT.SHUTDOWN:return i.lV.PLAY_REASON_END_PLAY;default:throw new Error("Unexpectedly hit unreachable code! Unhandled discriminated union member: ".concat(JSON.stringify(e)))}}function s(e){switch(e){case"none":case"":return i.vN.STREAMING_RULE_NONE;case"dmca-radio":return i.vN.STREAMING_RULE_DMCA_RADIO;case"preview":return i.vN.STREAMING_RULE_PREVIEW;case"wifi":return i.vN.STREAMING_RULE_WIFI;case"shuffle-mode":return i.vN.STREAMING_RULE_SHUFFLE_MODE;default:throw new Error("Unrecognized StreamingRule ".concat(e))}}function c(e){if(e.length%2!=0)throw new Error("Invalid encoding!");for(var t=e.length/2,n=new Array(t),i=0,o=0;i{"use strict";n.d(t,{d:()=>g});var i,o=n(544),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())}))},a=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)throw new Error("Cleared ".concat(e," pending tasks after onPlaybackEnded. Once end is received, no additional updates are expected."))}))},this.requestQueue.push(r,this.streamStartedPreRunCheck()),[2]}}))}))},e.prototype.onFullscreenChanged=function(e,t){var n=e.fullscreen,i=e.position;this.fullscreen=n,this.currentPositionMs=Math.round(i*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest(t)},e.prototype.onSurfaceChanged=function(e,t){var n=e.surface,i=e.position;this.videoSurface!==n&&(this.videoSurface=n,this.currentPositionMs=Math.round(i*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest(t))},e.prototype.onMinimizeBitrateChanged=function(e,t){var n=e.minimizeBitrate,i=e.position;this.isVideoDisabled!==n&&(this.isVideoDisabled=n,this.currentPositionMs=Math.round(i*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest(t))},e.prototype.onPlaybackSpeedChanged=function(e,t){var n=e.position,i=e.speed;this.playbackSpeed=i,this.currentPositionMs=Math.round(n*this.SECONDS_TO_MILLISECONDS),this.enqueueStreamProgressRequest(t)},e.prototype.onResumeRequested=function(){this.didAttemptToPlay=!0},e.prototype.queueWaitForIdle=function(){return this.requestQueue.waitForIdle()},e.prototype.addPeriodicObserver=function(){var e=this;void 0===this.periodicEventsObserverToken&&void 0!==this.timeObservable&&(this.periodicEventsObserverToken=this.timeObservable.addObserverForPeriodicEvents(this.PERIODIC_STREAM_REPORTING_INTERVAL_IN_SEC,(function(t){e.seekInProgress||(e.currentPositionMs=Math.round(t*e.SECONDS_TO_MILLISECONDS),e.enqueueStreamProgressRequest(Date.now()))})))},e.prototype.removePeriodicObserver=function(){void 0!==this.periodicEventsObserverToken&&void 0!==this.timeObservable&&(this.timeObservable.removePeriodicObserver(this.periodicEventsObserverToken),this.periodicEventsObserverToken=void 0)},e.prototype.sendPlaybackError=function(e,t,n){var i,o,r,a,s,u;null===(i=this.eventSender)||void 0===i||i.send((0,l.G)({feature_identifier:null===(r=null===(o=this.playbackIdentity)||void 0===o?void 0:o.metadata)||void 0===r?void 0:r.feature_identifier,media_url:null===(a=this.metadata)||void 0===a?void 0:a.endvideo_play_track,session_id:null===(s=this.playbackIdentity)||void 0===s?void 0:s.sessionId,error_domain:"StreamReportingTracker",error_code:t,error_description:e,error_extra1:JSON.stringify({reason:n,severity:"recoverable"}),desktop_ui:null===(u=this.metadata)||void 0===u?void 0:u.desktop_ui,playback_id:this.playbackId?(0,c.xJ)(this.playbackId):void 0}))},e.prototype.handleStatusResponse=function(e,t){if(e.statusCode!==o.su.SUCCESS)throw new m("Error returned from StreamReportingService.".concat(t),e.statusCode)},e.prototype.handleFailure=function(e){return h(this,void 0,void 0,(function(){var t;return f(this,(function(n){switch(n.label){case 0:return this.requestQueue.clearPendingQueue(),e instanceof m?this.sendPlaybackError(e.reason,e.responseStatusCode,e.responseReason):e instanceof Error?this.sendPlaybackError(e.message):this.sendPlaybackError(e),this.failPlaybackOnError?[4,null===(t=this.stopPlayback)||void 0===t?void 0:t.call(this,d.mT.FATAL_ERROR)]:[3,4];case 1:return n.sent(),this.contextCoordinator&&this.playbackId?(this.contextCoordinator.pausePlayback(this.playbackId),[4,this.contextCoordinator.sendPlaybackState(this.playbackId)]):[3,4];case 2:return n.sent(),[4,this.contextCoordinator.sendContextPlayerError({type:"playback_reporting_error"})];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},e.prototype.streamStartedPreRunCheck=function(){var e=this;return function(){return!!e.streamHandle}},e.prototype.enqueueStreamStartRequest=function(e){var t,n,i=this;if(!this.playbackIdentity)throw new Error("PlaybackIdentity not found on started event");if(!this.metadata)throw new Error("Metadata not found on started event");var r=o.yK.fromPartial({playbackId:this.playbackId?(0,c.xJ)(this.playbackId):void 0,playbackStack:o.iw.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:(0,c.uJ)(this.productStateProvider.streamingRules()),connectControllerDeviceId:this.metadata.endvideo_gaia_dev_id,pageInstanceId:this.metadata.page_instance_id,interactionId:this.metadata.interaction_id,reasonStart:(0,c.C)(this.metadata.endvideo_reason_start),isShuffle:"true"===this.metadata.endvideo_shuffle,clientOffline:"true"===this.metadata.endvideo_client_offline,mediaId:null===(t=this.metadata)||void 0===t?void 0:t["media.manifest_id"],mediaType:o.zu.VIDEO,playbackStartTime:BigInt(e),startPosition:BigInt(this.currentPositionMs),isLive:"live"===this.streamingType,contentIsDownloaded:"offline"===this.streamingType,featureUuid:null===(n=this.metadata)||void 0===n?void 0:n[u.P.FEATURE_UUID],clientTimestamp:new Date(e),playContextDecisionId:this.metadata.endvideo_play_context_decision_id,decisionId:this.metadata.endvideo_decision_id,isVideoOn:!this.isVideoDisabled,videoSurface:this.videoSurface});return this.requestQueue.push((function(){return i.streamReportingServiceClient.streamStart(r).then((function(e){var t,n;if((null===(t=e.status)||void 0===t?void 0:t.statusCode)!==o.su.SUCCESS)throw new m("Error returned from StreamReportingService.StreamStart",null===(n=e.status)||void 0===n?void 0:n.statusCode);i.streamHandle=e.streamHandle})).catch((function(e){return i.handleFailure(e)}))}),(function(){return!i.streamHandle}))},e.prototype.enqueueStreamProgressRequest=function(e,t){var n=this;void 0===t&&(t=!1);var i=o.pB.fromPartial({currentPosition:BigInt(this.currentPositionMs),isPaused:this.paused,isPlayingVideo:!this.isVideoDisabled,videoSurface:this.videoSurface,isFullscreen:this.fullscreen,playbackSpeed:this.playbackSpeed,playbackState:this.paused?o.di.PAUSED:o.di.ACTIVE,clientTimestamp:new Date(e)}),r=function(){return n.streamHandleTask(i).then((function(e){return n.streamReportingServiceClient.streamProgress(e)})).then((function(e){return n.handleStatusResponse(e,"StreamProgress")})).catch((function(e){return n.handleFailure(e)}))};t?this.requestQueue.unshift(r,this.streamStartedPreRunCheck()):this.requestQueue.push(r,this.streamStartedPreRunCheck())},e}(),g=function(e,t,n,i,r){return function(a){return a.isRoyaltyMedia?new _(new o.FZ(e),t,n,i,r):null}}},30131:(e,t,n)=>{"use strict";var i,o;n.d(t,{P:()=>o,S:()=>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={}))},86639:(e,t,n)=>{"use strict";n.d(t,{$S:()=>C,Ai:()=>U,Es:()=>L,Et:()=>s,F0:()=>h,Gc:()=>E,IO:()=>y,Ig:()=>m,Ko:()=>x,Oh:()=>D,RQ:()=>k,Rf:()=>M,T8:()=>H,UG:()=>P,WD:()=>S,Xc:()=>b,Y5:()=>R,Y6:()=>w,_2:()=>c,c6:()=>V,d$:()=>O,hX:()=>T,im:()=>I,ld:()=>f,p0:()=>v,pI:()=>A,sF:()=>F,sz:()=>N,v6:()=>p,w5:()=>B,y3:()=>a,zu:()=>g});var i=n(65994),o=n(15999),r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n{"use strict";n.d(t,{Z:()=>i});var i=function(){var e;if(navigator.onLine){var t=null===(e=navigator.connection)||void 0===e?void 0:e.effectiveType;return t?"".concat(t,"-like"):"online"}return"none"}},34521:(e,t,n)=>{"use strict";n.d(t,{Ee:()=>f,eN:()=>p,NH:()=>d,dY:()=>h});const i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var o,r=new Uint8Array(16);function a(){if(!o&&!(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(r)}for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).slice(1));function l(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]]).toLowerCase()}const u=function(e,t,n){if(i.randomUUID&&!t&&!e)return i.randomUUID();var 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(var r=0;r<16;++r)t[n+r]=o[r];return t}return l(o)};var d=function(){return u().replace(new RegExp("-","g"),"")};function p(e,t){var n;return null===(n=null==t?void 0:t.find((function(t){return t.isPlayable(e)})))||void 0===n?void 0:n.getMediaUrl(e)}function h(e){return/^[A-Za-z0-9]*$/.test(e)}var f=function(){}},48055:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});var i=function(e){(null===performance||void 0===performance?void 0:performance.mark)&&(null===performance||void 0===performance||performance.mark(e))}},80521:(e,t,n)=>{"use strict";n.d(t,{Vk:()=>i,bk:()=>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(45603);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}}},87783:(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}}},70710:(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}}},21046:(e,t)=>{"use strict";t.Y=void 0,t.Y=function(e){return{name:"ConfigurationApplied",environments:["device","browser"],data:e}}},90061:(e,t)=>{"use strict";t.b=void 0,t.b=function(e){return{name:"ConfigurationAppliedNonAuth",environments:["devicenonauth","browsernonauth"],data:e}}},37167:(e,t)=>{"use strict";t.P=void 0,t.P=function(e){return{name:"DefaultConfigurationApplied",environments:["device","browser"],data:e}}},16526:(e,t)=>{"use strict";t.m=void 0,t.m=function(e){return{name:"DefaultConfigurationAppliedNonAuth",environments:["devicenonauth","browsernonauth"],data:e}}},48431:(e,t)=>{"use strict";t.w=void 0,t.w=function(e){return{name:"SptCookieConsentClientNonAuth",environments:["browsernonauth"],data:e}}},23892:(e,t)=>{"use strict";t.I=void 0,t.I=function(e){return{name:"EventSenderStats2NonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},39907:(e,t)=>{"use strict";t.R=void 0,t.R=function(e){return{name:"RejectedClientEventNonAuth",environments:["browsernonauth","desktopnonauth","devicenonauth"],data:e}}},17744:(e,t)=>{"use strict";t.I=void 0,t.I=function(e){return{name:"UbiExpr2PageView",environments:["device","browser","desktop"],data:e}}},25848:(e,t)=>{"use strict";t.m=void 0,t.m=function(e){return{name:"UbiProd1Impression",environments:["device","browser","desktop"],data:e}}},6583:(e,t)=>{"use strict";t.J=void 0,t.J=function(e){return{name:"UbiProd1ImpressionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},47233:(e,t)=>{"use strict";t.l=void 0,t.l=function(e){return{name:"UbiProd1Interaction",environments:["device","browser","desktop"],data:e}}},26272:(e,t)=>{"use strict";t.y=void 0,t.y=function(e){return{name:"UbiProd1InteractionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},4820:(e,t)=>{"use strict";t.m=void 0,t.m=function(e){return{name:"UbiProd1PageTransitionNonAuth",environments:["devicenonauth","browsernonauth","desktopnonauth"],data:e}}},37574:(e,t)=>{"use strict";t._=void 0,t._=function(e){return{name:"WwwExperiments",environments:["browser"],data:e}}},86205:(e,t)=>{"use strict";t.r=void 0,t.r=function(e){return{name:"WwwExperimentsNonAuth",environments:["browsernonauth"],data:e}}},66210:(e,t,n)=>{"use strict";function i(e){return{name:"AdDSAEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{m:()=>i})},34330:(e,t,n)=>{"use strict";function i(e){return{name:"AdError",environments:["device"],data:e}}n.d(t,{G:()=>i})},64388:(e,t,n)=>{"use strict";function i(e){return{name:"AdEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{A:()=>i})},96705:(e,t,n)=>{"use strict";function i(e){return{name:"AdFeedbackEvent",environments:["device"],data:e}}n.d(t,{F:()=>i})},3894:(e,t,n)=>{"use strict";function i(e){return{name:"AdInStreamUBILinkerEvent",environments:["device"],data:e}}n.d(t,{A:()=>i})},76160:(e,t,n)=>{"use strict";function i(e){return{name:"AdViewContext",environments:["browser","device","desktop"],data:e}}n.d(t,{y:()=>i})},14115:(e,t,n)=>{"use strict";function i(e){return{name:"CastTransfer",environments:["device","browser"],data:e}}n.d(t,{F:()=>i})},51559:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableExtendedCredit",environments:["browser"],data:e}}n.d(t,{L:()=>i})},67209:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableTrackCredit",environments:["browser","device","desktop"],data:e}}n.d(t,{d:()=>i})},63992:(e,t,n)=>{"use strict";function i(e){return{name:"ClickableTrackCreditNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{_:()=>i})},28490:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationCompleted",environments:["browser","desktop"],data:e}}n.d(t,{Y:()=>i})},56413:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationPresented",environments:["browser","desktop"],data:e}}n.d(t,{n:()=>i})},20959:(e,t,n)=>{"use strict";function i(e){return{name:"ClientVerificationRequestFailed",environments:["browser","desktop"],data:e}}n.d(t,{D:()=>i})},45172:(e,t,n)=>{"use strict";function i(e){return{name:"ClientWebLoad",environments:["browser","desktop"],data:e}}n.d(t,{u:()=>i})},24969:(e,t,n)=>{"use strict";function i(e){return{name:"ConnectDevicePickerClosed",environments:["device","desktop","browser"],data:e}}n.d(t,{f:()=>i})},6193:(e,t,n)=>{"use strict";function i(e){return{name:"DeeplinkOpen",environments:["browser","device"],data:e}}n.d(t,{N:()=>i})},47728:(e,t,n)=>{"use strict";function i(e){return{name:"DeeplinkOpenNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{W:()=>i})},98971:(e,t,n)=>{"use strict";function i(e){return{name:"KmInteraction",environments:["browser"],data:e}}n.d(t,{x:()=>i})},48746:(e,t,n)=>{"use strict";function i(e){return{name:"KmInteractionNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{o:()=>i})},48253:(e,t,n)=>{"use strict";function i(e){return{name:"KmPageView",environments:["browser"],data:e}}n.d(t,{x:()=>i})},62988:(e,t,n)=>{"use strict";function i(e){return{name:"KmPageViewNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{s:()=>i})},55773:(e,t,n)=>{"use strict";function i(e){return{name:"LeavebehindAdEvent",environments:["browser","device","desktop"],data:e}}n.d(t,{x:()=>i})},15212:(e,t,n)=>{"use strict";function i(e){return{name:"MinimumLyricsCharactersSeen",environments:["device","desktop","browser"],data:e}}n.d(t,{W:()=>i})},58009:(e,t,n)=>{"use strict";function i(e){return{name:"PuffinFiltersUsage",environments:["device","desktop"],data:e}}n.d(t,{v:()=>i})},12419:(e,t,n)=>{"use strict";function i(e){return{name:"PuffinHeadphonesOptimized",environments:["device"],data:e}}n.d(t,{d:()=>i})},75301:(e,t,n)=>{"use strict";function i(e){return{name:"ScrollTrackCredits",environments:["browser","desktop","device"],data:e}}n.d(t,{h:()=>i})},31652:(e,t,n)=>{"use strict";function i(e){return{name:"ScrollTrackCreditsNonAuth",environments:["browsernonauth","devicenonauth"],data:e}}n.d(t,{s:()=>i})},85808:(e,t,n)=>{"use strict";function i(e){return{name:"Share",environments:["browser","device"],data:e}}n.d(t,{c:()=>i})},23771:(e,t,n)=>{"use strict";function i(e){return{name:"SocialConnectSessionJoinResult",environments:["device"],data:e}}n.d(t,{X:()=>i})},72224:(e,t,n)=>{"use strict";function i(e){return{name:"SocialListeningClientSessionCreated",environments:["device"],data:e}}n.d(t,{q:()=>i})},23816:(e,t,n)=>{"use strict";function i(e){return{name:"SocialListeningClientSessionEnded",environments:["device"],data:e}}n.d(t,{c:()=>i})},66790:(e,t,n)=>{"use strict";function i(e){return{name:"WindowSize",environments:["desktop","browser"],data:e}}n.d(t,{_:()=>i})},50586:(e,t,n)=>{"use strict";function i(e){return{name:"WwwAnalytics",environments:["browser"],data:e}}n.d(t,{Q:()=>i})},24209:(e,t,n)=>{"use strict";function i(e){return{name:"WwwAnalyticsNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{Z:()=>i})},20842:(e,t,n)=>{"use strict";function i(e){return{name:"WwwExperiments",environments:["browser"],data:e}}n.d(t,{_:()=>i})},40353:(e,t,n)=>{"use strict";function i(e){return{name:"WwwExperimentsNonAuth",environments:["browsernonauth"],data:e}}n.d(t,{r:()=>i})},60269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBase64=void 0;var i=n(72714);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)}},93284:(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}}}},24694:(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}}}},67785:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCacheIdContext=void 0;var i=n(60269);t.createCacheIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_cache_id",data:{value:t}}}}},35294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClientIdContext=void 0;var i=n(60269);t.createClientIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_client_id",data:{value:t}}}}},23554:(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}}}}},56271:(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}}}}},26926:(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}}}},26408:(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}}}},97886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(83422);i.__exportStar(n(93284),t),i.__exportStar(n(24694),t),i.__exportStar(n(67785),t),i.__exportStar(n(35294),t),i.__exportStar(n(23554),t),i.__exportStar(n(56271),t),i.__exportStar(n(26926),t),i.__exportStar(n(26408),t),i.__exportStar(n(20677),t),i.__exportStar(n(32162),t),i.__exportStar(n(83078),t)},20677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInstallationIdContext=void 0;var i=n(60269);t.createInstallationIdContext=function(e){var t=i.hexToBase64(e);return function(){return{name:"context_installation_id",data:{value:t}}}}},32162:(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}}}},83078:(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}}}}},83087:(e,t,n)=>{"use strict";var i;n.r(t),n.d(t,{Environment:()=>i,EventSenderEvent:()=>o,createEventSender:()=>I}),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={}));var o,r=n(83422),a=n(74987),s=n(71774),c=n(80521);!function(e){e.UPLOAD_SUCCEEDED="upload_succeeded",e.UPLOAD_FAILED="upload_failed",e.UPLOAD_REQUEST_FAILED="upload_request_failed"}(o||(o={}));const l=s.m.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.bk{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}),f>0&&this.emit(o.UPLOAD_SUCCEEDED,{authorize:this._authorize,num_events:f}),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)}var h,f=n(12650),m=n(39907);!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"}(h||(h={}));const _="4.0.3";var g=n(23892);class E{static pushToArrIfMissing(e,t){-1===e.indexOf(t)&&e.push(t)}static isMissingFromArray(e,t){return-1===e.indexOf(t)}}class v{_addEventsToEventSenderStatsData(e,t){Object.keys(t).map((n=>{for(let i=0;i{if(E.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])=>{E.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 f.n.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()?(A.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?h.PAYLOAD_SIZE_LIMIT_EXCEEDED:t&&n&&!n()?h.UNKNOWN_OWNER:null:h.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===h.UNKNOWN_OWNER&&(A.consoleLogger.warn(`Trying to send an authenticated event without a current owner: ${e.name}`),i=null),i){const t=(0,m.R)({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 I(e){const t={suppressPersist:e.suppressPersist,transport:e.transport};return new A(Object.assign(Object.assign({},e),{uploaders:{authorized:p(t),unauthorized:p(Object.assign(Object.assign({},t),{authorize:!1}))}}))}A.consoleLogger=s.m.forTag("EventSender")},55462:(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,{Ow:()=>i,QI:()=>o,ks:()=>s,p4:()=>c,es:()=>l,xB:()=>u,ws:()=>d});var r=n(21913);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}})}},43433:(e,t,n)=>{"use strict";n.d(t,{ky:()=>r,aN:()=>b,ty:()=>O,QI:()=>o.QI,ks:()=>o.ks,es:()=>o.es,kE:()=>oe,xB:()=>o.xB});var i,o=n(55462);!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={}));var r,a=n(83422),s=n(74987),c=n(71774),l=n(80521);!function(e){e.UPLOAD_SUCCEEDED="upload_succeeded",e.UPLOAD_FAILED="upload_failed",e.UPLOAD_REQUEST_FAILED="upload_request_failed"}(r||(r={}));const u=c.m.forTag("Uploader");class d extends l.bk{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=[],h=[],f=[],m=[],_=[],g=s.errors;g&&g.length&&(u.info("response errors",o,g),g.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?(f.push(s),m.push(c)):(h.push(s),_.push(c))})));const E=o.filter((e=>!p.includes(e)));this._backoff=!("true"!==(null==c?void 0:c.get("Spotify-Back-Off")));const v=h.length+f.length,y=E.length;v>0&&this.emit(r.UPLOAD_FAILED,{authorize:d,rejected:_,will_retry:m}),y>0&&this.emit(r.UPLOAD_SUCCEEDED,{authorize:this._authorize,num_events:y});const b=[...E,...h];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)}var h,f,m,_,g=n(39907),E=n(12650);!function(e){e.JS_SDK_MULTI_ENV_TEST="JSSDKMultiEnvTest",e.JS_SDK_MULTI_ENV_TEST_NON_AUTH="JSSDKMultiEnvTestNonAuth"}(h||(h={})),function(e){e.AUTHORIZED="authorized",e.UNAUTHORIZED="unauthorized"}(f||(f={})),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"}(_||(_={}));const v="5.0.2";function y(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(21913);class T{static pushToArrIfMissing(e,t){-1===e.indexOf(t)&&e.push(t)}static isMissingFromArray(e,t){return-1===e.indexOf(t)}}class A{constructor(e){this.installationId=e}getIdHash(e){const t=(e=>{let t=0;for(let n=0;ne+t)),P="|";var L,k,w,D;function M(e){return e.split(P)}function x(e,t){return M(e)[t]}function U(...e){return e.join(P)}!function(e){e.EVENTS="EVENT",e.SEQ_NUM="SEQ_NUM",e.GLOBAL_SEQ_NUM="GLOBAL_SEQ_NUM",e.DROPPED_EVENT="DROPPED_EVENT"}(L||(L={})),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"}(w||(w={})),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={}));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)}${P}`,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)[D.ITEM_GROUP_ID]===L.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 I,flushStrategy:{kind:b.SCHEDULED,interval:e.flushIntervalMs||1e4},maxCapacityForDroppedInPercentage:n},o={adapter:new O,flushStrategy:{kind:b.IMMEDIATE}};switch(R(N)){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 I?H.LOCAL_STORAGE:this.storageAdapter instanceof O?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 W{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(L.SEQ_NUM,t,e);return this.generateNextSequenceNumber(n)}generateNextGlobalSequenceNumber(){const e=U(L.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[w.ITEM_GROUP_ID]===L.SEQ_NUM&&n[w.SEQ_ID]===t})(t,e)));return n.forEach((e=>{const n=this.storageManager.getItem(e),i=x(e,w.EVENT_NAME);n&&(t[i]=Number(n))})),t}getSequenceNumbersPerSequenceId(e){const t={};return e.forEach((e=>{t[e]=this.getEventsSequenceNumbers(e)})),t}}var j=n(23892);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,j.I)(r)}}class z{constructor(e){this.storageManager=e.storageManager}updateDroppedEventCount(e,t){const n=U(L.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[D.ITEM_GROUP_ID]===L.DROPPED_EVENT&&n[D.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,D.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(L.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 K=n(20889);const J={encode:function(e){const t=(0,K.encode)(e);return(0,S.encode)(t)},decode(e){const t=(0,S.decode)(e);return(0,K.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 Q{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 $.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(L.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`${$.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]===L.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(Z).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,j.I)(t)},ne="FAKE_ESS_DB_KEY";class ie extends l.bk{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 z({storageManager:this.storageManager}),this.eventsManager=new Q({storageManager:this.storageManager}),this.installationId=this.setupInstallationId(),this.sequenceIdProvider=new A(this.installationId),this.sequenceNumberProvider=new W(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(f.UNAUTHORIZED),this.ownerProvider()&&(yield this.sendEvents(f.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===f.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?E.n.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(y(JSON.stringify(e.data))>5e3)i=_.PAYLOAD_SIZE_LIMIT_EXCEEDED;else if(t&&n&&!n())return _.UNKNOWN_OWNER}else i=_.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,g.R)({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`${v}-${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.m.forTag("EventSender")},91028:(e,t,n)=>{"use strict";var i;n.d(t,{B:()=>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={}))},14864:(e,t,n)=>{"use strict";var i;n.d(t,{Hv:()=>Fi,O4:()=>f,bi:()=>h,d2:()=>An,pM:()=>m,LW:()=>On,jb:()=>xn,nD:()=>Bi}),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(83356);!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.CONNECTAPI_CLIENT_ACK_TIMEOUT="CONNECTAPI_CLIENT_ACK_TIMEOUT",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_FORBIDDEN="QUEUE_OPERATION_FORBIDDEN",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_SET_OPTIONS_FAILED_WITH_STATUS="TP_SET_OPTIONS_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(80483);var a=n(74987);var s,c=n(80521);!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(30353),u=n(86380);const d="@local",p=65535;var h,f,m;!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"}(h||(h={})),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"}(m||(m={}));var _=n(91028);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(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",h=`${p.uid}:::${null!==(i=null===(n=p.metadata)||void 0===n?void 0:n.iteration)&&void 0!==i?i:""}`,f={type:e,uri:p.uri,uid:p.uid,qid:h,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};f.queued&&(u=!0),c.push(f),"meta"===f.type?d=!0:!t.ignoreMetaForTrack&&d||"track"!==f.type||f.hidden||(null===(s=f.removed_reasons)||void 0===s?void 0:s.length)||f.hidden_in_queue||l.push(f)}return{items:c,tracks:l,hasQueuedTracks:u}}function b(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 S(e){const[t,n]=e.split(":::"),i={type:"track",uid:t};return n&&(i.metadata={iteration:n}),i}class T extends c.bk{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 T(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(h.PLAYER_QUEUE_CHANGED,{internalPlayerQueue:this._currentInternalQueue,playerQueue:this._currentQueue}),this._currentInternalQueue}_setQueueNext(e,t){var n;const i=this._currentPlayerState;if(!i)return Promise.reject(new v(o.QUEUE_MANAGER_NO_STATE,"Cannot perform operation; no current state."));const r={next_tracks:e,prev_tracks:i.prev_tracks,queue_revision:i.queue_revision},a=null===(n=i.restrictions)||void 0===n?void 0:n.disallow_set_queue_reasons;return this._runner((()=>a&&a.length?Promise.reject(new v(o.QUEUE_OPERATION_FORBIDDEN,"Cannot perform operation; SetQueueCommand is not allowed.")):this._connectClient.setQueue(r,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(h.PLAYER_QUEUE_CHANGED,(t=>{e(t.data.internalPlayerQueue)}))}))}getPlayerQueue(){return this._hasInitialState?Promise.resolve(this._currentQueue):new Promise((e=>{this.on(h.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:b(e.next_items),prev_tracks:b(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){var n;const i=this._currentPlayerState;if(!i)return Promise.reject(new v(o.QUEUE_MANAGER_NO_STATE,"Cannot perform operation; no current state."));if(!Array.isArray(e))return Promise.reject(new TypeError("Argument `items` must be an array."));const r=b(e,{queued:!0}),a=null===(n=i.restrictions)||void 0===n?void 0:n.disallow_add_to_queue_reasons;return r.length?1===r.length?this._runner((()=>a&&a.length?Promise.reject(new v(o.QUEUE_OPERATION_FORBIDDEN,"Cannot perform operation; AddToQueueCommand is not allowed.")):this._connectClient.addToQueue(r[0],t)),t):this._insertQueued(r,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?S(e):e;const c=Array.from(null!==(n=a.next_tracks)&&void 0!==n?n:[]),l=c.length;for(let e=0;e{const r=(0,u.X)();if(!i||r-i>=e)return i=r,t.apply(n,o)}}(100,this._seek,this),this._client=e.client,this._streamer=e.streamer,this._controller=e.controller,this._hidden=!!e.hidden,this._onlyLocalState=!!e.onlyLocalState,this._preferController=!this._onlyLocalState&&!!e.preferControllerState,this._claimInactivePlayerStates=!!e.claimInactivePlayerStates,this._enableControllerWithoutStreamer=!!e.enableControllerWithoutStreamer,this._autoActivateElement=!!e.autoActivateElement,this._deactivateOnStop=!!e.experimentalDeactivateOnStop,this._forceRemoteActions=!!e.forceRemoteActions,this._parseDeviceList=this._parseDeviceList.bind(this),this._init()}static create(e){return new I(e)}_init(){this._createStreamerDeferred();const e=this._client;e.on("error",this._onError.bind(this)),this.proxyEmit(e,"authenticated",h.AUTHENTICATED),this.proxyEmit(e,"authentication_error",h.AUTHENTICATION_ERROR),this.proxyEmit(e,"before_disconnect",h.BEFORE_DISCONNECT),this.proxyEmit(e,"connected",h.CONNECTED),this.proxyEmit(e,"connection_error",h.CONNECTION_ERROR),this.proxyEmit(e,"descriptor_changed",h.DEVICE_DESCRIPTOR_CHANGED),this.proxyEmit(e,"product_state_changed",h.PRODUCT_STATE_CHANGED),this.proxyEmit(e,"reconnected",h.RECONNECTED),this.proxyEmit(e,"reconnecting",h.RECONNECTING),this.proxyEmit(e,"unrecoverable_failure",h.UNRECOVERABLE_FAILURE),this.proxyEmit(e,"logged_out",h.LOGGED_OUT);const t=this._controller;t.on("device_info_changed",(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:h.MAX_SUBSCRIPTIONS_REACHED,device_deactivated:h.DEVICE_DEACTIVATED}),t.on("registered",this.emit.bind(this,h.REMOTE_OBSERVER_ENABLED,null)),t.on("deregistered",this.emit.bind(this,h.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",h.BEFORE_VOLUME_CHANGE),this.proxyEmit(n,"autoplay_failed",h.AUTOPLAY_FAILED),this.proxyEmit(n,"stalled",h.BUFFER_STALLED),this.proxyEmit(n,"buffering_end",h.BUFFERING_END),this.proxyEmit(n,"buffering_start",h.BUFFERING_START),this.proxyEmit(n,"rebuffering_end",h.REBUFFERING_END),this.proxyEmit(n,"rebuffering_start",h.REBUFFERING_START),this.proxyEmit(n,"duration_changed",h.DURATION_CHANGED),this.proxyEmit(n,"max_list_errors_reached",h.MAX_LIST_ERRORS_REACHED),this.proxyEmit(n,"max_subscriptions_reached",h.MAX_SUBSCRIPTIONS_REACHED),this.proxyEmit(n,"playback_capped",h.PLAYBACK_CAPPED),this.proxyEmit(n,"player_initialization_done",h.PLAYER_INITIALIZATION_DONE),this.proxyEmit(n,"player_initialization_failed",h.PLAYER_INITIALIZATION_FAILED),this.proxyEmit(n,"progress",h.PROGRESS),this.proxyEmit(n,"registration_error",h.SERVICE_REGISTRATION_ERROR),this.proxyEmit(n,"track_ended",h.TRACK_ENDED),this.proxyEmit(n,"video_element_appended",h.VIDEO_ELEMENT_APPENDED),this.proxyEmit(n,"video_element_removed",h.VIDEO_ELEMENT_REMOVED),this.proxyEmit(n,"volume_changed",h.VOLUME_CHANGED),this.proxyEmit(n,"displayed_cues_changed",h.DISPLAYED_CUES_CHANGED),this.proxyEmit(n,"subtitle_languages_loaded",h.SUBTITLE_LANGUAGES_LOADED),this.proxyEmit(n,"speed_changed",h.SPEED_CHANGED),this.proxyEmitSync(n,"reporting_start",h.REPORTING_START),this.proxyEmitSync(n,"reporting_first_quartile",h.REPORTING_FIRST_QUARTILE),this.proxyEmitSync(n,"reporting_midpoint",h.REPORTING_MIDPOINT),this.proxyEmitSync(n,"reporting_third_quartile",h.REPORTING_THIRD_QUARTILE),this.proxyEmitSync(n,"reporting_complete",h.REPORTING_COMPLETE),this.proxyEmitSync(n,"reporting_pause",h.REPORTING_PAUSE),this.proxyEmitSync(n,"reporting_resume",h.REPORTING_RESUME),this.proxyEmitSync(n,"reporting_creative_view",h.REPORTING_CREATIVE_VIEW),this.proxyEmitSync(n,"reporting_error",h.REPORTING_ERROR),this.proxyEmitSync(n,"internal_endcontent","internal_endcontent"),n.on("context_ended",this.emit.bind(this,h.LOCAL_CONTEXT_ENDED,null)),n.on("logged_out",this.emit.bind(this,h.LOCAL_PLAYER_LOGGED_OUT,null))):(this._disableLocalTarget(),this.on(h.AUTHENTICATED,(()=>{this.emit(h.LOCAL_PLAYER_DISABLED,null)})))}_createStreamerDeferred(){this._deferredStreamer=(0,l.u)(),this._deferredStreamer.promise.catch((function(){}))}_isTargetIdLocal(e){return e?e===d?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(h.LOCAL_PLAYER_ENABLED,null)}_onStreamerDeregistered(){this._disableLocalTarget(),this.emit(h.LOCAL_PLAYER_DISABLED,null)}_onStreamerRegistrationAborted(){this._disableLocalTarget(),this._enableControllerWithoutStreamer&&this._controller.register(),this.emit(h.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(h.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(h.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(h.LAST_ACTIVE_DEVICE_INFO_CHANGED,e)})).catch((function(){}))}else this._onlyLocalState?(this._localPlayback||n)&&i():this.emit(h.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(h.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){var o;if(this._hasFakeState&&!(null==i?void 0:i.bypassFakeState))return this._autoActivateElement&&this._activateElement(),this._claimStateAndRun(n,i);return(null!==(o=null==i?void 0:i.forceRemoteAction)&&void 0!==o?o: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(d,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,brand:e.brand,model:e.model,version:t,volume:i,capabilities:{supports_lossless_audio:!1},playback_features:r,has_inactive_player_state:this._hasFakeState,disallow_transfer_reason:_.B.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."));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?S(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 m.OFF:if(i.toggling_repeat_context){if(i.toggling_repeat_track)return Promise.resolve(!1);n=m.TRACK}else n=m.CONTEXT;break;case m.CONTEXT:n=i.toggling_repeat_track?m.OFF:m.TRACK;break;case m.TRACK:default:n=m.OFF}return this.setRepeatMode(n,e)}))}_onSeekHandled(e){this._controller.seek(e.data.position)}_seek(e,t){return this.getCurrentState().then((n=>{if(null==n?void 0:n.disallows.seeking)return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Seeking is not allowed with current content."));return this._client.getLogger().logClientEvent({source:"harmony.seek()",source_version:A.tagged,source_vendor:"spotify",event:"Harmony/Client seek",event_version:"1.0.0",json_data:{position:e,deviceId:t}},"object"),this._runOnDevice(t,(()=>this._streamer.seek(e)),this._controller.seek.bind(this._controller,e,t))}))}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,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}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,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}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,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}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,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}))}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.disallows.skipping_prev?Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,"Skipping is not allowed with current content.")):this.previousTrack(e,t):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,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}))}seek(e,t){var n;return null!==(n=this._throttledSeek(e,t))&&void 0!==n?n:Promise.resolve(!0)}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(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(e,t,n);return this._runOnDevice(t,i,i,{loggingParams:null==n?void 0:n.loggingParams,forceRemoteAction:null==n?void 0:n.forceRemoteAction})}toggleShuffle(e,t){const n=()=>this._controller.toggleShuffle(e,t);return this._runOnDevice(e,n,n,{loggingParams:null==t?void 0:t.loggingParams,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}setRepeatMode(e,t){const n=()=>this._controller.setRepeatMode(e,t);return this._runOnDevice(t,n,n)}cycleRepeatMode(e){const t=()=>this._cycleRepeatMode(e);return this._runOnDevice(e,t,t)}transfer(e,t){const n=e||d,i=()=>this._controller.transfer(n,t);return this._autoActivateElement&&this._activateElement(),this._runOnDevice(n,i,i,{bypassFakeState:!0,loggingParams:null==t?void 0:t.loggingParams,forceRemoteAction:null==t?void 0:t.forceRemoteAction})}logout(e){return this._controller.logout(e||d)}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.getCurrentState().then((i=>{if(((null==i?void 0:i.disallows.signals)||{})[e])return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,`Sending signal ${e} is not allowed.`));const r=()=>this._controller.sendCustomSignal(e,t,n);return this._runOnDevice(t,r,r,{loggingParams:null==n?void 0:n.loggingParams,forceRemoteAction:null==n?void 0:n.forceRemoteAction})}))}playAsNextInQueue(e,t,n){const i=()=>this._controller.playAsNextInQueue(e,t,n);return this._runOnDevice(t,i,i,{loggingParams:null==n?void 0:n.loggingParams,forceRemoteAction:null==n?void 0:n.forceRemoteAction})}setModes(e,t,n){return this.getCurrentState().then((i=>{var r,a;const s=(null==i?void 0:i.disallows)||{};for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];if(null===(a=null===(r=s.setting_modes)||void 0===r?void 0:r[t])||void 0===a?void 0:a[n])return Promise.reject(new g(o.HARMONY_OPERATION_FORBIDDEN,`Setting ${t} to ${n} is not allowed.`))}const c=()=>this._controller.setModes(e,t,n);return this._runOnDevice(t,c,c,{loggingParams:null==n?void 0:n.loggingParams,forceRemoteAction:null==n?void 0:n.forceRemoteAction})}))}setShuffleMode(e,t,n){const i=()=>this._controller.setShuffleMode(e,t,n);return this._runOnDevice(t,i,i,{loggingParams:null==n?void 0:n.loggingParams,forceRemoteAction:null==n?void 0:n.forceRemoteAction})}}var O=n(80117),C=n(98321),R=n(40231);const N="spotify:user:attributes:mutated";class P extends c.bk{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 P(e)}_init(){this.register()}_handleUserUpdate(){clearTimeout(this._debounce),this._debounce=setTimeout((()=>{this._transport.forceTokenRefresh().catch((function(){})),this.getCurrentState(!0).then((e=>{this.emit(R.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!==C.s.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(N,this._handleUserUpdate),Promise.resolve(!0)}deregister(){return this._transport.unmatchMessages(N,this._handleUserUpdate),Promise.resolve(!0)}}const L=/(edge)[\s\/:]([\w\d\.]+)/,k=new RegExp("(opera|ie|firefox|chrome|trident|crios|version)[\\s/:]([\\w\\d\\.]+)?.*?(safari|(?:rv[\\s\\/:]|version[\\s\\/:])([\\w\\d\\.]+)|$)"),w={};function D(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=w[s];if(c)return c;const l=r.match(L),u=r.match(k)||[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],h="opera"===d[1]&&d[4]?d[4]:d[2],f={name:null!==(i=null==p?void 0:p.toString())&&void 0!==i?i:"unknown",version:null!==(o=null==h?void 0:h.toString())&&void 0!==o?o:"unknown",platform:a};return w[s]=f,f}(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 M,x;!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",e.MANIFEST_URLS_AUDIO_AD="manifest_urls_audio_ad"}(M||(M={})),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"}(x||(x={}));const U="undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues;const V=e=>U?function(e){return crypto.getRandomValues(new Uint8Array(e))}(e):function(e){const t=[];for(;t.length{const t=Math.ceil(e/2);return function(e){let t="";for(let n=0;nF(40),H="_spharmony_device_id";const G={get:function(e,t=!1){if(e&&"string"==typeof e)return e;if(t)return B();let n=localStorage.getItem(H);return n||(n=B(),localStorage.setItem(H,n)),n},generate:B};class W extends c.bk{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 W({id:G.get(e.id,e.randomizeId),model:e.model||D("harmony-{{name}}.{{version}}-{{platform}}").toLowerCase(),name:e.nameTemplate?D(e.nameTemplate):e.name||(t=D("Spotify ({{name}}/{{platform}})"),t.replace(/\b[a-z]/g,(e=>e.toUpperCase()))),type:e.type||x.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(M.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}}}var j=n(36858);class Y{constructor(e){this._melodyLogger=new j.nj(e)}logClientEvent(e,t){return e?this._melodyLogger.sendLog("/v1/msg/batch",{type:"client_event",message:{source:e.source||j.Z7.UNKNOWN,context:e.context||j.Z7.UNKNOWN,event:e.event||j.Z7.UNKNOWN,event_version:e.event_version||j.Z7.EMPTY,test_version:e.test_version||j.Z7.EMPTY,source_version:e.source_version||j.Z7.UNKNOWN,source_vendor:e.source_vendor||j.Z7.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||j.Z7.UNKNOWN,source_version:e.source_version||j.Z7.UNKNOWN,type:e.type||j.Z7.UNKNOWN,message:e.message||j.Z7.EMPTY,stack:JSON.stringify(e.stack||j.Z7.EMPTY),json_data:"json"===t?e.json_data||"{}":JSON.stringify(e.json_data||{}),json_data_version:e.json_data_version||j.Z7.EMPTY_VERSION}},{batch:!0})}logJSSDKContentRequest(e){var t;return this._melodyLogger.sendLog("/v1/msg/jssdk_content_request",{source:e.source||j.Z7.UNKNOWN,type:e.type||j.Z7.UNKNOWN,http_status:null!==(t=e.http_status)&&void 0!==t?t:void 0,ms_request_duration:e.ms_request_duration||j.Z7.EMPTY,n_retries:e.n_retries||j.Z7.ZERO,playback_id:e.playback_id||j.Z7.EMPTY})}logJSSDKConnectCommand(e){return this._melodyLogger.sendLog("/v1/msg/batch",{type:"jssdk_connect_command",message:{ms_ack_duration:e.ms_ack_duration,ms_request_latency:e.ms_request_latency||j.Z7.ZERO,command_id:e.command_id||j.Z7.EMPTY,command_type:e.command_type||j.Z7.EMPTY,target_device_brand:e.target_device_brand||j.Z7.EMPTY,target_device_model:e.target_device_model||j.Z7.EMPTY,target_device_client_id:e.target_device_client_id||j.Z7.EMPTY,target_device_id:e.target_device_id||j.Z7.EMPTY,interaction_ids:e.interaction_ids||j.Z7.EMPTY,play_origin:e.play_origin||j.Z7.EMPTY,result:e.result||j.Z7.EMPTY,http_response:e.http_response||j.Z7.EMPTY,http_status_code:e.http_status_code||j.Z7.ZERO}},{batch:!0})}}const z=O.m.forTag("harmonyclient"),K=/^[a-zA-Z0-9_%:-]{1,40}$/;class J extends c.bk{constructor(e){if(super(),this._platformIdentifier=(0,l.u)(),this._platformVersion=(0,l.u)(),!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 Y({transport:this._transport.toPublic(),sdkId:this.getSDKId(),platform:this._platformIdentifier.promise,clientVersion:this._platformVersion.promise}),this._productStateObserver=P.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 J(e)}static of(e){return e._client}_createDeviceDescriptor(e,t={}){var n,i;if((null==t?void 0:t.id)&&!K.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:A.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=>z.warn(`${e.type} Logging Error:`,t)))}getVersionDescriptor(){return Object.assign({},A)}getSDKId(){return`harmony:${A.tagged}`}getUntaggedSDKId(){return`harmony:${A.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(D(e))}setCapability(e,t){return this._deviceDescriptor.then((n=>n.setCapability(e,t)))}notifyError(e,t){this._onError(e,{error:t})}}var q,X=n(57128),$=n(22239);!function(e){e.FRAGMENT_FETCHED="fragment_fetched",e.FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.VIDEO_PROFILE_CHANGED="video_profile"}(q||(q={}));var Z,Q,ee,te,ne;!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_MUTED_CHANGED="muted_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_MUTED_CHANGED="muted_changed",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"}(ee||(ee={})),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"}(te||(te={})),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"}(ne||(ne={}));class ie 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 ie(e,t);return n.unrecoverable=!0,n}}n(28360);class oe 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 oe(e,t);return n.unrecoverable=!0,n}}class re extends Error{constructor(e,t){super(t),this.name="CappingError",this.message=t,this.code=e}}function ae(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 se extends c.Vk{constructor(e){super(Q.KEY_SESSION_MESSAGE,null),this.messageType="license-request",this.message=e}}class ce extends c.bk{constructor(e){super(),this._nativeKeySession=null,this._lastUpdateDeferred=(0,l.u)(),this._lastGenerateDeferred=(0,l.u)(),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 se(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 le{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,ae),t()}))}detach(e){this._lastBoundSetter&&(e.removeEventListener(Q.MS_NEEDKEY,ae),e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(){return Promise.reject(new oe(i.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){return new ce(this._nativeMediaKeys)}}function ue(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 de{constructor(e,t){if(this._configuration=null,this.keySystem=e,!this._checkConfig(t))throw new oe(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 le(this.keySystem))}))}}const pe=O.m.forTag("eme_polyfill.v0_1b");class he extends c.bk{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 se(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 oe(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.u)();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){pe.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,ae);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,ae);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):pe.warn("Got keymessage without session.")}_onKeyAdded(e){const t=this._getSession(e.sessionId);t?t.updateComplete():pe.warn("Got keyadded without session.")}_onKeyError(e){const t=this._getSession(e.sessionId);t?t.handleErrorEvent(e):pe.warn("Got keyerror without session.")}setServerCertificate(){return Promise.reject(new oe(i.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){const e=new he(this._keySystem,this._mediaElement,this._prefix);return this._waitingForSessionIds.push(e),e}}function me(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 _e{constructor(e,t,n){if(this._configuration=null,this.keySystem=e,this._prefix=n,!this._checkConfig(t))throw new oe(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 _e(t,n,e))}))};const t=HTMLMediaElement.prototype;delete t.mediaKeys,t.setMediaKeys=me}const Ee=O.m.forTag("eme_polyfill.safari");class ve extends c.bk{constructor(e,t){super(),this._attached=!1,this._nativeKeySession=null,this._lastGenerateResolver=(0,l.u)(),this._lastUpdateResolver=(0,l.u)(),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)):Ee.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)):Ee.warn("Tried to detach with no WebKitMediaKeySession")}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new se(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 oe(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 oe(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.u)();if(this._lastUpdateResolver=t,!this._nativeKeySession)return Ee.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,ae),t()}))}detach(e){e.removeEventListener(Q.WEBKIT_NEEDKEY,ae),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 oe(i.EME_INVALID_STATE_ERROR,"The server certificate is not available");return new ve(this._nativeMediaKeys,this._serverCertificate)}}class be{constructor(e,t){this.keySystem=e;const n=this._checkConfig(t);if(!n)throw new oe(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 Se(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 Te=O.m.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)?(Te.log("Using native EME implementation."),"native"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.webkitGenerateKeyRequest)?(Te.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)?(Te.log("Detected Unprefixed EME v0.1b. Polyfilling."),ge(),"v0.1b"):"undefined"!=typeof MSMediaKeys?(Te.log("Detected MS IE EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new de(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=ue}(),"ms-ie"):"function"==typeof WebKitMediaKeys?(Te.log("Detected Safari EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new be(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=Se}(),"safari"):(Te.warn("Detected no EME APIs."),null)}const Ie={[ee.WIDEVINE]:{commonName:"widevine",licenseServer:"https://@webgate/widevine-license",withCertificate:!0,pssh_field:{audio:"pssh_widevine",video:"encryption_data"}},[ee.PLAYREADY]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[ee.PLAYREADY_HARDWARE]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[ee.FAIRPLAY]:{commonName:"fairplay",licenseServer:"https://@webgate/fairplay-license",withCertificate:!0,pssh_field:{audio:"pssh_fairplay",video:"asset_id"}},[ee.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/mp4; codecs="mp4a.40.5"',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"}],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/mp4; codecs="mp4a.40.5"',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/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/mp4; codecs="mp4a.40.5"',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/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"},{contentType:'audio/mp4; codecs="mp4a.40.5"',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:""},{contentType:'audio/mp4; codecs="mp4a.40.5"',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"},{contentType:'audio/mp4; codecs="mp4a.40.5"',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:""},{contentType:'audio/mp4; codecs="mp4a.40.5"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]}];function Ce(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 Re=/([^;]+)(?:;\s?codecs="(.*)")?/;function Ne(e){var t;const[,n="unknown",i="unknown"]=null!==(t=e.match(Re))&&void 0!==t?t:[];return{mimeType:n,codec:i,contentType:e}}const Pe=/([^;]+)(?:;\s?codecs="(.*)")?/,Le=O.m.forTag("playback.eme_manager"),ke={EMPTY:"-no-robustness",SW_CRYPTO:"-sw-crypto",SW_DECODE:"-sw-decode",HW_CRYPTO:"-hw-crypto",HW_DECODE:"-hw-decode",HW_ALL:"-hw-all"};function we(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=we(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=we(e.videoCapabilities,n))&&void 0!==a?a:void 0,!c)?null:Object.assign(Object.assign({},e),{audioCapabilities:s,videoCapabilities:c})}class Me extends c.bk{constructor(e){var t;super(),this._unauthServerCertificateBase="",this._disallowCodecs={},this._keySystemDeferred=(0,l.u)(),this._configuration=(0,l.u)(),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&&ke.hasOwnProperty(i)&&t.push(ke[i])}}return new RegExp(`(${t.join("|")})$`)}(e.disallowRobustnessValues||[]),this._disallowCodecs=e.disallowCodecs,this._preferredKeySystems=e.preferredKeySystems||[ee.WIDEVINE,ee.PLAYREADY,ee.PLAYREADY_HARDWARE,ee.FAIRPLAY]}static create(e){return new Promise((t=>{const n=Ae();if(!n)throw oe.fatal(i.EME_API_NOT_SUPPORTED,"Platform does not support navigator.requestMediaKeySystemAccess");t(new Me(Object.assign(Object.assign({},e),{emeImpl:n})).init())}))}_prepareConfiguration(e){const t=e.getConfiguration();Le.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=Ie[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(Pe))&&void 0!==t?t:[];e&&n.push({contentType:i.contentType,mimeType:e,codec:null!=o?o:""})}return n}_appendProbableMediaCapabilities(e,t){const n=Ce(this._configs,(t=>(-1===t.indexOf("webm")||e!==ee.PLAYREADY&&e!==ee.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=>(Le.warn("Error from setting server certificate",e),this)))}_cacheServerCertificate(e){let t="";switch(e){case ee.FAIRPLAY:t="fairplay";break;case ee.WIDEVINE:t="widevine";break;default:return Promise.resolve(this)}return this._requestServerCertificate(`${this._unauthServerCertificateBase}/${t}-license`,!1).then((()=>this),(e=>(Le.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 Le.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 oe(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 oe(i.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")});return o}_onMessage(e,t){e.timeMap.generate.end=(0,u.X)();let n="message"in t?t.message:null;const i="messageType"in t?t.messageType:void 0;if(Le.info("Got EME message event with type",i),n&&e.keySystem===ee.PLAYREADY&&(n=this._extractPlayReadyChallenge(n,e.signal)),!n)return void Le.info("Ignoring message event: no valid request payload");if(!e.licenseServer)return void Le.info("Ignoring message event: no licenseServer url");e.timeMap.request.start=(0,u.X)();let o=e.licenseServer;e.keySystem===ee.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=(0,u.X)(),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 re(i.CAPPING_USER_IS_CAPPED,"User is capped.")}):400===t.status&&"widevine error"===r?(o=oe.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 oe(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 oe(i.EME_LICENSE_REQUEST_EMPTY_RESPONSE,"Empty license response body"),o.status=t.status,void n(o);try{e.timeMap.update.start=(0,u.X)(),e.keySession.update(t.body).catch((e=>{n(new oe(i.EME_LICENSE_UPDATE_FAILED,e.message||"License update failed."))})),Le.info("KeySession updated.")}catch(e){const{message:t}=e;n(new oe(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(oe.fatal(i.EME_MEDIA_KEYS_NOT_SUPPORTED,"Cannot create MediaKeys from KeySystemAccess"));e.keySystem===ee.FAIRPLAY&&t.setServerCertificate(new ArrayBuffer(0));try{if(!t.createSession())throw new Error("")}catch(e){const{message:t}=e;return Promise.reject(oe.fatal(i.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED,t||"Cannot create MediaKeySession from KeySystemAccess"))}return Promise.resolve(e)}),(e=>(Le.error(e.name),Promise.reject(oe.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=>{Le.warn("Failed to close KeySession",e)}));e.push(i),n.keySession=null,n.onMessageListener=null,n.onKeyStatusChangeListener=null,Le.info("Closed KeySession")}catch(e){Le.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 ee){if(!Object.prototype.hasOwnProperty.call(ee,e))continue;const i=e;n.push(navigator.requestMediaKeySystemAccess(ee[i],this._configs).then((e=>{t[e.keySystem]=e})).catch((()=>{})))}return Promise.all(n).then((()=>this._selectKeySystem(t))).then((e=>e?(Le.info("Supported keySystem: ",e.keySystem),this._testMediaKeys(e)):Promise.reject(new oe(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(oe.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 oe(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)=>{Le.info("Creating KeySession",e.keySystem);const o=e.mediaKeys.createSession(),r={generate:{start:null,end:null},request:{start:null,end:null},update:{start:null,end:null}},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=()=>{Le.info("KeyStatus change"),r.update.end=(0,u.X)();const e=e=>null!==e.start&&null!==e.end?(0,u.r)(e.start,e.end):0;t({elapsed:{generate:e(r.generate),request:e(r.request),update:e(r.update)}})};return o.addEventListener(Q.KEY_SESSION_STATUSES_CHANGE,c),this._saveSession({keySession:o,onMessageListener:s,onKeyStatusChangeListener:c}),Le.info("Generating KeySession request",e.keySystem),r.generate.start=(0,u.X)(),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 oe(t,e.message||"Unknown error message."))}))}))}}var xe;!function(e){e.SHOWING="showing",e.HIDDEN="hidden",e.DISABLED="disabled"}(xe||(xe={}));const Ue=Array.prototype.slice,Ve="function"==typeof Array.from?e=>Array.from(e):e=>Ue.call(e);function Fe(e,t){const n=Ve(e.getElementsByTagName(t));for(const t of n)e.removeChild(t)}function Be(e){const t=e;return{id:t.id,text:t.text}}const He="visible",Ge="hidden",We=/^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$|[A-Za-z]{2,3}-x-cc/;class je extends c.bk{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(Be)})}_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?He:Ge}));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;Ve(e.getElementsByTagName("track")).forEach((e=>{e.default&&(n=e),e.srclang.toLowerCase()===t&&(i=e)})),n&&(n.default=!1,n.track.mode=xe.DISABLED,this._unsubscribeFromCueEvents()),i&&(i.default=!0,i.track.mode=this._isVisible?xe.SHOWING:xe.HIDDEN,this._deactivateListeners||this._subscribeToCueEvents(i))}_onLoadedMetadata(){const e=this._player;if(e&&(Fe(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?He:Ge,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(!We.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=[],Fe(e,"track"),e.removeEventListener(Q.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.crossOrigin=this._crossOrigin)}visible(){return this._isVisible}}class Ye 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 ze{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}}var Ke=n(82620);function Je(e){const t=Ke.X.decode(e),n=new Uint8Array(t.length);for(let e=0,i=t.length;e=parseInt(l,16)}function Ze(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 Qe(e,t){return void 0!==t&&Array.isArray(e.encryption_indices)&&-1===e.encryption_indices.indexOf(t)}function et(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 tt(e){return"audio_codec"in e?e.audio_codec:e.video_codec}function nt(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=tt(a);!(t in a)||Qe(a,o)||et(a,r)||("unknown-codec"!==l||a.mime_type!==e.mimeType||i!==e.codec&&!$e(e.codec,i)?a.mime_type===c&&(i===l||s&&$e(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 Ze(n,a)}return[]}function it(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 ot extends ze{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=(0,u.r)(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 rt(e){return!!e&&"getMediaProfileInfo"in e}function at(e){return!!e&&"getCurrentBitrates"in e&&"canLowerBitrate"in e&&"adaptToBandwidth"in e}function st(e){return!!e&&"getTrackingEventData"in e&&"getTrackingEvents"in e}class ct{constructor(e){this.bandwidthEstimator=e.bandwidthEstimator}static create(e){return new ct(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:it(i.selected)},audio:{bitrate:null===(c=n.selected)||void 0===c?void 0:c.audio_bitrate,mimeType:it(n.selected)}}}return null}}const lt=O.m.forTag("playback.audio_processor");class ut{constructor(e){this._audioContext=null,this._mediaElementSource=null,this._gainNode=null,this._nodes=[],(null==e?void 0:e.disable)?lt.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)):lt.warn("The AudioContext API is not supported. Any future operation related to `AudioProcessor` will be skipped."))}static create(e){return new ut(e)}_setMediaElementSource(e){var t;this._audioContext&&(this._mediaElementSource&&(lt.info("Disconnecting previous media element source"),this._mediaElementSource.disconnect()),lt.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;lt.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),lt.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):lt.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 lt.info("The default gain node is not available"),!1;const t=Math.pow(10,e/20);return this._gainNode.gain.value=t,lt.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,lt.info("The AudioProcessor is destroyed")}}const dt=O.m.forTag("playback.media_source_manager");function pt(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 ht extends c.bk{constructor(e){super(),this._mediaSource=null,this._sourceBuffers={},this._currentInitSegments={},this._updateQueue=[],this._playId=0,this._lastBufferClearTime=(0,u.X)(),this._customSourceBufferParams="";const{mimeTypes:t,customSourceBufferParams:n,disableBufferAbort:i}=e;this._mimeTypes=t,this._customSourceBufferParams=pt(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 ht(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;dt.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;dt.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(){dt.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?dt.info(`Injected combined init segment and playable segment (${e.mimeType}, ${e.profileId})`):e.init&&dt.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 dt.info("Try update dropped: playId has changed"),void this._abortUpdate(e);if(e.timestamp{this.tryUpdate({playId:this._playId,timestamp:(0,u.X)(),type:"duration",duration:e,resolve:t})}))}getMediaSource(){return this._mediaSource}setPlayId(e){this._playId=e}getPlayId(){return this._playId}}const ft=O.m.forTag("playback.buffer_fill_operation");class mt{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--;){const n=t.start(e),o=t.end(e);if(n<=i.timeStart&&(o>=i.timeEnd||o+1e-5>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));ft.log(`Segments to download: ${r.length}/${o}`);const s=(0,u.X)();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),ft.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(),ft.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",ft.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):(ft.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&&ft.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 _t,gt;!function(e){e[e.AUDIO=12]="AUDIO",e[e.VIDEO=20]="VIDEO"}(_t||(_t={}));class Et extends c.bk{constructor(e,t={},n={}){var i,o;super(),this._bufferTarget={audio:_t.AUDIO,video:_t.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)||_t.AUDIO,this._bufferTarget.video=(null===(o=n.bufferTarget)||void 0===o?void 0:o.video)||_t.VIDEO,this._mediaSourceManager=ht.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 Et(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 h=d+(u-p);if(!o||"started"!==o.status||o.timeStarth){null==o||o.abort();const t=r.getPlayId();this._currentFillOperation=new mt({timeStart:d,timeEnd:h,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=(0,u.X)(),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 vt extends ze{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 Ye(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"}(gt||(gt={}));const yt={[gt.MP3_256]:"audio/mp3",[gt.MP3_320]:"audio/mp3",[gt.MP3_160]:"audio/mp3",[gt.MP3_96]:"audio/mp3",[gt.MP4_128]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_256]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_128_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_256_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_128_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_256_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[gt.MP4_FLAC]:'audio/mp4; codecs="flac"'};class bt extends ze{constructor(e){if(super(e),this._loaded=!1,this._lastResolveToken=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=Ie[this._keySystem],this._fileFormat=e.fileFormat,this._disableCache=e.disableCache,this._preloadedManifest=e.preloadedManifest,this._preresolvedURL=e.preresolvedURL,this._fileFormat)this._mimeType=yt[this._fileFormat];else switch(this._mediaFormat){case ne.MP3:this._mimeType=yt[gt.MP3_160];break;case ne.MP4:case ne.MP4_DUAL:case ne.MP4_CBCS:this._mimeType=yt[gt.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._lastResolveTime=(0,u.X)(),this._resolver.getCDNURL(t,this._fileFormat).then((t=>(e&&this._lastResolveTime&&(e.resolveLatency=(0,u.r)(this._lastResolveTime)),t)))),i=this._lastResolveTime?(0,u.r)(this._lastResolveTime):1/0;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=(0,u.X)();return this._resolver.getManifest(this._fileId).then((n=>(e&&(e.manifestLatency=(0,u.r)(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===ee.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 Ye(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 Ye(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 St="application/vnd.apple.mpegurl";function Tt(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 At(e){return`data:application/vnd.apple.mpegurl;base64,${btoa(e)}`}function It(e){const t=new Blob([e],{type:St});return URL.createObjectURL(t)}function Ot(e){return It(Tt(e))}function Ct(e){return At(Tt(e))}class Rt extends bt{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 Ye(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?Ot:Ct;return this._hlsURL=s({assetID:this._fileId,targetDuration:10,map:r,segments:a}),this._hlsURL}getLoadingApproach(){return{approach:"source",type:St}}}class Nt 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 Pt extends bt{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 Nt(i.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0,{time_range:s,byte_range:r}));const a=new Nt(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 Nt(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 Nt(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 Nt(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 Ye(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 Ye(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 429===e.status||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 ot{constructor(e){super(e),this._hlsURLs=[],this.strategy=Z.URL,this._keySystem===ee.FAIRPLAY&&(this._supportedFormats.audio.push({mimeType:"audio/mp2t",codec:"mp4a.40.2"}),this._supportedFormats.video.push({mimeType:"video/mp2t",codec:"avc1.4d402a"}))}_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?Ot:Ct)({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 Ye(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?It:At)(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:it(null===(e=this._audioProfiles.available)||void 0===e?void 0:e[0]),video:it(null===(t=this._videoProfiles.available)||void 0===t?void 0:t[0])}}getLoadingApproach(){return{approach:"source",type:St}}adaptToBandwidth(){return Promise.resolve(!1)}canLowerBitrate(){return!1}}class kt extends ot{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 429===e.status||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 Ye(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=(0,u.X)(),d=e=>{c+=e,s--,s||(this._abrManager.sample(c,(0,u.r)(l)),this._updateVariants())};let p=Promise.resolve(null);if(e){const t=a[e.id];(null==t?void 0:t.buffer.byteLength)?p=Promise.resolve(t):(null==r?void 0:r.audio)&&(s++,p=this._fetchBufferData(r.audio,o,e,r.audioLogging,n).then((t=>(a[e.id]=t,d(t.buffer.byteLength),t))))}let h=Promise.resolve(null);if(t){const e=a[t.id];(null==e?void 0:e.buffer.byteLength)?h=Promise.resolve(e):(null==r?void 0:r.video)&&(s++,h=this._fetchBufferData(r.video,o,t,r.videoLogging,n).then((e=>(a[t.id]=e,d(e.buffer.byteLength),e))))}return Promise.all([p,h]).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=(0,u.X)(),l=e=>{s+=e,a--,a||(this._abrManager.sample(s,(0,u.r)(c)),this._updateVariants())};let d=null;!e.init&&(null==o?void 0:o.audio)&&(a++,d=this._fetchBufferData(o.audio,e,t,o.audioLogging,i).then((e=>(l(e.buffer.byteLength),e))));let p=null;return!e.init&&(null==o?void 0:o.video)&&(a++,p=this._fetchBufferData(o.video,e,n,o.videoLogging,i).then((e=>(l(e.buffer.byteLength),e)))),Promise.all([r,d,p])})).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:it(this._audioProfiles.selected),video:it(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 wt extends ze{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=(0,u.X)();return this._resolver.getCDNURL(t).then((t=>(e&&(e.resolveLatency=(0,u.r)(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"}}}class Dt 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 Dt(e,t);return n.unrecoverable=!1,n.canPlayNext=!0,n}}class Mt extends ze{constructor(e){super(e),this._loaded=!1,this._playableContentSorted=[],this._mimeType="",this._manifestURL="",this._adURL="",this._product="",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 Dt(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._product=t.product,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=(0,u.X)(),n=this._manifestURL;return this._transport.request(n,{responseType:"json",authorize:!0,retry:{condition:(e,t)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((o=>{if(200!==o.status){const e=new Dt(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 Dt(i.AD_MANIFEST_INVALID,"Received empty manifest.");return e.debug.manifestURL=n,e.status=o.status,Promise.reject(e)}e&&(e.manifestLatency=(0,u.r)(t));const r=o.body;return Promise.resolve(r)}))}_getPlayableContent(){const e="video"===this._product;if(e&&this._videoManifestId)return;const t=e?this._videoFiles:this._audioFiles;if(!t.length)throw new Ye(i.FILE_NOT_RESOLVED,`Manifest's ${e?"video_files":"audio_files"} array is empty.`);const n=t.filter((e=>this._isPlayable(e.type,this.getMediaType())));if(!n.length)throw new Ye(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 Ye(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 xt(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 Ut(e,t,n){if(!e.fileId)return Promise.reject(new ie(i.INVALID_TRACK,`Invalid ${e.format} Track: No fileId.`));const o=Object.assign(Object.assign({},xt(e,t)),{transport:t.transport,abrManager:t.abrManager,supportedFormats:t.supportedFormats,fileId:e.fileId,keySystemSettings:Ie[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===ee.FAIRPLAY?new Lt(o).load(t.measures):new kt(o).load(t.measures)}const Vt=O.m.forTag("playback.player"),Ft=/^blob:/,Bt={[ne.MP4]:!0,[ne.MP4_DUAL]:!0,[ne.MP4_CBCS]:!0,[ne.MP4_FLAC]:!0,[ne.MP3]:!1,[ne.MANIFEST_ID]:!0,[ne.AD_MANIFEST]:!0,[ne.GENERIC_MEDIA]:!0},Ht={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},Gt={audio:2,video:2};function Wt(e){return Math.ceil(1e3*e)}function jt(e){return e/1e3}function Yt(e){return document.createElement(e)}class zt extends c.bk{constructor(e){var t,n,i,o,r;super(),this._cubicVolume=!1,this._player=null,this._emeManager=null,this._mediator=new c.bk,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._muted=!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=Gt,this._audioResolver=e.audioResolver,this._clearBufferOnSeek=!!e.clearBufferOnSeek,this._createPlayer=e.createPlayer||Yt,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 $.q(e.trackCacheSize||2),this._subtitleManager=new je({language:e.preferredSubtitleLanguage||navigator.language,player:this._player}),this._videoResolution=e.videoResolution,Vt.info("Setting Player track cache to:",e.trackCacheSize||2),this._bufferManager=Et.create(this._tracker,void 0,{disableBufferAbort:!!e.disableBufferAbort,reinjectInitsOnAbort:!!e.reinjectInitsOnAbort,noInit:!0,customSourceBufferParams:e.customSourceBufferParams,bufferTarget:e.bufferTarget}),this._statistics=ct.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:Gt.audio,a.audio),video:Math.min(null!==(r=null===(o=e.rebufferTarget)||void 0===o?void 0:o.video)&&void 0!==r?r:Gt.video,a.video)},this._audioProcessor=ut.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?zt.createWithOptions(t):Me.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 zt(t);return t.preinitMediaElement?n._preinitMediaElement():n})).catch((n=>{if(e.enableWithoutEME)return zt.createWithOptions(t);throw n}))}static createWithOptions(e){return new Promise((t=>{const n=new zt(e);t(e.preinitMediaElement?n._preinitMediaElement():n)}))}_init(){this._disableCache&&Vt.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({[q.FRAGMENT_FETCHED]:this._onFragmentFetched,[q.VIDEO_PROFILE_CHANGED]:this._onProfileChanged}),this.proxyEmitAll(this._mediator,{[q.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 Vt.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){Vt.info("Reusing media element.");return(!(e.audio===this._activeMimeTypes.audio&&e.video===this._activeMimeTypes.video)||this._newBufferPerTrack)&&n===Z.MSE&&(Vt.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")}Vt.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,l.muted=this._muted,"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 ie(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 Vt.info("Duration changed drop: operation aborted.");const e=Wt(this._player.duration),n=Wt(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=Wt(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=Wt(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=Wt(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)&&(Vt.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&&(Vt.info("Exceeded quota: rebuffering current track."),this._bufferManager.abort(!0),this._player.currentTime=this._player.currentTime,this._onTimeUpdate())}_onEncrypted(e){Vt.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()||(Vt.info("Native ended emitted."),this._emitEnded())}_onSyntheticEnded(){this._synthesizeEnded&&this._currentContent&&this._currentContent.isProtected()&&(Vt.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 h=new ie(r,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(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=!!at(this._currentContent)&&this._currentContent.canLowerBitrate(),o=this._tracker;this.emit(Q.PLAYER_BUFFERING_START,Object.assign({position:Wt(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:Wt(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:Wt(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){Vt.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?Wt(this._player.currentTime):0})}_emitWarning(e,t){Vt.warn("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?Wt(this._player.currentTime):0})}_emitReporting(e){if(!st(this._currentContent))return;const t=this._currentContent.getTrackingEventData(e);t&&0!==t.urls.length&&this.emitAndWait(Ht[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 Vt.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 Vt.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")),o.muted=!!e.muted,o.loop=!!e.loop,!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)?(Vt.info("Creating media keys"),this._emeManager.createMediaKeys(o).then((()=>!0),a)):o.mediaKeys!==r?(Vt.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 Vt.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.currentTimee(this._player&&this._player.play()))).then((()=>this._audioProcessor.resume())).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?(Vt.info("Ready to play, triggering play."),r()):(Vt.info("Waiting to be playable."),this.once(Q.INTERNAL_PLAYER_CANPLAY,r))}_handleCanPlayThrough(e){var t;e.aborted?Vt.info("CanPlayThrough operations dropped: operation aborted."):(this._tracker.trackCanPlayThrough(),(null===(t=this._currentContent)||void 0===t?void 0:t.strategy)!==Z.MSE&&this._tracker.trackPlayLatency())}_loadContent(e,t){if(t.aborted||!this._upcomingContent)return Vt.info("Loading content dropped: operation aborted."),Promise.resolve(!1);if(!this._player)throw new ie(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?Vt.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){Vt.warn("Cannot set initial position before loading.",e)}const s=e.playbackSpeed;return!e.useDefaultPlaybackSpeed&&s&&this.setPlaybackSpeed(s),this._tracker.setProtected(n.isProtected()),Vt.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 ie(i.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));Vt.info("Loading URL content.");const s=e.getURL();if(!s)return Promise.reject(new ie(i.PLAYER_INVALID_INTERNAL_STATE,"Content not loaded."));if(e.isProtected()){Vt.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()&&rt(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)Vt.info("URL content loaded using src attribute"),this._player.src=s;else{Vt.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 ie(i.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));if(Vt.info(`Loading MSE Content: ${e.getFileId()}`),e.isProtected()){Vt.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 ie(i.PLAYER_INVALID_INTERNAL_STATE,"No media source."));if("video"===e.getMediaType()&&rt(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=(0,u.X)();this.once(Q.PLAYER_REBUFFERING_END,(()=>{e((0,u.r)(t))}))}))}_requestLicense(e,t={}){if(e.aborted){const e="Request license dropped: operation aborted.";return Vt.info(e),Promise.resolve(!1)}if(!this._player||!this._currentContent||!this._emeManager)return Promise.resolve(!1);const n=(0,u.X)(),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 d;if(l)d=Promise.resolve(l);else{if(!r)return Promise.reject(new TypeError("Missing: fileId or licenseEndpoint"));d=this._licenseURLResolver.get(c,o.getMediaType()).then((e=>e.replace(/\{contentId\}/,r)))}const p=this._emeManager,h=this._tracker;return h.setKeySystem(c),h.setKeySystemImpl(p.getKeySystemImpl()),Promise.all([d,o.getInitParams()]).then((([o,r])=>{if(!r)return Promise.resolve(!1);h.setLicenseSessionLatency((0,u.r)(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 p.createSessionWithParams(t)}return Promise.resolve(!1)})).then((t=>{if(e.aborted)return Vt.info("License tracking dropped: operation aborted."),Promise.resolve(!1);"boolean"!=typeof t&&"elapsed"in t&&(h.setLicenseGenerationLatency(t.elapsed.generate),h.setLicenseRequestLatency(t.elapsed.request),h.setLicenseUpdateLatency(t.elapsed.update));const i=(0,u.r)(n);return h.setKeyLatency(i),this.emit(Q.PLAYER_KEY_RECEIVED,{requestTime:i,logData:a}),Vt.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 Vt.log("Dropping time update event: buffering before license disabled.");if(!n&&this._lastTimeUpdatePostion&&this._lastTimeUpdatePostion===i)return void Vt.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=Wt(i),a=t.getLogData();n?(this._tracker.trackPositionChanged(r),this.emit(Q.PLAYER_POSITION_CHANGED,{position:r,logData:a})):(this._tracker.trackProgress(r,at(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,Wt(o-i)))}_isPlaying(){return!!this._player&&!this._player.paused}_cleanMediaKeys(e,t=this._emeManager){return t?t.removeMediaKeys(e).catch((e=>(Vt.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=>(Vt.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:ee.INVALID_SPOTIFY_KEY,audioFormats:e.formatsInfo.audio,videoFormats:e.formatsInfo.video})))).then((n=>function(e,t){var n,o,r;const a=xt(e,t);switch(e.format){case ne.MP3:{const o=null!==(n=e.url)&&void 0!==n?n:e.resolvedURL;return o?new vt(Object.assign(Object.assign({},a),{url:o})).load():e.fileId?new wt(Object.assign(Object.assign({},a),{fileId:e.fileId,resolver:t.audioResolver})).load():Promise.reject(new ie(i.INVALID_TRACK,`Invalid ${e.format} Track: No url or fileId.`))}case ne.GENERIC_MEDIA:{const t=null!==(o=e.url)&&void 0!==o?o:e.resolvedURL;return t?new vt(Object.assign(Object.assign({},a),{url:t})).load():Promise.reject(new ie(i.INVALID_TRACK,`Invalid ${e.format} Track: No url.`))}case ne.MP4:case ne.MP4_DUAL:case ne.MP4_CBCS:case ne.MP4_FLAC:{if(!e.fileId)return Promise.reject(new ie(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:Ie[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===ee.FAIRPLAY?new Rt(n).load(t.measures):new Pt(n).load(t.measures)}case ne.MANIFEST_ID:return Ut(e,t);case ne.AD_MANIFEST:{if(!e.url)return Promise.reject(new ie(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 Mt(n).load(t.measures).then((n=>{const i=n.getManifestId();if(!i)return n;const o=Object.assign(Object.assign({},e),{fileId:i,format:ne.MANIFEST_ID}),r={trackingData:n.getTrackingEvents(),metadata:n.getContentMetadata()};return Ut(o,t,r)}))}default:return Promise.reject(new ie(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===ee.FAIRPLAY?Z.URL:Z.MSE,e.signal):null})).then((()=>this),(e=>(Vt.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&&Bt[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 Vt.info("Waiting for preloading track.",i),o.then((e=>(Vt.info("Preloading succeeded.",i),t.setResolveLatency(e.resolveLatency),t.setManifestLatency(e.manifestLatency),n.get(i)))).catch((()=>(Vt.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()?(Vt.info("Using cached track.",i,r),t.setMemoryCached(!0),r):(Vt.info("Mismatched keysystem for cached track. Creating new track",i),this._createContent(e)))):(Vt.info("Using cached track.",i,r),t.setMemoryCached(!0),Promise.resolve(r))}return Vt.info("Creating new content",i),this._createContent(e)}getMediaSource(){return this._bufferManager.getMediaSource()}load(e,t,n){var o,r,s,c,l,u,d;const p=function(e,t){return null==t?void 0:t.hasOwnProperty(e)}(t.uriProperty,e)?t.uriProperty:"uri",h=e[p];if(Vt.info("load",h),!h)return Promise.reject(new ie(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),t.muted&&this.setMuted(!0),this._preloadThreshold=t.preloadThreshold||this._preloadThreshold;const f=++this._playId;this._abortController=(0,a.createAbortControllerLike)();const m=this._abortController.signal,_=this._tracker;_.trackLoadStart(h,e.fileId,f.toString(),e.logData,e.metadata);const g=this._configureLoadingTimeout(m,this._abortController,t.loadingTimeout);void 0!==g&&m.addEventListener("abort",(()=>clearTimeout(g))),this.emit(Q.PLAYER_BEFORE_LOAD,{track:e,options:t,logData:e.logData,uri:h,timestamp:Date.now()}),this._bufferManager.setPlayId(f);const E=(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,v={position:jt(t.position||0),autoplay:null===(c=t.autoplay)||void 0===c||c,poster:e.poster,useDefaultPlaybackSpeed:!!(null===(l=e.options)||void 0===l?void 0:l.useDefaultPlaybackSpeed),playbackSpeed:E,callback:n,muted:null!==(u=t.muted)&&void 0!==u&&u,loop:null!==(d=t.loop)&&void 0!==d&&d};return this._loadingOptions=v,_.setPlayIntended(v.autoplay),_.setPlayedThreshold(t.playedThreshold),this._checkKeySystemAccess().then((()=>this._getContentPromise(e,_))).then((t=>{if(_.trackStrategy(t.strategy),t.isProtected()&&!this._emeManager)throw new ie(i.DISALLOW_PROTECTED_TRACK_ERROR,"Protected tracks not supported");t.setLogData(e.logData),t.strategy===Z.MSE&&_.setCalculatedDuration(Wt(t.getCalculatedDuration())),this._upcomingContent=t})).then((()=>this._prepareMediaElement(v,m))).then((()=>{var e;this._subtitleManager.setPlayer(this._player),(null===(e=this._upcomingContent)||void 0===e?void 0:e.isProtected())&&(Vt.info("Attaching HTMLMediaElement to the audio processor"),this._audioProcessor.setPlayer(this._player))})).then((()=>this._loadContent(v,m))).then((e=>this._handleLoadingComplete(e,g)),this._handleLoadingError.bind(this,h,e,m,g))}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;Vt.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],Vt.info("Cached",t),r))).catch((e=>(delete i[t],Vt.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 ie(i.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE,"Volume should be in range [0, 1]");this._playerVolume=e,this._player&&(this._muted&&e>0&&this.setMuted(!1),this._player.volume=this._cubicVolume?e*e*e:e)}}getVolume(){return this._playerVolume}getPlayerState(){var e,t,n,i;const o=this._player,r=this._currentContent,a={src:(null==o?void 0:o.src)?`data:${(null==r?void 0:r.getFileId())||"unknown"}`:void 0,height:(null==o?void 0:o.clientHeight)||0,width:(null==o?void 0:o.clientWidth)||0},s={};if(r){const e=r.getMediaTypeMimeTypes();s.audio_format=e.audio,s.video_format=e.video,"video"===r.getMediaType()&&o instanceof HTMLVideoElement&&(s.video_height=o.videoHeight,s.video_width=o.videoWidth,a.poster=o.poster)}let c=null;if(st(r)){const e=r.getTrackingEvents();e&&(c={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==o?void 0:o.paused))&&void 0!==e&&e,position:o?Wt(o.currentTime):0,duration:o?Wt(o.duration):0,volume:null!==(t=this._playerVolume)&&void 0!==t?t:1,muted:this._muted,loop:null!==(n=null==o?void 0:o.loop)&&void 0!==n&&n,playback_speed:null!==(i=null==o?void 0:o.playbackRate)&&void 0!==i?i:0,playback_speed_selected:this._playerSpeed,buffering:this._rebuffering,media_type:(null==r?void 0:r.getMediaType())||null,media_info:s,player_element:a,content_metadata:(null==r?void 0:r.getContentMetadata())||{},tracking_data:c}}getPlayerPosition(){return this._player?Wt(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 Vt.info("Seek dropped: operation aborted.");let t=jt(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?Wt(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&&Vt.warn("MediaError detected: next immediate media error will be fatal.");const e=s.src;if(e)Ft.test(e)&&URL.revokeObjectURL(e),s.removeAttribute("src");else{const e=Ve(s.getElementsByTagName("source"));Vt.info(`HTMLSourceElements to removed: ${e.length}`);for(const t of e)s.removeChild(t);Vt.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),s.ownerDocument!==document&&document.adoptNode(s)),this.emit(Q.PLAYER_STOPPED,null),Promise.all(r).then((()=>!0))}setMuted(e=!0){const t=this._player;t&&(this._muted=e,t.muted=e,this.emitSync(Q.PLAYER_MUTED_CHANGED,{muted:e}))}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(!rt(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(te.INVALID):(this._preferredBitrate=e,this._currentContent&&"video"===this._currentContent.getMediaType()&&e>0&&this._bufferManager.abort(!0),this._abrManager.overrideBitrate(e),Promise.resolve(te.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||Yt("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=Ce([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 Kt extends Error{constructor(e,t){super(t),this.debug={},this.name="LoggingError",this.message=t,this.code=e}}const Jt="7.38.0-966392b3",qt="7.38.0",Xt=O.m.forTag("playback.logger");class $t extends c.bk{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 $t(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};Xt.debug("Logged TrackStreamVerification",t),this._logSender.logTrackStreamVerification(t).catch((n=>{const o=new Kt(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};Xt.info("Logging PlaybackStats"),this._logSender.logJSSDKPlaybackStats(t).catch((n=>{const o=new Kt(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};Xt.info("Logging PlaybackStart"),this._logSender.logJSSDKPlaybackStart(t).catch((n=>{const o=new Kt(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){Xt.warn("Unable to send impression request",e)}))}_logError(e,t,n,i,o){const r={source:"playback",source_version:Jt||j.Z7.UNKNOWN,type:e||j.Z7.UNKNOWN,message:t&&t.message||j.Z7.EMPTY,stack:'""',json_data:JSON.stringify(n||{}),json_data_version:"1.0.0",client_id:i.clientId,correlation_id:i.correlationId};o?this._logSender.logJSSDKWarning(r).catch((e=>Xt.warn("Failed to log warning",r,e))):this._logSender.logJSSDKError(r).catch((e=>Xt.warn("Failed to log error",r,e)))}}class Zt 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 Qt=O.m.forTag("playback.storage_resolve");class en{constructor(e){this._transport=e}_parseResponse(e,t){var n;let o;if(200!==t.status)return o=new Zt(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 Zt(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){Qt.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)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then(this._parseResponse.bind(this,e))}getManifest(e){const t=`https://seektables.scdn.co/seektable/${e}.json`;return Qt.info("Requesting JSON manifest for ",e),this._transport.request(t,{responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((t=>{let n;return 200!==t.status?(n=new Zt(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 Zt(i.STORAGE_TRACK_MANIFEST_EMPTY,"Received empty manifest."),n.debug.file_id=e,n.status=t.status,Promise.reject(n))}))}}class tn extends Error{constructor(e,t){super(t),this.debug={},this.name="TrackingError",this.message=t,this.code=e}}class nn{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 on{constructor(){this._bitrates={},this._isFinalized=!1,this._needsEndSegment=!1,this._segments=[],this._cdnURLTracker=new nn,this.currentSpeed=1,this.audioCodec=null,this.bitrate=0,this.audioQuality=void 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=null,this.msInitLatency=null,this.msKeyLatency=null,this.msLicenseGenerationLatency=null,this.msLicenseRequestLatency=null,this.msLicenseSessionLatency=null,this.msLicenseUpdateLatency=null,this.msManifestLatency=null,this.msPlayed=0,this.msNominalPlayed=0,this.msPlayedUnion=0,this.msPlayLatency=null,this.msResolveLatency=null,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 on}_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 tn(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 ee.WIDEVINE:e="widevine";break;case ee.PLAYREADY:case ee.PLAYREADY_HARDWARE:e="playready";break;default:e="none"}return{ms_total_est:this.msActualDuration,ms_metadata_duration:this.msMetadataDuration,ms_manifest_latency:this.msManifestLatency||0,ms_latency:this.msPlayLatency||0,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||0,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 rn=O.m.forTag("playback.tracker");class an extends c.bk{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 an(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=on.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.loadStartMonotonic=(0,u.X)(),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.bufferLoadStartMonotonic=(0,u.X)())}trackBytesDownloaded(e){const t=this._trackingData;t&&(t.totalBytes+=e)}trackLoadDone(e){const t=this._trackingData;t&&(t.bufferLoadStartMonotonic&&(t.msInitLatency=(0,u.r)(t.bufferLoadStartMonotonic)),t.localTimeMs=Date.now(),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=(0,u.X)();this.trackHeadLatency(e)}trackPlayLatency(e=(0,u.X)()){const t=this._trackingData;!t||t.nSeeksBackward||t.nSeeksForward||t.loadStartMonotonic&&(t.msPlayLatency=(0,u.r)(t.loadStartMonotonic,e))}trackHeadLatency(e=(0,u.X)()){const t=this._trackingData;t&&t.bufferLoadStartMonotonic&&(t.msHeadLatency=(0,u.r)(t.bufferLoadStartMonotonic,e))}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;if(s.stopTime=Date.now(),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 rn.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 sn extends c.bk{constructor(e){super(),this._transport=e,this._parseManifestResponse=this._parseManifestResponse.bind(this)}static create(e){return new sn(e)}_parseManifestResponse(e){var t;const n=e.metadata.startTime;if(200!==e.status){const t=new Zt(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)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}},metadata:{startTime:Date.now()}}).then(this._parseManifestResponse)}}class cn 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 cn(e,t);return n.unrecoverable=!0,n.canPlayNext=!1,n}}class ln{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 429===e.status||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?cn.fatal(i.LICENSE_RESOLVER_DEPRECATED_VERSION,"This version of the SDK is no longer supported. Please upgrade"):new cn(i.LICENSE_RESOLVER_CANT_RESOLVE_URL,`License URL endpoint responded with status ${e.status}`):cn.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 un{constructor(e){this._melodyLogger=new j.nj(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 dn;!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"}(dn||(dn={}));const pn={[i.MEDIA_ABORTED]:dn.ABORTED,[i.MEDIA_DECODING_ERROR]:dn.MEDIA_DECODING,[i.MEDIA_NOT_SUPPORTED]:dn.SRC_NOT_SUPPORTED,[i.MEDIA_NETWORK_ERROR]:dn.NETWORK};function hn(e){let t=pn[e];return/_REQUEST_|_RESPONSE$/.test(e)?t=dn.NETWORK:t||(t=/^EME_/.test(e)?dn.EME:dn.GENERIC),t}function fn(e){var t;const n=e.match(/^https?:\/\/([^\/]+@)?([^\/?#]+)/);return null!==(t=null==n?void 0:n[2])&&void 0!==t?t:""}var mn;!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"}(mn||(mn={}));const _n={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 gn{constructor(e){this._playerId=`spotify-playback-${Date.now()}`,this._currentContentInfo=null,this._readyDeferred=(0,l.u)(),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 gn(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||qt,player_mux_plugin_name:"spotify-playback-mux-reporter",player_mux_plugin_version:qt},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,mn.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({},_n);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,mn.READY),this._isMuxInitialized=!0):o&&this._mux.emit(this._playerId,mn.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,mn.PLAY,this._currentContentInfo.videoData)}_onPlaying(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!1,this._mux.emit(this._playerId,mn.PLAYING))}_onPause(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!0,this._mux.emit(this._playerId,mn.PAUSE))}_onProgress(e){this._currentContentInfo&&this._mux.emit(this._playerId,mn.TIMEUPDATE,{player_playhead_time:e.data.position})}_onSeeking(){this._currentContentInfo&&this._mux.emit(this._playerId,mn.SEEKING)}_onPositionChanged(){this._currentContentInfo&&this._mux.emit(this._playerId,mn.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,mn.ERROR,{player_error_code:hn(i),player_error_message:i})}_onEnded(){this._currentContentInfo&&this._mux.emit(this._playerId,mn.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,mn.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,mn.REQUEST_COMPLETED,{request_type:n,request_hostname:fn(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,mn.REQUEST_FAILED,{request_type:n,request_hostname:fn(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,mn.REQUEST_COMPLETED,{request_type:"manifest",request_hostname:fn(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,mn.REQUEST_FAILED,{request_type:"manifest",request_hostname:fn(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 En{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 vn{constructor(e=4e5){this._totalBytes=0,this._overrideBitrate=0,this._currentBandwidth=e,this._short=new En(2),this._long=new En(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}}class yn{constructor(e,t){this._transport=e,this._abrManager=t}_fetch(e,t){const n=(0,u.X)();return this._transport.request(e,{responseType:"arraybuffer",headers:{Range:t}}).then((e=>e.ok&&e.body?{bytes:e.body.byteLength,time:(0,u.X)()-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 bn=(e,t)=>new yn(e,t);var Sn,Tn,An,In,On;function Cn(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"}(Sn||(Sn={})),function(e){e.AAC_LC="mp4a.40.2",e.AAC_HE="mp4a.40.5",e.FLAC="flac",e.OPUS="opus",e.VP9="vp9",e.VP8="vp8",e.H264_31="avc1.4d401f"}(Tn||(Tn={})),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"}(In||(In={})),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 Rn extends c.bk{constructor(e){if(super(),this._trackPlayerPromise=(0,l.u)(),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=In.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 Rn(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_MUTED_CHANGED]:Q.PLAYER_MUTED_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;const o=isNaN(e)?0:e;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translateDuration)||void 0===n?void 0:n.call(t,o))&&void 0!==i?i:o}_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 ie(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}),te.SUCCESS}_changeTrack(e,t,n){if(this._currentSeqId!==n)return Promise.resolve(te.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,u=!1,d=!1;o&&(1===i?(a=!o.paused,c=o.initialPosition||o.position||0):c=o.position||0,u=o.muted||!1,d=o.loop||!1);const p=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),void 0!==t.muted&&(u=t.muted),void 0!==t.loop&&(d=t.loop)}this._currentTrack=e,this._currentTrackOptions={reason:t,paused:!a,position:c,playedThreshold:l,muted:u,loop:d};const h=this._handleTrackLoaded.bind(this,{uid:this._uid,track:this._currentTrack,options:this._currentTrackOptions,list:this._loadedList});return this._getTrackPlayer().then((t=>this._currentSeqId!==n?te.CANCELLED:(Promise.resolve(t.load(e,{uriProperty:"playableURI",autoplay:a,position:c,playedThreshold:l,continuePrevious:p,loadingTimeout:r,muted:u,loop:d},h)).catch((()=>{})),te.SUCCESS)))}_preloadUpcomingTrack(){const e=this._loadedList;return e?e.peekNext({reason:s.TRACK_DONE,listConstants:Sn}).then((e=>e===Sn.FORBIDDEN?te.FORBIDDEN:e===Sn.NULL_VALUE?te.INVALID:e===Sn.LIST_END?te.LIST_END:Cn(e)&&e.playable?this.preloadTrack(e):te.INVALID)):Promise.reject(new ie(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}preloadTrack(e){return this._getTrackPlayer().then((t=>(t.preload(e).catch((()=>{})),te.SUCCESS)))}activateElement(){return this._getTrackPlayer().then((e=>(e.activateElement(),te.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,muted:!1,loop:!1};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),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.loop&&(t.loop=e.loop),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 te.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:Sn}).then((e=>e!==Sn.FORBIDDEN)):Promise.resolve(!0)}next(e){if(!e)return Promise.reject(new ie(i.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new ie(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:Sn};return t.next(o).then((i=>this._currentSeqId!==n?te.CANCELLED:i===Sn.FORBIDDEN?te.FORBIDDEN:i===Sn.NULL_VALUE?this.next(e):i===Sn.LIST_END?(this.emit(Q.LIST_PLAYER_LIST_ENDED,{list:t,reason:s.END_PLAY}),this.clear(e),te.LIST_END):Cn(i)?i.playable?this._changeTrack(i,e,n):(this.emit(Q.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.next(e)):te.INVALID))}previous(e){if(!e)return Promise.reject(new ie(i.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new ie(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:Sn};return t.previous(o).then((i=>this._currentSeqId!==n?te.CANCELLED:i===Sn.FORBIDDEN?te.FORBIDDEN:i===Sn.NULL_VALUE?this.previous(e):i===Sn.LIST_START?(this.emit(Q.LIST_PLAYER_LIST_ENDED,{list:t,reason:s.END_PLAY}),this.clear(e),te.LIST_END):Cn(i)?i.playable?this._changeTrack(i,e,n):(this.emit(Q.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.previous(e)):te.INVALID))}pause(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.pause().then((()=>te.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?te.CANCELLED:te.FORBIDDEN)))):Promise.resolve(te.SUCCESS):Promise.reject(new ie(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((()=>te.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?te.CANCELLED:te.FORBIDDEN)))):Promise.resolve(te.SUCCESS):Promise.reject(new ie(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((()=>te.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?te.CANCELLED:te.FORBIDDEN)))):Promise.resolve(te.SUCCESS):Promise.reject(new ie(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}),te.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),te.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(te.SUCCESS)}setRepeatMode(e){if(!(e in In))return Promise.reject(new ie(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(te.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}),te.SUCCESS)))}seek(e,t=s.SEEK){var n,o;const r=this._loadedList;if(!r)return Promise.reject(new ie(i.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));if("function"==typeof r.allowSeeking&&!r.allowSeeking())return Promise.reject(new ie(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:Sn}))&&void 0!==o?o:e;return a===Sn.PAUSE?this.pause().then((t=>(this.emit(Q.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:a}),t))):a===Sn.IGNORE?(this.emit(Q.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:a}),Promise.resolve(te.SUCCESS)):this._currentTrack?this._getTrackPlayer().then((e=>(e.seek(a),te.SUCCESS))):Promise.resolve(te.SUCCESS)}getListConstants(){return Sn}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((()=>te.SUCCESS))}showSubtitles(){return this._getTrackPlayer().then((e=>e.showSubtitles())).then((()=>te.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((()=>te.SUCCESS))}activateCueEvents(){return this._getTrackPlayer().then((e=>e.activateCueEvents())).then((()=>te.SUCCESS))}getCurrentBandwidth(){return this._getTrackPlayer().then((e=>e.getCurrentBandwidth()))}setSubtitleLanguage(e){return this._getTrackPlayer().then((t=>t.setSubtitleLanguage(e))).then((()=>te.SUCCESS))}setPlaybackSpeed(e){return this._getTrackPlayer().then((t=>t.setPlaybackSpeed(e))).then((e=>e?te.SUCCESS:te.FORBIDDEN))}setMuted(e){return this._getTrackPlayer().then((t=>(t.setMuted(e),te.SUCCESS)))}getStatistics(){return this._getTrackPlayer().then((e=>e.getStatistics()))}getAudioProcessor(){return this._getTrackPlayer().then((e=>e.getAudioProcessor()))}}const Nn=O.m.forTag("playback.init");function Pn(e){return new Promise(((t,n)=>{var i,o,r,a,s,c,l,u,d,p,h;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:f}=e,[m="",_=""]=(e.sdkId||"").split(":"),g=new vn,E=Object.assign(Object.assign({},e),{abrManager:g,initialBandwidthSampler:bn(f,g),tracker:an.create(),audioResolver:new en(f),videoResolver:new sn(f),licenseURLResolver:new ln({transport:f,sdk:{name:m,version:_},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===(h=e.loggerOptions)||void 0===h?void 0:h.clientVersion]).then((([t,n])=>{e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{deviceInfo:{platform:t,version:n}})})),zt.create(E).then((t=>{const n=Object.assign({disableMux:!0},e.loggerOptions),i=function(e){return new un(e)}(Object.assign(Object.assign({},n),{transport:f,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=$t.create({transport:f,player:t,logSender:i});return n.disableMux||gn.create({player:t,mux:X,envKey:null==n?void 0:n.muxEnvKey,sdk:m,sdkVersion:_,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 Ln=O.m.forTag("media_session");function kn(e){return Math.round(1e3*e)}class wn{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 wn(e):(Ln.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(kn(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+kn(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-kn(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.bk{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&&wn.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===te.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 Mn,xn,Un=n(61544);class Vn 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 Vn(e,t);return n.unrecoverable=!0,n}}class Fn{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 Fn(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 Vn(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(te.SUCCESS)}setShuffle(){return Promise.resolve(te.SUCCESS)}setRepeatMode(){return Promise.resolve(te.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,h={playbackQuality:e.playbackQuality,hifiStatus:e.hifi_status},f={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:h,options:{position:p,paused:d,playedThreshold:u,useDefaultPlaybackSpeed:!(0,Un.gH)(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(f)}))}))}getCurrentState(){return this._currentState}}function Bn(e,t){return e&&"RECOMMENDATION"===(null==t?void 0:t.context_enhancement)?xn.SMART:xn[e?"ON":"OFF"]}!function(e){e.ON="ON",e.OFF="OFF",e.NONE="NONE"}(Mn||(Mn={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.SMART=2]="SMART"}(xn||(xn={}));const Hn=/^disallow_([^]+)_reasons$/;function Gn(e){var t,n;const i={};for(const o in e)e.hasOwnProperty(o)&&(i[o]=!!(null===(n=null===(t=null==e?void 0:e[o])||void 0===t?void 0:t.reasons)||void 0===n?void 0:n.length));return i}function Wn(e){var t,n,i,o,r,a,s,c;const l={};for(const u in e)if(e.hasOwnProperty(u)){l[u]={};for(const d in null===(t=e[u])||void 0===t?void 0:t.values)if(null===(n=e[u])||void 0===n?void 0:n.values.hasOwnProperty(d)){(l[u]||{})[d]=!(!(null===(r=null===(o=null===(i=e[u])||void 0===i?void 0:i.values)||void 0===o?void 0:o[d])||void 0===r?void 0:r.reasons)||!(null===(c=null===(s=null===(a=e[u])||void 0===a?void 0:a.values)||void 0===s?void 0:s[d])||void 0===c?void 0:c.reasons.length))}}return l}function jn(e){const t={};for(const n in e)if(e.hasOwnProperty(n))if("disallow_setting_modes"===n)t.setting_modes=Wn(e[n]);else if("disallow_signals"===n)t.signals=Gn(e[n]);else{const i=e[n];if(Array.isArray(i)){const e=!(!i||!i.length);t[n.replace(Hn,"$1")]=e}}return t}const Yn=O.m.forTag("tp.stream.PlaybackStateObserver");class zn extends c.bk{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 zn(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;const{stateMachine:d,stateRef:p,position:h,paused:f,loading:m,currentTrackInfo:_,contextMetadata:g}=e.data,E=null==d?void 0:d.states;if(!d||!(null==E?void 0:E.length)||!p)return void Yn.warn("_onStateChanged called with no current state",e);const v=E[p.state_index],y=d.tracks[null==v?void 0:v.track];if(!v||!y)return void Yn.warn("_onStateChanged called with no current state or track",e);const{options:b}=v;let S=null!==(t=_.duration)&&void 0!==t?t:0;const T=this._createTrackWindow(d,v,S);S||(S=null!==(i=null===(n=T.current_track)||void 0===n?void 0:n.duration_ms)&&void 0!==i?i:0);!(null!==(o=!!(null==b?void 0:b.playback_speed))&&void 0!==o&&o)&&_.isPlaybackSpeedRestricted&&(v.restrictions=Object.assign({disallow_setting_playback_speed_reasons:["not_supported_by_content_type"]},v.restrictions));const A=function(e,t){const n=Object.assign({},e);return delete n.disallow_pausing_reasons,delete n.disallow_resuming_reasons,t?n.disallow_pausing_reasons=["already_paused"]:n.disallow_resuming_reasons=["not_paused"],n}(v.restrictions||{},f),I=jn(A),O={current:f?0:null!==(r=_.currentPlaybackSpeed)&&void 0!==r?r:1,selected:I.setting_playback_speed?1:null!==(a=_.selectedPlaybackSpeed)&&void 0!==a?a:1,restricted:!!I.setting_playback_speed},C={timestamp:Date.now(),context:{uri:null!==(c=null===(s=y.metadata)||void 0===s?void 0:s.context_uri)&&void 0!==c?c:null,metadata:g},position:h,duration:S,paused:f,playback_quality:null!==(l=_.playbackQuality)&&void 0!==l?l:An.UNKNOWN,playback_features:{hifi_status:null!==(u=_.hifiStatus)&&void 0!==u?u:Mn.NONE,playback_speed:O,signal_ids:v.signals||[],modes:(null==b?void 0:b.modes)||{}},shuffle:this._getShuffleSetting(d),shuffle_mode:Bn(null==b?void 0:b.shuffling_context,null==b?void 0:b.modes),repeat_mode:this._getRepeatSetting(d),track_window:T,restrictions:A,disallows:I,loading:m,playback_speed:O.current,playback_id:v.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?m.TRACK:t.repeating_context?m.CONTEXT:m.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,o;const r=null==e?void 0:e.tracks[t.track];if(!(null==r?void 0:r.metadata))return null;const a=r.metadata,s=r.manifest&&"manifest_ids_video"in r.manifest,c=r.track_type.toLowerCase(),l=(0,Un.o_)(a.uri),u=a.linked_from_uri?(0,Un.o_)(a.linked_from_uri):null,d=null===(i=a.episode_content_type)||void 0===i?void 0:i.toLowerCase(),p={episode:d||"unknown",track:"music",ad:"ad",interruption:"ad",media:"narration"};let h="unknown";(null==l?void 0:l.type)&&l.type in p&&(h=p[l.type]);const f=null===(o=a.images)||void 0===o?void 0:o.map((e=>{if(0===e.url.indexOf("spotify:image:")){const t=e.url.split(":").slice(-1)[0];return Object.assign(Object.assign({},e),{url:`https://i.scdn.co/image/${t}`})}return e}));return{id:l?l.id:null,uri:a.uri,type:(null==l?void 0:l.type)||"unknown",uid:t.track_uid,linked_from:{uri:a.linked_from_uri||null,id:u?u.id:null},media_type:s?"video":"audio",track_type:c,content_type:h,name:a.name,duration_ms:n||a.duration,artists:a.authors,album:{uri:a.group_uri,name:a.group_name,images:f},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 Kn=/^https:\/\//,Jn={[M.FILE_URLS_MP3]:ne.MP3,[M.FILE_URLS_EXTERNAL]:ne.MP3,[M.FILE_IDS_MP3]:ne.MP3,[M.FILE_IDS_MP4]:ne.MP4,[M.FILE_IDS_MP4_DUAL]:ne.MP4,[M.FILE_IDS_CBCS]:ne.MP4_CBCS,[M.FILE_IDS_MP4FLAC]:ne.MP4_FLAC,[M.MANIFEST_IDS_VIDEO]:ne.MANIFEST_ID,[M.MANIFEST_URLS_VIDEO_AD]:ne.AD_MANIFEST,[M.MANIFEST_URLS_AUDIO_AD]:ne.AD_MANIFEST};class qn{constructor(e){this._descriptor=e.descriptor,this._listPlayer=e.listPlayer}static create(e){return new qn(e)}_resolveFromStateTrack(e,t,n){var i,o,r,a;const s=e.manifest,c=e.metadata.uri,l=(0,Un.o_)(c);let u=null;for(const e of n){const n=s[e];if(n)for(const s of n){if(!s.file_id&&!Kn.test(null!==(i=s.file_url)&&void 0!==i?i:""))continue;const n=!(!l||l.type!==Un.NQ.AD&&l.type!==Un.NQ.INTERRUPTION);if(e===M.FILE_IDS_MP3&&!n)continue;let d,p;if(d=s.track_type?s.track_type.toLowerCase():e===M.MANIFEST_IDS_VIDEO?"video":"audio",s.format){const e=parseInt(s.format,10);gt[e]&&(p=e)}const h=null!==(o=s.bitrate)&&void 0!==o?o:e===M.FILE_IDS_MP4FLAC?1411200:128e3,f=null!==(r=s.bitrate)&&void 0!==r?r:e===M.FILE_IDS_MP4FLAC?7e5:128e3,m=Jn[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:f,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===ne.MP3,playable:!0},e===M.MANIFEST_IDS_VIDEO||h<=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 Xn=1e3,$n=0,Zn=!1;class Qn{constructor(e,t={}){this._cancelFn=null,this._deferredTimer=0,this._fn=e,this._cancelFn=t.cancel||null,this._threshold=t.threshold||Xn,this._ts=t.initialTimetamp||$n,this._blockInital=t.blockInitial||Zn}_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,ei.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(),h=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:f}=e,m=f.track.metadata||{},_=null===(i=null==p?void 0:p.options)||void 0===i?void 0:i.playback_speed,g=null!==(o=!!_)&&void 0!==o&&o;this._currentTrackInfo={duration:h,mediaType:f.track.mediaType.toUpperCase(),fileFormat:f.track.fileFormat,bitrate:null===(a=null===(r=f.logData)||void 0===r?void 0:r.format)||void 0===a?void 0:a.bitrate,playbackQuality:m.playbackQuality,hifiStatus:m.hifiStatus,isPlaybackSpeedRestricted:g?!!(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=f.track.options)||void 0===l?void 0:l.useDefaultPlaybackSpeed),currentPlaybackSpeed:null!=_?_:this._currentTrackInfo.selectedPlaybackSpeed,selectedPlaybackSpeed:null!=_?_:this._currentTrackInfo.selectedPlaybackSpeed};const E=f.options;u.setPaused(!E.autoplay),this._setCurrentTrackPosition(E&&E.position||0),this._updateState(ei.BEFORE_TRACK_LOAD),this._startedPlayingUpdateSent=!1,this._initialUpdateSent=!1}_onCapped(){this._listPlayer.clear(s.CAPPED),this._currentContext=null,this._updateState(ei.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=>{ti.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(ei.ERROR))}_onSpeedChanged(e){this._currentTrackInfo.currentPlaybackSpeed=e.data.playback_speed,this._currentTrackInfo.selectedPlaybackSpeed=e.data.playback_speed_selected,this._updateState(ei.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?ei.PAUSE:ei.RESUME):(this._lastProcessedStateId=null,this._emitStateChanged()))}_onPlayThresholdReached(e){this._initialUpdateSent=!0,this._setAllTrackPositions(e.data.position),this._updateState(ei.PLAYED_THRESHOLD_REACHED)}_onPlayTokenLost(){this._listPlayer.pause().catch((function(){}))}_onPositionChanged(e){this._loading||(this._setCurrentTrackPosition(e.data.position),this._logger.logClientEvent({source:"harmony:track_playback:client",source_version:A.tagged,source_vendor:"spotify",event:e.type,event_version:"1.0.0",json_data:{track:e.data.track,event_position:e.data.position,prev_position:this._previousTrackPosition,curr_position:this._currentTrackPosition}},"object"),e.data.position===this._previousTrackPosition&&this._logger.logClientEvent({source:"harmony:track_playback:client",source_version:A.tagged,source_vendor:"spotify",event:`${e.type} - same position as previous event`,event_version:"1.0.0",json_data:{track:e.data.track,event_position:e.data.position,prev_position:this._previousTrackPosition,curr_position:this._currentTrackPosition}},"object"),e.data.track&&this._shouldSendUpdateForEvent(e.data.track.stateId)?this._updateState(ei.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(ei.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&&(0,u.X)()-this._lastUpdateStateMonotonicTime>n&&this._updateState(ei.PROGRESS)}_onTrackDataCreatedEvent(){this._waitingForTrackingData=(0,l.u)()}_onTrackDataFinalizedEvent(e){const t=this._nextFinalizedDataPayload;t&&(t.playback_stats=e.data.playbackStats,this._updateState(ei.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*p,!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 Vn(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,ei.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:ci}).then((e=>{if(200!==e.status&&204!==e.status)return this._registered=!0,!1;const{body:t}=e;return t&&(t.endsong&&ni.log(t.endsong),t.endsongs&&(ii.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:A.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){ti.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=Vn.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=Vn.fatal(o.TP_REGISTRATION_FAILED_NON_PREMIUM,"Cannot register to Track Playback with non-premium user."):200!==e.status?t=Vn.fatal(o.TP_REGISTRATION_FAILED_WITH_STATUS,`track-playback service responded with status ${e.status} when registering device`):e.body||(t=Vn.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&&ni.log(n.endsong),n.endsongs&&(ii.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{ti.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(ei.PING);break;default:this._emitError(new Vn(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:ci}).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(ei.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(ei.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:si})}_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 ti.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]),ti.info("State update sent.",e,a)},c=`${this._endpoint}/v1/devices/${this._deviceId}/state`;this._lastUpdateStateMonotonicTime=(0,u.X)(),this._transport.request(c,{authorize:!0,method:"PUT",headers:{"Content-Type":"application/json"},responseType:"json",payload:JSON.stringify(a),retry:si}).then(this._handleStateUpdateResponse.bind(this,r)).then(s,(e=>{!function(e){return"object"==typeof e&&null!==e&&"code"in e}(e)?this._emitError(new Vn(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(),ei.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 ui(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(),h=e.getDeviceDescriptor(),f=null!==(i=n.initialVolume)&&void 0!==i?i:1,m=Pn(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:h.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)),_=m.then((e=>e.getMediaConfig())),g=Promise.all([h,_]).then((([e,t])=>(e.getCapability("audio_podcasts")&&!n.disableExternalFiles&&e.appendManifestFormat(M.FILE_URLS_EXTERNAL),t.keysystem===ee.FAIRPLAY?e.appendManifestFormat(M.FILE_IDS_CBCS):t.keysystem!==ee.WIDEVINE||n.preferMultiDRMFormat?e.appendManifestFormat(M.FILE_IDS_MP4_DUAL,M.FILE_IDS_MP4,M.MANIFEST_URLS_AUDIO_AD):(-1!==t.formats.audio.indexOf('audio/mp4; codecs="flac"')&&e.getCapability("lossless_playback")&&e.appendManifestFormat(M.FILE_IDS_MP4FLAC),e.appendManifestFormat(M.FILE_IDS_MP4,M.FILE_IDS_MP4_DUAL,M.MANIFEST_URLS_AUDIO_AD)),t.supports.protected_video&&e.getCapability("video_playback")&&e.prependManifestFormat(M.MANIFEST_IDS_VIDEO),t.supports.unprotected_video&&e.getCapability("video_ads")&&e.prependManifestFormat(M.MANIFEST_URLS_VIDEO_AD),e))),E=Rn.create({trackPlayer:m}),v=qn.create({descriptor:h,listPlayer:E}),{playbackServiceClient:y,playbackStateObserver:b}=t({initialVolume:f,listPlayer:E,logger:p,transport:d,clientVersion:u,descriptor:g,endpoint:n.endpoint,manifestTrackResolver:v});return new Dn({client:e,playbackServiceClient:y,playbackStateObserver:b,initialVolume:f,playerPromise:m,listPlayer:E,stopOnBackground:n.stopOnBackground,enableMediaSession:n.enableMediaSession})}(e,(e=>{const t=li.create(Object.assign(Object.assign({},e),{ListClass:Fn}));return{playbackServiceClient:t,playbackStateObserver:zn.create(t)}}),t)}const di=O.m.forTag("transport.server_time");class pi{constructor(e){this._serverTime=0,this._serverTimeFetchedAt=null,this._transport=e}static create(e){return new pi(e)}_handleResponse(e,t){var n;const i=(0,u.X)();return t.status!==C.s.OK?this._handleError(`Status ${t.status}`):"number"!=typeof(null===(n=t.body)||void 0===n?void 0:n.timestamp)?this._handleError("Invalid response"):(this._serverTimeFetchedAt=i,this._serverTime=t.body.timestamp+Math.round((i-e)/2),this._serverTime)}_handleError(e){return di.error(`Cannot fetch server time: ${e}`),this._serverTimeFetchedAt=(0,u.X)(),this._serverTime=Date.now(),this._serverTime}get(){const e=(0,u.X)();return this._transport.request("@webgate/melody/v1/time",{responseType:"json",signal:(0,a.createAbortSignalWithTimeout)(1e3)}).then(this._handleResponse.bind(this,e),this._handleError.bind(this))}getApproximate(){if(!this._serverTime||null===this._serverTimeFetchedAt)return this.get(),Date.now();const e=(0,u.r)(this._serverTimeFetchedAt);return e>18e4&&this.get(),this._serverTime+e}}var hi;!function(e){e.LOCAL_PLAYER_DISABLED="local_player_disabled",e.STOPPED="stopped",e.REMOTE_ACTIVATED="remote_activated",e.UNKNOWN="unknown"}(hi||(hi={}));class fi 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 fi(e,t);return n.unrecoverable=!0,n}}class mi{constructor(e){this._transport=e.transport,this._metadataCache=new $.q(e.cacheSize||20)}static create(e){return new mi(e)}_decorateTrackWindow(e){const t=this._metadataCache,n={current_track:null,next_tracks:[],previous_tracks:[]};let i,o,r;const a=e=>{var t;const n=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.track_player;e&&n&&(e.media_type="video"===n?"video":"audio")};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),a(n.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),a(n.next_tracks[i]);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),a(n.previous_tracks[i]);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,Un.o_)(a);e&&(e.type===Un.NQ.TRACK?i.push(e.id):"chapter"===(null==t?void 0:t.contentType)?o.push(e.id):e.type===Un.NQ.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!==Un.NQ.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,Un.DY)(e.artist).toURI(),name:e.artist}],album:{uri:(0,Un.dx)(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!==Un.NQ.AD&&e.type!==Un.NQ.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}]},artists:[{uri:"",name:i.artist_name}]}}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 _i=/^[0-9a-f]{32}$/i,gi=()=>F(32),Ei=e=>{if(e&&(t=e,!_i.test(t)))throw new TypeError(`Invalid commandId. Expected a 32 character hex string but got: ${e}`);var t;return e||gi()},vi=O.m.forTag("harmony.controller"),yi={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,disallow_setting_modes:!0,disallow_signals:!0,disallow_add_to_queue_reasons:!0,disallow_set_queue_reasons:!0,disallow_updating_context_reasons:!0,disallow_removing_from_context_tracks_reasons:!0,disallow_removing_from_next_tracks_reasons:!0,disallow_reordering_in_context_tracks_reasons:!0,disallow_reordering_in_next_tracks_reasons:!0,disallow_inserting_into_context_tracks_reasons:!0,disallow_inserting_into_next_tracks_reasons:!0,disallow_remote_control_reasons:!0},bi={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},Si={on:Mn.ON,off:Mn.OFF,none:Mn.NONE};function Ti(e,t){if(!e)return[];const n=[],i=[Un.NQ.TRACK,Un.NQ.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=hi.STOPPED;o?e||(t=hi.LOCAL_PLAYER_DISABLED):t=hi.REMOTE_ACTIVATED,this.emit("device_deactivated",{reason:t})})).catch((e=>{vi.warn("Device deactivation checking failed.",e)})),this._suppressed||this.emit("device_info_changed",this._lastDeviceInfoData)}_startProgressTracking(){this._stopProgressTracking(),this._lastProgressMonotonicTime=(0,u.X)(),this._onProgressTracking(),this._trackingIntervalId=setInterval(this._onProgressTracking,500)}_stopProgressTracking(){this._trackingIntervalId&&(clearInterval(this._trackingIntervalId),this._trackingIntervalId=0)}_onProgressTracking(){var e;const t=(0,u.X)(),n=(null===(e=this._lastPlayerState)||void 0===e?void 0:e.playback_speed)||1;this._progressPosition+=n*(t-this._lastProgressMonotonicTime),this.emit("progress",{position:this._progressPosition,timestamp:Date.now()}),this._lastProgressMonotonicTime=t}_generatePlayOptions(e,t){var n;const i={license:null!==(n=this._playerClient.getDeviceLicense())&&void 0!==n?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 m.CONTEXT:o.repeating_context=!0,o.repeating_track=!1;break;case m.TRACK:o.repeating_track=!0,o.repeating_context=!1;break;case m.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((null==e?void 0:e.featureClasses)&&!Array.isArray(e.featureClasses))throw new TypeError("PlayOptions playOrigin.featureClasses must be an array of strings.");return{feature_identifier:(null==e?void 0:e.featureIdentifier)||"harmony",feature_version:(null==e?void 0:e.featureVersion)||this._version,feature_classes:null==e?void 0:e.featureClasses,view_uri:null==e?void 0:e.viewURI,external_referrer:null==e?void 0:e.externalReferrer,referrer_identifier:null==e?void 0:e.referrerIdentifier,restriction_identifier:null==e?void 0:e.restrictionIdentifier}}_generateLoggingParams(e={}){const{pageInstanceId:t,interactionId:n,commandId:i}=e;try{return Promise.resolve({page_instance_ids:t?[t]:[],interaction_ids:n?[n]:[],command_id:Ei(i)})}catch(e){return Promise.reject(e)}}_parseRestrictions(e){const t={};for(const n in e.restrictions)e.restrictions.hasOwnProperty(n)&&yi[n]?t[n]=e.restrictions[n]:yi[n]&&(t[n]=[]);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,p,h;const f=!!(null===(n=e.options)||void 0===n?void 0:n.playback_speed)||!1;if(!f){const t=(0,Un.gH)(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 m=this._parseRestrictions(e),_=jn(m);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=bi[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:Si[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:!f||!!(null==_?void 0:_.setting_playback_speed)},signal_ids:e.signals||[],modes:e.modes||{}},paused:!!e.is_paused,shuffle:!(!e.options||!e.options.shuffling_context),shuffle_mode:Bn(null===(u=e.options)||void 0===u?void 0:u.shuffling_context,null===(d=e.options)||void 0===d?void 0:d.modes),repeat_mode:this._getStateRepeatMode(e),restrictions:m,disallows:_,track_window:t,loading:null!==(h=null===(p=this._state)||void 0===p?void 0:p.loading)&&void 0!==h&&h,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,Un.o_)(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?c.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,Un.o_)(a);if(!a||"spotify:delimiter"===a||c&&(c.type===Un.NQ.AD||c.type===Un.NQ.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?m.TRACK:t&&t.repeating_context?m.CONTEXT:m.OFF}_play(e,t,n){return this._setFilterAndSort(e,n),this._setMetadataOptions(e,n),Promise.all([this._generatePlayOptions(n),this._generateLoggingParams(null==n?void 0:n.loggingParams)]).then((([i,o])=>{const r={context:e,play_origin:this._generatePlayOrigin(n&&n.playOrigin),options:i,logging_params:o};return this._playerClient.play(r,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 vi.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,Un.o_)(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)?Ti(r.tracks):void 0,page_url:null!==(t=Ai(r.pageURL))&&void 0!==t?t:void 0,next_page_url:null!==(n=Ai(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=Ti(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=Ti(e),o=Ti(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._generateLoggingParams(null==t?void 0:t.loggingParams).then((n=>{const i=Object.assign(Object.assign({},t),{logging_params:n});return this._playerClient.transfer(e,i)}))}pause(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((t=>{const n={logging_params:t};return this._playerClient.pause(e,n)}))}resume(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((t=>{const n={logging_params:t};return this._playerClient.resume(e,n)}))}togglePlay(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((t=>{const n={logging_params:t};return this._playerClient.togglePlay(e,n)}))}nextTrack(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((n=>{const i={logging_params:n};return(null==t?void 0:t.track)&&(i.track=b([t.track])[0]),this._playerClient.nextTrack(e,i)}))}previousTrack(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((n=>{const i={logging_params:n};return(null==t?void 0:t.track)&&(i.track=b([t.track])[0]),this._playerClient.previousTrack(e,i)}))}seek(e,t){return this._playerClient.seek(e,t)}setShuffle(e,t,n){return this._generateLoggingParams(null==n?void 0:n.loggingParams).then((n=>{const i={logging_params:n};return this._playerClient.setShuffle(e,t,i)}))}toggleShuffle(e,t){return this._generateLoggingParams(null==t?void 0:t.loggingParams).then((t=>{const n={logging_params:t};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 fi(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"));const i=this._playerClient,r=n.disallows;switch(e){case m.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 m.CONTEXT:return!r.toggling_repeat_context&&i.setOptions({repeating_context:!0,repeating_track:!!r.toggling_repeat_track&&void 0},t);case m.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 fi(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 T(Object.assign({connectClient:this._playerClient,initialContextPlayerState:n,runner:e},t))}return this._queue}sendCustomSignal(e,t,n){return this._generateLoggingParams(null==n?void 0:n.loggingParams).then((i=>this._playerClient.sendCustomSignal(t,{parameters:null==n?void 0:n.parameters,logging_params:i,signal_id:e})))}playAsNextInQueue(e,t,n){return this._generateLoggingParams(null==n?void 0:n.loggingParams).then((n=>{const i={logging_params:n},o=Ti(e);return this._playerClient.playAsNextInQueue(o,t,i)}))}_setContextURIOptions(e,t){return this._client.getDeviceDescriptor().then((n=>{const i=e.split("?")[0],r=n.toTrackPlaybackDeviceInfo(),a=`http://@webgate/track-playback/v1/devices/${r.device_id}/context/${encodeURIComponent(i)}/player_options`,s={player_options:t,device_info:Object.assign(Object.assign({},r),{client_version:this._client.getSDKId()})};return this._transport.request(a,{authorize:!0,method:"POST",headers:{"Content-Type":"application/json"},responseType:"json",payload:JSON.stringify(s)}).then((e=>{if(200!==e.status){const t=new Vn(o.TP_SET_OPTIONS_FAILED_WITH_STATUS,`Track-Playback service responded with ${e.status}`);return t.status=e.status,Promise.reject(t)}return!0})).catch((e=>Promise.reject(e)))}))}_setOptions(e,t,n){return Promise.all([this._generateLoggingParams(null==n?void 0:n.loggingParams),this.getCurrentState()]).then((([i,r])=>{const a={logging_params:i};if(null==n?void 0:n.contextURI){if(!(0,Un.o_)(n.contextURI))return Promise.reject(new TypeError("contextURI is not a valid URI"));if(!((null==r?void 0:r.context.uri)&&(0,Un.B2)(r.context.uri,n.contextURI)))return this._setContextURIOptions(n.contextURI,e)}return r?this._playerClient.setOptions(e,t,a):Promise.reject(new fi(o.CONNECTAPI_CLIENT_NO_STATE,"Nothing playing"))}))}setModes(e,t,n){return this._setOptions({modes:e},t,n)}setShuffleMode(e,t,n){return this.getCurrentState().then((i=>{var r,a;const s=(null==i?void 0:i.disallows)||{};if(s.toggling_shuffle)return Promise.reject(new fi(o.HARMONY_OPERATION_FORBIDDEN,"Shuffle mode cannot be modified."));let c={};if(e===xn.SMART){if(null===(a=null===(r=s.setting_modes)||void 0===r?void 0:r.context_enhancement)||void 0===a?void 0:a.RECOMMENDATION)return Promise.reject(new fi(o.HARMONY_OPERATION_FORBIDDEN,"Setting shuffle mode to SMART is not allowed."));c={shuffling_context:!0,modes:{context_enhancement:"RECOMMENDATION"}}}else c={shuffling_context:!!e,modes:{context_enhancement:"NONE"}};return this._setOptions(c,t,n)}))}}var Oi,Ci=n(4034);!function(e){e.PREMIUM="premium",e.TFT="tft"}(Oi||(Oi={}));const Ri=/connect-state\/v1\/cluster$/,Ni=/^([a-zA-Z0-9_%:-]{1,40}).*$/;function Pi(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 Li="::a_";var ki;!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"}(ki||(ki={}));const wi={[ki.AD_DISALLOW]:_.B.AD_PLAYING,[ki.NARRATION]:_.B.NARRATION};function Di(e){if(!e)return{deviceId:null};const[t,n]=e.split(Li);return{deviceId:t,aliasId:n?parseInt(n,10):void 0}}class Mi extends c.bk{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._lastProcessedTimestamp=0,this._descriptor=e.descriptor,this._transport=e.transport,this._tracker=e.tracker,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(Ri,this._onClusterMessage),this._descriptorPromise=Promise.resolve(this._descriptor).then((e=>(this._localDeviceId=e.id||"",this._localObserverDeviceId=("hobs_"+this._localDeviceId).replace(Ni,"$1"),!0)))}static create(e){return new Mi(e)}_onConnectionId(e){this._connectionId=e,this._autoregister&&this.register()}_onClusterMessage(e){const t=e.payloads&&e.payloads[0];if(!t)return;const n=t.ack_id;n&&this._tracker.trackCommandAcknowledged(n),this._parseCluster(t.cluster)}_resolveTargetDevice(e){return this._descriptorPromise.then((()=>{const t=this._localDeviceId;return Di(e?e===d?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={}){var i,r;n.endpoint=e;const a=(null===(i=n.logging_params)||void 0===i?void 0:i.command_id)||gi();n.logging_params=Object.assign(Object.assign({},n.logging_params),{command_id:a});const s={command:n};return this._tracker.startTracking({commandId:a,commandType:e,interactionIds:null===(r=null==n?void 0:n.loggingParams)||void 0===r?void 0:r.interaction_ids,playOrigin:null==n?void 0:n.play_origin}),this._resolveTargetDevice(t).then((e=>{if(!e.deviceId)throw new fi(o.CONNECTAPI_CLIENT_MISSING_DEVICE_ID,"Operation resulted in a null device id");!s.target_alias_id&&e.aliasId&&(s.target_alias_id=e.aliasId);const t=this._getTargetDeviceInfo(e.deviceId);return this._tracker.trackDeviceInfo(a,t),this._makeEndpoint("v1","player/command",e.deviceId)})).then((e=>this._sendRequest(Ci.I.POST,e,s,a))).then(this._awaitResponseWithAck.bind(this,a)).then((e=>(this._tracker.logCommand(a),e))).catch((e=>{throw this._tracker.logCommand(a),e}))}_sendConnectCommand(e,t=null,n={}){const i="volume"===e?Ci.I.PUT:Ci.I.POST,r="volume"===e||"logout"===e,a=(null==n?void 0:n.command_id)||gi();return this._tracker.startTracking({commandId:a,commandType:e,interactionIds:n.interaction_id?[n.interaction_id]:void 0}),this._resolveTargetDevice(t).then((t=>{if(!t.deviceId)throw new fi(o.CONNECTAPI_CLIENT_MISSING_DEVICE_ID,"Operation resulted in a null device id");t.aliasId&&(r?n.command_options={target_alias_id:t.aliasId}:n.target_alias_id||(n.target_alias_id=t.aliasId));const i=this._getTargetDeviceInfo(t.deviceId);return this._tracker.trackDeviceInfo(a,i),this._makeEndpoint("v1",`connect/${e}`,t.deviceId)})).then((e=>this._sendRequest(i,e,n,a))).then(this._awaitResponseWithAck.bind(this,a)).then((e=>(this._tracker.logCommand(a),e))).catch((e=>{throw this._tracker.logCommand(a),e}))}_sendRequest(e,t,n,i){return this._tracker.trackRequestStart(i),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}}}).catch((e=>Promise.reject(e)))}_awaitResponseWithAck(e,t){var n;if(this._tracker.trackRequestComplete(e,t),404===t.status)return Promise.reject(new fi(o.CONNECTAPI_CLIENT_NO_DEVICE,"No such device."));const i=null===(n=t.body)||void 0===n?void 0:n.ack_id;if(200===t.status&&i){const t=(0,l.u)();return this._tracker.trackAcknowledgementRequired(e,i,t),t.promise}return Promise.resolve(202===t.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){var t;const n=this._lastActiveDevice;this._lastActiveDevice=null,this._lastKnownDevices=[],this._localDevice=null;const i=[];for(const t in e.devices)e.devices.hasOwnProperty(t)&&i.push(t);if(i.sort(),i.length)for(const n of i){const i=this._formatClusterDevice(e,n);this._lastKnownDevices.push(...i);for(const n of i)n.is_active&&(this._lastActiveDevice=n),n.local&&(this._localDevice=n,this._deviceLicense=null===(t=e.devices[n.id])||void 0===t?void 0:t.license)}if(!this._fetchedInitialState||!E(this._lastActiveDevice,n)){const t=e.player_state,i=t&&Pi(t);this.emit("device_state_changed",{deviceState:this._lastActiveDevice,hasOrphanedState:!this._lastActiveDevice&&!!i,disappeared:!!n&&!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,Un.o_)(a.uri))||void 0===o?void 0:o.type;if(e&&"mixed"!==e||(e="audio"),-1===t.capabilities.supported_types.indexOf(`${e}/${r}`))return _.B.INCOMPATIBLE}if(s){const e=s.disallow_transferring_playback_reasons;if(null==e?void 0:e.length)for(const t of e)return wi[t]?wi[t]||null:_.B.UNSUPPORTED}const c=e.active_device_id;if(!t.can_play||c===t.device_id)return _.B.UNAVAILABLE;const l=e.devices[c];return(null==l?void 0:l.license)!==Oi.TFT||t.license===Oi.TFT&&t.device_type!==x.SMARTPHONE?null:_.B.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 fi(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}))}))}_getTargetDeviceInfo(e){let t=null;const n=this._lastKnownDevices;for(const i of n)if(i.id===e){t=i;break}return t}register(){return this._connectionId?this._descriptorPromise.then(this._register.bind(this)):Promise.reject(new fi(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)}))}))}getDeviceLicense(){return this._deviceLicense||null}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 fi(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 fi(o.CONNECTAPI_CLIENT_NO_SESSION_ID,"The current state does not have a session id")):Promise.reject(new fi(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===d),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||d,{transfer_options:o,interaction_id:null===(n=t.logging_params)||void 0===n?void 0:n.interaction_ids[0],command_id:null===(i=t.logging_params)||void 0===i?void 0:i.command_id})}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 fi(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 fi(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 fi(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,n){return this._sendPlayerCommand("set_options",t,Object.assign(Object.assign({},e),n))}setVolume(e,t){if(isNaN(e)||e<0)return Promise.reject(new fi(o.CONNECTAPI_CLIENT_INVALID_VOLUME,"Invalid volume."));const n=Math.round(e*p);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))}}var xi=n(44156);var Ui;!function(e){e.SUCCESS="success",e.ACK_TIMEOUT="ack_timeout",e.HTTP_ERROR="http_error",e.SYSTEM_ERROR="system_error",e.PLAYER_ERROR="player_error",e.UNKNOWN_ERROR="unknown_error"}(Ui||(Ui={}));class Vi{constructor(e){this._commandDataMap={},this._orphanedAcknowledgements={},this._logger=e}startTracking({commandId:e,commandType:t,interactionIds:n,playOrigin:i}){e&&(this._commandDataMap[e]={commandType:t,ackId:null,interactionIds:(n||[]).join(","),playOrigin:i?JSON.stringify(i):void 0,timings:{request:{start:null,end:null},acknowledgement:{start:null,end:null}}})}trackDeviceInfo(e,t){const n=this._commandDataMap[e];n&&t&&(n.deviceInfo={id:t.id,client_id:t.client_id,target_device_brand:t.brand,target_device_model:t.model})}trackRequestStart(e){const t=this._commandDataMap[e];if(!t)return;const n=(0,u.X)();t.timings.request.start=n,t.timings.acknowledgement.start=n}trackRequestComplete(e,t){const n=this._commandDataMap[e];n&&(n.response=t,n.timings.request.end=(0,u.X)())}trackAcknowledgementRequired(e,t,n){const i=this._commandDataMap[e],r=this._orphanedAcknowledgements[t];if(i)if(i.ackId=t,r)i.timings.acknowledgement.end=r.ackTimeMs,r.deferredPromise.resolve(!0),delete this._orphanedAcknowledgements[t];else{const e=setTimeout((()=>{n.reject(new fi(o.CONNECTAPI_CLIENT_ACK_TIMEOUT,"Command didn't receive an acknowledgement within 30000ms"))}),3e4);n.promise.then((t=>(clearTimeout(e),t))),i.deferredPromise=n}}trackCommandAcknowledged(e){const t=(0,u.X)();for(const n in this._commandDataMap){if(!this._commandDataMap.hasOwnProperty(n))continue;const i=this._commandDataMap[n];if(i&&i.ackId===e)return i.deferredPromise&&i.deferredPromise.resolve(!0),void(i.timings.acknowledgement.end=t)}this._waitingOnCommands()&&(this._orphanedAcknowledgements[e]={deferredPromise:(0,l.u)(),ackTimeMs:t},setTimeout((()=>{this._orphanedAcknowledgements[e]&&delete this._orphanedAcknowledgements[e]}),6e4))}logCommand(e){var t;const n=this._commandDataMap[e];if(!n)return Promise.resolve();const i=this._finalizeData(n),{msAckDuration:o,msRequestLatency:r}=this._calculateTimings(n.timings),a={command_id:e,command_type:n.commandType,ms_ack_duration:null!=o?o:null,ms_request_latency:r,interaction_ids:n.interactionIds,play_origin:n.playOrigin,result:i,http_response:n.httpResponse,http_status_code:null===(t=n.response)||void 0===t?void 0:t.status};n.deviceInfo&&(a.target_device_id=n.deviceInfo.id,a.target_device_brand=n.deviceInfo.target_device_brand,a.target_device_model=n.deviceInfo.target_device_model,a.target_device_client_id=n.deviceInfo.client_id);const s=()=>{delete this._commandDataMap[e]};return this._logger.logJSSDKConnectCommand(a).then(s,s)}_finalizeData(e){if(!e.response)return Ui.UNKNOWN_ERROR;const t=e.response.status,n=e.response.getStatusFamily();return 403===t?(e.response.body&&(e.httpResponse=JSON.stringify(e.response.body)),Ui.PLAYER_ERROR):200===t&&e.ackId&&null===e.timings.acknowledgement.end?Ui.ACK_TIMEOUT:n===xi.t.SUCCESS?Ui.SUCCESS:n===xi.t.CONNECTION_ERROR?Ui.SYSTEM_ERROR:t?(e.response.body&&(e.httpResponse=JSON.stringify(e.response.body)),Ui.HTTP_ERROR):Ui.UNKNOWN_ERROR}_calculateTimings(e){const t={};return e.request.start&&e.request.end&&(t.msRequestLatency=(0,u.r)(e.request.start,e.request.end)),e.acknowledgement.start&&e.acknowledgement.end&&(t.msAckDuration=(0,u.r)(e.acknowledgement.start,e.acknowledgement.end)),t}_waitingOnCommands(){let e=!1;for(const t in this._commandDataMap){if(!this._commandDataMap.hasOwnProperty(t))continue;const n=this._commandDataMap[t];if(n&&!n.response){e=!0;break}}return e}}const Fi=Object.assign(Object.assign(Object.assign({},o),r.L),i);function Bi(e){var t;const n=e.transport;if(!n)throw new TypeError("No Transport instance provided");const i=function(e){return J.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=ui(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=Mi.create({autoregister:!("autoregister"in t)||t.autoregister,descriptor:e.getClientDescriptor(),transport:n,tracker:new Vi(e.getLogger())});return Ii.create({client:e,playerClient:o,version:i,serverTime:pi.create(n),decorateTrackWindow:"boolean"!=typeof t.decorateTrackWindow||t.decorateTrackWindow,disableProgress:t.disableProgress})}(i,r);return I.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})}},9926:(e,t,n)=>{"use strict";n.d(t,{qY:()=>T,ns:()=>I});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,h=t.locale,f=t.env,m=t.triggers,_=d({formats:p,triggers:m});return _.length>0?(l&&console.error("In-App Messaging: Please fix the following request errors: "+_.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)})),h=r("trigger",p),f=r("ctv_type",o),m=r("action",t),_="@webgate/"+d+"messages?"+f+h+m+"locale="+a+"&trig_type="+u[0].type;return[_,s(n,i)]}({actions:n,app:i,appUri:o,formats:p,locale:h,env:f,triggers:m}))).then((function(e){return a(e)}))}var h=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},f=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,f(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 _=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)}}},g=["DISMISS","URL","EXTERNAL_URL","SELECT_OPTION"];function E(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,g.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")||v)+"px",e.style.height=t.body.scrollHeight+"px")}(i),t()}),{once:!0}),i}var v=500;var y=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)},22239:(e,t,n)=>{"use strict";n.d(t,{q:()=>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}}},38461:(e,t,n)=>{"use strict";n.d(t,{wi:()=>an,t5:()=>ae,tE:()=>rn,JM:()=>sn});var i=n(86070),o=n(30758);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:d,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:M?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:M?5e3:3e3,compare:function(e,t){return b(e)==b(t)},isPaused:function(){return!1},cache:Y,mutate:z,fallback:{}},N),J=function(e,t){var n=_(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=_(o,a))}return n},q=(0,o.createContext)({}),X=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())}},$={dedupe:!0},Z=(h.defineProperty((function(e){var t=e.value,n=J((0,o.useContext)(q),t),i=t&&t.provider,r=(0,o.useState)((function(){return i?W(i(n.cache||Y),t):p}))[0];return r&&(n.cache=r[0],n.mutate=r[1]),w((function(){return r?r[2]:p}),[]),(0,o.createElement)(q.Provider,_(e,{value:n}))}),"default",{value:K}),s=function(e,t,n){var i=n.cache,s=n.compare,c=n.fallbackData,l=n.suspense,u=n.revalidateOnMount,d=n.refreshInterval,h=n.refreshWhenHidden,g=n.refreshWhenOffline,E=U.get(i),v=E[0],y=E[1],b=E[2],S=E[3],T=x(e),A=T[0],I=T[1],O=T[2],C=(0,o.useRef)(!1),R=(0,o.useRef)(!1),N=(0,o.useRef)(A),P=(0,o.useRef)(t),D=(0,o.useRef)(n),M=function(){return D.current},F=function(){return M().isVisible()&&M().isOnline()},G=function(e){return i.set(O,_(i.get(O),e))},W=i.get(A),j=f(c)?n.fallback[A]:c,Y=f(W)?j:W,z=i.get(O)||{},K=z.error,J=!C.current,q=function(){return J&&!f(u)?u:!M().isPaused()&&(l?!f(Y)&&n.revalidateIfStale:f(Y)||n.revalidateIfStale)},Z=!(!A||!t)&&(!!z.isValidating||J&&q()),Q=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 w((function(){i.current=e})),[i,r.current,a]}({data:Y,error:K,isValidating:Z},R),ee=Q[0],te=Q[1],ne=Q[2],ie=(0,o.useCallback)((function(e){return r(void 0,void 0,void 0,(function(){var t,o,r,c,l,u,d,h,_,g,E,v,y;return a(this,(function(a){switch(a.label){case 0:if(t=P.current,!A||!t||R.current||M().isPaused())return[2,!1];c=!0,l=e||{},u=!S[A]||!l.dedupe,d=function(){return!R.current&&A===N.current&&C.current},h=function(){var e=S[A];e&&e[1]===r&&delete S[A]},_={isValidating:!1},g=function(){G({isValidating:!1}),d()&&ne(_)},G({isValidating:!0}),ne({isValidating:!0}),a.label=1;case 1:return a.trys.push([1,3,,4]),u&&(V(i,A,ee.current.data,ee.current.error,!0),n.loadingTimeout&&!i.get(A)&&setTimeout((function(){c&&d()&&M().onLoadingSlow(A,n)}),n.loadingTimeout),S[A]=[t.apply(void 0,I),B()]),y=S[A],o=y[0],r=y[1],[4,o];case 2:return o=a.sent(),u&&setTimeout(h,n.dedupingInterval),S[A]&&S[A][1]===r?(G({error:p}),_.error=p,E=b[A],!f(E)&&(r<=E[0]||r<=E[1]||0===E[1])?(g(),u&&d()&&M().onDiscarded(A),[2,!1]):(s(ee.current.data,o)?_.data=ee.current.data:_.data=o,s(i.get(A),o)||i.set(A,o),u&&d()&&M().onSuccess(o,A,n),[3,4])):(u&&d()&&M().onDiscarded(A),[2,!1]);case 3:return v=a.sent(),h(),M().isPaused()||(G({error:v}),_.error=v,u&&d()&&(M().onError(v,A,n),("boolean"==typeof n.shouldRetryOnError&&n.shouldRetryOnError||m(n.shouldRetryOnError)&&n.shouldRetryOnError(v))&&F()&&M().onErrorRetry(v,A,n,ie,{retryCount:(l.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return c=!1,g(),d()&&u&&V(i,A,_.data,_.error,!1),[2,!0]}}))}))}),[A]),oe=(0,o.useCallback)(H.bind(p,i,(function(){return N.current})),[]);if(w((function(){P.current=t,D.current=n})),w((function(){if(A){var e=A!==N.current,t=ie.bind(p,$),n=0,i=X(A,y,(function(e,t,n){ne(_({error:t,isValidating:n},s(ee.current.data,e)?p:{data:e}))})),o=X(A,v,(function(e){if(0==e){var i=Date.now();M().revalidateOnFocus&&i>n&&F()&&(n=i+M().focusThrottleInterval,t())}else if(1==e)M().revalidateOnReconnect&&F()&&t();else if(2==e)return ie()}));return R.current=!1,N.current=A,C.current=!0,e&&ne({data:Y,error:K,isValidating:Z}),q()&&(f(Y)||L?t():k(t)),function(){R.current=!0,i(),o()}}}),[A,ie]),w((function(){var e;function t(){var t=m(d)?d(Y):d;t&&-1!==e&&(e=setTimeout(n,t))}function n(){ee.current.error||!h&&!M().isVisible()||!g&&!M().isOnline()?t():ie($).then(t)}return t(),function(){e&&(clearTimeout(e),e=-1)}}),[d,h,g,ie]),(0,o.useDebugValue)(Y),l&&f(Y)&&A)throw P.current=t,D.current=n,R.current=!1,f(K)?ie($):K;return{mutate:oe,get data(){return te.data=!0,Y},get error(){return te.error=!0,K},get isValidating(){return te.isValidating=!0,Z}}},function(){for(var e=[],t=0;t0;)u=d[p](u);return u(r,a||l.fetcher,l)}),Q=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())}))},ee=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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{"use strict";n.d(t,{LW:()=>zt,pM:()=>Bt,ci:()=>Ht,X7:()=>Qt,Wq:()=>en,a2:()=>Zt});var i,o=n(57128),r=n(80117),a=n(80521),s=n(74987),c=n(22239),l=n(86380);!function(e){e.FRAGMENT_FETCHED="fragment_fetched",e.FRAGMENT_FETCH_ERROR="fragment_fetch_error",e.VIDEO_PROFILE_CHANGED="video_profile"}(i||(i={}));var u,d,p,h,f,m;!function(e){e.URL="URL",e.MSE="MSE"}(u||(u={})),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_MUTED="muted",e.PLAYER_UNMUTED="unmuted",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"}(d||(d={})),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"}(p||(p={})),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"}(h||(h={})),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"}(f||(f={})),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"}(m||(m={}));class _ 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 _(e,t);return n.unrecoverable=!0,n}}n(28360);var g=n(30353);class E extends Error{constructor(e=h.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=h.EME_ERROR_UNKNOWN,t){const n=new E(e,t);return n.unrecoverable=!0,n}}class v extends Error{constructor(e,t){super(t),this.name="CappingError",this.message=t,this.code=e}}function y(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 b extends a.Vk{constructor(e){super(d.KEY_SESSION_MESSAGE,null),this.messageType="license-request",this.message=e}}class S extends a.bk{constructor(e){super(),this._nativeKeySession=null,this._lastUpdateDeferred=(0,g.u)(),this._lastGenerateDeferred=(0,g.u)(),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(d.MS_KEY_ADDED,this._onKeyAdded),e.addEventListener(d.MS_KEY_ERROR,this._onKeyError),e.addEventListener(d.MS_KEY_MESSAGE,this._onKeyMessage))}_detach(){const e=this._nativeKeySession;e&&(e.removeEventListener(d.MS_KEY_ADDED,this._onKeyAdded),e.removeEventListener(d.MS_KEY_ERROR,this._onKeyError),e.removeEventListener(d.MS_KEY_MESSAGE,this._onKeyMessage))}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new b(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(d.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(d.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 T{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(d.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.msSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(d.MEDIA_LOADEDMETADATA,n),e.addEventListener(d.MS_NEEDKEY,y),t()}))}detach(e){this._lastBoundSetter&&(e.removeEventListener(d.MS_NEEDKEY,y),e.removeEventListener(d.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(){return Promise.reject(new E(h.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){return new S(this._nativeMediaKeys)}}function A(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 I{constructor(e,t){if(this._configuration=null,this.keySystem=e,!this._checkConfig(t))throw new E(h.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 T(this.keySystem))}))}}const O=r.m.forTag("eme_polyfill.v0_1b");class C extends a.bk{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 b(e)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null)}updateComplete(){this._lastUpdateDeferred&&(this._lastUpdateDeferred.resolve(!0),this._lastUpdateDeferred=null),this.emit(d.KEY_SESSION_STATUSES_CHANGE,null)}handleErrorEvent(e){const t=new E(h.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(d.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,g.u)();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){O.warn("Could not close keysession",e)}return Promise.resolve(!0)}}class R{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+d.V0_1B_NEEDKEY,y);const n=e.addEventListener.bind(e);n(t+d.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+d.V0_1B_KEY_ERROR,this._onKeyError),n(t+d.V0_1B_KEY_MESSAGE,this._onKeyMessage)}detach(e){this._mediaElement=null;const t=this._prefix;e.removeEventListener(t+d.V0_1B_NEEDKEY,y);const n=e.removeEventListener.bind(e);n(t+d.V0_1B_KEY_ADDED,this._onKeyAdded),n(t+d.V0_1B_KEY_ERROR,this._onKeyError),n(t+d.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):O.warn("Got keymessage without session.")}_onKeyAdded(e){const t=this._getSession(e.sessionId);t?t.updateComplete():O.warn("Got keyadded without session.")}_onKeyError(e){const t=this._getSession(e.sessionId);t?t.handleErrorEvent(e):O.warn("Got keyerror without session.")}setServerCertificate(){return Promise.reject(new E(h.EME_CANNOT_SET_CERTIFICATE_FOR_PLATFORM,"Cannot set server certificate on this platform."))}createSession(){const e=new C(this._keySystem,this._mediaElement,this._prefix);return this._waitingForSessionIds.push(e),e}}function N(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 P{constructor(e,t,n){if(this._configuration=null,this.keySystem=e,this._prefix=n,!this._checkConfig(t))throw new E(h.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 R(this.keySystem,this._prefix))}))}}function L(e){navigator.requestMediaKeySystemAccess=function(t,n){return new Promise((i=>{i(new P(t,n,e))}))};const t=HTMLMediaElement.prototype;delete t.mediaKeys,t.setMediaKeys=N}const k=r.m.forTag("eme_polyfill.safari");class w extends a.bk{constructor(e,t){super(),this._attached=!1,this._nativeKeySession=null,this._lastGenerateResolver=(0,g.u)(),this._lastUpdateResolver=(0,g.u)(),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(d.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.addEventListener(d.WEBKIT_KEY_ADDED,this._onKeyAdded),e.addEventListener(d.WEBKIT_KEY_ERROR,this._onKeyError)):k.warn("Tried to attach with no WebKitMediaKeySession")}_detach(){if(!this._attached)return;const e=this._nativeKeySession;e?(e.removeEventListener(d.WEBKIT_KEY_MESSAGE,this._onKeyMessage),e.removeEventListener(d.WEBKIT_KEY_ADDED,this._onKeyAdded),e.removeEventListener(d.WEBKIT_KEY_ERROR,this._onKeyError)):k.warn("Tried to detach with no WebKitMediaKeySession")}_onKeyMessage(e){e.message&&e.message.buffer&&(this.emitEvent(new b(e.message.buffer)),this._lastGenerateResolver&&(this._lastGenerateResolver.resolve(!0),this._lastGenerateResolver=null))}_onKeyAdded(){this._lastUpdateResolver&&(this._lastUpdateResolver.resolve(!0),this._lastUpdateResolver=null),this.emit(d.KEY_SESSION_STATUSES_CHANGE,null)}_onKeyError(){const e=this._nativeKeySession&&this._nativeKeySession.error,t=new E(h.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 E(h.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,g.u)();if(this._lastUpdateResolver=t,!this._nativeKeySession)return k.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 D{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(d.MEDIA_LOADEDMETADATA,n),this._lastBoundSetter=null,e.webkitSetMediaKeys(this._nativeMediaKeys)};this._lastBoundSetter=n,e.addEventListener(d.MEDIA_LOADEDMETADATA,n),e.addEventListener(d.WEBKIT_NEEDKEY,y),t()}))}detach(e){e.removeEventListener(d.WEBKIT_NEEDKEY,y),this._lastBoundSetter&&(e.removeEventListener(d.MEDIA_LOADEDMETADATA,this._lastBoundSetter),this._lastBoundSetter=null)}setServerCertificate(e){return this._serverCertificate=new Uint8Array(e),Promise.resolve(!0)}createSession(){if(!this._serverCertificate)throw new E(h.EME_INVALID_STATE_ERROR,"The server certificate is not available");return new w(this._nativeMediaKeys,this._serverCertificate)}}class M{constructor(e,t){this.keySystem=e;const n=this._checkConfig(t);if(!n)throw new E(h.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 D(this.keySystem))}))}}function x(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 U=r.m.forTag("eme_polyfills.tester");function V(){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)?(U.log("Using native EME implementation."),"native"):"undefined"!=typeof HTMLMediaElement&&(null===HTMLMediaElement||void 0===HTMLMediaElement?void 0:HTMLMediaElement.prototype.webkitGenerateKeyRequest)?(U.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)?(U.log("Detected Unprefixed EME v0.1b. Polyfilling."),L(),"v0.1b"):"undefined"!=typeof MSMediaKeys?(U.log("Detected MS IE EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new I(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=A}(),"ms-ie"):"function"==typeof WebKitMediaKeys?(U.log("Detected Safari EME. Polyfilling."),function(){navigator.requestMediaKeySystemAccess=function(e,t){return new Promise((n=>{n(new M(e,t))}))};const e=HTMLMediaElement.prototype;delete e.mediaKeys,e.setMediaKeys=x}(),"safari"):(U.warn("Detected no EME APIs."),null)}const F={[p.WIDEVINE]:{commonName:"widevine",licenseServer:"https://@webgate/widevine-license",withCertificate:!0,pssh_field:{audio:"pssh_widevine",video:"encryption_data"}},[p.PLAYREADY]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[p.PLAYREADY_HARDWARE]:{commonName:"playready",licenseServer:"https://@webgate/playready-license",withCertificate:!1,pssh_field:{audio:"pssh_playready",video:"encryption_data"}},[p.FAIRPLAY]:{commonName:"fairplay",licenseServer:"https://@webgate/fairplay-license",withCertificate:!0,pssh_field:{audio:"pssh_fairplay",video:"asset_id"}},[p.INVALID_SPOTIFY_KEY]:{commonName:"spotify-invalid",licenseServer:"https://@webgate",withCertificate:!1,pssh_field:{audio:"pssh_invalid",video:"encryption_data"}}},B=[{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/mp4; codecs="mp4a.40.5"',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"}],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/mp4; codecs="mp4a.40.5"',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/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/mp4; codecs="mp4a.40.5"',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/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"},{contentType:'audio/mp4; codecs="mp4a.40.5"',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:""},{contentType:'audio/mp4; codecs="mp4a.40.5"',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"},{contentType:'audio/mp4; codecs="mp4a.40.5"',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:""},{contentType:'audio/mp4; codecs="mp4a.40.5"',robustness:""}],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:"optional",sessionTypes:["temporary"]}];function H(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 G=/([^;]+)(?:;\s?codecs="(.*)")?/;function W(e){var t;const[,n="unknown",i="unknown"]=null!==(t=e.match(G))&&void 0!==t?t:[];return{mimeType:n,codec:i,contentType:e}}const j=/([^;]+)(?:;\s?codecs="(.*)")?/,Y=r.m.forTag("playback.eme_manager"),z={EMPTY:"-no-robustness",SW_CRYPTO:"-sw-crypto",SW_DECODE:"-sw-decode",HW_CRYPTO:"-hw-crypto",HW_DECODE:"-hw-decode",HW_ALL:"-hw-all"};function K(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=K(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=K(e.videoCapabilities,n))&&void 0!==a?a:void 0,!c)?null:Object.assign(Object.assign({},e),{audioCapabilities:s,videoCapabilities:c})}class q extends a.bk{constructor(e){var t;super(),this._unauthServerCertificateBase="",this._disallowCodecs={},this._keySystemDeferred=(0,g.u)(),this._configuration=(0,g.u)(),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&&z.hasOwnProperty(i)&&t.push(z[i])}}return new RegExp(`(${t.join("|")})$`)}(e.disallowRobustnessValues||[]),this._disallowCodecs=e.disallowCodecs,this._preferredKeySystems=e.preferredKeySystems||[p.WIDEVINE,p.PLAYREADY,p.PLAYREADY_HARDWARE,p.FAIRPLAY]}static create(e){return new Promise((t=>{const n=V();if(!n)throw E.fatal(h.EME_API_NOT_SUPPORTED,"Platform does not support navigator.requestMediaKeySystemAccess");t(new q(Object.assign(Object.assign({},e),{emeImpl:n})).init())}))}_prepareConfiguration(e){const t=e.getConfiguration();Y.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=F[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(j))&&void 0!==t?t:[];e&&n.push({contentType:i.contentType,mimeType:e,codec:null!=o?o:""})}return n}_appendProbableMediaCapabilities(e,t){const n=H(this._configs,(t=>(-1===t.indexOf("webm")||e!==p.PLAYREADY&&e!==p.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=>(Y.warn("Error from setting server certificate",e),this)))}_cacheServerCertificate(e){let t="";switch(e){case p.FAIRPLAY:t="fairplay";break;case p.WIDEVINE:t="widevine";break;default:return Promise.resolve(this)}return this._requestServerCertificate(`${this._unauthServerCertificateBase}/${t}-license`,!1).then((()=>this),(e=>(Y.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 i=null;const o=new Uint16Array(e),r=String.fromCharCode.apply(null,o);if(-1===r.indexOf("PlayReadyKeyMessage"))return Y.info("Using unextracted PlayReady message."),e;const a=(new DOMParser).parseFromString(r,"application/xml"),s=a.getElementsByTagName("Challenge")[0],c=null===(n=null==s?void 0:s.childNodes[0])||void 0===n?void 0:n.nodeValue;if(c)try{i=atob(c);const e=a.getElementsByTagName("name"),t=a.getElementsByTagName("value");if(e.length!==t.length)throw new E(h.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")}catch(e){this.emit(d.EME_LICENSE_REQUEST_ERROR,{signal:t,error:e}),i=null}else this.emit(d.EME_LICENSE_REQUEST_ERROR,{signal:t,error:new E(h.EME_HEADER_KEY_VALUE_MISMATCH,"Mismatched header / pair in key message")});return i}_onMessage(e,t){e.timeMap.generate.end=(0,l.X)();let n="message"in t?t.message:null;const i="messageType"in t?t.messageType:void 0;if(Y.info("Got EME message event with type",i),n&&e.keySystem===p.PLAYREADY&&(n=this._extractPlayReadyChallenge(n,e.signal)),!n)return void Y.info("Ignoring message event: no valid request payload");if(!e.licenseServer)return void Y.info("Ignoring message event: no licenseServer url");e.timeMap.request.start=(0,l.X)();let o=e.licenseServer;e.keySystem===p.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(d.EME_LICENSE_REQUEST_ERROR,{signal:e.signal,error:t})};let i,o;if(e.timeMap.request.end=(0,l.X)(),200!==t.status){try{if(t.body){const e=new Uint8Array(t.body),n=String.fromCharCode.apply(String,e);o=JSON.parse(n).errorMsg}}catch(e){}402===t.status?this.emit(d.EME_LICENSE_REQUEST_CAPPED,{signal:e.signal,error:new v(h.CAPPING_USER_IS_CAPPED,"User is capped.")}):400===t.status&&"widevine error"===o?(i=E.fatal(h.EME_LICENSE_REQUEST_WIDEVINE_ERROR,"Widevine license server failed to parse request."),i.status=t.status,i.shouldRefreshEndpoint=!0,n(i)):(i=new E(h.EME_LICENSE_REQUEST_FAILED_WITH_STATUS,`License request failed (${o||"unknown"})`),i.status=t.status,i.shouldRefreshEndpoint=400===t.status||403===t.status,n(i))}else{if(!t.body)return i=new E(h.EME_LICENSE_REQUEST_EMPTY_RESPONSE,"Empty license response body"),i.status=t.status,void n(i);try{e.timeMap.update.start=(0,l.X)(),e.keySession.update(t.body).catch((e=>{n(new E(h.EME_LICENSE_UPDATE_FAILED,e.message||"License update failed."))})),Y.info("KeySession updated.")}catch(e){const{message:t}=e;n(new E(h.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(E.fatal(h.EME_MEDIA_KEYS_NOT_SUPPORTED,"Cannot create MediaKeys from KeySystemAccess"));e.keySystem===p.FAIRPLAY&&t.setServerCertificate(new ArrayBuffer(0));try{if(!t.createSession())throw new Error("")}catch(e){const{message:t}=e;return Promise.reject(E.fatal(h.EME_MEDIA_KEY_SESSION_NOT_SUPPORTED,t||"Cannot create MediaKeySession from KeySystemAccess"))}return Promise.resolve(e)}),(e=>(Y.error(e.name),Promise.reject(E.fatal(h.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(d.KEY_SESSION_MESSAGE,n.onMessageListener),n.onKeyStatusChangeListener&&t.removeEventListener(d.KEY_SESSION_STATUSES_CHANGE,n.onKeyStatusChangeListener);const i=Promise.resolve(t.close()).catch((e=>{Y.warn("Failed to close KeySession",e)}));e.push(i),n.keySession=null,n.onMessageListener=null,n.onKeyStatusChangeListener=null,Y.info("Closed KeySession")}catch(e){Y.warn("Failed to close KeySession",e)}return this._keySessions=[],Promise.all(e)}init(){const e=[];for(let t of B)if(!t.label||!this._configFilter.test(t.label)){if(this._disallowCodecs){const e=J(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 p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;const i=e;n.push(navigator.requestMediaKeySystemAccess(p[i],this._configs).then((e=>{t[e.keySystem]=e})).catch((()=>{})))}return Promise.all(n).then((()=>this._selectKeySystem(t))).then((e=>e?(Y.info("Supported keySystem: ",e.keySystem),this._testMediaKeys(e)):Promise.reject(new E(h.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||h.EME_NO_SUPPORTED_KEYSYSTEM,i=t.message||"No supported keysystem";return e.reject(E.fatal(n,i)),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 E(h.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)=>{Y.info("Creating KeySession",e.keySystem);const i=e.mediaKeys.createSession(),o={generate:{start:null,end:null},request:{start:null,end:null},update:{start:null,end:null}},r=this._keySystemSettings&&this._keySystemSettings.licenseServer||void 0,a=this._onMessage.bind(this,{keySystem:e.keySystem,keySession:i,licenseServer:e.licenseServer||r,signal:e.signal,timeMap:o});i.addEventListener(d.KEY_SESSION_MESSAGE,a);const s=()=>{Y.info("KeyStatus change"),o.update.end=(0,l.X)();const e=e=>null!==e.start&&null!==e.end?(0,l.r)(e.start,e.end):0;t({elapsed:{generate:e(o.generate),request:e(o.request),update:e(o.update)}})};return i.addEventListener(d.KEY_SESSION_STATUSES_CHANGE,s),this._saveSession({keySession:i,onMessageListener:a,onKeyStatusChangeListener:s}),Y.info("Generating KeySession request",e.keySystem),o.generate.start=(0,l.X)(),Promise.resolve(i.generateRequest(e.initDataType,e.initData.buffer)).catch((e=>{if(!e)return;let t;switch(e.name){case"NotSupportedError":t=h.EME_NOT_SUPPORTED_ERROR;break;case"InvalidStateError":t=h.EME_INVALID_STATE_ERROR;break;default:t=h.EME_UNKNOWN_ERROR}n(new E(t,e.message||"Unknown error message."))}))}))}}var X;!function(e){e.SHOWING="showing",e.HIDDEN="hidden",e.DISABLED="disabled"}(X||(X={}));const $=Array.prototype.slice,Z="function"==typeof Array.from?e=>Array.from(e):e=>$.call(e);function Q(e,t){const n=Z(e.getElementsByTagName(t));for(const t of n)e.removeChild(t)}function ee(e){const t=e;return{id:t.id,text:t.text}}const te="visible",ne="hidden",ie=/^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$|[A-Za-z]{2,3}-x-cc/;class oe extends a.bk{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(d.PLAYER_DISPLAYED_CUES_CHANGED,{cues:this._displayedCues.map(ee)})}_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?te:ne}));const i=this._player.textTracks;for(let e=0,t=i.length;e=1?this._switchActiveTextTrack():this._currentVideoContent&&e.addEventListener(d.MEDIA_LOADEDMETADATA,this._onLoadedMetadata)}_switchActiveTextTrack(){const e=this._player;if(!e||!this._currentVideoContent)return;const t=this._updateActiveLanguage();let n=null,i=null;Z(e.getElementsByTagName("track")).forEach((e=>{e.default&&(n=e),e.srclang.toLowerCase()===t&&(i=e)})),n&&(n.default=!1,n.track.mode=X.DISABLED,this._unsubscribeFromCueEvents()),i&&(i.default=!0,i.track.mode=this._isVisible?X.SHOWING:X.HIDDEN,this._deactivateListeners||this._subscribeToCueEvents(i))}_onLoadedMetadata(){const e=this._player;if(e&&(Q(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?te:ne,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(d.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(!ie.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=[],Q(e,"track"),e.removeEventListener(d.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.crossOrigin=this._crossOrigin)}visible(){return this._isVisible}}class re extends Error{constructor(e=h.STORAGE_ERROR,t="File Error"){super(t),this.canPlayNext=!0,this.debug={},this.code=e,this.message=t,this.name="FileError"}}class ae{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}}var se=n(82620);function ce(e){const t=se.X.decode(e),n=new Uint8Array(t.length);for(let e=0,i=t.length;e=parseInt(l,16)}function pe(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 he(e,t){return void 0!==t&&Array.isArray(e.encryption_indices)&&-1===e.encryption_indices.indexOf(t)}function fe(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 me(e){return"audio_codec"in e?e.audio_codec:e.video_codec}function _e(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=me(a);!(t in a)||he(a,o)||fe(a,r)||("unknown-codec"!==l||a.mime_type!==e.mimeType||i!==e.codec&&!de(e.codec,i)?a.mime_type===c&&(i===l||s&&de(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 pe(n,a)}return[]}function ge(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 Ee extends ae{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=(0,l.r)(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 ve(e){return!!e&&"getMediaProfileInfo"in e}function ye(e){return!!e&&"getCurrentBitrates"in e&&"canLowerBitrate"in e&&"adaptToBandwidth"in e}function be(e){return!!e&&"getTrackingEventData"in e&&"getTrackingEvents"in e}class Se{constructor(e){this.bandwidthEstimator=e.bandwidthEstimator}static create(e){return new Se(e)}getSample(e,t){var n,i,o,r,a,s,c;const l=this.bandwidthEstimator.getBandwidthEstimate(),d=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:ge(i.selected)},audio:{bitrate:null===(c=n.selected)||void 0===c?void 0:c.audio_bitrate,mimeType:ge(n.selected)}}}return null}}const Te=r.m.forTag("playback.audio_processor");class Ae{constructor(e){this._audioContext=null,this._mediaElementSource=null,this._gainNode=null,this._nodes=[],(null==e?void 0:e.disable)?Te.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)):Te.warn("The AudioContext API is not supported. Any future operation related to `AudioProcessor` will be skipped."))}static create(e){return new Ae(e)}_setMediaElementSource(e){var t;this._audioContext&&(this._mediaElementSource&&(Te.info("Disconnecting previous media element source"),this._mediaElementSource.disconnect()),Te.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;Te.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),Te.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):Te.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 Te.info("The default gain node is not available"),!1;const t=Math.pow(10,e/20);return this._gainNode.gain.value=t,Te.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,Te.info("The AudioProcessor is destroyed")}}const Ie=r.m.forTag("playback.media_source_manager");function Oe(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 Ce extends a.bk{constructor(e){super(),this._mediaSource=null,this._sourceBuffers={},this._currentInitSegments={},this._updateQueue=[],this._playId=0,this._lastBufferClearTime=(0,l.X)(),this._customSourceBufferParams="";const{mimeTypes:t,customSourceBufferParams:n,disableBufferAbort:i}=e;this._mimeTypes=t,this._customSourceBufferParams=Oe(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 Ce(e)}_init(){this._mediaSource=new MediaSource,this._mediaSource.addEventListener(d.MEDIA_SOURCE_OPEN,this._onSourceOpen),this._mediaSource.addEventListener(d.MEDIA_SOURCE_CLOSE,this._onSourceClose),this._sourceBuffers={},this._currentInitSegments={}}_onSourceOpen(){var e;Ie.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;Ie.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(d.SOURCE_BUFFER_UPDATE_END,this._onUpdateEnd),this._sourceBuffers[i]=n}}}this.dequeueUpdates(),this.emit(d.BUFFER_SOURCE_OPEN,null)}_onSourceClose(){Ie.info("MediaSource closed."),this._destroySourceBuffers(),this.emit(d.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?Ie.info(`Injected combined init segment and playable segment (${e.mimeType}, ${e.profileId})`):e.init&&Ie.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 Ie.info("Try update dropped: playId has changed"),void this._abortUpdate(e);if(e.timestamp{this.tryUpdate({playId:this._playId,timestamp:(0,l.X)(),type:"duration",duration:e,resolve:t})}))}getMediaSource(){return this._mediaSource}setPlayId(e){this._playId=e}getPlayId(){return this._playId}}const Re=r.m.forTag("playback.buffer_fill_operation");class Ne{constructor(e){var t;this._batchSize=1,this._prioritizeFirst=!1,this._segmentsToAppend=[],this._abortController=(0,s.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--;){const n=t.start(e),o=t.end(e);if(n<=i.timeStart&&(o>=i.timeEnd||o+1e-5>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));Re.log(`Segments to download: ${r.length}/${o}`);const a=(0,l.X)();Promise.all(r.map((t=>this._getBufferSetForSegment(t,e).then((n=>e.aborted?Promise.resolve([!1]):this._appendBufferData(n,t,a)))))).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),Re.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!==s.TransportErrors.HTTP_REQUEST_ABORTED?(this.status="failed",null===(t=this._resolveDone)||void 0===t||t.call(this),this._clear(),Re.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",Re.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):(Re.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&&Re.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 Pe,Le;!function(e){e[e.AUDIO=12]="AUDIO",e[e.VIDEO=20]="VIDEO"}(Pe||(Pe={}));class ke extends a.bk{constructor(e,t={},n={}){var i,o;super(),this._bufferTarget={audio:Pe.AUDIO,video:Pe.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)||Pe.AUDIO,this._bufferTarget.video=(null===(o=n.bufferTarget)||void 0===o?void 0:o.video)||Pe.VIDEO,this._mediaSourceManager=Ce.create({mimeTypes:t,noInit:a,customSourceBufferParams:r,disableBufferAbort:s}),this.proxyEmitAll(this._mediaSourceManager,{[d.BUFFER_SOURCE_OPEN]:d.BUFFER_SOURCE_OPEN,[d.BUFFER_SOURCE_CLOSE]:d.BUFFER_SOURCE_CLOSE,[d.BUFFER_QUOTA_EXCEEDED]:d.BUFFER_QUOTA_EXCEEDED,[d.BUFFER_UPDATE_END]:d.BUFFER_UPDATE_END})}static create(e,t={},n={}){return new ke(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,a=r.getMediaSource();if(!a||"closed"===a.readyState)return;let c=t;if(c>=a.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=p+(u-h);if(!o||"started"!==o.status||o.timeStartf){null==o||o.abort();const t=r.getPlayId();this._currentFillOperation=new Ne({timeStart:p,timeEnd:f,getBufferedTimeRanges:()=>{var e,t;return null!==(t=null===(e=a.sourceBuffers[a.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!==s.TransportErrors.HTTP_REQUEST_ABORTED&&this.emit(d.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=(0,l.X)(),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 we extends ae{constructor(e){super(e),this.strategy=u.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 re(h.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"}(Le||(Le={}));const De={[Le.MP3_256]:"audio/mp3",[Le.MP3_320]:"audio/mp3",[Le.MP3_160]:"audio/mp3",[Le.MP3_96]:"audio/mp3",[Le.MP4_128]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_256]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_128_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_256_DUAL]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_128_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_256_CBCS]:'audio/mp4; codecs="mp4a.40.2"',[Le.MP4_FLAC]:'audio/mp4; codecs="flac"'};class Me extends ae{constructor(e){if(super(e),this._loaded=!1,this._lastResolveToken=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=F[this._keySystem],this._fileFormat=e.fileFormat,this._disableCache=e.disableCache,this._preloadedManifest=e.preloadedManifest,this._preresolvedURL=e.preresolvedURL,this._fileFormat)this._mimeType=De[this._fileFormat];else switch(this._mediaFormat){case m.MP3:this._mimeType=De[Le.MP3_160];break;case m.MP4:case m.MP4_DUAL:case m.MP4_CBCS:this._mimeType=De[Le.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._lastResolveTime=(0,l.X)(),this._resolver.getCDNURL(t,this._fileFormat).then((t=>(e&&this._lastResolveTime&&(e.resolveLatency=(0,l.r)(this._lastResolveTime)),t)))),i=this._lastResolveTime?(0,l.r)(this._lastResolveTime):1/0;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=(0,l.X)();return this._resolver.getManifest(this._fileId).then((n=>(e&&(e.manifestLatency=(0,l.r)(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===p.INVALID_SPOTIFY_KEY)return this._pssh=new Uint8Array(0),this;let i;const o=this._keySystemSettings.pssh_field.audio;let r=function(e,t){return t.hasOwnProperty(e)}(o,t)?t[o]:null;if(!r&&"pssh_widevine"===o&&"pssh"in t&&(r=null!==(n=t.pssh)&&void 0!==n?n:null),!r)return i=new re(h.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._pssh=ce(r),"segments"in t&&t.segments)this._calculateSegments(t);else{if(!("references"in t)||!t.references)return i=new re(h.FILE_MALFORMED_SEEKTABLE,"Malformed seektable."),i.track=this.toLogJSON(),Promise.reject(i);this._calculateSegmentsV1(t)}return this}))}isProtected(){return!!this._protection&&!!this._pssh}getMediaTypeMimeTypes(){return{audio:this._mimeType}}}const xe="application/vnd.apple.mpegurl";function Ue(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 Ve(e){return`data:application/vnd.apple.mpegurl;base64,${btoa(e)}`}function Fe(e){const t=new Blob([e],{type:xe});return URL.createObjectURL(t)}function Be(e){return Fe(Ue(e))}function He(e){return Ve(Ue(e))}class Ge extends Me{constructor(){super(...arguments),this._hlsURL=null,this.strategy=u.URL}unload(){this._hlsURL&&URL.revokeObjectURL(this._hlsURL),this._hlsURL=null}getURL(){var e,t;const n=this._currentURL,i=this._initSegment;if(!n||!i)throw new re(h.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.unload();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},r=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}})),a="undefined"==typeof MediaSource?Be:He;return this._hlsURL=a({assetID:this._fileId,targetDuration:10,map:o,segments:r}),this._hlsURL}getLoadingApproach(){return{approach:"source",type:xe}}}class We 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 je extends Me{constructor(e){super(e),this._profileId=`${Date.now()}`,this._lastFetchedBuffer=null,this.strategy=u.MSE,this._transport=e.transport,this._abrManager=e.abrManager,this._parseSegmentResponse=this._parseSegmentResponse.bind(this)}_parseSegmentResponse(e,t){const{requestURL:n,segment:i,byteRangeHeader:o,expectedLength:r}=e.metadata,a=`${i.timeStart}-${i.timeEnd}`;switch(e.status){case 0:{if(e.offline)return Promise.reject(new We(h.FRAGMENT_OFFLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0,{time_range:a,byte_range:o}));const r=new We(h.FRAGMENT_ONLINE_REQUEST_FAILED_WITH_ZERO,"Request failed with status 0.",0);let s=!1;return this._currentURL!==n?s=!0:this._fallbackURLs.length&&this._currentURL===n&&(s=!0,this._currentURL=this._fallbackURLs.shift()),r.debug.has_fallback=s,s?this.getBufferSetForSegment(i,t):Promise.reject(r)}case 200:case 206:{const t=e.body;if(!t)return Promise.reject(new We(h.FRAGMENT_REQUEST_EMPTY_RESPONSE,"Empty response for successful buffer.",e.status,{time_range:a,byte_range:o}));if(t.byteLength!==r)return Promise.reject(new We(h.FRAGMENT_REQUEST_UNEXPECTED_LENGTH,"Received buffer of unexpected length.",e.status,{time_range:a,byte_range:o,received_length:t.byteLength,expected_length:r}));const s={audio:{profileId:this._profileId,bufferURL:n,byteStart:i.byteRanges.audio.start,byteEnd:i.byteRanges.audio.end,buffer:t,mimeType:this._mimeType,bandwidth:8e3*t.byteLength/e.timing.completed}};return i.cacheBufferSet&&t&&t.byteLength&&(i.bufferSet=s),this._abrManager.sample(t.byteLength,e.timing.completed),Promise.resolve(s)}case 403:return this._getCDNURLs().then((()=>this.getBufferSetForSegment(i,t)));default:{let r=!1;return this._currentURL!==n?r=!0:this._fallbackURLs.length&&this._currentURL===n&&(r=!0,this._currentURL=this._fallbackURLs.shift()),r?this.getBufferSetForSegment(i,t):Promise.reject(new We(h.FRAGMENT_REQUEST_FAILED_WITH_STATUS,`Buffer request failed with status ${e.status}`,e.status,{time_range:a,byte_range:o}))}}}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 re(h.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 re(h.FILE_NOT_RESOLVED,"Cannot fetch buffer: No resolved URL"));const i=e.byteRanges.audio,o=`${i.start}-${i.end}`,r=i.end+1-i.start,a=this._currentURL;return(e.init?Promise.resolve(null):this.getInitBufferSet(t)).then((n=>Promise.all([n,this._transport.request(a,{method:"GET",responseType:"arraybuffer",headers:{Range:`bytes=${o}`},signal:t,timing:!0,metadata:{requestURL:a,segment:e,byteRangeHeader:o,expectedLength:r},retry:{condition:(e,t)=>{if(0===e.status)return e.offline;const n=e.getStatusFamily();return 429===e.status||n===t.CONNECTION_ERROR||n===t.SERVER_ERROR||!(n!==t.SUCCESS||!e.body)&&e.body.byteLength!==r}}}).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 Ye extends Ee{constructor(e){super(e),this._hlsURLs=[],this.strategy=u.URL,this._keySystem===p.FAIRPLAY&&(this._supportedFormats.audio.unshift({mimeType:"audio/mp2t",codec:"mp4a.40.2"}),this._supportedFormats.video.unshift({mimeType:"video/mp2t",codec:"avc1.4d402a"}))}_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?Be:He)({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 re(h.FILE_NOT_RESOLVED,"Cannot return HLS Manifest URL: File not resolved.");this.unload();const n=[],i=this._audioProfiles.available[0];if(i){const e="ts"!==i.file_type?this._resolver.getInitSegmentURLs(this._baseURL,this._initTemplate,i,void 0).audio:"";n.push(`#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",LANGUAGE="eng",NAME="English",AUTOSELECT=YES,URI="${this._getHLSURLForProfile(i,e)}"`)}for(const o of this._videoProfiles.available){const r=(null!==(e=null==i?void 0:i.max_bitrate)&&void 0!==e?e:0)+o.max_bitrate,a=(null!==(t=null==i?void 0:i.audio_bitrate)&&void 0!==t?t:0)+o.video_bitrate,s="ts"!==o.file_type?this._resolver.getInitSegmentURLs(this._baseURL,this._initTemplate,void 0,o).video:"";n.push(`#EXT-X-STREAM-INF:BANDWIDTH=${r},AVERAGE-BANDWIDTH=${a},RESOLUTION=${o.video_width}x${o.video_height},CODECS="${(null==i?void 0:i.audio_codec)?`${i.audio_codec}, ${o.video_codec}`:o.video_codec}"${(null==i?void 0:i.audio_codec)?',AUDIO="audio"':""}\n${this._getHLSURLForProfile(o,s)}`)}const o=`#EXTM3U\n${n.join("\n")}`,r=("undefined"==typeof MediaSource?Fe:Ve)(o);return this._hlsURLs.push(r),r}unload(){for(const e of this._hlsURLs)URL.revokeObjectURL(e);this._hlsURLs=[]}getMediaTypeMimeTypes(){var e,t;return{audio:ge(null===(e=this._audioProfiles.available)||void 0===e?void 0:e[0]),video:ge(null===(t=this._videoProfiles.available)||void 0===t?void 0:t[0])}}getLoadingApproach(){return{approach:"source",type:xe}}adaptToBandwidth(){return Promise.resolve(!1)}canLowerBitrate(){return!1}}class ze extends Ee{constructor(e){super(e),this._initSegmentBuffers={},this.strategy=u.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 429===e.status||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 i=this._initSegment;if(!i)return Promise.reject(new re(h.FILE_NOT_RESOLVED,"Cannot fetch Init Segment buffers: File not resolved."));let o;try{o=this._constructSegmentURL(i,e,t)}catch(e){return Promise.reject(e)}const r=this._initSegmentBuffers;let a=0,s=0;const c=(0,l.X)(),u=e=>{s+=e,a--,a||(this._abrManager.sample(s,(0,l.r)(c)),this._updateVariants())};let d=Promise.resolve(null);if(e){const t=r[e.id];(null==t?void 0:t.buffer.byteLength)?d=Promise.resolve(t):(null==o?void 0:o.audio)&&(a++,d=this._fetchBufferData(o.audio,i,e,o.audioLogging,n).then((t=>(r[e.id]=t,u(t.buffer.byteLength),t))))}let p=Promise.resolve(null);if(t){const e=r[t.id];(null==e?void 0:e.buffer.byteLength)?p=Promise.resolve(e):(null==o?void 0:o.video)&&(a++,p=this._fetchBufferData(o.video,i,t,o.videoLogging,n).then((e=>(r[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=(0,l.X)(),u=e=>{s+=e,a--,a||(this._abrManager.sample(s,(0,l.r)(c)),this._updateVariants())};let d=null;!e.init&&(null==o?void 0:o.audio)&&(a++,d=this._fetchBufferData(o.audio,e,t,o.audioLogging,i).then((e=>(u(e.buffer.byteLength),e))));let p=null;return!e.init&&(null==o?void 0:o.video)&&(a++,p=this._fetchBufferData(o.video,e,n,o.videoLogging,i).then((e=>(u(e.buffer.byteLength),e)))),Promise.all([r,d,p])})).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:ge(this._audioProfiles.selected),video:ge(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 Ke extends ae{constructor(e){super(e),this._url="",this.strategy=u.URL,this._fileId=e.fileId,this._resolver=e.resolver}_getCDNURLs(e){const t=this._fileId,n=(0,l.X)();return this._resolver.getCDNURL(t).then((t=>(e&&(e.resolveLatency=(0,l.r)(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"}}}class Je 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 Je(e,t);return n.unrecoverable=!1,n.canPlayNext=!0,n}}class qe extends ae{constructor(e){super(e),this._loaded=!1,this._playableContentSorted=[],this._mimeType="",this._manifestURL="",this._adURL="",this._product="",this._audioFiles=[],this._videoFiles=[],this._trackingData=null,this.strategy=u.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 Je(h.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._product=t.product,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=(0,l.X)(),n=this._manifestURL;return this._transport.request(n,{responseType:"json",authorize:!0,retry:{condition:(e,t)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((i=>{if(200!==i.status){const e=new Je(h.AD_MANIFEST_REQUEST_FAILED_WITH_STATUS,`Ad manifest request failed with status code ${i.status}`);return e.debug.manifestURL=n,e.status=i.status,Promise.reject(e)}if(!i.body){const e=new Je(h.AD_MANIFEST_INVALID,"Received empty manifest.");return e.debug.manifestURL=n,e.status=i.status,Promise.reject(e)}e&&(e.manifestLatency=(0,l.r)(t));const o=i.body;return Promise.resolve(o)}))}_getPlayableContent(){const e="video"===this._product;if(e&&this._videoManifestId)return;const t=e?this._videoFiles:this._audioFiles;if(!t.length)throw new re(h.FILE_NOT_RESOLVED,`Manifest's ${e?"video_files":"audio_files"} array is empty.`);const n=t.filter((e=>this._isPlayable(e.type,this.getMediaType())));if(!n.length)throw new re(h.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 re(h.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 Xe(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 $e(e,t,n){if(!e.fileId)return Promise.reject(new _(h.INVALID_TRACK,`Invalid ${e.format} Track: No fileId.`));const i=Object.assign(Object.assign({},Xe(e,t)),{transport:t.transport,abrManager:t.abrManager,supportedFormats:t.supportedFormats,fileId:e.fileId,keySystemSettings:F[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===p.FAIRPLAY?new Ye(i).load(t.measures):new ze(i).load(t.measures)}const Ze=r.m.forTag("playback.player"),Qe=/^blob:/,et={[m.MP4]:!0,[m.MP4_DUAL]:!0,[m.MP4_CBCS]:!0,[m.MP4_FLAC]:!0,[m.MP3]:!1,[m.MANIFEST_ID]:!0,[m.AD_MANIFEST]:!0,[m.GENERIC_MEDIA]:!0},tt={start:d.REPORTING_START,creative_view:d.REPORTING_CREATIVE_VIEW,first_quartile:d.REPORTING_FIRST_QUARTILE,midpoint:d.REPORTING_MIDPOINT,third_quartile:d.REPORTING_THIRD_QUARTILE,complete:d.REPORTING_COMPLETE,pause:d.REPORTING_PAUSE,resume:d.REPORTING_RESUME,error:d.REPORTING_ERROR},nt={audio:2,video:2};function it(e){return Math.ceil(1e3*e)}function ot(e){return e/1e3}function rt(e){return document.createElement(e)}class at extends a.bk{constructor(e){var t,n,i,o,r;super(),this._cubicVolume=!1,this._player=null,this._emeManager=null,this._mediator=new a.bk,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._muted=!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=nt,this._audioResolver=e.audioResolver,this._clearBufferOnSeek=!!e.clearBufferOnSeek,this._createPlayer=e.createPlayer||rt,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 c.q(e.trackCacheSize||2),this._subtitleManager=new oe({language:e.preferredSubtitleLanguage||navigator.language,player:this._player}),this._videoResolution=e.videoResolution,Ze.info("Setting Player track cache to:",e.trackCacheSize||2),this._bufferManager=ke.create(this._tracker,void 0,{disableBufferAbort:!!e.disableBufferAbort,reinjectInitsOnAbort:!!e.reinjectInitsOnAbort,noInit:!0,customSourceBufferParams:e.customSourceBufferParams,bufferTarget:e.bufferTarget}),this._statistics=Se.create({bandwidthEstimator:this._abrManager}),this._newKeySystemAccessPerTrack=e.newKeySystemAccessPerTrack,this._loadingTimeout=e.loadingTimeout;const s=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:nt.audio,s.audio),video:Math.min(null!==(r=null===(o=e.rebufferTarget)||void 0===o?void 0:o.video)&&void 0!==r?r:nt.video,s.video)},this._audioProcessor=Ae.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?at.createWithOptions(t):q.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 at(t);return t.preinitMediaElement?n._preinitMediaElement():n})).catch((n=>{if(e.enableWithoutEME)return at.createWithOptions(t);throw n}))}static createWithOptions(e){return new Promise((t=>{const n=new at(e);t(e.preinitMediaElement?n._preinitMediaElement():n)}))}_init(){this._disableCache&&Ze.info("Cache disabled."),this._transport.on(this._transport.EVENT_CONNECTION_OFFLINE,this._onNavigatorOffline),this.proxyEmitAllSync(this._tracker,{[d.TRACKER_TRACKING_DATA_CREATED]:d.PLAYER_TRACKING_DATA_CREATED,[d.TRACKER_TRACKING_DATA_FINALIZED]:d.PLAYER_TRACKING_DATA_FINALIZED,[d.TRACKER_PLAYBACK_START]:d.PLAYER_PLAYBACK_START}),this._tracker.on(d.TRACKER_PLAYED_THRESHOLD_REACHED,this._onPlayedThresholdReached),this._emeManager&&this._emeManager.addListeners({[d.EME_LICENSE_REQUEST_CAPPED]:this._onLicenseRequestCapped,[d.EME_LICENSE_REQUEST_ERROR]:this._onLicenseRequestError}),this._bufferManager.addListeners({[d.BUFFER_APPEND_ERROR]:this._onBufferError,[d.BUFFER_QUOTA_EXCEEDED]:this._onQuotaExceeded,[d.BUFFER_UPDATE_END]:this._onBufferUpdateEnd}),this._mediator.addListeners({[i.FRAGMENT_FETCHED]:this._onFragmentFetched,[i.VIDEO_PROFILE_CHANGED]:this._onProfileChanged}),this.proxyEmitAll(this._mediator,{[i.FRAGMENT_FETCH_ERROR]:d.PLAYER_FRAGMENT_FETCH_ERROR}),this.proxyEmitSync(this._subtitleManager,d.PLAYER_DISPLAYED_CUES_CHANGED,d.PLAYER_DISPLAYED_CUES_CHANGED),this.proxyEmit(this._subtitleManager,d.PLAYER_SUBTITLE_LANGUAGES_LOADED,d.PLAYER_SUBTITLE_LANGUAGES_LOADED),this.proxyEmitAll(this._videoResolver,{[d.VIDEO_MANIFEST_RESOLVED]:d.PLAYER_VIDEO_MANIFEST_RESOLVED,[d.VIDEO_MANIFEST_RESOLVE_FAILED]:d.PLAYER_VIDEO_MANIFEST_RESOLVE_FAILED}),this._tracker.addListeners({[d.TRACKER_FIRST_QUARTILE]:()=>this._emitReporting("first_quartile"),[d.TRACKER_MIDPOINT]:()=>this._emitReporting("midpoint"),[d.TRACKER_THIRD_QUARTILE]:()=>this._emitReporting("third_quartile")}),this.addListeners({[d.PLAYER_PLAYBACK_START]:()=>{this._emitReporting("start"),this._emitReporting("creative_view")},[d.PLAYER_ENDED]:()=>this._emitReporting("complete"),[d.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(d.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(d.PLAYER_FRAGMENT_FETCHED,t)}_onProfileChanged(e){const{data:t}=e;this._tracker.trackProfileChanged(t.profile),this.emit(d.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(d.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(d.PLAYER_VIDEO_ELEMENT_REMOVED,null)))}_onLicenseRequestCapped(e){if(e.data.signal.aborted)return;this._currentContent&&(this.pause(),this.emit(d.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)===u.MSE&&this._bufferManager.checkBufferHealth(this._currentContent,this._player.currentTime)}_addPlayerEvents(e){e.addEventListener(d.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.addEventListener(d.MEDIA_PLAY,this._onPlay),e.addEventListener(d.MEDIA_PLAYING,this._onPlaying),e.addEventListener(d.MEDIA_PAUSE,this._onPause),e.addEventListener(d.MEDIA_SEEKING,this._onSeeking),e.addEventListener(d.MEDIA_ENCRYPTED,this._onEncrypted),e.addEventListener(d.MEDIA_ENDED,this._onEnded),e.addEventListener(d.MEDIA_ERROR,this._onError),e.addEventListener(d.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.addEventListener(d.MEDIA_DURATIONCHANGE,this._onDurationChange),e.addEventListener(d.MEDIA_WAITING,this._onWaiting),e.addEventListener(d.MEDIA_CANPLAY,this._onCanPlay),e.addEventListener(d.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.addEventListener(d.MEDIA_RATECHANGE,this._onRateChange),e.addEventListener(d.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.addEventListener(d.MEDIA_RESIZE,this._onVideoResize)}_removePlayerEvents(e){e.removeEventListener(d.MEDIA_TIMEUPDATE,this._onTimeUpdate),e.removeEventListener(d.MEDIA_PLAY,this._onPlay),e.removeEventListener(d.MEDIA_PLAYING,this._onPlaying),e.removeEventListener(d.MEDIA_PAUSE,this._onPause),e.removeEventListener(d.MEDIA_SEEKING,this._onSeeking),e.removeEventListener(d.MEDIA_ENCRYPTED,this._onEncrypted),e.removeEventListener(d.MEDIA_ENDED,this._onEnded),e.removeEventListener(d.MEDIA_ERROR,this._onError),e.removeEventListener(d.MEDIA_WAITING,this._onWaiting),e.removeEventListener(d.MEDIA_CANPLAY,this._onCanPlay),e.removeEventListener(d.MEDIA_RATECHANGE,this._onRateChange),e.removeEventListener(d.MEDIA_CANPLAYTHROUGH,this._onCanPlayThrough),e.removeEventListener(d.MEDIA_LOADEDMETADATA,this._onLoadedMetadata),e.removeEventListener(d.MEDIA_DURATIONCHANGE,this._onDurationChange),e.removeEventListener(d.INTERNAL_MEDIA_REQUIRES_DURATION,this._onRequiresDuration),e.removeEventListener(d.MEDIA_RESIZE,this._onVideoResize)}_recreateMediaElement(e,t,n,i){var o,r,a;if(i.aborted)return Ze.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){Ze.info("Reusing media element.");return(!(e.audio===this._activeMimeTypes.audio&&e.video===this._activeMimeTypes.video)||this._newBufferPerTrack)&&n===u.MSE&&(Ze.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")}Ze.info(`Creating new media element for media type ${t}.`);const l=this._createPlayer(t),d=this._playerVolume;return l.volume=this._cubicVolume?Math.pow(d,3):d,l.autoplay=!1,l.loop=!1,l.muted=this._muted,"playsInline"in l&&(l.playsInline=!0),this._player=l,this._playerActivated=!1,this._addPlayerEvents(l),n===u.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 i=new _(h.PLAYER_CONTAINER_ELEMENT_NOT_FOUND,"Container element was not found in the DOM");return i.listPlayerIgnore=!0,this._emitWarning(i,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(d.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 Ze.info("Duration changed drop: operation aborted.");const e=it(this._player.duration),n=it(this._player.currentTime);this._tracker.setActualDuration(e),this.emit(d.PLAYER_DURATION_CHANGED,{timestamp:Date.now(),position:n,duration:e})};this._loaded?n():this.once(d.PLAYER_LOAD,n)}_onPlay(){var e;if(!this._player||!this._currentContent)return;const t=it(this._player.currentTime);this._tracker.trackPlay(t,this._player.playbackRate),this.emit(d.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=it(this._player.currentTime);this._tracker.trackPlaying(t),this.emit(d.PLAYER_PLAYING,{timestamp:Date.now(),position:t,logData:e?e.getLogData():null})}_onPause(){var e;if(!this._player)return;const t=it(this._player.currentTime);this._tracker.trackPaused(t);const n=this._currentContent?this._currentContent.getLogData():null;this._pauseToken=setTimeout((()=>{clearTimeout(this._syntheticEndedToken),this.emit(d.PLAYER_PAUSED,{position:t,logData:n})}),10),this._player&&(null===(e=this._currentContent)||void 0===e?void 0:e.strategy)===u.MSE&&this._bufferManager.checkBufferHealth(this._currentContent,this._player.currentTime)}_onSeeking(){var e;this.emit(d.PLAYER_SEEKING,null),this._setRebufferingState(),(null===(e=this._currentContent)||void 0===e?void 0:e.strategy)===u.MSE&&this._player&&!this._bufferManager.isPositionInCurrentFillRange(this._currentContent,this._player.currentTime)&&(Ze.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&&(Ze.info("Exceeded quota: rebuffering current track."),this._bufferManager.abort(!0),this._player.currentTime=this._player.currentTime,this._onTimeUpdate())}_onEncrypted(e){Ze.info("Got Encrypted event");this._currentContent&&this.emitSync(d.INTERNAL_ENCRYPTED,{initData:e.initData,fromPolyfill:!!e.fromPolyfill})}_onEnded(){!this._currentContent||this._synthesizeEnded&&this._currentContent.isProtected()||(Ze.info("Native ended emitted."),this._emitEnded())}_onSyntheticEnded(){this._synthesizeEnded&&this._currentContent&&this._currentContent.isProtected()&&(Ze.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,r,a,s=!1;i&&(n=i.isProtected(),t=i.toLogJSON(),s=i.hasNonFatalErrors(),i.unload());let c=!0;const l=!i||s||!this._fatalOnNextError,u=e&&e.msExtendedCode?`0x${(e.msExtendedCode>>>0).toString(16).toUpperCase()}`:null,d=`data:${(null==t?void 0:t.fileId)||"unknown"}`;if(e instanceof MediaError){switch(e.code){case MediaError.MEDIA_ERR_ABORTED:o=h.MEDIA_ABORTED,r="Media aborted.";break;case MediaError.MEDIA_ERR_NETWORK:o=h.MEDIA_NETWORK_ERROR,r="Network error.";break;case MediaError.MEDIA_ERR_DECODE:o=h.MEDIA_DECODING_ERROR,r="Media decoding error.",c=l;break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:o=h.MEDIA_NOT_SUPPORTED,r="Media not supported.",c=l;break;default:o=h.PLAYER_MEDIA_ERROR,r="Media error.",a=!0}r+=` (${e.message||u||d||e.toString()})`}else o=h.PLAYER_PLAYBACK_ERROR,r="Error message undefined",a=!0;this._bufferManager.abort(!0);const p=new _(o,r);c||(p.unrecoverable=!0),p.listPlayerIgnore=s,p.debug.src_url=d,p.debug.protected=n,p.debug.extendedCode=u,p.debug.rawExCode=e&&e.msExtendedCode||null,a&&e&&(p.debug.nativeCode=e.code||null,p.debug.errorData=e),this._emitError(p,c,t)}_onLoadedMetadata(){this.emitSync(d.INTERNAL_PLAYER_LOADED_METADATA,null)}_onCanPlay(){this._setRebufferingState(),this.emitSync(d.INTERNAL_PLAYER_CANPLAY,null),this.emit(d.PLAYER_FIRST_BYTES,null)}_onCanPlayThrough(){this._setRebufferingState(),this.emitSync(d.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=!!ye(this._currentContent)&&this._currentContent.canLowerBitrate(),o=this._tracker;this.emit(d.PLAYER_BUFFERING_START,Object.assign({position:it(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(d.PLAYER_BUFFERING_END,Object.assign({position:it(t.currentTime),msPlayed:this._tracker.getMSPlayed(),canLowerBitrate:i,msStalled:e,seeking:n},o.getStallsInformation())))}))}_onPlayedThresholdReached(e){this._currentContent&&this._player&&this.emit(d.PLAYER_PLAYED_THRESHOLD_REACHED,{played:e.data.played,threshold:e.data.threshold,position:it(this._player.currentTime)})}_emitEnded(){this._currentContent&&"video"===this._currentContent.getMediaType()&&this.emit(d.PLAYER_ENDED_VIDEO,null),clearTimeout(this._pauseToken),this.emit(d.PLAYER_ENDED,null)}_emitError(e,t,n){Ze.error("Player Error",e,n,t),this._tracker.setHadError(!0),!this._disableCache&&n&&n.fileId&&this._cache.remove(n.fileId),this.emit(d.PLAYER_ERROR,{playId:this._playId,error:e,track:n,canPlayNext:t,position:this._player?it(this._player.currentTime):0})}_emitWarning(e,t){Ze.warn("Player Warning",e,t,!0),this._tracker.trackWarning(),this.emit(d.PLAYER_WARNING,{playId:this._playId,error:e,track:t,canPlayNext:!0,position:this._player?it(this._player.currentTime):0})}_emitReporting(e){if(!be(this._currentContent))return;const t=this._currentContent.getTrackingEventData(e);t&&0!==t.urls.length&&this.emitAndWait(tt[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 Ze.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 Ze.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")),o.muted=!!e.muted,o.loop=!!e.loop,!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)?(Ze.info("Creating media keys"),this._emeManager.createMediaKeys(o).then((()=>!0),a)):o.mediaKeys!==r?(Ze.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!==u.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(o,!0))}),i):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(d.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 Ze.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.currentTimee(this._player&&this._player.play()))).then((()=>this._audioProcessor.resume())).catch((e=>{if(e){if("NotSupportedError"===e.name)return Promise.reject(e);if("NotAllowedError"===e.name)return this.emit(d.PLAYER_AUTOPLAY_FAILED,null),Promise.reject(e)}return this._player?this._player.play():Promise.resolve()})).catch((()=>{this._onPause()}))}),i.readyState>2?(Ze.info("Ready to play, triggering play."),r()):(Ze.info("Waiting to be playable."),this.once(d.INTERNAL_PLAYER_CANPLAY,r))}_handleCanPlayThrough(e){var t;e.aborted?Ze.info("CanPlayThrough operations dropped: operation aborted."):(this._tracker.trackCanPlayThrough(),(null===(t=this._currentContent)||void 0===t?void 0:t.strategy)!==u.MSE&&this._tracker.trackPlayLatency())}_loadContent(e,t){if(t.aborted||!this._upcomingContent)return Ze.info("Loading content dropped: operation aborted."),Promise.resolve(!1);if(!this._player)throw new _(h.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 i=e.callback;i&&this.once(d.PLAYER_LOAD,(()=>{t.aborted?Ze.info("Load content event dropped: operation aborted."):i()})),this.once(d.INTERNAL_PLAYER_LOADED_METADATA,this._handleLoadedMetadata.bind(this,t,this._currentContent.getLogData(),e)),this.once(d.INTERNAL_PLAYER_CANPLAYTHROUGH,this._handleCanPlayThrough.bind(this,t));let o=e.position;const r="getCalculatedDuration"in n?n.getCalculatedDuration():1/0;r&&o>r&&(o=e.position=0);try{this._player.currentTime=o}catch(e){Ze.warn("Cannot set initial position before loading.",e)}const a=e.playbackSpeed;return!e.useDefaultPlaybackSpeed&&a&&this.setPlaybackSpeed(a),this._tracker.setProtected(n.isProtected()),Ze.info(`Detecting strategy for ${n.constructor.name}`),n.strategy===u.MSE?this._loadMSEContent(n,e,t):this._loadURLContent(n,e,t)}_loadURLContent(e,t,n){var i,o,r;if(!this._player||!e)return Promise.reject(new _(h.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));Ze.info("Loading URL content.");const a=e.getURL();if(!a)return Promise.reject(new _(h.PLAYER_INVALID_INTERNAL_STATE,"Content not loaded."));if(e.isProtected()){Ze.info("URL content is protected");const e=t=>{t.data.fromPolyfill&&(this.removeListener(d.INTERNAL_ENCRYPTED,e),this._requestLicense(n,{initData:t.data.initData}))};this.on(d.INTERNAL_ENCRYPTED,e)}if("video"===e.getMediaType()&&ve(e)){const t=e.getMediaProfileInfo();this._tracker.trackVideoLoadStart({bitrate:null===(i=t.video.selected)||void 0===i?void 0:i.video_bitrate,audioProfile:null!==(o=t.audio.selected)&&void 0!==o?o:void 0,videoProfile:null!==(r=t.video.selected)&&void 0!==r?r:void 0})}this._tracker.trackBufferLoadStart(),this._tracker.trackBufferURL(a,{bandwidth:0});const s=e.getLoadingApproach();if("src"===s.approach)Ze.info("URL content loaded using src attribute"),this._player.src=a;else{Ze.info("URL content loaded using source element");const e=document.createElement("source");e.src=a,e.type=s.type,this._player.appendChild(e)}return this._player.load(),Promise.resolve(!0)}_loadMSEContent(e,t,n){var i,o,r;if(!this._player||!e)return Promise.reject(new _(h.PLAYER_INVALID_INTERNAL_STATE,"Invalid playback state."));if(Ze.info(`Loading MSE Content: ${e.getFileId()}`),e.isProtected()){Ze.log("MSE content is protected");const e=()=>this._requestLicense(n).then((()=>{n.aborted||(this._licenseRequested=!0,this._disableBufferingBeforeLicense&&this._onTimeUpdate())}));this._disableLicensePrefetch?this.once(d.INTERNAL_ENCRYPTED,e):this._bufferManager.once(d.BUFFER_SOURCE_OPEN,e)}const a=this._bufferManager,s=a.getMediaSource();if(!s)return Promise.reject(new _(h.PLAYER_INVALID_INTERNAL_STATE,"No media source."));if("video"===e.getMediaType()&&ve(e)){const t=e.getMediaProfileInfo();this._tracker.trackVideoLoadStart({bitrate:null===(i=t.video.selected)||void 0===i?void 0:i.video_bitrate,audioProfile:null!==(o=t.audio.selected)&&void 0!==o?o:void 0,videoProfile:null!==(r=t.video.selected)&&void 0!==r?r:void 0})}return this._player.src=URL.createObjectURL(s),this._setPlaybackRate(),new Promise(((i,o)=>{a.once(d.BUFFER_SOURCE_OPEN,(()=>{this._tracker.trackBufferLoadStart(),this._getRebufferingLatency().then((e=>{n.aborted||this._tracker.trackInitialRebuffering(e)}));("video"===e.getMediaType()?a.setDuration(e.getCalculatedDuration()):Promise.resolve(!0)).then((()=>e.isProtected()&&this._disableBufferingBeforeLicense?a.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=(0,l.X)();this.once(d.PLAYER_REBUFFERING_END,(()=>{e((0,l.r)(t))}))}))}_requestLicense(e,t={}){if(e.aborted){const e="Request license dropped: operation aborted.";return Ze.info(e),Promise.resolve(!1)}if(!this._player||!this._currentContent||!this._emeManager)return Promise.resolve(!1);const n=(0,l.X)(),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 u=o.getLicenseEndpoint();let p;if(u)p=Promise.resolve(u);else{if(!r)return Promise.reject(new TypeError("Missing: fileId or licenseEndpoint"));p=this._licenseURLResolver.get(c,o.getMediaType()).then((e=>e.replace(/\{contentId\}/,r)))}const h=this._emeManager,f=this._tracker;return f.setKeySystem(c),f.setKeySystemImpl(h.getKeySystemImpl()),Promise.all([p,o.getInitParams()]).then((([o,r])=>{if(!r)return Promise.resolve(!1);f.setLicenseSessionLatency((0,l.r)(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 h.createSessionWithParams(t)}return Promise.resolve(!1)})).then((t=>{if(e.aborted)return Ze.info("License tracking dropped: operation aborted."),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 i=(0,l.r)(n);return f.setKeyLatency(i),this.emit(d.PLAYER_KEY_RECEIVED,{requestTime:i,logData:a}),Ze.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 Ze.log("Dropping time update event: buffering before license disabled.");if(!n&&this._lastTimeUpdatePostion&&this._lastTimeUpdatePostion===i)return void Ze.warn("Dropping duplicate time update.");this._lastTimeUpdatePostion=n?0:i,t.strategy===u.MSE&&this._bufferManager.checkBufferHealth(t,i,n);const o=this._player.duration,r=it(i),a=t.getLogData();n?(this._tracker.trackPositionChanged(r),this.emit(d.PLAYER_POSITION_CHANGED,{position:r,logData:a})):(this._tracker.trackProgress(r,ye(t)?t.getCurrentBitrates().video:0),this.emit(d.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(d.PLAYER_CAN_PRELOAD,null)):this._canPreloadEmitted&&!s&&(this._canPreloadEmitted=!1),clearTimeout(this._syntheticEndedToken),this._synthesizeEnded&&t.isProtected()&&this._isPlaying()&&(this._syntheticEndedToken=setTimeout(this._onSyntheticEnded,it(o-i)))}_isPlaying(){return!!this._player&&!this._player.paused}_cleanMediaKeys(e,t=this._emeManager){return t?t.removeMediaKeys(e).catch((e=>(Ze.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=>(Ze.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:p.INVALID_SPOTIFY_KEY,audioFormats:e.formatsInfo.audio,videoFormats:e.formatsInfo.video})))).then((n=>function(e,t){var n,i,o;const r=Xe(e,t);switch(e.format){case m.MP3:{const i=null!==(n=e.url)&&void 0!==n?n:e.resolvedURL;return i?new we(Object.assign(Object.assign({},r),{url:i})).load():e.fileId?new Ke(Object.assign(Object.assign({},r),{fileId:e.fileId,resolver:t.audioResolver})).load():Promise.reject(new _(h.INVALID_TRACK,`Invalid ${e.format} Track: No url or fileId.`))}case m.GENERIC_MEDIA:{const t=null!==(i=e.url)&&void 0!==i?i:e.resolvedURL;return t?new we(Object.assign(Object.assign({},r),{url:t})).load():Promise.reject(new _(h.INVALID_TRACK,`Invalid ${e.format} Track: No url.`))}case m.MP4:case m.MP4_DUAL:case m.MP4_CBCS:case m.MP4_FLAC:{if(!e.fileId)return Promise.reject(new _(h.INVALID_TRACK,`Invalid ${e.format} Track: No fileId.`));const n=Object.assign(Object.assign({},r),{transport:t.transport,abrManager:t.abrManager,fileId:e.fileId,keySystemSettings:F[t.keySystem],resolver:t.audioResolver,fileFormat:e.fileFormat,preloadedManifest:e.preloadedManifest,preresolvedURL:null!==(o=e.url)&&void 0!==o?o:e.resolvedURL});return t.keySystem===p.FAIRPLAY?new Ge(n).load(t.measures):new je(n).load(t.measures)}case m.MANIFEST_ID:return $e(e,t);case m.AD_MANIFEST:{if(!e.url)return Promise.reject(new _(h.INVALID_TRACK,`Invalid ${e.format} Track: No url.`));const n=Object.assign(Object.assign({},r),{abrManager:t.abrManager,transport:t.transport,manifestURL:e.url,preloadedManifest:e.preloadedManifest});return new qe(n).load(t.measures).then((n=>{const i=n.getManifestId();if(!i)return n;const o=Object.assign(Object.assign({},e),{fileId:i,format:m.MANIFEST_ID}),r={trackingData:n.getTrackingEvents(),metadata:n.getContentMetadata()};return $e(o,t,r)}))}default:return Promise.reject(new _(h.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,s.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===p.FAIRPLAY?u.URL:u.MSE,e.signal):null})).then((()=>this),(e=>(Ze.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&&et[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 Ze.info("Waiting for preloading track.",i),o.then((e=>(Ze.info("Preloading succeeded.",i),t.setResolveLatency(e.resolveLatency),t.setManifestLatency(e.manifestLatency),n.get(i)))).catch((()=>(Ze.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()?(Ze.info("Using cached track.",i,r),t.setMemoryCached(!0),r):(Ze.info("Mismatched keysystem for cached track. Creating new track",i),this._createContent(e)))):(Ze.info("Using cached track.",i,r),t.setMemoryCached(!0),Promise.resolve(r))}return Ze.info("Creating new content",i),this._createContent(e)}getMediaSource(){return this._bufferManager.getMediaSource()}load(e,t,n){var i,o,r,a,c,l,p;const f=function(e,t){return null==t?void 0:t.hasOwnProperty(e)}(t.uriProperty,e)?t.uriProperty:"uri",m=e[f];if(Ze.info("load",m),!m)return Promise.reject(new _(h.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),t.muted&&this.setMuted(!0),this._preloadThreshold=t.preloadThreshold||this._preloadThreshold;const g=++this._playId;this._abortController=(0,s.createAbortControllerLike)();const E=this._abortController.signal,v=this._tracker;v.trackLoadStart(m,e.fileId,g.toString(),e.logData,e.metadata);const y=this._configureLoadingTimeout(E,this._abortController,t.loadingTimeout);void 0!==y&&E.addEventListener("abort",(()=>clearTimeout(y))),this.emit(d.PLAYER_BEFORE_LOAD,{track:e,options:t,logData:e.logData,uri:m,timestamp:Date.now()}),this._bufferManager.setPlayId(g);const b=(null===(i=e.options)||void 0===i?void 0:i.useDefaultPlaybackSpeed)?1:null!==(r=null===(o=e.options)||void 0===o?void 0:o.playbackSpeed)&&void 0!==r?r:this._playerSpeed,S={position:ot(t.position||0),autoplay:null===(a=t.autoplay)||void 0===a||a,poster:e.poster,useDefaultPlaybackSpeed:!!(null===(c=e.options)||void 0===c?void 0:c.useDefaultPlaybackSpeed),playbackSpeed:b,callback:n,muted:null!==(l=t.muted)&&void 0!==l&&l,loop:null!==(p=t.loop)&&void 0!==p&&p};return this._loadingOptions=S,v.setPlayIntended(S.autoplay),v.setPlayedThreshold(t.playedThreshold),this._checkKeySystemAccess().then((()=>this._getContentPromise(e,v))).then((t=>{if(v.trackStrategy(t.strategy),t.isProtected()&&!this._emeManager)throw new _(h.DISALLOW_PROTECTED_TRACK_ERROR,"Protected tracks not supported");t.setLogData(e.logData),t.strategy===u.MSE&&v.setCalculatedDuration(it(t.getCalculatedDuration())),this._upcomingContent=t})).then((()=>this._prepareMediaElement(S,E))).then((()=>{var e;this._subtitleManager.setPlayer(this._player),(null===(e=this._upcomingContent)||void 0===e?void 0:e.isProtected())&&(Ze.info("Attaching HTMLMediaElement to the audio processor"),this._audioProcessor.setPlayer(this._player))})).then((()=>this._loadContent(S,E))).then((e=>this._handleLoadingComplete(e,y)),this._handleLoadingError.bind(this,m,e,E,y))}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;Ze.info("Preloading track",t);const r={manifestLatency:0,resolveLatency:0},a=this._createContent(e,r,!0).then((e=>{if(e.strategy!==u.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],Ze.info("Cached",t),r))).catch((e=>(delete i[t],Ze.warn("Preloading error",e),this.emit(d.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(d.PLAYER_BEFORE_VOLUME_CHANGE,{volume:e,options:t}).defaultPrevented){if(e<0||e>1)throw new _(h.PLAYER_ATTEMPTED_VOLUME_OUT_OF_RANGE,"Volume should be in range [0, 1]");this._playerVolume=e,this._player&&(this._muted&&e>0&&this.setMuted(!1),this._player.volume=this._cubicVolume?e*e*e:e)}}getVolume(){return this._playerVolume}getPlayerState(){var e,t,n,i;const o=this._player,r=this._currentContent,a={src:(null==o?void 0:o.src)?`data:${(null==r?void 0:r.getFileId())||"unknown"}`:void 0,height:(null==o?void 0:o.clientHeight)||0,width:(null==o?void 0:o.clientWidth)||0},s={};if(r){const e=r.getMediaTypeMimeTypes();s.audio_format=e.audio,s.video_format=e.video,"video"===r.getMediaType()&&o instanceof HTMLVideoElement&&(s.video_height=o.videoHeight,s.video_width=o.videoWidth,a.poster=o.poster)}let c=null;if(be(r)){const e=r.getTrackingEvents();e&&(c={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==o?void 0:o.paused))&&void 0!==e&&e,position:o?it(o.currentTime):0,duration:o?it(o.duration):0,volume:null!==(t=this._playerVolume)&&void 0!==t?t:1,muted:this._muted,loop:null!==(n=null==o?void 0:o.loop)&&void 0!==n&&n,playback_speed:null!==(i=null==o?void 0:o.playbackRate)&&void 0!==i?i:0,playback_speed_selected:this._playerSpeed,buffering:this._rebuffering,media_type:(null==r?void 0:r.getMediaType())||null,media_info:s,player_element:a,content_metadata:(null==r?void 0:r.getContentMetadata())||{},tracking_data:c}}getPlayerPosition(){return this._player?it(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 Ze.info("Seek dropped: operation aborted.");let t=ot(e);t<0?t=0:t>=this._player.duration&&(t=this._player.duration),this._player.currentTime=t};this._loaded?i():this.once(d.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(d.PLAYER_BEFORE_STOP,{timestamp:Date.now(),logData:a}),null===(n=this._abortController)||void 0===n||n.abort(),this._tracker.trackStopped(this._player?it(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&&Ze.warn("MediaError detected: next immediate media error will be fatal.");const e=s.src;if(e)Qe.test(e)&&URL.revokeObjectURL(e),s.removeAttribute("src");else{const e=Z(s.getElementsByTagName("source"));Ze.info(`HTMLSourceElements to removed: ${e.length}`);for(const t of e)s.removeChild(t);Ze.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),s.ownerDocument!==document&&document.adoptNode(s)),this.emit(d.PLAYER_STOPPED,null),Promise.all(r).then((()=>!0))}setMuted(e=!0){const t=this._player;t&&(this._muted=e,t.muted=e,e?this.emitSync(d.PLAYER_MUTED,null):this.emitSync(d.PLAYER_UNMUTED,null))}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(!ve(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(f.INVALID):(this._preferredBitrate=e,this._currentContent&&"video"===this._currentContent.getMediaType()&&e>0&&this._bufferManager.abort(!0),this._abrManager.overrideBitrate(e),Promise.resolve(f.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||rt("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=H([B[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(W(t.contentType));for(const e of t)s.push(e.contentType),l.push(W(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}}var st=n(36858);class ct extends Error{constructor(e,t){super(t),this.debug={},this.name="LoggingError",this.message=t,this.code=e}}const lt="7.37.2-4868c76d",ut="7.37.2",dt=r.m.forTag("playback.logger");class pt extends a.bk{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 pt(e)}_init(){const e=this._player;e.on(d.PLAYER_LOAD,this._onPlayerLoad.bind(this)),e.on(d.PLAYER_ERROR,this._onError.bind(this,!1)),e.on(d.PLAYER_WARNING,this._onError.bind(this,!0)),e.on(d.PLAYER_PRELOADING_ERROR,this._onError.bind(this,!1)),e.on(d.PLAYER_TRACKING_DATA_CREATED,this._onTrackingDataCreated.bind(this)),e.on(d.PLAYER_TRACKING_DATA_FINALIZED,this._onTrackingDataFinalized.bind(this)),e.on(d.PLAYER_PLAYBACK_START,this._onPlaybackStart.bind(this))}_emitError(e,t){this.emit(d.LOGGER_ERROR,{error:e,trackingData:t})}_onError(e,t){var n,i,o;const r=t.data,a=this._currentTrackingData;if(!a||a.noLog)return;const s=r.error,c=null!==(n=null==s?void 0:s.debug)&&void 0!==n?n:{};c.position="position"in r?r.position:0;const l={track:r.track||{},debug:c,preloading:"preloading"in r&&!!r.preloading,session_id:this._sessionId,playback_id:a.playbackId||null,player_play_id:"playId"in r?r.playId:null,http_status_code:null!==(i=null==s?void 0:s.status)&&void 0!==i?i:null,license_server:null!==(o=null==s?void 0:s.licenseServer)&&void 0!==o?o:null};this._logError(s.code||h.UNKNOWN,s,l,a,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};dt.debug("Logged TrackStreamVerification",t),this._logSender.logTrackStreamVerification(t).catch((n=>{const i=new ct(h.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: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};dt.info("Logging PlaybackStats"),this._logSender.logJSSDKPlaybackStats(t).catch((n=>{const i=new ct(h.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};dt.info("Logging PlaybackStart"),this._logSender.logJSSDKPlaybackStart(t).catch((n=>{const i=new ct(h.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){dt.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:lt||st.Z7.UNKNOWN,type:e||st.Z7.UNKNOWN,message:t&&t.message||st.Z7.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=>dt.warn("Failed to log warning",a,e))):this._logSender.logJSSDKError(a).catch((e=>dt.warn("Failed to log error",a,e)))}}class ht extends Error{constructor(e=h.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 ft=r.m.forTag("playback.storage_resolve");class mt{constructor(e){this._transport=e}_parseResponse(e,t){var n;let i;if(200!==t.status)return i=new ht(h.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 ht(h.STORAGE_RETURNED_NO_TRACKS,`Storage Resolve returned no tracks for fileId ${e}`),i.fileId=e,Promise.reject(i);const r={uri:o.cdnurl[0],uris:o.cdnurl,protection:"cenc"};return Promise.resolve(r)}getCDNURL(e,t){ft.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)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then(this._parseResponse.bind(this,e))}getManifest(e){const t=`https://seektables.scdn.co/seektable/${e}.json`;return ft.info("Requesting JSON manifest for ",e),this._transport.request(t,{responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}}}).then((t=>{let n;return 200!==t.status?(n=new ht(h.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 ht(h.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 gt{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 Et{constructor(){this._bitrates={},this._isFinalized=!1,this._needsEndSegment=!1,this._segments=[],this._cdnURLTracker=new gt,this.currentSpeed=1,this.audioCodec=null,this.bitrate=0,this.audioQuality=void 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=null,this.msInitLatency=null,this.msKeyLatency=null,this.msLicenseGenerationLatency=null,this.msLicenseRequestLatency=null,this.msLicenseSessionLatency=null,this.msLicenseUpdateLatency=null,this.msManifestLatency=null,this.msPlayed=0,this.msNominalPlayed=0,this.msPlayedUnion=0,this.msPlayLatency=null,this.msResolveLatency=null,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 Et}_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(h.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 p.WIDEVINE:e="widevine";break;case p.PLAYREADY:case p.PLAYREADY_HARDWARE:e="playready";break;default:e="none"}return{ms_total_est:this.msActualDuration,ms_metadata_duration:this.msMetadataDuration,ms_manifest_latency:this.msManifestLatency||0,ms_latency:this.msPlayLatency||0,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||0,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 vt=r.m.forTag("playback.tracker");class yt extends a.bk{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 yt(e)}_checkPlayedThreshold(){const e=this._trackingData;!e||!this._playedThreshold||this._playedThresholdReached||e.msPlayed=n&&(this._quartileTrackingEvents.firstEventFired=!0,this.emit(d.TRACKER_FIRST_QUARTILE,null)),!this._quartileTrackingEvents.midEventFired&&e.position>=2*n&&(this._quartileTrackingEvents.midEventFired=!0,this.emit(d.TRACKER_MIDPOINT,null)),!this._quartileTrackingEvents.thirdEventFired&&e.position>=3*n&&(this._quartileTrackingEvents.thirdEventFired=!0,this.emit(d.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=Et.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.loadStartMonotonic=(0,l.X)(),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(d.TRACKER_TRACKING_DATA_CREATED,{trackingData:r})}trackBufferLoadStart(){const e=this._trackingData;e&&(e.bufferLoadStartMonotonic=(0,l.X)())}trackBytesDownloaded(e){const t=this._trackingData;t&&(t.totalBytes+=e)}trackLoadDone(e){const t=this._trackingData;t&&(t.bufferLoadStartMonotonic&&(t.msInitLatency=(0,l.r)(t.bufferLoadStartMonotonic)),t.localTimeMs=Date.now(),t.position=e,t.addStartSegment())}trackPlay(e,t){const n=this._trackingData;n&&(n.played||this.emit(d.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=(0,l.X)();this.trackHeadLatency(e)}trackPlayLatency(e=(0,l.X)()){const t=this._trackingData;!t||t.nSeeksBackward||t.nSeeksForward||t.loadStartMonotonic&&(t.msPlayLatency=(0,l.r)(t.loadStartMonotonic,e))}trackHeadLatency(e=(0,l.X)()){const t=this._trackingData;t&&t.bufferLoadStartMonotonic&&(t.msHeadLatency=(0,l.r)(t.bufferLoadStartMonotonic,e))}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;if(s.stopTime=Date.now(),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 vt.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 bt extends a.bk{constructor(e){super(),this._transport=e,this._parseManifestResponse=this._parseManifestResponse.bind(this)}static create(e){return new bt(e)}_parseManifestResponse(e){var t;const n=e.metadata.startTime;if(200!==e.status){const t=new ht(h.STORAGE_VIDEO_MANIFEST_FAILED,`Video manifest request failed with status ${e.status}`);return t.status=e.status,this.emit(d.VIDEO_MANIFEST_RESOLVE_FAILED,{url:e.url,error:t,start_time:n}),Promise.reject(t)}const i=e.body,o=null===(t=e.headers)||void 0===t?void 0:t.get("content-length");return this.emit(d.VIDEO_MANIFEST_RESOLVED,{url:e.url,manifest_size:o?parseInt(o,10):JSON.stringify(i).length,start_time:n,end_time:Date.now()}),Promise.resolve(i)}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)=>{const n=e.getStatusFamily();return 429===e.status||n===t.SERVER_ERROR||n===t.CONNECTION_ERROR}},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 Tt{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":"",r=`@webgate/melody/v1/license_url?keysystem=${e}&mediatype=${t}&sdk_name=${this._sdk.name}&sdk_version=${this._sdk.version}${o}`;return this._transport.request(r,{responseType:"json",retry:{condition:(e,t)=>{const n=e.getStatusFamily();return 429===e.status||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(h.LICENSE_RESOLVER_DEPRECATED_VERSION,"This version of the SDK is no longer supported. Please upgrade"):new St(h.LICENSE_RESOLVER_CANT_RESOLVE_URL,`License URL endpoint responded with status ${e.status}`):St.fatal(h.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 At{constructor(e){this._melodyLogger=new st.nj(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 It;!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"}(It||(It={}));const Ot={[h.MEDIA_ABORTED]:It.ABORTED,[h.MEDIA_DECODING_ERROR]:It.MEDIA_DECODING,[h.MEDIA_NOT_SUPPORTED]:It.SRC_NOT_SUPPORTED,[h.MEDIA_NETWORK_ERROR]:It.NETWORK};function Ct(e){let t=Ot[e];return/_REQUEST_|_RESPONSE$/.test(e)?t=It.NETWORK:t||(t=/^EME_/.test(e)?It.EME:It.GENERIC),t}function Rt(e){var t;const n=e.match(/^https?:\/\/([^\/]+@)?([^\/?#]+)/);return null!==(t=null==n?void 0:n[2])&&void 0!==t?t:""}var Nt;!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"}(Nt||(Nt={}));const Pt={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 Lt{constructor(e){this._playerId=`spotify-playback-${Date.now()}`,this._currentContentInfo=null,this._readyDeferred=(0,g.u)(),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 Lt(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||ut,player_mux_plugin_name:"spotify-playback-mux-reporter",player_mux_plugin_version:ut},e.muxCustomDimensions),getPlayheadTime:this._getPlayheadTime,getStateData:this._getStateData},this._player.addListeners({[d.PLAYER_BEFORE_LOAD]:this._onBeforeLoad.bind(this),[d.PLAYER_PLAY]:this._onPlay.bind(this),[d.PLAYER_PLAYING]:this._onPlaying.bind(this),[d.PLAYER_PAUSED]:this._onPause.bind(this),[d.PLAYER_PROGRESS]:this._onProgress.bind(this),[d.PLAYER_SEEKING]:this._onSeeking.bind(this),[d.PLAYER_POSITION_CHANGED]:this._onPositionChanged.bind(this),[d.PLAYER_ERROR]:this._onError.bind(this),[d.PLAYER_ENDED]:this._onEnded.bind(this),[d.PLAYER_DURATION_CHANGED]:this._onDurationChanged.bind(this),[d.PLAYER_VIDEO_RESIZED]:this._onVideoResized.bind(this),[d.PLAYER_VIDEO_PROFILE_CHANGED]:this._onVideoProfileChanged.bind(this),[d.PLAYER_FRAGMENT_FETCHED]:this._onFragmentFetched.bind(this),[d.PLAYER_FRAGMENT_FETCH_ERROR]:this._onFragmentFetchError.bind(this),[d.PLAYER_VIDEO_MANIFEST_RESOLVED]:this._onVideoManifestResolved.bind(this),[d.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,Nt.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({},Pt);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,Nt.READY),this._isMuxInitialized=!0):o&&this._mux.emit(this._playerId,Nt.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,Nt.PLAY,this._currentContentInfo.videoData)}_onPlaying(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!1,this._mux.emit(this._playerId,Nt.PLAYING))}_onPause(){this._currentContentInfo&&(this._currentContentInfo.stateData.player_is_paused=!0,this._mux.emit(this._playerId,Nt.PAUSE))}_onProgress(e){this._currentContentInfo&&this._mux.emit(this._playerId,Nt.TIMEUPDATE,{player_playhead_time:e.data.position})}_onSeeking(){this._currentContentInfo&&this._mux.emit(this._playerId,Nt.SEEKING)}_onPositionChanged(){this._currentContentInfo&&this._mux.emit(this._playerId,Nt.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,Nt.ERROR,{player_error_code:Ct(i),player_error_message:i})}_onEnded(){this._currentContentInfo&&this._mux.emit(this._playerId,Nt.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,Nt.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,Nt.REQUEST_COMPLETED,{request_type:n,request_hostname:Rt(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,Nt.REQUEST_FAILED,{request_type:n,request_hostname:Rt(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,Nt.REQUEST_COMPLETED,{request_type:"manifest",request_hostname:Rt(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,Nt.REQUEST_FAILED,{request_type:"manifest",request_hostname:Rt(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 kt{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 wt{constructor(e=4e5){this._totalBytes=0,this._overrideBitrate=0,this._currentBandwidth=e,this._short=new kt(2),this._long=new kt(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}}class Dt{constructor(e,t){this._transport=e,this._abrManager=t}_fetch(e,t){const n=(0,l.X)();return this._transport.request(e,{responseType:"arraybuffer",headers:{Range:t}}).then((e=>e.ok&&e.body?{bytes:e.body.byteLength,time:(0,l.X)()-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 Mt=(e,t)=>new Dt(e,t);var xt,Ut,Vt,Ft,Bt,Ht;function Gt(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"}(xt||(xt={})),function(e){e.AAC_LC="mp4a.40.2",e.AAC_HE="mp4a.40.5",e.FLAC="flac",e.OPUS="opus",e.VP9="vp9",e.VP8="vp8",e.H264_31="avc1.4d401f"}(Ut||(Ut={})),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"}(Vt||(Vt={})),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"}(Ft||(Ft={})),function(e){e.NONE="NONE",e.CONTEXT="CONTEXT",e.TRACK="TRACK"}(Bt||(Bt={})),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"}(Ht||(Ht={}));class Wt extends a.bk{constructor(e){if(super(),this._trackPlayerPromise=(0,g.u)(),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=Bt.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 Wt(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({[d.PLAYER_CAN_PRELOAD]:this._handleCanPreload,[d.PLAYER_CAPPED]:this._handleCapped,[d.PLAYER_ENDED]:this._handleEnded,[d.PLAYER_ERROR]:this._handleError,[d.PLAYER_PAUSED]:this._handlePaused,[d.PLAYER_PLAYING]:this._handlePlaying,[d.PLAYER_TIMEOUT]:this._handleTimeout,[d.PLAYER_POSITION_CHANGED]:this._handlePositionChanged,[d.PLAYER_DURATION_CHANGED]:this._handleDurationChanged,[d.PLAYER_PROGRESS]:this._handleProgress,[d.PLAYER_BEFORE_LOAD]:this._handleBeforeLoad,[d.PLAYER_PLAYED_THRESHOLD_REACHED]:this._handlePlayedThresholdReached}),this.proxyEmitAllSync(e,{[d.PLAYER_BEFORE_VOLUME_CHANGE]:d.LIST_PLAYER_BEFORE_VOLUME_CHANGE,[d.PLAYER_LOAD]:d.LIST_PLAYER_PLAYER_LOAD,[d.REPORTING_START]:d.REPORTING_START,[d.REPORTING_CREATIVE_VIEW]:d.REPORTING_CREATIVE_VIEW,[d.REPORTING_FIRST_QUARTILE]:d.REPORTING_FIRST_QUARTILE,[d.REPORTING_MIDPOINT]:d.REPORTING_MIDPOINT,[d.REPORTING_THIRD_QUARTILE]:d.REPORTING_THIRD_QUARTILE,[d.REPORTING_COMPLETE]:d.REPORTING_COMPLETE,[d.REPORTING_PAUSE]:d.REPORTING_PAUSE,[d.REPORTING_RESUME]:d.REPORTING_RESUME,[d.REPORTING_ERROR]:d.REPORTING_ERROR}),this.proxyEmitAll(e,{[d.PLAYER_AUTOPLAY_FAILED]:d.LIST_PLAYER_AUTOPLAY_FAILED,[d.PLAYER_TRACKING_DATA_CREATED]:d.LIST_PLAYER_TRACKING_DATA_CREATED,[d.PLAYER_TRACKING_DATA_FINALIZED]:d.LIST_PLAYER_TRACKING_DATA_FINALIZED,[d.PLAYER_BUFFER_STALLED]:d.LIST_PLAYER_BUFFER_STALLED,[d.PLAYER_BUFFERING_START]:d.LIST_PLAYER_BUFFERING_START,[d.PLAYER_BUFFERING_END]:d.LIST_PLAYER_BUFFERING_END,[d.PLAYER_REBUFFERING_START]:d.LIST_PLAYER_REBUFFERING_START,[d.PLAYER_REBUFFERING_END]:d.LIST_PLAYER_REBUFFERING_END,[d.PLAYER_VIDEO_ELEMENT_APPENDED]:d.LIST_PLAYER_VIDEO_ELEMENT_APPENDED,[d.PLAYER_VIDEO_ELEMENT_REMOVED]:d.LIST_PLAYER_VIDEO_ELEMENT_REMOVED,[d.PLAYER_DISPLAYED_CUES_CHANGED]:d.LIST_PLAYER_DISPLAYED_CUES_CHANGED,[d.LIST_PLAYER_VIDEO_PROFILE_CHANGED]:d.PLAYER_VIDEO_PROFILE_CHANGED,[d.LIST_PLAYER_PLAYBACK_SPEED_CHANGED]:d.PLAYER_PLAYBACK_SPEED_CHANGED,[d.LIST_PLAYER_SUBTITLE_LANGUAGES_LOADED]:d.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;const o=isNaN(e)?0:e;return null!==(i=null===(n=null===(t=this._loadedList)||void 0===t?void 0:t.translateDuration)||void 0===n?void 0:n.call(t,o))&&void 0!==i?i:o}_handleProgress(e){const{data:t}=e;this.emit(d.LIST_PLAYER_PROGRESS,Object.assign(Object.assign({},t),{position:this._translatePosition(t.position)}))}_handleBeforeLoad(e){const{data:t}=e;this.emit(d.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 _(h.LIST_PLAYER_NO_TRACK_PLAYER,e.message||"Track player promise was rejected."))}_handleCapped(){const e=this._currentTrack;e&&this.emit(d.LIST_PLAYER_CAPPED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList})}_handlePlaying(e){const t=this._currentTrack;t&&this.emit(d.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(d.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(d.LIST_PLAYER_TRACK_ENDED,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(Vt.TRACK_DONE))}_handleTimeout(){const e=this._currentTrack;e&&(this.emit(d.LIST_PLAYER_TRACK_TIMEOUT,{uid:this._uid,track:e,options:this._currentTrackOptions,list:this._loadedList}),this.next(Vt.TRACK_ERROR))}_handlePositionChanged(e){const t=this._currentTrack;t&&this.emit(d.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(d.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(d.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(d.LIST_PLAYER_ERROR,n),this.emitSync(d.LIST_PLAYER_ERROR_SYNC,n);const i=!!n.error&&n.error.listPlayerIgnore;i||this._listErrorCount++,n.canPlayNext&&(i||this._listErrorCount<=this._maxListErrors?this.next(Vt.TRACK_ERROR):this.emit(d.LIST_PLAYER_MAX_LIST_ERRORS_REACHED,{count:this._listErrorCount,threshold:this._maxListErrors}))}_handleTrackLoaded(e){this.emitSync(d.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(d.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(d.LIST_PLAYER_LIST_CHANGED,{list:e,options:t}),f.SUCCESS}_changeTrack(e,t,n){if(this._currentSeqId!==n)return Promise.resolve(f.CANCELLED);this.emitSync(d.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,s=0,c=3e4,l=!1,u=!1;o&&(1===i?(a=!o.paused,s=o.initialPosition||o.position||0):s=o.position||0,l=o.muted||!1,u=o.loop||!1);const p=t===Vt.TRACK_DONE;if(e.options){const t=e.options;void 0!==t.paused&&(a=!t.paused),void 0!==t.position&&(s=t.position),void 0!==t.playedThreshold&&(c=t.playedThreshold),void 0!==t.loadingTimeout&&(r=t.loadingTimeout),void 0!==t.muted&&(l=t.muted),void 0!==t.loop&&(u=t.loop)}this._currentTrack=e,this._currentTrackOptions={reason:t,paused:!a,position:s,playedThreshold:c,muted:l,loop:u};const h=this._handleTrackLoaded.bind(this,{uid:this._uid,track:this._currentTrack,options:this._currentTrackOptions,list:this._loadedList});return this._getTrackPlayer().then((t=>this._currentSeqId!==n?f.CANCELLED:(Promise.resolve(t.load(e,{uriProperty:"playableURI",autoplay:a,position:s,playedThreshold:c,continuePrevious:p,loadingTimeout:r,muted:l,loop:u},h)).catch((()=>{})),f.SUCCESS)))}_preloadUpcomingTrack(){const e=this._loadedList;return e?e.peekNext({reason:Vt.TRACK_DONE,listConstants:xt}).then((e=>e===xt.FORBIDDEN?f.FORBIDDEN:e===xt.NULL_VALUE?f.INVALID:e===xt.LIST_END?f.LIST_END:Gt(e)&&e.playable?this.preloadTrack(e):f.INVALID)):Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}preloadTrack(e){return this._getTrackPlayer().then((t=>(t.preload(e).catch((()=>{})),f.SUCCESS)))}activateElement(){return this._getTrackPlayer().then((e=>(e.activateElement(),f.SUCCESS)))}load(e,t){const n=function(e={}){const t={index:-1,position:0,initialPosition:0,playbackSpeed:1,duration:-1,paused:!1,reason:Vt.UNKNOWN,muted:!1,loop:!1};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),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.loop&&(t.loop=e.loop),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 f.CANCELLED;const t=this._loadedOptions?this._loadedOptions.reason:Vt.UNKNOWN;return this.next(t)}))}canChangeTrack(){return this._loadedList?this._loadedList.peekNext({reason:Vt.FORWARD_BUTTON,listConstants:xt}).then((e=>e!==xt.FORBIDDEN)):Promise.resolve(!0)}next(e){if(!e)return Promise.reject(new _(h.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(d.LIST_PLAYER_BEFORE_NEXT,{list:t,reason:e});const n=this._incrementSeqId(),i={reason:e,listConstants:xt};return t.next(i).then((i=>this._currentSeqId!==n?f.CANCELLED:i===xt.FORBIDDEN?f.FORBIDDEN:i===xt.NULL_VALUE?this.next(e):i===xt.LIST_END?(this.emit(d.LIST_PLAYER_LIST_ENDED,{list:t,reason:Vt.END_PLAY}),this.clear(e),f.LIST_END):Gt(i)?i.playable?this._changeTrack(i,e,n):(this.emit(d.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.next(e)):f.INVALID))}previous(e){if(!e)return Promise.reject(new _(h.LIST_PLAYER_INVALID_ARGUMENT,"The argument `reason` is required."));const t=this._loadedList;if(!t)return Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));this.emitSync(d.LIST_PLAYER_BEFORE_PREVIOUS,{list:t,reason:e});const n=this._incrementSeqId(),i={reason:e,listConstants:xt};return t.previous(i).then((i=>this._currentSeqId!==n?f.CANCELLED:i===xt.FORBIDDEN?f.FORBIDDEN:i===xt.NULL_VALUE?this.previous(e):i===xt.LIST_START?(this.emit(d.LIST_PLAYER_LIST_ENDED,{list:t,reason:Vt.END_PLAY}),this.clear(e),f.LIST_END):Gt(i)?i.playable?this._changeTrack(i,e,n):(this.emit(d.LIST_PLAYER_TRACK_UNPLAYABLE,{track:i,list:t}),this.previous(e)):f.INVALID))}pause(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.pause().then((()=>f.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?f.CANCELLED:f.FORBIDDEN)))):Promise.resolve(f.SUCCESS):Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}resume(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.resume().then((()=>f.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?f.CANCELLED:f.FORBIDDEN)))):Promise.resolve(f.SUCCESS):Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}togglePlay(){return this._loadedList?this._currentTrack?this._getTrackPlayer().then((e=>e.togglePlay().then((()=>f.SUCCESS)).catch((e=>"AbortError"===(null==e?void 0:e.name)?f.CANCELLED:f.FORBIDDEN)))):Promise.resolve(f.SUCCESS):Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."))}stop(e){const t={reason:e||Vt.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(d.LIST_PLAYER_STOPPED,{uid:this._uid,options:this._currentTrackOptions,list:this._loadedList}),f.SUCCESS)))}clear(e){return this.stop(e).then((()=>(this._loadedList=null,this._loadedOptions=null,this._currentTrack=null,this._currentTrackOptions=null,this.emit(d.LIST_PLAYER_CLEARED,null),f.SUCCESS)))}setShuffle(e){const t=!!e;if(this._shuffled!==t){this._shuffled=t,this.emit(d.LIST_PLAYER_SHUFFLE_CHANGED,{player:this,shuffled:t});const e=this._loadedList;e&&e.setShuffle(this._shuffled)}return Promise.resolve(f.SUCCESS)}setRepeatMode(e){if(!(e in Bt))return Promise.reject(new _(h.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(d.LIST_PLAYER_REPEAT_MODE_CHANGED,{player:this,repeatMode:e});const t=this._loadedList;t&&t.setRepeatMode(this._repeatMode)}return Promise.resolve(f.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(d.LIST_PLAYER_VOLUME_CHANGED,{volume:e,commandId:t}),f.SUCCESS)))}seek(e,t=Vt.SEEK){var n,i;const o=this._loadedList;if(!o)return Promise.reject(new _(h.LIST_PLAYER_NO_LIST,"Cannot perform operation; no list was loaded."));if("function"==typeof o.allowSeeking&&!o.allowSeeking())return Promise.reject(new _(h.LIST_PLAYER_FORBIDDEN,"The operation is not allowed."));const r=null!==(i=null===(n=o.handleSeek)||void 0===n?void 0:n.call(o,e,{reason:t,listConstants:xt}))&&void 0!==i?i:e;return r===xt.PAUSE?this.pause().then((t=>(this.emit(d.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:r}),t))):r===xt.IGNORE?(this.emit(d.LIST_PLAYER_SEEK_HANDLED,{position:e,reason:r}),Promise.resolve(f.SUCCESS)):this._currentTrack?this._getTrackPlayer().then((e=>(e.seek(r),f.SUCCESS))):Promise.resolve(f.SUCCESS)}getListConstants(){return xt}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((()=>f.SUCCESS))}showSubtitles(){return this._getTrackPlayer().then((e=>e.showSubtitles())).then((()=>f.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((()=>f.SUCCESS))}activateCueEvents(){return this._getTrackPlayer().then((e=>e.activateCueEvents())).then((()=>f.SUCCESS))}getCurrentBandwidth(){return this._getTrackPlayer().then((e=>e.getCurrentBandwidth()))}setSubtitleLanguage(e){return this._getTrackPlayer().then((t=>t.setSubtitleLanguage(e))).then((()=>f.SUCCESS))}setPlaybackSpeed(e){return this._getTrackPlayer().then((t=>t.setPlaybackSpeed(e))).then((e=>e?f.SUCCESS:f.FORBIDDEN))}setMuted(e){return this._getTrackPlayer().then((t=>(t.setMuted(e),f.SUCCESS)))}getStatistics(){return this._getTrackPlayer().then((e=>e.getStatistics()))}getAudioProcessor(){return this._getTrackPlayer().then((e=>e.getAudioProcessor()))}}const jt=r.m.forTag("playback.init");function Yt(e){return new Promise(((t,n)=>{var i,r,a,s,c,l,u,d,p,h,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===(r=e.playerContainerManager)||void 0===r?void 0:r.eject)||"function"!=typeof(null===(a=e.playerContainerManager)||void 0===a?void 0:a.inject)))return void n(new TypeError("Both inject and eject PlayerContainerManager functions must be present."));const{transport:m}=e,[_="",g=""]=(e.sdkId||"").split(":"),E=new wt,v=Object.assign(Object.assign({},e),{abrManager:E,initialBandwidthSampler:Mt(m,E),tracker:yt.create(),audioResolver:new mt(m),videoResolver:new bt(m),licenseURLResolver:new Tt({transport:m,sdk:{name:_,version:g},securityLevel:e.securityLevel,useTestLicenseServer:e.useTestLicenseServer}),newBufferPerTrack:null===(s=e.newBufferPerTrack)||void 0===s||s,preinitMediaElement:null===(c=e.preinitMediaElement)||void 0===c||c,audioProcessorOptions:Object.assign(Object.assign({},e.audioProcessorOptions),{disable:null!==(u=null===(l=e.audioProcessorOptions)||void 0===l?void 0:l.disable)&&void 0!==u?u:!!e.createPlayer})});e.unauthenticatedLogs&&!(null===(d=e.loggerOptions)||void 0===d?void 0:d.endpoint)&&(e.loggerOptions=Object.assign(Object.assign({},e.loggerOptions),{endpoint:"https://spclient.wg.spotify.com/melody/unauth"})),(null===(p=null==e?void 0:e.loggerOptions)||void 0===p?void 0:p.deviceInfo)||Promise.all([null===(h=e.loggerOptions)||void 0===h?void 0:h.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}})})),at.create(v).then((t=>{const n=Object.assign({disableMux:!0},e.loggerOptions),i=function(e){return new At(e)}(Object.assign(Object.assign({},n),{transport:m,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:""}))})),r=pt.create({transport:m,player:t,logSender:i});return n.disableMux||Lt.create({player:t,mux:o,envKey:null==n?void 0:n.muxEnvKey,sdk:_,sdkVersion:g,deviceInfo:n.deviceInfo,muxCustomDimensions:n.muxCustomDimensions}).ready().then((()=>jt.info("MuxReporter ready")),(e=>jt.error("Failed to instantiate MuxReporter",null==e?void 0:e.message))),{player:t,logger:r}})).then(t,n)}))}var zt;!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.REBUFFERING_START="REBUFFERING_START",e.REBUFFERING_END="REBUFFERING_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",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"}(zt||(zt={}));const Kt={MP3:m.MP3,MP4:m.MP4,MP4_DUAL:m.MP4_DUAL,MP4_CBCS:m.MP4_CBCS,MP4_FLAC:m.MP4_FLAC,MANIFEST_ID:m.MANIFEST_ID,AD_MANIFEST:m.AD_MANIFEST,GENERIC_MEDIA:m.GENERIC_MEDIA};class Jt{constructor(e){var t,n,i,o,r;if(this.isAd=!1,!e.uri)throw new TypeError("Missing required `uri` option.");if(!e.fileId&&!(null!==(t=e.url)&&void 0!==t?t:e.resolvedURL))throw new TypeError("Missing: provide either fileId or url");this.uri=e.uri,this.playableURI=this.uri,this.fileId=e.fileId||"",this.playable=null===(n=e.playable)||void 0===n||n,this.mediaType=e.mediaType||"audio",this.metadata=e.metadata||{},this.url=null!==(i=e.url)&&void 0!==i?i:e.resolvedURL,this.noManifest=null!==(o=e.noManifest)&&void 0!==o?o:!!this.url,this.noAuth=null!==(r=e.noAuth)&&void 0!==r&&r,this.preloadedManifest=e.preloadedManifest,this.licenseEndpoint=e.licenseEndpoint,this.fileFormat=e.fileFormat,this.poster=e.poster,this.options=e.options,this.audioGain=e.audioGain,this.mimeType=e.mimeType;const{format:a}=e;if(a){if(!Kt.hasOwnProperty(a))throw new TypeError("Invalid `format` option.");this.format=Kt[a]}else this.format=this.url&&!this.fileId?m.GENERIC_MEDIA:m.MP4;this.logData=Object.assign(Object.assign({},e.logData),{noLog:!1,noTSV:!0,noStats:!1})}static create(e){return new Jt(e)}}class qt{constructor(e){this._index=-1,this._tracks=[],this._tracks=e.tracks}static create(e){const t=[];for(const n of e.tracks)n instanceof Jt?t.push(n):t.push(Jt.create(n));return new qt({tracks:t})}startAt(e){return e>this._tracks.length||e<0?this._index=-1:this._index=e-1,Promise.resolve(f.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(xt.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(xt.NULL_VALUE)}setShuffle(){return Promise.resolve(f.SUCCESS)}setRepeatMode(){return Promise.resolve(f.SUCCESS)}}class Xt extends a.bk{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 Xt(e)}_init(){const e=this._listPlayer;this.proxyEmitAll(e,{[d.LIST_PLAYER_AUTOPLAY_FAILED]:zt.AUTOPLAY_FAILED,[d.LIST_PLAYER_BEFORE_LIST_CHANGE]:zt.BEFORE_LIST_CHANGE,[d.LIST_PLAYER_BUFFER_STALLED]:zt.BUFFER_STALLED,[d.LIST_PLAYER_BUFFERING_START]:zt.BUFFERING_START,[d.LIST_PLAYER_BUFFERING_END]:zt.BUFFERING_END,[d.LIST_PLAYER_REBUFFERING_START]:zt.REBUFFERING_START,[d.LIST_PLAYER_REBUFFERING_END]:zt.REBUFFERING_END,[d.LIST_PLAYER_CLEARED]:zt.CLEARED,[d.LIST_PLAYER_DURATION_CHANGED]:zt.DURATION_CHANGED,[d.LIST_PLAYER_ERROR]:zt.ERROR,[d.LIST_PLAYER_LIST_CHANGED]:zt.LIST_CHANGED,[d.LIST_PLAYER_LIST_ENDED]:zt.LIST_ENDED,[d.LIST_PLAYER_MAX_LIST_ERRORS_REACHED]:zt.MAX_LIST_ERRORS_REACHED,[d.LIST_PLAYER_PAUSED]:zt.PAUSED,[d.LIST_PLAYER_PLAYING]:zt.PLAYING,[d.LIST_PLAYER_PLAYED_THRESHOLD_REACHED]:zt.PLAYED_THRESHOLD_REACHED,[d.LIST_PLAYER_POSITION_CHANGED]:zt.POSITION_CHANGED,[d.LIST_PLAYER_PROGRESS]:zt.PROGRESS,[d.LIST_PLAYER_REPEAT_MODE_CHANGED]:zt.REPEAT_MODE_CHANGED,[d.LIST_PLAYER_SHUFFLE_CHANGED]:zt.SHUFFLE_CHANGED,[d.LIST_PLAYER_STOPPED]:zt.STOPPED,[d.LIST_PLAYER_TRACKING_DATA_CREATED]:zt.TRACKING_DATA_CREATED,[d.LIST_PLAYER_TRACKING_DATA_FINALIZED]:zt.TRACKING_DATA_FINALIZED,[d.LIST_PLAYER_TRACK_ENDED]:zt.TRACK_ENDED,[d.LIST_PLAYER_TRACK_LOADED]:zt.TRACK_LOADED,[d.LIST_PLAYER_TRACK_TIMEOUT]:zt.TRACK_TIMEOUT,[d.LIST_PLAYER_TRACK_UNPLAYABLE]:zt.TRACK_UNPLAYABLE,[d.LIST_PLAYER_VOLUME_CHANGED]:zt.VOLUME_CHANGED,[d.LIST_PLAYER_VIDEO_ELEMENT_APPENDED]:zt.VIDEO_ELEMENT_APPENDED,[d.LIST_PLAYER_VIDEO_ELEMENT_REMOVED]:zt.VIDEO_ELEMENT_REMOVED,[d.PLAYER_DISPLAYED_CUES_CHANGED]:zt.DISPLAYED_CUES_CHANGED,[d.PLAYER_SUBTITLE_LANGUAGES_LOADED]:zt.SUBTITLE_LANGUAGES_LOADED,[d.PLAYER_PLAYBACK_SPEED_CHANGED]:zt.SPEED_CHANGED}),this.proxyEmitAllSync(e,{[d.LIST_PLAYER_BEFORE_NEXT]:zt.BEFORE_NEXT,[d.LIST_PLAYER_BEFORE_PREVIOUS]:zt.BEFORE_PREVIOUS,[d.LIST_PLAYER_BEFORE_TRACK_LOAD]:zt.BEFORE_TRACK_LOAD,[d.LIST_PLAYER_ERROR_SYNC]:zt.ERROR_SYNC,[d.REPORTING_START]:zt.REPORTING_START,[d.REPORTING_FIRST_QUARTILE]:zt.REPORTING_FIRST_QUARTILE,[d.REPORTING_MIDPOINT]:zt.REPORTING_MIDPOINT,[d.REPORTING_THIRD_QUARTILE]:zt.REPORTING_THIRD_QUARTILE,[d.REPORTING_COMPLETE]:zt.REPORTING_COMPLETE,[d.REPORTING_PAUSE]:zt.REPORTING_PAUSE,[d.REPORTING_RESUME]:zt.REPORTING_RESUME,[d.REPORTING_CREATIVE_VIEW]:zt.REPORTING_CREATIVE_VIEW,[d.REPORTING_ERROR]:zt.REPORTING_ERROR}),this._emitStateChanged=this._emitStateChanged.bind(this),this.on(zt.CLEARED,this._emitStateChanged),this.on(zt.PAUSED,this._emitStateChanged),this.on(zt.PLAYING,this._emitStateChanged),this.on(zt.POSITION_CHANGED,this._emitStateChanged),this.on(zt.STOPPED,this._emitStateChanged),this.on(zt.LIST_CHANGED,this._emitStateChanged),this.on(zt.VOLUME_CHANGED,this._emitStateChanged),this.on(zt.SPEED_CHANGED,this._emitStateChanged),this.on(zt.TRACK_LOADED,this._emitStateChanged),this._playerPromise.then((()=>this.emit(zt.PLAYER_INITIALIZATION_DONE,null))).catch((e=>this.emit(zt.PLAYER_INITIALIZATION_FAILED,{error:e}))),this._transport.on(s.TransportEvent.BEFORE_ONLINE_DISCONNECT,(e=>{e.data.awaitPromise(this._listPlayer.stop(Vt.END_PLAY).catch((e=>{})))}))}_emitStateChanged(){this._listPlayer.getState().then((e=>{this.emit(zt.STATE_CHANGED,{state:e})}))}playTracks(e,t){return this._autoActivateElement&&this._listPlayer.activateElement(),new Promise((t=>{t(qt.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(Vt.END_PLAY)}seek(e){return this._listPlayer.seek(e)}nextTrack(){return this._listPlayer.next(Vt.FORWARD_BUTTON)}previousTrack(){return this._listPlayer.previous(Vt.BACK_BUTTON)}getVolume(){return this._listPlayer.getVolume()}setVolume(e){return this._listPlayer.setVolume(e)}setPlaybackSpeed(e){return this._listPlayer.setPlaybackSpeed(e)}setMuted(e){return this._listPlayer.setMuted(e)}activateElement(){return this._listPlayer.activateElement()}preloadTrack(e){return this._listPlayer.preloadTrack(e)}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 $t={tagged:"2.24.0-af512aa",version:"2.24.0",revision:"af512aa"},Zt=(Object.assign(Object.assign({},s.TransportErrors),h),Jt.create),Qt=qt.create;function en(e){var t,n,i,o,r,a,s;const{transport:c,autoActivateElement:l,config:u}=e,d=null==u?void 0:u.mux,p=Yt(Object.assign(Object.assign({},u),{loggerOptions:{platform:e.platform_identifier,disableMux:null===(n=null!==(t=null==d?void 0:d.disable)&&void 0!==t?t:null==u?void 0:u.disableMux)||void 0===n||n,muxEnvKey:null!==(i=null==d?void 0:d.envKey)&&void 0!==i?i:null==u?void 0:u.muxEnvKey,muxCustomDimensions:null==d?void 0:d.customDimensions,deviceInfo:null!==(o=null==d?void 0:d.deviceInfo)&&void 0!==o?o:null===(r=null==u?void 0:u.loggerOptions)||void 0===r?void 0:r.deviceInfo},sdkId:`overture:${$t.version}`,transport:c.toPublic(),audioProcessorOptions:{disable:null===(s=null===(a=null==u?void 0:u.audioProcessorOptions)||void 0===a?void 0:a.disable)||void 0===s||s}})).then((e=>e.player)),h=Wt.create({trackPlayer:p});return Xt.create({listPlayer:h,playerPromise:p,transport:c,autoActivateElement:l})}},39302:(e,t,n)=>{"use strict";n.d(t,{HK:()=>ue,Dr:()=>v,Qm:()=>ie,wK:()=>re,Op:()=>J,KT:()=>q,H1:()=>A,jB:()=>se,Gv:()=>O});var i=n(21364),o=n(24848),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:!!g(e.canView)&&Boolean(e.canView),canAdministratePermissions:!!g(e.canAdministratePermissions)&&Boolean(e.canAdministratePermissions),grantableLevel:Array.isArray(e?.grantableLevel)?e.grantableLevel.map((e=>h(e))):[],canEditMetadata:!!g(e.canEditMetadata)&&Boolean(e.canEditMetadata),canEditItems:!!g(e.canEditItems)&&Boolean(e.canEditItems),canCancelMembership:!!g(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=>f(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 _=(()=>{if(void 0!==_)return _;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 g(e){return null!=e}r().util.Long!==i.A&&(r().util.Long=i.A,r().configure());var E=n(20633);let v=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 y=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 T(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 A=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 I(e){switch(e){case 0:case"KIND_UNKNOWN":return A.KIND_UNKNOWN;case 2:case"ADD":return A.ADD;case 3:case"REM":return A.REM;case 4:case"MOV":return A.MOV;case 5:case"UPDATE_ITEM_ATTRIBUTES":return A.UPDATE_ITEM_ATTRIBUTES;case 6:case"UPDATE_LIST_ATTRIBUTES":return A.UPDATE_LIST_ATTRIBUTES;case 7:case"UPDATE_ITEM_URIS":return A.UPDATE_ITEM_URIS;default:return A.UNRECOGNIZED}}let O=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 O.CLIENT_UNKNOWN;case 1:case"NATIVE_HERMES":return O.NATIVE_HERMES;case 2:case"CLIENT":return O.CLIENT;case 3:case"PYTHON":return O.PYTHON;case 4:case"JAVA":return O.JAVA;case 5:case"WEBPLAYER":return O.WEBPLAYER;case 6:case"LIBSPOTIFY":return O.LIBSPOTIFY;default:return O.UNRECOGNIZED}}const R={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 N(){return{revision:new Uint8Array,attributes:void 0,length:0,timestamp:"0",ownerUsername:"",abuseReportingEnabled:!1,capabilities:void 0,geoblock:[]}}const P={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=N();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=fe(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=he(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=>T(e))):t.geoblock=[],t},fromPartial(e){const t=N();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 L={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)R.encode(n,t.uint32(26).fork()).ldelim();if(void 0!==e.metaItems&&0!==e.metaItems.length)for(const n of e.metaItems)P.encode(n,t.uint32(34).fork()).ldelim();if(void 0!==e.availableSignals&&0!==e.availableSignals.length)for(const n of e.availableSignals)E.HN.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(R.decode(n,n.uint32()));break;case 4:o.metaItems.push(P.decode(n,n.uint32()));break;case 5:o.availableSignals.push(E.HN.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=>R.fromJSON(e))):[],metaItems:Array.isArray(e?.metaItems)?e.metaItems.map((e=>P.fromJSON(e))):[],availableSignals:Array.isArray(e?.availableSignals)?e.availableSignals.map((e=>E.HN.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?R.toJSON(e):void 0)):t.items=[],e.metaItems?t.metaItems=e.metaItems.map((e=>e?P.toJSON(e):void 0)):t.metaItems=[],e.availableSignals?t.availableSignals=e.availableSignals.map((e=>e?E.HN.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=>R.fromPartial(e)))||[],t.metaItems=e.metaItems?.map((e=>P.fromPartial(e)))||[],t.availableSignals=e.availableSignals?.map((e=>E.HN.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 w={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 D={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)w.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(w.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=>w.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=he(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?w.toJSON(e):void 0)):t.pictureSize=[],void 0!==e.sequenceContextTemplate&&(t.sequenceContextTemplate=he(void 0!==e.sequenceContextTemplate?e.sequenceContextTemplate:new Uint8Array)),void 0!==e.aiCurationReferenceId&&(t.aiCurationReferenceId=he(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=>w.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)E.HN.encode(n,t.uint32(114).fork()).ldelim();return void 0!==e.recommendationInfo&&D.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=fe(n.int64());break;case 9:o.seenAt=fe(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(E.HN.decode(n,n.uint32()));break;case 15:o.recommendationInfo=D.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=>E.HN.fromJSON(e))):[],recommendationInfo:me(e.recommendationInfo)?D.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=he(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?E.HN.toJSON(e):void 0)):t.availableSignals=[],void 0!==e.recommendationInfo&&(t.recommendationInfo=e.recommendationInfo?D.toJSON(e.recommendationInfo):void 0),void 0!==e.sequenceChildTemplate&&(t.sequenceChildTemplate=he(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=>E.HN.fromPartial(e)))||[],t.recommendationInfo=void 0!==e.recommendationInfo&&null!==e.recommendationInfo?D.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)R.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&&R.encode(e.addBeforeItem,t.uint32(50).fork()).ldelim(),void 0!==e.addAfterItem&&R.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(R.decode(n,n.uint32()));break;case 4:o.addLast=n.bool();break;case 5:o.addFirst=n.bool();break;case 6:o.addBeforeItem=R.decode(n,n.uint32());break;case 7:o.addAfterItem=R.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=>R.fromJSON(e))):[],addLast:!!me(e.addLast)&&Boolean(e.addLast),addFirst:!!me(e.addFirst)&&Boolean(e.addFirst),addBeforeItem:me(e.addBeforeItem)?R.fromJSON(e.addBeforeItem):void 0,addAfterItem:me(e.addAfterItem)?R.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?R.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?R.toJSON(e.addBeforeItem):void 0),void 0!==e.addAfterItem&&(t.addAfterItem=e.addAfterItem?R.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=>R.fromPartial(e)))||[],t.addLast=e.addLast??!1,t.addFirst=e.addFirst??!1,t.addBeforeItem=void 0!==e.addBeforeItem&&null!==e.addBeforeItem?R.fromPartial(e.addBeforeItem):void 0,t.addAfterItem=void 0!==e.addAfterItem&&null!==e.addAfterItem?R.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)R.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(R.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=>R.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?R.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=>R.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)R.encode(n,t.uint32(34).fork()).ldelim();return void 0!==e.addBeforeItem&&R.encode(e.addBeforeItem,t.uint32(42).fork()).ldelim(),void 0!==e.addAfterItem&&R.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(R.decode(n,n.uint32()));break;case 5:o.addBeforeItem=R.decode(n,n.uint32());break;case 6:o.addAfterItem=R.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=>R.fromJSON(e))):[],addBeforeItem:me(e.addBeforeItem)?R.fromJSON(e.addBeforeItem):void 0,addAfterItem:me(e.addAfterItem)?R.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?R.toJSON(e):void 0)):t.items=[],void 0!==e.addBeforeItem&&(t.addBeforeItem=e.addBeforeItem?R.toJSON(e.addBeforeItem):void 0),void 0!==e.addAfterItem&&(t.addAfterItem=e.addAfterItem?R.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=>R.fromPartial(e)))||[],t.addBeforeItem=void 0!==e.addBeforeItem&&null!==e.addBeforeItem?R.fromPartial(e.addBeforeItem):void 0,t.addAfterItem=void 0!==e.addAfterItem&&null!==e.addAfterItem?R.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 y.ITEM_UNKNOWN;case 1:case"ITEM_ADDED_BY":return y.ITEM_ADDED_BY;case 2:case"ITEM_TIMESTAMP":return y.ITEM_TIMESTAMP;case 9:case"ITEM_SEEN_AT":return y.ITEM_SEEN_AT;case 10:case"ITEM_PUBLIC":return y.ITEM_PUBLIC;case 11:case"ITEM_FORMAT_ATTRIBUTES":return y.ITEM_FORMAT_ATTRIBUTES;case 12:case"ITEM_ID":return y.ITEM_ID;case 13:case"ITEM_SOURCE_LENS":return y.ITEM_SOURCE_LENS;case 14:case"ITEM_AVAILABLE_SIGNALS":return y.ITEM_AVAILABLE_SIGNALS;case 15:case"ITEM_RECOMMENDATION_INFO":return y.ITEM_RECOMMENDATION_INFO;case 16:case"ITEM_SEQUENCE_CHILD_TEMPLATE":return y.ITEM_SEQUENCE_CHILD_TEMPLATE;default:return y.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 y.ITEM_UNKNOWN:return 0;case y.ITEM_ADDED_BY:return 1;case y.ITEM_TIMESTAMP:return 2;case y.ITEM_SEEN_AT:return 9;case y.ITEM_PUBLIC:return 10;case y.ITEM_FORMAT_ATTRIBUTES:return 11;case y.ITEM_ID:return 12;case y.ITEM_SOURCE_LENS:return 13;case y.ITEM_AVAILABLE_SIGNALS:return 14;case y.ITEM_RECOMMENDATION_INFO:return 15;case y.ITEM_SEQUENCE_CHILD_TEMPLATE:return 16;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?V.fromPartial(e.values):void 0,t.noValue=e.noValue?.map((e=>e))||[],t}};const W={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 v.LIST_UNKNOWN;case 1:case"LIST_NAME":return v.LIST_NAME;case 2:case"LIST_DESCRIPTION":return v.LIST_DESCRIPTION;case 3:case"LIST_PICTURE":return v.LIST_PICTURE;case 4:case"LIST_COLLABORATIVE":return v.LIST_COLLABORATIVE;case 5:case"LIST_PL3_VERSION":return v.LIST_PL3_VERSION;case 6:case"LIST_DELETED_BY_OWNER":return v.LIST_DELETED_BY_OWNER;case 10:case"LIST_CLIENT_ID":return v.LIST_CLIENT_ID;case 11:case"LIST_FORMAT":return v.LIST_FORMAT;case 12:case"LIST_FORMAT_ATTRIBUTES":return v.LIST_FORMAT_ATTRIBUTES;case 13:case"LIST_PICTURE_SIZE":return v.LIST_PICTURE_SIZE;case 14:case"LIST_SEQUENCE_CONTEXT_TEMPLATE":return v.LIST_SEQUENCE_CONTEXT_TEMPLATE;case 15:case"LIST_AI_CURATION_REFERENCE_ID":return v.LIST_AI_CURATION_REFERENCE_ID;default:return v.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 v.LIST_UNKNOWN:return 0;case v.LIST_NAME:return 1;case v.LIST_DESCRIPTION:return 2;case v.LIST_PICTURE:return 3;case v.LIST_COLLABORATIVE:return 4;case v.LIST_PL3_VERSION:return 5;case v.LIST_DELETED_BY_OWNER:return 6;case v.LIST_CLIENT_ID:return 10;case v.LIST_FORMAT:return 11;case v.LIST_FORMAT_ATTRIBUTES:return 12;case v.LIST_PICTURE_SIZE:return 13;case v.LIST_SEQUENCE_CONTEXT_TEMPLATE:return 14;case v.LIST_AI_CURATION_REFERENCE_ID:return 15;case v.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 j={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&&R.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=R.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)?R.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?R.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?R.fromPartial(e.item):void 0,t}};const Y={encode:(e,t=r().Writer.create())=>(void 0!==e.newAttributes&&W.encode(e.newAttributes,t.uint32(10).fork()).ldelim(),void 0!==e.oldAttributes&&W.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=W.decode(n,n.uint32());break;case 2:o.oldAttributes=W.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({newAttributes:me(e.newAttributes)?W.fromJSON(e.newAttributes):void 0,oldAttributes:me(e.oldAttributes)?W.fromJSON(e.oldAttributes):void 0}),toJSON(e){const t={};return void 0!==e.newAttributes&&(t.newAttributes=e.newAttributes?W.toJSON(e.newAttributes):void 0),void 0!==e.oldAttributes&&(t.oldAttributes=e.oldAttributes?W.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?W.fromPartial(e.newAttributes):void 0,t.oldAttributes=void 0!==e.oldAttributes&&null!==e.oldAttributes?W.fromPartial(e.oldAttributes):void 0,t}};const z={encode(e,t=r().Writer.create()){if(void 0!==e.uriReplacements&&0!==e.uriReplacements.length)for(const n of e.uriReplacements)K.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(K.decode(n,n.uint32()));else n.skipType(7&e)}return o},fromJSON:e=>({uriReplacements:Array.isArray(e?.uriReplacements)?e.uriReplacements.map((e=>K.fromJSON(e))):[]}),toJSON(e){const t={};return e.uriReplacements?t.uriReplacements=e.uriReplacements.map((e=>e?K.toJSON(e):void 0)):t.uriReplacements=[],t},fromPartial(e){const t={uriReplacements:[]};return t.uriReplacements=e.uriReplacements?.map((e=>K.fromPartial(e)))||[],t}};const K={encode:(e,t=r().Writer.create())=>(void 0!==e.index&&0!==e.index&&t.uint32(8).int32(e.index),void 0!==e.item&&R.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=R.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)?R.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?R.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?R.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&&j.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&&z.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=j.decode(n,n.uint32());break;case 6:o.updateListAttributes=Y.decode(n,n.uint32());break;case 7:o.updateItemUris=z.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({kind:me(e.kind)?I(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)?j.fromJSON(e.updateItemAttributes):void 0,updateListAttributes:me(e.updateListAttributes)?Y.fromJSON(e.updateListAttributes):void 0,updateItemUris:me(e.updateItemUris)?z.fromJSON(e.updateItemUris):void 0}),toJSON(e){const t={};return void 0!==e.kind&&(t.kind=function(e){switch(e){case A.KIND_UNKNOWN:return 0;case A.ADD:return 2;case A.REM:return 3;case A.MOV:return 4;case A.UPDATE_ITEM_ATTRIBUTES:return 5;case A.UPDATE_LIST_ATTRIBUTES:return 6;case A.UPDATE_ITEM_URIS:return 7;case A.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?j.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?z.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?j.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?z.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&&$.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=fe(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=$.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)?$.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?$.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?$.fromPartial(e.source):void 0,t}};const $={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 O.CLIENT_UNKNOWN:return 0;case O.NATIVE_HERMES:return 1;case O.CLIENT:return 2;case O.PYTHON:return 3;case O.JAVA:return 4;case O.WEBPLAYER:return 5;case O.LIBSPOTIFY:return 6;case O.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 Z(){return{baseVersion:new Uint8Array,ops:[],info:void 0}}const Q={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=Z();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=he(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=Z();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=he(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=he(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)Q.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(Q.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=>Q.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=he(void 0!==e.baseRevision?e.baseRevision:new Uint8Array)),e.deltas?t.deltas=e.deltas.map((e=>e?Q.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=>Q.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)E.HN.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(E.HN.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=>E.HN.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.baseRevision&&(t.baseRevision=he(void 0!==e.baseRevision?e.baseRevision:new Uint8Array)),e.emittedSignals?t.emittedSignals=e.emittedSignals.map((e=>e?E.HN.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=>E.HN.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&&L.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=L.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)?L.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=he(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?L.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=>he(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=>T(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?L.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=he(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 fe(e){return e.toString()}function me(e){return null!=e}r().util.Long!==i.A&&(r().util.Long=i.A,r().configure())},27090:(e,t,n)=>{"use strict";n.d(t,{Lg:()=>c,d0:()=>u});var i=n(21364),o=n(24848),r=n.n(o),a=n(39302);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:f(e.uri)?p(e.uri):new Uint8Array,newRevision:f(e.newRevision)?p(e.newRevision):new Uint8Array,parentRevision:f(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=h(void 0!==e.uri?e.uri:new Uint8Array)),void 0!==e.newRevision&&(t.newRevision=h(void 0!==e.newRevision?e.newRevision:new Uint8Array)),void 0!==e.parentRevision&&(t.parentRevision=h(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:f(e.newRevision)?p(e.newRevision):new Uint8Array,parentRevision:f(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=h(void 0!==e.newRevision?e.newRevision:new Uint8Array)),void 0!==e.parentRevision&&(t.parentRevision=h(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 f(e){return null!=e}r().util.Long!==i.A&&(r().util.Long=i.A,r().configure())},20633:(e,t,n)=>{"use strict";n.d(t,{HN:()=>a,tu:()=>c});var i=n(24848),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}},78424:(e,t,n)=>{"use strict";n.d(t,{M:()=>W});var i,o=n(86070),r=n(73217),a=n(54555),s=n(12783),c=n(45729),l=n(75930),u=n(83547),d=n(69644),p=n(435),h=n(43830),f=n(1256),m=n(94526),_=n(75721),g=n(30171),E=n(69808),v=n(30758),y="PromotionDefaultNative-module_card-container__Y90Vl",b="PromotionDefaultNative-module_layout-container__g9tY4",S="PromotionDefaultNative-module_tertiary-footer-visibility-buttons__XUyBk",T="PromotionDefaultNative-module_title-area__MQiix",A="PromotionDefaultNative-module_body-area__Hsx6u",I="PromotionDefaultNative-module_footer-area__N7OZR",O="PromotionDefaultNative-module_truncated-text__YVan5",C="PromotionDefaultNative-module_truncated-text-single-line__bwBLq",R="PromotionDefaultNative-module_tertiary-footer-icons__aNIyL",N="PromotionDefaultNative-module_dynamic-layout-container__Ka-Eb",P={exports:{}};i=P,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;te.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n{"use strict";n.d(t,{Ay:()=>P});var i=n(30758),o=n(10018),r=n(21953),a=n(6826),s=n(72973),c=n(82775),l=n(80481),u=n(92808),d=n(31323),p=n(53933),h=n(43178),f=n(74743);function m(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 _(e){for(var t=1;t{"use strict";n.d(t,{Id:()=>oe,tZ:()=>E,YJ:()=>ne,O_:()=>r,$X:()=>l,he:()=>c,ff:()=>i});var i={};n.r(i),n.d(i,{G2:()=>N,gn:()=>w,sv:()=>D});var o=n(86857);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}const u=["error","warn","info","debug"];const d="",p=["0","1","2","3","4","5","6","7","8"];let h=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 h({name:t,level:e,timestamp:Date.now(),data:Object.create(null,i),msg:o,args:r})}const[i,...o]=n;return h({name:t,level:e,timestamp:Date.now(),data:Object.create(null),msg:i,args:o})}}(i,e):f,t)),{})}const _=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}(),g=new Map;function E(e){const t=g.get(e);if(t)return t;const n=m(e,_);return g.set(e,n),n}var v=n(87252),y=n.n(v),b=n(24848),S=n.n(b);var T;!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"}(T||(T={}));const A={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:R(e.scope)?String(e.scope):"",name:R(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 I={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&&O.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=O.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:R(e.system)?String(e.system):"",serviceName:R(e.serviceName)?String(e.serviceName):"",staticContext:R(e.staticContext)?O.fromJSON(e.staticContext):void 0,surfaceMetadata:R(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?O.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?O.fromPartial(e.staticContext):void 0,i.surfaceMetadata=void 0!==e.surfaceMetadata&&null!==e.surfaceMetadata?C.fromPartial(e.surfaceMetadata):void 0,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),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:R(e.system)?String(e.system):"",serviceName:R(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:R(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 R(e){return null!=e}var N,P;function L(e){switch(e){case 0:case"BLOCKING":return N.BLOCKING;case 1:case"BACKGROUND_SYNC":return N.BACKGROUND_SYNC;case 2:case"ASYNC":return N.ASYNC;case 3:case"PUSH_INITIATED":return N.PUSH_INITIATED;case 4:case"RECONNECT":return N.RECONNECT;default:return N.UNRECOGNIZED}}function k(e){switch(e){case 0:case"KNOWN_CONTEXT_INVALID":return P.KNOWN_CONTEXT_INVALID;case 1:case"KNOWN_CONTEXT_USER_ID":return P.KNOWN_CONTEXT_USER_ID;case 2:case"KNOWN_CONTEXT_INSTALLATION_ID":return P.KNOWN_CONTEXT_INSTALLATION_ID;case 3:case"KNOWN_CONTEXT_VERSION":return P.KNOWN_CONTEXT_VERSION;default:return P.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"}(N||(N={})),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"}(P||(P={}));const w={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&&I.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=I.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON:e=>({propertySetId:z(e.propertySetId)?String(e.propertySetId):"",fetchType:z(e.fetchType)?H.fromJSON(e.fetchType):void 0,context:z(e.context)?G.fromJSON(e.context):void 0,backendContext:z(e.backendContext)?I.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?I.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?I.fromPartial(e.backendContext):void 0,n}};const D={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:z(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:z(e.configurationAssignmentId)?String(e.configurationAssignmentId):"",fetchTimeMillis:z(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&&A.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=A.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:z(e.propertyId)?A.fromJSON(e.propertyId):void 0,metadata:z(e.metadata)?U.fromJSON(e.metadata):void 0,boolValue:z(e.boolValue)?V.fromJSON(e.boolValue):void 0,intValue:z(e.intValue)?F.fromJSON(e.intValue):void 0,enumValue:z(e.enumValue)?B.fromJSON(e.enumValue):void 0}),toJSON(e){const t={};return void 0!==e.propertyId&&(t.propertyId=e.propertyId?A.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?A.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:z(e.policyId)?Number(e.policyId):0,externalRealm:z(e.externalRealm)?String(e.externalRealm):"",externalRealmId:z(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:!!z(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:z(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:z(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:z(e.type)?L(e.type):0}),toJSON(e){const t={};return void 0!==e.type&&(t.type=function(e){switch(e){case N.BLOCKING:return"BLOCKING";case N.BACKGROUND_SYNC:return"BACKGROUND_SYNC";case N.ASYNC:return"ASYNC";case N.PUSH_INITIATED:return"PUSH_INITIATED";case N.RECONNECT:return"RECONNECT";case N.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)W.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(W.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=>W.fromJSON(e))):[]}),toJSON(e){const t={};return e.context?t.context=e.context.map((e=>e?W.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=>W.fromPartial(e))))||[],n}};const W={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:z(e.knownContext)?k(e.knownContext):void 0,policyInputName:z(e.policyInputName)?String(e.policyInputName):void 0,value:z(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 P.KNOWN_CONTEXT_INVALID:return"KNOWN_CONTEXT_INVALID";case P.KNOWN_CONTEXT_USER_ID:return"KNOWN_CONTEXT_USER_ID";case P.KNOWN_CONTEXT_INSTALLATION_ID:return"KNOWN_CONTEXT_INSTALLATION_ID";case P.KNOWN_CONTEXT_VERSION:return"KNOWN_CONTEXT_VERSION";case P.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 j=(()=>{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 j.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}function z(e){return null!=e}S().util.Long!==y()&&(S().util.Long=y(),S().configure());var K=(()=>{if(void 0!==K)return K;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"})();K.atob;K.btoa;S().util.Long!==y()&&(S().util.Long=y(),S().configure());const J={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let q;const X=new Uint8Array(16);function $(){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 Z=[];for(let e=0;e<256;++e)Z.push((e+256).toString(16).slice(1));function Q(e,t=0){return(Z[e[t+0]]+Z[e[t+1]]+Z[e[t+2]]+Z[e[t+3]]+"-"+Z[e[t+4]]+Z[e[t+5]]+"-"+Z[e[t+6]]+Z[e[t+7]]+"-"+Z[e[t+8]]+Z[e[t+9]]+"-"+Z[e[t+10]]+Z[e[t+11]]+Z[e[t+12]]+Z[e[t+13]]+Z[e[t+14]]+Z[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||$)();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 Q(i)},te=E("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())}}},26238:(e,t,n)=>{"use strict";n.d(t,{N$:()=>i,bs:()=>s,$p:()=>u,gn:()=>c,sv:()=>l,Tw:()=>h});var i,o=n(75323),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.O_)(Object.assign(Object.assign({},t(e)),{username:e.username})):(0,o.O_)(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.ff.G2.BACKGROUND_SYNC};case i.BLOCKING:return{type:o.ff.G2.BLOCKING};case i.DELAYED:return{type:o.ff.G2.ASYNC};default:throw new Error(`Unknown FetchType (${e})`)}}e.toPayload=t,e.encode=function(e){return o.ff.gn.encode(t(e)).finish()}}(c||(c={}));var l,u,d=n(28835);!function(e){e.configurationAssignmentId=(0,d.p1)({name:"#configurationAssignmentId",description:"Unique ID for the specific resolver call this configuration originates from.",default:""}),e.fetchTimeMillis=(0,d.p1)({name:"#fetchTimeMillis",description:"Server reported time when this configuration was fetched.",default:0}),e.groupIds=(0,d.p1)({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.ff.sv.decode(t));const{configuration:n}=o.ff.sv.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.qW)(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.tZ)("core");function h(e){return f(e)}function f(e){return class{constructor(t){this.onDestroyListeners=new Set,this.logger=(0,o.tZ)("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 f(u.apply(t,e))}static withIdentifier(e){return this}static withContext(e){return this}}}},81987:(e,t,n)=>{"use strict";n.d(t,{Gu:()=>c,NC:()=>l});var i=n(30758),o=n(28835);const r=(0,i.createContext)(new o.Vk.Delegate((()=>{throw new Error("Please wrap your component in RemoteConfig Provider")})));var a=n(75323);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.$X)(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)};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.$X)(e))return t.loadingValue;throw e}}},66768:(e,t,n)=>{"use strict";n.d(t,{li:()=>d});var i=n(26238),o=n(28835),r=n(75323),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.p1)({name:"#contextHash",description:"Hash of the context when passing through initial-config-middleware",default:""}),l=(0,r.tZ)("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.O_)(Object.assign(Object.assign({},i.bs.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.sv.configurationAssignmentId);t&&s.set(t,e)}(d),n.req.on("close",(()=>{!function(e){s.delete(e.getValue(i.sv.configurationAssignmentId))}(d)}))),d}))},46227:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});const i=(0,n(75323).tZ)("middleware:version"),o=e=>({version:t})=>n=>(i.debug("Setting version: %s",t),e(Object.assign(Object.assign({},n),{version:t})))},28835:(e,t,n)=>{"use strict";n.d(t,{Vk:()=>y,mA:()=>a,m9:()=>m,BL:()=>g,HW:()=>_,p1:()=>E,qW:()=>f,Ao:()=>h,v6:()=>p});var i=n(75323),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.O_)(a)}}(a||(a={}));var s=n(93212),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 h(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=h(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()}}}(y||(y={}))},57321:(e,t,n)=>{"use strict";n.d(t,{HZ:()=>H,If:()=>N,m4:()=>L,u0:()=>U,pn:()=>B});var i=n(26238),o=n(75323);const r=6e5;let a;var s=n(28835),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.tZ)("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(43433),h=n(21046),f=n(90061);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 _=new WeakMap;const g={debounceTimeout:400,exposeOnGc:!0};function E(e,t){return(...n)=>(t(...n),e(...n))}function v(e,t){let n=(...i)=>(n=e,t(...i),e(...i));return(...e)=>n(...e)}function y(e){return"number"==typeof e}const b=function(e,t=g,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.sv.groupIds)||{}),Array.from(new Set(l))).filter(y);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.Id.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.sv.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=v(l,((e,t)=>{_.set(t,(()=>{c("manual")}))})),o>=0&&o{clearTimeout(e),e=setTimeout((()=>{c("timeout")}),o)})),c=E(c,(()=>{clearTimeout(e)}))}const u=function(){if("function"==typeof FinalizationRegistry)return new FinalizationRegistry((e=>{e()}))}();r&&u&&(n.debug("Adding GC cleanup function"),l=v(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.sv.fetchTimeMillis),a=n.getValue(i.sv.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.bs.extractIdentifiersMap(t)}}(n,e,o,r);return a?t.send((0,h.Y)(s)):t.send((0,f.b)(s))}}),void 0,(0,o.tZ)("middleware:exposure"));var S=n(37167),T=n(16526);var A=n(48431),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())}))};const O=function(){try{return n(78827)}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(!O)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,A.w)(n))};return O.addConsentListener(r,!0),n((()=>{O.removeConsentListener(r)})),t=>I(void 0,void 0,void 0,(function*(){const n=yield e(t),a=i.bs.extractIdentifiersMap(t)["/client/sp-t-cookie"];if(a&&o!==a){o=a;const e=O.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.bs.extractIdentifiersMap(e)};return o?(0,S.P)(r):(0,T.m)(r)})({context:o,reason:r,clientId:t})),e})))),N=e=>t=>{var{transport:n,eventSender:i=P(n)}=t,o=C(t,["transport","eventSender"]);return R(e)(Object.assign({eventSender:i},o))};function P(e){if(!e)throw new Error('Either "transport" or "eventSender" must be provided.');return(0,p.kE)({transport:e})}const L=e=>({clientId:t,properties:n})=>{const r=(0,o.tZ)("middleware:properties");let a;return o=>(null!=a||(a=(e=>s.mA.getPropertySetId({clientId:t},n?n.map(s.Ao):(0,s.v6)(),i.bs.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 w=(0,o.tZ)("middleware:session-config");function D(e){for(var t=1;tt=>{const n=(0,o.tZ)("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.YJ)();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.gn.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.sv.toConfiguration(e)))).catch((e=>{throw F.error("resolve error",e),e}));return(0,o.he)(l,r)},H=(0,i.Tw)(B).addMiddleware(L).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.bs.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.he)(d,l)}))})).addMiddleware((e=>({backgroundFetchInterval:t=36e5})=>{const n=(0,o.tZ)("middleware:background-fetch");if(t{return r=e(o),s=()=>{var r,s;r=()=>{e(Object.assign(Object.assign({},o),{fetchType:i.N$.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(N).addMiddleware(U).addMiddleware((e=>()=>{let t=null,n="";return o=>k(void 0,void 0,void 0,(function*(){const r=i.bs.hash(o);return n===r?(w.debug('Session matching hash: "%s" will be used. %o',r,t),t):(t=yield e(o),w.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)}))))},18762: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.sendMetric=t.reportMetrics=t.createSemanticMetrics=t.asNanoseconds=t.MetricTypes=void 0;const r=o(n(20556)),a=n(78448);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)}))},1662:(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"},14693: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(97044),t),o(n(41203),t),o(n(63450),t);var a=n(18762);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r(a).default}})},97044: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(18762),t),o(n(34653),t),o(n(5395),t),o(n(1451),t);var r=n(89948);Object.defineProperty(t,"Timer",{enumerable:!0,get:function(){return r.Timer}});var a=n(98348);Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return a.Time}})},63450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserMetrics=void 0;const i=n(18762),o=n(98348);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},1451: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(20556));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)}`)}))}}},5395: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(83087),a=n(87783),s=n(70710),c=o(n(20556)),l=n(74987),u=n(1662);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 h=r.createEventSender(Object.assign({transport:s,context:o},n&&{ownerProvider:n})),f=d(s);return new p(h,f,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},78448: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*(){}))}}},34653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98348:(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)},89948:(e,t,n)=>{"use strict";var i=n(68558);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=t.getHighResolutionTime=t.getLowResolutionTime=t.getTime=t.getBrowserTime=t.supportsHighResolutionTime=void 0;const o=n(98348),r=n(18762);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},41203:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUniversalReporter=void 0;const i=n(5395),o=n(97886);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}))}},66465:(e,t,n)=>{"use strict";t.Cd=t.Lj=void 0;var i=n(38589);Object.defineProperty(t,"Lj",{enumerable:!0,get:function(){return i.logPageActionForTestStep}}),Object.defineProperty(t,"Cd",{enumerable:!0,get:function(){return i.setUpSpektrumLogging}})},38589:(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}},78827:(e,t,n)=>{"use strict";function i(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}function o(){window.dataLayer=window.dataLayer||[],window.dataLayer.push(arguments)}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)}n.r(t),n.d(t,{GTM_SHA_HASH:()=>s,OPTIMIZE_SHA_HASH:()=>A,addConsentListener:()=>b,getConsentInfo:()=>T,removeConsentListener:()=>S,track:()=>C});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})}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",h=new Set,f=new Set;function m({timeout:e=5e3,oneTrustDomainScript:t}){return d(this,void 0,void 0,(function*(){let n;return window.OptanonWrapper=_,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 _(){var e,t;window.gtag||(window.gtag=o);const n=T();var r;n&&h.forEach((e=>{try{e(n)}catch(e){}})),null===(e=window.OneTrust)||void 0===e||e.OnConsentChanged(y),(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});v(),i({consentData:o})}}(r)):window.__cmp("getVendorConsents",{},function(e){return function(t){const n=JSON.stringify({id:e,iab:t.metadata,cate:window.OptanonActiveGroups});v(),i({consentData:n})}}(r)))}const g="sp_consent",E=-1e3;function v(){const e=u(window.location.hostname);document.cookie=[`${g}=`,`max-age=${E}`,`domain=${e}`,"path=/"].join("; ")}function y(){const e=T();e&&f.forEach((t=>{try{t(e)}catch(e){}}))}function b(e,t){t&&h.add(e),f.add(e)}function S(e){h.delete(e),f.delete(e)}function T(){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 A="'sha256-KRzjHxCdT8icNaDOqPBdY0AlKiIh5F8r4bnbe1PQwss='";function I({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 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())}))};function C(e){return O(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 O(this,void 0,void 0,(function*(){const u=[];return e&&u.push(I({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))}))}},83356:(e,t,n)=>{"use strict";var i;n.d(t,{L:()=>i}),function(e){e.HTTP_REQUEST_ABORTED="HTTP_REQUEST_ABORTED",e.HTTP_REQUEST_FAILED="HTTP_REQUEST_FAILED",e.HTTP_REQUEST_TIMEOUT="HTTP_REQUEST_TIMEOUT",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={}))},40231:(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={}))},36722:(e,t,n)=>{"use strict";var i;n.d(t,{W:()=>i}),function(e){e[e.CLOSE=4e3]="CLOSE",e[e.TIMEOUT=4001]="TIMEOUT"}(i||(i={}))},4034:(e,t,n)=>{"use strict";var i;n.d(t,{I:()=>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={}))},36051:(e,t,n)=>{"use strict";var i;n.d(t,{O:()=>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={}))},98321:(e,t,n)=>{"use strict";var i;n.d(t,{s:()=>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={}))},44156:(e,t,n)=>{"use strict";var i;n.d(t,{t:()=>i}),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"}(i||(i={}))},74987:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConnectionObserver:()=>h,DEALER_PLUGIN_NAME:()=>O.IL,DealerErrors:()=>O.xJ,DisconnectionReason:()=>r,Method:()=>c.I,PluginEvent:()=>l.O,REQUEST_TRANSFORMER_PLUGIN_NAME:()=>Se,TransportErrors:()=>a.L,TransportEvent:()=>s.J,createAbortControllerLike:()=>T,createAbortSignalWithTimeout:()=>A,createBaseTransport:()=>Ie,createSpotifyComEndpointsProvider:()=>ve,createSpotifyComProviders:()=>be,createSpotifyComTokenProvider:()=>ye,createTransport:()=>Oe,createXResolveProvider:()=>Ee.Q,dealerCreator:()=>O.kJ,requestTransformerCreator:()=>Ae});var i={};n.r(i),n.d(i,{isSupported:()=>M,request:()=>x});var o={};n.r(o),n.d(o,{request:()=>ge});var r,a=n(83356),s=n(40231),c=n(4034),l=n(36051);!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,d,p=n(80521);class h extends p.bk{}class f extends h{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 f(e)}isOnline(){const e=this._navigator;return!e||!("onLine"in e)||e.onLine}}class m 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 _ extends m{constructor(e,t){super("Request aborted by signal.",a.L.HTTP_REQUEST_ABORTED,0,e),this.name="RequestAbortedError",this.reason=t}}class g extends m{constructor(e,t){super("Request aborted by timeout.",a.L.HTTP_REQUEST_TIMEOUT,0,e),this.name="RequestTimeoutError",this.reason=t}}const E="Signal is aborted without reason";function v(e,t){const n=new Error(t);return n.name=e,n}class y extends p.bk{constructor(){super(),this._aborted=!1,this._reason=void 0,this.onabort=null,this.on("abort",(()=>{var e;return null===(e=this.onabort)||void 0===e?void 0:e.call(this)}))}static abort(e){const t=new y;return t._aborted=!0,t._reason=v("AbortError",null!=e?e:E),t}static signalAbort(e,t){"_aborted"in e&&!e._aborted&&(e._aborted=!0,"_reason"in e&&(e._reason=t||v("AbortError",E)),e.emit("abort",null))}static timeout(e){if(!isFinite(e))throw new TypeError('Value of "delay" is not supported.');const t=new y;return setTimeout((()=>{y.signalAbort(t,v("TimeoutError","Signal timed out"))}),e),t}get aborted(){return this._aborted}set aborted(e){}get reason(){return this._reason}addEventListener(e,t){this.addListener(e,t)}removeEventListener(e,t){this.removeListener(e,t)}dispatchEvent(){}}class b{constructor(){this.signal=new y}abort(e){const t=this.signal;y.signalAbort(t,e)}}function S(){return"undefined"!=typeof window&&"function"==typeof window.AbortController}const T=S()?()=>new AbortController:()=>new b,A=("undefined"!=typeof window&&"function"==typeof(null===(u=window.AbortSignal)||void 0===u?void 0:u.any)&&window.AbortSignal.any,"undefined"!=typeof window&&"function"==typeof(null===(d=window.AbortSignal)||void 0===d?void 0:d.timeout)?window.AbortSignal.timeout:y.timeout);function I(e,t){var n;return"TimeoutError"===(null===(n=t.reason)||void 0===n?void 0:n.name)?new g(e,t.reason):new _(e,t.reason)}var O=n(92232),C=n(80117),R=n(86380);const N={POST:!0,PUT:!0,PATCH:!0,DELETE:!0};var P=n(98321);class L{constructor(e){this.get=e.get.bind(e),this.has=e.has.bind(e)}get(e){return null}has(e){return!1}}class k{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 w=C.m.forTag("transport.http.fetch"),D={json:!0,text:!0,arraybuffer:!0,blob:!0};function M(){return"function"==typeof fetch}function x(e){if(!M())return Promise.reject(new TypeError("Fetch is not supported"));const t=e.options.signal;if(null==t?void 0:t.aborted)return Promise.reject(I(e.url,t));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 N&&!0===N[n]&&e.payload?o=e.payload:e.payload&&(i+=`?${e.payload}`),e.options.responseType&&!(e.options.responseType in D))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=(0,R.X)();return fetch(i,r).then((function(t){let n;n=e.options.ignoreResponseBody||t.status===P.s.NO_CONTENT?null:"json"===e.options.responseType?t.json().catch((function(e){return w.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 L(t.headers):null;return Promise.all([t.url,t.status,i,n])})).then((function([t,n,i,o]){const r=(0,R.X)(),s=new k(t,n);return s.body=o,s.headers=i,e.options.timing&&(s.timing={completed:(0,R.r)(a,r)}),s})).catch((function(t){const n=(0,R.X)();if("AbortError"===(null==t?void 0:t.name))throw new _(i);if("TimeoutError"===(null==t?void 0:t.name))throw new g(i);const o=new k(i);return e.options.timing&&(o.timing={completed:(0,R.r)(a,n)}),o})).then((function(t){return e.options.connectionObserver&&(t.offline=!e.options.connectionObserver.isOnline()),t}))}var U=n(83422),V=n(30353);const F=200,B=0,H="linear",G=!0;class W{constructor(e={}){this._curve=e.curve||H,this._baseTime=e.baseTime||F,this._ceiling=e.ceiling||B,this._jitter="jitter"in e?!!e.jitter:G}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 j={backoffInitial:!1,baseTime:200,ceiling:0,curve:"linear",jitter:!0,maxDuration:1/0,maxRetries:1/0,maxTime:1/0,retryPredicate:()=>!0};class Y{constructor(e,t){this._resolver=(0,V.u)(),this._ts=0,this._callCount=0,this._tickInterval=0,this._isRunning=!1,this._isDestroyed=!1;const n=Object.assign(Object.assign({},j),t),{backoffInitial:i,maxDuration:o,maxRetries:r,maxTime:a,retryPredicate:s}=n,c=(0,U.__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 W(c),this._backoffInitial&&(this._maxRetries+=1)}static init(e,t={}){return new Y(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 z,K=n(36722),J=n(44156);class q extends Error{constructor(e,t,n=null){super(t),this.name="TransportError",this.message=t,this.code=e,this.origin=n}}class X{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 ${constructor(e,t){this.url=e,this.method=(null==t?void 0:t.method)||"GET",this.headers=new X(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 $(e,t)}clone(){const e=new $(this.url);return e.method=this.method,e.headers=new X(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"}(z||(z={}));class Z extends p.bk{constructor(e,t){super(),this.EVENT_ACCESS_TOKEN=z.EVENT_ACCESS_TOKEN,this.EVENT_CONNECTION_ID=z.EVENT_CONNECTION_ID,this.EVENT_CONNECTION_OFFLINE=z.EVENT_CONNECTION_OFFLINE,this.EVENT_CONNECTION_ONLINE=z.EVENT_CONNECTION_ONLINE,this.EVENT_ENDPOINTS_RESOLVED=z.EVENT_ENDPOINTS_RESOLVED,this.StatusCode=P.s,this.StatusFamily=J.t,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,z.EVENT_ACCESS_TOKEN),this.proxyEmit(e,s.J.CONNECTION_OFFLINE,z.EVENT_CONNECTION_OFFLINE),this.proxyEmit(e,s.J.CONNECTION_ONLINE,z.EVENT_CONNECTION_ONLINE),this.proxyEmit(e,s.J.ENDPOINTS_RESOLVED,z.EVENT_ENDPOINTS_RESOLVED),this.onAddListener(z.EVENT_CONNECTION_ID,this._onAddConnectionIdListener.bind(this,e.on.bind(e))),this.onRemoveListener(z.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(z.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 Q{constructor(){this._startTime=null,this._endTime=null}static create(){return new Q}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 ee=C.m.forTag("transport.transport"),te=/^(?:https?:\/\/)?@([^\/]+)\//,ne=/^(ws|http)s?:\/\/.*[^\/]$/,ie=/^([a-zA-Z]{3},\ \d{1,2}\ [a-zA-Z]{3}\ (\d{1,2}.){3})/,oe={xhr:!0,fetch:!0},re=1,ae=4;function se(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 ce extends p.bk{constructor(e){if(super(),this._plugins={},this._pluginMediator=new p.bk,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 W({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 oe?e.requestMode:"xhr",this._forcePolyfillTypes=e.forcePolyfillTypes||{},this._disableAutoLogout="disableAutoLogout"in e&&!!e.disableAutoLogout,this._disconnectBeforeUnload=e.disconnectBeforeUnload||!1;const t=e.createConnectionObserver||f.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 ce(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.O.TRANSPORT_CONNECT,this._onAddListener.bind(this,"transport_connect")),this._pluginMediator.onAddListener(l.O.TRANSPORT_AUTHENTICATE,this._onAddListener.bind(this,"transport_authenticate")),this._pluginMediator.onRemoveListener(l.O.TRANSPORT_CONNECT,this._onRemoveListener.bind(this,"transport_connect")),this._pluginMediator.onRemoveListener(l.O.TRANSPORT_AUTHENTICATE,this._onRemoveListener.bind(this,"transport_authenticate")),"fetch"!==this._requestMode||this._Fetch&&this._Fetch.isSupported()||(ee.warn('Default "fetch" request mode unavailable; Fallback to "xhr"'),this._requestMode="xhr");const e=this._pluginMediator;e.addListeners({[l.O.PLUGIN_DISCONNECTED]:this._onPluginDisconnected.bind(this)}),this.proxyEmit(e,l.O.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);try{for(const e of n)e.call(this,t)}finally{this._stateAwareRunners[e]=null}}_connect(){return this._stateMask&re?Promise.resolve(!1):this._connectionObserver.isOnline()?this._performConnect():new Promise(((e,t)=>{ee.info("Waiting to go online before connecting"),this._connectionObserver.once(s.J.CONNECTION_ONLINE,(()=>{this._performConnect().then(e,t)}))}))}_performConnect(){return new Promise((e=>{ee.info("Resolving endpoints"),e(this._endpointsProvider(this.toPublic()))})).catch((e=>{const t=(null==e?void 0:e.code)?e:new q(a.L.TRANSPORT_ENDPOINTS_PROVIDER_ERROR,(null==e?void 0:e.message)||"Endpoints provider error",null!=e?e:null);return ee.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}),ee.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&&(ne.test(i)&&(i+="/"),t[n]=i)}this._endpoints=t,this.emit(s.J.ENDPOINTS_RESOLVED,{endpoints:Object.assign({},t)}),ee.info("Endpoints resolved");const n=[],i=e=>{n.push(e)};return ee.info("Waiting for plugins to connect"),new Promise(((e,o)=>{this._pluginMediator.emitAndWait(l.O.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=>{ee.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 q(a.L.TRANSPORT_TOKEN_PROVIDER_ERROR,(null==e?void 0:e.message)||"Token provider error",e);return this.emit(s.J.TOKEN_PROVIDER_ERROR,{error:t}),ee.error("Token provider error",t),Promise.reject(t)}))}_parseProvidedToken(e){let t,n=3540;if(Array.isArray(e)?(t=e[0],n="string"==typeof e[1]?parseInt(e[1],10):e[1],"number"==typeof n&&isFinite(n)||(n=3540)):t=e,!t)throw this._lastToken=null,this._lastTokenExpiry=0,ee.error("No token was provided"),new q(a.L.TRANSPORT_INVALID_TOKEN,`Token provider returned an invalid token, "${t}"`);if(this._lastToken===t){ee.error("TokenProvider returned same token twice.");const e=new q(a.L.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}),ee.info("Access token set"),t}_authenticateWithToken(e){if(!this._endpoints)return Promise.resolve(!0);const t=[],n=e=>{t.push(e)};return ee.info("Waiting for plugins to authenticate"),new Promise(((i,o)=>{this._pluginMediator.emitAndWait(l.O.TRANSPORT_AUTHENTICATE,{token:e,awaitPromise:n},(()=>{Promise.all(t).then((()=>i(!0)),o)}))}))}_authenticate(e){if(!(this._stateMask&re))return Promise.reject(new q(a.L.TRANSPORT_INVALID_STATE,"Cannot authenticate disconnected transport."));if(this._authenticationPromise)return this._authenticationPromise;const t=Q.create();return t.start(),this._authenticationPromise=Y.init((()=>(ee.info("Authenticating"),this._refreshToken(e).then(this._authenticateWithToken))),{curve:"exponential",maxRetries:2,baseTime:500,retryPredicate:e=>(ee.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}),ee.info("Disconnected")),ee.info("Waiting for plugins to disconnect."),this._pluginMediator.emitSync(l.O.TRANSPORT_DISCONNECT,{supressed:t}),!0}_createReconnector(){let e=!1;return()=>(this._isReconnecting=!0,this.emit(s.J.RECONNECTING,null),ee.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),ee.info("Reconnected"),!0))))}_tryToReconnect(){this._isReconnecting?ee.warn("Reconnection triggered while already reconnecting"):(this._stateMask=0,Y.init(this._createReconnector(),{baseTime:1e3,maxTime:15e3,maxRetries:this._reconnectionRetries,retryPredicate:e=>(ee.warn("Retrying reconnection due to failure",e),!0)}).catch((()=>{this._stateMask=0,this._isReconnecting=!1,this.emit(s.J.DISCONNECTED,{reason:r.RECONNECTION_FAILED}),ee.info("Disconnected: reconnection failed")})))}_sendRequest(e,t={},n={}){const i=t.signal;return(null==i?void 0:i.aborted)?Promise.reject(I(e,i)):this._processRequestArgs(e,t).then((t=>(null==i?void 0:i.aborted)?Promise.reject(I(e,i)):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(I(e,t.signal));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)&&!S()&&("fetch"===t.requestMode?ee.warn("Request with `{requestMode: fetch}` but no native AbortController."):a.requestMode="xhr"),te.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 _)});return Promise.resolve($.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(te,((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(I(n,o.signal));if("GET"!==i&&"POST"!==i)return Promise.reject(new q(a.L.TRANSPORT_UNSUPPORTED_OPTION,`Option 'forget' cannot be used for ${i} request.`));if(!o.autoAuthorized&&o.authorize)return Promise.reject(new q(a.L.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&&S()&&(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&&S()&&(i.signal=o.signal),fetch(n,i).catch((()=>{}))}else this._sendRetriedRequest(e,{}).catch((()=>{}));return Promise.resolve(new k(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(I(e.url,i)):this._setAuthHeader(e,o),a=this._connectionObserver,c=new Y((()=>{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(I(e.url,i));let n;if(this._pluginMediator.emitSync(l.O.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(I(e.url,i));let r=null;if(t.headers&&(r=t.headers.get("Retry-After")),t.status===P.s.UNAUTHORIZED&&!e.options.ignoreUnauthorized)return o=!0,Promise.reject(t);if("function"==typeof(null==n?void 0:n.condition)&&(n.condition(t,J.t)||r)){if(null!==r)if(ie.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(I(e.url,i)):(n.metadata=e.options.metadata,n.retries=n.retries||{count:0},n.retries.count=c.getRetryCount(),this._pluginMediator.emitSync(l.O.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&ae?n():new Promise(((e,t)=>{ee.info("Auth header setting awaiting authentication."),this.once(s.J.AUTHENTICATED,(()=>{ee.info("Auth header set after authentication."),n().then(e,t)}))}))}_handleRetriedRequestError(e){return e instanceof k?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.O.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.O.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===K.W.CLOSE)return ee.info(`Plugin "${e.data.plugin}" explicitly disconnected`),void(this._quickDisconnectCount=0);this._connectionObserver.isOnline()&&(ee.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),ee.info("ConnectionObserver online"),this._connectCalled&&this._tryToReconnect()}_onOffline(){this.emit(s.J.CONNECTION_OFFLINE,null),ee.info("ConnectioObserver offline"),this._performDisconnect()}_onConnected(){return this._stateMask|=re,this.emit(s.J.CONNECTED,null),ee.info("Connected"),Promise.resolve(!0)}_onAuthenticated(e){e.end(),clearTimeout(this._reconnectTimeout),this._authenticationPromise=null,this._stateMask|=ae,this._initTime=Date.now();const t=e.getMetrics();return this.emit(s.J.AUTHENTICATED,{timing:t}),this._stateAwareOperationMetrics.authenticated=t,ee.info("Authenticated"),Promise.resolve(!0)}_onAuthenticationFailed(e,t){t.end();const n=e&&e.error?e.error:e;this._authenticationPromise=null,this._stateMask&=~ae;const i={error:n,timing:t.getMetrics()};return this.emit(s.J.AUTHENTICATION_FAILED,i),this._pluginMediator.emit(l.O.TRANSPORT_AUTHENTICATE_FAILED,i),ee.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&re)}isAuthenticated(){return!!(this._stateMask&ae)}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 Z(this,e)}hasOwnerRef(e){return this._ownerRef===e}appendTokenQuery(e){return this._refreshToken().then((t=>se(e,t)))}appendLastTokenQuery(e){return this._lastToken?se(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.O.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.O.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.O.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.O.PLUGIN_REQUEST,i),!0)}request(e,t){var n;const i={uri:e,options:t,context:{}};this._pluginMediator.emitSync(l.O.TRANSPORT_BEFORE_PROCESS_REQUEST,i);const o=this._sendRequest.bind(this,i.uri,i.options,i.context);if(!this._endpoints&&te.test(i.uri))return ee.info("Request queued until endpoints resolved",i.uri),new Promise(((e,t)=>{this.once(s.J.ENDPOINTS_RESOLVED,(()=>{ee.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)?(ee.info("Request queued until online",i.uri),new Promise(((e,t)=>{this.once(s.J.CONNECTION_ONLINE,(()=>{ee.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 le{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 ue=C.m.forTag("transport.http.xhr"),de=function(){},pe={json:!0,text:!0,document:!0};function he(){this.onabort=de,this.onerror=de,this.onload=de,this.onloadend=de}function fe(e,t,n){var i,o;if(null===(i=e.options.signal)||void 0===i?void 0:i.aborted)return;const r=(0,R.X)(),a=this.status,s=new k(this.responseURL||e.url,a);s.body=null;const c=e.options;if(c.timing&&(s.timing={completed:(0,R.r)(t,r)}),(null===(o=c.connectionObserver)||void 0===o?void 0:o.isOnline)&&(s.offline=!c.connectionObserver.isOnline()),(c.parseResponseHeaders||a>299)&&(s.headers=new le(this.getAllResponseHeaders())),!c.ignoreResponseBody&&a!==P.s.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){ue.warn("Could not parse response as JSON:",e),s.body=null}else"text"!==e&&""!==e||(s.body=this.responseText)}n(s)}function me(e,t,n){4===this.readyState?t(new k(this.responseURL||e,this.status)):n(new m("Request cannot be completed.",a.L.HTTP_REQUEST_FAILED,this.status,e))}function _e(e){const t=e.options.signal;return new Promise(((n,i)=>{if(null==t?void 0:t.aborted)return void i(I(e.url,t));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 N&&!0===N[s]&&c?a=c:c&&(r+=`?${c}`),o.open(s,r,!0),o.onerror=me.bind(o,r,n,i),o.onabort=he,o.onloadend=he,o.onprogress=de;const l=e.options;"include"===l.credentials&&(o.withCredentials=!0);const u=l.responseType;if(u)if(l.forcePolyfill){if(!(u in pe))return void i(new TypeError(`Cannot polyfill responseType "${u}"`))}else{if(!("responseType"in o)&&!(u in pe))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 pe))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(I(r,t))})),o.onload=fe.bind(o,e,(0,R.X)(),n);try{o.send(a)}catch(e){return void i(e)}}))}function ge(e){return _e(e)}var Ee=n(80483);function ve(){return()=>Promise.resolve({webgate:"https://www.spotify.com/api/",webapi:"https://api.spotify.com"})}function ye(){return()=>Promise.resolve("NOT_A_TOKEN")}function be(){return{endpoints:ve(),token:ye()}}const Se="request-transformer";class Te{constructor(e){this.name=Se,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.O.TRANSPORT_BEFORE_PROCESS_REQUEST,this._processRequest)}detach(e,t){t.removeListener(l.O.TRANSPORT_BEFORE_PROCESS_REQUEST,this._processRequest)}}function Ae(e,t){return new Te(t)}function Ie(e){const t=Object.assign({},e);return t.XHR||(t.XHR=o),t.Fetch=i,ce.create(t)}function Oe(e){const t=Ie(e);return t.addPlugin(O.kJ,{WebSocket}),t}},48500:(e,t,n)=>{"use strict";n.d(t,{dW:()=>c});var i=n(80117),o=n(36051);const r=i.m.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,h={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(h),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.O.TRANSPORT_AUTHENTICATE,this._onAuthenticate),t.on(o.O.TRANSPORT_BEFORE_SEND_REQUEST,this._onBeforeSendRequest),this._transport=e}detach(e,t){t.removeListener(o.O.TRANSPORT_AUTHENTICATE,this._onAuthenticate),t.removeListener(o.O.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)}},92232:(e,t,n)=>{"use strict";var i;n.d(t,{IL:()=>m,xJ:()=>i,kJ:()=>g}),function(e){e.DEALER_CONNECTION_ERROR="DEALER_CONNECTION_ERROR",e.DEALER_AUTHENTICATION_FAILED="DEALER_AUTHENTICATION_FAILED",e.DEALER_ERROR="DEALER_ERROR",e.DEALER_DISCONNECTED_BEFORE_EVENTS="DEALER_DISCONNECTED_BEFORE_EVENTS",e.ENDPOINT_NOT_DEFINED="ENDPOINT_NOT_DEFINED",e.INVALID_ENDPOINT="INVALID_ENDPOINT"}(i||(i={}));var o,r=n(36051);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(80521),c=n(30353),l=n(36722),u=n(84686).hp;const d=function(){},p=/hm:\/\/pusher\/(?:[^]+)?\/connections\/([^]+)/,h="undefined"!=typeof window;class f extends s.bk{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._closeBeforeEventsRejector=null,this._WebSocket=e.WebSocket||WebSocket,this._heartbeatTimeout=e.heartbeatTimeout||1e4}static create(e){return new f(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.W.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(h&&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 _{constructor(e){this.name=m,this._dealer=new f(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.O.PLUGIN_CONNECTION_INFO,Object.assign({plugin:this.name},e.data))}_onDealerDisconnected(e){if(!this._mediator)return;const t=e.data;this._mediator.emit(r.O.PLUGIN_DISCONNECTED,{plugin:this.name,code:t.wsCode,reason:t.reason})}_onDealerMessage(e){this._mediator&&this._mediator.emit(r.O.PLUGIN_MESSAGE,Object.assign({plugin:this.name},e.data))}_onDealerRequest(e){this._mediator&&this._mediator.emit(r.O.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.O.PLUGIN_ERROR,{plugin:this.name,error:e.data.error})}attach(e,t){this._mediator=t,t.addListeners({[r.O.TRANSPORT_CONNECT]:this._onTransportConnect,[r.O.TRANSPORT_AUTHENTICATE]:this._onTransportAuthenticate,[r.O.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.O.TRANSPORT_CONNECT]:this._onTransportConnect,[r.O.TRANSPORT_AUTHENTICATE]:this._onTransportAuthenticate,[r.O.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 g(e,t){return new _(t)}},23301:(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)}}},80483:(e,t,n)=>{"use strict";n.d(t,{Q:()=>u});var i=n(83356);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 h=e.body,f={dealer:null!==(a=null===(r=null==h?void 0:h[t])||void 0===r?void 0:r[0])&&void 0!==a?a:s,webgate:null!==(p=null!==(d=null===(u=null==h?void 0:h[n])||void 0===u?void 0:u[0])&&void 0!==d?d:l[n])&&void 0!==p?p:l.spclient,webapi:c};if(!f.dealer||!f.webgate)throw new o(i.L.XRESOLVE_INCOMPLETE_RESPONSE,"X-Resolve responded with incomplete results.",e.status);return f})).then((e=>(e.dealer=`wss://${e.dealer.replace(/:443$/,"")}`,e.webgate=`https://${e.webgate.replace(/:443$/,"")}`,e)))}}},53190:(e,t,n)=>{"use strict";n.d(t,{J:()=>o});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)}}}},31052:(e,t,n)=>{"use strict";n.d(t,{vR:()=>D});var i=n(25848),o=n(6583);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(37204);const h={createGabitoEvent:function(e,t,n){var a,s,h,f;const m=c(e.location.pathNodes),_=c(l(e.parentAbsoluteLocation)),g=u(e.parentAbsoluteLocation),E=d(e.parentAbsoluteLocation);let v={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:E,parent_path_ids:_.element_path_ids,parent_path_names:_.element_path_names,parent_path_pos:_.element_path_pos,parent_path_reasons:_.element_path_reasons,parent_path_uris:_.element_path_uris,parent_specification_versions:g,specification_version:e.specificationVersion,specification_mode:e.specificationMode};if(n.pageInstanceIdProvider&&(v=Object.assign(Object.assign({},v),{page_instance_id:n.pageInstanceIdProvider.getPageInstanceId()||null})),n.playbackIdProvider&&(v=Object.assign(Object.assign({},v),{playback_id:(null===(a=n.playbackIdProvider)||void 0===a?void 0:a.getPlaybackId())||null})),n.playContextUriProvider&&(v=Object.assign(Object.assign({},v),{play_context_uri:(null===(s=n.playContextUriProvider)||void 0===s?void 0:s.getPlayContextUri())||null})),n.pageUriProvider&&(v=Object.assign(Object.assign({},v),{page_uri:(null===(h=n.pageUriProvider)||void 0===h?void 0:h.getPageUri())||null})),t.isAuthenticated())return(0,i.m)(v);const y=Object.assign(Object.assign({},v),{flow_id:(null===(f=n.flowIdProvider)||void 0===f?void 0:f.getFlowId())||null});return(0,o.J)(y)}};var f=n(47233),m=n(26272);const _={createGabitoEvent:function(e,t,n){var i,o,a,s;const h=c(e.location.pathNodes),_=c(l(e.parentAbsoluteLocation)),g=u(e.parentAbsoluteLocation),E=d(e.parentAbsoluteLocation);let v={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:h.element_path_ids,element_path_names:h.element_path_names,element_path_pos:h.element_path_pos,element_path_reasons:h.element_path_reasons,element_path_uris:h.element_path_uris,generator_version:e.generatorVersion,interaction_id:(0,p.v4)(),interaction_type:e.interactionType,parent_modes:E,parent_path_ids:_.element_path_ids,parent_path_names:_.element_path_names,parent_path_pos:_.element_path_pos,parent_path_reasons:_.element_path_reasons,parent_path_uris:_.element_path_uris,parent_specification_versions:g,specification_version:e.specificationVersion,specification_mode:e.specificationMode};if(n.pageInstanceIdProvider&&(v=Object.assign(Object.assign({},v),{page_instance_id:n.pageInstanceIdProvider.getPageInstanceId()||null})),n.playbackIdProvider&&(v=Object.assign(Object.assign({},v),{playback_id:(null===(i=n.playbackIdProvider)||void 0===i?void 0:i.getPlaybackId())||null})),n.playContextUriProvider&&(v=Object.assign(Object.assign({},v),{play_context_uri:(null===(o=n.playContextUriProvider)||void 0===o?void 0:o.getPlayContextUri())||null})),n.pageUriProvider&&(v=Object.assign(Object.assign({},v),{page_uri:(null===(a=n.pageUriProvider)||void 0===a?void 0:a.getPageUri())||null})),t.isAuthenticated())return(0,f.l)(v);const y=Object.assign(Object.assign({},v),{flow_id:(null===(s=n.flowIdProvider)||void 0===s?void 0:s.getFlowId())||null});return(0,m.y)(y)}},g="CURRENT_PAGE_INSTANCE_ID";class E{constructor(e){this.storageManager=e.storageManager}getPageInstanceId(){return this.storageManager.getItem(g)}setPageInstanceId(e){this.storageManager.setItem(g,e)}}var v,y,b=n(17744),S=n(4820),T=n(5800);!function(e){e.NAVIGATION_IDLE="navigation_idle",e.NAVIGATION_STARTED="navigation_started",e.NAVIGATION_COMPLETED="navigation_completed"}(v||(v={})),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"}(y||(y={}));class A{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)}getCurrentPageId(){return this.storageManager.getItem(y.CURRENT_PAGE_ID)}setCurrentPageId(e){this.storageManager.setItem(y.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(y.CURRENT_NAV_ROOT)}setCurrentNavigationalRoot(e){this.storageManager.setItem(y.CURRENT_NAV_ROOT,e)}getNavigationStatus(){return this.storageManager.getItem(y.NAVIGATION_STATUS)}setNavigationStatus(e){this.storageManager.setItem(y.NAVIGATION_STATUS,e)}getPendingNavigationalRoot(){return this.storageManager.getItem(y.PENDING_NAV_ROOT)}setPendingNavigationalRoot(e){this.storageManager.setItem(y.PENDING_NAV_ROOT,e)}getPendingInteractionId(){return this.storageManager.getItem(y.PENDING_INTERACTION_ID)}setPendingInteractionId(e){this.storageManager.setItem(y.PENDING_INTERACTION_ID,e)}getPendingNavigationReason(){return this.storageManager.getItem(y.PENDING_NAV_REASON)}setPendingNavigationReason(e){this.storageManager.setItem(y.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,T.km)(e)){const{interactionId:t}=e;this.setPendingInteractionId(t)}if((0,T.EO)(e)){const{navigationReason:t}=e;this.setPendingNavigationReason(t)}this.setPendingNavigationalRoot(t),this.setNavigationStatus(v.NAVIGATION_STARTED)}completeNavigation(e){var t;const{pageId:n,entityUri:i}=e;if(this.getCurrentEntityUri()!==i&&this.getNavigationStatus()===v.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.I)(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.m)(e);this.eventSender.send(n)}this.setCurrent(n,e,i,this.getPendingNavigationalRoot())}else this.resetNavStartInfo();this.setNavigationStatus(v.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:T.$.CLIENT_LOST_FOCUS};if(this.authenticationProvider.isAuthenticated()){const e=(0,b.I)(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.m)(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:T.$.CLIENT_GAINED_FOCUS};if(this.authenticationProvider.isAuthenticated()){const e=(0,b.I)(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.m)(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 I{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 O{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 R={requiresPersistingState:!1};var N;!function(e){e.IN_MEMORY="in-memory",e.SESSION_STORAGE="session-storage",e.CUSTOM_STORAGE="custom-storage"}(N||(N={}));class P{constructor(e=R){this.storageAdapter=new I,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":v.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 O))}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 I?N.IN_MEMORY:this.storageAdapter instanceof O?N.SESSION_STORAGE:N.CUSTOM_STORAGE}}const L="CURRENT_PAGE_URI";class k{constructor(e){this.storageManager=e.storageManager}getPageUri(){return this.storageManager.getItem(L)}setPageUri(e){this.storageManager.setItem(L,e)}}class w{constructor(e){var t,n;this.eventSender=e.eventSender,this.disableAutoBackgroundMonitoring=null===(t=e.disableAutoBackgroundMonitoring)||void 0===t||t,this.storageManager=new P({storageAdapter:e.storageAdapter,requiresPersistingState:e.requiresPersistingState}),this.authenticationProvider=e.authenticationProvider,this.pageInstanceIdProvider=new E({storageManager:this.storageManager}),this.pageUriProvider=new k({storageManager:this.storageManager}),this.contextualProviders=e.contextualProviders,this.pageViewLogger=new A({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=_.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=h.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 D=function(){let e;return{getUBILogger:function(t){return function(t){return e&&e.unregisterEventListeners(),e=new w(t),e.registerEventListeners(),e}(t)}}}()},5800:(e,t,n)=>{"use strict";var i,o;function r(e){return"interactionId"in e}function a(e){return"navigationReason"in e}n.d(t,{$:()=>i,$h:()=>o,km:()=>r,EO:()=>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.PRERELEASE_AUDIOBOOK="prerelease/audiobook",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.ARTIST_MUSIC_VIDEOS="artist/music-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.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_CHOICESCREEN_UC="checkout/choicescreen-uc",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.CULTURALMOMENTS_STORIES="culturalmoments/stories",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.YOURLIBRARY_FILTERS_SETTINGS="yourlibrary/filters-settings",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.VENUE="venue",e.CONNECT_CONTEXTMENU="connect/contextmenu",e.CONNECT_DEVICEPICKER="connect/devicepicker",e.CONNECT_OUTPUTSWITCHERDEVICEPICKER="connect/outputSwitcherDevicePicker",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.CONTEXTMENU_COURSE="contextmenu/course",e.CONTEXTMENU_ALBUMPRERELEASE="contextmenu/albumprerelease",e.CONTEXTMENU_DJLANGUAGESETTINGS="contextmenu/djlanguagesettings",e.CONTEXTMENU_DJNARRATION="contextmenu/djnarration",e.COURSE="course",e.COURSE_UPSELL="course/upsell",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.UNBOXING_FEATURE_FLOW="unboxing/feature-flow",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_ACCOUNT_TRANSITION_EDUCATION="kid-account-transition/education",e.KID_ACCOUNT_TRANSITION_CONSENT="kid-account-transition/consent",e.KID_ACCOUNT_TRANSITION_LEGAL_CONSENT="kid-account-transition/legal-consent",e.KID_ACCOUNT_TRANSITION_PARENTAL_CONTROL="kid-account-transition/parental-control",e.KID_ACCOUNT_TRANSITION_PIN="kid-account-transition/pin",e.KID_ACCOUNT_TRANSITION_NAME="kid-account-transition/name",e.KID_ACCOUNT_TRANSITION_BIRTHDAY="kid-account-transition/birthday",e.KID_ACCOUNT_TRANSITION_SUBMIT="kid-account-transition/submit",e.KID_PARENTAL_BLOCKING_TRACK="kid-parental-blocking/track",e.KID_PARENTAL_BLOCKING_ARTIST="kid-parental-blocking/artist",e.PARENTALCONTROL="parentalcontrol",e.PARENTAL_CONTROL_LOGIN_OPTIONS="parental-control/login-options",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.LISTENINGSTATS_DETAILS="listeningstats/details",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.HOME_MUSIC="home/music",e.HOME_MUSIC_FOLLOWING="home/music-following",e.HOME_MUSIC_VIDEOS="home/music-videos",e.HOME_PODCASTS="home/podcasts",e.HOME_PODCASTS_FOLLOW="home/podcasts-follow",e.HOME_PODCASTS_VIDEOS="home/podcasts-videos",e.HOME_AUDIOBOOKS="home/audiobooks",e.HOME_WRAPPED="home/wrapped",e.HOME_COURSES="home/courses",e.HOME_UNKNOWN="home/unknown",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_CREATE_EUTERPE_REPORT_A_PROBLEM="playlist/create/euterpe-report-a-problem",e.PLAYLIST_TUNER="playlist/tuner",e.PLAYLIST_TUNER_EDIT_MENU="playlist/tuner/edit-menu",e.PLAYLIST_TUNER_ONBOARDING="playlist/tuner/onboarding",e.PLAYLIST_TUNER_ONBOARDING_SELECT_PLAYLIST="playlist/tuner/onboarding/select-playlist",e.LIST_CREATIONMENU="list/creationmenu",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_CONSIDERATION="premium-consideration",e.PLAN_DETAILS="plan-details",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_MEMBER_DETAILS="premium-account-management/member-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_MUSIC="search/music",e.SEARCH_GENRES="search/genres",e.SEARCH_PLAYLISTS="search/playlists",e.SEARCH_PODCASTS_AND_EPISODES="search/podcasts_and_episodes",e.SEARCH_PODCASTS_AND_EPISODES_VIDEOS="search/podcasts_and_episodes/videos",e.SEARCH_PODCASTS_AND_EPISODES_UPLOAD_DATE="search/podcasts_and_episodes/upload_date",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_SEARCH="settings/search",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_NOTIFICATIONS_IMPORTANT_PUBLIC_NOTICE="settings/notifications/important-public-notice",e.SETTINGS_PLAYBACK="settings/playback",e.SETTINGS_MEDIA_QUALITY="settings/media-quality",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.SETTINGS_CAR="settings/car",e.SETTINGS_EMPLOYEE_TOOLS="settings/employee-tools",e.SETTINGS_INTEGRATIONS="settings/integrations",e.SETTINGS_CONTENT_PERSONALIZATION="settings/content-personalization",e.SETTINGS_CONNECTIVITY="settings/connectivity",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.YOU="you",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.SOCIAL_LISTENING_MARACASDIALOG="social-listening/maracasdialog",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.UBI_DEBUG_MONITOR_JOURNEY="ubi/debug-monitor/journey",e.UBI_DEBUG_MONITOR_RECENTEVENTSLIST="ubi/debug-monitor/recenteventslist",e.UBI_DEBUG_MONITOR_RAWDATA="ubi/debug-monitor/rawdata",e.UBI_DEBUG_MONITOR_EVENTGROUPDETAILS="ubi/debug-monitor/eventgroupdetails",e.UBI_DEBUG_MONITOR_EVENTDETAILS="ubi/debug-monitor/eventdetails",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.MESSAGE_STORE="message-store",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.VOTING_ROOT="voting/root",e.VOTING_CONFIRMATION="voting/confirmation",e.VOTING_SHARE="voting/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_EVENTS="mrkt/artist/events",e.MRKT_ARTIST_NOTIFICATIONS="mrkt/artist/notifications",e.MRKT_ARTIST_EVENTS_NO_ARTIST_REDIRECT="mrkt/artist/events/no-artist-redirect",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_RELEASE_ENGAGEMENT_NO_ARTIST_REDIRECT="mrkt/artist/audience/release-engagement/no-artist-redirect",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_MUSIC_PLAYLISTS="mrkt/artist/music/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_MUSIC_SONGS="mrkt/artist/music/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_CAMPAIGNS_MARQUEE_AND_SHOWCASE="mrkt/artist/campaigns/marquee-and-showcase",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_RELEASE="mrkt/artist/campaigns/marquee-and-showcase/release",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_TEAM="mrkt/artist/campaigns/marquee-and-showcase/team",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_COUNTRY="mrkt/artist/campaigns/marquee-and-showcase/country",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_SETUP="mrkt/artist/campaigns/marquee-and-showcase/setup",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_CUSTOMIZE="mrkt/artist/campaigns/marquee-and-showcase/customize",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_BILLING="mrkt/artist/campaigns/marquee-and-showcase/billing",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_REVIEW="mrkt/artist/campaigns/marquee-and-showcase/review",e.MRKT_ARTIST_CAMPAIGNS_MARQUEE_AND_SHOWCASE_SUCCESS="mrkt/artist/campaigns/marquee-and-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_SELECT_RELEASE="mrkt/expression-video/select-release",e.MRKT_EXPRESSION_VIDEO_SELECT_TRACK="mrkt/expression-video/select-track",e.MRKT_EXPRESSION_VIDEO_TYPE="mrkt/expression-video/type",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_MUSIC_RELEASES="mrkt/artist/music/releases",e.MRKT_ARTIST_RELEASE_STATS="mrkt/artist/release/stats",e.MRKT_ARTIST_MUSIC_UPCOMING="mrkt/artist/music/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_SONGWRITING="mrkt/frontdoor/songwriting",e.MRKT_FRONTDOOR_SHOWCASE="mrkt/frontdoor/showcase",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_CANVAS="mrkt/frontdoor/canvas",e.MRKT_FRONTDOOR_MERCH_LIVE_AND_MORE="mrkt/frontdoor/merch-live-and-more",e.MRKT_FRONTDOOR_VIDEO_AND_VISUALS="mrkt/frontdoor/video-and-visuals",e.MRKT_FRONTDOOR_LIVE_EVENTS="mrkt/frontdoor/live-events",e.MRKT_FRONTDOOR_CLIPS="mrkt/frontdoor/clips",e.MRKT_FRONTDOOR_ARTIFICIAL_STREAMING="mrkt/frontdoor/artificial-streaming",e.MRKT_FRONTDOOR_NEW_RELEASES="mrkt/frontdoor/new-releases",e.MRKT_FRONTDOOR_COUNTDOWN_PAGES="mrkt/frontdoor/countdown-pages",e.MRKT_FRONTDOOR_UNKNOWN="mrkt/frontdoor/unknown",e.S4P_AUTHENTICATION_SELECTION="s4p/authentication/selection",e.S4P_AUTHENTICATION_ABOUT_SPOTITY_ACCOUNTS="s4p/authentication/about-spotity-accounts",e.S4P_AUTHENTICATION_ACCOUNT_INFORMATION="s4p/authentication/account-information",e.S4P_CLAIM_PODCAST_WEB_MIGRATION_REQUIRED="s4p/claim-podcast/web-migration-required",e.S4P_CLAIM_PODCAST_ADD_EXISTING_PODCAST="s4p/claim-podcast/add-existing-podcast",e.S4P_CLAIM_PODCAST_PODCAST_SEARCH_RESULTS="s4p/claim-podcast/podcast-search-results",e.S4P_CLAIM_PODCAST_PODCAST_VERIFICATION="s4p/claim-podcast/podcast-verification",e.S4P_CLAIM_PODCAST_PODCAST_VERIFICATION_COMPLETE="s4p/claim-podcast/podcast-verification-complete",e.S4P_CLAIM_PODCAST_PAYOUTS_CONFIRMATION="s4p/claim-podcast/payouts-confirmation",e.S4P_EMAIL_VERIFICATION="s4p/email-verification",e.S4P_HOME="s4p/home",e.S4P_WEB_VIEW_HOW_TO_GROW_AN_AUDIENCE="s4p/web-view/how-to-grow-an-audience",e.S4P_WEB_VIEW_HOW_TO_GET_DISCOVERED_ON_SPOTIFY="s4p/web-view/how-to-get-discovered-on-spotify",e.S4P_WEB_VIEW_HOW_TO_INSERT_AD_BREAKS="s4p/web-view/how-to-insert-ad-breaks",e.S4P_WEB_VIEW_SUBSCRIPTION_ANALYTICS="s4p/web-view/subscription-analytics",e.S4P_PODCAST_EPISODE="s4p/podcast/episode",e.S4P_PODCAST_EPISODE_RICH_TEXT_EDITOR="s4p/podcast/episode/rich-text-editor",e.S4P_PODCAST_EPISODE_ADDITIONAL_DETAILS="s4p/podcast/episode/additional-details",e.S4P_PODCAST_EPISODE_PREVIEW_PLAYER="s4p/podcast/episode/preview-player",e.S4P_PODCAST="s4p/podcast",e.S4P_PODCAST_EPISODE_OPTIONS="s4p/podcast/episode/options",e.S4P_PODCAST_EPISODE_MONETIZE="s4p/podcast/episode/monetize",e.S4P_ANALYTICS="s4p/analytics",e.S4P_ANALYTICS_IMPRESSIONS="s4p/analytics/impressions",e.S4P_ANALYTICS_GEO_LOCATION="s4p/analytics/geo-location",e.S4P_ANALYTICS_MILESTONE="s4p/analytics/milestone",e.S4P_ANALYTICS_MILESTONE_PLAYS="s4p/analytics/milestone/plays",e.S4P_ANALYTICS_NOTIFICATION_CHARTS="s4p/analytics/notification/charts",e.S4P_SHOW_SWITCHER="s4p/show-switcher",e.S4P_SHOWS_ALL="s4p/shows/all",e.S4P_SHOWS_VIEW_IN_BROWSER="s4p/shows/view-in-browser",e.S4P_INCOMPLETE_HOSTING_SWITCH="s4p/incomplete-hosting-switch",e.S4P_SUBMITTED_SHOW="s4p/submitted-show",e.S4P_SETTINGS="s4p/settings",e.S4P_SETTINGS_PERSONAL_INFO="s4p/settings/personal-info",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_SETUP_SHOW_PLATFORM_SELECTION="s4p/setup-show/platform-selection",e.S4P_SETUP_SHOW_CLAIM_BLOCKING="s4p/setup-show/claim-blocking",e.S4P_TERMS_OF_SERVICE="s4p/terms-of-service",e.S4P_ONBOARDING_LANDING="s4p/onboarding/landing",e.S4P_ONBOARDING_PUSH_NOTIFICATIONS="s4p/onboarding/push-notifications",e.S4P_ONBOARDING_HOSTING="s4p/onboarding/hosting",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_BLOCKED_WORDS="s4p/blocked-words",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.S4P_COMMENTS_DETAIL="s4p/comments-detail",e.S4P_MONETIZE="s4p/monetize",e.S4P_AUDIENCE="s4p/audience",e.S4P_CATALOG="s4p/catalog",e.S4P_POLL_DETAIL="s4p/poll-detail",e.S4P_COMMON_WEBVIEW="s4p/common-webview",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_INTRO="puffin/intro",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.MANAGE_ACCEPT_INVITE="manage/accept-invite",e.MANAGE_ACCEPT_INVITE_WELCOME_PAGE="manage/accept-invite/welcome-page",e.MANAGE_TEAM_MEMBERS_PAGE="manage/team-members-page",e.MANAGE_TEAM_MEMBER_DETAILS_PAGE="manage/team-member-details-page",e.MANAGE_INVITES_PAGE="manage/invites-page",e.MANAGE_CREATE_INVITE_PAGE="manage/create-invite-page",e.MANAGE_ACTIVITY_FEED="manage/activity-feed",e.MANAGE_ORG_UNITS="manage/org-units",e.READALONG="readalong",e.READALONG_FULLSCREEN="readalong/fullscreen",e.READALONG_SHARE="readalong/share",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_COLD_START_CAMPAIGN_RESERVED_BOOKING="adstudio/cold-start/campaign/reserved-booking",e.ADSTUDIO_COLD_START_AD_SET_RESERVED_BOOKING="adstudio/cold-start/ad-set/reserved-booking",e.ADSTUDIO_COLD_START_AD_RESERVED_BOOKING="adstudio/cold-start/ad/reserved-booking",e.ADSTUDIO_COLD_START_REVIEW_AND_SUBMIT_RESERVED_BOOKING="adstudio/cold-start/review-and-submit/reserved-booking",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_EDIT_CAMPAIGN_RESERVED_BOOKING="adstudio/edit/campaign/reserved-booking",e.ADSTUDIO_EDIT_AD_SET_RESERVED_BOOKING="adstudio/edit/ad-set/reserved-booking",e.ADSTUDIO_APPROVE_CAMPAIGN_RESERVED_BOOKING="adstudio/approve/campaign/reserved-booking",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.ADSTUDIO_BUSINESS_PEOPLE="adstudio/business/people",e.ADSTUDIO_BUSINESS_DETAILS="adstudio/business/details",e.ADSTUDIO_BUSINESS_AD_ACCOUNTS="adstudio/business/ad-accounts",e.ADSTUDIO_BUSINESS_AD_ACCOUNTS_DETAILS="adstudio/business/ad-accounts/details",e.ADSTUDIO_BUSINESS_SIGNUP="adstudio/business/signup",e.ADSTUDIO_COLD_START_AD_QUICK_AUDIO="adstudio/cold-start/ad-quick-audio",e.ADSTUDIO_COLD_START_AD_QUICK_AI_AUDIO="adstudio/cold-start/ad-quick-ai-audio",e.ADSTUDIO_COLD_START_AD_FULL_SERVICE_AUDIO="adstudio/cold-start/ad-full-service-audio",e.ADSTUDIO_ADD_TO_EXISTING_AD_SET_AD_QUICK_AUDIO="adstudio/add-to-existing-ad-set/ad-quick-audio",e.ADSTUDIO_ADD_TO_EXISTING_AD_SET_AD_QUICK_AI_AUDIO="adstudio/add-to-existing-ad-set/ad-quick-ai-audio",e.ADSTUDIO_ADD_TO_EXISTING_AD_SET_AD_FULL_SERVICE_AUDIO="adstudio/add-to-existing-ad-set/ad-full-service-audio",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_AD_QUICK_AUDIO="adstudio/duplicate-ad-set-only/ad-quick-audio",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_AD_QUICK_AI_AUDIO="adstudio/duplicate-ad-set-only/ad-quick-ai-audio",e.ADSTUDIO_DUPLICATE_AD_SET_ONLY_AD_FULL_SERVICE_AUDIO="adstudio/duplicate-ad-set-only/ad-full-service-audio",e.ADSTUDIO_REPORT="adstudio/report",e.ADSTUDIO_REPORT_CREATE="adstudio/report/create",e.ADSTUDIO_SIGN_UP="adstudio/sign-up",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",e.SMARTSHUFFLE_NPVRECOMMENDATIONS_FULLSCREEN="smartshuffle/npvrecommendations/fullscreen",e.SPOTS="spots"}(o||(o={}))},61544:(e,t,n)=>{"use strict";n.d(t,{NQ:()=>i,Q0:()=>h,bX:()=>f,ZA:()=>_,IT:()=>m,Uu:()=>v,g1:()=>y,fH:()=>g,B4:()=>b,iM:()=>S,TR:()=>T,XI:()=>ce,d7:()=>le,cE:()=>se,Y8:()=>ae,CC:()=>A,AI:()=>me,_T:()=>_e,Th:()=>ge,ec:()=>Ee,bp:()=>ve,KB:()=>be,eW:()=>Se,Z0:()=>ye,ly:()=>Te,gH:()=>Ae,fp:()=>Ie,p3:()=>Oe,Pk:()=>Ce,tb:()=>Pe,iw:()=>Re,nu:()=>Ne,AP:()=>Le,Cf:()=>ke,B2:()=>re,WB:()=>we,cr:()=>De,t9:()=>Me,U_:()=>xe,dx:()=>C,DY:()=>R,o_:()=>fe,cA:()=>he,Ps:()=>N,js:()=>P,Qj:()=>L,K7:()=>E,Ru:()=>k,Mc:()=>w,MZ:()=>D,Ft:()=>M,tR:()=>U,du:()=>V});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",COMMENT:"comment",CONCEPT:"concept",CONCERT:"concert",CONTEXT_GROUP:"context-group",CULTURAL_MOMENT:"cultural-moment",DAILY_MIX:"dailymix",EMPTY:"empty",EPISODE:"episode",FACEBOOK:"facebook",FESTIVAL:"festival",FOLDER:"folder",FOLLOWERS:"followers",FOLLOWING:"following",IMAGE:"image",INBOX:"inbox",INTERRUPTION:"interruption",LIBRARY:"library",LIVE:"live",ROOM:"room",EXPRESSION:"expression",JAM:"jam",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",PROMOTER:"promoter",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",TOUR:"tour",TRACK:"track",TRACKSET:"trackset",USER_TOPLIST:"user-toplist",USER_TOP_TRACKS:"user-top-tracks",UNKNOWN:"unknown",VENUE:"venue",VIDEO:"video",MEDIA:"media",QUESTION:"question",POLL:"poll",RESPONSE:"response",COURSE:"course",LESSON:"lesson",CANVAS:"canvas"};var o,r=n(83422);!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"};function h(e,t){return pe(i.ALBUM,{id:e,disc:t,hasBase62Id:!0})}function f(e,t){return pe(i.APPLICATION,{id:e,args:Array.isArray(t)?t:[]})}function m(e){return pe(i.ARTIST,{id:e,hasBase62Id:!0})}function _(e){return pe(i.ARTIST_CONCERTS,{id:e,hasBase62Id:!0})}function g(e,t){return pe(i.COLLECTION,{username:e,category:t})}function E(){return pe(i.QUEUE,{})}function v(e,t){return pe(i.COLLECTION_ALBUM,{id:t,username:e,hasBase62Id:!0})}function y(e,t){return pe(i.COLLECTION_ARTIST,{id:t,username:e,hasBase62Id:!0})}function b(e){return pe(i.CONCERT,{id:e,hasBase62Id:!0})}function S(e,t,n){return pe(i.EPISODE,{id:e,context:t?he(t):null,play:n,hasBase62Id:!0})}function T(e,t){return pe(i.FOLDER,{id:t,username:e,hasBase62Id:!0})}function A(e){return pe(i.IMAGE,{id:e})}function I(e,t,n){return pe(i.JAM,{id:e,contextType:t,hasBase62Id:Boolean(e),play:Boolean(n)})}function O(e,t,n,o){return pe(i.LOCAL_TRACK,{artist:e,album:t,track:n,duration:o})}function C(e,t){return pe(i.LOCAL_ALBUM,{artist:e,album:t})}function R(e){return pe(i.LOCAL_ARTIST,{artist:e})}function N(e){return pe(i.PLAYLIST_V2,{id:e,hasBase62Id:!0})}function P(e){return pe(i.PRERELEASE,{id:e,hasBase62Id:!0})}function L(e,t){return pe(i.PROFILE,{username:e,args:null!=t?t:[]})}function k(e){return pe(i.SEARCH,{query:e})}function w(e){return pe(i.SHOW,{id:e,hasBase62Id:!0})}function D(e){return pe(i.SOCIAL_SESSION,{id:e,hasBase62Id:!0})}function M(e){return pe(i.STATION,{args:null!=e?e:[]})}function x(e,t,n){return pe(i.TOPLIST,{toplist:e,country:t,global:Boolean(n)})}function U(e,t,n,o){return pe(i.TRACK,{id:e,anchor:t,context:n?he(n):null,play:o,hasBase62Id:!0})}function V(e,t){return pe(i.USER_TOPLIST,{username:e,toplist:t})}function F(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 B(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 W=/^intl-[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$/;const j=()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]},[Y,z]=j();Y(i.PLAYLIST,((e,t,{username:n})=>function(e,t){return pe(i.PLAYLIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getBase62IdComponent()))),Y(i.FOLDER,((e,t,{username:n})=>T(n,e.getIdComponent()))),Y(i.COLLECTION_TRACK_LIST,((e,t,{username:n})=>function(e,t){return pe(i.COLLECTION_TRACK_LIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),Y(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 pe(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)})),Y(i.STARRED,((e,t,{username:n})=>function(e){return pe(i.STARRED,{username:e})}(n))),Y(i.FOLLOWERS,((e,t,{username:n})=>function(e){return pe(i.FOLLOWERS,{username:e})}(n))),Y(i.FOLLOWING,((e,t,{username:n})=>function(e){return pe(i.FOLLOWING,{username:e})}(n))),Y(p.TOP,((e,t,{username:n})=>V(n,e.getNextRequiredComponent()))),Y(i.INBOX,((e,t,{username:n})=>function(e){return pe(i.INBOX,{username:e})}(n))),Y(i.ROOTLIST,((e,t,{username:n})=>function(e){return pe(i.ROOTLIST,{username:e})}(n))),Y(i.PUBLISHED_ROOTLIST,((e,t,{username:n})=>function(e){return pe(i.PUBLISHED_ROOTLIST,{username:e})}(n))),Y(i.TOPLIST,((e,t,{username:n})=>function(e){return pe(i.USER_TOP_TRACKS,{username:e})}(n))),Y(i.LIBRARY,((e,t,{username:n})=>function(e,t){return pe(i.LIBRARY,{username:e,category:t})}(n,e.getNextComponent())));const[K,J]=j();function q(e){let t,n,i,r,p=e;const[h,f]=p.split("?");if(h&&f){p=h;const[e,t]=f.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 X(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=J[u];if(!d){const e=function(e){return W.test(e)}(u);e&&(u=c(),d=J[u])}if(d)return d(l,t,{});if(r)return J[i.UNKNOWN](l,t,{});throw new TypeError("Invalid or unknown Spotify URI!")}K(i.ALBUM,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return h(t,n?parseInt(n,10):void 0)})),K(p.APP,((e,t)=>{const n=e.getNextRequiredComponent();if(F(H(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(),pe(i.AD,{id:t});var t})),K(i.ARTIST,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return n===p.TOP?function(e,t){return pe(i.ARTIST_TOPLIST,{id:e,toplist:t,hasBase62Id:!0})}(t,e.getNextRequiredComponent()):n===p.CONCERTS?_(t):m(t)})),K(i.AUDIO_FILE,(e=>{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),pe(i.AUDIO_FILE,{id:n,extension:t});var t,n})),K(i.DAILY_MIX,(e=>{return t=e.getIdComponent(),pe(i.DAILY_MIX,{id:t,hasBase62Id:!0});var t})),K(i.TEMP_PLAYLIST,(e=>{return t=e.getNextRequiredComponent(),n=e.getRemainingString(),pe(i.TEMP_PLAYLIST,{origin:t,data:n});var t,n})),K(i.PLAYLIST,(e=>N(e.getBase62IdComponent()))),K(i.SEARCH,((e,t)=>k(H(e.getRemainingString(),t)))),K(i.TRACK,(e=>{const t=e.getQueryParams();return U(e.getBase62IdComponent(),e.getNextComponent(),null==t?void 0:t.context,null==t?void 0:t.play)})),K(i.TRACKSET,(e=>{var t;const n=H(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=H(o).split(",");for(let e=0,t=o.length;e{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),pe(i.CONTEXT_GROUP,{origin:t,name:n,hasBase62Id:!0});var t,n})),K(p.TOP,(e=>{const t=e.getNextRequiredComponent();return e.getNextComponent()===p.GLOBAL?x(t,void 0,!0):x(t,e.getNextComponent(),!1)})),K(i.LOCAL_TRACK,((e,t)=>{const n=H(e.getNextComponent(),t),i=e.getNextComponent(),o=H(i,t),r=e.getNextComponent(),a=H(r,t),s=e.getNextComponent(),c=s?parseInt(s,10):void 0;return void 0!==r?O(n,o,a,c):void 0!==i?C(n,o):R(n)})),K(i.IMAGE,(e=>A(e.getHexIdComponent(40)))),K(i.MOSAIC,(e=>{return t=e.getRemainingComponents(),pe(i.MOSAIC,{ids:t});var t})),K(i.RADIO,(e=>{return t=e.getRemainingString(),pe(i.RADIO,{args:null!=t?t:""});var t})),K(i.SPECIAL,((e,t)=>{const n=e.getRemainingComponents();for(let e=0,i=n.length;eM(e.getRemainingComponents()))),K(i.EPISODE,(e=>{const t=e.getQueryParams();return S(e.getBase62IdComponent(),null==t?void 0:t.context,null==t?void 0:t.play)})),K(i.SHOW,(e=>w(e.getBase62IdComponent()))),K(i.LIVE,(e=>{return t=e.getIdComponent(),pe(i.LIVE,{id:t,hasBase62Id:!0});var t})),K(i.ROOM,(e=>{return t=e.getIdComponent(),pe(i.ROOM,{id:t,hasBase62Id:!0});var t})),K(i.EXPRESSION,(e=>{return t=e.getIdComponent(),pe(i.EXPRESSION,{id:t,hasBase62Id:!0});var t})),K(i.CONCEPT,(e=>{return t=e.getIdComponent(),pe(i.CONCEPT,{id:t,hasBase62Id:!0});var t})),K(i.CONCERT,(e=>b(e.getIdComponent()))),K(i.MERCH,(e=>{return t=e.getIdComponent(),pe(i.MERCH,{id:t,hasBase62Id:!0});var t})),K(i.MERCHHUB,(()=>pe(i.MERCHHUB,{}))),K(i.PRERELEASE,(e=>P(e.getIdComponent()))),K(i.SOCIAL_SESSION,(e=>D(e.getNextRequiredComponent()))),K(i.JAM,(e=>{const[t,n,o,r]=e.getAllComponents();return n===i.ALBUM||n===i.ARTIST||n===i.PLAYLIST?I(o,n,!!r):I("")})),K(i.INTERRUPTION,(e=>{return t=e.getNextRequiredComponent(),pe(i.INTERRUPTION,{id:t});var t})),K(i.COLLECTION,(e=>g(void 0,e.getNextComponent()))),K(i.GENRE,(e=>{return t=e.getNextRequiredComponent(),pe(i.GENRE,{genre:t});var t})),K(i.QUEUE,(()=>E())),K(p.USER,((e,t)=>{const n=H(e.getNextRequiredComponent(),t),o=e.getNextComponent();if(n===i.FACEBOOK&&o)return r=o,pe(i.FACEBOOK,{uid:r});if(o&&z[o]){const i=z[o];if(!i)throw new TypeError("Invalid Spotify URI!");return i(e,t,{username:n})}var r;const a=e.getRemainingComponents();return L(n,o?[o].concat(a):void 0)})),K(i.UNKNOWN,(e=>function(e){return pe(i.UNKNOWN,{args:null!=e?e:[]})}(e.getAllComponents()))),K(i.MEDIA,(e=>{return t=e.getIdComponent(),pe(i.MEDIA,{id:t,hasBase62Id:!0});var t})),K(i.POLL,(e=>{return t=e.getIdComponent(),pe(i.POLL,{id:t,hasBase62Id:!0});var t})),K(i.QUESTION,(e=>{return t=e.getIdComponent(),pe(i.QUESTION,{id:t,hasBase62Id:!0});var t})),K(i.RESPONSE,(e=>{return t=e.getIdComponent(),pe(i.RESPONSE,{id:t,hasBase62Id:!0});var t})),K(i.CULTURAL_MOMENT,(e=>{if(e.getNextComponent()!==p.HUB)throw new TypeError("Invalid or unknown Spotify URI!");return t=e.getIdComponent(),pe(i.CULTURAL_MOMENT,{id:t});var t})),K(i.FESTIVAL,(e=>{return t=e.getIdComponent(),pe(i.FESTIVAL,{id:t,hasBase62Id:!0});var t})),K(i.TOUR,(e=>{return t=e.getIdComponent(),pe(i.TOUR,{id:t,hasBase62Id:!0});var t})),K(i.VENUE,(e=>{return t=e.getIdComponent(),pe(i.VENUE,{id:t,hasBase62Id:!0});var t})),K(i.VIDEO,(e=>{return t=e.getIdComponent(),pe(i.VIDEO,{id:t,hasBase62Id:!0});var t})),K(i.CANVAS,(e=>{return t=e.getIdComponent(),pe(i.CANVAS,{id:t,hasBase62Id:!0});var t})),K(i.COURSE,(e=>{return t=e.getIdComponent(),pe(i.COURSE,{id:t,hasBase62Id:!0});var t})),K(i.LESSON,(e=>{return t=e.getIdComponent(),pe(i.LESSON,{id:t,hasBase62Id:!0});var t})),K(i.PROMOTER,(e=>{return t=e.getIdComponent(),pe(i.PROMOTER,{id:t,hasBase62Id:!0});var t})),K(i.COMMENT,(e=>{return t=e.getIdComponent(),pe(i.COMMENT,{id:t,hasBase62Id:!0});var t}));const[$,Z]=(()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]})();function Q(e,t){const n=Z[e.type];if(!n)throw new TypeError("Invalid Spotify URI!");return n(e,t)}$(i.ALBUM,(e=>{const t=[i.ALBUM,e.id];return e.disc&&t.push(e.disc),t})),$(i.AD,(e=>[i.AD,e.id])),$(i.ARTIST,(e=>[i.ARTIST,e.id])),$(i.QUEUE,(()=>[i.QUEUE])),$(i.GENRE,(e=>[i.GENRE,e.genre])),$(i.ARTIST_TOPLIST,(e=>[i.ARTIST,e.id,p.TOP,e.toplist])),$(i.ARTIST_CONCERTS,(e=>[i.ARTIST,e.id,p.CONCERTS])),$(i.DAILY_MIX,(e=>[i.DAILY_MIX,e.id])),$(i.SEARCH,((e,t)=>[i.SEARCH,F(e.query,t)])),$(i.TRACK,(e=>{let t=e.id;return(e.context||e.play)&&(t+=G({context:e.context,play:e.play})),e.anchor&&(t+=`#${e.anchor}`),[i.TRACK,t]})),$(i.TRACKSET,(e=>{let t=[];if(e.tracks)for(let n=0,i=e.tracks.length;n[p.USER,i.FACEBOOK,e.uid])),$(i.AUDIO_FILE,(e=>[i.AUDIO_FILE,e.extension,e.id])),$(i.FOLDER,((e,t)=>[p.USER,F(e.username,t),i.FOLDER,e.id])),$(i.FOLLOWERS,((e,t)=>[p.USER,F(e.username,t),i.FOLLOWERS])),$(i.FOLLOWING,((e,t)=>[p.USER,F(e.username,t),i.FOLLOWING])),$(i.PLAYLIST,((e,t)=>[p.USER,F(e.username,t),i.PLAYLIST,e.id])),$(i.PLAYLIST_V2,(e=>[i.PLAYLIST,e.id])),$(i.STARRED,((e,t)=>[p.USER,F(e.username,t),i.STARRED])),$(i.TEMP_PLAYLIST,(e=>[i.TEMP_PLAYLIST,e.origin,e.data])),$(i.CONTEXT_GROUP,(e=>[i.CONTEXT_GROUP,e.origin,e.name])),$(i.USER_TOPLIST,((e,t)=>[p.USER,F(e.username,t),p.TOP,e.toplist])),$(i.USER_TOP_TRACKS,((e,t)=>[p.USER,F(e.username,t),i.TOPLIST])),$(i.TOPLIST,(e=>[p.TOP,e.toplist].concat(e.global||!e.country?[p.GLOBAL]:["country",e.country]))),$(i.INBOX,((e,t)=>[p.USER,F(e.username,t),i.INBOX])),$(i.ROOTLIST,((e,t)=>[p.USER,F(e.username,t),i.ROOTLIST])),$(i.PUBLISHED_ROOTLIST,((e,t)=>[p.USER,F(e.username,t),i.PUBLISHED_ROOTLIST])),$(i.COLLECTION_TRACK_LIST,((e,t)=>[p.USER,F(e.username,t),i.COLLECTION_TRACK_LIST,e.id])),$(i.PROFILE,((e,t)=>e.args&&e.args.length>0?[p.USER,F(e.username,t)].concat(e.args):[p.USER,F(e.username,t)])),$(i.LOCAL_ARTIST,((e,t)=>[i.LOCAL_TRACK,F(e.artist,t)])),$(i.LOCAL_ALBUM,((e,t)=>[i.LOCAL_TRACK,F(e.artist,t),F(e.album,t)])),$(i.LOCAL_TRACK,((e,t)=>[i.LOCAL_TRACK,F(e.artist,t),F(e.album,t),F(e.track,t),e.duration])),$(i.LIBRARY,((e,t)=>[p.USER,F(e.username,t),i.LIBRARY].concat(e.category?[e.category]:[]))),$(i.IMAGE,(e=>[i.IMAGE,e.id])),$(i.MOSAIC,(e=>{let t=[];return e.ids&&(t=e.ids.slice(0)),t.unshift(i.MOSAIC),t})),$(i.RADIO,((e,t)=>B(e.args,t,[i.RADIO]))),$(i.SPECIAL,((e,t)=>B(e.args,t,[i.SPECIAL]))),$(i.STATION,((e,t)=>B(e.args,t,[i.STATION]))),$(i.APPLICATION,((e,t)=>B(e.args,t,[p.APP,e.id]))),$(i.COLLECTION_ALBUM,((e,t)=>[p.USER,F(e.username,t),i.COLLECTION,i.ALBUM,e.id])),$(i.COLLECTION_MISSING_ALBUM,((e,t)=>[p.USER,F(e.username,t),i.COLLECTION,i.ALBUM,e.id,"missing"])),$(i.COLLECTION_ARTIST,((e,t)=>[p.USER,F(e.username,t),i.COLLECTION,i.ARTIST,e.id])),$(i.COLLECTION,((e,t)=>{const n=[i.COLLECTION].concat(e.category?[e.category]:[]);return e.username?[p.USER,F(e.username,t)].concat(n):n})),$(i.COMMENT,(e=>[i.COMMENT,e.id])),$(i.EPISODE,(e=>{let t=e.id;return(e.context||e.play)&&(t+=G({context:e.context,play:e.play})),[i.EPISODE,t]})),$(i.SHOW,(e=>[i.SHOW,e.id])),$(i.LIVE,(e=>[i.LIVE,e.id])),$(i.ROOM,(e=>[i.ROOM,e.id])),$(i.EXPRESSION,(e=>[i.EXPRESSION,e.id])),$(i.CONCEPT,(e=>[i.CONCEPT,e.id])),$(i.CONCERT,(e=>[i.CONCERT,e.id])),$(i.SOCIAL_SESSION,(e=>[i.SOCIAL_SESSION,e.id])),$(i.JAM,(e=>{const t=[i.JAM];return e.contextType&&e.id&&t.push(e.contextType,e.id),e.play&&t.push("play"),t})),$(i.INTERRUPTION,(e=>[i.INTERRUPTION,e.id])),$(i.MERCH,(e=>[i.MERCH,e.id])),$(i.MERCHHUB,(()=>[i.MERCHHUB])),$(i.PRERELEASE,(e=>[i.PRERELEASE,e.id])),$(i.UNKNOWN,((e,t)=>B(e.args,t))),$(i.MEDIA,(e=>[i.MEDIA,e.id])),$(i.POLL,(e=>[i.POLL,e.id])),$(i.QUESTION,(e=>[i.QUESTION,e.id])),$(i.RESPONSE,(e=>[i.RESPONSE,e.id])),$(i.FESTIVAL,(e=>[i.FESTIVAL,e.id])),$(i.TOUR,(e=>[i.TOUR,e.id])),$(i.CULTURAL_MOMENT,(e=>[i.CULTURAL_MOMENT,p.HUB,e.id])),$(i.VENUE,(e=>[i.VENUE,e.id])),$(i.VIDEO,(e=>[i.VIDEO,e.id])),$(i.CANVAS,(e=>[i.CANVAS,e.id])),$(i.COURSE,(e=>[i.COURSE,e.id])),$(i.LESSON,(e=>[i.LESSON,e.id])),$(i.PROMOTER,(e=>[i.PROMOTER,e.id]));const ee="0123456789abcdef",te="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",ne=[];ne.length=256;for(let e=0;e<256;e++)ne[e]=ee[e>>4]+ee[15&e];const ie=[];ie.length=128;for(let e=0;e>>24]+ne[s>>>16&255]+ne[s>>>8&255]+ne[255&s]+ne[a>>>24]+ne[a>>>16&255]+ne[a>>>8&255]+ne[255&a]+ne[r>>>24]+ne[r>>>16&255]+ne[r>>>8&255]+ne[255&r]+ne[o>>>24]+ne[o>>>16&255]+ne[o>>>8&255]+ne[255&o]}(e):e}function se(e){return 32===e.length?function(e){let t,n=0,i=0,o=0;for(t=0;t<10;t++)o=16*o+oe[e.charCodeAt(t)];for(t=0;t<11;t++)i=16*i+oe[e.charCodeAt(t+10)];for(t=0;t<11;t++)n=16*n+oe[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=te[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=te[s-62*n]+c;for(n+=i*r;t<21;++t)s=n,n=Math.floor(s*a),c=te[s-62*n]+c;return te[n]+c}(e):e}function ce(e){return F(e,o.URI)}function le(e){return H(e,o.URI)}const ue="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 de{constructor(e,t={}){this.type=e,this.hasBase62Id=!!t.hasBase62Id,ue(this,t)}toURI(){return`spotify:${Q(this,o.URI).join(":")}`}toString(){return this.toURI()}toURLPath(e=!1){let t=Q(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,{Z0:()=>G,gH:()=>W});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",COMMENT:"comment",CONCEPT:"concept",CONCERT:"concert",CONTEXT_GROUP:"context-group",CULTURAL_MOMENT:"cultural-moment",DAILY_MIX:"dailymix",EMPTY:"empty",EPISODE:"episode",FACEBOOK:"facebook",FESTIVAL:"festival",FOLDER:"folder",FOLLOWERS:"followers",FOLLOWING:"following",IMAGE:"image",INBOX:"inbox",INTERRUPTION:"interruption",LIBRARY:"library",LIVE:"live",ROOM:"room",EXPRESSION:"expression",JAM:"jam",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",PROMOTER:"promoter",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",TOUR:"tour",TRACK:"track",TRACKSET:"trackset",USER_TOPLIST:"user-toplist",USER_TOP_TRACKS:"user-top-tracks",UNKNOWN:"unknown",VENUE:"venue",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"};function p(e,t){return F(i.COLLECTION,{username:e,category:t})}function h(e,t,n){return F(i.JAM,{id:e,contextType:t,hasBase62Id:Boolean(e),play:Boolean(n)})}function f(e,t,n,o){return F(i.LOCAL_TRACK,{artist:e,album:t,track:n,duration:o})}function m(e,t,n){return F(i.TOPLIST,{toplist:e,country:t,global:Boolean(n)})}function _(e,t,n,o){return F(i.TRACK,{id:e,anchor:t,context:n?B(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(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 S=()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]},[T,A]=S();T(i.PLAYLIST,((e,t,{username:n})=>function(e,t){return F(i.PLAYLIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getBase62IdComponent()))),T(i.FOLDER,((e,t,{username:n})=>function(e,t){return F(i.FOLDER,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),T(i.COLLECTION_TRACK_LIST,((e,t,{username:n})=>function(e,t){return F(i.COLLECTION_TRACK_LIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()))),T(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 F(i.COLLECTION_MISSING_ALBUM,{id:t,username:e,hasBase62Id:!0})}(n,t):function(e,t){return F(i.COLLECTION_ALBUM,{id:t,username:e,hasBase62Id:!0})}(n,t)}return o===i.ARTIST?function(e,t){return F(i.COLLECTION_ARTIST,{id:t,username:e,hasBase62Id:!0})}(n,e.getIdComponent()):p(n,o)})),T(i.STARRED,((e,t,{username:n})=>function(e){return F(i.STARRED,{username:e})}(n))),T(i.FOLLOWERS,((e,t,{username:n})=>function(e){return F(i.FOLLOWERS,{username:e})}(n))),T(i.FOLLOWING,((e,t,{username:n})=>function(e){return F(i.FOLLOWING,{username:e})}(n))),T(d.TOP,((e,t,{username:n})=>function(e,t){return F(i.USER_TOPLIST,{username:e,toplist:t})}(n,e.getNextRequiredComponent()))),T(i.INBOX,((e,t,{username:n})=>function(e){return F(i.INBOX,{username:e})}(n))),T(i.ROOTLIST,((e,t,{username:n})=>function(e){return F(i.ROOTLIST,{username:e})}(n))),T(i.PUBLISHED_ROOTLIST,((e,t,{username:n})=>function(e){return F(i.PUBLISHED_ROOTLIST,{username:e})}(n))),T(i.TOPLIST,((e,t,{username:n})=>function(e){return F(i.USER_TOP_TRACKS,{username:e})}(n))),T(i.LIBRARY,((e,t,{username:n})=>function(e,t){return F(i.LIBRARY,{username:e,category:t})}(n,e.getNextComponent())));const[I,O]=S();function C(e){let t,n,i,d,p=e;const[h,f]=p.split("?");if(h&&f){p=h;const[e,t]=f.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 R(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 b.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!")}I(i.ALBUM,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return function(e,t){return F(i.ALBUM,{id:e,disc:t,hasBase62Id:!0})}(t,n?parseInt(n,10):void 0)})),I(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(),F(i.AD,{id:t});var t})),I(i.ARTIST,(e=>{const t=e.getBase62IdComponent(),n=e.getNextComponent();return n===d.TOP?function(e,t){return F(i.ARTIST_TOPLIST,{id:e,toplist:t,hasBase62Id:!0})}(t,e.getNextRequiredComponent()):n===d.CONCERTS?function(e){return F(i.ARTIST_CONCERTS,{id:e,hasBase62Id:!0})}(t):function(e){return F(i.ARTIST,{id:e,hasBase62Id:!0})}(t)})),I(i.AUDIO_FILE,(e=>{return t=e.getNextRequiredComponent(),n=e.getNextRequiredComponent(),F(i.AUDIO_FILE,{id:n,extension:t});var t,n})),I(i.DAILY_MIX,(e=>{return t=e.getIdComponent(),F(i.DAILY_MIX,{id:t,hasBase62Id:!0});var t})),I(i.TEMP_PLAYLIST,(e=>{return t=e.getNextRequiredComponent(),n=e.getRemainingString(),F(i.TEMP_PLAYLIST,{origin:t,data:n});var t,n})),I(i.PLAYLIST,(e=>{return t=e.getBase62IdComponent(),F(i.PLAYLIST_V2,{id:t,hasBase62Id:!0});var t})),I(i.SEARCH,((e,t)=>{return n=v(e.getRemainingString(),t),F(i.SEARCH,{query:n});var n})),I(i.TRACK,(e=>{const t=e.getQueryParams();return _(e.getBase62IdComponent(),e.getNextComponent(),t?.context,t?.play)})),I(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(),F(i.CONTEXT_GROUP,{origin:t,name:n,hasBase62Id:!0});var t,n})),I(d.TOP,(e=>{const t=e.getNextRequiredComponent();return e.getNextComponent()===d.GLOBAL?m(t,void 0,!0):m(t,e.getNextComponent(),!1)})),I(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,F(i.LOCAL_ALBUM,{artist:u,album:d})):function(e){return F(i.LOCAL_ARTIST,{artist:e})}(n);var u,d})),I(i.IMAGE,(e=>{return t=e.getHexIdComponent(40),F(i.IMAGE,{id:t});var t})),I(i.MOSAIC,(e=>{return t=e.getRemainingComponents(),F(i.MOSAIC,{ids:t});var t})),I(i.RADIO,(e=>{return t=e.getRemainingString(),F(i.RADIO,{args:t??""});var t})),I(i.SPECIAL,((e,t)=>{const n=e.getRemainingComponents();for(let e=0,i=n.length;e{return t=e.getRemainingComponents(),F(i.STATION,{args:t??[]});var t})),I(i.EPISODE,(e=>{const t=e.getQueryParams();return function(e,t,n){return F(i.EPISODE,{id:e,context:t?B(t):null,play:n,hasBase62Id:!0})}(e.getBase62IdComponent(),t?.context,t?.play)})),I(i.SHOW,(e=>{return t=e.getBase62IdComponent(),F(i.SHOW,{id:t,hasBase62Id:!0});var t})),I(i.LIVE,(e=>{return t=e.getIdComponent(),F(i.LIVE,{id:t,hasBase62Id:!0});var t})),I(i.ROOM,(e=>{return t=e.getIdComponent(),F(i.ROOM,{id:t,hasBase62Id:!0});var t})),I(i.EXPRESSION,(e=>{return t=e.getIdComponent(),F(i.EXPRESSION,{id:t,hasBase62Id:!0});var t})),I(i.CONCEPT,(e=>{return t=e.getIdComponent(),F(i.CONCEPT,{id:t,hasBase62Id:!0});var t})),I(i.CONCERT,(e=>{return t=e.getIdComponent(),F(i.CONCERT,{id:t,hasBase62Id:!0});var t})),I(i.MERCH,(e=>{return t=e.getIdComponent(),F(i.MERCH,{id:t,hasBase62Id:!0});var t})),I(i.MERCHHUB,(()=>F(i.MERCHHUB,{}))),I(i.PRERELEASE,(e=>{return t=e.getIdComponent(),F(i.PRERELEASE,{id:t,hasBase62Id:!0});var t})),I(i.SOCIAL_SESSION,(e=>{return t=e.getNextRequiredComponent(),F(i.SOCIAL_SESSION,{id:t,hasBase62Id:!0});var t})),I(i.JAM,(e=>{const[t,n,o,r]=e.getAllComponents();return n===i.ALBUM||n===i.ARTIST||n===i.PLAYLIST?h(o,n,!!r):h("")})),I(i.INTERRUPTION,(e=>{return t=e.getNextRequiredComponent(),F(i.INTERRUPTION,{id:t});var t})),I(i.COLLECTION,(e=>p(void 0,e.getNextComponent()))),I(i.GENRE,(e=>{return t=e.getNextRequiredComponent(),F(i.GENRE,{genre:t});var t})),I(i.QUEUE,(()=>F(i.QUEUE,{}))),I(d.USER,((e,t)=>{const n=v(e.getNextRequiredComponent(),t),o=e.getNextComponent();if(n===i.FACEBOOK&&o)return r=o,F(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 F(i.PROFILE,{username:e,args:t??[]})}(n,o?[o].concat(a):void 0)})),I(i.UNKNOWN,(e=>function(e){return F(i.UNKNOWN,{args:e??[]})}(e.getAllComponents()))),I(i.MEDIA,(e=>{return t=e.getIdComponent(),F(i.MEDIA,{id:t,hasBase62Id:!0});var t})),I(i.POLL,(e=>{return t=e.getIdComponent(),F(i.POLL,{id:t,hasBase62Id:!0});var t})),I(i.QUESTION,(e=>{return t=e.getIdComponent(),F(i.QUESTION,{id:t,hasBase62Id:!0});var t})),I(i.RESPONSE,(e=>{return t=e.getIdComponent(),F(i.RESPONSE,{id:t,hasBase62Id:!0});var t})),I(i.CULTURAL_MOMENT,(e=>{if(e.getNextComponent()!==d.HUB)throw new TypeError("Invalid or unknown Spotify URI!");return t=e.getIdComponent(),F(i.CULTURAL_MOMENT,{id:t});var t})),I(i.FESTIVAL,(e=>{return t=e.getIdComponent(),F(i.FESTIVAL,{id:t,hasBase62Id:!0});var t})),I(i.TOUR,(e=>{return t=e.getIdComponent(),F(i.TOUR,{id:t,hasBase62Id:!0});var t})),I(i.VENUE,(e=>{return t=e.getIdComponent(),F(i.VENUE,{id:t,hasBase62Id:!0});var t})),I(i.VIDEO,(e=>{return t=e.getIdComponent(),F(i.VIDEO,{id:t,hasBase62Id:!0});var t})),I(i.CANVAS,(e=>{return t=e.getIdComponent(),F(i.CANVAS,{id:t,hasBase62Id:!0});var t})),I(i.COURSE,(e=>{return t=e.getIdComponent(),F(i.COURSE,{id:t,hasBase62Id:!0});var t})),I(i.LESSON,(e=>{return t=e.getIdComponent(),F(i.LESSON,{id:t,hasBase62Id:!0});var t})),I(i.PROMOTER,(e=>{return t=e.getIdComponent(),F(i.PROMOTER,{id:t,hasBase62Id:!0});var t})),I(i.COMMENT,(e=>{return t=e.getIdComponent(),F(i.COMMENT,{id:t,hasBase62Id:!0});var t}));const[N,P]=(()=>{const e={};return[(t,n)=>{e[t]||(e[t]=n)},e]})();function L(e,t){const n=P[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(e.args,t,[i.RADIO]))),N(i.SPECIAL,((e,t)=>E(e.args,t,[i.SPECIAL]))),N(i.STATION,((e,t)=>E(e.args,t,[i.STATION]))),N(i.APPLICATION,((e,t)=>E(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.COMMENT,(e=>[i.COMMENT,e.id])),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.JAM,(e=>{const t=[i.JAM];return e.contextType&&e.id&&t.push(e.contextType,e.id),e.play&&t.push("play"),t})),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(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.FESTIVAL,(e=>[i.FESTIVAL,e.id])),N(i.TOUR,(e=>[i.TOUR,e.id])),N(i.CULTURAL_MOMENT,(e=>[i.CULTURAL_MOMENT,d.HUB,e.id])),N(i.VENUE,(e=>[i.VENUE,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])),N(i.PROMOTER,(e=>[i.PROMOTER,e.id]));const k="0123456789abcdef",w="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",D=[];D.length=256;for(let e=0;e<256;e++)D[e]=k[e>>4]+k[15&e];const M=[];M.length=128;for(let e=0;e<62;++e)M[w.charCodeAt(e)]=e;const x=[];for(let e=0;e<16;e++)x[k.charCodeAt(e)]=e;for(let e=0;e<6;e++)x["ABCDEF".charCodeAt(e)]=10+e;const U="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 V{constructor(e,t={}){this.type=e,this.hasBase62Id=!!t.hasBase62Id,U(this,t)}toURI(){return`spotify:${L(this,o.URI).join(":")}`}toString(){return this.toURI()}toURLPath(e=!1){let t=L(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)}}))}},88176:(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={}))},21913: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)}()},35350:(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},9856: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),h=s.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(o[h])}},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}})},84686:(e,t,n)=>{"use strict";const i=n(35350),o=n(77947),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=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 h(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 h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(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|f(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|f(e))}function p(e){const t=e.length<0?0:0|f(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 z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(o)return i?-1:z(e).length;t=(""+t).toLowerCase(),o=!0}}function _(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 P(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function E(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:v(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):v(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function v(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 I(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function O(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 y(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 T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(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 R(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 w(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 D(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=Z((function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(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||j(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=Z((function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(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||j(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){w(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){w(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||w(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||w(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||w(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||w(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||w(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=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((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);w(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);w(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||w(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||w(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||w(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||w(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||w(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=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((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){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||j(t,e.length-(n+1))}(i,o,r)}function W(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function j(e,t,n){if(Math.floor(e)!==e)throw W(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 z(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 K(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 $=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 Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},14877: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]}},66138:(e,t,n)=>{var i=n(14877),o=n(301),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)]}},56324:(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 h(e){this.map={},e instanceof h?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 f(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 _(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function E(){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=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(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=f(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=f(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(_)}),this.text=function(){var e,t,n,i=f(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 h(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},E.call(y.prototype),E.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];S.redirect=function(e,t){if(-1===T.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 A(e,i){return new Promise((function(o,a){var c=new y(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 h,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 h?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)}))}A.polyfill=!0,n.fetch||(n.fetch=A,n.Headers=h,n.Request=y,n.Response=S),t.Headers=h,t.Request=y,t.Response=S,t.fetch=A}({})}(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},42067:(e,t,n)=>{t.UINT32=n(44402),t.UINT64=n(49117)},44402: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)}()},49117: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)}()},76860:e=>{"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}},8994:(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},42095: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(8994),a=n(42399);o(n(42399),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},42399: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 h=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=h;var f=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=f;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 _(e){return(0,a.isTag)(e)}function g(e){return e.type===a.ElementType.CDATA}function E(e){return e.type===a.ElementType.Text}function v(e){return e.type===a.ElementType.Comment}function y(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),E(e))n=new l(e.data);else if(v(e))n=new u(e.data);else if(_(e)){var i=t?T(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(g(e)){i=t?T(e.children):[];var a=new h(i);i.forEach((function(e){return e.parent=a})),n=a}else if(b(e)){i=t?T(e.children):[];var s=new f(i);i.forEach((function(e){return e.parent=s})),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!y(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 T(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)}()},93212: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}},8741:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});const i=new Uint32Array(65536),o=(e,t)=>{if(e.length{const n=e.length,o=t.length,r=1<{const n=t.length,o=e.length,r=[],a=[],s=Math.ceil(n/32),c=Math.ceil(o/32);for(let e=0;e>>e&1,l=r[e/32|0]>>>e&1,u=n|s,d=((n|l)&c)+c^c|n|l;let p=s|~(d|c),h=c&d;p>>>31^o&&(a[e/32|0]^=1<>>31^l&&(r[e/32|0]^=1<>>e&1,c=r[e/32|0]>>>e&1,l=n|u,p=((n|c)&d)+d^d|n|c;let h=u|~(p|d),m=d&p;f+=h>>>o-1&1,f-=m>>>o-1&1,h>>>31^s&&(a[e/32|0]^=1<>>31^c&&(r[e/32|0]^=1<=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;n1?i-1:0),r=1;r element.");return l.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),Object.defineProperty(t,"prototype",{writable:!1}),u}(l.Component),f="undefined"==typeof Element?Function:Element;h.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.bool,u.func]),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.bool,u.func]),allowOutsideClick:u.oneOfType([u.bool,u.func]),preventScroll:u.bool,tabbableOptions:u.shape({displayCheck:u.oneOf(["full","non-zero-area","none"]),getShadowRoot:u.oneOfType([u.bool,u.func])})}),containerElements:u.arrayOf(u.instanceOf(f)),children:u.oneOfType([u.element,u.instanceOf(f)])},h.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:d},e.exports=h},61912:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createFocusTrap:()=>h});var i=n(29069);function o(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 r(e){for(var t=1;t0){var t=s[s.length-1];t!==e&&t.pause()}var n=s.indexOf(e);-1===n||s.splice(n,1),s.push(e)},deactivateTrap:function(e){var t=s.indexOf(e);-1!==t&&s.splice(t,1),s.length>0&&s[s.length-1].unpause()}}),l=function(e){return setTimeout(e,0)},u=function(e,t){var n=-1;return e.every((function(e,i){return!t(e)||(n=i,!1)})),n},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?n-1:0),r=1;r=0)e=o.activeElement;else{var t=s.tabbableGroups[0];e=t&&t.firstTabbableNode||m("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},g=function(){if(s.containerGroups=s.containers.map((function(e){var t=(0,i.tabbable)(e,a.tabbableOptions),n=(0,i.focusable)(e,a.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=n.findIndex((function(t){return t===e}));if(!(o<0))return t?n.slice(o+1).find((function(e){return(0,i.isTabbable)(e,a.tabbableOptions)})):n.slice(0,o).reverse().find((function(e){return(0,i.isTabbable)(e,a.tabbableOptions)}))}}})),s.tabbableGroups=s.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),s.tabbableGroups.length<=0&&!m("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},E=function e(t){!1!==t&&t!==o.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!a.preventScroll}),s.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(_()))},v=function(e){var t=m("setReturnFocus",e);return t||!1!==t&&e},y=function(e){var t=p(e);f(t)>=0||(d(a.clickOutsideDeactivates,e)?n.deactivate({returnFocus:a.returnFocusOnDeactivate&&!(0,i.isFocusable)(t,a.tabbableOptions)}):d(a.allowOutsideClick,e)||e.preventDefault())},b=function(e){var t=p(e),n=f(t)>=0;n||t instanceof Document?n&&(s.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),E(s.mostRecentlyFocusedNode||_()))},S=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==d(a.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=p(e);g();var n=null;if(s.tabbableGroups.length>0){var o=f(t),r=o>=0?s.containerGroups[o]:void 0;if(o<0)n=e.shiftKey?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=u(s.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(r.container===t||(0,i.isFocusable)(t,a.tabbableOptions)&&!(0,i.isTabbable)(t,a.tabbableOptions)&&!r.nextTabbableNode(t,!1))&&(c=o),c>=0){var l=0===c?s.tabbableGroups.length-1:c-1;n=s.tabbableGroups[l].lastTabbableNode}}else{var d=u(s.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(d<0&&(r.container===t||(0,i.isFocusable)(t,a.tabbableOptions)&&!(0,i.isTabbable)(t,a.tabbableOptions)&&!r.nextTabbableNode(t))&&(d=o),d>=0){var h=d===s.tabbableGroups.length-1?0:d+1;n=s.tabbableGroups[h].firstTabbableNode}}}else n=m("fallbackFocus");n&&(e.preventDefault(),E(n))}(e)},T=function(e){var t=p(e);f(t)>=0||d(a.clickOutsideDeactivates,e)||d(a.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},A=function(){if(s.active)return c.activateTrap(n),s.delayInitialFocusTimer=a.delayInitialFocus?l((function(){E(_())})):E(_()),o.addEventListener("focusin",b,!0),o.addEventListener("mousedown",y,{capture:!0,passive:!1}),o.addEventListener("touchstart",y,{capture:!0,passive:!1}),o.addEventListener("click",T,{capture:!0,passive:!1}),o.addEventListener("keydown",S,{capture:!0,passive:!1}),n},I=function(){if(s.active)return o.removeEventListener("focusin",b,!0),o.removeEventListener("mousedown",y,!0),o.removeEventListener("touchstart",y,!0),o.removeEventListener("click",T,!0),o.removeEventListener("keydown",S,!0),n};return(n={get active(){return s.active},get paused(){return s.paused},activate:function(e){if(s.active)return this;var t=h(e,"onActivate"),n=h(e,"onPostActivate"),i=h(e,"checkCanFocusTrap");i||g(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,t&&t();var r=function(){i&&g(),A(),n&&n()};return i?(i(s.containers.concat()).then(r,r),this):(r(),this)},deactivate:function(e){if(!s.active)return this;var t=r({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},e);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,c.deactivateTrap(n);var i=h(t,"onDeactivate"),o=h(t,"onPostDeactivate"),u=h(t,"checkCanReturnFocus"),d=h(t,"returnFocus","returnFocusOnDeactivate");i&&i();var p=function(){l((function(){d&&E(v(s.nodeFocusedBeforeActivation)),o&&o()}))};return d&&u?(u(v(s.nodeFocusedBeforeActivation)).then(p,p),this):(p(),this)},pause:function(){return s.paused||!s.active||(s.paused=!0,I()),this},unpause:function(){return s.paused&&s.active?(s.paused=!1,g(),A(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return s.containers=t.map((function(e){return"string"==typeof e?o.querySelector(e):e})),s.active&&g(),this}}).updateContainerElements(e),n}},79133:(e,t,n)=>{const i=n(4964),o=n(8082).p,r=n(66505).p,a=n(44747),s=n(80686).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,h=2;function f(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}},83407:(e,t,n)=>{"use strict";n.d(t,{zR:()=>I,sC:()=>N});var i=n(41930),o=n.n(i),r=n(29597),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 h=i[p];"."===h?c(i,p):".."===h?(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 f=i.join("/");return l&&"/"!==f.substr(-1)&&(f+="/"),f};"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},h=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};a()(_,"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,h=e.getUserConfirmation,I=void 0===h?v:h,O=e.keyLength,C=void 0===O?6:O,R=e.basename?"/"===(n=u(e.basename)).charAt(n.length-1)?n.slice(0,-1):n:"",N=function(e){var t=e||{},n=t.key,i=t.state,r=window.location,a=r.pathname+r.search+r.hash;return o()(!R||d(a,R),'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 "'+R+'".'),R&&(a=function(e,t){return d(e,t)?e.substr(t.length):e}(a,R)),f(a,i,n)},P=function(){return Math.random().toString(36).substr(2,C)},L=m(),k=function(e){b(Y,e),Y.length=i.length,L.notifyListeners(Y.location,Y.action)},w=function(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||x(N(e.state))},D=function(){x(N(A()))},M=!1,x=function(e){if(M)M=!1,k();else{L.confirmTransitionTo(e,"POP",I,(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=N(A()),F=[V.key],B=function(e){return R+p(e)},H=function(e){i.go(e)},G=0,W=function(e){1===(G+=e)?(g(window,S,w),s&&g(window,T,D)):0===G&&(E(window,S,w),s&&E(window,T,D))},j=!1,Y={length:i.length,action:"POP",location:V,createHref:B,push:function(e,t){o()(!("object"===(void 0===e?"undefined":y(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=f(e,t,P(),Y.location);L.confirmTransitionTo(a,n,I,(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":y(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=f(e,t,P(),Y.location);L.confirmTransitionTo(a,n,I,(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=L.setPrompt(e);return j||(W(1),j=!0),function(){return j&&(j=!1,W(-1)),t()}},listen:function(e){var t=L.appendListener(e);return W(1),function(){W(-1),t()}}};return Y};Object.assign;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},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(v,e),v.length=v.entries.length,l.notifyListeners(v.location,v.action)},d=function(){return Math.random().toString(36).substr(2,c)},h=R(a,0,i.length-1),_=i.map((function(e){return f(e,void 0,"string"==typeof e?d():e.key||d())})),g=p,E=function(e){var n=R(v.index+e,0,v.entries.length-1),i=v.entries[n];l.confirmTransitionTo(i,"POP",t,(function(e){e?u({action:"POP",location:i,index:n}):u()}))},v={length:_.length,action:"POP",location:_[h],index:h,entries:_,createHref:g,push:function(e,n){o()(!("object"===(void 0===e?"undefined":O(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=f(e,n,d(),v.location);l.confirmTransitionTo(r,i,t,(function(e){if(e){var t=v.index+1,n=v.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":O(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=f(e,n,d(),v.location);l.confirmTransitionTo(r,i,t,(function(e){e&&(v.entries[v.index]=r,u({action:i,location:r}))}))},go:E,goBack:function(){return E(-1)},goForward:function(){return E(1)},canGo:function(e){var t=v.index+e;return t>=0&&t0&&void 0!==arguments[0]&&arguments[0];return l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return v}},31035:(e,t,n)=>{"use strict";var i=n(35959),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,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,i){if("string"!=typeof n){if(f){var o=h(n);o&&o!==f&&e(t,o,i)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=c(t),m=c(n),_=0;_{"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}),{})},65189:(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 h,f="object"==typeof document&&document.createElement("template");f&&f.content&&(h=function(e){return f.innerHTML=e,f.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 f=l(e);if(!a.test(e))null===(t=null==(_=f.querySelector(i))?void 0:_.parentNode)||void 0===t||t.removeChild(_);if(!s.test(e))null===(u=null==(_=f.querySelector(o))?void 0:_.parentNode)||void 0===u||u.removeChild(_);return f.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 h?h(e):(_=c(e,o).querySelector(o)).childNodes;var _}}},35466: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(65189)),r=n(85562),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)}},85562:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDOM=t.formatAttributes=void 0;var i=n(42095),o=n(98615);function r(e){for(var t={},n=0,i=e.length;n'"&]/g,nonAscii:/[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintable:/[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintableOnly:/[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,extensive:/[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g},u={mode:"specialChars",level:"all",numeric:"decimal"};t.encode=function(e,t){var n=void 0===t?u:t,i=n.mode,o=void 0===i?"specialChars":i,r=n.numeric,d=void 0===r?"decimal":r,p=n.level;if(!e)return"";var h=l[o],f=s[void 0===p?"all":p].characters,m="hexadecimal"===d;return c(e,h,(function(e){var t=f[e];if(!t){var n=e.length>1?a.getCodePoint(e,0):e.charCodeAt(0);t=(m?"&#x"+n.toString(16):"&#"+n)+";"}return t}))};var d={scope:"body",level:"all"},p=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,h=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,f={xml:{strict:p,attribute:h,body:o.bodyRegExps.xml},html4:{strict:p,attribute:h,body:o.bodyRegExps.html4},html5:{strict:p,attribute:h,body:o.bodyRegExps.html5}},m=i(i({},f),{all:f.html5}),_=String.fromCharCode,g=_(65533),E={level:"all"};function v(e,t,n,i){var o=e,s=e[e.length-1];if(n&&"="===s)o=e;else if(i&&";"!==s)o=e;else{var c=t[e];if(c)o=c;else if("&"===e[0]&&"#"===e[1]){var l=e[2],u="x"==l||"X"==l?parseInt(e.substr(3),16):parseInt(e.substr(2));o=u>=1114111?g:u>65535?a.fromCodePoint(u):_(r.numericUnicodeMap[u]||u)}}return o}t.decodeEntity=function(e,t){var n=(void 0===t?E:t).level;return e?v(e,s[void 0===n?"all":n].entities,!1,!1):""},t.decode=function(e,t){var n=void 0===t?d:t,i=n.level,o=void 0===i?"all":i,r=n.scope,a=void 0===r?"xml"===o?"strict":"body":r;if(!e)return"";var l=m[o][a],u=s[o].entities,p="attribute"===a,h="strict"===a;return c(e,l,(function(e){return v(e,u,p,h)}))}},67350:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyRegExps={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},t.namedReferences={xml:{entities:{"<":"<",">":">",""":'"',"'":"'","&":"&"},characters:{"<":"<",">":">",'"':""","'":"'","&":"&"}},html4:{entities:{"'":"'"," ":" "," ":" ","¡":"¡","¡":"¡","¢":"¢","¢":"¢","£":"£","£":"£","¤":"¤","¤":"¤","¥":"¥","¥":"¥","¦":"¦","¦":"¦","§":"§","§":"§","¨":"¨","¨":"¨","©":"©","©":"©","ª":"ª","ª":"ª","«":"«","«":"«","¬":"¬","¬":"¬","­":"­","­":"­","®":"®","®":"®","¯":"¯","¯":"¯","°":"°","°":"°","±":"±","±":"±","²":"²","²":"²","³":"³","³":"³","´":"´","´":"´","µ":"µ","µ":"µ","¶":"¶","¶":"¶","·":"·","·":"·","¸":"¸","¸":"¸","¹":"¹","¹":"¹","º":"º","º":"º","»":"»","»":"»","¼":"¼","¼":"¼","½":"½","½":"½","¾":"¾","¾":"¾","¿":"¿","¿":"¿","À":"À","À":"À","Á":"Á","Á":"Á","Â":"Â","Â":"Â","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","Å":"Å","Å":"Å","Æ":"Æ","Æ":"Æ","Ç":"Ç","Ç":"Ç","È":"È","È":"È","É":"É","É":"É","Ê":"Ê","Ê":"Ê","Ë":"Ë","Ë":"Ë","Ì":"Ì","Ì":"Ì","Í":"Í","Í":"Í","Î":"Î","Î":"Î","Ï":"Ï","Ï":"Ï","Ð":"Ð","Ð":"Ð","Ñ":"Ñ","Ñ":"Ñ","Ò":"Ò","Ò":"Ò","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","Õ":"Õ","Õ":"Õ","Ö":"Ö","Ö":"Ö","×":"×","×":"×","Ø":"Ø","Ø":"Ø","Ù":"Ù","Ù":"Ù","Ú":"Ú","Ú":"Ú","Û":"Û","Û":"Û","Ü":"Ü","Ü":"Ü","Ý":"Ý","Ý":"Ý","Þ":"Þ","Þ":"Þ","ß":"ß","ß":"ß","à":"à","à":"à","á":"á","á":"á","â":"â","â":"â","ã":"ã","ã":"ã","ä":"ä","ä":"ä","å":"å","å":"å","æ":"æ","æ":"æ","ç":"ç","ç":"ç","è":"è","è":"è","é":"é","é":"é","ê":"ê","ê":"ê","ë":"ë","ë":"ë","ì":"ì","ì":"ì","í":"í","í":"í","î":"î","î":"î","ï":"ï","ï":"ï","ð":"ð","ð":"ð","ñ":"ñ","ñ":"ñ","ò":"ò","ò":"ò","ó":"ó","ó":"ó","ô":"ô","ô":"ô","õ":"õ","õ":"õ","ö":"ö","ö":"ö","÷":"÷","÷":"÷","ø":"ø","ø":"ø","ù":"ù","ù":"ù","ú":"ú","ú":"ú","û":"û","û":"û","ü":"ü","ü":"ü","ý":"ý","ý":"ý","þ":"þ","þ":"þ","ÿ":"ÿ","ÿ":"ÿ",""":'"',""":'"',"&":"&","&":"&","<":"<","<":"<",">":">",">":">","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ˆ":"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€","ƒ":"ƒ","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},characters:{"'":"'"," ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©",ª:"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´",µ:"µ","¶":"¶","·":"·","¸":"¸","¹":"¹",º:"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿",À:"À",Á:"Á",Â:"Â",Ã:"Ã",Ä:"Ä",Å:"Å",Æ:"Æ",Ç:"Ç",È:"È",É:"É",Ê:"Ê",Ë:"Ë",Ì:"Ì",Í:"Í",Î:"Î",Ï:"Ï",Ð:"Ð",Ñ:"Ñ",Ò:"Ò",Ó:"Ó",Ô:"Ô",Õ:"Õ",Ö:"Ö","×":"×",Ø:"Ø",Ù:"Ù",Ú:"Ú",Û:"Û",Ü:"Ü",Ý:"Ý",Þ:"Þ",ß:"ß",à:"à",á:"á",â:"â",ã:"ã",ä:"ä",å:"å",æ:"æ",ç:"ç",è:"è",é:"é",ê:"ê",ë:"ë",ì:"ì",í:"í",î:"î",ï:"ï",ð:"ð",ñ:"ñ",ò:"ò",ó:"ó",ô:"ô",õ:"õ",ö:"ö","÷":"÷",ø:"ø",ù:"ù",ú:"ú",û:"û",ü:"ü",ý:"ý",þ:"þ",ÿ:"ÿ",'"':""","&":"&","<":"<",">":">",Œ:"Œ",œ:"œ",Š:"Š",š:"š",Ÿ:"Ÿ",ˆ:"ˆ","˜":"˜"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","‰":"‰","‹":"‹","›":"›","€":"€",ƒ:"ƒ",Α:"Α",Β:"Β",Γ:"Γ",Δ:"Δ",Ε:"Ε",Ζ:"Ζ",Η:"Η",Θ:"Θ",Ι:"Ι",Κ:"Κ",Λ:"Λ",Μ:"Μ",Ν:"Ν",Ξ:"Ξ",Ο:"Ο",Π:"Π",Ρ:"Ρ",Σ:"Σ",Τ:"Τ",Υ:"Υ",Φ:"Φ",Χ:"Χ",Ψ:"Ψ",Ω:"Ω",α:"α",β:"β",γ:"γ",δ:"δ",ε:"ε",ζ:"ζ",η:"η",θ:"θ",ι:"ι",κ:"κ",λ:"λ",μ:"μ",ν:"ν",ξ:"ξ",ο:"ο",π:"π",ρ:"ρ",ς:"ς",σ:"σ",τ:"τ",υ:"υ",φ:"φ",χ:"χ",ψ:"ψ",ω:"ω",ϑ:"ϑ",ϒ:"ϒ",ϖ:"ϖ","•":"•","…":"…","′":"′","″":"″","‾":"‾","⁄":"⁄",℘:"℘",ℑ:"ℑ",ℜ:"ℜ","™":"™",ℵ:"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","〈":"⟨","〉":"⟩","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"}},html5:{entities:{"Æ":"Æ","Æ":"Æ","&":"&","&":"&","Á":"Á","Á":"Á","Ă":"Ă","Â":"Â","Â":"Â","А":"А","𝔄":"𝔄","À":"À","À":"À","Α":"Α","Ā":"Ā","⩓":"⩓","Ą":"Ą","𝔸":"𝔸","⁡":"⁡","Å":"Å","Å":"Å","𝒜":"𝒜","≔":"≔","Ã":"Ã","Ã":"Ã","Ä":"Ä","Ä":"Ä","∖":"∖","⫧":"⫧","⌆":"⌆","Б":"Б","∵":"∵","ℬ":"ℬ","Β":"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","ℬ":"ℬ","≎":"≎","Ч":"Ч","©":"©","©":"©","Ć":"Ć","⋒":"⋒","ⅅ":"ⅅ","ℭ":"ℭ","Č":"Č","Ç":"Ç","Ç":"Ç","Ĉ":"Ĉ","∰":"∰","Ċ":"Ċ","¸":"¸","·":"·","ℭ":"ℭ","Χ":"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮","ℂ":"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","ⅅ":"ⅅ","⤑":"⤑","Ђ":"Ђ","Ѕ":"Ѕ","Џ":"Џ","‡":"‡","↡":"↡","⫤":"⫤","Ď":"Ď","Д":"Д","∇":"∇","Δ":"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","∯":"∯","¨":"¨","⇓":"⇓","⇐":"⇐","⇔":"⇔","⫤":"⫤","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","⇓":"⇓","𝒟":"𝒟","Đ":"Đ","Ŋ":"Ŋ","Ð":"Ð","Ð":"Ð","É":"É","É":"É","Ě":"Ě","Ê":"Ê","Ê":"Ê","Э":"Э","Ė":"Ė","𝔈":"𝔈","È":"È","È":"È","∈":"∈","Ē":"Ē","◻":"◻","▫":"▫","Ę":"Ę","𝔼":"𝔼","Ε":"Ε","⩵":"⩵","≂":"≂","⇌":"⇌","ℰ":"ℰ","⩳":"⩳","Η":"Η","Ë":"Ë","Ë":"Ë","∃":"∃","ⅇ":"ⅇ","Ф":"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀","ℱ":"ℱ","ℱ":"ℱ","Ѓ":"Ѓ",">":">",">":">","Γ":"Γ","Ϝ":"Ϝ","Ğ":"Ğ","Ģ":"Ģ","Ĝ":"Ĝ","Г":"Г","Ġ":"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫","Ъ":"Ъ","ˇ":"ˇ","^":"^","Ĥ":"Ĥ","ℌ":"ℌ","ℋ":"ℋ","ℍ":"ℍ","─":"─","ℋ":"ℋ","Ħ":"Ħ","≎":"≎","≏":"≏","Е":"Е","IJ":"IJ","Ё":"Ё","Í":"Í","Í":"Í","Î":"Î","Î":"Î","И":"И","İ":"İ","ℑ":"ℑ","Ì":"Ì","Ì":"Ì","ℑ":"ℑ","Ī":"Ī","ⅈ":"ⅈ","⇒":"⇒","∬":"∬","∫":"∫","⋂":"⋂","⁣":"⁣","⁢":"⁢","Į":"Į","𝕀":"𝕀","Ι":"Ι","ℐ":"ℐ","Ĩ":"Ĩ","І":"І","Ï":"Ï","Ï":"Ï","Ĵ":"Ĵ","Й":"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥","Ј":"Ј","Є":"Є","Х":"Х","Ќ":"Ќ","Κ":"Κ","Ķ":"Ķ","К":"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦","Љ":"Љ","<":"<","<":"<","Ĺ":"Ĺ","Λ":"Λ","⟪":"⟪","ℒ":"ℒ","↞":"↞","Ľ":"Ľ","Ļ":"Ļ","Л":"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⇐":"⇐","⇔":"⇔","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚","Ŀ":"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","⟸":"⟸","⟺":"⟺","⟹":"⟹","𝕃":"𝕃","↙":"↙","↘":"↘","ℒ":"ℒ","↰":"↰","Ł":"Ł","≪":"≪","⤅":"⤅","М":"М"," ":" ","ℳ":"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄","ℳ":"ℳ","Μ":"Μ","Њ":"Њ","Ń":"Ń","Ň":"Ň","Ņ":"Ņ","Н":"Н","​":"​","​":"​","​":"​","​":"​","≫":"≫","≪":"≪"," ":"\n","𝔑":"𝔑","⁠":"⁠"," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц"," ":"\t","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"​","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"⁡","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"⁣","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"⁢","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"‎","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"‏","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"­","­":"­","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"‍","‌":"‌"},characters:{Æ:"Æ","&":"&",Á:"Á",Ă:"Ă",Â:"Â",А:"А",𝔄:"𝔄",À:"À",Α:"Α",Ā:"Ā","⩓":"⩓",Ą:"Ą",𝔸:"𝔸","⁡":"⁡",Å:"Å",𝒜:"𝒜","≔":"≔",Ã:"Ã",Ä:"Ä","∖":"∖","⫧":"⫧","⌆":"⌆",Б:"Б","∵":"∵",ℬ:"ℬ",Β:"Β",𝔅:"𝔅",𝔹:"𝔹","˘":"˘","≎":"≎",Ч:"Ч","©":"©",Ć:"Ć","⋒":"⋒",ⅅ:"ⅅ",ℭ:"ℭ",Č:"Č",Ç:"Ç",Ĉ:"Ĉ","∰":"∰",Ċ:"Ċ","¸":"¸","·":"·",Χ:"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮",ℂ:"ℂ","∐":"∐","∳":"∳","⨯":"⨯",𝒞:"𝒞","⋓":"⋓","≍":"≍","⤑":"⤑",Ђ:"Ђ",Ѕ:"Ѕ",Џ:"Џ","‡":"‡","↡":"↡","⫤":"⫤",Ď:"Ď",Д:"Д","∇":"∇",Δ:"Δ",𝔇:"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄",ⅆ:"ⅆ",𝔻:"𝔻","¨":"¨","⃜":"⃜","≐":"≐","⇓":"⇓","⇐":"⇐","⇔":"⇔","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧",𝒟:"𝒟",Đ:"Đ",Ŋ:"Ŋ",Ð:"Ð",É:"É",Ě:"Ě",Ê:"Ê",Э:"Э",Ė:"Ė",𝔈:"𝔈",È:"È","∈":"∈",Ē:"Ē","◻":"◻","▫":"▫",Ę:"Ę",𝔼:"𝔼",Ε:"Ε","⩵":"⩵","≂":"≂","⇌":"⇌",ℰ:"ℰ","⩳":"⩳",Η:"Η",Ë:"Ë","∃":"∃",ⅇ:"ⅇ",Ф:"Ф",𝔉:"𝔉","◼":"◼","▪":"▪",𝔽:"𝔽","∀":"∀",ℱ:"ℱ",Ѓ:"Ѓ",">":">",Γ:"Γ",Ϝ:"Ϝ",Ğ:"Ğ",Ģ:"Ģ",Ĝ:"Ĝ",Г:"Г",Ġ:"Ġ",𝔊:"𝔊","⋙":"⋙",𝔾:"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳",𝒢:"𝒢","≫":"≫",Ъ:"Ъ",ˇ:"ˇ","^":"^",Ĥ:"Ĥ",ℌ:"ℌ",ℋ:"ℋ",ℍ:"ℍ","─":"─",Ħ:"Ħ","≏":"≏",Е:"Е",IJ:"IJ",Ё:"Ё",Í:"Í",Î:"Î",И:"И",İ:"İ",ℑ:"ℑ",Ì:"Ì",Ī:"Ī",ⅈ:"ⅈ","∬":"∬","∫":"∫","⋂":"⋂","⁣":"⁣","⁢":"⁢",Į:"Į",𝕀:"𝕀",Ι:"Ι",ℐ:"ℐ",Ĩ:"Ĩ",І:"І",Ï:"Ï",Ĵ:"Ĵ",Й:"Й",𝔍:"𝔍",𝕁:"𝕁",𝒥:"𝒥",Ј:"Ј",Є:"Є",Х:"Х",Ќ:"Ќ",Κ:"Κ",Ķ:"Ķ",К:"К",𝔎:"𝔎",𝕂:"𝕂",𝒦:"𝒦",Љ:"Љ","<":"<",Ĺ:"Ĺ",Λ:"Λ","⟪":"⟪",ℒ:"ℒ","↞":"↞",Ľ:"Ľ",Ļ:"Ļ",Л:"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲",𝔏:"𝔏","⋘":"⋘","⇚":"⇚",Ŀ:"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶",𝕃:"𝕃","↙":"↙","↘":"↘","↰":"↰",Ł:"Ł","≪":"≪","⤅":"⤅",М:"М"," ":" ",ℳ:"ℳ",𝔐:"𝔐","∓":"∓",𝕄:"𝕄",Μ:"Μ",Њ:"Њ",Ń:"Ń",Ň:"Ň",Ņ:"Ņ",Н:"Н","​":"​","\n":" ",𝔑:"𝔑","⁠":"⁠"," ":" ",ℕ:"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤",𝒩:"𝒩",Ñ:"Ñ",Ν:"Ν",Œ:"Œ",Ó:"Ó",Ô:"Ô",О:"О",Ő:"Ő",𝔒:"𝔒",Ò:"Ò",Ō:"Ō",Ω:"Ω",Ο:"Ο",𝕆:"𝕆","“":"“","‘":"‘","⩔":"⩔",𝒪:"𝒪",Ø:"Ø",Õ:"Õ","⨷":"⨷",Ö:"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂",П:"П",𝔓:"𝔓",Φ:"Φ",Π:"Π","±":"±",ℙ:"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∝":"∝",𝒫:"𝒫",Ψ:"Ψ",'"':""",𝔔:"𝔔",ℚ:"ℚ",𝒬:"𝒬","⤐":"⤐","®":"®",Ŕ:"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖",Ř:"Ř",Ŗ:"Ŗ",Р:"Р",ℜ:"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯",Ρ:"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓",ℝ:"ℝ","⥰":"⥰","⇛":"⇛",ℛ:"ℛ","↱":"↱","⧴":"⧴",Щ:"Щ",Ш:"Ш",Ь:"Ь",Ś:"Ś","⪼":"⪼",Š:"Š",Ş:"Ş",Ŝ:"Ŝ",С:"С",𝔖:"𝔖","↑":"↑",Σ:"Σ","∘":"∘",𝕊:"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔",𝒮:"𝒮","⋆":"⋆","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇",Þ:"Þ","™":"™",Ћ:"Ћ",Ц:"Ц","\t":" ",Τ:"Τ",Ť:"Ť",Ţ:"Ţ",Т:"Т",𝔗:"𝔗","∴":"∴",Θ:"Θ","  ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈",𝕋:"𝕋","⃛":"⃛",𝒯:"𝒯",Ŧ:"Ŧ",Ú:"Ú","↟":"↟","⥉":"⥉",Ў:"Ў",Ŭ:"Ŭ",Û:"Û",У:"У",Ű:"Ű",𝔘:"𝔘",Ù:"Ù",Ū:"Ū",_:"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎",Ų:"Ų",𝕌:"𝕌","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","↖":"↖","↗":"↗",ϒ:"ϒ",Υ:"Υ",Ů:"Ů",𝒰:"𝒰",Ũ:"Ũ",Ü:"Ü","⊫":"⊫","⫫":"⫫",В:"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ",𝔙:"𝔙",𝕍:"𝕍",𝒱:"𝒱","⊪":"⊪",Ŵ:"Ŵ","⋀":"⋀",𝔚:"𝔚",𝕎:"𝕎",𝒲:"𝒲",𝔛:"𝔛",Ξ:"Ξ",𝕏:"𝕏",𝒳:"𝒳",Я:"Я",Ї:"Ї",Ю:"Ю",Ý:"Ý",Ŷ:"Ŷ",Ы:"Ы",𝔜:"𝔜",𝕐:"𝕐",𝒴:"𝒴",Ÿ:"Ÿ",Ж:"Ж",Ź:"Ź",Ž:"Ž",З:"З",Ż:"Ż",Ζ:"Ζ",ℨ:"ℨ",ℤ:"ℤ",𝒵:"𝒵",á:"á",ă:"ă","∾":"∾","∾̳":"∾̳","∿":"∿",â:"â",а:"а",æ:"æ",𝔞:"𝔞",à:"à",ℵ:"ℵ",α:"α",ā:"ā","⨿":"⨿","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","⍼":"⍼",ą:"ą",𝕒:"𝕒","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'",å:"å",𝒶:"𝒶","*":"*",ã:"ã",ä:"ä","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⎶":"⎶",б:"б","„":"„","⦰":"⦰",β:"β",ℶ:"ℶ","≬":"≬",𝔟:"𝔟","◯":"◯","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⤍":"⤍","⧫":"⧫","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐",𝕓:"𝕓","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","¦":"¦",𝒷:"𝒷","⁏":"⁏","\\":"\","⧅":"⧅","⟈":"⟈","•":"•","⪮":"⪮",ć:"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","⩍":"⩍",č:"č",ç:"ç",ĉ:"ĉ","⩌":"⩌","⩐":"⩐",ċ:"ċ","⦲":"⦲","¢":"¢",𝔠:"𝔠",ч:"ч","✓":"✓",χ:"χ","○":"○","⧃":"⧃",ˆ:"ˆ","≗":"≗","↺":"↺","↻":"↻","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣",":":":",",":",","@":"@","∁":"∁","⩭":"⩭",𝕔:"𝕔","℗":"℗","↵":"↵","✗":"✗",𝒸:"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋎":"⋎","⋏":"⋏","¤":"¤","∱":"∱","⌭":"⌭","⥥":"⥥","†":"†",ℸ:"ℸ","‐":"‐","⤏":"⤏",ď:"ď",д:"д","⇊":"⇊","⩷":"⩷","°":"°",δ:"δ","⦱":"⦱","⥿":"⥿",𝔡:"𝔡","♦":"♦",ϝ:"ϝ","⋲":"⋲","÷":"÷","⋇":"⋇",ђ:"ђ","⌞":"⌞","⌍":"⌍",$:"$",𝕕:"𝕕","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌟":"⌟","⌌":"⌌",𝒹:"𝒹",ѕ:"ѕ","⧶":"⧶",đ:"đ","⋱":"⋱","▿":"▿","⦦":"⦦",џ:"џ","⟿":"⟿",é:"é","⩮":"⩮",ě:"ě","≖":"≖",ê:"ê","≕":"≕",э:"э",ė:"ė","≒":"≒",𝔢:"𝔢","⪚":"⪚",è:"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧",ℓ:"ℓ","⪕":"⪕","⪗":"⪗",ē:"ē","∅":"∅"," ":" "," ":" "," ":" ",ŋ:"ŋ"," ":" ",ę:"ę",𝕖:"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱",ε:"ε",ϵ:"ϵ","=":"=","≟":"≟","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱",ℯ:"ℯ",η:"η",ð:"ð",ë:"ë","€":"€","!":"!",ф:"ф","♀":"♀",ffi:"ffi",ff:"ff",ffl:"ffl",𝔣:"𝔣",fi:"fi",fj:"fj","♭":"♭",fl:"fl","▱":"▱",ƒ:"ƒ",𝕗:"𝕗","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","⅓":"⅓","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢",𝒻:"𝒻","⪌":"⪌",ǵ:"ǵ",γ:"γ","⪆":"⪆",ğ:"ğ",ĝ:"ĝ",г:"г",ġ:"ġ","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔",𝔤:"𝔤",ℷ:"ℷ",ѓ:"ѓ","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪈":"⪈","⋧":"⋧",𝕘:"𝕘",ℊ:"ℊ","⪎":"⪎","⪐":"⪐","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⥸":"⥸","≩︀":"≩︀",ъ:"ъ","⥈":"⥈","↭":"↭",ℏ:"ℏ",ĥ:"ĥ","♥":"♥","…":"…","⊹":"⊹",𝔥:"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪",𝕙:"𝕙","―":"―",𝒽:"𝒽",ħ:"ħ","⁃":"⁃",í:"í",î:"î",и:"и",е:"е","¡":"¡",𝔦:"𝔦",ì:"ì","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩",ij:"ij",ī:"ī",ı:"ı","⊷":"⊷",Ƶ:"Ƶ","℅":"℅","∞":"∞","⧝":"⧝","⊺":"⊺","⨗":"⨗","⨼":"⨼",ё:"ё",į:"į",𝕚:"𝕚",ι:"ι","¿":"¿",𝒾:"𝒾","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳",ĩ:"ĩ",і:"і",ï:"ï",ĵ:"ĵ",й:"й",𝔧:"𝔧",ȷ:"ȷ",𝕛:"𝕛",𝒿:"𝒿",ј:"ј",є:"є",κ:"κ",ϰ:"ϰ",ķ:"ķ",к:"к",𝔨:"𝔨",ĸ:"ĸ",х:"х",ќ:"ќ",𝕜:"𝕜",𝓀:"𝓀","⤛":"⤛","⤎":"⤎","⪋":"⪋","⥢":"⥢",ĺ:"ĺ","⦴":"⦴",λ:"λ","⦑":"⦑","⪅":"⪅","«":"«","⤟":"⤟","⤝":"⤝","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍",ľ:"ľ",ļ:"ļ",л:"л","⤶":"⤶","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","⇇":"⇇","⋋":"⋋","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⋖":"⋖","⥼":"⥼",𝔩:"𝔩","⪑":"⪑","⥪":"⥪","▄":"▄",љ:"љ","⥫":"⥫","◺":"◺",ŀ:"ŀ","⎰":"⎰","≨":"≨","⪉":"⪉","⪇":"⪇","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟼":"⟼","↬":"↬","⦅":"⦅",𝕝:"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","◊":"◊","(":"(","⦓":"⦓","⥭":"⥭","‎":"‎","⊿":"⊿","‹":"‹",𝓁:"𝓁","⪍":"⪍","⪏":"⪏","‚":"‚",ł:"ł","⪦":"⪦","⩹":"⩹","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","∺":"∺","¯":"¯","♂":"♂","✠":"✠","▮":"▮","⨩":"⨩",м:"м","—":"—",𝔪:"𝔪","℧":"℧",µ:"µ","⫰":"⫰","−":"−","⨪":"⨪","⫛":"⫛","⊧":"⊧",𝕞:"𝕞",𝓂:"𝓂",μ:"μ","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","⇏":"⇏","⊯":"⊯","⊮":"⊮",ń:"ń","∠⃒":"∠⃒","⩰̸":"⩰̸","≋̸":"≋̸",ʼn:"ʼn","♮":"♮","⩃":"⩃",ň:"ň",ņ:"ņ","⩭̸":"⩭̸","⩂":"⩂",н:"н","–":"–","⇗":"⇗","⤤":"⤤","≐̸":"≐̸","⤨":"⤨",𝔫:"𝔫","↮":"↮","⫲":"⫲","⋼":"⋼","⋺":"⋺",њ:"њ","≦̸":"≦̸","↚":"↚","‥":"‥",𝕟:"𝕟","¬":"¬","⋹̸":"⋹̸","⋵̸":"⋵̸","⋷":"⋷","⋶":"⋶","⋾":"⋾","⋽":"⋽","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸",𝓃:"𝓃","⊄":"⊄","⫅̸":"⫅̸","⊅":"⊅","⫆̸":"⫆̸",ñ:"ñ",ν:"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","⤧":"⤧",ó:"ó",ô:"ô",о:"о",ő:"ő","⨸":"⨸","⦼":"⦼",œ:"œ","⦿":"⦿",𝔬:"𝔬","˛":"˛",ò:"ò","⧁":"⧁","⦵":"⦵","⦾":"⦾","⦻":"⦻","⧀":"⧀",ō:"ō",ω:"ω",ο:"ο","⦶":"⦶",𝕠:"𝕠","⦷":"⦷","⦹":"⦹","∨":"∨","⩝":"⩝",ℴ:"ℴ",ª:"ª",º:"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛",ø:"ø","⊘":"⊘",õ:"õ","⨶":"⨶",ö:"ö","⌽":"⌽","¶":"¶","⫳":"⫳","⫽":"⫽",п:"п","%":"%",".":".","‰":"‰","‱":"‱",𝔭:"𝔭",φ:"φ",ϕ:"ϕ","☎":"☎",π:"π",ϖ:"ϖ",ℎ:"ℎ","+":"+","⨣":"⨣","⨢":"⨢","⨥":"⨥","⩲":"⩲","⨦":"⨦","⨧":"⨧","⨕":"⨕",𝕡:"𝕡","£":"£","⪳":"⪳","⪷":"⪷","⪹":"⪹","⪵":"⪵","⋨":"⋨","′":"′","⌮":"⌮","⌒":"⌒","⌓":"⌓","⊰":"⊰",𝓅:"𝓅",ψ:"ψ"," ":" ",𝔮:"𝔮",𝕢:"𝕢","⁗":"⁗",𝓆:"𝓆","⨖":"⨖","?":"?","⤜":"⤜","⥤":"⥤","∽̱":"∽̱",ŕ:"ŕ","⦳":"⦳","⦒":"⦒","⦥":"⦥","»":"»","⥵":"⥵","⤠":"⤠","⤳":"⤳","⤞":"⤞","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐",ř:"ř",ŗ:"ŗ",р:"р","⤷":"⤷","⥩":"⥩","↳":"↳","▭":"▭","⥽":"⥽",𝔯:"𝔯","⥬":"⥬",ρ:"ρ",ϱ:"ϱ","⇉":"⇉","⋌":"⋌","˚":"˚","‏":"‏","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⦆":"⦆",𝕣:"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","›":"›",𝓇:"𝓇","⋊":"⋊","▹":"▹","⧎":"⧎","⥨":"⥨","℞":"℞",ś:"ś","⪴":"⪴","⪸":"⪸",š:"š",ş:"ş",ŝ:"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓",с:"с","⋅":"⋅","⩦":"⩦","⇘":"⇘","§":"§",";":";","⤩":"⤩","✶":"✶",𝔰:"𝔰","♯":"♯",щ:"щ",ш:"ш","­":"­",σ:"σ",ς:"ς","⩪":"⩪","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","⨳":"⨳","⧤":"⧤","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀",ь:"ь","/":"/","⧄":"⧄","⌿":"⌿",𝕤:"𝕤","♠":"♠","⊓︀":"⊓︀","⊔︀":"⊔︀",𝓈:"𝓈","☆":"☆","⊂":"⊂","⫅":"⫅","⪽":"⪽","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⫇":"⫇","⫕":"⫕","⫓":"⫓","♪":"♪","¹":"¹","²":"²","³":"³","⫆":"⫆","⪾":"⪾","⫘":"⫘","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤪":"⤪",ß:"ß","⌖":"⌖",τ:"τ",ť:"ť",ţ:"ţ",т:"т","⌕":"⌕",𝔱:"𝔱",θ:"θ",ϑ:"ϑ",þ:"þ","×":"×","⨱":"⨱","⨰":"⨰","⌶":"⌶","⫱":"⫱",𝕥:"𝕥","⫚":"⫚","‴":"‴","▵":"▵","≜":"≜","◬":"◬","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢",𝓉:"𝓉",ц:"ц",ћ:"ћ",ŧ:"ŧ","⥣":"⥣",ú:"ú",ў:"ў",ŭ:"ŭ",û:"û",у:"у",ű:"ű","⥾":"⥾",𝔲:"𝔲",ù:"ù","▀":"▀","⌜":"⌜","⌏":"⌏","◸":"◸",ū:"ū",ų:"ų",𝕦:"𝕦",υ:"υ","⇈":"⇈","⌝":"⌝","⌎":"⌎",ů:"ů","◹":"◹",𝓊:"𝓊","⋰":"⋰",ũ:"ũ",ü:"ü","⦧":"⦧","⫨":"⫨","⫩":"⫩","⦜":"⦜","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀",в:"в","⊻":"⊻","≚":"≚","⋮":"⋮",𝔳:"𝔳",𝕧:"𝕧",𝓋:"𝓋","⦚":"⦚",ŵ:"ŵ","⩟":"⩟","≙":"≙",℘:"℘",𝔴:"𝔴",𝕨:"𝕨",𝓌:"𝓌",𝔵:"𝔵",ξ:"ξ","⋻":"⋻",𝕩:"𝕩",𝓍:"𝓍",ý:"ý",я:"я",ŷ:"ŷ",ы:"ы","¥":"¥",𝔶:"𝔶",ї:"ї",𝕪:"𝕪",𝓎:"𝓎",ю:"ю",ÿ:"ÿ",ź:"ź",ž:"ž",з:"з",ż:"ż",ζ:"ζ",𝔷:"𝔷",ж:"ж","⇝":"⇝",𝕫:"𝕫",𝓏:"𝓏","‍":"‍","‌":"‌"}}}},17588:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numericUnicodeMap={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},88744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromCodePoint=String.fromCodePoint||function(e){return String.fromCharCode(Math.floor((e-65536)/1024)+55296,(e-65536)%1024+56320)},t.getCodePoint=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536},t.highSurrogateFrom=55296,t.highSurrogateTo=56319},14736:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(92913),o=n(90022),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(),h=c(p);if(h){var f=(0,i.getPropertyInfo)(h);switch(r.includes(h)&&a.includes(t)&&!l&&(h=c("default"+p)),n[h]=d,f&&f.type){case i.BOOLEAN:n[h]=!0;break;case i.OVERLOADED_BOOLEAN:""===d&&(n[h]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n}},13564: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(30758),r=i(n(14736)),a=n(90022),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){void 0===n&&(n={});for(var i=[],o="function"==typeof n.replace,l=n.transform||a.returnFirstArg,u=n.library||s,d=u.cloneElement,p=u.createElement,h=u.isValidElement,f=t.length,m=0;m1&&(g=d(g,{key:g.key||m})),i.push(l(g,_,m));continue}}if("text"!==_.type){var E=_,v={};c(E)?((0,a.setStyleProp)(E.attribs.style,E.attribs),v=E.attribs):E.attribs&&(v=(0,r.default)(E.attribs,E.name));var y=void 0;switch(_.type){case"script":case"style":_.children[0]&&(v.dangerouslySetInnerHTML={__html:_.children[0].data});break;case"tag":"textarea"===_.name&&_.children[0]?v.defaultValue=_.children[0].data:_.children&&_.children.length&&(y=e(_.children,n));break;default:continue}f>1&&(v.key=m),i.push(l(p(_.name,v,y),_,m))}else{var b=!_.data.trim().length;if(b&&_.parent&&!(0,a.canTextBeChildOfNode)(_.parent))continue;if(n.trim&&b)continue;i.push(l(_.data,_,m))}}return 1===i.length?i[0]:i}},8498: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(35466));t.htmlToDOM=o.default;var r=i(n(14736));t.attributesToProps=r.default;var a=i(n(13564));t.domToReact=a.default;var s=n(42095);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):[]}},90022: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(30758),r=i(n(78783)),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}},6936: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 h={},f=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(_)>-1){var v=n.innerHTML;return v&&("style"!==_&&"script"!==_&&(v=v.replace(/"/g,""")),g.dangerouslySetInnerHTML={__html:v.trim()}),c(_,g,s)}var y=0===E.length?null:E;return c(_,g,s,y)}(e,String(o),n)})).filter(Boolean);return 1===a.length?a[0]:a}}(n(30758))},91771:(e,t,n)=>{"use strict";var i,o=n(76860)("http-errors"),r=n(74144),a=n(9216),s=n(56192),c=n(15237);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)},77947:(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,h=e[t+d];for(d+=p,r=h&(1<<-u)-1,h>>=-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*(h?-1:1);a+=Math.pow(2,i),r-=l}return(h?-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,h=i?0:r-1,f=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+h]=255&s,h+=f,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=f,a/=256,l-=8);e[n+h-f]|=128*m}},56192: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}}},70090: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 h(e){var t=e.match(n);t&&(d+=t.length);var i=e.lastIndexOf("\n");p=~i?e.length-i:p+e.length}function f(){var e={line:d,column:p};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=c.source}m.prototype.content=e;var _=[];function g(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;_.push(n)}function E(t){var n=t.exec(e);if(n){var i=n[0];return h(i),e=e.slice(i.length),n}}function v(){E(i)}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=f();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 g("End of comment missing");var i=e.slice(2,n-2);return p+=2,h(i),e=e.slice(n),p+=2,t({type:"comment",comment:i})}}function S(){var e=f(),n=E(o);if(n){if(b(),!E(r))return g("property missing ':'");var i=E(a),c=e({type:"declaration",property:u(n[0].replace(t,l)),value:i?u(i[0].replace(t,l)):l});return E(s),c}}return v(),function(){var e,t=[];for(y(t);e=S();)!1!==e&&(t.push(e),y(t));return t}()}},56175:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>Ce});var i,o,r,a=n(83422);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 h(e){return e.type===o.plural}function f(e){return e.type===o.pound}function m(e){return e.type===o.tag}function _(e){return!(!e||"object"!=typeof e||e.type!==r.number)}function g(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 E=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,v=/(?:[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 y(e){var t={};return e.replace(v,(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,T=/^(@+)?(\+|#+)?[rs]?$/g,A=/(\*)(0+)|(#+)(0+)|(0+)/g,I=/^(0+)$/;function O(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(T,(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 R(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)),!I.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function N(e){var t=C(e);return t||{}}function P(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(A,(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(I.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),O(r)))}else if(T.test(o.stem))t=(0,a.__assign)((0,a.__assign)({},t),O(o.stem));else{var s=C(o.stem);s&&(t=(0,a.__assign)((0,a.__assign)({},t),s));var c=R(o.stem);c&&(t=(0,a.__assign)((0,a.__assign)({},t),c))}}return t}var L,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 w(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 D=new RegExp("^".concat(E.source,"*")),M=new RegExp("".concat(E.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,W=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},j=!0;try{j="a"===(null===(L=Z("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===L?void 0:L[0])}catch(e){j=!1}var Y,z=U?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},K=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(D,"")},$=G?function(e){return e.trimEnd()}:function(e){return e.replace(M,"")};function Z(e,t){return new RegExp(e,t)}if(j){var Q=Z("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Y=function(e,t){var n;return Q.lastIndex=t,null!==(n=Q.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 K.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 K.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(),K(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 h=this.clonePosition();if((S=this.parseSimpleArgStyleIfPossible()).err)return S;if(0===(g=$(S.val)).length)return this.error(i.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));p={style:g,styleLocation:x(h,this.clonePosition())}}if((T=this.tryParseArgumentClose(s)).err)return T;var f=x(s,this.clonePosition());if(p&&z(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:f,style:S.val},err:null};if(0===m.length)return this.error(i.EXPECT_DATE_TIME_SKELETON,f);var _=m;this.locale&&(_=function(e,t){for(var n="",i=0;i>1),c=w(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 g={type:r.dateTime,pattern:_,location:p.styleLocation,parsedOptions:this.shouldParseSkeletons?y(_):{}};return{val:{type:"date"===u?o.date:o.time,value:n,location:f,style:g},err:null}}return{val:{type:"number"===u?o.number:"date"===u?o.date:o.time,value:n,location:f,style:null!==(c=null==p?void 0:p.style)&&void 0!==c?c:null},err:null};case"plural":case"selectordinal":case"select":var E=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(i.EXPECT_SELECT_ARGUMENT_OPTIONS,x(E,(0,a.__assign)({},E)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),b=0;if("select"!==u&&"offset"===v.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(),v=this.parseIdentifierIfPossible(),b=S.val}var T,A=this.tryParsePluralOrSelectOptions(e,u,t,v);if(A.err)return A;if((T=this.tryParseArgumentClose(s)).err)return T;var I=x(s,this.clonePosition());return"select"===u?{val:{type:o.select,value:n,options:J(A.val),location:I},err:null}:{val:{type:o.plural,value:n,options:J(A.val),offset:b,pluralType:"plural"===u?"cardinal":"ordinal",location:I},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?W(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(z(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)||h(e))for(var t in e.options)delete e.options[t].location,re(e.options[t].value);else l(e)&&_(e.style)||(u(e)||d(e))&&g(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 he(){this.cache=Object.create(null)}he.prototype.get=function(e){return this.cache[e]},he.prototype.set=function(e,t){this.cache[e]=t};var fe,me={create:function(){return new he}},_e={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"}(fe||(fe={}));var ge,Ee=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),ve=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('", "'),'"'),fe.INVALID_VALUE,o)||this}return(0,a.__extends)(t,e),t}(Ee),ye=function(e){function t(t,n,i){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),fe.INVALID_VALUE,i)||this}return(0,a.__extends)(t,e),t}(Ee),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,'"'),fe.MISSING_VALUE,n)||this}return(0,a.__extends)(t,e),t}(Ee);function Se(e){return"function"==typeof e}function Te(e,t,n,i,o,r,a){if(1===e.length&&s(e[0]))return[{type:ge.literal,value:e[0].value}];for(var E=[],v=0,y=e;v0?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=Oe},29597: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}}},48336: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))}},80686:function(e,t,n){var i=n(84686).hp;"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}=?)?$/,h=String.fromCharCode.bind(String),f="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?"-":"_"}))},_=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},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},E=r?function(e){return btoa(e)}:a?function(e){return i.from(e,"binary").toString("base64")}:g,v=a?function(e){return i.from(e).toString("base64")}:function(e){for(var t=4096,n=[],i=0,o=e.length;i>>6)+h(128|63&t):h(224|t>>>12&15)+h(128|t>>>6&63)+h(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return h(240|t>>>18&7)+h(128|t>>>12&63)+h(128|t>>>6&63)+h(128|63&t)},S=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,T=function(e){return e.replace(S,b)},A=a?function(e){return i.from(e,"utf8").toString("base64")}:c?function(e){return v(c.encode(e))}:function(e){return E(T(e))},I=function(e,t){return void 0===t&&(t=!1),t?m(A(e)):A(e)},O=function(e){return I(e,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=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 h(55296+(t>>>10))+h(56320+(1023&t));case 3:return h((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return h((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},N=function(e){return e.replace(C,R)},P=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?h(t>>16&255,t>>8&255):h(t>>16&255,t>>8&255,255&t);return o},L=o?function(e){return atob(_(e))}:a?function(e){return i.from(e,"base64").toString("binary")}:P,k=a?function(e){return f(i.from(e,"base64"))}:function(e){return f(L(e),(function(e){return e.charCodeAt(0)}))},w=function(e){return k(M(e))},D=a?function(e){return i.from(e,"base64").toString("utf8")}:s?function(e){return s.decode(k(e))}:function(e){return N(L(e))},M=function(e){return _(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},x=function(e){return D(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 I(this,e)})),e("toBase64URI",(function(){return I(this,!0)})),e("toBase64URL",(function(){return I(this,!0)})),e("toUint8Array",(function(){return w(this)}))},F=function(){var e=function(e,t){return Object.defineProperty(Uint8Array.prototype,e,U(t))};e("toBase64",(function(e){return y(this,e)})),e("toBase64URI",(function(){return y(this,!0)})),e("toBase64URL",(function(){return y(this,!0)}))},B=function(){V(),F()},H={version:t,VERSION:n,atob:L,atobPolyfill:P,btoa:E,btoaPolyfill:g,fromBase64:x,toBase64:I,encode:I,encodeURI:O,encodeURL:O,utob:T,btou:N,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:y,toUint8Array:w,extendString:V,extendUint8Array:F,extendBuiltins:B,Base64:{}};return Object.keys(H).forEach((function(e){return H.Base64[e]=H[e]})),H}()},55569:(e,t,n)=>{var i,o=n(68558);!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,h="0123456789abcdef".split(""),f=[128,32768,8388608,-2147483648],m=[0,8,16,24],_=["hex","array","digest","buffer","arrayBuffer","base64"],g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),E=[];if(p){var v=new ArrayBuffer(68);l=new Uint8Array(v),E=new Uint32Array(v)}var y=Array.isArray;!a.JS_MD5_NO_NODE_JS&&y||(y=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(!y(e)&&!b(e))throw new Error(t);return[e,!1]},T=function(e){return function(t){return new O(!0).update(t)[e]()}},A=function(e){var i,o=n(15644),r=n(28333).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)),y(n)||b(n)||n.constructor===r?o.createHash("md5").update(i(n)).digest("hex"):e(n)}},I=function(e){return function(t,n){return new C(t,!0).update(n)[e]()}};function O(e){if(e)E[0]=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,this.blocks=E,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 O(!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}O.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}O.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},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=f[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()}},O.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)},O.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return h[e>>>4&15]+h[15&e]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>28&15]+h[e>>>24&15]+h[t>>>4&15]+h[15&t]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>28&15]+h[t>>>24&15]+h[n>>>4&15]+h[15&n]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>28&15]+h[n>>>24&15]+h[i>>>4&15]+h[15&i]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>28&15]+h[i>>>24&15]},O.prototype.toString=O.prototype.hex,O.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]},O.prototype.array=O.prototype.digest,O.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},O.prototype.buffer=O.prototype.arrayBuffer,O.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+=g[e>>>2]+g[63&(e<<4|t>>>4)]+g[63&(t<<2|n>>>6)]+g[63&n];return e=o[r],i+=g[e>>>2]+g[e<<4&63]+"=="},C.prototype=new O,C.prototype.finalize=function(){if(O.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();O.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),O.prototype.finalize.call(this)}};var R=function(){var e=T("hex");c&&(e=A(e)),e.create=function(){return new O},e.update=function(t){return e.create().update(t)};for(var t=0;t<_.length;++t){var n=_[t];e[n]=T(n)}return e}();R.md5=R,R.md5.hmac=function(){var e=I("hex");e.create=function(e){return new C(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<_.length;++t){var n=_[t];e[n]=I(n)}return e}(),u?e.exports=R:(a.md5=R,d&&(void 0===(i=function(){return R}.call(R,n,R,e))||(e.exports=i)))}()},87252:e=>{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 g;if(e>=h)return S}else{if(e<=-f)return T;if(e+1>=f)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 _;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=_,a=0;a>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},A.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}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},A.isOdd=function(){return 1==(1&this.low)},A.isEven=function(){return 0==(1&this.low)},A.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)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.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},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(E)},A.neg=A.negate,A.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,h=0,f=0;return h+=(f+=r+(65535&e.low))>>>16,p+=(h+=o+l)>>>16,u+=(p+=n+s)>>>16,u+=t+a,c((h&=65535)<<16|(f&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},A.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return _;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 _;if(this.eq(T))return e.isOdd()?T:_;if(e.eq(T))return this.isOdd()?T:_;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,h=65535&e.low,f=0,g=0,E=0,v=0;return E+=(v+=a*h)>>>16,g+=(E+=r*h)>>>16,E&=65535,g+=(E+=a*p)>>>16,f+=(g+=o*h)>>>16,g&=65535,f+=(g+=r*p)>>>16,g&=65535,f+=(g+=a*u)>>>16,f+=n*h+o*p+r*u+a*l,c((E&=65535)<<16|(v&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},A.mul=A.multiply,A.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 g;if(e.gt(this.shru(1)))return v;r=g}else{if(this.eq(T))return e.eq(E)||e.eq(y)?T:e.eq(T)?E:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?E:y:(o=this.sub(e.mul(n)),r=n.add(o.div(e)));if(e.eq(T))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=_}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),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=s(n-=u,this.unsigned)).mul(e);p.isZero()&&(p=E),r=r.add(p),o=o.sub(h)}return r},A.div=A.divide,A.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))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return c(~this.low,~this.high,this.unsigned)},A.and=function(e){return i(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return i(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return i(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},A.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)},A.shr=A.shiftRight,A.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)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.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]},A.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)}},3899:()=>{},5460:()=>{},95104:()=>{},81465:()=>{},73075:(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();v.prototype.bind=function(e,t,n){var i=this;return e=e instanceof Array?e:[e],i._bindMultiple.call(i,e,t,n),i},v.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},v.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},v.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},v.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(E(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},v.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},v.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);s=null},v.init=function(){var e=v(r);for(var t in e)"_"!==t.charAt(0)&&(v[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},v.init(),o.Mousetrap=v,e.exports&&(e.exports=v),void 0===(i=function(){return v}.call(t,n,t,e))||(e.exports=i)}function h(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function f(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 _(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 g(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=g(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{"use strict";n.d(t,{n:()=>Ge,eB:()=>x,mk:()=>Le,M8:()=>Pe,dh:()=>We});var i=n(30758),o=n(8143);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},h={},f=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+f(e[n]);return t}return e},m=(e,t,n,i,o)=>{let r=f(e),a=h[r]||(h[r]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(r));if(!h[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);h[a]=p(o?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&h.g?h.g:null;return n&&(h.g=h[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)})(h[a],t,i,s),a},_=(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 g(e){let t=this||{},n=e.call?e(t.p):e;return m(n.unshift?n.raw?_(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)}g.bind({g:1}),g.bind({k:1});function E(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var A=function(){return""},I=i.createContext({enqueueSnackbar:A,closeSnackbar:A}),O="@media (max-width:599.95px)",C="@media (min-width:600px)",R=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},N=function(e){return""+R(e.vertical)+R(e.horizontal)},P=function(e){return!!e||0===e},L="unmounted",k="exited",w="entering",D="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=w):i=D:i=t.unmountOnExit||t.mountOnEnter?L:k,n.state={status:i},n.nextCallback=null,n}b(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===L?{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!==w&&n!==D&&(t=w):n!==w&&n!==D||(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===w?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===k&&this.setState({status:L})},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:w},(function(){t.props.onEntering&&t.props.onEntering(t.node,i),t.onTransitionEnd(o.enter,(function(){t.safeSetState({status:D},(function(){t.props.onEntered&&t.props.onEntered(t.node,i)}))}))}))):this.safeSetState({status:D},(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===L)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"]))},v(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)",W="cubic-bezier(0.4, 0, 0.6, 1)",j=function(e){e.scrollTop=e.scrollTop},Y=function(e){return Math.round(e)+"ms"};function z(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 K(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=K(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,h=e.onExited,f=S(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),m=(0,i.useRef)(null),_=F(n.ref,m),g=F(_,t),E=(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(y({},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?y({},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?y({},e):(t=!0,e.entered?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),y({},e,{open:!1})):y({},e,{requestClose:!0}))}));return y({},e,{snacks:o})},n.handleEnteredSnack=function(e,t,i){if(!P(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?y({},e,{entered:!0}):y({},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?y({},e,{open:!1}):y({},e,{requestClose:!0}):y({},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}));P(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!P(t))throw new Error("handleExitedSnack Cannot be called with undefined key");n.setState((function(e){var i=n.processQueue(y({},e,{snacks:e.snacks.filter((function(e){return e.id!==t}))}));return 0===i.queue.length?i:n.handleDismissOldest(i)}))},Pe=n.enqueueSnackbar,Le=n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(T(n)),closeSnackbar:n.closeSnackbar.bind(T(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=N(t.anchorOrigin),o=e[i]||[];return y({},e,((n={})[i]=[].concat(o,[t]),n))}),{}),h=Object.keys(p).map((function(t){var n=p[t],o=n[0];return i.createElement(Be,{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(I.Provider,{value:t},a,r?(0,o.createPortal)(h,r):h)},v(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||te.maxSnack}}]),t}(i.Component),We=function(){return(0,i.useContext)(I)}},68558: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(62985);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}},2736:(e,t,n)=>{e.exports=n(16186)()},62985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},24848:(e,t,n)=>{"use strict";e.exports=n(15948)},15948:(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(12387),i.BufferWriter=n(97292),i.Reader=n(3619),i.BufferReader=n(80108),i.util=n(26736),i.rpc=n(67481),i.roots=n(33603),i.configure=o,o()},3619:(e,t,n)=>{"use strict";e.exports=c;var i,o=n(26736),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 h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new r(h(this.buf,this.pos+=4),h(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 h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(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 f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},80108:(e,t,n)=>{"use strict";e.exports=r;var i=n(3619);(r.prototype=Object.create(i.prototype)).constructor=r;var o=n(26736);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()},33603:e=>{"use strict";e.exports={}},67481:(e,t,n)=>{"use strict";t.Service=n(59889)},59889:(e,t,n)=>{"use strict";e.exports=o;var i=n(26736);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}},29433:(e,t,n)=>{"use strict";e.exports=o;var i=n(26736);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}},26736: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(26736),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 h(e,t,n){t[n]=255&e}function f(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 _(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},f.prototype=Object.create(c.prototype),f.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 f((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(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=r.from(e);return this._push(_,4,t.lo)._push(_,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 g=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(h,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(g,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,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()}},97292:(e,t,n)=>{"use strict";e.exports=r;var i=n(12387);(r.prototype=Object.create(i.prototype)).constructor=r;var o=n(26736);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()},2477:(e,t,n)=>{"use strict";t.Ay=void 0;var i,o=(i=n(39590))&&i.__esModule?i:{default:i};var r,a,s,c,l,u,d,p,h,f=(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 h=s.value;if("childList"===h.type&&h.addedNodes.length>0)c.disconnect(),h.addedNodes.forEach(d),c.observe(document.body,l);else if("characterData"===h.type){var f=h.target.nodeValue,m=!!h.target.parentElement&&r.blacklistedNodeNames.includes(h.target.parentElement.nodeName);u(f)&&!m&&(c.disconnect(),h.target.nodeValue=(0,o.default)(f,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;h()?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(){h()?(c&&c.disconnect(),s=!1):console.error("pseudo-localization is already disabled")},isEnabled:h=function(){return s},localize:o.default});t.Ay=f},39590:(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},35616:(e,t,n)=>{var i=n(68002);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},85543:e=>{e.exports={L:1,M:0,Q:3,H:2}},89363:(e,t,n)=>{var i=n(86023);function o(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n{var i=n(35616),o=n(3249),r=n(97304),a=n(19049),s=n(89363);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?f.get(m):0}}var _=0;for(p=0;p{var i=n(85543);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}},19049:(e,t,n)=>{var i=n(68002),o=n(89363),r=n(86023),a=0,s=1,c=2,l=3,u=4,d=5,p=6,h=7,f={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;f.getBCHDigit(t)-f.getBCHDigit(f.G15)>=0;)t^=f.G15<=0;)t^=f.G18<>>=1;return t},getPatternPosition:function(e){return f.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 h: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,{hv:()=>zt});var i=n(86070),o=n(30758),r=n(67017),a=n(71682);Math.pow(10,8);const s=6048e5,c=864e5;var l=n(10849),u=n(72849);function d(e){const t=(0,u.a)(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 p(e,t){const n=(0,l.o)(e),i=(0,l.o)(t),o=+n-d(n),r=+i-d(i);return Math.round((o-r)/c)}function h(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function f(e){const t=(0,u.a)(e),n=h(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function m(e){const t=(0,u.a)(e);return p(t,f(t))+1}var _=n(70001);function g(e){return(0,_.k)(e,{weekStartsOn:1})}function E(e){const t=(0,u.a)(e),n=t.getFullYear(),i=h(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=g(i),r=h(e,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const a=g(r);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function v(e){const t=E(e),n=h(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),g(n)}function y(e){const t=(0,u.a)(e),n=+g(t)-+v(t);return Math.round(n/s)+1}function b(e,t){const n=(0,u.a)(e),i=n.getFullYear(),o=(0,a.q)(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=h(e,0);s.setFullYear(i+1,0,r),s.setHours(0,0,0,0);const c=(0,_.k)(s,t),l=h(e,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const d=(0,_.k)(l,t);return n.getTime()>=c.getTime()?i+1:n.getTime()>=d.getTime()?i:i-1}function S(e,t){const n=(0,a.q)(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=b(e,t),r=h(e,0);r.setFullYear(o,0,i),r.setHours(0,0,0,0);return(0,_.k)(r,t)}function T(e,t){const n=(0,u.a)(e),i=+(0,_.k)(n,t)-+S(n,t);return Math.round(i/s)+1}var A=n(79357);const I={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return(0,A.F)("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):(0,A.F)(n+1,2)},d:(e,t)=>(0,A.F)(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,A.F)(e.getHours()%12||12,t.length),H:(e,t)=>(0,A.F)(e.getHours(),t.length),m:(e,t)=>(0,A.F)(e.getMinutes(),t.length),s:(e,t)=>(0,A.F)(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,A.F)(o,t.length)}},O="midnight",C="noon",R="morning",N="afternoon",P="evening",L="night",k={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 I.y(e,t)},Y:function(e,t,n,i){const o=b(e,i),r=o>0?o:1-o;if("YY"===t){const e=r%100;return(0,A.F)(e,2)}return"Yo"===t?n.ordinalNumber(r,{unit:"year"}):(0,A.F)(r,t.length)},R:function(e,t){const n=E(e);return(0,A.F)(n,t.length)},u:function(e,t){const n=e.getFullYear();return(0,A.F)(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,A.F)(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,A.F)(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 I.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,A.F)(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=T(e,i);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):(0,A.F)(o,t.length)},I:function(e,t,n){const i=y(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):(0,A.F)(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):I.d(e,t)},D:function(e,t,n){const i=m(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):(0,A.F)(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,A.F)(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,A.F)(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,A.F)(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?C:0===i?O: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?P:i>=12?N:i>=4?R:L,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 I.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):I.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):(0,A.F)(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,A.F)(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):I.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):I.s(e,t)},S:function(e,t){return I.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return D(i);case"XXXX":case"XX":return M(i);default:return M(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return D(i);case"xxxx":case"xx":return M(i);default:return M(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+w(i,":");default:return"GMT"+M(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+w(i,":");default:return"GMT"+M(i,":")}},t:function(e,t,n){const i=Math.trunc(e.getTime()/1e3);return(0,A.F)(i,t.length)},T:function(e,t,n){const i=e.getTime();return(0,A.F)(i,t.length)}};function w(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,A.F)(r,2)}function D(e,t){if(e%60==0){return(e>0?"-":"+")+(0,A.F)(Math.abs(e)/60,2)}return M(e,t)}function M(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+(0,A.F)(Math.trunc(i/60),2)+t+(0,A.F)(i%60,2)}const x=(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"})}},U=(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"})}},V={p:U,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return x(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}}",x(i,t)).replace("{{time}}",U(o,t))}},F=/^D+$/,B=/^Y+$/,H=["D","DD","YY","YYYY"];function G(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function W(e){if(!G(e)&&"number"!=typeof e)return!1;const t=(0,u.a)(e);return!isNaN(Number(t))}const j=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,z=/^'([^]*?)'?$/,K=/''/g,J=/[a-zA-Z]/;function q(e,t,n){const i=(0,a.q)(),o=n?.locale??i.locale??r.c,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=(0,u.a)(e);if(!W(l))throw new RangeError("Invalid time value");let d=t.match(Y).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,V[t])(e,o.formatLong)}return e})).join("").match(j).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:X(e)};if(k[t])return{isToken:!0,value:e};if(t.match(J))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(d=o.localize.preprocessor(l,d));const p={firstWeekContainsDate:s,weekStartsOn:c,locale:o};return d.map((i=>{if(!i.isToken)return i.value;const r=i.value;(!n?.useAdditionalWeekYearTokens&&function(e){return B.test(e)}(r)||!n?.useAdditionalDayOfYearTokens&&function(e){return F.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),H.includes(e))throw new RangeError(i)}(r,t,String(e));return(0,k[r[0]])(l,r,o.localize,p)})).join("")}function X(e){const t=e.match(z);return t?t[1].replace(K,"'"):e}function $(e){const t=(0,u.a)(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Z(e){const t=(0,u.a)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Q(e,t){const n=(0,u.a)(e),i=(0,u.a)(t);return n.getFullYear()===i.getFullYear()}function ee(e){const t=(0,u.a)(e),n=t.getFullYear(),i=t.getMonth(),o=h(e,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function te(e,t){const n=(0,u.a)(e),i=n.getFullYear(),o=n.getDate(),r=h(e,0);r.setFullYear(i,t,15),r.setHours(0,0,0,0);const a=ee(r);return n.setMonth(t,Math.min(o,a)),n}function ne(e,t){const n=(0,u.a)(e);return isNaN(+n)?h(e,NaN):(n.setFullYear(t),n)}function ie(e,t){const n=(0,u.a)(e),i=(0,u.a)(t);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}function oe(e,t){const n=(0,u.a)(e);if(isNaN(t))return h(e,NaN);if(!t)return n;const i=n.getDate(),o=h(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return i>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function re(e,t){const n=(0,u.a)(e),i=(0,u.a)(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}function ae(e,t){return+(0,u.a)(e)<+(0,u.a)(t)}function se(e,t){const n=(0,u.a)(e);return isNaN(t)?h(e,NaN):t?(n.setDate(n.getDate()+t),n):n}var ce=n(12058);function le(e,t){const n=(0,u.a)(e),i=(0,u.a)(t);return n.getTime()>i.getTime()}function ue(e,t){return se(e,-t)}function de(e,t){return se(e,7*t)}function pe(e,t){return oe(e,12*t)}function he(e,t){const n=(0,a.q)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=(0,u.a)(e),r=o.getDay(),s=6+(r{const n=(0,u.a)(e);(!t||t>n||isNaN(+n))&&(t=n)})),t||new Date(NaN)}function ge(e){return Math.trunc(+(0,u.a)(e)/1e3)}function Ee(e,t,n){const i=(0,_.k)(e,n),o=(0,_.k)(t,n),r=+i-d(i),a=+o-d(o);return Math.round((r-a)/s)}function ve(e){const t=(0,u.a)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function ye(e,t){return Ee(ve(e),$(e),t)+1}var be=function(){return be=Object.assign||function(e){for(var t,n=1,i=arguments.length;n1&&(l||!u),p=t>1&&(u||!l);return(0,i.jsx)(ze,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:p,nextMonth:r,previousMonth:o,onPreviousClick:function(){o&&a(o)},onNextClick:function(){r&&a(r)}})}function Je(e){var t,n,o=ke(),r=o.classNames,a=o.disableNavigation,s=o.styles,c=o.captionLayout,l=o.components,u=null!==(t=null==l?void 0:l.CaptionLabel)&&void 0!==t?t:we;return n=a?(0,i.jsx)(u,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===c?(0,i.jsx)(Ge,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ge,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),(0,i.jsx)(Ke,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,i.jsx)(Ke,{displayMonth:e.displayMonth,id:e.id})]}),(0,i.jsx)("div",{className:r.caption,style:s.caption,children:n})}function qe(e){var t=ke(),n=t.footer,o=t.styles,r=t.classNames.tfoot;return n?(0,i.jsx)("tfoot",{className:r,style:o.tfoot,children:(0,i.jsx)("tr",{children:(0,i.jsx)("td",{colSpan:8,children:n})})}):(0,i.jsx)(i.Fragment,{})}function Xe(){var e=ke(),t=e.classNames,n=e.styles,o=e.showWeekNumber,r=e.locale,a=e.weekStartsOn,s=e.ISOWeek,c=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,u=function(e,t,n){for(var i=n?g(new Date):(0,_.k)(new Date,{locale:e,weekStartsOn:t}),o=[],r=0;r<7;r++){var a=se(i,r);o.push(a)}return o}(r,a,s);return(0,i.jsxs)("tr",{style:n.head_row,className:t.head_row,children:[o&&(0,i.jsx)("td",{style:n.head_cell,className:t.head_cell}),u.map((function(e,o){return(0,i.jsx)("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(e,{locale:r}),children:c(e,{locale:r})},o)}))]})}function $e(){var e,t=ke(),n=t.classNames,o=t.styles,r=t.components,a=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:Xe;return(0,i.jsx)("thead",{style:o.head,className:n.head,children:(0,i.jsx)(a,{})})}function Ze(e){var t=ke(),n=t.locale,o=t.formatters.formatDay;return(0,i.jsx)(i.Fragment,{children:o(e.date,{locale:n})})}var Qe=(0,o.createContext)(void 0);function et(e){if(!Te(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return(0,i.jsx)(Qe.Provider,{value:t,children:e.children})}return(0,i.jsx)(tt,{initialProps:e.initialProps,children:e.children})}function tt(e){var t=e.initialProps,n=e.children,o=t.selected,r=t.min,a=t.max,s={disabled:[]};o&&s.disabled.push((function(e){var t=a&&o.length>a-1,n=o.some((function(t){return(0,ce.r)(t,e)}));return Boolean(t&&!n)}));var c={selected:o,onDayClick:function(e,n,i){var s,c;if((null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,i),!Boolean(n.selected&&r&&(null==o?void 0:o.length)===r))&&!Boolean(!n.selected&&a&&(null==o?void 0:o.length)===a)){var l=o?Se([],o,!0):[];if(n.selected){var u=l.findIndex((function(t){return(0,ce.r)(e,t)}));l.splice(u,1)}else l.push(e);null===(c=t.onSelect)||void 0===c||c.call(t,l,e,n,i)}},modifiers:s};return(0,i.jsx)(Qe.Provider,{value:c,children:n})}function nt(){var e=(0,o.useContext)(Qe);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var it,ot=(0,o.createContext)(void 0);function rt(e){if(!Ae(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return(0,i.jsx)(ot.Provider,{value:t,children:e.children})}return(0,i.jsx)(at,{initialProps:e.initialProps,children:e.children})}function at(e){var t=e.initialProps,n=e.children,o=t.selected,r=o||{},a=r.from,s=r.to,c=t.min,l=t.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(u.range_start=[a],s?(u.range_end=[s],(0,ce.r)(a,s)||(u.range_middle=[{after:a,before:s}])):u.range_end=[a]):s&&(u.range_start=[s],u.range_end=[s]),c&&(a&&!s&&u.disabled.push({after:ue(a,c-1),before:se(a,c-1)}),a&&s&&u.disabled.push({after:a,before:se(a,c-1)}),!a&&s&&u.disabled.push({after:ue(s,c-1),before:se(s,c-1)})),l){if(a&&!s&&(u.disabled.push({before:se(a,1-l)}),u.disabled.push({after:se(a,l-1)})),a&&s){var d=l-(p(s,a)+1);u.disabled.push({before:ue(a,d)}),u.disabled.push({after:se(s,d)})}!a&&s&&(u.disabled.push({before:se(s,1-l)}),u.disabled.push({after:se(s,l-1)}))}return(0,i.jsx)(ot.Provider,{value:{selected:o,onDayClick:function(e,n,i){var r,a;null===(r=t.onDayClick)||void 0===r||r.call(t,e,n,i);var s=function(e,t){var n=t||{},i=n.from,o=n.to;if(i&&o){if((0,ce.r)(o,e)&&(0,ce.r)(i,e))return;if((0,ce.r)(o,e))return{from:o,to:void 0};if((0,ce.r)(i,e))return;return le(i,e)?{from:e,to:o}:{from:i,to:e}}return o?le(e,o)?{from:o,to:e}:{from:e,to:o}:i?ae(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0}}(e,o);null===(a=t.onSelect)||void 0===a||a.call(t,s,e,n,i)},modifiers:u},children:n})}function st(){var e=(0,o.useContext)(ot);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ct(e){return Array.isArray(e)?Se([],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"}(it||(it={}));var lt=it.Selected,ut=it.Disabled,dt=it.Hidden,pt=it.Today,ht=it.RangeEnd,ft=it.RangeMiddle,mt=it.RangeStart,_t=it.Outside;var gt=(0,o.createContext)(void 0);function Et(e){var t=ke(),n=function(e,t,n){var i,o=((i={})[lt]=ct(e.selected),i[ut]=ct(e.disabled),i[dt]=ct(e.hidden),i[pt]=[e.today],i[ht]=[],i[ft]=[],i[mt]=[],i[_t]=[],i);return e.fromDate&&o[ut].push({before:e.fromDate}),e.toDate&&o[ut].push({after:e.toDate}),Te(e)?o[ut]=o[ut].concat(t.modifiers[ut]):Ae(e)&&(o[ut]=o[ut].concat(n.modifiers[ut]),o[mt]=n.modifiers[mt],o[ft]=n.modifiers[ft],o[ht]=n.modifiers[ht]),o}(t,nt(),st()),o=function(e){var t={};return Object.entries(e).forEach((function(e){var n=e[0],i=e[1];t[n]=ct(i)})),t}(t.modifiers),r=be(be({},n),o);return(0,i.jsx)(gt.Provider,{value:r,children:e.children})}function vt(){var e=(0,o.useContext)(gt);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function yt(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(G(t))return(0,ce.r)(e,t);if(function(e){return Array.isArray(e)&&e.every(G)}(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?(p(o,i)<0&&(i=(n=[o,i])[0],o=n[1]),p(e,i)>=0&&p(o,e)>=0):o?(0,ce.r)(o,e):!!i&&(0,ce.r)(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=p(t.before,e)>0,i=p(t.after,e)<0;return le(t.before,t.after)?i&&n:n||i}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?p(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?p(t.before,e)>0:"function"==typeof t&&t(e)}))}function bt(e,t,n){var i=Object.keys(t).reduce((function(n,i){var o=t[i];return yt(e,o)&&n.push(i),n}),[]),o={};return i.forEach((function(e){return o[e]=!0})),n&&!re(e,n)&&(o.outside=!0),o}var St=365;function Tt(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:se,week:de,month:oe,year:pe,startOfWeek:function(e){return o.ISOWeek?g(e):(0,_.k)(e,{locale:d,weekStartsOn:c})},endOfWeek:function(e){return o.ISOWeek?fe(e):he(e,{locale:d,weekStartsOn:c})}}[n](e,"after"===i?1:-1);"before"===i&&l?p=me([l,p]):"after"===i&&u&&(p=_e([u,p]));var h=!0;if(r){var f=bt(p,r);h=!f.disabled&&!f.hidden}return h?p:s.count>St?s.lastFocused:Tt(p,{moveBy:n,direction:i,context:o,modifiers:r,retry:be(be({},s),{count:s.count+1})})}var At=(0,o.createContext)(void 0);function It(e){var t=He(),n=vt(),r=(0,o.useState)(),a=r[0],s=r[1],c=(0,o.useState)(),l=c[0],u=c[1],d=function(e,t){for(var n,i,o=$(e[0]),r=Z(e[e.length-1]),a=o;a<=r;){var s=bt(a,t);if(s.disabled||s.hidden)a=se(a,1);else{if(s.selected)return a;s.today&&!i&&(i=a),n||(n=a),a=se(a,1)}}return i||n}(t.displayMonths,n),p=(null!=a?a:l&&t.isDateDisplayed(l))?l:d,h=function(e){s(e)},f=ke(),m=function(e,i){if(a){var o=Tt(a,{moveBy:e,direction:i,context:f,modifiers:n});(0,ce.r)(a,o)||(t.goToDate(o,a),h(o))}},_={focusedDay:a,focusTarget:p,blur:function(){u(a),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return(0,i.jsx)(At.Provider,{value:_,children:e.children})}function Ot(){var e=(0,o.useContext)(At);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var Ct=(0,o.createContext)(void 0);function Rt(e){if(!Ie(e.initialProps)){var t={selected:void 0};return(0,i.jsx)(Ct.Provider,{value:t,children:e.children})}return(0,i.jsx)(Nt,{initialProps:e.initialProps,children:e.children})}function Nt(e){var t=e.initialProps,n=e.children,o={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(0,i.jsx)(Ct.Provider,{value:o,children:n})}function Pt(){var e=(0,o.useContext)(Ct);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Lt(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(it).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function kt(e,t,n){var r,a,s,c=ke(),l=Ot(),u=function(e,t){return bt(e,vt(),t)}(e,t),d=function(e,t){var n=ke(),i=Pt(),o=nt(),r=st(),a=Ot(),s=a.focusDayAfter,c=a.focusDayBefore,l=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,p=a.focus,h=a.focusMonthBefore,f=a.focusMonthAfter,m=a.focusYearBefore,_=a.focusYearAfter,g=a.focusStartOfWeek,E=a.focusEndOfWeek,v={onClick:function(a){var s,c,l,u;Ie(n)?null===(s=i.onDayClick)||void 0===s||s.call(i,e,t,a):Te(n)?null===(c=o.onDayClick)||void 0===c||c.call(o,e,t,a):Ae(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():h();break;case"PageDown":i.preventDefault(),i.stopPropagation(),i.shiftKey?_():f();break;case"Home":i.preventDefault(),i.stopPropagation(),g();break;case"End":i.preventDefault(),i.stopPropagation(),E()}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 v}(e,u),p=function(){var e=ke(),t=Pt(),n=nt(),i=st();return Ie(e)?t.selected:Te(e)?n.selected:Ae(e)?i.selected:void 0}(),h=Boolean(c.onDayClick||"default"!==c.mode);(0,o.useEffect)((function(){var t;u.outside||l.focusedDay&&h&&(0,ce.r)(l.focusedDay,e)&&(null===(t=n.current)||void 0===t||t.focus())}),[l.focusedDay,e,n,h,u.outside]);var f=Lt(c,u).join(" "),m=function(e,t){var n=be({},e.styles.day);return Object.keys(t).forEach((function(t){var i;n=be(be({},n),null===(i=e.modifiersStyles)||void 0===i?void 0:i[t])})),n}(c,u),_=Boolean(u.outside&&!c.showOutsideDays||u.hidden),g=null!==(s=null===(a=c.components)||void 0===a?void 0:a.DayContent)&&void 0!==s?s:Ze,E={style:m,className:f,children:(0,i.jsx)(g,{date:e,displayMonth:t,activeModifiers:u}),role:"gridcell"},v=l.focusTarget&&(0,ce.r)(l.focusTarget,e)&&!u.outside,y=l.focusedDay&&(0,ce.r)(l.focusedDay,e),b=be(be(be({},E),((r={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,r.tabIndex=y||v?0:-1,r)),d);return{isButton:h,isHidden:_,activeModifiers:u,selectedDays:p,buttonProps:b,divProps:E}}function wt(e){var t=(0,o.useRef)(null),n=kt(e.date,e.displayMonth,t);return n.isHidden?(0,i.jsx)("div",{role:"gridcell"}):n.isButton?(0,i.jsx)(Ye,be({name:"day",ref:t},n.buttonProps)):(0,i.jsx)("div",be({},n.divProps))}function Dt(e){var t=e.number,n=e.dates,o=ke(),r=o.onWeekNumberClick,a=o.styles,s=o.classNames,c=o.locale,l=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(t),{locale:c});if(!r)return(0,i.jsx)("span",{className:s.weeknumber,style:a.weeknumber,children:u});var d=l(Number(t),{locale:c});return(0,i.jsx)(Ye,{name:"week-number","aria-label":d,className:s.weeknumber,style:a.weeknumber,onClick:function(e){r(t,n,e)},children:u})}function Mt(e){var t,n,o,r=ke(),a=r.styles,s=r.classNames,c=r.showWeekNumber,l=r.components,u=null!==(t=null==l?void 0:l.Day)&&void 0!==t?t:wt,d=null!==(n=null==l?void 0:l.WeekNumber)&&void 0!==n?n:Dt;return c&&(o=(0,i.jsx)("td",{className:s.cell,style:a.cell,children:(0,i.jsx)(d,{number:e.weekNumber,dates:e.dates})})),(0,i.jsxs)("tr",{className:s.row,style:a.row,children:[o,e.dates.map((function(t){return(0,i.jsx)("td",{className:s.cell,style:a.cell,role:"presentation",children:(0,i.jsx)(u,{displayMonth:e.displayMonth,date:t})},ge(t))}))]})}function xt(e,t,n){for(var i=(null==n?void 0:n.ISOWeek)?fe(t):he(t,n),o=(null==n?void 0:n.ISOWeek)?g(e):(0,_.k)(e,n),r=p(i,o),a=[],s=0;s<=r;s++)a.push(se(o,s));return a.reduce((function(e,t){var i=(null==n?void 0:n.ISOWeek)?y(t):T(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 Ut(e){var t,n,o,r=ke(),a=r.locale,s=r.classNames,c=r.styles,l=r.hideHead,u=r.fixedWeeks,d=r.components,p=r.weekStartsOn,h=r.firstWeekContainsDate,f=r.ISOWeek,m=function(e,t){var n=xt($(e),Z(e),t);if(null==t?void 0:t.useFixedWeeks){var i=ye(e,t);if(i<6){var o=n[n.length-1],r=o.dates[o.dates.length-1],a=de(r,6-i),s=xt(de(r,1),a,t);n.push.apply(n,s)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(u),ISOWeek:f,locale:a,weekStartsOn:p,firstWeekContainsDate:h}),_=null!==(t=null==d?void 0:d.Head)&&void 0!==t?t:$e,g=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:Mt,E=null!==(o=null==d?void 0:d.Footer)&&void 0!==o?o:qe;return(0,i.jsxs)("table",{id:e.id,className:s.table,style:c.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&(0,i.jsx)(_,{}),(0,i.jsx)("tbody",{className:s.tbody,style:c.tbody,children:m.map((function(t){return(0,i.jsx)(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)}))}),(0,i.jsx)(E,{displayMonth:e.displayMonth})]})}var Vt="undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,Ft=!1,Bt=0;function Ht(){return"react-day-picker-".concat(++Bt)}function Gt(e){var t,n,r=ke(),a=r.dir,s=r.classNames,c=r.styles,l=r.components,u=He().displayMonths,d=function(e){var t,n=null!=e?e:Ft?Ht():null,i=(0,o.useState)(n),r=i[0],a=i[1];return Vt((function(){null===r&&a(Ht())}),[]),(0,o.useEffect)((function(){!1===Ft&&(Ft=!0)}),[]),null!==(t=null!=e?e:r)&&void 0!==t?t:void 0}(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),p=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,h=[s.month],f=c.month,m=0===e.displayIndex,_=e.displayIndex===u.length-1,g=!m&&!_;"rtl"===a&&(_=(t=[m,_])[0],m=t[1]),m&&(h.push(s.caption_start),f=be(be({},f),c.caption_start)),_&&(h.push(s.caption_end),f=be(be({},f),c.caption_end)),g&&(h.push(s.caption_between),f=be(be({},f),c.caption_between));var E=null!==(n=null==l?void 0:l.Caption)&&void 0!==n?n:Je;return(0,i.jsxs)("div",{className:h.join(" "),style:f,children:[(0,i.jsx)(E,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,i.jsx)(Ut,{id:p,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function Wt(e){var t=ke(),n=t.classNames,o=t.styles;return(0,i.jsx)("div",{className:n.months,style:o.months,children:e.children})}function jt(e){var t,n,r=e.initialProps,a=ke(),s=Ot(),c=He(),l=(0,o.useState)(!1),u=l[0],d=l[1];(0,o.useEffect)((function(){a.initialFocus&&s.focusTarget&&(u||(s.focus(s.focusTarget),d(!0)))}),[a.initialFocus,u,s.focus,s.focusTarget,s]);var p=[a.classNames.root,a.className];a.numberOfMonths>1&&p.push(a.classNames.multiple_months),a.showWeekNumber&&p.push(a.classNames.with_weeknumber);var h=be(be({},a.styles.root),a.style),f=Object.keys(r).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return be(be({},e),((n={})[t]=r[t],n))}),{}),m=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:Wt;return(0,i.jsx)("div",be({className:p.join(" "),style:h,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:(0,i.jsx)(m,{children:c.displayMonths.map((function(e,t){return(0,i.jsx)(Gt,{displayIndex:t,displayMonth:e},t)}))})}))}function Yt(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(30758);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n