var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var hE=Object.create;var xs=Object.defineProperty;var gE=Object.getOwnPropertyDescriptor;var DE=Object.getOwnPropertyNames;var yE=Object.getPrototypeOf,RE=Object.prototype.hasOwnProperty;var ph=e=>xs(e,"__esModule",{value:!0});var TE=(e,n)=>()=>(e&&(n=e(e=0)),n);var ka=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),mh=(e,n)=>{ph(e);for(var r in n)xs(e,r,{get:n[r],enumerable:!0})},bE=(e,n,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of DE(n))!RE.call(e,i)&&i!=="default"&&xs(e,i,{get:()=>n[i],enumerable:!(r=gE(n,i))||r.enumerable});return e},wl=e=>bE(ph(xs(e!=null?hE(yE(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var em={};mh(em,{Children:()=>nx,Component:()=>ax,Fragment:()=>cx,Suspense:()=>dx,cloneElement:()=>rx,createContext:()=>ox,createElement:()=>ix,createRef:()=>ux,default:()=>er,forwardRef:()=>lx,isValidElement:()=>sx,lazy:()=>fx,useCallback:()=>vx,useContext:()=>px,useEffect:()=>Zp,useImperativeHandle:()=>mx,useLayoutEffect:()=>_x,useMemo:()=>hx,useReducer:()=>gx,useRef:()=>Dx,useState:()=>yx});var er,nx,rx,ax,ox,ix,ux,lx,cx,sx,fx,dx,vx,px,Zp,mx,_x,hx,gx,Dx,yx,Yo=TE(()=>{er=window.React,{Children:nx,cloneElement:rx,Component:ax,createContext:ox,createElement:ix,createRef:ux,forwardRef:lx,Fragment:cx,isValidElement:sx,lazy:fx,Suspense:dx,useCallback:vx,useContext:px,useEffect:Zp,useImperativeHandle:mx,useLayoutEffect:_x,useMemo:hx,useReducer:gx,useRef:Dx,useState:yx}=window.React});var pm=ka((lre,d0)=>{"use strict";var f0=Object.getOwnPropertySymbols,c2=Object.prototype.hasOwnProperty,s2=Object.prototype.propertyIsEnumerable;function f2(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function d2(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(n).map(function(v){return n[v]});if(i.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(v){l[v]=v}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}d0.exports=d2()?Object.assign:function(e,n){for(var r,i=f2(e),l,v=1;v{"use strict";var mm=pm(),Uu=60103,v0=60106;Ht.Fragment=60107;Ht.StrictMode=60108;Ht.Profiler=60114;var p0=60109,m0=60110,_0=60112;Ht.Suspense=60113;var h0=60115,g0=60116;typeof Symbol=="function"&&Symbol.for&&(Ra=Symbol.for,Uu=Ra("react.element"),v0=Ra("react.portal"),Ht.Fragment=Ra("react.fragment"),Ht.StrictMode=Ra("react.strict_mode"),Ht.Profiler=Ra("react.profiler"),p0=Ra("react.provider"),m0=Ra("react.context"),_0=Ra("react.forward_ref"),Ht.Suspense=Ra("react.suspense"),h0=Ra("react.memo"),g0=Ra("react.lazy"));var Ra,D0=typeof Symbol=="function"&&Symbol.iterator;function v2(e){return e===null||typeof e!="object"?null:(e=D0&&e[D0]||e["@@iterator"],typeof e=="function"?e:null)}function hc(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";M0.exports=x0()});var X0=ka(Wu=>{"use strict";var Ya=pm(),Ao=Rm();function hn(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;ryc;yc++)nr[yc]=yc+1;var nr,yc;nr[15]=0;var y2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,N0=Object.prototype.hasOwnProperty,U0={},O0={};function W0(e){return N0.call(O0,e)?!0:N0.call(U0,e)?!1:y2.test(e)?O0[e]=!0:(U0[e]=!0,!1)}function R2(e,n,r,i){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T2(e,n,r,i){if(n===null||typeof n=="undefined"||R2(e,n,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function Cr(e,n,r,i,l,v,b){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=b}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new Cr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];rr[n]=new Cr(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new Cr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new Cr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rr[e]=new Cr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new Cr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new Cr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new Cr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new Cr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sm=/[\-:]([a-z])/g;function Im(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Sm,Im);rr[n]=new Cr(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Sm,Im);rr[n]=new Cr(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Sm,Im);rr[n]=new Cr(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new Cr(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new Cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new Cr(e,1,!1,e.toLowerCase(),null,!0,!0)});var b2=/["'&<>]/;function Pi(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var n=b2.exec(e);if(n){var r="",i,l=0;for(i=n.index;iGf))throw Error(hn(301));if(e===mo)if($f=!0,e={action:r,next:null},Zo===null&&(Zo=new Map),r=Zo.get(n),r===void 0)Zo.set(n,e);else{for(n=r;n.next!==null;)n=n.next;n.next=e}}function Am(){}var Ni=null,x2={readContext:function(e){var n=Ni.threadID;return Dc(e,n),e[n]},useContext:function(e){ji();var n=Ni.threadID;return Dc(e,n),e[n]},useMemo:q0,useReducer:G0,useRef:function(e){mo=ji(),cn=Lm();var n=cn.memoizedState;return n===null?(e={current:e},cn.memoizedState=e):n},useState:function(e){return G0($0,e)},useLayoutEffect:function(){},useCallback:function(e,n){return q0(function(){return e},n)},useImperativeHandle:Am,useEffect:Am,useDebugValue:Am,useDeferredValue:function(e){return ji(),e},useTransition:function(){return ji(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(Ni.identifierPrefix||"")+"R:"+(Ni.uniqueID++).toString(36)},useMutableSource:function(e,n){return ji(),n(e._source)}},J0={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function z0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var V0={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},M2=Ya({menuitem:!0},V0),Tc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},S2=["Webkit","ms","Moz","O"];Object.keys(Tc).forEach(function(e){S2.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Tc[n]=Tc[e]})});var I2=/([A-Z])/g,L2=/^ms-/,ei=Ao.Children.toArray,Pm=g2.ReactCurrentDispatcher,A2={listing:!0,pre:!0,textarea:!0},P2=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,K0={},jm={};function j2(e){if(e==null)return e;var n="";return Ao.Children.forEach(e,function(r){r!=null&&(n+=r)}),n}var N2=Object.prototype.hasOwnProperty,U2={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Y0(e,n){if(e===void 0)throw Error(hn(152,gc(n)||"Component"))}function O2(e,n,r){function i(b,d){var h=d.prototype&&d.prototype.isReactComponent,N=D2(d,n,r,h),y=[],E=!1,S={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(Z,ne){E=!0,y=[ne]},enqueueSetState:function(Z,ne){if(y===null)return null;y.push(ne)}};if(h){if(h=new d(b.props,N,S),typeof d.getDerivedStateFromProps=="function"){var C=d.getDerivedStateFromProps.call(null,b.props,h.state);C!=null&&(h.state=Ya({},h.state,C))}}else if(mo={},h=d(b.props,N,S),h=H0(d,b.props,h,N),h==null||h.render==null){e=h,Y0(e,d);return}if(h.props=b.props,h.context=N,h.updater=S,S=h.state,S===void 0&&(h.state=S=null),typeof h.UNSAFE_componentWillMount=="function"||typeof h.componentWillMount=="function")if(typeof h.componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.UNSAFE_componentWillMount(),y.length){S=y;var M=E;if(y=null,E=!1,M&&S.length===1)h.state=S[0];else{C=M?S[0]:h.state;var U=!0;for(M=M?1:0;M=d))throw Error(hn(304));var h=new Uint16Array(d);for(h.set(b),nr=h,nr[0]=v+1,b=v;b=h.children.length){var N=h.footer;if(N!==""&&(this.previousWasTextNode=!1),this.stack.pop(),h.type==="select")this.currentSelectValue=null;else if(h.type!=null&&h.type.type!=null&&h.type.type.$$typeof===kf)this.popProvider(h.type);else if(h.type===Hf){this.suspenseDepth--;var y=v.pop();if(b){b=!1;var E=h.fallbackFrame;if(!E)throw Error(hn(303));this.stack.push(E),v[this.suspenseDepth]+="";continue}else v[this.suspenseDepth]+=y}v[this.suspenseDepth]+=N}else{var S=h.children[h.childIndex++],C="";try{C+=this.render(S,h.context,h.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(hn(294)):M}finally{}v.length<=this.suspenseDepth&&v.push(""),v[this.suspenseDepth]+=C}}return v[0]}finally{Pm.current=l,Ni=i,B0()}},n.render=function(r,i,l){if(typeof r=="string"||typeof r=="number")return l=""+r,l===""?"":this.makeStaticMarkup?Pi(l):this.previousWasTextNode?""+Pi(l):(this.previousWasTextNode=!0,Pi(l));if(i=O2(r,i,this.threadID),r=i.child,i=i.context,r===null||r===!1)return"";if(!Ao.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw l=r.$$typeof,Error(l===Tm?hn(257):hn(258,l.toString()));return r=ei(r),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}var v=r.type;if(typeof v=="string")return this.renderDOM(r,i,l);switch(v){case P0:case A0:case bm:case Em:case Cm:case Wf:return r=ei(r.props.children),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Hf:throw Error(hn(294));case L0:throw Error(hn(343))}if(typeof v=="object"&&v!==null)switch(v.$$typeof){case wm:mo={};var b=v.render(r.props,r.ref);return b=H0(v.render,r.props,b,r.ref),b=ei(b),this.stack.push({type:null,domNamespace:l,children:b,childIndex:0,context:i,footer:""}),"";case xm:return r=[Ao.createElement(v.type,Ya({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case kf:return v=ei(r.props.children),l={type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""},this.pushProvider(r),this.stack.push(l),"";case Fm:v=r.type,b=r.props;var d=this.threadID;return Dc(v,d),v=ei(b.children(v[d])),this.stack.push({type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""}),"";case I0:throw Error(hn(338));case Mm:return v=r.type,b=v._init,v=b(v._payload),r=[Ao.createElement(v,Ya({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}throw Error(hn(130,v==null?v:typeof v,""))},n.renderDOM=function(r,i,l){var v=r.type.toLowerCase();if(l===J0.html&&z0(v),!K0.hasOwnProperty(v)){if(!P2.test(v))throw Error(hn(65,v));K0[v]=!0}var b=r.props;if(v==="input")b=Ya({type:void 0},b,{defaultChecked:void 0,defaultValue:void 0,value:b.value!=null?b.value:b.defaultValue,checked:b.checked!=null?b.checked:b.defaultChecked});else if(v==="textarea"){var d=b.value;if(d==null){d=b.defaultValue;var h=b.children;if(h!=null){if(d!=null)throw Error(hn(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(hn(93));h=h[0]}d=""+h}d==null&&(d="")}b=Ya({},b,{value:void 0,children:""+d})}else if(v==="select")this.currentSelectValue=b.value!=null?b.value:b.defaultValue,b=Ya({},b,{value:void 0});else if(v==="option"){h=this.currentSelectValue;var N=j2(b.children);if(h!=null){var y=b.value!=null?b.value+"":N;if(d=!1,Array.isArray(h)){for(var E=0;E":(ne+=">",d="");e:{if(h=b.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break e}}else if(h=b.children,typeof h=="string"||typeof h=="number"){h=Pi(h);break e}h=null}return h!=null?(b=[],A2.hasOwnProperty(v)&&h.charAt(0)===` `&&(ne+=` `),ne+=h):b=ei(b.children),r=r.type,l=l==null||l==="http://www.w3.org/1999/xhtml"?z0(r):l==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":l,this.stack.push({domNamespace:l,type:v,children:b,childIndex:0,context:i,footer:d}),this.previousWasTextNode=!1,ne},e}();Wu.renderToNodeStream=function(){throw Error(hn(207))};Wu.renderToStaticMarkup=function(e,n){e=new Q0(e,!0,n);try{return e.read(1/0)}finally{e.destroy()}};Wu.renderToStaticNodeStream=function(){throw Error(hn(208))};Wu.renderToString=function(e,n){e=new Q0(e,!1,n);try{return e.read(1/0)}finally{e.destroy()}};Wu.version="17.0.2"});var eD=ka((dre,Z0)=>{"use strict";Z0.exports=X0()});var LT=ka((kd,B_)=>{(function(n,r){typeof kd=="object"&&typeof B_=="object"?B_.exports=r():typeof define=="function"&&define.amd?define([],r):typeof kd=="object"?kd.Pusher=r():n.Pusher=r()})(window,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var b in i)r.d(v,b,function(d){return i[d]}.bind(null,b));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="",r(r.s=2)}([function(e,n,r){"use strict";var i=this&&this.__extends||function(){var C=function(M,U){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var J in Y)Y.hasOwnProperty(J)&&(H[J]=Y[J])},C(M,U)};return function(M,U){C(M,U);function H(){this.constructor=M}M.prototype=U===null?Object.create(U):(H.prototype=U.prototype,new H)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=256,v=function(){function C(M){M===void 0&&(M="="),this._paddingCharacter=M}return C.prototype.encodedLength=function(M){return this._paddingCharacter?(M+2)/3*4|0:(M*8+5)/6|0},C.prototype.encode=function(M){for(var U="",H=0;H>>3*6&63),U+=this._encodeByte(Y>>>2*6&63),U+=this._encodeByte(Y>>>1*6&63),U+=this._encodeByte(Y>>>0*6&63)}var J=M.length-H;if(J>0){var Y=M[H]<<16|(J===2?M[H+1]<<8:0);U+=this._encodeByte(Y>>>3*6&63),U+=this._encodeByte(Y>>>2*6&63),J===2?U+=this._encodeByte(Y>>>1*6&63):U+=this._paddingCharacter||"",U+=this._paddingCharacter||""}return U},C.prototype.maxDecodedLength=function(M){return this._paddingCharacter?M/4*3|0:(M*6+7)/8|0},C.prototype.decodedLength=function(M){return this.maxDecodedLength(M.length-this._getPaddingLength(M))},C.prototype.decode=function(M){if(M.length===0)return new Uint8Array(0);for(var U=this._getPaddingLength(M),H=M.length-U,Y=new Uint8Array(this.maxDecodedLength(H)),J=0,Z=0,ne=0,ee=0,de=0,ve=0,We=0;Z>>4,Y[J++]=de<<4|ve>>>2,Y[J++]=ve<<6|We,ne|=ee&l,ne|=de&l,ne|=ve&l,ne|=We&l;if(Z>>4,ne|=ee&l,ne|=de&l),Z>>2,ne|=ve&l),Z>>8&0-65-26+97,U+=51-M>>>8&26-97-52+48,U+=61-M>>>8&52-48-62+43,U+=62-M>>>8&62-43-63+47,String.fromCharCode(U)},C.prototype._decodeChar=function(M){var U=l;return U+=(42-M&M-44)>>>8&-l+M-43+62,U+=(46-M&M-48)>>>8&-l+M-47+63,U+=(47-M&M-58)>>>8&-l+M-48+52,U+=(64-M&M-91)>>>8&-l+M-65+0,U+=(96-M&M-123)>>>8&-l+M-97+26,U},C.prototype._getPaddingLength=function(M){var U=0;if(this._paddingCharacter){for(var H=M.length-1;H>=0&&M[H]===this._paddingCharacter;H--)U++;if(M.length<4||U>2)throw new Error("Base64Coder: incorrect padding")}return U},C}();n.Coder=v;var b=new v;function d(C){return b.encode(C)}n.encode=d;function h(C){return b.decode(C)}n.decode=h;var N=function(C){i(M,C);function M(){return C!==null&&C.apply(this,arguments)||this}return M.prototype._encodeByte=function(U){var H=U;return H+=65,H+=25-U>>>8&0-65-26+97,H+=51-U>>>8&26-97-52+48,H+=61-U>>>8&52-48-62+45,H+=62-U>>>8&62-45-63+95,String.fromCharCode(H)},M.prototype._decodeChar=function(U){var H=l;return H+=(44-U&U-46)>>>8&-l+U-45+62,H+=(94-U&U-96)>>>8&-l+U-95+63,H+=(47-U&U-58)>>>8&-l+U-48+52,H+=(64-U&U-91)>>>8&-l+U-65+0,H+=(96-U&U-123)>>>8&-l+U-97+26,H},M}(v);n.URLSafeCoder=N;var y=new N;function E(C){return y.encode(C)}n.encodeURLSafe=E;function S(C){return y.decode(C)}n.decodeURLSafe=S,n.encodedLength=function(C){return b.encodedLength(C)},n.maxDecodedLength=function(C){return b.maxDecodedLength(C)},n.decodedLength=function(C){return b.decodedLength(C)}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i="utf8: invalid string",l="utf8: invalid source encoding";function v(h){for(var N=new Uint8Array(b(h)),y=0,E=0;E>6,N[y++]=128|S&63):S<55296?(N[y++]=224|S>>12,N[y++]=128|S>>6&63,N[y++]=128|S&63):(E++,S=(S&1023)<<10,S|=h.charCodeAt(E)&1023,S+=65536,N[y++]=240|S>>18,N[y++]=128|S>>12&63,N[y++]=128|S>>6&63,N[y++]=128|S&63)}return N}n.encode=v;function b(h){for(var N=0,y=0;y=h.length-1)throw new Error(i);y++,N+=4}else throw new Error(i)}return N}n.encodedLength=b;function d(h){for(var N=[],y=0;y=h.length)throw new Error(l);var C=h[++y];if((C&192)!=128)throw new Error(l);E=(E&31)<<6|C&63,S=128}else if(E<240){if(y>=h.length-1)throw new Error(l);var C=h[++y],M=h[++y];if((C&192)!=128||(M&192)!=128)throw new Error(l);E=(E&15)<<12|(C&63)<<6|M&63,S=2048}else if(E<248){if(y>=h.length-2)throw new Error(l);var C=h[++y],M=h[++y],U=h[++y];if((C&192)!=128||(M&192)!=128||(U&192)!=128)throw new Error(l);E=(E&15)<<18|(C&63)<<12|(M&63)<<6|U&63,S=65536}else throw new Error(l);if(E=55296&&E<=57343)throw new Error(l);if(E>=65536){if(E>1114111)throw new Error(l);E-=65536,N.push(String.fromCharCode(55296|E>>10)),E=56320|E&1023}}N.push(String.fromCharCode(E))}return N.join("")}n.decode=d},function(e,n,r){e.exports=r(3).default},function(e,n,r){"use strict";r.r(n);var i=function(){function f(s,m){this.lastId=0,this.prefix=s,this.name=m}return f.prototype.create=function(s){this.lastId++;var m=this.lastId,F=this.prefix+m,w=this.name+"["+m+"]",B=!1,oe=function(){B||(s.apply(null,arguments),B=!0)};return this[m]=oe,{number:m,id:F,name:w,callback:oe}},f.prototype.remove=function(s){delete this[s.number]},f}(),l=new i("_pusher_script_","Pusher.ScriptReceivers"),v={VERSION:"6.0.3",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},b=v,d=function(){function f(s){this.options=s,this.receivers=s.receivers||l,this.loading={}}return f.prototype.load=function(s,m,F){var w=this;if(w.loading[s]&&w.loading[s].length>0)w.loading[s].push(F);else{w.loading[s]=[F];var B=Rt.createScriptRequest(w.getPath(s,m)),oe=w.receivers.create(function(ye){if(w.receivers.remove(oe),w.loading[s]){var Ke=w.loading[s];delete w.loading[s];for(var $t=function(Yn){Yn||B.cleanup()},ln=0;ln>>6)+S(128|s&63):S(224|s>>>12&15)+S(128|s>>>6&63)+S(128|s&63)},J=function(f){return f.replace(/[^\x00-\x7F]/g,Y)},Z=function(f){var s=[0,2,1][f.length%3],m=f.charCodeAt(0)<<16|(f.length>1?f.charCodeAt(1):0)<<8|(f.length>2?f.charCodeAt(2):0),F=[C.charAt(m>>>18),C.charAt(m>>>12&63),s>=2?"=":C.charAt(m>>>6&63),s>=1?"=":C.charAt(m&63)];return F.join("")},ne=window.btoa||function(f){return f.replace(/[\s\S]{1,3}/g,Z)},ee=function(){function f(s,m,F,w){var B=this;this.clear=m,this.timer=s(function(){B.timer&&(B.timer=w(B.timer))},F)}return f.prototype.isRunning=function(){return this.timer!==null},f.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},f}(),de=ee,ve=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}();function We(f){window.clearTimeout(f)}function Ge(f){window.clearInterval(f)}var Je=function(f){ve(s,f);function s(m,F){return f.call(this,setTimeout,We,m,function(w){return F(),null})||this}return s}(de),en=function(f){ve(s,f);function s(m,F){return f.call(this,setInterval,Ge,m,function(w){return F(),w})||this}return s}(de),an={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(f){return new Je(0,f)},method:function(f){for(var s=[],m=1;m0)for(var w=0;w=1002&&f.code<=1004?"backoff":null:f.code===4e3?"tls_only":f.code<4100?"refused":f.code<4200?"backoff":f.code<4300?"retry":"refused"},getCloseError:function(f){return f.code!==1e3&&f.code!==1001?{type:"PusherError",data:{code:f.code,message:f.reason||f.message}}:null}},te=yo,ja=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Na=function(f){ja(s,f);function s(m,F){var w=f.call(this)||this;return w.id=m,w.transport=F,w.activityTimeout=F.activityTimeout,w.bindListeners(),w}return s.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},s.prototype.send=function(m){return this.transport.send(m)},s.prototype.send_event=function(m,F,w){var B={event:m,data:F};return w&&(B.channel=w),Be.debug("Event sent",B),this.send(te.encodeMessage(B))},s.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},s.prototype.close=function(){this.transport.close()},s.prototype.bindListeners=function(){var m=this,F={message:function(B){var oe;try{oe=te.decodeMessage(B)}catch(ye){m.emit("error",{type:"MessageParseError",error:ye,data:B.data})}if(oe!==void 0){switch(Be.debug("Event recd",oe),oe.event){case"pusher:error":m.emit("error",{type:"PusherError",data:oe.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",oe)}},activity:function(){m.emit("activity")},error:function(B){m.emit("error",{type:"WebSocketError",error:B})},closed:function(B){w(),B&&B.code&&m.handleCloseEvent(B),m.transport=null,m.emit("closed")}},w=function(){Ot(F,function(B,oe){m.transport.unbind(oe,B)})};Ot(F,function(B,oe){m.transport.bind(oe,B)})},s.prototype.handleCloseEvent=function(m){var F=te.getCloseAction(m),w=te.getCloseError(m);w&&this.emit("error",w),F&&this.emit(F,{action:F,error:w})},s}(Ve),Ro=Na,Ua=function(){function f(s,m){this.transport=s,this.callback=m,this.bindListeners()}return f.prototype.close=function(){this.unbindListeners(),this.transport.close()},f.prototype.bindListeners=function(){var s=this;this.onMessage=function(m){s.unbindListeners();var F;try{F=te.processHandshake(m)}catch(w){s.finish("error",{error:w}),s.transport.close();return}F.action==="connected"?s.finish("connected",{connection:new Ro(F.id,s.transport),activityTimeout:F.activityTimeout}):(s.finish(F.action,{error:F.error}),s.transport.close())},this.onClosed=function(m){s.unbindListeners();var F=te.getCloseAction(m)||"backoff",w=te.getCloseError(m);s.finish(F,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},f.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},f.prototype.finish=function(s,m){this.callback(ht({transport:this.transport,action:s},m))},f}(),Xr=Ua,fl=function(){function f(s,m){this.channel=s;var F=m.authTransport;if(typeof Rt.getAuthorizers()[F]=="undefined")throw"'"+F+"' is not a recognized auth transport";this.type=F,this.options=m,this.authOptions=m.auth||{}}return f.prototype.composeQuery=function(s){var m="socket_id="+encodeURIComponent(s)+"&channel_name="+encodeURIComponent(this.channel.name);for(var F in this.authOptions.params)m+="&"+encodeURIComponent(F)+"="+encodeURIComponent(this.authOptions.params[F]);return m},f.prototype.authorize=function(s,m){f.authorizers=f.authorizers||Rt.getAuthorizers(),f.authorizers[this.type].call(this,Rt,s,m)},f}(),li=fl,Xi=function(){function f(s,m){this.timeline=s,this.options=m||{}}return f.prototype.send=function(s,m){this.timeline.isEmpty()||this.timeline.send(Rt.TimelineTransport.getAgent(this,s),m)},f}(),Zi=Xi,Zr=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),hr=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),To=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),eu=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),dl=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),tu=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Kc=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Oo=function(f){Zr(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Zd=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),ev=function(f){Zd(s,f);function s(m,F){var w=f.call(this,function(B,oe){Be.debug("No callbacks on "+m+" for "+B)})||this;return w.name=m,w.pusher=F,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return s.prototype.authorize=function(m,F){return F(!1,{auth:""})},s.prototype.trigger=function(m,F){if(m.indexOf("client-")!==0)throw new hr("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var w=gt.buildLogSuffix("triggeringClientEvents");Be.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(m,F,this.name)},s.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(F.indexOf("pusher_internal:")!==0){var B={};this.emit(F,w,B)}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},s.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(F,w){F?(Be.error(w),m.emit("pusher:subscription_error",w)):(w=w,m.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:m.name}))}))},s.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},s.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},s.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},s}(Ve),Yc=ev,tv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),nv=function(f){tv(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s.prototype.authorize=function(m,F){var w=ea.createAuthorizer(this,this.pusher.config);return w.authorize(m,F)},s}(Yc),vl=nv,Qc=function(){function f(){this.reset()}return f.prototype.get=function(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null},f.prototype.each=function(s){var m=this;Ot(this.members,function(F,w){s(m.get(w))})},f.prototype.setMyID=function(s){this.myID=s},f.prototype.onSubscription=function(s){this.members=s.presence.hash,this.count=s.presence.count,this.me=this.get(this.myID)},f.prototype.addMember=function(s){return this.get(s.user_id)===null&&this.count++,this.members[s.user_id]=s.user_info,this.get(s.user_id)},f.prototype.removeMember=function(s){var m=this.get(s.user_id);return m&&(delete this.members[s.user_id],this.count--),m},f.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},f}(),rv=Qc,av=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Xc=function(f){av(s,f);function s(m,F){var w=f.call(this,m,F)||this;return w.members=new rv,w}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function(B,oe){if(!B){if(oe=oe,oe.channel_data===void 0){var ye=gt.buildLogSuffix("authenticationEndpoint");Be.error("Invalid auth response for channel '"+w.name+"',"+("expected 'channel_data' field. "+ye)),F("Invalid auth response");return}var Ke=JSON.parse(oe.channel_data);w.members.setMyID(Ke.user_id)}F(B,oe)})},s.prototype.handleEvent=function(m){var F=m.event;if(F.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var w=m.data,B={};m.user_id&&(B.user_id=m.user_id),this.emit(F,w,B)}},s.prototype.handleInternalEvent=function(m){var F=m.event,w=m.data;switch(F){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);break;case"pusher_internal:member_added":var B=this.members.addMember(w);this.emit("pusher:member_added",B);break;case"pusher_internal:member_removed":var oe=this.members.removeMember(w);oe&&this.emit("pusher:member_removed",oe);break}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(m.data),this.emit("pusher:subscription_succeeded",this.members))},s.prototype.disconnect=function(){this.members.reset(),f.prototype.disconnect.call(this)},s}(vl),ov=Xc,Zc=r(1),pl=r(0),iv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),uv=function(f){iv(s,f);function s(m,F,w){var B=f.call(this,m,F)||this;return B.key=null,B.nacl=w,B}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function(B,oe){if(B){F(!0,oe);return}var ye=oe.shared_secret;if(!ye){var Ke="No shared_secret key in auth payload for encrypted channel: "+w.name;F(!0,Ke);return}w.key=Object(pl.decode)(ye),delete oe.shared_secret,F(!1,oe)})},s.prototype.trigger=function(m,F){throw new tu("Client events are not currently supported for encrypted channels")},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F.indexOf("pusher_internal:")===0||F.indexOf("pusher:")===0){f.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(F,w)},s.prototype.handleEncryptedEvent=function(m,F){var w=this;if(!this.key){Be.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!F.ciphertext||!F.nonce){Be.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+F);return}var B=Object(pl.decode)(F.ciphertext);if(B.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new Je(m||0,function(){F.disconnectInternally(),F.connect()})},s.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},s.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new Je(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},s.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},s.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Je(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},s.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Je(this.activityTimeout,function(){m.sendActivityCheck()}))},s.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},s.prototype.buildConnectionCallbacks=function(m){var F=this;return ht({},m,{message:function(w){F.resetActivityCheck(),F.emit("message",w)},ping:function(){F.send_event("pusher:pong",{})},activity:function(){F.resetActivityCheck()},error:function(w){F.emit("error",{type:"WebSocketError",error:w})},closed:function(){F.abandonConnection(),F.shouldRetry()&&F.retryIn(1e3)}})},s.prototype.buildHandshakeCallbacks=function(m){var F=this;return ht({},m,{connected:function(w){F.activityTimeout=Math.min(F.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),F.clearUnavailableTimer(),F.setConnection(w.connection),F.socket_id=F.connection.id,F.updateState("connected",{socket_id:F.socket_id})}})},s.prototype.buildErrorCallbacks=function(){var m=this,F=function(w){return function(B){B.error&&m.emit("error",{type:"WebSocketError",error:B.error}),w(B)}};return{tls_only:F(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:F(function(){m.disconnect()}),backoff:F(function(){m.retryIn(1e3)}),retry:F(function(){m.retryIn(0)})}},s.prototype.setConnection=function(m){this.connection=m;for(var F in this.connectionCallbacks)this.connection.bind(F,this.connectionCallbacks[F]);this.resetActivityCheck()},s.prototype.abandonConnection=function(){if(!!this.connection){this.stopActivityCheck();for(var m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var F=this.connection;return this.connection=null,F}},s.prototype.updateState=function(m,F){var w=this.state;if(this.state=m,w!==m){var B=m;B==="connected"&&(B+=" with new socket ID "+F.socket_id),Be.debug("State changed",w+" -> "+B),this.timeline.info({state:m,params:F}),this.emit("state_change",{previous:w,current:m}),this.emit(m,F)}},s.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},s}(Ve),es=sv,fv=function(){function f(){this.channels={}}return f.prototype.add=function(s,m){return this.channels[s]||(this.channels[s]=ts(s,m)),this.channels[s]},f.prototype.all=function(){return Gt(this.channels)},f.prototype.find=function(s){return this.channels[s]},f.prototype.remove=function(s){var m=this.channels[s];return delete this.channels[s],m},f.prototype.disconnect=function(){Ot(this.channels,function(s){s.disconnect()})},f}(),dv=fv;function ts(f,s){if(f.indexOf("private-encrypted-")===0){if(s.config.nacl)return ea.createEncryptedChannel(f,s,s.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",F=gt.buildLogSuffix("encryptedChannelSupport");throw new tu(m+". "+F)}else return f.indexOf("private-")===0?ea.createPrivateChannel(f,s):f.indexOf("presence-")===0?ea.createPresenceChannel(f,s):ea.createChannel(f,s)}var vv={createChannels:function(){return new dv},createConnectionManager:function(f,s){return new es(f,s)},createChannel:function(f,s){return new Yc(f,s)},createPrivateChannel:function(f,s){return new vl(f,s)},createPresenceChannel:function(f,s){return new ov(f,s)},createEncryptedChannel:function(f,s,m){return new lv(f,s,m)},createTimelineSender:function(f,s){return new Zi(f,s)},createAuthorizer:function(f,s){return s.authorizer?s.authorizer(f,s):new li(f,s)},createHandshake:function(f,s){return new Xr(f,s)},createAssistantToTheTransportManager:function(f,s,m){return new ro(f,s,m)}},ea=vv,pv=function(){function f(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}return f.prototype.getAssistant=function(s){return ea.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},f.prototype.isAlive=function(){return this.livesLeft>0},f.prototype.reportDeath=function(){this.livesLeft-=1},f}(),ns=pv,mv=function(){function f(s,m){this.strategies=s,this.loop=Boolean(m.loop),this.failFast=Boolean(m.failFast),this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return f.prototype.isSupported=function(){return Pe(this.strategies,it.method("isSupported"))},f.prototype.connect=function(s,m){var F=this,w=this.strategies,B=0,oe=this.timeout,ye=null,Ke=function($t,ln){ln?m(null,ln):(B=B+1,F.loop&&(B=B%w.length),B0&&(B=new Je(F.timeout,function(){oe.abort(),w(!0)})),oe=s.connect(m,function(ye,Ke){ye&&B&&B.isRunning()&&!F.failFast||(B&&B.ensureAborted(),w(ye,Ke))}),{abort:function(){B&&B.ensureAborted(),oe.abort()},forceMinPriority:function(ye){oe.forceMinPriority(ye)}}},f}(),bo=mv,_v=function(){function f(s){this.strategies=s}return f.prototype.isSupported=function(){return Pe(this.strategies,it.method("isSupported"))},f.prototype.connect=function(s,m){return hv(this.strategies,s,function(F,w){return function(B,oe){if(w[F].error=B,B){rs(w)&&m(!0);return}Mt(w,function(ye){ye.forceMinPriority(oe.transport.priority)}),m(null,oe)}})},f}(),ml=_v;function hv(f,s,m){var F=ct(f,function(w,B,oe,ye){return w.connect(s,m(B,ye))});return{abort:function(){Mt(F,_l)},forceMinPriority:function(w){Mt(F,function(B){B.forceMinPriority(w)})}}}function rs(f){return Ce(f,function(s){return Boolean(s.error)})}function _l(f){!f.error&&!f.aborted&&(f.abort(),f.aborted=!0)}var gv=function(){function f(s,m,F){this.strategy=s,this.transports=m,this.ttl=F.ttl||1800*1e3,this.usingTLS=F.useTLS,this.timeline=F.timeline}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.usingTLS,w=as(F),B=[this.strategy];if(w&&w.timestamp+this.ttl>=it.now()){var oe=this.transports[w.transport];oe&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),B.push(new bo([oe],{timeout:w.latency*2+1e3,failFast:!0})))}var ye=it.now(),Ke=B.pop().connect(s,function $t(ln,Yn){ln?(os(F),B.length>0?(ye=it.now(),Ke=B.pop().connect(s,$t)):m(ln)):(yv(F,Yn.transport.name,it.now()-ye),m(null,Yn))});return{abort:function(){Ke.abort()},forceMinPriority:function($t){s=$t,Ke&&Ke.forceMinPriority($t)}}},f}(),Dv=gv;function hl(f){return"pusherTransport"+(f?"TLS":"NonTLS")}function as(f){var s=Rt.getLocalStorage();if(s)try{var m=s[hl(f)];if(m)return JSON.parse(m)}catch{os(f)}return null}function yv(f,s,m){var F=Rt.getLocalStorage();if(F)try{F[hl(f)]=Et({timestamp:it.now(),transport:s,latency:m})}catch{}}function os(f){var s=Rt.getLocalStorage();if(s)try{delete s[hl(f)]}catch{}}var Rv=function(){function f(s,m){var F=m.delay;this.strategy=s,this.options={delay:F}}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy,w,B=new Je(this.options.delay,function(){w=F.connect(s,m)});return{abort:function(){B.ensureAborted(),w&&w.abort()},forceMinPriority:function(oe){s=oe,w&&w.forceMinPriority(oe)}}},f}(),nu=Rv,is=function(){function f(s,m,F){this.test=s,this.trueBranch=m,this.falseBranch=F}return f.prototype.isSupported=function(){var s=this.test()?this.trueBranch:this.falseBranch;return s.isSupported()},f.prototype.connect=function(s,m){var F=this.test()?this.trueBranch:this.falseBranch;return F.connect(s,m)},f}(),ci=is,Tv=function(){function f(s){this.strategy=s}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy.connect(s,function(w,B){B&&F.abort(),m(w,B)});return F},f}(),bv=Tv;function Oa(f){return function(){return f.isSupported()}}var us=function(f,s,m){var F={};function w(Cn,Fs,ws,Xv,Cs){var g=m(f,Cn,Fs,ws,Xv,Cs);return F[Cn]=g,g}var B=Object.assign({},s,{hostNonTLS:f.wsHost+":"+f.wsPort,hostTLS:f.wsHost+":"+f.wssPort,httpPath:f.wsPath}),oe=Object.assign({},B,{useTLS:!0}),ye=Object.assign({},s,{hostNonTLS:f.httpHost+":"+f.httpPort,hostTLS:f.httpHost+":"+f.httpsPort,httpPath:f.httpPath}),Ke={loop:!0,timeout:15e3,timeoutLimit:6e4},$t=new ns({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),ln=new ns({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),Yn=w("ws","ws",3,B,$t),Br=w("wss","ws",3,oe,$t),Vv=w("sockjs","sockjs",1,ye),gs=w("xhr_streaming","xhr_streaming",1,ye,ln),Ds=w("xdr_streaming","xdr_streaming",1,ye,ln),ys=w("xhr_polling","xhr_polling",1,ye),Kv=w("xdr_polling","xdr_polling",1,ye),Rs=new bo([Yn],Ke),Yv=new bo([Br],Ke),Qv=new bo([Vv],Ke),Ts=new bo([new ci(Oa(gs),gs,Ds)],Ke),bs=new bo([new ci(Oa(ys),ys,Kv)],Ke),Es=new bo([new ci(Oa(Ts),new ml([Ts,new nu(bs,{delay:4e3})]),bs)],Ke),bl=new ci(Oa(Es),Es,Qv),El;return s.useTLS?El=new ml([Rs,new nu(bl,{delay:2e3})]):El=new ml([Rs,new nu(Yv,{delay:2e3}),new nu(bl,{delay:5e3})]),new Dv(new bv(new ci(Oa(Yn),El,bl)),F,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})},Ev=us,Fv=function(){var f=this;f.timeline.info(f.buildTimelineMessage({transport:f.name+(f.options.useTLS?"s":"")})),f.hooks.isInitialized()?f.changeState("initialized"):f.hooks.file?(f.changeState("initializing"),y.load(f.hooks.file,{useTLS:f.options.useTLS},function(s,m){f.hooks.isInitialized()?(f.changeState("initialized"),m(!0)):(s&&f.onError(s),f.onClose(),m(!1))})):f.onClose()},ls={getRequest:function(f){var s=new window.XDomainRequest;return s.ontimeout=function(){f.emit("error",new To),f.close()},s.onerror=function(m){f.emit("error",m),f.close()},s.onprogress=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText)},s.onload=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText),f.emit("finished",200),f.close()},s},abortRequest:function(f){f.ontimeout=f.onerror=f.onprogress=f.onload=null,f.abort()}},wv=ls,cs=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Cv=256*1024,ss=function(f){cs(s,f);function s(m,F,w){var B=f.call(this)||this;return B.hooks=m,B.method=F,B.url=w,B}return s.prototype.start=function(m){var F=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){F.close()},Rt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(m)},s.prototype.close=function(){this.unloader&&(Rt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},s.prototype.onChunk=function(m,F){for(;;){var w=this.advanceBuffer(F);if(w)this.emit("chunk",{status:m,data:w});else break}this.isBufferTooLong(F)&&this.emit("buffer_too_long")},s.prototype.advanceBuffer=function(m){var F=m.slice(this.position),w=F.indexOf(` `);return w!==-1?(this.position+=w+1,F.slice(0,w)):null},s.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>Cv},s}(Ve),fs=ss,si;(function(f){f[f.CONNECTING=0]="CONNECTING",f[f.OPEN=1]="OPEN",f[f.CLOSED=3]="CLOSED"})(si||(si={}));var ta=si,xv=1,ds=function(){function f(s,m){this.hooks=s,this.session=Ir(1e3)+"/"+Wa(8),this.location=Mv(m),this.readyState=ta.CONNECTING,this.openStream()}return f.prototype.send=function(s){return this.sendRaw(JSON.stringify([s]))},f.prototype.ping=function(){this.hooks.sendHeartbeat(this)},f.prototype.close=function(s,m){this.onClose(s,m,!0)},f.prototype.sendRaw=function(s){if(this.readyState===ta.OPEN)try{return Rt.createSocketRequest("POST",gl(Sv(this.location,this.session))).start(s),!0}catch{return!1}else return!1},f.prototype.reconnect=function(){this.closeStream(),this.openStream()},f.prototype.onClose=function(s,m,F){this.closeStream(),this.readyState=ta.CLOSED,this.onclose&&this.onclose({code:s,reason:m,wasClean:F})},f.prototype.onChunk=function(s){if(s.status===200){this.readyState===ta.OPEN&&this.onActivity();var m,F=s.data.slice(0,1);switch(F){case"o":m=JSON.parse(s.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(s.data.slice(1)||"[]");for(var w=0;w0&&f.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText),f.emit("finished",m.status),f.close();break}},m},abortRequest:function(f){f.onreadystatechange=null,f.abort()}},yt=ps,Eo={createStreamingSocket:function(f){return this.createSocket(Av,f)},createPollingSocket:function(f){return this.createSocket(jv,f)},createSocket:function(f,s){return new Iv(f,s)},createXHR:function(f,s){return this.createRequest(yt,f,s)},createRequest:function(f,s,m){return new fs(f,s,m)}},Dl=Eo;Dl.createXDR=function(f,s){return this.createRequest(wv,f,s)};var Nv=Dl,Uv={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:l,DependenciesReceivers:N,getDefaultStrategy:Ev,Transports:Kn,transportConnectionInitializer:Fv,HTTPFactory:Nv,TimelineTransport:V,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(f){var s=this;window.Pusher=f;var m=function(){s.onDocumentBody(f.ready)};window.JSON?m():y.load("json2",{},m)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:O,jsonp:A}},onDocumentBody:function(f){var s=this;document.body?f():setTimeout(function(){s.onDocumentBody(f)},0)},createJSONPRequest:function(f,s){return new W(f,s)},createScriptRequest:function(f){return new x(f)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var f=this.getXHRAPI();return new f},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Hr},createWebSocket:function(f){var s=this.getWebSocketAPI();return new s(f)},createSocketRequest:function(f,s){if(this.isXHRSupported())return this.HTTPFactory.createXHR(f,s);if(this.isXDRSupported(s.indexOf("https:")===0))return this.HTTPFactory.createXDR(f,s);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var f=this.getXHRAPI();return Boolean(f)&&new f().withCredentials!==void 0},isXDRSupported:function(f){var s=f?"https:":"http:",m=this.getProtocol();return Boolean(window.XDomainRequest)&&m===s},addUnloadListener:function(f){window.addEventListener!==void 0?window.addEventListener("unload",f,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",f)},removeUnloadListener:function(f){window.addEventListener!==void 0?window.removeEventListener("unload",f,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",f)}},Rt=Uv,ru;(function(f){f[f.ERROR=3]="ERROR",f[f.INFO=6]="INFO",f[f.DEBUG=7]="DEBUG"})(ru||(ru={}));var au=ru,Ov=function(){function f(s,m,F){this.key=s,this.session=m,this.events=[],this.options=F||{},this.sent=0,this.uniqueID=0}return f.prototype.log=function(s,m){s<=this.options.level&&(this.events.push(ht({},m,{timestamp:it.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},f.prototype.error=function(s){this.log(au.ERROR,s)},f.prototype.info=function(s){this.log(au.INFO,s)},f.prototype.debug=function(s){this.log(au.DEBUG,s)},f.prototype.isEmpty=function(){return this.events.length===0},f.prototype.send=function(s,m){var F=this,w=ht({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],s(w,function(B,oe){B||F.sent++,m&&m(B,oe)}),!0},f.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},f}(),ms=Ov,yl=function(){function f(s,m,F,w){this.name=s,this.priority=m,this.transport=F,this.options=w||{}}return f.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},f.prototype.connect=function(s,m){var F=this;if(this.isSupported()){if(this.priority{typeof window!="undefined"&&function(n,r){typeof Hc=="object"&&typeof G_=="object"?G_.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Hc=="object"?Hc.Hls=r():n.Hls=r()}(Hc,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var b in i)r.d(v,b,function(d){return i[d]}.bind(null,b));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(e,n,r){"use strict";var i=Object.prototype.hasOwnProperty,l="~";function v(){}Object.create&&(v.prototype=Object.create(null),new v().__proto__||(l=!1));function b(y,E,S){this.fn=y,this.context=E,this.once=S||!1}function d(y,E,S,C,M){if(typeof S!="function")throw new TypeError("The listener must be a function");var U=new b(S,C||y,M),H=l?l+E:E;return y._events[H]?y._events[H].fn?y._events[H]=[y._events[H],U]:y._events[H].push(U):(y._events[H]=U,y._eventsCount++),y}function h(y,E){--y._eventsCount==0?y._events=new v:delete y._events[E]}function N(){this._events=new v,this._eventsCount=0}N.prototype.eventNames=function(){var E=[],S,C;if(this._eventsCount===0)return E;for(C in S=this._events)i.call(S,C)&&E.push(l?C.slice(1):C);return Object.getOwnPropertySymbols?E.concat(Object.getOwnPropertySymbols(S)):E},N.prototype.listeners=function(E){var S=l?l+E:E,C=this._events[S];if(!C)return[];if(C.fn)return[C.fn];for(var M=0,U=C.length,H=new Array(U);M0},!1)}function y(E,S){for(var C={main:[S]},M={main:[]},U={main:{}};N(C);)for(var H=Object.keys(C),Y=0;Y>>8^Gt&255^99,Z[Qt]=Gt,ne[Gt]=Qt;var Mt=Pt[Qt],ct=Pt[Mt],Mn=Pt[ct],me=Pt[Gt]*257^Gt*16843008;de[Qt]=me<<24|me>>>8,ve[Qt]=me<<16|me>>>16,We[Qt]=me<<8|me>>>24,Ge[Qt]=me,me=Mn*16843009^ct*65537^Mt*257^Qt*16843008,en[Gt]=me<<24|me>>>8,an[Gt]=me<<16|me>>>16,it[Gt]=me<<8|me>>>24,ht[Gt]=me,Qt?(Qt=Mt^Pt[Pt[Pt[Mn^Mt]]],Ot^=Pt[Pt[Ot]]):Qt=Ot=1}},Y.expandKey=function(Z){for(var ne=this.uint8ArrayToUint32Array_(Z),ee=!0,de=0;de>>6)+1,L=(G[A+2]&60)>>>2,L>ie.length-1){O.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+L});return}return k=(G[A+2]&1)<<2,k|=(G[A+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+x+",sampleingIndex:"+L+"["+ie[L]+"Hz],channelConfig:"+k),/firefox/i.test(V)?L>=6?(x=5,Q=new Array(4),W=L-3):(x=2,Q=new Array(2),W=L):V.indexOf("android")!==-1?(x=2,Q=new Array(2),W=L):(x=5,Q=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&L>=6?W=L-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(L>=6&&k===1||/vivaldi/i.test(V))||!D&&k===1)&&(x=2,Q=new Array(2)),W=L)),Q[0]=x<<3,Q[0]|=(L&14)>>1,Q[1]|=(L&1)<<7,Q[1]|=k<<3,x===5&&(Q[1]|=(W&14)>>1,Q[2]=(W&1)<<7,Q[2]|=2<<2,Q[3]=0),{config:Q,samplerate:ie[L],channelCount:k,codec:"mp4a.40."+x,manifestCodec:re}}function y(O,G){return O[G]===255&&(O[G+1]&246)==240}function E(O,G){return O[G+1]&1?7:9}function S(O,G){return(O[G+3]&3)<<11|O[G+4]<<3|(O[G+5]&224)>>>5}function C(O,G){return!!(G+10&&G+L+W<=Q)return k=A+D*x,{headerLength:L,frameLength:W,stamp:k}}function J(O,G,A,D,x){var L=H(O.samplerate),W=Y(G,A,D,x,L);if(W){var k=W.stamp,Q=W.headerLength,V=W.frameLength,re={unit:G.subarray(A+Q,A+Q+V),pts:k,dts:k};return O.samples.push(re),{sample:re,length:V+Q}}}var Z=r("./src/demux/id3.js"),ne=function(){function O(A,D,x){this.observer=A,this.config=x,this.remuxer=D}var G=O.prototype;return G.resetInitSegment=function(D,x,L,W){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:x,duration:W,inputTimeScale:9e4}},G.resetTimeStamp=function(){},O.probe=function(D){if(!D)return!1;for(var x=Z.default.getID3Data(D,0)||[],L=x.length,W=D.length;LA.length)){var W=this.parseHeader(A,D);if(W&&D+W.frameLength<=A.length){var k=W.samplesPerFrame*9e4/W.sampleRate,Q=x+L*k,V={unit:A.subarray(D,D+W.frameLength),pts:Q,dts:Q};return G.config=[],G.channelCount=W.channelCount,G.samplerate=W.sampleRate,G.samples.push(V),{sample:V,length:W.frameLength}}}},parseHeader:function(G,A){var D=G[A+1]>>3&3,x=G[A+1]>>1&3,L=G[A+2]>>4&15,W=G[A+2]>>2&3,k=G[A+2]>>1&1;if(D!==1&&L!==0&&L!==15&&W!==3){var Q=D===3?3-x:x===3?3:4,V=ve.BitratesMap[Q*14+L-1]*1e3,re=D===3?0:D===2?1:2,ie=ve.SamplingRateMap[re*3+W],ue=G[A+3]>>6==3?1:2,le=ve.SamplesCoefficients[D][x],ge=ve.BytesInSlot[x],Te=le*8*ge,se=parseInt(le*V/ie+k,10)*ge;return{sampleRate:ie,channelCount:ue,frameLength:se,samplesPerFrame:Te}}},isHeaderPattern:function(G,A){return G[A]===255&&(G[A+1]&224)==224&&(G[A+1]&6)!=0},isHeader:function(G,A){return!!(A+1D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,x=D>>3,D-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},G.readBits=function(D){var x=Math.min(this.bitsAvailable,D),L=this.word>>>32-x;return D>32&&d.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=D-x,x>0&&this.bitsAvailable?L<>>D)!=0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},G.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(D){var x=8,L=8,W,k;for(W=0;W=D.length){L();return}if(!(D[x].unit.length<32)){var W=this.decrypter.isSync();if(this.decryptAacSample(D,x,L,W),!W)return}}},G.getAvcEncryptedData=function(D){for(var x=Math.floor((D.length-48)/160)*16+16,L=new Int8Array(x),W=0,k=32;k<=D.length-16;k+=160,W+=16)L.set(D.subarray(k,k+16),W);return L},G.getAvcDecryptedUnit=function(D,x){x=new Uint8Array(x);for(var L=0,W=32;W<=D.length-16;W+=160,L+=16)D.set(x.subarray(L,L+16),W);return D},G.decryptAvcSample=function(D,x,L,W,k,Q){var V=this.discardEPB(k.data),re=this.getAvcEncryptedData(V),ie=this;this.decryptBuffer(re.buffer,function(ue){k.data=ie.getAvcDecryptedUnit(V,ue),Q||ie.decryptAvcSamples(D,x,L+1,W)})},G.decryptAvcSamples=function(D,x,L,W){for(;;x++,L=0){if(x>=D.length){W();return}for(var k=D[x].units;!(L>=k.length);L++){var Q=k[L];if(!(Q.length<=48||Q.type!==1&&Q.type!==5)){var V=this.decrypter.isSync();if(this.decryptAvcSample(D,x,L,W,Q,V),!V)return}}}},O}(),an=en,it={video:1,audio:2,id3:3,text:4},ht=function(){function O(A,D,x,L){this.observer=A,this.config=x,this.typeSupported=L,this.remuxer=D,this.sampleAes=null}var G=O.prototype;return G.setDecryptData=function(D){D!=null&&D.key!=null&&D.method==="SAMPLE-AES"?this.sampleAes=new an(this.observer,this.config,D,this.discardEPB):this.sampleAes=null},O.probe=function(D){var x=O._syncOffset(D);return x<0?!1:(x&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},O._syncOffset=function(D){for(var x=Math.min(1e3,D.length-3*188),L=0;L>4,ie>1){if(ue=k+5+D[k+4],ue===k+188)continue}else ue=k+4;switch(re){case Ve:V&&(Wt&&(le=fn(Wt))&&Fn(le,!1),Wt={data:[],size:0}),Wt&&(Wt.data.push(D.subarray(ue,k+188)),Wt.size+=k+188-ue);break;case xt:V&&(vt&&(le=fn(vt))&&(Fe.isAAC?Gn(le):Dn(le)),vt={data:[],size:0}),vt&&(vt.data.push(D.subarray(ue,k+188)),vt.size+=k+188-ue);break;case Xt:V&&(nn&&(le=fn(nn))&&or(le),nn={data:[],size:0}),nn&&(nn.data.push(D.subarray(ue,k+188)),nn.size+=k+188-ue);break;case 0:V&&(ue+=D[ue]+1),tt=this._pmtId=Dt(D,ue);break;case tt:V&&(ue+=D[ue]+1);var sn=qt(D,ue,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);Ve=sn.avc,Ve>0&&(se.pid=Ve),xt=sn.audio,xt>0&&(Fe.pid=xt,Fe.isAAC=sn.isAAC),Xt=sn.id3,Xt>0&&(Ne.pid=Xt),ge&&!Te&&(d.logger.log("reparse from beginning"),ge=!1,k=wn-188),Te=this.pmtParsed=!0;break;case 17:case 8191:break;default:ge=!0;break}}else this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});Wt&&(le=fn(Wt))?(Fn(le,!0),se.pesData=null):se.pesData=Wt,vt&&(le=fn(vt))?(Fe.isAAC?Gn(le):Dn(le),Fe.pesData=null):(vt&&vt.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),Fe.pesData=vt),nn&&(le=fn(nn))?(or(le),Ne.pesData=null):Ne.pesData=nn,this.sampleAes==null?this.remuxer.remux(Fe,se,Ne,this._txtTrack,x,L,W):this.decryptAndRemux(Fe,se,Ne,this._txtTrack,x,L,W)},G.decryptAndRemux=function(D,x,L,W,k,Q,V){if(D.samples&&D.isAAC){var re=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){re.decryptAndRemuxAvc(D,x,L,W,k,Q,V)})}else this.decryptAndRemuxAvc(D,x,L,W,k,Q,V)},G.decryptAndRemuxAvc=function(D,x,L,W,k,Q,V){if(x.samples){var re=this;this.sampleAes.decryptAvcSamples(x.samples,0,0,function(){re.remuxer.remux(D,x,L,W,k,Q,V)})}else this.remuxer.remux(D,x,L,W,k,Q,V)},G.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},G._parsePAT=function(D,x){return(D[x+10]&31)<<8|D[x+11]},G._parsePMT=function(D,x,L,W){var k,Q,V,re,ie={audio:-1,avc:-1,id3:-1,isAAC:!0};for(k=(D[x+1]&15)<<8|D[x+2],Q=x+3+k-4,V=(D[x+10]&15)<<8|D[x+11],x+=12+V;x1;){var Te=new Uint8Array(ge[0].length+ge[1].length);Te.set(ge[0]),Te.set(ge[1],ge[0].length),ge[0]=Te,ge.splice(1,1)}if(L=ge[0],k=(L[0]<<16)+(L[1]<<8)+L[2],k===1){if(Q=(L[4]<<8)+L[5],Q&&Q>D.size-6||(W=L[7],W&192&&(ie=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,ie>4294967295&&(ie-=8589934592),W&64?(ue=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,ue>4294967295&&(ue-=8589934592),ie-ue>60*9e4&&(d.logger.warn(Math.round((ie-ue)/9e4)+"s delta between PTS and DTS, align them"),ie=ue)):ue=ie),V=L[8],le=V+9,D.size<=le))return null;D.size-=le,re=new Uint8Array(D.size);for(var se=0,Fe=ge.length;seNe){le-=Ne;continue}else L=L.subarray(le),Ne-=le,le=0;re.set(L,x),x+=Ne}return Q&&(Q-=V+3),{data:re,pts:ie,dts:ue,len:Q}}else return null},G.pushAccesUnit=function(D,x){if(D.units.length&&D.frame){var L=x.samples,W=L.length;if(isNaN(D.pts))if(W){var k=L[W-1];D.pts=k.pts,D.dts=k.dts}else{x.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||x.sps&&(W||this.contiguous)?(D.id=W,L.push(D)):x.dropped++}D.debug.length&&d.logger.log(D.pts+"/"+D.dts+":"+D.debug)},G._parseAVCPES=function(D,x){var L=this,W=this._avcTrack,k=this._parseAVCNALu(D.data),Q=!1,V,re=this.avcSample,ie,ue=!1,le,ge=this.pushAccesUnit.bind(this),Te=function(Fe,Ne,Ve,xt){return{key:Fe,pts:Ne,dts:Ve,units:[],debug:xt}};D.data=null,re&&k.length&&!W.audFound&&(ge(re,W),re=this.avcSample=Te(!1,D.pts,D.dts,"")),k.forEach(function(se){switch(se.type){case 1:ie=!0,re||(re=L.avcSample=Te(!0,D.pts,D.dts,"")),Q&&(re.debug+="NDR "),re.frame=!0;var Fe=se.data;if(ue&&Fe.length>4){var Ne=new Je(Fe).readSliceType();(Ne===2||Ne===4||Ne===7||Ne===9)&&(re.key=!0)}break;case 5:ie=!0,re||(re=L.avcSample=Te(!0,D.pts,D.dts,"")),Q&&(re.debug+="IDR "),re.key=!0,re.frame=!0;break;case 6:ie=!0,Q&&re&&(re.debug+="SEI "),V=new Je(L.discardEPB(se.data)),V.readUByte();for(var Ve=0,xt=0,Xt=!1,tt=0;!Xt&&V.bytesAvailable>1;){Ve=0;do tt=V.readUByte(),Ve+=tt;while(tt===255);xt=0;do tt=V.readUByte(),xt+=tt;while(tt===255);if(Ve===4&&V.bytesAvailable!==0){Xt=!0;var Wt=V.readUByte();if(Wt===181){var vt=V.readUShort();if(vt===49){var nn=V.readUInt();if(nn===1195456820){var Dt=V.readUByte();if(Dt===3){var qt=V.readUByte(),fn=V.readUByte(),Fn=31&qt,Gn=[qt,fn];for(le=0;le16){var Dn=[];for(le=0;le<16;le++)Dn.push(V.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&Dn.push("-");var or=xt-16,wn=new Uint8Array(or);for(le=0;le0){if(x.pts>=D[L-1].pts)D.push(x);else for(var W=L-1;W>=0;W--)if(x.pts=0)ue={data:D.subarray(ge,x-V-1),type:Te},ie.push(ue);else{var se=this._getLastNalUnit();if(se&&(re&&x<=4-re&&se.state&&(se.data=se.data.subarray(0,se.data.byteLength-re)),k=x-V-1,k>0)){var Fe=new Uint8Array(se.data.byteLength+k);Fe.set(se.data,0),Fe.set(D.subarray(0,k),se.data.byteLength),se.data=Fe}}x=0&&V>=0&&(ue={data:D.subarray(ge,L),type:Te,state:V},ie.push(ue)),ie.length===0){var Ne=this._getLastNalUnit();if(Ne){var Ve=new Uint8Array(Ne.data.byteLength+D.byteLength);Ve.set(Ne.data,0),Ve.set(D,Ne.data.byteLength),Ne.data=Ve}}return Q.naluState=V,ie},G.discardEPB=function(D){for(var x=D.byteLength,L=[],W=1,k,Q;W1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Ne-W)/90)),W=Ne)}for(;ue>24&255,k[1]=x>>16&255,k[2]=x>>8&255,k[3]=x&255,k.set(A,4),L=0,x=8;L>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},O.mdia=function(A){return O.box(O.types.mdia,O.mdhd(A.timescale,A.duration),O.hdlr(A.type),O.minf(A))},O.mfhd=function(A){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255]))},O.minf=function(A){return A.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(A)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(A))},O.moof=function(A,D,x){return O.box(O.types.moof,O.mfhd(A),O.traf(x,D))},O.moov=function(A){for(var D=A.length,x=[];D--;)x[D]=O.trak(A[D]);return O.box.apply(null,[O.types.moov,O.mvhd(A[0].timescale,A[0].duration)].concat(x).concat(O.mvex(A)))},O.mvex=function(A){for(var D=A.length,x=[];D--;)x[D]=O.trex(A[D]);return O.box.apply(null,[O.types.mvex].concat(x))},O.mvhd=function(A,D){D*=A;var x=Math.floor(D/(Mt+1)),L=Math.floor(D%(Mt+1)),W=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return O.box(O.types.mvhd,W)},O.sdtp=function(A){var D=A.samples||[],x=new Uint8Array(4+D.length),L,W;for(W=0;W>>8&255),D.push(k&255),D=D.concat(Array.prototype.slice.call(W));for(L=0;L>>8&255),x.push(k&255),x=x.concat(Array.prototype.slice.call(W));var Q=O.box(O.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|A.sps.length].concat(D).concat([A.pps.length]).concat(x))),V=A.width,re=A.height,ie=A.pixelRatio[0],ue=A.pixelRatio[1];return O.box(O.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,V>>8&255,V&255,re>>8&255,re&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),Q,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([ie>>24,ie>>16&255,ie>>8&255,ie&255,ue>>24,ue>>16&255,ue>>8&255,ue&255])))},O.esds=function(A){var D=A.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(A.config).concat([6,1,2]))},O.mp4a=function(A){var D=A.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),O.box(O.types.esds,O.esds(A)))},O.mp3=function(A){var D=A.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},O.stsd=function(A){return A.type==="audio"?!A.isAAC&&A.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(A)):O.box(O.types.stsd,O.STSD,O.mp4a(A)):O.box(O.types.stsd,O.STSD,O.avc1(A))},O.tkhd=function(A){var D=A.id,x=A.duration*A.timescale,L=A.width,W=A.height,k=Math.floor(x/(Mt+1)),Q=Math.floor(x%(Mt+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,Q>>24,Q>>16&255,Q>>8&255,Q&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,L>>8&255,L&255,0,0,W>>8&255,W&255,0,0]))},O.traf=function(A,D){var x=O.sdtp(A),L=A.id,W=Math.floor(D/(Mt+1)),k=Math.floor(D%(Mt+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,W>>24,W>>16&255,W>>8&255,W&255,k>>24,k>>16&255,k>>8&255,k&255])),O.trun(A,x.length+16+20+8+16+8+8),x)},O.trak=function(A){return A.duration=A.duration||4294967295,O.box(O.types.trak,O.tkhd(A),O.mdia(A))},O.trex=function(A){var D=A.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(A,D){var x=A.samples||[],L=x.length,W=12+16*L,k=new Uint8Array(W),Q,V,re,ie,ue,le;for(D+=8+W,k.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),Q=0;Q>>24&255,re>>>16&255,re>>>8&255,re&255,ie>>>24&255,ie>>>16&255,ie>>>8&255,ie&255,ue.isLeading<<2|ue.dependsOn,ue.isDependedOn<<6|ue.hasRedundancy<<4|ue.paddingValue<<1|ue.isNonSync,ue.degradPrio&240<<8,ue.degradPrio&15,le>>>24&255,le>>>16&255,le>>>8&255,le&255],12+16*Q);return O.box(O.types.trun,k)},O.initSegment=function(A){O.types||O.init();var D=O.moov(A),x;return x=new Uint8Array(O.FTYP.byteLength+D.byteLength),x.set(O.FTYP),x.set(D,O.FTYP.byteLength),x},O}(),Mn=ct,me=9e4;function st(O,G,A,D){return A===void 0&&(A=1),D===void 0&&(D=!1),St(O,G,1/A)}function St(O,G,A,D){A===void 0&&(A=1),D===void 0&&(D=!1);var x=O*G*A;return D?Math.round(x):x}function Pe(O,G){return G===void 0&&(G=!1),St(O,1e3,1/me,G)}function Ce(O,G){return G===void 0&&(G=1),St(O,me,1/G)}var _e=Ce(10),et=Ce(.2),Ye=function(){function O(A,D,x,L){this.observer=A,this.config=D,this.typeSupported=x;var W=navigator.userAgent;this.isSafari=L&&L.indexOf("Apple")>-1&&W&&!W.match("CriOS"),this.ISGenerated=!1}var G=O.prototype;return G.destroy=function(){},G.resetTimeStamp=function(D){this._initPTS=this._initDTS=D},G.resetInitSegment=function(){this.ISGenerated=!1},G.remux=function(D,x,L,W,k,Q,V){if(this.ISGenerated||this.generateIS(D,x,k),this.ISGenerated){var re=D.samples.length,ie=x.samples.length,ue=k,le=k;if(re&&ie){var ge=(D.samples[0].pts-x.samples[0].pts)/x.inputTimeScale;ue+=Math.max(0,ge),le+=Math.max(0,-ge)}if(re){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,x,k));var Te=this.remuxAudio(D,ue,Q,V);if(ie){var se;Te&&(se=Te.endPTS-Te.startPTS),x.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,x,k)),this.remuxVideo(x,le,Q,se,V)}}else if(ie){var Fe=this.remuxVideo(x,le,Q,0,V);Fe&&D.codec&&this.remuxEmptyAudio(D,ue,Q,Fe)}}L.samples.length&&this.remuxID3(L,k),W.samples.length&&this.remuxText(W,k),this.observer.trigger(i.default.FRAG_PARSED)},G.generateIS=function(D,x,L){var W=this.observer,k=D.samples,Q=x.samples,V=this.typeSupported,re="audio/mp4",ie={},ue={tracks:ie},le=this._initPTS===void 0,ge,Te;if(le&&(ge=Te=1/0),D.config&&k.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(V.mpeg?(re="audio/mpeg",D.codec=""):V.mp3&&(D.codec="mp3")),ie.audio={container:re,codec:D.codec,initSegment:!D.isAAC&&V.mpeg?new Uint8Array:Mn.initSegment([D]),metadata:{channelCount:D.channelCount}},le&&(ge=Te=k[0].pts-D.inputTimeScale*L)),x.sps&&x.pps&&Q.length){var se=x.inputTimeScale;x.timescale=se,ie.video={container:"video/mp4",codec:x.codec,initSegment:Mn.initSegment([x]),metadata:{width:x.width,height:x.height}},le&&(ge=Math.min(ge,Q[0].pts-se*L),Te=Math.min(Te,Q[0].dts-se*L),this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:ge}))}Object.keys(ie).length?(W.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,ue),this.ISGenerated=!0,le&&(this._initPTS=ge,this._initDTS=Te)):W.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},G.remuxVideo=function(D,x,L,W,k){var Q=8,V,re,ie,ue,le,ge,Te,se=D.timescale,Fe=D.samples,Ne=[],Ve=Fe.length,xt=this._PTSNormalize,Xt=this._initPTS,tt=this.nextAvcDts,Wt=this.isSafari;if(Ve!==0){Wt&&(L|=Fe.length&&tt&&(k&&Math.abs(x-tt/se)<.1||Math.abs(Fe[0].pts-tt-Xt)1?d.logger.log("AVC: "+Pe(qt,!0)+" ms hole between fragments detected,filling it"):qt<-1&&d.logger.log("AVC: "+Pe(-qt,!0)+" ms overlapping between fragments detected"),le=tt,Fe[0].dts=le,ue=Math.max(ue-qt,tt),Fe[0].pts=ue,d.logger.log("Video: PTS/DTS adjusted: "+Pe(ue,!0)+"/"+Pe(le,!0)+", delta: "+Pe(qt,!0)+" ms")),Dt=Fe[Fe.length-1],Te=Math.max(Dt.dts,0),ge=Math.max(Dt.pts,0,Te),Wt&&(V=Math.round((Te-le)/(Fe.length-1)));for(var fn=0,Fn=0,Gn=0;Gn0?Kn-1:Kn].dts;if(Ro.stretchShortVideoTrack){var Xr=Ro.maxBufferHole,fl=Math.floor(Xr*se),li=(W?ue+W*se:this.nextAudioPts)-Ln.pts;li>fl?(V=li-Ua,V<0&&(V=Ua),d.logger.log("It is approximately "+Pe(li,!1)+" ms to the next segment; using duration "+Pe(V,!1)+" ms for the last video frame.")):V=Ua}else V=Ua}Qr=Math.round(Ln.pts-Ln.dts)}Ne.push({size:Hr,duration:V,cts:Qr,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Ln.key?2:1,isNonSync:Ln.key?0:1}})}this.nextAvcDts=Te+V;var Xi=D.dropped;if(D.nbNalu=0,D.dropped=0,Ne.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Zi=Ne[0].flags;Zi.dependsOn=2,Zi.isNonSync=0}D.samples=Ne,ie=Mn.moof(D.sequenceNumber++,le,D),D.samples=[];var Zr={data1:ie,data2:re,startPTS:ue/se,endPTS:(ge+V)/se,startDTS:le/se,endDTS:this.nextAvcDts/se,type:"video",hasAudio:!1,hasVideo:!0,nb:Ne.length,dropped:Xi};return this.observer.trigger(i.default.FRAG_PARSING_DATA,Zr),Zr}},G.remuxAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.timescale,V=k/Q,re=D.isAAC?1024:1152,ie=re*V,ue=this._PTSNormalize,le=this._initPTS,ge=!D.isAAC&&this.typeSupported.mpeg,Te,se,Fe,Ne,Ve,xt,Xt=ge?0:8,tt=D.samples,Wt=[],vt=this.nextAudioPts;if(L|=tt.length&&vt&&(W&&Math.abs(x-vt/k)<.1||Math.abs(tt[0].pts-vt-le)<20*ie),tt.forEach(function(Xr){Xr.pts=Xr.dts=ue(Xr.pts-le,x*k)}),tt=tt.filter(function(Xr){return Xr.pts>=0}),tt.length!==0){if(L||(W?vt=x*k:vt=tt[0].pts),D.isAAC)for(var nn=this.config.maxAudioFramesDrift,Dt=0,qt=vt;Dt=nn*ie&&Fn<_e&&qt){var Dn=Math.round(Fn/ie);d.logger.warn("Injecting "+Dn+" audio frames @ "+Pe(qt,!0)+" ms due to "+Pe(qt,!0)+" ms gap.");for(var or=0;or.1*ie,fn.pts=fn.dts=qt,qt+=ie,Dt++}for(var sn=tt.length,In=0;sn--;)In+=tt[sn].unit.byteLength;for(var mr=0,_r=tt.length;mr<_r;mr++){var Kn=tt[mr],Ln=Kn.unit,Sr=Kn.pts;if(xt!==void 0)Te.duration=Math.round((Sr-xt)/V);else{var Hr=Sr-vt,Qr=0;if(L&&D.isAAC&&Hr){if(Hr>0&&Hr<_e)Qr=Math.round((Sr-vt)/ie),d.logger.log(Pe(Hr,!0)+" ms hole between AAC samples detected,filling it"),Qr>0&&(se=Gt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),se||(se=Ln.subarray()),In+=Qr*se.length);else if(Hr<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+Pe(vt,!0)+" ms / "+Pe(Sr,!0)+" ms / "+Pe(-Hr,!0)+" ms"),In-=Ln.byteLength;continue}Sr=vt}if(Ve=Sr,In>0){In+=Xt;try{Fe=new Uint8Array(In)}catch{this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:In,reason:"fail allocating audio mdat "+In});return}if(!ge){var ro=new DataView(Fe.buffer);ro.setUint32(0,In),Fe.set(Mn.types.mdat,4)}}else return;for(var yo=0;yo=2&&(ja=Wt[sn-2].duration,Te.duration=ja),sn){this.nextAudioPts=vt=xt+V*ja,D.samples=Wt,ge?Ne=new Uint8Array:Ne=Mn.moof(D.sequenceNumber++,Ve/V,D),D.samples=[];var Na=Ve/k,Ro=vt/k,Ua={data1:Ne,data2:Fe,startPTS:Na,endPTS:Ro,startDTS:Na,endDTS:Ro,type:"audio",hasAudio:!0,hasVideo:!1,nb:sn};return this.observer.trigger(i.default.FRAG_PARSING_DATA,Ua),Ua}return null}},G.remuxEmptyAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.samplerate?D.samplerate:k,V=k/Q,re=this.nextAudioPts,ie=(re!==void 0?re:W.startDTS*k)+this._initDTS,ue=W.endDTS*k+this._initDTS,le=1024,ge=V*le,Te=Math.ceil((ue-ie)/ge),se=Gt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!se){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var Fe=[],Ne=0;Ne4294967296;)D+=L;return D},O}(),Et=Ye,tn=function(){function O(A){this.observer=A}var G=O.prototype;return G.destroy=function(){},G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.remux=function(D,x,L,W,k,Q,V,re){var ie=this.observer,ue="";D&&(ue+="audio"),x&&(ue+="video"),ie.trigger(i.default.FRAG_PARSING_DATA,{data1:re,startPTS:k,startDTS:k,type:ue,hasAudio:!!D,hasVideo:!!x,nb:1,dropped:0}),ie.trigger(i.default.FRAG_PARSED)},O}(),Be=tn,ft=Object(h.getSelfScope)(),Sn;try{Sn=ft.performance.now.bind(ft.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),Sn=ft.Date.now}var gt=function(){function O(A,D,x,L){this.observer=A,this.typeSupported=D,this.config=x,this.vendor=L}var G=O.prototype;return G.destroy=function(){var D=this.demuxer;D&&D.destroy()},G.push=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Te=this;if(D.byteLength>0&&x!=null&&x.key!=null&&x.method==="AES-128"){var se=this.decrypter;se==null&&(se=this.decrypter=new v.default(this.observer,this.config));var Fe=Sn();se.decrypt(D,x.key.buffer,x.iv.buffer,function(Ne){var Ve=Sn();Te.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:Fe,tdecrypt:Ve}}),Te.pushDecrypted(new Uint8Array(Ne),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)})}else this.pushDecrypted(new Uint8Array(D),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)},G.pushDecrypted=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Te=this.demuxer;if(!Te||(V||re)&&!this.probe(D)){for(var se=this.observer,Fe=this.typeSupported,Ne=this.config,Ve=[{demux:Pt,remux:Et},{demux:de.default,remux:Be},{demux:ee,remux:Et},{demux:Ot,remux:Et}],xt=0,Xt=Ve.length;xt1?U-1:0),Y=1;Y1?U-1:0),Y=1;Y0)return y.subarray(S,S+C)},h._readSize=function(y,E){var S=0;return S=(y[E]&127)<<21,S|=(y[E+1]&127)<<14,S|=(y[E+2]&127)<<7,S|=y[E+3]&127,S},h.getTimeStamp=function(y){for(var E=h.getID3Frames(y),S=0;S>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:Z+=String.fromCharCode(H);break;case 12:case 13:Y=y[ne++],Z+=String.fromCharCode((H&31)<<6|Y&63);break;case 14:Y=y[ne++],J=y[ne++],Z+=String.fromCharCode((H&15)<<12|(Y&63)<<6|(J&63)<<0);break;default:}}return Z},h}(),v;function b(){var h=Object(i.getSelfScope)();return!v&&typeof h.TextDecoder!="undefined"&&(v=new h.TextDecoder("utf-8")),v}var d=l._utf8ArrayToStr;n.default=l},"./src/demux/mp4demuxer.js":function(e,n,r){"use strict";r.r(n);var i=r("./src/utils/logger.js"),l=r("./src/events.js"),v=Math.pow(2,32)-1,b=function(){function d(N,y){this.observer=N,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,E,S,C){if(y&&y.byteLength){var M=this.initData=d.parseInitSegment(y);E==null&&(E="mp4a.40.5"),S==null&&(S="avc1.42e01e");var U={};M.audio&&M.video?U.audiovideo={container:"video/mp4",codec:E+","+S,initSegment:C?y:null}:(M.audio&&(U.audio={container:"audio/mp4",codec:E,initSegment:C?y:null}),M.video&&(U.video={container:"video/mp4",codec:S,initSegment:C?y:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:U})}else E&&(this.audioCodec=E),S&&(this.videoCodec=S)},d.probe=function(y){return d.findBox({data:y,start:0,end:Math.min(y.length,16384)},["moof"]).length>0},d.bin2str=function(y){return String.fromCharCode.apply(null,y)},d.readUint16=function(y,E){y.data&&(E+=y.start,y=y.data);var S=y[E]<<8|y[E+1];return S<0?65536+S:S},d.readUint32=function(y,E){y.data&&(E+=y.start,y=y.data);var S=y[E]<<24|y[E+1]<<16|y[E+2]<<8|y[E+3];return S<0?4294967296+S:S},d.writeUint32=function(y,E,S){y.data&&(E+=y.start,y=y.data),y[E]=S>>24,y[E+1]=S>>16&255,y[E+2]=S>>8&255,y[E+3]=S&255},d.findBox=function(y,E){var S=[],C,M,U,H,Y,J,Z;if(y.data?(J=y.start,H=y.end,y=y.data):(J=0,H=y.byteLength),!E.length)return null;for(C=J;C1?C+M:H,U===E[0]&&(E.length===1?S.push({data:y,start:C+8,end:Z}):(Y=d.findBox({data:y,start:C+8,end:Z},E.slice(1)),Y.length&&(S=S.concat(Y)))),C=Z;return S},d.parseSegmentIndex=function(y){var E=d.findBox(y,["moov"])[0],S=E?E.end:null,C=0,M=d.findBox(y,["sidx"]),U;if(!M||!M[0])return null;U=[],M=M[0];var H=M.data[0];C=H===0?8:16;var Y=d.readUint32(M,C);C+=4;var J=0,Z=0;H===0?C+=8:C+=16,C+=2;var ne=M.end+Z,ee=d.readUint16(M,C);C+=2;for(var de=0;de>>31;if(Je===1){console.warn("SIDX has hierarchical references (not supported)");return}var en=d.readUint32(M,ve);ve+=4,U.push({referenceSize:Ge,subsegmentDuration:en,info:{duration:en/Y,start:ne,end:ne+Ge-1}}),ne+=Ge,ve+=4,C=ve}return{earliestPresentationTime:J,timescale:Y,version:H,referencesCount:ee,references:U,moovEndOffset:S}},d.parseInitSegment=function(y){var E=[],S=d.findBox(y,["moov","trak"]);return S.forEach(function(C){var M=d.findBox(C,["tkhd"])[0];if(M){var U=M.data[M.start],H=U===0?12:20,Y=d.readUint32(M,H),J=d.findBox(C,["mdia","mdhd"])[0];if(J){U=J.data[J.start],H=U===0?12:20;var Z=d.readUint32(J,H),ne=d.findBox(C,["mdia","hdlr"])[0];if(ne){var ee=d.bin2str(ne.data.subarray(ne.start+8,ne.start+12)),de={soun:"audio",vide:"video"}[ee];if(de){var ve=d.findBox(C,["mdia","minf","stbl","stsd"]);if(ve.length){ve=ve[0];var We=d.bin2str(ve.data.subarray(ve.start+12,ve.start+16));i.logger.log("MP4Demuxer:"+de+":"+We+" found")}E[Y]={timescale:Z,type:de},E[de]={timescale:Z,id:Y}}}}}}),E},d.getStartDTS=function(y,E){var S,C,M;return S=d.findBox(E,["moof","traf"]),C=[].concat.apply([],S.map(function(U){return d.findBox(U,["tfhd"]).map(function(H){var Y,J,Z;return Y=d.readUint32(H,4),J=y[Y].timescale||9e4,Z=d.findBox(U,["tfdt"]).map(function(ne){var ee,de;return ee=ne.data[ne.start],de=d.readUint32(ne,4),ee===1&&(de*=Math.pow(2,32),de+=d.readUint32(ne,8)),de})[0],Z/J})})),M=Math.min.apply(null,C),isFinite(M)?M:0},d.offsetStartDTS=function(y,E,S){d.findBox(E,["moof","traf"]).map(function(C){return d.findBox(C,["tfhd"]).map(function(M){var U=d.readUint32(M,4),H=y[U].timescale||9e4;d.findBox(C,["tfdt"]).map(function(Y){var J=Y.data[Y.start],Z=d.readUint32(Y,4);if(J===0)d.writeUint32(Y,4,Z-S*H);else{Z*=Math.pow(2,32),Z+=d.readUint32(Y,8),Z-=S*H,Z=Math.max(Z,0);var ne=Math.floor(Z/(v+1)),ee=Math.floor(Z%(v+1));d.writeUint32(Y,4,ne),d.writeUint32(Y,8,ee)}})})})},h.append=function(y,E,S,C){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var U,H=this.initPTS;if(H===void 0){var Y=d.getStartDTS(M,y);this.initPTS=H=Y-E,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:H})}d.offsetStartDTS(M,y,H),U=d.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,U,S,C,y)},h.destroy=function(){},d}();n.default=b},"./src/errors.ts":function(e,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return i}),r.d(n,"ErrorDetails",function(){return l});var i;(function(v){v.NETWORK_ERROR="networkError",v.MEDIA_ERROR="mediaError",v.KEY_SYSTEM_ERROR="keySystemError",v.MUX_ERROR="muxError",v.OTHER_ERROR="otherError"})(i||(i={}));var l;(function(v){v.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",v.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",v.KEY_SYSTEM_NO_SESSION="keySystemNoSession",v.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",v.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",v.MANIFEST_LOAD_ERROR="manifestLoadError",v.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",v.MANIFEST_PARSING_ERROR="manifestParsingError",v.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",v.LEVEL_LOAD_ERROR="levelLoadError",v.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",v.LEVEL_SWITCH_ERROR="levelSwitchError",v.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",v.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",v.FRAG_LOAD_ERROR="fragLoadError",v.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",v.FRAG_DECRYPT_ERROR="fragDecryptError",v.FRAG_PARSING_ERROR="fragParsingError",v.REMUX_ALLOC_ERROR="remuxAllocError",v.KEY_LOAD_ERROR="keyLoadError",v.KEY_LOAD_TIMEOUT="keyLoadTimeOut",v.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",v.BUFFER_APPEND_ERROR="bufferAppendError",v.BUFFER_APPENDING_ERROR="bufferAppendingError",v.BUFFER_STALLED_ERROR="bufferStalledError",v.BUFFER_FULL_ERROR="bufferFullError",v.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",v.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",v.INTERNAL_EXCEPTION="internalException"})(l||(l={}))},"./src/events.js":function(e,n,r){"use strict";r.r(n);var i={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition",LIVE_BACK_BUFFER_REACHED:"hlsLiveBackBufferReached"};n.default=i},"./src/hls.ts":function(e,n,r){"use strict";r.r(n);var i={};r.r(i),r.d(i,"newCue",function(){return Sv});var l=r("./node_modules/url-toolkit/src/url-toolkit.js"),v=r("./src/errors.ts"),b=r("./src/polyfills/number-isFinite.js"),d=r("./src/events.js"),h=r("./src/utils/logger.js"),N={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=function(){function g(u){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=u,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return t},p.setDecryptDataFromLevelKey=function(o,t){var a=o;return o&&o.method&&o.uri&&!o.iv&&(a=new Y(o.baseuri,o.reluri),a.method=o.method,a.iv=this.createInitializationVector(t)),a},Z(g,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(l.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(o){this._url=o}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var o=this.sn;typeof o!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&h.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),o=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,o)}return this._decryptdata}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(b.isFiniteNumber)(this.programDateTime))return null;var o=Object(b.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+o*1e3}},{key:"encrypted",get:function(){return!!(this.decryptdata&&this.decryptdata.uri!==null&&this.decryptdata.key===null)}}]),g}();function de(g,p){for(var u=0;uNumber.MAX_SAFE_INTEGER?1/0:t},p.hexadecimalInteger=function(o){if(this[o]){var t=(this[o]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var a=new Uint8Array(t.length/2),c=0;cNumber.MAX_SAFE_INTEGER?1/0:t},p.decimalFloatingPoint=function(o){return parseFloat(this[o])},p.enumeratedString=function(o){return this[o]},p.decimalResolution=function(o){var t=Ge.exec(this[o]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},g.parseAttrList=function(o){var t,a={};for(Je.lastIndex=0;(t=Je.exec(o))!==null;){var c=t[2],_='"';c.indexOf(_)===0&&c.lastIndexOf(_)===c.length-1&&(c=c.slice(1,-1)),a[t[1]]=c}return a},g}(),an=en,it={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function ht(g,p){var u=it[p];return!!u&&u[g.slice(0,4)]===!0}function Pt(g,p){return MediaSource.isTypeSupported((p||"video")+'/mp4;codecs="'+g+'"')}var Qt=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Ot=/#EXT-X-MEDIA:(.*)/g,wt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Gt=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,Mt=/\.(mp4|m4s|m4v|m4a)$/i,ct=function(){function g(){}return g.findGroup=function(u,o){for(var t=0;t2?(t=o.shift()+".",t+=parseInt(o.shift()).toString(16),t+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):t=u,t},g.resolve=function(u,o){return l.buildAbsoluteURL(o,u,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(u,o){var t=[];Qt.lastIndex=0;function a(I,j){["video","audio"].forEach(function(P){var q=I.filter(function(fe){return ht(fe,P)});if(q.length){var ae=q.filter(function(fe){return fe.lastIndexOf("avc1",0)===0||fe.lastIndexOf("mp4a",0)===0});j[P+"Codec"]=ae.length>0?ae[0]:q[0],I=I.filter(function(fe){return q.indexOf(fe)===-1})}}),j.unknownCodecs=I}for(var c;(c=Qt.exec(u))!=null;){var _={},R=_.attrs=new an(c[1]);_.url=g.resolve(c[2],o);var T=R.decimalResolution("RESOLUTION");T&&(_.width=T.width,_.height=T.height),_.bitrate=R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),_.name=R.NAME,a([].concat((R.CODECS||"").split(/[ ,]+/)),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=g.convertAVC1ToAVCOTI(_.videoCodec)),t.push(_)}return t},g.parseMasterPlaylistMedia=function(u,o,t,a){a===void 0&&(a=[]);var c,_=[],R=0;for(Ot.lastIndex=0;(c=Ot.exec(u))!==null;){var T=new an(c[1]);if(T.TYPE===t){var I={id:R++,groupId:T["GROUP-ID"],name:T.NAME||T.LANGUAGE,type:t,default:T.DEFAULT==="YES",autoselect:T.AUTOSELECT==="YES",forced:T.FORCED==="YES",lang:T.LANGUAGE};if(T.URI&&(I.url=g.resolve(T.URI,o)),a.length){var j=g.findGroup(a,I.groupId);I.audioCodec=j?j.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(u,o,t,a,c){var _=0,R=0,T=new We(o),I=0,j=null,P=new ee,q,ae,fe,De=null;for(wt.lastIndex=0;(q=wt.exec(u))!==null;){var ze=q[1];if(ze){P.duration=parseFloat(ze);var ke=(" "+q[2]).slice(1);P.title=ke||null,P.tagList.push(ke?["INF",ze,ke]:["INF",ze])}else if(q[3]){if(Object(b.isFiniteNumber)(P.duration)){var qe=_++;P.type=a,P.start=R,fe&&(P.levelkey=fe),P.sn=qe,P.level=t,P.cc=I,P.urlId=c,P.baseurl=o,P.relurl=(" "+q[3]).slice(1),me(P,j),T.fragments.push(P),j=P,R+=P.duration,P=new ee}}else if(q[4]){var Ze=(" "+q[4]).slice(1);j?P.setByteRange(Ze,j):P.setByteRange(Ze)}else if(q[5])P.rawProgramDateTime=(" "+q[5]).slice(1),P.tagList.push(["PROGRAM-DATE-TIME",P.rawProgramDateTime]),De===null&&(De=T.fragments.length);else{if(q=q[0].match(Gt),!q){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae=0&&(fe.method=jt,fe.key=null,fe.iv=pt));break}case"START":{var Qn=new an(_t),iu=Qn.decimalFloatingPoint("TIME-OFFSET");Object(b.isFiniteNumber)(iu)&&(T.startTimeOffset=iu);break}case"MAP":{var uu=new an(_t);P.relurl=uu.URI,uu.BYTERANGE&&P.setByteRange(uu.BYTERANGE),P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,P=new ee,P.rawProgramDateTime=T.initSegment.rawProgramDateTime;break}default:h.logger.warn("line parsed but not handled: "+q);break}}}return P=j,P&&!P.relurl&&(T.fragments.pop(),R-=P.duration),T.totalduration=R,T.averagetargetduration=R/T.fragments.length,T.endSN=_-1,T.startCC=T.fragments[0]?T.fragments[0].cc:0,T.endCC=I,!T.initSegment&&T.fragments.length&&T.fragments.every(function(Zv){return Mt.test(Zv.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),P=new ee,P.relurl=T.fragments[0].relurl,P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,T.needSidxRanges=!0),De&&Mn(T.fragments,De),T},g}();function Mn(g,p){for(var u=g[p],o=p-1;o>=0;o--){var t=g[o];t.programDateTime=u.programDateTime-t.duration*1e3,u=t}}function me(g,p){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):p&&p.programDateTime&&(g.programDateTime=p.endProgramDateTime),Object(b.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}function st(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var St=window,Pe=St.performance,Ce=function(g){st(p,g);function p(o){var t;return t=g.call(this,o,d.default.MANIFEST_LOADING,d.default.LEVEL_LOADING,d.default.AUDIO_TRACK_LOADING,d.default.SUBTITLE_TRACK_LOADING)||this,t.loaders={},t}p.canHaveQualityLevels=function(t){return t!==S.AUDIO_TRACK&&t!==S.SUBTITLE_TRACK},p.mapContextToLevelType=function(t){var a=t.type;switch(a){case S.AUDIO_TRACK:return C.AUDIO;case S.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},p.getResponseUrl=function(t,a){var c=t.url;return(c===void 0||c.indexOf("data:")===0)&&(c=a.url),c};var u=p.prototype;return u.createInternalLoader=function(t){var a=this.hls.config,c=a.pLoader,_=a.loader,R=c||_,T=new R(a);return t.loader=T,this.loaders[t.type]=T,T},u.getInternalLoader=function(t){return this.loaders[t.type]},u.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},u.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},u.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},u.onManifestLoading=function(t){this.load({url:t.url,type:S.MANIFEST,level:0,id:null,responseType:"text"})},u.onLevelLoading=function(t){this.load({url:t.url,type:S.LEVEL,level:t.level,id:t.id,responseType:"text"})},u.onAudioTrackLoading=function(t){this.load({url:t.url,type:S.AUDIO_TRACK,level:null,id:t.id,responseType:"text"})},u.onSubtitleTrackLoading=function(t){this.load({url:t.url,type:S.SUBTITLE_TRACK,level:null,id:t.id,responseType:"text"})},u.load=function(t){var a=this.hls.config;h.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var c=this.getInternalLoader(t);if(c){var _=c.context;if(_&&_.url===t.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+t.type),c.abort()}var R,T,I,j;switch(t.type){case S.MANIFEST:R=a.manifestLoadingMaxRetry,T=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,j=a.manifestLoadingMaxRetryTimeout;break;case S.LEVEL:R=0,j=0,I=0,T=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,T=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,j=a.levelLoadingMaxRetryTimeout;break}c=this.createInternalLoader(t);var P={timeout:T,maxRetry:R,retryDelay:I,maxRetryDelay:j},q={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return h.logger.debug("Calling internal loader delegate for URL: "+t.url),c.load(t,P,q),!0},u.loadsuccess=function(t,a,c,_){if(_===void 0&&(_=null),c.isSidxRequest){this._handleSidxRequest(t,c),this._handlePlaylistLoaded(t,a,c,_);return}if(this.resetInternalLoader(c.type),typeof t.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=t.data;if(a.tload=Pe.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(t,c,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,a,c,_):this._handleMasterPlaylist(t,a,c,_)},u.loaderror=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!1,t)},u.loadtimeout=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!0)},u._handleMasterPlaylist=function(t,a,c,_){var R=this.hls,T=t.data,I=p.getResponseUrl(t,c),j=ct.parseMasterPlaylist(T,I);if(!j.length){this._handleManifestParsingError(t,c,"no level found in manifest",_);return}var P=j.map(function(De){return{id:De.attrs.AUDIO,codec:De.audioCodec}}),q=ct.parseMasterPlaylistMedia(T,I,"AUDIO",P),ae=ct.parseMasterPlaylistMedia(T,I,"SUBTITLES");if(q.length){var fe=!1;q.forEach(function(De){De.url||(fe=!0)}),fe===!1&&j[0].audioCodec&&!j[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),q.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(d.default.MANIFEST_LOADED,{levels:j,audioTracks:q,subtitles:ae,url:I,stats:a,networkDetails:_})},u._handleTrackOrLevelPlaylist=function(t,a,c,_){var R=this.hls,T=c.id,I=c.level,j=c.type,P=p.getResponseUrl(t,c),q=Object(b.isFiniteNumber)(T)?T:0,ae=Object(b.isFiniteNumber)(I)?I:q,fe=p.mapContextToLevelType(c),De=ct.parseLevelPlaylist(t.data,P,ae,fe,q);if(De.tload=a.tload,j===S.MANIFEST){var ze={url:P,details:De};R.trigger(d.default.MANIFEST_LOADED,{levels:[ze],audioTracks:[],url:P,stats:a,networkDetails:_})}if(a.tparsed=Pe.now(),De.needSidxRanges){var ke=De.initSegment.url;this.load({url:ke,isSidxRequest:!0,type:j,level:I,levelDetails:De,id:T,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}c.levelDetails=De,this._handlePlaylistLoaded(t,a,c,_)},u._handleSidxRequest=function(t,a){if(typeof t.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var c=M.default.parseSegmentIndex(new Uint8Array(t.data));if(!!c){var _=c.references,R=a.levelDetails;_.forEach(function(T,I){var j=T.info;if(!!R){var P=R.fragments[I];P.byteRange.length===0&&P.setByteRange(String(1+j.end-j.start)+"@"+String(j.start))}}),R&&R.initSegment.setByteRange(String(c.moovEndOffset)+"@0")}},u._handleManifestParsingError=function(t,a,c,_){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:c,networkDetails:_})},u._handleNetworkError=function(t,a,c,_){c===void 0&&(c=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+t.type+"-type playlist");var R,T,I=this.getInternalLoader(t);switch(t.type){case S.MANIFEST:R=c?v.ErrorDetails.MANIFEST_LOAD_TIMEOUT:v.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case S.LEVEL:R=c?v.ErrorDetails.LEVEL_LOAD_TIMEOUT:v.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case S.AUDIO_TRACK:R=c?v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;default:T=!1}I&&(I.abort(),this.resetInternalLoader(t.type));var j={type:v.ErrorTypes.NETWORK_ERROR,details:R,fatal:T,url:t.url,loader:I,context:t,networkDetails:a};_&&(j.response=_),this.hls.trigger(d.default.ERROR,j)},u._handlePlaylistLoaded=function(t,a,c,_){var R=c.type,T=c.level,I=c.id,j=c.levelDetails;if(!j||!j.targetduration){this._handleManifestParsingError(t,c,"invalid target duration",_);return}var P=p.canHaveQualityLevels(c.type);if(P)this.hls.trigger(d.default.LEVEL_LOADED,{details:j,level:T||0,id:I||0,stats:a,networkDetails:_});else switch(R){case S.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break;case S.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break}},p}(E),_e=Ce;function et(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Ye=function(g){et(p,g);function p(o){var t;return t=g.call(this,o,d.default.FRAG_LOADING)||this,t.loaders={},t}var u=p.prototype;return u.destroy=function(){var t=this.loaders;for(var a in t){var c=t[a];c&&c.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onFragLoading=function(t){var a=t.frag,c=a.type,_=this.loaders,R=this.hls.config,T=R.fLoader,I=R.loader;a.loaded=0;var j=_[c];j&&(h.logger.warn("abort previous fragment loader for type: "+c),j.abort()),j=_[c]=a.loader=R.fLoader?new T(R):new I(R);var P,q,ae;P={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var fe=a.byteRangeStartOffset,De=a.byteRangeEndOffset;Object(b.isFiniteNumber)(fe)&&Object(b.isFiniteNumber)(De)&&(P.rangeStart=fe,P.rangeEnd=De),q={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},ae={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},j.load(P,q,ae)},u.loadsuccess=function(t,a,c,_){_===void 0&&(_=null);var R=t.data,T=c.frag;T.loader=void 0,this.loaders[T.type]=void 0,this.hls.trigger(d.default.FRAG_LOADED,{payload:R,frag:T,stats:a,networkDetails:_})},u.loaderror=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a.frag,response:t,networkDetails:c})},u.loadtimeout=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a.frag,networkDetails:c})},u.loadprogress=function(t,a,c,_){_===void 0&&(_=null);var R=a.frag;R.loaded=t.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:t,networkDetails:_})},p}(E),Et=Ye;function tn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Be=function(g){tn(p,g);function p(o){var t;return t=g.call(this,o,d.default.KEY_LOADING)||this,t.loaders={},t.decryptkey=null,t.decrypturl=null,t}var u=p.prototype;return u.destroy=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onKeyLoading=function(t){var a=t.frag,c=a.type,_=this.loaders[c];if(!a.decryptdata){h.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=a.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var T=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+c),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[c]=new T.loader(T),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,responseType:"arraybuffer"},j={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:T.fragLoadingRetryDelay,maxRetryDelay:T.fragLoadingMaxRetryTimeout},P={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.loader.load(I,j,P)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},u.loadsuccess=function(t,a,c){var _=c.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(t.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},u.loaderror=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:t})},u.loadtimeout=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},p}(E),ft=Be;function Sn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var gt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},kr=function(g){Sn(p,g);function p(o){var t;return t=g.call(this,o,d.default.BUFFER_APPENDED,d.default.FRAG_BUFFERED,d.default.FRAG_LOADED)||this,t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=o.config,t}var u=p.prototype;return u.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,E.prototype.destroy.call(this),g.prototype.destroy.call(this)},u.getBufferedFrag=function(t,a){var c=this.fragments,_=Object.keys(c).filter(function(T){var I=c[T];if(I.body.type!==a||!I.buffered)return!1;var j=I.body;return j.startPTS<=t&&t<=j.endPTS});if(_.length===0)return null;var R=_.pop();return c[R].body},u.detectEvictedFragments=function(t,a){var c=this,_,R;Object.keys(this.fragments).forEach(function(T){var I=c.fragments[T];if(I.buffered===!0){var j=I.range[t];if(j){_=j.time;for(var P=0;P<_.length;P++)if(R=_[P],c.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){c.removeFragment(I.body);break}}}})},u.detectPartialFragments=function(t){var a=this,c=this.getFragmentKey(t),_=this.fragments[c];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(t.hasElementaryStream(R)){var T=a.timeRanges[R];_.range[R]=a.getBufferedTimes(t.startPTS,t.endPTS,T)}}))},u.getBufferedTimes=function(t,a,c){for(var _=[],R,T,I=!1,j=0;j=R&&a<=T){_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))});break}else if(tR)_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},u.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},u.getPartialFragment=function(t){var a=this,c,_,R,T=null,I=0;return Object.keys(this.fragments).forEach(function(j){var P=a.fragments[j];a.isPartial(P)&&(_=P.body.startPTS-a.bufferPadding,R=P.body.endPTS+a.bufferPadding,t>=_&&t<=R&&(c=Math.min(t-_,R-t),I<=c&&(T=P.body,I=c)))}),T},u.getState=function(t){var a=this.getFragmentKey(t),c=this.fragments[a],_=gt.NOT_LOADED;return c!==void 0&&(c.buffered?this.isPartial(c)===!0?_=gt.PARTIAL:_=gt.OK:_=gt.APPENDING),_},u.isPartial=function(t){return t.buffered===!0&&(t.range.video!==void 0&&t.range.video.partial===!0||t.range.audio!==void 0&&t.range.audio.partial===!0)},u.isTimeBuffered=function(t,a,c){for(var _,R,T=0;T=_&&a<=R)return!0;if(a<=_)return!1}return!1},u.onFragLoaded=function(t){var a=t.frag;!Object(b.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},u.onBufferAppended=function(t){var a=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(c){var _=a.timeRanges[c];a.detectEvictedFragments(c,_)})},u.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},u.hasFragment=function(t){var a=this.getFragmentKey(t);return this.fragments[a]!==void 0},u.removeFragment=function(t){var a=this.getFragmentKey(t);delete this.fragments[a]},u.removeAllFragments=function(){this.fragments=Object.create(null)},p}(E),O={search:function(p,u){for(var o=0,t=p.length-1,a=null,c=null;o<=t;){a=(o+t)/2|0,c=p[a];var _=u(c);if(_>0)o=a+1;else if(_<0)t=a-1;else return c}return null}},G=O,A=function(){function g(){}return g.isBuffered=function(u,o){try{if(u){for(var t=u.buffered,a=0;a=t.start(a)&&o<=t.end(a))return!0}}catch{}return!1},g.bufferInfo=function(u,o,t){try{if(u){var a=u.buffered,c=[],_;for(_=0;_R&&(a[_-1].end=u[c].end):a.push(u[c])}else a.push(u[c])}else a=u;for(var T=0,I,j=o,P=o,q=0;q=ae&&o1?a-1:0),_=1;_p?(o.duration=a-o.start,o.duration<0&&h.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):(t.duration=o.start-a,t.duration<0&&h.logger.warn("negative duration computed for frag "+t.sn+",level "+t.level+", there should be some duration drift between playlist and fragment!")):u>p?t.start=o.start+o.duration:t.start=Math.max(o.start-t.duration,0)}function se(g,p,u,o,t,a){var c=u;if(Object(b.isFiniteNumber)(p.startPTS)){var _=Math.abs(p.startPTS-u);Object(b.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(_,p.deltaPTS):p.deltaPTS=_,c=Math.max(u,p.startPTS),u=Math.min(u,p.startPTS),o=Math.max(o,p.endPTS),t=Math.min(t,p.startDTS),a=Math.max(a,p.endDTS)}var R=u-p.start;p.start=p.startPTS=u,p.maxStartPTS=c,p.endPTS=o,p.startDTS=t,p.endDTS=a,p.duration=o-u;var T=p.sn;if(!g||Tg.endSN)return 0;var I,j,P;for(I=T-g.startSN,j=g.fragments,j[I]=p,P=I;P>0;P--)Te(j,P,P-1);for(P=I;Po.length))for(var a=0;ap?-1:0})}function Dt(g,p,u){var o=!1;return p&&p.details&&u&&(u.endCC>u.startCC||g&&g.cc=(t||0))return null;u=u||0;for(var a=0;ag&&u.start?-1:0}function In(g,p,u){var o=Math.min(p,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,t=u.endProgramDateTime||0;return t-o>g}var mr=250,_r=2,Kn=.1,Ln=.05,Sr=function(){function g(u,o,t,a){this.config=u,this.media=o,this.fragmentTracker=t,this.hls=a,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var p=g.prototype;return p.poll=function(o){var t=this.config,a=this.media,c=this.stalled,_=a.currentTime,R=a.seeking,T=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,c!==null){if(this.stallReported){var j=self.performance.now()-c;h.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(j)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((I||T)&&(this.stalled=null),!(a.paused||a.ended||a.playbackRate===0||!a.buffered.length)){var P=A.bufferInfo(a,_,0),q=P.len>0,ae=P.nextStart||0;if(!(!q&&!ae)){if(R){var fe=P.len>_r,De=!ae||ae-_>_r;if(fe||De)return;this.moved=!1}if(!this.moved&&this.stalled){var ze=Math.max(ae,P.start||0)-_;if(ze>0&&ze<=_r){this._trySkipBufferHole(null);return}}var ke=self.performance.now();if(c===null){this.stalled=ke;return}var qe=ke-c;!R&&qe>=mr&&this._reportStall(P.len);var Ze=A.bufferInfo(a,_,t.maxBufferHole);this._tryFixBufferStall(Ze,qe)}}},p._tryFixBufferStall=function(o,t){var a=this.config,c=this.fragmentTracker,_=this.media,R=_.currentTime,T=c.getPartialFragment(R);if(T){var I=this._trySkipBufferHole(T);if(I)return}o.len>a.maxBufferHole&&t>a.highBufferWatchdogPeriod*1e3&&(h.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(o){var t=this.hls,a=this.media,c=this.stallReported;c||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),t.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},p._trySkipBufferHole=function(o){for(var t=this.config,a=this.hls,c=this.media,_=c.currentTime,R=0,T=0;T=R&&_1?a-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},u.doTick=function(){},p}(E);function yo(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var te={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},ja=function(g){yo(p,g);function p(){return g.apply(this,arguments)||this}var u=p.prototype;return u.doTick=function(){},u.startLoad=function(){},u.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED},u._streamEnded=function(t,a){var c=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&c&&!c.backtracked&&c.sn===a.endSN&&!t.nextStart){var R=_.getState(c);return R===gt.PARTIAL||R===gt.OK}return!1},u.onMediaSeeking=function(){var t=this.config,a=this.media,c=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,T=A.bufferInfo(c||a,R,this.config.maxBufferHole);if(Object(b.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===te.FRAG_LOADING){var I=this.fragCurrent;if(T.len===0&&I){var j=t.maxFragLookUpTolerance,P=I.start-j,q=I.start+I.duration+j;Rq?(I.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),I.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===te.ENDED&&(T.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=te.IDLE);a&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=te.STOPPED,this.fragmentTracker=null},u.computeLivePosition=function(t,a){var c=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return t+Math.max(0,a.totalduration-c)},p}(ro);function Na(g,p){for(var u=0;u0&&t===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),t=a),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=te.STOPPED},u.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},u.doTick=function(){switch(this.state){case te.BUFFER_FLUSHING:this.fragLoadError=0;break;case te.IDLE:this._doTickIdle();break;case te.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=te.IDLE);break;case te.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),c=this.retryDate;(!c||a>=c||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.ERROR:case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},u._doTickIdle=function(){var t=this.hls,a=t.config,c=this.media;if(!(this.levelLastLoaded===void 0||!c&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=c.currentTime:_=this.nextLoadPosition;var R=t.nextLoadLevel,T=this.levels[R];if(!!T){var I=T.bitrate,j;I?j=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):j=a.maxBufferLength,j=Math.min(j,a.maxMaxBufferLength);var P=A.bufferInfo(this.mediaBuffer?this.mediaBuffer:c,_,a.maxBufferHole),q=P.len;if(!(q>=j)){h.logger.trace("buffer length of "+q.toFixed(3)+" is below max of "+j.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=R;var ae=T.details;if(!ae||ae.live&&this.levelLastLoaded!==R){this.state=te.WAITING_LEVEL;return}if(this._streamEnded(P,ae)){var fe={};this.altAudio&&(fe.type="video"),this.hls.trigger(d.default.BUFFER_EOS,fe),this.state=te.ENDED;return}this._fetchPayloadOrEos(_,P,ae)}}}},u._fetchPayloadOrEos=function(t,a,c){var _=this.fragPrevious,R=this.level,T=c.fragments,I=T.length;if(I!==0){var j=T[0].start,P=T[I-1].start+T[I-1].duration,q=a.end,ae;if(c.initSegment&&!c.initSegment.data)ae=c.initSegment;else if(c.live){var fe=this.config.initialLiveManifestSize;if(Ife&&fe>P.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+fe.toFixed(3)),P.currentTime=fe),this.nextLoadPosition=fe}if(t.PTSKnown&&a>_&&P&&P.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(R)if(t.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),q=or(T,R.endProgramDateTime,j.maxFragLookUpTolerance);else{var De=R.sn+1;if(De>=t.startSN&&De<=t.endSN){var ze=T[De-t.startSN];R.cc===ze.cc&&(q=ze,h.logger.log("live playlist, switching playlist, load frag with next SN: "+q.sn))}q||(q=G.search(T,function(ke){return R.cc-ke.cc}),q&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+q.sn))}q||(q=T[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+q.sn))}return q},u._findFragment=function(t,a,c,_,R,T,I){var j=this.hls.config,P;if(RT-j.maxFragLookUpTolerance?0:j.maxFragLookUpTolerance;P=wn(a,_,R,q)}else P=_[c-1];if(P){var ae=P.sn-I.startSN,fe=a&&P.level===a.level,De=_[ae-1],ze=_[ae+1];if(a&&P.sn===a.sn)if(fe&&!P.backtracked)if(P.snj.maxBufferHole&&a.dropped&&ae?(P=De,h.logger.warn("Previous fragment was dropped with large PTS gap between audio and video. Maybe fragment is not starting with a keyframe? Loading previous one to try to overcome this")):(P=ze,h.logger.log("Re-loading fragment with SN: "+P.sn))}else P=null;else P.backtracked&&(ze&&ze.backtracked?(h.logger.warn("Already backtracked from fragment "+ze.sn+", will not backtrack to fragment "+P.sn+". Loading fragment "+ze.sn),P=ze):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),P.dropped=0,De?(P=De,P.backtracked=!0):ae&&(P=null)))}return P},u._loadKey=function(t){this.state=te.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:t})},u._loadFragment=function(t){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,t.sn!=="initSegment"&&(this.startFragRequested=!0),Object(b.isFiniteNumber)(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||a===gt.NOT_LOADED||a===gt.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new le(this.hls,"main")),this.state=te.FRAG_LOADING):a===gt.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},u.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,C.MAIN)},u.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},u._checkFragmentChanged=function(){var t,a,c=this.media;if(c&&c.readyState&&c.seeking===!1&&(a=c.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),A.isBuffered(c,a)?t=this.getBufferedFrag(a):A.isBuffered(c,a+.1)&&(t=this.getBufferedFrag(a+.1)),t)){var _=t;if(_!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(d.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},u.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,a;t?(a=t.paused,t.pause()):a=!0,this.previouslyPaused=a}var c=this.fragCurrent;c&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},u.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,A.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},u.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var a,c,_;if(c=this.getBufferedFrag(t.currentTime),c&&c.startPTS>1&&this.flushMainBuffer(0,c.startPTS-1),t.paused)a=0;else{var R=this.hls.nextLoadLevel,T=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?a=this.fragCurrent.duration*T.bitrate/(1e3*I)+1:a=0}if(_=this.getBufferedFrag(t.currentTime+a),_&&(_=this.followingBufferedFrag(_),_)){var j=this.fragCurrent;j&&j.loader&&j.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},u.flushMainBuffer=function(t,a){this.state=te.BUFFER_FLUSHING;var c={startOffset:t,endOffset:a};this.altAudio&&(c.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,c)},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("seeked",this.onvseeked),a.addEventListener("ended",this.onvended);var c=this.config;this.levels&&c.autoStartLoad&&this.hls.startLoad(c.startPosition),this.gapController=new Sr(c,a,this.fragmentTracker,this.hls)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(c){c.details&&c.details.fragments.forEach(function(_){_.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},u.onMediaSeeked=function(){var t=this.media,a=t?t.currentTime:void 0;Object(b.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},u.onManifestLoading=function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},u.onManifestParsed=function(t){var a=!1,c=!1,_;t.levels.forEach(function(T){_=T.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(c=!0))}),this.audioCodecSwitch=a&&c,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=t.altAudio,this.levels=t.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},u.onLevelLoaded=function(t){var a=t.details,c=t.level,_=this.levels[this.levelLastLoaded],R=this.levels[c],T=a.totalduration,I=0;if(h.logger.log("level "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+T),a.live){var j=R.details;j&&a.fragments.length>0?(Fe(j,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,j),a.PTSKnown&&Object(b.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),Fn(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,Fn(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=c,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:c}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var P=a.startTimeOffset;Object(b.isFiniteNumber)(P)?(P<0&&(h.logger.log("negative start time offset "+P+", count from end of last fragment"),P=I+T+P),h.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):a.live?(this.startPosition=this.computeLivePosition(I,a),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_LEVEL&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=this.hls,_=this.levels,R=this.media,T=t.frag;if(this.state===te.FRAG_LOADING&&a&&T.type==="main"&&T.level===a.level&&T.sn===a.sn){var I=t.stats,j=_[a.level],P=j.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level),T.bitrateTest&&c.nextLoadLevel)this.state=te.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(T.sn==="initSegment")this.state=te.IDLE,I.tparsed=I.tbuffered=window.performance.now(),P.initSegment.data=t.payload,c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level+", cc "+a.cc),this.state=te.PARSING,this.pendingBuffering=!0,this.appended=!1,T.bitrateTest&&(T.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:T}));var q=!(R&&R.seeking)&&(P.PTSKnown||!P.live),ae=P.initSegment?P.initSegment.data:[],fe=this._getAudioCodec(j),De=this.demuxer=this.demuxer||new le(this.hls,"main");De.push(t.payload,ae,fe,j.videoCodec,a,P.totalduration,q)}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R,T;if(_.audio&&this.altAudio&&delete _.audio,T=_.audio,T){var I=this.levels[this.level].audioCodec,j=navigator.userAgent.toLowerCase();I&&this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),I.indexOf("mp4a.40.5")!==-1?I="mp4a.40.2":I="mp4a.40.5"),this.audioCodecSwitch&&T.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(I="mp4a.40.5"),j.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(I="mp4a.40.2",h.logger.log("Android: force audio codec to "+I)),T.levelCodec=I,T.id=t.id}T=_.video,T&&(T.levelCodec=this.levels[this.level].videoCodec,T.id=t.id),this.hls.trigger(d.default.BUFFER_CODECS,_);for(R in _){T=_[R],h.logger.log("main track:"+R+",container:"+T.container+",codecs[level/parsed]=["+T.levelCodec+"/"+T.codec+"]");var P=T.initSegment;P&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:R,data:P,parent:"main",content:"initSegment"}))}this.tick()}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="main"&&_.sn===c.sn&&_.level===c.level&&!(t.type==="audio"&&this.altAudio)&&this.state===te.PARSING){var R=this.levels[this.level],T=c;if(Object(b.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),t.hasAudio===!0&&T.addElementaryStream(ne.AUDIO),t.hasVideo===!0&&T.addElementaryStream(ne.VIDEO),h.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),t.type==="video")if(T.dropped=t.dropped,T.dropped)if(T.backtracked)h.logger.warn("Already backtracked on this fragment, appending with the gap",T.sn);else{var I=R.details;if(I&&T.sn===I.startSN)h.logger.warn("missing video frame(s) on first frag, appending with gap",T.sn);else{h.logger.warn("missing video frame(s), backtracking fragment",T.sn),this.fragmentTracker.removeFragment(T),T.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=te.IDLE,this.fragPrevious=T,this.tick();return}}else T.backtracked=!1;var j=se(R.details,T,t.startPTS,t.endPTS,t.startDTS,t.endDTS),P=this.hls;P.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:j,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(q){q&&q.length&&a.state===te.PARSING&&(a.appended=!0,a.pendingBuffering=!0,P.trigger(d.default.BUFFER_APPENDING,{type:t.type,data:q,parent:"main",content:"data"}))}),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onAudioTrackSwitching=function(t){var a=!!t.url,c=t.id;if(!a){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),_.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=te.IDLE}var R=this.hls;R.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:c}),this.altAudio=!1}},u.onAudioTrackSwitched=function(t){var a=t.id,c=!!this.hls.audioTracks[a].url;if(c){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=c,this.tick()},u.onBufferCreated=function(t){var a=t.tracks,c,_,R=!1;for(var T in a){var I=a[T];I.id==="main"?(_=T,c=I,T==="video"&&(this.videoBuffer=a[T].buffer)):R=!0}R&&c?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},u.onBufferAppended=function(t){if(t.parent==="main"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent;if(t){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+Wt.toString(a.buffered)),this.fragPrevious=t;var c=this.stats;c.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*c.total/(c.tbuffered-c.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:c,frag:t,id:"main"}),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var c=!!this.media&&A.isBuffered(this.media,this.media.currentTime)&&A.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var _=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+_+" ms"),this.retryDate=window.performance.now()+_,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR;break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==te.ERROR&&(t.fatal?(this.state=te.ERROR,h.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):!t.levelRetry&&this.state===te.WAITING_LEVEL&&(this.state=te.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:t.parent==="main"&&(this.state===te.PARSING||this.state===te.PARSED)&&(c?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=te.IDLE):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}},u._reduceMaxBufferLength=function(t){var a=this.config;return a.maxMaxBufferLength>=t?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},u._checkBuffer=function(){var t=this.media;if(!(!t||t.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:t,c=a.buffered;!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,c)}},u.onFragLoadEmergencyAborted=function(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},u.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(ne.VIDEO,t.buffered),this.state=te.IDLE,this.fragPrevious=null},u.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},u._seekToStartPos=function(){var t=this.media,a=t.currentTime,c=t.seeking?a:this.startPosition;a!==c&&c>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+c+" from current time "+a+" "),t.currentTime=c)},u._getAudioCodec=function(t){var a=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5")),a},Ro(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("main stream-controller: "+a+"->"+t),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:a,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var a=this.getBufferedFrag(t.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),p}(ja),li=fl;function Xi(g,p){for(var u=0;u0){_=a[0].bitrate,a.sort(function(q,ae){return q.bitrate-ae.bitrate}),this._levels=a;for(var P=0;P=0&&t1&&j.loadError0){var a=this.currentLevelIndex,c=t.urlId,_=t.url[c];h.logger.log("Attempt loading level index "+a+" with URL-id "+c),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:c})}}},Zi(p,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var a=this._levels;a&&(t=Math.min(t,a.length-1),(this.currentLevelIndex!==t||!a[t].details)&&this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}}]),p}(E),tu=r("./src/demux/id3.js");function Kc(g,p){var u;try{u=new Event("addtrack")}catch{u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,p.dispatchEvent(u)}function Oo(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function Zd(g,p){if(pg[g.length-1].endTime)return g[g.length-1];for(var u=0,o=g.length-1;u<=o;){var t=Math.floor((o+u)/2);if(pg[t].endTime)u=t+1;else return g[t]}return g[u].endTime-pj&&(h.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),j=I+.25);for(var P=0;P=this.minWeight_},p.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},p.destroy=function(){},g}(),av=rv;function Xc(g,p){for(var u=0;u500*c.duration/j){var P=t.levels,q=Math.max(1,T.bw?T.bw/8:T.loaded*1e3/I),ae=P[c.level],fe=ae.realBitrate?Math.max(ae.realBitrate,ae.bitrate):ae.bitrate,De=T.total?T.total:Math.max(T.loaded,Math.round(c.duration*fe/8)),ze=a.currentTime,ke=(De-T.loaded)/q,qe=(A.bufferInfo(a,ze,t.config.maxBufferHole).end-ze)/j;if(qe<2*c.duration/j&&ke>qe){var Ze,_t;for(_t=c.level-1;_t>R;_t--){var Lr=P[_t].realBitrate?Math.max(P[_t].realBitrate,P[_t].bitrate):P[_t].bitrate,ir=c.duration*Lr/(8*.8*q);if(ir=_;q--){var ae=P[q];if(!!ae){var fe=ae.details,De=fe?fe.totalduration/fe.fragments.length:a,ze=fe?fe.live:!1,ke=void 0;q<=t?ke=I*c:ke=j*c;var qe=P[q].realBitrate?Math.max(P[q].realBitrate,P[q].bitrate):P[q].bitrate,Ze=qe*De/ke;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+q+"/"+Math.round(ke)+"/"+qe+"/"+De+"/"+T+"/"+Ze),ke>qe&&(!Ze||ze&&!this.bitrateTestDelay||Ze=0)return De;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var ze=j?Math.min(j,_.maxStarvationDelay):_.maxStarvationDelay,ke=_.abrBandWidthFactor,qe=_.abrBandWidthUpFactor;if(fe===0){var Ze=this.bitrateTestDelay;if(Ze){var _t=j?Math.min(j,_.maxLoadingDelay):_.maxLoadingDelay;ze=_t-Ze,h.logger.trace("bitrate test took "+Math.round(1e3*Ze)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*ze)+" ms"),ke=qe=1}}return De=this._findBestLevel(I,j,ae,R,a,fe+ze,ke,qe,c),Math.max(De,0)}}]),p}(E),cv=lv;function sv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var es=W(),fv=function(g){sv(p,g);function p(o){var t;return t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.MANIFEST_PARSED,d.default.BUFFER_RESET,d.default.BUFFER_APPENDING,d.default.BUFFER_CODECS,d.default.BUFFER_EOS,d.default.BUFFER_FLUSHING,d.default.LEVEL_PTS_UPDATED,d.default.LEVEL_UPDATED)||this,t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t._needsFlush=!1,t._needsEos=!1,t.config=void 0,t.audioTimestampOffset=void 0,t.bufferCodecEventsExpected=0,t._bufferCodecEventsTotal=0,t.media=null,t.mediaSource=null,t.segments=[],t.parent=void 0,t.appending=!1,t.appended=0,t.appendError=0,t.flushBufferCounter=0,t.tracks={},t.pendingTracks={},t.sourceBuffer={},t.flushRange=[],t._onMediaSourceOpen=function(){h.logger.log("media source opened"),t.hls.trigger(d.default.MEDIA_ATTACHED,{media:t.media});var a=t.mediaSource;a&&a.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},t._onMediaSourceClose=function(){h.logger.log("media source closed")},t._onMediaSourceEnded=function(){h.logger.log("media source ended")},t._onSBUpdateEnd=function(){if(t.audioTimestampOffset&&t.sourceBuffer.audio){var a=t.sourceBuffer.audio;h.logger.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+t.audioTimestampOffset),a.timestampOffset=t.audioTimestampOffset,delete t.audioTimestampOffset}t._needsFlush&&t.doFlush(),t._needsEos&&t.checkEos(),t.appending=!1;var c=t.parent,_=t.segments.reduce(function(P,q){return q.parent===c?P+1:P},0),R={},T=t.sourceBuffer;for(var I in T){var j=T[I];if(!j)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=j.buffered}t.hls.trigger(d.default.BUFFER_APPENDED,{parent:c,pending:_,timeRanges:R}),t._needsFlush||t.doAppending(),t.updateMediaElementDuration(),_===0&&t.flushLiveBackBuffer()},t._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),t.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},t.config=o.config,t}var u=p.prototype;return u.destroy=function(){E.prototype.destroy.call(this)},u.onLevelPtsUpdated=function(t){var a=t.type,c=this.tracks.audio;if(a==="audio"&&c&&c.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-t.start);if(R>.1){var T=_.updating;try{_.abort()}catch(I){h.logger.warn("can not abort audio buffer: "+I)}T?this.audioTimestampOffset=t.start:(h.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+t.start),_.timestampOffset=t.start)}}},u.onManifestParsed=function(t){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(t){var a=this.media=t.media;if(a&&es){var c=this.mediaSource=new es;c.addEventListener("sourceopen",this._onMediaSourceOpen),c.addEventListener("sourceended",this._onMediaSourceEnded),c.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(c),this._objectUrl=a.src}},u.onMediaDetaching=function(){h.logger.log("media source detaching");var t=this.mediaSource;if(t){if(t.readyState==="open")try{t.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.media&&(this._objectUrl&&window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):h.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.hls.trigger(d.default.MEDIA_DETACHED)},u.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.pendingTracks,c=Object.keys(a).length;(c&&!t||c===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},u.onBufferReset=function(){var t=this.sourceBuffer;for(var a in t){var c=t[a];try{c&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(c),c.removeEventListener("updateend",this._onSBUpdateEnd),c.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},u.onBufferCodecs=function(t){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(t).forEach(function(c){a.pendingTracks[c]=t[c]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},u.createSourceBuffers=function(t){var a=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in t)if(!a[_]){var R=t[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var T=R.levelCodec||R.codec,I=R.container+";codecs="+T;h.logger.log("creating sourceBuffer("+I+")");try{var j=a[_]=c.addSourceBuffer(I);j.addEventListener("updateend",this._onSBUpdateEnd),j.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:j,codec:T,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(P){h.logger.error("error while trying to add sourceBuffer:"+P.message),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:P,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},u.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},u.onBufferEos=function(t){for(var a in this.sourceBuffer)if(!t.type||t.type===a){var c=this.sourceBuffer[a];c&&!c.ended&&(c.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},u.checkEos=function(){var t=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var c in t){var _=t[c];if(!!_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}h.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{a.endOfStream()}catch{h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},u.onBufferFlushing=function(t){t.type?this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}):(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"video"}),this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},u.flushLiveBackBuffer=function(){if(!!this._live){var t=this.config.liveBackBufferLength;if(!(!isFinite(t)||t<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,c=this.sourceBuffer,_=Object.keys(c),R=a-Math.max(t,this._levelTargetDuration),T=_.length-1;T>=0;T--){var I=_[T],j=c[I];if(j){var P=j.buffered;P.length>0&&R>P.start(0)&&this.removeBufferRange(I,j,0,R)&&this.hls.trigger(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},u.onLevelUpdated=function(t){var a=t.details;a.fragments.length>0&&(this._levelDuration=a.totalduration+a.fragments[0].start,this._levelTargetDuration=a.averagetargetduration||a.targetduration||10,this._live=a.live,this.updateMediaElementDuration())},u.updateMediaElementDuration=function(){var t=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var c in this.sourceBuffer){var _=this.sourceBuffer[c];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(h.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>a||!Object(b.isFiniteNumber)(a))&&(h.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},u.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(this.flushBuffer(t.start,t.end,t.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,c=this.sourceBuffer;try{for(var _ in c){var R=c[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},u.doAppending=function(){var t=this.config,a=this.hls,c=this.segments,_=this.sourceBuffer;if(!!Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],h.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=c.shift();if(!!R)try{var T=_[R.type];if(!T){this._onSBUpdateEnd();return}if(T.updating){c.unshift(R);return}T.ended=!1,this.parent=R.parent,T.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(j){h.logger.error("error while trying to append buffer:"+j.message),c.unshift(R);var I={type:v.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};j.code===22?(this.segments=[],I.details=v.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=v.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.appendErrorMaxRetry&&(h.logger.log("fail "+t.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),a.trigger(d.default.ERROR,I)}}}},u.flushBuffer=function(t,a,c){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),h.logger.log("flushBuffer,pos/start/end: "+R+"/"+t+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var T=_[c];if(T){if(T.ended=!1,T.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(c,T,t,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},u.removeBufferRange=function(t,a,c,_){try{for(var R=0;R.5){var q="null";return this.media&&(q=this.media.currentTime.toString()),h.logger.log("sb remove "+t+" ["+j+","+P+"], of ["+T+","+I+"], pos:"+q),a.remove(j,P),!0}}}catch(ae){h.logger.warn("removeBufferRange failed",ae)}return!1},p}(E),dv=fv;function ts(g,p){for(var u=0;uthis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},u.getMaxLevel=function(t){var a=this;if(!this.levels)return-1;var c=this.levels.filter(function(_,R){return p.isLevelAllowed(R,a.restrictedLevels)&&R<=t});return p.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},u.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},u.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},p.isLevelAllowed=function(t,a){return a===void 0&&(a=[]),a.indexOf(t)===-1},p.getMaxLevelByMediaSize=function(t,a,c){if(!t||t&&!t.length)return-1;for(var _=function(P,q){return q?P.width!==q.width||P.height!==q.height:!0},R=t.length-1,T=0;T=a||I.height>=c)&&_(I,t[T+1])){R=T;break}}return R},vv(p,[{key:"mediaWidth",get:function(){var t,a=this.media;return a&&(t=a.width||a.clientWidth||a.offsetWidth,t*=p.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t,a=this.media;return a&&(t=a.height||a.clientHeight||a.offsetHeight,t*=p.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch{}return t}}]),p}(E),ns=pv;function mv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var bo=window,_v=bo.performance,ml=function(g){mv(p,g);function p(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var u=p.prototype;return u.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},u.onMediaAttaching=function(t){var a=this.hls.config;if(a.capLevelOnFPSDrop){var c=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},u.checkFPS=function(t,a,c){var _=_v.now();if(a){if(this.lastTime){var R=_-this.lastTime,T=c-this.lastDroppedFrames,I=a-this.lastDecodedFrames,j=1e3*T/R,P=this.hls;if(P.trigger(d.default.FPS_DROP,{currentDropped:T,currentDecoded:I,totalDroppedFrames:c}),j>0&&T>P.config.fpsDroppedMonitoringThreshold*I){var q=P.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+q),q>0&&(P.autoLevelCapping===-1||P.autoLevelCapping>=q)&&(q=q-1,P.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:q,droppedLevel:P.currentLevel}),P.autoLevelCapping=q,P.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=c,this.lastDecodedFrames=a}},u.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var a=t.getVideoPlaybackQuality();this.checkFPS(t,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},p}(E),hv=ml,rs=window,_l=rs.performance,gv=rs.XMLHttpRequest,Dv=function(){function g(u){u&&u.xhrSetup&&(this.xhrSetup=u.xhrSetup)}var p=g.prototype;return p.destroy=function(){this.abort(),this.loader=null},p.abort=function(){var o=this.loader;o&&o.readyState!==4&&(this.stats.aborted=!0,o.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},p.load=function(o,t,a){this.context=o,this.config=t,this.callbacks=a,this.stats={trequest:_l.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},p.loadInternal=function(){var o,t=this.context;o=this.loader=new gv;var a=this.stats;a.tfirst=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(o,t.url)}catch{o.open("GET",t.url,!0),c(o,t.url)}o.readyState||o.open("GET",t.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},t,o);return}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},p.readystatechange=function(o){var t=o.currentTarget,a=t.readyState,c=this.stats,_=this.context,R=this.config;if(!c.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),c.tfirst===0&&(c.tfirst=Math.max(_l.now(),c.trequest)),a===4){var T=t.status;if(T>=200&&T<300){c.tload=Math.max(c.tfirst,_l.now());var I,j;_.responseType==="arraybuffer"?(I=t.response,j=I.byteLength):(I=t.responseText,j=I.length),c.loaded=c.total=j;var P={url:t.responseURL,data:I};this.callbacks.onSuccess(P,c,_,t)}else c.retry>=R.maxRetry||T>=400&&T<499?(h.logger.error(T+" while loading "+_.url),this.callbacks.onError({code:T,text:t.statusText},_,t)):(h.logger.warn(T+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,R.maxRetryDelay),c.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),R.timeout)},p.loadtimeout=function(){h.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},p.loadprogress=function(o){var t=o.currentTarget,a=this.stats;a.loaded=o.loaded,o.lengthComputable&&(a.total=o.total);var c=this.callbacks.onProgress;c&&c(a,this.context,null,t)},g}(),hl=Dv;function as(g,p){for(var u=0;u=this.tracks.length){h.logger.warn("Invalid audio track id:",t.id);return}if(h.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var a=t.details.targetduration*1e3;this.setInterval(a)}!t.details.live&&this.hasInterval()&&this.clearInterval()},u.onAudioTrackSwitched=function(t){var a=this.tracks[t.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},u.onLevelLoaded=function(t){this._selectAudioGroup(t.level)},u.onError=function(t){t.type===v.ErrorTypes.NETWORK_ERROR&&(t.fatal&&this.clearInterval(),t.details===v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(h.logger.warn("Network failure on audio-track id:",t.context.id),this._handleLoadError()))},u._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(t<0||t>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[t];h.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var c=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:c}),this._loadTrackDetailsIfNeeded(a)},u.doTick=function(){this._updateTrack(this._trackId)},u._selectAudioGroup=function(t){var a=this.hls.levels[t];if(!(!a||!a.audioGroupIds)){var c=a.audioGroupIds[a.urlId];this.audioGroupId!==c&&(this.audioGroupId=c,this._selectInitialAudioTrack())}},u._selectInitialAudioTrack=function(){var t=this,a=this.tracks;if(!!a.length){var c=this.tracks[this._trackId],_=null;if(c&&(_=c.name),this._selectDefaultTrack){var R=a.filter(function(j){return j.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var T=!1,I=function(){a.forEach(function(P){T||(!t.audioGroupId||P.groupId===t.audioGroupId)&&(!_||_===P.name)&&(t._setAudioTrack(P.id),T=!0)})};I(),T||(_=null,I()),T||(h.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},u._needsTrackLoading=function(t){var a=t.details,c=t.url;return!a||a.live?!!c:!1},u._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var a=t.url,c=t.id;h.logger.log("loading audio-track playlist for id: "+c),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:c})}},u._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,h.logger.log("trying to update audio-track "+t);var a=this.tracks[t];this._loadTrackDetailsIfNeeded(a)}},u._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,a=this.tracks[t],c=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+t+", group-id: "+R+', name/language: "'+c+'" / "'+_+'"');for(var T=t,I=0;I0&&t===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=te.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=te.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=te.STOPPED},u.doTick=function(){var t,a,c,_=this.hls,R=_.config;switch(this.state){case te.ERROR:case te.PAUSED:case te.BUFFER_FLUSHING:break;case te.STARTING:this.state=te.WAITING_TRACK,this.loadedmetadata=!1;break;case te.IDLE:var T=this.tracks;if(!T||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(t=this.nextLoadPosition,t===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,j=this.videoBuffer?this.videoBuffer:this.media,P=A.bufferInfo(I,t,R.maxBufferHole),q=A.bufferInfo(j,t,R.maxBufferHole),ae=P.len,fe=P.end,De=this.fragPrevious,ze=Math.min(R.maxBufferLength,R.maxMaxBufferLength),ke=Math.max(ze,q.len),qe=this.audioSwitch,Ze=this.trackId;if((aeir||P.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=ir+.05;else return}if(c.initSegment&&!c.initSegment.data)jt=c.initSegment;else if(fe<=ir){if(jt=_t[0],this.videoTrackCC!==null&&jt.cc!==this.videoTrackCC&&(jt=nn(_t,this.videoTrackCC)),c.live&&jt.loadIdx&&jt.loadIdx===this.fragLoadIdx){var kt=P.nextStart?P.nextStart:ir;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(kt+.05)),this.media.currentTime=kt+.05;return}}else{var pt,Qn=R.maxFragLookUpTolerance,iu=De?_t[De.sn-_t[0].sn+1]:void 0,uu=function(Fl){var vh=Math.min(Qn,Fl.duration);return Fl.start+Fl.duration-vh<=fe?1:Fl.start-vh>fe&&Fl.start?-1:0};fena-Qn&&(Qn=0),iu&&!uu(iu)?pt=iu:pt=G.search(_t,uu)):pt=_t[Lr-1],pt&&(jt=pt,ir=pt.start,De&&jt.level===De.level&&jt.sn===De.sn&&(jt.sn=sh||_E)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.WAITING_INIT_PTS:var ep=this.videoTrackCC;if(this.initPTS[ep]===void 0)break;var fh=this.waitingFragment;if(fh){var dh=fh.frag.cc;ep!==dh?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+dh+") does not match video track CC ("+ep+")"),this.waitingFragment=null,this.state=te.IDLE)):(this.state=te.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=te.IDLE;break;case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var c=this.config;this.tracks&&c.autoStartLoad&&this.startLoad(c.startPosition)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onAudioTracksUpdated=function(t){h.logger.log("audio tracks updated"),this.tracks=t.audioTracks},u.onAudioTrackSwitching=function(t){var a=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=te.PAUSED,this.waitingFragment=null,a?this.setInterval(us):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=te.IDLE),this.tick()},u.onAudioTrackLoaded=function(t){var a=t.details,c=t.id,_=this.tracks[c],R=a.totalduration,T=0;if(h.logger.log("track "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(Fe(I,a),T=a.fragments[0].start,a.PTSKnown?h.logger.log("live audio playlist sliding:"+T.toFixed(3)):h.logger.log("live audio playlist - outdated PTS, unknown sliding")):(a.PTSKnown=!1,h.logger.log("live audio playlist - first load, unknown sliding"))}else a.PTSKnown=!1;if(_.details=a,!this.startFragRequested){if(this.startPosition===-1){var j=a.startTimeOffset;Object(b.isFiniteNumber)(j)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+j),this.startPosition=j):a.live?(this.startPosition=this.computeLivePosition(T,a),h.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_TRACK&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag;if(this.state===te.FRAG_LOADING&&a&&c.type==="audio"&&c.level===a.level&&c.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,T=R.totalduration,I=a.level,j=a.sn,P=a.cc,q=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",ae=this.stats=t.stats;if(j==="initSegment")this.state=te.IDLE,ae.tparsed=ae.tbuffered=Oa.now(),R.initSegment.data=t.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:ae,frag:a,id:"audio"}),this.tick();else{this.state=te.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new le(this.hls,"audio"));var fe=this.initPTS[P],De=R.initSegment?R.initSegment.data:[];if(R.initSegment||fe!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var ze=!1;this.demuxer.push(t.payload,De,q,null,a,T,ze,fe)}else h.logger.log("unknown video PTS for continuity counter "+P+", waiting for video PTS before demuxing audio frag "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=t,this.state=te.WAITING_INIT_PTS}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=t.id,this.hls.trigger(d.default.BUFFER_CODECS,_),h.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var T=R.initSegment;if(T){var I={type:"audio",data:T,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[I]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,I))}this.tick()}}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="audio"&&t.type==="audio"&&_.sn===c.sn&&_.level===c.level&&this.state===te.PARSING){var R=this.trackId,T=this.tracks[R],I=this.hls;Object(b.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),c.addElementaryStream(ne.AUDIO),h.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),se(T.details,c,t.startPTS,t.endPTS);var j=this.audioSwitch,P=this.media,q=!1;if(j)if(P&&P.readyState){var ae=P.currentTime;h.logger.log("switching audio track : currentTime:"+ae),ae>=t.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=te.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),q=!0,this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R});var fe=this.pendingData;if(!fe){h.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),I.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([t.data1,t.data2].forEach(function(De){De&&De.length&&fe.push({type:t.type,data:De,parent:"audio",content:"data"})}),!q&&fe.length&&(fe.forEach(function(De){a.state===te.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,De))}),this.pendingData=[],this.appended=!0)),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=Oa.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(t){var a=t.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},u.onBufferAppended=function(t){if(t.parent==="audio"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent,a=this.stats,c=this.hls;if(t){this.fragPrevious=t,a.tbuffered=Oa.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:t,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+Wt.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,c.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag;if(!(a&&a.type!=="audio"))switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:var c=t.frag;if(c&&c.type!=="audio")break;if(!t.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var T=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);h.logger.warn("AudioStreamController: frag loading failed, retry in "+T+" ms"),this.retryDate=Oa.now()+T,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR}break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==te.ERROR&&(this.state=t.fatal?te.ERROR:te.IDLE,h.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===te.PARSING||this.state===te.PARSED)){var I=this.mediaBuffer,j=this.media.currentTime,P=I&&A.isBuffered(I,j)&&A.isBuffered(I,j+.5);if(P){var q=this.config;q.maxMaxBufferLength>=q.maxBufferLength&&(q.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+q.maxMaxBufferLength+"s")),this.state=te.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=te.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},u.onBufferFlushed=function(){var t=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(c){t.hls.trigger(d.default.BUFFER_APPENDING,c)}),this.appended=!0,this.pendingData=[],this.state=te.PARSED):(this.state=te.IDLE,this.fragPrevious=null,this.tick())},ci(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("audio stream:"+a+"->"+t)}},get:function(){return this._state}}]),p}(ja),Fv=Ev,ls=function(){if(typeof window!="undefined"&&window.VTTCue)return window.VTTCue;var g="auto",p={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(_){if(typeof _!="string")return!1;var R=p[_.toLowerCase()];return R?_.toLowerCase():!1}function t(_){if(typeof _!="string")return!1;var R=u[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Lr=pt,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},j,{get:function(){return ir},set:function(pt){var Qn=t(pt);if(!Qn)throw new SyntaxError("An invalid or illegal string was specified.");ir=Qn,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},j,{get:function(){return na},set:function(pt){if(pt<0||pt>100)throw new Error("Size must be between 0 and 100.");na=pt,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},j,{get:function(){return jt},set:function(pt){var Qn=t(pt);if(!Qn)throw new SyntaxError("An invalid or illegal string was specified.");jt=Qn,this.hasBeenReset=!0}})),I.displayState=void 0}return c.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},c}(),wv=function(){return{decode:function(u){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))}}};function cs(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new wv,this.regionList=[]}function Cv(g){function p(o,t,a,c){return(o|0)*3600+(t|0)*60+(a|0)+(c|0)/1e3}var u=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return u?u[3]?p(u[1],u[2],u[3].replace(":",""),u[4]):u[1]>59?p(u[1],u[2],0,u[4]):p(0,u[1],u[2],u[4]):null}function ss(){this.values=Object.create(null)}ss.prototype={set:function(p,u){!this.get(p)&&u!==""&&(this.values[p]=u)},get:function(p,u,o){return o?this.has(p)?this.values[p]:u[o]:this.has(p)?this.values[p]:u},has:function(p){return p in this.values},alt:function(p,u,o){for(var t=0;t=0&&u<=100)?(this.set(p,u),!0):!1}};function fs(g,p,u,o){var t=o?g.split(o):[g];for(var a in t)if(typeof t[a]=="string"){var c=t[a].split(u);if(c.length===2){var _=c[0],R=c[1];p(_,R)}}}var si=new ls(0,0,0),ta=si.align==="middle"?"middle":"center";function xv(g,p,u){var o=g;function t(){var _=Cv(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var T=new ss;fs(_,function(P,q){switch(P){case"region":for(var ae=u.length-1;ae>=0;ae--)if(u[ae].id===q){T.set(P,u[ae].region);break}break;case"vertical":T.alt(P,q,["rl","lr"]);break;case"line":var fe=q.split(","),De=fe[0];T.integer(P,De),T.percent(P,De)&&T.set("snapToLines",!1),T.alt(P,De,["auto"]),fe.length===2&&T.alt("lineAlign",fe[1],["start",ta,"end"]);break;case"position":fe=q.split(","),T.percent(P,fe[0]),fe.length===2&&T.alt("positionAlign",fe[1],["start",ta,"end","line-left","line-right","auto"]);break;case"size":T.percent(P,q);break;case"align":T.alt(P,q,["start",ta,"end","left","right"]);break}},/:/,/\s/),R.region=T.get("region",null),R.vertical=T.get("vertical","");var I=T.get("line","auto");I==="auto"&&si.line===-1&&(I=-1),R.line=I,R.lineAlign=T.get("lineAlign","start"),R.snapToLines=T.get("snapToLines",!0),R.size=T.get("size",100),R.align=T.get("align",ta);var j=T.get("position","auto");j==="auto"&&si.position===50&&(j=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=j}function c(){g=g.replace(/^\s+/,"")}if(c(),p.startTime=t(),c(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),c(),p.endTime=t(),c(),a(g,p)}function ds(g){return g.replace(//gi,` `)}cs.prototype={parse:function(p){var u=this;p&&(u.buffer+=u.decoder.decode(p,{stream:!0}));function o(){var T=u.buffer,I=0;for(T=ds(T);I")===-1){u.cue.id=a;continue}case"CUE":try{xv(a,u.cue,u.regionList)}catch{u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){u.oncue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}u.cue.text&&(u.cue.text+=` `),u.cue.text+=a;continue;case"BADCUE":a||(u.state="ID");continue}}}catch{u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var p=this;try{if(p.buffer+=p.decoder.decode(),(p.cue||p.state==="HEADER")&&(p.buffer+=` `,p.parse()),p.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(u){throw u}return p.onflush&&p.onflush(),this}};var Mv=cs;function Sv(g,p,u,o){for(var t,a,c,_,R,T=window.VTTCue||TextTrackCue,I=0;I=16?_--:_++,navigator.userAgent.match(/Firefox\//)?a.line=I+1:a.line=I>7?I-2:I+1,a.align="left",a.position=Math.max(0,Math.min(100,100*(_/32))),g.addCue(a)}}var gl={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},vs=function(p){var u=p;return gl.hasOwnProperty(p)&&(u=gl[p]),String.fromCharCode(u)},Ir=15,Wa=100,Iv={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Lv={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Av={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Pv={25:2,26:4,29:6,30:8,31:10,27:13,28:15},jv=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ps;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(ps||(ps={}));var yt={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(p){this.time=p},log:function(p,u){var o=this.verboseFilter[p];this.verboseLevel>=o}},Eo=function(p){for(var u=[],o=0;oWa&&(yt.log("ERROR","Too large cursor position "+this.pos),this.pos=Wa)},p.moveCursor=function(o){var t=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var t=vs(o);if(this.pos>=Wa){yt.log("ERROR","Cannot insert "+o.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)},p.clearFromPos=function(o){var t;for(t=o;t0&&(o?a="["+t.join(" | ")+"]":a=t.join(` `)),a},p.getTextAndFormat=function(){return this.rows},g}(),ru=function(){function g(u,o){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.lastCueEndTime=void 0,this.chNr=u,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new Rt,this.nonDisplayedMemory=new Rt,this.lastOutputScreen=new Rt,this.currRollUpRow=this.displayedMemory.rows[Ir-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}var p=g.prototype;return p.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[Ir-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},p.getHandler=function(){return this.outputFilter},p.setHandler=function(o){this.outputFilter=o},p.setPAC=function(o){this.writeScreen.setPAC(o)},p.setBkgData=function(o){this.writeScreen.setBkgData(o)},p.setMode=function(o){o!==this.mode&&(this.mode=o,yt.log("INFO","MODE="+o),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=o)},p.insertChars=function(o){for(var t=0;t=46,t.italics)t.foreground="white";else{var a=Math.floor(o/2)-16,c=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=c[a]}yt.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},p.outputDataUpdate=function(o){o===void 0&&(o=!1);var t=yt.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))},p.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},g}(),au=function(){function g(u,o,t){this.field=void 0,this.outputs=void 0,this.channels=void 0,this.currChNr=void 0,this.lastCmdA=void 0,this.lastCmdB=void 0,this.lastTime=void 0,this.dataCounters=void 0,this.field=u||1,this.outputs=[o,t],this.channels=[new ru(1,o),new ru(2,t)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var p=g.prototype;return p.getHandler=function(o){return this.channels[o].getHandler()},p.setHandler=function(o,t){this.channels[o].setHandler(t)},p.addData=function(o,t){var a,c,_,R=!1;this.lastTime=o,yt.setTime(o);for(var T=0;T ("+Eo([c,_])+")");if(a=this.parseCmd(c,_),a||(a=this.parseMidrow(c,_)),a||(a=this.parsePAC(c,_)),a||(a=this.parseBackgroundAttributes(c,_)),!a&&(R=this.parseChars(c,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else yt.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,yt.log("WARNING","Couldn't parse cleaned data "+Eo([c,_])+" orig: "+Eo([t[T],t[T+1]])))}},p.parseCmd=function(o,t){var a=null,c=(o===20||o===28)&&t>=32&&t<=47,_=(o===23||o===31)&&t>=33&&t<=35;if(!(c||_))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,yt.log("DEBUG","Repeated command ("+Eo([o,t])+") is dropped"),!0;o===20||o===23?a=1:a=2;var R=this.channels[a-1];return o===20||o===28?t===32?R.ccRCL():t===33?R.ccBS():t===34?R.ccAOF():t===35?R.ccAON():t===36?R.ccDER():t===37?R.ccRU(2):t===38?R.ccRU(3):t===39?R.ccRU(4):t===40?R.ccFON():t===41?R.ccRDC():t===42?R.ccTR():t===43?R.ccRTD():t===44?R.ccEDM():t===45?R.ccCR():t===46?R.ccENM():t===47&&R.ccEOC():R.ccTO(t-32),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.parseMidrow=function(o,t){var a=null;if((o===17||o===25)&&t>=32&&t<=47){if(o===17?a=1:a=2,a!==this.currChNr)return yt.log("ERROR","Mismatch channel in midrow parsing"),!1;var c=this.channels[a-1];return c.ccMIDROW(t),yt.log("DEBUG","MIDROW ("+Eo([o,t])+")"),!0}return!1},p.parsePAC=function(o,t){var a=null,c=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&t>=64&&t<=127,R=(o===16||o===24)&&t>=64&&t<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,t>=64&&t<=95?c=a===1?Iv[o]:Av[o]:c=a===1?Lv[o]:Pv[o];var T=this.interpretPAC(c,t),I=this.channels[a-1];return I.setPAC(T),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.interpretPAC=function(o,t){var a=t,c={color:null,italics:!1,indent:null,underline:!1,row:o};return t>95?a=t-96:a=t-64,c.underline=(a&1)==1,a<=13?c.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(c.italics=!0,c.color="white"):c.indent=Math.floor((a-16)/2)*4,c},p.parseChars=function(o,t){var a=null,c=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=t;_===17?R=t+80:_===18?R=t+112:R=t+144,yt.log("INFO","Special char '"+vs(R)+"' in channel "+a),c=[R]}else o>=32&&o<=127&&(c=t===0?[o]:[o,t]);if(c){var T=Eo(c);yt.log("DEBUG","Char codes = "+T.join(",")),this.lastCmdA=null,this.lastCmdB=null}return c},p.parseBackgroundAttributes=function(o,t){var a,c,_,R,T=(o===16||o===24)&&t>=32&&t<=47,I=(o===23||o===31)&&t>=45&&t<=47;return T||I?(a={},o===16||o===24?(c=Math.floor((t-32)/2),a.background=jv[c],t%2==1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(a),this.lastCmdA=null,this.lastCmdB=null,!0):!1},p.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=t,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g}(),yl=function(p,u,o){return p.substr(o||0,u.length)===u},Wv=function(p){var u=parseInt(p.substr(-3)),o=parseInt(p.substr(-6,2)),t=parseInt(p.substr(-9,2)),a=p.length>9?parseInt(p.substr(0,p.indexOf(":"))):0;if(!Object(b.isFiniteNumber)(u)||!Object(b.isFiniteNumber)(o)||!Object(b.isFiniteNumber)(t)||!Object(b.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+p);return u+=1e3*o,u+=60*1e3*t,u+=60*60*1e3*a,u},ou=function(p){for(var u=5381,o=p.length;o;)u=u*33^p.charCodeAt(--o);return(u>>>0).toString()},kv=function(p,u,o){var t=p[u],a=p[t.prevCC];if(!a||!a.new&&t.new){p.ccOffset=p.presentationOffset=t.start,t.new=!1;return}for(;a&&a.new;)p.ccOffset+=t.start-a.start,t.new=!1,t=a,a=p[t.prevCC];p.presentationOffset=o},Hv={parse:function(p,u,o,t,a,c){var _=/\r\n|\n\r|\n|\r/g,R=Object(tu.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(_,` `).split(` `),T="00:00.000",I=0,j=0,P=0,q=[],ae,fe=!0,De=!1,ze=new Mv;ze.oncue=function(ke){var qe=o[t],Ze=o.ccOffset;qe&&qe.new&&(j!==void 0?Ze=o.ccOffset=qe.start:kv(o,t,P)),P&&(Ze=P-o.presentationOffset),De&&(ke.startTime+=Ze-j,ke.endTime+=Ze-j),ke.id=ou(ke.startTime.toString())+ou(ke.endTime.toString())+ou(ke.text),ke.text=decodeURIComponent(encodeURIComponent(ke.text)),ke.endTime>0&&q.push(ke)},ze.onparsingerror=function(ke){ae=ke},ze.onflush=function(){if(ae&&c){c(ae);return}a(q)},R.forEach(function(ke){if(fe)if(yl(ke,"X-TIMESTAMP-MAP=")){fe=!1,De=!0,ke.substr(16).split(",").forEach(function(qe){yl(qe,"LOCAL:")?T=qe.substr(6):yl(qe,"MPEGTS:")&&(I=parseInt(qe.substr(7)))});try{u+(o[t].start*9e4||0)<0&&(u+=8589934592),I-=u,j=Wv(T)/1e3,P=I/9e4}catch(qe){De=!1,ae=qe}return}else ke===""&&(fe=!1);ze.parse(ke+` `)}),ze.flush()}},Bv=Hv;function _s(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function $v(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Gv=function(g){$v(p,g);function p(o){var t;if(t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.FRAG_DECRYPTED,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.INIT_PTS_FOUND)||this,t.media=null,t.config=void 0,t.enabled=!0,t.Cues=void 0,t.textTracks=[],t.tracks=[],t.initPTS=[],t.unparsedVttFrags=[],t.cueRanges=[],t.captionsTracks={},t.captionsProperties=void 0,t.cea608Parser=void 0,t.lastSn=-1,t.prevCC=-1,t.vttCCs=null,t.hls=o,t.config=o.config,t.Cues=o.config.cueHandler,t.captionsProperties={textTrack1:{label:t.config.captionsTextTrack1Label,languageCode:t.config.captionsTextTrack1LanguageCode},textTrack2:{label:t.config.captionsTextTrack2Label,languageCode:t.config.captionsTextTrack2LanguageCode}},t.config.enableCEA708Captions){var a=new ms(_s(t),"textTrack1"),c=new ms(_s(t),"textTrack2");t.cea608Parser=new Ov(0,a,c)}return t}var u=p.prototype;return u.addCues=function(t,a,c,_){for(var R=this.cueRanges,T=!1,I=R.length;I--;){var j=R[I],P=qv(j[0],j[1],a,c);if(P>=0&&(j[0]=Math.min(j[0],a),j[1]=Math.max(j[1],c),T=!0,P/(c-a)>.5))return}T||R.push([a,c]),this.Cues.newCue(this.captionsTracks[t],a,c,_)},u.onInitPtsFound=function(t){var a=this,c=t.frag,_=t.id,R=t.initPTS,T=this.unparsedVttFrags;_==="main"&&(this.initPTS[c.cc]=R),T.length&&(this.unparsedVttFrags=[],T.forEach(function(I){a.onFragLoaded(I)}))},u.getExistingTrack=function(t){var a=this.media;if(a)for(var c=0;c=T.length||c!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+c+" loaded"),_.live){var j=Xt(I.details,_,t.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+j+"ms"),this.timer=setTimeout(function(){a._loadCurrentTrack()},j)}else this._clearReloadTimer()},u.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},u.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},u._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},u._loadCurrentTrack=function(){var t=this.trackId,a=this.tracks,c=this.hls,_=a[t];t<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+t),c.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:t}))},u._toggleTrackModes=function(t){var a=this.media,c=this.subtitleDisplay,_=this.trackId;if(!!a){var R=s(a.textTracks);if(t===-1)[].slice.call(R).forEach(function(j){j.mode="disabled"});else{var T=R[_];T&&(T.mode="disabled")}var I=R[t];I&&(I.mode=c?"showing":"hidden")}},u._setSubtitleTrackInternal=function(t){var a=this.hls,c=this.tracks;!Object(b.isFiniteNumber)(t)||t<-1||t>=c.length||(this.trackId=t,h.logger.log("Switching to subtitle track "+t),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},u._onTextTracksChanged=function(){if(!!this.media){for(var t=-1,a=s(this.media.textTracks),c=0;c=_[I].start&&T<=_[I].end){R=_[I];break}var j=a.start+a.duration;R?R.end=j:(R={start:T,end:j},_.push(R))}}},u.onMediaAttached=function(t){var a=t.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=te.IDLE},u.onMediaDetaching=function(){var t=this;!this.media||(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){t.tracksBuffered[a.id]=[]}),this.media=null,this.state=te.STOPPED)},u.onError=function(t){var a=t.frag;!a||a.type!=="subtitle"||(this.state=te.IDLE)},u.onSubtitleTracksUpdated=function(t){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(c){a.tracksBuffered[c.id]=[]})},u.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(Ke)},u.onSubtitleTrackLoaded=function(t){var a=t.id,c=t.details,_=this.currentTrackId,R=this.tracks,T=R[_];a>=R.length||a!==_||!T||(c.live&&Ne(T.details,c,this.lastAVStart),T.details=c,this.setInterval(Ke))},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE)},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag.decryptdata,_=t.frag,R=this.hls;if(this.state===te.FRAG_LOADING&&a&&t.frag.type==="subtitle"&&a.sn===t.frag.sn&&t.payload.byteLength>0&&c&&c.key&&c.method==="AES-128"){var T=ye.now();this.decrypter.decrypt(t.payload,c.key.buffer,c.iv.buffer,function(I){var j=ye.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:T,tdecrypt:j}})})}},u.onLevelUpdated=function(t){var a=t.details,c=a.fragments;this.lastAVStart=c.length?c[0].start:0},u.doTick=function(){if(!this.media){this.state=te.IDLE;return}switch(this.state){case te.IDLE:{var t=this.config,a=this.currentTrackId,c=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var T=t.maxBufferHole,I=t.maxFragLookUpTolerance,j=Math.min(t.maxBufferLength,t.maxMaxBufferLength),P=A.bufferedInfo(this._getBuffered(),_.currentTime,T),q=P.end,ae=P.len,fe=R[a].details,De=fe.fragments,ze=De.length,ke=De[ze-1].start+De[ze-1].duration;if(ae>j)return;var qe,Ze=this.fragPrevious;qDs){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=Ds-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(c,_)}break}},u._generateLicenseRequestChallenge=function(t,a){switch(t.mediaKeySystemDomain){case ln.WIDEVINE:return a}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},u._requestLicense=function(t,a){h.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){h.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(c.mediaKeySystemDomain),R=this._createLicenseXhr(_,t,a);h.logger.log("Sending license request to URL: "+_);var T=this._generateLicenseRequestChallenge(c,t);R.send(T)}catch(I){h.logger.error("Failure requesting DRM license: "+I),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(t){if(!!this._emeEnabled){var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},u.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},u.onManifestParsed=function(t){if(!!this._emeEnabled){var a=t.levels.map(function(_){return _.audioCodec}),c=t.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(ln.WIDEVINE,a,c)}},Vv(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}(E),Yv=Rs;function Qv(g){for(var p=1;pa)return _}return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,a=this.autoLevelCapping,c;return a===-1&&t&&t.length?c=t.length-1:c=a,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var a=this.audioTrackController;a&&(a.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return t?t.subtitleDisplay:!1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=t)}}]),p}(V);Cs.defaultConfig=void 0},"./src/polyfills/number-isFinite.js":function(e,n,r){"use strict";r.r(n),r.d(n,"isFiniteNumber",function(){return i});var i=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)}},"./src/utils/get-self-scope.js":function(e,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return i});function i(){return typeof window=="undefined"?self:window}},"./src/utils/logger.js":function(e,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return E}),r.d(n,"logger",function(){return S});var i=r("./src/utils/get-self-scope.js");function l(){}var v={trace:l,debug:l,log:l,warn:l,info:l,error:l},b=v;function d(C,M){return M="["+C+"] > "+M,M}var h=Object(i.getSelfScope)();function N(C){var M=h.console[C];return M?function(){for(var U=arguments.length,H=new Array(U),Y=0;Y1?M-1:0),H=1;H{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Direction=void 0;var b8;(function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"})(b8=Bc.Direction||(Bc.Direction={}))});var J_=ka(lt=>{"use strict";var $c=lt&<.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;ie)return h;if(N&&Ni)return i;if(e=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(er)throw new RangeError("value (".concat(e,") is bigger than max (").concat(r,")"))}lt.checkBoundaries=M8;function S8(e,n,r){return er?r:e}lt.checkValuesAgainstBoundaries=S8;function I8(e){if(!(e.length<2)&&!e.slice(1).every(function(n,r){return e[r]<=n}))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))}lt.checkInitialOverlap=I8;function L8(e){var n=window.getComputedStyle(e);return{top:parseInt(n["margin-top"],10),bottom:parseInt(n["margin-bottom"],10),left:parseInt(n["margin-left"],10),right:parseInt(n["margin-right"],10)}}lt.getMargin=L8;function A8(e){var n=window.getComputedStyle(e);return{top:parseInt(n["padding-top"],10)+parseInt(n["border-top-width"],10),bottom:parseInt(n["padding-bottom"],10)+parseInt(n["border-bottom-width"],10),left:parseInt(n["padding-left"],10)+parseInt(n["border-left-width"],10),right:parseInt(n["padding-right"],10)+parseInt(n["border-right-width"],10)}}lt.getPaddingAndBorder=A8;function P8(e,n,r){var i=r?-1:1;e.forEach(function(l,v){return GT(l,i*n[v].x,n[v].y)})}lt.translateThumbs=P8;function j8(e,n,r,i){for(var l=0,v=JT(e[0],n,r,i),b=1;bb?h:b},e.getBoundingClientRect().width));return v},H8=function(e,n,r,i,l,v,b){b===void 0&&(b=function(N){return N});var d=[],h=function(N){var y=qT(r[N],i[N],l,v,b),E=n[N].x;n.forEach(function(S,C){var M=S.x,U=qT(r[C],i[C],l,v,b);N!==C&&(E>=M&&E<=M+U||E+y>=M&&E+y<=M+U)&&(d.includes(C)||(d.push(N),d.push(C),d=$c($c([],d,!0),[N,C],!1),h(C)))})};return h(e),Array.from(new Set(d.sort()))},B8=function(e,n,r,i,l,v){i===void 0&&(i=.1),l===void 0&&(l=" - "),v===void 0&&(v=function(C){return C});var b=(0,lt.getStepDecimals)(i),d=(0,q_.useState)({}),h=d[0],N=d[1],y=(0,q_.useState)(v(n[r].toFixed(b))),E=y[0],S=y[1];return(0,q_.useEffect)(function(){if(e){var C=e.getThumbs();if(C.length<1)return;var M={},U=e.getOffsets(),H=H8(r,U,C,n,l,b,v),Y=v(n[r].toFixed(b));if(H.length){var J=H.reduce(function(ve,We,Ge,Je){return ve.length?$c($c([],ve,!0),[U[Je[Ge]].x],!1):[U[Je[Ge]].x]},[]);if(Math.min.apply(Math,J)===U[r].x){var Z=[];H.forEach(function(ve){Z.push(n[ve].toFixed(b))}),Y=Array.from(new Set(Z.sort(function(ve,We){return parseFloat(ve)-parseFloat(We)}))).map(v).join(l);var ne=Math.min.apply(Math,J),ee=Math.max.apply(Math,J),de=C[H[J.indexOf(ee)]].getBoundingClientRect().width;M.left="".concat(Math.abs(ne-(ee+de))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}S(Y),N(M)}},[e,n]),[E,h]};lt.useThumbOverlap=B8;function JT(e,n,r,i){var l=e.getBoundingClientRect(),v=l.left,b=l.top,d=l.width,h=l.height;return $T(i)?Math.abs(r-(b+h/2)):Math.abs(n-(v+d/2))}});var VT=ka(Kr=>{"use strict";var $8=Kr&&Kr.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var v in l)Object.prototype.hasOwnProperty.call(l,v)&&(i[v]=l[v])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),G8=Kr&&Kr.__createBinding||(Object.create?function(e,n,r,i){i===void 0&&(i=r);var l=Object.getOwnPropertyDescriptor(n,r);(!l||("get"in l?!n.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,i,l)}:function(e,n,r,i){i===void 0&&(i=r),e[i]=n[r]}),q8=Kr&&Kr.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),J8=Kr&&Kr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&G8(n,e,r);return q8(n,e),n},zT=Kr&&Kr.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;i1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.clientX,l.clientY]},function(){return i.onMove(l.clientX,l.clientY)})}else{var b=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.clientX,l.clientY,i.props.direction);(v=i.thumbRefs[b].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:b},function(){return i.onMove(l.clientX,l.clientY)})}},i.onResize=function(){(0,Bt.translateThumbs)(i.getThumbs(),i.getOffsets(),i.props.rtl),i.calculateMarkOffsets()},i.onTouchStartTrack=function(l){var v;if(l.persist(),i.addTouchEvents(l.nativeEvent),i.props.values.length>1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.touches[0].clientX,l.touches[0].clientY]},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}else{var b=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.touches[0].clientX,l.touches[0].clientY,i.props.direction);(v=i.thumbRefs[b].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:b},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}},i.onMouseOrTouchStart=function(l){if(!i.props.disabled){var v=(0,Bt.isTouchEvent)(l);if(!(!v&&l.button!==0)){var b=i.getTargetIndex(l);b!==-1&&(v?i.addTouchEvents(l):i.addMouseEvents(l),i.setState({draggedThumbIndex:b,thumbZIndexes:i.state.thumbZIndexes.map(function(d,h){return h===b?Math.max.apply(Math,i.state.thumbZIndexes):d<=i.state.thumbZIndexes[b]?d:d-1})}))}}},i.onMouseMove=function(l){l.preventDefault(),i.onMove(l.clientX,l.clientY)},i.onTouchMove=function(l){l.preventDefault(),i.onMove(l.touches[0].clientX,l.touches[0].clientY)},i.onKeyDown=function(l){var v=i.props,b=v.values,d=v.onChange,h=v.step,N=v.rtl,y=v.direction,E=i.state.isChanged,S=i.getTargetIndex(l.nativeEvent),C=N||y===Hn.Direction.Left||y===Hn.Direction.Down?-1:1;S!==-1&&(z8.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(b,S,i.normalizeValue(b[S]+C*(l.key==="PageUp"?h*10:h),S)))):V8.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(b,S,i.normalizeValue(b[S]-C*(l.key==="PageDown"?h*10:h),S)))):l.key==="Tab"?i.setState({draggedThumbIndex:-1},function(){E&&i.fireOnFinalChange()}):E&&i.fireOnFinalChange())},i.onKeyUp=function(l){var v=i.state.isChanged;i.setState({draggedThumbIndex:-1},function(){v&&i.fireOnFinalChange()})},i.onMove=function(l,v){var b=i.state,d=b.draggedThumbIndex,h=b.draggedTrackPos,N=i.props,y=N.direction,E=N.min,S=N.max,C=N.onChange,M=N.values,U=N.step,H=N.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Y=i.trackRef.current;if(!Y)return null;var J=Y.getBoundingClientRect(),Z=(0,Bt.isVertical)(y)?J.height:J.width;if(h[0]!==-1&&h[1]!==-1){var ne=l-h[0],ee=v-h[1],de=0;switch(y){case Hn.Direction.Right:case Hn.Direction.Left:de=ne/Z*(S-E);break;case Hn.Direction.Down:case Hn.Direction.Up:de=ee/Z*(S-E);break;default:(0,Bt.assertUnreachable)(y)}if(H&&(de*=-1),Math.abs(de)>=U/2){for(var ve=0;veS?de=S-M[ve]:We=U/2&&C((0,Bt.replaceAt)(M,d,i.normalizeValue(Je,d)))}},i.normalizeValue=function(l,v){var b=i.props,d=b.min,h=b.max,N=b.step,y=b.allowOverlap,E=b.values;return(0,Bt.normalizeValue)(l,v,d,h,N,y,E)},i.onEnd=function(l){if(l.preventDefault(),document.removeEventListener("mousemove",i.schdOnMouseMove),document.removeEventListener("touchmove",i.schdOnTouchMove),document.removeEventListener("mouseup",i.schdOnEnd),document.removeEventListener("touchend",i.schdOnEnd),document.removeEventListener("touchcancel",i.schdOnEnd),i.state.draggedThumbIndex===-1&&i.state.draggedTrackPos[0]===-1&&i.state.draggedTrackPos[1]===-1)return null;i.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){i.fireOnFinalChange()})},i.fireOnFinalChange=function(){i.setState({isChanged:!1});var l=i.props,v=l.onFinalChange,b=l.values;v&&v(b)},i.updateMarkRefs=function(l){if(!l.renderMark){i.numOfMarks=void 0,i.markRefs=void 0;return}i.numOfMarks=(l.max-l.min)/i.props.step,i.markRefs=[];for(var v=0;v-1?"grabbing":this.props.draggableTrack?(0,Bt.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!S?"pointer":"inherit"},onMouseDown:S?Bt.voidFn:this.onMouseDownTrack,onTouchStart:S?Bt.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:zT(zT([],H.map(function(Y,J,Z){return d({props:{style:r.props.direction===Hn.Direction.Left||r.props.direction===Hn.Direction.Right?{position:"absolute",left:"".concat(Y[0],"px"),marginTop:"".concat(Y[1],"px")}:{position:"absolute",top:"".concat(Y[0],"px"),marginLeft:"".concat(Y[1],"px")},key:"mark".concat(J),ref:r.markRefs[J]},index:J})}),!0),h.map(function(Y,J){var Z=r.state.draggedThumbIndex===J;return v({index:J,value:Y,isDragged:Z,props:{style:{position:"absolute",zIndex:U[J],cursor:S?"inherit":Z?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:J,tabIndex:S?void 0:0,"aria-valuemax":E?y:h[J+1]||y,"aria-valuemin":E?N:h[J-1]||N,"aria-valuenow":Y,draggable:!1,ref:r.thumbRefs[J],role:"slider",onKeyDown:S?Bt.voidFn:r.onKeyDown,onKeyUp:S?Bt.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:Hn.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n}($d.Component);Kr.default=K8});var KT=ka(pr=>{"use strict";var Y8=pr&&pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pr,"__esModule",{value:!0});pr.checkValuesAgainstBoundaries=pr.relativeValue=pr.useThumbOverlap=pr.Direction=pr.getTrackBackground=pr.Range=void 0;var Q8=Y8(VT());pr.Range=Q8.default;var Gd=J_();Object.defineProperty(pr,"getTrackBackground",{enumerable:!0,get:function(){return Gd.getTrackBackground}});Object.defineProperty(pr,"useThumbOverlap",{enumerable:!0,get:function(){return Gd.useThumbOverlap}});Object.defineProperty(pr,"relativeValue",{enumerable:!0,get:function(){return Gd.relativeValue}});Object.defineProperty(pr,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return Gd.checkValuesAgainstBoundaries}});var X8=Bd();Object.defineProperty(pr,"Direction",{enumerable:!0,get:function(){return X8.Direction}})});var C7={};mh(C7,{boot:()=>w7});var Ms={compose:function(e){return function(n){return function(r){return e(n(r))}}}};var He=function(e){return e.identity},$e={identity:function(e){return e},Semigroupoid0:function(){return Ms}};var rt=!0;var np=function(e){return function(n){return function(r){return function(i){return e(n(r))(n(i))}}}},Nt=function(e){return function(n){return function(r){return e(r)(n)}}},Qe=function(e){return function(n){return e}};var _h=function(e){return function(n){for(var r=n.length,i=new Array(r),l=0;l>1),d-v>1&&e(n,r,l,i,v,d),b-d>1&&e(n,r,l,i,d,b),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=E,++h);for(;h="0"&&e[l]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+v})+'"'};var lr={show:Bh};var un={show:Hh};var Re=function(e){return e.show};var Tt=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),at=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var Vt=function(){function e(){}return e.value=new e,e}(),Al=function(e){return e};var Pl=function(e){return e.to};var js=function(e){return e.from};var BE=He($e),z=function(){function e(){}return e.value=new e,e}(),$=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var Ft=function(e){return function(n){return function(r){if(r instanceof z)return e;if(r instanceof $)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},Ga=Ft(!0)(Qe(!1)),vi=Ft(!1)(Qe(!0));var Le={map:function(e){return function(n){return n instanceof $?new $(e(n.value0)):z.value}}},$E=X(Le);var Zt=function(e){return Ft(e)(BE)},Wn=function(){return function(e){if(e instanceof $)return e.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[e.constructor.name])}};var io=function(e){var n=Ue(e);return{eq:function(r){return function(i){return r instanceof z&&i instanceof z?!0:r instanceof $&&i instanceof $?n(r.value0)(i.value0):!1}}}};var aa={apply:function(e){return function(n){if(e instanceof $)return $E(e.value0)(n);if(e instanceof z)return z.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Le}};var Kt={bind:function(e){return function(n){if(e instanceof $)return n(e.value0);if(e instanceof z)return z.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return aa}};var cr=function(){return{pure:$.create,Apply0:function(){return aa}}}();var Ns={alt:function(e){return function(n){return e instanceof z?n:e}},Functor0:function(){return Le}},GE=function(){return{empty:z.value,Alt0:function(){return Ns}}}(),sp={Applicative0:function(){return cr},Plus1:function(){return GE}};var Ee=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),we=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var Us=function(e){return Ft(new Ee(e))(we.create)};var sr={map:function(e){return function(n){if(n instanceof Ee)return new Ee(n.value0);if(n instanceof we)return new we(e(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},qE=X(sr);var Rn=function(e){return function(n){return function(r){if(r instanceof Ee)return e(r.value0);if(r instanceof we)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},fp=function(){return Rn(Qe(z.value))($.create)}();var $h={apply:function(e){return function(n){if(e instanceof Ee)return new Ee(e.value0);if(e instanceof we)return qE(e.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return sr}};var ko={bind:Rn(function(e){return function(n){return new Ee(e)}})(function(e){return function(n){return n(e)}}),Apply0:function(){return $h}};var uo=function(e){return e};var Ho={map:function(e){return function(n){return e(n)}}};var Gh={apply:function(e){return function(n){return e(n)}},Functor0:function(){return Ho}},JE={bind:function(e){return function(n){return n(e)}},Apply0:function(){return Gh}},zE={pure:uo,Apply0:function(){return Gh}},Jn={Applicative0:function(){return zE},Bind1:function(){return JE}};var co={mempty:"",Semigroup0:function(){return ap}};var Ut=function(e){return e.mempty};var Jh=function(e){return function(){return e}},zh=function(e){return function(n){return function(){return n(e())()}}};var vp=function(e){return function(n){return function(){for(var r=0,i=e.length;r>1),d-v>1&&e(n,r,l,i,v,d),b-d>1&&e(n,r,l,i,d,b),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=E,++h);for(;h=0;v--)i=e(r[v])(i);return i}}},dg=function(e){return function(n){return function(r){for(var i=n,l=r.length,v=0;v=0&&e<100&&d.setUTCFullYear(e),d.getTime()};function Sg(e){return function(n){return function(r){return function(i){var l=hw(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond),v=new Date(l+r);return isNaN(v.getTime())?n:e({year:v.getUTCFullYear(),month:v.getUTCMonth()+1,day:v.getUTCDate(),hour:v.getUTCHours(),minute:v.getUTCMinutes(),second:v.getUTCSeconds(),millisecond:v.getUTCMilliseconds()})}}}}var gw=function(e,n,r){var i=new Date(Date.UTC(e,n,r));return e>=0&&e<100&&i.setUTCFullYear(e),i};function Ig(e,n,r,i){var l=gw(n,r-1,i);return e(l.getUTCFullYear())(l.getUTCMonth()+1)(l.getUTCDate())}function Jo(e){return e.charCodeAt(0)}function Lg(e){return String.fromCharCode(e)}var Qs=function(e){var n=ce(e.Applicative0()),r=br(e.Plus1());return function(i){if(i)return n(be);if(!i)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[i.constructor.name])}};var jg=rn(cu),Ng=dn(cu);var dt=function(e){return e.toEnum};var bt=function(e){return e.fromEnum};var Jl=function(e){return function(n){return function(r){return e(n(r)+1|0)}}},zl=function(e){return function(n){return function(r){return e(n(r)-1|0)}}};var Pp=function(e){return e>=Jo(jg)&&e<=Jo(Ng)?new $(Lg(e)):z.value},Dw={succ:Jl(Pp)(Jo),pred:zl(Pp)(Jo),Ord0:function(){return As}};var Vl=function(){return{cardinality:Jo(Ng)-Jo(jg)|0,toEnum:Pp,fromEnum:Jo,Bounded0:function(){return cu},Enum1:function(){return Dw}}}();var jp=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var zr=function(){function e(){}return e.value=new e,e}(),ia=function(){function e(){}return e.value=new e,e}(),ua=function(){function e(){}return e.value=new e,e}(),la=function(){function e(){}return e.value=new e,e}(),ca=function(){function e(){}return e.value=new e,e}(),sa=function(){function e(){}return e.value=new e,e}(),fa=function(){function e(){}return e.value=new e,e}(),da=function(){function e(){}return e.value=new e,e}(),va=function(){function e(){}return e.value=new e,e}(),pa=function(){function e(){}return e.value=new e,e}(),ma=function(){function e(){}return e.value=new e,e}(),qa=function(){function e(){}return e.value=new e,e}();var Xs=Jt,Zs=Jt,Ug=ur;var Np={eq:function(e){return function(n){return e instanceof zr&&n instanceof zr||e instanceof ia&&n instanceof ia||e instanceof ua&&n instanceof ua||e instanceof la&&n instanceof la||e instanceof ca&&n instanceof ca||e instanceof sa&&n instanceof sa||e instanceof fa&&n instanceof fa||e instanceof da&&n instanceof da||e instanceof va&&n instanceof va||e instanceof pa&&n instanceof pa||e instanceof ma&&n instanceof ma||e instanceof qa&&n instanceof qa}}},ef={compare:function(e){return function(n){if(e instanceof zr&&n instanceof zr)return ut.value;if(e instanceof zr)return Me.value;if(n instanceof zr)return xe.value;if(e instanceof ia&&n instanceof ia)return ut.value;if(e instanceof ia)return Me.value;if(n instanceof ia)return xe.value;if(e instanceof ua&&n instanceof ua)return ut.value;if(e instanceof ua)return Me.value;if(n instanceof ua)return xe.value;if(e instanceof la&&n instanceof la)return ut.value;if(e instanceof la)return Me.value;if(n instanceof la)return xe.value;if(e instanceof ca&&n instanceof ca)return ut.value;if(e instanceof ca)return Me.value;if(n instanceof ca)return xe.value;if(e instanceof sa&&n instanceof sa)return ut.value;if(e instanceof sa)return Me.value;if(n instanceof sa)return xe.value;if(e instanceof fa&&n instanceof fa)return ut.value;if(e instanceof fa)return Me.value;if(n instanceof fa)return xe.value;if(e instanceof da&&n instanceof da)return ut.value;if(e instanceof da)return Me.value;if(n instanceof da)return xe.value;if(e instanceof va&&n instanceof va)return ut.value;if(e instanceof va)return Me.value;if(n instanceof va)return xe.value;if(e instanceof pa&&n instanceof pa)return ut.value;if(e instanceof pa)return Me.value;if(n instanceof pa)return xe.value;if(e instanceof ma&&n instanceof ma)return ut.value;if(e instanceof ma)return Me.value;if(n instanceof ma)return xe.value;if(e instanceof qa&&n instanceof qa)return ut.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return Np}},Og=ur,tf=function(){return{bottom:-271820|0,top:275759,Ord0:function(){return Xs}}}();var nf=function(){return{bottom:zr.value,top:qa.value,Ord0:function(){return ef}}}(),Vr={cardinality:547580,toEnum:function(e){if(e>=(-271820|0)&&e<=275759)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return tf},Enum1:function(){return yw(0)}},yw=jp("enumYear","Data.Date.Component",function(){return{succ:function(){var e=dt(Vr),n=bt(Vr);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(Vr),n=bt(Vr);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return Xs}}});var Xn={cardinality:12,toEnum:function(e){return e===1?new $(zr.value):e===2?new $(ia.value):e===3?new $(ua.value):e===4?new $(la.value):e===5?new $(ca.value):e===6?new $(sa.value):e===7?new $(fa.value):e===8?new $(da.value):e===9?new $(va.value):e===10?new $(pa.value):e===11?new $(ma.value):e===12?new $(qa.value):z.value},fromEnum:function(e){if(e instanceof zr)return 1;if(e instanceof ia)return 2;if(e instanceof ua)return 3;if(e instanceof la)return 4;if(e instanceof ca)return 5;if(e instanceof sa)return 6;if(e instanceof fa)return 7;if(e instanceof da)return 8;if(e instanceof va)return 9;if(e instanceof pa)return 10;if(e instanceof ma)return 11;if(e instanceof qa)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return nf},Enum1:function(){return Rw(0)}},Rw=jp("enumMonth","Data.Date.Component",function(){return{succ:function(){var e=dt(Xn),n=bt(Xn);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(Xn),n=bt(Xn);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return ef}}});var rf={bottom:1,top:31,Ord0:function(){return Zs}},_a={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return rf},Enum1:function(){return Tw(0)}},Tw=jp("enumDay","Data.Date.Component",function(){return{succ:function(){var e=dt(_a),n=bt(_a);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(_a),n=bt(_a);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return Zs}}});var Wg=function(e){return function(n){return function(r){return(r|0)===r?e(r):n}}};var Kl=function(){return Wg($.create)(z.value)}();var Gg=He($e);var af=function(e){return e.fromDuration};var of={fromDuration:Gg,toDuration:Gg};var jw=bt(Xn),Nw=Wn();var Uw=Ue(Ug),Ow=Ue(Np),Ww=Ue(Og),kw=Ie(Xs),Hw=Ie(ef),Bw=Ie(Zs);var $w=dt(Xn);var lf=function(){function e(n,r,i){this.value0=n,this.value1=r,this.value2=i}return e.create=function(n){return function(r){return function(i){return new e(n,r,i)}}},e}(),wi=function(e){return e.value0};var Ci=function(e){return e.value1};var cf={eq:function(e){return function(n){return Uw(e.value0)(n.value0)&&Ow(e.value1)(n.value1)&&Ww(e.value2)(n.value2)}}},Gw=Ue(cf),Wp={compare:function(e){return function(n){var r=kw(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof xe)return xe.value;var i=Hw(e.value1)(n.value1);return i instanceof Me?Me.value:i instanceof xe?xe.value:Bw(e.value2)(n.value2)}},Eq0:function(){return cf}};var Ru=function(e){return e.value2},xi=function(e){return function(n){return function(r){var i=function(l){return function(v){return function(b){return new lf(l,Nw($w(v)),b)}}};return Ig(i,e,jw(n),r)}}},kp=function(e){return function(n){return function(r){var i=new lf(e,n,r),l=Gw(xi(e)(n)(r))(i);return l?new $(i):z.value}}},Hp=function(){return{bottom:new lf(rn(tf),rn(nf),rn(rf)),top:new lf(dn(tf),dn(nf),dn(rf)),Ord0:function(){return Wp}}}();var sf=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var ff=Jt,df=Jt,vf=Jt,pf=Jt,Zg=ur,e1=ur,t1=ur,n1=ur,Yl={bottom:0,top:59,Ord0:function(){return ff}},Ql={bottom:0,top:59,Ord0:function(){return df}},Xl={bottom:0,top:999,Ord0:function(){return vf}},Zl={bottom:0,top:23,Ord0:function(){return pf}},ha={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Yl},Enum1:function(){return qw(0)}},qw=sf("enumSecond","Data.Time.Component",function(){return{succ:function(){var e=dt(ha),n=bt(ha);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(ha),n=bt(ha);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return ff}}});var ga={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Ql},Enum1:function(){return Jw(0)}},Jw=sf("enumMinute","Data.Time.Component",function(){return{succ:function(){var e=dt(ga),n=bt(ga);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(ga),n=bt(ga);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return df}}});var Da={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Xl},Enum1:function(){return zw(0)}},zw=sf("enumMillisecond","Data.Time.Component",function(){return{succ:function(){var e=dt(Da),n=bt(Da);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(Da),n=bt(Da);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return vf}}});var ya={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new $(e);if(rt)return z.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Zl},Enum1:function(){return Vw(0)}},Vw=sf("enumHour","Data.Time.Component",function(){return{succ:function(){var e=dt(ya),n=bt(ya);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=dt(ya),n=bt(ya);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return pf}}});var Xw=Ue(n1),Zw=Ue(e1),eC=Ue(Zg),tC=Ue(t1),nC=Ie(pf),rC=Ie(df),aC=Ie(ff),oC=Ie(vf);var fo=function(){function e(n,r,i,l){this.value0=n,this.value1=r,this.value2=i,this.value3=l}return e.create=function(n){return function(r){return function(i){return function(l){return new e(n,r,i,l)}}}},e}();var bu=function(e){return e.value2},Eu=function(e){return e.value1},Fu=function(e){return e.value3};var wu=function(e){return e.value0};var Bp={eq:function(e){return function(n){return Xw(e.value0)(n.value0)&&Zw(e.value1)(n.value1)&&eC(e.value2)(n.value2)&&tC(e.value3)(n.value3)}}},$p={compare:function(e){return function(n){var r=nC(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof xe)return xe.value;var i=rC(e.value1)(n.value1);if(i instanceof Me)return Me.value;if(i instanceof xe)return xe.value;var l=aC(e.value2)(n.value2);return l instanceof Me?Me.value:l instanceof xe?xe.value:oC(e.value3)(n.value3)}},Eq0:function(){return Bp}};var Gp=function(){return{bottom:new fo(rn(Zl),rn(Ql),rn(Yl),rn(Xl)),top:new fo(dn(Zl),dn(Ql),dn(Yl),dn(Xl)),Ord0:function(){return $p}}}();var uC=bt(Vr),lC=bt(Xn),cC=bt(_a),sC=bt(ya),fC=bt(ga),dC=bt(ha),vC=bt(Da);var pC=Ue(cf),mC=Ue(Bp),_C=Ie(Wp),hC=Ie($p),gC=pe(Kt),Cu=mt(aa),qp=X(Le),DC=Ml(Kt),yC=dt(Vr),RC=dt(Xn),TC=dt(_a),bC=dt(ya),EC=dt(ga),FC=dt(ha),wC=dt(Da),zo=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),CC=function(e){return{year:uC(wi(e.value0)),month:lC(Ci(e.value0)),day:cC(Ru(e.value0)),hour:sC(wu(e.value1)),minute:fC(Eu(e.value1)),second:dC(bu(e.value1)),millisecond:vC(Fu(e.value1))}};var xC={eq:function(e){return function(n){return pC(e.value0)(n.value0)&&mC(e.value1)(n.value1)}}},ec={compare:function(e){return function(n){var r=_C(e.value0)(n.value0);return r instanceof Me?Me.value:r instanceof xe?xe.value:hC(e.value1)(n.value1)}},Eq0:function(){return xC}};var mf=function(){return{bottom:new zo(rn(Hp),rn(Gp)),top:new zo(dn(Hp),dn(Gp)),Ord0:function(){return ec}}}(),r1=function(e){var n=af(e);return function(r){return function(i){return gC(Sg($.create)(z.value)(n(r))(CC(i)))(function(l){return Cu(qp(zo.create)(DC(Cu(Cu(qp(kp)(yC(l.year)))(RC(l.month)))(TC(l.day)))))(Cu(Cu(Cu(qp(fo.create)(bC(l.hour)))(EC(l.minute)))(FC(l.second)))(wC(l.millisecond)))})}}};var dr=function(){var e={},n="Pure",r="Throw",i="Catch",l="Sync",v="Async",b="Bind",d="Bracket",h="Fork",N="Sequential",y="Map",E="Apply",S="Alt",C="Cons",M="Resume",U="Release",H="Finalizer",Y="Finalized",J="Forked",Z="Fiber",ne="Thunk";function ee(me,st,St,Pe){this.tag=me,this._1=st,this._2=St,this._3=Pe}function de(me){var st=function(St,Pe,Ce){return new ee(me,St,Pe,Ce)};return st.tag=me,st}function ve(me){return new ee(n,void 0)}function We(me){try{me()}catch(st){setTimeout(function(){throw st},0)}}function Ge(me,st,St){try{return st(St())}catch(Pe){return me(Pe)}}function Je(me,st,St){try{return st(St)()}catch(Pe){return St(me(Pe))(),ve}}var en=function(){var me=1024,st=0,St=0,Pe=new Array(me),Ce=!1;function _e(){var et;for(Ce=!0;st!==0;)st--,et=Pe[St],Pe[St]=void 0,St=(St+1)%me,et();Ce=!1}return{isDraining:function(){return Ce},enqueue:function(et){var Ye,Et;st===me&&(Et=Ce,_e(),Ce=Et),Pe[(St+st)%me]=et,st++,Ce||_e()}}}();function an(me){var st={},St=0,Pe=0;return{register:function(Ce){var _e=St++;Ce.onComplete({rethrow:!0,handler:function(et){return function(){Pe--,delete st[_e]}}})(),st[_e]=Ce,Pe++},isEmpty:function(){return Pe===0},killAll:function(Ce,_e){return function(){if(Pe===0)return _e();var et=0,Ye={};function Et(Be){Ye[Be]=st[Be].kill(Ce,function(ft){return function(){delete Ye[Be],et--,me.isLeft(ft)&&me.fromLeft(ft)&&setTimeout(function(){throw me.fromLeft(ft)},0),et===0&&_e()}})()}for(var tn in st)st.hasOwnProperty(tn)&&(et++,Et(tn));return st={},St=0,Pe=0,function(Be){return new ee(l,function(){for(var ft in Ye)Ye.hasOwnProperty(ft)&&Ye[ft]()})}}}}}var it=0,ht=1,Pt=2,Qt=3,Ot=4,wt=5,Gt=6;function Mt(me,st,St){var Pe=0,Ce=it,_e=St,et=null,Ye=null,Et=null,tn=null,Be=null,ft=0,Sn=0,gt=null,kr=!0;function O(x){for(var L,W,k;;)switch(L=null,W=null,k=null,Ce){case Pt:Ce=ht;try{_e=Et(_e),tn===null?Et=null:(Et=tn._1,tn=tn._2)}catch(V){Ce=wt,et=me.left(V),_e=null}break;case Qt:me.isLeft(_e)?(Ce=wt,et=_e,_e=null):Et===null?Ce=wt:(Ce=Pt,_e=me.fromRight(_e));break;case ht:switch(_e.tag){case b:Et&&(tn=new ee(C,Et,tn)),Et=_e._2,Ce=ht,_e=_e._1;break;case n:Et===null?(Ce=wt,_e=me.right(_e._1)):(Ce=Pt,_e=_e._1);break;case l:Ce=Qt,_e=Ge(me.left,me.right,_e._1);break;case v:Ce=Ot,_e=Je(me.left,_e._1,function(V){return function(){Pe===x&&(Pe++,en.enqueue(function(){Pe===x+1&&(Ce=Qt,_e=V,O(Pe))}))}});return;case r:Ce=wt,et=me.left(_e._1),_e=null;break;case i:Et===null?Be=new ee(C,_e,Be,Ye):Be=new ee(C,_e,new ee(C,new ee(M,Et,tn),Be,Ye),Ye),Et=null,tn=null,Ce=ht,_e=_e._1;break;case d:ft++,Et===null?Be=new ee(C,_e,Be,Ye):Be=new ee(C,_e,new ee(C,new ee(M,Et,tn),Be,Ye),Ye),Et=null,tn=null,Ce=ht,_e=_e._1;break;case h:Ce=Qt,L=Mt(me,st,_e._2),st&&st.register(L),_e._1&&L.run(),_e=me.right(L);break;case N:Ce=ht,_e=Mn(me,st,_e._1);break}break;case wt:if(Et=null,tn=null,Be===null)Ce=Gt,_e=Ye||et||_e;else switch(L=Be._3,k=Be._1,Be=Be._2,k.tag){case i:Ye&&Ye!==L&&ft===0?Ce=wt:et&&(Ce=ht,_e=k._2(me.fromLeft(et)),et=null);break;case M:Ye&&Ye!==L&&ft===0||et?Ce=wt:(Et=k._1,tn=k._2,Ce=Pt,_e=me.fromRight(_e));break;case d:ft--,et===null&&(W=me.fromRight(_e),Be=new ee(C,new ee(U,k._2,W),Be,L),(Ye===L||ft>0)&&(Ce=ht,_e=k._3(W)));break;case U:Be=new ee(C,new ee(Y,_e,et),Be,Ye),Ce=ht,Ye&&Ye!==L&&ft===0?_e=k._1.killed(me.fromLeft(Ye))(k._2):et?_e=k._1.failed(me.fromLeft(et))(k._2):_e=k._1.completed(me.fromRight(_e))(k._2),et=null,ft++;break;case H:ft++,Be=new ee(C,new ee(Y,_e,et),Be,Ye),Ce=ht,_e=k._1;break;case Y:ft--,Ce=wt,_e=k._1,et=k._2;break}break;case Gt:for(var Q in gt)gt.hasOwnProperty(Q)&&(kr=kr&>[Q].rethrow,We(gt[Q].handler(_e)));gt=null,Ye&&et?setTimeout(function(){throw me.fromLeft(et)},0):me.isLeft(_e)&&kr&&setTimeout(function(){if(kr)throw me.fromLeft(_e)},0);return;case it:Ce=ht;break;case Ot:return}}function G(x){return function(){if(Ce===Gt)return kr=kr&&x.rethrow,x.handler(_e)(),function(){};var L=Sn++;return gt=gt||{},gt[L]=x,function(){gt!==null&&delete gt[L]}}}function A(x,L){return function(){if(Ce===Gt)return L(me.right(void 0))(),function(){};var W=G({rethrow:!1,handler:function(){return L(me.right(void 0))}})();switch(Ce){case it:Ye=me.left(x),Ce=Gt,_e=Ye,O(Pe);break;case Ot:Ye===null&&(Ye=me.left(x)),ft===0&&(Ce===Ot&&(Be=new ee(C,new ee(H,_e(x)),Be,Ye)),Ce=wt,_e=null,et=null,O(++Pe));break;default:Ye===null&&(Ye=me.left(x)),ft===0&&(Ce=wt,_e=null,et=null)}return W}}function D(x){return function(){var L=G({rethrow:!1,handler:x})();return Ce===it&&O(Pe),L}}return{kill:A,join:D,onComplete:G,isSuspended:function(){return Ce===it},run:function(){Ce===it&&(en.isDraining()?O(Pe):en.enqueue(function(){O(Pe)}))}}}function ct(me,st,St,Pe){var Ce=0,_e={},et=0,Ye={},Et=new Error("[ParAff] Early exit"),tn=null,Be=e;function ft(G,A,D){var x=A,L=null,W=null,k=0,Q={},V,re;e:for(;;)switch(V=null,x.tag){case J:if(x._3===e&&(V=_e[x._1],Q[k++]=V.kill(G,function(ie){return function(){k--,k===0&&D(ie)()}})),L===null)break e;x=L._2,W===null?L=null:(L=W._1,W=W._2);break;case y:x=x._2;break;case E:case S:L&&(W=new ee(C,L,W)),L=x,x=x._1;break}if(k===0)D(me.right(void 0))();else for(re=0,V=k;re":e===void 0?"":e instanceof Date?e.toString():typeof Blob!="undefined"&&e instanceof Blob?"file["+e.name+"]":JSON.stringify(e)}var Tx=mn(It),k1=bi(Hl),bx=Tn(It);var uc=function(e){return e.foldrWithIndex};var lc=function(e){return e.foldlWithIndex};var Ex=function(e){var n=uc(e);return function(r){var i=Oe(r.Semigroup0()),l=Ut(r);return function(v){return n(function(b){return function(d){return function(h){return i(v(b)(d))(h)}}})(l)}}},cc={foldrWithIndex:function(e){return function(n){var r=Tx(function(l){return function(v){return e(l.value0)(l.value1)(v)}})(n),i=k1(nt.create);return function(l){return r(i(l))}}},foldlWithIndex:function(e){return function(n){var r=bx(function(l){return function(v){return e(v.value0)(l)(v.value1)}})(n),i=k1(nt.create);return function(l){return r(i(l))}}},foldMapWithIndex:function(e){return Ex(cc)(e)},Foldable0:function(){return It}};var H1=function(e){var n=lc(e);return function(r){var i=function(l){return function(v){return function(b){return v instanceof z?r(l)(b):v}}};return n(i)(z.value)}};function Ff(e){return Object.prototype.toString.call(e).slice(8,-1)}function wf(e){return e===null}function sc(e){return e===void 0}var Cf=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var vo=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var xf=function(e){var n=br(e);return function(r){return new vo(r,n)}};var zn=function(){function e(){}return e.value=new e,e}(),Yt=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),Mf=function(e){return e},Ux=function(e){return new Yt(e.value0,e.value1)};var Ox=function(e){var n=function(r){return function(i){var l=r,v=!1,b;function d(h,N){if(N instanceof Yt&&N.value1 instanceof Yt&&N.value1.value1 instanceof Yt){l=new Yt(N,h),i=N.value1.value1.value1;return}var y=function(S){return S instanceof Yt&&S.value1 instanceof Yt&&S.value1.value1 instanceof zn?new Yt(e(S.value0),new Yt(e(S.value1.value0),zn.value)):S instanceof Yt&&S.value1 instanceof zn?new Yt(e(S.value0),zn.value):zn.value},E=function(S){return function(C){var M=S,U=!1,H;function Y(J,Z){if(J instanceof Yt&&J.value0 instanceof Yt&&J.value0.value1 instanceof Yt&&J.value0.value1.value1 instanceof Yt){M=J.value1,C=new Yt(e(J.value0.value0),new Yt(e(J.value0.value1.value0),new Yt(e(J.value0.value1.value1.value0),Z)));return}return U=!0,Z}for(;!U;)H=Y(M,C);return H}};return v=!0,E(h)(y(N))}for(;!v;)b=d(l,i);return b}};return n(zn.value)},Wx={map:Ox};var Li={foldr:function(e){return function(n){var r=function(){var l=function(v){return function(b){var d=v,h=!1,N;function y(E,S){if(S instanceof zn)return h=!0,E;if(S instanceof Yt){d=new Yt(S.value0,E),b=S.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[E.constructor.name,S.constructor.name])}for(;!h;)N=y(d,b);return N}};return l(zn.value)}(),i=Tn(Li)(Nt(e))(n);return function(l){return i(r(l))}}},foldl:function(e){var n=function(r){return function(i){var l=r,v=!1,b;function d(h,N){if(N instanceof zn)return v=!0,h;if(N instanceof Yt){l=e(h)(N.value0),i=N.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[N.constructor.name])}for(;!v;)b=d(l,i);return b}};return n},foldMap:function(e){var n=Oe(e.Semigroup0()),r=Ut(e);return function(i){return Tn(Li)(function(l){var v=n(l);return function(b){return v(i(b))}})(r)}}};var kx=mn(Li);var rm={append:function(e){return function(n){return kx(Yt.create)(n)(e)}}},G1=Oe(rm);var Sf={append:function(e){return function(n){return new vo(e.value0,G1(e.value1)(Ux(n)))}}};var Hx={alt:G1,Functor0:function(){return Wx}},q1=function(){return{empty:zn.value,Alt0:function(){return Hx}}}();var om=function(){var e=xf(q1);return function(n){return Mf(e(n))}}();var Q1=function(e){return e.value0};var Qo=function(e){return e.length};var X1=function(e){return function(n){return function(r){return function(i){var l=i.indexOf(r);return l===-1?n:e(l)}}}};var Pu=function(e){return function(n){return n.substr(0,e)}},Xo=function(e){return function(n){return n.substring(e)}};var So=function(e){return function(n){if(e>=0&&e""),W2=Nf.unmountComponentAtNode;function aD(e,n,r){return er.createElement.apply(null,[e,k2(e,n)].concat(r))}function k2(e,n){if(typeof e!="string"||n._data==null)return n;var r={_data:void 0};for(var i in n._data){var l=n._data[i];r["data-"+i]=l}return Object.assign({},n,r)}var oD=(e,n)=>n[e],iD=(e,n,r)=>r[e]=n;var ku=function(n){return function(r){return n(r)()}};var Ui=function(n){return function(r){return function(i){return function(){return n(r,i)}}}},Hu=function(n){return function(r){return function(i){return function(l){return function(){return n(r,i,l)}}}}};var Om=null;function cD(e,n,r){return e==null?n:r(e)}function Wm(e){return e}var Po=Ft(Om)(Wm),Se=function(e){return cD(e,z.value,$.create)};var tM=Ct(ot);var Qa={asReactChildren:function(e){return[e]}},jo={asReactChildren:function(e){return[e]}},Xa={asReactChildren:He($e)};var sD=Hu(tD),fD=function(){return Hu(iD)},dD=Ui(nD),vD=Ui(rD);var km=function(e){var n=jf(e);return function(r){return function(i){return tM(function(){return oD(r,i)})(n)}}};var nM=function(e){return e.asReactChildren},bc=function(){return function(e){var n=nM(e);return function(r){return function(i){return function(l){return aD(r,i,n(l))}}}}},rM=bc()(Xa),Ec=function(){return function(e){return function(n){return rM(e)(n)([])}}};var pD=X(ot),aM=ce(vn);var mD=function(){var e=function(n){return function(r){return{initialize:function(i){return pi(new $(r.initialState))(n)},getState:function(i){return pD(Zt(r.initialState))(fu(n))},setState:function(i){return function(l){return function(v){return function(){return pi(new $(l))(n)(),sD(i)(l)(aM(be))(),v()}}}}}}};return pD(e)(jl(z.value))}();var _D=Ct(zt),hD=Oe(Dr);var iM=ce(vn),gD=fD(),uM=km(kn),DD=X(ot),lM=km(wr(c0)),cM=Nn(On),sM=Un(Gr),fM=wp(vn)(It),dM=cM(Zn),yD=Lt(Mu),vM=wh($o),pM=Oe(op(mp(Is)));var Oi=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),mM={map:function(e){return function(n){return new Oi(e(n.value0),n.value1)}}},Jf=function(e){return{bimap:function(n){return function(r){return function(i){return new Oi(r(i.value0),_D(i.value1)(function(l){return function(v){return l({dispatch:function(b){return v.dispatch(n(b))},onStop:v.onStop})}}))}}}}},RD={apply:function(e){return function(n){return new Oi(e.value0(n.value0),hD(e.value1)(n.value1))}},Functor0:function(){return mM}},Wi={bind:function(e){return function(n){var r=n(e.value0);return new Oi(r.value0,hD(e.value1)(r.value1))}},Apply0:function(){return RD}},No={pure:function(e){return new Oi(e,[])},Apply0:function(){return RD}};var _M=function(e){var n=pe(e);return function(r){var i=Lt(r);return function(l){return function(v){return new Oi(l,_D(v)(function(b){return function(d){return n(b)(function(h){return i(d.dispatch(h))})}}))}}}};var zf=function(e){return new Oi(be,[e])},Bu=function(e){return zf(Qe(e))},$u=function(e){var n=pe(e.Monad0().Bind1()),r=Lt(e);return function(i){return zf(function(l){return n(i)(function(v){return r(Ft(iM(be))(l.dispatch)(v))})})}},Gu=function(e){var n=_M(e.Monad0().Bind1())(e);return function(r){return n(be)([r])}},hM=function(e){return function(n){return function(r){var i=r({initialState:n.init.value0}),l=gD("__unmounted"),v=gD("__subscriptions"),b=function(){var C=DD(Zt(!1)),M=uM("__unmounted");return function(U){return C(M(U))}}(),d=function(){var C=DD(Zt([])),M=lM("__subscriptions");return function(U){return C(M(U))}}(),h=function(C){return function(){return sM(fM)(d(C))(),v([])(C)()}},N=function(C){return function(M){return function(){var H=d(C)();return v(qo(Yp(M))(H))(C)()}}},y=function(C){return function(M){var U=function(H){return Yp(dM(Mo(0))(function(){return H({dispatch:function(){var Y=E(M);return function(J){return yD(Y(J))}}(),onStop:N(M)})}))};return vp(C)(U)}},E=function(C){return function(M){return vM(b(C))(function(){var H=i.getState(C)(),Y=n.update(H)(M);return i.setState(C)(Y.value0)(y(Y.value1)(C))()})}},S=function(C){return function(){var U=i.getState(C)();return n.view(U)(E(C))}};return P1(e,{init:i.initialize,render:S,componentDidMount:y(n.init.value1),componentWillUnmount:pM(l(!0))(h)})}}},TD=function(e){return function(){var r=yD(mD)();return A1(function(i){return hM(i)(e)(r)})}};var Vf={handle:function(e){return function(n){return function(r){return e(n(r))()}}}},bD={handleEffect:function(e){return ku(e)}},ED={handleEffect:function(e){return ku(Qe(e))}},qu={handle:function(e){return function(n){return function(r){return e(n)()}}}};var Kf=function(e){return e.handleEffect},ti=function(e){return e.handle};function Yf(e,n){var r={};for(var i in n)({}).hasOwnProperty.call(n,i)&&(r[i]=n[i]);for(var l in e)({}).hasOwnProperty.call(e,l)&&(r[l]=e[l]);return r}var FD=function(){return function(){return function(e){return function(n){return Yf(e,n)}}}};var wD=bc(),gM=FD()();var CD=he;var Fc=function(e){var n=wD(e);return function(r){return function(i){return function(l){return n(CD(r))(gM(l)({className:i}))}}}};var Qf=function(e){return function(n){var r=wD(n);return function(i){return function(l){return r(CD(e))({className:i})(l)}}}};var ki=he;var xD=function(e){var n=Fc(e);return function(){return function(){return n("video")}}};var Hm=function(e){return Qf("span")(e)};var MD=function(e){return Qf("i")(e)};var ni=function(e){var n=Fc(e);return function(){return function(){return n("div")}}},Uo=function(e){return Qf("div")(e)};var Xf=function(e){var n=Fc(e);return function(){return function(){return n("button")}}};var SD=function(e){var n=Fc(e);return function(){return function(){return n("a")}}};var ID=wl(Rm()),LD=ID.Fragment;var wc=he,Bm=bc()(Xa)(LD)({}),xr=!1;var DM=ce(vn);var yM=function(e){var n=pe(e.Monad0().Bind1()),r=Lt(e);return function(i){return function(l){return zf(function(v){return n(l(function(){var b=Ft(DM(be))(v.dispatch);return function(d){return b(i(d))}}()))(function(b){return r(v.onStop(b))})})}}},AD=function(e){var n=yM(e);return function(r){return n(function(i){return $.create(r(i))})}};var Ta=function(){return{"genericTop'":Vt.value}}();var $m=function(e){return e["genericTop'"]},ba=function(e){return{"genericTop'":$m(e)}};var Ea=function(){return{"genericBottom'":Vt.value}}();var Cc=function(e){return e["genericBottom'"]},Fa=function(e){return{"genericBottom'":Cc(e)}};var wa=function(e){return{"genericBottom'":new Tt(Cc(e))}},PD=function(e){var n=Pl(e);return function(r){return n(Cc(r))}};var ri=X(Le),Zf=pn();var Gm=function(e){return e["genericToEnum'"]};var ed=function(e){return e["genericSucc'"]},jD=function(e){var n=Pl(e),r=js(e);return function(i){var l=ri(n),v=ed(i);return function(b){return l(v(r(b)))}}},qm=function(e){return e["genericPred'"]};var Jm=function(e){return e["genericFromEnum'"]};var Ca=function(e){var n=qm(e),r=ed(e);return function(i){var l=$m(i);return function(v){var b=qm(v),d=ed(v);return function(h){var N=Cc(h);return{"genericPred'":function(y){if(y instanceof Tt)return ri(Tt.create)(n(y.value0));if(y instanceof at){var E=b(y.value0);if(E instanceof z)return new $(new Tt(l));if(E instanceof $)return new $(new at(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[E.constructor.name])}throw new Error("Failed pattern match at Data.Enum.Generic (line 28, column 18 - line 32, column 31): "+[y.constructor.name])},"genericSucc'":function(y){if(y instanceof Tt){var E=r(y.value0);if(E instanceof z)return new $(new at(N));if(E instanceof $)return new $(new Tt(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[E.constructor.name])}if(y instanceof at)return ri(at.create)(d(y.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 33, column 18 - line 37, column 36): "+[y.constructor.name])}}}}}};var xa={"genericPred'":function(e){return z.value},"genericSucc'":function(e){return z.value}},Ma=function(e){var n=qm(e),r=ed(e);return{"genericPred'":function(i){return ri(Al)(n(i))},"genericSucc'":function(i){return ri(Al)(r(i))}}};var zm=function(e){return e["genericCardinality'"]};var Sa=function(e){var n=zm(e),r=Gm(e),i=Jm(e);return function(l){var v=Gm(l),b=Jm(l);return{"genericCardinality'":Zf(n)+Zf(zm(l))|0,"genericToEnum'":function(d){var h=function(N){if(d>=0&&d1;if(r){var i=Mc(So(1)(e)),l=GD(i);return l?$D(n)(i):n}return n},AM=UD(LM),zD=OD(IM)(AM),Ju=function(e){return Ha(zD(e))};var VD=function(e){return function(n){return BD(function(r){return Ju(Pu(r)(n))})(um(e)(n))}};var PM=function(){function e(b){this.fn=b}var n={},r=function(b,d){this.head=b,this.tail=d};function i(b){return new r(b,n)}function l(b){return function(d){return new r(b,d)}}function v(b){for(var d=[],h=b;h!==n;)d.push(h.head),h=h.tail;return d}return function(b,d,h){var N=function(E,S){return b(d(l)(h(E)))(S)},y=function(E,S,C){if(S===0)return E;var M=C[S-1];return new e(function(){var U=y(N(M,E),S-1,C);return U})};return function(E){for(var S=d(i)(h(E[E.length-1])),C=y(S,E.length-1,E);C instanceof e;)C=C.fn();return d(v)(C)}}}();var KD=Ks;var rd=function(e){return e};var VM=u0(It),KM=Ct(zt),YM=Du(KD),Ur=function(e){return function(n){var r=VM(KM(n)(function(i){return new nt(e(i),i)}));return function(i){return dm(i)(r)}}},QM=function(e){var n=jD(e),r=PD(e);return function(i){var l=n(i);return function(v){return function(b){return YM(function(d){return new nt(d,l(d))})(r(b))}}}},Aa=function(e){var n=QM(e);return function(r){var i=n(r);return function(l){var v=i(l);return function(b){return rd(v(b))}}}};var XM={info:"info",warning:"warn",error:"error"},Ym=e=>n=>r=>i=>{let l=XM[e];if(typeof console!="undefined"&&console[l]&&console[l](n,r),typeof window!="undefined"){let v=new Error(n);typeof window.Sentry!="undefined"&&window.Sentry.captureException(v,{extra:r})}return i()},QD=(e,n)=>(n.__sentryFingerprint=e,n);var XD=function(e){return xo(QD)(e)};var ZD="error";var ad={parseOrPanic:function(e){return function(n){var r=e.parse(n);if(r instanceof we)return r.value0;if(r instanceof Ee)return Ym(ZD)("Failed to parse "+e.diagnosticName)({error:r.value0,value:n})(function(i){return e.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},ar=function(e){return e.parseOrPanic},ZM=ar(ad),Bi=function(e){var n=ar(e);return function(r){var i=X(r);return function(l){return n({parse:function(v){return i($.create)(l.parse(v))},default:z.value,diagnosticName:l.diagnosticName})}}},eS=Bi(ad)(sr),$i=function(e){var n=Ai(e);return function(r){return eS({parse:n,diagnosticName:r})}},Vn={parseOrPanic:function(e){return ZM({default:e.default,diagnosticName:e.diagnosticName,parse:function(){var n=Ft(new Ee(""))(we.create);return function(r){return n(e.parse(r))}}()})}};var ny=Ma(xa),ry=Fa(Ea),ay=La(Ia),zu=function(){function e(){}return e.value=new e,e}(),Sc=function(){function e(){}return e.value=new e,e}(),tS={to:function(e){if(e instanceof Tt)return zu.value;if(e instanceof at)return Sc.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])},from:function(e){if(e instanceof zu)return new Tt(Vt.value);if(e instanceof Sc)return new at(Vt.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])}};var nS=function(e){if(e instanceof zu)return"school";if(e instanceof Sc)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 32, column 1 - line 32, column 29): "+[e.constructor.name])},oy=function(){return ar(Vn)({parse:Ur(nS)(Aa(tS)(Ca(ny)(ba(Ta))(ny)(ry))(Sa(ay)(ay))(wa(ry))),default:zu.value,diagnosticName:"Sem.Connections.Types.Actor"})}();var iy=Ma(xa),uy=Ca(iy)(ba(Ta)),ly=Fa(Ea),cy=wa(ly),sy=La(Ia),fy=Sa(sy),rS=on(Ns),Vu=function(){function e(){}return e.value=new e,e}(),Ic=function(){function e(){}return e.value=new e,e}(),Ku=function(){function e(){}return e.value=new e,e}(),aS={to:function(e){if(e instanceof Tt)return Vu.value;if(e instanceof at&&e.value0 instanceof Tt)return Ic.value;if(e instanceof at&&e.value0 instanceof at)return Ku.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])},from:function(e){if(e instanceof Vu)return new Tt(Vt.value);if(e instanceof Ic)return new at(new Tt(Vt.value));if(e instanceof Ku)return new at(new at(Vt.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])}};var oS=function(e){if(e instanceof Vu)return"pending";if(e instanceof Ic)return"connected";if(e instanceof Ku)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 40, column 1 - line 40, column 30): "+[e.constructor.name])},dy=function(){var e=Ur(oS)(Aa(aS)(uy(uy(iy)(ly))(cy))(fy(fy(sy)))(cy)),n=function(r){return r==="cold"?new $(Ku.value):z.value};return ar(Vn)({parse:function(r){return rS(e(r))(n(r))},default:Vu.value,diagnosticName:"Sem.Connections.Types.Status"})}();var vy=function(e){return{initiator:oy(e.initiator),status:dy(e.status),introMessage:Zt("")(Se(e.introMessage))}};var ud=function(){function e(){}return e.value=new e,e}(),py=function(){function e(){}return e.value=new e,e}();var my=function(){var e=ar(Vn)({parse:function(n){return n instanceof $&&n.value0==="paid"?new $(py.value):n instanceof $&&n.value0==="free"?new $(ud.value):n instanceof $&&n.value0==="churned"?new $(ud.value):n instanceof z?new $(ud.value):z.value},default:ud.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return e(Se(n))}}();var _y=function(e){return{allowedToContact:e.allowedToContact,id:e.id,name:e.name,imageUrl:Se(e.imageUrl),partnerStatus:my(e.partnerStatus)}};var iS=pe(Kt),Xm=Io(),Lc=bn(Ae),hy=K({reflectSymbol:function(){return"id"}}),uS=Nn(On)(Kt),lS=Qs(sp),cS=X(Le);var sS=Ae,fS=$i(Xm(K({reflectSymbol:function(){return"avatarUrl"}})(Lc)(K({reflectSymbol:function(){return"bio"}})(Lc)(K({reflectSymbol:function(){return"connection"}})(bn(Xm(K({reflectSymbol:function(){return"initiator"}})(Ae)(K({reflectSymbol:function(){return"introMessage"}})(Lc)(K({reflectSymbol:function(){return"status"}})(Ae)(At))))))(K({reflectSymbol:function(){return"firstName"}})(Ae)(hy(sS)(K({reflectSymbol:function(){return"lastName"}})(Ae)(K({reflectSymbol:function(){return"school"}})(Xm(K({reflectSymbol:function(){return"allowedToContact"}})(kn)(hy(ND)(K({reflectSymbol:function(){return"imageUrl"}})(Lc)(K({reflectSymbol:function(){return"name"}})(Ae)(K({reflectSymbol:function(){return"partnerStatus"}})(Lc)(At)))))))(K({reflectSymbol:function(){return"title"}})(Ae)(K({reflectSymbol:function(){return"type"}})(Ae)(K({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(Xe)(At))))))))))));var gy=function(e){return iS(fS("SemUser")(e))(function(n){return uS(lS(n.type==="Sem::User"))(function(){return new $({school:_y(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Se(n.avatarUrl),title:n.title,bio:Se(n.bio),connection:cS(vy)(Se(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var Cy=function(){function e(){}return e.value=new e,e}(),xy=function(){function e(){}return e.value=new e,e}(),My=function(){function e(){}return e.value=new e,e}();var xS=function(e){if(e instanceof Cy)return"disabled";if(e instanceof xy)return"free-consultation";if(e instanceof My)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 31, column 13 - line 34, column 40): "+[e.constructor.name])};var MS=function(){return[Cy.value,xy.value,My.value]}(),Sy=Bi(Vn)(Le)({parse:Ur(xS)(MS),diagnosticName:"InquiryMode"});function $y(e){return function(n){return function(){return n.getElementById(e)}}}var y3=X(ot),cd=function(e){var n=y3(Se),r=$y(e);return function(i){return n(r(i))}};var sd=function(e){return function(n){return function(){return n[e]}}},R3=sd("children"),T3=sd("firstElementChild"),b3=sd("lastElementChild"),E3=sd("childElementCount");var Za=function(){return window};function Gy(e,n,r,i){if(typeof window!="undefined"){var l=window[r];if(l!=null&&i instanceof l)return n(i)}for(var v=i;v!=null;){var b=Object.getPrototypeOf(v),d=b.constructor.name;if(d===r)return n(i);if(d==="Object")return e;v=b}return e}var je=function(e){return function(n){return Gy(z.value,$.create,e,n)}};var fd=he;function qy(e,n,r){var i=Object.prototype.toString.call(r);return i.indexOf("[object HTML")===0&&i.indexOf("Element]")===i.length-8?n(r):e}var Jy=function(e){return qy(z.value,$.create,e)};function dd(e){return function(){return e.currentTime}}function o_(e){return function(){return e.volume}}function i_(e){return function(n){return function(){n.volume=e}}}function u_(e){return function(){return e.muted}}function Gi(e){return function(n){return function(){n.muted=e}}}var zy=je("HTMLMediaElement");var Vy=je("HTMLMediaElement");function l_(e){return function(n){return function(){n.href=e}}}function c_(e){return function(){return e.platform}}function Uc(e){return function(){return e.document}}function s_(e){return function(){return e.navigator}}function f_(e){return function(){return e.location}}function vd(e){return function(){return e.localStorage}}var C3=Vs(vn)(zs),Ky=pe(Gr),Yy=Ct(ot),x3=pe(Kt);var Qy=Nt(Ft(xr));var M3=function(e){return function(n){if(e)return n(be);if(rt)return xr;throw new Error("Failed pattern match at Utils.HTML (line 94, column 1 - line 94, column 61): "+[e.constructor.name,n.constructor.name])}},qi=function(e){return function(n){return M3(e)(Qe(n))}};var md=function(e){return C3(Vy(e.target))(dd)};var S3=function(e){return Ky(Yy(Ky(Za)(Uc))(fd))(cd(e))},Xy=function(e){return Yy(S3(e))(function(n){return x3(n)(Jy)})};var Oc=Xe;var Zy=({just:e,nothing:n})=>r=>{try{let i=new Date(r);return isNaN(i.getTime())?n:e(i)}catch{return n}},eR=e=>({year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()});var I3=(()=>{let e=new Date;return typeof window!="undefined"?()=>e:()=>{let n=new Date;return n-e>1e3&&(e=n),e}})();var L3=(()=>{let e=new Date().toString(),n=(e.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(e.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(e.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(e.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var nR={liftAff:He($e),MonadEffect0:function(){return _n}};var nHe=function(){function e(){this.head=null,this.last=null,this.size=0}function n(y,E){this.queue=y,this.value=E,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new e,this.reads=new e,this.puts=new e}var i={};function l(y){try{y()}catch(E){setTimeout(function(){throw E},0)}}function v(y,E){var S=new n(y,E);switch(y.size){case 0:y.head=S;break;case 1:S.prev=y.head,y.head.next=S,y.last=S;break;default:S.prev=y.last,y.last.next=S,y.last=S}return y.size++,S}function b(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.last,y.head.next=null,y.last=null;break;default:E=y.last,y.last=E.prev,y.last.next=null}return E.prev=null,E.queue=null,y.size--,E.value}function d(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:E=y.head,y.head=E.next,y.head.prev=null}return E.next=null,E.queue=null,y.size--,E.value}function h(y){if(y.queue!==null){if(y.queue.last===y){b(y.queue);return}if(y.queue.head===y){d(y.queue);return}y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),y.queue.size--,y.queue=null,y.value=null,y.next=null,y.prev=null}}function N(y,E){if(!E.draining){var S=E.puts,C=E.takes,M=E.reads,U,H,Y,J,Z;for(E.draining=!0;;){if(U=null,H=null,Y=null,J=E.value,Z=M.size,E.error!==null){for(J=y.left(E.error);U=d(S);)l(U.cb(J));for(;H=d(M);)l(H(J));for(;Y=d(C);)l(Y(J));break}if(J===i&&(U=d(S))&&(E.value=J=U.value),J!==i){for(Y=d(C);Z--&&(H=d(M));)l(H(y.right(J)));Y!==null&&(E.value=i,l(Y(y.right(J))))}if(U!==null&&l(U.cb(y.right(void 0))),E.value===i&&S.size===0||E.value!==i&&C.size===0)break}E.draining=!1}}return r.EMPTY=i,r.putLast=v,r.takeLast=b,r.takeHead=d,r.deleteCell=h,r.drainVar=N,r}();var ai=pe(Kt),$3=dt(Vr),G3=dt(Xn),q3=dt(_a),J3=dt(ya),z3=dt(ga),V3=dt(ha),K3=dt(Da),Y3=ce(cr);var Q3=Ct(Le);var X3=function(e){return ai($3(e.year))(function(n){return ai(G3(e.month+1|0))(function(r){return ai(q3(e.day))(function(i){return ai(J3(e.hour))(function(l){return ai(z3(e.minute))(function(v){return ai(V3(e.second))(function(b){return ai(K3(e.millisecond))(function(d){return Y3(new zo(xi(n)(r)(i),new fo(l,v,b,d)))})})})})})})})};var Xu=function(e){return ai(Q3(Zy({just:$.create,nothing:z.value})(e))(eR))(X3)};var d_=ce(cr),Z3=X(Le),rR=pe(Kt);var aR=Ma(xa),oR=Ca(aR)(ba(Ta)),iR=Fa(Ea),uR=wa(iR),lR=La(Ia),cR=Sa(lR);var v_=function(){function e(){}return e.value=new e,e}(),p_=function(){function e(){}return e.value=new e,e}(),m_=function(){function e(){}return e.value=new e,e}();var e4={to:function(e){if(e instanceof Tt)return v_.value;if(e instanceof at&&e.value0 instanceof Tt)return p_.value;if(e instanceof at&&e.value0 instanceof at)return m_.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 183, column 1 - line 183, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof v_)return new Tt(Vt.value);if(e instanceof p_)return new at(new Tt(Vt.value));if(e instanceof m_)return new at(new at(Vt.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 183, column 1 - line 183, column 41): "+[e.constructor.name])}};var t4=function(e){if(e instanceof v_)return"stuffed";if(e instanceof p_)return"satisfied";if(e instanceof m_)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 242, column 27 - line 245, column 35): "+[e.constructor.name])};var n4=Bi(Vn)(Le)({parse:Ur(t4)(Aa(e4)(oR(oR(aR)(iR))(uR))(cR(cR(lR)))(uR)),diagnosticName:"ClientAppetite"}),sR=function(e){return rR(Ft(d_(z.value))(function(){var n=Z3(d_);return function(r){return n(n4(r))}}())(Se(e.clientAppetite)))(function(n){return rR(Sy(e.inquiryMode))(function(r){return d_({packages:e.packages,pricePerHourCents:e.pricePerHourCents,singleSessionDurationMinutes:e.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:e.singleSessionRefundPeriodLengthDays,themes:e.themes,freeConsultationDurationMinutes:Se(e.freeConsultationDurationMinutes),canSubmitConsultInquiry:Se(e.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var fR=pe(Kt),Zu=Io(),__=bn(Ae),dR=K({reflectSymbol:function(){return"description"}})(Ae),_d=K({reflectSymbol:function(){return"id"}})(Xe),h_=K({reflectSymbol:function(){return"name"}})(Ae),vR=Zu(_d(h_(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))),pR=wr(vR),r4=$i(Zu(K({reflectSymbol:function(){return"advisingConfig"}})(bn(Zu(K({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(bn(kn))(K({reflectSymbol:function(){return"clientAppetite"}})(__)(K({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(bn(Xe))(K({reflectSymbol:function(){return"inquiryMode"}})(Ae)(K({reflectSymbol:function(){return"packages"}})(wr(Zu(K({reflectSymbol:function(){return"activeForSale"}})(kn)(dR(_d(h_(K({reflectSymbol:function(){return"numMinutes"}})(Xe)(K({reflectSymbol:function(){return"packageCategories"}})(pR)(K({reflectSymbol:function(){return"refundPeriodLengthDays"}})(Xe)(K({reflectSymbol:function(){return"totalPriceCents"}})(Oc)(At)))))))))))(K({reflectSymbol:function(){return"pricePerHourCents"}})(Oc)(K({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(Xe)(K({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(Xe)(K({reflectSymbol:function(){return"themes"}})(wr(Zu(K({reflectSymbol:function(){return"active"}})(kn)(K({reflectSymbol:function(){return"category"}})(vR)(dR(K({reflectSymbol:function(){return"durationMinutes"}})(Xe)(_d(K({reflectSymbol:function(){return"priceCents"}})(Oc)(K({reflectSymbol:function(){return"title"}})(Ae)(At))))))))))(At))))))))))))(K({reflectSymbol:function(){return"entity"}})(Zu(K({reflectSymbol:function(){return"bio"}})(Ae)(_d(K({reflectSymbol:function(){return"imageUrl"}})(__)(h_(K({reflectSymbol:function(){return"organizationId"}})(Xe)(K({reflectSymbol:function(){return"organizationName"}})(Ae)(K({reflectSymbol:function(){return"shortEducation"}})(__)(K({reflectSymbol:function(){return"tags"}})(pR)(At))))))))))(At)))),g_=ce(cr),D_=X(Le),a4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),o4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),i4=function(e){return fR(r4("ServiceProviderPresenter")(e))(function(n){return fR(Ft(g_(z.value))(function(){var r=D_(g_);return function(i){return r(sR(i))}}())(Se(n.advisingConfig)))(function(r){return g_({entity:n.entity,advisingConfig:r})})})},mR=Bi(Vn)(Le)({parse:function(e){return e.type==="Sem::User"?D_(a4.create)(gy(e.presenter)):e.type==="ServiceProviders::Individual"?D_(o4.create)(i4(e.presenter)):z.value},diagnosticName:"Livestream Guest Presenter"});var _R=Ma(xa),hR=Ca(_R)(ba(Ta)),gR=Fa(Ea),DR=wa(gR),yR=La(Ia),RR=Sa(yR),Wc=function(){function e(){}return e.value=new e,e}(),hd=function(){function e(){}return e.value=new e,e}(),gd=function(){function e(){}return e.value=new e,e}(),y_=function(e){if(e instanceof Wc)return"ready";if(e instanceof hd)return"live";if(e instanceof gd)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 64, column 23 - line 67, column 21): "+[e.constructor.name])};var R_=function(e){return{id:e.id,question:e.question,multiSelect:e.multiSelect,options:e.options,autoDisplayMinutesFromStart:Se(e.autoDisplayMinutesFromStart)}};var u4={to:function(e){if(e instanceof Tt)return Wc.value;if(e instanceof at&&e.value0 instanceof Tt)return hd.value;if(e instanceof at&&e.value0 instanceof at)return gd.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 52): "+[e.constructor.name])},from:function(e){if(e instanceof Wc)return new Tt(Vt.value);if(e instanceof hd)return new at(new Tt(Vt.value));if(e instanceof gd)return new at(new at(Vt.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 52): "+[e.constructor.name])}},Dd=function(){return ar(Vn)({parse:Ur(y_)(Aa(u4)(hR(hR(_R)(gR))(DR))(RR(RR(yR)))(DR)),default:Wc.value,diagnosticName:"livestream poll status"})}();var TR=function(e){return{fullName:e.fullName,firstName:e.firstName,totalStreams:e.totalStreams,undergrad:{college:Se(e.undergrad.college),major:Se(e.undergrad.major),year:Se(e.undergrad.year)},gradCollege:Se(e.gradCollege),workExperience:Se(e.workExperience),admissionsStory:Se(e.admissionsStory),pictureUrl:Se(e.pictureUrl),allStreamsUrl:Se(e.allStreamsUrl)}};var l4=Ct(Le),bR=ar(Vn),ER=Ma(xa),FR=Ca(ER)(ba(Ta)),wR=Fa(Ea),CR=wa(wR),xR=La(Ia),MR=Sa(xR),SR=Bs(),IR=Un(Kt),c4=Ct(zt),s4=X(Le),f4=pe(Kt);var Ji=function(){function e(){}return e.value=new e,e}(),el=function(){function e(){}return e.value=new e,e}(),tl=function(){function e(){}return e.value=new e,e}();var LR=un;var d4=bR({parse:Xu,default:rn(mf),diagnosticName:"livestream scheduled start time"}),v4={to:function(e){if(e instanceof Tt)return Ji.value;if(e instanceof at&&e.value0 instanceof Tt)return el.value;if(e instanceof at&&e.value0 instanceof at)return tl.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 56): "+[e.constructor.name])},from:function(e){if(e instanceof Ji)return new Tt(Vt.value);if(e instanceof el)return new at(new Tt(Vt.value));if(e instanceof tl)return new at(new at(Vt.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 56): "+[e.constructor.name])}},AR=function(){var e=function(n){if(n instanceof Ji)return"waiting_room";if(n instanceof el)return"on_air";if(n instanceof tl)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 188, column 17 - line 191, column 35): "+[n.constructor.name])};return Ur(e)(Aa(v4)(FR(FR(ER)(wR))(CR))(MR(MR(xR)))(CR))}(),PR=function(){return bR({parse:AR,default:Ji.value,diagnosticName:"livestream status"})}(),yd=function(e){return{uid:e.uid,title:e.title,description:e.description,url:e.url,imageUrl:e.imageUrl,duration:e.duration,tailTime:e.tailTime,stats:e.stats,isPrivate:e.isPrivate,legacyRecording:e.legacyRecording,collegeFair:e.collegeFair,id:e.id,school:l4(Se(e.school))(function(n){return{cityState:n.cityState,name:n.name,id:SR(n.id),slug:SR(n.slug)}}),scheduledStartTime:d4(e.scheduledStartTime),onAirTime:IR(Xu)(Se(e.onAirTime)),streamStatus:PR(e.streamStatus),watchUrl:Se(e.watchUrl),streamingStartTime:IR(Xu)(Se(e.streamingStartTime)),polls:c4(e.polls)(function(n){return{poll:R_(n.poll),status:Dd(n.status)}}),presenter:s4(TR)(Se(e.presenter)),partnerType:Se(e.partnerType),guestPresenter:f4(Se(e.guestPresenter))(mR),zoomJoinUrl:Se(e.zoomJoinUrl),zoomStartUrl:Se(e.zoomStartUrl)}};var p4=typeof CV!="undefined"&&CV.pathInfo||typeof global!="undefined"&&global.CV&&global.CV.pathInfo||(e=>null);function jR(e,n){let r=typeof CV!="undefined"&&CV.apiEndpoint||typeof global!="undefined"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(e,n)}function NR(e,n,r,i,l){return function(v,b){var d=e.newXHR(),h=e.fixupUrl(l.url,d);if(d.open(l.method||"GET",h,!0,l.username,l.password),l.headers)try{for(var N=0,y;(y=l.headers[N])!=null;N++)d.setRequestHeader(y.field,y.value)}catch(S){v(S)}var E=function(S){return function(){v(new Error(S))}};return d.onerror=E(r),d.ontimeout=E(n),d.onload=function(){b({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(S){return S.length>0}).map(function(S){var C=S.indexOf(":");return i(S.substring(0,C))(S.substring(C+2))}),body:d.response})},d.responseType=l.responseType,d.withCredentials=l.withCredentials,d.timeout=l.timeout,d.send(l.content),function(S,C,M){try{d.abort()}catch(U){return C(U)}return M()}}}var Rd="application/json",UR="application/x-www-form-urlencoded";var OR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),WR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),kR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),HR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),BR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),T_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Td=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$R=function(e){return e instanceof T_?new $(UR):e instanceof Td?new $(Rd):z.value};var GR=function(){return Td.create}();var qR=pn();var bd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Ed=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),nl=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),JR=function(e){if(e instanceof bd||e instanceof Ed)return qR(e.value0);if(e instanceof nl)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])};var b_=function(e){if(e instanceof bd)return"Accept";if(e instanceof Ed)return"Content-Type";if(e instanceof nl)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])};var zR=He($e),E_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),F_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),w_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Fd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),wd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Cd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),VR=function(e){if(e instanceof E_)return"arraybuffer";if(e instanceof F_)return"blob";if(e instanceof w_)return"document";if(e instanceof Fd||e instanceof wd)return"text";if(e instanceof Cd)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},KR=function(e){return e instanceof Fd?new $(Rd):z.value},YR=function(){return new wd(zR)}();var QR=function(){return new Cd(zR)}();var XR=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var _4=pn();var xd=function(e){return _4(gf(e))};function eo(e){return e}function C_(e){return JSON.stringify(e)}var ZR=eo(Lf);function eT(e,n,r){try{return n(JSON.parse(r))}catch(i){return e(i.message)}}var Md=function(e){return eT(Ee.create,we.create,e)};function h4(e){return e.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function tT(e,n,r){try{return n(h4(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(i){return e(i)}}var Sd=function(){return Gs(tT)(Qe(z.value))($.create)}();var g4=mt(aa),nT=X(Le),D4=Jr(Fi)(cr);var y4=function(e){return e};var rT=function(){var e=function(i){if(i.value1 instanceof z)return Sd(i.value0);if(i.value1 instanceof $)return g4(nT(function(l){return function(v){return l+("="+v)}})(Sd(i.value0)))(Sd(i.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[i.constructor.name])},n=nT(Hi("&")),r=D4(e);return function(i){return n(r(y4(i)))}}();var x_=function(){function e(){}return e.value=new e,e}(),zi=function(){function e(){}return e.value=new e,e}(),M_=function(){function e(){}return e.value=new e,e}(),rl=function(){function e(){}return e.value=new e,e}(),Id=function(){function e(){}return e.value=new e,e}(),kc=function(){function e(){}return e.value=new e,e}(),S_=function(){function e(){}return e.value=new e,e}(),I_=function(){function e(){}return e.value=new e,e}(),L_=function(){function e(){}return e.value=new e,e}(),A_=function(){function e(){}return e.value=new e,e}(),P_=function(){function e(){}return e.value=new e,e}(),j_=function(){function e(){}return e.value=new e,e}(),N_=function(){function e(){}return e.value=new e,e}(),U_=function(){function e(){}return e.value=new e,e}(),O_=function(){function e(){}return e.value=new e,e}(),Ld=function(){function e(){}return e.value=new e,e}();var R4=function(e){return e},T4={show:function(e){if(e instanceof x_)return"OPTIONS";if(e instanceof zi)return"GET";if(e instanceof M_)return"HEAD";if(e instanceof rl)return"POST";if(e instanceof Id)return"PUT";if(e instanceof kc)return"DELETE";if(e instanceof S_)return"TRACE";if(e instanceof I_)return"CONNECT";if(e instanceof L_)return"PROPFIND";if(e instanceof A_)return"PROPPATCH";if(e instanceof P_)return"MKCOL";if(e instanceof j_)return"COPY";if(e instanceof N_)return"MOVE";if(e instanceof U_)return"LOCK";if(e instanceof O_)return"UNLOCK";if(e instanceof Ld)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}};var aT=Rn(Re(T4))(R4);var oT={eq:function(e){return function(n){return e instanceof x_&&n instanceof x_||e instanceof zi&&n instanceof zi||e instanceof M_&&n instanceof M_||e instanceof rl&&n instanceof rl||e instanceof Id&&n instanceof Id||e instanceof kc&&n instanceof kc||e instanceof S_&&n instanceof S_||e instanceof I_&&n instanceof I_||e instanceof L_&&n instanceof L_||e instanceof A_&&n instanceof A_||e instanceof P_&&n instanceof P_||e instanceof j_&&n instanceof j_||e instanceof N_&&n instanceof N_||e instanceof U_&&n instanceof U_||e instanceof O_&&n instanceof O_||e instanceof Ld&&n instanceof Ld}}};var iT=function(e){return Vo(function(n){return function(){var i=e(function(l){return n(Ee.create(l))()},function(l){return n(we.create(l))()});return function(l){return Vo(function(v){return function(){return i(l,function(d){return v(Ee.create(d))()},function(d){return v(we.create(d))()}),Qp}})}}})};var W_=ce(Si(Jn)),b4=vc(Jn),Vi=Nu(Jn),uT=on(Rf(Sf)(Jn)),E4=xl(Vp(Jn)),Ad=X(Le),F4=oa(It)(Tr),w4=Ue($r),C4=Un(Kt),x4=X(zt),M4=Ct(za),S4=tc(ac),I4=ce(Nr);var Pd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jd=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),Nd=function(){function e(){}return e.value=new e,e}(),Ud=function(){function e(){}return e.value=new e,e}(),Od=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),lT=function(e){return function(n){var r=function(y){return y===""?W_(ZR):Rn(function(E){return b4(fc.create(E))})(W_)(Md(y))},i=function(){if(n.responseFormat instanceof E_)return Vi("ArrayBuffer");if(n.responseFormat instanceof F_)return Vi("Blob");if(n.responseFormat instanceof w_)return function(y){return uT(Vi("Document")(y))(uT(Vi("XMLDocument")(y))(Vi("HTMLDocument")(y)))};if(n.responseFormat instanceof Fd)return E4(function(y){return n.responseFormat.value0(r(y))})(Vi("String"));if(n.responseFormat instanceof wd)return Vi("String");if(n.responseFormat instanceof Cd)return Qe(n.responseFormat.value0(W_(be)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])}(),l=function(y){if(y instanceof OR)return new we(y.value0(Va));if(y instanceof WR)return new we(Va(y.value0));if(y instanceof kR)return new we(Va(y.value0));if(y instanceof HR)return new we(Va(y.value0));if(y instanceof BR)return new we(Va(y.value0));if(y instanceof T_)return Us("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(Ad(Va)(rT(y.value0)));if(y instanceof Td)return new we(Va(C_(y.value0)));throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): "+[y.constructor.name])},v=function(y){return function(E){return y instanceof $&&!F4(np(w4)(b_)(y.value0))(E)?Ys(E)(y.value0):E}},b=function(y){return v(Ad(Ed.create)(C4($R)(y)))(v(Ad(bd.create)(KR(n.responseFormat)))(n.headers))},d=function(y){return{method:aT(n.method),url:n.url,headers:x4(function(E){return{field:b_(E),value:JR(E)}})(b(n.content)),content:y,responseType:VR(n.responseFormat),username:Po(n.username),password:Po(n.password),withCredentials:n.withCredentials,timeout:Zt(0)(Ad(function(E){return E})(n.timeout))}},h=function(y){return M4(S4(iT(NR(e,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",XR.create,d(y)))))(function(E){if(E instanceof we){var S=xd(i(E.value0.body));if(S instanceof Ee)return new Ee(new jd(Q1(S.value0),E.value0));if(S instanceof we)return new we({headers:E.value0.headers,status:E.value0.status,statusText:E.value0.statusText,body:S.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[S.constructor.name])}if(E instanceof Ee)return new Ee(function(){var C=xu(E.value0),M=C==="AffjaxTimeoutErrorMessageIdent";if(M)return Nd.value;var U=C==="AffjaxRequestFailedMessageIdent";return U?Ud.value:new Od(E.value0)}());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[E.constructor.name])})};if(n.content instanceof z)return h(Po(z.value));if(n.content instanceof $){var N=l(n.content.value0);if(N instanceof we)return h(Po(new $(N.value0)));if(N instanceof Ee)return I4(new Ee(new Pd(N.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[N.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var al=function(){return{method:new Ee(zi.value),url:"/",headers:[],content:z.value,username:z.value,password:z.value,withCredentials:!1,responseFormat:QR,timeout:z.value}}();var cT={eq:function(e){return function(n){return e===n}}};var k_={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(e){return e||"/"}};var sT=lT(k_);function fT(e){return Buffer.from(e).toString("base64")}function dT(e,n,r){let i;try{i=n(btoa(r))}catch(l){i=e(l)}return i}var H_=typeof btoa=="function";function vT(e){let n=32768,r=[];for(let i=0;i{let e=null,n=0,r=()=>{if(!_o||!_o.key)return _o||console.error("Pusher config is missing in global context"),new t8;let i={auth:{headers:{"X-CSRF-Token":_o.authToken}},authEndpoint:_o.authPath,cluster:_o.cluster};return _o.dev&&Object.assign(i,{wsHost:_o.dev.wsHost,wsPort:_o.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new AT.default(_o.key,i)};return{acquireConnection:()=>(e||(e=r(),n=0),n++,e),releaseConnection:()=>{--n<=0&&(e.disconnect(),e=null)}}})(),PT=e=>{let n=Z4().subscribe(e.channel);return n.bind(e.event,e.handler),()=>{n.unbind(e.event,e.handler),e8()}};function t8(){typeof document!="undefined"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(e){let n=this.channels.find(i=>i.name===e);if(n)return n;let r=new n8(e);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(e=>e.name)}}function n8(e){this.name=e,this.handlers={},this.triggered=[],this.disconnect=()=>{},this.bind=function(n,r){this.handlers[n]=r},this.unbind=function(n,r){this.handlers[n]===r&&(this.handlers[n]=null)},this.trigger=function(n,r){this.triggered.push({eventName:n,eventData:r})}}var r8=Gl(co),a8=Ri(vn)(Ti);var o8={show:function(e){return e}},i8=Re(o8),$_=Ae,u8=function(e){var n=$i(e);return function(r){return function(i){return function(l){var v=r8(["Pusher event ",i," over channel ",i8(r)]),b=function(d){return a8(n(v)(d))(l)()};return function(){return PT({channel:r,event:i,handler:b})}}}}},jT=function(e){var n=u8(e);return function(r){var i=r.Monad0(),l=pe(i.Bind1()),v=Lt(r),b=ce(i.Applicative0());return function(d){return function(h){return function(N){return l(v(n(d)(h)(N)))(function(y){return b(v(y))})}}}}};var l8=MT(FT),c8=IT(l8),s8=pe(Zn);var f8=Ct(Le),to=Io();var d8=K({reflectSymbol:function(){return"status"}})(Ae)(At);var NT=K({reflectSymbol:function(){return"id"}}),UT=NT(Xe);var v8=Ct(za),p8=K({reflectSymbol:function(){return"description"}}),OT=K({reflectSymbol:function(){return"presenter"}}),Or=bn(Ae),m8=K({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(bn(Xe)),_8=to(m8(UT(K({reflectSymbol:function(){return"multiSelect"}})(kn)(K({reflectSymbol:function(){return"options"}})(wr(Ae))(K({reflectSymbol:function(){return"question"}})(Ae)(At)))))),h8=K({reflectSymbol:function(){return"name"}})(Ae),g8=K({reflectSymbol:function(){return"title"}})(Ae),D8=K({reflectSymbol:function(){return"url"}})(Ae),y8=wT(bn(to(K({reflectSymbol:function(){return"pusher"}})(to(K({reflectSymbol:function(){return"dataChannel"}})($_)(K({reflectSymbol:function(){return"presenceChannel"}})($_)(At))))(K({reflectSymbol:function(){return"stream"}})(to(K({reflectSymbol:function(){return"collegeFair"}})(kn)(p8(Ae)(K({reflectSymbol:function(){return"duration"}})(Xe)(K({reflectSymbol:function(){return"guestPresenter"}})(bn(to(OT(mc)(K({reflectSymbol:function(){return"type"}})(Ae)(At)))))(UT(K({reflectSymbol:function(){return"imageUrl"}})(Ae)(K({reflectSymbol:function(){return"isPrivate"}})(kn)(K({reflectSymbol:function(){return"legacyRecording"}})(kn)(K({reflectSymbol:function(){return"onAirTime"}})(Or)(K({reflectSymbol:function(){return"partnerType"}})(Or)(K({reflectSymbol:function(){return"polls"}})(wr(to(K({reflectSymbol:function(){return"poll"}})(_8)(d8))))(OT(bn(to(K({reflectSymbol:function(){return"admissionsStory"}})(Or)(K({reflectSymbol:function(){return"allStreamsUrl"}})(Or)(K({reflectSymbol:function(){return"firstName"}})(Ae)(K({reflectSymbol:function(){return"fullName"}})(Ae)(K({reflectSymbol:function(){return"gradCollege"}})(Or)(K({reflectSymbol:function(){return"pictureUrl"}})(Or)(K({reflectSymbol:function(){return"totalStreams"}})(Xe)(K({reflectSymbol:function(){return"undergrad"}})(to(K({reflectSymbol:function(){return"college"}})(Or)(K({reflectSymbol:function(){return"major"}})(Or)(K({reflectSymbol:function(){return"year"}})(Or)(At)))))(K({reflectSymbol:function(){return"workExperience"}})(Or)(At))))))))))))(K({reflectSymbol:function(){return"scheduledStartTime"}})(Ae)(K({reflectSymbol:function(){return"school"}})(bn(to(K({reflectSymbol:function(){return"cityState"}})(Ae)(NT(Ae)(h8(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))))))(K({reflectSymbol:function(){return"stats"}})(to(K({reflectSymbol:function(){return"parentAttendances"}})(Xe)(K({reflectSymbol:function(){return"parentRecordingWatchers"}})(Xe)(K({reflectSymbol:function(){return"parentRegistrations"}})(Xe)(K({reflectSymbol:function(){return"registrationsBySource"}})(wr(to(K({reflectSymbol:function(){return"parentCount"}})(Xe)(K({reflectSymbol:function(){return"source"}})(Ae)(K({reflectSymbol:function(){return"studentCount"}})(Xe)(At))))))(K({reflectSymbol:function(){return"studentAttendances"}})(Xe)(K({reflectSymbol:function(){return"studentRecordingWatchers"}})(Xe)(K({reflectSymbol:function(){return"studentRegistrations"}})(Xe)(K({reflectSymbol:function(){return"totalAttendances"}})(Xe)(K({reflectSymbol:function(){return"totalRecordingWatchers"}})(Xe)(K({reflectSymbol:function(){return"totalRegistrations"}})(Xe)(At))))))))))))(K({reflectSymbol:function(){return"streamStatus"}})(Ae)(K({reflectSymbol:function(){return"streamingStartTime"}})(Or)(K({reflectSymbol:function(){return"tailTime"}})(Xe)(g8(K({reflectSymbol:function(){return"uid"}})(Ae)(D8(K({reflectSymbol:function(){return"watchUrl"}})(Or)(K({reflectSymbol:function(){return"zoomJoinUrl"}})(Or)(K({reflectSymbol:function(){return"zoomStartUrl"}})(Or)(At))))))))))))))))))))))))))(At)))));var WT=c8("livestreams_live_promo_stream_path")(function(e){return function(n){return s8(e({}))(CT(function(r){return v8(y8("Livestream Mini-Promo")(r))(function(i){return f8(Se(i))(function(l){return{pusher:l.pusher,stream:yd(l.stream)}})})}))}});var Hd=e=>e.play();var oi=wl(kT());Yo();var HT=e=>{let[n,r]=er.useState(),[i,l]=er.useState(),v=er.useRef();return v.current=e,Zp(()=>{if(!i)return oi.default.isSupported()?r(R8(e.videoStreamUrl,e.videoElementId,v)):e.onNotSupported(),l(!0),()=>{n&&n.destroy()}}),null},R8=(e,n,r)=>{let i=document.getElementById(n);return i?(hls=new oi.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(oi.default.Events.ERROR,function(l,v){if(r.current.onError&&r.current.onError("HLS error: "+v.type,v),v.fatal)switch(v.type){case oi.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();break;default:hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(v.type);break}}),hls.on(oi.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(e)),hls.on(oi.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(oi.default.Events.INIT_PTS_FOUND,(l,v)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:v.initPTS})),hls.attachMedia(i),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var T8=Ec();var BT=function(){return function(){return T8(HT)}};Yo();var no={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var Gc=wl(KT()),YT=4,Z8=({trackColor:e,background:n})=>({props:r,children:i})=>er.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${YT}px`,borderRadius:`${YT*2}px`,background:n||e})}),...i),eI=({horizontal:e})=>({props:n,isDragged:r})=>er.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),er.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?no.SECONDARY:no.WHITE,stroke:no.SECONDARY}),er.createElement("path",{stroke:r?no.WHITE:no.SECONDARY,d:e?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),er.createElement("path",{stroke:r?no.WHITE:no.SECONDARY,d:e?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),QT=e=>er.createElement(Gc.Range,{step:e.step,min:e.min,max:e.max,values:[e.value],onChange:([n])=>e.onChange(n),onFinalChange:([n])=>e.onFinalChange&&e.onFinalChange(n),renderTrack:Z8({trackColor:e.trackColor||no.GRAY_300,background:e.fillBefore?(0,Gc.getTrackBackground)({values:[e.value],colors:[no.PRIMARY,no.GRAY_300],min:e.min,max:e.max}):void 0}),renderThumb:eI({horizontal:!0})});var tI=Ec(),XT={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return vm}};var ZT=function(e){return function(){return function(){return tI(QT)}}};var En=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),gn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var nI=ni(jo)()(),rI=ZT(XT)()(),aI=ti(Vf),oI=Xf(jo)()(),iI=ti(qu),eb=Uo(Xa),uI=Hm(Qa),qd=Gu(_n),z_=ce(Nr),tb=Nn(On),lI=rn(mf),ho=ce(No),cI=$u(_n),V_=Lt(_n),sI=X(Le),fI=r1(of),dI=tb(Zn),ii=tb(Wi),vI=ao(No),pI=pe(Zn),mI=Ps(ec),_I=ao(vn),K_=function(){function e(){}return e.value=new e,e}(),Y_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Q_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),nb=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),X_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),rb=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ab=function(){function e(){}return e.value=new e,e}(),hI=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ob=function(e){return function(n){if(e.videoState instanceof z)return xr;if(e.videoState instanceof $){var r=nI("")({style:ki({minWidth:"6rem",width:"6rem"})})(rI({value:function(){return e.videoState.value0.muted?0:e.videoState.value0.volume}(),min:0,max:1,step:.05,onChange:aI(n)(function(b){return En.create(Y_.create(b))})})),i=function(){if(e.videoState.value0.muted)return"fe-volume-x";if(rt)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 128, column 5 - line 130, column 34): "+[])}(),l=oI("btn large px-3 py-1 mr-3 text-white fe "+i)({onClick:iI(n)(new En(K_.value))})(xr),v=eb("d-flex align-items-center text-white px-3")([wc("LIVE"),uI("text-danger x-large ml-2 mt-n1")("\u25CF")]);return eb("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+function(){return e.visible?"":"hidden"}())([qi(e.config.liveIndicator)(v),qi(e.config.mute)(l),qi(e.config.volume)(r)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 105, column 1 - line 105, column 50): "+[e.constructor.name,n.constructor.name])}},ib=function(e){return En.create(Q_.create(e))},ub=function(e){return qd(z_(new gn(new hI(function(n){return function(){return e(n)(),new En(new Q_(n))}}))))},Jd=function(){return new En(new X_(!0))}(),lb=function(e){return{config:e,videoState:z.value,visible:!1,visibilityExpiration:lI}},cb=2e3,sb=function(e){return function(n){if(n instanceof gn)return ho(e);if(n instanceof En){var r=cI(V_(function(){var b=oc();return sI(function(d){return En.create(rb.create(d))})(fI(cb)(b))})),i=dI(Mo(cb))(function(){return z_(new En(ab.value))}),l=function(v){if(n.value0 instanceof K_)return ho(e);var b=function(d){if(n.value0 instanceof Y_)return ho(e);if(n.value0 instanceof Q_)return ii(qd(V_(function(){var N=u_(n.value0.value0)(),y=o_(n.value0.value0)();return new En(new nb({muted:N,volume:y}))})))(function(){return ho(e)});if(n.value0 instanceof nb)return ho({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $(n.value0.value0)});if(n.value0 instanceof X_)return ii(vI(n.value0.value0)(r))(function(){return ii(qd(i))(function(){return ho({config:e.config,videoState:e.videoState,visibilityExpiration:e.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof rb)return ho({config:e.config,videoState:e.videoState,visible:e.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof ab)return ii(qd(pI(V_(oc))(function(h){var N=mI(h)(e.visibilityExpiration);return N?z_(new En(new X_(!1))):i})))(function(){return ho(e)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 143, column 1 - line 143, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof Y_&&e.videoState instanceof $?ii(r)(function(){return ii(ub(function(d){return function(){return _I(n.value0.value0>0)(Gi(!1)(d))(),i_(n.value0.value0)(d)()}}))(function(){return ho({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $({muted:e.videoState.value0.muted,volume:n.value0.value0})})})}):b(!0)};return n.value0 instanceof K_&&e.videoState instanceof $?ii(r)(function(){return ii(ub(Gi(!e.videoState.value0.muted)))(function(){return ho({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new $({volume:e.videoState.value0.volume,muted:!e.videoState.value0.muted})})})}):l(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 143, column 1 - line 143, column 55): "+[e.constructor.name,n.constructor.name])}},fb=function(e){if(e instanceof $)return!1;if(e instanceof z)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 212, column 1 - line 212, column 37): "+[e.constructor.name])};var db=e=>n=>r=>()=>e.then(r,n),vb=e=>e instanceof Error,pb=e=>e===null?"null":typeof e=="undefined"?"undefined":e.toString();var gI=ce(Si(Jn)),DI=vc(Jn),yI=He($e),mb=on(Rf(Sf)(Jn)),RI=Nu(Jn),TI=X(yf(Ho)),bI=r0(Jn),EI=Ss(ot),FI=Ut(S1);var wI=function(e){var n=function(r){if(vb(r))return gI(r);if(rt)return DI(new fc(""));throw new Error("Failed pattern match at Utils.Promise (line 53, column 5 - line 55, column 43): "+[r.constructor.name])};return Rn(function(r){return jr("Promise failed: "+pb(e))})(yI)(xd(mb(n(e))(mb(RI("Error")(e))(TI(jr)(bI(e))))))},zd=function(e){return Vo(function(n){return EI(FI)(db(e)(function(r){return n(Ee.create(wI(r)))()})(function(r){return n(we.create(r))()}))})};function _b(e,n){typeof CV!="undefined"&&CV.tracking&&CV.tracking.event(e,n)}var CI=Af();var xI=function(e){var n=Lt(e);return function(r){return function(i){return n(function(){return _b(r,i)})}}},hb=function(e){var n=xI(e);return function(){return function(r){return function(i){return n(r)(CI(i))}}}};var MI=pe(Kt),SI=Uo(jo),Z_=Kf(bD),qc=pe(Gr),eh=Go(vn)(Ti),Vd=ti(qu),gb=xD(Qa)()(),II=BT()();var Jc=ti(Vf),Db=ni(jo)()(),LI=Xf(Xa)()(),AI=MD(Qa),PI=Uo(Xa),yb=Nn(On),jI=hb(_n)(),NI=oa(It)(Tr),UI=Ue(io(ur)),il=yb(Zn),OI=fi(Nr),WI=Pn(Au),Bn=ce(Nr),Rb=Lt(_n),Tb=Fr(ac),bb=rp(Zn),jn=ce(No),$n=yb(Wi),Mr=Gu(_n),Eb=X(za),Fb=$u(_n),kI=X(ot),HI=qr(Jf(za)),BI=X(Le);var wb=function(){function e(){}return e.value=new e,e}(),Cb=function(){function e(){}return e.value=new e,e}(),zc=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),xb=function(){function e(){}return e.value=new e,e}(),ul=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Mb=function(){function e(){}return e.value=new e,e}(),Sb=function(){function e(){}return e.value=new e,e}(),Ib=function(){function e(){}return e.value=new e,e}(),th=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),nh=function(){function e(){}return e.value=new e,e}(),Kd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Yd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Qd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Lb=function(){function e(){}return e.value=new e,e}(),rh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ah=function(){function e(){}return e.value=new e,e}(),Ab=function(){function e(){}return e.value=new e,e}(),Pb=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Qi=function(){function e(){}return e.value=new e,e}(),go=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jb=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$I=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ll=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Nb=function(e){var n=e.Monad0(),r=pe(n.Bind1()),i=Lt(e),l=ce(n.Applicative0());return function(v){return function(b){return function(d){return r(i(Xy(v.videoId)))(function(h){return Ft(l(b.whenNotFound))(d)(MI(h)(zy))})}}}};var oh=Nb(_n),Ub=function(e){var n=Nb(e);return function(r){return n(r)({whenNotFound:be})}},GI=Ub(Mu),qI=Ub(_n),Ob=function(e){return function(n){return function(r){var i=function(){var M=SI("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof xb)return M(e.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof Mb)return M(e.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof zc)return M(e.introScreen);if(n.stage instanceof ul)return xr;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 253, column 20 - line 264, column 16): "+[n.stage.constructor.name])}(),l=function(){return n.stage instanceof zc?n.stage.value0.reset:!1}(),v=Z_(function(M){return qc(md(M))(eh(function(U){return r(new En(new $I({time:U})))}))}),b=Z_(function(M){return qc(md(M))(eh(function(U){return r(new En(new jb({playing:!0,time:U})))}))}),d=function(M){return r(gn.create(M))},h=Z_(function(M){return qc(md(M))(eh(function(U){return d(new rh(U))}))}),N=Vd(d)(Lb.value),y=Bm([gb("w-100 t--real-video")({id:n.videoId,controls:Ga(n.customControls),onVolumeChange:N,onTimeUpdate:v,onPlay:b,onPause:h})(""),qi(!l)(II({videoStreamUrl:e.watchUrl,videoElementId:n.videoId,onNotSupported:d(Sb.value),onError:function(M,U){return be},onCriticalFail:Jc(d)(function(M){var U=M==="networkError";return U?nh.value:new Kd("HLS player crashed")}),onReady:d(new Yd({autoPlay:e.autoPlay})),onInitialPts:Jc(d)(function(M){return new Pb(M.initPTS)})}))]),E=function(){return n.stage instanceof ul&&n.stage.value0.unmuteOverlay?Db("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:ki({pointerEvents:"none"})})(LI("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")({onClick:Vd(d)(Ab.value),style:ki({pointerEvents:"all"})})([wc("click for sound"),AI("fe fe-volume-2 ml-2")("")])):xr}(),S=function(M){return Db("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:Jc(d)(function(U){return new go(Jd)}),onMouseDown:Jc(d)(function(U){return new go(Jd)}),onTouchStart:Jc(d)(function(U){return new go(Jd)})})(ob(M)(function(U){return d(go.create(U))}))},C=gb("w-100 t--real-video")({id:n.videoId,controls:Ga(n.customControls),playsInline:!0,onVolumeChange:N,onTimeUpdate:v,onPlay:b,onPause:h,onLoadedMetadata:Vd(d)(new Yd({autoPlay:e.autoPlay})),onError:Vd(d)(nh.value),src:function(){return l?"":e.watchUrl}()})("");return PI("position-relative w-100")([function(){if(n.support instanceof wb)return y;if(n.support instanceof Cb)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 175, column 7 - line 177, column 40): "+[n.support.constructor.name])}(),Qy(n.customControls)(S),qi(n.allowSound)(E),i])}}},JI=function(e){var n=Lt(e.MonadEffect0());return function(r){return n(function(){return GI(r)(Gi(!1))(),ah.value})}},zI=JI(nR),ih=function(e){return jI("Livestream: Error")({livestream_error_message:e})};var VI=function(e){return Lt(e)(function(){var r=qc(qc(Za)(s_))(c_)();return NI(function(i){return UI(VD(i)(r))(new $(0))})(["iPad","iPod","iPhone"])})},Wb=VI(_n),KI=function(e){var n=function(i){return il(OI(e.allowSound)(WI(jr("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return il(zd(Hd(i)))(function(){return Bn(new Qd({unmuteOverlay:!1}))})})},r=function(i){return il(Rb(Gi(!0)(i)))(function(){return il(zd(Hd(i)))(function(){return Bn(new Qd({unmuteOverlay:!0}))})})};return oh(e)({whenNotFound:new Kd("