(self.webpackChunk=self.webpackChunk||[]).push([[4339],{98280:function(He,ye,K){"use strict";K.d(ye,{Z:function(){return ot}});function Z(U){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},Z(U)}function J(U,W){if(Z(U)!="object"||!U)return U;var B=U[Symbol.toPrimitive];if(B!==void 0){var X=B.call(U,W||"default");if(Z(X)!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return(W==="string"?String:Number)(U)}function V(U){var W=J(U,"string");return Z(W)=="symbol"?W:W+""}function N(U,W,B){return(W=V(W))in U?Object.defineProperty(U,W,{value:B,enumerable:!0,configurable:!0,writable:!0}):U[W]=B,U}function L(U,W){var B=Object.keys(U);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(U);W&&(X=X.filter(function(ae){return Object.getOwnPropertyDescriptor(U,ae).enumerable})),B.push.apply(B,X)}return B}function C(U){for(var W=1;WU.length)&&(W=U.length);for(var B=0,X=Array(W);BU.length)&&(W=U.length);for(var B=0,X=new Array(W);B0&&arguments[0]!==void 0?arguments[0]:{},W=U.mark;return W?W.startsWith("data-")?W:"data-".concat(W):he}function Ue(U){if(U.attachTo)return U.attachTo;var W=document.querySelector("head");return W||document.body}function $e(U){return U==="queue"?"prependQueue":U?"prepend":"append"}function z(U){return Array.from((be.get(U)||U).children).filter(function(W){return W.tagName==="STYLE"})}function ne(U){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!b())return null;var B=W.csp,X=W.prepend,ae=document.createElement("style");ae.setAttribute(Ee,$e(X)),B!=null&&B.nonce&&(ae.nonce=B==null?void 0:B.nonce),ae.innerHTML=U;var me=Ue(W),Te=me.firstChild;if(X){if(X==="queue"){var Me=z(me).filter(function(Ie){return["prepend","prependQueue"].includes(Ie.getAttribute(Ee))});if(Me.length)return me.insertBefore(ae,Me[Me.length-1].nextSibling),ae}me.insertBefore(ae,Te)}else me.appendChild(ae);return ae}function de(U){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=Ue(W);return z(B).find(function(X){return X.getAttribute(Ce(W))===U})}function ge(U){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=de(U,W);if(B){var X=Ue(W);X.removeChild(B)}}function Ae(U,W){var B=be.get(U);if(!B||!Re(document,B)){var X=ne("",W),ae=X.parentNode;be.set(U,ae),U.removeChild(X)}}function Ve(){be.clear()}function xt(U,W){var B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},X=Ue(B);Ae(X,B);var ae=de(W,B);if(ae){var me,Te;if((me=B.csp)!==null&&me!==void 0&&me.nonce&&ae.nonce!==((Te=B.csp)===null||Te===void 0?void 0:Te.nonce)){var Me;ae.nonce=(Me=B.csp)===null||Me===void 0?void 0:Me.nonce}return ae.innerHTML!==U&&(ae.innerHTML=U),ae}var Ie=ne(U,B);return Ie.setAttribute(Ce(B),W),Ie}var Je;function pt(U){if(typeof document=="undefined")return 0;if(U||Je===void 0){var W=document.createElement("div");W.style.width="100%",W.style.height="200px";var B=document.createElement("div"),X=B.style;X.position="absolute",X.top="0",X.left="0",X.pointerEvents="none",X.visibility="hidden",X.width="200px",X.height="150px",X.overflow="hidden",B.appendChild(W),document.body.appendChild(B);var ae=W.offsetWidth;B.style.overflow="scroll";var me=W.offsetWidth;ae===me&&(me=B.clientWidth),document.body.removeChild(B),Je=ae-me}return Je}function St(U){var W=U.match(/^(.*)px$/),B=Number(W==null?void 0:W[1]);return Number.isNaN(B)?pt():B}function er(U){if(typeof document=="undefined"||!U||!(U instanceof Element))return{width:0,height:0};var W=getComputedStyle(U,"::-webkit-scrollbar"),B=W.width,X=W.height;return{width:St(B),height:St(X)}}function Ne(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Fe="rc-util-locker-".concat(Date.now()),We=0;function Be(U){var W=!!U,B=i.useState(function(){return We+=1,"".concat(Fe,"_").concat(We)}),X=a(B,1),ae=X[0];ie(function(){if(W){var me=er(document.body).width,Te=Ne();xt(` html body { overflow-y: hidden; `.concat(Te?"width: calc(100% - ".concat(me,"px);"):"",` }`),ae)}else ge(ae);return function(){ge(ae)}},[W,ae])}var _e=!1;function ht(U){return typeof U=="boolean"&&(_e=U),_e}var Ze=function(W){return W===!1?!1:!b()||!W?null:typeof W=="string"?document.querySelector(W):typeof W=="function"?W():W},At=i.forwardRef(function(U,W){var B=U.open,X=U.autoLock,ae=U.getContainer,me=U.debug,Te=U.autoDestroy,Me=Te===void 0?!0:Te,Ie=U.children,ke=i.useState(B),at=a(ke,2),st=at[0],dt=at[1],nt=st||B;i.useEffect(function(){(Me||B)&&dt(B)},[B,Me]);var mt=i.useState(function(){return Ze(ae)}),kt=a(mt,2),Dt=kt[0],Bt=kt[1];i.useEffect(function(){var Tr=Ze(ae);Bt(Tr!=null?Tr:null)});var Nt=xe(nt&&!Dt,me),Mt=a(Nt,2),Qt=Mt[0],Ot=Mt[1],ft=Dt!=null?Dt:Qt;Be(X&&B&&b()&&(ft===Qt||ft===document.body));var Xt=null;if(Ie&&O(Ie)&&W){var Ht=Ie;Xt=Ht.ref}var nr=D(Xt,W);if(!nt||!b()||Dt===void 0)return null;var Fr=ft===!1||ht(),br=Ie;return W&&(br=i.cloneElement(Ie,{ref:nr})),i.createElement(F.Provider,{value:Ot},Fr?br:(0,E.createPortal)(br,ft))}),yt=At,tt=yt,bt=K(94184),Ye=K.n(bt),je=K(48555);function it(U){return U instanceof HTMLElement||U instanceof SVGElement}function Vt(U){return U&&_typeof(U)==="object"&&it(U.nativeElement)?U.nativeElement:it(U)?U:null}function tr(U){var W=Vt(U);if(W)return W;if(U instanceof React.Component){var B;return(B=ReactDOM.findDOMNode)===null||B===void 0?void 0:B.call(ReactDOM,U)}return null}function or(U){var W;return U==null||(W=U.getRootNode)===null||W===void 0?void 0:W.call(U)}function Dr(U){return or(U)instanceof ShadowRoot}function Yr(U){return Dr(U)?or(U):null}function ur(U){var W=i.useRef();W.current=U;var B=i.useCallback(function(){for(var X,ae=arguments.length,me=new Array(ae),Te=0;TeU.length)&&(W=U.length);for(var B=0,X=new Array(W);B=19)return!0;var ae=(0,An.isMemo)(W)?W.type.type:W.type;return!(typeof ae=="function"&&!((B=ae.prototype)!==null&&B!==void 0&&B.render)&&ae.$$typeof!==An.ForwardRef||typeof W=="function"&&!((X=W.prototype)!==null&&X!==void 0&&X.render)&&W.$$typeof!==An.ForwardRef)};function Nn(U){return(0,i.isValidElement)(U)&&!yi(U)}var ki=function(W){return Nn(W)&&kr(W)},Ni=function(W){if(W&&Nn(W)){var B=W;return B.props.propertyIsEnumerable("ref")?B.props.ref:B.ref}return null};function en(U){var W=U.prefixCls,B=U.align,X=U.arrow,ae=U.arrowPos,me=X||{},Te=me.className,Me=me.content,Ie=ae.x,ke=Ie===void 0?0:Ie,at=ae.y,st=at===void 0?0:at,dt=i.useRef();if(!B||!B.points)return null;var nt={position:"absolute"};if(B.autoArrow!==!1){var mt=B.points[0],kt=B.points[1],Dt=mt[0],Bt=mt[1],Nt=kt[0],Mt=kt[1];Dt===Nt||!["t","b"].includes(Dt)?nt.top=st:Dt==="t"?nt.top=0:nt.bottom=0,Bt===Mt||!["l","r"].includes(Bt)?nt.left=ke:Bt==="l"?nt.left=0:nt.right=0}return i.createElement("div",{ref:dt,className:Ye()("".concat(W,"-arrow"),Te),style:nt},Me)}function Ri(U){var W=U.prefixCls,B=U.open,X=U.zIndex,ae=U.mask,me=U.motion;return ae?i.createElement(Gn.Z,Yn({},me,{motionAppear:!0,visible:B,removeOnLeave:!0}),function(Te){var Me=Te.className;return i.createElement("div",{style:{zIndex:X},className:Ye()("".concat(W,"-mask"),Me)})}):null}var Fi=i.memo(function(U){var W=U.children;return W},function(U,W){return W.cache}),Gi=Fi,Li=i.forwardRef(function(U,W){var B=U.popup,X=U.className,ae=U.prefixCls,me=U.style,Te=U.target,Me=U.onVisibleChanged,Ie=U.open,ke=U.keepDom,at=U.fresh,st=U.onClick,dt=U.mask,nt=U.arrow,mt=U.arrowPos,kt=U.align,Dt=U.motion,Bt=U.maskMotion,Nt=U.forceRender,Mt=U.getPopupContainer,Qt=U.autoDestroy,Ot=U.portal,ft=U.zIndex,Xt=U.onMouseEnter,Ht=U.onMouseLeave,nr=U.onPointerEnter,Fr=U.onPointerDownCapture,br=U.ready,Tr=U.offsetX,$t=U.offsetY,dr=U.offsetR,vr=U.offsetB,Rr=U.onAlign,tn=U.onPrepare,ir=U.stretch,xr=U.targetWidth,Wt=U.targetHeight,Qr=typeof B=="function"?B():B,Xr=Ie||ke,pr=(Mt==null?void 0:Mt.length)>0,Ft=i.useState(!Mt||!pr),Lr=f(Ft,2),hn=Lr[0],dn=Lr[1];if(on(function(){!hn&&pr&&Te&&dn(!0)},[hn,pr,Te]),!hn)return null;var Sr="auto",ar={left:"-1000vw",top:"-1000vh",right:Sr,bottom:Sr};if(br||!Ie){var Pr,$r=kt.points,gr=kt.dynamicInset||((Pr=kt._experimental)===null||Pr===void 0?void 0:Pr.dynamicInset),Ir=gr&&$r[0][1]==="r",Ar=gr&&$r[0][0]==="b";Ir?(ar.right=dr,ar.left=Sr):(ar.left=Tr,ar.right=Sr),Ar?(ar.bottom=vr,ar.top=Sr):(ar.top=$t,ar.bottom=Sr)}var mr={};return ir&&(ir.includes("height")&&Wt?mr.height=Wt:ir.includes("minHeight")&&Wt&&(mr.minHeight=Wt),ir.includes("width")&&xr?mr.width=xr:ir.includes("minWidth")&&xr&&(mr.minWidth=xr)),Ie||(mr.pointerEvents="none"),i.createElement(Ot,{open:Nt||Xr,getContainer:Mt&&function(){return Mt(Te)},autoDestroy:Qt},i.createElement(Ri,{prefixCls:ae,open:Ie,zIndex:ft,mask:dt,motion:Bt}),i.createElement(je.Z,{onResize:Rr,disabled:!Ie},function(jr){return i.createElement(Gn.Z,Yn({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Nt,leavedClassName:"".concat(ae,"-hidden")},Dt,{onAppearPrepare:tn,onEnterPrepare:tn,visible:Ie,onVisibleChanged:function(Ur){var Jt;Dt==null||(Jt=Dt.onVisibleChanged)===null||Jt===void 0||Jt.call(Dt,Ur),Me(Ur)}}),function(un,Ur){var Jt=un.className,Or=un.style,Mr=Ye()(ae,Jt,X);return i.createElement("div",{ref:yr(jr,W,Ur),className:Mr,style:C(C(C(C({"--arrow-x":"".concat(mt.x||0,"px"),"--arrow-y":"".concat(mt.y||0,"px")},ar),mr),Or),{},{boxSizing:"border-box",zIndex:ft},me),onMouseEnter:Xt,onMouseLeave:Ht,onPointerEnter:nr,onClick:st,onPointerDownCapture:Fr},nt&&i.createElement(en,{prefixCls:ae,arrow:nt,arrowPos:mt,align:kt}),i.createElement(Gi,{cache:!Ie&&!at},Qr))})}))}),$=Li,q=i.forwardRef(function(U,W){var B=U.children,X=U.getTriggerDOMNode,ae=kr(B),me=i.useCallback(function(Me){Qn(W,X?X(Me):Me)},[X]),Te=hr(me,Ni(B));return ae?i.cloneElement(B,{ref:Te}):B}),ue=q,pe=i.createContext(null),Se=pe;function De(U){return U?Array.isArray(U)?U:[U]:[]}function Le(U,W,B,X){return i.useMemo(function(){var ae=De(B!=null?B:W),me=De(X!=null?X:W),Te=new Set(ae),Me=new Set(me);return U&&(Te.has("hover")&&(Te.delete("hover"),Te.add("click")),Me.has("hover")&&(Me.delete("hover"),Me.add("click"))),[Te,Me]},[U,W,B,X])}var Oe=function(U){if(!U)return!1;if(U instanceof Element){if(U.offsetParent)return!0;if(U.getBBox){var W=U.getBBox(),B=W.width,X=W.height;if(B||X)return!0}if(U.getBoundingClientRect){var ae=U.getBoundingClientRect(),me=ae.width,Te=ae.height;if(me||Te)return!0}}return!1};function ze(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],B=arguments.length>2?arguments[2]:void 0;return B?U[0]===W[0]:U[0]===W[0]&&U[1]===W[1]}function ut(U,W,B,X){for(var ae=B.points,me=Object.keys(U),Te=0;Te1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(U)?W:U}function Yt(U){return jt(parseFloat(U),0)}function Kt(U,W){var B=C({},U);return(W||[]).forEach(function(X){if(!(X instanceof HTMLBodyElement||X instanceof HTMLHtmlElement)){var ae=qe(X).getComputedStyle(X),me=ae.overflow,Te=ae.overflowClipMargin,Me=ae.borderTopWidth,Ie=ae.borderBottomWidth,ke=ae.borderLeftWidth,at=ae.borderRightWidth,st=X.getBoundingClientRect(),dt=X.offsetHeight,nt=X.clientHeight,mt=X.offsetWidth,kt=X.clientWidth,Dt=Yt(Me),Bt=Yt(Ie),Nt=Yt(ke),Mt=Yt(at),Qt=jt(Math.round(st.width/mt*1e3)/1e3),Ot=jt(Math.round(st.height/dt*1e3)/1e3),ft=(mt-kt-Nt-Mt)*Qt,Xt=(dt-nt-Dt-Bt)*Ot,Ht=Dt*Ot,nr=Bt*Ot,Fr=Nt*Qt,br=Mt*Qt,Tr=0,$t=0;if(me==="clip"){var dr=Yt(Te);Tr=dr*Qt,$t=dr*Ot}var vr=st.x+Fr-Tr,Rr=st.y+Ht-$t,tn=vr+st.width+2*Tr-Fr-br-ft,ir=Rr+st.height+2*$t-Ht-nr-Xt;B.left=Math.max(B.left,vr),B.top=Math.max(B.top,Rr),B.right=Math.min(B.right,tn),B.bottom=Math.min(B.bottom,ir)}}),B}function rr(U){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B="".concat(W),X=B.match(/^(.*)\%$/);return X?U*(parseFloat(X[1])/100):parseFloat(B)}function Pt(U,W){var B=W||[],X=f(B,2),ae=X[0],me=X[1];return[rr(U.width,ae),rr(U.height,me)]}function It(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[U[0],U[1]]}function Lt(U,W){var B=W[0],X=W[1],ae,me;return B==="t"?me=U.y:B==="b"?me=U.y+U.height:me=U.y+U.height/2,X==="l"?ae=U.x:X==="r"?ae=U.x+U.width:ae=U.x+U.width/2,{x:ae,y:me}}function Zt(U,W){var B={t:"b",b:"t",l:"r",r:"l"};return U.map(function(X,ae){return ae===W?B[X]||"c":X}).join("")}function Nr(U,W,B,X,ae,me,Te){var Me=i.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ae[X]||{}}),Ie=f(Me,2),ke=Ie[0],at=Ie[1],st=i.useRef(0),dt=i.useMemo(function(){return W?Rt(W):[]},[W]),nt=i.useRef({}),mt=function(){nt.current={}};U||mt();var kt=ur(function(){if(W&&B&&U){let Kn=function(Ci,gi){var mi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ln,Wi=Ft.x+Ci,zi=Ft.y+gi,sa=Wi+Ir,oa=zi+gr,ua=Math.max(Wi,mi.left),Xe=Math.max(zi,mi.top),Tt=Math.min(sa,mi.right),Br=Math.min(oa,mi.bottom);return Math.max(0,(Tt-ua)*(Br-Xe))},Zi=function(){ei=Ft.y+fr,Bn=ei+gr,Vn=Ft.x+lr,vi=Vn+Ir};var Nt,Mt,Qt,Ot,ft=W,Xt=ft.ownerDocument,Ht=qe(ft),nr=Ht.getComputedStyle(ft),Fr=nr.width,br=nr.height,Tr=nr.position,$t=ft.style.left,dr=ft.style.top,vr=ft.style.right,Rr=ft.style.bottom,tn=ft.style.overflow,ir=C(C({},ae[X]),me),xr=Xt.createElement("div");(Nt=ft.parentElement)===null||Nt===void 0||Nt.appendChild(xr),xr.style.left="".concat(ft.offsetLeft,"px"),xr.style.top="".concat(ft.offsetTop,"px"),xr.style.position=Tr,xr.style.height="".concat(ft.offsetHeight,"px"),xr.style.width="".concat(ft.offsetWidth,"px"),ft.style.left="0",ft.style.top="0",ft.style.right="auto",ft.style.bottom="auto",ft.style.overflow="hidden";var Wt;if(Array.isArray(B))Wt={x:B[0],y:B[1],width:0,height:0};else{var Qr,Xr,pr=B.getBoundingClientRect();pr.x=(Qr=pr.x)!==null&&Qr!==void 0?Qr:pr.left,pr.y=(Xr=pr.y)!==null&&Xr!==void 0?Xr:pr.top,Wt={x:pr.x,y:pr.y,width:pr.width,height:pr.height}}var Ft=ft.getBoundingClientRect();Ft.x=(Mt=Ft.x)!==null&&Mt!==void 0?Mt:Ft.left,Ft.y=(Qt=Ft.y)!==null&&Qt!==void 0?Qt:Ft.top;var Lr=Xt.documentElement,hn=Lr.clientWidth,dn=Lr.clientHeight,Sr=Lr.scrollWidth,ar=Lr.scrollHeight,Pr=Lr.scrollTop,$r=Lr.scrollLeft,gr=Ft.height,Ir=Ft.width,Ar=Wt.height,mr=Wt.width,jr={left:0,top:0,right:hn,bottom:dn},un={left:-$r,top:-Pr,right:Sr-$r,bottom:ar-Pr},Ur=ir.htmlRegion,Jt="visible",Or="visibleFirst";Ur!=="scroll"&&Ur!==Or&&(Ur=Jt);var Mr=Ur===Or,Xn=Kt(un,dt),zt=Kt(jr,dt),ln=Ur===Jt?zt:Xn,bn=Mr?zt:ln;ft.style.left="auto",ft.style.top="auto",ft.style.right="0",ft.style.bottom="0";var _r=ft.getBoundingClientRect();ft.style.left=$t,ft.style.top=dr,ft.style.right=vr,ft.style.bottom=Rr,ft.style.overflow=tn,(Ot=ft.parentElement)===null||Ot===void 0||Ot.removeChild(xr);var yn=jt(Math.round(Ir/parseFloat(Fr)*1e3)/1e3),rn=jt(Math.round(gr/parseFloat(br)*1e3)/1e3);if(yn===0||rn===0||it(B)&&!Oe(B))return;var Ct=ir.offset,we=ir.targetOffset,et=Pt(Ft,Ct),ct=f(et,2),Gt=ct[0],Ut=ct[1],Fn=Pt(Wt,we),Zr=f(Fn,2),nn=Zr[0],vn=Zr[1];Wt.x-=nn,Wt.y-=vn;var Ei=ir.points||[],ci=f(Ei,2),hi=ci[0],$n=ci[1],Un=It($n),pn=It(hi),Dn=Lt(Wt,Un),fn=Lt(Ft,pn),jn=C({},ir),lr=Dn.x-fn.x+Gt,fr=Dn.y-fn.y+Ut,Rn=Kn(lr,fr),Jn=Kn(lr,fr,zt),bi=Lt(Wt,["t","l"]),Sn=Lt(Ft,["t","l"]),Pi=Lt(Wt,["b","r"]),Ti=Lt(Ft,["b","r"]),Hn=ir.overflow||{},qn=Hn.adjustX,xi=Hn.adjustY,Si=Hn.shiftX,di=Hn.shiftY,Ai=function(gi){return typeof gi=="boolean"?gi:gi>=0},ei,Bn,Vn,vi;Zi();var ai=Ai(xi),wi=pn[0]===Un[0];if(ai&&pn[0]==="t"&&(Bn>bn.bottom||nt.current.bt)){var an=fr;wi?an-=gr-Ar:an=bi.y-Ti.y-Ut;var Ii=Kn(lr,an),Ui=Kn(lr,an,zt);Ii>Rn||Ii===Rn&&(!Mr||Ui>=Jn)?(nt.current.bt=!0,fr=an,Ut=-Ut,jn.points=[Zt(pn,0),Zt(Un,0)]):nt.current.bt=!1}if(ai&&pn[0]==="b"&&(eiRn||Oi===Rn&&(!Mr||wr>=Jn)?(nt.current.tb=!0,fr=si,Ut=-Ut,jn.points=[Zt(pn,0),Zt(Un,0)]):nt.current.tb=!1}var qt=Ai(qn),sr=pn[1]===Un[1];if(qt&&pn[1]==="l"&&(vi>bn.right||nt.current.rl)){var Jr=lr;sr?Jr-=Ir-mr:Jr=bi.x-Ti.x-Gt;var cn=Kn(Jr,fr),Zn=Kn(Jr,fr,zt);cn>Rn||cn===Rn&&(!Mr||Zn>=Jn)?(nt.current.rl=!0,lr=Jr,Gt=-Gt,jn.points=[Zt(pn,1),Zt(Un,1)]):nt.current.rl=!1}if(qt&&pn[1]==="r"&&(VnRn||Mi===Rn&&(!Mr||Di>=Jn)?(nt.current.lr=!0,lr=Ln,Gt=-Gt,jn.points=[Zt(pn,1),Zt(Un,1)]):nt.current.lr=!1}Zi();var Pn=Si===!0?0:Si;typeof Pn=="number"&&(Vnzt.right&&(lr-=vi-zt.right-Gt,Wt.x>zt.right-Pn&&(lr+=Wt.x-zt.right+Pn)));var gn=di===!0?0:di;typeof gn=="number"&&(eizt.bottom&&(fr-=Bn-zt.bottom-Ut,Wt.y>zt.bottom-gn&&(fr+=Wt.y-zt.bottom+gn)));var ti=Ft.x+lr,pi=ti+Ir,ri=Ft.y+fr,Xi=ri+gr,ji=Wt.x,$i=ji+mr,Bi=Wt.y,Ji=Bi+Ar,qi=Math.max(ti,ji),ea=Math.min(pi,$i),Hi=(qi+ea)/2,ta=Hi-ti,ra=Math.max(ri,Bi),Vi=Math.min(Xi,Ji),na=(ra+Vi)/2,ia=na-ri;Te==null||Te(W,jn);var Ki=_r.right-Ft.x-(lr+Ft.width),ni=_r.bottom-Ft.y-(fr+Ft.height);yn===1&&(lr=Math.round(lr),Ki=Math.round(Ki)),rn===1&&(fr=Math.round(fr),ni=Math.round(ni));var aa={ready:!0,offsetX:lr/yn,offsetY:fr/rn,offsetR:Ki/yn,offsetB:ni/rn,arrowX:ta/yn,arrowY:ia/rn,scaleX:yn,scaleY:rn,align:jn};at(aa)}}),Dt=function(){st.current+=1;var Mt=st.current;Promise.resolve().then(function(){st.current===Mt&&kt()})},Bt=function(){at(function(Mt){return C(C({},Mt),{},{ready:!1})})};return on(Bt,[X]),on(function(){U||Bt()},[U]),[ke.ready,ke.offsetX,ke.offsetY,ke.offsetR,ke.offsetB,ke.arrowX,ke.arrowY,ke.scaleX,ke.scaleY,ke.align,Dt]}function Er(U){if(Array.isArray(U))return e(U)}function Gr(U){if(typeof Symbol!="undefined"&&U[Symbol.iterator]!=null||U["@@iterator"]!=null)return Array.from(U)}function Y(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(U){return Er(U)||Gr(U)||I(U)||Y()}function oe(U,W,B,X,ae){on(function(){if(U&&W&&B){let st=function(){X(),ae()};var me=W,Te=B,Me=Rt(me),Ie=Rt(Te),ke=qe(Te),at=new Set([ke].concat(re(Me),re(Ie)));return at.forEach(function(dt){dt.addEventListener("scroll",st,{passive:!0})}),ke.addEventListener("resize",st,{passive:!0}),X(),function(){at.forEach(function(dt){dt.removeEventListener("scroll",st),ke.removeEventListener("resize",st)})}}},[U,W,B])}var te={},fe=[],ce=function(W){fe.push(W)};function ve(U,W){if(0)var B}function Pe(U,W){if(0)var B}function Qe(){te={}}function Ge(U,W,B){!W&&!te[B]&&(U(!1,B),te[B]=!0)}function vt(U,W){Ge(ve,U,W)}function lt(U,W){Ge(Pe,U,W)}vt.preMessage=ce,vt.resetWarned=Qe,vt.noteOnce=lt;var Et=null;function wt(U,W,B,X,ae,me,Te,Me){var Ie=i.useRef(U);Ie.current=U;var ke=i.useRef(!1);i.useEffect(function(){if(W&&X&&(!ae||me)){var st=function(){ke.current=!1},dt=function(Qt){var Ot;Ie.current&&!Te(((Ot=Qt.composedPath)===null||Ot===void 0||(Ot=Ot.call(Qt))===null||Ot===void 0?void 0:Ot[0])||Qt.target)&&!ke.current&&Me(!1)},nt=qe(X);nt.addEventListener("pointerdown",st,!0),nt.addEventListener("mousedown",dt,!0),nt.addEventListener("contextmenu",dt,!0);var mt=Yr(B);if(mt&&(mt.addEventListener("mousedown",dt,!0),mt.addEventListener("contextmenu",dt,!0)),0)var kt,Dt,Bt,Nt;return function(){nt.removeEventListener("pointerdown",st,!0),nt.removeEventListener("mousedown",dt,!0),nt.removeEventListener("contextmenu",dt,!0),mt&&(mt.removeEventListener("mousedown",dt,!0),mt.removeEventListener("contextmenu",dt,!0))}}},[W,B,X,ae,me]);function at(){ke.current=!0}return at}var gt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function rt(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt,W=i.forwardRef(function(B,X){var ae=B.prefixCls,me=ae===void 0?"rc-trigger-popup":ae,Te=B.children,Me=B.action,Ie=Me===void 0?"hover":Me,ke=B.showAction,at=B.hideAction,st=B.popupVisible,dt=B.defaultPopupVisible,nt=B.onPopupVisibleChange,mt=B.afterPopupVisibleChange,kt=B.mouseEnterDelay,Dt=B.mouseLeaveDelay,Bt=Dt===void 0?.1:Dt,Nt=B.focusDelay,Mt=B.blurDelay,Qt=B.mask,Ot=B.maskClosable,ft=Ot===void 0?!0:Ot,Xt=B.getPopupContainer,Ht=B.forceRender,nr=B.autoDestroy,Fr=B.destroyPopupOnHide,br=B.popup,Tr=B.popupClassName,$t=B.popupStyle,dr=B.popupPlacement,vr=B.builtinPlacements,Rr=vr===void 0?{}:vr,tn=B.popupAlign,ir=B.zIndex,xr=B.stretch,Wt=B.getPopupClassNameFromAlign,Qr=B.fresh,Xr=B.alignPoint,pr=B.onPopupClick,Ft=B.onPopupAlign,Lr=B.arrow,hn=B.popupMotion,dn=B.maskMotion,Sr=B.popupTransitionName,ar=B.popupAnimation,Pr=B.maskTransitionName,$r=B.maskAnimation,gr=B.className,Ir=B.getTriggerDOMNode,Ar=h(B,gt),mr=nr||Fr||!1,jr=i.useState(!1),un=f(jr,2),Ur=un[0],Jt=un[1];on(function(){Jt(li())},[]);var Or=i.useRef({}),Mr=i.useContext(Se),Xn=i.useMemo(function(){return{registerSubPopup:function(Tt,Br){Or.current[Tt]=Br,Mr==null||Mr.registerSubPopup(Tt,Br)}}},[Mr]),zt=oi(),ln=i.useState(null),bn=f(ln,2),_r=bn[0],yn=bn[1],rn=i.useRef(null),Ct=ur(function(Xe){rn.current=Xe,it(Xe)&&_r!==Xe&&yn(Xe),Mr==null||Mr.registerSubPopup(zt,Xe)}),we=i.useState(null),et=f(we,2),ct=et[0],Gt=et[1],Ut=i.useRef(null),Fn=ur(function(Xe){it(Xe)&&ct!==Xe&&(Gt(Xe),Ut.current=Xe)}),Zr=i.Children.only(Te),nn=(Zr==null?void 0:Zr.props)||{},vn={},Ei=ur(function(Xe){var Tt,Br,sn=ct;return(sn==null?void 0:sn.contains(Xe))||((Tt=Yr(sn))===null||Tt===void 0?void 0:Tt.host)===Xe||Xe===sn||(_r==null?void 0:_r.contains(Xe))||((Br=Yr(_r))===null||Br===void 0?void 0:Br.host)===Xe||Xe===_r||Object.values(Or.current).some(function(zr){return(zr==null?void 0:zr.contains(Xe))||Xe===zr})}),ci=_t(me,hn,ar,Sr),hi=_t(me,dn,$r,Pr),$n=i.useState(dt||!1),Un=f($n,2),pn=Un[0],Dn=Un[1],fn=st!=null?st:pn,jn=ur(function(Xe){st===void 0&&Dn(Xe)});on(function(){Dn(st||!1)},[st]);var lr=i.useRef(fn);lr.current=fn;var fr=i.useRef([]);fr.current=[];var Rn=ur(function(Xe){var Tt;jn(Xe),((Tt=fr.current[fr.current.length-1])!==null&&Tt!==void 0?Tt:fn)!==Xe&&(fr.current.push(Xe),nt==null||nt(Xe))}),Jn=i.useRef(),bi=function(){clearTimeout(Jn.current)},Sn=function(Tt){var Br=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;bi(),Br===0?Rn(Tt):Jn.current=setTimeout(function(){Rn(Tt)},Br*1e3)};i.useEffect(function(){return bi},[]);var Pi=i.useState(!1),Ti=f(Pi,2),Hn=Ti[0],qn=Ti[1];on(function(Xe){(!Xe||fn)&&qn(!0)},[fn]);var xi=i.useState(null),Si=f(xi,2),di=Si[0],Ai=Si[1],ei=i.useState(null),Bn=f(ei,2),Vn=Bn[0],vi=Bn[1],ai=function(Tt){vi([Tt.clientX,Tt.clientY])},wi=Nr(fn,_r,Xr&&Vn!==null?Vn:ct,dr,Rr,tn,Ft),an=f(wi,11),Ii=an[0],Ui=an[1],si=an[2],Oi=an[3],wr=an[4],qt=an[5],sr=an[6],Jr=an[7],cn=an[8],Zn=an[9],Ln=an[10],Mi=Le(Ur,Ie,ke,at),Di=f(Mi,2),Pn=Di[0],gn=Di[1],ti=Pn.has("click"),pi=gn.has("click")||gn.has("contextMenu"),ri=ur(function(){Hn||Ln()}),Xi=function(){lr.current&&Xr&&pi&&Sn(!1)};oe(fn,ct,_r,ri,Xi),on(function(){ri()},[Vn,dr]),on(function(){fn&&!(Rr!=null&&Rr[dr])&&ri()},[JSON.stringify(tn)]);var ji=i.useMemo(function(){var Xe=ut(Rr,me,Zn,Xr);return Ye()(Xe,Wt==null?void 0:Wt(Zn))},[Zn,Wt,Rr,me,Xr]);i.useImperativeHandle(X,function(){return{nativeElement:Ut.current,popupElement:rn.current,forceAlign:ri}});var $i=i.useState(0),Bi=f($i,2),Ji=Bi[0],qi=Bi[1],ea=i.useState(0),Hi=f(ea,2),ta=Hi[0],ra=Hi[1],Vi=function(){if(xr&&ct){var Tt=ct.getBoundingClientRect();qi(Tt.width),ra(Tt.height)}},na=function(){Vi(),ri()},ia=function(Tt){qn(!1),Ln(),mt==null||mt(Tt)},Ki=function(){return new Promise(function(Tt){Vi(),Ai(function(){return Tt})})};on(function(){di&&(Ln(),di(),Ai(null))},[di]);function ni(Xe,Tt,Br,sn){vn[Xe]=function(zr){var Yi;sn==null||sn(zr),Sn(Tt,Br);for(var la=arguments.length,fa=new Array(la>1?la-1:0),Qi=1;Qi1?Br-1:0),zr=1;zr1?Br-1:0),zr=1;zrS in R?p(R,S,{enumerable:!0,configurable:!0,writable:!0,value:w}):R[S]=w,s=(R,S)=>{for(var w in S||(S={}))o.call(S,w)&&i(R,w,S[w]);if(m)for(var w of m(S))a.call(S,w)&&i(R,w,S[w]);return R},E=(R,S)=>u(R,v(S)),b=(R,S,w)=>new Promise((r,n)=>{var t=y=>{try{x(w.next(y))}catch(c){n(c)}},l=y=>{try{x(w.throw(y))}catch(c){n(c)}},x=y=>y.done?r(y.value):Promise.resolve(y.value).then(t,l);x((w=w.apply(R,S)).next())});const d=({pathsDetail:R,dispatch:S})=>{var w,r,n,t,l;const x=(0,J.useParams)(),[y,c]=(0,Z.useState)(1),[,_,D,O]=(0,A.U)(I.Cc,{subject_id:x==null?void 0:x.pathId,uuid:x==null?void 0:x.learningpathId}),[k,F]=(0,Z.useState)([]),[G,H]=(0,Z.useState)(!1),[j,Q]=(0,Z.useState)({}),[ee,ie]=(0,Z.useState)(!1),se=[3,2,1];(0,Z.useEffect)(()=>{D({})},[]),(0,Z.useEffect)(()=>{var he,be;if((he=R==null?void 0:R.detail)!=null&&he.nodes&&y===1){const Ce=[...(be=R==null?void 0:R.detail)==null?void 0:be.nodes];F(Ce==null?void 0:Ce.splice(1)),c(2)}},[(w=R==null?void 0:R.detail)==null?void 0:w.nodes]);const le=(0,Z.useMemo)(()=>[{title:"\u6807\u7B7E\u8282\u70B9\u540D\u79F0",width:"240rem",ellipsis:!0,dataIndex:"name",render:he=>Z.createElement(C.Z,{title:he},he)},{title:"\u5DF2\u5173\u8054\u8D44\u6E90\u6570",ellipsis:!0,dataIndex:"resource_count"},{title:"\u5B9E\u8BAD",ellipsis:!0,dataIndex:"shixun"},{title:"\u89C6\u9891",ellipsis:!0,dataIndex:"video"},{title:"\u8BFE\u4EF6",ellipsis:!0,dataIndex:"attachment"},{title:"\u8BD5\u5377",ellipsis:!0,dataIndex:"examination_bank"},{title:"\u4F5C\u4E1A",ellipsis:!0,dataIndex:"homework"},{title:"\u5176\u4ED6",ellipsis:!0,dataIndex:"other"},{title:"\u67E5\u770B",ellipsis:!0,dataIndex:"look",render:(he,be)=>Z.createElement("a",{style:{color:"#18D6FF"},onClick:()=>{Ee(be)}},"\u67E5\u770B\u8BE6\u60C5")}],[]),xe=()=>b(void 0,null,function*(){D({})}),Re=(0,Z.useMemo)(()=>{var he,be;const Ce=((he=O==null?void 0:O.data)==null?void 0:he.relation_resource_count)||0,Ue=((be=O==null?void 0:O.data)==null?void 0:be.no_relation_resource_count)||0,$e=Ce+Ue;return $e>0?Math.round(Ce/$e*100):0},[O==null?void 0:O.data]),Ee=he=>b(void 0,null,function*(){var be,Ce,Ue,$e,z;ie(!0);let ne=yield(0,h.ZP)("/api/knowledge/v2/get_node.json",{method:"get",params:{depth:0,subject_id:x==null?void 0:x.pathId,nodeUuid:he==null?void 0:he.knowledge_uuid}});if((ne==null?void 0:ne.status)===0&&((Ce=(be=ne==null?void 0:ne.data)==null?void 0:be.nodes)==null?void 0:Ce.length)>0){let de=(z=($e=(Ue=ne==null?void 0:ne.data)==null?void 0:Ue.nodes)==null?void 0:$e.map(ge=>{var Ae,Ve,xt,Je,pt,St,er,Ne,Fe,We,Be,_e,ht;const Ze=(Ae=ne==null?void 0:ne.data)==null?void 0:Ae.resource_count;return E(s({},ge==null?void 0:ge.properties),{rootNodeUuid:(Ve=ge==null?void 0:ge.properties)==null?void 0:Ve.rootNodeUuid,id:(xt=ge==null?void 0:ge.properties)==null?void 0:xt.uuid,name:(Je=ge==null?void 0:ge.properties)==null?void 0:Je.name,description:(pt=ge==null?void 0:ge.properties)==null?void 0:pt.description,nodeType:(St=ge==null?void 0:ge.properties)==null?void 0:St.nodeType,tags:((er=ge==null?void 0:ge.properties)==null?void 0:er.tags)&&((We=(Fe=(Ne=ge==null?void 0:ge.properties)==null?void 0:Ne.tags)==null?void 0:Fe.split("\uFF0C"))==null?void 0:We.map(At=>({name:At})))||[],colorType:parseInt((Be=ge==null?void 0:ge.properties)==null?void 0:Be.color)>3?"3":(_e=ge==null?void 0:ge.properties)==null?void 0:_e.color,activeColor:"#FA6400",size:se[((ht=ge==null?void 0:ge.properties)==null?void 0:ht.color)-1]||1,shape:"circle",hide:!1,isExtendedState:!0,currentResourceTotal:Ze})}))==null?void 0:z[0];de.resourceid=he==null?void 0:he.id,de.tpacti=he==null?void 0:he.knowledge_uuid,Q(de),H(!0)}ie(!1)});return Z.createElement(P.Z,{spinning:_||ee},Z.createElement("div",{className:"w-full c-white text-14px-rem",style:{background:`#030616 url(${L}) 0 0 / 100% auto no-repeat`,height:"100vh",overflow:"auto"}},Z.createElement("div",{className:"w-full flex item-center justify-center",style:{background:`#030616 url(${V}) 0 0 / 100% 100% no-repeat`,height:"108rem"}}),Z.createElement("div",{className:"ml-auto mr-auto flex flex-col mt-20px-rem",style:{width:"1200rem"}},Z.createElement("div",{className:"w-full flex item-center gap-64px-rem",style:{background:`#030616 url(${N}) 0 0 / 100% 100% no-repeat`,height:"156rem",padding:"0 64px",justifyContent:"space-around"}},Z.createElement("div",{className:"flex item-center gap-16px-rem"},Z.createElement("img",{src:K(76296),width:65,height:80,style:{width:"65rem",height:"80rem"}}),Z.createElement("div",{className:"flex flex-col"},Z.createElement("div",{className:"text-500"},"\u5DF2\u5173\u8054\u8D44\u6E90\u6807\u7B7E\u8282\u70B9\u6570"),Z.createElement("div",{className:"text-20px-rem multi_ellipsis1 blod",style:{color:"#7FBEFF"}},((r=O==null?void 0:O.data)==null?void 0:r.relation_resource_count)||0))),Z.createElement("div",{className:"flex item-center gap-16px-rem"},Z.createElement("img",{src:K(30757),width:65,height:80,style:{width:"65rem",height:"80rem"}}),Z.createElement("div",{className:"flex flex-col"},Z.createElement("div",{className:"text-500"},"\u672A\u5173\u8054\u8D44\u6E90\u6807\u7B7E\u8282\u70B9\u6570"),Z.createElement("div",{className:"text-20px-rem multi_ellipsis1 blod",style:{color:"#86A0FF"}},((n=O==null?void 0:O.data)==null?void 0:n.no_relation_resource_count)||0))),Z.createElement("div",{className:"flex item-center gap-16px-rem"},Z.createElement(M.Z,{type:"circle",percent:Re,showInfo:!1,size:65,strokeWidth:18,trailColor:"rgba(100, 135, 188, 0.40)",strokeColor:"#1BBDE0"}),Z.createElement("div",{className:"flex flex-col text-nowrap"},Z.createElement("div",null,"\u77E5\u8BC6\u70B9\u5EFA\u8BBE\u7387\xA0",Z.createElement(C.Z,{title:"\u8D44\u6E90\u5EFA\u8BBE\u7387 = \u56FE\u8C31\u4E2D\u5DF2\u5173\u8054\u8D44\u6E90\u7684\u6807\u7B7E\u8282\u70B9\u6570 / \u56FE\u8C31\u6807\u7B7E\u8282\u70B9\u603B\u6570"},Z.createElement("i",{className:"iconfont icon-xiaowenhao2",style:{fontSize:"16rem"}})," ")),Z.createElement("div",{className:"text-24px-rem ",style:{color:"#1BBDE0",fontWeight:800}},Re,"%")))),Z.createElement("div",{className:"flex flex-col mt-22px-rem gap-12px-rem pb-20px"},Z.createElement("div",{className:`w-full flex item-center justify-center px-30px-rem rounded-2px-rem gap-16px-rem sticky ${e.Z.TableMyHeader}`,style:{height:"40rem",top:0}},le==null?void 0:le.map((he,be)=>Z.createElement("div",{key:be,className:`minW-0 ${he!=null&&he.ellipsis?"multi_ellipsis1":""}`,style:{flex:he!=null&&he.width?"":1,width:(he==null?void 0:he.width)||""}},he==null?void 0:he.title))),(O==null?void 0:O.total_count)==0?Z.createElement(f.Z,null):(l=(t=O==null?void 0:O.data)==null?void 0:t.knowledge_infos)==null?void 0:l.map((he,be)=>Z.createElement("div",{key:be,style:{height:"54rem"},className:`w-full flex item-center justify-center px-30px-rem rounded-2px-rem gap-16px-rem ${e.Z.TableMyDiv}`},le==null?void 0:le.map((Ce,Ue)=>{var $e;return Z.createElement("div",{key:Ue,className:`minW-0 ${Ce!=null&&Ce.ellipsis?"multi_ellipsis1":""}`,style:{flex:Ce!=null&&Ce.width?"":1,width:(Ce==null?void 0:Ce.width)||""}},(($e=Ce==null?void 0:Ce.render)==null?void 0:$e.call(Ce,he==null?void 0:he[Ce==null?void 0:Ce.dataIndex],he,be))||(he==null?void 0:he[Ce==null?void 0:Ce.dataIndex]))})))))),Z.createElement(g.Z,{initdata:xe,uuid:x==null?void 0:x.learningpathId,setshow:()=>{},getData:xe,containerRef:()=>{},showdetail:G,setshowdetail:H,items:j,Tabsdatas:k,tpacti:j==null?void 0:j.tpacti}))};var T=(0,J.connect)(({pathsDetail:R})=>({pathsDetail:R}))(d)},20640:function(He,ye,K){"use strict";var Z=K(11742),J={"text/plain":"Text","text/html":"Url",default:"Text"},V="Copy to clipboard: #{key}, Enter";function N(C){var P=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return C.replace(/#{\s*key\s*}/g,P)}function L(C,P){var M,e,I,A,f,g,h=!1;P||(P={}),M=P.debug||!1;try{I=Z(),A=document.createRange(),f=document.getSelection(),g=document.createElement("span"),g.textContent=C,g.ariaHidden="true",g.style.all="unset",g.style.position="fixed",g.style.top=0,g.style.clip="rect(0, 0, 0, 0)",g.style.whiteSpace="pre",g.style.webkitUserSelect="text",g.style.MozUserSelect="text",g.style.msUserSelect="text",g.style.userSelect="text",g.addEventListener("copy",function(u){if(u.stopPropagation(),P.format)if(u.preventDefault(),typeof u.clipboardData=="undefined"){M&&console.warn("unable to use e.clipboardData"),M&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var v=J[P.format]||J.default;window.clipboardData.setData(v,C)}else u.clipboardData.clearData(),u.clipboardData.setData(P.format,C);P.onCopy&&(u.preventDefault(),P.onCopy(u.clipboardData))}),document.body.appendChild(g),A.selectNodeContents(g),f.addRange(A);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");h=!0}catch(u){M&&console.error("unable to copy using execCommand: ",u),M&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(P.format||"text",C),P.onCopy&&P.onCopy(window.clipboardData),h=!0}catch(v){M&&console.error("unable to copy using clipboardData: ",v),M&&console.error("falling back to prompt"),e=N("message"in P?P.message:V),window.prompt(e,C)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(A):f.removeAllRanges()),g&&document.body.removeChild(g),I()}return h}He.exports=L},67631:function(He){typeof window!="undefined"&&function(K,Z){He.exports=Z()}(this,()=>(()=>{var ye={"./src/config.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{enableStreamingMode:()=>n,hlsDefaultConfig:()=>S,mergeConfig:()=>r});var C=L("./src/controller/abr-controller.ts"),P=L("./src/controller/audio-stream-controller.ts"),M=L("./src/controller/audio-track-controller.ts"),e=L("./src/controller/subtitle-stream-controller.ts"),I=L("./src/controller/subtitle-track-controller.ts"),A=L("./src/controller/buffer-controller.ts"),f=L("./src/controller/timeline-controller.ts"),g=L("./src/controller/cap-level-controller.ts"),h=L("./src/controller/fps-controller.ts"),p=L("./src/controller/eme-controller.ts"),u=L("./src/controller/cmcd-controller.ts"),v=L("./src/utils/xhr-loader.ts"),m=L("./src/utils/fetch-loader.ts"),o=L("./src/utils/cues.ts"),a=L("./src/utils/mediakeys-helper.ts"),i=L("./src/utils/logger.ts");function s(){return s=Object.assign?Object.assign.bind():function(t){for(var l=1;l{"use strict";L.r(N),L.d(N,{default:()=>v});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/ewma-bandwidth-estimator.ts"),M=L("./src/events.ts"),e=L("./src/errors.ts"),I=L("./src/types/loader.ts"),A=L("./src/utils/logger.ts");function f(m,o){for(var a=0;ax;F--){var G=l[F].maxBitrate;if(k=_?R*G/(8*.8*_):R*G/t,k=D||(A.logger.warn("Fragment "+i.sn+(s?" part "+s.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+` Current BW estimate: `+((0,C.isFiniteNumber)(t)?(t/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+D.toFixed(3)+` s Estimated load time for the next fragment: `+k.toFixed(3)+` s Time to underbuffer: `+O.toFixed(3)+" s"),E.nextLoadLevel=F,n&&this.bwEstimator.sample(w,T.loaded),this.clearTimer(),(i.loader||i.keyLoader)&&(this.fragCurrent=this.partCurrent=null,i.abortRequests()),E.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:s,stats:T}))}}}}}},o.onFragLoaded=function(i,s){var E=s.frag,b=s.part;if(E.type===I.PlaylistLevelType.MAIN&&(0,C.isFiniteNumber)(E.sn)){var d=b?b.stats:E.stats,T=b?b.duration:E.duration;if(this.clearTimer(),this.lastLoadedFragLevel=E.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var R=this.hls.levels[E.level],S=(R.loaded?R.loaded.bytes:0)+d.loaded,w=(R.loaded?R.loaded.duration:0)+T;R.loaded={bytes:S,duration:w},R.realBitrate=Math.round(8*S/w)}if(E.bitrateTest){var r={stats:d,frag:E,part:b,id:E.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,r)}}},o.onFragBuffered=function(i,s){var E=s.frag,b=s.part,d=b?b.stats:E.stats;if(!d.aborted&&!(E.type!==I.PlaylistLevelType.MAIN||E.sn==="initSegment")){var T=d.parsing.end-d.loading.start;this.bwEstimator.sample(T,d.loaded),d.bwEstimate=this.bwEstimator.getEstimate(),E.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0}},o.onError=function(i,s){var E;if(((E=s.frag)===null||E===void 0?void 0:E.type)===I.PlaylistLevelType.MAIN){if(s.type===e.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(s.details){case e.ErrorDetails.FRAG_LOAD_ERROR:case e.ErrorDetails.FRAG_LOAD_TIMEOUT:case e.ErrorDetails.KEY_LOAD_ERROR:case e.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var i=this.fragCurrent,s=this.partCurrent,E=this.hls,b=E.maxAutoLevel,d=E.config,T=E.minAutoLevel,R=E.media,S=s?s.duration:i?i.duration:0,w=R&&R.playbackRate!==0?Math.abs(R.playbackRate):1,r=this.bwEstimator?this.bwEstimator.getEstimate():d.abrEwmaDefaultEstimate,n=E.mainForwardBufferInfo,t=(n?n.len:0)/w,l=this.findBestLevel(r,T,b,t,d.abrBandWidthFactor,d.abrBandWidthUpFactor);if(l>=0)return l;A.logger.trace((t?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=S?Math.min(S,d.maxStarvationDelay):d.maxStarvationDelay,y=d.abrBandWidthFactor,c=d.abrBandWidthUpFactor;if(!t){var _=this.bitrateTestDelay;if(_){var D=S?Math.min(S,d.maxLoadingDelay):d.maxLoadingDelay;x=D-_,A.logger.trace("bitrate test took "+Math.round(1e3*_)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),y=c=1}}return l=this.findBestLevel(r,T,b,t+x,y,c),Math.max(l,0)},o.findBestLevel=function(i,s,E,b,d,T){for(var R,S=this.fragCurrent,w=this.partCurrent,r=this.lastLoadedFragLevel,n=this.hls.levels,t=n[r],l=!!(t!=null&&(R=t.details)!==null&&R!==void 0&&R.live),x=t==null?void 0:t.codecSet,y=w?w.duration:S?S.duration:0,c=E;c>=s;c--){var _=n[c];if(!(!_||x&&_.codecSet!==x)){var D=_.details,O=(w?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||y,k=void 0;c<=r?k=d*i:k=T*i;var F=n[c].maxBitrate,G=F*O/k;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+c+"/"+Math.round(k)+"/"+F+"/"+O+"/"+b+"/"+G),k>F&&(G===0||!(0,C.isFiniteNumber)(G)||l&&!this.bitrateTestDelay||G{"use strict";L.r(N),L.d(N,{default:()=>d});var C=L("./src/polyfills/number.ts"),P=L("./src/controller/base-stream-controller.ts"),M=L("./src/events.ts"),e=L("./src/utils/buffer-helper.ts"),I=L("./src/controller/fragment-tracker.ts"),A=L("./src/types/level.ts"),f=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),h=L("./src/demux/chunk-cache.ts"),p=L("./src/demux/transmuxer-interface.ts"),u=L("./src/types/transmuxer.ts"),v=L("./src/controller/fragment-finders.ts"),m=L("./src/utils/discontinuities.ts"),o=L("./src/errors.ts");function a(){return a=Object.assign?Object.assign.bind():function(T){for(var R=1;R0&&r===-1?(this.log("Override startPosition with lastCurrentTime @"+n.toFixed(3)),r=n,this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()},S.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var r,n=this.levels,t=this.trackId,l=n==null||(r=n[t])===null||r===void 0?void 0:r.details;if(l){if(this.waitForCdnTuneIn(l))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var x,y=performance.now(),c=this.retryDate;(!c||y>=c||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var _=this.waitingData;if(_){var D=_.frag,O=_.part,k=_.cache,F=_.complete;if(this.initPTS[D.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var G=k.flush(),H={frag:D,part:O,payload:G,networkDetails:null};this._handleFragmentLoadProgress(H),F&&T.prototype._handleFragmentLoadComplete.call(this,H)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+D.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var j=this.getLoadPosition(),Q=e.BufferHelper.bufferInfo(this.mediaBuffer,j,this.config.maxBufferHole),ee=(0,v.fragmentWithinToleranceTest)(Q.end,this.config.maxFragLookUpTolerance,D);ee<0&&(this.log("Waiting fragment cc ("+D.cc+") @ "+D.start+" cancelled because another fragment at "+Q.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},S.clearWaitingFragment=function(){var r=this.waitingData;r&&(this.fragmentTracker.removeFragment(r.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},S.resetLoadingState=function(){this.clearWaitingFragment(),T.prototype.resetLoadingState.call(this)},S.onTickEnd=function(){var r=this.media;!r||!r.readyState||(this.lastCurrentTime=r.currentTime)},S.doTickIdle=function(){var r=this.hls,n=this.levels,t=this.media,l=this.trackId,x=r.config;if(!(!n||!n[l])&&!(!t&&(this.startFragRequested||!x.startFragPrefetch))){var y=n[l],c=y.details;if(!c||c.live&&this.levelLastLoaded!==l||this.waitForCdnTuneIn(c)){this.state=P.State.WAITING_TRACK;return}var _=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&_&&(this.bufferFlushed=!1,this.afterBufferFlushed(_,g.ElementaryStreamTypes.AUDIO,f.PlaylistLevelType.AUDIO));var D=this.getFwdBufferInfo(_,f.PlaylistLevelType.AUDIO);if(D!==null){var O=this.audioSwitch;if(!O&&this._streamEnded(D,c)){r.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var k=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,f.PlaylistLevelType.MAIN),F=D.len,G=this.getMaxBufferLength(k==null?void 0:k.len);if(!(F>=G&&!O)){var H=c.fragments,j=H[0].start,Q=D.end;if(O&&t){var ee=this.getLoadPosition();Q=ee,c.PTSKnown&&eej||D.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),t.currentTime=j+.05)}if(!(k&&Q>k.end+c.targetduration)&&!((!k||!k.len)&&D.len)){var ie=this.getNextFragment(Q,c);if(!ie){this.bufferFlushed=!0;return}this.loadFragment(ie,c,Q)}}}}},S.getMaxBufferLength=function(r){var n=T.prototype.getMaxBufferLength.call(this);return r?Math.max(n,r):n},S.onMediaDetaching=function(){this.videoBuffer=null,T.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(r,n){var t=n.audioTracks;this.resetTransmuxer(),this.levels=t.map(function(l){return new A.Level(l)})},S.onAudioTrackSwitching=function(r,n){var t=!!n.url;this.trackId=n.id;var l=this.fragCurrent;l&&l.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),t?this.setInterval(E):this.resetTransmuxer(),t?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(r,n){this.mainDetails=n.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},S.onAudioTrackLoaded=function(r,n){var t;if(this.mainDetails==null){this.cachedTrackLoadedData=n;return}var l=this.levels,x=n.details,y=n.id;if(!l){this.warn("Audio tracks were reset while loading level "+y);return}this.log("Track "+y+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var c=l[y],_=0;if(x.live||(t=c.details)!==null&&t!==void 0&&t.live){var D=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!D)return;!c.details&&x.hasProgramDateTime&&D.hasProgramDateTime?((0,m.alignMediaPlaylistByPDT)(x,D),_=x.fragments[0].start):_=this.alignPlaylists(x,c.details)}c.details=x,this.levelLastLoaded=y,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(c.details,_),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=P.State.IDLE),this.tick()},S._handleFragmentLoadProgress=function(r){var n,t=r.frag,l=r.part,x=r.payload,y=this.config,c=this.trackId,_=this.levels;if(!_){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+t.sn+" of level "+t.level+" will not be buffered");return}var D=_[c];console.assert(D,"Audio track is defined on fragment load progress");var O=D.details;console.assert(O,"Audio track details are defined on fragment load progress");var k=y.defaultAudioCodec||D.audioCodec||"mp4a.40.2",F=this.transmuxer;F||(F=this.transmuxer=new p.default(this.hls,f.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var G=this.initPTS[t.cc],H=(n=t.initSegment)===null||n===void 0?void 0:n.data;if(G!==void 0){var j=!1,Q=l?l.index:-1,ee=Q!==-1,ie=new u.ChunkMetadata(t.level,t.sn,t.stats.chunkCount,x.byteLength,Q,ee);F.push(x,H,k,"",t,l,O.totalduration,j,ie,G)}else{this.log("Unknown video PTS for cc "+t.cc+", waiting for video PTS before demuxing audio frag "+t.sn+" of ["+O.startSN+" ,"+O.endSN+"],track "+c);var se=this.waitingData=this.waitingData||{frag:t,part:l,cache:new h.default,complete:!1},le=se.cache;le.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},S._handleFragmentLoadComplete=function(r){if(this.waitingData){this.waitingData.complete=!0;return}T.prototype._handleFragmentLoadComplete.call(this,r)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(r,n){var t=n.tracks.audio;t&&(this.mediaBuffer=t.buffer||null),n.tracks.video&&(this.videoBuffer=n.tracks.video.buffer||null)},S.onFragBuffered=function(r,n){var t=n.frag,l=n.part;if(t.type!==f.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&t.type===f.PlaylistLevelType.MAIN){var x;(x=this.videoBuffer||this.media)!==null&&x!==void 0&&x.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(t)){this.warn("Fragment "+t.sn+(l?" p: "+l.index:"")+" of level "+t.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}t.sn!=="initSegment"&&(this.fragPrevious=t,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(t,l)},S.onError=function(r,n){if(n.type===o.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(f.PlaylistLevelType.AUDIO,n);return}switch(n.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.FRAG_PARSING_ERROR:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f.PlaylistLevelType.AUDIO,n);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=n.fatal?P.State.ERROR:P.State.IDLE,this.warn(n.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(n.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var t=!0,l=this.getFwdBufferInfo(this.mediaBuffer,f.PlaylistLevelType.AUDIO);l&&l.len>.5&&(t=!this.reduceMaxBufferLength(l.len)),t&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},S.onBufferFlushed=function(r,n){var t=n.type;t===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===P.State.ENDED&&(this.state=P.State.IDLE))},S._handleTransmuxComplete=function(r){var n,t="audio",l=this.hls,x=r.remuxResult,y=r.chunkMeta,c=this.getCurrentContext(y);if(!c){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(y.level);return}var _=c.frag,D=c.part,O=c.level.details,k=x.audio,F=x.text,G=x.id3,H=x.initSegment;if(!(this.fragContextChanged(_)||!O)){if(this.state=P.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),H!=null&&H.tracks&&(this._bufferInitSegment(H.tracks,_,y),l.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:t,tracks:H.tracks})),k){var j=k.startPTS,Q=k.endPTS,ee=k.startDTS,ie=k.endDTS;D&&(D.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:j,endPTS:Q,startDTS:ee,endDTS:ie}),_.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,j,Q,ee,ie),this.bufferFragmentData(k,_,D,y)}if(G!=null&&(n=G.samples)!==null&&n!==void 0&&n.length){var se=a({id:t,frag:_,details:O},G);l.trigger(M.Events.FRAG_PARSING_METADATA,se)}if(F){var le=a({id:t,frag:_,details:O},F);l.trigger(M.Events.FRAG_PARSING_USERDATA,le)}}},S._bufferInitSegment=function(r,n,t){if(this.state===P.State.PARSING){r.video&&delete r.video;var l=r.audio;if(l){l.levelCodec=l.codec,l.id="audio",this.log("Init audio buffer, container:"+l.container+", codecs[parsed]=["+l.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,r);var x=l.initSegment;if(x!=null&&x.byteLength){var y={type:"audio",frag:n,part:null,chunkMeta:t,parent:n.type,data:x};this.hls.trigger(M.Events.BUFFER_APPENDING,y)}this.tick()}}},S.loadFragment=function(r,n,t){var l=this.fragmentTracker.getState(r);this.fragCurrent=r,(this.audioSwitch||l===I.FragmentState.NOT_LOADED||l===I.FragmentState.PARTIAL)&&(r.sn==="initSegment"?this._loadInitSegment(r,n):n.live&&!(0,C.isFiniteNumber)(this.initPTS[r.cc])?(this.log("Waiting for video PTS in continuity counter "+r.cc+" of live stream before loading audio fragment "+r.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,r,n,t)))},S.completeAudioSwitch=function(){var r=this.hls,n=this.media,t=this.trackId;n&&(this.log("Switching audio track : flushing all audio"),T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,r.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:t})},R}(P.default);const d=b},"./src/controller/audio-track-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>v});var C=L("./src/events.ts"),P=L("./src/errors.ts"),M=L("./src/controller/base-playlist-controller.ts"),e=L("./src/types/loader.ts");function I(m,o){for(var a=0;a=E.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var b=E[this.trackId];this.log("Now switching to audio-track index "+s);var d=E[s],T=d.id,R=d.groupId,S=R===void 0?"":R,w=d.name,r=d.type,n=d.url;if(this.trackId=s,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(C.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:S,name:w,type:r,url:n}),!(d.details&&!d.details.live)){var t=this.switchParams(d.url,b==null?void 0:b.details);this.loadPlaylist(t)}},a.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var E=this.trackName,b=this.findTrackId(E)||this.findTrackId();b!==-1?this.setAudioTrack(b):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(C.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(s){for(var E=this.tracksInGroup,b=0;b{"use strict";L.r(N),L.d(N,{default:()=>I});var C=L("./src/types/level.ts"),P=L("./src/controller/level-helper.ts"),M=L("./src/utils/logger.ts"),e=L("./src/errors.ts"),I=function(){function A(g,h){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=M.logger.log.bind(M.logger,h+":"),this.warn=M.logger.warn.bind(M.logger,h+":"),this.hls=g}var f=A.prototype;return f.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},f.onError=function(h,p){p.fatal&&(p.type===e.ErrorTypes.NETWORK_ERROR||p.type===e.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},f.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},f.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},f.stopLoad=function(){this.canLoad=!1,this.clearTimer()},f.switchParams=function(h,p){var u=p==null?void 0:p.renditionReports;if(u)for(var v=0;v=0&&s>p.partTarget&&(i+=1)}return new C.HlsUrlParameters(a,i>=0?i:void 0,C.HlsSkip.No)}}},f.loadPlaylist=function(h){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},f.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},f.playlistLoaded=function(h,p,u){var v=this,m=p.details,o=p.stats,a=self.performance.now(),i=o.loading.first?Math.max(0,a-o.loading.first):0;if(m.advancedDateTime=Date.now()-i,m.live||u!=null&&u.live){if(m.reloaded(u),u&&this.log("live playlist "+h+" "+(m.advanced?"REFRESHED "+m.lastPartSn+"-"+m.lastPartIndex:"MISSED")),u&&m.fragments.length>0&&(0,P.mergeDetails)(u,m),!this.canLoad||!m.live)return;var s,E=void 0,b=void 0;if(m.canBlockReload&&m.endSN&&m.advanced){var d=this.hls.config.lowLatencyMode,T=m.lastPartSn,R=m.endSN,S=m.lastPartIndex,w=S!==-1,r=T===R,n=d?0:S;w?(E=r?R+1:T,b=r?n:S+1):E=R+1;var t=m.age,l=t+m.ageHeader,x=Math.min(l-m.partTarget,m.targetduration*1.5);if(x>0){if(u&&x>u.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+u.tuneInGoal+" to: "+x+" with playlist age: "+m.age),x=0;else{var y=Math.floor(x/m.targetduration);if(E+=y,b!==void 0){var c=Math.round(x%m.targetduration/m.partTarget);b+=c}this.log("CDN Tune-in age: "+m.ageHeader+"s last advanced "+t.toFixed(2)+"s goal: "+x+" skip sn "+y+" to part "+b)}m.tuneInGoal=x}if(s=this.getDeliveryDirectives(m,p.deliveryDirectives,E,b),d||!r){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(m,p.deliveryDirectives,E,b);var _=this.hls.mainForwardBufferInfo,D=_?_.end-_.len:0,O=(m.edge-D)*1e3,k=(0,P.computeReloadInterval)(m,O);m.updated?a>this.requestScheduled+k&&(this.requestScheduled=o.loading.start):this.requestScheduled=-1,E!==void 0&&m.canBlockReload?this.requestScheduled=o.loading.first+k-(m.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?a:this.requestScheduled)+k;var F=this.requestScheduled-a;F=Math.max(0,F),this.log("reload live playlist "+h+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return v.loadPlaylist(s)},F)}else this.clearTimer()},f.getDeliveryDirectives=function(h,p,u,v){var m=(0,C.getSkipValue)(h,u);return p!=null&&p.skip&&h.deltaUpdateFailed&&(u=p.msn,v=p.part,m=C.HlsSkip.No),new C.HlsUrlParameters(u,v,m)},f.retryLoadingOrFail=function(h){var p=this,u=this.hls.config,v=this.retryCount-1&&(m=h.context)!==null&&m!==void 0&&m.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return v},A}()},"./src/controller/base-stream-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{State:()=>w,default:()=>r});var C=L("./src/polyfills/number.ts"),P=L("./src/task-loop.ts"),M=L("./src/controller/fragment-tracker.ts"),e=L("./src/utils/buffer-helper.ts"),I=L("./src/utils/logger.ts"),A=L("./src/events.ts"),f=L("./src/errors.ts"),g=L("./src/types/transmuxer.ts"),h=L("./src/utils/mp4-tools.ts"),p=L("./src/utils/discontinuities.ts"),u=L("./src/controller/fragment-finders.ts"),v=L("./src/controller/level-helper.ts"),m=L("./src/loader/fragment-loader.ts"),o=L("./src/crypt/decrypter.ts"),a=L("./src/utils/time-ranges.ts"),i=L("./src/types/loader.ts");function s(n,t){for(var l=0;lF.end){var Q=k>j;(k0&&F&&F.key&&F.iv&&F.method==="AES-128"){var G=self.performance.now();return _.decrypter.decrypt(new Uint8Array(k),F.key.buffer,F.iv.buffer).then(function(H){var j=self.performance.now();return O.trigger(A.Events.FRAG_DECRYPTED,{frag:y,payload:H,stats:{tstart:G,tdecrypt:j}}),D.payload=H,D})}return D}).then(function(D){var O=_.fragCurrent,k=_.hls,F=_.levels;if(!F)throw new Error("init load aborted, missing levels");var G=F[y.level].details;console.assert(G,"Level details are defined when init segment is loaded");var H=y.stats;_.state=w.IDLE,_.fragLoadError=0,y.data=new Uint8Array(D.payload),H.parsing.start=H.buffering.start=self.performance.now(),H.parsing.end=H.buffering.end=self.performance.now(),D.frag===O&&k.trigger(A.Events.FRAG_BUFFERED,{stats:H,frag:O,part:null,id:y.type}),_.tick()}).catch(function(D){_.state===w.STOPPED||_.state===w.ERROR||(_.warn(D),_.resetFragmentLoading(y))})},l.fragContextChanged=function(y){var c=this.fragCurrent;return!y||!c||y.level!==c.level||y.sn!==c.sn||y.urlId!==c.urlId},l.fragBufferedComplete=function(y,c){var _,D,O,k,F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(c?" part: "+c.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" (frag:["+((_=y.startPTS)!=null?_:NaN).toFixed(3)+"-"+((D=y.endPTS)!=null?D:NaN).toFixed(3)+"] > buffer:"+(F?a.default.toString(e.BufferHelper.getBuffered(F)):"(detached)")+")"),this.state=w.IDLE,F&&(!this.loadedmetadata&&y.type==i.PlaylistLevelType.MAIN&&F.buffered.length&&((O=this.fragCurrent)===null||O===void 0?void 0:O.sn)===((k=this.fragPrevious)===null||k===void 0?void 0:k.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},l.seekToStartPos=function(){},l._handleFragmentLoadComplete=function(y){var c=this.transmuxer;if(c){var _=y.frag,D=y.part,O=y.partsLoaded,k=!O||O.length===0||O.some(function(G){return!G}),F=new g.ChunkMetadata(_.level,_.sn,_.stats.chunkCount+1,0,D?D.index:-1,!k);c.flush(F)}},l._handleFragmentLoadProgress=function(y){},l._doFragLoad=function(y,c,_,D){var O,k=this;if(_===void 0&&(_=null),!this.levels)throw new Error("frag load aborted, missing levels");var F=null;if(y.encrypted&&!((O=y.decryptdata)!==null&&O!==void 0&&O.key)?(this.log("Loading key for "+y.sn+" of ["+c.startSN+"-"+c.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=w.KEY_LOADING,this.fragCurrent=y,F=this.keyLoader.load(y).then(function(ee){if(!k.fragContextChanged(ee.frag))return k.hls.trigger(A.Events.KEY_LOADED,ee),k.state===w.KEY_LOADING&&(k.state=w.IDLE),ee}),this.hls.trigger(A.Events.KEY_LOADING,{frag:y}),this.throwIfFragContextChanged("KEY_LOADING")):!y.encrypted&&c.encryptedFragments.length&&this.keyLoader.loadClear(y,c.encryptedFragments),_=Math.max(y.start,_||0),this.config.lowLatencyMode&&c){var G=c.partList;if(G&&D){_>y.end&&c.fragmentHint&&(y=c.fragmentHint);var H=this.getNextPart(G,y,_);if(H>-1){var j=G[H];return this.log("Loading part sn: "+y.sn+" p: "+j.index+" cc: "+y.cc+" of playlist ["+c.startSN+"-"+c.endSN+"] parts [0-"+H+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(_.toFixed(3))),this.nextLoadPosition=j.start+j.duration,this.state=w.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:y,part:G[H],targetBufferTime:_}),this.throwIfFragContextChanged("FRAG_LOADING parts"),F?F.then(function(ee){return!ee||k.fragContextChanged(ee.frag)?null:k.doFragPartsLoad(y,G,H,D)}).catch(function(ee){return k.handleFragLoadError(ee)}):this.doFragPartsLoad(y,G,H,D).catch(function(ee){return k.handleFragLoadError(ee)})}else if(!y.url||this.loadedEndOfParts(G,_))return Promise.resolve(null)}}this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(c?"of ["+c.startSN+"-"+c.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(_.toFixed(3))),(0,C.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=w.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:y,targetBufferTime:_}),this.throwIfFragContextChanged("FRAG_LOADING");var Q=this.config.progressive;return Q&&F?F.then(function(ee){return!ee||k.fragContextChanged(ee==null?void 0:ee.frag)?null:k.fragmentLoader.load(y,D)}).catch(function(ee){return k.handleFragLoadError(ee)}):Promise.all([this.fragmentLoader.load(y,Q?D:void 0),F]).then(function(ee){var ie=ee[0];return!Q&&ie&&D&&D(ie),ie}).catch(function(ee){return k.handleFragLoadError(ee)})},l.throwIfFragContextChanged=function(y){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+y)},l.doFragPartsLoad=function(y,c,_,D){var O=this;return new Promise(function(k,F){var G=[],H=function j(Q){var ee=c[Q];O.fragmentLoader.loadPart(y,ee,D).then(function(ie){G[ee.index]=ie;var se=ie.part;O.hls.trigger(A.Events.FRAG_LOADED,ie);var le=c[Q+1];if(le&&le.fragment===y)j(Q+1);else return k({frag:y,part:se,partsLoaded:G})}).catch(F)};H(_)})},l.handleFragLoadError=function(y){if("data"in y){var c=y.data;y.data&&c.details===f.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(c.frag,c.part):this.hls.trigger(A.Events.ERROR,c)}else this.hls.trigger(A.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,err:y,fatal:!0});return null},l._handleTransmuxerFlush=function(y){var c=this.getCurrentContext(y);if(!c||this.state!==w.PARSING){!this.fragCurrent&&this.state!==w.STOPPED&&this.state!==w.ERROR&&(this.state=w.IDLE);return}var _=c.frag,D=c.part,O=c.level,k=self.performance.now();_.stats.parsing.end=k,D&&(D.stats.parsing.end=k),this.updateLevelTiming(_,D,O,y.partial)},l.getCurrentContext=function(y){var c=this.levels,_=y.level,D=y.sn,O=y.part;if(!c||!c[_])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+_+". The current chunk will not be buffered."),null;var k=c[_],F=O>-1?(0,v.getPartWith)(k,D,O):null,G=F?F.fragment:(0,v.getFragmentWithSN)(k,D,this.fragCurrent);return G?{frag:G,part:F,level:k}:null},l.bufferFragmentData=function(y,c,_,D){if(!(!y||this.state!==w.PARSING)){var O=y.data1,k=y.data2,F=O;if(O&&k&&(F=(0,h.appendUint8Array)(O,k)),!(!F||!F.length)){var G={type:y.type,frag:c,part:_,chunkMeta:D,parent:c.type,data:F};this.hls.trigger(A.Events.BUFFER_APPENDING,G),y.dropped&&y.independent&&!_&&this.flushBufferGap(c)}}},l.flushBufferGap=function(y){var c=this.media;if(c){if(!e.BufferHelper.isBuffered(c,c.currentTime)){this.flushMainBuffer(0,y.start);return}var _=c.currentTime,D=e.BufferHelper.bufferInfo(c,_,0),O=y.duration,k=Math.min(this.config.maxFragLookUpTolerance*2,O*.25),F=Math.max(Math.min(y.start-k,D.end-k),_+k);y.start-F>k&&this.flushMainBuffer(F,y.start)}},l.getFwdBufferInfo=function(y,c){var _=this.config,D=this.getLoadPosition();if(!(0,C.isFiniteNumber)(D))return null;var O=e.BufferHelper.bufferInfo(y,D,_.maxBufferHole);if(O.len===0&&O.nextStart!==void 0){var k=this.fragmentTracker.getBufferedFrag(D,c);if(k&&O.nextStart=_?(c.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+c.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(y,c){var _=c.fragments,D=_.length;if(!D)return null;var O=this.config,k=_[0].start,F;if(c.live){var G=O.initialLiveManifestSize;if(D-1&&__.start&&_.loaded},l.getInitialLiveFragment=function(y,c){var _=this.fragPrevious,D=null;if(_){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+_.programDateTime),D=(0,u.findFragmentByPDT)(c,_.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var O=_.sn+1;if(O>=y.startSN&&O<=y.endSN){var k=c[O-y.startSN];_.cc===k.cc&&(D=k,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=(0,u.findFragWithCC)(c,_.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(D=this.getFragmentAtPosition(F,this.bitrateTest?y.fragmentEnd:y.edge,y))}return D},l.getFragmentAtPosition=function(y,c,_){var D=this.config,O=this.fragPrevious,k=_.fragments,F=_.endSN,G=_.fragmentHint,H=D.maxFragLookUpTolerance,j=!!(D.lowLatencyMode&&_.partList&&G);j&&G&&!this.bitrateTest&&(k=k.concat(G),F=G.sn);var Q;if(yc-H?0:H;Q=(0,u.findFragmentByPTS)(O,k,y,ee)}else Q=k[k.length-1];if(Q){var ie=Q.sn-_.startSN;if(this.fragmentTracker.getState(Q)===M.FragmentState.OK&&(O=Q),O&&Q.sn===O.sn&&!j){var se=O&&Q.level===O.level;if(se){var le=k[ie+1];Q.sn=k-c.maxFragLookUpTolerance&&O<=F;if(D!==null&&_.duration>D&&(O"+y.startSN+" prev-sn: "+(O?O.sn:"na")+" fragments: "+F),Q}return G},l.waitForCdnTuneIn=function(y){var c=3;return y.live&&y.canBlockReload&&y.partTarget&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*c)},l.setStartPosition=function(y,c){var _=this.startPosition;if(_"+y))}}]),t}(P.default)},"./src/controller/buffer-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>u});var C=L("./src/polyfills/number.ts"),P=L("./src/events.ts"),M=L("./src/utils/logger.ts"),e=L("./src/errors.ts"),I=L("./src/utils/buffer-helper.ts"),A=L("./src/utils/mediasource-helper.ts"),f=L("./src/loader/fragment.ts"),g=L("./src/controller/buffer-operation-queue.ts"),h=(0,A.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function v(o){var a=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var i=a.media,s=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),i&&(i.removeEventListener("emptied",a._onMediaEmptied),a.updateMediaElementDuration(),a.hls.trigger(P.Events.MEDIA_ATTACHED,{media:i})),s&&s.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var i=a.media,s=a._objectUrl;i&&i.src!==s&&M.logger.error("Media element src was set while attaching MediaSource ("+s+" > "+i.src+")")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var m=v.prototype;return m.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},m.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},m.registerListeners=function(){var a=this.hls;a.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(P.Events.BUFFER_RESET,this.onBufferReset,this),a.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(P.Events.BUFFER_EOS,this.onBufferEos,this),a.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(P.Events.FRAG_PARSED,this.onFragParsed,this),a.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},m.unregisterListeners=function(){var a=this.hls;a.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(P.Events.BUFFER_RESET,this.onBufferReset,this),a.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(P.Events.BUFFER_EOS,this.onBufferEos,this),a.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(P.Events.FRAG_PARSED,this.onFragParsed,this),a.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},m._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},m.onManifestParsed=function(a,i){var s=2;(i.audio&&!i.video||!i.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},m.onMediaAttaching=function(a,i){var s=this.media=i.media;if(s&&h){var E=this.mediaSource=new h;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(E),this._objectUrl=s.src,s.addEventListener("emptied",this._onMediaEmptied)}},m.onMediaDetaching=function(){var a=this.media,i=this.mediaSource,s=this._objectUrl;if(i){if(M.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(E){M.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(a.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},m.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(i){var s=a.sourceBuffer[i];try{s&&(a.removeBufferListeners(i),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[i]=void 0)}catch(E){M.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",E)}}),this._initSourceBuffer()},m.onBufferCodecs=function(a,i){var s=this,E=this.getSourceBufferTypes().length;Object.keys(i).forEach(function(b){if(E){var d=s.tracks[b];if(d&&typeof d.buffer.changeType=="function"){var T=i[b],R=T.id,S=T.codec,w=T.levelCodec,r=T.container,n=T.metadata,t=(d.levelCodec||d.codec).replace(p,"$1"),l=(w||S).replace(p,"$1");if(t!==l){var x=r+";codecs="+(w||S);s.appendChangeType(b,x),M.logger.log("[buffer-controller]: switching codec "+t+" to "+l),s.tracks[b]={buffer:d.buffer,codec:S,container:r,levelCodec:w,metadata:n,id:R}}}}else s.pendingTracks[b]=i[b]}),!E&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},m.appendChangeType=function(a,i){var s=this,E=this.operationQueue,b={execute:function(){var T=s.sourceBuffer[a];T&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+i),T.changeType(i)),E.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(T){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",T)}};E.append(b,a)},m.onBufferAppending=function(a,i){var s=this,E=this.hls,b=this.operationQueue,d=this.tracks,T=i.data,R=i.type,S=i.frag,w=i.part,r=i.chunkMeta,n=r.buffering[R],t=self.performance.now();n.start=t;var l=S.stats.buffering,x=w?w.stats.buffering:null;l.start===0&&(l.start=t),x&&x.start===0&&(x.start=t);var y=d.audio,c=!1;R==="audio"&&(y==null?void 0:y.container)==="audio/mpeg"&&(c=!this.lastMpegAudioChunk||r.id===1||this.lastMpegAudioChunk.sn!==r.sn,this.lastMpegAudioChunk=r);var _=S.start,D={execute:function(){if(n.executeStart=self.performance.now(),c){var k=s.sourceBuffer[R];if(k){var F=_-k.timestampOffset;Math.abs(F)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_+" (delta: "+F+") sn: "+S.sn+")"),k.timestampOffset=_)}}s.appendExecutor(T,R)},onStart:function(){},onComplete:function(){var k=self.performance.now();n.executeEnd=n.end=k,l.first===0&&(l.first=k),x&&x.first===0&&(x.first=k);var F=s.sourceBuffer,G={};for(var H in F)G[H]=I.BufferHelper.getBuffered(F[H]);s.appendError=0,s.hls.trigger(P.Events.BUFFER_APPENDED,{type:R,frag:S,part:w,chunkMeta:r,parent:S.type,timeRanges:G})},onError:function(k){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" SourceBuffer",k);var F={type:e.ErrorTypes.MEDIA_ERROR,parent:S.type,details:e.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=e.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,F.details=e.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>E.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0,E.stopLoad())),E.trigger(P.Events.ERROR,F)}};b.append(D,R)},m.onBufferFlushing=function(a,i){var s=this,E=this.operationQueue,b=function(T){return{execute:s.removeExecutor.bind(s,T,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(P.Events.BUFFER_FLUSHED,{type:T})},onError:function(S){M.logger.warn("[buffer-controller]: Failed to remove from "+T+" SourceBuffer",S)}}};i.type?E.append(b(i.type),i.type):this.getSourceBufferTypes().forEach(function(d){E.append(b(d),d)})},m.onFragParsed=function(a,i){var s=this,E=i.frag,b=i.part,d=[],T=b?b.elementaryStreams:E.elementaryStreams;T[f.ElementaryStreamTypes.AUDIOVIDEO]?d.push("audiovideo"):(T[f.ElementaryStreamTypes.AUDIO]&&d.push("audio"),T[f.ElementaryStreamTypes.VIDEO]&&d.push("video"));var R=function(){var w=self.performance.now();E.stats.buffering.end=w,b&&(b.stats.buffering.end=w);var r=b?b.stats:E.stats;s.hls.trigger(P.Events.FRAG_BUFFERED,{frag:E,part:b,stats:r,id:E.type})};d.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(R,d)},m.onFragChanged=function(a,i){this.flushBackBuffer()},m.onBufferEos=function(a,i){var s=this,E=this.getSourceBufferTypes().reduce(function(b,d){var T=s.sourceBuffer[d];return T&&(!i.type||i.type===d)&&(T.ending=!0,T.ended||(T.ended=!0,M.logger.log("[buffer-controller]: "+d+" sourceBuffer now EOS"))),b&&!!(!T||T.ended)},!0);E&&(M.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){s.getSourceBufferTypes().forEach(function(d){var T=s.sourceBuffer[d];T&&(T.ending=!1)});var b=s.mediaSource;if(!b||b.readyState!=="open"){b&&M.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+b.readyState);return}M.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),b.endOfStream()}))},m.onLevelUpdated=function(a,i){var s=i.details;s.fragments.length&&(this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},m.flushBackBuffer=function(){var a=this.hls,i=this.details,s=this.media,E=this.sourceBuffer;if(!(!s||i===null)){var b=this.getSourceBufferTypes();if(b.length){var d=i.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!(!(0,C.isFiniteNumber)(d)||d<0)){var T=s.currentTime,R=i.levelTargetDuration,S=Math.max(d,R),w=Math.floor(T/R)*R-S;b.forEach(function(r){var n=E[r];if(n){var t=I.BufferHelper.getBuffered(n);if(t.length>0&&w>t.start(0)){if(a.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:w}),i.live)a.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:w});else if(n.ended&&t.end(t.length-1)-TT&&b>d||!(0,C.isFiniteNumber)(d))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+b.toFixed(3)),E.duration=b)}},m.updateSeekableRange=function(a){var i=this.mediaSource,s=a.fragments,E=s.length;if(E&&a.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var b=Math.max(0,s[0].start),d=Math.max(b,b+a.totalduration);i.setLiveSeekableRange(b,d)}},m.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,i=this.operationQueue,s=this.pendingTracks,E=Object.keys(s).length;if(E&&!a||E===2){this.createSourceBuffers(s),this.pendingTracks={};var b=this.getSourceBufferTypes();if(b.length===0){this.hls.trigger(P.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}b.forEach(function(d){i.executeNext(d)})}},m.createSourceBuffers=function(a){var i=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var b in a)if(!i[b]){var d=a[b];if(!d)throw Error("source buffer exists for track "+b+", however track does not");var T=d.levelCodec||d.codec,R=d.container+";codecs="+T;M.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var S=i[b]=s.addSourceBuffer(R),w=b;this.addBufferListener(w,"updatestart",this._onSBUpdateStart),this.addBufferListener(w,"updateend",this._onSBUpdateEnd),this.addBufferListener(w,"error",this._onSBUpdateError),this.tracks[b]={buffer:S,codec:T,container:d.container,levelCodec:d.levelCodec,metadata:d.metadata,id:d.id},E++}catch(r){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+r.message),this.hls.trigger(P.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:r,mimeType:R})}}E&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},m._onSBUpdateStart=function(a){var i=this.operationQueue,s=i.current(a);s.onStart()},m._onSBUpdateEnd=function(a){var i=this.operationQueue,s=i.current(a);s.onComplete(),i.shiftAndExecuteNext(a)},m._onSBUpdateError=function(a,i){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",i),this.hls.trigger(P.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(i)},m.removeExecutor=function(a,i,s){var E=this.media,b=this.mediaSource,d=this.operationQueue,T=this.sourceBuffer,R=T[a];if(!E||!b||!R){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(a);return}var S=(0,C.isFiniteNumber)(E.duration)?E.duration:1/0,w=(0,C.isFiniteNumber)(b.duration)?b.duration:1/0,r=Math.max(0,i),n=Math.min(s,S,w);n>r&&!R.ending?(R.ended=!1,M.logger.log("[buffer-controller]: Removing ["+r+","+n+"] from the "+a+" SourceBuffer"),console.assert(!R.updating,a+" sourceBuffer must not be updating"),R.remove(r,n)):d.shiftAndExecuteNext(a)},m.appendExecutor=function(a,i){var s=this.operationQueue,E=this.sourceBuffer,b=E[i];if(!b){M.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(i);return}b.ended=!1,console.assert(!b.updating,i+" sourceBuffer must not be updating"),b.appendBuffer(a)},m.blockBuffers=function(a,i){var s=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(a);return}var E=this.operationQueue,b=i.map(function(d){return E.appendBlocker(d)});Promise.all(b).then(function(){a(),i.forEach(function(d){var T=s.sourceBuffer[d];(!T||!T.updating)&&E.shiftAndExecuteNext(d)})})},m.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},m.addBufferListener=function(a,i,s){var E=this.sourceBuffer[a];if(E){var b=s.bind(this,a);this.listeners[a].push({event:i,listener:b}),E.addEventListener(i,b)}},m.removeBufferListeners=function(a){var i=this.sourceBuffer[a];i&&this.listeners[a].forEach(function(s){i.removeEventListener(s.event,s.listener)})},v}()},"./src/controller/buffer-operation-queue.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C=L("./src/utils/logger.ts"),P=function(){function M(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var e=M.prototype;return e.append=function(A,f){var g=this.queues[f];g.push(A),g.length===1&&this.buffers[f]&&this.executeNext(f)},e.insertAbort=function(A,f){var g=this.queues[f];g.unshift(A),this.executeNext(f)},e.appendBlocker=function(A){var f,g=new Promise(function(p){f=p}),h={execute:f,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,A),g},e.executeNext=function(A){var f=this.buffers,g=this.queues,h=f[A],p=g[A];if(p.length){var u=p[0];try{u.execute()}catch(v){C.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(v),(!h||!h.updating)&&(p.shift(),this.executeNext(A))}}},e.shiftAndExecuteNext=function(A){this.queues[A].shift(),this.executeNext(A)},e.current=function(A){return this.queues[A][0]},M}()},"./src/controller/cap-level-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>f});var C=L("./src/events.ts");function P(g,h){for(var p=0;p0&&this.mediaWidth>0){var u=this.hls.levels;if(u.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(u.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},h.getMaxLevel=function(u){var v=this,m=this.hls.levels;if(!m.length)return-1;var o=m.filter(function(a,i){return g.isLevelAllowed(i,v.restrictedLevels)&&i<=u});return this.clientRect=null,g.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},h.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},h.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},h.getDimensions=function(){if(this.clientRect)return this.clientRect;var u=this.media,v={width:0,height:0};if(u){var m=u.getBoundingClientRect();v.width=m.width,v.height=m.height,!v.width&&!v.height&&(v.width=m.right-m.left||u.width||0,v.height=m.bottom-m.top||u.height||0)}return this.clientRect=v,v},g.isLevelAllowed=function(u,v){return v===void 0&&(v=[]),v.indexOf(u)===-1},g.getMaxLevelByMediaSize=function(u,v,m){if(!u||!u.length)return-1;for(var o=function(b,d){return d?b.width!==d.width||b.height!==d.height:!0},a=u.length-1,i=0;i=v||s.height>=m)&&o(s,u[i+1])){a=i;break}}return a},M(g,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var u=1;if(!this.hls.config.ignoreDevicePixelRatio)try{u=self.devicePixelRatio}catch(v){}return u}}]),g}();const f=A},"./src/controller/cmcd-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>m});var C=L("./src/events.ts"),P=L("./src/types/cmcd.ts"),M=L("./src/utils/buffer-helper.ts"),e=L("./src/utils/logger.ts");function I(o,a){for(var i=0;i=o.length?{done:!0}:{done:!1,value:o[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(o,a){if(o){if(typeof o=="string")return u(o,a);var i=Object.prototype.toString.call(o).slice(8,-1);if(i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set")return Array.from(o);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return u(o,a)}}function u(o,a){(a==null||a>o.length)&&(a=o.length);for(var i=0,s=new Array(a);i-1?T+1:d.levels.length;b=d.levels.slice(0,R)}for(var S=h(b),w;!(w=S()).done;){var r=w.value;r.bitrate>E&&(E=r.bitrate)}return E>0?E:NaN},a.getBufferLength=function(s){var E=this.hls.media,b=s===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!b||!E)return NaN;var d=M.BufferHelper.bufferInfo(b,E.currentTime,this.config.maxBufferHole);return d.len*1e3},a.createPlaylistLoader=function(){var s=this.config.pLoader,E=this.applyPlaylistData,b=s||this.config.loader;return function(){function d(R){this.loader=void 0,this.loader=new b(R)}var T=d.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(S,w,r){E(S),this.loader.load(S,w,r)},A(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},a.createFragmentLoader=function(){var s=this.config.fLoader,E=this.applyFragmentData,b=s||this.config.loader;return function(){function d(R){this.loader=void 0,this.loader=new b(R)}var T=d.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(S,w,r){E(S),this.loader.load(S,w,r)},A(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},o.uuid=function(){var s=URL.createObjectURL(new Blob),E=s.toString();return URL.revokeObjectURL(s),E.slice(E.lastIndexOf("/")+1)},o.serialize=function(s){for(var E=[],b=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},d=function(D){return Math.round(D)},T=function(D){return d(D/100)*100},R=function(D){return encodeURIComponent(D)},S={br:d,d,bl:T,dl:T,mtp:T,nor:R,rtp:T,tb:d},w=Object.keys(s||{}).sort(),r=h(w),n;!(n=r()).done;){var t=n.value,l=s[t];if(b(l)&&!(t==="v"&&l===1)&&!(t=="pr"&&l===1)){var x=S[t];x&&(l=x(l));var y=typeof l,c=void 0;t==="ot"||t==="sf"||t==="st"?c=t+"="+l:y==="boolean"?c=t:y==="number"?c=t+"="+l:c=t+"="+JSON.stringify(l),E.push(c)}}return E.join(",")},o.toHeaders=function(s){for(var E=Object.keys(s),b={},d=["Object","Request","Session","Status"],T=[{},{},{},{}],R={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},S=0,w=E;S{"use strict";L.r(N),L.d(N,{default:()=>S});var C=L("./src/events.ts"),P=L("./src/errors.ts"),M=L("./src/utils/logger.ts"),e=L("./src/utils/mediakeys-helper.ts"),I=L("./src/utils/keysystem-util.ts"),A=L("./src/utils/numeric-encoding-utils.ts"),f=L("./src/loader/level-key.ts"),g=L("./src/utils/hex.ts"),h=L("./src/utils/mp4-tools.ts"),p=L("./node_modules/eventemitter3/index.js"),u=L.n(p);function v(w,r){w.prototype=Object.create(r.prototype),w.prototype.constructor=w,s(w,r)}function m(w){var r=typeof Map=="function"?new Map:void 0;return m=function(t){if(t===null||!i(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,l)}function l(){return o(t,arguments,E(this).constructor)}return l.prototype=Object.create(t.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),s(l,t)},m(w)}function o(w,r,n){return a()?o=Reflect.construct.bind():o=function(l,x,y){var c=[null];c.push.apply(c,x);var _=Function.bind.apply(l,c),D=new _;return y&&s(D,y.prototype),D},o.apply(null,arguments)}function a(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(w){return!1}}function i(w){return Function.toString.call(w).indexOf("[native code]")!==-1}function s(w,r){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,l){return t.__proto__=l,t},s(w,r)}function E(w){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},E(w)}var b=3,d="[eme]",T=function(){function w(n){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=w.CDMCleanupPromise?[w.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=M.logger.debug.bind(M.logger,d),this.log=M.logger.log.bind(M.logger,d),this.warn=M.logger.warn.bind(M.logger,d),this.error=M.logger.error.bind(M.logger,d),this.hls=n,this.config=n.config,this.registerListeners()}var r=w.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},r.registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},r.unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(C.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},r.getLicenseServerUrl=function(t){var l=this.config,x=l.drmSystems,y=l.widevineLicenseUrl,c=x[t];if(c)return c.licenseUrl;if(t===e.KeySystems.WIDEVINE&&y)return y;throw new Error('no license server URL configured for key-system "'+t+'"')},r.getServerCertificateUrl=function(t){var l=this.config.drmSystems,x=l[t];if(x)return x.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+t+'"]')},r.attemptKeySystemAccess=function(t){var l=this,x=this.hls.levels,y=function(O,k,F){return!!O&&F.indexOf(O)===k},c=x.map(function(D){return D.audioCodec}).filter(y),_=x.map(function(D){return D.videoCodec}).filter(y);return c.length+_.length===0&&_.push("avc1.42e01e"),new Promise(function(D,O){var k=function F(G){var H=G.shift();l.getMediaKeysPromise(H,c,_).then(function(j){return D({keySystem:H,mediaKeys:j})}).catch(function(j){G.length?F(G):j instanceof R?O(j):O(new R({type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:j,fatal:!0},j.message))})};k(t)})},r.requestMediaKeySystemAccess=function(t,l){var x=this.config.requestMediaKeySystemAccessFunc;if(typeof x!="function"){var y="Configured requestMediaKeySystemAccess is not a function "+x;return e.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(y="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(y))}return x(t,l)},r.getMediaKeysPromise=function(t,l,x){var y=this,c=(0,e.getSupportedMediaKeySystemConfigurations)(t,l,x,this.config.drmSystemOptions),_=this.keySystemAccessPromises[t],D=_==null?void 0:_.keySystemAccess;if(!D){this.log('Requesting encrypted media "'+t+'" key-system access with config: '+JSON.stringify(c)),D=this.requestMediaKeySystemAccess(t,c);var O=this.keySystemAccessPromises[t]={keySystemAccess:D};return D.catch(function(k){y.log('Failed to obtain access to key-system "'+t+'": '+k)}),D.then(function(k){y.log('Access for key-system "'+k.keySystem+'" obtained');var F=y.fetchServerCertificate(t);return y.log('Create media-keys for "'+t+'"'),O.mediaKeys=k.createMediaKeys().then(function(G){return y.log('Media-keys created for "'+t+'"'),F.then(function(H){return H?y.setMediaKeysServerCertificate(G,t,H):G})}),O.mediaKeys.catch(function(G){y.error('Failed to create media-keys for "'+t+'"}: '+G)}),O.mediaKeys})}return D.then(function(){return _.mediaKeys})},r.createMediaKeySessionContext=function(t){var l=t.decryptdata,x=t.keySystem,y=t.mediaKeys;console.assert(!!y,"mediaKeys is defined"),this.log('Creating key-system session "'+x+'" keyId: '+g.default.hexDump(l.keyId||[]));var c=y.createSession(),_={decryptdata:l,keySystem:x,mediaKeys:y,mediaKeysSession:c,keyStatus:"status-pending"};return this.mediaKeySessions.push(_),_},r.renewKeySession=function(t){var l=t.decryptdata;if(l.pssh){var x=this.createMediaKeySessionContext(t),y=this.getKeyIdString(l),c="cenc";this.keyIdToKeySessionPromise[y]=this.generateRequestWithPreferredKeySession(x,c,l.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)},r.getKeyIdString=function(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(t.keyId===null)throw new Error("keyId is null");return g.default.hexDump(t.keyId)},r.updateKeySession=function(t,l){var x,y=t.mediaKeysSession;return this.log('Updating key-session "'+y.sessionId+'" for keyID '+g.default.hexDump(((x=t.decryptdata)===null||x===void 0?void 0:x.keyId)||[])+` } (data length: `+(l&&l.byteLength)+")"),y.update(l)},r.selectKeySystemFormat=function(t){var l=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+t.sn+" "+t.type+": "+t.level+") key formats "+l.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(l)),this.keyFormatPromise},r.getKeyFormatPromise=function(t){var l=this;return new Promise(function(x,y){var c=(0,e.getKeySystemsForConfig)(l.config),_=t.map(e.keySystemFormatToKeySystemDomain).filter(function(D){return!!D&&c.indexOf(D)!==-1});return l.getKeySystemSelectionPromise(_).then(function(D){var O=D.keySystem,k=(0,e.keySystemDomainToKeySystemFormat)(O);k?x(k):y(new Error('Unable to find format for key-system "'+O+'"'))}).catch(y)})},r.loadKey=function(t){var l=this,x=t.keyInfo.decryptdata,y=this.getKeyIdString(x),c="(keyId: "+y+' format: "'+x.keyFormat+'" method: '+x.method+" uri: "+x.uri+")";this.log("Starting session for key "+c);var _=this.keyIdToKeySessionPromise[y];return _||(_=this.keyIdToKeySessionPromise[y]=this.getKeySystemForKeyPromise(x).then(function(D){var O=D.keySystem,k=D.mediaKeys;return l.throwIfDestroyed(),l.log("Handle encrypted media sn: "+t.frag.sn+" "+t.frag.type+": "+t.frag.level+" using key "+c),l.attemptSetMediaKeys(O,k).then(function(){l.throwIfDestroyed();var F=l.createMediaKeySessionContext({keySystem:O,mediaKeys:k,decryptdata:x}),G="cenc";return l.generateRequestWithPreferredKeySession(F,G,x.pssh,"playlist-key")})}),_.catch(function(D){return l.handleError(D)})),_},r.throwIfDestroyed=function(t){if(t===void 0&&(t="Invalid state"),!this.hls)throw new Error("invalid state")},r.handleError=function(t){this.hls&&(this.error(t.message),t instanceof R?this.hls.trigger(C.Events.ERROR,t.data):this.hls.trigger(C.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))},r.getKeySystemForKeyPromise=function(t){var l=this.getKeyIdString(t),x=this.keyIdToKeySessionPromise[l];if(!x){var y=(0,e.keySystemFormatToKeySystemDomain)(t.keyFormat),c=y?[y]:(0,e.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(c)}return x},r.getKeySystemSelectionPromise=function(t){if(t.length||(t=(0,e.getKeySystemsForConfig)(this.config)),t.length===0)throw new R({type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(t)},r._onMediaEncrypted=function(t){var l=this,x=t.initDataType,y=t.initData;if(this.debug('"'+t.type+'" event: init data type: "'+x+'"'),y!==null){var c,_;if(x==="sinf"&&this.config.drmSystems[e.KeySystems.FAIRPLAY]){var D=(0,h.bin2str)(new Uint8Array(y));try{var O=(0,A.base64Decode)(JSON.parse(D).sinf),k=(0,h.parseSinf)(new Uint8Array(O));if(!k)return;c=k.subarray(8,24),_=e.KeySystems.FAIRPLAY}catch(le){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var F=(0,h.parsePssh)(y);if(F===null)return;F.version===0&&F.systemId===e.KeySystemIds.WIDEVINE&&F.data&&(c=F.data.subarray(8,24)),_=(0,e.keySystemIdToKeySystemDomain)(F.systemId)}if(!(!_||!c)){for(var G=g.default.hexDump(c),H=this.keyIdToKeySessionPromise,j=this.mediaKeySessions,Q=H[G],ee=function(xe){var Re=j[xe],Ee=Re.decryptdata;if(Ee.pssh||!Ee.keyId)return"continue";var he=g.default.hexDump(Ee.keyId);if(G===he||Ee.uri.replace(/-/g,"").indexOf(G)!==-1)return Q=H[he],delete H[he],Ee.pssh=new Uint8Array(y),Ee.keyId=c,Q=H[G]=Q.then(function(){return l.generateRequestWithPreferredKeySession(Re,x,y,"encrypted-event-key-match")}),"break"},ie=0;ieb||D.status>=400&&D.status<500)c(new R({type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:D},"License Request XHR failed ("+_+"). Status: "+D.status+" ("+D.statusText+")"));else{var F=b-x._requestLicenseFailureCount+1;x.warn("Retrying license request, "+F+" attempts left"),x.requestLicense(t,l).then(y,c)}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=D,x.setupLicenseXHR(D,_,t,l).then(function(O){var k=O.xhr,F=O.licenseChallenge;k.send(F)})})},r.onMediaAttached=function(t,l){if(this.config.emeEnabled){var x=l.media;this.media=x,x.addEventListener("encrypted",this.onMediaEncrypted),x.addEventListener("waitingforkey",this.onWaitingForKey)}},r.onMediaDetached=function(){var t=this,l=this.media,x=this.mediaKeySessions;l&&(l.removeEventListener("encrypted",this.onMediaEncrypted),l.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},f.LevelKey.clearKeyUriToKeyIdMap();var y=x.length;w.CDMCleanupPromise=Promise.all(x.map(function(c){return t.removeSession(c)}).concat(l==null?void 0:l.setMediaKeys(null).catch(function(c){t.log("Could not clear media keys: "+c+". media.src: "+(l==null?void 0:l.src))}))).then(function(){y&&(t.log("finished closing key sessions and clearing media keys"),x.length=0)}).catch(function(c){t.log("Could not close sessions and clear media keys: "+c+". media.src: "+(l==null?void 0:l.src))})},r.onManifestLoaded=function(t,l){var x=l.sessionKeys;if(!(!x||!this.config.emeEnabled)&&!this.keyFormatPromise){var y=x.reduce(function(c,_){return c.indexOf(_.keyFormat)===-1&&c.push(_.keyFormat),c},[]);this.log("Selecting key-system from session-keys "+y.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(y)}},r.removeSession=function(t){var l=this,x=t.mediaKeysSession,y=t.licenseXhr;if(x){this.log("Remove licenses and keys and close session "+x.sessionId),x.onmessage=null,x.onkeystatuseschange=null,y&&y.readyState!==XMLHttpRequest.DONE&&y.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;var c=this.mediaKeySessions.indexOf(t);return c>-1&&this.mediaKeySessions.splice(c,1),x.remove().catch(function(_){l.log("Could not remove session: "+_)}).then(function(){return x.close()}).catch(function(_){l.log("Could not close session: "+_)})}},w}();T.CDMCleanupPromise=void 0;var R=function(w){v(r,w);function r(n,t){var l;return l=w.call(this,t)||this,l.data=void 0,l.data=n,n.err=n.error,l}return r}(m(Error));const S=T},"./src/controller/fps-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>e});var C=L("./src/events.ts"),P=L("./src/utils/logger.ts"),M=function(){function I(f){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=f,this.registerListeners()}var A=I.prototype;return A.setStreamController=function(g){this.streamController=g},A.registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},A.unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching)},A.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},A.onMediaAttaching=function(g,h){var p=this.hls.config;if(p.capLevelOnFPSDrop){var u=h.media instanceof self.HTMLVideoElement?h.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},A.checkFPS=function(g,h,p){var u=performance.now();if(h){if(this.lastTime){var v=u-this.lastTime,m=p-this.lastDroppedFrames,o=h-this.lastDecodedFrames,a=1e3*m/v,i=this.hls;if(i.trigger(C.Events.FPS_DROP,{currentDropped:m,currentDecoded:o,totalDroppedFrames:p}),a>0&&m>i.config.fpsDroppedMonitoringThreshold*o){var s=i.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=s)&&(s=s-1,i.trigger(C.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:i.currentLevel}),i.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=p,this.lastDecodedFrames=h}},A.checkFPSInterval=function(){var g=this.media;if(g)if(this.isVideoPlaybackQualityAvailable){var h=g.getVideoPlaybackQuality();this.checkFPS(g,h.totalVideoFrames,h.droppedVideoFrames)}else this.checkFPS(g,g.webkitDecodedFrameCount,g.webkitDroppedFrameCount)},I}();const e=M},"./src/controller/fragment-finders.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{findFragWithCC:()=>f,findFragmentByPDT:()=>M,findFragmentByPTS:()=>e,fragmentWithinToleranceTest:()=>I,pdtWithinToleranceTest:()=>A});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/binary-search.ts");function M(g,h,p){if(h===null||!Array.isArray(g)||!g.length||!(0,C.isFiniteNumber)(h))return null;var u=g[0].programDateTime;if(h<(u||0))return null;var v=g[g.length-1].endProgramDateTime;if(h>=(v||0))return null;p=p||0;for(var m=0;mg)return 0;var u=Math.min(h,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-u<=g?1:p.start-u>g&&p.start?-1:0}function A(g,h,p){var u=Math.min(h,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,v=p.endProgramDateTime||0;return v-u>g}function f(g,h){return P.default.search(g,function(p){return p.cch?-1:0})}},"./src/controller/fragment-tracker.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{FragmentState:()=>M,FragmentTracker:()=>e});var C=L("./src/events.ts"),P=L("./src/types/loader.ts"),M;(function(f){f.NOT_LOADED="NOT_LOADED",f.APPENDING="APPENDING",f.PARTIAL="PARTIAL",f.OK="OK"})(M||(M={}));var e=function(){function f(h){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=h,this._registerListeners()}var g=f.prototype;return g._registerListeners=function(){var p=this.hls;p.on(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(C.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var p=this.hls;p.off(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(C.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},g.getAppendedFrag=function(p,u){if(u===P.PlaylistLevelType.MAIN){var v=this.activeFragment,m=this.activeParts;if(!v)return null;if(m)for(var o=m.length;o--;){var a=m[o],i=a?a.end:v.appendedPTS;if(a.start<=p&&i!==void 0&&p<=i)return o>9&&(this.activeParts=m.slice(o-9)),a}else if(v.start<=p&&v.appendedPTS!==void 0&&p<=v.appendedPTS)return v}return this.getBufferedFrag(p,u)},g.getBufferedFrag=function(p,u){for(var v=this.fragments,m=Object.keys(v),o=m.length;o--;){var a=v[m[o]];if((a==null?void 0:a.body.type)===u&&a.buffered){var i=a.body;if(i.start<=p&&p<=i.end)return i}}return null},g.detectEvictedFragments=function(p,u,v){var m=this;this.timeRanges&&(this.timeRanges[p]=u),Object.keys(this.fragments).forEach(function(o){var a=m.fragments[o];if(a){if(!a.buffered&&!a.loaded){a.body.type===v&&m.removeFragment(a.body);return}var i=a.range[p];i&&i.time.some(function(s){var E=!m.isTimeBuffered(s.startPTS,s.endPTS,u);return E&&m.removeFragment(a.body),E})}})},g.detectPartialFragments=function(p){var u=this,v=this.timeRanges,m=p.frag,o=p.part;if(!(!v||m.sn==="initSegment")){var a=A(m),i=this.fragments[a];i&&(Object.keys(v).forEach(function(s){var E=m.elementaryStreams[s];if(E){var b=v[s],d=o!==null||E.partial===!0;i.range[s]=u.getBufferedTimes(m,o,d,b)}}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,i.body.endList&&(this.endListFragments[i.body.type]=i)):this.removeFragment(i.body))}},g.fragBuffered=function(p){var u=A(p),v=this.fragments[u];v&&(v.loaded=null,v.buffered=!0)},g.getBufferedTimes=function(p,u,v,m){for(var o={time:[],partial:v},a=u?u.start:p.start,i=u?u.end:p.end,s=p.minEndPTS||i,E=p.maxStartPTS||a,b=0;b=d&&s<=T){o.time.push({startPTS:Math.max(a,m.start(b)),endPTS:Math.min(i,m.end(b))});break}else if(ad)o.partial=!0,o.time.push({startPTS:Math.max(a,m.start(b)),endPTS:Math.min(i,m.end(b))});else if(i<=d)break}return o},g.getPartialFragment=function(p){var u=null,v,m,o,a=0,i=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(E){var b=s[E];b&&I(b)&&(m=b.body.start-i,o=b.body.end+i,p>=m&&p<=o&&(v=Math.min(p-m,o-p),a<=v&&(u=b.body,a=v)))}),u},g.isEndListAppended=function(p){var u=this.endListFragments[p];return u!==void 0&&(u.buffered||I(u))},g.getState=function(p){var u=A(p),v=this.fragments[u];return v?v.buffered?I(v)?M.PARTIAL:M.OK:M.APPENDING:M.NOT_LOADED},g.isTimeBuffered=function(p,u,v){for(var m,o,a=0;a=m&&u<=o)return!0;if(u<=m)return!1}return!1},g.onFragLoaded=function(p,u){var v=u.frag,m=u.part;if(!(v.sn==="initSegment"||v.bitrateTest||m)){var o=A(v);this.fragments[o]={body:v,loaded:u,buffered:!1,range:Object.create(null)}}},g.onBufferAppended=function(p,u){var v=this,m=u.frag,o=u.part,a=u.timeRanges;if(m.type===P.PlaylistLevelType.MAIN)if(this.activeFragment!==m&&(this.activeFragment=m,m.appendedPTS=void 0),o){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(o)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var E=a[s];if(v.detectEvictedFragments(s,E),!o&&m.type===P.PlaylistLevelType.MAIN){var b=m.elementaryStreams[s];if(!b)return;for(var d=0;db.startPTS?m.appendedPTS=Math.max(T,m.appendedPTS||0):m.appendedPTS=b.endPTS}}})},g.onFragBuffered=function(p,u){this.detectPartialFragments(u)},g.hasFragment=function(p){var u=A(p);return!!this.fragments[u]},g.removeFragmentsInRange=function(p,u,v){var m=this;Object.keys(this.fragments).forEach(function(o){var a=m.fragments[o];if(a&&a.buffered){var i=a.body;i.type===v&&i.startp&&m.removeFragment(i)}})},g.removeFragment=function(p){var u=A(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),p.appendedPTS=void 0,delete this.fragments[u],p.endList&&delete this.endListFragments[p.type]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},f}();function I(f){var g,h;return f.buffered&&(((g=f.range.video)===null||g===void 0?void 0:g.partial)||((h=f.range.audio)===null||h===void 0?void 0:h.partial))}function A(f){return f.type+"_"+f.level+"_"+f.urlId+"_"+f.sn}},"./src/controller/gap-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{MAX_START_GAP_JUMP:()=>A,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>f,SKIP_BUFFER_RANGE_START:()=>g,STALL_MINIMUM_DURATION_MS:()=>I,default:()=>h});var C=L("./src/utils/buffer-helper.ts"),P=L("./src/errors.ts"),M=L("./src/events.ts"),e=L("./src/utils/logger.ts"),I=250,A=2,f=.1,g=.05,h=function(){function p(v,m,o,a){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=v,this.media=m,this.fragmentTracker=o,this.hls=a}var u=p.prototype;return u.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},u.poll=function(m,o){var a=this.config,i=this.media,s=this.stalled;if(i!==null){var E=i.currentTime,b=i.seeking,d=this.seeking&&!b,T=!this.seeking&&b;if(this.seeking=b,E!==m){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;e.logger.warn("playback not stuck anymore @"+E+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||d)&&(this.stalled=null),!(i.paused&&!b||i.ended||i.playbackRate===0||!C.BufferHelper.getBuffered(i).length)){var S=C.BufferHelper.bufferInfo(i,E,0),w=S.len>0,r=S.nextStart||0;if(!(!w&&!r)){if(b){var n=S.len>A,t=!r||o&&o.start<=E||r-E>A&&!this.fragmentTracker.getPartialFragment(E);if(n||t)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var l,x=Math.max(r,S.start||0)-E,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,c=y==null||(l=y.details)===null||l===void 0?void 0:l.live,_=c?y.details.targetduration*2:A;if(x>0&&x<=_){this._trySkipBufferHole(null);return}}var D=self.performance.now();if(s===null){this.stalled=D;return}var O=D-s;if(!(!b&&O>=I&&(this._reportStall(S),!this.media))){var k=C.BufferHelper.bufferInfo(i,E,a.maxBufferHole);this._tryFixBufferStall(k,O)}}}}},u._tryFixBufferStall=function(m,o){var a=this.config,i=this.fragmentTracker,s=this.media;if(s!==null){var E=s.currentTime,b=i.getPartialFragment(E);if(b){var d=this._trySkipBufferHole(b);if(d||!this.media)return}m.len>a.maxBufferHole&&o>a.highBufferWatchdogPeriod*1e3&&(e.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},u._reportStall=function(m){var o=this.hls,a=this.media,i=this.stallReported;!i&&a&&(this.stallReported=!0,e.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer ("+JSON.stringify(m)+")"),o.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m.len}))},u._trySkipBufferHole=function(m){var o=this.config,a=this.hls,i=this.media;if(i===null)return 0;for(var s=i.currentTime,E=0,b=C.BufferHelper.getBuffered(i),d=0;d=E&&s{"use strict";L.r(N),L.d(N,{default:()=>m});var C=L("./src/polyfills/number.ts"),P=L("./src/events.ts"),M=L("./src/utils/texttrack-utils.ts"),e=L("./src/demux/id3.ts"),I=L("./src/loader/date-range.ts"),A=L("./src/types/demuxer.ts"),f=.25;function g(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var h=function(){var o=g();try{new o(0,Number.POSITIVE_INFINITY,"")}catch(a){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function p(o,a){return o.getTime()/1e3-a}function u(o){return Uint8Array.from(o.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var v=function(){function o(i){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=i,this._registerListeners()}var a=o.prototype;return a.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},a._registerListeners=function(){var s=this.hls;s.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},a._unregisterListeners=function(){var s=this.hls;s.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(P.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},a.onMediaAttached=function(s,E){this.media=E.media},a.onMediaDetaching=function(){this.id3Track&&((0,M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},a.onManifestLoading=function(){this.dateRangeCuesAppended={}},a.createTrack=function(s){var E=this.getID3Track(s.textTracks);return E.mode="hidden",E},a.getID3Track=function(s){if(this.media){for(var E=0;Eh&&(l=h);var x=l-t;x<=0&&(l=t+f);for(var y=0;yF.startDate&&be.push(Ue),be},[]).sort(function(be,Ce){return be.startDate.getTime()-Ce.startDate.getTime()})[0];se&&(ee=p(se.startDate,x),j=!0)}for(var le=Object.keys(F.attr),xe=0;xe{"use strict";L.r(N),L.d(N,{default:()=>g});var C=L("./src/errors.ts"),P=L("./src/events.ts"),M=L("./src/utils/logger.ts");function e(h,p){for(var u=0;u.05&&this.forwardBufferLength>1){var R=Math.min(2,Math.max(1,s)),S=Math.round(2/(1+Math.exp(-.75*b-this.edgeStalled))*20)/20;v.playbackRate=Math.min(R,Math.max(1,S))}else v.playbackRate!==1&&v.playbackRate!==0&&(v.playbackRate=1)}}}}},p.estimateLiveEdge=function(){var v=this.levelDetails;return v===null?null:v.edge+v.age},p.computeLatency=function(){var v=this.estimateLiveEdge();return v===null?null:v-this.currentTime},I(h,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var v=this.config,m=this.levelDetails;return v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:m?v.liveMaxLatencyDurationCount*m.targetduration:0}},{key:"targetLatency",get:function(){var v=this.levelDetails;if(v===null)return null;var m=v.holdBack,o=v.partHoldBack,a=v.targetduration,i=this.config,s=i.liveSyncDuration,E=i.liveSyncDurationCount,b=i.lowLatencyMode,d=this.hls.userConfig,T=b&&o||m;(d.liveSyncDuration||d.liveSyncDurationCount||T===0)&&(T=s!==void 0?s:E*a);var R=a,S=1;return T+Math.min(this.stallCount*S,R)}},{key:"liveSyncPosition",get:function(){var v=this.estimateLiveEdge(),m=this.targetLatency,o=this.levelDetails;if(v===null||m===null||o===null)return null;var a=o.edge,i=v-m-this.edgeStalled,s=a-o.totalduration,E=a-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(s,i),E)}},{key:"drift",get:function(){var v=this.levelDetails;return v===null?1:v.drift}},{key:"edgeStalled",get:function(){var v=this.levelDetails;if(v===null)return 0;var m=(this.config.lowLatencyMode&&v.partTarget||v.targetduration)*3;return Math.max(v.age-m,0)}},{key:"forwardBufferLength",get:function(){var v=this.media,m=this.levelDetails;if(!v||!m)return 0;var o=v.buffered.length;return(o?v.buffered.end(o-1):m.edge)-this.currentTime}}]),h}()},"./src/controller/level-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>i});var C=L("./src/types/level.ts"),P=L("./src/events.ts"),M=L("./src/errors.ts"),e=L("./src/utils/codecs.ts"),I=L("./src/controller/level-helper.ts"),A=L("./src/controller/base-playlist-controller.ts"),f=L("./src/types/loader.ts");function g(){return g=Object.assign?Object.assign.bind():function(s){for(var E=1;E0){n=S[0].bitrate,S.sort(function(k,F){return k.attrs["HDCP-LEVEL"]!==F.attrs["HDCP-LEVEL"]?(k.attrs["HDCP-LEVEL"]||"")>(F.attrs["HDCP-LEVEL"]||"")?1:-1:k.bitrate!==F.bitrate?k.bitrate-F.bitrate:k.attrs.SCORE!==F.attrs.SCORE?k.attrs.decimalFloatingPoint("SCORE")-F.attrs.decimalFloatingPoint("SCORE"):x&&k.height!==F.height?k.height-F.height:0}),this._levels=S;for(var _=0;_this.hls.config.fragLoadingMaxRetry&&(x=y)):x=y}break;case M.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var _=n.attrs["HDCP-LEVEL"];_&&(this.hls.maxHdcpLevel=C.HdcpLevels[C.HdcpLevels.indexOf(_)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case M.ErrorDetails.FRAG_PARSING_ERROR:case M.ErrorDetails.KEY_SYSTEM_NO_SESSION:x=((S=R.frag)===null||S===void 0?void 0:S.type)===f.PlaylistLevelType.MAIN?R.frag.level:this.currentLevelIndex,R.levelRetry=!1;break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(l=!1),x=r.level),t=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:x=(w=R.level)!=null?w:this.currentLevelIndex,t=!0;break}x!==void 0&&this.recoverLevel(R,x,t,l)}},b.recoverLevel=function(T,R,S,w){var r=T.details,n=this._levels[R];if(n.loadError++,S){var t=this.retryLoadingOrFail(T);if(t)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var l=n.url.length;if(l>1&&n.loadError-1&&this.currentLevelIndex!==x?(this.warn(r+": switch to "+x),T.levelRetry=!0,this.hls.nextAutoLevel=x):T.levelRetry===!1&&(T.fatal=!0)}}},b.redundantFailover=function(T){var R=this._levels[T],S=R.url.length;if(S>1){var w=(R.urlId+1)%S;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(r){r.urlId=w}),this.level=T}},b.onFragLoaded=function(T,R){var S=R.frag;if(S!==void 0&&S.type===f.PlaylistLevelType.MAIN){var w=this._levels[S.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},b.onLevelLoaded=function(T,R){var S,w=R.level,r=R.details,n=this._levels[w];if(!n){var t;this.warn("Invalid level index "+w),(t=R.deliveryDirectives)!==null&&t!==void 0&&t.skip&&(r.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0,this.retryCount=0),this.playlistLoaded(w,R,n.details)):(S=R.deliveryDirectives)!==null&&S!==void 0&&S.skip&&(r.deltaUpdateFailed=!0)},b.onAudioTrackSwitched=function(T,R){var S=this.hls.levels[this.currentLevelIndex];if(S&&S.audioGroupIds){for(var w=-1,r=this.hls.audioTracks[R.id].groupId,n=0;n0){var w=S.urlId,r=S.url[w];if(T)try{r=T.addDirectives(r)}catch(n){this.warn("Could not construct new URL with HLS Delivery Directives: "+n)}this.log("Attempt loading level index "+R+((T==null?void 0:T.msn)!==void 0?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+w+" "+r),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:r,level:R,id:w,deliveryDirectives:T||null})}},b.removeLevel=function(T,R){var S=function(n,t){return t!==R},w=this._levels.filter(function(r,n){return n!==T?!0:r.url.length>1&&R!==void 0?(r.url=r.url.filter(S),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(S)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(S)),r.urlId=0,!0):!1}).map(function(r,n){var t=r.details;return t!=null&&t.fragments&&t.fragments.forEach(function(l){l.level=n}),r});this._levels=w,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:w})},p(E,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var R,S=this._levels;if(S.length!==0&&!(this.currentLevelIndex===T&&(R=S[T])!==null&&R!==void 0&&R.details)){if(T<0||T>=S.length){var w=T<0;if(this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:w,reason:"invalid level idx"}),w)return;T=Math.min(T,S.length-1)}this.clearTimer();var r=this.currentLevelIndex,n=S[r],t=S[T];this.log("switching to level "+T+" from "+r),this.currentLevelIndex=T;var l=g({},t,{level:T,maxBitrate:t.maxBitrate,uri:t.uri,urlId:t.urlId});delete l._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,l);var x=t.details;if(!x||x.live){var y=this.switchParams(t.uri,n==null?void 0:n.details);this.loadPlaylist(y)}}}},{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)}}]),E}(A.default)},"./src/controller/level-helper.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{addGroupId:()=>I,addSliding:()=>a,adjustSliding:()=>o,assignTrackIdsByGroup:()=>A,computeReloadInterval:()=>i,getFragmentWithSN:()=>s,getPartWith:()=>E,mapFragmentIntersection:()=>m,mapPartIntersection:()=>v,mergeDetails:()=>p,updateFragPTSDTS:()=>h,updatePTS:()=>f});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/logger.ts"),M=L("./src/loader/date-range.ts");function e(){return e=Object.assign?Object.assign.bind():function(b){for(var d=1;db.sn?(R=T-b.start,S=b):(R=b.start-T,S=d),S.duration!==R&&(S.duration=R)}else if(d.sn>b.sn){var w=b.cc===d.cc;w&&b.minEndPTS?d.start=b.start+(b.minEndPTS-b.start):d.start=b.start+b.duration}else d.start=Math.max(b.start-d.duration,0)}function h(b,d,T,R,S,w){var r=R-T;r<=0&&(P.logger.warn("Fragment should have a positive duration",d),R=T+d.duration,w=S+d.duration);var n=T,t=R,l=d.startPTS,x=d.endPTS;if((0,C.isFiniteNumber)(l)){var y=Math.abs(l-T);(0,C.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(y,d.deltaPTS):d.deltaPTS=y,n=Math.max(T,l),T=Math.min(T,l),S=Math.min(S,d.startDTS),t=Math.min(R,x),R=Math.max(R,x),w=Math.max(w,d.endDTS)}d.duration=R-T;var c=T-d.start;d.start=d.startPTS=T,d.maxStartPTS=n,d.startDTS=S,d.endPTS=R,d.minEndPTS=t,d.endDTS=w;var _=d.sn;if(!b||_b.endSN)return 0;var D,O=_-b.startSN,k=b.fragments;for(k[O]=d,D=O;D>0;D--)g(k[D],k[D-1]);for(D=O;D=0;S--){var w=R[S].initSegment;if(w){T=w;break}}b.fragmentHint&&delete b.fragmentHint.endPTS;var r=0,n;if(m(b,d,function(D,O){D.relurl&&(r=D.cc-O.cc),(0,C.isFiniteNumber)(D.startPTS)&&(0,C.isFiniteNumber)(D.endPTS)&&(O.start=O.startPTS=D.startPTS,O.startDTS=D.startDTS,O.appendedPTS=D.appendedPTS,O.maxStartPTS=D.maxStartPTS,O.endPTS=D.endPTS,O.endDTS=D.endDTS,O.minEndPTS=D.minEndPTS,O.duration=D.endPTS-D.startPTS,O.duration&&(n=O),d.PTSKnown=d.alignedSliding=!0),O.elementaryStreams=D.elementaryStreams,O.loader=D.loader,O.stats=D.stats,O.urlId=D.urlId,D.initSegment&&(O.initSegment=D.initSegment,T=D.initSegment)}),T){var t=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;t.forEach(function(D){var O;(!D.initSegment||D.initSegment.relurl===((O=T)===null||O===void 0?void 0:O.relurl))&&(D.initSegment=T)})}if(d.skippedSegments)if(d.deltaUpdateFailed=d.fragments.some(function(D){return!D}),d.deltaUpdateFailed){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=d.skippedSegments;l--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}else d.canSkipDateRanges&&(d.dateRanges=u(b.dateRanges,d.dateRanges,d.recentlyRemovedDateranges));var x=d.fragments;if(r){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y=R.length||a(d,R[T].start)}function a(b,d){if(d){for(var T=b.fragments,R=b.skippedSegments;Rd){var w=R[R.length-1].duration*1e3;w{"use strict";L.r(N),L.d(N,{default:()=>d});var C=L("./src/polyfills/number.ts"),P=L("./src/controller/base-stream-controller.ts"),M=L("./src/is-supported.ts"),e=L("./src/events.ts"),I=L("./src/utils/buffer-helper.ts"),A=L("./src/controller/fragment-tracker.ts"),f=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),h=L("./src/demux/transmuxer-interface.ts"),p=L("./src/types/transmuxer.ts"),u=L("./src/controller/gap-controller.ts"),v=L("./src/errors.ts");function m(T,R){for(var S=0;S1?(l=0,this.bitrateTest=!0):l=t.nextAutoLevel),this.level=t.nextLoadLevel=l,this.loadedmetadata=!1}n>0&&r===-1&&(this.log("Override startPosition with lastCurrentTime @"+n.toFixed(3)),r=n),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var r,n=this.levels,t=this.level,l=n==null||(r=n[t])===null||r===void 0?void 0:r.details;if(l&&(!l.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(l))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var x,y=self.performance.now(),c=this.retryDate;(!c||y>=c||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var r=this.hls,n=this.levelLastLoaded,t=this.levels,l=this.media,x=r.config,y=r.nextLoadLevel;if(!(n===null||!l&&(this.startFragRequested||!x.startFragPrefetch))&&!(this.altAudio&&this.audioOnly)&&!(!t||!t[y])){var c=t[y],_=this.getMainFwdBufferInfo();if(_!==null){var D=this.getLevelDetails();if(D&&this._streamEnded(_,D)){var O={};this.altAudio&&(O.type="video"),this.hls.trigger(e.Events.BUFFER_EOS,O),this.state=P.State.ENDED;return}this.level=r.nextLoadLevel=y;var k=c.details;if(!k||this.state===P.State.WAITING_LEVEL||k.live&&this.levelLastLoaded!==y){this.level=y,this.state=P.State.WAITING_LEVEL;return}var F=_.len,G=this.getMaxBufferLength(c.maxBitrate);if(!(F>=G)){this.backtrackFragment&&this.backtrackFragment.start>_.end&&(this.backtrackFragment=null);var H=this.backtrackFragment?this.backtrackFragment.start:_.end,j=this.getNextFragment(H,k);if(this.couldBacktrack&&!this.fragPrevious&&j&&j.sn!=="initSegment"&&this.fragmentTracker.getState(j)!==A.FragmentState.OK){var Q,ee=((Q=this.backtrackFragment)!=null?Q:j).sn,ie=ee-k.startSN,se=k.fragments[ie-1];se&&j.cc===se.cc&&(j=se,this.fragmentTracker.removeFragment(se))}else this.backtrackFragment&&_.len&&(this.backtrackFragment=null);if(j&&this.fragmentTracker.getState(j)===A.FragmentState.OK&&this.nextLoadPosition>H){var le=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO,xe=(le===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;xe&&this.afterBufferFlushed(xe,le,f.PlaylistLevelType.MAIN),j=this.getNextFragment(this.nextLoadPosition,k)}j&&(j.initSegment&&!j.initSegment.data&&!this.bitrateTest&&(j=j.initSegment),this.loadFragment(j,k,H))}}}},S.loadFragment=function(r,n,t){var l,x=this.fragmentTracker.getState(r);this.fragCurrent=r,x===A.FragmentState.NOT_LOADED?r.sn==="initSegment"?this._loadInitSegment(r,n):this.bitrateTest?(this.log("Fragment "+r.sn+" of level "+r.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(r,n)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,r,n,t)):x===A.FragmentState.APPENDING?this.reduceMaxBufferLength(r.duration)&&this.fragmentTracker.removeFragment(r):((l=this.media)===null||l===void 0?void 0:l.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(r){var n=this.fragmentTracker.getAppendedFrag(r,f.PlaylistLevelType.MAIN);return n&&"fragment"in n?n.fragment:n},S.getBufferedFrag=function(r){return this.fragmentTracker.getBufferedFrag(r,f.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(r){return r?this.getBufferedFrag(r.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var r=this.levels,n=this.media;if(n!=null&&n.readyState){var t,l=this.getAppendedFrag(n.currentTime);if(l&&l.start>1&&this.flushMainBuffer(0,l.start-1),!n.paused&&r){var x=this.hls.nextLoadLevel,y=r[x],c=this.fragLastKbps;c&&this.fragCurrent?t=this.fragCurrent.duration*y.maxBitrate/(1e3*c)+1:t=0}else t=0;var _=this.getBufferedFrag(n.currentTime+t);if(_){var D=this.followingBufferedFrag(_);if(D){this.abortCurrentFrag();var O=D.maxStartPTS?D.maxStartPTS:D.start,k=D.duration,F=Math.max(_.end,O+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var r=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,r&&r.abortRequests(),this.state){case P.State.KEY_LOADING:case P.State.FRAG_LOADING:case P.State.FRAG_LOADING_WAITING_RETRY:case P.State.PARSING:case P.State.PARSED:this.state=P.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(r,n){T.prototype.flushMainBuffer.call(this,r,n,this.altAudio?"video":null)},S.onMediaAttached=function(r,n){T.prototype.onMediaAttached.call(this,r,n);var t=n.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),t.addEventListener("playing",this.onvplaying),t.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,t,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var r=this.media;r&&this.onvplaying&&this.onvseeked&&(r.removeEventListener("playing",this.onvplaying),r.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var r=this.media,n=r?r.currentTime:null;(0,C.isFiniteNumber)(n)&&this.log("Media seeked to "+n.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(e.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},S.onManifestParsed=function(r,n){var t=!1,l=!1,x;n.levels.forEach(function(y){x=y.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(t=!0),x.indexOf("mp4a.40.5")!==-1&&(l=!0))}),this.audioCodecSwitch=t&&l&&!(0,M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=n.levels,this.startFragRequested=!1},S.onLevelLoading=function(r,n){var t=this.levels;if(!(!t||this.state!==P.State.IDLE)){var l=t[n.level];(!l.details||l.details.live&&this.levelLastLoaded!==n.level||this.waitForCdnTuneIn(l.details))&&(this.state=P.State.WAITING_LEVEL)}},S.onLevelLoaded=function(r,n){var t,l=this.levels,x=n.level,y=n.details,c=y.totalduration;if(!l){this.warn("Levels were reset while loading level "+x);return}this.log("Level "+x+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+c);var _=this.fragCurrent;_&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&_.level!==n.level&&_.loader&&(this.state=P.State.IDLE,this.backtrackFragment=null,_.abortRequests());var D=l[x],O=0;if(y.live||(t=D.details)!==null&&t!==void 0&&t.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;O=this.alignPlaylists(y,D.details)}if(D.details=y,this.levelLastLoaded=x,this.hls.trigger(e.Events.LEVEL_UPDATED,{details:y,level:x}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=P.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,O),this.tick()},S._handleFragmentLoadProgress=function(r){var n,t=r.frag,l=r.part,x=r.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+t.sn+" of level "+t.level+" will not be buffered");return}var c=y[t.level],_=c.details;if(!_){this.warn("Dropping fragment "+t.sn+" of level "+t.level+" after level details were reset");return}var D=c.videoCodec,O=_.PTSKnown||!_.live,k=(n=t.initSegment)===null||n===void 0?void 0:n.data,F=this._getAudioCodec(c),G=this.transmuxer=this.transmuxer||new h.default(this.hls,f.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),H=l?l.index:-1,j=H!==-1,Q=new p.ChunkMetadata(t.level,t.sn,t.stats.chunkCount,x.byteLength,H,j),ee=this.initPTS[t.cc];G.push(x,k,F,D,t,l,_.totalduration,O,Q,ee)},S.onAudioTrackSwitching=function(r,n){var t=this.altAudio,l=!!n.url,x=n.id;if(!l){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y&&(this.log("Switching to main audio track, cancel main fragment load"),y.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var c=this.hls;t&&c.trigger(e.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),c.trigger(e.Events.AUDIO_TRACK_SWITCHED,{id:x})}},S.onAudioTrackSwitched=function(r,n){var t=n.id,l=!!this.hls.audioTracks[t].url;if(l){var x=this.videoBuffer;x&&this.mediaBuffer!==x&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=x)}this.altAudio=l,this.tick()},S.onBufferCreated=function(r,n){var t=n.tracks,l,x,y=!1;for(var c in t){var _=t[c];if(_.id==="main"){if(x=c,l=_,c==="video"){var D=t[c];D&&(this.videoBuffer=D.buffer)}}else y=!0}y&&l?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=l.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(r,n){var t=n.frag,l=n.part;if(!(t&&t.type!==f.PlaylistLevelType.MAIN)){if(this.fragContextChanged(t)){this.warn("Fragment "+t.sn+(l?" p: "+l.index:"")+" of level "+t.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var x=l?l.stats:t.stats;this.fragLastKbps=Math.round(8*x.total/(x.buffering.end-x.loading.first)),t.sn!=="initSegment"&&(this.fragPrevious=t),this.fragBufferedComplete(t,l)}},S.onError=function(r,n){if(n.type===v.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(f.PlaylistLevelType.MAIN,n);return}switch(n.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.FRAG_PARSING_ERROR:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f.PlaylistLevelType.MAIN,n);break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(n.fatal?(this.warn(""+n.details),this.state=P.State.ERROR):!n.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(n.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var t=!0,l=this.getFwdBufferInfo(this.media,f.PlaylistLevelType.MAIN);l&&l.len>.5&&(t=!this.reduceMaxBufferLength(l.len)),t&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var r=this.media,n=this.gapController;if(!(!r||!n||!r.readyState)){if(this.loadedmetadata||!I.BufferHelper.getBuffered(r).length){var t=this.state!==P.State.IDLE?this.fragCurrent:null;n.poll(this.lastCurrentTime,t)}this.lastCurrentTime=r.currentTime}},S.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(r,n){var t=n.type;if(t!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var l=(t===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(l,t,f.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(r,n){this.levels=n.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var r=this.media;if(r){var n=r.currentTime,t=this.startPosition;if(t>=0&&n0&&(y1&&r.seeking===!1){var t=r.currentTime;if(I.BufferHelper.isBuffered(r,t)?n=this.getAppendedFrag(t):I.BufferHelper.isBuffered(r,t+.1)&&(n=this.getAppendedFrag(t+.1)),n){this.backtrackFragment=null;var l=this.fragPlaying,x=n.level;(!l||n.sn!==l.sn||l.level!==x||n.urlId!==l.urlId)&&(this.fragPlaying=n,this.hls.trigger(e.Events.FRAG_CHANGED,{frag:n}),(!l||l.level!==x)&&this.hls.trigger(e.Events.LEVEL_SWITCHED,{level:x}))}}},o(R,[{key:"nextLevel",get:function(){var r=this.nextBufferedFrag;return r?r.level:-1}},{key:"currentFrag",get:function(){var r=this.media;return r?this.fragPlaying||this.getAppendedFrag(r.currentTime):null}},{key:"currentProgramDateTime",get:function(){var r=this.media;if(r){var n=r.currentTime,t=this.currentFrag;if(t&&(0,C.isFiniteNumber)(n)&&(0,C.isFiniteNumber)(t.programDateTime)){var l=t.programDateTime+(n-t.start)*1e3;return new Date(l)}}return null}},{key:"currentLevel",get:function(){var r=this.currentFrag;return r?r.level:-1}},{key:"nextBufferedFrag",get:function(){var r=this.currentFrag;return r?this.followingBufferedFrag(r):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{SubtitleStreamController:()=>s});var C=L("./src/events.ts"),P=L("./src/utils/buffer-helper.ts"),M=L("./src/controller/fragment-finders.ts"),e=L("./src/utils/discontinuities.ts"),I=L("./src/controller/level-helper.ts"),A=L("./src/controller/fragment-tracker.ts"),f=L("./src/controller/base-stream-controller.ts"),g=L("./src/types/loader.ts"),h=L("./src/types/level.ts");function p(b,d){for(var T=0;T=t[y].start&&x<=t[y].end){l=t[y];break}var c=r.start+r.duration;l?l.end=c:(l={start:x,end:c},t.push(l)),this.fragmentTracker.fragBuffered(r)}}},T.onBufferFlushing=function(S,w){var r=w.startOffset,n=w.endOffset;if(r===0&&n!==Number.POSITIVE_INFINITY){var t=this.currentTrackId,l=this.levels;if(!l.length||!l[t]||!l[t].details)return;var x=l[t].details,y=x.targetduration,c=n-y;if(c<=0)return;w.endOffsetSubtitles=Math.max(0,c),this.tracksBuffered.forEach(function(_){for(var D=0;D<_.length;){if(_[D].end<=c){_.shift();continue}else if(_[D].start=x.length||t!==l||!y)){this.mediaBuffer=this.mediaBufferTimeRanges;var c=0;if(n.live||(r=y.details)!==null&&r!==void 0&&r.live){var _=this.mainDetails;if(n.deltaUpdateFailed||!_)return;var D=_.fragments[0];y.details?(c=this.alignPlaylists(n,y.details),c===0&&D&&(c=D.start,(0,I.addSliding)(n,c))):n.hasProgramDateTime&&_.hasProgramDateTime?((0,e.alignMediaPlaylistByPDT)(n,_),c=n.fragments[0].start):D&&(c=D.start,(0,I.addSliding)(n,c))}if(y.details=n,this.levelLastLoaded=t,!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(y.details,c),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var O=(0,M.findFragmentByPTS)(null,n.fragments,this.media.currentTime,0);O||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}}}},T._handleFragmentLoadComplete=function(S){var w=this,r=S.frag,n=S.payload,t=r.decryptdata,l=this.hls;if(!this.fragContextChanged(r)&&n&&n.byteLength>0&&t&&t.key&&t.iv&&t.method==="AES-128"){var x=performance.now();this.decrypter.decrypt(new Uint8Array(n),t.key.buffer,t.iv.buffer).then(function(y){var c=performance.now();l.trigger(C.Events.FRAG_DECRYPTED,{frag:r,payload:y,stats:{tstart:x,tdecrypt:c}})}).catch(function(y){w.warn(y.name+": "+y.message),w.state=f.State.IDLE})}},T.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var S=this.currentTrackId,w=this.levels;if(!w.length||!w[S]||!w[S].details)return;var r=w[S].details,n=r.targetduration,t=this.config,l=this.getLoadPosition(),x=P.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],l-n,t.maxBufferHole),y=x.end,c=x.len,_=this.getFwdBufferInfo(this.media,g.PlaylistLevelType.MAIN),D=this.getMaxBufferLength(_==null?void 0:_.len)+n;if(c>D)return;console.assert(r,"Subtitle track details are defined on idle subtitle stream controller tick");var O=r.fragments,k=O.length,F=r.edge,G=null,H=this.fragPrevious;if(y>>0,w>r-1)throw new DOMException("Failed to execute '"+S+"' on 'TimeRanges': The index provided ("+w+") is greater than the maximum bound ("+r+")");return d[w][S]};this.buffered={get length(){return d.length},end:function(S){return T("end",S,d.length)},start:function(S){return T("start",S,d.length)}}}},"./src/controller/subtitle-track-controller.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>m});var C=L("./src/events.ts"),P=L("./src/utils/texttrack-utils.ts"),M=L("./src/controller/base-playlist-controller.ts"),e=L("./src/types/loader.ts");function I(o,a){for(var i=0;i-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},i.pollTrackChange=function(E){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,E)},i.onMediaDetaching=function(){if(this.media){self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var E=v(this.media.textTracks);E.forEach(function(b){(0,P.clearCurrentCues)(b)}),this.subtitleTrack=-1,this.media=null}},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},i.onManifestParsed=function(E,b){this.tracks=b.subtitleTracks},i.onSubtitleTrackLoaded=function(E,b){var d=b.id,T=b.details,R=this.trackId,S=this.tracksInGroup[R];if(!S){this.warn("Invalid subtitle track id "+d);return}var w=S.details;S.details=b.details,this.log("subtitle track "+d+" loaded ["+T.startSN+"-"+T.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,b,w))},i.onLevelLoading=function(E,b){this.switchLevel(b.level)},i.onLevelSwitching=function(E,b){this.switchLevel(b.level)},i.switchLevel=function(E){var b=this.hls.levels[E];if(b!=null&&b.textGroupIds){var d=b.textGroupIds[b.urlId];if(this.groupId!==d){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,R=this.tracks.filter(function(r){return!d||r.groupId===d});this.tracksInGroup=R;var S=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=d;var w={subtitleTracks:R};this.log("Updating subtitle tracks, "+R.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(C.Events.SUBTITLE_TRACKS_UPDATED,w),S!==-1&&this.setSubtitleTrack(S,T)}}},i.findTrackId=function(E){for(var b=this.tracksInGroup,d=0;d=T.length)){this.clearTimer();var R=T[E];if(this.log("Switching to subtitle track "+E),this.trackId=E,R){var S=R.id,w=R.groupId,r=w===void 0?"":w,n=R.name,t=R.type,l=R.url;this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:r,name:n,type:t,url:l});var x=this.switchParams(R.url,b==null?void 0:b.details);this.loadPlaylist(x)}else this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:E})}},i.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!(!this.media||!this.hls.config.renderTextTracksNatively)){for(var E=-1,b=v(this.media.textTracks),d=0;d-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(E){this.selectDefaultTrack=!1;var b=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(E,b)}}]),a}(M.default);function v(o){for(var a=[],i=0;i{"use strict";L.r(N),L.d(N,{TimelineController:()=>u});var C=L("./src/polyfills/number.ts"),P=L("./src/events.ts"),M=L("./src/utils/cea-608-parser.ts"),e=L("./src/utils/output-filter.ts"),I=L("./src/utils/webvtt-parser.ts"),A=L("./src/utils/texttrack-utils.ts"),f=L("./src/utils/imsc1-ttml-parser.ts"),g=L("./src/utils/mp4-tools.ts"),h=L("./src/types/loader.ts"),p=L("./src/utils/logger.ts"),u=function(){function a(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var E=new e.default(this,"textTrack1"),b=new e.default(this,"textTrack2"),d=new e.default(this,"textTrack3"),T=new e.default(this,"textTrack4");this.cea608Parser1=new M.default(1,E,b),this.cea608Parser2=new M.default(3,d,T)}s.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(P.Events.FRAG_LOADING,this.onFragLoading,this),s.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=a.prototype;return i.destroy=function(){var E=this.hls;E.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(P.Events.FRAG_LOADING,this.onFragLoading,this),E.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),E.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),E.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),E.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(E,b,d,T,R){for(var S=!1,w=R.length;w--;){var r=R[w],n=m(r[0],r[1],b,d);if(n>=0&&(r[0]=Math.min(r[0],b),r[1]=Math.max(r[1],d),S=!0,n/(d-b)>.5))return}if(S||R.push([b,d]),this.config.renderTextTracksNatively){var t=this.captionsTracks[E];this.Cues.newCue(t,b,d,T)}else{var l=this.Cues.newCue(null,b,d,T);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:l,track:E})}},i.onInitPtsFound=function(E,b){var d=this,T=b.frag,R=b.id,S=b.initPTS,w=b.timescale,r=this.unparsedVttFrags;R==="main"&&(this.initPTS[T.cc]=S,this.timescale[T.cc]=w),r.length&&(this.unparsedVttFrags=[],r.forEach(function(n){d.onFragLoaded(P.Events.FRAG_LOADED,n)}))},i.getExistingTrack=function(E){var b=this.media;if(b)for(var d=0;d{"use strict";L.r(N),L.d(N,{default:()=>C});var C=function(){function P(e,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=I}var M=P.prototype;return M.decrypt=function(I,A){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},A,I)},P}()},"./src/crypt/aes-decryptor.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>M,removePadding:()=>P});var C=L("./src/utils/typed-array.ts");function P(e){var I=e.byteLength,A=I&&new DataView(e.buffer).getUint8(I-1);return A?(0,C.sliceUint8)(e,0,I-A):e}var M=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var I=e.prototype;return I.uint8ArrayToUint32Array_=function(f){for(var g=new DataView(f),h=new Uint32Array(4),p=0;p<4;p++)h[p]=g.getUint32(p*4);return h},I.initTable=function(){var f=this.sBox,g=this.invSBox,h=this.subMix,p=h[0],u=h[1],v=h[2],m=h[3],o=this.invSubMix,a=o[0],i=o[1],s=o[2],E=o[3],b=new Uint32Array(256),d=0,T=0,R=0;for(R=0;R<256;R++)R<128?b[R]=R<<1:b[R]=R<<1^283;for(R=0;R<256;R++){var S=T^T<<1^T<<2^T<<3^T<<4;S=S>>>8^S&255^99,f[d]=S,g[S]=d;var w=b[d],r=b[w],n=b[r],t=b[S]*257^S*16843008;p[d]=t<<24|t>>>8,u[d]=t<<16|t>>>16,v[d]=t<<8|t>>>24,m[d]=t,t=n*16843009^r*65537^w*257^d*16843008,a[S]=t<<24|t>>>8,i[S]=t<<16|t>>>16,s[S]=t<<8|t>>>24,E[S]=t,d?(d=w^b[b[b[n^w]]],T^=b[b[T]]):d=T=1}},I.expandKey=function(f){for(var g=this.uint8ArrayToUint32Array_(f),h=!0,p=0;p{"use strict";L.r(N),L.d(N,{default:()=>g});var C=L("./src/crypt/aes-crypto.ts"),P=L("./src/crypt/fast-aes-key.ts"),M=L("./src/crypt/aes-decryptor.ts"),e=L("./src/utils/logger.ts"),I=L("./src/utils/mp4-tools.ts"),A=L("./src/utils/typed-array.ts"),f=16,g=function(){function h(u,v){var m=v===void 0?{}:v,o=m.removePKCS7Padding,a=o===void 0?!0:o;if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=u.enableSoftwareAES,this.removePKCS7Padding=a,a)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(s){}this.subtle===null&&(this.useSoftware=!0)}var p=h.prototype;return p.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},p.isSync=function(){return this.useSoftware},p.flush=function(){var v=this.currentResult,m=this.remainderData;if(!v||m)return this.reset(),null;var o=new Uint8Array(v);return this.reset(),this.removePKCS7Padding?(0,M.removePadding)(o):o},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(v,m,o){var a=this;return this.useSoftware?new Promise(function(i,s){a.softwareDecrypt(new Uint8Array(v),m,o);var E=a.flush();E?i(E.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(v),m,o)},p.softwareDecrypt=function(v,m,o){var a=this.currentIV,i=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(v=(0,I.appendUint8Array)(s,v),this.remainderData=null);var E=this.getValidChunk(v);if(!E.length)return null;a&&(o=a);var b=this.softwareDecrypter;b||(b=this.softwareDecrypter=new M.default),b.expandKey(m);var d=i;return this.currentResult=b.decrypt(E.buffer,0,o),this.currentIV=(0,A.sliceUint8)(E,-16).buffer,d||null},p.webCryptoDecrypt=function(v,m,o){var a=this,i=this.subtle;return(this.key!==m||!this.fastAesKey)&&(this.key=m,this.fastAesKey=new P.default(i,m)),this.fastAesKey.expandKey().then(function(s){if(!i)return Promise.reject(new Error("web crypto not initialized"));a.logOnce("WebCrypto AES decrypt");var E=new C.default(i,new Uint8Array(o));return E.decrypt(v.buffer,s)}).catch(function(s){return e.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+s.name+": "+s.message),a.onWebCryptoError(v,m,o)})},p.onWebCryptoError=function(v,m,o){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(v,m,o);var a=this.flush();if(a)return a.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},p.getValidChunk=function(v){var m=v,o=v.length-v.length%f;return o!==v.length&&(m=(0,A.sliceUint8)(v,0,o),this.remainderData=(0,A.sliceUint8)(v,o)),m},p.logOnce=function(v){this.logEnabled&&(e.logger.log("[decrypter]: "+v),this.logEnabled=!1)},h}()},"./src/crypt/fast-aes-key.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>C});var C=function(){function P(e,I){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=I}var M=P.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>g});var C=L("./src/demux/base-audio-demuxer.ts"),P=L("./src/demux/adts.ts"),M=L("./src/utils/logger.ts"),e=L("./src/demux/id3.ts");function I(h,p){h.prototype=Object.create(p.prototype),h.prototype.constructor=h,A(h,p)}function A(h,p){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,m){return v.__proto__=m,v},A(h,p)}var f=function(h){I(p,h);function p(v,m){var o;return o=h.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=v,o.config=m,o}var u=p.prototype;return u.resetInitSegment=function(m,o,a,i){h.prototype.resetInitSegment.call(this,m,o,a,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(m){if(!m)return!1;for(var o=e.getID3Data(m,0)||[],a=o.length,i=m.length;a{"use strict";L.r(N),L.d(N,{appendFrame:()=>a,canGetFrameLength:()=>g,canParse:()=>p,getAudioConfig:()=>e,getFrameDuration:()=>m,getFullFrameLength:()=>f,getHeaderLength:()=>A,initTrackConfig:()=>v,isHeader:()=>h,isHeaderPattern:()=>I,parseFrameHeader:()=>o,probe:()=>u});var C=L("./src/utils/logger.ts"),P=L("./src/errors.ts"),M=L("./src/events.ts");function e(i,s,E,b){var d,T,R,S,w=navigator.userAgent.toLowerCase(),r=b,n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];d=((s[E+2]&192)>>>6)+1;var t=(s[E+2]&60)>>>2;if(t>n.length-1){i.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+t});return}return R=(s[E+2]&1)<<2,R|=(s[E+3]&192)>>>6,C.logger.log("manifest codec:"+b+", ADTS type:"+d+", samplingIndex:"+t),/firefox/i.test(w)?t>=6?(d=5,S=new Array(4),T=t-3):(d=2,S=new Array(2),T=t):w.indexOf("android")!==-1?(d=2,S=new Array(2),T=t):(d=5,S=new Array(4),b&&(b.indexOf("mp4a.40.29")!==-1||b.indexOf("mp4a.40.5")!==-1)||!b&&t>=6?T=t-3:((b&&b.indexOf("mp4a.40.2")!==-1&&(t>=6&&R===1||/vivaldi/i.test(w))||!b&&R===1)&&(d=2,S=new Array(2)),T=t)),S[0]=d<<3,S[0]|=(t&14)>>1,S[1]|=(t&1)<<7,S[1]|=R<<3,d===5&&(S[1]|=(T&14)>>1,S[2]=(T&1)<<7,S[2]|=8,S[3]=0),{config:S,samplerate:n[t],channelCount:R,codec:"mp4a.40."+d,manifestCodec:r}}function I(i,s){return i[s]===255&&(i[s+1]&246)===240}function A(i,s){return i[s+1]&1?7:9}function f(i,s){return(i[s+3]&3)<<11|i[s+4]<<3|(i[s+5]&224)>>>5}function g(i,s){return s+5=i.length)return!1;var b=f(i,s);if(b<=E)return!1;var d=s+b;return d===i.length||h(i,d)}return!1}function v(i,s,E,b,d){if(!i.samplerate){var T=e(s,E,b,d);if(!T)return;i.config=T.config,i.samplerate=T.samplerate,i.channelCount=T.channelCount,i.codec=T.codec,i.manifestCodec=T.manifestCodec,C.logger.log("parsed codec:"+i.codec+", rate:"+T.samplerate+", channels:"+T.channelCount)}}function m(i){return 9216e4/i}function o(i,s){var E=A(i,s);if(s+E<=i.length){var b=f(i,s)-E;if(b>0)return{headerLength:E,frameLength:b}}}function a(i,s,E,b,d){var T=m(i.samplerate),R=b+d*T,S=o(s,E),w;if(S){var r=S.frameLength,n=S.headerLength,t=n+r,l=Math.max(0,E+t-s.length);l?(w=new Uint8Array(t-n),w.set(s.subarray(E+n,s.length),0)):w=s.subarray(E+n,E+t);var x={unit:w,pts:R};return l||i.samples.push(x),{sample:x,length:t,missing:l}}var y=s.length-E;w=new Uint8Array(y),w.set(s.subarray(E,s.length),0);var c={unit:w,pts:R};return{sample:c,length:y,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>h,initPTSFn:()=>g});var C=L("./src/polyfills/number.ts"),P=L("./src/demux/id3.ts"),M=L("./src/types/demuxer.ts"),e=L("./src/demux/dummy-demuxed-track.ts"),I=L("./src/utils/mp4-tools.ts"),A=L("./src/utils/typed-array.ts"),f=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var u=p.prototype;return u.resetInitSegment=function(m,o,a,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},u.resetTimeStamp=function(m){this.initPTS=m,this.resetContiguity()},u.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},u.canParse=function(m,o){return!1},u.appendFrame=function(m,o,a){},u.demux=function(m,o){this.cachedData&&(m=(0,I.appendUint8Array)(this.cachedData,m),this.cachedData=null);var a=P.getID3Data(m,0),i=a?a.length:0,s,E=this._audioTrack,b=this._id3Track,d=a?P.getTimeStamp(a):void 0,T=m.length;for((this.basePTS===null||this.frameIndex===0&&(0,C.isFiniteNumber)(d))&&(this.basePTS=g(d,o,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),a&&a.length>0&&b.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:M.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});i{"use strict";L.r(N),L.d(N,{default:()=>C});var C=function(){function M(){this.chunks=[],this.dataLength=0}var e=M.prototype;return e.push=function(A){this.chunks.push(A),this.dataLength+=A.length},e.flush=function(){var A=this.chunks,f=this.dataLength,g;if(A.length)A.length===1?g=A[0]:g=P(A,f);else return new Uint8Array(0);return this.reset(),g},e.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function P(M,e){for(var I=new Uint8Array(e),A=0,f=0;f{"use strict";L.r(N),L.d(N,{dummyTrack:()=>C});function C(P,M){return P===void 0&&(P=""),M===void 0&&(M=9e4),{type:P,id:-1,pid:-1,inputTimeScale:M,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>M});var C=L("./src/utils/logger.ts"),P=function(){function e(A){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=A,this.bytesAvailable=A.byteLength,this.word=0,this.bitsAvailable=0}var I=e.prototype;return I.loadWord=function(){var f=this.data,g=this.bytesAvailable,h=f.byteLength-g,p=new Uint8Array(4),u=Math.min(4,g);if(u===0)throw new Error("no bytes available");p.set(f.subarray(h,h+u)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},I.skipBits=function(f){var g;f=Math.min(f,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>f?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,g=f>>3,f-=g<<3,this.bytesAvailable-=g,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},I.readBits=function(f){var g=Math.min(this.bitsAvailable,f),h=this.word>>>32-g;if(f>32&&C.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=g,this.bitsAvailable>0)this.word<<=g;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return g=f-g,g>0&&this.bitsAvailable?h<>>f)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},I.skipUEG=function(){this.skipBits(1+this.skipLZ())},I.skipEG=function(){this.skipBits(1+this.skipLZ())},I.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},I.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},I.readBoolean=function(){return this.readBits(1)===1},I.readUByte=function(){return this.readBits(8)},I.readUShort=function(){return this.readBits(16)},I.readUInt=function(){return this.readBits(32)},I.skipScalingList=function(f){for(var g=8,h=8,p,u=0;u{"use strict";L.r(N),L.d(N,{canParse:()=>I,decodeFrame:()=>p,getID3Data:()=>M,getID3Frames:()=>h,getTimeStamp:()=>A,isFooter:()=>P,isHeader:()=>C,isTimeStampFrame:()=>f,testables:()=>i,utf8ArrayToStr:()=>a});var C=function(d,T){return T+10<=d.length&&d[T]===73&&d[T+1]===68&&d[T+2]===51&&d[T+3]<255&&d[T+4]<255&&d[T+6]<128&&d[T+7]<128&&d[T+8]<128&&d[T+9]<128},P=function(d,T){return T+10<=d.length&&d[T]===51&&d[T+1]===68&&d[T+2]===73&&d[T+3]<255&&d[T+4]<255&&d[T+6]<128&&d[T+7]<128&&d[T+8]<128&&d[T+9]<128},M=function(d,T){for(var R=T,S=0;C(d,T);){S+=10;var w=e(d,T+6);S+=w,P(d,T+10)&&(S+=10),T+=S}if(S>0)return d.subarray(R,R+S)},e=function(d,T){var R=0;return R=(d[T]&127)<<21,R|=(d[T+1]&127)<<14,R|=(d[T+2]&127)<<7,R|=d[T+3]&127,R},I=function(d,T){return C(d,T)&&e(d,T+6)+10<=d.length-T},A=function(d){for(var T=h(d),R=0;R>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(n);break;case 12:case 13:t=d[y++],x+=String.fromCharCode((n&31)<<6|t&63);break;case 14:t=d[y++],l=d[y++],x+=String.fromCharCode((n&15)<<12|(t&63)<<6|(l&63)<<0);break;default:}}return x},i={decodeTextFrame:v},s;function E(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>g});var C=L("./src/demux/base-audio-demuxer.ts"),P=L("./src/demux/id3.ts"),M=L("./src/utils/logger.ts"),e=L("./src/demux/mpegaudio.ts");function I(h,p){h.prototype=Object.create(p.prototype),h.prototype.constructor=h,A(h,p)}function A(h,p){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,m){return v.__proto__=m,v},A(h,p)}var f=function(h){I(p,h);function p(){return h.apply(this,arguments)||this}var u=p.prototype;return u.resetInitSegment=function(m,o,a,i){h.prototype.resetInitSegment.call(this,m,o,a,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(m){if(!m)return!1;for(var o=P.getID3Data(m,0)||[],a=o.length,i=m.length;a{"use strict";L.r(N),L.d(N,{default:()=>f});var C=L("./src/polyfills/number.ts"),P=L("./src/types/demuxer.ts"),M=L("./src/utils/mp4-tools.ts"),e=L("./src/demux/dummy-demuxed-track.ts"),I=/\/emsg[-/]ID3/i,A=function(){function g(p,u){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=u}var h=g.prototype;return h.resetTimeStamp=function(){},h.resetInitSegment=function(u,v,m,o){var a=this.videoTrack=(0,e.dummyTrack)("video",1),i=this.audioTrack=(0,e.dummyTrack)("audio",1),s=this.txtTrack=(0,e.dummyTrack)("text",1);if(this.id3Track=(0,e.dummyTrack)("id3",1),this.timeOffset=0,!(!u||!u.byteLength)){var E=(0,M.parseInitSegment)(u);if(E.video){var b=E.video,d=b.id,T=b.timescale,R=b.codec;a.id=d,a.timescale=s.timescale=T,a.codec=R}if(E.audio){var S=E.audio,w=S.id,r=S.timescale,n=S.codec;i.id=w,i.timescale=r,i.codec=n}s.id=M.RemuxerTrackIdConfig.text,a.sampleDuration=0,a.duration=i.duration=o}},h.resetContiguity=function(){},g.probe=function(u){return u=u.length>16384?u.subarray(0,16384):u,(0,M.findBox)(u,["moof"]).length>0},h.demux=function(u,v){this.timeOffset=v;var m=u,o=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(m=(0,M.appendUint8Array)(this.remainderData,u));var i=(0,M.segmentValidRange)(m);this.remainderData=i.remainder,o.samples=i.valid||new Uint8Array}else o.samples=m;var s=this.extractID3Track(o,v);return a.samples=(0,M.parseSamples)(v,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},h.flush=function(){var u=this.timeOffset,v=this.videoTrack,m=this.txtTrack;v.samples=this.remainderData||new Uint8Array,this.remainderData=null;var o=this.extractID3Track(v,this.timeOffset);return m.samples=(0,M.parseSamples)(u,v),{videoTrack:v,audioTrack:(0,e.dummyTrack)(),id3Track:o,textTrack:(0,e.dummyTrack)()}},h.extractID3Track=function(u,v){var m=this.id3Track;if(u.samples.length){var o=(0,M.findBox)(u.samples,["emsg"]);o&&o.forEach(function(a){var i=(0,M.parseEmsg)(a);if(I.test(i.schemeIdUri)){var s=(0,C.isFiniteNumber)(i.presentationTime)?i.presentationTime/i.timeScale:v+i.presentationTimeDelta/i.timeScale,E=i.eventDuration===4294967295?Number.POSITIVE_INFINITY:i.eventDuration/i.timeScale;E<=.001&&(E=Number.POSITIVE_INFINITY);var b=i.payload;m.samples.push({data:b,len:b.byteLength,dts:s,pts:s,type:P.MetadataSchema.emsg,duration:E})}})}return m},h.demuxSampleAes=function(u,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},h.destroy=function(){},g}();const f=A},"./src/demux/mpegaudio.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{appendFrame:()=>A,canParse:()=>p,isHeader:()=>h,isHeaderPattern:()=>g,parseHeader:()=>f,probe:()=>u});var C=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],e=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function A(v,m,o,a,i){if(!(o+24>m.length)){var s=f(m,o);if(s&&o+s.frameLength<=m.length){var E=s.samplesPerFrame*9e4/s.sampleRate,b=a+i*E,d={unit:m.subarray(o,o+s.frameLength),pts:b,dts:b};return v.config=[],v.channelCount=s.channelCount,v.samplerate=s.sampleRate,v.samples.push(d),{sample:d,length:s.frameLength,missing:0}}}}function f(v,m){var o=v[m+1]>>3&3,a=v[m+1]>>1&3,i=v[m+2]>>4&15,s=v[m+2]>>2&3;if(o!==1&&i!==0&&i!==15&&s!==3){var E=v[m+2]>>1&1,b=v[m+3]>>6,d=o===3?3-a:a===3?3:4,T=P[d*14+i-1]*1e3,R=o===3?0:o===2?1:2,S=M[R*3+s],w=b===3?1:2,r=e[o][a],n=I[a],t=r*8*n,l=Math.floor(r*T/S+E)*n;if(C===null){var x=navigator.userAgent||"",y=x.match(/Chrome\/(\d+)/i);C=y?parseInt(y[1]):0}var c=!!C&&C<=87;return c&&a===2&&T>=224e3&&b===0&&(v[m+3]=v[m+3]|128),{sampleRate:S,channelCount:w,frameLength:l,samplesPerFrame:t}}}function g(v,m){return v[m]===255&&(v[m+1]&224)===224&&(v[m+1]&6)!==0}function h(v,m){return m+1{"use strict";L.r(N),L.d(N,{default:()=>e});var C=L("./src/crypt/decrypter.ts"),P=L("./src/utils/mp4-tools.ts"),M=function(){function I(f,g,h){this.keyData=void 0,this.decrypter=void 0,this.keyData=h,this.decrypter=new C.default(g,{removePKCS7Padding:!1})}var A=I.prototype;return A.decryptBuffer=function(g){return this.decrypter.decrypt(g,this.keyData.key.buffer,this.keyData.iv.buffer)},A.decryptAacSample=function(g,h,p){var u=this,v=g[h].unit;if(!(v.length<=16)){var m=v.subarray(16,v.length-v.length%16),o=m.buffer.slice(m.byteOffset,m.byteOffset+m.length);this.decryptBuffer(o).then(function(a){var i=new Uint8Array(a);v.set(i,16),u.decrypter.isSync()||u.decryptAacSamples(g,h+1,p)})}},A.decryptAacSamples=function(g,h,p){for(;;h++){if(h>=g.length){p();return}if(!(g[h].unit.length<32)&&(this.decryptAacSample(g,h,p),!this.decrypter.isSync()))return}},A.getAvcEncryptedData=function(g){for(var h=Math.floor((g.length-48)/160)*16+16,p=new Int8Array(h),u=0,v=32;v=g.length){u();return}for(var v=g[h].units;!(p>=v.length);p++){var m=v[p];if(!(m.data.length<=48||m.type!==1&&m.type!==5)&&(this.decryptAvcSample(g,h,p,u,m),!this.decrypter.isSync()))return}}},I}();const e=M},"./src/demux/transmuxer-interface.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>p});var C=L("./src/demux/webworkify-webpack.js"),P=L("./src/events.ts"),M=L("./src/demux/transmuxer.ts"),e=L("./src/utils/logger.ts"),I=L("./src/errors.ts"),A=L("./src/utils/mediasource-helper.ts"),f=L("./node_modules/eventemitter3/index.js"),g=L.n(f),h=(0,A.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function u(m,o,a,i){var s=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var E=m.config;this.hls=m,this.id=o,this.useWorker=!!E.enableWorker,this.onTransmuxComplete=a,this.onFlush=i;var b=function(w,r){r=r||{},r.frag=s.frag,r.id=s.id,s.hls.trigger(w,r)};this.observer=new f.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,b),this.observer.on(P.Events.ERROR,b);var d={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){e.logger.log("demuxing in webworker");var R;try{R=this.worker=(0,C.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),R.addEventListener("message",this.onwmsg),R.onerror=function(S){s.useWorker=!1,e.logger.warn("Exception in webworker, fallback to inline"),s.hls.trigger(P.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},R.postMessage({cmd:"init",typeSupported:d,vendor:T,id:o,config:JSON.stringify(E)})}catch(S){e.logger.warn("Error in worker:",S),e.logger.error("Error while initializing DemuxerWorker, fallback to inline"),R&&self.URL.revokeObjectURL(R.objectURL),this.transmuxer=new M.default(this.observer,d,E,T,o),this.worker=null}}else this.transmuxer=new M.default(this.observer,d,E,T,o)}var v=u.prototype;return v.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null,this.onwmsg=void 0;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},v.push=function(o,a,i,s,E,b,d,T,R,S){var w,r,n=this;R.transmuxing.start=self.performance.now();var t=this.transmuxer,l=this.worker,x=b?b.start:E.start,y=E.decryptdata,c=this.frag,_=!(c&&E.cc===c.cc),D=!(c&&R.level===c.level),O=c?R.sn-c.sn:-1,k=this.part?R.part-this.part.index:-1,F=O===0&&R.id>1&&R.id===(c==null?void 0:c.stats.chunkCount),G=!D&&(O===1||O===0&&(k===1||F&&k<=0)),H=self.performance.now();(D||O||E.stats.parsing.start===0)&&(E.stats.parsing.start=H),b&&(k||!G)&&(b.stats.parsing.start=H);var j=!(c&&((w=E.initSegment)===null||w===void 0?void 0:w.url)===((r=c.initSegment)===null||r===void 0?void 0:r.url)),Q=new M.TransmuxState(_,G,T,D,x,j);if(!G||_||j){e.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+R.sn+" p: "+R.part+" level: "+R.level+" id: "+R.id+` discontinuity: `+_+` trackSwitch: `+D+` contiguous: `+G+` accurateTimeOffset: `+T+` timeOffset: `+x+` initSegmentChange: `+j);var ee=new M.TransmuxConfig(i,s,a,d,S);this.configureTransmuxer(ee)}if(this.frag=E,this.part=b,l)l.postMessage({cmd:"demux",data:o,decryptdata:y,chunkMeta:R,state:Q},o instanceof ArrayBuffer?[o]:[]);else if(t){var ie=t.push(o,y,R,Q);(0,M.isPromise)(ie)?(t.async=!0,ie.then(function(se){n.handleTransmuxComplete(se)}).catch(function(se){n.transmuxerError(se,R,"transmuxer-interface push error")})):(t.async=!1,this.handleTransmuxComplete(ie))}},v.flush=function(o){var a=this;o.transmuxing.start=self.performance.now();var i=this.transmuxer,s=this.worker;if(s)s.postMessage({cmd:"flush",chunkMeta:o});else if(i){var E=i.flush(o),b=(0,M.isPromise)(E);b||i.async?((0,M.isPromise)(E)||(E=Promise.resolve(E)),E.then(function(d){a.handleFlushResult(d,o)}).catch(function(d){a.transmuxerError(d,o,"transmuxer-interface flush error")})):this.handleFlushResult(E,o)}},v.transmuxerError=function(o,a,i){this.hls&&this.hls.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:a,fatal:!1,error:o,err:o,reason:i})},v.handleFlushResult=function(o,a){var i=this;o.forEach(function(s){i.handleTransmuxComplete(s)}),this.onFlush(a)},v.onWorkerMessage=function(o){var a=o.data,i=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}case"workerLog":e.logger[a.data.logType]&&e.logger[a.data.logType](a.data.message);break;default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,i.trigger(a.event,a.data);break}}},v.configureTransmuxer=function(o){var a=this.worker,i=this.transmuxer;a?a.postMessage({cmd:"configure",config:o}):i&&i.configure(o)},v.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},u}()},"./src/demux/transmuxer-worker.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>f});var C=L("./src/demux/transmuxer.ts"),P=L("./src/events.ts"),M=L("./src/utils/logger.ts"),e=L("./node_modules/eventemitter3/index.js"),I=L.n(e),A=L("./src/errors.ts");function f(v){var m=new e.EventEmitter,o=function(s,E){v.postMessage({event:s,data:E})};m.on(P.Events.FRAG_DECRYPTED,o),m.on(P.Events.ERROR,o);var a=function(){var s=function(d){var T=function(S){o("workerLog",{logType:d,message:S})};M.logger[d]=T};for(var E in M.logger)s(E)};v.addEventListener("message",function(i){var s=i.data;switch(s.cmd){case"init":{var E=JSON.parse(s.config);v.transmuxer=new C.default(m,s.typeSupported,E,s.vendor,s.id),(0,M.enableLogs)(E.debug,s.id),a(),o("init",null);break}case"configure":{v.transmuxer.configure(s.config);break}case"demux":{var b=v.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);(0,C.isPromise)(b)?(v.transmuxer.async=!0,b.then(function(S){g(v,S)}).catch(function(S){o(P.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:s.chunkMeta,fatal:!1,error:S,err:S,reason:"transmuxer-worker push error"})})):(v.transmuxer.async=!1,g(v,b));break}case"flush":{var d=s.chunkMeta,T=v.transmuxer.flush(d),R=(0,C.isPromise)(T);R||v.transmuxer.async?((0,C.isPromise)(T)||(T=Promise.resolve(T)),T.then(function(S){p(v,S,d)}).catch(function(S){o(P.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:s.chunkMeta,fatal:!1,error:S,err:S,reason:"transmuxer-worker flush error"})})):p(v,T,d);break}default:break}})}function g(v,m){if(u(m.remuxResult))return!1;var o=[],a=m.remuxResult,i=a.audio,s=a.video;return i&&h(o,i),s&&h(o,s),v.postMessage({event:"transmuxComplete",data:m},o),!0}function h(v,m){m.data1&&v.push(m.data1.buffer),m.data2&&v.push(m.data2.buffer)}function p(v,m,o){var a=m.reduce(function(i,s){return g(v,s)||i},!1);a||v.postMessage({event:"transmuxComplete",data:m[0]}),v.postMessage({event:"flush",data:o})}function u(v){return!v.audio&&!v.video&&!v.text&&!v.id3&&!v.initSegment}},"./src/demux/transmuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{TransmuxConfig:()=>s,TransmuxState:()=>E,default:()=>m,isPromise:()=>i});var C=L("./src/events.ts"),P=L("./src/errors.ts"),M=L("./src/crypt/decrypter.ts"),e=L("./src/demux/aacdemuxer.ts"),I=L("./src/demux/mp4demuxer.ts"),A=L("./src/demux/tsdemuxer.ts"),f=L("./src/demux/mp3demuxer.ts"),g=L("./src/remux/mp4-remuxer.ts"),h=L("./src/remux/passthrough-remuxer.ts"),p=L("./src/utils/logger.ts"),u;try{u=self.performance.now.bind(self.performance)}catch(b){p.logger.debug("Unable to use Performance API on this environment"),u=self.Date.now}var v=[{demux:I.default,remux:h.default},{demux:A.default,remux:g.default},{demux:e.default,remux:g.default},{demux:f.default,remux:g.default}],m=function(){function b(T,R,S,w,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=T,this.typeSupported=R,this.config=S,this.vendor=w,this.id=r}var d=b.prototype;return d.configure=function(R){this.transmuxConfig=R,this.decrypter&&this.decrypter.reset()},d.push=function(R,S,w,r){var n=this,t=w.transmuxing;t.executeStart=u();var l=new Uint8Array(R),x=this.currentTransmuxState,y=this.transmuxConfig;r&&(this.currentTransmuxState=r);var c=r||x,_=c.contiguous,D=c.discontinuity,O=c.trackSwitch,k=c.accurateTimeOffset,F=c.timeOffset,G=c.initSegmentChange,H=y.audioCodec,j=y.videoCodec,Q=y.defaultInitPts,ee=y.duration,ie=y.initSegmentData,se=o(l,S);if(se&&se.method==="AES-128"){var le=this.getDecrypter();if(le.isSync()){var xe=le.softwareDecrypt(l,se.key.buffer,se.iv.buffer),Re=w.part>-1;if(Re&&(xe=le.flush()),!xe)return t.executeEnd=u(),a(w);l=new Uint8Array(xe)}else return this.decryptionPromise=le.webCryptoDecrypt(l,se.key.buffer,se.iv.buffer).then(function(Ce){var Ue=n.push(Ce,null,w);return n.decryptionPromise=null,Ue}),this.decryptionPromise}var Ee=this.needsProbing(D,O);Ee&&this.configureTransmuxer(l),(D||O||G||Ee)&&this.resetInitSegment(ie,H,j,ee,S),(D||G||Ee)&&this.resetInitialTimestamp(Q),_||this.resetContiguity();var he=this.transmux(l,se,F,k,w),be=this.currentTransmuxState;return be.contiguous=!0,be.discontinuity=!1,be.trackSwitch=!1,t.executeEnd=u(),he},d.flush=function(R){var S=this,w=R.transmuxing;w.executeStart=u();var r=this.decrypter,n=this.currentTransmuxState,t=this.decryptionPromise;if(t)return t.then(function(){return S.flush(R)});var l=[],x=n.timeOffset;if(r){var y=r.flush();y&&l.push(this.push(y,null,R))}var c=this.demuxer,_=this.remuxer;if(!c||!_)return this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=u(),[a(R)];var D=c.flush(x);return i(D)?D.then(function(O){return S.flushRemux(l,O,R),l}):(this.flushRemux(l,D,R),l)},d.flushRemux=function(R,S,w){var r=S.audioTrack,n=S.videoTrack,t=S.id3Track,l=S.textTrack,x=this.currentTransmuxState,y=x.accurateTimeOffset,c=x.timeOffset;p.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var _=this.remuxer.remux(r,n,t,l,c,y,!0,this.id);R.push({remuxResult:_,chunkMeta:w}),w.transmuxing.executeEnd=u()},d.resetInitialTimestamp=function(R){var S=this.demuxer,w=this.remuxer;!S||!w||(S.resetTimeStamp(R),w.resetTimeStamp(R))},d.resetContiguity=function(){var R=this.demuxer,S=this.remuxer;!R||!S||(R.resetContiguity(),S.resetNextTimestamp())},d.resetInitSegment=function(R,S,w,r,n){var t=this.demuxer,l=this.remuxer;!t||!l||(t.resetInitSegment(R,S,w,r),l.resetInitSegment(R,S,w,n))},d.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},d.transmux=function(R,S,w,r,n){var t;return S&&S.method==="SAMPLE-AES"?t=this.transmuxSampleAes(R,S,w,r,n):t=this.transmuxUnencrypted(R,w,r,n),t},d.transmuxUnencrypted=function(R,S,w,r){var n=this.demuxer.demux(R,S,!1,!this.config.progressive),t=n.audioTrack,l=n.videoTrack,x=n.id3Track,y=n.textTrack,c=this.remuxer.remux(t,l,x,y,S,w,!1,this.id);return{remuxResult:c,chunkMeta:r}},d.transmuxSampleAes=function(R,S,w,r,n){var t=this;return this.demuxer.demuxSampleAes(R,S,w).then(function(l){var x=t.remuxer.remux(l.audioTrack,l.videoTrack,l.id3Track,l.textTrack,w,r,!1,t.id);return{remuxResult:x,chunkMeta:n}})},d.configureTransmuxer=function(R){for(var S=this.config,w=this.observer,r=this.typeSupported,n=this.vendor,t,l=0,x=v.length;l0&&d!=null&&d.key!=null&&d.iv!==null&&d.method!=null&&(T=d),T}var a=function(d){return{remuxResult:{},chunkMeta:d}};function i(b){return"then"in b&&b.then instanceof Function}var s=function(d,T,R,S,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=d,this.videoCodec=T,this.initSegmentData=R,this.duration=S,this.defaultInitPts=w},E=function(d,T,R,S,w,r){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=d,this.contiguous=T,this.accurateTimeOffset=R,this.trackSwitch=S,this.timeOffset=w,this.initSegmentChange=r}},"./src/demux/tsdemuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>b});var C=L("./src/demux/adts.ts"),P=L("./src/demux/mpegaudio.ts"),M=L("./src/demux/exp-golomb.ts"),e=L("./src/demux/sample-aes.ts"),I=L("./src/events.ts"),A=L("./src/utils/mp4-tools.ts"),f=L("./src/utils/logger.ts"),g=L("./src/errors.ts"),h=L("./src/types/demuxer.ts");function p(){return p=Object.assign?Object.assign.bind():function(d){for(var T=1;T0&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w),w!==-1},d.syncOffset=function(S){for(var w=S.length,r=Math.min(u*5,S.length-u)+1,n=0;nr)return n;n++}return-1},d.createTrack=function(S,w){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:A.RemuxerTrackIdConfig[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?w:void 0}};var T=d.prototype;return T.resetInitSegment=function(S,w,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=d.createTrack("video"),this._audioTrack=d.createTrack("audio",n),this._id3Track=d.createTrack("id3"),this._txtTrack=d.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=w,this.videoCodec=r,this._duration=n},T.resetTimeStamp=function(){},T.resetContiguity=function(){var S=this._audioTrack,w=this._avcTrack,r=this._id3Track;S&&(S.pesData=null),w&&(w.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},T.demux=function(S,w,r,n){r===void 0&&(r=!1),n===void 0&&(n=!1),r||(this.sampleAes=null);var t,l=this._avcTrack,x=this._audioTrack,y=this._id3Track,c=this._txtTrack,_=l.pid,D=l.pesData,O=x.pid,k=y.pid,F=x.pesData,G=y.pesData,H=null,j=this.pmtParsed,Q=this._pmtId,ee=S.length;if(this.remainderData&&(S=(0,A.appendUint8Array)(this.remainderData,S),ee=S.length,this.remainderData=null),ee>4,he=void 0;if(Ee>1){if(he=le+5+S[le+4],he===le+u)continue}else he=le+4;switch(Re){case _:xe&&(D&&(t=s(D))&&this.parseAVCPES(l,c,t,!1),D={data:[],size:0}),D&&(D.data.push(S.subarray(he,le+u)),D.size+=le+u-he);break;case O:if(xe){if(F&&(t=s(F)))switch(x.segmentCodec){case"aac":this.parseAACPES(x,t);break;case"mp3":this.parseMPEGPES(x,t);break}F={data:[],size:0}}F&&(F.data.push(S.subarray(he,le+u)),F.size+=le+u-he);break;case k:xe&&(G&&(t=s(G))&&this.parseID3PES(y,t),G={data:[],size:0}),G&&(G.data.push(S.subarray(he,le+u)),G.size+=le+u-he);break;case 0:xe&&(he+=S[he]+1),Q=this._pmtId=a(S,he);break;case Q:{xe&&(he+=S[he]+1);var be=i(S,he,this.typeSupported,r);_=be.avc,_>0&&(l.pid=_),O=be.audio,O>0&&(x.pid=O,x.segmentCodec=be.segmentCodec),k=be.id3,k>0&&(y.pid=k),H!==null&&!j&&(f.logger.warn("MPEG-TS PMT found at "+le+" after unknown PID '"+H+"'. Backtracking to sync byte @"+ie+" to parse all TS packets."),H=null,le=ie-188),j=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=Re;break}}else se++;se>0&&this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+se+" TS packet/s that do not start with 0x47"}),l.pesData=D,x.pesData=F,y.pesData=G;var Ce={audioTrack:x,videoTrack:l,id3Track:y,textTrack:c};return n&&this.extractRemainingSamples(Ce),Ce},T.flush=function(){var S=this.remainderData;this.remainderData=null;var w;return S?w=this.demux(S,-1,!1,!0):w={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},T.extractRemainingSamples=function(S){var w=S.audioTrack,r=S.videoTrack,n=S.id3Track,t=S.textTrack,l=r.pesData,x=w.pesData,y=n.pesData,c;if(l&&(c=s(l))?(this.parseAVCPES(r,t,c,!0),r.pesData=null):r.pesData=l,x&&(c=s(x))){switch(w.segmentCodec){case"aac":this.parseAACPES(w,c);break;case"mp3":this.parseMPEGPES(w,c);break}w.pesData=null}else x!=null&&x.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=x;y&&(c=s(y))?(this.parseID3PES(n,c),n.pesData=null):n.pesData=y},T.demuxSampleAes=function(S,w,r){var n=this.demux(S,r,!0,!this.config.progressive),t=this.sampleAes=new e.default(this.observer,this.config,w);return this.decrypt(n,t)},T.decrypt=function(S,w){return new Promise(function(r){var n=S.audioTrack,t=S.videoTrack;n.samples&&n.segmentCodec==="aac"?w.decryptAacSamples(n.samples,0,function(){t.samples?w.decryptAvcSamples(t.samples,0,0,function(){r(S)}):r(S)}):t.samples&&w.decryptAvcSamples(t.samples,0,0,function(){r(S)})})},T.destroy=function(){this._duration=0},T.parseAVCPES=function(S,w,r,n){var t=this,l=this.parseAVCNALu(S,r.data),x=!1,y=this.avcSample,c,_=!1;r.data=null,y&&l.length&&!S.audFound&&(E(y,S),y=this.avcSample=m(!1,r.pts,r.dts,"")),l.forEach(function(D){switch(D.type){case 1:{c=!0,y||(y=t.avcSample=m(!0,r.pts,r.dts,"")),x&&(y.debug+="NDR "),y.frame=!0;var O=D.data;if(_&&O.length>4){var k=new M.default(O).readSliceType();(k===2||k===4||k===7||k===9)&&(y.key=!0)}break}case 5:c=!0,y||(y=t.avcSample=m(!0,r.pts,r.dts,"")),x&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{c=!0,x&&y&&(y.debug+="SEI "),(0,A.parseSEIMessageFromNALu)(D.data,1,r.pts,w.samples);break}case 7:if(c=!0,_=!0,x&&y&&(y.debug+="SPS "),!S.sps){var F=new M.default(D.data),G=F.readSPS();S.width=G.width,S.height=G.height,S.pixelRatio=G.pixelRatio,S.sps=[D.data],S.duration=t._duration;for(var H=D.data.subarray(1,4),j="avc1.",Q=0;Q<3;Q++){var ee=H[Q].toString(16);ee.length<2&&(ee="0"+ee),j+=ee}S.codec=j}break;case 8:c=!0,x&&y&&(y.debug+="PPS "),S.pps||(S.pps=[D.data]);break;case 9:c=!1,S.audFound=!0,y&&E(y,S),y=t.avcSample=m(!1,r.pts,r.dts,x?"AUD ":"");break;case 12:c=!0;break;default:c=!1,y&&(y.debug+="unknown NAL "+D.type+" ");break}if(y&&c){var ie=y.units;ie.push(D)}}),n&&y&&(E(y,S),this.avcSample=null)},T.getLastNalUnit=function(S){var w,r=this.avcSample,n;if((!r||r.units.length===0)&&(r=S[S.length-1]),(w=r)!==null&&w!==void 0&&w.units){var t=r.units;n=t[t.length-1]}return n},T.parseAVCNALu=function(S,w){var r=w.byteLength,n=S.naluState||0,t=n,l=[],x=0,y,c,_,D=-1,O=0;for(n===-1&&(D=0,O=w[0]&31,n=0,x=1);x=0){var k={data:w.subarray(D,x-n-1),type:O};l.push(k)}else{var F=this.getLastNalUnit(S.samples);if(F&&(t&&x<=4-t&&F.state&&(F.data=F.data.subarray(0,F.data.byteLength-t)),c=x-n-1,c>0)){var G=new Uint8Array(F.data.byteLength+c);G.set(F.data,0),G.set(w.subarray(0,c),F.data.byteLength),F.data=G,F.state=0}}x=0&&n>=0){var H={data:w.subarray(D,r),type:O,state:n};l.push(H)}if(l.length===0){var j=this.getLastNalUnit(S.samples);if(j){var Q=new Uint8Array(j.data.byteLength+w.byteLength);Q.set(j.data,0),Q.set(w,j.data.byteLength),j.data=Q}}return S.naluState=n,l},T.parseAACPES=function(S,w){var r=0,n=this.aacOverFlow,t=w.data;if(n){this.aacOverFlow=null;var l=n.missing,x=n.sample.unit.byteLength;if(l===-1){var y=new Uint8Array(x+t.byteLength);y.set(n.sample.unit,0),y.set(t,x),t=y}else{var c=x-l;n.sample.unit.set(t.subarray(0,l),c),S.samples.push(n.sample),r=n.missing}}var _,D;for(_=r,D=t.length;_1;){var l=new Uint8Array(t[0].length+t[1].length);l.set(t[0]),l.set(t[1],t[0].length),t[0]=l,t.splice(1,1)}R=t[0];var x=(R[0]<<16)+(R[1]<<8)+R[2];if(x===1){if(S=(R[4]<<8)+R[5],S&&S>d.size-6)return null;var y=R[7];y&192&&(r=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,y&64?(n=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,r-n>54e5&&(f.logger.warn(Math.round((r-n)/9e4)+"s delta between PTS and DTS, align them"),r=n)):n=r),w=R[8];var c=w+9;if(d.size<=c)return null;d.size-=c;for(var _=new Uint8Array(d.size),D=0,O=t.length;Dk){c-=k;continue}else R=R.subarray(c),k-=c,c=0;_.set(R,T),T+=k}return S&&(S-=w+3),{data:_,pts:r,dts:n,len:S}}return null}function E(d,T){if(d.units.length&&d.frame){if(d.pts===void 0){var R=T.samples,S=R.length;if(S){var w=R[S-1];d.pts=w.pts,d.dts=w.dts}else{T.dropped++;return}}T.samples.push(d)}d.debug.length&&f.logger.log(d.pts+"/"+d.dts+":"+d.debug)}const b=v},"./src/demux/webworkify-webpack.js":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>u});var C=function(){var m=ENTRY_MODULE,o={},a=function s(E){var b=o[E];if(b!==void 0)return b.exports;var d=o[E]={exports:{}};return m[E].call(d.exports,d,d.exports,s),d.exports};a.m=m,function(){a.n=function(s){var E=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(E,{a:E}),E}}(),function(){a.d=function(s,E){for(var b in E)a.o(E,b)&&!a.o(s,b)&&Object.defineProperty(s,b,{enumerable:!0,get:E[b]})}}(),function(){a.o=function(s,E){return Object.prototype.hasOwnProperty.call(s,E)}}(),function(){a.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}}();var i=a(ENTRY_MODULE);return i.default||i},P=C.toString().split("ENTRY_MODULE"),M="[\\.|\\-|\\+|\\w|/|@]+",e="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function I(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function A(v){return!isNaN(1*v)}function f(v,m,o){var a={};a[o]=[];var i=m.toString().replace(/^"[^"]+"/,"function"),s=i.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||i.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return a;for(var E=s[1],b=new RegExp("(\\\\n|\\W)"+I(E)+e,"g"),d;d=b.exec(i);)d[3]!=="dll-reference"&&a[o].push(d[3]);for(b=new RegExp("\\("+I(E)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+e,"g");d=b.exec(i);)v[d[2]]||(a[o].push(d[1]),v[d[2]]=L(d[1]).m),a[d[2]]=a[d[2]]||[],a[d[2]].push(d[4]);for(var T=Object.keys(a),R=0;R0},!1)}function h(v,m){for(var o={main:[m]},a={main:[]},i={main:{}};g(o);)for(var s=Object.keys(o),E=0;E{"use strict";L.r(N),L.d(N,{ErrorDetails:()=>P,ErrorTypes:()=>C});var C;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(C||(C={}));var P;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",M.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",M.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",M.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",M.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{Events:()=>C});var C;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(C||(C={}))},"./src/hls.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>R});var C=L("./node_modules/url-toolkit/src/url-toolkit.js"),P=L.n(C),M=L("./src/loader/playlist-loader.ts"),e=L("./src/controller/id3-track-controller.ts"),I=L("./src/controller/latency-controller.ts"),A=L("./src/controller/level-controller.ts"),f=L("./src/controller/fragment-tracker.ts"),g=L("./src/loader/key-loader.ts"),h=L("./src/controller/stream-controller.ts"),p=L("./src/is-supported.ts"),u=L("./src/utils/logger.ts"),v=L("./src/config.ts"),m=L("./node_modules/eventemitter3/index.js"),o=L.n(m),a=L("./src/events.ts"),i=L("./src/errors.ts"),s=L("./src/types/level.ts");function E(S,w){for(var r=0;r-1&&(this._maxHdcpLevel=n)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var n=this.levels,t=this.config.minAutoBitrate;if(!n)return 0;for(var l=n.length,x=0;x=t)return x;return 0}},{key:"maxAutoLevel",get:function(){var n=this.levels,t=this.autoLevelCapping,l=this.maxHdcpLevel,x;if(t===-1&&n&&n.length?x=n.length-1:x=t,l)for(var y=x;y--;){var c=n[y].attrs["HDCP-LEVEL"];if(c&&c<=l)return y}return x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(n){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,n)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var n=this.audioTrackController;return n?n.audioTracks:[]}},{key:"audioTrack",get:function(){var n=this.audioTrackController;return n?n.audioTrack:-1},set:function(n){var t=this.audioTrackController;t&&(t.audioTrack=n)}},{key:"subtitleTracks",get:function(){var n=this.subtitleTrackController;return n?n.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var n=this.subtitleTrackController;return n?n.subtitleTrack:-1},set:function(n){var t=this.subtitleTrackController;t&&(t.subtitleTrack=n)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var n=this.subtitleTrackController;return n?n.subtitleDisplay:!1},set:function(n){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=n)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(n){this.config.lowLatencyMode=n}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.3.5"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:v.hlsDefaultConfig},set:function(n){S.defaultConfig=n}}]),S}();R.defaultConfig=void 0},"./src/is-supported.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{changeTypeSupported:()=>e,isSupported:()=>M});var C=L("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var I=(0,C.getMediaSource)();if(!I)return!1;var A=P(),f=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!A||A.prototype&&typeof A.prototype.appendBuffer=="function"&&typeof A.prototype.remove=="function";return!!f&&!!g}function e(){var I,A=P();return typeof(A==null||(I=A.prototype)===null||I===void 0?void 0:I.changeType)=="function"}},"./src/loader/date-range.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{DateRange:()=>p,DateRangeAttribute:()=>h});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/attr-list.ts"),M=L("./src/utils/logger.ts");function e(){return e=Object.assign?Object.assign.bind():function(u){for(var v=1;v=0)&&(!this.endOnNext||!!this.class)}}]),u}()},"./src/loader/fragment-loader.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{LoadError:()=>m,default:()=>u});var C=L("./src/polyfills/number.ts"),P=L("./src/errors.ts");function M(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,g(o,a)}function e(o){var a=typeof Map=="function"?new Map:void 0;return e=function(s){if(s===null||!f(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,E)}function E(){return I(s,arguments,h(this).constructor)}return E.prototype=Object.create(s.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),g(E,s)},e(o)}function I(o,a,i){return A()?I=Reflect.construct.bind():I=function(E,b,d){var T=[null];T.push.apply(T,b);var R=Function.bind.apply(E,T),S=new R;return d&&g(S,d.prototype),S},I.apply(null,arguments)}function A(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function f(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function g(o,a){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,E){return s.__proto__=E,s},g(o,a)}function h(o){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},h(o)}var p=Math.pow(2,17),u=function(){function o(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var a=o.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,E){var b=this,d=s.url;if(!d)return Promise.reject(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(d?"part list":"url")));this.abort();var T=this.config,R=T.fLoader,S=T.loader;return new Promise(function(w,r){b.loader&&b.loader.destroy();var n=b.loader=s.loader=R?new R(T):new S(T),t=v(s),l={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:s.sn==="initSegment"?1/0:p};s.stats=n.stats,n.load(t,l,{onSuccess:function(y,c,_,D){b.resetLoader(s,n);var O=y.data;_.resetIV&&s.decryptdata&&(s.decryptdata.iv=new Uint8Array(O.slice(0,16)),O=O.slice(16)),w({frag:s,part:null,payload:O,networkDetails:D})},onError:function(y,c,_){b.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:y,networkDetails:_}))},onAbort:function(y,c,_){b.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:_}))},onTimeout:function(y,c,_){b.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:_}))},onProgress:function(y,c,_,D){E&&E({frag:s,part:null,payload:_,networkDetails:D})}})})},a.loadPart=function(s,E,b){var d=this;this.abort();var T=this.config,R=T.fLoader,S=T.loader;return new Promise(function(w,r){d.loader&&d.loader.destroy();var n=d.loader=s.loader=R?new R(T):new S(T),t=v(s,E),l={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:p};E.stats=n.stats,n.load(t,l,{onSuccess:function(y,c,_,D){d.resetLoader(s,n),d.updateStatsFromPart(s,E);var O={frag:s,part:E,payload:y.data,networkDetails:D};b(O),w(O)},onError:function(y,c,_){d.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:E,response:y,networkDetails:_}))},onAbort:function(y,c,_){s.stats.aborted=E.stats.aborted,d.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:E,networkDetails:_}))},onTimeout:function(y,c,_){d.resetLoader(s,n),r(new m({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:E,networkDetails:_}))}})})},a.updateStatsFromPart=function(s,E){var b=s.stats,d=E.stats,T=d.total;if(b.loaded+=d.loaded,T){var R=Math.round(s.duration/E.duration),S=Math.min(Math.round(b.loaded/T),R),w=R-S,r=w*Math.round(b.loaded/S);b.total=b.loaded+r}else b.total=Math.max(b.loaded,b.total);var n=b.loading,t=d.loading;n.start?n.first+=t.first-t.start:(n.start=t.start,n.first=t.first),n.end=t.end},a.resetLoader=function(s,E){s.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},o}();function v(o,a){a===void 0&&(a=null);var i=a||o,s={frag:o,part:a,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},E=i.byteRangeStartOffset,b=i.byteRangeEndOffset;if((0,C.isFiniteNumber)(E)&&(0,C.isFiniteNumber)(b)){var d,T=E,R=b;if(o.sn==="initSegment"&&((d=o.decryptdata)===null||d===void 0?void 0:d.method)==="AES-128"){var S=b-E;S%16&&(R=b+(16-S%16)),E!==0&&(s.resetIV=!0,T=E-16)}s.rangeStart=T,s.rangeEnd=R}return s}var m=function(o){M(a,o);function a(i){for(var s,E=arguments.length,b=new Array(E>1?E-1:0),d=1;d{"use strict";L.r(N),L.d(N,{BaseSegment:()=>v,ElementaryStreamTypes:()=>u,Fragment:()=>m,Part:()=>o});var C=L("./src/polyfills/number.ts"),P=L("./node_modules/url-toolkit/src/url-toolkit.js"),M=L.n(P),e=L("./src/loader/load-stats.ts");function I(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,A(a,i)}function A(a,i){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,b){return E.__proto__=b,E},A(a,i)}function f(a,i){for(var s=0;s1||T===1&&this.levelkeys[d[0]].encrypted)return!0}return!1}}]),i}(v),o=function(a){I(i,a);function i(s,E,b,d,T){var R;R=a.call(this,b)||this,R.fragOffset=0,R.duration=0,R.gap=!1,R.independent=!1,R.relurl=void 0,R.fragment=void 0,R.index=void 0,R.stats=new e.LoadStats,R.duration=s.decimalFloatingPoint("DURATION"),R.gap=s.bool("GAP"),R.independent=s.bool("INDEPENDENT"),R.relurl=s.enumeratedString("URI"),R.fragment=E,R.index=d;var S=s.enumeratedString("BYTERANGE");return S&&R.setByteRange(S,T),T&&(R.fragOffset=T.fragOffset+T.duration),R}return g(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),i}(v)},"./src/loader/key-loader.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>M});var C=L("./src/errors.ts"),P=L("./src/loader/fragment-loader.ts"),M=function(){function e(A){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=A}var I=e.prototype;return I.abort=function(){for(var f in this.keyUriToKeyInfo){var g=this.keyUriToKeyInfo[f].loader;g&&g.abort()}},I.detach=function(){for(var f in this.keyUriToKeyInfo){var g=this.keyUriToKeyInfo[f];(g.mediaKeySessionContext||g.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[f]}},I.destroy=function(){this.detach();for(var f in this.keyUriToKeyInfo){var g=this.keyUriToKeyInfo[f].loader;g&&g.destroy()}this.keyUriToKeyInfo={}},I.createKeyLoadError=function(f,g,h,p){return g===void 0&&(g=C.ErrorDetails.KEY_LOAD_ERROR),new P.LoadError({type:C.ErrorTypes.NETWORK_ERROR,details:g,fatal:!1,frag:f,networkDetails:h})},I.loadClear=function(f,g){var h=this;if(this.emeController&&this.config.emeEnabled)for(var p=f.sn,u=f.cc,v=function(i){var s=g[i];if(u<=s.cc&&(p==="initSegment"||p{"use strict";L.r(N),L.d(N,{LevelDetails:()=>f});var C=L("./src/polyfills/number.ts");function P(g,h){for(var p=0;pu.endSN||v>0||v===0&&m>0,this.updated||this.advanced?this.misses=Math.floor(u.misses*.6):this.misses=u.misses+1,this.availabilityDelay=u.availabilityDelay},M(g,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,C.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||A}},{key:"drift",get:function(){var u=this.driftEndTime-this.driftStartTime;if(u>0){var v=this.driftEnd-this.driftStart;return v*1e3/u}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var u;return(u=this.fragments)!==null&&u!==void 0&&u.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),g}()},"./src/loader/level-key.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{LevelKey:()=>f});var C=L("./src/utils/keysystem-util.ts"),P=L("./src/utils/mediakeys-helper.ts"),M=L("./src/utils/mp4-tools.ts"),e=L("./src/utils/logger.ts"),I=L("./src/utils/numeric-encoding-utils.ts"),A={},f=function(){h.clearKeyUriToKeyIdMap=function(){A={}};function h(u,v,m,o,a){o===void 0&&(o=[1]),a===void 0&&(a=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=u,this.uri=v,this.keyFormat=m,this.keyFormatVersions=o,this.iv=a,this.encrypted=u?u!=="NONE":!1,this.isCommonEncryption=this.encrypted&&u!=="AES-128"}var p=h.prototype;return p.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case P.KeySystemFormats.FAIRPLAY:case P.KeySystemFormats.WIDEVINE:case P.KeySystemFormats.PLAYREADY:case P.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},p.getDecryptData=function(v){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof v!="number"&&(this.method==="AES-128"&&!this.iv&&e.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),v=0);var m=g(v),o=new h(this.method,this.uri,"identity",this.keyFormatVersions,m);return o}var a=(0,C.convertDataUriToArrayBytes)(this.uri);if(a)switch(this.keyFormat){case P.KeySystemFormats.WIDEVINE:this.pssh=a,a.length>=22&&(this.keyId=a.subarray(a.length-22,a.length-6));break;case P.KeySystemFormats.PLAYREADY:{var i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,M.mp4pssh)(i,null,a);var s=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),E=String.fromCharCode.apply(null,Array.from(s)),b=E.substring(E.indexOf("<"),E.length),d=new DOMParser,T=d.parseFromString(b,"text/xml"),R=T.getElementsByTagName("KID")[0];if(R){var S=R.childNodes[0]?R.childNodes[0].nodeValue:R.getAttribute("VALUE");if(S){var w=(0,I.base64Decode)(S).subarray(0,16);(0,C.changeEndianness)(w),this.keyId=w}}break}default:{var r=a.subarray(0,16);if(r.length!==16){var n=new Uint8Array(16);n.set(r,16-r.length),r=n}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){var t=A[this.uri];if(!t){var l=Object.keys(A).length%Number.MAX_SAFE_INTEGER;t=new Uint8Array(16);var x=new DataView(t.buffer,12,4);x.setUint32(0,l),A[this.uri]=t}this.keyId=t}return this},h}();function g(h){for(var p=new Uint8Array(16),u=12;u<16;u++)p[u]=h>>8*(15-u)&255;return p}},"./src/loader/load-stats.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{LoadStats:()=>C});var C=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>i});var C=L("./src/polyfills/number.ts"),P=L("./node_modules/url-toolkit/src/url-toolkit.js"),M=L.n(P),e=L("./src/loader/date-range.ts"),I=L("./src/loader/fragment.ts"),A=L("./src/loader/level-details.ts"),f=L("./src/loader/level-key.ts"),g=L("./src/utils/attr-list.ts"),h=L("./src/utils/logger.ts"),p=L("./src/utils/codecs.ts");function u(){return u=Object.assign?Object.assign.bind():function(w){for(var r=1;r2){var l=t.shift()+".";return l+=parseInt(t.shift()).toString(16),l+=("000"+parseInt(t.shift()).toString(16)).slice(-4),l}return n},w.resolve=function(n,t){return(0,P.buildAbsoluteURL)(t,n,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(n,t){var l=[],x=[],y={},c=[],_=!1;v.lastIndex=0;for(var D;(D=v.exec(n))!=null;)if(D[1]){var O,k=new g.AttrList(D[1]),F={attrs:k,bitrate:k.decimalInteger("AVERAGE-BANDWIDTH")||k.decimalInteger("BANDWIDTH"),name:k.NAME,url:w.resolve(D[2],t)},G=k.decimalResolution("RESOLUTION");G&&(F.width=G.width,F.height=G.height),E((k.CODECS||"").split(/[ ,]+/).filter(function(ie){return ie}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=w.convertAVC1ToAVCOTI(F.videoCodec)),(O=F.unknownCodecs)!==null&&O!==void 0&&O.length||x.push(F),l.push(F)}else if(D[3]){var H=new g.AttrList(D[3]);H["DATA-ID"]&&(_=!0,y[H["DATA-ID"]]=H)}else if(D[4]){var j=D[4],Q=s(j,t);Q.encrypted&&Q.isSupported()?c.push(Q):h.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+j+'"')}var ee=x.length>0&&x.length0&&St.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=St.optionalFloat("PART-HOLD-BACK",0),c.holdBack=St.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var er=new g.AttrList(be);c.partTarget=er.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ne=c.partList;Ne||(Ne=c.partList=[]);var Fe=k>0?Ne[Ne.length-1]:void 0,We=k++,Be=new I.Part(new g.AttrList(be),j,t,We,Fe);Ne.push(Be),j.duration+=Be.duration;break}case"PRELOAD-HINT":{var _e=new g.AttrList(be);c.preloadHint=_e;break}case"RENDITION-REPORT":{var ht=new g.AttrList(be);c.renditionReports=c.renditionReports||[],c.renditionReports.push(ht);break}default:h.logger.warn("line parsed but not handled: "+Q);break}}}H&&!H.relurl?(_.pop(),F-=H.duration,c.partList&&(c.fragmentHint=H)):c.partList&&(T(j,H),j.cc=G,c.fragmentHint=j,ie&&S(j,ie,c));var Ze=_.length,At=_[0],yt=_[Ze-1];if(F+=c.skippedSegments*c.targetduration,F>0&&Ze&&yt){c.averagetargetduration=F/Ze;var tt=yt.sn;c.endSN=tt!=="initSegment"?tt:0,c.live||(yt.endList=!0),At&&(c.startCC=At.cc)}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(F+=c.fragmentHint.duration),c.totalduration=F,c.endCC=G,se>0&&d(_,se),c},w}();function s(w,r){var n,t,l=new g.AttrList(w),x=(n=l.enumeratedString("METHOD"))!=null?n:"",y=l.URI,c=l.hexadecimalInteger("IV"),_=l.enumeratedString("KEYFORMATVERSIONS"),D=(t=l.enumeratedString("KEYFORMAT"))!=null?t:"identity";y&&l.IV&&!c&&h.logger.error("Invalid IV: "+l.IV);var O=y?i.resolve(y,r):"",k=(_||"1").split("/").map(Number).filter(Number.isFinite);return new f.LevelKey(x,O,D,k,c)}function E(w,r){["video","audio","text"].forEach(function(n){var t=w.filter(function(x){return(0,p.isCodecType)(x,n)});if(t.length){var l=t.filter(function(x){return x.lastIndexOf("avc1",0)===0||x.lastIndexOf("mp4a",0)===0});r[n+"Codec"]=l.length>0?l[0]:t[0],w=w.filter(function(x){return t.indexOf(x)===-1})}}),r.unknownCodecs=w}function b(w,r,n){var t=r[n];t&&(w[n]=t)}function d(w,r){for(var n=w[r],t=r;t--;){var l=w[t];if(!l)return;l.programDateTime=n.programDateTime-l.duration*1e3,n=l}}function T(w,r){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):r!=null&&r.programDateTime&&(w.programDateTime=r.endProgramDateTime),(0,C.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}function R(w,r,n,t){w.relurl=r.URI,r.BYTERANGE&&w.setByteRange(r.BYTERANGE),w.level=n,w.sn="initSegment",t&&(w.levelkeys=t),w.initSegment=null}function S(w,r,n){w.levelkeys=r;var t=n.encryptedFragments;(!t.length||t[t.length-1].levelkeys!==r)&&Object.keys(r).some(function(l){return r[l].isCommonEncryption})&&t.push(w)}},"./src/loader/playlist-loader.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>u});var C=L("./src/polyfills/number.ts"),P=L("./src/events.ts"),M=L("./src/errors.ts"),e=L("./src/utils/logger.ts"),I=L("./src/loader/m3u8-parser.ts"),A=L("./src/types/loader.ts"),f=L("./src/utils/attr-list.ts");function g(v){var m=v.type;switch(m){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function h(v,m){var o=v.url;return(o===void 0||o.indexOf("data:")===0)&&(o=m.url),o}var p=function(){function v(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var m=v.prototype;return m.startLoad=function(a){},m.stopLoad=function(){this.destroyInternalLoaders()},m.registerListeners=function(){var a=this.hls;a.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.unregisterListeners=function(){var a=this.hls;a.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.createInternalLoader=function(a){var i=this.hls.config,s=i.pLoader,E=i.loader,b=s||E,d=new b(i);return a.loader=d,this.loaders[a.type]=d,d},m.getInternalLoader=function(a){return this.loaders[a.type]},m.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},m.destroyInternalLoaders=function(){for(var a in this.loaders){var i=this.loaders[a];i&&i.destroy(),this.resetInternalLoader(a)}},m.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},m.onManifestLoading=function(a,i){var s=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},m.onLevelLoading=function(a,i){var s=i.id,E=i.level,b=i.url,d=i.deliveryDirectives;this.load({id:s,groupId:null,level:E,responseType:"text",type:A.PlaylistContextType.LEVEL,url:b,deliveryDirectives:d})},m.onAudioTrackLoading=function(a,i){var s=i.id,E=i.groupId,b=i.url,d=i.deliveryDirectives;this.load({id:s,groupId:E,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:b,deliveryDirectives:d})},m.onSubtitleTrackLoading=function(a,i){var s=i.id,E=i.groupId,b=i.url,d=i.deliveryDirectives;this.load({id:s,groupId:E,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:b,deliveryDirectives:d})},m.load=function(a){var i,s=this.hls.config,E=this.getInternalLoader(a);if(E){var b=E.context;if(b&&b.url===a.url){e.logger.trace("[playlist-loader]: playlist request ongoing");return}e.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),E.abort()}var d,T,R,S;switch(a.type){case A.PlaylistContextType.MANIFEST:d=s.manifestLoadingMaxRetry,T=s.manifestLoadingTimeOut,R=s.manifestLoadingRetryDelay,S=s.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:d=0,T=s.levelLoadingTimeOut;break;default:d=s.levelLoadingMaxRetry,T=s.levelLoadingTimeOut,R=s.levelLoadingRetryDelay,S=s.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(a),(i=a.deliveryDirectives)!==null&&i!==void 0&&i.part){var w;if(a.type===A.PlaylistContextType.LEVEL&&a.level!==null?w=this.hls.levels[a.level].details:a.type===A.PlaylistContextType.AUDIO_TRACK&&a.id!==null?w=this.hls.audioTracks[a.id].details:a.type===A.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(w=this.hls.subtitleTracks[a.id].details),w){var r=w.partTarget,n=w.targetduration;r&&n&&(T=Math.min(Math.max(r*3,n*.8)*1e3,T))}}var t={timeout:T,maxRetry:d,retryDelay:R,maxRetryDelay:S,highWaterMark:0},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(a,t,l)},m.loadsuccess=function(a,i,s,E){E===void 0&&(E=null),this.resetInternalLoader(s.type);var b=a.data;if(b.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",E);return}i.parsing.start=performance.now(),b.indexOf("#EXTINF:")>0||b.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,i,s,E):this.handleMasterPlaylist(a,i,s,E)},m.loaderror=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!1,a)},m.loadtimeout=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!0)},m.handleMasterPlaylist=function(a,i,s,E){var b=this.hls,d=a.data,T=h(a,s),R=I.default.parseMasterPlaylist(d,T),S=R.levels,w=R.sessionData,r=R.sessionKeys;if(!S.length){this.handleManifestParsingError(a,s,"no level found in manifest",E);return}var n=S.map(function(_){return{id:_.attrs.AUDIO,audioCodec:_.audioCodec}}),t=S.map(function(_){return{id:_.attrs.SUBTITLES,textCodec:_.textCodec}}),l=I.default.parseMasterPlaylistMedia(d,T,"AUDIO",n),x=I.default.parseMasterPlaylistMedia(d,T,"SUBTITLES",t),y=I.default.parseMasterPlaylistMedia(d,T,"CLOSED-CAPTIONS");if(l.length){var c=l.some(function(_){return!_.url});!c&&S[0].audioCodec&&!S[0].attrs.AUDIO&&(e.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),l.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}b.trigger(P.Events.MANIFEST_LOADED,{levels:S,audioTracks:l,subtitles:x,captions:y,url:T,stats:i,networkDetails:E,sessionData:w,sessionKeys:r})},m.handleTrackOrLevelPlaylist=function(a,i,s,E){var b=this.hls,d=s.id,T=s.level,R=s.type,S=h(a,s),w=(0,C.isFiniteNumber)(d)?d:0,r=(0,C.isFiniteNumber)(T)?T:w,n=g(s),t=I.default.parseLevelPlaylist(a.data,S,r,n,w);if(!t.fragments.length){b.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:S,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(R===A.PlaylistContextType.MANIFEST){var l={attrs:new f.AttrList({}),bitrate:0,details:t,name:"",url:S};b.trigger(P.Events.MANIFEST_LOADED,{levels:[l],audioTracks:[],url:S,stats:i,networkDetails:E,sessionData:null,sessionKeys:null})}i.parsing.end=performance.now(),s.levelDetails=t,this.handlePlaylistLoaded(a,i,s,E)},m.handleManifestParsingError=function(a,i,s,E){this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===A.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:i,networkDetails:E})},m.handleNetworkError=function(a,i,s,E){s===void 0&&(s=!1),e.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var b=M.ErrorDetails.UNKNOWN,d=!1,T=this.getInternalLoader(a);switch(a.type){case A.PlaylistContextType.MANIFEST:b=s?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,d=!0;break;case A.PlaylistContextType.LEVEL:b=s?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,d=!1;break;case A.PlaylistContextType.AUDIO_TRACK:b=s?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:b=s?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,d=!1;break}T&&this.resetInternalLoader(a.type);var R={type:M.ErrorTypes.NETWORK_ERROR,details:b,fatal:d,url:a.url,loader:T,context:a,networkDetails:i};E&&(R.response=E),this.hls.trigger(P.Events.ERROR,R)},m.handlePlaylistLoaded=function(a,i,s,E){var b=s.type,d=s.level,T=s.id,R=s.groupId,S=s.loader,w=s.levelDetails,r=s.deliveryDirectives;if(!(w!=null&&w.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",E);return}if(S)switch(w.live&&(S.getCacheAge&&(w.ageHeader=S.getCacheAge()||0),(!S.getCacheAge||isNaN(w.ageHeader))&&(w.ageHeader=0)),b){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:w,level:d||0,id:T||0,stats:i,networkDetails:E,deliveryDirectives:r});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:w,id:T||0,groupId:R||"",stats:i,networkDetails:E,deliveryDirectives:r});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:w,id:T||0,groupId:R||"",stats:i,networkDetails:E,deliveryDirectives:r});break}},v}();const u=p},"./src/polyfills/number.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{MAX_SAFE_INTEGER:()=>P,isFiniteNumber:()=>C});var C=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C=function(){function M(){}return M.getSilentFrame=function(I,A){switch(I){case"mp4a.40.2":if(A===1)return new Uint8Array([0,200,0,128,35,128]);if(A===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(A===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(A===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(A===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(A===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(A===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(A===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(A===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}},M}();const P=C},"./src/remux/mp4-generator.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>M});var C=Math.pow(2,32)-1,P=function(){function e(){}return e.init=function(){e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var A;for(A in e.types)e.types.hasOwnProperty(A)&&(e.types[A]=[A.charCodeAt(0),A.charCodeAt(1),A.charCodeAt(2),A.charCodeAt(3)]);var f=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),g=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:f,audio:g};var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=p,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),v=new Uint8Array([97,118,99,49]),m=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,u,m,u,v),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,h))},e.box=function(A){for(var f=8,g=arguments.length,h=new Array(g>1?g-1:0),p=1;p>24&255,m[1]=f>>16&255,m[2]=f>>8&255,m[3]=f&255,m.set(A,4),u=0,f=8;u>24&255,A>>16&255,A>>8&255,A&255,g>>24,g>>16&255,g>>8&255,g&255,h>>24,h>>16&255,h>>8&255,h&255,85,196,0,0]))},e.mdia=function(A){return e.box(e.types.mdia,e.mdhd(A.timescale,A.duration),e.hdlr(A.type),e.minf(A))},e.mfhd=function(A){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255]))},e.minf=function(A){return A.type==="audio"?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(A)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(A))},e.moof=function(A,f,g){return e.box(e.types.moof,e.mfhd(A),e.traf(g,f))},e.moov=function(A){for(var f=A.length,g=[];f--;)g[f]=e.trak(A[f]);return e.box.apply(null,[e.types.moov,e.mvhd(A[0].timescale,A[0].duration)].concat(g).concat(e.mvex(A)))},e.mvex=function(A){for(var f=A.length,g=[];f--;)g[f]=e.trex(A[f]);return e.box.apply(null,[e.types.mvex].concat(g))},e.mvhd=function(A,f){f*=A;var g=Math.floor(f/(C+1)),h=Math.floor(f%(C+1)),p=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,g>>24,g>>16&255,g>>8&255,g&255,h>>24,h>>16&255,h>>8&255,h&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 e.box(e.types.mvhd,p)},e.sdtp=function(A){var f=A.samples||[],g=new Uint8Array(4+f.length),h,p;for(h=0;h>>8&255),f.push(u&255),f=f.concat(Array.prototype.slice.call(p));for(h=0;h>>8&255),g.push(u&255),g=g.concat(Array.prototype.slice.call(p));var v=e.box(e.types.avcC,new Uint8Array([1,f[3],f[4],f[5],255,224|A.sps.length].concat(f).concat([A.pps.length]).concat(g))),m=A.width,o=A.height,a=A.pixelRatio[0],i=A.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,m>>8&255,m&255,o>>8&255,o&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]),v,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},e.esds=function(A){var f=A.config.length;return new Uint8Array([0,0,0,0,3,23+f,0,1,0,4,15+f,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([f]).concat(A.config).concat([6,1,2]))},e.mp4a=function(A){var f=A.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]),e.box(e.types.esds,e.esds(A)))},e.mp3=function(A){var f=A.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]))},e.stsd=function(A){return A.type==="audio"?A.segmentCodec==="mp3"&&A.codec==="mp3"?e.box(e.types.stsd,e.STSD,e.mp3(A)):e.box(e.types.stsd,e.STSD,e.mp4a(A)):e.box(e.types.stsd,e.STSD,e.avc1(A))},e.tkhd=function(A){var f=A.id,g=A.duration*A.timescale,h=A.width,p=A.height,u=Math.floor(g/(C+1)),v=Math.floor(g%(C+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,f>>24&255,f>>16&255,f>>8&255,f&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,v>>24,v>>16&255,v>>8&255,v&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,h>>8&255,h&255,0,0,p>>8&255,p&255,0,0]))},e.traf=function(A,f){var g=e.sdtp(A),h=A.id,p=Math.floor(f/(C+1)),u=Math.floor(f%(C+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255])),e.trun(A,g.length+16+20+8+16+8+8),g)},e.trak=function(A){return A.duration=A.duration||4294967295,e.box(e.types.trak,e.tkhd(A),e.mdia(A))},e.trex=function(A){var f=A.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(A,f){var g=A.samples||[],h=g.length,p=12+16*h,u=new Uint8Array(p),v,m,o,a,i,s;for(f+=8+p,u.set([A.type==="video"?1:0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,h&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0),v=0;v>>24&255,o>>>16&255,o>>>8&255,o&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&61440,i.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*v);return e.box(e.types.trun,u)},e.initSegment=function(A){e.types||e.init();var f=e.moov(A),g=new Uint8Array(e.FTYP.byteLength+f.byteLength);return g.set(e.FTYP),g.set(f,e.FTYP.byteLength),g},e}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0;const M=P},"./src/remux/mp4-remuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>a,flushTextTrackMetadataCueSamples:()=>E,flushTextTrackUserdataCueSamples:()=>b,normalizePts:()=>i});var C=L("./src/polyfills/number.ts"),P=L("./src/remux/aac-helper.ts"),M=L("./src/remux/mp4-generator.ts"),e=L("./src/events.ts"),I=L("./src/errors.ts"),A=L("./src/utils/logger.ts"),f=L("./src/types/loader.ts"),g=L("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign?Object.assign.bind():function(R){for(var S=1;S0?l:x.pts},r[0].pts);return n&&A.logger.debug("PTS rollover detected"),t},S.remux=function(r,n,t,l,x,y,c,_){var D,O,k,F,G,H,j=x,Q=x,ee=r.pid>-1,ie=n.pid>-1,se=n.samples.length,le=r.samples.length>0,xe=c&&se>0||se>1,Re=(!ee||le)&&(!ie||xe)||this.ISGenerated||c;if(Re){this.ISGenerated||(k=this.generateIS(r,n,x));var Ee=this.isVideoContiguous,he=-1,be;if(xe&&(he=s(n.samples),!Ee&&this.config.forceKeyFrameOnDiscontinuity))if(H=!0,he>0){A.logger.warn("[mp4-remuxer]: Dropped "+he+" out of "+se+" video samples due to a missing keyframe");var Ce=this.getVideoStartPts(n.samples);n.samples=n.samples.slice(he),n.dropped+=he,Q+=(n.samples[0].pts-Ce)/n.inputTimeScale,be=Q}else he===-1&&(A.logger.warn("[mp4-remuxer]: No keyframe found out of "+se+" video samples"),H=!1);if(this.ISGenerated){if(le&&xe){var Ue=this.getVideoStartPts(n.samples),$e=i(r.samples[0].pts,Ue)-Ue,z=$e/n.inputTimeScale;j+=Math.max(0,z),Q+=Math.max(0,-z)}if(le){if(r.samplerate||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(r,n,x)),O=this.remuxAudio(r,j,this.isAudioContiguous,y,ie||xe||_===f.PlaylistLevelType.AUDIO?Q:void 0),xe){var ne=O?O.endPTS-O.startPTS:0;n.inputTimeScale||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(r,n,x)),D=this.remuxVideo(n,Q,Ee,ne)}}else xe&&(D=this.remuxVideo(n,Q,Ee,0));D&&(D.firstKeyFrame=he,D.independent=he!==-1,D.firstKeyFramePTS=be)}}return this.ISGenerated&&(t.samples.length&&(G=E(t,x,this._initPTS,this._initDTS)),l.samples.length&&(F=b(l,x,this._initPTS))),{audio:O,video:D,initSegment:k,independent:H,text:F,id3:G}},S.generateIS=function(r,n,t){var l=r.samples,x=n.samples,y=this.typeSupported,c={},_=!(0,C.isFiniteNumber)(this._initPTS),D="audio/mp4",O,k,F;if(_&&(O=k=1/0),r.config&&l.length){switch(r.timescale=r.samplerate,r.segmentCodec){case"mp3":y.mpeg?(D="audio/mpeg",r.codec=""):y.mp3&&(r.codec="mp3");break}c.audio={id:"audio",container:D,codec:r.codec,initSegment:r.segmentCodec==="mp3"&&y.mpeg?new Uint8Array(0):M.default.initSegment([r]),metadata:{channelCount:r.channelCount}},_&&(F=r.inputTimeScale,O=k=l[0].pts-Math.round(F*t))}if(n.sps&&n.pps&&x.length&&(n.timescale=n.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:n.codec,initSegment:M.default.initSegment([n]),metadata:{width:n.width,height:n.height}},_)){F=n.inputTimeScale;var G=this.getVideoStartPts(x),H=Math.round(F*t);k=Math.min(k,i(x[0].dts,G)-H),O=Math.min(O,G-H)}if(Object.keys(c).length)return this.ISGenerated=!0,_&&(this._initPTS=O,this._initDTS=k),{tracks:c,initPTS:O,timescale:F}},S.remuxVideo=function(r,n,t,l){var x=r.inputTimeScale,y=r.samples,c=[],_=y.length,D=this._initPTS,O=this.nextAvcDts,k=8,F=this.videoSampleDuration,G,H,j=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,ee=!1;if(!t||O===null){var ie=n*x,se=y[0].pts-i(y[0].dts,y[0].pts);O=ie-se}for(var le=0;le<_;le++){var xe=y[le];xe.pts=i(xe.pts-D,O),xe.dts=i(xe.dts-D,O),xe.dts0?le-1:le].dts&&(ee=!0)}ee&&y.sort(function(_n,Vr){var Wr=_n.dts-Vr.dts,xn=_n.pts-Vr.pts;return Wr||xn}),G=y[0].dts,H=y[y.length-1].dts;var Re=H-G,Ee=Re?Math.round(Re/(_-1)):F||r.inputTimeScale/30;if(t){var he=G-O,be=he>Ee,Ce=he<-1;if((be||Ce)&&(be?A.logger.warn("AVC: "+(0,g.toMsFromMpegTsClock)(he,!0)+" ms ("+he+"dts) hole between fragments detected, filling it"):A.logger.warn("AVC: "+(0,g.toMsFromMpegTsClock)(-he,!0)+" ms ("+he+"dts) overlapping between fragments detected"),!Ce||O>y[0].pts)){G=O;var Ue=y[0].pts-he;y[0].dts=G,y[0].pts=Ue,A.logger.log("Video: First PTS/DTS adjusted: "+(0,g.toMsFromMpegTsClock)(Ue,!0)+"/"+(0,g.toMsFromMpegTsClock)(G,!0)+", delta: "+(0,g.toMsFromMpegTsClock)(he,!0)+" ms")}}G=Math.max(0,G);for(var $e=0,z=0,ne=0;ne<_;ne++){for(var de=y[ne],ge=de.units,Ae=ge.length,Ve=0,xt=0;xt0?ht.dts-y[_e-1].dts:Ee;if(it=_e>0?ht.pts-y[_e-1].pts:Ee,Vt.stretchShortVideoTrack&&this.nextAudioPts!==null){var or=Math.floor(Vt.maxBufferHole*x),Dr=(l?j+l*x:this.nextAudioPts)-ht.pts;Dr>or?(F=Dr-tr,F<0?F=tr:er=!0,A.logger.log("[mp4-remuxer]: It is approximately "+Dr/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=tr}else F=tr}var Yr=Math.round(ht.pts-ht.dts);Ne=Math.min(Ne,F),We=Math.max(We,F),Fe=Math.min(Fe,it),Be=Math.max(Be,it),c.push(new d(ht.key,F,At,Yr))}if(c.length){if(m){if(m<70){var ur=c[0].flags;ur.dependsOn=2,ur.isNonSync=0}}else if(o&&Be-Fe0&&(l&&Math.abs(ie-ee)<9e3||Math.abs(i(j[0].pts-k,ie)-ee)<20*O),j.forEach(function(bt){bt.pts=i(bt.pts-k,ie)}),!t||ee<0){if(j=j.filter(function(bt){return bt.pts>=0}),!j.length)return;x===0?ee=0:l&&!H?ee=Math.max(0,ie):ee=j[0].pts}if(r.segmentCodec==="aac")for(var se=this.config.maxAudioFramesDrift,le=0,xe=ee;le=se*O&&be0){Ae+=Q;try{ge=new Uint8Array(Ae)}catch(bt){this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ae,reason:"fail allocating audio mdat "+Ae});return}if(!F){var Fe=new DataView(ge.buffer);Fe.setUint32(0,Ae),ge.set(M.default.types.mdat,4)}}else return;ge.set(St,Q);var We=St.byteLength;Q+=We,G.push(new d(!0,D,We,0)),de=er}var Be=G.length;if(Be){var _e=G[G.length-1];this.nextAudioPts=ee=de+_*_e.duration;var ht=F?new Uint8Array(0):M.default.moof(r.sequenceNumber++,ne/_,h({},r,{samples:G}));r.samples=[];var Ze=ne/y,At=ee/y,yt="audio",tt={data1:ht,data2:ge,startPTS:Ze,endPTS:At,startDTS:Ze,endDTS:At,type:yt,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(ge.length,"MDAT length must not be zero"),tt}},S.remuxEmptyAudio=function(r,n,t,l){var x=r.inputTimeScale,y=r.samplerate?r.samplerate:x,c=x/y,_=this.nextAudioPts,D=(_!==null?_:l.startDTS*x)+this._initDTS,O=l.endDTS*x+this._initDTS,k=c*u,F=Math.ceil((O-D)/k),G=P.default.getSilentFrame(r.manifestCodec||r.codec,r.channelCount);if(A.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){A.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var H=[],j=0;j4294967296;)R+=w;return R}function s(R){for(var S=0;S{"use strict";L.r(N),L.d(N,{default:()=>g});var C=L("./src/polyfills/number.ts"),P=L("./src/remux/mp4-remuxer.ts"),M=L("./src/utils/mp4-tools.ts"),e=L("./src/loader/fragment.ts"),I=L("./src/utils/logger.ts"),A=function(){function h(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var p=h.prototype;return p.destroy=function(){},p.resetTimeStamp=function(v){this.initPTS=v,this.lastEndTime=null},p.resetNextTimestamp=function(){this.lastEndTime=null},p.resetInitSegment=function(v,m,o,a){this.audioCodec=m,this.videoCodec=o,this.generateInitSegment((0,M.patchEncyptionData)(v,a)),this.emitInitSegment=!0},p.generateInitSegment=function(v){var m=this.audioCodec,o=this.videoCodec;if(!v||!v.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=(0,M.parseInitSegment)(v);m||(m=f(a.audio,e.ElementaryStreamTypes.AUDIO)),o||(o=f(a.video,e.ElementaryStreamTypes.VIDEO));var i={};a.audio&&a.video?i.audiovideo={container:"video/mp4",codec:m+","+o,initSegment:v,id:"main"}:a.audio?i.audio={container:"audio/mp4",codec:m,initSegment:v,id:"audio"}:a.video?i.video={container:"video/mp4",codec:o,initSegment:v,id:"main"}:I.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},p.remux=function(v,m,o,a,i){var s,E=this.initPTS,b=this.lastEndTime,d={audio:void 0,video:void 0,text:a,id3:o,initSegment:void 0};(0,C.isFiniteNumber)(b)||(b=this.lastEndTime=i||0);var T=m.samples;if(!T||!T.length)return d;var R={initPTS:void 0,timescale:1},S=this.initData;if((!S||!S.length)&&(this.generateInitSegment(T),S=this.initData),!S||!S.length)return I.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(R.tracks=this.initTracks,this.emitInitSegment=!1);var w=(0,M.getStartDTS)(S,T);(0,C.isFiniteNumber)(E)||(this.initPTS=R.initPTS=E=w-i);var r=(0,M.getDuration)(T,S),n=v?w-E:b,t=n+r;(0,M.offsetStartDTS)(S,T,E),r>0?this.lastEndTime=t:(I.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!S.audio,x=!!S.video,y="";l&&(y+="audio"),x&&(y+="video");var c={data1:T,startPTS:n,startDTS:n,endPTS:t,endDTS:t,type:y,hasAudio:l,hasVideo:x,nb:1,dropped:0};d.audio=c.type==="audio"?c:void 0,d.video=c.type!=="audio"?c:void 0,d.initSegment=R;var _=(s=this.initPTS)!=null?s:0;return d.id3=(0,P.flushTextTrackMetadataCueSamples)(o,i,_,_),a.samples.length&&(d.text=(0,P.flushTextTrackUserdataCueSamples)(a,i,_)),d},h}();function f(h,p){var u=h==null?void 0:h.codec;return u&&u.length>4?u:u==="hvc1"||u==="hev1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||p===e.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const g=A},"./src/task-loop.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>C});var C=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=P.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},P}()},"./src/types/cmcd.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{CMCDObjectType:()=>P,CMCDStreamType:()=>e,CMCDStreamingFormat:()=>M,CMCDVersion:()=>C});var C=1,P;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(P||(P={}));var M;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(M||(M={}));var e;(function(I){I.VOD="v",I.LIVE="l"})(e||(e={}))},"./src/types/demuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{MetadataSchema:()=>C});var C;(function(P){P.audioId3="org.id3",P.dateRange="com.apple.quicktime.HLS",P.emsg="https://aomedia.org/emsg/ID3"})(C||(C={}))},"./src/types/level.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{HdcpLevels:()=>I,HlsSkip:()=>A,HlsUrlParameters:()=>g,Level:()=>h,getSkipValue:()=>f});function C(p,u){for(var v=0;v{"use strict";L.r(N),L.d(N,{PlaylistContextType:()=>C,PlaylistLevelType:()=>P});var C;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(C||(C={}));var P;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{ChunkMetadata:()=>C});var C=function(e,I,A,f,g,h){f===void 0&&(f=0),g===void 0&&(g=-1),h===void 0&&(h=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=e,this.sn=I,this.id=A,this.size=f,this.part=g,this.partial=h};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{AttrList:()=>M});var C=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function e(A){typeof A=="string"&&(A=e.parseAttrList(A));for(var f in A)A.hasOwnProperty(f)&&(this[f]=A[f])}var I=e.prototype;return I.decimalInteger=function(f){var g=parseInt(this[f],10);return g>Number.MAX_SAFE_INTEGER?1/0:g},I.hexadecimalInteger=function(f){if(this[f]){var g=(this[f]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var h=new Uint8Array(g.length/2),p=0;pNumber.MAX_SAFE_INTEGER?1/0:g},I.decimalFloatingPoint=function(f){return parseFloat(this[f])},I.optionalFloat=function(f,g){var h=this[f];return h?parseFloat(h):g},I.enumeratedString=function(f){return this[f]},I.bool=function(f){return this[f]==="YES"},I.decimalResolution=function(f){var g=C.exec(this[f]);if(g!==null)return{width:parseInt(g[1],10),height:parseInt(g[2],10)}},e.parseAttrList=function(f){var g,h={},p='"';for(P.lastIndex=0;(g=P.exec(f))!==null;){var u=g[2];u.indexOf(p)===0&&u.lastIndexOf(p)===u.length-1&&(u=u.slice(1,-1)),h[g[1]]=u}return h},e}()},"./src/utils/binary-search.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C={search:function(e,I){for(var A=0,f=e.length-1,g=null,h=null;A<=f;){g=(A+f)/2|0,h=e[g];var p=I(h);if(p>0)A=g+1;else if(p<0)f=g-1;else return h}return null}};const P=C},"./src/utils/buffer-helper.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{BufferHelper:()=>M});var C=L("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function e(){}return e.isBuffered=function(A,f){try{if(A){for(var g=e.getBuffered(A),h=0;h=g.start(h)&&f<=g.end(h))return!0}}catch(p){}return!1},e.bufferInfo=function(A,f,g){try{if(A){var h=e.getBuffered(A),p=[],u;for(u=0;uv&&(h[u-1].end=A[p].end):h.push(A[p])}else h.push(A[p])}else h=A;for(var m=0,o,a=f,i=f,s=0;s=E&&f{"use strict";L.r(N),L.d(N,{CaptionScreen:()=>s,Row:()=>i,default:()=>S});var C=L("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(r){var n=r;return P.hasOwnProperty(r)&&(n=P[r]),String.fromCharCode(n)},e=15,I=100,A={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},f={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(u||(u={}));var v=function(){function w(){this.time=null,this.verboseLevel=u.ERROR}var r=w.prototype;return r.log=function(t,l){if(this.verboseLevel>=t){var x=typeof l=="function"?l():l;C.logger.log(this.time+" ["+t+"] "+x)}},w}(),m=function(r){for(var n=[],t=0;tI&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},r.moveCursor=function(t){var l=this.pos+t;if(t>1)for(var x=this.pos+1;x=144&&this.backSpace();var x=M(t);if(this.pos>=I){this.logger.log(u.ERROR,function(){return"Cannot insert "+t.toString(16)+" ("+x+") at position "+l.pos+". Skipping it!"});return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},r.clearFromPos=function(t){var l;for(l=t;l0&&(t?x="["+l.join(" | ")+"]":x=l.join(` `)),x},r.getTextAndFormat=function(){return this.rows},w}(),E=function(){function w(n,t,l){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=n,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new s(l),this.nonDisplayedMemory=new s(l),this.lastOutputScreen=new s(l),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=l}var r=w.prototype;return r.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},r.getHandler=function(){return this.outputFilter},r.setHandler=function(t){this.outputFilter=t},r.setPAC=function(t){this.writeScreen.setPAC(t)},r.setBkgData=function(t){this.writeScreen.setBkgData(t)},r.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(u.INFO,function(){return"MODE="+t}),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=t)},r.insertChars=function(t){for(var l=this,x=0;x=46,l.italics)l.foreground="white";else{var x=Math.floor(t/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];l.foreground=y[x]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(l)),this.writeScreen.setPen(l)},r.outputDataUpdate=function(t){t===void 0&&(t=!1);var l=this.logger.time;l!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=l:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,l,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:l),this.lastOutputScreen.copy(this.displayedMemory))},r.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},w}(),b=function(){function w(n,t,l){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new v;this.channels=[null,new E(n,t,x),new E(n+1,l,x)],this.cmdHistory=R(),this.logger=x}var r=w.prototype;return r.getHandler=function(t){return this.channels[t].getHandler()},r.setHandler=function(t,l){this.channels[t].setHandler(l)},r.addData=function(t,l){var x,y,c,_=!1;this.logger.time=t;for(var D=0;D ("+m([y,c])+")"),x=this.parseCmd(y,c),x||(x=this.parseMidrow(y,c)),x||(x=this.parsePAC(y,c)),x||(x=this.parseBackgroundAttributes(y,c)),!x&&(_=this.parseChars(y,c),_)){var O=this.currentChannel;if(O&&O>0){var k=this.channels[O];k.insertChars(_)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!x&&!_&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+m([y,c])+" orig: "+m([l[D],l[D+1]]))}},r.parseCmd=function(t,l){var x=this.cmdHistory,y=(t===20||t===28||t===21||t===29)&&l>=32&&l<=47,c=(t===23||t===31)&&l>=33&&l<=35;if(!(y||c))return!1;if(T(t,l,x))return d(null,null,x),this.logger.log(u.DEBUG,"Repeated command ("+m([t,l])+") is dropped"),!0;var _=t===20||t===21||t===23?1:2,D=this.channels[_];return t===20||t===21||t===28||t===29?l===32?D.ccRCL():l===33?D.ccBS():l===34?D.ccAOF():l===35?D.ccAON():l===36?D.ccDER():l===37?D.ccRU(2):l===38?D.ccRU(3):l===39?D.ccRU(4):l===40?D.ccFON():l===41?D.ccRDC():l===42?D.ccTR():l===43?D.ccRTD():l===44?D.ccEDM():l===45?D.ccCR():l===46?D.ccENM():l===47&&D.ccEOC():D.ccTO(l-32),d(t,l,x),this.currentChannel=_,!0},r.parseMidrow=function(t,l){var x=0;if((t===17||t===25)&&l>=32&&l<=47){if(t===17?x=1:x=2,x!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[x];return y?(y.ccMIDROW(l),this.logger.log(u.DEBUG,"MIDROW ("+m([t,l])+")"),!0):!1}return!1},r.parsePAC=function(t,l){var x,y=this.cmdHistory,c=(t>=17&&t<=23||t>=25&&t<=31)&&l>=64&&l<=127,_=(t===16||t===24)&&l>=64&&l<=95;if(!(c||_))return!1;if(T(t,l,y))return d(null,null,y),!0;var D=t<=23?1:2;l>=64&&l<=95?x=D===1?A[t]:g[t]:x=D===1?f[t]:h[t];var O=this.channels[D];return O?(O.setPAC(this.interpretPAC(x,l)),d(t,l,y),this.currentChannel=D,!0):!1},r.interpretPAC=function(t,l){var x,y={color:null,italics:!1,indent:null,underline:!1,row:t};return l>95?x=l-96:x=l-64,y.underline=(x&1)===1,x<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(x/2)]:x<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((x-16)/2)*4,y},r.parseChars=function(t,l){var x,y=null,c=null;if(t>=25?(x=2,c=t-8):(x=1,c=t),c>=17&&c<=19){var _;c===17?_=l+80:c===18?_=l+112:_=l+144,this.logger.log(u.INFO,"Special char '"+M(_)+"' in channel "+x),y=[_]}else t>=32&&t<=127&&(y=l===0?[t]:[t,l]);if(y){var D=m(y);this.logger.log(u.DEBUG,"Char codes = "+D.join(",")),d(t,l,this.cmdHistory)}return y},r.parseBackgroundAttributes=function(t,l){var x=(t===16||t===24)&&l>=32&&l<=47,y=(t===23||t===31)&&l>=45&&l<=47;if(!(x||y))return!1;var c,_={};t===16||t===24?(c=Math.floor((l-32)/2),_.background=p[c],l%2===1&&(_.background=_.background+"_semi")):l===45?_.background="transparent":(_.foreground="black",l===47&&(_.underline=!0));var D=t<=23?1:2,O=this.channels[D];return O.setBkgData(_),d(t,l,this.cmdHistory),!0},r.reset=function(){for(var t=0;t{"use strict";L.r(N),L.d(N,{isCodecSupportedInMp4:()=>M,isCodecType:()=>P});var C={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function P(e,I){var A=C[I];return!!A&&A[e.slice(0,4)]===!0}function M(e,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>A});var C=L("./src/utils/vttparser.ts"),P=L("./src/utils/webvtt-parser.ts"),M=L("./src/utils/texttrack-utils.ts"),e=/\s/,I={newCue:function(g,h,p,u){for(var v=[],m,o,a,i,s,E=self.VTTCue||self.TextTrackCue,b=0;b=16?i--:i++;var T=(0,C.fixLineBreaks)(s.trim()),R=(0,P.generateCueId)(h,p,T);(!g||!g.cues||!g.cues.getCueById(R))&&(o=new E(h,p,T),o.id=R,o.line=b+1,o.align="left",o.position=10+Math.min(80,Math.floor(i*8/32)*10),v.push(o))}return g&&v.length&&(v.sort(function(S,w){return S.line==="auto"||w.line==="auto"?0:S.line>8&&w.line>8?w.line-S.line:S.line-w.line}),v.forEach(function(S){return(0,M.addCueToTrack)(g,S)})),v}};const A=I},"./src/utils/discontinuities.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{adjustSlidingStart:()=>g,alignMediaPlaylistByPDT:()=>v,alignPDT:()=>u,alignStream:()=>h,findDiscontinuousReferenceFrag:()=>A,findFirstFragWithCC:()=>e,shouldAlignOnDiscontinuities:()=>I});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/logger.ts"),M=L("./src/controller/level-helper.ts");function e(m,o){for(var a=null,i=0,s=m.length;ia.startCC||m&&m.cc{"use strict";L.r(N),L.d(N,{default:()=>M});var C=L("./src/utils/ewma.ts"),P=function(){function e(A,f,g){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=g,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new C.default(A),this.fast_=new C.default(f)}var I=e.prototype;return I.update=function(f,g){var h=this.slow_,p=this.fast_;this.slow_.halfLife!==f&&(this.slow_=new C.default(f,h.getEstimate(),h.getTotalWeight())),this.fast_.halfLife!==g&&(this.fast_=new C.default(g,p.getEstimate(),p.getTotalWeight()))},I.sample=function(f,g){f=Math.max(f,this.minDelayMs_);var h=8*g,p=f/1e3,u=h/p;this.fast_.sample(p,u),this.slow_.sample(p,u)},I.canEstimate=function(){var f=this.fast_;return f&&f.getTotalWeight()>=this.minWeight_},I.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},I.destroy=function(){},e}();const M=P},"./src/utils/ewma.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C=function(){function M(I,A,f){A===void 0&&(A=0),f===void 0&&(f=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=I,this.alpha_=I?Math.exp(Math.log(.5)/I):0,this.estimate_=A,this.totalWeight_=f}var e=M.prototype;return e.sample=function(A,f){var g=Math.pow(this.alpha_,A);this.estimate_=f*(1-g)+g*this.estimate_,this.totalWeight_+=A},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var A=1-Math.pow(this.alpha_,this.totalWeight_);if(A)return this.estimate_/A}return this.estimate_},M}();const P=C},"./src/utils/fetch-loader.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>s,fetchSupported:()=>v});var C=L("./src/polyfills/number.ts"),P=L("./src/loader/load-stats.ts"),M=L("./src/demux/chunk-cache.ts");function e(E,b){E.prototype=Object.create(b.prototype),E.prototype.constructor=E,h(E,b)}function I(E){var b=typeof Map=="function"?new Map:void 0;return I=function(T){if(T===null||!g(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof b!="undefined"){if(b.has(T))return b.get(T);b.set(T,R)}function R(){return A(T,arguments,p(this).constructor)}return R.prototype=Object.create(T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),h(R,T)},I(E)}function A(E,b,d){return f()?A=Reflect.construct.bind():A=function(R,S,w){var r=[null];r.push.apply(r,S);var n=Function.bind.apply(R,r),t=new n;return w&&h(t,w.prototype),t},A.apply(null,arguments)}function f(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(E){return!1}}function g(E){return Function.toString.call(E).indexOf("[native code]")!==-1}function h(E,b){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,R){return T.__proto__=R,T},h(E,b)}function p(E){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},p(E)}function u(){return u=Object.assign?Object.assign.bind():function(E){for(var b=1;b=w&&r(R,S,n.flush(),T)):r(R,S,c,T),x()}).catch(function(){return Promise.reject()})};return l()},E}();function o(E,b){var d={method:"GET",mode:"cors",credentials:"same-origin",signal:b,headers:new self.Headers(u({},E.headers))};return E.rangeEnd&&d.headers.set("Range","bytes="+E.rangeStart+"-"+String(E.rangeEnd-1)),d}function a(E,b){return new self.Request(E.url,b)}var i=function(E){e(b,E);function b(d,T,R){var S;return S=E.call(this,d)||this,S.code=void 0,S.details=void 0,S.code=T,S.details=R,S}return b}(I(Error));const s=m},"./src/utils/hex.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C={hexDump:function(e){for(var I="",A=0;A{"use strict";L.r(N),L.d(N,{IMSC1_CODEC:()=>g,parseIMSC1:()=>v});var C=L("./src/utils/mp4-tools.ts"),P=L("./src/utils/vttparser.ts"),M=L("./src/utils/vttcue.ts"),e=L("./src/demux/id3.ts"),I=L("./src/utils/timescale-conversion.ts"),A=L("./src/utils/webvtt-parser.ts");function f(){return f=Object.assign?Object.assign.bind():function(S){for(var w=1;w{"use strict";L.r(N),L.d(N,{changeEndianness:()=>M,convertDataUriToArrayBytes:()=>e,strToUtf8array:()=>I});var C=L("./src/utils/numeric-encoding-utils.ts");function P(A){var f=I(A).subarray(0,16),g=new Uint8Array(16);return g.set(f,16-f.length),g}function M(A){var f=function(h,p,u){var v=h[p];h[p]=h[u],h[u]=v};f(A,0,3),f(A,1,2),f(A,4,5),f(A,6,7)}function e(A){var f=A.split(":"),g=null;if(f[0]==="data"&&f.length===2){var h=f[1].split(";"),p=h[h.length-1].split(",");if(p.length===2){var u=p[0]==="base64",v=p[1];u?(h.splice(-1,1),g=(0,C.base64Decode)(v)):g=P(v)}}return g}function I(A){return Uint8Array.from(unescape(encodeURIComponent(A)),function(f){return f.charCodeAt(0)})}},"./src/utils/logger.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{enableLogs:()=>A,logger:()=>f});var C=function(){},P={trace:C,debug:C,log:C,warn:C,info:C,error:C},M=P;function e(g){var h=self.console[g];return h?h.bind(self.console,"["+g+"] >"):C}function I(g){for(var h=arguments.length,p=new Array(h>1?h-1:0),u=1;u{"use strict";L.r(N),L.d(N,{KeySystemFormats:()=>P,KeySystemIds:()=>e,KeySystems:()=>C,getKeySystemsForConfig:()=>f,getSupportedMediaKeySystemConfigurations:()=>h,keySystemDomainToKeySystemFormat:()=>A,keySystemFormatToKeySystemDomain:()=>M,keySystemIdToKeySystemDomain:()=>I,requestMediaKeySystemAccess:()=>g});var C;(function(u){u.CLEARKEY="org.w3.clearkey",u.FAIRPLAY="com.apple.fps",u.PLAYREADY="com.microsoft.playready",u.WIDEVINE="com.widevine.alpha"})(C||(C={}));var P;(function(u){u.CLEARKEY="org.w3.clearkey",u.FAIRPLAY="com.apple.streamingkeydelivery",u.PLAYREADY="com.microsoft.playready",u.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(P||(P={}));function M(u){switch(u){case P.FAIRPLAY:return C.FAIRPLAY;case P.PLAYREADY:return C.PLAYREADY;case P.WIDEVINE:return C.WIDEVINE;case P.CLEARKEY:return C.CLEARKEY}}var e;(function(u){u.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(e||(e={}));function I(u){if(u===e.WIDEVINE)return C.WIDEVINE}function A(u){switch(u){case C.FAIRPLAY:return P.FAIRPLAY;case C.PLAYREADY:return P.PLAYREADY;case C.WIDEVINE:return P.WIDEVINE;case C.CLEARKEY:return P.CLEARKEY}}function f(u){var v=u.drmSystems,m=u.widevineLicenseUrl,o=v?[C.FAIRPLAY,C.WIDEVINE,C.PLAYREADY,C.CLEARKEY].filter(function(a){return!!v[a]}):[];return!o[C.WIDEVINE]&&m&&o.push(C.WIDEVINE),o}var g=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function h(u,v,m,o){var a;switch(u){case C.FAIRPLAY:a=["cenc","sinf"];break;case C.WIDEVINE:case C.PLAYREADY:a=["cenc"];break;case C.CLEARKEY:a=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+u)}return p(a,v,m,o)}function p(u,v,m,o){var a={initDataTypes:u,persistentState:o.persistentState||"not-allowed",distinctiveIdentifier:o.distinctiveIdentifier||"not-allowed",sessionTypes:o.sessionTypes||[o.sessionType||"temporary"],audioCapabilities:v.map(function(i){return{contentType:'audio/mp4; codecs="'+i+'"',robustness:o.audioRobustness||"",encryptionScheme:o.audioEncryptionScheme||null}}),videoCapabilities:m.map(function(i){return{contentType:'video/mp4; codecs="'+i+'"',robustness:o.videoRobustness||"",encryptionScheme:o.videoEncryptionScheme||null}})};return[a]}},"./src/utils/mediasource-helper.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{getMediaSource:()=>C});function C(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{RemuxerTrackIdConfig:()=>g,appendUint8Array:()=>w,bin2str:()=>h,computeRawDurationFromSamples:()=>T,discardEPB:()=>x,findBox:()=>o,getDuration:()=>d,getStartDTS:()=>b,mp4Box:()=>c,mp4pssh:()=>_,offsetStartDTS:()=>R,parseEmsg:()=>y,parseInitSegment:()=>i,parsePssh:()=>D,parseSEIMessageFromNALu:()=>l,parseSamples:()=>r,parseSegmentIndex:()=>a,parseSinf:()=>E,patchEncyptionData:()=>s,readSint32:()=>v,readUint16:()=>p,readUint32:()=>u,segmentValidRange:()=>S,writeUint32:()=>m});var C=L("./src/loader/fragment.ts"),P=L("./src/utils/typed-array.ts"),M=L("./src/demux/id3.ts"),e=L("./src/utils/logger.ts"),I=L("./src/utils/hex.ts"),A=Math.pow(2,32)-1,f=[].push,g={video:1,audio:2,id3:3,text:4};function h(O){return String.fromCharCode.apply(null,O)}function p(O,k){var F=O[k]<<8|O[k+1];return F<0?65536+F:F}function u(O,k){var F=v(O,k);return F<0?4294967296+F:F}function v(O,k){return O[k]<<24|O[k+1]<<16|O[k+2]<<8|O[k+3]}function m(O,k,F){O[k]=F>>24,O[k+1]=F>>16&255,O[k+2]=F>>8&255,O[k+3]=F&255}function o(O,k){var F=[];if(!k.length)return F;for(var G=O.byteLength,H=0;H1?H+j:G;if(Q===k[0])if(k.length===1)F.push(O.subarray(H+8,ee));else{var ie=o(O.subarray(H+8,ee),k.slice(1));ie.length&&f.apply(F,ie)}H=ee}return F}function a(O){var k=[],F=O[0],G=8,H=u(O,G);G+=4;var j=0,Q=0;F===0?G+=8:G+=16,G+=2;var ee=O.length+Q,ie=p(O,G);G+=2;for(var se=0;se>>31;if(Ee===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var he=u(O,le);le+=4,k.push({referenceSize:Re,subsegmentDuration:he,info:{duration:he/H,start:ee,end:ee+Re-1}}),ee+=Re,le+=4,G=le}return{earliestPresentationTime:j,timescale:H,version:F,referencesCount:ie,references:k}}function i(O){for(var k=[],F=o(O,["moov","trak"]),G=0;G0;ie||(ee=o(Q,["encv"])),ee.forEach(function(se){var le=ie?se.subarray(28):se.subarray(78),xe=o(le,["sinf"]);xe.forEach(function(Re){var Ee=E(Re);if(Ee){var he=Ee.subarray(8,24);he.some(function(be){return be!==0})||(e.logger.log("[eme] Patching keyId in 'enc"+(ie?"a":"v")+">sinf>>tenc' box: "+I.default.hexDump(he)+" -> "+I.default.hexDump(F)),Ee.set(F,8))}})})})}return O}function E(O){var k=o(O,["schm"])[0];if(k){var F=h(k.subarray(4,8));if(F==="cbcs"||F==="cenc")return o(O,["schi","tenc"])[0]}return e.logger.error("[eme] missing 'schm' box"),null}function b(O,k){return o(k,["moof","traf"]).reduce(function(F,G){var H=o(G,["tfdt"])[0],j=H[0],Q=o(G,["tfhd"]).reduce(function(ee,ie){var se=u(ie,4),le=O[se];if(le){var xe=u(H,4);j===1&&(xe*=Math.pow(2,32),xe+=u(H,8));var Re=le.timescale||9e4,Ee=xe/Re;if(isFinite(Ee)&&(ee===null||Ee>1&63;return F===39||F===40}else{var G=k&31;return G===6}}function l(O,k,F,G){var H=x(O),j=0;j+=k;for(var Q=0,ee=0,ie=!1,se=0;j=H.length)break;se=H[j++],Q+=se}while(se===255);ee=0;do{if(j>=H.length)break;se=H[j++],ee+=se}while(se===255);var le=H.length-j;if(!ie&&Q===4&&j16){for(var de=[],ge=0;ge<16;ge++){var Ae=H[j++].toString(16);de.push(Ae.length==1?"0"+Ae:Ae),(ge===3||ge===5||ge===7||ge===9)&&de.push("-")}for(var Ve=ee-16,xt=new Uint8Array(Ve),Je=0;Jele)break}}function x(O){for(var k=O.byteLength,F=[],G=1;G1?k-1:0),G=1;G>24&255,ee[1]=j>>16&255,ee[2]=j>>8&255,ee[3]=j&255,ee.set(O,4),Q=0,j=8;Q0?(ee=new Uint8Array(4),k.length>0&&new DataView(ee.buffer).setUint32(0,k.length,!1)):ee=new Uint8Array;var ie=new Uint8Array(4);return F&&F.byteLength>0&&new DataView(ie.buffer).setUint32(0,F.byteLength,!1),c([112,115,115,104],new Uint8Array([G,0,0,0]),O,ee,H,ie,F||new Uint8Array)}function D(O){if(!(O instanceof ArrayBuffer)||O.byteLength<32)return null;var k={version:0,systemId:"",kids:null,data:null},F=new DataView(O),G=F.getUint32(0);if(O.byteLength!==G&&G>44)return null;var H=F.getUint32(4);if(H!==1886614376||(k.version=F.getUint32(8)>>>24,k.version>1))return null;k.systemId=I.default.hexDump(new Uint8Array(O,12,16));var j=F.getUint32(28);if(k.version===0){if(G-32{"use strict";L.r(N),L.d(N,{base64Decode:()=>A,base64DecodeToStr:()=>M,base64Encode:()=>e,base64ToBase64Url:()=>C,base64UrlEncode:()=>I,strToBase64Encode:()=>P});function C(f){return f.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function P(f){return btoa(f)}function M(f){return atob(f)}function e(f){return btoa(String.fromCharCode.apply(String,f))}function I(f){return C(e(f))}function A(f){return Uint8Array.from(atob(f),function(g){return g.charCodeAt(0)})}},"./src/utils/output-filter.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>C});var C=function(){function P(e,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=I}var M=P.prototype;return M.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},M.newCue=function(I,A,f){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=A,this.screen=f,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[],this.startTime=null},P}()},"./src/utils/texttrack-utils.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{addCueToTrack:()=>M,clearCurrentCues:()=>e,getCuesInRange:()=>f,removeCuesInRange:()=>I,sendAddTrackEvent:()=>P});var C=L("./src/utils/logger.ts");function P(g,h){var p;try{p=new Event("addtrack")}catch(u){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=g,h.dispatchEvent(p)}function M(g,h){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(h.id))try{if(g.addCue(h),!g.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(v){C.logger.debug("[texttrack-utils]: "+v);var u=new self.TextTrackCue(h.startTime,h.endTime,h.text);u.id=h.id,g.addCue(u)}p==="disabled"&&(g.mode=p)}function e(g){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues)for(var p=g.cues.length;p--;)g.removeCue(g.cues[p]);h==="disabled"&&(g.mode=h)}function I(g,h,p,u){var v=g.mode;if(v==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var m=f(g.cues,h,p),o=0;og[p].endTime)return-1;for(var u=0,v=p;u<=v;){var m=Math.floor((v+u)/2);if(hg[m].startTime&&u-1)for(var m=v,o=g.length;m=h&&a.endTime<=p)u.push(a);else if(a.startTime>p)return u}return u}},"./src/utils/time-ranges.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>P});var C={toString:function(e){for(var I="",A=e.length,f=0;f{"use strict";L.r(N),L.d(N,{toMpegTsClockFromTimescale:()=>I,toMsFromMpegTsClock:()=>e,toTimescaleFromBase:()=>P,toTimescaleFromScale:()=>M});var C=9e4;function P(A,f,g,h){g===void 0&&(g=1),h===void 0&&(h=!1);var p=A*f*g;return h?Math.round(p):p}function M(A,f,g,h){return g===void 0&&(g=1),h===void 0&&(h=!1),P(A,f,1/g,h)}function e(A,f){return f===void 0&&(f=!1),P(A,1e3,1/C,f)}function I(A,f){return f===void 0&&(f=1),P(A,C,1/f)}},"./src/utils/typed-array.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{sliceUint8:()=>C});function C(P,M,e){return Uint8Array.prototype.slice?P.slice(M,e):new Uint8Array(Array.prototype.slice.call(P,M,e))}},"./src/utils/vttcue.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>C});const C=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var P=["","lr","rl"],M=["start","middle","end","left","right"];function e(h,p){if(typeof p!="string"||!Array.isArray(h))return!1;var u=p.toLowerCase();return~h.indexOf(u)?u:!1}function I(h){return e(P,h)}function A(h){return e(M,h)}function f(h){for(var p=arguments.length,u=new Array(p>1?p-1:0),v=1;v100)throw new Error("Position must be between 0 and 100.");w=x,this.hasBeenReset=!0}})),Object.defineProperty(v,"positionAlign",f({},m,{get:function(){return r},set:function(x){var y=A(x);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(v,"size",f({},m,{get:function(){return n},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");n=x,this.hasBeenReset=!0}})),Object.defineProperty(v,"align",f({},m,{get:function(){return t},set:function(x){var y=A(x);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");t=y,this.hasBeenReset=!0}})),v.displayState=void 0}return g.prototype.getCueAsHTML=function(){var h=self.WebVTT;return h.convertCueToDOMTree(self,this.text)},g}()},"./src/utils/vttparser.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{VTTParser:()=>p,fixLineBreaks:()=>h,parseTimeStamp:()=>M});var C=L("./src/utils/vttcue.ts"),P=function(){function u(){}var v=u.prototype;return v.decode=function(o,a){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},u}();function M(u){function v(o,a,i,s){return(o|0)*3600+(a|0)*60+(i|0)+parseFloat(s||0)}var m=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return m?parseFloat(m[2])>59?v(m[2],m[3],0,m[4]):v(m[1],m[2],m[3],m[4]):null}var e=function(){function u(){this.values=Object.create(null)}var v=u.prototype;return v.set=function(o,a){!this.get(o)&&a!==""&&(this.values[o]=a)},v.get=function(o,a,i){return i?this.has(o)?this.values[o]:a[i]:this.has(o)?this.values[o]:a},v.has=function(o){return o in this.values},v.alt=function(o,a,i){for(var s=0;s=0&&i<=100)return this.set(o,i),!0}return!1},u}();function I(u,v,m,o){var a=o?u.split(o):[u];for(var i in a)if(typeof a[i]=="string"){var s=a[i].split(m);if(s.length===2){var E=s[0],b=s[1];v(E,b)}}}var A=new C.default(0,0,""),f=A.align==="middle"?"middle":"center";function g(u,v,m){var o=u;function a(){var E=M(u);if(E===null)throw new Error("Malformed timestamp: "+o);return u=u.replace(/^[^\sa-zA-Z-]+/,""),E}function i(E,b){var d=new e;I(E,function(S,w){var r;switch(S){case"region":for(var n=m.length-1;n>=0;n--)if(m[n].id===w){d.set(S,m[n].region);break}break;case"vertical":d.alt(S,w,["rl","lr"]);break;case"line":r=w.split(","),d.integer(S,r[0]),d.percent(S,r[0])&&d.set("snapToLines",!1),d.alt(S,r[0],["auto"]),r.length===2&&d.alt("lineAlign",r[1],["start",f,"end"]);break;case"position":r=w.split(","),d.percent(S,r[0]),r.length===2&&d.alt("positionAlign",r[1],["start",f,"end","line-left","line-right","auto"]);break;case"size":d.percent(S,w);break;case"align":d.alt(S,w,["start",f,"end","left","right"]);break}},/:/,/\s/),b.region=d.get("region",null),b.vertical=d.get("vertical","");var T=d.get("line","auto");T==="auto"&&A.line===-1&&(T=-1),b.line=T,b.lineAlign=d.get("lineAlign","start"),b.snapToLines=d.get("snapToLines",!0),b.size=d.get("size",100),b.align=d.get("align",f);var R=d.get("position","auto");R==="auto"&&A.position===50&&(R=b.align==="start"||b.align==="left"?0:b.align==="end"||b.align==="right"?100:50),b.position=R}function s(){u=u.replace(/^\s+/,"")}if(s(),v.startTime=a(),s(),u.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);u=u.slice(3),s(),v.endTime=a(),s(),i(u,v)}function h(u){return u.replace(//gi,` `)}var p=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var v=u.prototype;return v.parse=function(o){var a=this;o&&(a.buffer+=a.decoder.decode(o,{stream:!0}));function i(){var R=a.buffer,S=0;for(R=h(R);S")===-1){a.cue.id=E;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{g(E,a.cue,a.regionList)}catch(R){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var T=E.indexOf("-->")!==-1;if(!E||T&&(d=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=` `),a.cue.text+=E}continue;case"BADCUE":E||(a.state="ID")}}}catch(R){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},v.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=` `,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){o.onparsingerror&&o.onparsingerror(a)}return o.onflush&&o.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{generateCueId:()=>p,parseWebVTT:()=>v});var C=L("./src/polyfills/number.ts"),P=L("./src/utils/vttparser.ts"),M=L("./src/demux/id3.ts"),e=L("./src/utils/timescale-conversion.ts"),I=L("./src/remux/mp4-remuxer.ts"),A=/\r\n|\n\r|\n|\r/g,f=function(o,a,i){return i===void 0&&(i=0),o.slice(i,i+a.length)===a},g=function(o){var a=parseInt(o.slice(-3)),i=parseInt(o.slice(-6,-4)),s=parseInt(o.slice(-9,-7)),E=o.length>9?parseInt(o.substring(0,o.indexOf(":"))):0;if(!(0,C.isFiniteNumber)(a)||!(0,C.isFiniteNumber)(i)||!(0,C.isFiniteNumber)(s)||!(0,C.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return a+=1e3*i,a+=60*1e3*s,a+=60*60*1e3*E,a},h=function(o){for(var a=5381,i=o.length;i;)a=a*33^o.charCodeAt(--i);return(a>>>0).toString()};function p(m,o,a){return h(m.toString())+h(o.toString())+h(a)}var u=function(o,a,i){var s=o[a],E=o[s.prevCC];if(!E||!E.new&&s.new){o.ccOffset=o.presentationOffset=s.start,s.new=!1;return}for(;(b=E)!==null&&b!==void 0&&b.new;){var b;o.ccOffset+=s.start-E.start,s.new=!1,s=E,E=o[s.prevCC]}o.presentationOffset=i};function v(m,o,a,i,s,E,b,d){var T=new P.VTTParser,R=(0,M.utf8ArrayToStr)(new Uint8Array(m)).trim().replace(A,` `).split(` `),S=[],w=(0,e.toMpegTsClockFromTimescale)(o,a),r="00:00.000",n=0,t=0,l,x=!0;T.oncue=function(y){var c=i[s],_=i.ccOffset,D=(n-w)/9e4;c!=null&&c.new&&(t!==void 0?_=i.ccOffset=c.start:u(i,s,D)),D&&(_=D-i.presentationOffset);var O=y.endTime-y.startTime,k=(0,I.normalizePts)((y.startTime+_-t)*9e4,E*9e4)/9e4;y.startTime=Math.max(k,0),y.endTime=Math.max(k+O,0);var F=y.text.trim();y.text=decodeURIComponent(encodeURIComponent(F)),y.id||(y.id=p(y.startTime,y.endTime,F)),y.endTime>0&&S.push(y)},T.onparsingerror=function(y){l=y},T.onflush=function(){if(l){d(l);return}b(S)},R.forEach(function(y){if(x)if(f(y,"X-TIMESTAMP-MAP=")){x=!1,y.slice(16).split(",").forEach(function(c){f(c,"LOCAL:")?r=c.slice(6):f(c,"MPEGTS:")&&(n=parseInt(c.slice(7)))});try{t=g(r)/1e3}catch(c){l=c}return}else y===""&&(x=!1);T.parse(y+` `)}),T.flush()}},"./src/utils/xhr-loader.ts":(V,N,L)=>{"use strict";L.r(N),L.d(N,{default:()=>I});var C=L("./src/utils/logger.ts"),P=L("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,e=function(){function A(g){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=g?g.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var f=A.prototype;return f.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},f.abortInternal=function(){var h=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),h&&(h.onreadystatechange=null,h.onprogress=null,h.readyState!==4&&(this.stats.aborted=!0,h.abort()))},f.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},f.load=function(h,p,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=h,this.config=p,this.callbacks=u,this.retryDelay=p.retryDelay,this.loadInternal()},f.loadInternal=function(){var h=this.config,p=this.context;if(h){var u=this.loader=new self.XMLHttpRequest,v=this.stats;v.loading.first=0,v.loaded=0;var m=this.xhrSetup;try{if(m)try{m(u,p.url)}catch(i){u.open("GET",p.url,!0),m(u,p.url)}u.readyState||u.open("GET",p.url,!0);var o=this.context.headers;if(o)for(var a in o)u.setRequestHeader(a,o[a])}catch(i){this.callbacks.onError({code:u.status,text:i.message},p,u);return}p.rangeEnd&&u.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout),u.send()}},f.readystatechange=function(){var h=this.context,p=this.loader,u=this.stats;if(!(!h||!p)){var v=p.readyState,m=this.config;if(!u.aborted&&v>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),v===4){p.onreadystatechange=null,p.onprogress=null;var o=p.status,a=p.responseType==="arraybuffer";if(o>=200&&o<300&&(a&&p.response||p.responseText!==null)){u.loading.end=Math.max(self.performance.now(),u.loading.first);var i,s;if(a?(i=p.response,s=i.byteLength):(i=p.responseText,s=i.length),u.loaded=u.total=s,!this.callbacks)return;var E=this.callbacks.onProgress;if(E&&E(u,h,i,p),!this.callbacks)return;var b={url:p.responseURL,data:i};this.callbacks.onSuccess(b,u,h,p)}else u.retry>=m.maxRetry||o>=400&&o<499?(C.logger.error(o+" while loading "+h.url),this.callbacks.onError({code:o,text:p.statusText},h,p)):(C.logger.warn(o+" while loading "+h.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,m.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout)}},f.loadtimeout=function(){C.logger.warn("timeout while loading "+this.context.url);var h=this.callbacks;h&&(this.abortInternal(),h.onTimeout(this.stats,this.context,this.loader))},f.loadprogress=function(h){var p=this.stats;p.loaded=h.loaded,h.lengthComputable&&(p.total=h.total)},f.getCacheAge=function(){var h=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");h=p?parseFloat(p):null}return h},A}();const I=e},"./node_modules/eventemitter3/index.js":V=>{"use strict";var N=Object.prototype.hasOwnProperty,L="~";function C(){}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(L=!1));function P(A,f,g){this.fn=A,this.context=f,this.once=g||!1}function M(A,f,g,h,p){if(typeof g!="function")throw new TypeError("The listener must be a function");var u=new P(g,h||A,p),v=L?L+f:f;return A._events[v]?A._events[v].fn?A._events[v]=[A._events[v],u]:A._events[v].push(u):(A._events[v]=u,A._eventsCount++),A}function e(A,f){--A._eventsCount===0?A._events=new C:delete A._events[f]}function I(){this._events=new C,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],g,h;if(this._eventsCount===0)return f;for(h in g=this._events)N.call(g,h)&&f.push(L?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(g)):f},I.prototype.listeners=function(f){var g=L?L+f:f,h=this._events[g];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,u=h.length,v=new Array(u);p{var N=V&&V.__esModule?()=>V.default:()=>V;return Z.d(N,{a:N}),N},Z.d=(V,N)=>{for(var L in N)Z.o(N,L)&&!Z.o(V,L)&&Object.defineProperty(V,L,{enumerable:!0,get:N[L]})},Z.o=(V,N)=>Object.prototype.hasOwnProperty.call(V,N),Z.r=V=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})};var J=Z("./src/hls.ts");return J=J.default,J})())},84204:function(He,ye,K){"use strict";var Z,J;function V(N,L,C){var P=function(M,e){return N.js_beautify(M,e)};return P.js=N.js_beautify,P.css=L.css_beautify,P.html=C.html_beautify,P.js_beautify=N.js_beautify,P.css_beautify=L.css_beautify,P.html_beautify=C.html_beautify,P}Z=[K(77937),K(85040),K(3566)],J=function(N,L,C){return V(N,L,C)}.apply(ye,Z),J!==void 0&&(He.exports=J)},85040:function(He,ye){var K,Z;(function(){var J;(function(){"use strict";var N=[,,function(M){function e(f){this.__parent=f,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}e.prototype.clone_empty=function(){var f=new e(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},e.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},e.prototype.has_match=function(f){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(f))return!0;return!1},e.prototype.set_indent=function(f,g){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(f){this.__items.push(f);var g=f.lastIndexOf(` `);g!==-1?this.__character_count=f.length-g:this.__character_count+=f.length},e.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function I(f,g){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),g=g||"",f.indent_level>0&&(g=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}I.prototype.get_indent_size=function(f,g){var h=this.__base_string_length;return g=g||0,f<0&&(h=0),h+=f*this.__indent_size,h+=g,h},I.prototype.get_indent_string=function(f,g){var h=this.__base_string;return g=g||0,f<0&&(f=0,h=""),g+=f*this.__indent_size,this.__ensure_cache(g),h+=this.__cache[g],h},I.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},I.prototype.__add_column=function(){var f=this.__cache.length,g=0,h="";this.__indent_size&&f>=this.__indent_size&&(g=Math.floor(f/this.__indent_size),f-=g*this.__indent_size,h=new Array(g+1).join(this.__indent_string)),f&&(h+=new Array(f+1).join(" ")),this.__cache.push(h)};function A(f,g){this.__indent_cache=new I(f,g),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}A.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},A.prototype.get_line_number=function(){return this.__lines.length},A.prototype.get_indent_string=function(f,g){return this.__indent_cache.get_indent_string(f,g)},A.prototype.get_indent_size=function(f,g){return this.__indent_cache.get_indent_size(f,g)},A.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},A.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},A.prototype.get_code=function(f){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===` `&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(` `);return f!==` `&&(h=h.replace(/[\n]/g,f)),h},A.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},A.prototype.set_indent=function(f,g){return f=f||0,g=g||0,this.next_line.set_indent(f,g),this.__lines.length>1?(this.current_line.set_indent(f,g),!0):(this.current_line.set_indent(),!1)},A.prototype.add_raw_token=function(f){for(var g=0;g1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},A.prototype.just_added_newline=function(){return this.current_line.is_empty()},A.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},A.prototype.ensure_empty_line_above=function(f,g){for(var h=this.__lines.length-2;h>=0;){var p=this.__lines[h];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==g){this.__lines.splice(h+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},M.exports.Output=A},,,,function(M){function e(f,g){this.raw_options=I(f,g),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}e.prototype._get_array=function(f,g){var h=this.raw_options[f],p=g||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(p=h.concat()):typeof h=="string"&&(p=h.split(/[^a-zA-Z0-9_\/\-]+/)),p},e.prototype._get_boolean=function(f,g){var h=this.raw_options[f],p=h===void 0?!!g:!!h;return p},e.prototype._get_characters=function(f,g){var h=this.raw_options[f],p=g||"";return typeof h=="string"&&(p=h.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),p},e.prototype._get_number=function(f,g){var h=this.raw_options[f];g=parseInt(g,10),isNaN(g)&&(g=0);var p=parseInt(h,10);return isNaN(p)&&(p=g),p},e.prototype._get_selection=function(f,g,h){var p=this._get_selection_list(f,g,h);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values: `+g+` You passed in: '`+this.raw_options[f]+"'");return p[0]},e.prototype._get_selection_list=function(f,g,h){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[g[0]],!this._is_valid_selection(h,g))throw new Error("Invalid Default Value!");var p=this._get_array(f,h);if(!this._is_valid_selection(p,g))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values: `+g+` You passed in: '`+this.raw_options[f]+"'");return p},e.prototype._is_valid_selection=function(f,g){return f.length&&g.length&&!f.some(function(h){return g.indexOf(h)===-1})};function I(f,g){var h={};f=A(f);var p;for(p in f)p!==g&&(h[p]=f[p]);if(g&&f[g])for(p in f[g])h[p]=f[g][p];return h}function A(f){var g={},h;for(h in f){var p=h.replace(/-/g,"_");g[p]=f[h]}return g}M.exports.Options=e,M.exports.normalizeOpts=A,M.exports.mergeOpts=I},,function(M){var e=RegExp.prototype.hasOwnProperty("sticky");function I(A){this.__input=A||"",this.__input_length=this.__input.length,this.__position=0}I.prototype.restart=function(){this.__position=0},I.prototype.back=function(){this.__position>0&&(this.__position-=1)},I.prototype.hasNext=function(){return this.__position=0&&A=0&&f=A.length&&this.__input.substring(f-A.length,f).toLowerCase()===A},M.exports.InputScanner=I},,,,,function(M){function e(I,A){I=typeof I=="string"?I:I.source,A=typeof A=="string"?A:A.source,this.__directives_block_pattern=new RegExp(I+/ beautify( \w+[:]\w+)+ /.source+A,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(I+/\sbeautify\signore:end\s/.source+A,"g")}e.prototype.get_directives=function(I){if(!I.match(this.__directives_block_pattern))return null;var A={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(I);f;)A[f[1]]=f[2],f=this.__directive_pattern.exec(I);return A},e.prototype.readIgnored=function(I){return I.readUntilAfter(this.__directives_end_ignore_pattern)},M.exports.Directives=e},,function(M,e,I){var A=I(16).Beautifier,f=I(17).Options;function g(h,p){var u=new A(h,p);return u.beautify()}M.exports=g,M.exports.defaultOptions=function(){return new f}},function(M,e,I){var A=I(17).Options,f=I(2).Output,g=I(8).InputScanner,h=I(13).Directives,p=new h(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,v=/\r\n|[\r\n]/g,m=/\s/,o=/(?:\s|\n)+/g,a=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,i=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function s(E,b){this._source_text=E||"",this._options=new A(b),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}s.prototype.eatString=function(E){var b="";for(this._ch=this._input.next();this._ch;){if(b+=this._ch,this._ch==="\\")b+=this._input.next();else if(E.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return b},s.prototype.eatWhitespace=function(E){for(var b=m.test(this._input.peek()),d=0;m.test(this._input.peek());)this._ch=this._input.next(),E&&this._ch===` `&&(d===0||d0&&this._indentLevel--},s.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,b=this._options.eol;b==="auto"&&(b=` `,E&&u.test(E||"")&&(b=E.match(u)[0])),E=E.replace(v,` `);var d=E.match(/^[\t ]*/)[0];this._output=new f(this._options,d),this._input=new g(E),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,R=!1,S=!1,w=!1,r=!1,n=!1,t=!1,l=this._ch,x=!1,y,c,_;y=this._input.read(o),c=y!=="",_=l,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),l=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var D=this._input.read(a),O=p.get_directives(D);O&&O.ignore==="start"&&(D+=p.readIgnored(this._input)),this.print_string(D),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(i)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(c),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s$/,""),this.print_string(k),this._output.space_before_token=!0),k=k.replace(/\s$/,""),k==="extend"?r=!0:k==="import"&&(n=!0),k in this.NESTED_AT_RULE?(this._nestedLevel+=1,k in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!R&&T===0&&k.indexOf(":")!==-1&&(S=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(c),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")S&&(S=!1,this.outdent()),w?(w=!1,R=this._indentLevel>=this._nestedLevel):R=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&R&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(_==="("?this._output.space_before_token=!1:_!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),_==="{"&&this._output.trim(!0),n=!1,r=!1,S&&(this.outdent(),S=!1),this.print_string(this._ch),R=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var F=0;F"||this._ch==="+"||this._ch==="~")&&!S&&T===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&m.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(c),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),m.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var j=_==='"'||_==="'";this.preserveSingleSpace(j||c),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&x&&this._output.add_new_line()}var Q=this._output.get_code(b);return Q},M.exports.Beautifier=s},function(M,e,I){var A=I(6).Options;function f(g){A.call(this,g,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var h=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||h;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u=0;u--)if(this.__items[u].match(p))return!0;return!1},f.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(` `);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},f.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function g(p,u){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(p,u){var v=this.__base_string_length;return u=u||0,p<0&&(v=0),v+=p*this.__indent_size,v+=u,v},g.prototype.get_indent_string=function(p,u){var v=this.__base_string;return u=u||0,p<0&&(p=0,v=""),u+=p*this.__indent_size,this.__ensure_cache(u),v+=this.__cache[u],v},g.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var p=this.__cache.length,u=0,v="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,v=new Array(u+1).join(this.__indent_string)),p&&(v+=new Array(p+1).join(" ")),this.__cache.push(v)};function h(p,u){this.__indent_cache=new g(p,u),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},h.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var v=this.__lines.join(` `);return p!==` `&&(v=v.replace(/[\n]/g,p)),v},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(p){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(p,u){for(var v=this.__lines.length-2;v>=0;){var m=this.__lines[v];if(m.is_empty())break;if(m.item(0).indexOf(p)!==0&&m.item(-1)!==u){this.__lines.splice(v+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}v--}},A.exports.Output=h},function(A){function f(g,h,p,u){this.type=g,this.text=h,this.comments_before=null,this.newlines=p||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}A.exports.Token=f},,,function(A){function f(p,u){this.raw_options=g(p,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(p,u){var v=this.raw_options[p],m=u||[];return typeof v=="object"?v!==null&&typeof v.concat=="function"&&(m=v.concat()):typeof v=="string"&&(m=v.split(/[^a-zA-Z0-9_\/\-]+/)),m},f.prototype._get_boolean=function(p,u){var v=this.raw_options[p],m=v===void 0?!!u:!!v;return m},f.prototype._get_characters=function(p,u){var v=this.raw_options[p],m=u||"";return typeof v=="string"&&(m=v.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),m},f.prototype._get_number=function(p,u){var v=this.raw_options[p];u=parseInt(u,10),isNaN(u)&&(u=0);var m=parseInt(v,10);return isNaN(m)&&(m=u),m},f.prototype._get_selection=function(p,u,v){var m=this._get_selection_list(p,u,v);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values: `+u+` You passed in: '`+this.raw_options[p]+"'");return m[0]},f.prototype._get_selection_list=function(p,u,v){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(v=v||[u[0]],!this._is_valid_selection(v,u))throw new Error("Invalid Default Value!");var m=this._get_array(p,v);if(!this._is_valid_selection(m,u))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values: `+u+` You passed in: '`+this.raw_options[p]+"'");return m},f.prototype._is_valid_selection=function(p,u){return p.length&&u.length&&!p.some(function(v){return u.indexOf(v)===-1})};function g(p,u){var v={};p=h(p);var m;for(m in p)m!==u&&(v[m]=p[m]);if(u&&p[u])for(m in p[u])v[m]=p[u][m];return v}function h(p){var u={},v;for(v in p){var m=v.replace(/-/g,"_");u[m]=p[v]}return u}A.exports.Options=f,A.exports.normalizeOpts=h,A.exports.mergeOpts=g},,function(A){var f=RegExp.prototype.hasOwnProperty("sticky");function g(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&h=0&&p=h.length&&this.__input.substring(p-h.length,p).toLowerCase()===h},A.exports.InputScanner=g},function(A,f,g){var h=g(8).InputScanner,p=g(3).Token,u=g(10).TokenStream,v=g(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(a,i){this._input=new h(a),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new v(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var a,i=new p(m.START,""),s=null,E=[],b=new u;i.type!==m.EOF;){for(a=this._get_next_token(i,s);this._is_comment(a);)b.add(a),a=this._get_next_token(i,s);b.isEmpty()||(a.comments_before=b,b=new u),a.parent=s,this._is_opening(a)?(E.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=E.pop(),a.parent=s),a.previous=i,i.next=a,this.__tokens.add(a),i=a}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(a,i){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(m.RAW,s):this._create_token(m.EOF,"")},o.prototype._is_comment=function(a){return!1},o.prototype._is_opening=function(a){return!1},o.prototype._is_closing=function(a,i){return!1},o.prototype._create_token=function(a,i){var s=new p(a,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},A.exports.Tokenizer=o,A.exports.TOKEN=m},function(A){function f(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position=0&&g/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new h,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(v){var m=this._create();return m._disabled[v]=!0,m._update(),m},u.prototype.read_options=function(v){var m=this._create();for(var o in p)m._disabled[o]=v.templating.indexOf(o)===-1;return m._update(),m},u.prototype.exclude=function(v){var m=this._create();return m._excluded[v]=!0,m._update(),m},u.prototype.read=function(){var v="";this._match_pattern?v=this._input.read(this._starting_pattern):v=this._input.read(this._starting_pattern,this.__template_pattern);for(var m=this._read_template();m;)this._match_pattern?m+=this._input.read(this._match_pattern):m+=this._input.readUntil(this.__template_pattern),v+=m,m=this._read_template();return this._until_after&&(v+=this._input.readUntilAfter(this._until_pattern)),v},u.prototype.__set_templated_pattern=function(){var v=[];this._disabled.php||v.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||v.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||v.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(v.push(this.__patterns.django._starting_pattern.source),v.push(this.__patterns.django_value._starting_pattern.source),v.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||v.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&v.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+v.join("|")+")")},u.prototype._read_template=function(){var v="",m=this._input.peek();if(m==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(v=v||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(v=v||this.__patterns.erb.read())}else m==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(v=v||this.__patterns.handlebars_comment.read(),v=v||this.__patterns.handlebars_unescaped.read(),v=v||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(v=v||this.__patterns.django_value.read()),this._excluded.django||(v=v||this.__patterns.django_comment.read(),v=v||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(v=v||this.__patterns.smarty_comment.read(),v=v||this.__patterns.smarty_literal.read(),v=v||this.__patterns.smarty.read()));return v},A.exports.TemplatablePattern=u},,,,function(A,f,g){var h=g(19).Beautifier,p=g(20).Options;function u(v,m,o,a){var i=new h(v,m,o,a);return i.beautify()}A.exports=u,A.exports.defaultOptions=function(){return new p}},function(A,f,g){var h=g(20).Options,p=g(2).Output,u=g(21).Tokenizer,v=g(21).TOKEN,m=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=function(r,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=r.max_preserve_newlines,this.preserve_newlines=r.preserve_newlines,this._output=new p(r,n)};a.prototype.current_line_has_match=function(r){return this._output.current_line.has_match(r)},a.prototype.set_space_before_token=function(r,n){this._output.space_before_token=r,this._output.non_breaking_space=n},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(r){this._output.add_raw_token(r)},a.prototype.print_preserved_newlines=function(r){var n=0;r.type!==v.TEXT&&r.previous.type!==v.TEXT&&(n=r.newlines?1:0),this.preserve_newlines&&(n=r.newlines0);return n!==0},a.prototype.traverse_whitespace=function(r){return r.whitespace_before||r.newlines?(this.print_preserved_newlines(r)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(r){this._output.add_new_line(r)},a.prototype.print_token=function(r){r.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(r.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(r){return r=this.indent_level+(r||0),r<1?"":this._output.get_indent_string(r)};var i=function(r){for(var n=null,t=r.next;t.type!==v.EOF&&r.closed!==t;){if(t.type===v.ATTRIBUTE&&t.text==="type"){t.next&&t.next.type===v.EQUALS&&t.next.next&&t.next.next.type===v.VALUE&&(n=t.next.next.text);break}t=t.next}return n},s=function(r,n){var t=null,l=null;return n.closed?(r==="script"?t="text/javascript":r==="style"&&(t="text/css"),t=i(n)||t,t.search("text/css")>-1?l="css":t.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?l="javascript":t.search(/(text|application|dojo)\/(x-)?(html)/)>-1?l="html":t.search(/test\/null/)>-1&&(l="null"),l):null};function E(r,n){return n.indexOf(r)!==-1}function b(r,n,t){this.parent=r||null,this.tag=n?n.tag_name:"",this.indent_level=t||0,this.parser_token=n||null}function d(r){this._printer=r,this._current_frame=null}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(r){var n=new b(this._current_frame,r,this._printer.indent_level);this._current_frame=n},d.prototype._try_pop_frame=function(r){var n=null;return r&&(n=r.parser_token,this._printer.indent_level=r.indent_level,this._current_frame=r.parent),n},d.prototype._get_frame=function(r,n){for(var t=this._current_frame;t&&r.indexOf(t.tag)===-1;){if(n&&n.indexOf(t.tag)!==-1){t=null;break}t=t.parent}return t},d.prototype.try_pop=function(r,n){var t=this._get_frame([r],n);return this._try_pop_frame(t)},d.prototype.indent_to_tag=function(r){var n=this._get_frame(r);n&&(this._printer.indent_level=n.indent_level)};function T(r,n,t,l){this._source_text=r||"",n=n||{},this._js_beautify=t,this._css_beautify=l,this._tag_stack=null;var x=new h(n,"html");this._options=x,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var r=this._source_text,n=this._options.eol;this._options.eol==="auto"&&(n=` `,r&&m.test(r)&&(n=r.match(m)[0])),r=r.replace(o,` `);var t=r.match(/^[\t ]*/)[0],l={text:"",type:""},x=new R,y=new a(this._options,t),c=new u(r,this._options).tokenize();this._tag_stack=new d(y);for(var _=null,D=c.next();D.type!==v.EOF;)D.type===v.TAG_OPEN||D.type===v.COMMENT?(_=this._handle_tag_open(y,D,x,l),x=_):D.type===v.ATTRIBUTE||D.type===v.EQUALS||D.type===v.VALUE||D.type===v.TEXT&&!x.tag_complete?_=this._handle_inside_tag(y,D,x,c):D.type===v.TAG_CLOSE?_=this._handle_tag_close(y,D,x):D.type===v.TEXT?_=this._handle_text(y,D,x):y.add_raw_token(D),l=_,D=c.next();var O=y._output.get_code(n);return O},T.prototype._handle_tag_close=function(r,n,t){var l={text:n.text,type:n.type};return r.alignment_size=0,t.tag_complete=!0,r.set_space_before_token(n.newlines||n.whitespace_before!=="",!0),t.is_unformatted?r.add_raw_token(n):(t.tag_start_char==="<"&&(r.set_space_before_token(n.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&t.has_wrapped_attrs&&r.print_newline(!1)),r.print_token(n)),t.indent_content&&!(t.is_unformatted||t.is_content_unformatted)&&(r.indent(),t.indent_content=!1),!t.is_inline_element&&!(t.is_unformatted||t.is_content_unformatted)&&r.set_wrap_point(),l},T.prototype._handle_inside_tag=function(r,n,t,l){var x=t.has_wrapped_attrs,y={text:n.text,type:n.type};if(r.set_space_before_token(n.newlines||n.whitespace_before!=="",!0),t.is_unformatted)r.add_raw_token(n);else if(t.tag_start_char==="{"&&n.type===v.TEXT)r.print_preserved_newlines(n)?(n.newlines=0,r.add_raw_token(n)):r.print_token(n);else{if(n.type===v.ATTRIBUTE?(r.set_space_before_token(!0),t.attr_count+=1):(n.type===v.EQUALS||n.type===v.VALUE&&n.previous.type===v.EQUALS)&&r.set_space_before_token(!1),n.type===v.ATTRIBUTE&&t.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(r.traverse_whitespace(n),x=x||n.newlines!==0),this._is_wrap_attributes_force)){var c=t.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&t.attr_count===1){var _=!0,D=0,O;do{if(O=l.peek(D),O.type===v.ATTRIBUTE){_=!1;break}D+=1}while(D<4&&O.type!==v.EOF&&O.type!==v.TAG_CLOSE);c=!_}c&&(r.print_newline(!1),x=!0)}r.print_token(n),x=x||r.previous_token_wrapped(),t.has_wrapped_attrs=x}return y},T.prototype._handle_text=function(r,n,t){var l={text:n.text,type:"TK_CONTENT"};return t.custom_beautifier_name?this._print_custom_beatifier_text(r,n,t):t.is_unformatted||t.is_content_unformatted?r.add_raw_token(n):(r.traverse_whitespace(n),r.print_token(n)),l},T.prototype._print_custom_beatifier_text=function(r,n,t){var l=this;if(n.text!==""){var x=n.text,y,c=1,_="",D="";t.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?y=this._js_beautify:t.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?y=this._css_beautify:t.custom_beautifier_name==="html"&&(y=function(j,Q){var ee=new T(j,Q,l._js_beautify,l._css_beautify);return ee.beautify()}),this._options.indent_scripts==="keep"?c=0:this._options.indent_scripts==="separate"&&(c=-r.indent_level);var O=r.get_full_indent(c);if(x=x.replace(/\n[ \t]*$/,""),t.custom_beautifier_name!=="html"&&x[0]==="<"&&x.match(/^(|]]>)$/.exec(x);if(!k){r.add_raw_token(n);return}_=O+k[1]+` `,x=k[4],k[5]&&(D=O+k[5]),x=x.replace(/\n[ \t]*$/,""),(k[2]||k[3].indexOf(` `)!==-1)&&(k=k[3].match(/[ \t]+$/),k&&(n.whitespace_before=k[0]))}if(x)if(y){var F=function(){this.eol=` `};F.prototype=this._options.raw_options;var G=new F;x=y(O+x,G)}else{var H=n.whitespace_before;H&&(x=x.replace(new RegExp(` (`+H+")?","g"),` `)),x=O+x.replace(/\n/g,` `+O)}_&&(x?x=_+x+` `+D:x=_+D),r.print_newline(!1),x&&(n.text=x,n.whitespace_before="",n.newlines=0,r.add_raw_token(n),r.print_newline(!0))}},T.prototype._handle_tag_open=function(r,n,t,l){var x=this._get_tag_open_token(n);return(t.is_unformatted||t.is_content_unformatted)&&!t.is_empty_element&&n.type===v.TAG_OPEN&&n.text.indexOf("]*)/),this.tag_check=t?t[1]:""):(t=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=t?t[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&n.next!==null?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===v.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&n.closed.text==="/>";var l=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(l=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(l)))}};T.prototype._get_tag_open_token=function(r){var n=new R(this._tag_stack.get_parser_token(),r);return n.alignment_size=this._options.wrap_attributes_indent_size,n.is_end_tag=n.is_end_tag||E(n.tag_check,this._options.void_elements),n.is_empty_element=n.tag_complete||n.is_start_tag&&n.is_end_tag,n.is_unformatted=!n.tag_complete&&E(n.tag_check,this._options.unformatted),n.is_content_unformatted=!n.is_empty_element&&E(n.tag_check,this._options.content_unformatted),n.is_inline_element=E(n.tag_name,this._options.inline)||n.tag_name.includes("-")||n.tag_start_char==="{",n},T.prototype._set_tag_position=function(r,n,t,l,x){if(t.is_empty_element||(t.is_end_tag?t.start_tag_token=this._tag_stack.try_pop(t.tag_name):(this._do_optional_end_element(t)&&(t.is_inline_element||r.print_newline(!1)),this._tag_stack.record_tag(t),(t.tag_name==="script"||t.tag_name==="style")&&!(t.is_unformatted||t.is_content_unformatted)&&(t.custom_beautifier_name=s(t.tag_check,n)))),E(t.tag_check,this._options.extra_liners)&&(r.print_newline(!1),r._output.just_added_blankline()||r.print_newline(!0)),t.is_empty_element){if(t.tag_start_char==="{"&&t.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),t.indent_content=!0;var y=r.current_line_has_match(/{{#if/);y||r.print_newline(!1)}t.tag_name==="!--"&&x.type===v.TAG_CLOSE&&l.is_end_tag&&t.text.indexOf(` `)===-1||(t.is_inline_element||t.is_unformatted||r.print_newline(!1),this._calcluate_parent_multiline(r,t))}else if(t.is_end_tag){var c=!1;c=t.start_tag_token&&t.start_tag_token.multiline_content,c=c||!t.is_inline_element&&!(l.is_inline_element||l.is_unformatted)&&!(x.type===v.TAG_CLOSE&&t.start_tag_token===l)&&x.type!=="TK_CONTENT",(t.is_content_unformatted||t.is_unformatted)&&(c=!1),c&&r.print_newline(!1)}else t.indent_content=!t.custom_beautifier_name,t.tag_start_char==="<"&&(t.tag_name==="html"?t.indent_content=this._options.indent_inner_html:t.tag_name==="head"?t.indent_content=this._options.indent_head_inner_html:t.tag_name==="body"&&(t.indent_content=this._options.indent_body_inner_html)),!(t.is_inline_element||t.is_unformatted)&&(x.type!=="TK_CONTENT"||t.is_content_unformatted)&&r.print_newline(!1),this._calcluate_parent_multiline(r,t)},T.prototype._calcluate_parent_multiline=function(r,n){n.parent&&r._output.just_added_newline()&&!((n.is_inline_element||n.is_unformatted)&&n.parent.is_inline_element)&&(n.parent.multiline_content=!0)};var S=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],w=["a","audio","del","ins","map","noscript","video"];T.prototype._do_optional_end_element=function(r){var n=null;if(!(r.is_empty_element||!r.is_start_tag||!r.parent)){if(r.tag_name==="body")n=n||this._tag_stack.try_pop("head");else if(r.tag_name==="li")n=n||this._tag_stack.try_pop("li",["ol","ul"]);else if(r.tag_name==="dd"||r.tag_name==="dt")n=n||this._tag_stack.try_pop("dt",["dl"]),n=n||this._tag_stack.try_pop("dd",["dl"]);else if(r.parent.tag_name==="p"&&S.indexOf(r.tag_name)!==-1){var t=r.parent.parent;(!t||w.indexOf(t.tag_name)===-1)&&(n=n||this._tag_stack.try_pop("p"))}else r.tag_name==="rp"||r.tag_name==="rt"?(n=n||this._tag_stack.try_pop("rt",["ruby","rtc"]),n=n||this._tag_stack.try_pop("rp",["ruby","rtc"])):r.tag_name==="optgroup"?n=n||this._tag_stack.try_pop("optgroup",["select"]):r.tag_name==="option"?n=n||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):r.tag_name==="colgroup"?n=n||this._tag_stack.try_pop("caption",["table"]):r.tag_name==="thead"?(n=n||this._tag_stack.try_pop("caption",["table"]),n=n||this._tag_stack.try_pop("colgroup",["table"])):r.tag_name==="tbody"||r.tag_name==="tfoot"?(n=n||this._tag_stack.try_pop("caption",["table"]),n=n||this._tag_stack.try_pop("colgroup",["table"]),n=n||this._tag_stack.try_pop("thead",["table"]),n=n||this._tag_stack.try_pop("tbody",["table"])):r.tag_name==="tr"?(n=n||this._tag_stack.try_pop("caption",["table"]),n=n||this._tag_stack.try_pop("colgroup",["table"]),n=n||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(r.tag_name==="th"||r.tag_name==="td")&&(n=n||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),n=n||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return r.parent=this._tag_stack.get_parser_token(),n}},A.exports.Beautifier=T},function(A,f,g){var h=g(6).Options;function p(u){h.call(this,u,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}p.prototype=new h,A.exports.Options=p},function(A,f,g){var h=g(9).Tokenizer,p=g(9).TOKEN,u=g(13).Directives,v=g(14).TemplatablePattern,m=g(12).Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:p.START,RAW:p.RAW,EOF:p.EOF},a=new u(/<\!--/,/-->/),i=function(s,E){h.call(this,s,E),this._current_tag_name="";var b=new v(this._input).read_options(this._options),d=new m(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),handlebars_comment:d.starting_with(/{{!--/).until_after(/--}}/),handlebars:d.starting_with(/{{/).until_after(/}}/),handlebars_open:d.until(/[\n\r\t }]/),handlebars_raw_close:d.until(/}}/),comment:d.starting_with(//),cdata:d.starting_with(//),conditional_comment:d.starting_with(//),processing:d.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var T=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=d.matching(T).until_after(T)}};i.prototype=new h,i.prototype._is_comment=function(s){return!1},i.prototype._is_opening=function(s){return s.type===o.TAG_OPEN},i.prototype._is_closing=function(s,E){return s.type===o.TAG_CLOSE&&E&&((s.text===">"||s.text==="/>")&&E.text[0]==="<"||s.text==="}}"&&E.text[0]==="{"&&E.text[1]==="{")},i.prototype._reset=function(){this._current_tag_name=""},i.prototype._get_next_token=function(s,E){var b=null;this._readWhitespace();var d=this._input.peek();return d===null?this._create_token(o.EOF,""):(b=b||this._read_open_handlebars(d,E),b=b||this._read_attribute(d,s,E),b=b||this._read_close(d,E),b=b||this._read_raw_content(d,s,E),b=b||this._read_content_word(d),b=b||this._read_comment_or_cdata(d),b=b||this._read_processing(d),b=b||this._read_open(d,E),b=b||this._create_token(o.UNKNOWN,this._input.next()),b)},i.prototype._read_comment_or_cdata=function(s){var E=null,b=null,d=null;if(s==="<"){var T=this._input.peek(1);T==="!"&&(b=this.__patterns.comment.read(),b?(d=a.get_directives(b),d&&d.ignore==="start"&&(b+=a.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(E=this._create_token(o.COMMENT,b),E.directives=d)}return E},i.prototype._read_processing=function(s){var E=null,b=null,d=null;if(s==="<"){var T=this._input.peek(1);(T==="!"||T==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(E=this._create_token(o.COMMENT,b),E.directives=d)}return E},i.prototype._read_open=function(s,E){var b=null,d=null;return E||s==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),d=this._create_token(o.TAG_OPEN,b)),d},i.prototype._read_open_handlebars=function(s,E){var b=null,d=null;return E||this._options.indent_handlebars&&s==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),d=this._create_token(o.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),d=this._create_token(o.TAG_OPEN,b))),d},i.prototype._read_close=function(s,E){var b=null,d=null;return E&&(E.text[0]==="<"&&(s===">"||s==="/"&&this._input.peek(1)===">")?(b=this._input.next(),s==="/"&&(b+=this._input.next()),d=this._create_token(o.TAG_CLOSE,b)):E.text[0]==="{"&&s==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),d=this._create_token(o.TAG_CLOSE,"}}"))),d},i.prototype._read_attribute=function(s,E,b){var d=null,T="";if(b&&b.text[0]==="<")if(s==="=")d=this._create_token(o.EQUALS,this._input.next());else if(s==='"'||s==="'"){var R=this._input.next();s==='"'?R+=this.__patterns.double_quote.read():R+=this.__patterns.single_quote.read(),d=this._create_token(o.VALUE,R)}else T=this.__patterns.attribute.read(),T&&(E.type===o.EQUALS?d=this._create_token(o.VALUE,T):d=this._create_token(o.ATTRIBUTE,T));return d},i.prototype._is_content_unformatted=function(s){return this._options.void_elements.indexOf(s)===-1&&(this._options.content_unformatted.indexOf(s)!==-1||this._options.unformatted.indexOf(s)!==-1)},i.prototype._read_raw_content=function(s,E,b){var d="";if(b&&b.text[0]==="{")d=this.__patterns.handlebars_raw_close.read();else if(E.type===o.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var T=E.opened.text.substr(1).toLowerCase();if(T==="script"||T==="style"){var R=this._read_comment_or_cdata(s);if(R)return R.type=o.TEXT,R;d=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(T)&&(d=this._input.readUntil(new RegExp("","ig")))}return d?this._create_token(o.TEXT,d):null},i.prototype._read_content_word=function(s){var E="";if(this._options.unformatted_content_delimiter&&s===this._options.unformatted_content_delimiter[0]&&(E=this.__patterns.unformatted_content_delimiter.read()),E||(E=this.__patterns.word.read()),E)return this._create_token(o.TEXT,E)},A.exports.Tokenizer=i,A.exports.TOKEN=o}],M={};function e(A){var f=M[A];if(f!==void 0)return f.exports;var g=M[A]={exports:{}};return P[A](g,g.exports,e),g.exports}var I=e(18);V=I})();var N=V;if(1)Z=[K,K(77937),K(85040)],J=function(P){var M=K(77937),e=K(85040);return{html_beautify:function(I,A){return N(I,A,M.js_beautify,e.css_beautify)}}}.apply(ye,Z),J!==void 0&&(He.exports=J);else var L,C})()},77937:function(He,ye){var K,Z;(function(){var J;(function(){"use strict";var N=[function(M,e,I){var A=I(1).Beautifier,f=I(5).Options;function g(h,p){var u=new A(h,p);return u.beautify()}M.exports=g,M.exports.defaultOptions=function(){return new f}},function(M,e,I){var A=I(2).Output,f=I(3).Token,g=I(4),h=I(5).Options,p=I(7).Tokenizer,u=I(7).line_starters,v=I(7).positionable_operators,m=I(7).TOKEN;function o(_,D){return D.indexOf(_)!==-1}function a(_){return _.replace(/^\s+/g,"")}function i(_){for(var D={},O=0;O<_.length;O++)D[_[O].replace(/-/g,"_")]=_[O];return D}function s(_,D){return _&&_.type===m.RESERVED&&_.text===D}function E(_,D){return _&&_.type===m.RESERVED&&o(_.text,D)}var b=["case","return","do","if","throw","else","await","break","continue","async"],d=["before-newline","after-newline","preserve-newline"],T=i(d),R=[T.before_newline,T.preserve_newline],S={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function w(_,D){D.multiline_frame||D.mode===S.ForInitializer||D.mode===S.Conditional||_.remove_indent(D.start_line_index)}function r(_){_=_.replace(g.allLineBreaks,` `);for(var D=[],O=_.indexOf(` `);O!==-1;)D.push(_.substring(0,O)),_=_.substring(O+1),O=_.indexOf(` `);return _.length&&D.push(_),D}function n(_){return _===S.ArrayLiteral}function t(_){return o(_,[S.Expression,S.ForInitializer,S.Conditional])}function l(_,D){for(var O=0;O<_.length;O++){var k=_[O].trim();if(k.charAt(0)!==D)return!1}return!0}function x(_,D){for(var O=0,k=_.length,F;OO&&(O=_.line_indent_level));var k={mode:D,parent:_,last_token:_?_.last_token:new f(m.START_BLOCK,""),last_word:_?_.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:O,alignment:0,line_indent_level:_?_.line_indent_level:O,start_line_index:this._output.get_line_number(),ternary_depth:0};return k},y.prototype._reset=function(_){var D=_.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new A(this._options,D),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(S.BlockStatement);var O=new p(_,this._options);return this._tokens=O.tokenize(),_},y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _,D=this._reset(this._source_text),O=this._options.eol;this._options.eol==="auto"&&(O=` `,D&&g.lineBreak.test(D||"")&&(O=D.match(g.lineBreak)[0]));for(var k=this._tokens.next();k;)this.handle_token(k),this._last_last_text=this._flags.last_token.text,this._flags.last_token=k,k=this._tokens.next();return _=this._output.get_code(O),_},y.prototype.handle_token=function(_,D){_.type===m.START_EXPR?this.handle_start_expr(_):_.type===m.END_EXPR?this.handle_end_expr(_):_.type===m.START_BLOCK?this.handle_start_block(_):_.type===m.END_BLOCK?this.handle_end_block(_):_.type===m.WORD?this.handle_word(_):_.type===m.RESERVED?this.handle_word(_):_.type===m.SEMICOLON?this.handle_semicolon(_):_.type===m.STRING?this.handle_string(_):_.type===m.EQUALS?this.handle_equals(_):_.type===m.OPERATOR?this.handle_operator(_):_.type===m.COMMA?this.handle_comma(_):_.type===m.BLOCK_COMMENT?this.handle_block_comment(_,D):_.type===m.COMMENT?this.handle_comment(_,D):_.type===m.DOT?this.handle_dot(_):_.type===m.EOF?this.handle_eof(_):_.type===m.UNKNOWN?this.handle_unknown(_,D):this.handle_unknown(_,D)},y.prototype.handle_whitespace_and_comments=function(_,D){var O=_.newlines,k=this._options.keep_array_indentation&&n(this._flags.mode);if(_.comments_before)for(var F=_.comments_before.next();F;)this.handle_whitespace_and_comments(F,D),this.handle_token(F,D),F=_.comments_before.next();if(k)for(var G=0;G0,D);else if(this._options.max_preserve_newlines&&O>this._options.max_preserve_newlines&&(O=this._options.max_preserve_newlines),this._options.preserve_newlines&&O>1){this.print_newline(!1,D);for(var H=1;H0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},y.prototype.set_mode=function(_){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,_),this._flags=this.create_flags(this._previous_flags,_),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===S.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},y.prototype.start_of_object_property=function(){return this._flags.parent.mode===S.ObjectLiteral&&this._flags.mode===S.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"]))},y.prototype.start_of_statement=function(_){var D=!1;return D=D||E(this._flags.last_token,["var","let","const"])&&_.type===m.WORD,D=D||s(this._flags.last_token,"do"),D=D||!(this._flags.parent.mode===S.ObjectLiteral&&this._flags.mode===S.Statement)&&E(this._flags.last_token,c)&&!_.newlines,D=D||s(this._flags.last_token,"else")&&!(s(_,"if")&&!_.comments_before),D=D||this._flags.last_token.type===m.END_EXPR&&(this._previous_flags.mode===S.ForInitializer||this._previous_flags.mode===S.Conditional),D=D||this._flags.last_token.type===m.WORD&&this._flags.mode===S.BlockStatement&&!this._flags.in_case&&!(_.text==="--"||_.text==="++")&&this._last_last_text!=="function"&&_.type!==m.WORD&&_.type!==m.RESERVED,D=D||this._flags.mode===S.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),D?(this.set_mode(S.Statement),this.indent(),this.handle_whitespace_and_comments(_,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(_,E(_,["do","for","if","while"])),!0):!1},y.prototype.handle_start_expr=function(_){this.start_of_statement(_)||this.handle_whitespace_and_comments(_);var D=S.Expression;if(_.text==="["){if(this._flags.last_token.type===m.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(_),this.set_mode(D),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}D=S.ArrayLiteral,n(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),o(this._flags.last_token.type,[m.START_EXPR,m.END_EXPR,m.WORD,m.OPERATOR,m.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===m.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,D=S.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,D=S.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&_.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,u)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===m.EQUALS||this._flags.last_token.type===m.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(_);else if(this._flags.last_token.type===m.WORD){this._output.space_before_token=!1;var O=this._tokens.peek(-3);if(this._options.space_after_named_function&&O){var k=this._tokens.peek(-4);E(O,["async","function"])||O.text==="*"&&E(k,["async","function"])?this._output.space_before_token=!0:this._flags.mode===S.ObjectLiteral?(O.text==="{"||O.text===","||O.text==="*"&&(k.text==="{"||k.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(_);(this._flags.last_token.type===m.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===S.ObjectLiteral&&o(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===m.START_BLOCK?this.print_newline():(this._flags.last_token.type===m.END_EXPR||this._flags.last_token.type===m.START_EXPR||this._flags.last_token.type===m.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===m.COMMA)&&this.allow_wrap_or_preserved_newline(_,_.newlines),this.print_token(_),this.set_mode(D),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},y.prototype.handle_end_expr=function(_){for(;this._flags.mode===S.Statement;)this.restore_mode();this.handle_whitespace_and_comments(_),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(_,_.text==="]"&&n(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===m.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(_),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===S.Conditional&&(this._previous_flags.mode=S.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},y.prototype.handle_start_block=function(_){this.handle_whitespace_and_comments(_);var D=this._tokens.peek(),O=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===m.END_EXPR?(this.set_mode(S.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(S.BlockStatement):O&&(o(O.text,[":",","])&&o(D.type,[m.STRING,m.WORD,m.RESERVED])||o(D.text,["get","set","..."])&&o(O.type,[m.WORD,m.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(O.text,[":",","])?this.set_mode(S.BlockStatement):this.set_mode(S.ObjectLiteral):this._flags.last_token.type===m.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(S.BlockStatement):o(this._flags.last_token.type,[m.EQUALS,m.START_EXPR,m.COMMA,m.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(S.ObjectLiteral):this.set_mode(S.BlockStatement),this._flags.last_token&&E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var k=!D.comments_before&&D.text==="}",F=k&&this._flags.last_word==="function"&&this._flags.last_token.type===m.END_EXPR;if(this._options.brace_preserve_inline){var G=0,H=null;this._flags.inline_frame=!0;do if(G+=1,H=this._tokens.peek(G-1),H.newlines){this._flags.inline_frame=!1;break}while(H.type!==m.EOF&&!(H.type===m.END_BLOCK&&H.opened===_))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&_.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==m.OPERATOR&&(F||this._flags.last_token.type===m.EQUALS||E(this._flags.last_token,b)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(n(this._previous_flags.mode)&&(this._flags.last_token.type===m.START_EXPR||this._flags.last_token.type===m.COMMA)&&((this._flags.last_token.type===m.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===m.COMMA||this._flags.last_token.type===m.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(_),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==m.OPERATOR&&this._flags.last_token.type!==m.START_EXPR&&(this._flags.last_token.type===m.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(_),this.indent(),!k&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},y.prototype.handle_end_block=function(_){for(this.handle_whitespace_and_comments(_);this._flags.mode===S.Statement;)this.restore_mode();var D=this._flags.last_token.type===m.START_BLOCK;this._flags.inline_frame&&!D?this._output.space_before_token=!0:this._options.brace_style==="expand"?D||this.print_newline():D||(n(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(_)},y.prototype.handle_word=function(_){if(_.type===m.RESERVED){if(o(_.text,["set","get"])&&this._flags.mode!==S.ObjectLiteral)_.type=m.WORD;else if(_.text==="import"&&o(this._tokens.peek().text,["(","."]))_.type=m.WORD;else if(o(_.text,["as","from"])&&!this._flags.import_block)_.type=m.WORD;else if(this._flags.mode===S.ObjectLiteral){var D=this._tokens.peek();D.text===":"&&(_.type=m.WORD)}}if(this.start_of_statement(_)?E(this._flags.last_token,["var","let","const"])&&_.type===m.WORD&&(this._flags.declaration_statement=!0):_.newlines&&!t(this._flags.mode)&&(this._flags.last_token.type!==m.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==m.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(_),this.print_newline()):this.handle_whitespace_and_comments(_),this._flags.do_block&&!this._flags.do_while)if(s(_,"while")){this._output.space_before_token=!0,this.print_token(_),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&s(_,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===S.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&E(_,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(_),this._flags.in_case=!0;return}if((this._flags.last_token.type===m.COMMA||this._flags.last_token.type===m.START_EXPR||this._flags.last_token.type===m.EQUALS||this._flags.last_token.type===m.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(_)),s(_,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===m.OPERATOR))&&!this._output.just_added_blankline()&&!_.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===m.RESERVED||this._flags.last_token.type===m.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,c)?this._output.space_before_token=!0:s(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===m.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(t(this._flags.mode)||n(this._flags.mode))||this.print_newline(),this.print_token(_),this._flags.last_word=_.text;return}var O="NONE";if(this._flags.last_token.type===m.END_BLOCK?this._previous_flags.inline_frame?O="SPACE":E(_,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&_.newlines?O="NEWLINE":(O="SPACE",this._output.space_before_token=!0):O="NEWLINE":this._flags.last_token.type===m.SEMICOLON&&this._flags.mode===S.BlockStatement?O="NEWLINE":this._flags.last_token.type===m.SEMICOLON&&t(this._flags.mode)?O="SPACE":this._flags.last_token.type===m.STRING?O="NEWLINE":this._flags.last_token.type===m.RESERVED||this._flags.last_token.type===m.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===S.ObjectLiteral&&o(this._last_last_text,["{",","]))?O="SPACE":this._flags.last_token.type===m.START_BLOCK?this._flags.inline_frame?O="SPACE":O="NEWLINE":this._flags.last_token.type===m.END_EXPR&&(this._output.space_before_token=!0,O="NEWLINE"),E(_,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?O="SPACE":O="NEWLINE"),E(_,["else","catch","finally"]))if((!(this._flags.last_token.type===m.END_BLOCK&&this._previous_flags.mode===S.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&_.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var k=this._output.current_line;k.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else O==="NEWLINE"?E(this._flags.last_token,b)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(_,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==m.END_EXPR?(this._flags.last_token.type!==m.START_EXPR||!E(_,["var","let","const"]))&&this._flags.last_token.text!==":"&&(s(_,"if")&&s(_.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(_,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&n(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():O==="SPACE"&&(this._output.space_before_token=!0);_.previous&&(_.previous.type===m.WORD||_.previous.type===m.RESERVED)&&(this._output.space_before_token=!0),this.print_token(_),this._flags.last_word=_.text,_.type===m.RESERVED&&(_.text==="do"?this._flags.do_block=!0:_.text==="if"?this._flags.if_block=!0:_.text==="import"?this._flags.import_block=!0:this._flags.import_block&&s(_,"from")&&(this._flags.import_block=!1))},y.prototype.handle_semicolon=function(_){this.start_of_statement(_)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(_);for(var D=this._tokens.peek();this._flags.mode===S.Statement&&!(this._flags.if_block&&s(D,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(_)},y.prototype.handle_string=function(_){_.text.startsWith("`")&&_.newlines===0&&_.whitespace_before===""&&(_.previous.text===")"||this._flags.last_token.type===m.WORD)||(this.start_of_statement(_)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(_),this._flags.last_token.type===m.RESERVED||this._flags.last_token.type===m.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===m.COMMA||this._flags.last_token.type===m.START_EXPR||this._flags.last_token.type===m.EQUALS||this._flags.last_token.type===m.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(_):_.text.startsWith("`")&&this._flags.last_token.type===m.END_EXPR&&(_.previous.text==="]"||_.previous.text===")")&&_.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(_)},y.prototype.handle_equals=function(_){this.start_of_statement(_)||this.handle_whitespace_and_comments(_),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(_),this._output.space_before_token=!0},y.prototype.handle_comma=function(_){this.handle_whitespace_and_comments(_,!0),this.print_token(_),this._output.space_before_token=!0,this._flags.declaration_statement?(t(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(_)):this._flags.mode===S.ObjectLiteral||this._flags.mode===S.Statement&&this._flags.parent.mode===S.ObjectLiteral?(this._flags.mode===S.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(_)},y.prototype.handle_operator=function(_){var D=_.text==="*"&&(E(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[m.START_BLOCK,m.COMMA,m.END_BLOCK,m.SEMICOLON])),O=o(_.text,["-","+"])&&(o(this._flags.last_token.type,[m.START_BLOCK,m.START_EXPR,m.EQUALS,m.OPERATOR])||o(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(_)){var k=!D;this.handle_whitespace_and_comments(_,k)}if(_.text==="*"&&this._flags.last_token.type===m.DOT){this.print_token(_);return}if(_.text==="::"){this.print_token(_);return}if(this._flags.last_token.type===m.OPERATOR&&o(this._options.operator_position,R)&&this.allow_wrap_or_preserved_newline(_),_.text===":"&&this._flags.in_case){this.print_token(_),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==m.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var F=!0,G=!0,H=!1;if(_.text===":"?this._flags.ternary_depth===0?F=!1:(this._flags.ternary_depth-=1,H=!0):_.text==="?"&&(this._flags.ternary_depth+=1),!O&&!D&&this._options.preserve_newlines&&o(_.text,v)){var j=_.text===":",Q=j&&H,ee=j&&!H;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!ee,this.print_token(_),(!j||Q)&&this.allow_wrap_or_preserved_newline(_),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!j||Q?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(_):this._output.space_before_token=!1,this.print_token(_),this._output.space_before_token=!0;return;case T.preserve_newline:ee||this.allow_wrap_or_preserved_newline(_),F=!(this._output.just_added_newline()||ee),this._output.space_before_token=F,this.print_token(_),this._output.space_before_token=!0;return}}if(D){this.allow_wrap_or_preserved_newline(_),F=!1;var ie=this._tokens.peek();G=ie&&o(ie.type,[m.WORD,m.RESERVED])}else if(_.text==="...")this.allow_wrap_or_preserved_newline(_),F=this._flags.last_token.type===m.START_BLOCK,G=!1;else if(o(_.text,["--","++","!","~"])||O){if((this._flags.last_token.type===m.COMMA||this._flags.last_token.type===m.START_EXPR)&&this.allow_wrap_or_preserved_newline(_),F=!1,G=!1,_.newlines&&(_.text==="--"||_.text==="++"||_.text==="~")){var se=E(this._flags.last_token,b)&&_.newlines;se&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(se,!0)}this._flags.last_token.text===";"&&t(this._flags.mode)&&(F=!0),this._flags.last_token.type===m.RESERVED?F=!0:this._flags.last_token.type===m.END_EXPR?F=!(this._flags.last_token.text==="]"&&(_.text==="--"||_.text==="++")):this._flags.last_token.type===m.OPERATOR&&(F=o(_.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(_.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(G=!0)),(this._flags.mode===S.BlockStatement&&!this._flags.inline_frame||this._flags.mode===S.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||F,this.print_token(_),this._output.space_before_token=G},y.prototype.handle_block_comment=function(_,D){if(this._output.raw){this._output.add_raw_token(_),_.directives&&_.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(_.directives){this.print_newline(!1,D),this.print_token(_),_.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!g.newline.test(_.text)&&!_.newlines){this._output.space_before_token=!0,this.print_token(_),this._output.space_before_token=!0;return}else this.print_block_commment(_,D)},y.prototype.print_block_commment=function(_,D){var O=r(_.text),k,F=!1,G=!1,H=_.whitespace_before,j=H.length;if(this.print_newline(!1,D),this.print_token_line_indentation(_),this._output.add_token(O[0]),this.print_newline(!1,D),O.length>1){for(O=O.slice(1),F=l(O,"*"),G=x(O,H),F&&(this._flags.alignment=1),k=0;k=0;g--)if(this.__items[g].match(f))return!0;return!1},e.prototype.set_indent=function(f,g){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(f){this.__items.push(f);var g=f.lastIndexOf(` `);g!==-1?this.__character_count=f.length-g:this.__character_count+=f.length},e.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function I(f,g){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),g=g||"",f.indent_level>0&&(g=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}I.prototype.get_indent_size=function(f,g){var h=this.__base_string_length;return g=g||0,f<0&&(h=0),h+=f*this.__indent_size,h+=g,h},I.prototype.get_indent_string=function(f,g){var h=this.__base_string;return g=g||0,f<0&&(f=0,h=""),g+=f*this.__indent_size,this.__ensure_cache(g),h+=this.__cache[g],h},I.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},I.prototype.__add_column=function(){var f=this.__cache.length,g=0,h="";this.__indent_size&&f>=this.__indent_size&&(g=Math.floor(f/this.__indent_size),f-=g*this.__indent_size,h=new Array(g+1).join(this.__indent_string)),f&&(h+=new Array(f+1).join(" ")),this.__cache.push(h)};function A(f,g){this.__indent_cache=new I(f,g),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}A.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},A.prototype.get_line_number=function(){return this.__lines.length},A.prototype.get_indent_string=function(f,g){return this.__indent_cache.get_indent_string(f,g)},A.prototype.get_indent_size=function(f,g){return this.__indent_cache.get_indent_size(f,g)},A.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},A.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},A.prototype.get_code=function(f){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===` `&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(` `);return f!==` `&&(h=h.replace(/[\n]/g,f)),h},A.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},A.prototype.set_indent=function(f,g){return f=f||0,g=g||0,this.next_line.set_indent(f,g),this.__lines.length>1?(this.current_line.set_indent(f,g),!0):(this.current_line.set_indent(),!1)},A.prototype.add_raw_token=function(f){for(var g=0;g1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},A.prototype.just_added_newline=function(){return this.current_line.is_empty()},A.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},A.prototype.ensure_empty_line_above=function(f,g){for(var h=this.__lines.length-2;h>=0;){var p=this.__lines[h];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==g){this.__lines.splice(h+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},M.exports.Output=A},function(M){function e(I,A,f,g){this.type=I,this.text=A,this.comments_before=null,this.newlines=f||0,this.whitespace_before=g||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}M.exports.Token=e},function(M,e){var I="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",A="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",g="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",h="(?:\\\\u[0-9a-fA-F]{4}|["+I+f+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+A+f+g+"])*";e.identifier=new RegExp(h+p,"g"),e.identifierStart=new RegExp(h),e.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+A+f+g+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp(`\r |`+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(M,e,I){var A=I(6).Options,f=["before-newline","after-newline","preserve-newline"];function g(h){A.call(this,h,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var v=0;v>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),d=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";d=d.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),d="\\?\\.(?!\\d) "+d,d=d.replace(/ /g,"|");var T=new RegExp(d),R="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),S=R.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+S.join("|")+")$"),r,n=function(l,x){f.call(this,l,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var y=new u(this._input),c=new v(this._input).read_options(this._options);this.__patterns={template:c,identifier:c.starting_with(p.identifier).matching(p.identifierMatch),number:y.matching(i),punct:y.matching(T),comment:y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:y.matching(//),include:y.starting_with(/#include/).until_after(p.lineBreak),shebang:y.starting_with(/#!/).until_after(p.lineBreak),xml:y.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:c.until(/['\\\n\r\u2028\u2029]/),double_quote:c.until(/["\\\n\r\u2028\u2029]/),template_text:c.until(/[`\\$]/),template_expression:c.until(/[`}\\]/)}};n.prototype=new f,n.prototype._is_comment=function(l){return l.type===o.COMMENT||l.type===o.BLOCK_COMMENT||l.type===o.UNKNOWN},n.prototype._is_opening=function(l){return l.type===o.START_BLOCK||l.type===o.START_EXPR},n.prototype._is_closing=function(l,x){return(l.type===o.END_BLOCK||l.type===o.END_EXPR)&&x&&(l.text==="]"&&x.text==="["||l.text===")"&&x.text==="("||l.text==="}"&&x.text==="{")},n.prototype._reset=function(){r=!1},n.prototype._get_next_token=function(l,x){var y=null;this._readWhitespace();var c=this._input.peek();return c===null?this._create_token(o.EOF,""):(y=y||this._read_non_javascript(c),y=y||this._read_string(c),y=y||this._read_word(l),y=y||this._read_singles(c),y=y||this._read_comment(c),y=y||this._read_regexp(c,l),y=y||this._read_xml(c,l),y=y||this._read_punctuation(),y=y||this._create_token(o.UNKNOWN,this._input.next()),y)},n.prototype._read_word=function(l){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(p.allLineBreaks,` `),!(l.type===o.DOT||l.type===o.RESERVED&&(l.text==="set"||l.text==="get"))&&w.test(x)?(x==="in"||x==="of")&&(l.type===o.WORD||l.type===o.STRING)?this._create_token(o.OPERATOR,x):this._create_token(o.RESERVED,x):this._create_token(o.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(o.WORD,x)},n.prototype._read_singles=function(l){var x=null;return l==="("||l==="["?x=this._create_token(o.START_EXPR,l):l===")"||l==="]"?x=this._create_token(o.END_EXPR,l):l==="{"?x=this._create_token(o.START_BLOCK,l):l==="}"?x=this._create_token(o.END_BLOCK,l):l===";"?x=this._create_token(o.SEMICOLON,l):l==="."&&E.test(this._input.peek(1))?x=this._create_token(o.DOT,l):l===","&&(x=this._create_token(o.COMMA,l)),x&&this._input.next(),x},n.prototype._read_punctuation=function(){var l=this.__patterns.punct.read();if(l!=="")return l==="="?this._create_token(o.EQUALS,l):l==="?."?this._create_token(o.DOT,l):this._create_token(o.OPERATOR,l)},n.prototype._read_non_javascript=function(l){var x="";if(l==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(o.UNKNOWN,x.trim()+` `);if(x=this.__patterns.include.read(),x)return this._create_token(o.UNKNOWN,x.trim()+` `);l=this._input.next();var y="#";if(this._input.hasNext()&&this._input.testChar(s)){do l=this._input.next(),y+=l;while(this._input.hasNext()&&l!=="#"&&l!=="=");return l==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(y+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,y)}this._input.back()}else if(l==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)x+=this._input.next();return r=!0,this._create_token(o.COMMENT,x)}}else if(r&&l==="-"&&(x=this.__patterns.html_comment_end.read(),x))return r=!1,this._create_token(o.COMMENT,x);return null},n.prototype._read_comment=function(l){var x=null;if(l==="/"){var y="";if(this._input.peek(1)==="*"){y=this.__patterns.block_comment.read();var c=a.get_directives(y);c&&c.ignore==="start"&&(y+=a.readIgnored(this._input)),y=y.replace(p.allLineBreaks,` `),x=this._create_token(o.BLOCK_COMMENT,y),x.directives=c}else this._input.peek(1)==="/"&&(y=this.__patterns.comment.read(),x=this._create_token(o.COMMENT,y))}return x},n.prototype._read_string=function(l){if(l==="`"||l==="'"||l==='"'){var x=this._input.next();return this.has_char_escapes=!1,l==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(l),this.has_char_escapes&&this._options.unescape_strings&&(x=t(x)),this._input.peek()===l&&(x+=this._input.next()),x=x.replace(p.allLineBreaks,` `),this._create_token(o.STRING,x)}return null},n.prototype._allow_regexp_or_xml=function(l){return l.type===o.RESERVED&&m(l.text,["return","case","throw","else","do","typeof","yield"])||l.type===o.END_EXPR&&l.text===")"&&l.opened.previous.type===o.RESERVED&&m(l.opened.previous.text,["if","while","for"])||m(l.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},n.prototype._read_regexp=function(l,x){if(l==="/"&&this._allow_regexp_or_xml(x)){for(var y=this._input.next(),c=!1,_=!1;this._input.hasNext()&&(c||_||this._input.peek()!==l)&&!this._input.testChar(p.newline);)y+=this._input.peek(),c?c=!1:(c=this._input.peek()==="\\",this._input.peek()==="["?_=!0:this._input.peek()==="]"&&(_=!1)),this._input.next();return this._input.peek()===l&&(y+=this._input.next(),y+=this._input.read(p.identifier)),this._create_token(o.STRING,y)}return null},n.prototype._read_xml=function(l,x){if(this._options.e4x&&l==="<"&&this._allow_regexp_or_xml(x)){var y="",c=this.__patterns.xml.read_match();if(c){for(var _=c[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),D=_.indexOf("{")===0,O=0;c;){var k=!!c[1],F=c[2],G=!!c[c.length-1]||F.slice(0,8)==="![CDATA[";if(!G&&(F===_||D&&F.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(k?--O:++O),y+=c[0],O<=0)break;c=this.__patterns.xml.read_match()}return c||(y+=this._input.match(/[\s\S]*/g)[0]),y=y.replace(p.allLineBreaks,` `),this._create_token(o.STRING,y)}}return null};function t(l){for(var x="",y=0,c=new A(l),_=null;c.hasNext();)if(_=c.match(/([\s]|[^\\]|\\\\)+/g),_&&(x+=_[0]),c.peek()==="\\"){if(c.next(),c.peek()==="x")_=c.match(/x([0-9A-Fa-f]{2})/g);else if(c.peek()==="u")_=c.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",c.hasNext()&&(x+=c.next());continue}if(!_||(y=parseInt(_[1],16),y>126&&y<=255&&_[0].indexOf("x")===0))return l;if(y>=0&&y<32){x+="\\"+_[0];continue}else y===34||y===39||y===92?x+="\\"+String.fromCharCode(y):x+=String.fromCharCode(y)}return x}n.prototype._read_string_recursive=function(l,x,y){var c,_;l==="'"?_=this.__patterns.single_quote:l==='"'?_=this.__patterns.double_quote:l==="`"?_=this.__patterns.template_text:l==="}"&&(_=this.__patterns.template_expression);for(var D=_.read(),O="";this._input.hasNext();){if(O=this._input.next(),O===l||!x&&p.newline.test(O)){this._input.back();break}else O==="\\"&&this._input.hasNext()?(c=this._input.peek(),c==="x"||c==="u"?this.has_char_escapes=!0:c==="\r"&&this._input.peek(1)===` `&&this._input.next(),O+=this._input.next()):y&&(y==="${"&&O==="$"&&this._input.peek()==="{"&&(O+=this._input.next()),y===O&&(l==="`"?O+=this._read_string_recursive("}",x,"`"):O+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(O+=this._input.next())));O+=_.read(),D+=O}return D},M.exports.Tokenizer=n,M.exports.TOKEN=o,M.exports.positionable_operators=b.slice(),M.exports.line_starters=R.slice()},function(M){var e=RegExp.prototype.hasOwnProperty("sticky");function I(A){this.__input=A||"",this.__input_length=this.__input.length,this.__position=0}I.prototype.restart=function(){this.__position=0},I.prototype.back=function(){this.__position>0&&(this.__position-=1)},I.prototype.hasNext=function(){return this.__position=0&&A=0&&f=A.length&&this.__input.substring(f-A.length,f).toLowerCase()===A},M.exports.InputScanner=I},function(M,e,I){var A=I(8).InputScanner,f=I(3).Token,g=I(10).TokenStream,h=I(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(v,m){this._input=new A(v),this._options=m||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new h(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new g,this._reset();for(var v,m=new f(p.START,""),o=null,a=[],i=new g;m.type!==p.EOF;){for(v=this._get_next_token(m,o);this._is_comment(v);)i.add(v),v=this._get_next_token(m,o);i.isEmpty()||(v.comments_before=i,i=new g),v.parent=o,this._is_opening(v)?(a.push(o),o=v):o&&this._is_closing(v,o)&&(v.opened=o,o.closed=v,o=a.pop(),v.parent=o),v.previous=m,m.next=v,this.__tokens.add(v),m=v}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(v,m){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(p.RAW,o):this._create_token(p.EOF,"")},u.prototype._is_comment=function(v){return!1},u.prototype._is_opening=function(v){return!1},u.prototype._is_closing=function(v,m){return!1},u.prototype._create_token=function(v,m){var o=new f(v,m,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},M.exports.Tokenizer=u,M.exports.TOKEN=p},function(M){function e(I){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=I}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return this.__tokens_length===0},e.prototype.hasNext=function(){return this.__position=0&&I/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}g.prototype=new A,g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){this.__set_templated_pattern()},g.prototype.disable=function(h){var p=this._create();return p._disabled[h]=!0,p._update(),p},g.prototype.read_options=function(h){var p=this._create();for(var u in f)p._disabled[u]=h.templating.indexOf(u)===-1;return p._update(),p},g.prototype.exclude=function(h){var p=this._create();return p._excluded[h]=!0,p._update(),p},g.prototype.read=function(){var h="";this._match_pattern?h=this._input.read(this._starting_pattern):h=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),h+=p,p=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},g.prototype.__set_templated_pattern=function(){var h=[];this._disabled.php||h.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||h.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||h.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(h.push(this.__patterns.django._starting_pattern.source),h.push(this.__patterns.django_value._starting_pattern.source),h.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||h.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&h.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+h.join("|")+")")},g.prototype._read_template=function(){var h="",p=this._input.peek();if(p==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(h=h||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(h=h||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(h=h||this.__patterns.handlebars_comment.read(),h=h||this.__patterns.handlebars_unescaped.read(),h=h||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(h=h||this.__patterns.django_value.read()),this._excluded.django||(h=h||this.__patterns.django_comment.read(),h=h||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(h=h||this.__patterns.smarty_comment.read(),h=h||this.__patterns.smarty_literal.read(),h=h||this.__patterns.smarty.read()));return h},M.exports.TemplatablePattern=g}],L={};function C(M){var e=L[M];if(e!==void 0)return e.exports;var I=L[M]={exports:{}};return N[M](I,I.exports,C),I.exports}var P=C(0);J=P})();var V=J;K=[],Z=function(){return{js_beautify:V}}.apply(ye,K),Z!==void 0&&(He.exports=Z)})()},74741:function(He,ye,K){"use strict";K.d(ye,{Wi:function(){return C},Z0:function(){return P},aU:function(){return L},eZ:function(){return e},wY:function(){return M}});var Z=K(4669),J=K(9917),V=K(63580),N=function(I,A,f,g){function h(p){return p instanceof f?p:new f(function(u){u(p)})}return new(f||(f=Promise))(function(p,u){function v(a){try{o(g.next(a))}catch(i){u(i)}}function m(a){try{o(g.throw(a))}catch(i){u(i)}}function o(a){a.done?p(a.value):h(a.value).then(v,m)}o((g=g.apply(I,A||[])).next())})};class L extends J.JT{constructor(A,f="",g="",h=!0,p){super(),this._onDidChange=this._register(new Z.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=f,this._cssClass=g,this._enabled=h,this._actionCallback=p}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,f){return N(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class C extends J.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new Z.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.Q5),this.onDidRun=this._onDidRun.event}run(A,f){return N(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let g;try{yield this.runAction(A,f)}catch(h){g=h}this._onDidRun.fire({action:A,error:g})})}runAction(A,f){return N(this,void 0,void 0,function*(){yield A.run(f)})}}class P extends L{constructor(A){super(P.ID,A,A?"separator text":"separator"),this.checked=!1,this.enabled=!1}}P.ID="vs.actions.separator";class M{constructor(A,f,g,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=f,this.class=h,this._actions=g}get actions(){return this._actions}dispose(){}run(){return N(this,void 0,void 0,function*(){})}}class e extends L{constructor(){super(e.ID,V.N("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},35146:function(He,ye,K){"use strict";K.d(ye,{ok:function(){return Z}});function Z(J,V){if(!J)throw new Error(V?`Assertion failed (${V})`:"Assertion Failed")}},73046:function(He,ye,K){"use strict";K.d(ye,{CM:function(){return L},JL:function(){return C},dT:function(){return M},fK:function(){return N},lA:function(){return P}});var Z=K(4669);class J{constructor(){this._icons=new Map,this._onDidRegister=new Z.Q5}add(I){const A=this._icons.get(I.id);A?I.description?A.description=I.description:console.error(`Duplicate registration of codicon ${I.id}`):(this._icons.set(I.id,I),this._onDidRegister.fire(I))}get(I){return this._icons.get(I)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const V=new J,N=V;function L(e,I){return new P(e,I)}function C(e){return e?e.replace(/\$\((.*?)\)/g,(I,A)=>` ${A} `).trim():""}class P{constructor(I,A,f){this.id=I,this.definition=A,this.description=f,V.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var M;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function A(h){if(h instanceof P)return["codicon","codicon-"+h.id];const p=I.exec(h.id);if(!p)return A(P.error);let[,u,v]=p;const m=["codicon","codicon-"+u];return v&&m.push("codicon-modifier-"+v.substr(1)),m}e.asClassNameArray=A;function f(h){return A(h).join(" ")}e.asClassName=f;function g(h){return"."+A(h).join(".")}e.asCSSSelector=g})(M||(M={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(P||(P={}))},17301:function(He,ye,K){"use strict";K.d(ye,{B8:function(){return A},Cp:function(){return N},F0:function(){return M},L6:function(){return I},VV:function(){return P},b1:function(){return e},dL:function(){return V},ri:function(){return L}});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+` `+g.stack):g},0)}}emit(g){this.listeners.forEach(h=>{h(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const J=new Z;function V(f){P(f)||J.onUnexpectedError(f)}function N(f){P(f)||J.onUnexpectedExternalError(f)}function L(f){if(f instanceof Error){let{name:g,message:h}=f;const p=f.stacktrace||f.stack;return{$isError:!0,name:g,message:h,stack:p}}return f}const C="Canceled";function P(f){return f instanceof Error&&f.name===C&&f.message===C}function M(){const f=new Error(C);return f.name=f.message,f}function e(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function I(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class A extends Error{constructor(g){super("NotSupported"),g&&(this.message=g)}}},4669:function(He,ye,K){"use strict";K.d(ye,{D0:function(){return A},E7:function(){return f},K3:function(){return I},Q5:function(){return e},ZD:function(){return g},ju:function(){return L}});var Z=K(17301),J=K(9917),V=K(91741),N=K(84013),L;(function(h){h.None=()=>J.JT.None;function p(t){return(l,x=null,y)=>{let c=!1,_;return _=t(D=>{if(!c)return _?_.dispose():c=!0,l.call(x,D)},null,y),c&&_.dispose(),_}}h.once=p;function u(t,l){return s((x,y=null,c)=>t(_=>x.call(y,l(_)),null,c))}h.map=u;function v(t,l){return s((x,y=null,c)=>t(_=>{l(_),x.call(y,_)},null,c))}h.forEach=v;function m(t,l){return s((x,y=null,c)=>t(_=>l(_)&&x.call(y,_),null,c))}h.filter=m;function o(t){return t}h.signal=o;function a(...t){return(l,x=null,y)=>(0,J.F8)(...t.map(c=>c(_=>l.call(x,_),null,y)))}h.any=a;function i(t,l,x){let y=x;return u(t,c=>(y=l(y,c),y))}h.reduce=i;function s(t){let l;const x=new e({onFirstListenerAdd(){l=t(x.fire,x)},onLastListenerRemove(){l.dispose()}});return x.event}function E(t,l,x=100,y=!1,c){let _,D,O,k=0;const F=new e({leakWarningThreshold:c,onFirstListenerAdd(){_=t(G=>{k++,D=l(D,G),y&&!O&&(F.fire(D),D=void 0),clearTimeout(O),O=setTimeout(()=>{const H=D;D=void 0,O=void 0,(!y||k>1)&&F.fire(H),k=0},x)})},onLastListenerRemove(){_.dispose()}});return F.event}h.debounce=E;function b(t,l=(x,y)=>x===y){let x=!0,y;return m(t,c=>{const _=x||!l(c,y);return x=!1,y=c,_})}h.latch=b;function d(t,l){return[h.filter(t,l),h.filter(t,x=>!l(x))]}h.split=d;function T(t,l=!1,x=[]){let y=x.slice(),c=t(O=>{y?y.push(O):D.fire(O)});const _=()=>{y&&y.forEach(O=>D.fire(O)),y=null},D=new e({onFirstListenerAdd(){c||(c=t(O=>D.fire(O)))},onFirstListenerDidAdd(){y&&(l?setTimeout(_):_())},onLastListenerRemove(){c&&c.dispose(),c=null}});return D.event}h.buffer=T;class R{constructor(l){this.event=l}map(l){return new R(u(this.event,l))}forEach(l){return new R(v(this.event,l))}filter(l){return new R(m(this.event,l))}reduce(l,x){return new R(i(this.event,l,x))}latch(){return new R(b(this.event))}debounce(l,x=100,y=!1,c){return new R(E(this.event,l,x,y,c))}on(l,x,y){return this.event(l,x,y)}once(l,x,y){return p(this.event)(l,x,y)}}function S(t){return new R(t)}h.chain=S;function w(t,l,x=y=>y){const y=(...O)=>D.fire(x(...O)),c=()=>t.on(l,y),_=()=>t.removeListener(l,y),D=new e({onFirstListenerAdd:c,onLastListenerRemove:_});return D.event}h.fromNodeEventEmitter=w;function r(t,l,x=y=>y){const y=(...O)=>D.fire(x(...O)),c=()=>t.addEventListener(l,y),_=()=>t.removeEventListener(l,y),D=new e({onFirstListenerAdd:c,onLastListenerRemove:_});return D.event}h.fromDOMEventEmitter=r;function n(t){return new Promise(l=>p(t)(l))}h.toPromise=n})(L||(L={}));class C{constructor(p){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${p}_${C._idPool++}`}start(p){this._stopWatch=new N.G(!0),this._listenerCount=p}stop(){if(this._stopWatch){const p=this._stopWatch.elapsed();this._elapsedOverall+=p,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${p.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}C._idPool=0;let P=-1;class M{constructor(p,u=Math.random().toString(18).slice(2,5)){this.customThreshold=p,this.name=u,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(p){let u=P;if(typeof this.customThreshold=="number"&&(u=this.customThreshold),u<=0||p{const o=this._stacks.get(v)||0;this._stacks.set(v,o-1)}}}class e{constructor(p){var u;this._disposed=!1,this._options=p,this._leakageMon=P>0?new M(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((u=this._options)===null||u===void 0)&&u._profName?new C(this._options._profName):void 0}get event(){return this._event||(this._event=(p,u,v)=>{var m;this._listeners||(this._listeners=new V.S);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(u?[p,u]:p);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,p,u);const i=(m=this._leakageMon)===null||m===void 0?void 0:m.check(this._listeners.size),s=(0,J.OF)(()=>{i&&i(),this._disposed||(a(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return v instanceof J.SL?v.add(s):Array.isArray(v)&&v.push(s),s}),this._event}fire(p){var u,v;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new V.S);for(let m of this._listeners)this._deliveryQueue.push([m,p]);for((u=this._perfMon)===null||u===void 0||u.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[m,o]=this._deliveryQueue.shift();try{typeof m=="function"?m.call(void 0,o):m[0].call(m[1],o)}catch(a){(0,Z.dL)(a)}}(v=this._perfMon)===null||v===void 0||v.stop()}}dispose(){var p,u,v,m,o;this._disposed||(this._disposed=!0,(p=this._listeners)===null||p===void 0||p.clear(),(u=this._deliveryQueue)===null||u===void 0||u.clear(),(m=(v=this._options)===null||v===void 0?void 0:v.onLastListenerRemove)===null||m===void 0||m.call(v),(o=this._leakageMon)===null||o===void 0||o.dispose())}}class I extends e{constructor(p){super(p),this._isPaused=0,this._eventQueue=new V.S,this._mergeFn=p==null?void 0:p.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const p=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(p))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(p){this._listeners&&(this._isPaused!==0?this._eventQueue.push(p):super.fire(p))}}class A extends I{constructor(p){var u;super(p),this._delay=(u=p.delay)!==null&&u!==void 0?u:100}fire(p){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(p)}}class f{constructor(){this.buffers=[]}wrapEvent(p){return(u,v,m)=>p(o=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>u.call(v,o)):u.call(v,o)},void 0,m)}bufferEvents(p){const u=[];this.buffers.push(u);const v=p();return this.buffers.pop(),u.forEach(m=>m()),v}}class g{constructor(){this.listening=!1,this.inputEvent=L.None,this.inputEventListener=J.JT.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},88289:function(He,ye,K){"use strict";K.d(ye,{I:function(){return Z}});function Z(J){const V=this;let N=!1,L;return function(){return N||(N=!0,L=J.apply(V,arguments)),L}}},53725:function(He,ye,K){"use strict";K.d(ye,{$:function(){return Z}});var Z;(function(J){function V(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}J.is=V;const N=Object.freeze([]);function L(){return N}J.empty=L;function*C(a){yield a}J.single=C;function P(a){return a||N}J.from=P;function M(a){return!a||a[Symbol.iterator]().next().done===!0}J.isEmpty=M;function e(a){return a[Symbol.iterator]().next().value}J.first=e;function I(a,i){for(const s of a)if(i(s))return!0;return!1}J.some=I;function A(a,i){for(const s of a)if(i(s))return s}J.find=A;function*f(a,i){for(const s of a)i(s)&&(yield s)}J.filter=f;function*g(a,i){let s=0;for(const E of a)yield i(E,s++)}J.map=g;function*h(...a){for(const i of a)for(const s of i)yield s}J.concat=h;function*p(a){for(const i of a)for(const s of i)yield s}J.concatNested=p;function u(a,i,s){let E=s;for(const b of a)E=i(E,b);return E}J.reduce=u;function*v(a,i,s=a.length){for(i<0&&(i+=a.length),s<0?s+=a.length:s>a.length&&(s=a.length);iE===b){const E=a[Symbol.iterator](),b=i[Symbol.iterator]();for(;;){const d=E.next(),T=b.next();if(d.done!==T.done)return!1;if(d.done)return!0;if(!s(d.value,T.value))return!1}}J.equals=o})(Z||(Z={}))},9917:function(He,ye,K){"use strict";K.d(ye,{B9:function(){return g},F8:function(){return h},JT:function(){return v},Jz:function(){return o},OF:function(){return p},SL:function(){return u},Wf:function(){return f},XK:function(){return m},dk:function(){return I}});var Z=K(88289),J=K(53725);const V=!1;let N=null;function L(a){N=a}if(V){const a="__is_disposable_tracked__";L(new class{trackDisposable(i){const s=new Error("Potentially leaked disposable").stack;setTimeout(()=>{i[a]||console.log(s)},3e3)}setParent(i,s){if(i&&i!==v.None)try{i[a]=!0}catch(E){}}markAsDisposed(i){if(i&&i!==v.None)try{i[a]=!0}catch(s){}}markAsSingleton(i){}})}function C(a){return N==null||N.trackDisposable(a),a}function P(a){N==null||N.markAsDisposed(a)}function M(a,i){N==null||N.setParent(a,i)}function e(a,i){if(N)for(const s of a)N.setParent(s,i)}function I(a){return N==null||N.markAsSingleton(a),a}class A extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`),this.errors=i}}function f(a){return typeof a.dispose=="function"&&a.dispose.length===0}function g(a){if(J.$.is(a)){let i=[];for(const s of a)if(s)try{s.dispose()}catch(E){i.push(E)}if(i.length===1)throw i[0];if(i.length>1)throw new A(i);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function h(...a){const i=p(()=>g(a));return e(a,i),i}function p(a){const i=C({dispose:(0,Z.I)(()=>{P(i),a()})});return i}class u{constructor(){this._toDispose=new Set,this._isDisposed=!1,C(this)}dispose(){this._isDisposed||(P(this),this._isDisposed=!0,this.clear())}clear(){try{g(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return M(i,this),this._isDisposed?u.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}}u.DISABLE_DISPOSED_WARNING=!1;class v{constructor(){this._store=new u,C(this),M(this._store,this)}dispose(){P(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}v.None=Object.freeze({dispose(){}});class m{constructor(){this._isDisposed=!1,C(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var s;this._isDisposed||i===this._value||((s=this._value)===null||s===void 0||s.dispose(),i&&M(i,this),this._value=i)}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,P(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&M(i,null),i}}class o{constructor(i){this.object=i}dispose(){}}},91741:function(He,ye,K){"use strict";K.d(ye,{S:function(){return J}});class Z{constructor(N){this.element=N,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class J{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let N=this._first;for(;N!==Z.Undefined;){const L=N.next;N.prev=Z.Undefined,N.next=Z.Undefined,N=L}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,L){const C=new Z(N);if(this._first===Z.Undefined)this._first=C,this._last=C;else if(L){const M=this._last;this._last=C,C.prev=M,M.next=C}else{const M=this._first;this._first=C,C.next=M,M.prev=C}this._size+=1;let P=!1;return()=>{P||(P=!0,this._remove(C))}}shift(){if(this._first!==Z.Undefined){const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last!==Z.Undefined){const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==Z.Undefined&&N.next!==Z.Undefined){const L=N.prev;L.next=N.next,N.next.prev=L}else N.prev===Z.Undefined&&N.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):N.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):N.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==Z.Undefined;)yield N.element,N=N.next}}},1432:function(He,ye,K){"use strict";K.d(ye,{$L:function(){return E},ED:function(){return o},IJ:function(){return i},OS:function(){return R},WE:function(){return d},dz:function(){return a},gn:function(){return b},li:function(){return p},r:function(){return r},tY:function(){return s},xS:function(){return T}});var Z=K(34155),J;const V="en";let N=!1,L=!1,C=!1,P=!1,M=!1,e=!1,I=!1,A,f=null,g=null,h;const p=typeof self=="object"?self:typeof K.g=="object"?K.g:{};let u;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?u=p.vscode.process:typeof Z!="undefined"&&(u=Z);const v=typeof((J=u==null?void 0:u.versions)===null||J===void 0?void 0:J.electron)=="string"&&u.type==="renderer";if(typeof navigator=="object"&&!v)h=navigator.userAgent,N=h.indexOf("Windows")>=0,L=h.indexOf("Macintosh")>=0,I=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,C=h.indexOf("Linux")>=0,e=!0,A=navigator.language,f=A;else if(typeof u=="object"){N=u.platform==="win32",L=u.platform==="darwin",C=u.platform==="linux",P=C&&!!u.env.SNAP&&!!u.env.SNAP_REVISION,A=V,f=V;const n=u.env.VSCODE_NLS_CONFIG;if(n)try{const t=JSON.parse(n),l=t.availableLanguages["*"];A=t.locale,f=l||V,g=t._translationsConfigFile}catch(t){}M=!0}else console.error("Unable to resolve platform.");let m=0;L?m=1:N?m=3:C&&(m=2);const o=N,a=L,i=C,s=M,E=e,b=I,d=h,T=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let l=[];p.addEventListener("message",y=>{if(y.data&&y.data.vscodeSetImmediateId)for(let c=0,_=l.length;c<_;c++){const D=l[c];if(D.id===y.data.vscodeSetImmediateId){l.splice(c,1),D.callback();return}}});let x=0;return y=>{const c=++x;l.push({id:c,callback:y}),p.postMessage({vscodeSetImmediateId:c},"*")}}if(typeof(u==null?void 0:u.nextTick)=="function")return u.nextTick.bind(u);const t=Promise.resolve();return l=>t.then(l)}(),R=L||I?2:N?1:3;let S=!0,w=!1;function r(){if(!w){w=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,S=new Uint16Array(n.buffer)[0]===513}return S}},84013:function(He,ye,K){"use strict";K.d(ye,{G:function(){return V}});var Z=K(1432);const J=Z.li.performance&&typeof Z.li.performance.now=="function";class V{constructor(L){this._highResolution=J&&L,this._startTime=this._now(),this._stopTime=-1}static create(L=!0){return new V(L)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.li.performance.now():Date.now()}}},97295:function(He,ye,K){"use strict";K.d(ye,{$i:function(){return k},C8:function(){return Q},GF:function(){return A},HO:function(){return x},IO:function(){return f},K7:function(){return j},Kw:function(){return se},LC:function(){return p},Mh:function(){return T},P1:function(){return R},PJ:function(){return le},Qe:function(){return F},R1:function(){return I},RP:function(){return D},S6:function(){return xe},TT:function(){return o},Ut:function(){return c},V8:function(){return u},WU:function(){return V},YK:function(){return w},YU:function(){return N},ZG:function(){return S},ZH:function(){return n},ab:function(){return G},c1:function(){return ee},df:function(){return E},ec:function(){return L},fi:function(){return Re},fy:function(){return C},j3:function(){return P},j_:function(){return i},m5:function(){return Z},mK:function(){return s},mr:function(){return g},oH:function(){return be},oL:function(){return M},ok:function(){return d},ow:function(){return v},qq:function(){return b},qu:function(){return m},rL:function(){return r},uS:function(){return ie},un:function(){return e},uq:function(){return h},vH:function(){return l},xe:function(){return H},zY:function(){return a}});function Z(z){return!z||typeof z!="string"?!0:z.trim().length===0}const J=/{(\d+)}/g;function V(z,...ne){return ne.length===0?z:z.replace(J,function(de,ge){const Ae=parseInt(ge,10);return isNaN(Ae)||Ae<0||Ae>=ne.length?de:ne[Ae]})}function N(z){return z.replace(/[<>&]/g,function(ne){switch(ne){case"<":return"<";case">":return">";case"&":return"&";default:return ne}})}function L(z){return z.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function C(z,ne=" "){const de=P(z,ne);return M(de,ne)}function P(z,ne){if(!z||!ne)return z;const de=ne.length;if(de===0||z.length===0)return z;let ge=0;for(;z.indexOf(ne,ge)===ge;)ge=ge+de;return z.substring(ge)}function M(z,ne){if(!z||!ne)return z;const de=ne.length,ge=z.length;if(de===0||ge===0)return z;let Ae=ge,Ve=-1;for(;Ve=z.lastIndexOf(ne,Ae-1),!(Ve===-1||Ve+de!==Ae);){if(Ve===0)return"";Ae=Ve}return z.substring(0,Ae)}function e(z){return z.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(z){return z.replace(/\*/g,"")}function A(z,ne,de={}){if(!z)throw new Error("Cannot create regex from empty string");ne||(z=L(z)),de.wholeWord&&(/\B/.test(z.charAt(0))||(z="\\b"+z),/\B/.test(z.charAt(z.length-1))||(z=z+"\\b"));let ge="";return de.global&&(ge+="g"),de.matchCase||(ge+="i"),de.multiline&&(ge+="m"),de.unicode&&(ge+="u"),new RegExp(z,ge)}function f(z){return z.source==="^"||z.source==="^$"||z.source==="$"||z.source==="^\\s*$"?!1:!!(z.exec("")&&z.lastIndex===0)}function g(z){return(z.global?"g":"")+(z.ignoreCase?"i":"")+(z.multiline?"m":"")+(z.unicode?"u":"")}function h(z){return z.split(/\r\n|\r|\n/)}function p(z){for(let ne=0,de=z.length;ne=0;de--){const ge=z.charCodeAt(de);if(ge!==32&&ge!==9)return de}return-1}function m(z,ne){return zne?1:0}function o(z,ne,de=0,ge=z.length,Ae=0,Ve=ne.length){for(;deSt)return 1}const xt=ge-de,Je=Ve-Ae;return xtJe?1:0}function a(z,ne){return i(z,ne,0,z.length,0,ne.length)}function i(z,ne,de=0,ge=z.length,Ae=0,Ve=ne.length){for(;de=128||St>=128)return o(z.toLowerCase(),ne.toLowerCase(),de,ge,Ae,Ve);s(pt)&&(pt-=32),s(St)&&(St-=32);const er=pt-St;if(er!==0)return er}const xt=ge-de,Je=Ve-Ae;return xtJe?1:0}function s(z){return z>=97&&z<=122}function E(z){return z>=65&&z<=90}function b(z,ne){return z.length===ne.length&&i(z,ne)===0}function d(z,ne){const de=ne.length;return ne.length>z.length?!1:i(z,ne,0,de)===0}function T(z,ne){let de,ge=Math.min(z.length,ne.length);for(de=0;de1){const ge=z.charCodeAt(ne-2);if(S(ge))return r(ge,de)}return de}function l(z,ne){const de=Ee.getInstance(),ge=ne,Ae=z.length,Ve=n(z,Ae,ne);ne+=Ve>=65536?2:1;let xt=de.getGraphemeBreakType(Ve);for(;ne=65536?2:1,xt=pt}return ne-ge}function x(z,ne){const de=Ee.getInstance(),ge=ne,Ae=t(z,ne);ne-=Ae>=65536?2:1;let Ve=de.getGraphemeBreakType(Ae);for(;ne>0;){const xt=t(z,ne),Je=de.getGraphemeBreakType(xt);if(Re(Je,Ve))break;ne-=xt>=65536?2:1,Ve=Je}return ge-ne}const y=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function c(z){return y.test(z)}const _=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function D(z){return _.test(z)}const O=/^[\t\n\r\x20-\x7E]*$/;function k(z){return O.test(z)}const F=/[\u2028\u2029]/;function G(z){return F.test(z)}function H(z){for(let ne=0,de=z.length;ne=11904&&z<=55215||z>=63744&&z<=64255||z>=65281&&z<=65374}function Q(z){return z>=127462&&z<=127487||z===8986||z===8987||z===9200||z===9203||z>=9728&&z<=10175||z===11088||z===11093||z>=127744&&z<=128591||z>=128640&&z<=128764||z>=128992&&z<=129003||z>=129280&&z<=129535||z>=129648&&z<=129750}const ee="\uFEFF";function ie(z){return!!(z&&z.length>0&&z.charCodeAt(0)===65279)}function se(z,ne=!1){return z?(ne&&(z=z.replace(/\\./g,"")),z.toLowerCase()!==z):!1}function le(z){return z=z%(2*26),z<26?String.fromCharCode(97+z):String.fromCharCode(65+z-26)}function xe(z){return Ee.getInstance().getGraphemeBreakType(z)}function Re(z,ne){return z===0?ne!==5&&ne!==7:z===2&&ne===3?!1:z===4||z===2||z===3||ne===4||ne===2||ne===3?!0:!(z===8&&(ne===8||ne===9||ne===11||ne===12)||(z===11||z===9)&&(ne===9||ne===10)||(z===12||z===10)&&ne===10||ne===5||ne===13||ne===7||z===1||z===13&&ne===14||z===6&&ne===6)}class Ee{constructor(){this._data=he()}static getInstance(){return Ee._INSTANCE||(Ee._INSTANCE=new Ee),Ee._INSTANCE}getGraphemeBreakType(ne){if(ne<32)return ne===10?3:ne===13?2:4;if(ne<127)return 0;const de=this._data,ge=de.length/3;let Ae=1;for(;Ae<=ge;)if(nede[3*Ae+1])Ae=2*Ae+1;else return de[3*Ae+2];return 0}}Ee._INSTANCE=null;function he(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function be(z,ne){if(z===0)return 0;const de=Ce(z,ne);if(de!==void 0)return de;const ge=t(ne,z);return z-=Ue(ge),z}function Ce(z,ne){let de=t(ne,z);for(z-=Ue(de);$e(de)||de===65039||de===8419;){if(z===0)return;de=t(ne,z),z-=Ue(de)}if(Q(de)){if(z>=0){const ge=t(ne,z);ge===8205&&(z-=Ue(ge))}return z}}function Ue(z){return z>=65536?2:1}function $e(z){return 127995<=z&&z<=127999}},98401:function(He,ye,K){"use strict";K.d(ye,{$E:function(){return p},$K:function(){return P},D8:function(){return f},HD:function(){return J},IU:function(){return u},Jp:function(){return M},Kn:function(){return V},cW:function(){return I},f6:function(){return v},hj:function(){return N},jn:function(){return L},kJ:function(){return Z},mf:function(){return A},o8:function(){return C},p_:function(){return e},vE:function(){return m}});function Z(o){return Array.isArray(o)}function J(o){return typeof o=="string"}function V(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&!(o instanceof RegExp)&&!(o instanceof Date)}function N(o){return typeof o=="number"&&!isNaN(o)}function L(o){return o===!0||o===!1}function C(o){return typeof o=="undefined"}function P(o){return!M(o)}function M(o){return C(o)||o===null}function e(o,a){if(!o)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function I(o){if(M(o))throw new Error("Assertion Failed: argument is undefined or null");return o}function A(o){return typeof o=="function"}function f(o,a){const i=Math.min(o.length,a.length);for(let s=0;sfunction(){const b=Array.prototype.slice.call(arguments,0);return a(E,b)};let s={};for(const E of o)s[E]=i(E);return s}function v(o){return o===null?void 0:o}function m(o,a="Unreachable"){throw new Error(a)}},63580:function(He,ye,K){"use strict";K.d(ye,{N:function(){return J}});function Z(V,N){let L;return N.length===0?L=V:L=V.replace(/\{(\d+)\}/g,function(C,P){const M=P[0];return typeof N[M]!="undefined"?N[M]:C}),L}function J(V,N,...L){return Z(N,L)}},84144:function(He,ye,K){"use strict";K.d(ye,{BH:function(){return u},NZ:function(){return v},U8:function(){return m},co:function(){return p},eH:function(){return h},vr:function(){return g}});var Z=K(74741),J=K(73046),V=K(4669),N=K(53725),L=K(9917),C=K(91741),P=K(94565),M=K(38819),e=K(72065),I=K(97781),A=function(o,a,i,s){var E=arguments.length,b=E<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,i):s,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,a,i,s);else for(var T=o.length-1;T>=0;T--)(d=o[T])&&(b=(E<3?d(b):E>3?d(a,i,b):d(a,i))||b);return E>3&&b&&Object.defineProperty(a,i,b),b},f=function(o,a){return function(i,s){a(i,s,o)}};function g(o){return o.command!==void 0}class h{constructor(a){this.id=h._idPool++,this._debugName=a}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const p=(0,e.yh)("menuService"),u=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new V.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:o=>o===h.CommandPalette}}addCommand(o){return this.addCommands(N.$.single(o))}addCommands(o){for(const a of o)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,L.OF)(()=>{let a=!1;for(const i of o)a=this._commands.delete(i.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(o){return this._commands.get(o)}getCommands(){const o=new Map;return this._commands.forEach((a,i)=>o.set(i,a)),o}appendMenuItem(o,a){return this.appendMenuItems(N.$.single({id:o,item:a}))}appendMenuItems(o){const a=new Set,i=new C.S;for(const{id:s,item:E}of o){let b=this._menuItems.get(s);b||(b=new C.S,this._menuItems.set(s,b)),i.push(b.push(E)),a.add(s)}return this._onDidChangeMenu.fire(a),(0,L.OF)(()=>{if(i.size>0){for(let s of i)s();this._onDidChangeMenu.fire(a),i.clear()}})}getMenuItems(o){let a;return this._menuItems.has(o)?a=[...this._menuItems.get(o)]:a=[],o===h.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(o){const a=new Set;for(const i of o)g(i)&&(a.add(i.command.id),i.alt&&a.add(i.alt.id));this._commands.forEach((i,s)=>{a.has(s)||o.push({command:i})})}};class v extends Z.wY{constructor(a,i,s,E){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu"),this.item=a,this._menuService=i,this._contextKeyService=s,this._options=E}get actions(){const a=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),s=i.getActions(this._options);i.dispose();for(const[,E]of s)E.length>0&&(a.push(...E),a.push(new Z.Z0));return a.length&&a.pop(),a}}let m=class ca{constructor(a,i,s,E,b){var d,T;if(this._commandService=b,this.id=a.id,this.label=s!=null&&s.renderShortTitle&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(T=typeof a.tooltip=="string"?a.tooltip:(d=a.tooltip)===null||d===void 0?void 0:d.value)!==null&&T!==void 0?T:"",this.enabled=!a.precondition||E.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const R=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=E.contextMatchesRules(R.condition),this.checked&&R.tooltip&&(this.tooltip=typeof R.tooltip=="string"?R.tooltip:R.tooltip.value),R.title&&(this.label=typeof R.title=="string"?R.title:R.title.value)}this.item=a,this.alt=i?new ca(i,void 0,s,E,b):void 0,this._options=s,I.kS.isThemeIcon(a.icon)&&(this.class=J.dT.asClassName(a.icon))}dispose(){}run(...a){var i,s;let E=[];return!((i=this._options)===null||i===void 0)&&i.arg&&(E=[...E,this._options.arg]),!((s=this._options)===null||s===void 0)&&s.shouldForwardArgs&&(E=[...E,...a]),this._commandService.executeCommand(this.id,...E)}};m=A([f(3,M.i6),f(4,P.H)],m)},94565:function(He,ye,K){"use strict";K.d(ye,{H:function(){return P},P:function(){return M}});var Z=K(4669),J=K(53725),V=K(9917),N=K(91741),L=K(98401),C=K(72065);const P=(0,C.yh)("commandService"),M=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,I){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:e,handler:I})}if(e.description){const p=[];for(let v of e.description.args)p.push(v.constraint);const u=e.handler;e.handler=function(v,...m){return(0,L.D8)(m,p),u(v,...m)}}const{id:A}=e;let f=this._commands.get(A);f||(f=new N.S,this._commands.set(A,f));let g=f.unshift(e),h=(0,V.OF)(()=>{g();const p=this._commands.get(A);p!=null&&p.isEmpty()&&this._commands.delete(A)});return this._onDidRegisterCommand.fire(A),h}registerCommandAlias(e,I){return M.registerCommand(e,(A,...f)=>A.get(P).executeCommand(I,...f))}getCommand(e){const I=this._commands.get(e);if(!(!I||I.isEmpty()))return J.$.first(I)}getCommands(){const e=new Map;for(const I of this._commands.keys()){const A=this.getCommand(I);A&&e.set(I,A)}return e}};M.registerCommand("noop",()=>{})},38819:function(He,ye,K){"use strict";K.d(ye,{Ao:function(){return P},Eq:function(){return r},Fb:function(){return M},K8:function(){return l},i6:function(){return w},uy:function(){return S}});var Z=K(1432),J=K(97295),V=K(72065);let N=Z.WE||"";const L=new Map;L.set("false",!1),L.set("true",!0),L.set("isMac",Z.dz),L.set("isLinux",Z.IJ),L.set("isWindows",Z.ED),L.set("isWeb",Z.$L),L.set("isMacNative",Z.dz&&!Z.$L),L.set("isEdge",N.indexOf("Edg/")>=0),L.set("isFirefox",N.indexOf("Firefox")>=0),L.set("isChrome",N.indexOf("Chrome")>=0),L.set("isSafari",N.indexOf("Safari")>=0);const C=Object.prototype.hasOwnProperty;class P{static has(c){return f.create(c)}static equals(c,_){return g.create(c,_)}static regex(c,_){return E.create(c,_)}static not(c){return v.create(c)}static and(...c){return T.create(c,null)}static or(...c){return R.create(c,null,!0)}static deserialize(c,_=!1){if(c)return this._deserializeOrExpression(c,_)}static _deserializeOrExpression(c,_){let D=c.split("||");return R.create(D.map(O=>this._deserializeAndExpression(O,_)),null,!0)}static _deserializeAndExpression(c,_){let D=c.split("&&");return T.create(D.map(O=>this._deserializeOne(O,_)),null)}static _deserializeOne(c,_){if(c=c.trim(),c.indexOf("!=")>=0){let D=c.split("!=");return u.create(D[0].trim(),this._deserializeValue(D[1],_))}if(c.indexOf("==")>=0){let D=c.split("==");return g.create(D[0].trim(),this._deserializeValue(D[1],_))}if(c.indexOf("=~")>=0){let D=c.split("=~");return E.create(D[0].trim(),this._deserializeRegexValue(D[1],_))}if(c.indexOf(" in ")>=0){let D=c.split(" in ");return h.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(c)){const D=c.split(">=");return a.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(c)){const D=c.split(">");return o.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(c)){const D=c.split("<=");return s.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(c)){const D=c.split("<");return i.create(D[0].trim(),D[1].trim())}return/^\!\s*/.test(c)?v.create(c.substr(1).trim()):f.create(c)}static _deserializeValue(c,_){if(c=c.trim(),c==="true")return!0;if(c==="false")return!1;let D=/^'([^']*)'$/.exec(c);return D?D[1].trim():c}static _deserializeRegexValue(c,_){if((0,J.m5)(c)){if(_)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let D=c.indexOf("/"),O=c.lastIndexOf("/");if(D===O||D<0){if(_)throw new Error(`bad regexp-value '${c}', missing /-enclosure`);return console.warn(`bad regexp-value '${c}', missing /-enclosure`),null}let k=c.slice(D+1,O),F=c[O+1]==="i"?"i":"";try{return new RegExp(k,F)}catch(G){if(_)throw new Error(`bad regexp-value '${c}', parse error: ${G}`);return console.warn(`bad regexp-value '${c}', parse error: ${G}`),null}}}function M(y,c){const _=y?y.substituteConstants():void 0,D=c?c.substituteConstants():void 0;return!_&&!D?!0:!_||!D?!1:_.equals(D)}function e(y,c){return y.cmp(c)}class I{constructor(){this.type=0}cmp(c){return this.type-c.type}equals(c){return c.type===this.type}substituteConstants(){return this}evaluate(c){return!1}serialize(){return"false"}keys(){return[]}negate(){return A.INSTANCE}}I.INSTANCE=new I;class A{constructor(){this.type=1}cmp(c){return this.type-c.type}equals(c){return c.type===this.type}substituteConstants(){return this}evaluate(c){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}A.INSTANCE=new A;class f{constructor(c,_){this.key=c,this.negated=_,this.type=2}static create(c,_=null){const D=L.get(c);return typeof D=="boolean"?D?A.INSTANCE:I.INSTANCE:new f(c,_)}cmp(c){return c.type!==this.type?this.type-c.type:n(this.key,c.key)}equals(c){return c.type===this.type?this.key===c.key:!1}substituteConstants(){const c=L.get(this.key);return typeof c=="boolean"?c?A.INSTANCE:I.INSTANCE:this}evaluate(c){return!!c.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this)),this.negated}}class g{constructor(c,_,D){this.key=c,this.value=_,this.negated=D,this.type=4}static create(c,_,D=null){if(typeof _=="boolean")return _?f.create(c,D):v.create(c,D);const O=L.get(c);return typeof O=="boolean"?_===(O?"true":"false")?A.INSTANCE:I.INSTANCE:new g(c,_,D)}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){const c=L.get(this.key);if(typeof c=="boolean"){const _=c?"true":"false";return this.value===_?A.INSTANCE:I.INSTANCE}return this}evaluate(c){return c.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class h{constructor(c,_){this.key=c,this.valueKey=_,this.type=10,this.negated=null}static create(c,_){return new h(c,_)}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.valueKey,c.key,c.valueKey)}equals(c){return c.type===this.type?this.key===c.key&&this.valueKey===c.valueKey:!1}substituteConstants(){return this}evaluate(c){const _=c.getValue(this.valueKey),D=c.getValue(this.key);return Array.isArray(_)?_.indexOf(D)>=0:typeof D=="string"&&typeof _=="object"&&_!==null?C.call(_,D):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p.create(this)),this.negated}}class p{constructor(c){this._actual=c,this.type=11}static create(c){return new p(c)}cmp(c){return c.type!==this.type?this.type-c.type:this._actual.cmp(c._actual)}equals(c){return c.type===this.type?this._actual.equals(c._actual):!1}substituteConstants(){return this}evaluate(c){return!this._actual.evaluate(c)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class u{constructor(c,_,D){this.key=c,this.value=_,this.negated=D,this.type=5}static create(c,_,D=null){if(typeof _=="boolean")return _?v.create(c,D):f.create(c,D);const O=L.get(c);return typeof O=="boolean"?_===(O?"true":"false")?I.INSTANCE:A.INSTANCE:new u(c,_,D)}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){const c=L.get(this.key);if(typeof c=="boolean"){const _=c?"true":"false";return this.value===_?I.INSTANCE:A.INSTANCE}return this}evaluate(c){return c.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class v{constructor(c,_){this.key=c,this.negated=_,this.type=3}static create(c,_=null){const D=L.get(c);return typeof D=="boolean"?D?I.INSTANCE:A.INSTANCE:new v(c,_)}cmp(c){return c.type!==this.type?this.type-c.type:n(this.key,c.key)}equals(c){return c.type===this.type?this.key===c.key:!1}substituteConstants(){const c=L.get(this.key);return typeof c=="boolean"?c?I.INSTANCE:A.INSTANCE:this}evaluate(c){return!c.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function m(y,c){if(typeof y=="string"){const _=parseFloat(y);isNaN(_)||(y=_)}return typeof y=="string"||typeof y=="number"?c(y):I.INSTANCE}class o{constructor(c,_,D){this.key=c,this.value=_,this.negated=D,this.type=12}static create(c,_,D=null){return m(_,O=>new o(c,O,D))}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){return this}evaluate(c){return typeof this.value=="string"?!1:parseFloat(c.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class a{constructor(c,_,D){this.key=c,this.value=_,this.negated=D,this.type=13}static create(c,_,D=null){return m(_,O=>new a(c,O,D))}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){return this}evaluate(c){return typeof this.value=="string"?!1:parseFloat(c.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class i{constructor(c,_,D){this.key=c,this.value=_,this.negated=D,this.type=14}static create(c,_,D=null){return m(_,O=>new i(c,O,D))}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){return this}evaluate(c){return typeof this.value=="string"?!1:parseFloat(c.getValue(this.key))new s(c,O,D))}cmp(c){return c.type!==this.type?this.type-c.type:t(this.key,this.value,c.key,c.value)}equals(c){return c.type===this.type?this.key===c.key&&this.value===c.value:!1}substituteConstants(){return this}evaluate(c){return typeof this.value=="string"?!1:parseFloat(c.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class E{constructor(c,_){this.key=c,this.regexp=_,this.type=7,this.negated=null}static create(c,_){return new E(c,_)}cmp(c){if(c.type!==this.type)return this.type-c.type;if(this.keyc.key)return 1;const _=this.regexp?this.regexp.source:"",D=c.regexp?c.regexp.source:"";return _D?1:0}equals(c){if(c.type===this.type){const _=this.regexp?this.regexp.source:"",D=c.regexp?c.regexp.source:"";return this.key===c.key&&_===D}return!1}substituteConstants(){return this}evaluate(c){let _=c.getValue(this.key);return this.regexp?this.regexp.test(_):!1}serialize(){const c=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${c}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this)),this.negated}}class b{constructor(c){this._actual=c,this.type=8}static create(c){return new b(c)}cmp(c){return c.type!==this.type?this.type-c.type:this._actual.cmp(c._actual)}equals(c){return c.type===this.type?this._actual.equals(c._actual):!1}substituteConstants(){return this}evaluate(c){return!this._actual.evaluate(c)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function d(y){let c=null;for(let _=0,D=y.length;_c.expr.length)return 1;for(let _=0,D=this.expr.length;_1;){const k=D[D.length-1];if(k.type!==9)break;D.pop();const F=D.pop(),G=D.length===0,H=R.create(k.expr.map(j=>T.create([j,F],null)),null,G);H&&(D.push(H),D.sort(e))}return D.length===1?D[0]:new T(D,_)}}serialize(){return this.expr.map(c=>c.serialize()).join(" && ")}keys(){const c=[];for(let _ of this.expr)c.push(..._.keys());return c}negate(){if(!this.negated){const c=[];for(let _ of this.expr)c.push(_.negate());this.negated=R.create(c,this,!0)}return this.negated}}class R{constructor(c,_){this.expr=c,this.negated=_,this.type=9}static create(c,_,D){return R._normalizeArr(c,_,D)}cmp(c){if(c.type!==this.type)return this.type-c.type;if(this.expr.lengthc.expr.length)return 1;for(let _=0,D=this.expr.length;_c.serialize()).join(" || ")}keys(){const c=[];for(let _ of this.expr)c.push(..._.keys());return c}negate(){if(!this.negated){let c=[];for(let _ of this.expr)c.push(_.negate());for(;c.length>1;){const _=c.shift(),D=c.shift(),O=[];for(const F of x(_))for(const G of x(D))O.push(T.create([F,G],null));const k=c.length===0;c.unshift(R.create(O,null,k))}this.negated=c[0]}return this.negated}}class S extends f{constructor(c,_,D){super(c,null),this._defaultValue=_,typeof D=="object"?S._info.push(Object.assign(Object.assign({},D),{key:c})):D!==!0&&S._info.push({key:c,description:D,type:_!=null?typeof _:void 0})}static all(){return S._info.values()}bindTo(c){return c.createKey(this.key,this._defaultValue)}getValue(c){return c.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(c){return g.create(this.key,c)}}S._info=[];const w=(0,V.yh)("contextKeyService"),r="setContext";function n(y,c){return yc?1:0}function t(y,c,_,D){return y<_?-1:y>_?1:cD?1:0}function l(y,c){if(c.type===6&&y.type!==9&&y.type!==6){for(const O of c.expr)if(y.equals(O))return!0}const _=y.negate(),D=x(_).concat(x(c));D.sort(e);for(let O=0;OC,Z.serviceIds.set(C,P),P}function L(C){return function(P,M,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");V(C,P,e,!0)}}},89872:function(He,ye,K){"use strict";K.d(ye,{B:function(){return N}});var Z=K(35146),J=K(98401);class V{constructor(){this.data=new Map}add(C,P){Z.ok(J.HD(C)),Z.ok(J.Kn(P)),Z.ok(!this.data.has(C),"There is already an extension with this id"),this.data.set(C,P)}as(C){return this.data.get(C)||null}}const N=new V},92321:function(He,ye,K){"use strict";K.d(ye,{e:function(){return Z}});var Z;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(Z||(Z={}))},97781:function(He,ye,K){"use strict";K.d(ye,{EN:function(){return e},IP:function(){return f},Ic:function(){return p},XE:function(){return P},bB:function(){return u},kS:function(){return I},m6:function(){return A}});var Z=K(73046),J=K(4669),V=K(9917),N=K(72065),L=K(89872),C=K(92321);const P=(0,N.yh)("themeService");var M;(function(v){function m(o){return o&&typeof o=="object"&&typeof o.id=="string"}v.isThemeColor=m})(M||(M={}));function e(v){return{id:v}}var I;(function(v){function m(b){return b&&typeof b=="object"&&typeof b.id=="string"&&(typeof b.color=="undefined"||M.isThemeColor(b.color))}v.isThemeIcon=m;const o=new RegExp(`^\\$\\((${Z.dT.iconNameExpression}(?:${Z.dT.iconModifierExpression})?)\\)$`);function a(b){const d=o.exec(b);if(!d)return;let[,T]=d;return{id:T}}v.fromString=a;function i(b,d){let T=b.id;const R=T.lastIndexOf("~");return R!==-1&&(T=T.substring(0,R)),d&&(T=`${T}~${d}`),{id:T}}v.modify=i;function s(b,d){var T,R;return b.id===d.id&&((T=b.color)===null||T===void 0?void 0:T.id)===((R=d.color)===null||R===void 0?void 0:R.id)}v.isEqual=s;function E(b,d){return{id:b.id,color:d?e(d):void 0}}v.asThemeIcon=E,v.asClassNameArray=Z.dT.asClassNameArray,v.asClassName=Z.dT.asClassName,v.asCSSSelector=Z.dT.asCSSSelector})(I||(I={}));function A(v){switch(v){case C.e.DARK:return"vs-dark";case C.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class g{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new J.Q5}onColorThemeChange(m){return this.themingParticipants.push(m),this.onThemingParticipantAddedEmitter.fire(m),(0,V.OF)(()=>{const o=this.themingParticipants.indexOf(m);this.themingParticipants.splice(o,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new g;L.B.add(f.ThemingContribution,h);function p(v){return h.onColorThemeChange(v)}class u extends V.JT{constructor(m){super(),this.themeService=m,this.theme=m.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(o=>this.onThemeChange(o)))}onThemeChange(m){this.theme=m,this.updateStyles()}updateStyles(){}}},95860:function(He,ye,K){"use strict";K.d(ye,{Z:function(){return a}});var Z=K(87462),J=K(1413),V=K(4942),N=K(97685),L=K(45987),C=K(94184),P=K.n(C),M=K(67294);function e(i){var s=M.useRef();s.current=i;var E=M.useCallback(function(){for(var b,d=arguments.length,T=new Array(d),R=0;Rpt;(0,P.useImperativeHandle)(s,function(){var Ye;return{focus:Ce,blur:function(){var it;(it=he.current)===null||it===void 0||it.blur()},setSelectionRange:function(it,Vt,tr){var or;(or=he.current)===null||or===void 0||or.setSelectionRange(it,Vt,tr)},select:function(){var it;(it=he.current)===null||it===void 0||it.select()},input:he.current,nativeElement:((Ye=be.current)===null||Ye===void 0?void 0:Ye.nativeElement)||he.current}}),(0,P.useEffect)(function(){Ee.current&&(Ee.current=!1),xe(function(Ye){return Ye&&t?!1:Ye})},[t]);var Ne=function(je,it,Vt){var tr=it;if(!Re.current&&Je.exceedFormatter&&Je.max&&Je.strategy(it)>Je.max){if(tr=Je.exceedFormatter(it,{max:Je.max}),it!==tr){var or,Dr;xt([((or=he.current)===null||or===void 0?void 0:or.selectionStart)||0,((Dr=he.current)===null||Dr===void 0?void 0:Dr.selectionEnd)||0])}}else if(Vt.source==="compositionEnd")return;ne(tr),he.current&&(0,M.rJ)(he.current,je,b,tr)};(0,P.useEffect)(function(){if(Ve){var Ye;(Ye=he.current)===null||Ye===void 0||Ye.setSelectionRange.apply(Ye,(0,A.Z)(Ve))}},[Ve]);var Fe=function(je){Ne(je,je.target.value,{source:"change"})},We=function(je){Re.current=!1,Ne(je,je.currentTarget.value,{source:"compositionEnd"}),Q==null||Q(je)},Be=function(je){R&&je.key==="Enter"&&!Ee.current&&(Ee.current=!0,R(je)),S==null||S(je)},_e=function(je){je.key==="Enter"&&(Ee.current=!1),w==null||w(je)},ht=function(je){xe(!0),d==null||d(je)},Ze=function(je){Ee.current&&(Ee.current=!1),xe(!1),T==null||T(je)},At=function(je){ne(""),Ce(),he.current&&(0,M.rJ)(he.current,je,b)},yt=er&&"".concat(n,"-out-of-range"),tt=function(){var je=(0,p.Z)(i,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return P.createElement("input",(0,J.Z)({autoComplete:E},je,{onChange:Fe,onFocus:ht,onBlur:Ze,onKeyDown:Be,onKeyUp:_e,className:C()(n,(0,V.Z)({},"".concat(n,"-disabled"),t),G==null?void 0:G.input),style:H==null?void 0:H.input,ref:he,size:l,type:k,onCompositionStart:function(Vt){Re.current=!0,j==null||j(Vt)},onCompositionEnd:We}))},bt=function(){var je=Number(pt)>0;if(c||Je.show){var it=Je.showFormatter?Je.showFormatter({value:de,count:St,maxLength:pt}):"".concat(St).concat(je?" / ".concat(pt):"");return P.createElement(P.Fragment,null,Je.show&&P.createElement("span",{className:C()("".concat(n,"-show-count-suffix"),(0,V.Z)({},"".concat(n,"-show-count-has-suffix"),!!c),G==null?void 0:G.count),style:(0,Z.Z)({},H==null?void 0:H.count)},it),c)}return null};return P.createElement(I,(0,J.Z)({},ee,{prefixCls:n,className:C()(x,yt),handleReset:At,value:de,focused:le,triggerFocus:Ce,suffix:bt(),disabled:t,classes:F,classNames:G,styles:H}),tt())}),o=m,a=o},87887:function(He,ye,K){"use strict";K.d(ye,{He:function(){return Z},X3:function(){return J},nH:function(){return L},rJ:function(){return N}});function Z(C){return!!(C.addonBefore||C.addonAfter)}function J(C){return!!(C.prefix||C.suffix||C.allowClear)}function V(C,P,M){var e=P.cloneNode(!0),I=Object.create(C,{target:{value:e},currentTarget:{value:e}});return e.value=M,typeof P.selectionStart=="number"&&typeof P.selectionEnd=="number"&&(e.selectionStart=P.selectionStart,e.selectionEnd=P.selectionEnd),e.setSelectionRange=function(){P.setSelectionRange.apply(P,arguments)},I}function N(C,P,M,e){if(M){var I=P;if(P.type==="click"){I=V(P,C,""),M(I);return}if(C.type!=="file"&&e!==void 0){I=V(P,C,e),M(I);return}M(I)}}function L(C,P){if(C){C.focus(P);var M=P||{},e=M.cursor;if(e){var I=C.value.length;switch(e){case"start":C.setSelectionRange(0,0);break;case"end":C.setSelectionRange(I,I);break;default:C.setSelectionRange(0,I)}}}}},78595:function(He,ye,K){"use strict";K.d(ye,{iz:function(){return _t},ck:function(){return wn},BW:function(){return Yt},sN:function(){return wn},Wd:function(){return ze},ZP:function(){return Gr},Xl:function(){return Ve}});var Z=K(87462),J=K(4942),V=K(1413),N=K(74902),L=K(97685),C=K(45987),P=K(94184),M=K.n(P),e=K(67294),I=K(48555);function A(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var f=A()?e.useLayoutEffect:e.useEffect,g=function(re,oe){var te=e.useRef(!0);f(function(){return re(te.current)},oe),f(function(){return te.current=!1,function(){te.current=!0}},[])},h=function(re,oe){g(function(te){if(!te)return re()},oe)},p=g,u=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],v=void 0;function m(Y,re){var oe=Y.prefixCls,te=Y.invalidate,fe=Y.item,ce=Y.renderItem,ve=Y.responsive,Pe=Y.responsiveDisabled,Qe=Y.registerSize,Ge=Y.itemKey,vt=Y.className,lt=Y.style,Et=Y.children,wt=Y.display,gt=Y.order,rt=Y.component,ot=rt===void 0?"div":rt,U=(0,C.Z)(Y,u),W=ve&&!wt;function B(Me){Qe(Ge,Me)}e.useEffect(function(){return function(){B(null)}},[]);var X=ce&&fe!==v?ce(fe):Et,ae;te||(ae={opacity:W?0:1,height:W?0:v,overflowY:W?"hidden":v,order:ve?gt:v,pointerEvents:W?"none":v,position:W?"absolute":v});var me={};W&&(me["aria-hidden"]=!0);var Te=e.createElement(ot,(0,Z.Z)({className:M()(!te&&oe,vt),style:(0,V.Z)((0,V.Z)({},ae),lt)},me,U,{ref:re}),X);return ve&&(Te=e.createElement(I.Z,{onResize:function(Ie){var ke=Ie.offsetWidth;B(ke)},disabled:Pe},Te)),Te}var o=e.forwardRef(m);o.displayName="Item";var a=o;function i(Y){var re=e.useRef();re.current=Y;var oe=e.useCallback(function(){for(var te,fe=arguments.length,ce=new Array(fe),ve=0;ve1&&arguments[1]!==void 0?arguments[1]:1;d+=1;var te=d;function fe(ce){if(ce===0)R(te),re();else{var ve=E(function(){fe(ce-1)});T.set(te,ve)}}return fe(oe),te};S.cancel=function(Y){var re=T.get(Y);return R(re),b(re)};var w=S;function r(Y){if(typeof MessageChannel=="undefined")w(Y);else{var re=new MessageChannel;re.port1.onmessage=function(){return Y()},re.port2.postMessage(void 0)}}function n(){var Y=e.useRef(null),re=function(te){Y.current||(Y.current=[],r(function(){(0,s.unstable_batchedUpdates)(function(){Y.current.forEach(function(fe){fe()}),Y.current=null})})),Y.current.push(te)};return re}function t(Y,re){var oe=e.useState(re),te=(0,L.Z)(oe,2),fe=te[0],ce=te[1],ve=i(function(Pe){Y(function(){ce(Pe)})});return[fe,ve]}var l=e.createContext(null),x=["component"],y=["className"],c=["className"],_=function(re,oe){var te=e.useContext(l);if(!te){var fe=re.component,ce=fe===void 0?"div":fe,ve=(0,C.Z)(re,x);return e.createElement(ce,(0,Z.Z)({},ve,{ref:oe}))}var Pe=te.className,Qe=(0,C.Z)(te,y),Ge=re.className,vt=(0,C.Z)(re,c);return e.createElement(l.Provider,{value:null},e.createElement(a,(0,Z.Z)({ref:oe,className:M()(Pe,Ge)},Qe,vt)))},D=e.forwardRef(_);D.displayName="RawItem";var O=D,k=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],F="responsive",G="invalidate";function H(Y){return"+ ".concat(Y.length," ...")}function j(Y,re){var oe=Y.prefixCls,te=oe===void 0?"rc-overflow":oe,fe=Y.data,ce=fe===void 0?[]:fe,ve=Y.renderItem,Pe=Y.renderRawItem,Qe=Y.itemKey,Ge=Y.itemWidth,vt=Ge===void 0?10:Ge,lt=Y.ssr,Et=Y.style,wt=Y.className,gt=Y.maxCount,rt=Y.renderRest,ot=Y.renderRawRest,U=Y.suffix,W=Y.component,B=W===void 0?"div":W,X=Y.itemComponent,ae=Y.onVisibleChange,me=(0,C.Z)(Y,k),Te=lt==="full",Me=n(),Ie=t(Me,null),ke=(0,L.Z)(Ie,2),at=ke[0],st=ke[1],dt=at||0,nt=t(Me,new Map),mt=(0,L.Z)(nt,2),kt=mt[0],Dt=mt[1],Bt=t(Me,0),Nt=(0,L.Z)(Bt,2),Mt=Nt[0],Qt=Nt[1],Ot=t(Me,0),ft=(0,L.Z)(Ot,2),Xt=ft[0],Ht=ft[1],nr=t(Me,0),Fr=(0,L.Z)(nr,2),br=Fr[0],Tr=Fr[1],$t=(0,e.useState)(null),dr=(0,L.Z)($t,2),vr=dr[0],Rr=dr[1],tn=(0,e.useState)(null),ir=(0,L.Z)(tn,2),xr=ir[0],Wt=ir[1],Qr=e.useMemo(function(){return xr===null&&Te?Number.MAX_SAFE_INTEGER:xr||0},[xr,at]),Xr=(0,e.useState)(!1),pr=(0,L.Z)(Xr,2),Ft=pr[0],Lr=pr[1],hn="".concat(te,"-item"),dn=Math.max(Mt,Xt),Sr=gt===F,ar=ce.length&&Sr,Pr=gt===G,$r=ar||typeof gt=="number"&&ce.length>gt,gr=(0,e.useMemo)(function(){var we=ce;return ar?at===null&&Te?we=ce:we=ce.slice(0,Math.min(ce.length,dt/vt)):typeof gt=="number"&&(we=ce.slice(0,gt)),we},[ce,vt,at,gt,ar]),Ir=(0,e.useMemo)(function(){return ar?ce.slice(Qr+1):ce.slice(gr.length)},[ce,gr,ar,Qr]),Ar=(0,e.useCallback)(function(we,et){var ct;return typeof Qe=="function"?Qe(we):(ct=Qe&&(we==null?void 0:we[Qe]))!==null&&ct!==void 0?ct:et},[Qe]),mr=(0,e.useCallback)(ve||function(we){return we},[ve]);function jr(we,et,ct){xr===we&&(et===void 0||et===vr)||(Wt(we),ct||(Lr(wedt){jr(Gt-1,we-Ut-br+Xt);break}}U&&Mr(0)+br>dt&&Rr(null)}},[dt,kt,Xt,br,Ar,gr]);var Xn=Ft&&!!Ir.length,zt={};vr!==null&&ar&&(zt={position:"absolute",left:vr,top:0});var ln={prefixCls:hn,responsive:ar,component:X,invalidate:Pr},bn=Pe?function(we,et){var ct=Ar(we,et);return e.createElement(l.Provider,{key:ct,value:(0,V.Z)((0,V.Z)({},ln),{},{order:et,item:we,itemKey:ct,registerSize:Ur,display:et<=Qr})},Pe(we,et))}:function(we,et){var ct=Ar(we,et);return e.createElement(a,(0,Z.Z)({},ln,{order:et,key:ct,item:we,renderItem:mr,itemKey:ct,registerSize:Ur,display:et<=Qr}))},_r,yn={order:Xn?Qr:Number.MAX_SAFE_INTEGER,className:"".concat(hn,"-rest"),registerSize:Jt,display:Xn};if(ot)ot&&(_r=e.createElement(l.Provider,{value:(0,V.Z)((0,V.Z)({},ln),yn)},ot(Ir)));else{var rn=rt||H;_r=e.createElement(a,(0,Z.Z)({},ln,yn),typeof rn=="function"?rn(Ir):rn)}var Ct=e.createElement(B,(0,Z.Z)({className:M()(!Pr&&te,wt),style:Et,ref:re},me),gr.map(bn),$r?_r:null,U&&e.createElement(a,(0,Z.Z)({},ln,{responsive:Sr,responsiveDisabled:!ar,order:Qr,className:"".concat(hn,"-suffix"),registerSize:Or,display:!0,style:zt}),U));return Sr&&(Ct=e.createElement(I.Z,{onResize:un,disabled:!ar},Ct)),Ct}var Q=e.forwardRef(j);Q.displayName="Overflow",Q.Item=O,Q.RESPONSIVE=F,Q.INVALIDATE=G;var ee=Q,ie=ee,se=K(21770),le=K(91881),xe=K(80334),Re=e.createContext(null);function Ee(Y,re){return Y===void 0?null:"".concat(Y,"-").concat(re)}function he(Y){var re=e.useContext(Re);return Ee(re,Y)}var be=K(56982),Ce=["children","locked"],Ue=e.createContext(null);function $e(Y,re){var oe=(0,V.Z)({},Y);return Object.keys(re).forEach(function(te){var fe=re[te];fe!==void 0&&(oe[te]=fe)}),oe}function z(Y){var re=Y.children,oe=Y.locked,te=(0,C.Z)(Y,Ce),fe=e.useContext(Ue),ce=(0,be.Z)(function(){return $e(fe,te)},[fe,te],function(ve,Pe){return!oe&&(ve[0]!==Pe[0]||!(0,le.Z)(ve[1],Pe[1],!0))});return e.createElement(Ue.Provider,{value:ce},re)}var ne=[],de=e.createContext(null);function ge(){return e.useContext(de)}var Ae=e.createContext(ne);function Ve(Y){var re=e.useContext(Ae);return e.useMemo(function(){return Y!==void 0?[].concat((0,N.Z)(re),[Y]):re},[re,Y])}var xt=e.createContext(null),Je=e.createContext({}),pt=Je,St=function(Y){if(!Y)return!1;if(Y instanceof Element){if(Y.offsetParent)return!0;if(Y.getBBox){var re=Y.getBBox(),oe=re.width,te=re.height;if(oe||te)return!0}if(Y.getBoundingClientRect){var fe=Y.getBoundingClientRect(),ce=fe.width,ve=fe.height;if(ce||ve)return!0}}return!1};function er(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(St(Y)){var oe=Y.nodeName.toLowerCase(),te=["input","select","textarea","button"].includes(oe)||Y.isContentEditable||oe==="a"&&!!Y.getAttribute("href"),fe=Y.getAttribute("tabindex"),ce=Number(fe),ve=null;return fe&&!Number.isNaN(ce)?ve=ce:te&&ve===null&&(ve=0),te&&Y.disabled&&(ve=null),ve!==null&&(ve>=0||re&&ve<0)}return!1}function Ne(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=(0,N.Z)(Y.querySelectorAll("*")).filter(function(te){return er(te,re)});return er(Y,re)&&oe.unshift(Y),oe}var Fe=null;function We(){Fe=document.activeElement}function Be(){Fe=null}function _e(){if(Fe)try{Fe.focus()}catch(Y){}}function ht(Y,re){if(re.keyCode===9){var oe=Ne(Y),te=oe[re.shiftKey?0:oe.length-1],fe=te===document.activeElement||Y===document.activeElement;if(fe){var ce=oe[re.shiftKey?oe.length-1:0];ce.focus(),re.preventDefault()}}}var Ze=K(15105),At=K(75164),yt=Ze.Z.LEFT,tt=Ze.Z.RIGHT,bt=Ze.Z.UP,Ye=Ze.Z.DOWN,je=Ze.Z.ENTER,it=Ze.Z.ESC,Vt=Ze.Z.HOME,tr=Ze.Z.END,or=[bt,Ye,yt,tt];function Dr(Y,re,oe,te){var fe,ce="prev",ve="next",Pe="children",Qe="parent";if(Y==="inline"&&te===je)return{inlineTrigger:!0};var Ge=(0,J.Z)((0,J.Z)({},bt,ce),Ye,ve),vt=(0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)({},yt,oe?ve:ce),tt,oe?ce:ve),Ye,Pe),je,Pe),lt=(0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)({},bt,ce),Ye,ve),je,Pe),it,Qe),yt,oe?Pe:Qe),tt,oe?Qe:Pe),Et={inline:Ge,horizontal:vt,vertical:lt,inlineSub:Ge,horizontalSub:lt,verticalSub:lt},wt=(fe=Et["".concat(Y).concat(re?"":"Sub")])===null||fe===void 0?void 0:fe[te];switch(wt){case ce:return{offset:-1,sibling:!0};case ve:return{offset:1,sibling:!0};case Qe:return{offset:-1,sibling:!1};case Pe:return{offset:1,sibling:!1};default:return null}}function Yr(Y){for(var re=Y;re;){if(re.getAttribute("data-menu-list"))return re;re=re.parentElement}return null}function ur(Y,re){for(var oe=Y||document.activeElement;oe;){if(re.has(oe))return oe;oe=oe.parentElement}return null}function qr(Y,re){var oe=Ne(Y,!0);return oe.filter(function(te){return re.has(te)})}function cr(Y,re,oe){var te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Y)return null;var fe=qr(Y,re),ce=fe.length,ve=fe.findIndex(function(Pe){return oe===Pe});return te<0?ve===-1?ve=ce-1:ve-=1:te>0&&(ve+=1),ve=(ve+ce)%ce,fe[ve]}var Hr=function(re,oe){var te=new Set,fe=new Map,ce=new Map;return re.forEach(function(ve){var Pe=document.querySelector("[data-menu-id='".concat(Ee(oe,ve),"']"));Pe&&(te.add(Pe),ce.set(Pe,ve),fe.set(ve,Pe))}),{elements:te,key2element:fe,element2key:ce}};function mn(Y,re,oe,te,fe,ce,ve,Pe,Qe,Ge){var vt=e.useRef(),lt=e.useRef();lt.current=re;var Et=function(){At.Z.cancel(vt.current)};return e.useEffect(function(){return function(){Et()}},[]),function(wt){var gt=wt.which;if([].concat(or,[je,it,Vt,tr]).includes(gt)){var rt=ce(),ot=Hr(rt,te),U=ot,W=U.elements,B=U.key2element,X=U.element2key,ae=B.get(re),me=ur(ae,W),Te=X.get(me),Me=Dr(Y,ve(Te,!0).length===1,oe,gt);if(!Me&>!==Vt&>!==tr)return;(or.includes(gt)||[Vt,tr].includes(gt))&&wt.preventDefault();var Ie=function(Dt){if(Dt){var Bt=Dt,Nt=Dt.querySelector("a");Nt!=null&&Nt.getAttribute("href")&&(Bt=Nt);var Mt=X.get(Dt);Pe(Mt),Et(),vt.current=(0,At.Z)(function(){lt.current===Mt&&Bt.focus()})}};if([Vt,tr].includes(gt)||Me.sibling||!me){var ke;!me||Y==="inline"?ke=fe.current:ke=Yr(me);var at,st=qr(ke,W);gt===Vt?at=st[0]:gt===tr?at=st[st.length-1]:at=cr(ke,W,me,Me.offset),Ie(at)}else if(Me.inlineTrigger)Qe(Te);else if(Me.offset>0)Qe(Te,!0),Et(),vt.current=(0,At.Z)(function(){ot=Hr(rt,te);var kt=me.getAttribute("aria-controls"),Dt=document.getElementById(kt),Bt=cr(Dt,ot.elements);Ie(Bt)},5);else if(Me.offset<0){var dt=ve(Te,!0),nt=dt[dt.length-2],mt=B.get(nt);Qe(nt,!1),Ie(mt)}}Ge==null||Ge(wt)}}function En(Y){Promise.resolve().then(Y)}var Tn="__RC_UTIL_PATH_SPLIT__",Cr=function(re){return re.join(Tn)},Ke=function(re){return re.split(Tn)},Kr="rc-menu-more";function _n(){var Y=e.useState({}),re=(0,L.Z)(Y,2),oe=re[1],te=(0,e.useRef)(new Map),fe=(0,e.useRef)(new Map),ce=e.useState([]),ve=(0,L.Z)(ce,2),Pe=ve[0],Qe=ve[1],Ge=(0,e.useRef)(0),vt=(0,e.useRef)(!1),lt=function(){vt.current||oe({})},Et=(0,e.useCallback)(function(B,X){var ae=Cr(X);fe.current.set(ae,B),te.current.set(B,ae),Ge.current+=1;var me=Ge.current;En(function(){me===Ge.current&<()})},[]),wt=(0,e.useCallback)(function(B,X){var ae=Cr(X);fe.current.delete(ae),te.current.delete(B)},[]),gt=(0,e.useCallback)(function(B){Qe(B)},[]),rt=(0,e.useCallback)(function(B,X){var ae=te.current.get(B)||"",me=Ke(ae);return X&&Pe.includes(me[0])&&me.unshift(Kr),me},[Pe]),ot=(0,e.useCallback)(function(B,X){return B.filter(function(ae){return ae!==void 0}).some(function(ae){var me=rt(ae,!0);return me.includes(X)})},[rt]),U=function(){var X=(0,N.Z)(te.current.keys());return Pe.length&&X.push(Kr),X},W=(0,e.useCallback)(function(B){var X="".concat(te.current.get(B)).concat(Tn),ae=new Set;return(0,N.Z)(fe.current.keys()).forEach(function(me){me.startsWith(X)&&ae.add(fe.current.get(me))}),ae},[]);return e.useEffect(function(){return function(){vt.current=!0}},[]),{registerPath:Et,unregisterPath:wt,refreshOverflowKeys:gt,isSubPathKey:ot,getKeyPath:rt,getKeys:U,getSubPathKeys:W}}function Vr(Y){var re=e.useRef(Y);re.current=Y;var oe=e.useCallback(function(){for(var te,fe=arguments.length,ce=new Array(fe),ve=0;ve1&&(W.motionAppear=!1);var B=W.onVisibleChanged;return W.onVisibleChanged=function(X){return!Et.current&&!X&&ot(!0),B==null?void 0:B(X)},rt?null:e.createElement(z,{mode:ce,locked:!Et.current},e.createElement(ue.Z,(0,Z.Z)({visible:U},W,{forceRender:Qe,removeOnLeave:!1,leavedClassName:"".concat(Pe,"-hidden")}),function(X){var ae=X.className,me=X.style;return e.createElement(kr,{id:re,className:ae,style:me},fe)}))}var Se=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],De=["active"],Le=e.forwardRef(function(Y,re){var oe=Y.style,te=Y.className,fe=Y.title,ce=Y.eventKey,ve=Y.warnKey,Pe=Y.disabled,Qe=Y.internalPopupClose,Ge=Y.children,vt=Y.itemIcon,lt=Y.expandIcon,Et=Y.popupClassName,wt=Y.popupOffset,gt=Y.popupStyle,rt=Y.onClick,ot=Y.onMouseEnter,U=Y.onMouseLeave,W=Y.onTitleClick,B=Y.onTitleMouseEnter,X=Y.onTitleMouseLeave,ae=(0,C.Z)(Y,Se),me=he(ce),Te=e.useContext(Ue),Me=Te.prefixCls,Ie=Te.mode,ke=Te.openKeys,at=Te.disabled,st=Te.overflowDisabled,dt=Te.activeKey,nt=Te.selectedKeys,mt=Te.itemIcon,kt=Te.expandIcon,Dt=Te.onItemClick,Bt=Te.onOpenChange,Nt=Te.onActive,Mt=e.useContext(pt),Qt=Mt._internalRenderSubMenuItem,Ot=e.useContext(xt),ft=Ot.isSubPathKey,Xt=Ve(),Ht="".concat(Me,"-submenu"),nr=at||Pe,Fr=e.useRef(),br=e.useRef(),Tr=vt!=null?vt:mt,$t=lt!=null?lt:kt,dr=ke.includes(ce),vr=!st&&dr,Rr=ft(nt,ce),tn=ui(ce,nr,B,X),ir=tn.active,xr=(0,C.Z)(tn,De),Wt=e.useState(!1),Qr=(0,L.Z)(Wt,2),Xr=Qr[0],pr=Qr[1],Ft=function(Or){nr||pr(Or)},Lr=function(Or){Ft(!0),ot==null||ot({key:ce,domEvent:Or})},hn=function(Or){Ft(!1),U==null||U({key:ce,domEvent:Or})},dn=e.useMemo(function(){return ir||(Ie!=="inline"?Xr||ft([dt],ce):!1)},[Ie,ir,dt,Xr,ce,ft]),Sr=on(Xt.length),ar=function(Or){nr||(W==null||W({key:ce,domEvent:Or}),Ie==="inline"&&Bt(ce,!dr))},Pr=Vr(function(Jt){rt==null||rt(Gn(Jt)),Dt(Jt)}),$r=function(Or){Ie!=="inline"&&Bt(ce,Or)},gr=function(){Nt(ce)},Ir=me&&"".concat(me,"-popup"),Ar=e.useMemo(function(){return e.createElement(li,{icon:Ie!=="horizontal"?$t:void 0,props:(0,V.Z)((0,V.Z)({},Y),{},{isOpen:vr,isSubMenu:!0})},e.createElement("i",{className:"".concat(Ht,"-arrow")}))},[Ie,$t,Y,vr,Ht]),mr=e.createElement("div",(0,Z.Z)({role:"menuitem",style:Sr,className:"".concat(Ht,"-title"),tabIndex:nr?null:-1,ref:Fr,title:typeof fe=="string"?fe:null,"data-menu-id":st&&me?null:me,"aria-expanded":vr,"aria-haspopup":!0,"aria-controls":Ir,"aria-disabled":nr,onClick:ar,onFocus:gr},xr),fe,Ar),jr=e.useRef(Ie);if(Ie!=="inline"&&Xt.length>1?jr.current="vertical":jr.current=Ie,!st){var un=jr.current;mr=e.createElement(q,{mode:un,prefixCls:Ht,visible:!Qe&&vr&&Ie!=="inline",popupClassName:Et,popupOffset:wt,popupStyle:gt,popup:e.createElement(z,{mode:un==="horizontal"?"vertical":un},e.createElement(kr,{id:Ir,ref:br},Ge)),disabled:nr,onVisibleChange:$r},mr)}var Ur=e.createElement(ie.Item,(0,Z.Z)({ref:re,role:"none"},ae,{component:"li",style:oe,className:M()(Ht,"".concat(Ht,"-").concat(Ie),te,(0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)({},"".concat(Ht,"-open"),vr),"".concat(Ht,"-active"),dn),"".concat(Ht,"-selected"),Rr),"".concat(Ht,"-disabled"),nr)),onMouseEnter:Lr,onMouseLeave:hn}),mr,!st&&e.createElement(pe,{id:Ir,open:vr,keyPath:Xt},Ge));return Qt&&(Ur=Qt(Ur,Y,{selected:Rr,active:dn,open:vr,disabled:nr})),e.createElement(z,{onItemClick:Pr,mode:Ie==="horizontal"?"vertical":Ie,itemIcon:Tr,expandIcon:$t},Ur)}),Oe=e.forwardRef(function(Y,re){var oe=Y.eventKey,te=Y.children,fe=Ve(oe),ce=ki(te,fe),ve=ge();e.useEffect(function(){if(ve)return ve.registerPath(oe,fe),function(){ve.unregisterPath(oe,fe)}},[fe]);var Pe;return ve?Pe=ce:Pe=e.createElement(Le,(0,Z.Z)({ref:re},Y),ce),e.createElement(Ae.Provider,{value:fe},Pe)}),ze=Oe,ut=K(71002);function _t(Y){var re=Y.className,oe=Y.style,te=e.useContext(Ue),fe=te.prefixCls,ce=ge();return ce?null:e.createElement("li",{role:"separator",className:M()("".concat(fe,"-item-divider"),re),style:oe})}var qe=["className","title","eventKey","children"],Rt=e.forwardRef(function(Y,re){var oe=Y.className,te=Y.title,fe=Y.eventKey,ce=Y.children,ve=(0,C.Z)(Y,qe),Pe=e.useContext(Ue),Qe=Pe.prefixCls,Ge="".concat(Qe,"-item-group");return e.createElement("li",(0,Z.Z)({ref:re,role:"presentation"},ve,{onClick:function(lt){return lt.stopPropagation()},className:M()(Ge,oe)}),e.createElement("div",{role:"presentation",className:"".concat(Ge,"-title"),title:typeof te=="string"?te:void 0},te),e.createElement("ul",{role:"group",className:"".concat(Ge,"-list")},ce))}),jt=e.forwardRef(function(Y,re){var oe=Y.eventKey,te=Y.children,fe=Ve(oe),ce=ki(te,fe),ve=ge();return ve?ce:e.createElement(Rt,(0,Z.Z)({ref:re},(0,Mn.Z)(Y,["warnKey"])),ce)}),Yt=jt,Kt=["label","children","key","type","extra"];function rr(Y,re,oe){var te=re.item,fe=re.group,ce=re.submenu,ve=re.divider;return(Y||[]).map(function(Pe,Qe){if(Pe&&(0,ut.Z)(Pe)==="object"){var Ge=Pe,vt=Ge.label,lt=Ge.children,Et=Ge.key,wt=Ge.type,gt=Ge.extra,rt=(0,C.Z)(Ge,Kt),ot=Et!=null?Et:"tmp-".concat(Qe);return lt||wt==="group"?wt==="group"?e.createElement(fe,(0,Z.Z)({key:ot},rt,{title:vt}),rr(lt,re,oe)):e.createElement(ce,(0,Z.Z)({key:ot},rt,{title:vt}),rr(lt,re,oe)):wt==="divider"?e.createElement(ve,(0,Z.Z)({key:ot},rt)):e.createElement(te,(0,Z.Z)({key:ot},rt,{extra:gt}),vt,(!!gt||gt===0)&&e.createElement("span",{className:"".concat(oe,"-item-extra")},gt))}return null}).filter(function(Pe){return Pe})}function Pt(Y,re,oe,te,fe){var ce=Y,ve=(0,V.Z)({divider:_t,item:wn,group:Yt,submenu:ze},te);return re&&(ce=rr(re,ve,fe)),ki(ce,oe)}var It=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Lt=[],Zt=e.forwardRef(function(Y,re){var oe,te=Y,fe=te.prefixCls,ce=fe===void 0?"rc-menu":fe,ve=te.rootClassName,Pe=te.style,Qe=te.className,Ge=te.tabIndex,vt=Ge===void 0?0:Ge,lt=te.items,Et=te.children,wt=te.direction,gt=te.id,rt=te.mode,ot=rt===void 0?"vertical":rt,U=te.inlineCollapsed,W=te.disabled,B=te.disabledOverflow,X=te.subMenuOpenDelay,ae=X===void 0?.1:X,me=te.subMenuCloseDelay,Te=me===void 0?.1:me,Me=te.forceSubMenuRender,Ie=te.defaultOpenKeys,ke=te.openKeys,at=te.activeKey,st=te.defaultActiveFirst,dt=te.selectable,nt=dt===void 0?!0:dt,mt=te.multiple,kt=mt===void 0?!1:mt,Dt=te.defaultSelectedKeys,Bt=te.selectedKeys,Nt=te.onSelect,Mt=te.onDeselect,Qt=te.inlineIndent,Ot=Qt===void 0?24:Qt,ft=te.motion,Xt=te.defaultMotions,Ht=te.triggerSubMenuAction,nr=Ht===void 0?"hover":Ht,Fr=te.builtinPlacements,br=te.itemIcon,Tr=te.expandIcon,$t=te.overflowedIndicator,dr=$t===void 0?"...":$t,vr=te.overflowedIndicatorPopupClassName,Rr=te.getPopupContainer,tn=te.onClick,ir=te.onOpenChange,xr=te.onKeyDown,Wt=te.openAnimation,Qr=te.openTransitionName,Xr=te._internalRenderMenuItem,pr=te._internalRenderSubMenuItem,Ft=te._internalComponents,Lr=(0,C.Z)(te,It),hn=e.useMemo(function(){return[Pt(Et,lt,Lt,Ft,ce),Pt(Et,lt,Lt,{},ce)]},[Et,lt,Ft]),dn=(0,L.Z)(hn,2),Sr=dn[0],ar=dn[1],Pr=e.useState(!1),$r=(0,L.Z)(Pr,2),gr=$r[0],Ir=$r[1],Ar=e.useRef(),mr=In(gt),jr=wt==="rtl",un=(0,se.Z)(Ie,{value:ke,postState:function(qt){return qt||Lt}}),Ur=(0,L.Z)(un,2),Jt=Ur[0],Or=Ur[1],Mr=function(qt){var sr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Jr(){Or(qt),ir==null||ir(qt)}sr?(0,s.flushSync)(Jr):Jr()},Xn=e.useState(Jt),zt=(0,L.Z)(Xn,2),ln=zt[0],bn=zt[1],_r=e.useRef(!1),yn=e.useMemo(function(){return(ot==="inline"||ot==="vertical")&&U?["vertical",U]:[ot,!1]},[ot,U]),rn=(0,L.Z)(yn,2),Ct=rn[0],we=rn[1],et=Ct==="inline",ct=e.useState(Ct),Gt=(0,L.Z)(ct,2),Ut=Gt[0],Fn=Gt[1],Zr=e.useState(we),nn=(0,L.Z)(Zr,2),vn=nn[0],Ei=nn[1];e.useEffect(function(){Fn(Ct),Ei(we),_r.current&&(et?Or(ln):Mr(Lt))},[Ct,we]);var ci=e.useState(0),hi=(0,L.Z)(ci,2),$n=hi[0],Un=hi[1],pn=$n>=Sr.length-1||Ut!=="horizontal"||B;e.useEffect(function(){et&&bn(Jt)},[Jt]),e.useEffect(function(){return _r.current=!0,function(){_r.current=!1}},[]);var Dn=_n(),fn=Dn.registerPath,jn=Dn.unregisterPath,lr=Dn.refreshOverflowKeys,fr=Dn.isSubPathKey,Rn=Dn.getKeyPath,Jn=Dn.getKeys,bi=Dn.getSubPathKeys,Sn=e.useMemo(function(){return{registerPath:fn,unregisterPath:jn}},[fn,jn]),Pi=e.useMemo(function(){return{isSubPathKey:fr}},[fr]);e.useEffect(function(){lr(pn?Lt:Sr.slice($n+1).map(function(wr){return wr.key}))},[$n,pn]);var Ti=(0,se.Z)(at||st&&((oe=Sr[0])===null||oe===void 0?void 0:oe.key),{value:at}),Hn=(0,L.Z)(Ti,2),qn=Hn[0],xi=Hn[1],Si=Vr(function(wr){xi(wr)}),di=Vr(function(){xi(void 0)});(0,e.useImperativeHandle)(re,function(){return{list:Ar.current,focus:function(qt){var sr,Jr=Jn(),cn=Hr(Jr,mr),Zn=cn.elements,Ln=cn.key2element,Mi=cn.element2key,Di=qr(Ar.current,Zn),Pn=qn!=null?qn:Di[0]?Mi.get(Di[0]):(sr=Sr.find(function(pi){return!pi.props.disabled}))===null||sr===void 0?void 0:sr.key,gn=Ln.get(Pn);if(Pn&&gn){var ti;gn==null||(ti=gn.focus)===null||ti===void 0||ti.call(gn,qt)}}}});var Ai=(0,se.Z)(Dt||[],{value:Bt,postState:function(qt){return Array.isArray(qt)?qt:qt==null?Lt:[qt]}}),ei=(0,L.Z)(Ai,2),Bn=ei[0],Vn=ei[1],vi=function(qt){if(nt){var sr=qt.key,Jr=Bn.includes(sr),cn;kt?Jr?cn=Bn.filter(function(Ln){return Ln!==sr}):cn=[].concat((0,N.Z)(Bn),[sr]):cn=[sr],Vn(cn);var Zn=(0,V.Z)((0,V.Z)({},qt),{},{selectedKeys:cn});Jr?Mt==null||Mt(Zn):Nt==null||Nt(Zn)}!kt&&Jt.length&&Ut!=="inline"&&Mr(Lt)},ai=Vr(function(wr){tn==null||tn(Gn(wr)),vi(wr)}),wi=Vr(function(wr,qt){var sr=Jt.filter(function(cn){return cn!==wr});if(qt)sr.push(wr);else if(Ut!=="inline"){var Jr=bi(wr);sr=sr.filter(function(cn){return!Jr.has(cn)})}(0,le.Z)(Jt,sr,!0)||Mr(sr,!0)}),an=function(qt,sr){var Jr=sr!=null?sr:!Jt.includes(qt);wi(qt,Jr)},Ii=mn(Ut,qn,jr,mr,Ar,Jn,Rn,xi,an,xr);e.useEffect(function(){Ir(!0)},[]);var Ui=e.useMemo(function(){return{_internalRenderMenuItem:Xr,_internalRenderSubMenuItem:pr}},[Xr,pr]),si=Ut!=="horizontal"||B?Sr:Sr.map(function(wr,qt){return e.createElement(z,{key:wr.key,overflowDisabled:qt>$n},wr)}),Oi=e.createElement(ie,(0,Z.Z)({id:gt,ref:Ar,prefixCls:"".concat(ce,"-overflow"),component:"ul",itemComponent:wn,className:M()(ce,"".concat(ce,"-root"),"".concat(ce,"-").concat(Ut),Qe,(0,J.Z)((0,J.Z)({},"".concat(ce,"-inline-collapsed"),vn),"".concat(ce,"-rtl"),jr),ve),dir:wt,style:Pe,role:"menu",tabIndex:vt,data:si,renderRawItem:function(qt){return qt},renderRawRest:function(qt){var sr=qt.length,Jr=sr?Sr.slice(-sr):null;return e.createElement(ze,{eventKey:Kr,title:dr,disabled:pn,internalPopupClose:sr===0,popupClassName:vr},Jr)},maxCount:Ut!=="horizontal"||B?ie.INVALIDATE:ie.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(qt){Un(qt)},onKeyDown:Ii},Lr));return e.createElement(pt.Provider,{value:Ui},e.createElement(Re.Provider,{value:mr},e.createElement(z,{prefixCls:ce,rootClassName:ve,mode:Ut,openKeys:Jt,rtl:jr,disabled:W,motion:gr?ft:null,defaultMotions:gr?Xt:null,activeKey:qn,onActive:Si,onInactive:di,selectedKeys:Bn,inlineIndent:Ot,subMenuOpenDelay:ae,subMenuCloseDelay:Te,forceSubMenuRender:Me,builtinPlacements:Fr,triggerSubMenuAction:nr,getPopupContainer:Rr,itemIcon:br,expandIcon:Tr,onItemClick:ai,onOpenChange:wi},e.createElement(xt.Provider,{value:Pi},Oi),e.createElement("div",{style:{display:"none"},"aria-hidden":!0},e.createElement(de.Provider,{value:Sn},ar)))))}),Nr=Zt,Er=Nr;Er.Item=wn,Er.SubMenu=ze,Er.ItemGroup=Yt,Er.Divider=_t;var Gr=Er},62874:function(He,ye,K){"use strict";K.d(ye,{Z:function(){return er}});var Z=K(4942),J=K(1413),V=K(97685),N=K(71002),L=K(67294),C=K(34203),P=K(42550),M=K(94184),e=K.n(M),I=K(98924);function A(Ne,Fe){var We={};return We[Ne.toLowerCase()]=Fe.toLowerCase(),We["Webkit".concat(Ne)]="webkit".concat(Fe),We["Moz".concat(Ne)]="moz".concat(Fe),We["ms".concat(Ne)]="MS".concat(Fe),We["O".concat(Ne)]="o".concat(Fe.toLowerCase()),We}function f(Ne,Fe){var We={animationend:A("Animation","AnimationEnd"),transitionend:A("Transition","TransitionEnd")};return Ne&&("AnimationEvent"in Fe||delete We.animationend.animation,"TransitionEvent"in Fe||delete We.transitionend.transition),We}var g=f((0,I.Z)(),typeof window!="undefined"?window:{}),h={};if((0,I.Z)()){var p=document.createElement("div");h=p.style}var u={};function v(Ne){if(u[Ne])return u[Ne];var Fe=g[Ne];if(Fe)for(var We=Object.keys(Fe),Be=We.length,_e=0;_e1&&arguments[1]!==void 0?arguments[1]:2;Fe();var ht=(0,x.Z)(function(){_e<=1?Be({isCanceled:function(){return ht!==Ne.current}}):We(Be,_e-1)});Ne.current=ht}return L.useEffect(function(){return function(){Fe()}},[]),[We,Fe]},c=(0,I.Z)()?L.useLayoutEffect:L.useEffect,_=c,D=[w,r,n,t],O=!1,k=!0;function F(Ne){return Ne===n||Ne===t}var G=function(Ne,Fe){var We=(0,l.Z)(S),Be=(0,V.Z)(We,2),_e=Be[0],ht=Be[1],Ze=y(),At=(0,V.Z)(Ze,2),yt=At[0],tt=At[1];function bt(){ht(w,!0)}return _(function(){if(_e!==S&&_e!==t){var Ye=D.indexOf(_e),je=D[Ye+1],it=Fe(_e);it===O?ht(je,!0):yt(function(Vt){function tr(){Vt.isCanceled()||ht(je,!0)}it===!0?tr():Promise.resolve(it).then(tr)})}},[Ne,_e]),L.useEffect(function(){return function(){tt()}},[]),[bt,_e]},H=function(Ne){var Fe=(0,L.useRef)(),We=(0,L.useRef)(Ne);We.current=Ne;var Be=L.useCallback(function(Ze){We.current(Ze)},[]);function _e(Ze){Ze&&(Ze.removeEventListener(s,Be),Ze.removeEventListener(i,Be))}function ht(Ze){Fe.current&&Fe.current!==Ze&&_e(Fe.current),Ze&&Ze!==Fe.current&&(Ze.addEventListener(s,Be),Ze.addEventListener(i,Be),Fe.current=Ze)}return L.useEffect(function(){return function(){_e(Fe.current)}},[]),[ht,_e]};function j(Ne,Fe,We,Be){var _e=Be.motionEnter,ht=_e===void 0?!0:_e,Ze=Be.motionAppear,At=Ze===void 0?!0:Ze,yt=Be.motionLeave,tt=yt===void 0?!0:yt,bt=Be.motionDeadline,Ye=Be.motionLeaveImmediately,je=Be.onAppearPrepare,it=Be.onEnterPrepare,Vt=Be.onLeavePrepare,tr=Be.onAppearStart,or=Be.onEnterStart,Dr=Be.onLeaveStart,Yr=Be.onAppearActive,ur=Be.onEnterActive,qr=Be.onLeaveActive,cr=Be.onAppearEnd,Hr=Be.onEnterEnd,mn=Be.onLeaveEnd,En=Be.onVisibleChanged,Tn=(0,l.Z)(),Cr=(0,V.Z)(Tn,2),Ke=Cr[0],Kr=Cr[1],_n=(0,l.Z)(b),Vr=(0,V.Z)(_n,2),Wr=Vr[0],xn=Vr[1],In=(0,l.Z)(null),On=(0,V.Z)(In,2),Wn=On[0],oi=On[1],zn=(0,L.useRef)(!1),Mn=(0,L.useRef)(null);function Cn(){return We()}var ui=(0,L.useRef)(!1);function on(yr){var hr=Cn();if(!(yr&&!yr.deadline&&yr.target!==hr)){var kr=ui.current,Nn;Wr===d&&kr?Nn=cr==null?void 0:cr(hr,yr):Wr===T&&kr?Nn=Hr==null?void 0:Hr(hr,yr):Wr===R&&kr&&(Nn=mn==null?void 0:mn(hr,yr)),Wr!==b&&kr&&Nn!==!1&&(xn(b,!0),oi(null,!0))}}var li=H(on),Yn=(0,V.Z)(li,1),Gn=Yn[0],An=L.useMemo(function(){var yr,hr,kr;switch(Wr){case d:return yr={},(0,Z.Z)(yr,w,je),(0,Z.Z)(yr,r,tr),(0,Z.Z)(yr,n,Yr),yr;case T:return hr={},(0,Z.Z)(hr,w,it),(0,Z.Z)(hr,r,or),(0,Z.Z)(hr,n,ur),hr;case R:return kr={},(0,Z.Z)(kr,w,Vt),(0,Z.Z)(kr,r,Dr),(0,Z.Z)(kr,n,qr),kr;default:return{}}},[Wr]),_i=G(Wr,function(yr){if(yr===w){var hr=An[w];return hr?hr(Cn()):O}if(kn in An){var kr;oi(((kr=An[kn])===null||kr===void 0?void 0:kr.call(An,Cn(),null))||null)}return kn===n&&(Gn(Cn()),bt>0&&(clearTimeout(Mn.current),Mn.current=setTimeout(function(){on({deadline:!0})},bt))),k}),fi=(0,V.Z)(_i,2),ii=fi[0],kn=fi[1],yi=F(kn);ui.current=yi,_(function(){Kr(Fe);var yr=zn.current;if(zn.current=!0,!!Ne){var hr;!yr&&Fe&&At&&(hr=d),yr&&Fe&&ht&&(hr=T),(yr&&!Fe&&tt||!yr&&Ye&&!Fe&&tt)&&(hr=R),hr&&(xn(hr),ii())}},[Fe]),(0,L.useEffect)(function(){(Wr===d&&!At||Wr===T&&!ht||Wr===R&&!tt)&&xn(b)},[At,ht,tt]),(0,L.useEffect)(function(){return function(){zn.current=!1,clearTimeout(Mn.current)}},[]);var wn=L.useRef(!1);(0,L.useEffect)(function(){Ke&&(wn.current=!0),Ke!==void 0&&Wr===b&&((wn.current||Ke)&&(En==null||En(Ke)),wn.current=!0)},[Ke,Wr]);var Qn=Wn;return An[w]&&kn===r&&(Qn=(0,J.Z)({transition:"none"},Qn)),[Wr,kn,Qn,Ke!=null?Ke:Fe]}var Q=K(15671),ee=K(43144),ie=K(60136),se=K(29388),le=function(Ne){(0,ie.Z)(We,Ne);var Fe=(0,se.Z)(We);function We(){return(0,Q.Z)(this,We),Fe.apply(this,arguments)}return(0,ee.Z)(We,[{key:"render",value:function(){return this.props.children}}]),We}(L.Component),xe=le;function Re(Ne){var Fe=Ne;(0,N.Z)(Ne)==="object"&&(Fe=Ne.transitionSupport);function We(_e){return!!(_e.motionName&&Fe)}var Be=L.forwardRef(function(_e,ht){var Ze=_e.visible,At=Ze===void 0?!0:Ze,yt=_e.removeOnLeave,tt=yt===void 0?!0:yt,bt=_e.forceRender,Ye=_e.children,je=_e.motionName,it=_e.leavedClassName,Vt=_e.eventProps,tr=We(_e),or=(0,L.useRef)(),Dr=(0,L.useRef)();function Yr(){try{return or.current instanceof HTMLElement?or.current:(0,C.Z)(Dr.current)}catch(In){return null}}var ur=j(tr,At,Yr,_e),qr=(0,V.Z)(ur,4),cr=qr[0],Hr=qr[1],mn=qr[2],En=qr[3],Tn=L.useRef(En);En&&(Tn.current=!0);var Cr=L.useCallback(function(In){or.current=In,(0,P.mH)(ht,In)},[ht]),Ke,Kr=(0,J.Z)((0,J.Z)({},Vt),{},{visible:At});if(!Ye)Ke=null;else if(cr===b||!We(_e))En?Ke=Ye((0,J.Z)({},Kr),Cr):!tt&&Tn.current&&it?Ke=Ye((0,J.Z)((0,J.Z)({},Kr),{},{className:it}),Cr):bt||!tt&&!it?Ke=Ye((0,J.Z)((0,J.Z)({},Kr),{},{style:{display:"none"}}),Cr):Ke=null;else{var _n,Vr;Hr===w?Vr="prepare":F(Hr)?Vr="active":Hr===r&&(Vr="start"),Ke=Ye((0,J.Z)((0,J.Z)({},Kr),{},{className:e()(E(je,cr),(_n={},(0,Z.Z)(_n,E(je,"".concat(cr,"-").concat(Vr)),Vr),(0,Z.Z)(_n,je,typeof je=="string"),_n)),style:mn}),Cr)}if(L.isValidElement(Ke)&&(0,P.Yr)(Ke)){var Wr=Ke,xn=Wr.ref;xn||(Ke=L.cloneElement(Ke,{ref:Cr}))}return L.createElement(xe,{ref:Dr},Ke)});return Be.displayName="CSSMotion",Be}var Ee=Re(a),he=K(87462),be=K(45987),Ce=K(97326),Ue="add",$e="keep",z="remove",ne="removed";function de(Ne){var Fe;return Ne&&(0,N.Z)(Ne)==="object"&&"key"in Ne?Fe=Ne:Fe={key:Ne},(0,J.Z)((0,J.Z)({},Fe),{},{key:String(Fe.key)})}function ge(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ne.map(de)}function Ae(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],We=[],Be=0,_e=Fe.length,ht=ge(Ne),Ze=ge(Fe);ht.forEach(function(tt){for(var bt=!1,Ye=Be;Ye<_e;Ye+=1){var je=Ze[Ye];if(je.key===tt.key){Be1});return yt.forEach(function(tt){We=We.filter(function(bt){var Ye=bt.key,je=bt.status;return Ye!==tt||je!==z}),We.forEach(function(bt){bt.key===tt&&(bt.status=$e)})}),We}var Ve=["component","children","onVisibleChanged","onAllRemoved"],xt=["status"],Je=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function pt(Ne){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee,We=function(Be){(0,ie.Z)(ht,Be);var _e=(0,se.Z)(ht);function ht(){var Ze;(0,Q.Z)(this,ht);for(var At=arguments.length,yt=new Array(At),tt=0;tt1&&arguments[1]!==void 0?arguments[1]:1;n+=1;var pe=n;function Se(De){if(De===0)l(pe),q();else{var Le=w(function(){Se(De-1)});t.set(pe,Le)}}return Se(ue),pe};x.cancel=function($){var q=t.get($);return l(q),r(q)};var y=x,c=function(q){var ue=q.activeTabOffset,pe=q.horizontal,Se=q.rtl,De=q.indicator,Le=De===void 0?{}:De,Oe=Le.size,ze=Le.align,ut=ze===void 0?"center":ze,_t=(0,e.useState)(),qe=(0,N.Z)(_t,2),Rt=qe[0],jt=qe[1],Yt=(0,e.useRef)(),Kt=e.useCallback(function(Pt){return typeof Oe=="function"?Oe(Pt):typeof Oe=="number"?Oe:Pt},[Oe]);function rr(){y.cancel(Yt.current)}return(0,e.useEffect)(function(){var Pt={};if(ue)if(pe){Pt.width=Kt(ue.width);var It=Se?"right":"left";ut==="start"&&(Pt[It]=ue[It]),ut==="center"&&(Pt[It]=ue[It]+ue.width/2,Pt.transform=Se?"translateX(50%)":"translateX(-50%)"),ut==="end"&&(Pt[It]=ue[It]+ue.width,Pt.transform="translateX(-100%)")}else Pt.height=Kt(ue.height),ut==="start"&&(Pt.top=ue.top),ut==="center"&&(Pt.top=ue.top+ue.height/2,Pt.transform="translateY(-50%)"),ut==="end"&&(Pt.top=ue.top+ue.height,Pt.transform="translateY(-100%)");return rr(),Yt.current=y(function(){jt(Pt)}),rr},[ue,pe,Se,ut,Kt]),{style:Rt}},_=c,D={width:0,height:0,left:0,top:0};function O($,q,ue){return(0,e.useMemo)(function(){for(var pe,Se=new Map,De=q.get((pe=$[0])===null||pe===void 0?void 0:pe.key)||D,Le=De.left+De.width,Oe=0;Oe<$.length;Oe+=1){var ze=$[Oe].key,ut=q.get(ze);if(!ut){var _t;ut=q.get((_t=$[Oe-1])===null||_t===void 0?void 0:_t.key)||D}var qe=Se.get(ze)||(0,V.Z)({},ut);qe.right=Le-qe.left-qe.width,Se.set(ze,qe)}return Se},[$.map(function(pe){return pe.key}).join("_"),q,ue])}function k($,q){var ue=e.useRef($),pe=e.useState({}),Se=(0,N.Z)(pe,2),De=Se[1];function Le(Oe){var ze=typeof Oe=="function"?Oe(ue.current):Oe;ze!==ue.current&&q(ze,ue.current),ue.current=ze,De({})}return[ue.current,Le]}var F=.1,G=.01,H=20,j=Math.pow(.995,H);function Q($,q){var ue=(0,e.useState)(),pe=(0,N.Z)(ue,2),Se=pe[0],De=pe[1],Le=(0,e.useState)(0),Oe=(0,N.Z)(Le,2),ze=Oe[0],ut=Oe[1],_t=(0,e.useState)(0),qe=(0,N.Z)(_t,2),Rt=qe[0],jt=qe[1],Yt=(0,e.useState)(),Kt=(0,N.Z)(Yt,2),rr=Kt[0],Pt=Kt[1],It=(0,e.useRef)();function Lt(re){var oe=re.touches[0],te=oe.screenX,fe=oe.screenY;De({x:te,y:fe}),window.clearInterval(It.current)}function Zt(re){if(Se){var oe=re.touches[0],te=oe.screenX,fe=oe.screenY;De({x:te,y:fe});var ce=te-Se.x,ve=fe-Se.y;q(ce,ve);var Pe=Date.now();ut(Pe),jt(Pe-ze),Pt({x:ce,y:ve})}}function Nr(){if(Se&&(De(null),Pt(null),rr)){var re=rr.x/Rt,oe=rr.y/Rt,te=Math.abs(re),fe=Math.abs(oe);if(Math.max(te,fe)ve?(fe=oe,Er.current="x"):(fe=te,Er.current="y"),q(-fe,-fe)&&re.preventDefault()}var Y=(0,e.useRef)(null);Y.current={onTouchStart:Lt,onTouchMove:Zt,onTouchEnd:Nr,onWheel:Gr},e.useEffect(function(){function re(ce){Y.current.onTouchStart(ce)}function oe(ce){Y.current.onTouchMove(ce)}function te(ce){Y.current.onTouchEnd(ce)}function fe(ce){Y.current.onWheel(ce)}return document.addEventListener("touchmove",oe,{passive:!1}),document.addEventListener("touchend",te,{passive:!0}),$.current.addEventListener("touchstart",re,{passive:!0}),$.current.addEventListener("wheel",fe,{passive:!1}),function(){document.removeEventListener("touchmove",oe),document.removeEventListener("touchend",te)}},[])}function ee($){var q=(0,e.useState)(0),ue=(0,N.Z)(q,2),pe=ue[0],Se=ue[1],De=(0,e.useRef)(0),Le=(0,e.useRef)();return Le.current=$,h(function(){var Oe;(Oe=Le.current)===null||Oe===void 0||Oe.call(Le)},[pe]),function(){De.current===pe&&(De.current+=1,Se(De.current))}}function ie($){var q=(0,e.useRef)([]),ue=(0,e.useState)({}),pe=(0,N.Z)(ue,2),Se=pe[1],De=(0,e.useRef)(typeof $=="function"?$():$),Le=ee(function(){var ze=De.current;q.current.forEach(function(ut){ze=ut(ze)}),q.current=[],De.current=ze,Se({})});function Oe(ze){q.current.push(ze),Le()}return[De.current,Oe]}var se={width:0,height:0,left:0,top:0,right:0};function le($,q,ue,pe,Se,De,Le){var Oe=Le.tabs,ze=Le.tabPosition,ut=Le.rtl,_t,qe,Rt;return["top","bottom"].includes(ze)?(_t="width",qe=ut?"right":"left",Rt=Math.abs(ue)):(_t="height",qe="top",Rt=-ue),(0,e.useMemo)(function(){if(!Oe.length)return[0,0];for(var jt=Oe.length,Yt=jt,Kt=0;KtMath.floor(Rt+q)){Yt=Kt-1;break}}for(var Pt=0,It=jt-1;It>=0;It-=1){var Lt=$.get(Oe[It].key)||se;if(Lt[qe]=Yt?[0,0]:[Pt,Yt]},[$,q,pe,Se,De,Rt,ze,Oe.map(function(jt){return jt.key}).join("_"),ut])}function xe($){var q;return $ instanceof Map?(q={},$.forEach(function(ue,pe){q[pe]=ue})):q=$,JSON.stringify(q)}var Re="TABS_DQ";function Ee($){return String($).replace(/"/g,Re)}function he($,q,ue,pe){return!(!ue||pe||$===!1||$===void 0&&(q===!1||q===null))}var be=e.forwardRef(function($,q){var ue=$.prefixCls,pe=$.editable,Se=$.locale,De=$.style;return!pe||pe.showAdd===!1?null:e.createElement("button",{ref:q,type:"button",className:"".concat(ue,"-nav-add"),style:De,"aria-label":(Se==null?void 0:Se.addAriaLabel)||"Add tab",onClick:function(Oe){pe.onEdit("add",{event:Oe})}},pe.addIcon||"+")}),Ce=be,Ue=e.forwardRef(function($,q){var ue=$.position,pe=$.prefixCls,Se=$.extra;if(!Se)return null;var De,Le={};return(0,L.Z)(Se)==="object"&&!e.isValidElement(Se)?Le=Se:Le.right=Se,ue==="right"&&(De=Le.right),ue==="left"&&(De=Le.left),De?e.createElement("div",{className:"".concat(pe,"-extra-content"),ref:q},De):null}),$e=Ue,z=K(98280),ne=K(39607);function de($,q,ue){var pe=React.useRef({});return(!("value"in pe.current)||ue(pe.current.condition,q))&&(pe.current.value=$(),pe.current.condition=q),pe.current.value}var ge=Symbol.for("react.element"),Ae=Symbol.for("react.transitional.element"),Ve=Symbol.for("react.fragment");function xt($){return $&&(0,L.Z)($)==="object"&&($.$$typeof===ge||$.$$typeof===Ae)&&$.type===Ve}var Je=Number(e.version.split(".")[0]),pt=function(q,ue){typeof q=="function"?q(ue):(0,L.Z)(q)==="object"&&q&&"current"in q&&(q.current=ue)},St=function(){for(var q=arguments.length,ue=new Array(q),pe=0;pe=19)return!0;var Se=(0,ne.isMemo)(q)?q.type.type:q.type;return!(typeof Se=="function"&&!((ue=Se.prototype)!==null&&ue!==void 0&&ue.render)&&Se.$$typeof!==ne.ForwardRef||typeof q=="function"&&!((pe=q.prototype)!==null&&pe!==void 0&&pe.render)&&q.$$typeof!==ne.ForwardRef)};function Fe($){return(0,e.isValidElement)($)&&!xt($)}var We=function(q){return Fe(q)&&Ne(q)},Be=function(q){if(q&&Fe(q)){var ue=q;return ue.props.propertyIsEnumerable("ref")?ue.props.ref:ue.ref}return null},_e={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(q){var ue=q.keyCode;if(q.altKey&&!q.ctrlKey||q.metaKey||ue>=_e.F1&&ue<=_e.F12)return!1;switch(ue){case _e.ALT:case _e.CAPS_LOCK:case _e.CONTEXT_MENU:case _e.CTRL:case _e.DOWN:case _e.END:case _e.ESC:case _e.HOME:case _e.INSERT:case _e.LEFT:case _e.MAC_FF_META:case _e.META:case _e.NUMLOCK:case _e.NUM_CENTER:case _e.PAGE_DOWN:case _e.PAGE_UP:case _e.PAUSE:case _e.PRINT_SCREEN:case _e.RIGHT:case _e.SHIFT:case _e.UP:case _e.WIN_KEY:case _e.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(q){if(q>=_e.ZERO&&q<=_e.NINE||q>=_e.NUM_ZERO&&q<=_e.NUM_MULTIPLY||q>=_e.A&&q<=_e.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&q===0)return!0;switch(q){case _e.SPACE:case _e.QUESTION_MARK:case _e.NUM_PLUS:case _e.NUM_MINUS:case _e.NUM_PERIOD:case _e.NUM_DIVISION:case _e.SEMICOLON:case _e.DASH:case _e.EQUALS:case _e.COMMA:case _e.PERIOD:case _e.SLASH:case _e.APOSTROPHE:case _e.SINGLE_QUOTE:case _e.OPEN_SQUARE_BRACKET:case _e.BACKSLASH:case _e.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},ht=_e,Ze=function(q){return+setTimeout(q,16)},At=function(q){return clearTimeout(q)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ze=function(q){return window.requestAnimationFrame(q)},At=function(q){return window.cancelAnimationFrame(q)});var yt=0,tt=new Map;function bt($){tt.delete($)}var Ye=function(q){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;yt+=1;var pe=yt;function Se(De){if(De===0)bt(pe),q();else{var Le=Ze(function(){Se(De-1)});tt.set(pe,Le)}}return Se(ue),pe};Ye.cancel=function($){var q=tt.get($);return bt($),At(q)};var je=Ye,it=ht.ESC,Vt=ht.TAB;function tr($){var q=$.visible,ue=$.triggerRef,pe=$.onVisibleChange,Se=$.autoFocus,De=$.overlayRef,Le=e.useRef(!1),Oe=function(){if(q){var qe,Rt;(qe=ue.current)===null||qe===void 0||(Rt=qe.focus)===null||Rt===void 0||Rt.call(qe),pe==null||pe(!1)}},ze=function(){var qe;return(qe=De.current)!==null&&qe!==void 0&&qe.focus?(De.current.focus(),Le.current=!0,!0):!1},ut=function(qe){switch(qe.keyCode){case it:Oe();break;case Vt:{var Rt=!1;Le.current||(Rt=ze()),Rt?qe.preventDefault():Oe();break}}};e.useEffect(function(){return q?(window.addEventListener("keydown",ut),Se&&je(ze,3),function(){window.removeEventListener("keydown",ut),Le.current=!1}):function(){Le.current=!1}},[q])}var or=(0,e.forwardRef)(function($,q){var ue=$.overlay,pe=$.arrow,Se=$.prefixCls,De=(0,e.useMemo)(function(){var Oe;return typeof ue=="function"?Oe=ue():Oe=ue,Oe},[ue]),Le=St(q,Be(De));return e.createElement(e.Fragment,null,pe&&e.createElement("div",{className:"".concat(Se,"-arrow")}),e.cloneElement(De,{ref:Ne(De)?Le:void 0}))}),Dr=or,Yr={adjustX:1,adjustY:1},ur=[0,0],qr={topLeft:{points:["bl","tl"],overflow:Yr,offset:[0,-4],targetOffset:ur},top:{points:["bc","tc"],overflow:Yr,offset:[0,-4],targetOffset:ur},topRight:{points:["br","tr"],overflow:Yr,offset:[0,-4],targetOffset:ur},bottomLeft:{points:["tl","bl"],overflow:Yr,offset:[0,4],targetOffset:ur},bottom:{points:["tc","bc"],overflow:Yr,offset:[0,4],targetOffset:ur},bottomRight:{points:["tr","br"],overflow:Yr,offset:[0,4],targetOffset:ur}},cr=qr,Hr=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function mn($,q){var ue,pe=$.arrow,Se=pe===void 0?!1:pe,De=$.prefixCls,Le=De===void 0?"rc-dropdown":De,Oe=$.transitionName,ze=$.animation,ut=$.align,_t=$.placement,qe=_t===void 0?"bottomLeft":_t,Rt=$.placements,jt=Rt===void 0?cr:Rt,Yt=$.getPopupContainer,Kt=$.showAction,rr=$.hideAction,Pt=$.overlayClassName,It=$.overlayStyle,Lt=$.visible,Zt=$.trigger,Nr=Zt===void 0?["hover"]:Zt,Er=$.autoFocus,Gr=$.overlay,Y=$.children,re=$.onVisibleChange,oe=(0,C.Z)($,Hr),te=e.useState(),fe=(0,N.Z)(te,2),ce=fe[0],ve=fe[1],Pe="visible"in $?Lt:ce,Qe=e.useRef(null),Ge=e.useRef(null),vt=e.useRef(null);e.useImperativeHandle(q,function(){return Qe.current});var lt=function(X){ve(X),re==null||re(X)};tr({visible:Pe,triggerRef:vt,onVisibleChange:lt,autoFocus:Er,overlayRef:Ge});var Et=function(X){var ae=$.onOverlayClick;ve(!1),ae&&ae(X)},wt=function(){return e.createElement(Dr,{ref:Ge,overlay:Gr,prefixCls:Le,arrow:Se})},gt=function(){return typeof Gr=="function"?wt:wt()},rt=function(){var X=$.minOverlayWidthMatchTrigger,ae=$.alignPoint;return"minOverlayWidthMatchTrigger"in $?X:!ae},ot=function(){var X=$.openClassName;return X!==void 0?X:"".concat(Le,"-open")},U=e.cloneElement(Y,{className:M()((ue=Y.props)===null||ue===void 0?void 0:ue.className,Pe&&ot()),ref:Ne(Y)?St(vt,Be(Y)):void 0}),W=rr;return!W&&Nr.indexOf("contextMenu")!==-1&&(W=["click"]),e.createElement(z.Z,(0,Z.Z)({builtinPlacements:jt},oe,{prefixCls:Le,ref:Qe,popupClassName:M()(Pt,(0,J.Z)({},"".concat(Le,"-show-arrow"),Se)),popupStyle:It,action:Nr,showAction:Kt,hideAction:W,popupPlacement:qe,popupAlign:ut,popupTransitionName:Oe,popupAnimation:ze,popupVisible:Pe,stretch:rt()?"minWidth":"",popup:gt(),onPopupVisibleChange:lt,onPopupClick:Et,getPopupContainer:Yt}),U)}var En=e.forwardRef(mn),Tn=En,Cr=K(78595),Ke={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(q){var ue=q.keyCode;if(q.altKey&&!q.ctrlKey||q.metaKey||ue>=Ke.F1&&ue<=Ke.F12)return!1;switch(ue){case Ke.ALT:case Ke.CAPS_LOCK:case Ke.CONTEXT_MENU:case Ke.CTRL:case Ke.DOWN:case Ke.END:case Ke.ESC:case Ke.HOME:case Ke.INSERT:case Ke.LEFT:case Ke.MAC_FF_META:case Ke.META:case Ke.NUMLOCK:case Ke.NUM_CENTER:case Ke.PAGE_DOWN:case Ke.PAGE_UP:case Ke.PAUSE:case Ke.PRINT_SCREEN:case Ke.RIGHT:case Ke.SHIFT:case Ke.UP:case Ke.WIN_KEY:case Ke.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(q){if(q>=Ke.ZERO&&q<=Ke.NINE||q>=Ke.NUM_ZERO&&q<=Ke.NUM_MULTIPLY||q>=Ke.A&&q<=Ke.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&q===0)return!0;switch(q){case Ke.SPACE:case Ke.QUESTION_MARK:case Ke.NUM_PLUS:case Ke.NUM_MINUS:case Ke.NUM_PERIOD:case Ke.NUM_DIVISION:case Ke.SEMICOLON:case Ke.DASH:case Ke.EQUALS:case Ke.COMMA:case Ke.PERIOD:case Ke.SLASH:case Ke.APOSTROPHE:case Ke.SINGLE_QUOTE:case Ke.OPEN_SQUARE_BRACKET:case Ke.BACKSLASH:case Ke.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Kr=Ke,_n=e.forwardRef(function($,q){var ue=$.prefixCls,pe=$.id,Se=$.tabs,De=$.locale,Le=$.mobile,Oe=$.more,ze=Oe===void 0?{}:Oe,ut=$.style,_t=$.className,qe=$.editable,Rt=$.tabBarGutter,jt=$.rtl,Yt=$.removeAriaLabel,Kt=$.onTabClick,rr=$.getPopupContainer,Pt=$.popupClassName,It=(0,e.useState)(!1),Lt=(0,N.Z)(It,2),Zt=Lt[0],Nr=Lt[1],Er=(0,e.useState)(null),Gr=(0,N.Z)(Er,2),Y=Gr[0],re=Gr[1],oe=ze.icon,te=oe===void 0?"More":oe,fe="".concat(pe,"-more-popup"),ce="".concat(ue,"-dropdown"),ve=Y!==null?"".concat(fe,"-").concat(Y):null,Pe=De==null?void 0:De.dropdownAriaLabel;function Qe(rt,ot){rt.preventDefault(),rt.stopPropagation(),qe.onEdit("remove",{key:ot,event:rt})}var Ge=e.createElement(Cr.ZP,{onClick:function(ot){var U=ot.key,W=ot.domEvent;Kt(U,W),Nr(!1)},prefixCls:"".concat(ce,"-menu"),id:fe,tabIndex:-1,role:"listbox","aria-activedescendant":ve,selectedKeys:[Y],"aria-label":Pe!==void 0?Pe:"expanded dropdown"},Se.map(function(rt){var ot=rt.closable,U=rt.disabled,W=rt.closeIcon,B=rt.key,X=rt.label,ae=he(ot,W,qe,U);return e.createElement(Cr.sN,{key:B,id:"".concat(fe,"-").concat(B),role:"option","aria-controls":pe&&"".concat(pe,"-panel-").concat(B),disabled:U},e.createElement("span",null,X),ae&&e.createElement("button",{type:"button","aria-label":Yt||"remove",tabIndex:0,className:"".concat(ce,"-menu-item-remove"),onClick:function(Te){Te.stopPropagation(),Qe(Te,B)}},W||qe.removeIcon||"\xD7"))}));function vt(rt){for(var ot=Se.filter(function(ae){return!ae.disabled}),U=ot.findIndex(function(ae){return ae.key===Y})||0,W=ot.length,B=0;Bwe?"left":"right"})}),ce=(0,N.Z)(fe,2),ve=ce[0],Pe=ce[1],Qe=k(0,function(Ct,we){!te&&Kt&&Kt({direction:Ct>we?"top":"bottom"})}),Ge=(0,N.Z)(Qe,2),vt=Ge[0],lt=Ge[1],Et=(0,e.useState)([0,0]),wt=(0,N.Z)(Et,2),gt=wt[0],rt=wt[1],ot=(0,e.useState)([0,0]),U=(0,N.Z)(ot,2),W=U[0],B=U[1],X=(0,e.useState)([0,0]),ae=(0,N.Z)(X,2),me=ae[0],Te=ae[1],Me=(0,e.useState)([0,0]),Ie=(0,N.Z)(Me,2),ke=Ie[0],at=Ie[1],st=ie(new Map),dt=(0,N.Z)(st,2),nt=dt[0],mt=dt[1],kt=O(Lt,nt,W[0]),Dt=Wn(gt,te),Bt=Wn(W,te),Nt=Wn(me,te),Mt=Wn(ke,te),Qt=Math.floor(Dt)Ht?Ht:Ct}var Fr=(0,e.useRef)(null),br=(0,e.useState)(),Tr=(0,N.Z)(br,2),$t=Tr[0],dr=Tr[1];function vr(){dr(Date.now())}function Rr(){Fr.current&&clearTimeout(Fr.current)}Q(Gr,function(Ct,we){function et(ct,Gt){ct(function(Ut){var Fn=nr(Ut+Gt);return Fn})}return Qt?(te?et(Pe,Ct):et(lt,we),Rr(),vr(),!0):!1}),(0,e.useEffect)(function(){return Rr(),$t&&(Fr.current=setTimeout(function(){dr(0)},100)),Rr},[$t]);var tn=le(kt,Ot,te?ve:vt,Bt,Nt,Mt,(0,V.Z)((0,V.Z)({},$),{},{tabs:Lt})),ir=(0,N.Z)(tn,2),xr=ir[0],Wt=ir[1],Qr=I(function(){var Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le,we=kt.get(Ct)||{width:0,height:0,left:0,right:0,top:0};if(te){var et=ve;Oe?we.rightve+Ot&&(et=we.right+we.width-Ot):we.left<-ve?et=-we.left:we.left+we.width>-ve+Ot&&(et=-(we.left+we.width-Ot)),lt(0),Pe(nr(et))}else{var ct=vt;we.top<-vt?ct=-we.top:we.top+we.height>-vt+Ot&&(ct=-(we.top+we.height-Ot)),Pe(0),lt(nr(ct))}}),Xr=(0,e.useState)(),pr=(0,N.Z)(Xr,2),Ft=pr[0],Lr=pr[1],hn=(0,e.useState)(!1),dn=(0,N.Z)(hn,2),Sr=dn[0],ar=dn[1],Pr=Lt.filter(function(Ct){return!Ct.disabled}).map(function(Ct){return Ct.key}),$r=function(we){var et=Pr.indexOf(Ft||Le),ct=Pr.length,Gt=(et+we+ct)%ct,Ut=Pr[Gt];Lr(Ut)},gr=function(we){var et=we.code,ct=Oe&&te,Gt=Pr[0],Ut=Pr[Pr.length-1];switch(et){case"ArrowLeft":{te&&$r(ct?1:-1);break}case"ArrowRight":{te&&$r(ct?-1:1);break}case"ArrowUp":{we.preventDefault(),te||$r(-1);break}case"ArrowDown":{we.preventDefault(),te||$r(1);break}case"Home":{we.preventDefault(),Lr(Gt);break}case"End":{we.preventDefault(),Lr(Ut);break}case"Enter":case"Space":{we.preventDefault(),Yt(Le,we);break}case"Backspace":case"Delete":{var Fn=Pr.indexOf(Ft),Zr=Lt.find(function(vn){return vn.key===Ft}),nn=he(Zr==null?void 0:Zr.closable,Zr==null?void 0:Zr.closeIcon,ut,Zr==null?void 0:Zr.disabled);nn&&(we.preventDefault(),we.stopPropagation(),ut.onEdit("remove",{key:Ft,event:we}),Fn===Pr.length-1?$r(-1):$r(1));break}}},Ir={};te?Ir[Oe?"marginRight":"marginLeft"]=Rt:Ir.marginTop=Rt;var Ar=Lt.map(function(Ct,we){var et=Ct.key;return e.createElement(xn,{id:Se,prefixCls:It,key:et,tab:Ct,style:we===0?void 0:Ir,closable:Ct.closable,editable:ut,active:et===Le,focus:et===Ft,renderWrapper:jt,removeAriaLabel:_t==null?void 0:_t.removeAriaLabel,tabCount:Pr.length,currentPosition:we+1,onClick:function(Gt){Yt(et,Gt)},onKeyDown:gr,onFocus:function(){Sr||Lr(et),Qr(et),vr(),Gr.current&&(Oe||(Gr.current.scrollLeft=0),Gr.current.scrollTop=0)},onBlur:function(){Lr(void 0)},onMouseDown:function(){ar(!0)},onMouseUp:function(){ar(!1)}})}),mr=function(){return mt(function(){var we,et=new Map,ct=(we=Y.current)===null||we===void 0?void 0:we.getBoundingClientRect();return Lt.forEach(function(Gt){var Ut,Fn=Gt.key,Zr=(Ut=Y.current)===null||Ut===void 0?void 0:Ut.querySelector('[data-node-key="'.concat(Ee(Fn),'"]'));if(Zr){var nn=In(Zr,ct),vn=(0,N.Z)(nn,4),Ei=vn[0],ci=vn[1],hi=vn[2],$n=vn[3];et.set(Fn,{width:Ei,height:ci,left:hi,top:$n})}}),et})};(0,e.useEffect)(function(){mr()},[Lt.map(function(Ct){return Ct.key}).join("_")]);var jr=ee(function(){var Ct=On(Zt),we=On(Nr),et=On(Er);rt([Ct[0]-we[0]-et[0],Ct[1]-we[1]-et[1]]);var ct=On(oe);Te(ct);var Gt=On(re);at(Gt);var Ut=On(Y);B([Ut[0]-ct[0],Ut[1]-ct[1]]),mr()}),un=Lt.slice(0,xr),Ur=Lt.slice(Wt+1),Jt=[].concat((0,i.Z)(un),(0,i.Z)(Ur)),Or=kt.get(Le),Mr=_({activeTabOffset:Or,horizontal:te,indicator:rr,rtl:Oe}),Xn=Mr.style;(0,e.useEffect)(function(){Qr()},[Le,Xt,Ht,xe(Or),xe(kt),te]),(0,e.useEffect)(function(){jr()},[Oe]);var zt=!!Jt.length,ln="".concat(It,"-nav-wrap"),bn,_r,yn,rn;return te?Oe?(_r=ve>0,bn=ve!==Ht):(bn=ve<0,_r=ve!==Xt):(yn=vt<0,rn=vt!==Xt),e.createElement(s.Z,{onResize:jr},e.createElement("div",{ref:R(q,Zt),role:"tablist","aria-orientation":te?"horizontal":"vertical",className:M()("".concat(It,"-nav"),ue),style:pe,onKeyDown:function(){vr()}},e.createElement($e,{ref:Nr,position:"left",extra:ze,prefixCls:It}),e.createElement(s.Z,{onResize:jr},e.createElement("div",{className:M()(ln,(0,J.Z)((0,J.Z)((0,J.Z)((0,J.Z)({},"".concat(ln,"-ping-left"),bn),"".concat(ln,"-ping-right"),_r),"".concat(ln,"-ping-top"),yn),"".concat(ln,"-ping-bottom"),rn)),ref:Gr},e.createElement(s.Z,{onResize:jr},e.createElement("div",{ref:Y,className:"".concat(It,"-nav-list"),style:{transform:"translate(".concat(ve,"px, ").concat(vt,"px)"),transition:$t?"none":void 0}},Ar,e.createElement(Ce,{ref:oe,prefixCls:It,locale:_t,editable:ut,style:(0,V.Z)((0,V.Z)({},Ar.length===0?void 0:Ir),{},{visibility:zt?"hidden":null})}),e.createElement("div",{className:M()("".concat(It,"-ink-bar"),(0,J.Z)({},"".concat(It,"-ink-bar-animated"),De.inkBar)),style:Xn}))))),e.createElement(Vr,(0,Z.Z)({},$,{removeAriaLabel:_t==null?void 0:_t.removeAriaLabel,ref:re,prefixCls:It,tabs:Jt,className:!zt&&ft,tabMoving:!!$t})),e.createElement($e,{ref:Er,position:"right",extra:ze,prefixCls:It})))}),zn=oi,Mn=e.forwardRef(function($,q){var ue=$.prefixCls,pe=$.className,Se=$.style,De=$.id,Le=$.active,Oe=$.tabKey,ze=$.children;return e.createElement("div",{id:De&&"".concat(De,"-panel-").concat(Oe),role:"tabpanel",tabIndex:Le?0:-1,"aria-labelledby":De&&"".concat(De,"-tab-").concat(Oe),"aria-hidden":!Le,style:Se,className:M()(ue,Le&&"".concat(ue,"-active"),pe),ref:q},ze)}),Cn=Mn,ui=["renderTabBar"],on=["label","key"],li=function(q){var ue=q.renderTabBar,pe=(0,C.Z)(q,ui),Se=e.useContext(a),De=Se.tabs;if(ue){var Le=(0,V.Z)((0,V.Z)({},pe),{},{panes:De.map(function(Oe){var ze=Oe.label,ut=Oe.key,_t=(0,C.Z)(Oe,on);return e.createElement(Cn,(0,Z.Z)({tab:ze,key:ut,tabKey:ut},_t))})});return ue(Le,zn)}return e.createElement(zn,pe)},Yn=li,Gn=K(62874),An=["key","forceRender","style","className","destroyInactiveTabPane"],_i=function(q){var ue=q.id,pe=q.activeKey,Se=q.animated,De=q.tabPosition,Le=q.destroyInactiveTabPane,Oe=e.useContext(a),ze=Oe.prefixCls,ut=Oe.tabs,_t=Se.tabPane,qe="".concat(ze,"-tabpane");return e.createElement("div",{className:M()("".concat(ze,"-content-holder"))},e.createElement("div",{className:M()("".concat(ze,"-content"),"".concat(ze,"-content-").concat(De),(0,J.Z)({},"".concat(ze,"-content-animated"),_t))},ut.map(function(Rt){var jt=Rt.key,Yt=Rt.forceRender,Kt=Rt.style,rr=Rt.className,Pt=Rt.destroyInactiveTabPane,It=(0,C.Z)(Rt,An),Lt=jt===pe;return e.createElement(Gn.Z,(0,Z.Z)({key:jt,visible:Lt,forceRender:Yt,removeOnLeave:!!(Le||Pt),leavedClassName:"".concat(qe,"-hidden")},Se.tabPaneMotion),function(Zt,Nr){var Er=Zt.style,Gr=Zt.className;return e.createElement(Cn,(0,Z.Z)({},It,{prefixCls:qe,id:ue,tabKey:jt,animated:_t,active:Lt,style:(0,V.Z)((0,V.Z)({},Kt),Er),className:M()(rr,Gr),ref:Nr}))})})))},fi=_i,ii={},kn=[],yi=function(q){kn.push(q)};function wn($,q){if(0)var ue}function Qn($,q){if(0)var ue}function yr(){ii={}}function hr($,q,ue){!q&&!ii[ue]&&($(!1,ue),ii[ue]=!0)}function kr($,q){hr(wn,$,q)}function Nn($,q){hr(Qn,$,q)}kr.preMessage=yi,kr.resetWarned=yr,kr.noteOnce=Nn;var ki=null;function Ni(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},q;return $===!1?q={inkBar:!1,tabPane:!1}:$===!0?q={inkBar:!0,tabPane:!1}:q=(0,V.Z)({inkBar:!0},(0,L.Z)($)==="object"?$:{}),q.tabPaneMotion&&q.tabPane===void 0&&(q.tabPane=!0),!q.tabPaneMotion&&q.tabPane&&(q.tabPane=!1),q}var en=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Ri=0,Fi=e.forwardRef(function($,q){var ue=$.id,pe=$.prefixCls,Se=pe===void 0?"rc-tabs":pe,De=$.className,Le=$.items,Oe=$.direction,ze=$.activeKey,ut=$.defaultActiveKey,_t=$.editable,qe=$.animated,Rt=$.tabPosition,jt=Rt===void 0?"top":Rt,Yt=$.tabBarGutter,Kt=$.tabBarStyle,rr=$.tabBarExtraContent,Pt=$.locale,It=$.more,Lt=$.destroyInactiveTabPane,Zt=$.renderTabBar,Nr=$.onChange,Er=$.onTabClick,Gr=$.onTabScroll,Y=$.getPopupContainer,re=$.popupClassName,oe=$.indicator,te=(0,C.Z)($,en),fe=e.useMemo(function(){return(Le||[]).filter(function(ke){return ke&&(0,L.Z)(ke)==="object"&&"key"in ke})},[Le]),ce=Oe==="rtl",ve=Ni(qe),Pe=(0,e.useState)(!1),Qe=(0,N.Z)(Pe,2),Ge=Qe[0],vt=Qe[1];(0,e.useEffect)(function(){vt(o())},[]);var lt=m(function(){var ke;return(ke=fe[0])===null||ke===void 0?void 0:ke.key},{value:ze,defaultValue:ut}),Et=(0,N.Z)(lt,2),wt=Et[0],gt=Et[1],rt=(0,e.useState)(function(){return fe.findIndex(function(ke){return ke.key===wt})}),ot=(0,N.Z)(rt,2),U=ot[0],W=ot[1];(0,e.useEffect)(function(){var ke=fe.findIndex(function(st){return st.key===wt});if(ke===-1){var at;ke=Math.max(0,Math.min(U,fe.length-1)),gt((at=fe[ke])===null||at===void 0?void 0:at.key)}W(ke)},[fe.map(function(ke){return ke.key}).join("_"),wt,U]);var B=m(null,{value:ue}),X=(0,N.Z)(B,2),ae=X[0],me=X[1];(0,e.useEffect)(function(){ue||(me("rc-tabs-".concat(Ri)),Ri+=1)},[]);function Te(ke,at){Er==null||Er(ke,at);var st=ke!==wt;gt(ke),st&&(Nr==null||Nr(ke))}var Me={id:ae,activeKey:wt,animated:ve,tabPosition:jt,rtl:ce,mobile:Ge},Ie=(0,V.Z)((0,V.Z)({},Me),{},{editable:_t,locale:Pt,more:It,tabBarGutter:Yt,onTabClick:Te,onTabScroll:Gr,extra:rr,style:Kt,panes:null,getPopupContainer:Y,popupClassName:re,indicator:oe});return e.createElement(a.Provider,{value:{tabs:fe,prefixCls:Se}},e.createElement("div",(0,Z.Z)({ref:q,id:ue,className:M()(Se,"".concat(Se,"-").concat(jt),(0,J.Z)((0,J.Z)((0,J.Z)({},"".concat(Se,"-mobile"),Ge),"".concat(Se,"-editable"),_t),"".concat(Se,"-rtl"),ce),De)},te),e.createElement(Yn,(0,Z.Z)({},Ie,{renderTabBar:Zt})),e.createElement(fi,(0,Z.Z)({destroyInactiveTabPane:Lt},Me,{animated:ve}))))}),Gi=Fi,Li=Gi},64681:function(He,ye){"use strict";var K;var Z=Symbol.for("react.element"),J=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),P=Symbol.for("react.context"),M=Symbol.for("react.server_context"),e=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function u(v){if(typeof v=="object"&&v!==null){var m=v.$$typeof;switch(m){case Z:switch(v=v.type,v){case V:case L:case N:case I:case A:return v;default:switch(v=v&&v.$$typeof,v){case M:case P:case e:case g:case f:case C:return v;default:return m}}case J:return m}}}K=P,K=C,K=Z,ye.ForwardRef=e,K=V,K=g,K=f,K=J,K=L,K=N,K=I,K=A,K=function(){return!1},K=function(){return!1},K=function(v){return u(v)===P},K=function(v){return u(v)===C},K=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===Z},K=function(v){return u(v)===e},K=function(v){return u(v)===V},K=function(v){return u(v)===g},ye.isMemo=function(v){return u(v)===f},K=function(v){return u(v)===J},K=function(v){return u(v)===L},K=function(v){return u(v)===N},K=function(v){return u(v)===I},K=function(v){return u(v)===A},K=function(v){return typeof v=="string"||typeof v=="function"||v===V||v===L||v===N||v===I||v===A||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===g||v.$$typeof===f||v.$$typeof===C||v.$$typeof===P||v.$$typeof===e||v.$$typeof===p||v.getModuleId!==void 0)},K=u},39607:function(He,ye,K){"use strict";He.exports=K(64681)},36697:function(He,ye,K){"use strict";K.d(ye,{G:function(){return L},Z:function(){return b}});var Z=K(94184),J=K.n(Z),V=K(67294),N=K.t(V,2);function L(d){var T=d.children,R=d.prefixCls,S=d.id,w=d.overlayInnerStyle,r=d.bodyClassName,n=d.className,t=d.style;return V.createElement("div",{className:J()("".concat(R,"-content"),n),style:t},V.createElement("div",{className:J()("".concat(R,"-inner"),r),id:S,role:"tooltip",style:w},typeof T=="function"?T():T))}var C=K(87462),P=K(1413),M=K(45987),e=K(98280),I={shiftX:64,adjustY:1},A={adjustX:1,shiftY:!0},f=[0,0],g={left:{points:["cr","cl"],overflow:A,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:A,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:I,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:I,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:I,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:A,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:I,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:A,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:I,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:A,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:I,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:A,offset:[-4,0],targetOffset:f}},h=null,p=K(97685);function u(){var d=(0,P.Z)({},N);return d.useId}var v=0;function m(){}var o=u(),a=o?function(T){var R=o();return T||R}:function(T){var R=V.useState("ssr-id"),S=(0,p.Z)(R,2),w=S[0],r=S[1];return V.useEffect(function(){var n=v;v+=1,r("rc_unique_".concat(n))},[]),T||w},i=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],s=function(T,R){var S=T.overlayClassName,w=T.trigger,r=w===void 0?["hover"]:w,n=T.mouseEnterDelay,t=n===void 0?0:n,l=T.mouseLeaveDelay,x=l===void 0?.1:l,y=T.overlayStyle,c=T.prefixCls,_=c===void 0?"rc-tooltip":c,D=T.children,O=T.onVisibleChange,k=T.afterVisibleChange,F=T.transitionName,G=T.animation,H=T.motion,j=T.placement,Q=j===void 0?"right":j,ee=T.align,ie=ee===void 0?{}:ee,se=T.destroyTooltipOnHide,le=se===void 0?!1:se,xe=T.defaultVisible,Re=T.getTooltipContainer,Ee=T.overlayInnerStyle,he=T.arrowContent,be=T.overlay,Ce=T.id,Ue=T.showArrow,$e=Ue===void 0?!0:Ue,z=T.classNames,ne=T.styles,de=(0,M.Z)(T,i),ge=a(Ce),Ae=(0,V.useRef)(null);(0,V.useImperativeHandle)(R,function(){return Ae.current});var Ve=(0,P.Z)({},de);"visible"in T&&(Ve.popupVisible=T.visible);var xt=function(){return V.createElement(L,{key:"content",prefixCls:_,id:ge,bodyClassName:z==null?void 0:z.body,overlayInnerStyle:(0,P.Z)((0,P.Z)({},Ee),ne==null?void 0:ne.body)},be)},Je=function(){var St=V.Children.only(D),er=(St==null?void 0:St.props)||{},Ne=(0,P.Z)((0,P.Z)({},er),{},{"aria-describedby":be?ge:null});return V.cloneElement(D,Ne)};return V.createElement(e.Z,(0,C.Z)({popupClassName:J()(S,z==null?void 0:z.root),prefixCls:_,popup:xt,action:r,builtinPlacements:g,popupPlacement:Q,ref:Ae,popupAlign:ie,getPopupContainer:Re,onPopupVisibleChange:O,afterPopupVisibleChange:k,popupTransitionName:F,popupAnimation:G,popupMotion:H,defaultPopupVisible:xe,autoDestroy:le,mouseLeaveDelay:x,popupStyle:(0,P.Z)((0,P.Z)({},y),ne==null?void 0:ne.root),mouseEnterDelay:t,arrow:$e},Ve),Je())},E=(0,V.forwardRef)(s),b=E},50344:function(He,ye,K){"use strict";K.d(ye,{Z:function(){return V}});var Z=K(67294),J=K(59864);function V(N){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=[];return Z.Children.forEach(N,function(P){P==null&&!L.keepEmpty||(Array.isArray(P)?C=C.concat(V(P)):(0,J.isFragment)(P)&&P.props?C=C.concat(V(P.props.children,L)):C.push(P))}),C}},66680:function(He,ye,K){"use strict";K.d(ye,{Z:function(){return J}});var Z=K(67294);function J(V){var N=Z.useRef();N.current=V;var L=Z.useCallback(function(){for(var C,P=arguments.length,M=new Array(P),e=0;e2&&arguments[2]!==void 0?arguments[2]:!1,P=new Set;function M(e,I){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=P.has(e);if((0,J.ZP)(!f,"Warning: There may be circular references"),f)return!1;if(e===I)return!0;if(C&&A>1)return!1;P.add(e);var g=A+1;if(Array.isArray(e)){if(!Array.isArray(I)||e.length!==I.length)return!1;for(var h=0;h=0)&&Object.prototype.propertyIsEnumerable.call(o,s)&&(i[s]=o[s])}return i}function M(o,a){if(o==null)return{};var i={},s=Object.keys(o),E,b;for(b=0;b=0)&&(i[E]=o[E]);return i}function e(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")}function I(o,a){for(var i=0;i0},r.prototype.connect_=function(){!J||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!J||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var t=n.propertyName,l=t===void 0?"":t,x=M.some(function(y){return!!~l.indexOf(y)});x&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),A=function(r,n){for(var t=0,l=Object.keys(n);t0},r}(),R=typeof WeakMap!="undefined"?new WeakMap:new Z,S=function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=I.getInstance(),l=new T(n,t,this);R.set(this,l)}return r}();["observe","unobserve","disconnect"].forEach(function(r){S.prototype[r]=function(){var n;return(n=R.get(this))[r].apply(n,arguments)}});var w=function(){return typeof V.ResizeObserver!="undefined"?V.ResizeObserver:S}();ye.Z=w},11742:function(He){He.exports=function(){var ye=document.getSelection();if(!ye.rangeCount)return function(){};for(var K=document.activeElement,Z=[],J=0;J