You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1035 lines
1.0 MiB
1035 lines
1.0 MiB
!(function(){var Xo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[2829],{65352:function(vn,St,C){"use strict";C.d(St,{Z:function(){return Ze}});var T=C(89490),de=C(11036),De=C(39224),re=C(43403),M=C(92310),p=C.n(M),fe=C(29301),ie=C(76846),l=C(96452),S=C(6089),w=C(80402),d=C(34280),m=C(49658),y=C(59301),x=C(71409),N=C(77900),U=C(8654);function K(ge){var le=ge.prefixCls,G=ge.align,be=ge.arrow,ke=ge.arrowPos,Ne=be||{},k=Ne.className,F=Ne.content,ee=ke.x,oe=ee===void 0?0:ee,J=ke.y,me=J===void 0?0:J,Te=y.useRef();if(!G||!G.points)return null;var pe={position:"absolute"};if(G.autoArrow!==!1){var _e=G.points[0],Ce=G.points[1],Ge=_e[0],He=_e[1],et=Ce[0],lt=Ce[1];Ge===et||!["t","b"].includes(Ge)?pe.top=me:Ge==="t"?pe.top=0:pe.bottom=0,He===lt||!["l","r"].includes(He)?pe.left=oe:He==="l"?pe.left=0:pe.right=0}return y.createElement("div",{ref:Te,className:p()("".concat(le,"-arrow"),k),style:pe},F)}function D(ge){var le=ge.prefixCls,G=ge.open,be=ge.zIndex,ke=ge.mask,Ne=ge.motion;return ke?y.createElement(N.default,(0,x.Z)({},Ne,{motionAppear:!0,visible:G,removeOnLeave:!0}),function(k){var F=k.className;return y.createElement("div",{style:{zIndex:be},className:p()("".concat(le,"-mask"),F)})}):null}var A=y.memo(function(ge){var le=ge.children;return le},function(ge,le){return le.cache}),P=A,z=y.forwardRef(function(ge,le){var G=ge.popup,be=ge.className,ke=ge.prefixCls,Ne=ge.style,k=ge.target,F=ge.onVisibleChanged,ee=ge.open,oe=ge.keepDom,J=ge.fresh,me=ge.onClick,Te=ge.mask,pe=ge.arrow,_e=ge.arrowPos,Ce=ge.align,Ge=ge.motion,He=ge.maskMotion,et=ge.forceRender,lt=ge.getPopupContainer,Pt=ge.autoDestroy,xt=ge.portal,ut=ge.zIndex,Gt=ge.onMouseEnter,an=ge.onMouseLeave,Ct=ge.onPointerEnter,un=ge.onPointerDownCapture,Nn=ge.ready,At=ge.offsetX,Qt=ge.offsetY,Re=ge.offsetR,xe=ge.offsetB,Ae=ge.onAlign,B=ge.onPrepare,j=ge.stretch,te=ge.targetWidth,q=ge.targetHeight,we=typeof G=="function"?G():G,vt=ee||oe,st=(lt==null?void 0:lt.length)>0,ft=y.useState(!lt||!st),Mt=(0,de.Z)(ft,2),Sn=Mt[0],En=Mt[1];if((0,d.Z)(function(){!Sn&&st&&k&&En(!0)},[Sn,st,k]),!Sn)return null;var Ft="auto",Yt={left:"-1000vw",top:"-1000vh",right:Ft,bottom:Ft};if(Nn||!ee){var kn,$n=Ce.points,Rn=Ce.dynamicInset||((kn=Ce._experimental)===null||kn===void 0?void 0:kn.dynamicInset),Bn=Rn&&$n[0][1]==="r",xn=Rn&&$n[0][0]==="b";Bn?(Yt.right=Re,Yt.left=Ft):(Yt.left=At,Yt.right=Ft),xn?(Yt.bottom=xe,Yt.top=Ft):(Yt.top=Qt,Yt.bottom=Ft)}var sn={};return j&&(j.includes("height")&&q?sn.height=q:j.includes("minHeight")&&q&&(sn.minHeight=q),j.includes("width")&&te?sn.width=te:j.includes("minWidth")&&te&&(sn.minWidth=te)),ee||(sn.pointerEvents="none"),y.createElement(xt,{open:et||vt,getContainer:lt&&function(){return lt(k)},autoDestroy:Pt},y.createElement(D,{prefixCls:ke,open:ee,zIndex:ut,mask:Te,motion:He}),y.createElement(fe.Z,{onResize:Ae,disabled:!ee},function(wn){return y.createElement(N.default,(0,x.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:et,leavedClassName:"".concat(ke,"-hidden")},Ge,{onAppearPrepare:B,onEnterPrepare:B,visible:ee,onVisibleChanged:function(Hn){var Se;Ge==null||(Se=Ge.onVisibleChanged)===null||Se===void 0||Se.call(Ge,Hn),F(Hn)}}),function(zn,Hn){var Se=zn.className,Ee=zn.style,_t=p()(ke,Se,be);return y.createElement("div",{ref:(0,U.sQ)(wn,le,Hn),className:_t,style:(0,T.Z)((0,T.Z)((0,T.Z)((0,T.Z)({"--arrow-x":"".concat(_e.x||0,"px"),"--arrow-y":"".concat(_e.y||0,"px")},Yt),sn),Ee),{},{boxSizing:"border-box",zIndex:ut},Ne),onMouseEnter:Gt,onMouseLeave:an,onPointerEnter:Ct,onClick:me,onPointerDownCapture:un},pe&&y.createElement(K,{prefixCls:ke,arrow:pe,arrowPos:_e,align:Ce}),y.createElement(P,{cache:!ee&&!J},we))})}))}),se=z,ae=y.forwardRef(function(ge,le){var G=ge.children,be=ge.getTriggerDOMNode,ke=(0,U.Yr)(G),Ne=y.useCallback(function(F){(0,U.mH)(le,be?be(F):F)},[be]),k=(0,U.x1)(Ne,(0,U.C4)(G));return ke?y.cloneElement(G,{ref:k}):G}),ne=ae,Q=y.createContext(null),ye=Q;function ce(ge){return ge?Array.isArray(ge)?ge:[ge]:[]}function Oe(ge,le,G,be){return y.useMemo(function(){var ke=ce(G!=null?G:le),Ne=ce(be!=null?be:le),k=new Set(ke),F=new Set(Ne);return ge&&(k.has("hover")&&(k.delete("hover"),k.add("click")),F.has("hover")&&(F.delete("hover"),F.add("click"))),[k,F]},[ge,le,G,be])}var Z=C(29194);function L(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],G=arguments.length>2?arguments[2]:void 0;return G?ge[0]===le[0]:ge[0]===le[0]&&ge[1]===le[1]}function V(ge,le,G,be){for(var ke=G.points,Ne=Object.keys(ge),k=0;k<Ne.length;k+=1){var F,ee=Ne[k];if(L((F=ge[ee])===null||F===void 0?void 0:F.points,ke,be))return"".concat(le,"-placement-").concat(ee)}return""}function $(ge,le,G,be){return le||(G?{motionName:"".concat(ge,"-").concat(G)}:be?{motionName:be}:null)}function H(ge){return ge.ownerDocument.defaultView}function W(ge){for(var le=[],G=ge==null?void 0:ge.parentElement,be=["hidden","scroll","clip","auto"];G;){var ke=H(G).getComputedStyle(G),Ne=ke.overflowX,k=ke.overflowY,F=ke.overflow;[Ne,k,F].some(function(ee){return be.includes(ee)})&&le.push(G),G=G.parentElement}return le}function _(ge){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ge)?le:ge}function g(ge){return _(parseFloat(ge),0)}function O(ge,le){var G=(0,T.Z)({},ge);return(le||[]).forEach(function(be){if(!(be instanceof HTMLBodyElement||be instanceof HTMLHtmlElement)){var ke=H(be).getComputedStyle(be),Ne=ke.overflow,k=ke.overflowClipMargin,F=ke.borderTopWidth,ee=ke.borderBottomWidth,oe=ke.borderLeftWidth,J=ke.borderRightWidth,me=be.getBoundingClientRect(),Te=be.offsetHeight,pe=be.clientHeight,_e=be.offsetWidth,Ce=be.clientWidth,Ge=g(F),He=g(ee),et=g(oe),lt=g(J),Pt=_(Math.round(me.width/_e*1e3)/1e3),xt=_(Math.round(me.height/Te*1e3)/1e3),ut=(_e-Ce-et-lt)*Pt,Gt=(Te-pe-Ge-He)*xt,an=Ge*xt,Ct=He*xt,un=et*Pt,Nn=lt*Pt,At=0,Qt=0;if(Ne==="clip"){var Re=g(k);At=Re*Pt,Qt=Re*xt}var xe=me.x+un-At,Ae=me.y+an-Qt,B=xe+me.width+2*At-un-Nn-ut,j=Ae+me.height+2*Qt-an-Ct-Gt;G.left=Math.max(G.left,xe),G.top=Math.max(G.top,Ae),G.right=Math.min(G.right,B),G.bottom=Math.min(G.bottom,j)}}),G}function Y(ge){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,G="".concat(le),be=G.match(/^(.*)\%$/);return be?ge*(parseFloat(be[1])/100):parseFloat(G)}function Pe(ge,le){var G=le||[],be=(0,de.Z)(G,2),ke=be[0],Ne=be[1];return[Y(ge.width,ke),Y(ge.height,Ne)]}function Me(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ge[0],ge[1]]}function Xe(ge,le){var G=le[0],be=le[1],ke,Ne;return G==="t"?Ne=ge.y:G==="b"?Ne=ge.y+ge.height:Ne=ge.y+ge.height/2,be==="l"?ke=ge.x:be==="r"?ke=ge.x+ge.width:ke=ge.x+ge.width/2,{x:ke,y:Ne}}function Ye(ge,le){var G={t:"b",b:"t",l:"r",r:"l"};return ge.map(function(be,ke){return ke===le?G[be]||"c":be}).join("")}function Tt(ge,le,G,be,ke,Ne,k){var F=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ke[be]||{}}),ee=(0,de.Z)(F,2),oe=ee[0],J=ee[1],me=y.useRef(0),Te=y.useMemo(function(){return le?W(le):[]},[le]),pe=y.useRef({}),_e=function(){pe.current={}};ge||_e();var Ce=(0,S.Z)(function(){if(le&&G&&ge){let Ri=function(vi,hi){var Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$t,_n=ft.x+vi,bn=ft.y+hi,Dn=_n+Bn,Jn=bn+Rn,li=Math.max(_n,Ot.left),en=Math.max(bn,Ot.top),yn=Math.min(Dn,Ot.right),ei=Math.min(Jn,Ot.bottom);return Math.max(0,(yn-li)*(ei-en))},fi=function(){Zn=ft.y+jt,ai=Zn+Rn,qn=ft.x+Xt,Yn=qn+Bn};var et,lt,Pt,xt,ut=le,Gt=ut.ownerDocument,an=H(ut),Ct=an.getComputedStyle(ut),un=Ct.width,Nn=Ct.height,At=Ct.position,Qt=ut.style.left,Re=ut.style.top,xe=ut.style.right,Ae=ut.style.bottom,B=ut.style.overflow,j=(0,T.Z)((0,T.Z)({},ke[be]),Ne),te=Gt.createElement("div");(et=ut.parentElement)===null||et===void 0||et.appendChild(te),te.style.left="".concat(ut.offsetLeft,"px"),te.style.top="".concat(ut.offsetTop,"px"),te.style.position=At,te.style.height="".concat(ut.offsetHeight,"px"),te.style.width="".concat(ut.offsetWidth,"px"),ut.style.left="0",ut.style.top="0",ut.style.right="auto",ut.style.bottom="auto",ut.style.overflow="hidden";var q;if(Array.isArray(G))q={x:G[0],y:G[1],width:0,height:0};else{var we,vt,st=G.getBoundingClientRect();st.x=(we=st.x)!==null&&we!==void 0?we:st.left,st.y=(vt=st.y)!==null&&vt!==void 0?vt:st.top,q={x:st.x,y:st.y,width:st.width,height:st.height}}var ft=ut.getBoundingClientRect();ft.x=(lt=ft.x)!==null&<!==void 0?lt:ft.left,ft.y=(Pt=ft.y)!==null&&Pt!==void 0?Pt:ft.top;var Mt=Gt.documentElement,Sn=Mt.clientWidth,En=Mt.clientHeight,Ft=Mt.scrollWidth,Yt=Mt.scrollHeight,kn=Mt.scrollTop,$n=Mt.scrollLeft,Rn=ft.height,Bn=ft.width,xn=q.height,sn=q.width,wn={left:0,top:0,right:Sn,bottom:En},zn={left:-$n,top:-kn,right:Ft-$n,bottom:Yt-kn},Hn=j.htmlRegion,Se="visible",Ee="visibleFirst";Hn!=="scroll"&&Hn!==Ee&&(Hn=Se);var _t=Hn===Ee,ct=O(zn,Te),tt=O(wn,Te),$t=Hn===Se?tt:ct,je=_t?tt:$t;ut.style.left="auto",ut.style.top="auto",ut.style.right="0",ut.style.bottom="0";var Ve=ut.getBoundingClientRect();ut.style.left=Qt,ut.style.top=Re,ut.style.right=xe,ut.style.bottom=Ae,ut.style.overflow=B,(xt=ut.parentElement)===null||xt===void 0||xt.removeChild(te);var ht=_(Math.round(Bn/parseFloat(un)*1e3)/1e3),nt=_(Math.round(Rn/parseFloat(Nn)*1e3)/1e3);if(ht===0||nt===0||(0,ie.Sh)(G)&&!(0,Z.Z)(G))return;var Vt=j.offset,Zt=j.targetOffset,It=Pe(ft,Vt),wt=(0,de.Z)(It,2),he=wt[0],Ie=wt[1],Fe=Pe(q,Zt),Ue=(0,de.Z)(Fe,2),it=Ue[0],at=Ue[1];q.x-=it,q.y-=at;var qe=j.points||[],yt=(0,de.Z)(qe,2),Dt=yt[0],kt=yt[1],qt=Me(kt),Lt=Me(Dt),nn=Xe(q,qt),cn=Xe(ft,Lt),ln=(0,T.Z)({},j),Xt=nn.x-cn.x+he,jt=nn.y-cn.y+Ie,dn=Ri(Xt,jt),Rt=Ri(Xt,jt,tt),Nt=Xe(q,["t","l"]),Kt=Xe(ft,["t","l"]),pn=Xe(q,["b","r"]),Jt=Xe(ft,["b","r"]),fn=j.overflow||{},An=fn.adjustX,Pn=fn.adjustY,ni=fn.shiftX,Fn=fn.shiftY,On=function(hi){return typeof hi=="boolean"?hi:hi>=0},Zn,ai,qn,Yn;fi();var on=On(Pn),bt=Lt[0]===qt[0];if(on&&Lt[0]==="t"&&(ai>je.bottom||pe.current.bt)){var mt=jt;bt?mt-=Rn-xn:mt=Nt.y-Jt.y-Ie;var Ht=Ri(Xt,mt),Wt=Ri(Xt,mt,tt);Ht>dn||Ht===dn&&(!_t||Wt>=Rt)?(pe.current.bt=!0,jt=mt,Ie=-Ie,ln.points=[Ye(Lt,0),Ye(qt,0)]):pe.current.bt=!1}if(on&&Lt[0]==="b"&&(Zn<je.top||pe.current.tb)){var hn=jt;bt?hn+=Rn-xn:hn=pn.y-Kt.y-Ie;var Gn=Ri(Xt,hn),Vn=Ri(Xt,hn,tt);Gn>dn||Gn===dn&&(!_t||Vn>=Rt)?(pe.current.tb=!0,jt=hn,Ie=-Ie,ln.points=[Ye(Lt,0),Ye(qt,0)]):pe.current.tb=!1}var Mn=On(An),ri=Lt[1]===qt[1];if(Mn&&Lt[1]==="l"&&(Yn>je.right||pe.current.rl)){var ci=Xt;ri?ci-=Bn-sn:ci=Nt.x-Jt.x-he;var yi=Ri(ci,jt),wi=Ri(ci,jt,tt);yi>dn||yi===dn&&(!_t||wi>=Rt)?(pe.current.rl=!0,Xt=ci,he=-he,ln.points=[Ye(Lt,1),Ye(qt,1)]):pe.current.rl=!1}if(Mn&&Lt[1]==="r"&&(qn<je.left||pe.current.lr)){var In=Xt;ri?In+=Bn-sn:In=pn.x-Kt.x-he;var Li=Ri(In,jt),Ti=Ri(In,jt,tt);Li>dn||Li===dn&&(!_t||Ti>=Rt)?(pe.current.lr=!0,Xt=In,he=-he,ln.points=[Ye(Lt,1),Ye(qt,1)]):pe.current.lr=!1}fi();var gi=ni===!0?0:ni;typeof gi=="number"&&(qn<tt.left&&(Xt-=qn-tt.left-he,q.x+sn<tt.left+gi&&(Xt+=q.x-tt.left+sn-gi)),Yn>tt.right&&(Xt-=Yn-tt.right-he,q.x>tt.right-gi&&(Xt+=q.x-tt.right+gi)));var oi=Fn===!0?0:Fn;typeof oi=="number"&&(Zn<tt.top&&(jt-=Zn-tt.top-Ie,q.y+xn<tt.top+oi&&(jt+=q.y-tt.top+xn-oi)),ai>tt.bottom&&(jt-=ai-tt.bottom-Ie,q.y>tt.bottom-oi&&(jt+=q.y-tt.bottom+oi)));var gn=ft.x+Xt,mi=gn+Bn,Ai=ft.y+jt,$i=Ai+Rn,Oi=q.x,Mi=Oi+sn,Di=q.y,Wi=Di+xn,Xn=Math.max(gn,Oi),ji=Math.min(mi,Mi),bi=(Xn+ji)/2,lr=bi-gn,Xi=Math.max(Ai,Di),Hi=Math.min($i,Wi),nr=(Xi+Hi)/2,Fi=nr-Ai;k==null||k(le,ln);var Ni=Ve.right-ft.x-(Xt+ft.width),Ei=Ve.bottom-ft.y-(jt+ft.height);ht===1&&(Xt=Math.round(Xt),Ni=Math.round(Ni)),nt===1&&(jt=Math.round(jt),Ei=Math.round(Ei));var Bi={ready:!0,offsetX:Xt/ht,offsetY:jt/nt,offsetR:Ni/ht,offsetB:Ei/nt,arrowX:lr/ht,arrowY:Fi/nt,scaleX:ht,scaleY:nt,align:ln};J(Bi)}}),Ge=function(){me.current+=1;var lt=me.current;Promise.resolve().then(function(){me.current===lt&&Ce()})},He=function(){J(function(lt){return(0,T.Z)((0,T.Z)({},lt),{},{ready:!1})})};return(0,d.Z)(He,[be]),(0,d.Z)(function(){ge||He()},[ge]),[oe.ready,oe.offsetX,oe.offsetY,oe.offsetR,oe.offsetB,oe.arrowX,oe.arrowY,oe.scaleX,oe.scaleY,oe.align,Ge]}var gt=C(62730);function Le(ge,le,G,be,ke){(0,d.Z)(function(){if(ge&&le&&G){let me=function(){be(),ke()};var Ne=le,k=G,F=W(Ne),ee=W(k),oe=H(k),J=new Set([oe].concat((0,gt.Z)(F),(0,gt.Z)(ee)));return J.forEach(function(Te){Te.addEventListener("scroll",me,{passive:!0})}),oe.addEventListener("resize",me,{passive:!0}),be(),function(){J.forEach(function(Te){Te.removeEventListener("scroll",me),oe.removeEventListener("resize",me)})}}},[ge,le,G])}var Je=C(48736);function Et(ge,le,G,be,ke,Ne,k,F){var ee=y.useRef(ge);ee.current=ge;var oe=y.useRef(!1);y.useEffect(function(){if(le&&be&&(!ke||Ne)){var me=function(){oe.current=!1},Te=function(Pt){var xt;ee.current&&!k(((xt=Pt.composedPath)===null||xt===void 0||(xt=xt.call(Pt))===null||xt===void 0?void 0:xt[0])||Pt.target)&&!oe.current&&F(!1)},pe=H(be);pe.addEventListener("pointerdown",me,!0),pe.addEventListener("mousedown",Te,!0),pe.addEventListener("contextmenu",Te,!0);var _e=(0,l.A)(G);if(_e&&(_e.addEventListener("mousedown",Te,!0),_e.addEventListener("contextmenu",Te,!0)),0)var Ce,Ge,He,et;return function(){pe.removeEventListener("pointerdown",me,!0),pe.removeEventListener("mousedown",Te,!0),pe.removeEventListener("contextmenu",Te,!0),_e&&(_e.removeEventListener("mousedown",Te,!0),_e.removeEventListener("contextmenu",Te,!0))}}},[le,G,be,ke,Ne]);function J(){oe.current=!0}return J}var ot=["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 rn(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re.Z,le=y.forwardRef(function(G,be){var ke=G.prefixCls,Ne=ke===void 0?"rc-trigger-popup":ke,k=G.children,F=G.action,ee=F===void 0?"hover":F,oe=G.showAction,J=G.hideAction,me=G.popupVisible,Te=G.defaultPopupVisible,pe=G.onPopupVisibleChange,_e=G.afterPopupVisibleChange,Ce=G.mouseEnterDelay,Ge=G.mouseLeaveDelay,He=Ge===void 0?.1:Ge,et=G.focusDelay,lt=G.blurDelay,Pt=G.mask,xt=G.maskClosable,ut=xt===void 0?!0:xt,Gt=G.getPopupContainer,an=G.forceRender,Ct=G.autoDestroy,un=G.destroyPopupOnHide,Nn=G.popup,At=G.popupClassName,Qt=G.popupStyle,Re=G.popupPlacement,xe=G.builtinPlacements,Ae=xe===void 0?{}:xe,B=G.popupAlign,j=G.zIndex,te=G.stretch,q=G.getPopupClassNameFromAlign,we=G.fresh,vt=G.alignPoint,st=G.onPopupClick,ft=G.onPopupAlign,Mt=G.arrow,Sn=G.popupMotion,En=G.maskMotion,Ft=G.popupTransitionName,Yt=G.popupAnimation,kn=G.maskTransitionName,$n=G.maskAnimation,Rn=G.className,Bn=G.getTriggerDOMNode,xn=(0,De.Z)(G,ot),sn=Ct||un||!1,wn=y.useState(!1),zn=(0,de.Z)(wn,2),Hn=zn[0],Se=zn[1];(0,d.Z)(function(){Se((0,m.Z)())},[]);var Ee=y.useRef({}),_t=y.useContext(ye),ct=y.useMemo(function(){return{registerSubPopup:function(yn,ei){Ee.current[yn]=ei,_t==null||_t.registerSubPopup(yn,ei)}}},[_t]),tt=(0,w.Z)(),$t=y.useState(null),je=(0,de.Z)($t,2),Ve=je[0],ht=je[1],nt=y.useRef(null),Vt=(0,S.Z)(function(en){nt.current=en,(0,ie.Sh)(en)&&Ve!==en&&ht(en),_t==null||_t.registerSubPopup(tt,en)}),Zt=y.useState(null),It=(0,de.Z)(Zt,2),wt=It[0],he=It[1],Ie=y.useRef(null),Fe=(0,S.Z)(function(en){(0,ie.Sh)(en)&&wt!==en&&(he(en),Ie.current=en)}),Ue=y.Children.only(k),it=(Ue==null?void 0:Ue.props)||{},at={},qe=(0,S.Z)(function(en){var yn,ei,Qn=wt;return(Qn==null?void 0:Qn.contains(en))||((yn=(0,l.A)(Qn))===null||yn===void 0?void 0:yn.host)===en||en===Qn||(Ve==null?void 0:Ve.contains(en))||((ei=(0,l.A)(Ve))===null||ei===void 0?void 0:ei.host)===en||en===Ve||Object.values(Ee.current).some(function(ui){return(ui==null?void 0:ui.contains(en))||en===ui})}),yt=$(Ne,Sn,Yt,Ft),Dt=$(Ne,En,$n,kn),kt=y.useState(Te||!1),qt=(0,de.Z)(kt,2),Lt=qt[0],nn=qt[1],cn=me!=null?me:Lt,ln=(0,S.Z)(function(en){me===void 0&&nn(en)});(0,d.Z)(function(){nn(me||!1)},[me]);var Xt=y.useRef(cn);Xt.current=cn;var jt=y.useRef([]);jt.current=[];var dn=(0,S.Z)(function(en){var yn;ln(en),((yn=jt.current[jt.current.length-1])!==null&&yn!==void 0?yn:cn)!==en&&(jt.current.push(en),pe==null||pe(en))}),Rt=y.useRef(),Nt=function(){clearTimeout(Rt.current)},Kt=function(yn){var ei=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Nt(),ei===0?dn(yn):Rt.current=setTimeout(function(){dn(yn)},ei*1e3)};y.useEffect(function(){return Nt},[]);var pn=y.useState(!1),Jt=(0,de.Z)(pn,2),fn=Jt[0],An=Jt[1];(0,d.Z)(function(en){(!en||cn)&&An(!0)},[cn]);var Pn=y.useState(null),ni=(0,de.Z)(Pn,2),Fn=ni[0],On=ni[1],Zn=y.useState(null),ai=(0,de.Z)(Zn,2),qn=ai[0],Yn=ai[1],on=function(yn){Yn([yn.clientX,yn.clientY])},bt=Tt(cn,Ve,vt&&qn!==null?qn:wt,Re,Ae,B,ft),mt=(0,de.Z)(bt,11),Ht=mt[0],Wt=mt[1],hn=mt[2],Gn=mt[3],Vn=mt[4],Mn=mt[5],ri=mt[6],ci=mt[7],yi=mt[8],wi=mt[9],In=mt[10],Li=Oe(Hn,ee,oe,J),Ti=(0,de.Z)(Li,2),gi=Ti[0],oi=Ti[1],gn=gi.has("click"),mi=oi.has("click")||oi.has("contextMenu"),Ai=(0,S.Z)(function(){fn||In()}),$i=function(){Xt.current&&vt&&mi&&Kt(!1)};Le(cn,wt,Ve,Ai,$i),(0,d.Z)(function(){Ai()},[qn,Re]),(0,d.Z)(function(){cn&&!(Ae!=null&&Ae[Re])&&Ai()},[JSON.stringify(B)]);var Oi=y.useMemo(function(){var en=V(Ae,Ne,wi,vt);return p()(en,q==null?void 0:q(wi))},[wi,q,Ae,Ne,vt]);y.useImperativeHandle(be,function(){return{nativeElement:Ie.current,popupElement:nt.current,forceAlign:Ai}});var Mi=y.useState(0),Di=(0,de.Z)(Mi,2),Wi=Di[0],Xn=Di[1],ji=y.useState(0),bi=(0,de.Z)(ji,2),lr=bi[0],Xi=bi[1],Hi=function(){if(te&&wt){var yn=wt.getBoundingClientRect();Xn(yn.width),Xi(yn.height)}},nr=function(){Hi(),Ai()},Fi=function(yn){An(!1),In(),_e==null||_e(yn)},Ni=function(){return new Promise(function(yn){Hi(),On(function(){return yn})})};(0,d.Z)(function(){Fn&&(In(),Fn(),On(null))},[Fn]);function Ei(en,yn,ei,Qn){at[en]=function(ui){var zi;Qn==null||Qn(ui),Kt(yn,ei);for(var Qi=arguments.length,Ui=new Array(Qi>1?Qi-1:0),ir=1;ir<Qi;ir++)Ui[ir-1]=arguments[ir];(zi=it[en])===null||zi===void 0||zi.call.apply(zi,[it,ui].concat(Ui))}}(gn||mi)&&(at.onClick=function(en){var yn;Xt.current&&mi?Kt(!1):!Xt.current&&gn&&(on(en),Kt(!0));for(var ei=arguments.length,Qn=new Array(ei>1?ei-1:0),ui=1;ui<ei;ui++)Qn[ui-1]=arguments[ui];(yn=it.onClick)===null||yn===void 0||yn.call.apply(yn,[it,en].concat(Qn))});var Bi=Et(cn,mi,wt,Ve,Pt,ut,qe,Kt),Ri=gi.has("hover"),fi=oi.has("hover"),vi,hi;Ri&&(Ei("onMouseEnter",!0,Ce,function(en){on(en)}),Ei("onPointerEnter",!0,Ce,function(en){on(en)}),vi=function(yn){(cn||fn)&&Ve!==null&&Ve!==void 0&&Ve.contains(yn.target)&&Kt(!0,Ce)},vt&&(at.onMouseMove=function(en){var yn;(yn=it.onMouseMove)===null||yn===void 0||yn.call(it,en)})),fi&&(Ei("onMouseLeave",!1,He),Ei("onPointerLeave",!1,He),hi=function(){Kt(!1,He)}),gi.has("focus")&&Ei("onFocus",!0,et),oi.has("focus")&&Ei("onBlur",!1,lt),gi.has("contextMenu")&&(at.onContextMenu=function(en){var yn;Xt.current&&oi.has("contextMenu")?Kt(!1):(on(en),Kt(!0)),en.preventDefault();for(var ei=arguments.length,Qn=new Array(ei>1?ei-1:0),ui=1;ui<ei;ui++)Qn[ui-1]=arguments[ui];(yn=it.onContextMenu)===null||yn===void 0||yn.call.apply(yn,[it,en].concat(Qn))}),Rn&&(at.className=p()(it.className,Rn));var Ot=(0,T.Z)((0,T.Z)({},it),at),_n={},bn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];bn.forEach(function(en){xn[en]&&(_n[en]=function(){for(var yn,ei=arguments.length,Qn=new Array(ei),ui=0;ui<ei;ui++)Qn[ui]=arguments[ui];(yn=Ot[en])===null||yn===void 0||yn.call.apply(yn,[Ot].concat(Qn)),xn[en].apply(xn,Qn)})});var Dn=y.cloneElement(Ue,(0,T.Z)((0,T.Z)({},Ot),_n)),Jn={x:Mn,y:ri},li=Mt?(0,T.Z)({},Mt!==!0?Mt:{}):null;return y.createElement(y.Fragment,null,y.createElement(fe.Z,{disabled:!cn,ref:Fe,onResize:nr},y.createElement(ne,{getTriggerDOMNode:Bn},Dn)),y.createElement(ye.Provider,{value:ct},y.createElement(se,{portal:ge,ref:Vt,prefixCls:Ne,popup:Nn,className:p()(At,Oi),style:Qt,target:wt,onMouseEnter:vi,onMouseLeave:hi,onPointerEnter:vi,zIndex:j,open:cn,keepDom:fn,fresh:we,onClick:st,onPointerDownCapture:Bi,mask:Pt,motion:yt,maskMotion:Dt,onVisibleChanged:Fi,onPrepare:Ni,forceRender:an,autoDestroy:sn,getPopupContainer:Gt,align:wi,arrow:li,arrowPos:Jn,ready:Ht,offsetX:Wt,offsetY:hn,offsetR:Gn,offsetB:Vn,onAlign:Ai,stretch:te,targetWidth:Wi/ci,targetHeight:lr/yi})))});return le}var Ze=rn(re.Z)},28426:function(vn,St,C){"use strict";var T=C(59301),de=C(93314),De=C(99571),re=Object.defineProperty,M=Object.defineProperties,p=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,S=(y,x,N)=>x in y?re(y,x,{enumerable:!0,configurable:!0,writable:!0,value:N}):y[x]=N,w=(y,x)=>{for(var N in x||(x={}))ie.call(x,N)&&S(y,N,x[N]);if(fe)for(var N of fe(x))l.call(x,N)&&S(y,N,x[N]);return y},d=(y,x)=>M(y,p(x));const m=({img:y,buttonProps:x={},styles:N={},customText:U,ButtonText:K,ButtonClick:D,Buttonclass:A,ButtonTwo:P,imgStyles:z,loading:se=!1,className:ae=""})=>T.createElement("section",{className:`tc animated fadeIn ${ae}`,style:w({color:"#999",margin:"100px auto",visibility:se?"hidden":"visible"},N)},T.createElement("img",{src:y||de,style:d(w({},z),{pointerEvents:"none",userSelect:"none"})}),T.createElement("p",{className:"mt20 font14"},U||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),K&&T.createElement(De.ZP,w({className:A,onClick:D},x),K),P&&P);St.Z=m},45677:function(vn,St,C){"use strict";C.d(St,{Z:function(){return A}});var T=C(59301),de={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},De=C(99571),re=C(70557),M=C(75975),p=C(25399),fe=C(51257),ie=C(81722),l=C(28426),S=C(346),w=C(44203),d=C(59301),m=Object.defineProperty,y=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,U=(P,z,se)=>z in P?m(P,z,{enumerable:!0,configurable:!0,writable:!0,value:se}):P[z]=se,K=(P,z)=>{for(var se in z||(z={}))x.call(z,se)&&U(P,se,z[se]);if(y)for(var se of y(z))N.call(z,se)&&U(P,se,z[se]);return P},D=(P,z,se)=>new Promise((ae,ne)=>{var Q=Oe=>{try{ce(se.next(Oe))}catch(Z){ne(Z)}},ye=Oe=>{try{ce(se.throw(Oe))}catch(Z){ne(Z)}},ce=Oe=>Oe.done?ae(Oe.value):Promise.resolve(Oe.value).then(Q,ye);ce((se=se.apply(P,z)).next())}),A=({editOffice:P="view",data:z,issaver:se,onSaver:ae,theme:ne,type:Q,filename:ye,monacoEditor:ce,className:Oe,style:Z,close:L,onClose:V,hasMask:$,disabledDownload:H,onImgDimensions:W,showNodata:_,recordInfo:g})=>{const[O,Y]=(0,T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Pe,Me]=(0,T.useState)(""),[Xe,Ye]=(0,T.useState)(),Tt=window.ENV==="build"?"/react/build":"",gt=location.host.startsWith("localhost")?S.Z.PROXY_SERVER:S.Z.API_SERVER,Je=10*(1024*1024),Et=(0,T.useRef)();z!=null&&z.startsWith("/api")&&Q!=="txt"&&(z=S.Z.API_SERVER+z);const ot=G=>G.substring(G.lastIndexOf("/")+1).split(".").pop();ye&&ce&&(ce.filename=ye),(0,T.useEffect)(()=>{var G,be;const ke=(be=(G=document.cookie)==null?void 0:G.replace(/\s/g,""))==null?void 0:be.split(";");ke==null||ke.map(Ne=>{let k=Ne.split("=");k[0]==="_educoder_session"&&Me(k[1])})},[]),(0,T.useEffect)(()=>{Q==="office"&&(z.indexOf("bigfilescdn.")>-1||z.indexOf("bigfiles1")>-1?Ye({url:z,fileType:ot(z),model:z.indexOf("model=edit")?"edit":"view"}):Ze())},[Q,z]);function rn(G){return D(this,null,function*(){G.data.type==="pdfdata"&&(ae(G.data.data),window.removeEventListener("message",rn,!1)),console.log("mess---:",G.data)})}const Ze=()=>D(void 0,null,function*(){console.log("data:",z);let G=z;z.startsWith("http")||(G=location.origin+G);let be=new URL(G).pathname.split("/").pop();const ke=yield(0,ie.gJ)({attachment_id:be});ke.url=gt+ke.url,Ye(ke)}),ge=()=>{if(z.startsWith("http")||z.startsWith("blob:")){le();return}(0,fe.Sv)(ye||"educoder",z,ye)},le=()=>{g&&(0,w.fc)({id:g==null?void 0:g.id,watch_type:1,course_id:g==null?void 0:g.course_id}),(0,fe.Nd)(ye||"educoder",decodeURIComponent(z))};return d.createElement("div",{style:K({},Z||{}),className:`${$&&de.bgBlack} ${Q?de.wrp:"hide"}`},L&&d.createElement("div",{className:de.close,ref:Et},!!W&&d.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Et.current},d.createElement("span",{onClick:()=>{V(),W()}},d.createElement("i",{className:"icon-yulanpizhu"}))),!H&&d.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Et.current},d.createElement("span",{onClick:le},d.createElement("i",{className:"icon-quxiaozhiding"}))),se&&d.createElement(p.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Et.current},d.createElement("span",{className:"",onClick:()=>{const G=document.getElementById("pdfiframe");window.addEventListener("message",rn,!1),setTimeout(()=>{G.contentWindow.postMessage("getData","*")},300)}},d.createElement("i",{className:"icon-baocun"}))),d.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Et.current},d.createElement("span",{className:"",onClick:()=>{V()}},d.createElement("i",{className:"icon-guanbi1"})))),d.createElement("div",{className:`${de[Oe]} ${Oe} ${de.monaco} ${Q==="txt"?"show":"hide"}`},Q==="txt"&&d.createElement(d.Fragment,null,d.createElement(M.ZP,K({},ce)))),Q==="audio"&&d.createElement("audio",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${z}`,autoPlay:!0}),Q==="video"&&d.createElement(d.Fragment,null,(z==null?void 0:z.indexOf("http"))>-1?d.createElement("video",{controls:!0,src:`${z}`,autoPlay:!0}):d.createElement("video",{controls:!0,src:`data:video/mp4;base64,${z}`,autoPlay:!0})),Q==="office"&&Xe&&d.createElement("iframe",{src:`${Tt}/office.html?key=${Xe.key}&url=${btoa(Xe.url)}&callbackUrl=${gt+(Xe.callbackUrl||"")}&fileType=${Xe.fileType}&title=${Xe.title||""}&model=${P}&officeServer=${S.Z.ONLYOFFICE}&disabledDownload=${!!H}`}),Q==="html"&&d.createElement("iframe",{src:z+"&disposition=inline"}),Q==="pdf"&&d.createElement("iframe",{id:"pdfiframe",src:`${Tt}/js/pdfview/index.html?filename=${ye||"educoder.pdf"}&url=${encodeURIComponent(z)}&disabledDownload=${!!H}&model=${P}`}),Q==="image"&&d.createElement("img",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:image/png;base64,"}${z}`}),(Q==="other"||Q==="download")&&d.createElement(d.Fragment,null,_?d.createElement(l.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:d.createElement(De.ZP,{icon:d.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:ge,disabled:H},"\u4E0B\u8F7D")}):d.createElement(De.ZP,{type:"primary",size:"middle",onClick:ge,disabled:H},d.createElement(re.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},76902:function(vn,St,C){"use strict";C.d(St,{z:function(){return ne},Z:function(){return Q}});var T=C(59301),de=C(8944),De=C(81428),re=C(64018),M=C(79710),p=C(346),fe=C(51257),ie=C(15342),l=C(1012),S=C(45677),w=C(59301),m=({html:ye})=>{const ce=(0,T.useRef)(null),Oe=(0,T.useRef)(null),Z=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 56px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,T.useEffect)(()=>{const L=ce.current.attachShadow({mode:"open"});Oe.current=document.createElement("div"),Oe.current.className="markdown-body",Oe.current.innerHTML=ye,L.appendChild(Oe.current);const V=document.createElement("style");return V.textContent=Z,L.appendChild(V),()=>{L.innerHTML=""}},[]),(0,T.useEffect)(()=>{Oe.current&&(Oe.current.innerHTML=ye)},[ye]),w.createElement("div",{ref:ce})};function y(ye){const ce=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Oe=new RegExp(`\\b(${ce.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return ye.replace(Oe,"").trim()}var x=Object.defineProperty,N=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,D=(ye,ce,Oe)=>ce in ye?x(ye,ce,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):ye[ce]=Oe,A=(ye,ce)=>{for(var Oe in ce||(ce={}))U.call(ce,Oe)&&D(ye,Oe,ce[Oe]);if(N)for(var Oe of N(ce))K.call(ce,Oe)&&D(ye,Oe,ce[Oe]);return ye};const P="@\u2581\u2581@",z="@\u2581@",se=/<pre[^>]*>/g;function ae(ye){let ce=document.createElement("div");return ce.innerHTML=ye,ce.childNodes.length===0?"":ce.childNodes[0].nodeValue}const ne=(ye,ce)=>{ye=ye||"";const Oe=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Z=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,L=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,V=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ce?ye.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Oe,($,H,W,_,g,O,Y)=>{const Pe=H||_||O,Me=W||g||Y||"?";return p.Z.API_SERVER+"/api/attachments/"+Pe+Me+"&t="+(0,fe.Jn)(Pe,Date.now())+($.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(ye=ye.replace(V,($,H,W,_,g,O,Y)=>{const Pe=H||_||O,Me=W||g||Y||"?";return p.Z.API_SERVER+"/attachments/download/"+Pe+Me+"&t="+(0,fe.Jn)(Pe,Date.now())+($.indexOf(")")>-1?")":"&")}).replace(Oe,($,H,W,_,g,O,Y)=>{const Pe=H||_||O,Me=W||g||Y||"?";return p.Z.API_SERVER+"/api/attachments/"+Pe+Me+"&t="+(0,fe.Jn)(Pe,Date.now())+($.indexOf(")")>-1?")":"&")}).replace(Z,($,H,W,_,g)=>{const O=H||_,Y=W||g||"";return'"'+p.Z.API_SERVER+"/api/attachments/"+O+Y+O+Y+"&t="+(0,fe.Jn)(O,Date.now())}).replace(L,($,H,W,_,g)=>{const O=H||_,Y=W||g||"";return"("+p.Z.API_SERVER+"/files/uploads/"+O+Y+O+Y+"&t="+(0,fe.Jn)(O,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),ye)};var Q=({value:ye="",className:ce,showTextOnly:Oe,showLines:Z,style:L={},stylesPrev:V={},highlightKeywords:$,showProgramFill:H,isProgramFill:W,disabledFill:_=!1,programFillValue:g,onFillChange:O=Me=>{},onFillBlur:Y=()=>{},onFillFocus:Pe=()=>{}})=>{let Me=y(String(ye||""));const[Xe,Ye]=(0,T.useState)(""),[Tt,gt]=(0,T.useState)("office"),[Le,Je]=(0,T.useState)([]),Et=(0,T.useRef)("a"+(0,l.Z)()),ot={},rn=J=>/<style[\s\S]*?>/i.test(J||""),Ze=(J,me,Te)=>{const pe=document.createElement(J===z?"input":"textarea");pe.style.width="100%",pe.style.height=J===z?"40px":"151px",pe.rows=5,pe.spellcheck=!1,pe.name="edu-program-fill",pe.placeholder="\u8BF7\u8F93\u5165",pe.dataset.id=me;const _e=Object.keys(ot).length;return ot[_e]=pe,`<span class="edu-program-fill-wrap ${J===z?"":"show"}" style="width:${J===z?"400px":"100%"}" title=${Te||""}><span>${pe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function ge(J){return J=J.replace(/!\[.*?\]\(.*?\)/g,""),J=J.replace(/\[.*?\]\(.*?\)/g,""),J=J.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),J=J.replace(/<embed.*?>/g,""),J=J.replace(/<img.*?>/g,""),J=J.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),J=J.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),J=J.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),J=J.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),J}const le=J=>!Oe&&rn(Me)?J:J.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(me,Te){let pe=Te.replace(/(\n|\r)/g,"").split("}"),_e=[];return pe.map(Ce=>{Ce!=""&&_e.push(`.${Et.current} ${Ce}`)}),`<style>${_e.join("}")}</style>`}),G=(0,T.useMemo)(()=>{try{const pe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,_e=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ce=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Ge=/\(\/attachments\/download\//g;Me=Me.replace(Ge,"("+p.Z.API_SERVER+"/attachments/download/").replace(pe,"("+p.Z.API_SERVER+"/api/attachments/").replace(_e,'"'+p.Z.API_SERVER+"/api/attachments/").replace(Ce,'"'+p.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(pe){}if(H){let pe=-1;return Me=Me.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(_e,Ce,Ge){var He;return++pe,Ze(_e,pe,(He=g==null?void 0:g[pe])==null?void 0:He.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${le(Me||"")}</pre>`}let J=le(Me);J=(0,De.ZP)(J);const me=(0,De.ez)();Me.match(/\[TOC\]/)&&(J=J.replace("<p>[TOC]</p>",(0,De.Qv)()),(0,De.Iy)()),J=J.replace(/(__special_katext_id_\d+__)/g,(pe,_e)=>{const{type:Ce,expression:Ge}=me[_e];return(0,ie.renderToString)(ae(Ge)||"",{displayMode:Ce==="block",throwOnError:!1,output:"html"})}),J=J.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,De.AL)();const Te=document.createElement("div");if(Te.innerHTML=J,Oe)return Te.innerText;if($){const pe=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return k(Te,pe),Te.innerHTML}return setTimeout(()=>oe(),500),Te.innerHTML},[Me,$]);(0,T.useEffect)(()=>{F.current&&F.current.querySelectorAll(["input","textarea"]).forEach(me=>{me.oninput=be,me.onblur=ke,me.onfocus=Ne})},[Le]),(0,T.useEffect)(()=>{var J,me,Te,pe,_e;if(g!=null&&g.length)try{const Ce=F.current.querySelectorAll(".edu-program-fill-score"),Ge=F.current.querySelectorAll('[name="edu-program-fill"]');for(const[He,et]of Ge.entries())et.value=((J=g==null?void 0:g[He])==null?void 0:J.value)||"",((me=g==null?void 0:g[He])==null?void 0:me.type)==="warning"?et.className="program-fill-warning":((Te=g==null?void 0:g[He])==null?void 0:Te.type)==="success"?et.className="program-fill-success":et.className="";for(const[He,et]of Ce.entries())et.innerHTML=(pe=g==null?void 0:g[He])!=null&&pe.score?`${(_e=g==null?void 0:g[He])==null?void 0:_e.score}\u5206`:"";Je(g)}catch(Ce){console.log(Ce,"error")}},[g]);const be=J=>{Le[J.target.dataset.id]=Le[J.target.dataset.id]||{},Le[J.target.dataset.id].value=J.target.value,Je([...Le]),O(Le,J.target.dataset.id)},ke=J=>{Le[J.target.dataset.id]=Le[J.target.dataset.id]||{},Le[J.target.dataset.id].value=J.target.value,Je([...Le]),Y(Le,J.target.dataset.id)},Ne=J=>{Le[J.target.dataset.id]=Le[J.target.dataset.id]||{},Le[J.target.dataset.id].value=J.target.value,Je([...Le]),Pe(Le,J.target.dataset.id)};function k(J,me){return J.childNodes.forEach(Te=>{var pe;if(Te.childNodes.length>0)k(Te,me);else if(Te.nodeName!=="IMG")if(Te.innerHTML)Te.innerHTML=(pe=Te.innerHTML)==null?void 0:pe.replace(new RegExp(me,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const _e=document.createElement("span");_e.innerHTML=Te.textContent.replace(new RegExp(me,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Te.replaceWith(_e)}})}const F=(0,T.useRef)();De.jb.WebkitLineClamp=Z,Z&&(L=A(A({},L),De.jb));function ee(J){let me=J.target;if(me.tagName.toUpperCase()==="A"){let Te=me.getAttribute("href");if(Te.indexOf("office")>-1)J.preventDefault(),Ye(Te),gt("office");else if(Te.indexOf("application/pdf")>-1)J.preventDefault(),Ye(Te),gt("pdf");else if(Te.indexOf("text/html")>-1)J.preventDefault(),Ye(Te),gt("html");else if(Te.startsWith("#")){J.preventDefault();let pe=document.getElementById(Te.replace("#",""));pe&&pe.scrollIntoView(!0)}}}const oe=()=>{var J;const me=(J=F.current)==null?void 0:J.querySelectorAll("video");me==null||me.forEach(Te=>{if(Te.oncontextmenu=()=>!1,Te.src.indexOf(".m3u8")>-1&&!Te.canPlayType("application/vnd.apple.mpegurl")){if(M.ZP.isSupported()){var pe=new M.ZP;pe.loadSource(Te.src),pe.attachMedia(Te)}}})};return(0,T.useEffect)(()=>{if(F.current&&G&&G.match(se)&&window.PR.prettyPrint(),F.current)return F.current.addEventListener("click",ee),()=>{var J;(J=F.current)==null||J.removeEventListener("click",ee),(0,De.AL)(),(0,De.Iy)()}},[G,F.current,ee]),(0,T.useEffect)(()=>{var J;const me=Te=>{Te.preventDefault(),Te.clipboardData.setData("text",window.getSelection().toString())};return(J=F.current)==null||J.addEventListener("copy",me),()=>{var Te;(Te=F.current)==null||Te.removeEventListener("copy",me)}},[F.current]),T.createElement(T.Fragment,null,Oe&&T.createElement("div",{ref:F},G),!Oe&&!rn(G)&&T.createElement("div",{ref:F,style:A({},L),className:`${ce||""} ${_?"disabled-fill":""} markdown-body ${Et.current}`,dangerouslySetInnerHTML:{__html:G}}),!Oe&&rn(G)&&T.createElement(m,{html:G}),T.createElement(S.Z,{close:!0,data:Xe,type:Xe!=null&&Xe.length?Tt:"",style:A({},V),onClose:()=>Ye("")}))}},75975:function(vn,St,C){"use strict";C.d(St,{SV:function(){return k},ZP:function(){return Ne}});var T=C(59301),de=C(76374);const De={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},re={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},M={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},p={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},fe={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var ie=C(53184),l=C.n(ie),S=Object.defineProperty,w=Object.defineProperties,d=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,N=(F,ee,oe)=>ee in F?S(F,ee,{enumerable:!0,configurable:!0,writable:!0,value:oe}):F[ee]=oe,U=(F,ee)=>{for(var oe in ee||(ee={}))y.call(ee,oe)&&N(F,oe,ee[oe]);if(m)for(var oe of m(ee))x.call(ee,oe)&&N(F,oe,ee[oe]);return F},K=(F,ee)=>w(F,d(ee)),D=(F,ee,oe)=>new Promise((J,me)=>{var Te=Ce=>{try{_e(oe.next(Ce))}catch(Ge){me(Ge)}},pe=Ce=>{try{_e(oe.throw(Ce))}catch(Ge){me(Ge)}},_e=Ce=>Ce.done?J(Ce.value):Promise.resolve(Ce.value).then(Te,pe);_e((oe=oe.apply(F,ee)).next())});const A={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},P=(F,ee)=>ee.map(oe=>({label:oe,kind:F.languages.CompletionItemKind.Keyword,insertText:oe})),z=F=>Object.keys(A.tables).map(ee=>({label:ee,kind:F.languages.CompletionItemKind.Variable,insertText:ee})),se=(F,ee)=>{const oe=A.tables[F];return oe?oe.map(J=>({label:J,kind:ee.languages.CompletionItemKind.Field,insertText:J})):[]};function ae(F,ee,oe,J,me){let Te=ee.getWordUntilPosition(oe),pe={startLineNumber:oe.lineNumber,endLineNumber:oe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},_e=J.map(Ce=>({label:Ce,kind:F.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}));return me.map(Ce=>{_e.push(K(U({},Ce),{range:pe}))}),_e}var ne=F=>{A.languages.map(me=>(F.languages.registerDocumentFormattingEditProvider(me,{provideDocumentFormattingEdits(Te,pe,_e){return D(this,null,function*(){const Ce=l()(Te.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:Te.getFullModelRange(),text:Ce}]})}}),me));const ee=M.quickKey.map(me=>({label:me.label,kind:F.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),oe=p.quickKey.map(me=>({label:me.label,kind:F.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),J=re.quickKey.map(me=>({label:me.label,kind:F.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}));F.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(me,Te){var pe=me.getWordUntilPosition(Te),_e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ce=me.getLineContent(Te.lineNumber).substring(pe.startColumn-2,pe.endColumn);return{suggestions:[...M.keywords.map(Ge=>({label:Ge,kind:F.languages.CompletionItemKind.Function,documentation:Ge,insertText:Ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...M.quickKey.map(Ge=>({label:Ge.label,kind:F.languages.CompletionItemKind.Function,documentation:Ge.content,insertText:Ce.startsWith("#")?Ge.content.replace(/#/,""):Ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(me,Te){var pe=me.getWordUntilPosition(Te),_e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn};return{suggestions:[...De.keywords.map(Ce=>({label:Ce,kind:F.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(me,Te){var pe=me.getWordUntilPosition(Te),_e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ce=me.getLineContent(Te.lineNumber).substring(pe.startColumn-2,pe.endColumn);return{suggestions:[...re.keywords.map(Ge=>({label:Ge,kind:F.languages.CompletionItemKind.Function,documentation:Ge,insertText:Ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...re.quickKey.map(Ge=>({label:Ge.label,kind:F.languages.CompletionItemKind.Function,documentation:Ge.content,insertText:Ce.startsWith("#")?Ge.content.replace(/#/,""):Ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(me,Te){var pe=me.getWordUntilPosition(Te),_e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ce=me.getLineContent(Te.lineNumber).substring(pe.startColumn-2,pe.endColumn);return{suggestions:[...fe.keywords.map(Ge=>({label:Ge,kind:F.languages.CompletionItemKind.Function,documentation:Ge,insertText:Ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...fe.quickKey.map(Ge=>({label:Ge.label,kind:F.languages.CompletionItemKind.Function,documentation:Ge.content,insertText:Ce.startsWith("#")?Ge.content.replace(/#/,""):Ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}}),F.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(me,Te){var pe=me.getWordUntilPosition(Te),_e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ce=me.getLineContent(Te.lineNumber).substring(pe.startColumn-2,pe.endColumn);return{suggestions:[...p.keywords.map(Ge=>({label:Ge,kind:F.languages.CompletionItemKind.Function,documentation:Ge,insertText:Ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e})),...p.quickKey.map(Ge=>({label:Ge.label,kind:F.languages.CompletionItemKind.Function,documentation:Ge.content,insertText:Ce.startsWith("#")?Ge.content.replace(/#/,""):Ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}))]}}})};const Q="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var ye=Object.defineProperty,ce=(F,ee,oe)=>ee in F?ye(F,ee,{enumerable:!0,configurable:!0,writable:!0,value:oe}):F[ee]=oe,Oe=(F,ee,oe)=>ce(F,typeof ee!="symbol"?ee+"":ee,oe);const Z=class Qo{constructor(ee,oe,J){this.placeholder=ee,this.editor=oe,this.monaco=J,oe.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Qo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Oe(Z,"ID","editor.widget.placeholderHint");var V=Z,$=C(96236),H=C(6767),W=C(25399),_=C(89392),g=C(49535),O=C(56102),Y=Object.defineProperty,Pe=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,gt=(F,ee,oe)=>ee in F?Y(F,ee,{enumerable:!0,configurable:!0,writable:!0,value:oe}):F[ee]=oe,Le=(F,ee)=>{for(var oe in ee||(ee={}))Ye.call(ee,oe)&>(F,oe,ee[oe]);if(Xe)for(var oe of Xe(ee))Tt.call(ee,oe)&>(F,oe,ee[oe]);return F},Je=(F,ee)=>Pe(F,Me(ee)),Et=(F,ee)=>{var oe={};for(var J in F)Ye.call(F,J)&&ee.indexOf(J)<0&&(oe[J]=F[J]);if(F!=null&&Xe)for(var J of Xe(F))ee.indexOf(J)<0&&Tt.call(F,J)&&(oe[J]=F[J]);return oe},ot=(F,ee,oe)=>new Promise((J,me)=>{var Te=Ce=>{try{_e(oe.next(Ce))}catch(Ge){me(Ge)}},pe=Ce=>{try{_e(oe.throw(Ce))}catch(Ge){me(Ge)}},_e=Ce=>Ce.done?J(Ce.value):Promise.resolve(Ce.value).then(Te,pe);_e((oe=oe.apply(F,ee)).next())});function rn(F){return/^\d+$/.test(F)?`${F}px`:F}function Ze(){}let ge=!1;const le={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function G(F=[]){let ee=F;if(Array.isArray(F)){for(let oe=0;oe<F.length;oe++){let J=le[F[oe]];if(J)return J}return ee[0]}return le[ee]||ee}let be=null;const ke=()=>ot(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(F){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",F)}});var Ne=F=>{var ee=F,{width:oe="100%",height:J="100%",value:me,language:Te="javascript",style:pe={},options:_e={},overrideServices:Ce={},theme:Ge="vs-dark",onEditBlur:He,isCopy:et=!1,onSave:lt,autoHeight:Pt=!1,forbidCopy:xt=!1,onChange:ut=Ze,editorDidMount:Gt=Ze,onFocus:an=Ze,onBreakPoint:Ct=Ze,breakPointValue:un=[],filename:Nn="educoder.txt",errorLine:At,errorContent:Qt="",highlightLine:Re,openBreakPoint:xe=!1,placeholder:Ae="",showMiniMap:B=!0}=ee,j=Et(ee,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const te=(0,T.useRef)(),q=(0,T.useRef)({}),we=(0,T.useRef)(),vt=(0,T.useRef)(),st=(0,T.useRef)([]),ft=(0,T.useRef)(!1),Mt=(0,T.useRef)(),Sn=(0,T.useRef)(),En=(0,T.useRef)(!1),[Ft,Yt]=(0,T.useState)(!1);function kn(){let je;return te.current&&(je=new de.Z(Ve=>{for(let ht of Ve)(ht.target.offsetHeight>0||ht.target.offsetWidth>0)&&q.current.instance.layout()}),je.observe(te.current)),je}function $n(){H.ZP.warning({content:decodeURIComponent(Q),key:"monaco-editor-tip"})}const Rn=()=>{let je=q.current.instance;if(me!=null&&je&&Ft){const Ve=je.getModel();Ve&&me!==Ve.getValue()&&(ge=!0,Ve.setValue(me),je.layout(),ge=!1)}};(0,T.useEffect)(()=>{const je=g.Z.subscribe("formatDocument",Ve=>{var ht;let nt=q.current.instance;(ht=nt==null?void 0:nt.getAction)==null||ht.call(nt,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ve=>{ut(Ve)},je},[]),(0,T.useEffect)(()=>{var je;let Ve=q.current.instance;vt.current&&clearTimeout(vt.current),vt.current=setTimeout(()=>{Rn()},500),me&&(me!=null&&me.length)&&((je=Ve==null?void 0:Ve.updateOptions)==null||je.call(Ve,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(me.split(/\r\n|\r|\n/g).length))+3,5)}))},[me,Ft,q.current]),(0,T.useEffect)(()=>{if(At&&q.current&&q.current.instance){let Ve=q.current.instance;Ve.changeViewZones(function(ht){var nt=document.createElement("div");nt.style.padding="10px 20px",nt.style.width="calc(100% - 20px)",nt.className="my-error-line-wrp",nt.innerHTML=Qt,ht.addZone({afterLineNumber:At||11,heightInLines:3,domNode:nt})});var je={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ve.addOverlayWidget(je),Ve.revealPositionInCenter({lineNumber:20,column:1})}},[At,q.current,Ft]);const Bn=(je="",Ve)=>{if(!je||je.trim()==="")return!0;const nt=q.current.instance.getModel().getLineTokens(Ve);let Vt=!1;for(let Zt=0;Zt<2;Zt++)nt.getStandardTokenType(Zt)===1&&(Vt=!0);return Vt};(0,T.useEffect)(()=>{var je;const Ve=(je=q.current)==null?void 0:je.instance;if(Ve&&Ft&&xt){const ht=Ve.onDidBlurEditorWidget(()=>{En.current=!1}),nt=Ve.onDidFocusEditorText(()=>{En.current=!0});return()=>{ht.dispose(),nt.dispose()}}},[q.current,Ft,xt]),(0,T.useEffect)(()=>{var je;if((je=q.current)!=null&&je.instance&&Ft&&xe){let Ve=q.current.instance,ht=Ve.getModel();if(!ht)return;(()=>{var qe;let yt=[],Dt=[];const kt=ht.getAllDecorations();for(let Lt of kt)Lt.options.className==="highlighted-line"&&(yt.push((qe=Lt==null?void 0:Lt.range)==null?void 0:qe.startLineNumber),Dt.push(Lt==null?void 0:Lt.id));if(Re===yt[0])return;ht.deltaDecorations(Dt,[]);const qt=ht.getLineCount();Re&&Re<=qt&&(Ve.deltaDecorations([],[{range:new be.Range(Re,1,Re,ht.getLineMaxColumn(Re)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ve.revealLineInCenter(Re))})();const Vt=(qe=!1)=>{var yt;let Dt=[],kt=[];const qt=ht.getAllDecorations();for(let Lt of qt)Lt.options.linesDecorationsClassName==="breakpoints-select"&&(Dt.push((yt=Lt==null?void 0:Lt.range)==null?void 0:yt.startLineNumber),kt.push(Lt==null?void 0:Lt.id));if(qe)return{lines:Dt,ids:kt};Ct(Dt)},Zt=qe=>ot(void 0,null,function*(){let yt={range:new be.Range(qe,1,qe,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ht.deltaDecorations([],[yt]),Vt()}),It=qe=>ot(void 0,null,function*(){let yt=[];const Dt=Ve.getLineDecorations(qe);for(let kt of Dt)kt.options.linesDecorationsClassName==="breakpoints-select"&&yt.push(kt.id);yield ht.deltaDecorations(yt,[]),Vt()}),wt=qe=>{let yt=Ve.getLineDecorations(qe);for(let Dt of yt)if(Dt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,_.isEqual)(un,Vt(!0).lines)){ht.deltaDecorations(Vt(!0).ids,[]);const qe=un.map(yt=>({range:new be.Range(yt,1,yt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ht.deltaDecorations([],qe)}const he=Ve.onDidChangeModelContent(qe=>{let yt=Ve.getPosition();if(yt){let Dt=yt.lineNumber;clearTimeout(Sn.current),Sn.current=setTimeout(()=>{Bn(ht.getLineContent(Dt),Dt)?It(Dt):wt(Dt)?(It(Dt),Zt(Dt)):Vt()},100)}}),Ie=Ve.onMouseDown(qe=>{var yt,Dt,kt;if(qe.target.detail&&((kt=(Dt=(yt=qe.target)==null?void 0:yt.element)==null?void 0:Dt.className)!=null&&kt.includes("line-numbers"))){let qt=qe.target.position.lineNumber;if(Bn(ht.getLineContent(qt),qt))return;wt(qt)?It(qt):Zt(qt)}}),Fe=qe=>{let yt={range:new be.Range(qe,1,qe,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};st.current=Ve.deltaDecorations(st.current,[yt])},Ue=()=>{st.current=Ve.deltaDecorations(st.current,[])},it=Ve.onMouseMove(qe=>{var yt,Dt,kt;if(Ue(),qe.target.detail&&((kt=(Dt=(yt=qe.target)==null?void 0:yt.element)==null?void 0:Dt.className)!=null&&kt.includes("line-numbers"))){let qt=qe.target.position.lineNumber;if(Bn(ht.getLineContent(qt),qt))return;Fe(qt)}}),at=Ve.onMouseLeave(()=>{Ue()});return()=>{he.dispose(),Ie.dispose(),it.dispose(),at.dispose()}}},[q.current,Ft,un,Re,xe,Te]),(0,T.useEffect)(()=>{var je;(je=q.current)!=null&&je.instance&&xe&&q.current.instance.setPosition({lineNumber:0,column:0})},[Re]);function xn(){let je=q.current.instance;if(je){const Ve=je.getSelection(),ht=q.current.pastePos||{},nt=new be.Range(ht.startLineNumber||Ve.endLineNumber,ht.startColumn||Ve.endColumn,ht.endLineNumber||Ve.endLineNumber,ht.endColumn||Ve.endColumn);setTimeout(()=>{je.executeEdits("",[{range:nt,text:""}])},300)}}function sn(je){(window.navigator.platform.match("Mac")?je.metaKey:je.ctrlKey)&&je.keyCode==83&&(je.preventDefault(),lt())}const wn=()=>{if(Pt&&q.current.instance){const je=q.current.instance.getContentHeight();tt(je<J?J:je)}else tt(J)};function zn(je){var Ve=document.createEvent("MouseEvents");Ve.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),je.dispatchEvent(Ve)}const Hn=je=>{if(!En.current)return;const{keyCode:Ve,ctrlKey:ht,metaKey:nt,target:Vt,type:Zt}=je;return(Zt==="paste"||(Ve===67||Ve===86)&&(nt||ht))&&Vt.nodeName==="TEXTAREA"&&($n(),je.preventDefault()),!1};function Se(je,Ve){var ht=window.URL||window.webkitURL||window,nt=new Blob([Ve]),Vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Vt.href=ht.createObjectURL(nt),Vt.download=je,zn(Vt)}(0,T.useEffect)(()=>{wn()},[wn]),(0,T.useEffect)(()=>{te.current&&!Ft&&Promise.all([C.e(8909),C.e(6656)]).then(C.bind(C,71448)).then(je=>{try{be=je,q.current.instance=be.editor.create(te.current,{value:me,language:G(Te),theme:Ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:B||!1}},Ce);const Ve=q.current.instance;let Vt=[...$.BH._menuItems].find(he=>he[0]._debugName=="EditorContext")[1],Zt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],It=(he,Ie)=>{var Fe,Ue;let it=he._first;do Ie.includes((Ue=(Fe=it.element)==null?void 0:Fe.command)==null?void 0:Ue.id)&&he._remove(it);while(it=it.next)};if(Gt(Ve,be),setTimeout(()=>{wn(),q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Se(Nn||"educoder.txt",Ve.getValue())}})},500),q.current.subscription=Ve.onDidChangeModelContent(he=>{ft.current?clearTimeout(Mt.current):(wn(),ut(Ve.getValue(),he)),Mt.current=setTimeout(()=>{ft.current=!1},500)}),window.Monaco||ne(be,G(Te)),xt&&(It(Vt,Zt),te.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Hn),window.removeEventListener("paste",Hn),window.addEventListener("keydown",Hn),window.addEventListener("paste",Hn)),window.Monaco=be,He&&Ve.onDidBlurEditorWidget(()=>{He(Ve.getValue())}),an&&Ve.onDidFocusEditorText(()=>{xt&&ke(),an(Ve.getValue())}),xt){ke();try{Ve.onDidPaste(he=>{const Ie=Ve.getSelection(),Fe=q.current.pastePos||{},Ue=new be.Range(Fe.startLineNumber||Ie.endLineNumber,Fe.startColumn||Ie.endColumn,Fe.endLineNumber||Ie.endLineNumber,Fe.endColumn||Ie.endColumn);Ve.executeEdits("",[{range:he.range,text:""}])})}catch(he){}}let wt=kn();return Ae&&typeof Ae=="string"&&new V(Ae,Ve,be),Yt(!0),()=>{const he=q.current.instance;he.dispose();const Ie=he.getModel();Ie&&Ie.dispose(),q.current.subscription&&q.current.subscription.dispose(),wt.unobserve(te.current)}}catch(Ve){}})},[]),(0,T.useEffect)(()=>{if(q.current.instance&&Ft)return document.addEventListener("keydown",sn,!1),()=>{document.removeEventListener("keydown",sn)}},[lt,Ft]),(0,T.useEffect)(()=>{let je=q.current.instance;if(je&&Ft){let Ve=G(Te);be.editor.setModelLanguage(je.getModel(),Ve)}},[Te,Ft]),(0,T.useEffect)(()=>{q.current.instance&&Ft&&be.editor.setTheme(Ge)},[Ge,Ft]),(0,T.useEffect)(()=>{let je=q.current.instance;we.current=_e,je&&Ft&&(je.updateOptions(Le({},_e)),setTimeout(()=>{je.getModel().updateOptions(Le({},_e))},200))},[JSON.stringify(_e),Ft]),(0,T.useEffect)(()=>{let je=q.current.instance;je&&Ft&&je.layout()},[oe,J,Ft]);const[Ee,_t]=(0,T.useState)(rn(oe)),[ct,tt]=(0,T.useState)(rn(J)),$t=Je(Le({},pe),{width:Ee,height:ct,position:"relative"});return T.createElement("div",{className:"my-monaco-editor",ref:te,style:$t},et&&T.createElement(O.CopyToClipboard,{text:me,onCopy:()=>H.ZP.success("\u590D\u5236\u6210\u529F")},T.createElement(W.Z,{title:"\u590D\u5236\u4EE3\u7801"},T.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},T.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function k({width:F="100%",height:ee="100%",original:oe,modified:J,language:me,options:Te={}}){const pe=(0,T.useRef)(),[_e,Ce]=(0,T.useState)(null);function Ge(Pt){let xt;return pe.current&&(xt=new de.Z(ut=>{for(let Gt of ut)(Gt.target.offsetHeight>0||Gt.target.offsetWidth>0)&&Pt.layout()}),xt.observe(pe.current)),xt}(0,T.useEffect)(()=>(pe.current&&Promise.all([C.e(8909),C.e(9404)]).then(C.bind(C,2550)).then(Pt=>{be=Pt;const xt=be.editor.createDiffEditor(pe.current,Je(Le({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Te),{wordWrap:!0}));Ce(xt);let ut=Ge(xt);return()=>{xt.dispose();const Gt=xt.getModel();Gt&&Gt.dispose(),ut.unobserve(pe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,T.useEffect)(()=>{_e&&_e.setModel({original:be.editor.createModel(oe,me),modified:be.editor.createModel(J,me)})},[oe,J,me,_e]);const He=rn(F),et=rn(ee),lt={width:He,height:et};return T.createElement("div",{className:"my-diff-editor",ref:pe,style:lt})}},82821:function(vn,St,C){"use strict";C.r(St),C.d(St,{default:function(){return gt}});var T=C(59301),de=C(25690),De=C(61186),re=C.n(De),M=C(93041),p=C(24404),fe=C(77019),ie=C(5269),l=C(37285),S=C(458),w=C(13747),d=C(346),m=C(28426),y=C(28284),x=C(62957),N=C(6767),U=C(37568),K=C(50958),D={flex_box_center:"flex_box_center___N_gPw",flex_space_between:"flex_space_between___f_LaO",flex_box_vertical_center:"flex_box_vertical_center___silBX",flex_box_center_end:"flex_box_center_end___Nt5TD",flex_box_column:"flex_box_column___xc67X",tabs:"tabs___JYWDM",active:"active___siUX9",list:"list___IZLen",tags:"tags___V_Bdb",searchWrp:"searchWrp___MhTxO",newlight:"newlight___pybQh"},A=Object.defineProperty,P=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ae=(Le,Je,Et)=>Je in Le?A(Le,Je,{enumerable:!0,configurable:!0,writable:!0,value:Et}):Le[Je]=Et,ne=(Le,Je)=>{for(var Et in Je||(Je={}))z.call(Je,Et)&&ae(Le,Et,Je[Et]);if(P)for(var Et of P(Je))se.call(Je,Et)&&ae(Le,Et,Je[Et]);return Le},Q=(Le,Je,Et)=>new Promise((ot,rn)=>{var Ze=G=>{try{le(Et.next(G))}catch(be){rn(be)}},ge=G=>{try{le(Et.throw(G))}catch(be){rn(be)}},le=G=>G.done?ot(G.value):Promise.resolve(G.value).then(Ze,ge);le((Et=Et.apply(Le,Je)).next())});const ye=({messages:Le,loading:Je,user:Et,dispatch:ot})=>{var rn;const Ze=(0,de.useParams)(),ge=(0,de.useLocation)(),{actionTabs:le}=Le,[G]=y.default.useForm(),{recentContacts:be}=Le,[ke,Ne]=(0,T.useState)(""),[k,F]=(0,T.useState)([]),[ee,oe]=(0,T.useState)(!1),[J,me]=(0,T.useState)();(0,T.useEffect)(()=>{Le.actionTabs.key==="\u5199\u79C1\u4FE1"&&Te()},[Le.actionTabs.key]);const Te=()=>Q(void 0,null,function*(){var _e;const Ce=yield ot({type:"messages/getRecentContacts",payload:{id:(_e=Et==null?void 0:Et.userInfo)==null?void 0:_e.user_id,keyword:ke}});F(ne({},Ce))}),pe=()=>Q(void 0,null,function*(){if(ke!==""){const _e=yield ot({type:"messages/getUsersForPrivateMessages",payload:{keyword:ke}});F(ne({},_e))}});return(0,T.useEffect)(()=>{pe()},[ke]),T.createElement(x.default,{centered:!0,title:"\u5199\u79C1\u4FE1",open:Le.actionTabs.key==="\u5199\u79C1\u4FE1",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{height:320},onOk:()=>Q(void 0,null,function*(){var _e,Ce,Ge;yield G.validateFields();const He=G.getFieldValue(),et=`/api/course_modules/${Ze.categoryId}/add_second_category.json`,lt=yield(0,K.w0)({content:He.content,target_id:J,userId:(_e=Et==null?void 0:Et.userInfo)==null?void 0:_e.user_id});lt.status===0&&(N.ZP.success("\u6DFB\u52A0\u6210\u529F"),ot({type:"messages/setActionTabs",payload:{}}),de.history.push(`/messages/${(Ce=Et==null?void 0:Et.userInfo)==null?void 0:Ce.login}/message_detail?target_ids=${(Ge=lt==null?void 0:lt.private_message)==null?void 0:Ge.receiver_id}`))}),onCancel:()=>{ot({type:"messages/setActionTabs",payload:{}})}},T.createElement(y.default,{form:G,initialValues:{name:""}},T.createElement(y.default.Item,{name:"users",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u9001\u5BF9\u8C61"}]},T.createElement(U.default.Search,{onFocus:()=>oe(!0),onSearch:_e=>{Ne(_e)},placeholder:"\u53D1\u9001\u7ED9..."})),ee&&T.createElement(S.Z,{loading:Je["messages/getUsersForPrivateMessages"]},T.createElement("aside",{className:D.searchWrp,style:{maxHeight:260,overflow:"auto"}},T.createElement("p",{className:"c-light-black mt10"},ke===""?"\u6700\u8FD1\u8054\u7CFB\u4EBA":"\u641C\u7D22\u7ED3\u679C"),(rn=k==null?void 0:k.users)==null?void 0:rn.map(function(_e,Ce){return T.createElement(fe.Z,{key:Ce,align:"middle",className:"mt15 current",onClick:()=>{me(_e.id),G.setFieldsValue({users:_e.name}),oe(!1)}},T.createElement(ie.Z,{flex:"58px"},T.createElement("img",{style:{width:48,borderRadius:48},src:d.Z.IMG_SERVER+"/images/"+(_e==null?void 0:_e.image_url),alt:""})),T.createElement(ie.Z,null,_e.name))}))),T.createElement(y.default.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9"}],className:ee&&"hide",name:"content"},T.createElement(U.default.TextArea,{rows:10,maxLength:200}))))};var ce=(0,de.connect)(({messages:Le,loading:Je,user:Et})=>({messages:Le,user:Et,loading:Je.effects}))(ye),Oe=C(76902),Z=C(92582),L=Object.defineProperty,V=Object.defineProperties,$=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,g=(Le,Je,Et)=>Je in Le?L(Le,Je,{enumerable:!0,configurable:!0,writable:!0,value:Et}):Le[Je]=Et,O=(Le,Je)=>{for(var Et in Je||(Je={}))W.call(Je,Et)&&g(Le,Et,Je[Et]);if(H)for(var Et of H(Je))_.call(Je,Et)&&g(Le,Et,Je[Et]);return Le},Y=(Le,Je)=>V(Le,$(Je)),Pe=(Le,Je)=>{var Et={};for(var ot in Le)W.call(Le,ot)&&Je.indexOf(ot)<0&&(Et[ot]=Le[ot]);if(Le!=null&&H)for(var ot of H(Le))Je.indexOf(ot)<0&&_.call(Le,ot)&&(Et[ot]=Le[ot]);return Et};const{SubMenu:Me}=M.default,{Sider:Xe,Content:Ye}=p.default,Tt=Le=>{var Je=Le,{messages:Et,globalSetting:ot,loading:rn,user:Ze,dispatch:ge}=Je,le=Pe(Je,["messages","globalSetting","loading","user","dispatch"]),G,be;const ke=(0,de.useParams)(),{userInfo:Ne}=Ze,{tidingsList:k,privateMessage:F}=Et,[ee,oe]=(0,T.useState)({per_page:10,page:1});(0,T.useEffect)(()=>{ee.page=1,J()},[ke.userId]);const J=()=>{ge({type:"messages/getPrivateMessages",payload:O(O({},ee),ke)})},me=_e=>{var Ce,Ge;le.history.push(`/messages/${(Ce=Ze==null?void 0:Ze.userInfo)==null?void 0:Ce.login}/message_detail?target_ids=${(Ge=_e==null?void 0:_e.target)==null?void 0:Ge.id}`)},Te=_e=>{var Ce;le.history.push(`/users/${(Ce=_e==null?void 0:_e.target)==null?void 0:Ce.login}`)},pe=(0,T.useMemo)(()=>(Ne==null?void 0:Ne.is_teacher)&&(Ne==null?void 0:Ne.professional_certification),[Ne]);return T.createElement("section",{className:D.bg},T.createElement("section",{className:"edu-container mt20"},T.createElement(fe.Z,{gutter:[20,20]},T.createElement(Z.Z,null),T.createElement(ie.Z,{flex:"1"},T.createElement("aside",{className:"bg-white"},T.createElement("aside",{className:"pt30 pl30 pr30 font16"},T.createElement(fe.Z,null,T.createElement(ie.Z,{flex:"1"},"\u5168\u90E8\u79C1\u4FE1"),pe&&T.createElement(ie.Z,null,T.createElement("span",{className:"c-blue current",onClick:()=>{var _e;ge({type:"messages/setActionTabs",payload:{key:"\u5199\u79C1\u4FE1",bodyParams:Y(O({},ee),{user_id:(_e=Ze==null?void 0:Ze.userInfo)==null?void 0:_e.user_id})}})}},"\u5199\u79C1\u4FE1")))),T.createElement(l.Z,null),T.createElement("aside",{className:D.list},T.createElement(S.Z,{active:!0,avatar:{size:40},paragraph:{rows:5},loading:rn["messages/getPrivateMessages"]},!((G=F==null?void 0:F.private_messages)!=null&&G.length)&&T.createElement(m.Z,null),(be=F==null?void 0:F.private_messages)==null?void 0:be.map(function(_e,Ce){var Ge,He;return T.createElement("aside",null,T.createElement(fe.Z,null,T.createElement(ie.Z,{flex:"58px",onClick:()=>Te(_e)},T.createElement("img",{src:d.Z.IMG_SERVER+"/images/"+((Ge=_e==null?void 0:_e.target)==null?void 0:Ge.image_url),alt:""})),T.createElement(ie.Z,{flex:1},T.createElement(fe.Z,null,T.createElement(ie.Z,{span:24},T.createElement(fe.Z,null,T.createElement(ie.Z,{flex:"1"},T.createElement("span",{onClick:()=>Te(_e)},(He=_e==null?void 0:_e.target)==null?void 0:He.name),T.createElement("span",{className:"ml15"},"\u4E0E\u4F60\u7684\u79C1\u4FE1"),T.createElement("span",{className:"c-light-black mr15"},"[",_e==null?void 0:_e.message_count,"\u6761]"),T.createElement("span",{className:"ml15 c-light-black"},re()(_e.send_time).fromNow())),T.createElement(ie.Z,null,(_e==null?void 0:_e.unread)&&T.createElement("span",{className:D.newlight})))),T.createElement(ie.Z,{span:24,onClick:()=>me(_e)},T.createElement("div",{className:"mt15"},T.createElement(Oe.Z,{value:_e.content||""})))))))})))),T.createElement("aside",{className:"tc mt20"},!rn["messages/getTidings"]&&T.createElement(w.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:_e=>{ee.page=_e,oe(O({},ee)),J()},current:ee.page||1,total:F==null?void 0:F.count}))))),T.createElement(ce,null))};var gt=(0,de.connect)(({messages:Le,loading:Je,user:Et,globalSetting:ot})=>({messages:Le,globalSetting:ot,user:Et,loading:Je.effects}))(Tt)},92582:function(vn,St,C){"use strict";C.d(St,{Z:function(){return D}});var T=C(59301),de=C(25690),De=C(93041),re=C(24404),M=C(5269),p=C(346),fe={flex_box_center:"flex_box_center___cQVhO",flex_space_between:"flex_space_between___L36a6",flex_box_vertical_center:"flex_box_vertical_center___sIHwG",flex_box_center_end:"flex_box_center_end___OqNyE",flex_box_column:"flex_box_column___Ct7XG",userInfo:"userInfo____uyMZ",navInfo:"navInfo___acXs6",actived:"actived___WhZza",newTip:"newTip___Jdd6B"},ie=Object.defineProperty,l=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,d=(A,P,z)=>P in A?ie(A,P,{enumerable:!0,configurable:!0,writable:!0,value:z}):A[P]=z,m=(A,P)=>{for(var z in P||(P={}))S.call(P,z)&&d(A,z,P[z]);if(l)for(var z of l(P))w.call(P,z)&&d(A,z,P[z]);return A},y=(A,P)=>{var z={};for(var se in A)S.call(A,se)&&P.indexOf(se)<0&&(z[se]=A[se]);if(A!=null&&l)for(var se of l(A))P.indexOf(se)<0&&w.call(A,se)&&(z[se]=A[se]);return z};const{SubMenu:x}=De.default,{Sider:N,Content:U}=re.default,K=A=>{var P=A,{messages:z,globalSetting:se,loading:ae,user:ne,dispatch:Q}=P,ye=y(P,["messages","globalSetting","loading","user","dispatch"]);const ce=(0,de.useParams)(),{userInfo:Oe}=ne,Z=(0,de.useLocation)(),{tidingsList:L,privateMessage:V,unreadInfo:$}=z,[H,W]=(0,T.useState)({per_page:10,page:1});(0,T.useEffect)(()=>{_()},[ce.userId]);const _=()=>{Q({type:"messages/unreadMessageInfo",payload:m(m({},H),ce)})};return T.createElement(M.Z,{flex:"264px"},T.createElement("aside",{className:fe.userInfo},T.createElement("img",{className:"mt40",src:p.Z.IMG_SERVER+"/images/"+(Oe==null?void 0:Oe.image_url)}),T.createElement("p",{className:"font24 mt10"},Oe==null?void 0:Oe.username),T.createElement("p",{className:"mt20"},Oe==null?void 0:Oe.user_identity)),T.createElement("ul",{className:fe.navInfo},T.createElement(de.Link,{to:`/messages/${Oe==null?void 0:Oe.login}/user_tidings`},T.createElement("li",{className:Z.pathname.indexOf("user_tidings")>-1&&fe.actived},"\u6D88\u606F",!!($!=null&&$.unread_tiding_count)&&T.createElement("span",{className:fe.newTip},$==null?void 0:$.unread_tiding_count))),T.createElement(de.Link,{to:`/messages/${Oe==null?void 0:Oe.login}/private_messages`},T.createElement("li",{className:(Z.pathname.indexOf("private_messages")>-1||Z.pathname.indexOf("message_detail")>-1)&&fe.actived},"\u79C1\u4FE1",!!($!=null&&$.unread_message_count)&&T.createElement("span",{className:fe.newTip},$==null?void 0:$.unread_message_count)))))};var D=(0,de.connect)(({messages:A,loading:P,user:z,globalSetting:se})=>({messages:A,globalSetting:se,user:z,loading:P.effects}))(K)},81428:function(vn,St,C){"use strict";C.d(St,{AL:function(){return P},Iy:function(){return w},Qv:function(){return y},ez:function(){return A},jb:function(){return d}});var T=C(32834),de=C.n(T),De=C(11690),re=C.n(De);let M=1;function p(Q,ye){const ce=Q.match(/^(\s+)(?:```)/);if(ce===null)return ye;const Oe=ce[1];return ye.split(`
|
|
`).map(Z=>{const L=Z.match(/^\s+/);if(L===null)return Z;const[V]=L;return V.length>=Oe.length?Z.slice(Oe.length):Z}).join(`
|
|
`)}let fe=[],ie=["<ul>"];const l=new(de()).Renderer,S=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){fe.length=0,ie=["<ul>"]}const d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(Q,ye,ce,Oe){if(ye>=Q.length||Q[ye].level<=ce)return ye;var Z=Q[ye];Oe.push("<li><a href='#"+M+Z.anchor+"'>"+Z.text+"</a>"),ye++;var L=[];return ye=m(Q,ye,Z.level,L),L.length>0&&(Oe.push("<ul>"),L.forEach(function(V){Oe.push(V)}),Oe.push("</ul>")),Oe.push("</li>"),ye=m(Q,ye,ce,Oe),ye}function y(){return m(fe,0,0,ie),ie.push("</ul>"),ie.join("")}const x={heading(Q){const ye=S.exec(Q);if(M+=1,ye)return{type:"heading",raw:ye[0],depth:ye[1].length,text:ye[2]}},fences(Q){const ye=this.rules.block.fences.exec(Q);if(ye){const ce=ye[0];let Oe=p(ce,ye[3]||"");const Z=ye[2]?ye[2].trim():ye[2];if(["latex","katex","math"].indexOf(Z)>=0){const L=K(),V=Oe;Oe=L,D[L]={type:"block",expression:V}}return{type:"code",raw:ce,lang:Z,text:Oe}}}},N=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let U=0;const K=()=>`__special_katext_id_${U++}__`;let D={};function A(){return D}function P(){U=0,D={}}function z(Q){return Q=Q.replace(N,(ye,ce)=>{const Oe=K();return D[Oe]={type:"inline",expression:ce},Oe}),Q}const se=l.listitem;l.listitem=function(Q){return se(z(Q))};const ae=l.paragraph;l.paragraph=function(Q){return ae(z(Q))};const ne=l.tablecell;l.tablecell=function(Q,ye){return ne(z(Q),ye)},l.code=function(Q,ye,ce){const Oe=(ye||"").match(/\S*/)[0];return Oe?["latex","katex","math"].indexOf(Oe)>=0?`<p class='editormd-tex'>${Q}</p>`:`<pre class="prettyprint linenums"><code class="language-${ye}">${ce?Q:(0,De.escape)(Q,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ce?Q:(0,De.escape)(Q,!0))+"</code></pre>"},l.heading=function(Q,ye,ce){let Oe=this.options.headerPrefix+ce.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return fe.push({anchor:Oe,level:ye,text:Q}),"<h"+ye+' id="'+M+Oe+'">'+Q+"</h"+ye+">"},de().setOptions({silent:!0,gfm:!0,pedantic:!1}),de().use({tokenizer:x,renderer:l}),St.ZP=de()},64018:function(){var vn,St,C,T=!1,de,De;window.PR_SHOULD_USE_CONTINUATION=!0;var re,M;(function(){var p=window,fe=["break,continue,do,else,for,if,return,while"],ie=[fe,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],l=[ie,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[l,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],w=[l,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[l,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],m="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[l,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],x="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",N=[fe,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],U=[fe,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],K=[fe,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],D=[S,d,w,y,x,N,U,K],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,P="str",z="kwd",se="com",ae="typ",ne="lit",Q="pun",ye="pln",ce="tag",Oe="dec",Z="src",L="atn",V="atv",$="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(le){for(var G=0,be=!1,ke=!1,Ne=0,k=le.length;Ne<k;++Ne){var F=le[Ne];if(F.ignoreCase)ke=!0;else if(/[a-z]/i.test(F.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){be=!0,ke=!1;break}}var ee={b:8,t:9,n:10,v:11,f:12,r:13};function oe(_e){var Ce=_e.charCodeAt(0);if(Ce!==92)return Ce;var Ge=_e.charAt(1);return Ce=ee[Ge],Ce||("0"<=Ge&&Ge<="7"?parseInt(_e.substring(1),8):Ge==="u"||Ge==="x"?parseInt(_e.substring(2),16):_e.charCodeAt(1))}function J(_e){if(_e<32)return(_e<16?"\\x0":"\\x")+_e.toString(16);var Ce=String.fromCharCode(_e);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function me(_e){var Ce=_e.substring(1,_e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ge=[],He=Ce[0]==="^",et=["["];He&&et.push("^");for(var lt=He?1:0,Pt=Ce.length;lt<Pt;++lt){var xt=Ce[lt];if(/\\[bdsw]/i.test(xt))et.push(xt);else{var ut=oe(xt),Gt;lt+2<Pt&&Ce[lt+1]==="-"?(Gt=oe(Ce[lt+2]),lt+=2):Gt=ut,Ge.push([ut,Gt]),Gt<65||ut>122||(Gt<65||ut>90||Ge.push([Math.max(65,ut)|32,Math.min(Gt,90)|32]),Gt<97||ut>122||Ge.push([Math.max(97,ut)&-33,Math.min(Gt,122)&-33]))}}Ge.sort(function(Nn,At){return Nn[0]-At[0]||At[1]-Nn[1]});for(var an=[],Ct=[],lt=0;lt<Ge.length;++lt){var un=Ge[lt];un[0]<=Ct[1]+1?Ct[1]=Math.max(Ct[1],un[1]):an.push(Ct=un)}for(var lt=0;lt<an.length;++lt){var un=an[lt];et.push(J(un[0])),un[1]>un[0]&&(un[1]+1>un[0]&&et.push("-"),et.push(J(un[1])))}return et.push("]"),et.join("")}function Te(_e){for(var Ce=_e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ge=Ce.length,He=[],et=0,lt=0;et<Ge;++et){var Pt=Ce[et];if(Pt==="(")++lt;else if(Pt.charAt(0)==="\\"){var xt=+Pt.substring(1);xt&&(xt<=lt?He[xt]=-1:Ce[et]=J(xt))}}for(var et=1;et<He.length;++et)He[et]===-1&&(He[et]=++G);for(var et=0,lt=0;et<Ge;++et){var Pt=Ce[et];if(Pt==="(")++lt,He[lt]||(Ce[et]="(?:");else if(Pt.charAt(0)==="\\"){var xt=+Pt.substring(1);xt&&xt<=lt&&(Ce[et]="\\"+He[xt])}}for(var et=0;et<Ge;++et)Ce[et]==="^"&&Ce[et+1]!=="^"&&(Ce[et]="");if(_e.ignoreCase&&be)for(var et=0;et<Ge;++et){var Pt=Ce[et],ut=Pt.charAt(0);Pt.length>=2&&ut==="["?Ce[et]=me(Pt):ut!=="\\"&&(Ce[et]=Pt.replace(/[a-zA-Z]/g,function(Ct){var un=Ct.charCodeAt(0);return"["+String.fromCharCode(un&-33,un|32)+"]"}))}return Ce.join("")}for(var pe=[],Ne=0,k=le.length;Ne<k;++Ne){var F=le[Ne];if(F.global||F.multiline)throw new Error(""+F);pe.push("(?:"+Te(F)+")")}return new RegExp(pe.join("|"),ke?"gi":"g")}function _(le,G){var be=/(?:^|\s)nocode(?:\s|$)/,ke=[],Ne=0,k=[],F=0;function ee(oe){var J=oe.nodeType;if(J==1){if(be.test(oe.className))return;for(var me=oe.firstChild;me;me=me.nextSibling)ee(me);var Te=oe.nodeName.toLowerCase();(Te==="br"||Te==="li")&&(ke[F]=`
|
|
`,k[F<<1]=Ne++,k[F++<<1|1]=oe)}else if(J==3||J==4){var pe=oe.nodeValue;pe.length&&(G?pe=pe.replace(/\r\n?/g,`
|
|
`):pe=pe.replace(/[ \t\r\n]+/g," "),ke[F]=pe,k[F<<1]=Ne,Ne+=pe.length,k[F++<<1|1]=oe)}}return ee(le),{sourceCode:ke.join("").replace(/\n$/,""),spans:k}}function g(le,G,be,ke,Ne){if(be){var k={sourceNode:le,pre:1,langExtension:null,numberLines:null,sourceCode:be,spans:null,basePos:G,decorations:null};ke(k),Ne.push.apply(Ne,k.decorations)}}var O=/\S/;function Y(le){for(var G=void 0,be=le.firstChild;be;be=be.nextSibling){var ke=be.nodeType;G=ke===1?G?le:be:ke===3&&O.test(be.nodeValue)?le:G}return G===le?void 0:G}function Pe(le,G){var be={},ke;(function(){for(var F=le.concat(G),ee=[],oe={},J=0,me=F.length;J<me;++J){var Te=F[J],pe=Te[3];if(pe)for(var _e=pe.length;--_e>=0;)be[pe.charAt(_e)]=Te;var Ce=Te[1],Ge=""+Ce;oe.hasOwnProperty(Ge)||(ee.push(Ce),oe[Ge]=null)}ee.push(/[\0-\uffff]/),ke=W(ee)})();var Ne=G.length,k=function(F){for(var ee=F.sourceCode,oe=F.basePos,J=F.sourceNode,me=[oe,ye],Te=0,pe=ee.match(ke)||[],_e={},Ce=0,Ge=pe.length;Ce<Ge;++Ce){var He=pe[Ce],et=_e[He],lt=void 0,Pt;if(typeof et=="string")Pt=!1;else{var xt=be[He.charAt(0)];if(xt)lt=He.match(xt[1]),et=xt[0];else{for(var ut=0;ut<Ne;++ut)if(xt=G[ut],lt=He.match(xt[1]),lt){et=xt[0];break}lt||(et=ye)}Pt=et.length>=5&&et.substring(0,5)==="lang-",Pt&&!(lt&&typeof lt[1]=="string")&&(Pt=!1,et=Z),Pt||(_e[He]=et)}var Gt=Te;if(Te+=He.length,!Pt)me.push(oe+Gt,et);else{var an=lt[1],Ct=He.indexOf(an),un=Ct+an.length;lt[2]&&(un=He.length-lt[2].length,Ct=un-an.length);var Nn=et.substring(5);g(J,oe+Gt,He.substring(0,Ct),k,me),g(J,oe+Gt+Ct,an,Je(Nn,an),me),g(J,oe+Gt+un,He.substring(un),k,me)}}F.decorations=me};return k}function Me(le){var G=[],be=[];le.tripleQuotedStrings?G.push([P,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):le.multiLineStrings?G.push([P,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):G.push([P,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),le.verbatimStrings&&be.push([P,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ke=le.hashComments;ke&&(le.cStyleComments?(ke>1?G.push([se,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):G.push([se,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),be.push([P,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):G.push([se,/^#[^\r\n]*/,null,"#"])),le.cStyleComments&&(be.push([se,/^\/\/[^\r\n]*/,null]),be.push([se,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ne=le.regexLiterals;if(Ne){var k=Ne>1?"":`
|
|
\r`,F=k?".":"[\\S\\s]",ee="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+F+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+F+")*(?:\\x5D|$))+/";be.push(["lang-regex",RegExp("^"+H+"("+ee+")")])}var oe=le.types;oe&&be.push([ae,oe]);var J=(""+le.keywords).replace(/^ | $/g,"");J.length&&be.push([z,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),G.push([ye,/^\s+/,null,` \r
|
|
\xA0`]);var me="^.[^\\s\\w.$@'\"`/\\\\]*";return le.regexLiterals&&(me+="(?!s*/)"),be.push([ne,/^@[a-z_$][a-z_$@0-9]*/i,null],[ae,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[ye,/^[a-z_$][a-z_$@0-9]*/i,null],[ne,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[ye,/^\\[\s\S]?/,null],[Q,new RegExp(me),null]),Pe(G,be)}var Xe=Me({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ye(le,G,be){for(var ke=/(?:^|\s)nocode(?:\s|$)/,Ne=/\r\n?|\n/,k=le.ownerDocument,F=k.createElement("li");le.firstChild;)F.appendChild(le.firstChild);var ee=[F];function oe(Ce){var Ge=Ce.nodeType;if(Ge==1&&!ke.test(Ce.className))if(Ce.nodeName==="br")J(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var He=Ce.firstChild;He;He=He.nextSibling)oe(He);else if((Ge==3||Ge==4)&&be){var et=Ce.nodeValue,lt=et.match(Ne);if(lt){var Pt=et.substring(0,lt.index);Ce.nodeValue=Pt;var xt=et.substring(lt.index+lt[0].length);if(xt){var ut=Ce.parentNode;ut.insertBefore(k.createTextNode(xt),Ce.nextSibling)}J(Ce),Pt||Ce.parentNode.removeChild(Ce)}}}function J(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Ge(lt,Pt){var xt=Pt?lt.cloneNode(!1):lt,ut=lt.parentNode;if(ut){var Gt=Ge(ut,1),an=lt.nextSibling;Gt.appendChild(xt);for(var Ct=an;Ct;Ct=an)an=Ct.nextSibling,Gt.appendChild(Ct)}return xt}for(var He=Ge(Ce.nextSibling,0),et;(et=He.parentNode)&&et.nodeType===1;)He=et;ee.push(He)}for(var me=0;me<ee.length;++me)oe(ee[me]);G===(G|0)&&ee[0].setAttribute("value",G);var Te=k.createElement("ol");Te.className="linenums";for(var pe=Math.max(0,G-1|0)||0,me=0,_e=ee.length;me<_e;++me)F=ee[me],F.className="L"+(me+pe)%10,F.firstChild||F.appendChild(k.createTextNode("\xA0")),Te.appendChild(F);le.appendChild(Te)}function Tt(le){var G=/\bMSIE\s(\d+)/.exec(navigator.userAgent);G=G&&+G[1]<=8;var be=/\n/g,ke=le.sourceCode,Ne=ke.length,k=0,F=le.spans,ee=F.length,oe=0,J=le.decorations,me=J.length,Te=0;J[me]=Ne;var pe,_e;for(_e=pe=0;_e<me;)J[_e]!==J[_e+2]?(J[pe++]=J[_e++],J[pe++]=J[_e++]):_e+=2;for(me=pe,_e=pe=0;_e<me;){for(var Ce=J[_e],Ge=J[_e+1],He=_e+2;He+2<=me&&J[He+1]===Ge;)He+=2;J[pe++]=Ce,J[pe++]=Ge,_e=He}me=J.length=pe;var et=le.sourceNode,lt="";et&&(lt=et.style.display,et.style.display="none");try{for(var Pt=null;oe<ee;){var xt=F[oe],ut=F[oe+2]||Ne,Gt=J[Te+2]||Ne,He=Math.min(ut,Gt),an=F[oe+1],Ct;if(an.nodeType!==1&&(Ct=ke.substring(k,He))){G&&(Ct=Ct.replace(be,"\r")),an.nodeValue=Ct;var un=an.ownerDocument,Nn=un.createElement("span");Nn.className=J[Te+1];var At=an.parentNode;At.replaceChild(Nn,an),Nn.appendChild(an),k<ut&&(F[oe+1]=an=un.createTextNode(ke.substring(He,ut)),At.insertBefore(an,Nn.nextSibling))}k=He,k>=ut&&(oe+=2),k>=Gt&&(Te+=2)}}finally{et&&(et.style.display=lt)}}var gt={};function Le(le,G){for(var be=G.length;--be>=0;){var ke=G[be];gt.hasOwnProperty(ke)?p.console&&console.warn("cannot override language handler %s",ke):gt[ke]=le}}function Je(le,G){return le&>.hasOwnProperty(le)||(le=/^\s*</.test(G)?"default-markup":"default-code"),gt[le]}Le(Xe,["default-code"]),Le(Pe([],[[ye,/^[^<?]+/],[Oe,/^<!\w[^>]*(?:>|$)/],[se,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Q,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Le(Pe([[ye,/^[\s]+/,null,` \r
|
|
`],[V,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ce,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Q,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Le(Pe([],[[V,/^[\s\S]+/]]),["uq.val"]),Le(Me({keywords:S,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),Le(Me({keywords:"null,true,false"}),["json"]),Le(Me({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),Le(Me({keywords:w,cStyleComments:!0}),["java"]),Le(Me({keywords:K,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Le(Me({keywords:N,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Le(Me({keywords:x,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Le(Me({keywords:U,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Le(Me({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Le(Me({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Le(Pe([],[[P,/^[\s\S]+/]]),["regex"]);function Et(le){var G=le.langExtension;try{var be=_(le.sourceNode,le.pre),ke=be.sourceCode;le.sourceCode=ke,le.spans=be.spans,le.basePos=0,Je(G,ke)(le),Tt(le)}catch(Ne){p.console&&console.log(Ne&&Ne.stack||Ne)}}function ot(le,G,be){var ke=be||!1,Ne=G||null,k=document.createElement("div");k.innerHTML="<pre>"+le+"</pre>",k=k.firstChild,ke&&Ye(k,ke,!0);var F={langExtension:Ne,numberLines:ke,sourceNode:k,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Et(F),k.innerHTML}function rn(le,G){var be=G||document.body,ke=be.ownerDocument||document;function Ne(xt){return be.getElementsByTagName(xt)}for(var k=[Ne("pre"),Ne("code"),Ne("xmp")],F=[],ee=0;ee<k.length;++ee)for(var oe=0,J=k[ee].length;oe<J;++oe)F.push(k[ee][oe]);k=null;var me=Date;me.now||(me={now:function(){return+new Date}});var Te=0,pe=/\blang(?:uage)?-([\w.]+)(?!\S)/,_e=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,Ge=/pre|xmp/i,He=/^code$/i,et=/^(?:pre|code|xmp)$/i,lt={};function Pt(){for(var xt=p.PR_SHOULD_USE_CONTINUATION?me.now()+250:1/0;Te<F.length&&me.now()<xt;Te++){for(var ut=F[Te],Gt=lt,an=ut;an=an.previousSibling;){var Ct=an.nodeType,un=(Ct===7||Ct===8)&&an.nodeValue;if(un?!/^\??prettify\b/.test(un):Ct!==3||/\S/.test(an.nodeValue))break;if(un){Gt={},un.replace(/\b(\w+)=([\w:.%+-]+)/g,function(st,ft,Mt){Gt[ft]=Mt});break}}var Nn=ut.className;if((Gt!==lt||_e.test(Nn))&&!Ce.test(Nn)){for(var At=!1,Qt=ut.parentNode;Qt;Qt=Qt.parentNode){var Re=Qt.tagName;if(et.test(Re)&&Qt.className&&_e.test(Qt.className)){At=!0;break}}if(!At){ut.className+=" prettyprinted";var xe=Gt.lang;if(!xe){xe=Nn.match(pe);var Ae;!xe&&(Ae=Y(ut))&&He.test(Ae.tagName)&&(xe=Ae.className.match(pe)),xe&&(xe=xe[1])}var B;if(Ge.test(ut.tagName))B=1;else{var j=ut.currentStyle,te=ke.defaultView,q=j?j.whiteSpace:te&&te.getComputedStyle?te.getComputedStyle(ut,null).getPropertyValue("white-space"):0;B=q&&q.substring(0,3)==="pre"}var we=Gt.linenums;(we=we==="true"||+we)||(we=Nn.match(/\blinenums\b(?::(\d+))?/),we=we?we[1]&&we[1].length?+we[1]:!0:!1),we&&Ye(ut,we,B);var vt={langExtension:xe,sourceNode:ut,numberLines:we,pre:B,sourceCode:null,basePos:null,spans:null,decorations:null};Et(vt)}}}Te<F.length?p.setTimeout(Pt,250):typeof le=="function"&&le()}Pt()}var Ze=p.PR={createSimpleLexer:Pe,registerLangHandler:Le,sourceDecorator:Me,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:V,PR_COMMENT:se,PR_DECLARATION:Oe,PR_KEYWORD:z,PR_LITERAL:ne,PR_NOCODE:$,PR_PLAIN:ye,PR_PUNCTUATION:Q,PR_SOURCE:Z,PR_STRING:P,PR_TAG:ce,PR_TYPE:ae,prettyPrintOne:T?p.prettyPrintOne=ot:re=ot,prettyPrint:M=T?p.prettyPrint=rn:M=rn},ge=p.define;typeof ge=="function"&&ge.amd&&ge("google-code-prettify",[],function(){return Ze})})()},25769:function(vn,St,C){"use strict";var T=C(98040),de={"text/plain":"Text","text/html":"Url",default:"Text"},De="Copy to clipboard: #{key}, Enter";function re(p){var fe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,fe)}function M(p,fe){var ie,l,S,w,d,m,y=!1;fe||(fe={}),ie=fe.debug||!1;try{S=T(),w=document.createRange(),d=document.getSelection(),m=document.createElement("span"),m.textContent=p,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(N){if(N.stopPropagation(),fe.format)if(N.preventDefault(),typeof N.clipboardData=="undefined"){ie&&console.warn("unable to use e.clipboardData"),ie&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var U=de[fe.format]||de.default;window.clipboardData.setData(U,p)}else N.clipboardData.clearData(),N.clipboardData.setData(fe.format,p);fe.onCopy&&(N.preventDefault(),fe.onCopy(N.clipboardData))}),document.body.appendChild(m),w.selectNodeContents(m),d.addRange(w);var x=document.execCommand("copy");if(!x)throw new Error("copy command was unsuccessful");y=!0}catch(N){ie&&console.error("unable to copy using execCommand: ",N),ie&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(fe.format||"text",p),fe.onCopy&&fe.onCopy(window.clipboardData),y=!0}catch(U){ie&&console.error("unable to copy using clipboardData: ",U),ie&&console.error("falling back to prompt"),l=re("message"in fe?fe.message:De),window.prompt(l,p)}}finally{d&&(typeof d.removeRange=="function"?d.removeRange(w):d.removeAllRanges()),m&&document.body.removeChild(m),S()}return y}vn.exports=M},53184:function(vn,St,C){"use strict";var T,de;function De(re,M,p){var fe=function(ie,l){return re.js_beautify(ie,l)};return fe.js=re.js_beautify,fe.css=M.css_beautify,fe.html=p.html_beautify,fe.js_beautify=re.js_beautify,fe.css_beautify=M.css_beautify,fe.html_beautify=p.html_beautify,fe}T=[C(58553),C(87804),C(40998)],de=function(re,M,p){return De(re,M,p)}.apply(St,T),de!==void 0&&(vn.exports=de)},87804:function(vn,St){var C,T;(function(){var de;(function(){"use strict";var re=[,,function(ie){function l(d){this.__parent=d,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=[]}l.prototype.clone_empty=function(){var d=new l(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},l.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},l.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},l.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.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)},l.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},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},l.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function S(d,m){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(d,m){var y=this.__base_string_length;return m=m||0,d<0&&(y=0),y+=d*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(d,m){var y=this.__base_string;return m=m||0,d<0&&(d=0,y=""),m+=d*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var d=this.__cache.length,m=0,y="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),d&&(y+=new Array(d+1).join(" ")),this.__cache.push(y)};function w(d,m){this.__indent_cache=new S(d,m),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}w.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},w.prototype.get_line_number=function(){return this.__lines.length},w.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},w.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},w.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},w.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},w.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(y=y.replace(/[\n]/g,d)),y},w.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},w.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},w.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},w.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},w.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},w.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},w.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&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},w.prototype.just_added_newline=function(){return this.current_line.is_empty()},w.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},w.prototype.ensure_empty_line_above=function(d,m){for(var y=this.__lines.length-2;y>=0;){var x=this.__lines[y];if(x.is_empty())break;if(x.item(0).indexOf(d)!==0&&x.item(-1)!==m){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ie.exports.Output=w},,,,function(ie){function l(d,m){this.raw_options=S(d,m),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","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(d,m){var y=this.raw_options[d],x=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(x=y.concat()):typeof y=="string"&&(x=y.split(/[^a-zA-Z0-9_\/\-]+/)),x},l.prototype._get_boolean=function(d,m){var y=this.raw_options[d],x=y===void 0?!!m:!!y;return x},l.prototype._get_characters=function(d,m){var y=this.raw_options[d],x=m||"";return typeof y=="string"&&(x=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),x},l.prototype._get_number=function(d,m){var y=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var x=parseInt(y,10);return isNaN(x)&&(x=m),x},l.prototype._get_selection=function(d,m,y){var x=this._get_selection_list(d,m,y);if(x.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x[0]},l.prototype._get_selection_list=function(d,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var x=this._get_array(d,y);if(!this._is_valid_selection(x,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x},l.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(y){return m.indexOf(y)===-1})};function S(d,m){var y={};d=w(d);var x;for(x in d)x!==m&&(y[x]=d[x]);if(m&&d[m])for(x in d[m])y[x]=d[m][x];return y}function w(d){var m={},y;for(y in d){var x=y.replace(/-/g,"_");m[x]=d[y]}return m}ie.exports.Options=l,ie.exports.normalizeOpts=w,ie.exports.mergeOpts=S},,function(ie){var l=RegExp.prototype.hasOwnProperty("sticky");function S(w){this.__input=w||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var w=null;return this.hasNext()&&(w=this.__input.charAt(this.__position),this.__position+=1),w},S.prototype.peek=function(w){var d=null;return w=w||0,w+=this.__position,w>=0&&w<this.__input_length&&(d=this.__input.charAt(w)),d},S.prototype.__match=function(w,d){w.lastIndex=d;var m=w.exec(this.__input);return m&&!(l&&w.sticky)&&m.index!==d&&(m=null),m},S.prototype.test=function(w,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(w,d):!1},S.prototype.testChar=function(w,d){var m=this.peek(d);return w.lastIndex=0,m!==null&&w.test(m)},S.prototype.match=function(w){var d=this.__match(w,this.__position);return d?this.__position+=d[0].length:d=null,d},S.prototype.read=function(w,d,m){var y="",x;return w&&(x=this.match(w),x&&(y+=x[0])),d&&(x||!w)&&(y+=this.readUntil(d,m)),y},S.prototype.readUntil=function(w,d){var m="",y=this.__position;w.lastIndex=this.__position;var x=w.exec(this.__input);return x?(y=x.index,d&&(y+=x[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(w){return this.readUntil(w,!0)},S.prototype.get_regexp=function(w,d){var m=null,y="g";return d&&l&&(y="y"),typeof w=="string"&&w!==""?m=new RegExp(w,y):w&&(m=new RegExp(w.source,y)),m},S.prototype.get_literal_regexp=function(w){return RegExp(w.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(w){var d=this.__position,m=this.readUntilAfter(w);return this.__position=d,m},S.prototype.lookBack=function(w){var d=this.__position-1;return d>=w.length&&this.__input.substring(d-w.length,d).toLowerCase()===w},ie.exports.InputScanner=S},,,,,function(ie){function l(S,w){S=typeof S=="string"?S:S.source,w=typeof w=="string"?w:w.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+w,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+w,"g")}l.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var w={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(S);d;)w[d[1]]=d[2],d=this.__directive_pattern.exec(S);return w},l.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},ie.exports.Directives=l},,function(ie,l,S){var w=S(16).Beautifier,d=S(17).Options;function m(y,x){var N=new w(y,x);return N.beautify()}ie.exports=m,ie.exports.defaultOptions=function(){return new d}},function(ie,l,S){var w=S(17).Options,d=S(2).Output,m=S(8).InputScanner,y=S(13).Directives,x=new y(/\/\*/,/\*\//),N=/\r\n|[\r\n]/,U=/\r\n|[\r\n]/g,K=/\s/,D=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,P=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function z(se,ae){this._source_text=se||"",this._options=new w(ae),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"]}z.prototype.eatString=function(se){var ae="";for(this._ch=this._input.next();this._ch;){if(ae+=this._ch,this._ch==="\\")ae+=this._input.next();else if(se.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return ae},z.prototype.eatWhitespace=function(se){for(var ae=K.test(this._input.peek()),ne=0;K.test(this._input.peek());)this._ch=this._input.next(),se&&this._ch===`
|
|
`&&(ne===0||ne<this._options.max_preserve_newlines)&&(ne++,this._output.add_new_line(!0));return ae},z.prototype.foundNestedPseudoClass=function(){for(var se=0,ae=1,ne=this._input.peek(ae);ne;){if(ne==="{")return!0;if(ne==="(")se+=1;else if(ne===")"){if(se===0)return!1;se-=1}else if(ne===";"||ne==="}")return!1;ae++,ne=this._input.peek(ae)}return!1},z.prototype.print_string=function(se){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(se)},z.prototype.preserveSingleSpace=function(se){se&&(this._output.space_before_token=!0)},z.prototype.indent=function(){this._indentLevel++},z.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var se=this._source_text,ae=this._options.eol;ae==="auto"&&(ae=`
|
|
`,se&&N.test(se||"")&&(ae=se.match(N)[0])),se=se.replace(U,`
|
|
`);var ne=se.match(/^[\t ]*/)[0];this._output=new d(this._options,ne),this._input=new m(se),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Q=0,ye=!1,ce=!1,Oe=!1,Z=!1,L=!1,V=this._ch,$=!1,H,W,_;H=this._input.read(D),W=H!=="",_=V,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),V=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var g=this._input.read(A),O=x.get_directives(g);O&&O.ignore==="start"&&(g+=x.readIgnored(this._input)),this.print_string(g),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(P)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(W),this.print_string(this._ch);var Y=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Y.match(/[ :]$/)&&(Y=this.eatString(": ").replace(/\s+$/,""),this.print_string(Y),this._output.space_before_token=!0),Q===0&&Y.indexOf(":")!==-1&&(ce=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(W),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Pe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Pe.match(/[ :]$/)&&(Pe=this.eatString(": ").replace(/\s+$/,""),this.print_string(Pe),this._output.space_before_token=!0),Q===0&&Pe.indexOf(":")!==-1?(ce=!0,this.indent()):Pe in this.NESTED_AT_RULE?(this._nestedLevel+=1,Pe in this.CONDITIONAL_GROUP_RULE&&(Oe=!0)):Q===0&&!ce&&(Z=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(W),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ce&&(ce=!1,this.outdent()),Z=!1,Oe?(Oe=!1,ye=this._indentLevel>=this._nestedLevel):ye=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&ye&&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),ce&&(this.outdent(),ce=!1),this.print_string(this._ch),ye=!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 Me=0;Me<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Me++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Me])){$=!0;break}(ye||Oe)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Z&&Q===0?(this.print_string(":"),ce||(ce=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Xe=_==='"'||_==="'";this.preserveSingleSpace(Xe||W),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")$=!1,Q===0?(ce&&(this.outdent(),ce=!1),Z=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),Q++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),Q&&(Q--,this.outdent()));else{var Ye=!1;this._input.lookBack("with")&&(Ye=!0),this.preserveSingleSpace(W||Ye),this.print_string(this._ch),ce&&_==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),Q++,this.indent())}else if(this._ch===")")Q&&(Q--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!ce||L)&&Q===0&&!Z?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!ce&&Q===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&&K.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(W),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),K.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 Tt=_==='"'||_==="'";this.preserveSingleSpace(Tt||W),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&$&&this._output.add_new_line()}var gt=this._output.get_code(ae);return gt},ie.exports.Beautifier=z},function(ie,l,S){var w=S(6).Options;function d(m){w.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var x=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var N=0;N<x.length;N++)x[N]!=="expand"?this.brace_style="collapse":this.brace_style=x[N]}d.prototype=new w,ie.exports.Options=d}],M={};function p(ie){var l=M[ie];if(l!==void 0)return l.exports;var S=M[ie]={exports:{}};return re[ie](S,S.exports,p),S.exports}var fe=p(15);de=fe})();var De=de;C=[],T=function(){return{css_beautify:De}}.apply(St,C),T!==void 0&&(vn.exports=T)})()},40998:function(vn,St,C){var T,de;(function(){var De;(function(){"use strict";var fe=[,,function(w){function d(x){this.__parent=x,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=[]}d.prototype.clone_empty=function(){var x=new d(this.__parent);return x.set_indent(this.__indent_count,this.__alignment_count),x},d.prototype.item=function(x){return x<0?this.__items[this.__items.length+x]:this.__items[x]},d.prototype.has_match=function(x){for(var N=this.__items.length-1;N>=0;N--)if(this.__items[N].match(x))return!0;return!1},d.prototype.set_indent=function(x,N){this.is_empty()&&(this.__indent_count=x||0,this.__alignment_count=N||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var x=this.__parent.current_line;return x.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),x.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),x.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,x.__items[0]===" "&&(x.__items.splice(0,1),x.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(x){this.__items.push(x);var N=x.lastIndexOf(`
|
|
`);N!==-1?this.__character_count=x.length-N:this.__character_count+=x.length},d.prototype.pop=function(){var x=null;return this.is_empty()||(x=this.__items.pop(),this.__character_count-=x.length),x},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var x="";return this.is_empty()?this.__parent.indent_empty_lines&&(x=this.__parent.get_indent_string(this.__indent_count)):(x=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),x+=this.__items.join("")),x};function m(x,N){this.__cache=[""],this.__indent_size=x.indent_size,this.__indent_string=x.indent_char,x.indent_with_tabs||(this.__indent_string=new Array(x.indent_size+1).join(x.indent_char)),N=N||"",x.indent_level>0&&(N=new Array(x.indent_level+1).join(this.__indent_string)),this.__base_string=N,this.__base_string_length=N.length}m.prototype.get_indent_size=function(x,N){var U=this.__base_string_length;return N=N||0,x<0&&(U=0),U+=x*this.__indent_size,U+=N,U},m.prototype.get_indent_string=function(x,N){var U=this.__base_string;return N=N||0,x<0&&(x=0,U=""),N+=x*this.__indent_size,this.__ensure_cache(N),U+=this.__cache[N],U},m.prototype.__ensure_cache=function(x){for(;x>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var x=this.__cache.length,N=0,U="";this.__indent_size&&x>=this.__indent_size&&(N=Math.floor(x/this.__indent_size),x-=N*this.__indent_size,U=new Array(N+1).join(this.__indent_string)),x&&(U+=new Array(x+1).join(" ")),this.__cache.push(U)};function y(x,N){this.__indent_cache=new m(x,N),this.raw=!1,this._end_with_newline=x.end_with_newline,this.indent_size=x.indent_size,this.wrap_line_length=x.wrap_line_length,this.indent_empty_lines=x.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(x,N){return this.__indent_cache.get_indent_string(x,N)},y.prototype.get_indent_size=function(x,N){return this.__indent_cache.get_indent_size(x,N)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(x){return this.is_empty()||!x&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(x){this.trim(!0);var N=this.current_line.pop();N&&(N[N.length-1]===`
|
|
`&&(N=N.replace(/\n+$/g,"")),this.current_line.push(N)),this._end_with_newline&&this.__add_outputline();var U=this.__lines.join(`
|
|
`);return x!==`
|
|
`&&(U=U.replace(/[\n]/g,x)),U},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(x,N){return x=x||0,N=N||0,this.next_line.set_indent(x,N),this.__lines.length>1?(this.current_line.set_indent(x,N),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(x){for(var N=0;N<x.newlines;N++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(x.whitespace_before),this.current_line.push(x.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(x){this.__add_space_before_token(),this.current_line.push(x),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(x){for(var N=this.__lines.length;x<N;)this.__lines[x]._remove_indent(),x++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(x){for(x=x===void 0?!1:x,this.current_line.trim();x&&this.__lines.length>1&&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},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(x,N){for(var U=this.__lines.length-2;U>=0;){var K=this.__lines[U];if(K.is_empty())break;if(K.item(0).indexOf(x)!==0&&K.item(-1)!==N){this.__lines.splice(U+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}U--}},w.exports.Output=y},function(w){function d(m,y,x,N){this.type=m,this.text=y,this.comments_before=null,this.newlines=x||0,this.whitespace_before=N||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}w.exports.Token=d},,,function(w){function d(x,N){this.raw_options=m(x,N),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","angular","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(x,N){var U=this.raw_options[x],K=N||[];return typeof U=="object"?U!==null&&typeof U.concat=="function"&&(K=U.concat()):typeof U=="string"&&(K=U.split(/[^a-zA-Z0-9_\/\-]+/)),K},d.prototype._get_boolean=function(x,N){var U=this.raw_options[x],K=U===void 0?!!N:!!U;return K},d.prototype._get_characters=function(x,N){var U=this.raw_options[x],K=N||"";return typeof U=="string"&&(K=U.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),K},d.prototype._get_number=function(x,N){var U=this.raw_options[x];N=parseInt(N,10),isNaN(N)&&(N=0);var K=parseInt(U,10);return isNaN(K)&&(K=N),K},d.prototype._get_selection=function(x,N,U){var K=this._get_selection_list(x,N,U);if(K.length!==1)throw new Error("Invalid Option Value: The option '"+x+`' can only be one of the following values:
|
|
`+N+`
|
|
You passed in: '`+this.raw_options[x]+"'");return K[0]},d.prototype._get_selection_list=function(x,N,U){if(!N||N.length===0)throw new Error("Selection list cannot be empty.");if(U=U||[N[0]],!this._is_valid_selection(U,N))throw new Error("Invalid Default Value!");var K=this._get_array(x,U);if(!this._is_valid_selection(K,N))throw new Error("Invalid Option Value: The option '"+x+`' can contain only the following values:
|
|
`+N+`
|
|
You passed in: '`+this.raw_options[x]+"'");return K},d.prototype._is_valid_selection=function(x,N){return x.length&&N.length&&!x.some(function(U){return N.indexOf(U)===-1})};function m(x,N){var U={};x=y(x);var K;for(K in x)K!==N&&(U[K]=x[K]);if(N&&x[N])for(K in x[N])U[K]=x[N][K];return U}function y(x){var N={},U;for(U in x){var K=U.replace(/-/g,"_");N[K]=x[U]}return N}w.exports.Options=d,w.exports.normalizeOpts=y,w.exports.mergeOpts=m},,function(w){var d=RegExp.prototype.hasOwnProperty("sticky");function m(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},m.prototype.peek=function(y){var x=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(x=this.__input.charAt(y)),x},m.prototype.__match=function(y,x){y.lastIndex=x;var N=y.exec(this.__input);return N&&!(d&&y.sticky)&&N.index!==x&&(N=null),N},m.prototype.test=function(y,x){return x=x||0,x+=this.__position,x>=0&&x<this.__input_length?!!this.__match(y,x):!1},m.prototype.testChar=function(y,x){var N=this.peek(x);return y.lastIndex=0,N!==null&&y.test(N)},m.prototype.match=function(y){var x=this.__match(y,this.__position);return x?this.__position+=x[0].length:x=null,x},m.prototype.read=function(y,x,N){var U="",K;return y&&(K=this.match(y),K&&(U+=K[0])),x&&(K||!y)&&(U+=this.readUntil(x,N)),U},m.prototype.readUntil=function(y,x){var N="",U=this.__position;y.lastIndex=this.__position;var K=y.exec(this.__input);return K?(U=K.index,x&&(U+=K[0].length)):U=this.__input_length,N=this.__input.substring(this.__position,U),this.__position=U,N},m.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},m.prototype.get_regexp=function(y,x){var N=null,U="g";return x&&d&&(U="y"),typeof y=="string"&&y!==""?N=new RegExp(y,U):y&&(N=new RegExp(y.source,U)),N},m.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(y){var x=this.__position,N=this.readUntilAfter(y);return this.__position=x,N},m.prototype.lookBack=function(y){var x=this.__position-1;return x>=y.length&&this.__input.substring(x-y.length,x).toLowerCase()===y},w.exports.InputScanner=m},function(w,d,m){var y=m(8).InputScanner,x=m(3).Token,N=m(10).TokenStream,U=m(11).WhitespacePattern,K={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},D=function(A,P){this._input=new y(A),this._options=P||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new U(this._input)};D.prototype.tokenize=function(){this._input.restart(),this.__tokens=new N,this._reset();for(var A,P=new x(K.START,""),z=null,se=[],ae=new N;P.type!==K.EOF;){for(A=this._get_next_token(P,z);this._is_comment(A);)ae.add(A),A=this._get_next_token(P,z);ae.isEmpty()||(A.comments_before=ae,ae=new N),A.parent=z,this._is_opening(A)?(se.push(z),z=A):z&&this._is_closing(A,z)&&(A.opened=z,z.closed=A,z=se.pop(),A.parent=z),A.previous=P,P.next=A,this.__tokens.add(A),P=A}return this.__tokens},D.prototype._is_first_token=function(){return this.__tokens.isEmpty()},D.prototype._reset=function(){},D.prototype._get_next_token=function(A,P){this._readWhitespace();var z=this._input.read(/.+/g);return z?this._create_token(K.RAW,z):this._create_token(K.EOF,"")},D.prototype._is_comment=function(A){return!1},D.prototype._is_opening=function(A){return!1},D.prototype._is_closing=function(A,P){return!1},D.prototype._create_token=function(A,P){var z=new x(A,P,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return z},D.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},w.exports.Tokenizer=D,w.exports.TOKEN=K},function(w){function d(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},d.prototype.peek=function(m){var y=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(y=this.__tokens[m]),y},d.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},w.exports.TokenStream=d},function(w,d,m){var y=m(12).Pattern;function x(N,U){y.call(this,N,U),U?this._line_regexp=this._input.get_regexp(U._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}x.prototype=new y,x.prototype.__set_whitespace_patterns=function(N,U){N+="\\t ",U+="\\n\\r",this._match_pattern=this._input.get_regexp("["+N+U+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+U+"]")},x.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var N=this._input.read(this._match_pattern);if(N===" ")this.whitespace_before_token=" ";else if(N){var U=this.__split(this._newline_regexp,N);this.newline_count=U.length-1,this.whitespace_before_token=U[this.newline_count]}return N},x.prototype.matching=function(N,U){var K=this._create();return K.__set_whitespace_patterns(N,U),K._update(),K},x.prototype._create=function(){return new x(this._input,this)},x.prototype.__split=function(N,U){N.lastIndex=0;for(var K=0,D=[],A=N.exec(U);A;)D.push(U.substring(K,A.index)),K=A.index+A[0].length,A=N.exec(U);return K<U.length?D.push(U.substring(K,U.length)):D.push(""),D},w.exports.WhitespacePattern=x},function(w){function d(m,y){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}d.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(m){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(m),y._update(),y},d.prototype.until=function(m){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(m),y._update(),y},d.prototype.starting_with=function(m){var y=this._create();return y._starting_pattern=this._input.get_regexp(m,!0),y._update(),y},d.prototype.matching=function(m){var y=this._create();return y._match_pattern=this._input.get_regexp(m,!0),y._update(),y},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},w.exports.Pattern=d},function(w){function d(m,y){m=typeof m=="string"?m:m.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+y,"g")}d.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var x=this.__directive_pattern.exec(m);x;)y[x[1]]=x[2],x=this.__directive_pattern.exec(m);return y},d.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},w.exports.Directives=d},function(w,d,m){var y=m(12).Pattern,x={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function N(U,K){y.call(this,U,K),this.__template_pattern=null,this._disabled=Object.assign({},x),this._excluded=Object.assign({},x),K&&(this.__template_pattern=this._input.get_regexp(K.__template_pattern),this._excluded=Object.assign(this._excluded,K._excluded),this._disabled=Object.assign(this._disabled,K._disabled));var D=new y(U);this.__patterns={handlebars_comment:D.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:D.starting_with(/{{{/).until_after(/}}}/),handlebars:D.starting_with(/{{/).until_after(/}}/),php:D.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:D.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:D.starting_with(/{%/).until_after(/%}/),django_value:D.starting_with(/{{/).until_after(/}}/),django_comment:D.starting_with(/{#/).until_after(/#}/),smarty:D.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:D.starting_with(/{\*/).until_after(/\*}/),smarty_literal:D.starting_with(/{literal}/).until_after(/{\/literal}/)}}N.prototype=new y,N.prototype._create=function(){return new N(this._input,this)},N.prototype._update=function(){this.__set_templated_pattern()},N.prototype.disable=function(U){var K=this._create();return K._disabled[U]=!0,K._update(),K},N.prototype.read_options=function(U){var K=this._create();for(var D in x)K._disabled[D]=U.templating.indexOf(D)===-1;return K._update(),K},N.prototype.exclude=function(U){var K=this._create();return K._excluded[U]=!0,K._update(),K},N.prototype.read=function(){var U="";this._match_pattern?U=this._input.read(this._starting_pattern):U=this._input.read(this._starting_pattern,this.__template_pattern);for(var K=this._read_template();K;)this._match_pattern?K+=this._input.read(this._match_pattern):K+=this._input.readUntil(this.__template_pattern),U+=K,K=this._read_template();return this._until_after&&(U+=this._input.readUntilAfter(this._until_pattern)),U},N.prototype.__set_templated_pattern=function(){var U=[];this._disabled.php||U.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||U.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||U.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||U.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(U.push(this.__patterns.django._starting_pattern.source),U.push(this.__patterns.django_value._starting_pattern.source),U.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||U.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&U.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+U.join("|")+")")},N.prototype._read_template=function(){var U="",K=this._input.peek();if(K==="<"){var D=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&D==="?"&&(U=U||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&D==="%"&&(U=U||this.__patterns.erb.read())}else K==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(U=U||this.__patterns.handlebars_comment.read(),U=U||this.__patterns.handlebars_unescaped.read(),U=U||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(U=U||this.__patterns.django_value.read()),this._excluded.django||(U=U||this.__patterns.django_comment.read(),U=U||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(U=U||this.__patterns.smarty_comment.read(),U=U||this.__patterns.smarty_literal.read(),U=U||this.__patterns.smarty.read()));return U},w.exports.TemplatablePattern=N},,,,function(w,d,m){var y=m(19).Beautifier,x=m(20).Options;function N(U,K,D,A){var P=new y(U,K,D,A);return P.beautify()}w.exports=N,w.exports.defaultOptions=function(){return new x}},function(w,d,m){var y=m(20).Options,x=m(2).Output,N=m(21).Tokenizer,U=m(21).TOKEN,K=/\r\n|[\r\n]/,D=/\r\n|[\r\n]/g,A=function(Z,L){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Z.max_preserve_newlines,this.preserve_newlines=Z.preserve_newlines,this._output=new x(Z,L)};A.prototype.current_line_has_match=function(Z){return this._output.current_line.has_match(Z)},A.prototype.set_space_before_token=function(Z,L){this._output.space_before_token=Z,this._output.non_breaking_space=L},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(Z){this._output.add_raw_token(Z)},A.prototype.print_preserved_newlines=function(Z){var L=0;Z.type!==U.TEXT&&Z.previous.type!==U.TEXT&&(L=Z.newlines?1:0),this.preserve_newlines&&(L=Z.newlines<this.max_preserve_newlines+1?Z.newlines:this.max_preserve_newlines+1);for(var V=0;V<L;V++)this.print_newline(V>0);return L!==0},A.prototype.traverse_whitespace=function(Z){return Z.whitespace_before||Z.newlines?(this.print_preserved_newlines(Z)||(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(Z){this._output.add_new_line(Z)},A.prototype.print_token=function(Z){Z.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Z.text))},A.prototype.indent=function(){this.indent_level++},A.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},A.prototype.get_full_indent=function(Z){return Z=this.indent_level+(Z||0),Z<1?"":this._output.get_indent_string(Z)};var P=function(Z){for(var L=null,V=Z.next;V.type!==U.EOF&&Z.closed!==V;){if(V.type===U.ATTRIBUTE&&V.text==="type"){V.next&&V.next.type===U.EQUALS&&V.next.next&&V.next.next.type===U.VALUE&&(L=V.next.next.text);break}V=V.next}return L},z=function(Z,L){var V=null,$=null;return L.closed?(Z==="script"?V="text/javascript":Z==="style"&&(V="text/css"),V=P(L)||V,V.search("text/css")>-1?$="css":V.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?$="javascript":V.search(/(text|application|dojo)\/(x-)?(html)/)>-1?$="html":V.search(/test\/null/)>-1&&($="null"),$):null};function se(Z,L){return L.indexOf(Z)!==-1}function ae(Z,L,V){this.parent=Z||null,this.tag=L?L.tag_name:"",this.indent_level=V||0,this.parser_token=L||null}function ne(Z){this._printer=Z,this._current_frame=null}ne.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ne.prototype.record_tag=function(Z){var L=new ae(this._current_frame,Z,this._printer.indent_level);this._current_frame=L},ne.prototype._try_pop_frame=function(Z){var L=null;return Z&&(L=Z.parser_token,this._printer.indent_level=Z.indent_level,this._current_frame=Z.parent),L},ne.prototype._get_frame=function(Z,L){for(var V=this._current_frame;V&&Z.indexOf(V.tag)===-1;){if(L&&L.indexOf(V.tag)!==-1){V=null;break}V=V.parent}return V},ne.prototype.try_pop=function(Z,L){var V=this._get_frame([Z],L);return this._try_pop_frame(V)},ne.prototype.indent_to_tag=function(Z){var L=this._get_frame(Z);L&&(this._printer.indent_level=L.indent_level)};function Q(Z,L,V,$){this._source_text=Z||"",L=L||{},this._js_beautify=V,this._css_beautify=$,this._tag_stack=null;var H=new y(L,"html");this._options=H,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"}Q.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Z=this._source_text,L=this._options.eol;this._options.eol==="auto"&&(L=`
|
|
`,Z&&K.test(Z)&&(L=Z.match(K)[0])),Z=Z.replace(D,`
|
|
`);var V=Z.match(/^[\t ]*/)[0],$={text:"",type:""},H=new ye(this._options),W=new A(this._options,V),_=new N(Z,this._options).tokenize();this._tag_stack=new ne(W);for(var g=null,O=_.next();O.type!==U.EOF;)O.type===U.TAG_OPEN||O.type===U.COMMENT?(g=this._handle_tag_open(W,O,H,$,_),H=g):O.type===U.ATTRIBUTE||O.type===U.EQUALS||O.type===U.VALUE||O.type===U.TEXT&&!H.tag_complete?g=this._handle_inside_tag(W,O,H,$):O.type===U.TAG_CLOSE?g=this._handle_tag_close(W,O,H):O.type===U.TEXT?g=this._handle_text(W,O,H):O.type===U.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(W,O):O.type===U.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(W,O):W.add_raw_token(O),$=g,O=_.next();var Y=W._output.get_code(L);return Y},Q.prototype._handle_control_flow_open=function(Z,L){var V={text:L.text,type:L.type};return Z.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),L.newlines?Z.print_preserved_newlines(L):Z.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),Z.print_token(L),Z.indent(),V},Q.prototype._handle_control_flow_close=function(Z,L){var V={text:L.text,type:L.type};return Z.deindent(),L.newlines?Z.print_preserved_newlines(L):Z.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),Z.print_token(L),V},Q.prototype._handle_tag_close=function(Z,L,V){var $={text:L.text,type:L.type};return Z.alignment_size=0,V.tag_complete=!0,Z.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),V.is_unformatted?Z.add_raw_token(L):(V.tag_start_char==="<"&&(Z.set_space_before_token(L.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&V.has_wrapped_attrs&&Z.print_newline(!1)),Z.print_token(L)),V.indent_content&&!(V.is_unformatted||V.is_content_unformatted)&&(Z.indent(),V.indent_content=!1),!V.is_inline_element&&!(V.is_unformatted||V.is_content_unformatted)&&Z.set_wrap_point(),$},Q.prototype._handle_inside_tag=function(Z,L,V,$){var H=V.has_wrapped_attrs,W={text:L.text,type:L.type};return Z.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),V.is_unformatted?Z.add_raw_token(L):V.tag_start_char==="{"&&L.type===U.TEXT?Z.print_preserved_newlines(L)?(L.newlines=0,Z.add_raw_token(L)):Z.print_token(L):(L.type===U.ATTRIBUTE?Z.set_space_before_token(!0):(L.type===U.EQUALS||L.type===U.VALUE&&L.previous.type===U.EQUALS)&&Z.set_space_before_token(!1),L.type===U.ATTRIBUTE&&V.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Z.traverse_whitespace(L),H=H||L.newlines!==0),this._is_wrap_attributes_force&&V.attr_count>=this._options.wrap_attributes_min_attrs&&($.type!==U.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Z.print_newline(!1),H=!0)),Z.print_token(L),H=H||Z.previous_token_wrapped(),V.has_wrapped_attrs=H),W},Q.prototype._handle_text=function(Z,L,V){var $={text:L.text,type:"TK_CONTENT"};return V.custom_beautifier_name?this._print_custom_beatifier_text(Z,L,V):V.is_unformatted||V.is_content_unformatted?Z.add_raw_token(L):(Z.traverse_whitespace(L),Z.print_token(L)),$},Q.prototype._print_custom_beatifier_text=function(Z,L,V){var $=this;if(L.text!==""){var H=L.text,W,_=1,g="",O="";V.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?W=this._js_beautify:V.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?W=this._css_beautify:V.custom_beautifier_name==="html"&&(W=function(Tt,gt){var Le=new Q(Tt,gt,$._js_beautify,$._css_beautify);return Le.beautify()}),this._options.indent_scripts==="keep"?_=0:this._options.indent_scripts==="separate"&&(_=-Z.indent_level);var Y=Z.get_full_indent(_);if(H=H.replace(/\n[ \t]*$/,""),V.custom_beautifier_name!=="html"&&H[0]==="<"&&H.match(/^(<!--|<!\[CDATA\[)/)){var Pe=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(H);if(!Pe){Z.add_raw_token(L);return}g=Y+Pe[1]+`
|
|
`,H=Pe[4],Pe[5]&&(O=Y+Pe[5]),H=H.replace(/\n[ \t]*$/,""),(Pe[2]||Pe[3].indexOf(`
|
|
`)!==-1)&&(Pe=Pe[3].match(/[ \t]+$/),Pe&&(L.whitespace_before=Pe[0]))}if(H)if(W){var Me=function(){this.eol=`
|
|
`};Me.prototype=this._options.raw_options;var Xe=new Me;H=W(Y+H,Xe)}else{var Ye=L.whitespace_before;Ye&&(H=H.replace(new RegExp(`
|
|
(`+Ye+")?","g"),`
|
|
`)),H=Y+H.replace(/\n/g,`
|
|
`+Y)}g&&(H?H=g+H+`
|
|
`+O:H=g+O),Z.print_newline(!1),H&&(L.text=H,L.whitespace_before="",L.newlines=0,Z.add_raw_token(L),Z.print_newline(!0))}},Q.prototype._handle_tag_open=function(Z,L,V,$,H){var W=this._get_tag_open_token(L);if((V.is_unformatted||V.is_content_unformatted)&&!V.is_empty_element&&L.type===U.TAG_OPEN&&!W.is_start_tag?(Z.add_raw_token(L),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(Z.traverse_whitespace(L),this._set_tag_position(Z,L,W,V,$),W.is_inline_element||Z.set_wrap_point(),Z.print_token(L)),W.is_start_tag&&this._is_wrap_attributes_force){var _=0,g;do g=H.peek(_),g.type===U.ATTRIBUTE&&(W.attr_count+=1),_+=1;while(g.type!==U.EOF&&g.type!==U.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=L.text.length+1),!W.tag_complete&&!W.is_unformatted&&(Z.alignment_size=W.alignment_size),W};var ye=function(Z,L,V){if(this.parent=L||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!V)this.tag_complete=!0;else{var $;this.tag_start_char=V.text[0],this.text=V.text,this.tag_start_char==="<"?($=V.text.match(/^<([^\s>]*)/),this.tag_check=$?$[1]:""):($=V.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=$?$[1]:"",(V.text.startsWith("{{#>")||V.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&V.next!==null?this.tag_check=V.next.text.split(" ")[0]:this.tag_check=V.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),V.type===U.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||V.closed&&V.closed.text==="/>";var H=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(H=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Z.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(H)))}};Q.prototype._get_tag_open_token=function(Z){var L=new ye(this._options,this._tag_stack.get_parser_token(),Z);return L.alignment_size=this._options.wrap_attributes_indent_size,L.is_end_tag=L.is_end_tag||se(L.tag_check,this._options.void_elements),L.is_empty_element=L.tag_complete||L.is_start_tag&&L.is_end_tag,L.is_unformatted=!L.tag_complete&&se(L.tag_check,this._options.unformatted),L.is_content_unformatted=!L.is_empty_element&&se(L.tag_check,this._options.content_unformatted),L.is_inline_element=se(L.tag_name,this._options.inline)||this._options.inline_custom_elements&&L.tag_name.includes("-")||L.tag_start_char==="{",L},Q.prototype._set_tag_position=function(Z,L,V,$,H){if(V.is_empty_element||(V.is_end_tag?V.start_tag_token=this._tag_stack.try_pop(V.tag_name):(this._do_optional_end_element(V)&&(V.is_inline_element||Z.print_newline(!1)),this._tag_stack.record_tag(V),(V.tag_name==="script"||V.tag_name==="style")&&!(V.is_unformatted||V.is_content_unformatted)&&(V.custom_beautifier_name=z(V.tag_check,L)))),se(V.tag_check,this._options.extra_liners)&&(Z.print_newline(!1),Z._output.just_added_blankline()||Z.print_newline(!0)),V.is_empty_element){if(V.tag_start_char==="{"&&V.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),V.indent_content=!0;var W=Z.current_line_has_match(/{{#if/);W||Z.print_newline(!1)}V.tag_name==="!--"&&H.type===U.TAG_CLOSE&&$.is_end_tag&&V.text.indexOf(`
|
|
`)===-1||(V.is_inline_element||V.is_unformatted||Z.print_newline(!1),this._calcluate_parent_multiline(Z,V))}else if(V.is_end_tag){var _=!1;_=V.start_tag_token&&V.start_tag_token.multiline_content,_=_||!V.is_inline_element&&!($.is_inline_element||$.is_unformatted)&&!(H.type===U.TAG_CLOSE&&V.start_tag_token===$)&&H.type!=="TK_CONTENT",(V.is_content_unformatted||V.is_unformatted)&&(_=!1),_&&Z.print_newline(!1)}else V.indent_content=!V.custom_beautifier_name,V.tag_start_char==="<"&&(V.tag_name==="html"?V.indent_content=this._options.indent_inner_html:V.tag_name==="head"?V.indent_content=this._options.indent_head_inner_html:V.tag_name==="body"&&(V.indent_content=this._options.indent_body_inner_html)),!(V.is_inline_element||V.is_unformatted)&&(H.type!=="TK_CONTENT"||V.is_content_unformatted)&&Z.print_newline(!1),this._calcluate_parent_multiline(Z,V)},Q.prototype._calcluate_parent_multiline=function(Z,L){L.parent&&Z._output.just_added_newline()&&!((L.is_inline_element||L.is_unformatted)&&L.parent.is_inline_element)&&(L.parent.multiline_content=!0)};var ce=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],Oe=["a","audio","del","ins","map","noscript","video"];Q.prototype._do_optional_end_element=function(Z){var L=null;if(!(Z.is_empty_element||!Z.is_start_tag||!Z.parent)){if(Z.tag_name==="body")L=L||this._tag_stack.try_pop("head");else if(Z.tag_name==="li")L=L||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Z.tag_name==="dd"||Z.tag_name==="dt")L=L||this._tag_stack.try_pop("dt",["dl"]),L=L||this._tag_stack.try_pop("dd",["dl"]);else if(Z.parent.tag_name==="p"&&ce.indexOf(Z.tag_name)!==-1){var V=Z.parent.parent;(!V||Oe.indexOf(V.tag_name)===-1)&&(L=L||this._tag_stack.try_pop("p"))}else Z.tag_name==="rp"||Z.tag_name==="rt"?(L=L||this._tag_stack.try_pop("rt",["ruby","rtc"]),L=L||this._tag_stack.try_pop("rp",["ruby","rtc"])):Z.tag_name==="optgroup"?L=L||this._tag_stack.try_pop("optgroup",["select"]):Z.tag_name==="option"?L=L||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Z.tag_name==="colgroup"?L=L||this._tag_stack.try_pop("caption",["table"]):Z.tag_name==="thead"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"])):Z.tag_name==="tbody"||Z.tag_name==="tfoot"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("thead",["table"]),L=L||this._tag_stack.try_pop("tbody",["table"])):Z.tag_name==="tr"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Z.tag_name==="th"||Z.tag_name==="td")&&(L=L||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),L=L||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Z.parent=this._tag_stack.get_parser_token(),L}},w.exports.Beautifier=Q},function(w,d,m){var y=m(6).Options;function x(N){y.call(this,N,"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_min_attrs=this._get_number("wrap_attributes_min_attrs",2),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.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),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"])}x.prototype=new y,w.exports.Options=x},function(w,d,m){var y=m(9).Tokenizer,x=m(9).TOKEN,N=m(13).Directives,U=m(14).TemplatablePattern,K=m(12).Pattern,D={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:x.START,RAW:x.RAW,EOF:x.EOF},A=new N(/<\!--/,/-->/),P=function(z,se){y.call(this,z,se),this._current_tag_name="";var ae=new U(this._input).read_options(this._options),ne=new K(this._input);if(this.__patterns={word:ae.until(/[\n\r\t <]/),word_control_flow_close_excluded:ae.until(/[\n\r\t <}]/),single_quote:ae.until_after(/'/),double_quote:ae.until_after(/"/),attribute:ae.until(/[\n\r\t =>]|\/>/),element_name:ae.until(/[\n\r\t >\/]/),angular_control_flow_start:ne.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ne.starting_with(/{{!--/).until_after(/--}}/),handlebars:ne.starting_with(/{{/).until_after(/}}/),handlebars_open:ne.until(/[\n\r\t }]/),handlebars_raw_close:ne.until(/}}/),comment:ne.starting_with(/<!--/).until_after(/-->/),cdata:ne.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ne.starting_with(/<!\[/).until_after(/]>/),processing:ne.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var Q=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ne.matching(Q).until_after(Q)}};P.prototype=new y,P.prototype._is_comment=function(z){return!1},P.prototype._is_opening=function(z){return z.type===D.TAG_OPEN||z.type===D.CONTROL_FLOW_OPEN},P.prototype._is_closing=function(z,se){return z.type===D.TAG_CLOSE&&se&&((z.text===">"||z.text==="/>")&&se.text[0]==="<"||z.text==="}}"&&se.text[0]==="{"&&se.text[1]==="{")||z.type===D.CONTROL_FLOW_CLOSE&&z.text==="}"&&se.text.endsWith("{")},P.prototype._reset=function(){this._current_tag_name=""},P.prototype._get_next_token=function(z,se){var ae=null;this._readWhitespace();var ne=this._input.peek();return ne===null?this._create_token(D.EOF,""):(ae=ae||this._read_open_handlebars(ne,se),ae=ae||this._read_attribute(ne,z,se),ae=ae||this._read_close(ne,se),ae=ae||this._read_script_and_style(ne,z),ae=ae||this._read_control_flows(ne,se),ae=ae||this._read_raw_content(ne,z,se),ae=ae||this._read_content_word(ne,se),ae=ae||this._read_comment_or_cdata(ne),ae=ae||this._read_processing(ne),ae=ae||this._read_open(ne,se),ae=ae||this._create_token(D.UNKNOWN,this._input.next()),ae)},P.prototype._read_comment_or_cdata=function(z){var se=null,ae=null,ne=null;if(z==="<"){var Q=this._input.peek(1);Q==="!"&&(ae=this.__patterns.comment.read(),ae?(ne=A.get_directives(ae),ne&&ne.ignore==="start"&&(ae+=A.readIgnored(this._input))):ae=this.__patterns.cdata.read()),ae&&(se=this._create_token(D.COMMENT,ae),se.directives=ne)}return se},P.prototype._read_processing=function(z){var se=null,ae=null,ne=null;if(z==="<"){var Q=this._input.peek(1);(Q==="!"||Q==="?")&&(ae=this.__patterns.conditional_comment.read(),ae=ae||this.__patterns.processing.read()),ae&&(se=this._create_token(D.COMMENT,ae),se.directives=ne)}return se},P.prototype._read_open=function(z,se){var ae=null,ne=null;return(!se||se.type===D.CONTROL_FLOW_OPEN)&&z==="<"&&(ae=this._input.next(),this._input.peek()==="/"&&(ae+=this._input.next()),ae+=this.__patterns.element_name.read(),ne=this._create_token(D.TAG_OPEN,ae)),ne},P.prototype._read_open_handlebars=function(z,se){var ae=null,ne=null;return(!se||se.type===D.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&z==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(ae=this.__patterns.handlebars_comment.read(),ae=ae||this.__patterns.handlebars.read(),ne=this._create_token(D.COMMENT,ae)):(ae=this.__patterns.handlebars_open.read(),ne=this._create_token(D.TAG_OPEN,ae))),ne},P.prototype._read_control_flows=function(z,se){var ae="",ne=null;if(!this._options.templating.includes("angular"))return ne;if(z==="@"){if(ae=this.__patterns.angular_control_flow_start.read(),ae==="")return ne;for(var Q=ae.endsWith("(")?1:0,ye=0;!(ae.endsWith("{")&&Q===ye);){var ce=this._input.next();if(ce===null)break;ce==="("?Q++:ce===")"&&ye++,ae+=ce}ne=this._create_token(D.CONTROL_FLOW_OPEN,ae)}else z==="}"&&se&&se.type===D.CONTROL_FLOW_OPEN&&(ae=this._input.next(),ne=this._create_token(D.CONTROL_FLOW_CLOSE,ae));return ne},P.prototype._read_close=function(z,se){var ae=null,ne=null;return se&&se.type===D.TAG_OPEN&&(se.text[0]==="<"&&(z===">"||z==="/"&&this._input.peek(1)===">")?(ae=this._input.next(),z==="/"&&(ae+=this._input.next()),ne=this._create_token(D.TAG_CLOSE,ae)):se.text[0]==="{"&&z==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ne=this._create_token(D.TAG_CLOSE,"}}"))),ne},P.prototype._read_attribute=function(z,se,ae){var ne=null,Q="";if(ae&&ae.text[0]==="<")if(z==="=")ne=this._create_token(D.EQUALS,this._input.next());else if(z==='"'||z==="'"){var ye=this._input.next();z==='"'?ye+=this.__patterns.double_quote.read():ye+=this.__patterns.single_quote.read(),ne=this._create_token(D.VALUE,ye)}else Q=this.__patterns.attribute.read(),Q&&(se.type===D.EQUALS?ne=this._create_token(D.VALUE,Q):ne=this._create_token(D.ATTRIBUTE,Q));return ne},P.prototype._is_content_unformatted=function(z){return this._options.void_elements.indexOf(z)===-1&&(this._options.content_unformatted.indexOf(z)!==-1||this._options.unformatted.indexOf(z)!==-1)},P.prototype._read_raw_content=function(z,se,ae){var ne="";if(ae&&ae.text[0]==="{")ne=this.__patterns.handlebars_raw_close.read();else if(se.type===D.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var Q=se.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Q)&&(ne=this._input.readUntil(new RegExp("</"+Q+"[\\n\\r\\t ]*?>","ig")))}return ne?this._create_token(D.TEXT,ne):null},P.prototype._read_script_and_style=function(z,se){if(se.type===D.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var ae=se.opened.text.substr(1).toLowerCase();if(ae==="script"||ae==="style"){var ne=this._read_comment_or_cdata(z);if(ne)return ne.type=D.TEXT,ne;var Q=this._input.readUntil(new RegExp("</"+ae+"[\\n\\r\\t ]*?>","ig"));if(Q)return this._create_token(D.TEXT,Q)}}return null},P.prototype._read_content_word=function(z,se){var ae="";return this._options.unformatted_content_delimiter&&z===this._options.unformatted_content_delimiter[0]&&(ae=this.__patterns.unformatted_content_delimiter.read()),ae||(ae=se&&se.type===D.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ae?this._create_token(D.TEXT,ae):null},w.exports.Tokenizer=P,w.exports.TOKEN=D}],ie={};function l(w){var d=ie[w];if(d!==void 0)return d.exports;var m=ie[w]={exports:{}};return fe[w](m,m.exports,l),m.exports}var S=l(18);De=S})();var re=De;if(1)T=[C,C(58553),C(87804)],de=function(fe){var ie=C(58553),l=C(87804);return{html_beautify:function(S,w){return re(S,w,ie.js_beautify,l.css_beautify)}}}.apply(St,T),de!==void 0&&(vn.exports=de);else var M,p})()},58553:function(vn,St){var C,T;(function(){var de;(function(){"use strict";var re=[function(ie,l,S){var w=S(1).Beautifier,d=S(5).Options;function m(y,x){var N=new w(y,x);return N.beautify()}ie.exports=m,ie.exports.defaultOptions=function(){return new d}},function(ie,l,S){var w=S(2).Output,d=S(3).Token,m=S(4),y=S(5).Options,x=S(7).Tokenizer,N=S(7).line_starters,U=S(7).positionable_operators,K=S(7).TOKEN;function D(g,O){return O.indexOf(g)!==-1}function A(g){return g.replace(/^\s+/g,"")}function P(g){for(var O={},Y=0;Y<g.length;Y++)O[g[Y].replace(/-/g,"_")]=g[Y];return O}function z(g,O){return g&&g.type===K.RESERVED&&g.text===O}function se(g,O){return g&&g.type===K.RESERVED&&D(g.text,O)}var ae=["case","return","do","if","throw","else","await","break","continue","async"],ne=["before-newline","after-newline","preserve-newline"],Q=P(ne),ye=[Q.before_newline,Q.preserve_newline],ce={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Oe(g,O){O.multiline_frame||O.mode===ce.ForInitializer||O.mode===ce.Conditional||g.remove_indent(O.start_line_index)}function Z(g){g=g.replace(m.allLineBreaks,`
|
|
`);for(var O=[],Y=g.indexOf(`
|
|
`);Y!==-1;)O.push(g.substring(0,Y)),g=g.substring(Y+1),Y=g.indexOf(`
|
|
`);return g.length&&O.push(g),O}function L(g){return g===ce.ArrayLiteral}function V(g){return D(g,[ce.Expression,ce.ForInitializer,ce.Conditional])}function $(g,O){for(var Y=0;Y<g.length;Y++){var Pe=g[Y].trim();if(Pe.charAt(0)!==O)return!1}return!0}function H(g,O){for(var Y=0,Pe=g.length,Me;Y<Pe;Y++)if(Me=g[Y],Me&&Me.indexOf(O)!==0)return!1;return!0}function W(g,O){O=O||{},this._source_text=g||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(O)}W.prototype.create_flags=function(g,O){var Y=0;g&&(Y=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>Y&&(Y=g.line_indent_level));var Pe={mode:O,parent:g,last_token:g?g.last_token:new d(K.START_BLOCK,""),last_word:g?g.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:Y,alignment:0,line_indent_level:g?g.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return Pe},W.prototype._reset=function(g){var O=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new w(this._options,O),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ce.BlockStatement);var Y=new x(g,this._options);return this._tokens=Y.tokenize(),g},W.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,O=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
|
|
`,O&&m.lineBreak.test(O||"")&&(Y=O.match(m.lineBreak)[0]));for(var Pe=this._tokens.next();Pe;)this.handle_token(Pe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Pe,Pe=this._tokens.next();return g=this._output.get_code(Y),g},W.prototype.handle_token=function(g,O){g.type===K.START_EXPR?this.handle_start_expr(g):g.type===K.END_EXPR?this.handle_end_expr(g):g.type===K.START_BLOCK?this.handle_start_block(g):g.type===K.END_BLOCK?this.handle_end_block(g):g.type===K.WORD?this.handle_word(g):g.type===K.RESERVED?this.handle_word(g):g.type===K.SEMICOLON?this.handle_semicolon(g):g.type===K.STRING?this.handle_string(g):g.type===K.EQUALS?this.handle_equals(g):g.type===K.OPERATOR?this.handle_operator(g):g.type===K.COMMA?this.handle_comma(g):g.type===K.BLOCK_COMMENT?this.handle_block_comment(g,O):g.type===K.COMMENT?this.handle_comment(g,O):g.type===K.DOT?this.handle_dot(g):g.type===K.EOF?this.handle_eof(g):g.type===K.UNKNOWN?this.handle_unknown(g,O):this.handle_unknown(g,O)},W.prototype.handle_whitespace_and_comments=function(g,O){var Y=g.newlines,Pe=this._options.keep_array_indentation&&L(this._flags.mode);if(g.comments_before)for(var Me=g.comments_before.next();Me;)this.handle_whitespace_and_comments(Me,O),this.handle_token(Me,O),Me=g.comments_before.next();if(Pe)for(var Xe=0;Xe<Y;Xe+=1)this.print_newline(Xe>0,O);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,O);for(var Ye=1;Ye<Y;Ye+=1)this.print_newline(!0,O)}};var _=["async","break","continue","return","throw","yield"];W.prototype.allow_wrap_or_preserved_newline=function(g,O){if(O=O===void 0?!1:O,!this._output.just_added_newline()){var Y=this._options.preserve_newlines&&g.newlines||O,Pe=D(this._flags.last_token.text,U)||D(g.text,U);if(Pe){var Me=D(this._flags.last_token.text,U)&&D(this._options.operator_position,ye)||D(g.text,U);Y=Y&&Me}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(se(this._flags.last_token,_))return;this._output.set_wrap_point()}}},W.prototype.print_newline=function(g,O){if(!O&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==K.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var Y=this._tokens.peek();this._flags.mode===ce.Statement&&!(this._flags.if_block&&z(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},W.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||L(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},W.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===K.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var O=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(O),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},W.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.prototype.deindent=function(){this._flags.indentation_level>0&&(!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))},W.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===ce.Statement&&Oe(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},W.prototype.start_of_object_property=function(){return this._flags.parent.mode===ce.ObjectLiteral&&this._flags.mode===ce.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"]))},W.prototype.start_of_statement=function(g){var O=!1;return O=O||se(this._flags.last_token,["var","let","const"])&&g.type===K.WORD,O=O||z(this._flags.last_token,"do"),O=O||!(this._flags.parent.mode===ce.ObjectLiteral&&this._flags.mode===ce.Statement)&&se(this._flags.last_token,_)&&!g.newlines,O=O||z(this._flags.last_token,"else")&&!(z(g,"if")&&!g.comments_before),O=O||this._flags.last_token.type===K.END_EXPR&&(this._previous_flags.mode===ce.ForInitializer||this._previous_flags.mode===ce.Conditional),O=O||this._flags.last_token.type===K.WORD&&this._flags.mode===ce.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==K.WORD&&g.type!==K.RESERVED,O=O||this._flags.mode===ce.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"])),O?(this.set_mode(ce.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,se(g,["do","for","if","while"])),!0):!1},W.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var O=ce.Expression;if(g.text==="["){if(this._flags.last_token.type===K.WORD||this._flags.last_token.text===")"){se(this._flags.last_token,N)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(O),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}O=ce.ArrayLiteral,L(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()),D(this._flags.last_token.type,[K.START_EXPR,K.END_EXPR,K.WORD,K.OPERATOR,K.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===K.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,O=ce.ForInitializer):D(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,O=ce.Conditional):D(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(D(this._flags.last_token.text,N)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===K.EQUALS||this._flags.last_token.type===K.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===K.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var Pe=this._tokens.peek(-4);se(Y,["async","function"])||Y.text==="*"&&se(Pe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ce.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(Pe.text==="{"||Pe.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(g);(this._flags.last_token.type===K.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(D(this._last_last_text,["function","yield"])||this._flags.mode===ce.ObjectLiteral&&D(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===K.START_BLOCK?this.print_newline():(this._flags.last_token.type===K.END_EXPR||this._flags.last_token.type===K.START_EXPR||this._flags.last_token.type===K.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===K.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(O),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},W.prototype.handle_end_expr=function(g){for(;this._flags.mode===ce.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&L(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===K.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(g),this.restore_mode(),Oe(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===ce.Conditional&&(this._previous_flags.mode=ce.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},W.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var O=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===K.END_EXPR?(this.set_mode(ce.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(ce.BlockStatement):Y&&(D(Y.text,[":",","])&&D(O.type,[K.STRING,K.WORD,K.RESERVED])||D(O.text,["get","set","..."])&&D(Y.type,[K.WORD,K.RESERVED]))?D(this._last_last_text,["class","interface"])&&!D(Y.text,[":",","])?this.set_mode(ce.BlockStatement):this.set_mode(ce.ObjectLiteral):this._flags.last_token.type===K.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(ce.BlockStatement):D(this._flags.last_token.type,[K.EQUALS,K.START_EXPR,K.COMMA,K.OPERATOR])||se(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ce.ObjectLiteral):this.set_mode(ce.BlockStatement),this._flags.last_token&&se(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Pe=!O.comments_before&&O.text==="}",Me=Pe&&this._flags.last_word==="function"&&this._flags.last_token.type===K.END_EXPR;if(this._options.brace_preserve_inline){var Xe=0,Ye=null;this._flags.inline_frame=!0;do if(Xe+=1,Ye=this._tokens.peek(Xe-1),Ye.newlines){this._flags.inline_frame=!1;break}while(Ye.type!==K.EOF&&!(Ye.type===K.END_BLOCK&&Ye.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==K.OPERATOR&&(Me||this._flags.last_token.type===K.EQUALS||se(this._flags.last_token,ae)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(L(this._previous_flags.mode)&&(this._flags.last_token.type===K.START_EXPR||this._flags.last_token.type===K.COMMA)&&((this._flags.last_token.type===K.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===K.COMMA||this._flags.last_token.type===K.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==K.OPERATOR&&this._flags.last_token.type!==K.START_EXPR&&(D(this._flags.last_token.type,[K.START_BLOCK,K.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!Pe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},W.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===ce.Statement;)this.restore_mode();var O=this._flags.last_token.type===K.START_BLOCK;this._flags.inline_frame&&!O?this._output.space_before_token=!0:this._options.brace_style==="expand"?O||this.print_newline():O||(L(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(g)},W.prototype.handle_word=function(g){if(g.type===K.RESERVED){if(D(g.text,["set","get"])&&this._flags.mode!==ce.ObjectLiteral)g.type=K.WORD;else if(g.text==="import"&&D(this._tokens.peek().text,["(","."]))g.type=K.WORD;else if(D(g.text,["as","from"])&&!this._flags.import_block)g.type=K.WORD;else if(this._flags.mode===ce.ObjectLiteral){var O=this._tokens.peek();O.text===":"&&(g.type=K.WORD)}}if(this.start_of_statement(g)?se(this._flags.last_token,["var","let","const"])&&g.type===K.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!V(this._flags.mode)&&(this._flags.last_token.type!==K.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==K.EQUALS&&(this._options.preserve_newlines||!se(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(z(g,"while")){this._output.space_before_token=!0,this.print_token(g),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&&z(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===ce.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&se(g,["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(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===K.COMMA||this._flags.last_token.type===K.START_EXPR||this._flags.last_token.type===K.EQUALS||this._flags.last_token.type===K.OPERATOR)&&!this.start_of_object_property()&&!(D(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ce.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(g),z(g,"function")){(D(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(D(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===K.OPERATOR))&&!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===K.RESERVED||this._flags.last_token.type===K.WORD?se(this._flags.last_token,["get","set","new","export"])||se(this._flags.last_token,_)?this._output.space_before_token=!0:z(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===K.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(V(this._flags.mode)||L(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var Y="NONE";if(this._flags.last_token.type===K.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":se(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===K.SEMICOLON&&this._flags.mode===ce.BlockStatement?Y="NEWLINE":this._flags.last_token.type===K.SEMICOLON&&V(this._flags.mode)?Y="SPACE":this._flags.last_token.type===K.STRING?Y="NEWLINE":this._flags.last_token.type===K.RESERVED||this._flags.last_token.type===K.WORD||this._flags.last_token.text==="*"&&(D(this._last_last_text,["function","yield"])||this._flags.mode===ce.ObjectLiteral&&D(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===K.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===K.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),se(g,N)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),se(g,["else","catch","finally"]))if((!(this._flags.last_token.type===K.END_BLOCK&&this._previous_flags.mode===ce.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Pe=this._output.current_line;Pe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?se(this._flags.last_token,ae)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&se(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==K.END_EXPR?(this._flags.last_token.type!==K.START_EXPR||!se(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(z(g,"if")&&z(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):se(g,N)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&L(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===K.WORD||g.previous.type===K.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===K.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&z(g,"from")&&(this._flags.import_block=!1))},W.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var O=this._tokens.peek();this._flags.mode===ce.Statement&&!(this._flags.if_block&&z(O,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},W.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===K.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===K.RESERVED||this._flags.last_token.type===K.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===K.COMMA||this._flags.last_token.type===K.START_EXPR||this._flags.last_token.type===K.EQUALS||this._flags.last_token.type===K.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===K.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},W.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},W.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(V(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(g)):this._flags.mode===ce.ObjectLiteral||this._flags.mode===ce.Statement&&this._flags.parent.mode===ce.ObjectLiteral?(this._flags.mode===ce.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},W.prototype.handle_operator=function(g){var O=g.text==="*"&&(se(this._flags.last_token,["function","yield"])||D(this._flags.last_token.type,[K.START_BLOCK,K.COMMA,K.END_BLOCK,K.SEMICOLON])),Y=D(g.text,["-","+"])&&(D(this._flags.last_token.type,[K.START_BLOCK,K.START_EXPR,K.EQUALS,K.OPERATOR])||D(this._flags.last_token.text,N)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var Pe=!O;this.handle_whitespace_and_comments(g,Pe)}if(g.text==="*"&&this._flags.last_token.type===K.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(D(g.text,["-","+"])&&this.start_of_object_property()){this.print_token(g);return}if(this._flags.last_token.type===K.OPERATOR&&D(this._options.operator_position,ye)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==K.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 Me=!0,Xe=!0,Ye=!1;if(g.text===":"?this._flags.ternary_depth===0?Me=!1:(this._flags.ternary_depth-=1,Ye=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!O&&this._options.preserve_newlines&&D(g.text,U)){var Tt=g.text===":",gt=Tt&&Ye,Le=Tt&&!Ye;switch(this._options.operator_position){case Q.before_newline:this._output.space_before_token=!Le,this.print_token(g),(!Tt||gt)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case Q.after_newline:this._output.space_before_token=!0,!Tt||gt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case Q.preserve_newline:Le||this.allow_wrap_or_preserved_newline(g),Me=!(this._output.just_added_newline()||Le),this._output.space_before_token=Me,this.print_token(g),this._output.space_before_token=!0;return}}if(O){this.allow_wrap_or_preserved_newline(g),Me=!1;var Je=this._tokens.peek();Xe=Je&&D(Je.type,[K.WORD,K.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),Me=this._flags.last_token.type===K.START_BLOCK,Xe=!1;else if(D(g.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===K.COMMA||this._flags.last_token.type===K.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),Me=!1,Xe=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var Et=se(this._flags.last_token,ae)&&g.newlines;Et&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Et,!0)}this._flags.last_token.text===";"&&V(this._flags.mode)&&(Me=!0),this._flags.last_token.type===K.RESERVED?Me=!0:this._flags.last_token.type===K.END_EXPR?Me=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===K.OPERATOR&&(Me=D(g.text,["--","-","++","+"])&&D(this._flags.last_token.text,["--","-","++","+"]),D(g.text,["+","-"])&&D(this._flags.last_token.text,["--","++"])&&(Xe=!0)),(this._flags.mode===ce.BlockStatement&&!this._flags.inline_frame||this._flags.mode===ce.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Me,this.print_token(g),this._output.space_before_token=Xe},W.prototype.handle_block_comment=function(g,O){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,O),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,O)},W.prototype.print_block_commment=function(g,O){var Y=Z(g.text),Pe,Me=!1,Xe=!1,Ye=g.whitespace_before,Tt=Ye.length;if(this.print_newline(!1,O),this.print_token_line_indentation(g),this._output.add_token(Y[0]),this.print_newline(!1,O),Y.length>1){for(Y=Y.slice(1),Me=$(Y,"*"),Xe=H(Y,Ye),Me&&(this._flags.alignment=1),Pe=0;Pe<Y.length;Pe++)Me?(this.print_token_line_indentation(g),this._output.add_token(A(Y[Pe]))):Xe&&Y[Pe]?(this.print_token_line_indentation(g),this._output.add_token(Y[Pe].substring(Tt))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[Pe])),this.print_newline(!1,O);this._flags.alignment=0}},W.prototype.handle_comment=function(g,O){g.newlines?this.print_newline(!1,O):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,O)},W.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),se(this._flags.last_token,ae)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},W.prototype.handle_unknown=function(g,O){this.print_token(g),g.text[g.text.length-1]===`
|
|
`&&this.print_newline(!1,O)},W.prototype.handle_eof=function(g){for(;this._flags.mode===ce.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},ie.exports.Beautifier=W},function(ie){function l(d){this.__parent=d,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=[]}l.prototype.clone_empty=function(){var d=new l(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},l.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},l.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},l.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.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)},l.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},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},l.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function S(d,m){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(d,m){var y=this.__base_string_length;return m=m||0,d<0&&(y=0),y+=d*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(d,m){var y=this.__base_string;return m=m||0,d<0&&(d=0,y=""),m+=d*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var d=this.__cache.length,m=0,y="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),d&&(y+=new Array(d+1).join(" ")),this.__cache.push(y)};function w(d,m){this.__indent_cache=new S(d,m),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}w.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},w.prototype.get_line_number=function(){return this.__lines.length},w.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},w.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},w.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},w.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},w.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(y=y.replace(/[\n]/g,d)),y},w.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},w.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},w.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},w.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},w.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},w.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},w.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&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},w.prototype.just_added_newline=function(){return this.current_line.is_empty()},w.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},w.prototype.ensure_empty_line_above=function(d,m){for(var y=this.__lines.length-2;y>=0;){var x=this.__lines[y];if(x.is_empty())break;if(x.item(0).indexOf(d)!==0&&x.item(-1)!==m){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ie.exports.Output=w},function(ie){function l(S,w,d,m){this.type=S,this.text=w,this.comments_before=null,this.newlines=d||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ie.exports.Token=l},function(ie,l){var S="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",w="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\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",m="\\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",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",x="(?:"+y+"|["+S+d+"])",N="(?:"+y+"|["+w+d+m+"])*";l.identifier=new RegExp(x+N,"g"),l.identifierStart=new RegExp(x),l.identifierMatch=new RegExp("(?:"+y+"|["+w+d+m+"])+");var U=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;l.newline=/[\n\r\u2028\u2029]/,l.lineBreak=new RegExp(`\r
|
|
|`+l.newline.source),l.allLineBreaks=new RegExp(l.lineBreak.source,"g")},function(ie,l,S){var w=S(6).Options,d=["before-newline","after-newline","preserve-newline"];function m(y){w.call(this,y,"js");var x=this.raw_options.brace_style||null;x==="expand-strict"?this.raw_options.brace_style="expand":x==="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 N=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var U=0;U<N.length;U++)N[U]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=N[U];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",d),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}m.prototype=new w,ie.exports.Options=m},function(ie){function l(d,m){this.raw_options=S(d,m),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","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(d,m){var y=this.raw_options[d],x=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(x=y.concat()):typeof y=="string"&&(x=y.split(/[^a-zA-Z0-9_\/\-]+/)),x},l.prototype._get_boolean=function(d,m){var y=this.raw_options[d],x=y===void 0?!!m:!!y;return x},l.prototype._get_characters=function(d,m){var y=this.raw_options[d],x=m||"";return typeof y=="string"&&(x=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),x},l.prototype._get_number=function(d,m){var y=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var x=parseInt(y,10);return isNaN(x)&&(x=m),x},l.prototype._get_selection=function(d,m,y){var x=this._get_selection_list(d,m,y);if(x.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x[0]},l.prototype._get_selection_list=function(d,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var x=this._get_array(d,y);if(!this._is_valid_selection(x,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x},l.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(y){return m.indexOf(y)===-1})};function S(d,m){var y={};d=w(d);var x;for(x in d)x!==m&&(y[x]=d[x]);if(m&&d[m])for(x in d[m])y[x]=d[m][x];return y}function w(d){var m={},y;for(y in d){var x=y.replace(/-/g,"_");m[x]=d[y]}return m}ie.exports.Options=l,ie.exports.normalizeOpts=w,ie.exports.mergeOpts=S},function(ie,l,S){var w=S(8).InputScanner,d=S(9).Tokenizer,m=S(9).TOKEN,y=S(13).Directives,x=S(4),N=S(12).Pattern,U=S(14).TemplatablePattern;function K($,H){return H.indexOf($)!==-1}var D={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:m.START,RAW:m.RAW,EOF:m.EOF},A=new y(/\/\*/,/\*\//),P=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,z=/[0-9]/,se=/[^\d\.]/,ae=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ne=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ne=ne.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ne="\\?\\.(?!\\d) "+ne,ne=ne.replace(/ /g,"|");var Q=new RegExp(ne),ye="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ce=ye.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Oe=new RegExp("^(?:"+ce.join("|")+")$"),Z,L=function($,H){d.call(this,$,H),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var W=new N(this._input),_=new U(this._input).read_options(this._options);this.__patterns={template:_,identifier:_.starting_with(x.identifier).matching(x.identifierMatch),number:W.matching(P),punct:W.matching(Q),comment:W.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:W.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:W.matching(/<!--/),html_comment_end:W.matching(/-->/),include:W.starting_with(/#include/).until_after(x.lineBreak),shebang:W.starting_with(/#!/).until_after(x.lineBreak),xml:W.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:_.until(/['\\\n\r\u2028\u2029]/),double_quote:_.until(/["\\\n\r\u2028\u2029]/),template_text:_.until(/[`\\$]/),template_expression:_.until(/[`}\\]/)}};L.prototype=new d,L.prototype._is_comment=function($){return $.type===D.COMMENT||$.type===D.BLOCK_COMMENT||$.type===D.UNKNOWN},L.prototype._is_opening=function($){return $.type===D.START_BLOCK||$.type===D.START_EXPR},L.prototype._is_closing=function($,H){return($.type===D.END_BLOCK||$.type===D.END_EXPR)&&H&&($.text==="]"&&H.text==="["||$.text===")"&&H.text==="("||$.text==="}"&&H.text==="{")},L.prototype._reset=function(){Z=!1},L.prototype._get_next_token=function($,H){var W=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(D.EOF,""):(W=W||this._read_non_javascript(_),W=W||this._read_string(_),W=W||this._read_pair(_,this._input.peek(1)),W=W||this._read_word($),W=W||this._read_singles(_),W=W||this._read_comment(_),W=W||this._read_regexp(_,$),W=W||this._read_xml(_,$),W=W||this._read_punctuation(),W=W||this._create_token(D.UNKNOWN,this._input.next()),W)},L.prototype._read_word=function($){var H;if(H=this.__patterns.identifier.read(),H!=="")return H=H.replace(x.allLineBreaks,`
|
|
`),!($.type===D.DOT||$.type===D.RESERVED&&($.text==="set"||$.text==="get"))&&Oe.test(H)?(H==="in"||H==="of")&&($.type===D.WORD||$.type===D.STRING)?this._create_token(D.OPERATOR,H):this._create_token(D.RESERVED,H):this._create_token(D.WORD,H);if(H=this.__patterns.number.read(),H!=="")return this._create_token(D.WORD,H)},L.prototype._read_singles=function($){var H=null;return $==="("||$==="["?H=this._create_token(D.START_EXPR,$):$===")"||$==="]"?H=this._create_token(D.END_EXPR,$):$==="{"?H=this._create_token(D.START_BLOCK,$):$==="}"?H=this._create_token(D.END_BLOCK,$):$===";"?H=this._create_token(D.SEMICOLON,$):$==="."&&se.test(this._input.peek(1))?H=this._create_token(D.DOT,$):$===","&&(H=this._create_token(D.COMMA,$)),H&&this._input.next(),H},L.prototype._read_pair=function($,H){var W=null;return $==="#"&&H==="{"&&(W=this._create_token(D.START_BLOCK,$+H)),W&&(this._input.next(),this._input.next()),W},L.prototype._read_punctuation=function(){var $=this.__patterns.punct.read();if($!=="")return $==="="?this._create_token(D.EQUALS,$):$==="?."?this._create_token(D.DOT,$):this._create_token(D.OPERATOR,$)},L.prototype._read_non_javascript=function($){var H="";if($==="#"){if(this._is_first_token()&&(H=this.__patterns.shebang.read(),H))return this._create_token(D.UNKNOWN,H.trim()+`
|
|
`);if(H=this.__patterns.include.read(),H)return this._create_token(D.UNKNOWN,H.trim()+`
|
|
`);$=this._input.next();var W="#";if(this._input.hasNext()&&this._input.testChar(z)){do $=this._input.next(),W+=$;while(this._input.hasNext()&&$!=="#"&&$!=="=");return $==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(W+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(W+="{}",this._input.next(),this._input.next())),this._create_token(D.WORD,W)}this._input.back()}else if($==="<"&&this._is_first_token()){if(H=this.__patterns.html_comment_start.read(),H){for(;this._input.hasNext()&&!this._input.testChar(x.newline);)H+=this._input.next();return Z=!0,this._create_token(D.COMMENT,H)}}else if(Z&&$==="-"&&(H=this.__patterns.html_comment_end.read(),H))return Z=!1,this._create_token(D.COMMENT,H);return null},L.prototype._read_comment=function($){var H=null;if($==="/"){var W="";if(this._input.peek(1)==="*"){W=this.__patterns.block_comment.read();var _=A.get_directives(W);_&&_.ignore==="start"&&(W+=A.readIgnored(this._input)),W=W.replace(x.allLineBreaks,`
|
|
`),H=this._create_token(D.BLOCK_COMMENT,W),H.directives=_}else this._input.peek(1)==="/"&&(W=this.__patterns.comment.read(),H=this._create_token(D.COMMENT,W))}return H},L.prototype._read_string=function($){if($==="`"||$==="'"||$==='"'){var H=this._input.next();return this.has_char_escapes=!1,$==="`"?H+=this._read_string_recursive("`",!0,"${"):H+=this._read_string_recursive($),this.has_char_escapes&&this._options.unescape_strings&&(H=V(H)),this._input.peek()===$&&(H+=this._input.next()),H=H.replace(x.allLineBreaks,`
|
|
`),this._create_token(D.STRING,H)}return null},L.prototype._allow_regexp_or_xml=function($){return $.type===D.RESERVED&&K($.text,["return","case","throw","else","do","typeof","yield"])||$.type===D.END_EXPR&&$.text===")"&&$.opened.previous.type===D.RESERVED&&K($.opened.previous.text,["if","while","for"])||K($.type,[D.COMMENT,D.START_EXPR,D.START_BLOCK,D.START,D.END_BLOCK,D.OPERATOR,D.EQUALS,D.EOF,D.SEMICOLON,D.COMMA])},L.prototype._read_regexp=function($,H){if($==="/"&&this._allow_regexp_or_xml(H)){for(var W=this._input.next(),_=!1,g=!1;this._input.hasNext()&&(_||g||this._input.peek()!==$)&&!this._input.testChar(x.newline);)W+=this._input.peek(),_?_=!1:(_=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===$&&(W+=this._input.next(),W+=this._input.read(x.identifier)),this._create_token(D.STRING,W)}return null},L.prototype._read_xml=function($,H){if(this._options.e4x&&$==="<"&&this._allow_regexp_or_xml(H)){var W="",_=this.__patterns.xml.read_match();if(_){for(var g=_[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),O=g.indexOf("{")===0,Y=0;_;){var Pe=!!_[1],Me=_[2],Xe=!!_[_.length-1]||Me.slice(0,8)==="![CDATA[";if(!Xe&&(Me===g||O&&Me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Pe?--Y:++Y),W+=_[0],Y<=0)break;_=this.__patterns.xml.read_match()}return _||(W+=this._input.match(/[\s\S]*/g)[0]),W=W.replace(x.allLineBreaks,`
|
|
`),this._create_token(D.STRING,W)}}return null};function V($){for(var H="",W=0,_=new w($),g=null;_.hasNext();)if(g=_.match(/([\s]|[^\\]|\\\\)+/g),g&&(H+=g[0]),_.peek()==="\\"){if(_.next(),_.peek()==="x")g=_.match(/x([0-9A-Fa-f]{2})/g);else if(_.peek()==="u")g=_.match(/u([0-9A-Fa-f]{4})/g),g||(g=_.match(/u\{([0-9A-Fa-f]+)\}/g));else{H+="\\",_.hasNext()&&(H+=_.next());continue}if(!g||(W=parseInt(g[1],16),W>126&&W<=255&&g[0].indexOf("x")===0))return $;W>=0&&W<32||W>1114111?H+="\\"+g[0]:W===34||W===39||W===92?H+="\\"+String.fromCharCode(W):H+=String.fromCharCode(W)}return H}L.prototype._read_string_recursive=function($,H,W){var _,g;$==="'"?g=this.__patterns.single_quote:$==='"'?g=this.__patterns.double_quote:$==="`"?g=this.__patterns.template_text:$==="}"&&(g=this.__patterns.template_expression);for(var O=g.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===$||!H&&x.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(_=this._input.peek(),_==="x"||_==="u"?this.has_char_escapes=!0:_==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Y+=this._input.next()):W&&(W==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),W===Y&&($==="`"?Y+=this._read_string_recursive("}",H,"`"):Y+=this._read_string_recursive("`",H,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=g.read(),O+=Y}return O},ie.exports.Tokenizer=L,ie.exports.TOKEN=D,ie.exports.positionable_operators=ae.slice(),ie.exports.line_starters=ye.slice()},function(ie){var l=RegExp.prototype.hasOwnProperty("sticky");function S(w){this.__input=w||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var w=null;return this.hasNext()&&(w=this.__input.charAt(this.__position),this.__position+=1),w},S.prototype.peek=function(w){var d=null;return w=w||0,w+=this.__position,w>=0&&w<this.__input_length&&(d=this.__input.charAt(w)),d},S.prototype.__match=function(w,d){w.lastIndex=d;var m=w.exec(this.__input);return m&&!(l&&w.sticky)&&m.index!==d&&(m=null),m},S.prototype.test=function(w,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(w,d):!1},S.prototype.testChar=function(w,d){var m=this.peek(d);return w.lastIndex=0,m!==null&&w.test(m)},S.prototype.match=function(w){var d=this.__match(w,this.__position);return d?this.__position+=d[0].length:d=null,d},S.prototype.read=function(w,d,m){var y="",x;return w&&(x=this.match(w),x&&(y+=x[0])),d&&(x||!w)&&(y+=this.readUntil(d,m)),y},S.prototype.readUntil=function(w,d){var m="",y=this.__position;w.lastIndex=this.__position;var x=w.exec(this.__input);return x?(y=x.index,d&&(y+=x[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(w){return this.readUntil(w,!0)},S.prototype.get_regexp=function(w,d){var m=null,y="g";return d&&l&&(y="y"),typeof w=="string"&&w!==""?m=new RegExp(w,y):w&&(m=new RegExp(w.source,y)),m},S.prototype.get_literal_regexp=function(w){return RegExp(w.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(w){var d=this.__position,m=this.readUntilAfter(w);return this.__position=d,m},S.prototype.lookBack=function(w){var d=this.__position-1;return d>=w.length&&this.__input.substring(d-w.length,d).toLowerCase()===w},ie.exports.InputScanner=S},function(ie,l,S){var w=S(8).InputScanner,d=S(3).Token,m=S(10).TokenStream,y=S(11).WhitespacePattern,x={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},N=function(U,K){this._input=new w(U),this._options=K||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};N.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var U,K=new d(x.START,""),D=null,A=[],P=new m;K.type!==x.EOF;){for(U=this._get_next_token(K,D);this._is_comment(U);)P.add(U),U=this._get_next_token(K,D);P.isEmpty()||(U.comments_before=P,P=new m),U.parent=D,this._is_opening(U)?(A.push(D),D=U):D&&this._is_closing(U,D)&&(U.opened=D,D.closed=U,D=A.pop(),U.parent=D),U.previous=K,K.next=U,this.__tokens.add(U),K=U}return this.__tokens},N.prototype._is_first_token=function(){return this.__tokens.isEmpty()},N.prototype._reset=function(){},N.prototype._get_next_token=function(U,K){this._readWhitespace();var D=this._input.read(/.+/g);return D?this._create_token(x.RAW,D):this._create_token(x.EOF,"")},N.prototype._is_comment=function(U){return!1},N.prototype._is_opening=function(U){return!1},N.prototype._is_closing=function(U,K){return!1},N.prototype._create_token=function(U,K){var D=new d(U,K,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return D},N.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ie.exports.Tokenizer=N,ie.exports.TOKEN=x},function(ie){function l(S){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=S}l.prototype.restart=function(){this.__position=0},l.prototype.isEmpty=function(){return this.__tokens_length===0},l.prototype.hasNext=function(){return this.__position<this.__tokens_length},l.prototype.next=function(){var S=null;return this.hasNext()&&(S=this.__tokens[this.__position],this.__position+=1),S},l.prototype.peek=function(S){var w=null;return S=S||0,S+=this.__position,S>=0&&S<this.__tokens_length&&(w=this.__tokens[S]),w},l.prototype.add=function(S){this.__parent_token&&(S.parent=this.__parent_token),this.__tokens.push(S),this.__tokens_length+=1},ie.exports.TokenStream=l},function(ie,l,S){var w=S(12).Pattern;function d(m,y){w.call(this,m,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new w,d.prototype.__set_whitespace_patterns=function(m,y){m+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var y=this.__split(this._newline_regexp,m);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return m},d.prototype.matching=function(m,y){var x=this._create();return x.__set_whitespace_patterns(m,y),x._update(),x},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(m,y){m.lastIndex=0;for(var x=0,N=[],U=m.exec(y);U;)N.push(y.substring(x,U.index)),x=U.index+U[0].length,U=m.exec(y);return x<y.length?N.push(y.substring(x,y.length)):N.push(""),N},ie.exports.WhitespacePattern=d},function(ie){function l(S,w){this._input=S,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,w&&(this._starting_pattern=this._input.get_regexp(w._starting_pattern,!0),this._match_pattern=this._input.get_regexp(w._match_pattern,!0),this._until_pattern=this._input.get_regexp(w._until_pattern),this._until_after=w._until_after)}l.prototype.read=function(){var S=this._input.read(this._starting_pattern);return(!this._starting_pattern||S)&&(S+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),S},l.prototype.read_match=function(){return this._input.match(this._match_pattern)},l.prototype.until_after=function(S){var w=this._create();return w._until_after=!0,w._until_pattern=this._input.get_regexp(S),w._update(),w},l.prototype.until=function(S){var w=this._create();return w._until_after=!1,w._until_pattern=this._input.get_regexp(S),w._update(),w},l.prototype.starting_with=function(S){var w=this._create();return w._starting_pattern=this._input.get_regexp(S,!0),w._update(),w},l.prototype.matching=function(S){var w=this._create();return w._match_pattern=this._input.get_regexp(S,!0),w._update(),w},l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){},ie.exports.Pattern=l},function(ie){function l(S,w){S=typeof S=="string"?S:S.source,w=typeof w=="string"?w:w.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+w,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+w,"g")}l.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var w={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(S);d;)w[d[1]]=d[2],d=this.__directive_pattern.exec(S);return w},l.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},ie.exports.Directives=l},function(ie,l,S){var w=S(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function m(y,x){w.call(this,y,x),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),x&&(this.__template_pattern=this._input.get_regexp(x.__template_pattern),this._excluded=Object.assign(this._excluded,x._excluded),this._disabled=Object.assign(this._disabled,x._disabled));var N=new w(y);this.__patterns={handlebars_comment:N.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:N.starting_with(/{{{/).until_after(/}}}/),handlebars:N.starting_with(/{{/).until_after(/}}/),php:N.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:N.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:N.starting_with(/{%/).until_after(/%}/),django_value:N.starting_with(/{{/).until_after(/}}/),django_comment:N.starting_with(/{#/).until_after(/#}/),smarty:N.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:N.starting_with(/{\*/).until_after(/\*}/),smarty_literal:N.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new w,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(y){var x=this._create();return x._disabled[y]=!0,x._update(),x},m.prototype.read_options=function(y){var x=this._create();for(var N in d)x._disabled[N]=y.templating.indexOf(N)===-1;return x._update(),x},m.prototype.exclude=function(y){var x=this._create();return x._excluded[y]=!0,x._update(),x},m.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var x=this._read_template();x;)this._match_pattern?x+=this._input.read(this._match_pattern):x+=this._input.readUntil(this.__template_pattern),y+=x,x=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},m.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},m.prototype._read_template=function(){var y="",x=this._input.peek();if(x==="<"){var N=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&N==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&N==="%"&&(y=y||this.__patterns.erb.read())}else x==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},ie.exports.TemplatablePattern=m}],M={};function p(ie){var l=M[ie];if(l!==void 0)return l.exports;var S=M[ie]={exports:{}};return re[ie](S,S.exports,p),S.exports}var fe=p(0);de=fe})();var De=de;C=[],T=function(){return{js_beautify:De}}.apply(St,C),T!==void 0&&(vn.exports=T)})()},32834:function(vn){(function(St,C){vn.exports=C()})(this,function(){"use strict";function St(Re,xe){for(var Ae=0;Ae<xe.length;Ae++){var B=xe[Ae];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(Re,B.key,B)}}function C(Re,xe,Ae){return xe&&St(Re.prototype,xe),Ae&&St(Re,Ae),Re}function T(Re,xe){if(Re){if(typeof Re=="string")return de(Re,xe);var Ae=Object.prototype.toString.call(Re).slice(8,-1);if(Ae==="Object"&&Re.constructor&&(Ae=Re.constructor.name),Ae==="Map"||Ae==="Set")return Array.from(Re);if(Ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ae))return de(Re,xe)}}function de(Re,xe){(xe==null||xe>Re.length)&&(xe=Re.length);for(var Ae=0,B=new Array(xe);Ae<xe;Ae++)B[Ae]=Re[Ae];return B}function De(Re,xe){var Ae=typeof Symbol!="undefined"&&Re[Symbol.iterator]||Re["@@iterator"];if(Ae)return(Ae=Ae.call(Re)).next.bind(Ae);if(Array.isArray(Re)||(Ae=T(Re))||xe&&Re&&typeof Re.length=="number"){Ae&&(Re=Ae);var B=0;return function(){return B>=Re.length?{done:!0}:{done:!1,value:Re[B++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var re={exports:{}};function M(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function p(Re){re.exports.defaults=Re}re.exports={defaults:M(),getDefaults:M,changeDefaults:p};var fe=/[&<>"']/,ie=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(xe){return w[xe]};function m(Re,xe){if(xe){if(fe.test(Re))return Re.replace(ie,d)}else if(l.test(Re))return Re.replace(S,d);return Re}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x(Re){return Re.replace(y,function(xe,Ae){return Ae=Ae.toLowerCase(),Ae==="colon"?":":Ae.charAt(0)==="#"?Ae.charAt(1)==="x"?String.fromCharCode(parseInt(Ae.substring(2),16)):String.fromCharCode(+Ae.substring(1)):""})}var N=/(^|[^\[])\^/g;function U(Re,xe){Re=Re.source||Re,xe=xe||"";var Ae={replace:function(j,te){return te=te.source||te,te=te.replace(N,"$1"),Re=Re.replace(j,te),Ae},getRegex:function(){return new RegExp(Re,xe)}};return Ae}var K=/[^\w:]/g,D=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(Re,xe,Ae){if(Re){var B;try{B=decodeURIComponent(x(Ae)).replace(K,"").toLowerCase()}catch(j){return null}if(B.indexOf("javascript:")===0||B.indexOf("vbscript:")===0||B.indexOf("data:")===0)return null}xe&&!D.test(Ae)&&(Ae=ne(xe,Ae));try{Ae=encodeURI(Ae).replace(/%25/g,"%")}catch(j){return null}return Ae}var P={},z=/^[^:]+:\/*[^/]*$/,se=/^([^:]+:)[\s\S]*$/,ae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ne(Re,xe){P[" "+Re]||(z.test(Re)?P[" "+Re]=Re+"/":P[" "+Re]=Oe(Re,"/",!0)),Re=P[" "+Re];var Ae=Re.indexOf(":")===-1;return xe.substring(0,2)==="//"?Ae?xe:Re.replace(se,"$1")+xe:xe.charAt(0)==="/"?Ae?xe:Re.replace(ae,"$1")+xe:Re+xe}var Q={exec:function(){}};function ye(Re){for(var xe=1,Ae,B;xe<arguments.length;xe++){Ae=arguments[xe];for(B in Ae)Object.prototype.hasOwnProperty.call(Ae,B)&&(Re[B]=Ae[B])}return Re}function ce(Re,xe){var Ae=Re.replace(/\|/g,function(te,q,we){for(var vt=!1,st=q;--st>=0&&we[st]==="\\";)vt=!vt;return vt?"|":" |"}),B=Ae.split(/ \|/),j=0;if(B.length>xe)B.splice(xe);else for(;B.length<xe;)B.push("");for(;j<B.length;j++)B[j]=B[j].trim().replace(/\\\|/g,"|");return B}function Oe(Re,xe,Ae){var B=Re.length;if(B===0)return"";for(var j=0;j<B;){var te=Re.charAt(B-j-1);if(te===xe&&!Ae)j++;else if(te!==xe&&Ae)j++;else break}return Re.substr(0,B-j)}function Z(Re,xe){if(Re.indexOf(xe[1])===-1)return-1;for(var Ae=Re.length,B=0,j=0;j<Ae;j++)if(Re[j]==="\\")j++;else if(Re[j]===xe[0])B++;else if(Re[j]===xe[1]&&(B--,B<0))return j;return-1}function L(Re){Re&&Re.sanitize&&!Re.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function V(Re,xe){if(xe<1)return"";for(var Ae="";xe>1;)xe&1&&(Ae+=Re),xe>>=1,Re+=Re;return Ae+Re}var $={escape:m,unescape:x,edit:U,cleanUrl:A,resolveUrl:ne,noopTest:Q,merge:ye,splitCells:ce,rtrim:Oe,findClosingBracket:Z,checkSanitizeDeprecation:L,repeatString:V},H=re.exports.defaults,W=$.rtrim,_=$.splitCells,g=$.escape,O=$.findClosingBracket;function Y(Re,xe,Ae){var B=xe.href,j=xe.title?g(xe.title):null,te=Re[1].replace(/\\([\[\]])/g,"$1");return Re[0].charAt(0)!=="!"?{type:"link",raw:Ae,href:B,title:j,text:te}:{type:"image",raw:Ae,href:B,title:j,text:g(te)}}function Pe(Re,xe){var Ae=Re.match(/^(\s+)(?:```)/);if(Ae===null)return xe;var B=Ae[1];return xe.split(`
|
|
`).map(function(j){var te=j.match(/^\s+/);if(te===null)return j;var q=te[0];return q.length>=B.length?j.slice(B.length):j}).join(`
|
|
`)}var Me=function(){function Re(Ae){this.options=Ae||H}var xe=Re.prototype;return xe.space=function(B){var j=this.rules.block.newline.exec(B);if(j)return j[0].length>1?{type:"space",raw:j[0]}:{raw:`
|
|
`}},xe.code=function(B){var j=this.rules.block.code.exec(B);if(j){var te=j[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:j[0],codeBlockStyle:"indented",text:this.options.pedantic?te:W(te,`
|
|
`)}}},xe.fences=function(B){var j=this.rules.block.fences.exec(B);if(j){var te=j[0],q=Pe(te,j[3]||"");return{type:"code",raw:te,lang:j[2]?j[2].trim():j[2],text:q}}},xe.heading=function(B){var j=this.rules.block.heading.exec(B);if(j){var te=j[2].trim();if(/#$/.test(te)){var q=W(te,"#");(this.options.pedantic||!q||/ $/.test(q))&&(te=q.trim())}return{type:"heading",raw:j[0],depth:j[1].length,text:te}}},xe.nptable=function(B){var j=this.rules.block.nptable.exec(B);if(j){var te={type:"table",header:_(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
|
|
`):[],raw:j[0]};if(te.header.length===te.align.length){var q=te.align.length,we;for(we=0;we<q;we++)/^ *-+: *$/.test(te.align[we])?te.align[we]="right":/^ *:-+: *$/.test(te.align[we])?te.align[we]="center":/^ *:-+ *$/.test(te.align[we])?te.align[we]="left":te.align[we]=null;for(q=te.cells.length,we=0;we<q;we++)te.cells[we]=_(te.cells[we],te.header.length);return te}}},xe.hr=function(B){var j=this.rules.block.hr.exec(B);if(j)return{type:"hr",raw:j[0]}},xe.blockquote=function(B){var j=this.rules.block.blockquote.exec(B);if(j){var te=j[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:j[0],text:te}}},xe.list=function(B){var j=this.rules.block.list.exec(B);if(j){var te=j[0],q=j[2],we=q.length>1,vt={type:"list",raw:te,ordered:we,start:we?+q.slice(0,-1):"",loose:!1,items:[]},st=j[0].match(this.rules.block.item),ft=!1,Mt,Sn,En,Ft,Yt,kn,$n,Rn,Bn,xn=st.length;En=this.rules.block.listItemStart.exec(st[0]);for(var sn=0;sn<xn;sn++){if(Mt=st[sn],te=Mt,this.options.pedantic||(Bn=Mt.match(new RegExp("\\n\\s*\\n {0,"+(En[0].length-1)+"}\\S")),Bn&&(Yt=Mt.length-Bn.index+st.slice(sn+1).join(`
|
|
`).length,vt.raw=vt.raw.substring(0,vt.raw.length-Yt),Mt=Mt.substring(0,Bn.index),te=Mt,xn=sn+1)),sn!==xn-1){if(Ft=this.rules.block.listItemStart.exec(st[sn+1]),this.options.pedantic?Ft[1].length>En[1].length:Ft[1].length>=En[0].length||Ft[1].length>3){st.splice(sn,2,st[sn]+(!this.options.pedantic&&Ft[1].length<En[0].length&&!st[sn].match(/\n$/)?"":`
|
|
`)+st[sn+1]),sn--,xn--;continue}else(!this.options.pedantic||this.options.smartLists?Ft[2][Ft[2].length-1]!==q[q.length-1]:we===(Ft[2].length===1))&&(Yt=st.slice(sn+1).join(`
|
|
`).length,vt.raw=vt.raw.substring(0,vt.raw.length-Yt),sn=xn-1);En=Ft}Sn=Mt.length,Mt=Mt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Mt.indexOf(`
|
|
`)&&(Sn-=Mt.length,Mt=this.options.pedantic?Mt.replace(/^ {1,4}/gm,""):Mt.replace(new RegExp("^ {1,"+Sn+"}","gm"),"")),Mt=W(Mt,`
|
|
`),sn!==xn-1&&(te=te+`
|
|
`),kn=ft||/\n\n(?!\s*$)/.test(te),sn!==xn-1&&(ft=te.slice(-2)===`
|
|
|
|
`,kn||(kn=ft)),kn&&(vt.loose=!0),this.options.gfm&&($n=/^\[[ xX]\] /.test(Mt),Rn=void 0,$n&&(Rn=Mt[1]!==" ",Mt=Mt.replace(/^\[[ xX]\] +/,""))),vt.items.push({type:"list_item",raw:te,task:$n,checked:Rn,loose:kn,text:Mt})}return vt}},xe.html=function(B){var j=this.rules.block.html.exec(B);if(j)return{type:this.options.sanitize?"paragraph":"html",raw:j[0],pre:!this.options.sanitizer&&(j[1]==="pre"||j[1]==="script"||j[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):g(j[0]):j[0]}},xe.def=function(B){var j=this.rules.block.def.exec(B);if(j){j[3]&&(j[3]=j[3].substring(1,j[3].length-1));var te=j[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:te,raw:j[0],href:j[2],title:j[3]}}},xe.table=function(B){var j=this.rules.block.table.exec(B);if(j){var te={type:"table",header:_(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
|
|
`):[]};if(te.header.length===te.align.length){te.raw=j[0];var q=te.align.length,we;for(we=0;we<q;we++)/^ *-+: *$/.test(te.align[we])?te.align[we]="right":/^ *:-+: *$/.test(te.align[we])?te.align[we]="center":/^ *:-+ *$/.test(te.align[we])?te.align[we]="left":te.align[we]=null;for(q=te.cells.length,we=0;we<q;we++)te.cells[we]=_(te.cells[we].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},xe.lheading=function(B){var j=this.rules.block.lheading.exec(B);if(j)return{type:"heading",raw:j[0],depth:j[2].charAt(0)==="="?1:2,text:j[1]}},xe.paragraph=function(B){var j=this.rules.block.paragraph.exec(B);if(j)return{type:"paragraph",raw:j[0],text:j[1].charAt(j[1].length-1)===`
|
|
`?j[1].slice(0,-1):j[1]}},xe.text=function(B){var j=this.rules.block.text.exec(B);if(j)return{type:"text",raw:j[0],text:j[0]}},xe.escape=function(B){var j=this.rules.inline.escape.exec(B);if(j)return{type:"escape",raw:j[0],text:g(j[1])}},xe.tag=function(B,j,te){var q=this.rules.inline.tag.exec(B);if(q)return!j&&/^<a /i.test(q[0])?j=!0:j&&/^<\/a>/i.test(q[0])&&(j=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(q[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(q[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:q[0],inLink:j,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):g(q[0]):q[0]}},xe.link=function(B){var j=this.rules.inline.link.exec(B);if(j){var te=j[2].trim();if(!this.options.pedantic&&/^</.test(te)){if(!/>$/.test(te))return;var q=W(te.slice(0,-1),"\\");if((te.length-q.length)%2===0)return}else{var we=O(j[2],"()");if(we>-1){var vt=j[0].indexOf("!")===0?5:4,st=vt+j[1].length+we;j[2]=j[2].substring(0,we),j[0]=j[0].substring(0,st).trim(),j[3]=""}}var ft=j[2],Mt="";if(this.options.pedantic){var Sn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ft);Sn&&(ft=Sn[1],Mt=Sn[3])}else Mt=j[3]?j[3].slice(1,-1):"";return ft=ft.trim(),/^</.test(ft)&&(this.options.pedantic&&!/>$/.test(te)?ft=ft.slice(1):ft=ft.slice(1,-1)),Y(j,{href:ft&&ft.replace(this.rules.inline._escapes,"$1"),title:Mt&&Mt.replace(this.rules.inline._escapes,"$1")},j[0])}},xe.reflink=function(B,j){var te;if((te=this.rules.inline.reflink.exec(B))||(te=this.rules.inline.nolink.exec(B))){var q=(te[2]||te[1]).replace(/\s+/g," ");if(q=j[q.toLowerCase()],!q||!q.href){var we=te[0].charAt(0);return{type:"text",raw:we,text:we}}return Y(te,q,te[0])}},xe.emStrong=function(B,j,te){te===void 0&&(te="");var q=this.rules.inline.emStrong.lDelim.exec(B);if(q&&!(q[3]&&te.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\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\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\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\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\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-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\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\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var we=q[1]||q[2]||"";if(!we||we&&(te===""||this.rules.inline.punctuation.exec(te))){var vt=q[0].length-1,st,ft,Mt=vt,Sn=0,En=q[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(En.lastIndex=0,j=j.slice(-1*B.length+vt);(q=En.exec(j))!=null;)if(st=q[1]||q[2]||q[3]||q[4]||q[5]||q[6],!!st){if(ft=st.length,q[3]||q[4]){Mt+=ft;continue}else if((q[5]||q[6])&&vt%3&&!((vt+ft)%3)){Sn+=ft;continue}if(Mt-=ft,!(Mt>0))return ft=Math.min(ft,ft+Mt+Sn),Math.min(vt,ft)%2?{type:"em",raw:B.slice(0,vt+q.index+ft+1),text:B.slice(1,vt+q.index+ft)}:{type:"strong",raw:B.slice(0,vt+q.index+ft+1),text:B.slice(2,vt+q.index+ft-1)}}}}},xe.codespan=function(B){var j=this.rules.inline.code.exec(B);if(j){var te=j[2].replace(/\n/g," "),q=/[^ ]/.test(te),we=/^ /.test(te)&&/ $/.test(te);return q&&we&&(te=te.substring(1,te.length-1)),te=g(te,!0),{type:"codespan",raw:j[0],text:te}}},xe.br=function(B){var j=this.rules.inline.br.exec(B);if(j)return{type:"br",raw:j[0]}},xe.del=function(B){var j=this.rules.inline.del.exec(B);if(j)return{type:"del",raw:j[0],text:j[2]}},xe.autolink=function(B,j){var te=this.rules.inline.autolink.exec(B);if(te){var q,we;return te[2]==="@"?(q=g(this.options.mangle?j(te[1]):te[1]),we="mailto:"+q):(q=g(te[1]),we=q),{type:"link",raw:te[0],text:q,href:we,tokens:[{type:"text",raw:q,text:q}]}}},xe.url=function(B,j){var te;if(te=this.rules.inline.url.exec(B)){var q,we;if(te[2]==="@")q=g(this.options.mangle?j(te[0]):te[0]),we="mailto:"+q;else{var vt;do vt=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(vt!==te[0]);q=g(te[0]),te[1]==="www."?we="http://"+q:we=q}return{type:"link",raw:te[0],text:q,href:we,tokens:[{type:"text",raw:q,text:q}]}}},xe.inlineText=function(B,j,te){var q=this.rules.inline.text.exec(B);if(q){var we;return j?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):g(q[0]):q[0]:we=g(this.options.smartypants?te(q[0]):q[0]),{type:"text",raw:q[0],text:we}}},Re}(),Xe=$.noopTest,Ye=$.edit,Tt=$.merge,gt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Xe,table:Xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};gt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,gt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,gt.def=Ye(gt.def).replace("label",gt._label).replace("title",gt._title).getRegex(),gt.bullet=/(?:[*+-]|\d{1,9}[.)])/,gt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,gt.item=Ye(gt.item,"gm").replace(/bull/g,gt.bullet).getRegex(),gt.listItemStart=Ye(/^( *)(bull) */).replace("bull",gt.bullet).getRegex(),gt.list=Ye(gt.list).replace(/bull/g,gt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+gt.def.source+")").getRegex(),gt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",gt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,gt.html=Ye(gt.html,"i").replace("comment",gt._comment).replace("tag",gt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gt.paragraph=Ye(gt._paragraph).replace("hr",gt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",gt._tag).getRegex(),gt.blockquote=Ye(gt.blockquote).replace("paragraph",gt.paragraph).getRegex(),gt.normal=Tt({},gt),gt.gfm=Tt({},gt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),gt.gfm.nptable=Ye(gt.gfm.nptable).replace("hr",gt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",gt._tag).getRegex(),gt.gfm.table=Ye(gt.gfm.table).replace("hr",gt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",gt._tag).getRegex(),gt.pedantic=Tt({},gt.normal,{html:Ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xe,paragraph:Ye(gt.normal._paragraph).replace("hr",gt.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",gt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Xe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Xe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Le.punctuation=Ye(Le.punctuation).replace(/punctuation/g,Le._punctuation).getRegex(),Le.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Le.escapedEmSt=/\\\*|\\_/g,Le._comment=Ye(gt._comment).replace("(?:-->|$)","-->").getRegex(),Le.emStrong.lDelim=Ye(Le.emStrong.lDelim).replace(/punct/g,Le._punctuation).getRegex(),Le.emStrong.rDelimAst=Ye(Le.emStrong.rDelimAst,"g").replace(/punct/g,Le._punctuation).getRegex(),Le.emStrong.rDelimUnd=Ye(Le.emStrong.rDelimUnd,"g").replace(/punct/g,Le._punctuation).getRegex(),Le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Le._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Le.autolink=Ye(Le.autolink).replace("scheme",Le._scheme).replace("email",Le._email).getRegex(),Le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Le.tag=Ye(Le.tag).replace("comment",Le._comment).replace("attribute",Le._attribute).getRegex(),Le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Le._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Le.link=Ye(Le.link).replace("label",Le._label).replace("href",Le._href).replace("title",Le._title).getRegex(),Le.reflink=Ye(Le.reflink).replace("label",Le._label).getRegex(),Le.reflinkSearch=Ye(Le.reflinkSearch,"g").replace("reflink",Le.reflink).replace("nolink",Le.nolink).getRegex(),Le.normal=Tt({},Le),Le.pedantic=Tt({},Le.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Le._label).getRegex(),reflink:Ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Le._label).getRegex()}),Le.gfm=Tt({},Le.normal,{escape:Ye(Le.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Le.gfm.url=Ye(Le.gfm.url,"i").replace("email",Le.gfm._extended_email).getRegex(),Le.breaks=Tt({},Le.gfm,{br:Ye(Le.br).replace("{2,}","*").getRegex(),text:Ye(Le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Je={block:gt,inline:Le},Et=Me,ot=re.exports.defaults,rn=Je.block,Ze=Je.inline,ge=$.repeatString;function le(Re){return Re.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function G(Re){var xe="",Ae,B,j=Re.length;for(Ae=0;Ae<j;Ae++)B=Re.charCodeAt(Ae),Math.random()>.5&&(B="x"+B.toString(16)),xe+="&#"+B+";";return xe}var be=function(){function Re(Ae){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ae||ot,this.options.tokenizer=this.options.tokenizer||new Et,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var B={block:rn.normal,inline:Ze.normal};this.options.pedantic?(B.block=rn.pedantic,B.inline=Ze.pedantic):this.options.gfm&&(B.block=rn.gfm,this.options.breaks?B.inline=Ze.breaks:B.inline=Ze.gfm),this.tokenizer.rules=B}Re.lex=function(B,j){var te=new Re(j);return te.lex(B)},Re.lexInline=function(B,j){var te=new Re(j);return te.inlineTokens(B)};var xe=Re.prototype;return xe.lex=function(B){return B=B.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(B,this.tokens,!0),this.inline(this.tokens),this.tokens},xe.blockTokens=function(B,j,te){j===void 0&&(j=[]),te===void 0&&(te=!0),this.options.pedantic&&(B=B.replace(/^ +$/gm,""));for(var q,we,vt,st;B;){if(q=this.tokenizer.space(B)){B=B.substring(q.raw.length),q.type&&j.push(q);continue}if(q=this.tokenizer.code(B)){B=B.substring(q.raw.length),st=j[j.length-1],st&&st.type==="paragraph"?(st.raw+=`
|
|
`+q.raw,st.text+=`
|
|
`+q.text):j.push(q);continue}if(q=this.tokenizer.fences(B)){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.heading(B)){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.nptable(B)){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.hr(B)){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.blockquote(B)){B=B.substring(q.raw.length),q.tokens=this.blockTokens(q.text,[],te),j.push(q);continue}if(q=this.tokenizer.list(B)){for(B=B.substring(q.raw.length),vt=q.items.length,we=0;we<vt;we++)q.items[we].tokens=this.blockTokens(q.items[we].text,[],!1);j.push(q);continue}if(q=this.tokenizer.html(B)){B=B.substring(q.raw.length),j.push(q);continue}if(te&&(q=this.tokenizer.def(B))){B=B.substring(q.raw.length),this.tokens.links[q.tag]||(this.tokens.links[q.tag]={href:q.href,title:q.title});continue}if(q=this.tokenizer.table(B)){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.lheading(B)){B=B.substring(q.raw.length),j.push(q);continue}if(te&&(q=this.tokenizer.paragraph(B))){B=B.substring(q.raw.length),j.push(q);continue}if(q=this.tokenizer.text(B)){B=B.substring(q.raw.length),st=j[j.length-1],st&&st.type==="text"?(st.raw+=`
|
|
`+q.raw,st.text+=`
|
|
`+q.text):j.push(q);continue}if(B){var ft="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return j},xe.inline=function(B){var j,te,q,we,vt,st,ft=B.length;for(j=0;j<ft;j++)switch(st=B[j],st.type){case"paragraph":case"text":case"heading":{st.tokens=[],this.inlineTokens(st.text,st.tokens);break}case"table":{for(st.tokens={header:[],cells:[]},we=st.header.length,te=0;te<we;te++)st.tokens.header[te]=[],this.inlineTokens(st.header[te],st.tokens.header[te]);for(we=st.cells.length,te=0;te<we;te++)for(vt=st.cells[te],st.tokens.cells[te]=[],q=0;q<vt.length;q++)st.tokens.cells[te][q]=[],this.inlineTokens(vt[q],st.tokens.cells[te][q]);break}case"blockquote":{this.inline(st.tokens);break}case"list":{for(we=st.items.length,te=0;te<we;te++)this.inline(st.items[te].tokens);break}}return B},xe.inlineTokens=function(B,j,te,q){j===void 0&&(j=[]),te===void 0&&(te=!1),q===void 0&&(q=!1);var we,vt,st=B,ft,Mt,Sn;if(this.tokens.links){var En=Object.keys(this.tokens.links);if(En.length>0)for(;(ft=this.tokenizer.rules.inline.reflinkSearch.exec(st))!=null;)En.includes(ft[0].slice(ft[0].lastIndexOf("[")+1,-1))&&(st=st.slice(0,ft.index)+"["+ge("a",ft[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ft=this.tokenizer.rules.inline.blockSkip.exec(st))!=null;)st=st.slice(0,ft.index)+"["+ge("a",ft[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ft=this.tokenizer.rules.inline.escapedEmSt.exec(st))!=null;)st=st.slice(0,ft.index)+"++"+st.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;B;){if(Mt||(Sn=""),Mt=!1,we=this.tokenizer.escape(B)){B=B.substring(we.raw.length),j.push(we);continue}if(we=this.tokenizer.tag(B,te,q)){B=B.substring(we.raw.length),te=we.inLink,q=we.inRawBlock;var Ft=j[j.length-1];Ft&&we.type==="text"&&Ft.type==="text"?(Ft.raw+=we.raw,Ft.text+=we.text):j.push(we);continue}if(we=this.tokenizer.link(B)){B=B.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,q)),j.push(we);continue}if(we=this.tokenizer.reflink(B,this.tokens.links)){B=B.substring(we.raw.length);var Yt=j[j.length-1];we.type==="link"?(we.tokens=this.inlineTokens(we.text,[],!0,q),j.push(we)):Yt&&we.type==="text"&&Yt.type==="text"?(Yt.raw+=we.raw,Yt.text+=we.text):j.push(we);continue}if(we=this.tokenizer.emStrong(B,st,Sn)){B=B.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],te,q),j.push(we);continue}if(we=this.tokenizer.codespan(B)){B=B.substring(we.raw.length),j.push(we);continue}if(we=this.tokenizer.br(B)){B=B.substring(we.raw.length),j.push(we);continue}if(we=this.tokenizer.del(B)){B=B.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],te,q),j.push(we);continue}if(we=this.tokenizer.autolink(B,G)){B=B.substring(we.raw.length),j.push(we);continue}if(!te&&(we=this.tokenizer.url(B,G))){B=B.substring(we.raw.length),j.push(we);continue}if(we=this.tokenizer.inlineText(B,q,le)){B=B.substring(we.raw.length),we.raw.slice(-1)!=="_"&&(Sn=we.raw.slice(-1)),Mt=!0,vt=j[j.length-1],vt&&vt.type==="text"?(vt.raw+=we.raw,vt.text+=we.text):j.push(we);continue}if(B){var kn="Infinite loop on byte: "+B.charCodeAt(0);if(this.options.silent){console.error(kn);break}else throw new Error(kn)}}return j},C(Re,null,[{key:"rules",get:function(){return{block:rn,inline:Ze}}}]),Re}(),ke=re.exports.defaults,Ne=$.cleanUrl,k=$.escape,F=function(){function Re(Ae){this.options=Ae||ke}var xe=Re.prototype;return xe.code=function(B,j,te){var q=(j||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(B,q);we!=null&&we!==B&&(te=!0,B=we)}return B=B.replace(/\n$/,"")+`
|
|
`,q?'<pre><code class="'+this.options.langPrefix+k(q,!0)+'">'+(te?B:k(B,!0))+`</code></pre>
|
|
`:"<pre><code>"+(te?B:k(B,!0))+`</code></pre>
|
|
`},xe.blockquote=function(B){return`<blockquote>
|
|
`+B+`</blockquote>
|
|
`},xe.html=function(B){return B},xe.heading=function(B,j,te,q){return this.options.headerIds?"<h"+j+' id="'+this.options.headerPrefix+q.slug(te)+'">'+B+"</h"+j+`>
|
|
`:"<h"+j+">"+B+"</h"+j+`>
|
|
`},xe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},xe.list=function(B,j,te){var q=j?"ol":"ul",we=j&&te!==1?' start="'+te+'"':"";return"<"+q+we+`>
|
|
`+B+"</"+q+`>
|
|
`},xe.listitem=function(B){return"<li>"+B+`</li>
|
|
`},xe.checkbox=function(B){return"<input "+(B?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},xe.paragraph=function(B){return"<p>"+B+`</p>
|
|
`},xe.table=function(B,j){return j&&(j="<tbody>"+j+"</tbody>"),`<table>
|
|
<thead>
|
|
`+B+`</thead>
|
|
`+j+`</table>
|
|
`},xe.tablerow=function(B){return`<tr>
|
|
`+B+`</tr>
|
|
`},xe.tablecell=function(B,j){var te=j.header?"th":"td",q=j.align?"<"+te+' align="'+j.align+'">':"<"+te+">";return q+B+"</"+te+`>
|
|
`},xe.strong=function(B){return"<strong>"+B+"</strong>"},xe.em=function(B){return"<em>"+B+"</em>"},xe.codespan=function(B){return"<code>"+B+"</code>"},xe.br=function(){return this.options.xhtml?"<br/>":"<br>"},xe.del=function(B){return"<del>"+B+"</del>"},xe.link=function(B,j,te){if(B=Ne(this.options.sanitize,this.options.baseUrl,B),B===null)return te;var q='<a href="'+k(B)+'"';return j&&(q+=' title="'+j+'"'),q+=">"+te+"</a>",q},xe.image=function(B,j,te){if(B=Ne(this.options.sanitize,this.options.baseUrl,B),B===null)return te;var q='<img src="'+B+'" alt="'+te+'"';return j&&(q+=' title="'+j+'"'),q+=this.options.xhtml?"/>":">",q},xe.text=function(B){return B},Re}(),ee=function(){function Re(){}var xe=Re.prototype;return xe.strong=function(B){return B},xe.em=function(B){return B},xe.codespan=function(B){return B},xe.del=function(B){return B},xe.html=function(B){return B},xe.text=function(B){return B},xe.link=function(B,j,te){return""+te},xe.image=function(B,j,te){return""+te},xe.br=function(){return""},Re}(),oe=function(){function Re(){this.seen={}}var xe=Re.prototype;return xe.serialize=function(B){return B.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},xe.getNextSafeSlug=function(B,j){var te=B,q=0;if(this.seen.hasOwnProperty(te)){q=this.seen[B];do q++,te=B+"-"+q;while(this.seen.hasOwnProperty(te))}return j||(this.seen[B]=q,this.seen[te]=0),te},xe.slug=function(B,j){j===void 0&&(j={});var te=this.serialize(B);return this.getNextSafeSlug(te,j.dryrun)},Re}(),J=F,me=ee,Te=oe,pe=re.exports.defaults,_e=$.unescape,Ce=function(){function Re(Ae){this.options=Ae||pe,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new me,this.slugger=new Te}Re.parse=function(B,j){var te=new Re(j);return te.parse(B)},Re.parseInline=function(B,j){var te=new Re(j);return te.parseInline(B)};var xe=Re.prototype;return xe.parse=function(B,j){j===void 0&&(j=!0);var te="",q,we,vt,st,ft,Mt,Sn,En,Ft,Yt,kn,$n,Rn,Bn,xn,sn,wn,zn,Hn=B.length;for(q=0;q<Hn;q++)switch(Yt=B[q],Yt.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(Yt.tokens),Yt.depth,_e(this.parseInline(Yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(Yt.text,Yt.lang,Yt.escaped);continue}case"table":{for(En="",Sn="",st=Yt.header.length,we=0;we<st;we++)Sn+=this.renderer.tablecell(this.parseInline(Yt.tokens.header[we]),{header:!0,align:Yt.align[we]});for(En+=this.renderer.tablerow(Sn),Ft="",st=Yt.cells.length,we=0;we<st;we++){for(Mt=Yt.tokens.cells[we],Sn="",ft=Mt.length,vt=0;vt<ft;vt++)Sn+=this.renderer.tablecell(this.parseInline(Mt[vt]),{header:!1,align:Yt.align[vt]});Ft+=this.renderer.tablerow(Sn)}te+=this.renderer.table(En,Ft);continue}case"blockquote":{Ft=this.parse(Yt.tokens),te+=this.renderer.blockquote(Ft);continue}case"list":{for(kn=Yt.ordered,$n=Yt.start,Rn=Yt.loose,st=Yt.items.length,Ft="",we=0;we<st;we++)xn=Yt.items[we],sn=xn.checked,wn=xn.task,Bn="",xn.task&&(zn=this.renderer.checkbox(sn),Rn?xn.tokens.length>0&&xn.tokens[0].type==="text"?(xn.tokens[0].text=zn+" "+xn.tokens[0].text,xn.tokens[0].tokens&&xn.tokens[0].tokens.length>0&&xn.tokens[0].tokens[0].type==="text"&&(xn.tokens[0].tokens[0].text=zn+" "+xn.tokens[0].tokens[0].text)):xn.tokens.unshift({type:"text",text:zn}):Bn+=zn),Bn+=this.parse(xn.tokens,Rn),Ft+=this.renderer.listitem(Bn,wn,sn);te+=this.renderer.list(Ft,kn,$n);continue}case"html":{te+=this.renderer.html(Yt.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(Yt.tokens));continue}case"text":{for(Ft=Yt.tokens?this.parseInline(Yt.tokens):Yt.text;q+1<Hn&&B[q+1].type==="text";)Yt=B[++q],Ft+=`
|
|
`+(Yt.tokens?this.parseInline(Yt.tokens):Yt.text);te+=j?this.renderer.paragraph(Ft):Ft;continue}default:{var Se='Token with "'+Yt.type+'" type was not found.';if(this.options.silent){console.error(Se);return}else throw new Error(Se)}}return te},xe.parseInline=function(B,j){j=j||this.renderer;var te="",q,we,vt=B.length;for(q=0;q<vt;q++)switch(we=B[q],we.type){case"escape":{te+=j.text(we.text);break}case"html":{te+=j.html(we.text);break}case"link":{te+=j.link(we.href,we.title,this.parseInline(we.tokens,j));break}case"image":{te+=j.image(we.href,we.title,we.text);break}case"strong":{te+=j.strong(this.parseInline(we.tokens,j));break}case"em":{te+=j.em(this.parseInline(we.tokens,j));break}case"codespan":{te+=j.codespan(we.text);break}case"br":{te+=j.br();break}case"del":{te+=j.del(this.parseInline(we.tokens,j));break}case"text":{te+=j.text(we.text);break}default:{var st='Token with "'+we.type+'" type was not found.';if(this.options.silent){console.error(st);return}else throw new Error(st)}}return te},Re}(),Ge=be,He=Ce,et=Me,lt=F,Pt=ee,xt=oe,ut=$.merge,Gt=$.checkSanitizeDeprecation,an=$.escape,Ct=re.exports.getDefaults,un=re.exports.changeDefaults,Nn=re.exports.defaults;function At(Re,xe,Ae){if(typeof Re=="undefined"||Re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Re)+", string expected");if(typeof xe=="function"&&(Ae=xe,xe=null),xe=ut({},At.defaults,xe||{}),Gt(xe),Ae){var B=xe.highlight,j;try{j=Ge.lex(Re,xe)}catch(vt){return Ae(vt)}var te=function(st){var ft;if(!st)try{xe.walkTokens&&At.walkTokens(j,xe.walkTokens),ft=He.parse(j,xe)}catch(Mt){st=Mt}return xe.highlight=B,st?Ae(st):Ae(null,ft)};if(!B||B.length<3||(delete xe.highlight,!j.length))return te();var q=0;At.walkTokens(j,function(vt){vt.type==="code"&&(q++,setTimeout(function(){B(vt.text,vt.lang,function(st,ft){if(st)return te(st);ft!=null&&ft!==vt.text&&(vt.text=ft,vt.escaped=!0),q--,q===0&&te()})},0))}),q===0&&te();return}try{var we=Ge.lex(Re,xe);return xe.walkTokens&&At.walkTokens(we,xe.walkTokens),He.parse(we,xe)}catch(vt){if(vt.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+an(vt.message+"",!0)+"</pre>";throw vt}}At.options=At.setOptions=function(Re){return ut(At.defaults,Re),un(At.defaults),At},At.getDefaults=Ct,At.defaults=Nn,At.use=function(Re){var xe=ut({},Re);if(Re.renderer&&function(){var B=At.defaults.renderer||new lt,j=function(we){var vt=B[we];B[we]=function(){for(var st=arguments.length,ft=new Array(st),Mt=0;Mt<st;Mt++)ft[Mt]=arguments[Mt];var Sn=Re.renderer[we].apply(B,ft);return Sn===!1&&(Sn=vt.apply(B,ft)),Sn}};for(var te in Re.renderer)j(te);xe.renderer=B}(),Re.tokenizer&&function(){var B=At.defaults.tokenizer||new et,j=function(we){var vt=B[we];B[we]=function(){for(var st=arguments.length,ft=new Array(st),Mt=0;Mt<st;Mt++)ft[Mt]=arguments[Mt];var Sn=Re.tokenizer[we].apply(B,ft);return Sn===!1&&(Sn=vt.apply(B,ft)),Sn}};for(var te in Re.tokenizer)j(te);xe.tokenizer=B}(),Re.walkTokens){var Ae=At.defaults.walkTokens;xe.walkTokens=function(B){Re.walkTokens(B),Ae&&Ae(B)}}At.setOptions(xe)},At.walkTokens=function(Re,xe){for(var Ae=De(Re),B;!(B=Ae()).done;){var j=B.value;switch(xe(j),j.type){case"table":{for(var te=De(j.tokens.header),q;!(q=te()).done;){var we=q.value;At.walkTokens(we,xe)}for(var vt=De(j.tokens.cells),st;!(st=vt()).done;)for(var ft=st.value,Mt=De(ft),Sn;!(Sn=Mt()).done;){var En=Sn.value;At.walkTokens(En,xe)}break}case"list":{At.walkTokens(j.items,xe);break}default:j.tokens&&At.walkTokens(j.tokens,xe)}}},At.parseInline=function(Re,xe){if(typeof Re=="undefined"||Re===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Re!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Re)+", string expected");xe=ut({},At.defaults,xe||{}),Gt(xe);try{var Ae=Ge.lexInline(Re,xe);return xe.walkTokens&&At.walkTokens(Ae,xe.walkTokens),He.parseInline(Ae,xe)}catch(B){if(B.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+an(B.message+"",!0)+"</pre>";throw B}},At.Parser=He,At.parser=He.parse,At.Renderer=lt,At.TextRenderer=Pt,At.Lexer=Ge,At.lexer=Ge.lex,At.Tokenizer=et,At.Slugger=xt,At.parse=At;var Qt=At;return Qt})},11690:function(vn){const St=/[&<>"']/,C=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,de=/[<>"']|&(?!#?\w+;)/g,De={"&":"&","<":"<",">":">",'"':""","'":"'"},re=ne=>De[ne];function M(ne,Q){if(Q){if(St.test(ne))return ne.replace(C,re)}else if(T.test(ne))return ne.replace(de,re);return ne}const p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function fe(ne){return ne.replace(p,(Q,ye)=>(ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""))}const ie=/(^|[^\[])\^/g;function l(ne,Q){ne=ne.source||ne,Q=Q||"";const ye={replace:(ce,Oe)=>(Oe=Oe.source||Oe,Oe=Oe.replace(ie,"$1"),ne=ne.replace(ce,Oe),ye),getRegex:()=>new RegExp(ne,Q)};return ye}const S=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(ne,Q,ye){if(ne){let ce;try{ce=decodeURIComponent(fe(ye)).replace(S,"").toLowerCase()}catch(Oe){return null}if(ce.indexOf("javascript:")===0||ce.indexOf("vbscript:")===0||ce.indexOf("data:")===0)return null}Q&&!w.test(ye)&&(ye=U(Q,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ce){return null}return ye}const m={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,N=/^([^:]+:\/*[^/]*)[\s\S]*$/;function U(ne,Q){m[" "+ne]||(y.test(ne)?m[" "+ne]=ne+"/":m[" "+ne]=P(ne,"/",!0)),ne=m[" "+ne];const ye=ne.indexOf(":")===-1;return Q.substring(0,2)==="//"?ye?Q:ne.replace(x,"$1")+Q:Q.charAt(0)==="/"?ye?Q:ne.replace(N,"$1")+Q:ne+Q}const K={exec:function(){}};function D(ne){let Q=1,ye,ce;for(;Q<arguments.length;Q++){ye=arguments[Q];for(ce in ye)Object.prototype.hasOwnProperty.call(ye,ce)&&(ne[ce]=ye[ce])}return ne}function A(ne,Q){const ye=ne.replace(/\|/g,(Z,L,V)=>{let $=!1,H=L;for(;--H>=0&&V[H]==="\\";)$=!$;return $?"|":" |"}),ce=ye.split(/ \|/);let Oe=0;if(ce.length>Q)ce.splice(Q);else for(;ce.length<Q;)ce.push("");for(;Oe<ce.length;Oe++)ce[Oe]=ce[Oe].trim().replace(/\\\|/g,"|");return ce}function P(ne,Q,ye){const ce=ne.length;if(ce===0)return"";let Oe=0;for(;Oe<ce;){const Z=ne.charAt(ce-Oe-1);if(Z===Q&&!ye)Oe++;else if(Z!==Q&&ye)Oe++;else break}return ne.substr(0,ce-Oe)}function z(ne,Q){if(ne.indexOf(Q[1])===-1)return-1;const ye=ne.length;let ce=0,Oe=0;for(;Oe<ye;Oe++)if(ne[Oe]==="\\")Oe++;else if(ne[Oe]===Q[0])ce++;else if(ne[Oe]===Q[1]&&(ce--,ce<0))return Oe;return-1}function se(ne){ne&&ne.sanitize&&!ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ae(ne,Q){if(Q<1)return"";let ye="";for(;Q>1;)Q&1&&(ye+=ne),Q>>=1,ne+=ne;return ye+ne}vn.exports={escape:M,unescape:fe,edit:l,cleanUrl:d,resolveUrl:U,noopTest:K,merge:D,splitCells:A,rtrim:P,findClosingBracket:z,checkSanitizeDeprecation:se,repeatString:ae}},75918:function(vn,St,C){"use strict";C.d(St,{Wi:function(){return p},Z0:function(){return fe},aU:function(){return M},eZ:function(){return l},wY:function(){return ie}});var T=C(4348),de=C(69323),De=C(13268),re=function(S,w,d,m){function y(x){return x instanceof d?x:new d(function(N){N(x)})}return new(d||(d=Promise))(function(x,N){function U(A){try{D(m.next(A))}catch(P){N(P)}}function K(A){try{D(m.throw(A))}catch(P){N(P)}}function D(A){A.done?x(A.value):y(A.value).then(U,K)}D((m=m.apply(S,w||[])).next())})};class M extends de.JT{constructor(w,d="",m="",y=!0,x){super(),this._onDidChange=this._register(new T.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=d,this._cssClass=m,this._enabled=y,this._actionCallback=x}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,d){return re(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class p extends de.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new T.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new T.Q5),this.onDidRun=this._onDidRun.event}run(w,d){return re(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let m;try{yield this.runAction(w,d)}catch(y){m=y}this._onDidRun.fire({action:w,error:m})})}runAction(w,d){return re(this,void 0,void 0,function*(){yield w.run(d)})}}class fe extends M{constructor(w){super(fe.ID,w,w?"separator text":"separator"),this.checked=!1,this.enabled=!1}}fe.ID="vs.actions.separator";class ie{constructor(w,d,m,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=d,this.class=y,this._actions=m}get actions(){return this._actions}dispose(){}run(){return re(this,void 0,void 0,function*(){})}}class l extends M{constructor(){super(l.ID,De.N("submenu.empty","(empty)"),void 0,!1)}}l.ID="vs.actions.empty"},76068:function(vn,St,C){"use strict";C.d(St,{ok:function(){return T}});function T(de,De){if(!de)throw new Error(De?`Assertion failed (${De})`:"Assertion Failed")}},52615:function(vn,St,C){"use strict";C.d(St,{CM:function(){return M},JL:function(){return p},dT:function(){return ie},fK:function(){return re},lA:function(){return fe}});var T=C(4348);class de{constructor(){this._icons=new Map,this._onDidRegister=new T.Q5}add(S){const w=this._icons.get(S.id);w?S.description?w.description=S.description:console.error(`Duplicate registration of codicon ${S.id}`):(this._icons.set(S.id,S),this._onDidRegister.fire(S))}get(S){return this._icons.get(S)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const De=new de,re=De;function M(l,S){return new fe(l,S)}function p(l){return l?l.replace(/\$\((.*?)\)/g,(S,w)=>` ${w} `).trim():""}class fe{constructor(S,w,d){this.id=S,this.definition=w,this.description=d,De.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ie;(function(l){l.iconNameSegment="[A-Za-z0-9]+",l.iconNameExpression="[A-Za-z0-9\\-]+",l.iconModifierExpression="~[A-Za-z]+";const S=new RegExp(`^(${l.iconNameExpression})(${l.iconModifierExpression})?$`);function w(y){if(y instanceof fe)return["codicon","codicon-"+y.id];const x=S.exec(y.id);if(!x)return w(fe.error);let[,N,U]=x;const K=["codicon","codicon-"+N];return U&&K.push("codicon-modifier-"+U.substr(1)),K}l.asClassNameArray=w;function d(y){return w(y).join(" ")}l.asClassName=d;function m(y){return"."+w(y).join(".")}l.asCSSSelector=m})(ie||(ie={})),function(l){l.add=new l("add",{fontCharacter:"\\ea60"}),l.plus=new l("plus",l.add.definition),l.gistNew=new l("gist-new",l.add.definition),l.repoCreate=new l("repo-create",l.add.definition),l.lightbulb=new l("lightbulb",{fontCharacter:"\\ea61"}),l.lightBulb=new l("light-bulb",{fontCharacter:"\\ea61"}),l.repo=new l("repo",{fontCharacter:"\\ea62"}),l.repoDelete=new l("repo-delete",{fontCharacter:"\\ea62"}),l.gistFork=new l("gist-fork",{fontCharacter:"\\ea63"}),l.repoForked=new l("repo-forked",{fontCharacter:"\\ea63"}),l.gitPullRequest=new l("git-pull-request",{fontCharacter:"\\ea64"}),l.gitPullRequestAbandoned=new l("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),l.recordKeys=new l("record-keys",{fontCharacter:"\\ea65"}),l.keyboard=new l("keyboard",{fontCharacter:"\\ea65"}),l.tag=new l("tag",{fontCharacter:"\\ea66"}),l.tagAdd=new l("tag-add",{fontCharacter:"\\ea66"}),l.tagRemove=new l("tag-remove",{fontCharacter:"\\ea66"}),l.person=new l("person",{fontCharacter:"\\ea67"}),l.personFollow=new l("person-follow",{fontCharacter:"\\ea67"}),l.personOutline=new l("person-outline",{fontCharacter:"\\ea67"}),l.personFilled=new l("person-filled",{fontCharacter:"\\ea67"}),l.gitBranch=new l("git-branch",{fontCharacter:"\\ea68"}),l.gitBranchCreate=new l("git-branch-create",{fontCharacter:"\\ea68"}),l.gitBranchDelete=new l("git-branch-delete",{fontCharacter:"\\ea68"}),l.sourceControl=new l("source-control",{fontCharacter:"\\ea68"}),l.mirror=new l("mirror",{fontCharacter:"\\ea69"}),l.mirrorPublic=new l("mirror-public",{fontCharacter:"\\ea69"}),l.star=new l("star",{fontCharacter:"\\ea6a"}),l.starAdd=new l("star-add",{fontCharacter:"\\ea6a"}),l.starDelete=new l("star-delete",{fontCharacter:"\\ea6a"}),l.starEmpty=new l("star-empty",{fontCharacter:"\\ea6a"}),l.comment=new l("comment",{fontCharacter:"\\ea6b"}),l.commentAdd=new l("comment-add",{fontCharacter:"\\ea6b"}),l.alert=new l("alert",{fontCharacter:"\\ea6c"}),l.warning=new l("warning",{fontCharacter:"\\ea6c"}),l.search=new l("search",{fontCharacter:"\\ea6d"}),l.searchSave=new l("search-save",{fontCharacter:"\\ea6d"}),l.logOut=new l("log-out",{fontCharacter:"\\ea6e"}),l.signOut=new l("sign-out",{fontCharacter:"\\ea6e"}),l.logIn=new l("log-in",{fontCharacter:"\\ea6f"}),l.signIn=new l("sign-in",{fontCharacter:"\\ea6f"}),l.eye=new l("eye",{fontCharacter:"\\ea70"}),l.eyeUnwatch=new l("eye-unwatch",{fontCharacter:"\\ea70"}),l.eyeWatch=new l("eye-watch",{fontCharacter:"\\ea70"}),l.circleFilled=new l("circle-filled",{fontCharacter:"\\ea71"}),l.primitiveDot=new l("primitive-dot",{fontCharacter:"\\ea71"}),l.closeDirty=new l("close-dirty",{fontCharacter:"\\ea71"}),l.debugBreakpoint=new l("debug-breakpoint",{fontCharacter:"\\ea71"}),l.debugBreakpointDisabled=new l("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),l.debugHint=new l("debug-hint",{fontCharacter:"\\ea71"}),l.primitiveSquare=new l("primitive-square",{fontCharacter:"\\ea72"}),l.edit=new l("edit",{fontCharacter:"\\ea73"}),l.pencil=new l("pencil",{fontCharacter:"\\ea73"}),l.info=new l("info",{fontCharacter:"\\ea74"}),l.issueOpened=new l("issue-opened",{fontCharacter:"\\ea74"}),l.gistPrivate=new l("gist-private",{fontCharacter:"\\ea75"}),l.gitForkPrivate=new l("git-fork-private",{fontCharacter:"\\ea75"}),l.lock=new l("lock",{fontCharacter:"\\ea75"}),l.mirrorPrivate=new l("mirror-private",{fontCharacter:"\\ea75"}),l.close=new l("close",{fontCharacter:"\\ea76"}),l.removeClose=new l("remove-close",{fontCharacter:"\\ea76"}),l.x=new l("x",{fontCharacter:"\\ea76"}),l.repoSync=new l("repo-sync",{fontCharacter:"\\ea77"}),l.sync=new l("sync",{fontCharacter:"\\ea77"}),l.clone=new l("clone",{fontCharacter:"\\ea78"}),l.desktopDownload=new l("desktop-download",{fontCharacter:"\\ea78"}),l.beaker=new l("beaker",{fontCharacter:"\\ea79"}),l.microscope=new l("microscope",{fontCharacter:"\\ea79"}),l.vm=new l("vm",{fontCharacter:"\\ea7a"}),l.deviceDesktop=new l("device-desktop",{fontCharacter:"\\ea7a"}),l.file=new l("file",{fontCharacter:"\\ea7b"}),l.fileText=new l("file-text",{fontCharacter:"\\ea7b"}),l.more=new l("more",{fontCharacter:"\\ea7c"}),l.ellipsis=new l("ellipsis",{fontCharacter:"\\ea7c"}),l.kebabHorizontal=new l("kebab-horizontal",{fontCharacter:"\\ea7c"}),l.mailReply=new l("mail-reply",{fontCharacter:"\\ea7d"}),l.reply=new l("reply",{fontCharacter:"\\ea7d"}),l.organization=new l("organization",{fontCharacter:"\\ea7e"}),l.organizationFilled=new l("organization-filled",{fontCharacter:"\\ea7e"}),l.organizationOutline=new l("organization-outline",{fontCharacter:"\\ea7e"}),l.newFile=new l("new-file",{fontCharacter:"\\ea7f"}),l.fileAdd=new l("file-add",{fontCharacter:"\\ea7f"}),l.newFolder=new l("new-folder",{fontCharacter:"\\ea80"}),l.fileDirectoryCreate=new l("file-directory-create",{fontCharacter:"\\ea80"}),l.trash=new l("trash",{fontCharacter:"\\ea81"}),l.trashcan=new l("trashcan",{fontCharacter:"\\ea81"}),l.history=new l("history",{fontCharacter:"\\ea82"}),l.clock=new l("clock",{fontCharacter:"\\ea82"}),l.folder=new l("folder",{fontCharacter:"\\ea83"}),l.fileDirectory=new l("file-directory",{fontCharacter:"\\ea83"}),l.symbolFolder=new l("symbol-folder",{fontCharacter:"\\ea83"}),l.logoGithub=new l("logo-github",{fontCharacter:"\\ea84"}),l.markGithub=new l("mark-github",{fontCharacter:"\\ea84"}),l.github=new l("github",{fontCharacter:"\\ea84"}),l.terminal=new l("terminal",{fontCharacter:"\\ea85"}),l.console=new l("console",{fontCharacter:"\\ea85"}),l.repl=new l("repl",{fontCharacter:"\\ea85"}),l.zap=new l("zap",{fontCharacter:"\\ea86"}),l.symbolEvent=new l("symbol-event",{fontCharacter:"\\ea86"}),l.error=new l("error",{fontCharacter:"\\ea87"}),l.stop=new l("stop",{fontCharacter:"\\ea87"}),l.variable=new l("variable",{fontCharacter:"\\ea88"}),l.symbolVariable=new l("symbol-variable",{fontCharacter:"\\ea88"}),l.array=new l("array",{fontCharacter:"\\ea8a"}),l.symbolArray=new l("symbol-array",{fontCharacter:"\\ea8a"}),l.symbolModule=new l("symbol-module",{fontCharacter:"\\ea8b"}),l.symbolPackage=new l("symbol-package",{fontCharacter:"\\ea8b"}),l.symbolNamespace=new l("symbol-namespace",{fontCharacter:"\\ea8b"}),l.symbolObject=new l("symbol-object",{fontCharacter:"\\ea8b"}),l.symbolMethod=new l("symbol-method",{fontCharacter:"\\ea8c"}),l.symbolFunction=new l("symbol-function",{fontCharacter:"\\ea8c"}),l.symbolConstructor=new l("symbol-constructor",{fontCharacter:"\\ea8c"}),l.symbolBoolean=new l("symbol-boolean",{fontCharacter:"\\ea8f"}),l.symbolNull=new l("symbol-null",{fontCharacter:"\\ea8f"}),l.symbolNumeric=new l("symbol-numeric",{fontCharacter:"\\ea90"}),l.symbolNumber=new l("symbol-number",{fontCharacter:"\\ea90"}),l.symbolStructure=new l("symbol-structure",{fontCharacter:"\\ea91"}),l.symbolStruct=new l("symbol-struct",{fontCharacter:"\\ea91"}),l.symbolParameter=new l("symbol-parameter",{fontCharacter:"\\ea92"}),l.symbolTypeParameter=new l("symbol-type-parameter",{fontCharacter:"\\ea92"}),l.symbolKey=new l("symbol-key",{fontCharacter:"\\ea93"}),l.symbolText=new l("symbol-text",{fontCharacter:"\\ea93"}),l.symbolReference=new l("symbol-reference",{fontCharacter:"\\ea94"}),l.goToFile=new l("go-to-file",{fontCharacter:"\\ea94"}),l.symbolEnum=new l("symbol-enum",{fontCharacter:"\\ea95"}),l.symbolValue=new l("symbol-value",{fontCharacter:"\\ea95"}),l.symbolRuler=new l("symbol-ruler",{fontCharacter:"\\ea96"}),l.symbolUnit=new l("symbol-unit",{fontCharacter:"\\ea96"}),l.activateBreakpoints=new l("activate-breakpoints",{fontCharacter:"\\ea97"}),l.archive=new l("archive",{fontCharacter:"\\ea98"}),l.arrowBoth=new l("arrow-both",{fontCharacter:"\\ea99"}),l.arrowDown=new l("arrow-down",{fontCharacter:"\\ea9a"}),l.arrowLeft=new l("arrow-left",{fontCharacter:"\\ea9b"}),l.arrowRight=new l("arrow-right",{fontCharacter:"\\ea9c"}),l.arrowSmallDown=new l("arrow-small-down",{fontCharacter:"\\ea9d"}),l.arrowSmallLeft=new l("arrow-small-left",{fontCharacter:"\\ea9e"}),l.arrowSmallRight=new l("arrow-small-right",{fontCharacter:"\\ea9f"}),l.arrowSmallUp=new l("arrow-small-up",{fontCharacter:"\\eaa0"}),l.arrowUp=new l("arrow-up",{fontCharacter:"\\eaa1"}),l.bell=new l("bell",{fontCharacter:"\\eaa2"}),l.bold=new l("bold",{fontCharacter:"\\eaa3"}),l.book=new l("book",{fontCharacter:"\\eaa4"}),l.bookmark=new l("bookmark",{fontCharacter:"\\eaa5"}),l.debugBreakpointConditionalUnverified=new l("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),l.debugBreakpointConditional=new l("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),l.debugBreakpointConditionalDisabled=new l("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),l.debugBreakpointDataUnverified=new l("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),l.debugBreakpointData=new l("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),l.debugBreakpointDataDisabled=new l("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),l.debugBreakpointLogUnverified=new l("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),l.debugBreakpointLog=new l("debug-breakpoint-log",{fontCharacter:"\\eaab"}),l.debugBreakpointLogDisabled=new l("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),l.briefcase=new l("briefcase",{fontCharacter:"\\eaac"}),l.broadcast=new l("broadcast",{fontCharacter:"\\eaad"}),l.browser=new l("browser",{fontCharacter:"\\eaae"}),l.bug=new l("bug",{fontCharacter:"\\eaaf"}),l.calendar=new l("calendar",{fontCharacter:"\\eab0"}),l.caseSensitive=new l("case-sensitive",{fontCharacter:"\\eab1"}),l.check=new l("check",{fontCharacter:"\\eab2"}),l.checklist=new l("checklist",{fontCharacter:"\\eab3"}),l.chevronDown=new l("chevron-down",{fontCharacter:"\\eab4"}),l.dropDownButton=new l("drop-down-button",l.chevronDown.definition),l.chevronLeft=new l("chevron-left",{fontCharacter:"\\eab5"}),l.chevronRight=new l("chevron-right",{fontCharacter:"\\eab6"}),l.chevronUp=new l("chevron-up",{fontCharacter:"\\eab7"}),l.chromeClose=new l("chrome-close",{fontCharacter:"\\eab8"}),l.chromeMaximize=new l("chrome-maximize",{fontCharacter:"\\eab9"}),l.chromeMinimize=new l("chrome-minimize",{fontCharacter:"\\eaba"}),l.chromeRestore=new l("chrome-restore",{fontCharacter:"\\eabb"}),l.circleOutline=new l("circle-outline",{fontCharacter:"\\eabc"}),l.debugBreakpointUnverified=new l("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),l.circleSlash=new l("circle-slash",{fontCharacter:"\\eabd"}),l.circuitBoard=new l("circuit-board",{fontCharacter:"\\eabe"}),l.clearAll=new l("clear-all",{fontCharacter:"\\eabf"}),l.clippy=new l("clippy",{fontCharacter:"\\eac0"}),l.closeAll=new l("close-all",{fontCharacter:"\\eac1"}),l.cloudDownload=new l("cloud-download",{fontCharacter:"\\eac2"}),l.cloudUpload=new l("cloud-upload",{fontCharacter:"\\eac3"}),l.code=new l("code",{fontCharacter:"\\eac4"}),l.collapseAll=new l("collapse-all",{fontCharacter:"\\eac5"}),l.colorMode=new l("color-mode",{fontCharacter:"\\eac6"}),l.commentDiscussion=new l("comment-discussion",{fontCharacter:"\\eac7"}),l.compareChanges=new l("compare-changes",{fontCharacter:"\\eafd"}),l.creditCard=new l("credit-card",{fontCharacter:"\\eac9"}),l.dash=new l("dash",{fontCharacter:"\\eacc"}),l.dashboard=new l("dashboard",{fontCharacter:"\\eacd"}),l.database=new l("database",{fontCharacter:"\\eace"}),l.debugContinue=new l("debug-continue",{fontCharacter:"\\eacf"}),l.debugDisconnect=new l("debug-disconnect",{fontCharacter:"\\ead0"}),l.debugPause=new l("debug-pause",{fontCharacter:"\\ead1"}),l.debugRestart=new l("debug-restart",{fontCharacter:"\\ead2"}),l.debugStart=new l("debug-start",{fontCharacter:"\\ead3"}),l.debugStepInto=new l("debug-step-into",{fontCharacter:"\\ead4"}),l.debugStepOut=new l("debug-step-out",{fontCharacter:"\\ead5"}),l.debugStepOver=new l("debug-step-over",{fontCharacter:"\\ead6"}),l.debugStop=new l("debug-stop",{fontCharacter:"\\ead7"}),l.debug=new l("debug",{fontCharacter:"\\ead8"}),l.deviceCameraVideo=new l("device-camera-video",{fontCharacter:"\\ead9"}),l.deviceCamera=new l("device-camera",{fontCharacter:"\\eada"}),l.deviceMobile=new l("device-mobile",{fontCharacter:"\\eadb"}),l.diffAdded=new l("diff-added",{fontCharacter:"\\eadc"}),l.diffIgnored=new l("diff-ignored",{fontCharacter:"\\eadd"}),l.diffModified=new l("diff-modified",{fontCharacter:"\\eade"}),l.diffRemoved=new l("diff-removed",{fontCharacter:"\\eadf"}),l.diffRenamed=new l("diff-renamed",{fontCharacter:"\\eae0"}),l.diff=new l("diff",{fontCharacter:"\\eae1"}),l.discard=new l("discard",{fontCharacter:"\\eae2"}),l.editorLayout=new l("editor-layout",{fontCharacter:"\\eae3"}),l.emptyWindow=new l("empty-window",{fontCharacter:"\\eae4"}),l.exclude=new l("exclude",{fontCharacter:"\\eae5"}),l.extensions=new l("extensions",{fontCharacter:"\\eae6"}),l.eyeClosed=new l("eye-closed",{fontCharacter:"\\eae7"}),l.fileBinary=new l("file-binary",{fontCharacter:"\\eae8"}),l.fileCode=new l("file-code",{fontCharacter:"\\eae9"}),l.fileMedia=new l("file-media",{fontCharacter:"\\eaea"}),l.filePdf=new l("file-pdf",{fontCharacter:"\\eaeb"}),l.fileSubmodule=new l("file-submodule",{fontCharacter:"\\eaec"}),l.fileSymlinkDirectory=new l("file-symlink-directory",{fontCharacter:"\\eaed"}),l.fileSymlinkFile=new l("file-symlink-file",{fontCharacter:"\\eaee"}),l.fileZip=new l("file-zip",{fontCharacter:"\\eaef"}),l.files=new l("files",{fontCharacter:"\\eaf0"}),l.filter=new l("filter",{fontCharacter:"\\eaf1"}),l.flame=new l("flame",{fontCharacter:"\\eaf2"}),l.foldDown=new l("fold-down",{fontCharacter:"\\eaf3"}),l.foldUp=new l("fold-up",{fontCharacter:"\\eaf4"}),l.fold=new l("fold",{fontCharacter:"\\eaf5"}),l.folderActive=new l("folder-active",{fontCharacter:"\\eaf6"}),l.folderOpened=new l("folder-opened",{fontCharacter:"\\eaf7"}),l.gear=new l("gear",{fontCharacter:"\\eaf8"}),l.gift=new l("gift",{fontCharacter:"\\eaf9"}),l.gistSecret=new l("gist-secret",{fontCharacter:"\\eafa"}),l.gist=new l("gist",{fontCharacter:"\\eafb"}),l.gitCommit=new l("git-commit",{fontCharacter:"\\eafc"}),l.gitCompare=new l("git-compare",{fontCharacter:"\\eafd"}),l.gitMerge=new l("git-merge",{fontCharacter:"\\eafe"}),l.githubAction=new l("github-action",{fontCharacter:"\\eaff"}),l.githubAlt=new l("github-alt",{fontCharacter:"\\eb00"}),l.globe=new l("globe",{fontCharacter:"\\eb01"}),l.grabber=new l("grabber",{fontCharacter:"\\eb02"}),l.graph=new l("graph",{fontCharacter:"\\eb03"}),l.gripper=new l("gripper",{fontCharacter:"\\eb04"}),l.heart=new l("heart",{fontCharacter:"\\eb05"}),l.home=new l("home",{fontCharacter:"\\eb06"}),l.horizontalRule=new l("horizontal-rule",{fontCharacter:"\\eb07"}),l.hubot=new l("hubot",{fontCharacter:"\\eb08"}),l.inbox=new l("inbox",{fontCharacter:"\\eb09"}),l.issueClosed=new l("issue-closed",{fontCharacter:"\\eba4"}),l.issueReopened=new l("issue-reopened",{fontCharacter:"\\eb0b"}),l.issues=new l("issues",{fontCharacter:"\\eb0c"}),l.italic=new l("italic",{fontCharacter:"\\eb0d"}),l.jersey=new l("jersey",{fontCharacter:"\\eb0e"}),l.json=new l("json",{fontCharacter:"\\eb0f"}),l.kebabVertical=new l("kebab-vertical",{fontCharacter:"\\eb10"}),l.key=new l("key",{fontCharacter:"\\eb11"}),l.law=new l("law",{fontCharacter:"\\eb12"}),l.lightbulbAutofix=new l("lightbulb-autofix",{fontCharacter:"\\eb13"}),l.linkExternal=new l("link-external",{fontCharacter:"\\eb14"}),l.link=new l("link",{fontCharacter:"\\eb15"}),l.listOrdered=new l("list-ordered",{fontCharacter:"\\eb16"}),l.listUnordered=new l("list-unordered",{fontCharacter:"\\eb17"}),l.liveShare=new l("live-share",{fontCharacter:"\\eb18"}),l.loading=new l("loading",{fontCharacter:"\\eb19"}),l.location=new l("location",{fontCharacter:"\\eb1a"}),l.mailRead=new l("mail-read",{fontCharacter:"\\eb1b"}),l.mail=new l("mail",{fontCharacter:"\\eb1c"}),l.markdown=new l("markdown",{fontCharacter:"\\eb1d"}),l.megaphone=new l("megaphone",{fontCharacter:"\\eb1e"}),l.mention=new l("mention",{fontCharacter:"\\eb1f"}),l.milestone=new l("milestone",{fontCharacter:"\\eb20"}),l.mortarBoard=new l("mortar-board",{fontCharacter:"\\eb21"}),l.move=new l("move",{fontCharacter:"\\eb22"}),l.multipleWindows=new l("multiple-windows",{fontCharacter:"\\eb23"}),l.mute=new l("mute",{fontCharacter:"\\eb24"}),l.noNewline=new l("no-newline",{fontCharacter:"\\eb25"}),l.note=new l("note",{fontCharacter:"\\eb26"}),l.octoface=new l("octoface",{fontCharacter:"\\eb27"}),l.openPreview=new l("open-preview",{fontCharacter:"\\eb28"}),l.package_=new l("package",{fontCharacter:"\\eb29"}),l.paintcan=new l("paintcan",{fontCharacter:"\\eb2a"}),l.pin=new l("pin",{fontCharacter:"\\eb2b"}),l.play=new l("play",{fontCharacter:"\\eb2c"}),l.run=new l("run",{fontCharacter:"\\eb2c"}),l.plug=new l("plug",{fontCharacter:"\\eb2d"}),l.preserveCase=new l("preserve-case",{fontCharacter:"\\eb2e"}),l.preview=new l("preview",{fontCharacter:"\\eb2f"}),l.project=new l("project",{fontCharacter:"\\eb30"}),l.pulse=new l("pulse",{fontCharacter:"\\eb31"}),l.question=new l("question",{fontCharacter:"\\eb32"}),l.quote=new l("quote",{fontCharacter:"\\eb33"}),l.radioTower=new l("radio-tower",{fontCharacter:"\\eb34"}),l.reactions=new l("reactions",{fontCharacter:"\\eb35"}),l.references=new l("references",{fontCharacter:"\\eb36"}),l.refresh=new l("refresh",{fontCharacter:"\\eb37"}),l.regex=new l("regex",{fontCharacter:"\\eb38"}),l.remoteExplorer=new l("remote-explorer",{fontCharacter:"\\eb39"}),l.remote=new l("remote",{fontCharacter:"\\eb3a"}),l.remove=new l("remove",{fontCharacter:"\\eb3b"}),l.replaceAll=new l("replace-all",{fontCharacter:"\\eb3c"}),l.replace=new l("replace",{fontCharacter:"\\eb3d"}),l.repoClone=new l("repo-clone",{fontCharacter:"\\eb3e"}),l.repoForcePush=new l("repo-force-push",{fontCharacter:"\\eb3f"}),l.repoPull=new l("repo-pull",{fontCharacter:"\\eb40"}),l.repoPush=new l("repo-push",{fontCharacter:"\\eb41"}),l.report=new l("report",{fontCharacter:"\\eb42"}),l.requestChanges=new l("request-changes",{fontCharacter:"\\eb43"}),l.rocket=new l("rocket",{fontCharacter:"\\eb44"}),l.rootFolderOpened=new l("root-folder-opened",{fontCharacter:"\\eb45"}),l.rootFolder=new l("root-folder",{fontCharacter:"\\eb46"}),l.rss=new l("rss",{fontCharacter:"\\eb47"}),l.ruby=new l("ruby",{fontCharacter:"\\eb48"}),l.saveAll=new l("save-all",{fontCharacter:"\\eb49"}),l.saveAs=new l("save-as",{fontCharacter:"\\eb4a"}),l.save=new l("save",{fontCharacter:"\\eb4b"}),l.screenFull=new l("screen-full",{fontCharacter:"\\eb4c"}),l.screenNormal=new l("screen-normal",{fontCharacter:"\\eb4d"}),l.searchStop=new l("search-stop",{fontCharacter:"\\eb4e"}),l.server=new l("server",{fontCharacter:"\\eb50"}),l.settingsGear=new l("settings-gear",{fontCharacter:"\\eb51"}),l.settings=new l("settings",{fontCharacter:"\\eb52"}),l.shield=new l("shield",{fontCharacter:"\\eb53"}),l.smiley=new l("smiley",{fontCharacter:"\\eb54"}),l.sortPrecedence=new l("sort-precedence",{fontCharacter:"\\eb55"}),l.splitHorizontal=new l("split-horizontal",{fontCharacter:"\\eb56"}),l.splitVertical=new l("split-vertical",{fontCharacter:"\\eb57"}),l.squirrel=new l("squirrel",{fontCharacter:"\\eb58"}),l.starFull=new l("star-full",{fontCharacter:"\\eb59"}),l.starHalf=new l("star-half",{fontCharacter:"\\eb5a"}),l.symbolClass=new l("symbol-class",{fontCharacter:"\\eb5b"}),l.symbolColor=new l("symbol-color",{fontCharacter:"\\eb5c"}),l.symbolConstant=new l("symbol-constant",{fontCharacter:"\\eb5d"}),l.symbolEnumMember=new l("symbol-enum-member",{fontCharacter:"\\eb5e"}),l.symbolField=new l("symbol-field",{fontCharacter:"\\eb5f"}),l.symbolFile=new l("symbol-file",{fontCharacter:"\\eb60"}),l.symbolInterface=new l("symbol-interface",{fontCharacter:"\\eb61"}),l.symbolKeyword=new l("symbol-keyword",{fontCharacter:"\\eb62"}),l.symbolMisc=new l("symbol-misc",{fontCharacter:"\\eb63"}),l.symbolOperator=new l("symbol-operator",{fontCharacter:"\\eb64"}),l.symbolProperty=new l("symbol-property",{fontCharacter:"\\eb65"}),l.wrench=new l("wrench",{fontCharacter:"\\eb65"}),l.wrenchSubaction=new l("wrench-subaction",{fontCharacter:"\\eb65"}),l.symbolSnippet=new l("symbol-snippet",{fontCharacter:"\\eb66"}),l.tasklist=new l("tasklist",{fontCharacter:"\\eb67"}),l.telescope=new l("telescope",{fontCharacter:"\\eb68"}),l.textSize=new l("text-size",{fontCharacter:"\\eb69"}),l.threeBars=new l("three-bars",{fontCharacter:"\\eb6a"}),l.thumbsdown=new l("thumbsdown",{fontCharacter:"\\eb6b"}),l.thumbsup=new l("thumbsup",{fontCharacter:"\\eb6c"}),l.tools=new l("tools",{fontCharacter:"\\eb6d"}),l.triangleDown=new l("triangle-down",{fontCharacter:"\\eb6e"}),l.triangleLeft=new l("triangle-left",{fontCharacter:"\\eb6f"}),l.triangleRight=new l("triangle-right",{fontCharacter:"\\eb70"}),l.triangleUp=new l("triangle-up",{fontCharacter:"\\eb71"}),l.twitter=new l("twitter",{fontCharacter:"\\eb72"}),l.unfold=new l("unfold",{fontCharacter:"\\eb73"}),l.unlock=new l("unlock",{fontCharacter:"\\eb74"}),l.unmute=new l("unmute",{fontCharacter:"\\eb75"}),l.unverified=new l("unverified",{fontCharacter:"\\eb76"}),l.verified=new l("verified",{fontCharacter:"\\eb77"}),l.versions=new l("versions",{fontCharacter:"\\eb78"}),l.vmActive=new l("vm-active",{fontCharacter:"\\eb79"}),l.vmOutline=new l("vm-outline",{fontCharacter:"\\eb7a"}),l.vmRunning=new l("vm-running",{fontCharacter:"\\eb7b"}),l.watch=new l("watch",{fontCharacter:"\\eb7c"}),l.whitespace=new l("whitespace",{fontCharacter:"\\eb7d"}),l.wholeWord=new l("whole-word",{fontCharacter:"\\eb7e"}),l.window=new l("window",{fontCharacter:"\\eb7f"}),l.wordWrap=new l("word-wrap",{fontCharacter:"\\eb80"}),l.zoomIn=new l("zoom-in",{fontCharacter:"\\eb81"}),l.zoomOut=new l("zoom-out",{fontCharacter:"\\eb82"}),l.listFilter=new l("list-filter",{fontCharacter:"\\eb83"}),l.listFlat=new l("list-flat",{fontCharacter:"\\eb84"}),l.listSelection=new l("list-selection",{fontCharacter:"\\eb85"}),l.selection=new l("selection",{fontCharacter:"\\eb85"}),l.listTree=new l("list-tree",{fontCharacter:"\\eb86"}),l.debugBreakpointFunctionUnverified=new l("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),l.debugBreakpointFunction=new l("debug-breakpoint-function",{fontCharacter:"\\eb88"}),l.debugBreakpointFunctionDisabled=new l("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),l.debugStackframeActive=new l("debug-stackframe-active",{fontCharacter:"\\eb89"}),l.debugStackframeDot=new l("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),l.debugStackframe=new l("debug-stackframe",{fontCharacter:"\\eb8b"}),l.debugStackframeFocused=new l("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),l.debugBreakpointUnsupported=new l("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),l.symbolString=new l("symbol-string",{fontCharacter:"\\eb8d"}),l.debugReverseContinue=new l("debug-reverse-continue",{fontCharacter:"\\eb8e"}),l.debugStepBack=new l("debug-step-back",{fontCharacter:"\\eb8f"}),l.debugRestartFrame=new l("debug-restart-frame",{fontCharacter:"\\eb90"}),l.callIncoming=new l("call-incoming",{fontCharacter:"\\eb92"}),l.callOutgoing=new l("call-outgoing",{fontCharacter:"\\eb93"}),l.menu=new l("menu",{fontCharacter:"\\eb94"}),l.expandAll=new l("expand-all",{fontCharacter:"\\eb95"}),l.feedback=new l("feedback",{fontCharacter:"\\eb96"}),l.groupByRefType=new l("group-by-ref-type",{fontCharacter:"\\eb97"}),l.ungroupByRefType=new l("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),l.account=new l("account",{fontCharacter:"\\eb99"}),l.bellDot=new l("bell-dot",{fontCharacter:"\\eb9a"}),l.debugConsole=new l("debug-console",{fontCharacter:"\\eb9b"}),l.library=new l("library",{fontCharacter:"\\eb9c"}),l.output=new l("output",{fontCharacter:"\\eb9d"}),l.runAll=new l("run-all",{fontCharacter:"\\eb9e"}),l.syncIgnored=new l("sync-ignored",{fontCharacter:"\\eb9f"}),l.pinned=new l("pinned",{fontCharacter:"\\eba0"}),l.githubInverted=new l("github-inverted",{fontCharacter:"\\eba1"}),l.debugAlt=new l("debug-alt",{fontCharacter:"\\eb91"}),l.serverProcess=new l("server-process",{fontCharacter:"\\eba2"}),l.serverEnvironment=new l("server-environment",{fontCharacter:"\\eba3"}),l.pass=new l("pass",{fontCharacter:"\\eba4"}),l.stopCircle=new l("stop-circle",{fontCharacter:"\\eba5"}),l.playCircle=new l("play-circle",{fontCharacter:"\\eba6"}),l.record=new l("record",{fontCharacter:"\\eba7"}),l.debugAltSmall=new l("debug-alt-small",{fontCharacter:"\\eba8"}),l.vmConnect=new l("vm-connect",{fontCharacter:"\\eba9"}),l.cloud=new l("cloud",{fontCharacter:"\\ebaa"}),l.merge=new l("merge",{fontCharacter:"\\ebab"}),l.exportIcon=new l("export",{fontCharacter:"\\ebac"}),l.graphLeft=new l("graph-left",{fontCharacter:"\\ebad"}),l.magnet=new l("magnet",{fontCharacter:"\\ebae"}),l.notebook=new l("notebook",{fontCharacter:"\\ebaf"}),l.redo=new l("redo",{fontCharacter:"\\ebb0"}),l.checkAll=new l("check-all",{fontCharacter:"\\ebb1"}),l.pinnedDirty=new l("pinned-dirty",{fontCharacter:"\\ebb2"}),l.passFilled=new l("pass-filled",{fontCharacter:"\\ebb3"}),l.circleLargeFilled=new l("circle-large-filled",{fontCharacter:"\\ebb4"}),l.circleLargeOutline=new l("circle-large-outline",{fontCharacter:"\\ebb5"}),l.combine=new l("combine",{fontCharacter:"\\ebb6"}),l.gather=new l("gather",{fontCharacter:"\\ebb6"}),l.table=new l("table",{fontCharacter:"\\ebb7"}),l.variableGroup=new l("variable-group",{fontCharacter:"\\ebb8"}),l.typeHierarchy=new l("type-hierarchy",{fontCharacter:"\\ebb9"}),l.typeHierarchySub=new l("type-hierarchy-sub",{fontCharacter:"\\ebba"}),l.typeHierarchySuper=new l("type-hierarchy-super",{fontCharacter:"\\ebbb"}),l.gitPullRequestCreate=new l("git-pull-request-create",{fontCharacter:"\\ebbc"}),l.runAbove=new l("run-above",{fontCharacter:"\\ebbd"}),l.runBelow=new l("run-below",{fontCharacter:"\\ebbe"}),l.notebookTemplate=new l("notebook-template",{fontCharacter:"\\ebbf"}),l.debugRerun=new l("debug-rerun",{fontCharacter:"\\ebc0"}),l.workspaceTrusted=new l("workspace-trusted",{fontCharacter:"\\ebc1"}),l.workspaceUntrusted=new l("workspace-untrusted",{fontCharacter:"\\ebc2"}),l.workspaceUnspecified=new l("workspace-unspecified",{fontCharacter:"\\ebc3"}),l.terminalCmd=new l("terminal-cmd",{fontCharacter:"\\ebc4"}),l.terminalDebian=new l("terminal-debian",{fontCharacter:"\\ebc5"}),l.terminalLinux=new l("terminal-linux",{fontCharacter:"\\ebc6"}),l.terminalPowershell=new l("terminal-powershell",{fontCharacter:"\\ebc7"}),l.terminalTmux=new l("terminal-tmux",{fontCharacter:"\\ebc8"}),l.terminalUbuntu=new l("terminal-ubuntu",{fontCharacter:"\\ebc9"}),l.terminalBash=new l("terminal-bash",{fontCharacter:"\\ebca"}),l.arrowSwap=new l("arrow-swap",{fontCharacter:"\\ebcb"}),l.copy=new l("copy",{fontCharacter:"\\ebcc"}),l.personAdd=new l("person-add",{fontCharacter:"\\ebcd"}),l.filterFilled=new l("filter-filled",{fontCharacter:"\\ebce"}),l.wand=new l("wand",{fontCharacter:"\\ebcf"}),l.debugLineByLine=new l("debug-line-by-line",{fontCharacter:"\\ebd0"}),l.inspect=new l("inspect",{fontCharacter:"\\ebd1"}),l.layers=new l("layers",{fontCharacter:"\\ebd2"}),l.layersDot=new l("layers-dot",{fontCharacter:"\\ebd3"}),l.layersActive=new l("layers-active",{fontCharacter:"\\ebd4"}),l.compass=new l("compass",{fontCharacter:"\\ebd5"}),l.compassDot=new l("compass-dot",{fontCharacter:"\\ebd6"}),l.compassActive=new l("compass-active",{fontCharacter:"\\ebd7"}),l.azure=new l("azure",{fontCharacter:"\\ebd8"}),l.issueDraft=new l("issue-draft",{fontCharacter:"\\ebd9"}),l.gitPullRequestClosed=new l("git-pull-request-closed",{fontCharacter:"\\ebda"}),l.gitPullRequestDraft=new l("git-pull-request-draft",{fontCharacter:"\\ebdb"}),l.debugAll=new l("debug-all",{fontCharacter:"\\ebdc"}),l.debugCoverage=new l("debug-coverage",{fontCharacter:"\\ebdd"}),l.runErrors=new l("run-errors",{fontCharacter:"\\ebde"}),l.folderLibrary=new l("folder-library",{fontCharacter:"\\ebdf"}),l.debugContinueSmall=new l("debug-continue-small",{fontCharacter:"\\ebe0"}),l.beakerStop=new l("beaker-stop",{fontCharacter:"\\ebe1"}),l.graphLine=new l("graph-line",{fontCharacter:"\\ebe2"}),l.graphScatter=new l("graph-scatter",{fontCharacter:"\\ebe3"}),l.pieChart=new l("pie-chart",{fontCharacter:"\\ebe4"}),l.bracket=new l("bracket",l.json.definition),l.bracketDot=new l("bracket-dot",{fontCharacter:"\\ebe5"}),l.bracketError=new l("bracket-error",{fontCharacter:"\\ebe6"}),l.lockSmall=new l("lock-small",{fontCharacter:"\\ebe7"}),l.azureDevops=new l("azure-devops",{fontCharacter:"\\ebe8"}),l.verifiedFilled=new l("verified-filled",{fontCharacter:"\\ebe9"})}(fe||(fe={}))},79881:function(vn,St,C){"use strict";C.d(St,{B8:function(){return w},Cp:function(){return re},F0:function(){return ie},L6:function(){return S},VV:function(){return fe},b1:function(){return l},dL:function(){return De},ri:function(){return M}});class T{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(y=>{y(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const de=new T;function De(d){fe(d)||de.onUnexpectedError(d)}function re(d){fe(d)||de.onUnexpectedExternalError(d)}function M(d){if(d instanceof Error){let{name:m,message:y}=d;const x=d.stacktrace||d.stack;return{$isError:!0,name:m,message:y,stack:x}}return d}const p="Canceled";function fe(d){return d instanceof Error&&d.name===p&&d.message===p}function ie(){const d=new Error(p);return d.name=d.message,d}function l(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function S(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class w extends Error{constructor(m){super("NotSupported"),m&&(this.message=m)}}},4348:function(vn,St,C){"use strict";C.d(St,{D0:function(){return w},E7:function(){return d},K3:function(){return S},Q5:function(){return l},ZD:function(){return m},ju:function(){return M}});var T=C(79881),de=C(69323),De=C(34502),re=C(95830),M;(function(y){y.None=()=>de.JT.None;function x(V){return($,H=null,W)=>{let _=!1,g;return g=V(O=>{if(!_)return g?g.dispose():_=!0,$.call(H,O)},null,W),_&&g.dispose(),g}}y.once=x;function N(V,$){return z((H,W=null,_)=>V(g=>H.call(W,$(g)),null,_))}y.map=N;function U(V,$){return z((H,W=null,_)=>V(g=>{$(g),H.call(W,g)},null,_))}y.forEach=U;function K(V,$){return z((H,W=null,_)=>V(g=>$(g)&&H.call(W,g),null,_))}y.filter=K;function D(V){return V}y.signal=D;function A(...V){return($,H=null,W)=>(0,de.F8)(...V.map(_=>_(g=>$.call(H,g),null,W)))}y.any=A;function P(V,$,H){let W=H;return N(V,_=>(W=$(W,_),W))}y.reduce=P;function z(V){let $;const H=new l({onFirstListenerAdd(){$=V(H.fire,H)},onLastListenerRemove(){$.dispose()}});return H.event}function se(V,$,H=100,W=!1,_){let g,O,Y,Pe=0;const Me=new l({leakWarningThreshold:_,onFirstListenerAdd(){g=V(Xe=>{Pe++,O=$(O,Xe),W&&!Y&&(Me.fire(O),O=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Ye=O;O=void 0,Y=void 0,(!W||Pe>1)&&Me.fire(Ye),Pe=0},H)})},onLastListenerRemove(){g.dispose()}});return Me.event}y.debounce=se;function ae(V,$=(H,W)=>H===W){let H=!0,W;return K(V,_=>{const g=H||!$(_,W);return H=!1,W=_,g})}y.latch=ae;function ne(V,$){return[y.filter(V,$),y.filter(V,H=>!$(H))]}y.split=ne;function Q(V,$=!1,H=[]){let W=H.slice(),_=V(Y=>{W?W.push(Y):O.fire(Y)});const g=()=>{W&&W.forEach(Y=>O.fire(Y)),W=null},O=new l({onFirstListenerAdd(){_||(_=V(Y=>O.fire(Y)))},onFirstListenerDidAdd(){W&&($?setTimeout(g):g())},onLastListenerRemove(){_&&_.dispose(),_=null}});return O.event}y.buffer=Q;class ye{constructor($){this.event=$}map($){return new ye(N(this.event,$))}forEach($){return new ye(U(this.event,$))}filter($){return new ye(K(this.event,$))}reduce($,H){return new ye(P(this.event,$,H))}latch(){return new ye(ae(this.event))}debounce($,H=100,W=!1,_){return new ye(se(this.event,$,H,W,_))}on($,H,W){return this.event($,H,W)}once($,H,W){return x(this.event)($,H,W)}}function ce(V){return new ye(V)}y.chain=ce;function Oe(V,$,H=W=>W){const W=(...Y)=>O.fire(H(...Y)),_=()=>V.on($,W),g=()=>V.removeListener($,W),O=new l({onFirstListenerAdd:_,onLastListenerRemove:g});return O.event}y.fromNodeEventEmitter=Oe;function Z(V,$,H=W=>W){const W=(...Y)=>O.fire(H(...Y)),_=()=>V.addEventListener($,W),g=()=>V.removeEventListener($,W),O=new l({onFirstListenerAdd:_,onLastListenerRemove:g});return O.event}y.fromDOMEventEmitter=Z;function L(V){return new Promise($=>x(V)($))}y.toPromise=L})(M||(M={}));class p{constructor(x){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${x}_${p._idPool++}`}start(x){this._stopWatch=new re.G(!0),this._listenerCount=x}stop(){if(this._stopWatch){const x=this._stopWatch.elapsed();this._elapsedOverall+=x,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${x.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let fe=-1;class ie{constructor(x,N=Math.random().toString(18).slice(2,5)){this.customThreshold=x,this.name=N,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(x){let N=fe;if(typeof this.customThreshold=="number"&&(N=this.customThreshold),N<=0||x<N)return;this._stacks||(this._stacks=new Map);const U=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),K=this._stacks.get(U)||0;if(this._stacks.set(U,K+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=N*.5;let D,A=0;for(const[P,z]of this._stacks)(!D||A<z)&&(D=P,A=z);console.warn(`[${this.name}] potential listener LEAK detected, having ${x} listeners already. MOST frequent listener (${A}):`),console.warn(D)}return()=>{const D=this._stacks.get(U)||0;this._stacks.set(U,D-1)}}}class l{constructor(x){var N;this._disposed=!1,this._options=x,this._leakageMon=fe>0?new ie(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((N=this._options)===null||N===void 0)&&N._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(x,N,U)=>{var K;this._listeners||(this._listeners=new De.S);const D=this._listeners.isEmpty();D&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const A=this._listeners.push(N?[x,N]:x);D&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,x,N);const P=(K=this._leakageMon)===null||K===void 0?void 0:K.check(this._listeners.size),z=(0,de.OF)(()=>{P&&P(),this._disposed||(A(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return U instanceof de.SL?U.add(z):Array.isArray(U)&&U.push(z),z}),this._event}fire(x){var N,U;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new De.S);for(let K of this._listeners)this._deliveryQueue.push([K,x]);for((N=this._perfMon)===null||N===void 0||N.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[K,D]=this._deliveryQueue.shift();try{typeof K=="function"?K.call(void 0,D):K[0].call(K[1],D)}catch(A){(0,T.dL)(A)}}(U=this._perfMon)===null||U===void 0||U.stop()}}dispose(){var x,N,U,K,D;this._disposed||(this._disposed=!0,(x=this._listeners)===null||x===void 0||x.clear(),(N=this._deliveryQueue)===null||N===void 0||N.clear(),(K=(U=this._options)===null||U===void 0?void 0:U.onLastListenerRemove)===null||K===void 0||K.call(U),(D=this._leakageMon)===null||D===void 0||D.dispose())}}class S extends l{constructor(x){super(x),this._isPaused=0,this._eventQueue=new De.S,this._mergeFn=x==null?void 0:x.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const x=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(x))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(x){this._listeners&&(this._isPaused!==0?this._eventQueue.push(x):super.fire(x))}}class w extends S{constructor(x){var N;super(x),this._delay=(N=x.delay)!==null&&N!==void 0?N:100}fire(x){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(x)}}class d{constructor(){this.buffers=[]}wrapEvent(x){return(N,U,K)=>x(D=>{const A=this.buffers[this.buffers.length-1];A?A.push(()=>N.call(U,D)):N.call(U,D)},void 0,K)}bufferEvents(x){const N=[];this.buffers.push(N);const U=x();return this.buffers.pop(),N.forEach(K=>K()),U}}class m{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=de.JT.None,this.emitter=new l({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(x){this.inputEvent=x,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=x(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(vn,St,C){"use strict";C.d(St,{I:function(){return T}});function T(de){const De=this;let re=!1,M;return function(){return re||(re=!0,M=de.apply(De,arguments)),M}}},88226:function(vn,St,C){"use strict";C.d(St,{$:function(){return T}});var T;(function(de){function De(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}de.is=De;const re=Object.freeze([]);function M(){return re}de.empty=M;function*p(A){yield A}de.single=p;function fe(A){return A||re}de.from=fe;function ie(A){return!A||A[Symbol.iterator]().next().done===!0}de.isEmpty=ie;function l(A){return A[Symbol.iterator]().next().value}de.first=l;function S(A,P){for(const z of A)if(P(z))return!0;return!1}de.some=S;function w(A,P){for(const z of A)if(P(z))return z}de.find=w;function*d(A,P){for(const z of A)P(z)&&(yield z)}de.filter=d;function*m(A,P){let z=0;for(const se of A)yield P(se,z++)}de.map=m;function*y(...A){for(const P of A)for(const z of P)yield z}de.concat=y;function*x(A){for(const P of A)for(const z of P)yield z}de.concatNested=x;function N(A,P,z){let se=z;for(const ae of A)se=P(se,ae);return se}de.reduce=N;function*U(A,P,z=A.length){for(P<0&&(P+=A.length),z<0?z+=A.length:z>A.length&&(z=A.length);P<z;P++)yield A[P]}de.slice=U;function K(A,P=Number.POSITIVE_INFINITY){const z=[];if(P===0)return[z,A];const se=A[Symbol.iterator]();for(let ae=0;ae<P;ae++){const ne=se.next();if(ne.done)return[z,de.empty()];z.push(ne.value)}return[z,{[Symbol.iterator](){return se}}]}de.consume=K;function D(A,P,z=(se,ae)=>se===ae){const se=A[Symbol.iterator](),ae=P[Symbol.iterator]();for(;;){const ne=se.next(),Q=ae.next();if(ne.done!==Q.done)return!1;if(ne.done)return!0;if(!z(ne.value,Q.value))return!1}}de.equals=D})(T||(T={}))},69323:function(vn,St,C){"use strict";C.d(St,{B9:function(){return m},F8:function(){return y},JT:function(){return U},Jz:function(){return D},OF:function(){return x},SL:function(){return N},Wf:function(){return d},XK:function(){return K},dk:function(){return S}});var T=C(17845),de=C(88226);const De=!1;let re=null;function M(A){re=A}if(De){const A="__is_disposable_tracked__";M(new class{trackDisposable(P){const z=new Error("Potentially leaked disposable").stack;setTimeout(()=>{P[A]||console.log(z)},3e3)}setParent(P,z){if(P&&P!==U.None)try{P[A]=!0}catch(se){}}markAsDisposed(P){if(P&&P!==U.None)try{P[A]=!0}catch(z){}}markAsSingleton(P){}})}function p(A){return re==null||re.trackDisposable(A),A}function fe(A){re==null||re.markAsDisposed(A)}function ie(A,P){re==null||re.setParent(A,P)}function l(A,P){if(re)for(const z of A)re.setParent(z,P)}function S(A){return re==null||re.markAsSingleton(A),A}class w extends Error{constructor(P){super(`Encountered errors while disposing of store. Errors: [${P.join(", ")}]`),this.errors=P}}function d(A){return typeof A.dispose=="function"&&A.dispose.length===0}function m(A){if(de.$.is(A)){let P=[];for(const z of A)if(z)try{z.dispose()}catch(se){P.push(se)}if(P.length===1)throw P[0];if(P.length>1)throw new w(P);return Array.isArray(A)?[]:A}else if(A)return A.dispose(),A}function y(...A){const P=x(()=>m(A));return l(A,P),P}function x(A){const P=p({dispose:(0,T.I)(()=>{fe(P),A()})});return P}class N{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(fe(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(P){if(!P)return P;if(P===this)throw new Error("Cannot register a disposable on itself!");return ie(P,this),this._isDisposed?N.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(P),P}}N.DISABLE_DISPOSED_WARNING=!1;class U{constructor(){this._store=new N,p(this),ie(this._store,this)}dispose(){fe(this),this._store.dispose()}_register(P){if(P===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(P)}}U.None=Object.freeze({dispose(){}});class K{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(P){var z;this._isDisposed||P===this._value||((z=this._value)===null||z===void 0||z.dispose(),P&&ie(P,this),this._value=P)}clear(){this.value=void 0}dispose(){var P;this._isDisposed=!0,fe(this),(P=this._value)===null||P===void 0||P.dispose(),this._value=void 0}clearAndLeak(){const P=this._value;return this._value=void 0,P&&ie(P,null),P}}class D{constructor(P){this.object=P}dispose(){}}},34502:function(vn,St,C){"use strict";C.d(St,{S:function(){return de}});class T{constructor(re){this.element=re,this.next=T.Undefined,this.prev=T.Undefined}}T.Undefined=new T(void 0);class de{constructor(){this._first=T.Undefined,this._last=T.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===T.Undefined}clear(){let re=this._first;for(;re!==T.Undefined;){const M=re.next;re.prev=T.Undefined,re.next=T.Undefined,re=M}this._first=T.Undefined,this._last=T.Undefined,this._size=0}unshift(re){return this._insert(re,!1)}push(re){return this._insert(re,!0)}_insert(re,M){const p=new T(re);if(this._first===T.Undefined)this._first=p,this._last=p;else if(M){const ie=this._last;this._last=p,p.prev=ie,ie.next=p}else{const ie=this._first;this._first=p,p.next=ie,ie.prev=p}this._size+=1;let fe=!1;return()=>{fe||(fe=!0,this._remove(p))}}shift(){if(this._first!==T.Undefined){const re=this._first.element;return this._remove(this._first),re}}pop(){if(this._last!==T.Undefined){const re=this._last.element;return this._remove(this._last),re}}_remove(re){if(re.prev!==T.Undefined&&re.next!==T.Undefined){const M=re.prev;M.next=re.next,re.next.prev=M}else re.prev===T.Undefined&&re.next===T.Undefined?(this._first=T.Undefined,this._last=T.Undefined):re.next===T.Undefined?(this._last=this._last.prev,this._last.next=T.Undefined):re.prev===T.Undefined&&(this._first=this._first.next,this._first.prev=T.Undefined);this._size-=1}*[Symbol.iterator](){let re=this._first;for(;re!==T.Undefined;)yield re.element,re=re.next}}},23345:function(vn,St,C){"use strict";C.d(St,{$L:function(){return se},ED:function(){return D},IJ:function(){return P},OS:function(){return ye},WE:function(){return ne},dz:function(){return A},gn:function(){return ae},li:function(){return x},r:function(){return Z},tY:function(){return z},xS:function(){return Q}});var T=C(97671),de;const De="en";let re=!1,M=!1,p=!1,fe=!1,ie=!1,l=!1,S=!1,w,d=null,m=null,y;const x=typeof self=="object"?self:typeof C.g=="object"?C.g:{};let N;typeof x.vscode!="undefined"&&typeof x.vscode.process!="undefined"?N=x.vscode.process:typeof T!="undefined"&&(N=T);const U=typeof((de=N==null?void 0:N.versions)===null||de===void 0?void 0:de.electron)=="string"&&N.type==="renderer";if(typeof navigator=="object"&&!U)y=navigator.userAgent,re=y.indexOf("Windows")>=0,M=y.indexOf("Macintosh")>=0,S=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=y.indexOf("Linux")>=0,l=!0,w=navigator.language,d=w;else if(typeof N=="object"){re=N.platform==="win32",M=N.platform==="darwin",p=N.platform==="linux",fe=p&&!!N.env.SNAP&&!!N.env.SNAP_REVISION,w=De,d=De;const L=N.env.VSCODE_NLS_CONFIG;if(L)try{const V=JSON.parse(L),$=V.availableLanguages["*"];w=V.locale,d=$||De,m=V._translationsConfigFile}catch(V){}ie=!0}else console.error("Unable to resolve platform.");let K=0;M?K=1:re?K=3:p&&(K=2);const D=re,A=M,P=p,z=ie,se=l,ae=S,ne=y,Q=function(){if(x.setImmediate)return x.setImmediate.bind(x);if(typeof x.postMessage=="function"&&!x.importScripts){let $=[];x.addEventListener("message",W=>{if(W.data&&W.data.vscodeSetImmediateId)for(let _=0,g=$.length;_<g;_++){const O=$[_];if(O.id===W.data.vscodeSetImmediateId){$.splice(_,1),O.callback();return}}});let H=0;return W=>{const _=++H;$.push({id:_,callback:W}),x.postMessage({vscodeSetImmediateId:_},"*")}}if(typeof(N==null?void 0:N.nextTick)=="function")return N.nextTick.bind(N);const V=Promise.resolve();return $=>V.then($)}(),ye=M||S?2:re?1:3;let ce=!0,Oe=!1;function Z(){if(!Oe){Oe=!0;const L=new Uint8Array(2);L[0]=1,L[1]=2,ce=new Uint16Array(L.buffer)[0]===513}return ce}},95830:function(vn,St,C){"use strict";C.d(St,{G:function(){return De}});var T=C(23345);const de=T.li.performance&&typeof T.li.performance.now=="function";class De{constructor(M){this._highResolution=de&&M,this._startTime=this._now(),this._stopTime=-1}static create(M=!0){return new De(M)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?T.li.performance.now():Date.now()}}},82983:function(vn,St,C){"use strict";C.d(St,{$i:function(){return Pe},C8:function(){return gt},GF:function(){return w},HO:function(){return H},IO:function(){return d},K7:function(){return Tt},Kw:function(){return Et},LC:function(){return x},Mh:function(){return Q},P1:function(){return ye},PJ:function(){return ot},Qe:function(){return Me},R1:function(){return S},RP:function(){return O},S6:function(){return rn},TT:function(){return D},Ut:function(){return _},V8:function(){return N},WU:function(){return De},YK:function(){return Oe},YU:function(){return re},ZG:function(){return ce},ZH:function(){return L},ab:function(){return Xe},c1:function(){return Le},df:function(){return se},ec:function(){return M},fi:function(){return Ze},fy:function(){return p},j3:function(){return fe},j_:function(){return P},m5:function(){return T},mK:function(){return z},mr:function(){return m},oH:function(){return G},oL:function(){return ie},ok:function(){return ne},ow:function(){return U},qq:function(){return ae},qu:function(){return K},rL:function(){return Z},uS:function(){return Je},un:function(){return l},uq:function(){return y},vH:function(){return $},xe:function(){return Ye},zY:function(){return A}});function T(k){return!k||typeof k!="string"?!0:k.trim().length===0}const de=/{(\d+)}/g;function De(k,...F){return F.length===0?k:k.replace(de,function(ee,oe){const J=parseInt(oe,10);return isNaN(J)||J<0||J>=F.length?ee:F[J]})}function re(k){return k.replace(/[<>&]/g,function(F){switch(F){case"<":return"<";case">":return">";case"&":return"&";default:return F}})}function M(k){return k.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(k,F=" "){const ee=fe(k,F);return ie(ee,F)}function fe(k,F){if(!k||!F)return k;const ee=F.length;if(ee===0||k.length===0)return k;let oe=0;for(;k.indexOf(F,oe)===oe;)oe=oe+ee;return k.substring(oe)}function ie(k,F){if(!k||!F)return k;const ee=F.length,oe=k.length;if(ee===0||oe===0)return k;let J=oe,me=-1;for(;me=k.lastIndexOf(F,J-1),!(me===-1||me+ee!==J);){if(me===0)return"";J=me}return k.substring(0,J)}function l(k){return k.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function S(k){return k.replace(/\*/g,"")}function w(k,F,ee={}){if(!k)throw new Error("Cannot create regex from empty string");F||(k=M(k)),ee.wholeWord&&(/\B/.test(k.charAt(0))||(k="\\b"+k),/\B/.test(k.charAt(k.length-1))||(k=k+"\\b"));let oe="";return ee.global&&(oe+="g"),ee.matchCase||(oe+="i"),ee.multiline&&(oe+="m"),ee.unicode&&(oe+="u"),new RegExp(k,oe)}function d(k){return k.source==="^"||k.source==="^$"||k.source==="$"||k.source==="^\\s*$"?!1:!!(k.exec("")&&k.lastIndex===0)}function m(k){return(k.global?"g":"")+(k.ignoreCase?"i":"")+(k.multiline?"m":"")+(k.unicode?"u":"")}function y(k){return k.split(/\r\n|\r|\n/)}function x(k){for(let F=0,ee=k.length;F<ee;F++){const oe=k.charCodeAt(F);if(oe!==32&&oe!==9)return F}return-1}function N(k,F=0,ee=k.length){for(let oe=F;oe<ee;oe++){const J=k.charCodeAt(oe);if(J!==32&&J!==9)return k.substring(F,oe)}return k.substring(F,ee)}function U(k,F=k.length-1){for(let ee=F;ee>=0;ee--){const oe=k.charCodeAt(ee);if(oe!==32&&oe!==9)return ee}return-1}function K(k,F){return k<F?-1:k>F?1:0}function D(k,F,ee=0,oe=k.length,J=0,me=F.length){for(;ee<oe&&J<me;ee++,J++){let _e=k.charCodeAt(ee),Ce=F.charCodeAt(J);if(_e<Ce)return-1;if(_e>Ce)return 1}const Te=oe-ee,pe=me-J;return Te<pe?-1:Te>pe?1:0}function A(k,F){return P(k,F,0,k.length,0,F.length)}function P(k,F,ee=0,oe=k.length,J=0,me=F.length){for(;ee<oe&&J<me;ee++,J++){let _e=k.charCodeAt(ee),Ce=F.charCodeAt(J);if(_e===Ce)continue;if(_e>=128||Ce>=128)return D(k.toLowerCase(),F.toLowerCase(),ee,oe,J,me);z(_e)&&(_e-=32),z(Ce)&&(Ce-=32);const Ge=_e-Ce;if(Ge!==0)return Ge}const Te=oe-ee,pe=me-J;return Te<pe?-1:Te>pe?1:0}function z(k){return k>=97&&k<=122}function se(k){return k>=65&&k<=90}function ae(k,F){return k.length===F.length&&P(k,F)===0}function ne(k,F){const ee=F.length;return F.length>k.length?!1:P(k,F,0,ee)===0}function Q(k,F){let ee,oe=Math.min(k.length,F.length);for(ee=0;ee<oe;ee++)if(k.charCodeAt(ee)!==F.charCodeAt(ee))return ee;return oe}function ye(k,F){let ee,oe=Math.min(k.length,F.length);const J=k.length-1,me=F.length-1;for(ee=0;ee<oe;ee++)if(k.charCodeAt(J-ee)!==F.charCodeAt(me-ee))return ee;return oe}function ce(k){return 55296<=k&&k<=56319}function Oe(k){return 56320<=k&&k<=57343}function Z(k,F){return(k-55296<<10)+(F-56320)+65536}function L(k,F,ee){const oe=k.charCodeAt(ee);if(ce(oe)&&ee+1<F){const J=k.charCodeAt(ee+1);if(Oe(J))return Z(oe,J)}return oe}function V(k,F){const ee=k.charCodeAt(F-1);if(Oe(ee)&&F>1){const oe=k.charCodeAt(F-2);if(ce(oe))return Z(oe,ee)}return ee}function $(k,F){const ee=ge.getInstance(),oe=F,J=k.length,me=L(k,J,F);F+=me>=65536?2:1;let Te=ee.getGraphemeBreakType(me);for(;F<J;){const pe=L(k,J,F),_e=ee.getGraphemeBreakType(pe);if(Ze(Te,_e))break;F+=pe>=65536?2:1,Te=_e}return F-oe}function H(k,F){const ee=ge.getInstance(),oe=F,J=V(k,F);F-=J>=65536?2:1;let me=ee.getGraphemeBreakType(J);for(;F>0;){const Te=V(k,F),pe=ee.getGraphemeBreakType(Te);if(Ze(pe,me))break;F-=Te>=65536?2:1,me=pe}return oe-F}const W=/(?:[\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 _(k){return W.test(k)}const g=/(?:[\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 O(k){return g.test(k)}const Y=/^[\t\n\r\x20-\x7E]*$/;function Pe(k){return Y.test(k)}const Me=/[\u2028\u2029]/;function Xe(k){return Me.test(k)}function Ye(k){for(let F=0,ee=k.length;F<ee;F++)if(Tt(k.charCodeAt(F)))return!0;return!1}function Tt(k){return k=+k,k>=11904&&k<=55215||k>=63744&&k<=64255||k>=65281&&k<=65374}function gt(k){return k>=127462&&k<=127487||k===8986||k===8987||k===9200||k===9203||k>=9728&&k<=10175||k===11088||k===11093||k>=127744&&k<=128591||k>=128640&&k<=128764||k>=128992&&k<=129003||k>=129280&&k<=129535||k>=129648&&k<=129750}const Le="\uFEFF";function Je(k){return!!(k&&k.length>0&&k.charCodeAt(0)===65279)}function Et(k,F=!1){return k?(F&&(k=k.replace(/\\./g,"")),k.toLowerCase()!==k):!1}function ot(k){return k=k%(2*26),k<26?String.fromCharCode(97+k):String.fromCharCode(65+k-26)}function rn(k){return ge.getInstance().getGraphemeBreakType(k)}function Ze(k,F){return k===0?F!==5&&F!==7:k===2&&F===3?!1:k===4||k===2||k===3||F===4||F===2||F===3?!0:!(k===8&&(F===8||F===9||F===11||F===12)||(k===11||k===9)&&(F===9||F===10)||(k===12||k===10)&&F===10||F===5||F===13||F===7||k===1||k===13&&F===14||k===6&&F===6)}class ge{constructor(){this._data=le()}static getInstance(){return ge._INSTANCE||(ge._INSTANCE=new ge),ge._INSTANCE}getGraphemeBreakType(F){if(F<32)return F===10?3:F===13?2:4;if(F<127)return 0;const ee=this._data,oe=ee.length/3;let J=1;for(;J<=oe;)if(F<ee[3*J])J=2*J;else if(F>ee[3*J+1])J=2*J+1;else return ee[3*J+2];return 0}}ge._INSTANCE=null;function le(){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 G(k,F){if(k===0)return 0;const ee=be(k,F);if(ee!==void 0)return ee;const oe=V(F,k);return k-=ke(oe),k}function be(k,F){let ee=V(F,k);for(k-=ke(ee);Ne(ee)||ee===65039||ee===8419;){if(k===0)return;ee=V(F,k),k-=ke(ee)}if(gt(ee)){if(k>=0){const oe=V(F,k);oe===8205&&(k-=ke(oe))}return k}}function ke(k){return k>=65536?2:1}function Ne(k){return 127995<=k&&k<=127999}},72999:function(vn,St,C){"use strict";C.d(St,{$E:function(){return x},$K:function(){return fe},D8:function(){return d},HD:function(){return de},IU:function(){return N},Jp:function(){return ie},Kn:function(){return De},cW:function(){return S},f6:function(){return U},hj:function(){return re},jn:function(){return M},kJ:function(){return T},mf:function(){return w},o8:function(){return p},p_:function(){return l},vE:function(){return K}});function T(D){return Array.isArray(D)}function de(D){return typeof D=="string"}function De(D){return typeof D=="object"&&D!==null&&!Array.isArray(D)&&!(D instanceof RegExp)&&!(D instanceof Date)}function re(D){return typeof D=="number"&&!isNaN(D)}function M(D){return D===!0||D===!1}function p(D){return typeof D=="undefined"}function fe(D){return!ie(D)}function ie(D){return p(D)||D===null}function l(D,A){if(!D)throw new Error(A?`Unexpected type, expected '${A}'`:"Unexpected type")}function S(D){if(ie(D))throw new Error("Assertion Failed: argument is undefined or null");return D}function w(D){return typeof D=="function"}function d(D,A){const P=Math.min(D.length,A.length);for(let z=0;z<P;z++)m(D[z],A[z])}function m(D,A){if(de(A)){if(typeof D!==A)throw new Error(`argument does not match constraint: typeof ${A}`)}else if(w(A)){try{if(D instanceof A)return}catch(P){}if(!ie(D)&&D.constructor===A||A.length===1&&A.call(void 0,D)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(D){let A=[],P=Object.getPrototypeOf(D);for(;Object.prototype!==P;)A=A.concat(Object.getOwnPropertyNames(P)),P=Object.getPrototypeOf(P);return A}function x(D){const A=[];for(const P of y(D))typeof D[P]=="function"&&A.push(P);return A}function N(D,A){const P=se=>function(){const ae=Array.prototype.slice.call(arguments,0);return A(se,ae)};let z={};for(const se of D)z[se]=P(se);return z}function U(D){return D===null?void 0:D}function K(D,A="Unreachable"){throw new Error(A)}},13268:function(vn,St,C){"use strict";C.d(St,{N:function(){return de}});function T(De,re){let M;return re.length===0?M=De:M=De.replace(/\{(\d+)\}/g,function(p,fe){const ie=fe[0];return typeof re[ie]!="undefined"?re[ie]:p}),M}function de(De,re,...M){return T(re,M)}},96236:function(vn,St,C){"use strict";C.d(St,{BH:function(){return N},NZ:function(){return U},U8:function(){return K},co:function(){return x},eH:function(){return y},vr:function(){return m}});var T=C(75918),de=C(52615),De=C(4348),re=C(88226),M=C(69323),p=C(34502),fe=C(35884),ie=C(90689),l=C(16925),S=C(49055),w=function(D,A,P,z){var se=arguments.length,ae=se<3?A:z===null?z=Object.getOwnPropertyDescriptor(A,P):z,ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(D,A,P,z);else for(var Q=D.length-1;Q>=0;Q--)(ne=D[Q])&&(ae=(se<3?ne(ae):se>3?ne(A,P,ae):ne(A,P))||ae);return se>3&&ae&&Object.defineProperty(A,P,ae),ae},d=function(D,A){return function(P,z){A(P,z,D)}};function m(D){return D.command!==void 0}class y{constructor(A){this.id=y._idPool++,this._debugName=A}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const x=(0,l.yh)("menuService"),N=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new De.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:D=>D===y.CommandPalette}}addCommand(D){return this.addCommands(re.$.single(D))}addCommands(D){for(const A of D)this._commands.set(A.id,A);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,M.OF)(()=>{let A=!1;for(const P of D)A=this._commands.delete(P.id)||A;A&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(D){return this._commands.get(D)}getCommands(){const D=new Map;return this._commands.forEach((A,P)=>D.set(P,A)),D}appendMenuItem(D,A){return this.appendMenuItems(re.$.single({id:D,item:A}))}appendMenuItems(D){const A=new Set,P=new p.S;for(const{id:z,item:se}of D){let ae=this._menuItems.get(z);ae||(ae=new p.S,this._menuItems.set(z,ae)),P.push(ae.push(se)),A.add(z)}return this._onDidChangeMenu.fire(A),(0,M.OF)(()=>{if(P.size>0){for(let z of P)z();this._onDidChangeMenu.fire(A),P.clear()}})}getMenuItems(D){let A;return this._menuItems.has(D)?A=[...this._menuItems.get(D)]:A=[],D===y.CommandPalette&&this._appendImplicitItems(A),A}_appendImplicitItems(D){const A=new Set;for(const P of D)m(P)&&(A.add(P.command.id),P.alt&&A.add(P.alt.id));this._commands.forEach((P,z)=>{A.has(z)||D.push({command:P})})}};class U extends T.wY{constructor(A,P,z,se){super(`submenuitem.${A.submenu.id}`,typeof A.title=="string"?A.title:A.title.value,[],"submenu"),this.item=A,this._menuService=P,this._contextKeyService=z,this._options=se}get actions(){const A=[],P=this._menuService.createMenu(this.item.submenu,this._contextKeyService),z=P.getActions(this._options);P.dispose();for(const[,se]of z)se.length>0&&(A.push(...se),A.push(new T.Z0));return A.length&&A.pop(),A}}let K=class qo{constructor(A,P,z,se,ae){var ne,Q;if(this._commandService=ae,this.id=A.id,this.label=z!=null&&z.renderShortTitle&&A.shortTitle?typeof A.shortTitle=="string"?A.shortTitle:A.shortTitle.value:typeof A.title=="string"?A.title:A.title.value,this.tooltip=(Q=typeof A.tooltip=="string"?A.tooltip:(ne=A.tooltip)===null||ne===void 0?void 0:ne.value)!==null&&Q!==void 0?Q:"",this.enabled=!A.precondition||se.contextMatchesRules(A.precondition),this.checked=void 0,A.toggled){const ye=A.toggled.condition?A.toggled:{condition:A.toggled};this.checked=se.contextMatchesRules(ye.condition),this.checked&&ye.tooltip&&(this.tooltip=typeof ye.tooltip=="string"?ye.tooltip:ye.tooltip.value),ye.title&&(this.label=typeof ye.title=="string"?ye.title:ye.title.value)}this.item=A,this.alt=P?new qo(P,void 0,z,se,ae):void 0,this._options=z,S.kS.isThemeIcon(A.icon)&&(this.class=de.dT.asClassName(A.icon))}dispose(){}run(...A){var P,z;let se=[];return!((P=this._options)===null||P===void 0)&&P.arg&&(se=[...se,this._options.arg]),!((z=this._options)===null||z===void 0)&&z.shouldForwardArgs&&(se=[...se,...A]),this._commandService.executeCommand(this.id,...se)}};K=w([d(3,ie.i6),d(4,fe.H)],K)},35884:function(vn,St,C){"use strict";C.d(St,{H:function(){return fe},P:function(){return ie}});var T=C(4348),de=C(88226),De=C(69323),re=C(34502),M=C(72999),p=C(16925);const fe=(0,p.yh)("commandService"),ie=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new T.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(l,S){if(!l)throw new Error("invalid command");if(typeof l=="string"){if(!S)throw new Error("invalid command");return this.registerCommand({id:l,handler:S})}if(l.description){const x=[];for(let U of l.description.args)x.push(U.constraint);const N=l.handler;l.handler=function(U,...K){return(0,M.D8)(K,x),N(U,...K)}}const{id:w}=l;let d=this._commands.get(w);d||(d=new re.S,this._commands.set(w,d));let m=d.unshift(l),y=(0,De.OF)(()=>{m();const x=this._commands.get(w);x!=null&&x.isEmpty()&&this._commands.delete(w)});return this._onDidRegisterCommand.fire(w),y}registerCommandAlias(l,S){return ie.registerCommand(l,(w,...d)=>w.get(fe).executeCommand(S,...d))}getCommand(l){const S=this._commands.get(l);if(!(!S||S.isEmpty()))return de.$.first(S)}getCommands(){const l=new Map;for(const S of this._commands.keys()){const w=this.getCommand(S);w&&l.set(S,w)}return l}};ie.registerCommand("noop",()=>{})},90689:function(vn,St,C){"use strict";C.d(St,{Ao:function(){return fe},Eq:function(){return Z},Fb:function(){return ie},K8:function(){return $},i6:function(){return Oe},uy:function(){return ce}});var T=C(23345),de=C(82983),De=C(16925);let re=T.WE||"";const M=new Map;M.set("false",!1),M.set("true",!0),M.set("isMac",T.dz),M.set("isLinux",T.IJ),M.set("isWindows",T.ED),M.set("isWeb",T.$L),M.set("isMacNative",T.dz&&!T.$L),M.set("isEdge",re.indexOf("Edg/")>=0),M.set("isFirefox",re.indexOf("Firefox")>=0),M.set("isChrome",re.indexOf("Chrome")>=0),M.set("isSafari",re.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class fe{static has(_){return d.create(_)}static equals(_,g){return m.create(_,g)}static regex(_,g){return se.create(_,g)}static not(_){return U.create(_)}static and(..._){return Q.create(_,null)}static or(..._){return ye.create(_,null,!0)}static deserialize(_,g=!1){if(_)return this._deserializeOrExpression(_,g)}static _deserializeOrExpression(_,g){let O=_.split("||");return ye.create(O.map(Y=>this._deserializeAndExpression(Y,g)),null,!0)}static _deserializeAndExpression(_,g){let O=_.split("&&");return Q.create(O.map(Y=>this._deserializeOne(Y,g)),null)}static _deserializeOne(_,g){if(_=_.trim(),_.indexOf("!=")>=0){let O=_.split("!=");return N.create(O[0].trim(),this._deserializeValue(O[1],g))}if(_.indexOf("==")>=0){let O=_.split("==");return m.create(O[0].trim(),this._deserializeValue(O[1],g))}if(_.indexOf("=~")>=0){let O=_.split("=~");return se.create(O[0].trim(),this._deserializeRegexValue(O[1],g))}if(_.indexOf(" in ")>=0){let O=_.split(" in ");return y.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const O=_.split(">=");return A.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const O=_.split(">");return D.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const O=_.split("<=");return z.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const O=_.split("<");return P.create(O[0].trim(),O[1].trim())}return/^\!\s*/.test(_)?U.create(_.substr(1).trim()):d.create(_)}static _deserializeValue(_,g){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let O=/^'([^']*)'$/.exec(_);return O?O[1].trim():_}static _deserializeRegexValue(_,g){if((0,de.m5)(_)){if(g)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let O=_.indexOf("/"),Y=_.lastIndexOf("/");if(O===Y||O<0){if(g)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let Pe=_.slice(O+1,Y),Me=_[Y+1]==="i"?"i":"";try{return new RegExp(Pe,Me)}catch(Xe){if(g)throw new Error(`bad regexp-value '${_}', parse error: ${Xe}`);return console.warn(`bad regexp-value '${_}', parse error: ${Xe}`),null}}}function ie(W,_){const g=W?W.substituteConstants():void 0,O=_?_.substituteConstants():void 0;return!g&&!O?!0:!g||!O?!1:g.equals(O)}function l(W,_){return W.cmp(_)}class S{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return w.INSTANCE}}S.INSTANCE=new S;class w{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return S.INSTANCE}}w.INSTANCE=new w;class d{constructor(_,g){this.key=_,this.negated=g,this.type=2}static create(_,g=null){const O=M.get(_);return typeof O=="boolean"?O?w.INSTANCE:S.INSTANCE:new d(_,g)}cmp(_){return _.type!==this.type?this.type-_.type:L(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=M.get(this.key);return typeof _=="boolean"?_?w.INSTANCE:S.INSTANCE:this}evaluate(_){return!!_.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=U.create(this.key,this)),this.negated}}class m{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=4}static create(_,g,O=null){if(typeof g=="boolean")return g?d.create(_,O):U.create(_,O);const Y=M.get(_);return typeof Y=="boolean"?g===(Y?"true":"false")?w.INSTANCE:S.INSTANCE:new m(_,g,O)}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=M.get(this.key);if(typeof _=="boolean"){const g=_?"true":"false";return this.value===g?w.INSTANCE:S.INSTANCE}return this}evaluate(_){return _.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=N.create(this.key,this.value,this)),this.negated}}class y{constructor(_,g){this.key=_,this.valueKey=g,this.type=10,this.negated=null}static create(_,g){return new y(_,g)}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const g=_.getValue(this.valueKey),O=_.getValue(this.key);return Array.isArray(g)?g.indexOf(O)>=0:typeof O=="string"&&typeof g=="object"&&g!==null?p.call(g,O):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=x.create(this)),this.negated}}class x{constructor(_){this._actual=_,this.type=11}static create(_){return new x(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class N{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=5}static create(_,g,O=null){if(typeof g=="boolean")return g?U.create(_,O):d.create(_,O);const Y=M.get(_);return typeof Y=="boolean"?g===(Y?"true":"false")?S.INSTANCE:w.INSTANCE:new N(_,g,O)}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=M.get(this.key);if(typeof _=="boolean"){const g=_?"true":"false";return this.value===g?S.INSTANCE:w.INSTANCE}return this}evaluate(_){return _.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class U{constructor(_,g){this.key=_,this.negated=g,this.type=3}static create(_,g=null){const O=M.get(_);return typeof O=="boolean"?O?S.INSTANCE:w.INSTANCE:new U(_,g)}cmp(_){return _.type!==this.type?this.type-_.type:L(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=M.get(this.key);return typeof _=="boolean"?_?S.INSTANCE:w.INSTANCE:this}evaluate(_){return!_.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function K(W,_){if(typeof W=="string"){const g=parseFloat(W);isNaN(g)||(W=g)}return typeof W=="string"||typeof W=="number"?_(W):S.INSTANCE}class D{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=12}static create(_,g,O=null){return K(g,Y=>new D(_,Y,O))}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=z.create(this.key,this.value,this)),this.negated}}class A{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=13}static create(_,g,O=null){return K(g,Y=>new A(_,Y,O))}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=P.create(this.key,this.value,this)),this.negated}}class P{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=14}static create(_,g,O=null){return K(g,Y=>new P(_,Y,O))}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class z{constructor(_,g,O){this.key=_,this.value=g,this.negated=O,this.type=15}static create(_,g,O=null){return K(g,Y=>new z(_,Y,O))}cmp(_){return _.type!==this.type?this.type-_.type:V(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class se{constructor(_,g){this.key=_,this.regexp=g,this.type=7,this.negated=null}static create(_,g){return new se(_,g)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const g=this.regexp?this.regexp.source:"",O=_.regexp?_.regexp.source:"";return g<O?-1:g>O?1:0}equals(_){if(_.type===this.type){const g=this.regexp?this.regexp.source:"",O=_.regexp?_.regexp.source:"";return this.key===_.key&&g===O}return!1}substituteConstants(){return this}evaluate(_){let g=_.getValue(this.key);return this.regexp?this.regexp.test(g):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ae.create(this)),this.negated}}class ae{constructor(_){this._actual=_,this.type=8}static create(_){return new ae(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ne(W){let _=null;for(let g=0,O=W.length;g<O;g++){const Y=W[g].substituteConstants();if(W[g]!==Y&&_===null){_=[];for(let Pe=0;Pe<g;Pe++)_[Pe]=W[Pe]}_!==null&&(_[g]=Y)}return _===null?W:_}class Q{constructor(_,g){this.expr=_,this.negated=g,this.type=6}static create(_,g){return Q._normalizeArr(_,g)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let g=0,O=this.expr.length;g<O;g++){const Y=l(this.expr[g],_.expr[g]);if(Y!==0)return Y}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let g=0,O=this.expr.length;g<O;g++)if(!this.expr[g].equals(_.expr[g]))return!1;return!0}return!1}substituteConstants(){const _=ne(this.expr);return _===this.expr?this:Q.create(_,this.negated)}evaluate(_){for(let g=0,O=this.expr.length;g<O;g++)if(!this.expr[g].evaluate(_))return!1;return!0}static _normalizeArr(_,g){const O=[];let Y=!1;for(const Pe of _)if(Pe){if(Pe.type===1){Y=!0;continue}if(Pe.type===0)return S.INSTANCE;if(Pe.type===6){O.push(...Pe.expr);continue}O.push(Pe)}if(O.length===0&&Y)return w.INSTANCE;if(O.length!==0){if(O.length===1)return O[0];O.sort(l);for(let Pe=1;Pe<O.length;Pe++)O[Pe-1].equals(O[Pe])&&(O.splice(Pe,1),Pe--);if(O.length===1)return O[0];for(;O.length>1;){const Pe=O[O.length-1];if(Pe.type!==9)break;O.pop();const Me=O.pop(),Xe=O.length===0,Ye=ye.create(Pe.expr.map(Tt=>Q.create([Tt,Me],null)),null,Xe);Ye&&(O.push(Ye),O.sort(l))}return O.length===1?O[0]:new Q(O,g)}}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let g of this.expr)_.push(...g.keys());return _}negate(){if(!this.negated){const _=[];for(let g of this.expr)_.push(g.negate());this.negated=ye.create(_,this,!0)}return this.negated}}class ye{constructor(_,g){this.expr=_,this.negated=g,this.type=9}static create(_,g,O){return ye._normalizeArr(_,g,O)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let g=0,O=this.expr.length;g<O;g++){const Y=l(this.expr[g],_.expr[g]);if(Y!==0)return Y}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let g=0,O=this.expr.length;g<O;g++)if(!this.expr[g].equals(_.expr[g]))return!1;return!0}return!1}substituteConstants(){const _=ne(this.expr);return _===this.expr?this:ye.create(_,this.negated,!1)}evaluate(_){for(let g=0,O=this.expr.length;g<O;g++)if(this.expr[g].evaluate(_))return!0;return!1}static _normalizeArr(_,g,O){let Y=[],Pe=!1;if(_){for(let Me=0,Xe=_.length;Me<Xe;Me++){const Ye=_[Me];if(Ye){if(Ye.type===0){Pe=!0;continue}if(Ye.type===1)return w.INSTANCE;if(Ye.type===9){Y=Y.concat(Ye.expr);continue}Y.push(Ye)}}if(Y.length===0&&Pe)return S.INSTANCE;Y.sort(l)}if(Y.length!==0){if(Y.length===1)return Y[0];for(let Me=1;Me<Y.length;Me++)Y[Me-1].equals(Y[Me])&&(Y.splice(Me,1),Me--);if(Y.length===1)return Y[0];if(O){for(let Me=0;Me<Y.length;Me++)for(let Xe=Me+1;Xe<Y.length;Xe++)$(Y[Me],Y[Xe])&&(Y.splice(Xe,1),Xe--);if(Y.length===1)return Y[0]}return new ye(Y,g)}}serialize(){return this.expr.map(_=>_.serialize()).join(" || ")}keys(){const _=[];for(let g of this.expr)_.push(...g.keys());return _}negate(){if(!this.negated){let _=[];for(let g of this.expr)_.push(g.negate());for(;_.length>1;){const g=_.shift(),O=_.shift(),Y=[];for(const Me of H(g))for(const Xe of H(O))Y.push(Q.create([Me,Xe],null));const Pe=_.length===0;_.unshift(ye.create(Y,null,Pe))}this.negated=_[0]}return this.negated}}class ce extends d{constructor(_,g,O){super(_,null),this._defaultValue=g,typeof O=="object"?ce._info.push(Object.assign(Object.assign({},O),{key:_})):O!==!0&&ce._info.push({key:_,description:O,type:g!=null?typeof g:void 0})}static all(){return ce._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return m.create(this.key,_)}}ce._info=[];const Oe=(0,De.yh)("contextKeyService"),Z="setContext";function L(W,_){return W<_?-1:W>_?1:0}function V(W,_,g,O){return W<g?-1:W>g?1:_<O?-1:_>O?1:0}function $(W,_){if(_.type===6&&W.type!==9&&W.type!==6){for(const Y of _.expr)if(W.equals(Y))return!0}const g=W.negate(),O=H(g).concat(H(_));O.sort(l);for(let Y=0;Y<O.length;Y++){const Me=O[Y].negate();for(let Xe=Y+1;Xe<O.length;Xe++){const Ye=O[Xe];if(Me.equals(Ye))return!0}}return!1}function H(W){return W.type===9?W.expr:[W]}},16925:function(vn,St,C){"use strict";C.d(St,{I8:function(){return T},TG:function(){return de},jt:function(){return M},yh:function(){return re}});var T;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function fe(ie){return ie[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=fe})(T||(T={}));const de=re("instantiationService");function De(p,fe,ie,l){fe[T.DI_TARGET]===fe?fe[T.DI_DEPENDENCIES].push({id:p,index:ie,optional:l}):(fe[T.DI_DEPENDENCIES]=[{id:p,index:ie,optional:l}],fe[T.DI_TARGET]=fe)}function re(p){if(T.serviceIds.has(p))return T.serviceIds.get(p);const fe=function(ie,l,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");De(fe,ie,S,!1)};return fe.toString=()=>p,T.serviceIds.set(p,fe),fe}function M(p){return function(fe,ie,l){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");De(p,fe,l,!0)}}},44650:function(vn,St,C){"use strict";C.d(St,{B:function(){return re}});var T=C(76068),de=C(72999);class De{constructor(){this.data=new Map}add(p,fe){T.ok(de.HD(p)),T.ok(de.Kn(fe)),T.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,fe)}as(p){return this.data.get(p)||null}}const re=new De},66213:function(vn,St,C){"use strict";C.d(St,{e:function(){return T}});var T;(function(de){de.DARK="dark",de.LIGHT="light",de.HIGH_CONTRAST="hc"})(T||(T={}))},49055:function(vn,St,C){"use strict";C.d(St,{EN:function(){return l},IP:function(){return d},Ic:function(){return x},XE:function(){return fe},bB:function(){return N},kS:function(){return S},m6:function(){return w}});var T=C(52615),de=C(4348),De=C(69323),re=C(16925),M=C(44650),p=C(66213);const fe=(0,re.yh)("themeService");var ie;(function(U){function K(D){return D&&typeof D=="object"&&typeof D.id=="string"}U.isThemeColor=K})(ie||(ie={}));function l(U){return{id:U}}var S;(function(U){function K(ae){return ae&&typeof ae=="object"&&typeof ae.id=="string"&&(typeof ae.color=="undefined"||ie.isThemeColor(ae.color))}U.isThemeIcon=K;const D=new RegExp(`^\\$\\((${T.dT.iconNameExpression}(?:${T.dT.iconModifierExpression})?)\\)$`);function A(ae){const ne=D.exec(ae);if(!ne)return;let[,Q]=ne;return{id:Q}}U.fromString=A;function P(ae,ne){let Q=ae.id;const ye=Q.lastIndexOf("~");return ye!==-1&&(Q=Q.substring(0,ye)),ne&&(Q=`${Q}~${ne}`),{id:Q}}U.modify=P;function z(ae,ne){var Q,ye;return ae.id===ne.id&&((Q=ae.color)===null||Q===void 0?void 0:Q.id)===((ye=ne.color)===null||ye===void 0?void 0:ye.id)}U.isEqual=z;function se(ae,ne){return{id:ae.id,color:ne?l(ne):void 0}}U.asThemeIcon=se,U.asClassNameArray=T.dT.asClassNameArray,U.asClassName=T.dT.asClassName,U.asCSSSelector=T.dT.asCSSSelector})(S||(S={}));function w(U){switch(U){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new de.Q5}onColorThemeChange(K){return this.themingParticipants.push(K),this.onThemingParticipantAddedEmitter.fire(K),(0,De.OF)(()=>{const D=this.themingParticipants.indexOf(K);this.themingParticipants.splice(D,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new m;M.B.add(d.ThemingContribution,y);function x(U){return y.onColorThemeChange(U)}class N extends De.JT{constructor(K){super(),this.themeService=K,this.theme=K.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(D=>this.onThemeChange(D)))}onThemeChange(K){this.theme=K,this.updateStyles()}updateStyles(){}}},66003:function(vn,St,C){"use strict";C.d(St,{Z:function(){return fe}});var T=C(39224),de=C(89490),De=C(28788),re=C(59301),M=["show"];function p(ie,l){if(!l.max)return!0;var S=l.strategy(ie);return S<=l.max}function fe(ie,l){return re.useMemo(function(){var S={};l&&(S.show=(0,De.Z)(l)==="object"&&l.formatter?l.formatter:!!l),S=(0,de.Z)((0,de.Z)({},S),ie);var w=S,d=w.show,m=(0,T.Z)(w,M);return(0,de.Z)((0,de.Z)({},m),{},{show:!!d,showFormatter:typeof d=="function"?d:void 0,strategy:m.strategy||function(y){return y.length}})},[ie,l])}},36901:function(vn,St,C){"use strict";C.r(St),C.d(St,{BaseInput:function(){return S},default:function(){return A}});var T=C(89490),de=C(71409),De=C(87075),re=C(28788),M=C(92310),p=C.n(M),fe=C(59301),ie=C(30292),l=fe.forwardRef(function(P,z){var se,ae,ne,Q=P.inputElement,ye=P.children,ce=P.prefixCls,Oe=P.prefix,Z=P.suffix,L=P.addonBefore,V=P.addonAfter,$=P.className,H=P.style,W=P.disabled,_=P.readOnly,g=P.focused,O=P.triggerFocus,Y=P.allowClear,Pe=P.value,Me=P.handleReset,Xe=P.hidden,Ye=P.classes,Tt=P.classNames,gt=P.dataAttrs,Le=P.styles,Je=P.components,Et=P.onClear,ot=ye!=null?ye:Q,rn=(Je==null?void 0:Je.affixWrapper)||"span",Ze=(Je==null?void 0:Je.groupWrapper)||"span",ge=(Je==null?void 0:Je.wrapper)||"span",le=(Je==null?void 0:Je.groupAddon)||"span",G=(0,fe.useRef)(null),be=function(Pt){var xt;(xt=G.current)!==null&&xt!==void 0&&xt.contains(Pt.target)&&(O==null||O())},ke=(0,ie.X3)(P),Ne=(0,fe.cloneElement)(ot,{value:Pe,className:p()((se=ot.props)===null||se===void 0?void 0:se.className,!ke&&(Tt==null?void 0:Tt.variant))||null}),k=(0,fe.useRef)(null);if(fe.useImperativeHandle(z,function(){return{nativeElement:k.current||G.current}}),ke){var F=null;if(Y){var ee=!W&&!_&&Pe,oe="".concat(ce,"-clear-icon"),J=(0,re.Z)(Y)==="object"&&Y!==null&&Y!==void 0&&Y.clearIcon?Y.clearIcon:"\u2716";F=fe.createElement("button",{type:"button",tabIndex:-1,onClick:function(Pt){Me==null||Me(Pt),Et==null||Et()},onMouseDown:function(Pt){return Pt.preventDefault()},className:p()(oe,(0,De.Z)((0,De.Z)({},"".concat(oe,"-hidden"),!ee),"".concat(oe,"-has-suffix"),!!Z))},J)}var me="".concat(ce,"-affix-wrapper"),Te=p()(me,(0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)({},"".concat(ce,"-disabled"),W),"".concat(me,"-disabled"),W),"".concat(me,"-focused"),g),"".concat(me,"-readonly"),_),"".concat(me,"-input-with-clear-btn"),Z&&Y&&Pe),Ye==null?void 0:Ye.affixWrapper,Tt==null?void 0:Tt.affixWrapper,Tt==null?void 0:Tt.variant),pe=(Z||Y)&&fe.createElement("span",{className:p()("".concat(ce,"-suffix"),Tt==null?void 0:Tt.suffix),style:Le==null?void 0:Le.suffix},F,Z);Ne=fe.createElement(rn,(0,de.Z)({className:Te,style:Le==null?void 0:Le.affixWrapper,onClick:be},gt==null?void 0:gt.affixWrapper,{ref:G}),Oe&&fe.createElement("span",{className:p()("".concat(ce,"-prefix"),Tt==null?void 0:Tt.prefix),style:Le==null?void 0:Le.prefix},Oe),Ne,pe)}if((0,ie.He)(P)){var _e="".concat(ce,"-group"),Ce="".concat(_e,"-addon"),Ge="".concat(_e,"-wrapper"),He=p()("".concat(ce,"-wrapper"),_e,Ye==null?void 0:Ye.wrapper,Tt==null?void 0:Tt.wrapper),et=p()(Ge,(0,De.Z)({},"".concat(Ge,"-disabled"),W),Ye==null?void 0:Ye.group,Tt==null?void 0:Tt.groupWrapper);Ne=fe.createElement(Ze,{className:et,ref:k},fe.createElement(ge,{className:He},L&&fe.createElement(le,{className:Ce},L),Ne,V&&fe.createElement(le,{className:Ce},V)))}return fe.cloneElement(Ne,{className:p()((ae=Ne.props)===null||ae===void 0?void 0:ae.className,$)||null,style:(0,T.Z)((0,T.Z)({},(ne=Ne.props)===null||ne===void 0?void 0:ne.style),H),hidden:Xe})}),S=l,w=C(62730),d=C(11036),m=C(39224),y=C(18929),x=C(2738),N=C(66003),U=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],K=(0,fe.forwardRef)(function(P,z){var se=P.autoComplete,ae=P.onChange,ne=P.onFocus,Q=P.onBlur,ye=P.onPressEnter,ce=P.onKeyDown,Oe=P.onKeyUp,Z=P.prefixCls,L=Z===void 0?"rc-input":Z,V=P.disabled,$=P.htmlSize,H=P.className,W=P.maxLength,_=P.suffix,g=P.showCount,O=P.count,Y=P.type,Pe=Y===void 0?"text":Y,Me=P.classes,Xe=P.classNames,Ye=P.styles,Tt=P.onCompositionStart,gt=P.onCompositionEnd,Le=(0,m.Z)(P,U),Je=(0,fe.useState)(!1),Et=(0,d.Z)(Je,2),ot=Et[0],rn=Et[1],Ze=(0,fe.useRef)(!1),ge=(0,fe.useRef)(!1),le=(0,fe.useRef)(null),G=(0,fe.useRef)(null),be=function(Qt){le.current&&(0,ie.nH)(le.current,Qt)},ke=(0,y.Z)(P.defaultValue,{value:P.value}),Ne=(0,d.Z)(ke,2),k=Ne[0],F=Ne[1],ee=k==null?"":String(k),oe=(0,fe.useState)(null),J=(0,d.Z)(oe,2),me=J[0],Te=J[1],pe=(0,N.Z)(O,g),_e=pe.max||W,Ce=pe.strategy(ee),Ge=!!_e&&Ce>_e;(0,fe.useImperativeHandle)(z,function(){var At;return{focus:be,blur:function(){var Re;(Re=le.current)===null||Re===void 0||Re.blur()},setSelectionRange:function(Re,xe,Ae){var B;(B=le.current)===null||B===void 0||B.setSelectionRange(Re,xe,Ae)},select:function(){var Re;(Re=le.current)===null||Re===void 0||Re.select()},input:le.current,nativeElement:((At=G.current)===null||At===void 0?void 0:At.nativeElement)||le.current}}),(0,fe.useEffect)(function(){ge.current&&(ge.current=!1),rn(function(At){return At&&V?!1:At})},[V]);var He=function(Qt,Re,xe){var Ae=Re;if(!Ze.current&&pe.exceedFormatter&&pe.max&&pe.strategy(Re)>pe.max){if(Ae=pe.exceedFormatter(Re,{max:pe.max}),Re!==Ae){var B,j;Te([((B=le.current)===null||B===void 0?void 0:B.selectionStart)||0,((j=le.current)===null||j===void 0?void 0:j.selectionEnd)||0])}}else if(xe.source==="compositionEnd")return;F(Ae),le.current&&(0,ie.rJ)(le.current,Qt,ae,Ae)};(0,fe.useEffect)(function(){if(me){var At;(At=le.current)===null||At===void 0||At.setSelectionRange.apply(At,(0,w.Z)(me))}},[me]);var et=function(Qt){He(Qt,Qt.target.value,{source:"change"})},lt=function(Qt){Ze.current=!1,He(Qt,Qt.currentTarget.value,{source:"compositionEnd"}),gt==null||gt(Qt)},Pt=function(Qt){ye&&Qt.key==="Enter"&&!ge.current&&(ge.current=!0,ye(Qt)),ce==null||ce(Qt)},xt=function(Qt){Qt.key==="Enter"&&(ge.current=!1),Oe==null||Oe(Qt)},ut=function(Qt){rn(!0),ne==null||ne(Qt)},Gt=function(Qt){ge.current&&(ge.current=!1),rn(!1),Q==null||Q(Qt)},an=function(Qt){F(""),be(),le.current&&(0,ie.rJ)(le.current,Qt,ae)},Ct=Ge&&"".concat(L,"-out-of-range"),un=function(){var Qt=(0,x.Z)(P,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return fe.createElement("input",(0,de.Z)({autoComplete:se},Qt,{onChange:et,onFocus:ut,onBlur:Gt,onKeyDown:Pt,onKeyUp:xt,className:p()(L,(0,De.Z)({},"".concat(L,"-disabled"),V),Xe==null?void 0:Xe.input),style:Ye==null?void 0:Ye.input,ref:le,size:$,type:Pe,onCompositionStart:function(xe){Ze.current=!0,Tt==null||Tt(xe)},onCompositionEnd:lt}))},Nn=function(){var Qt=Number(_e)>0;if(_||pe.show){var Re=pe.showFormatter?pe.showFormatter({value:ee,count:Ce,maxLength:_e}):"".concat(Ce).concat(Qt?" / ".concat(_e):"");return fe.createElement(fe.Fragment,null,pe.show&&fe.createElement("span",{className:p()("".concat(L,"-show-count-suffix"),(0,De.Z)({},"".concat(L,"-show-count-has-suffix"),!!_),Xe==null?void 0:Xe.count),style:(0,T.Z)({},Ye==null?void 0:Ye.count)},Re),_)}return null};return fe.createElement(S,(0,de.Z)({},Le,{prefixCls:L,className:p()(H,Ct),handleReset:an,value:ee,focused:ot,triggerFocus:be,suffix:Nn(),disabled:V,classes:Me,classNames:Xe,styles:Ye}),un())}),D=K,A=D},30292:function(vn,St,C){"use strict";C.d(St,{He:function(){return T},X3:function(){return de},nH:function(){return M},rJ:function(){return re}});function T(p){return!!(p.addonBefore||p.addonAfter)}function de(p){return!!(p.prefix||p.suffix||p.allowClear)}function De(p,fe,ie){var l=fe.cloneNode(!0),S=Object.create(p,{target:{value:l},currentTarget:{value:l}});return l.value=ie,typeof fe.selectionStart=="number"&&typeof fe.selectionEnd=="number"&&(l.selectionStart=fe.selectionStart,l.selectionEnd=fe.selectionEnd),l.setSelectionRange=function(){fe.setSelectionRange.apply(fe,arguments)},S}function re(p,fe,ie,l){if(ie){var S=fe;if(fe.type==="click"){S=De(fe,p,""),ie(S);return}if(p.type!=="file"&&l!==void 0){S=De(fe,p,l),ie(S);return}ie(S)}}function M(p,fe){if(p){p.focus(fe);var ie=fe||{},l=ie.cursor;if(l){var S=p.value.length;switch(l){case"start":p.setSelectionRange(0,0);break;case"end":p.setSelectionRange(S,S);break;default:p.setSelectionRange(0,S)}}}}},28321:function(vn,St,C){"use strict";C.d(St,{iz:function(){return Se},ck:function(){return Ae},BW:function(){return tt},sN:function(){return Ae},Wd:function(){return zn},ZP:function(){return wt},Xl:function(){return ye}});var T=C(71409),de=C(87075),De=C(89490),re=C(62730),M=C(11036),p=C(39224),fe=C(92310),ie=C.n(fe),l=C(11780),S=C(18929),w=C(13697),d=C(48736),m=C(59301),y=C(4676),x=m.createContext(null);function N(he,Ie){return he===void 0?null:"".concat(he,"-").concat(Ie)}function U(he){var Ie=m.useContext(x);return N(Ie,he)}var K=C(80547),D=["children","locked"],A=m.createContext(null);function P(he,Ie){var Fe=(0,De.Z)({},he);return Object.keys(Ie).forEach(function(Ue){var it=Ie[Ue];it!==void 0&&(Fe[Ue]=it)}),Fe}function z(he){var Ie=he.children,Fe=he.locked,Ue=(0,p.Z)(he,D),it=m.useContext(A),at=(0,K.Z)(function(){return P(it,Ue)},[it,Ue],function(qe,yt){return!Fe&&(qe[0]!==yt[0]||!(0,w.Z)(qe[1],yt[1],!0))});return m.createElement(A.Provider,{value:at},Ie)}var se=[],ae=m.createContext(null);function ne(){return m.useContext(ae)}var Q=m.createContext(se);function ye(he){var Ie=m.useContext(Q);return m.useMemo(function(){return he!==void 0?[].concat((0,re.Z)(Ie),[he]):Ie},[Ie,he])}var ce=m.createContext(null),Oe=m.createContext({}),Z=Oe,L=C(29194);function V(he){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,L.Z)(he)){var Fe=he.nodeName.toLowerCase(),Ue=["input","select","textarea","button"].includes(Fe)||he.isContentEditable||Fe==="a"&&!!he.getAttribute("href"),it=he.getAttribute("tabindex"),at=Number(it),qe=null;return it&&!Number.isNaN(at)?qe=at:Ue&&qe===null&&(qe=0),Ue&&he.disabled&&(qe=null),qe!==null&&(qe>=0||Ie&&qe<0)}return!1}function $(he){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=(0,re.Z)(he.querySelectorAll("*")).filter(function(Ue){return V(Ue,Ie)});return V(he,Ie)&&Fe.unshift(he),Fe}var H=null;function W(){H=document.activeElement}function _(){H=null}function g(){if(H)try{H.focus()}catch(he){}}function O(he,Ie){if(Ie.keyCode===9){var Fe=$(he),Ue=Fe[Ie.shiftKey?0:Fe.length-1],it=Ue===document.activeElement||he===document.activeElement;if(it){var at=Fe[Ie.shiftKey?Fe.length-1:0];at.focus(),Ie.preventDefault()}}}var Y=C(10228),Pe=C(16089),Me=Y.Z.LEFT,Xe=Y.Z.RIGHT,Ye=Y.Z.UP,Tt=Y.Z.DOWN,gt=Y.Z.ENTER,Le=Y.Z.ESC,Je=Y.Z.HOME,Et=Y.Z.END,ot=[Ye,Tt,Me,Xe];function rn(he,Ie,Fe,Ue){var it,at="prev",qe="next",yt="children",Dt="parent";if(he==="inline"&&Ue===gt)return{inlineTrigger:!0};var kt=(0,de.Z)((0,de.Z)({},Ye,at),Tt,qe),qt=(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},Me,Fe?qe:at),Xe,Fe?at:qe),Tt,yt),gt,yt),Lt=(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},Ye,at),Tt,qe),gt,yt),Le,Dt),Me,Fe?yt:Dt),Xe,Fe?Dt:yt),nn={inline:kt,horizontal:qt,vertical:Lt,inlineSub:kt,horizontalSub:Lt,verticalSub:Lt},cn=(it=nn["".concat(he).concat(Ie?"":"Sub")])===null||it===void 0?void 0:it[Ue];switch(cn){case at:return{offset:-1,sibling:!0};case qe:return{offset:1,sibling:!0};case Dt:return{offset:-1,sibling:!1};case yt:return{offset:1,sibling:!1};default:return null}}function Ze(he){for(var Ie=he;Ie;){if(Ie.getAttribute("data-menu-list"))return Ie;Ie=Ie.parentElement}return null}function ge(he,Ie){for(var Fe=he||document.activeElement;Fe;){if(Ie.has(Fe))return Fe;Fe=Fe.parentElement}return null}function le(he,Ie){var Fe=$(he,!0);return Fe.filter(function(Ue){return Ie.has(Ue)})}function G(he,Ie,Fe){var Ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!he)return null;var it=le(he,Ie),at=it.length,qe=it.findIndex(function(yt){return Fe===yt});return Ue<0?qe===-1?qe=at-1:qe-=1:Ue>0&&(qe+=1),qe=(qe+at)%at,it[qe]}var be=function(Ie,Fe){var Ue=new Set,it=new Map,at=new Map;return Ie.forEach(function(qe){var yt=document.querySelector("[data-menu-id='".concat(N(Fe,qe),"']"));yt&&(Ue.add(yt),at.set(yt,qe),it.set(qe,yt))}),{elements:Ue,key2element:it,element2key:at}};function ke(he,Ie,Fe,Ue,it,at,qe,yt,Dt,kt){var qt=m.useRef(),Lt=m.useRef();Lt.current=Ie;var nn=function(){Pe.Z.cancel(qt.current)};return m.useEffect(function(){return function(){nn()}},[]),function(cn){var ln=cn.which;if([].concat(ot,[gt,Le,Je,Et]).includes(ln)){var Xt=at(),jt=be(Xt,Ue),dn=jt,Rt=dn.elements,Nt=dn.key2element,Kt=dn.element2key,pn=Nt.get(Ie),Jt=ge(pn,Rt),fn=Kt.get(Jt),An=rn(he,qe(fn,!0).length===1,Fe,ln);if(!An&&ln!==Je&&ln!==Et)return;(ot.includes(ln)||[Je,Et].includes(ln))&&cn.preventDefault();var Pn=function(on){if(on){var bt=on,mt=on.querySelector("a");mt!=null&&mt.getAttribute("href")&&(bt=mt);var Ht=Kt.get(on);yt(Ht),nn(),qt.current=(0,Pe.Z)(function(){Lt.current===Ht&&bt.focus()})}};if([Je,Et].includes(ln)||An.sibling||!Jt){var ni;!Jt||he==="inline"?ni=it.current:ni=Ze(Jt);var Fn,On=le(ni,Rt);ln===Je?Fn=On[0]:ln===Et?Fn=On[On.length-1]:Fn=G(ni,Rt,Jt,An.offset),Pn(Fn)}else if(An.inlineTrigger)Dt(fn);else if(An.offset>0)Dt(fn,!0),nn(),qt.current=(0,Pe.Z)(function(){jt=be(Xt,Ue);var Yn=Jt.getAttribute("aria-controls"),on=document.getElementById(Yn),bt=G(on,jt.elements);Pn(bt)},5);else if(An.offset<0){var Zn=qe(fn,!0),ai=Zn[Zn.length-2],qn=Nt.get(ai);Dt(ai,!1),Pn(qn)}}kt==null||kt(cn)}}function Ne(he){Promise.resolve().then(he)}var k="__RC_UTIL_PATH_SPLIT__",F=function(Ie){return Ie.join(k)},ee=function(Ie){return Ie.split(k)},oe="rc-menu-more";function J(){var he=m.useState({}),Ie=(0,M.Z)(he,2),Fe=Ie[1],Ue=(0,m.useRef)(new Map),it=(0,m.useRef)(new Map),at=m.useState([]),qe=(0,M.Z)(at,2),yt=qe[0],Dt=qe[1],kt=(0,m.useRef)(0),qt=(0,m.useRef)(!1),Lt=function(){qt.current||Fe({})},nn=(0,m.useCallback)(function(Nt,Kt){var pn=F(Kt);it.current.set(pn,Nt),Ue.current.set(Nt,pn),kt.current+=1;var Jt=kt.current;Ne(function(){Jt===kt.current&&Lt()})},[]),cn=(0,m.useCallback)(function(Nt,Kt){var pn=F(Kt);it.current.delete(pn),Ue.current.delete(Nt)},[]),ln=(0,m.useCallback)(function(Nt){Dt(Nt)},[]),Xt=(0,m.useCallback)(function(Nt,Kt){var pn=Ue.current.get(Nt)||"",Jt=ee(pn);return Kt&&yt.includes(Jt[0])&&Jt.unshift(oe),Jt},[yt]),jt=(0,m.useCallback)(function(Nt,Kt){return Nt.filter(function(pn){return pn!==void 0}).some(function(pn){var Jt=Xt(pn,!0);return Jt.includes(Kt)})},[Xt]),dn=function(){var Kt=(0,re.Z)(Ue.current.keys());return yt.length&&Kt.push(oe),Kt},Rt=(0,m.useCallback)(function(Nt){var Kt="".concat(Ue.current.get(Nt)).concat(k),pn=new Set;return(0,re.Z)(it.current.keys()).forEach(function(Jt){Jt.startsWith(Kt)&&pn.add(it.current.get(Jt))}),pn},[]);return m.useEffect(function(){return function(){qt.current=!0}},[]),{registerPath:nn,unregisterPath:cn,refreshOverflowKeys:ln,isSubPathKey:jt,getKeyPath:Xt,getKeys:dn,getSubPathKeys:Rt}}function me(he){var Ie=m.useRef(he);Ie.current=he;var Fe=m.useCallback(function(){for(var Ue,it=arguments.length,at=new Array(it),qe=0;qe<it;qe++)at[qe]=arguments[qe];return(Ue=Ie.current)===null||Ue===void 0?void 0:Ue.call.apply(Ue,[Ie].concat(at))},[]);return he?Fe:void 0}var Te=Math.random().toFixed(5).toString().slice(2),pe=0;function _e(he){var Ie=(0,S.Z)(he,{value:he}),Fe=(0,M.Z)(Ie,2),Ue=Fe[0],it=Fe[1];return m.useEffect(function(){pe+=1;var at="".concat(Te,"-").concat(pe);it("rc-menu-uuid-".concat(at))},[]),Ue}var Ce=C(16552),Ge=C(19210),He=C(46654),et=C(37205),lt=C(2738),Pt=C(8654);function xt(he,Ie,Fe,Ue){var it=m.useContext(A),at=it.activeKey,qe=it.onActive,yt=it.onInactive,Dt={active:at===he};return Ie||(Dt.onMouseEnter=function(kt){Fe==null||Fe({key:he,domEvent:kt}),qe(he)},Dt.onMouseLeave=function(kt){Ue==null||Ue({key:he,domEvent:kt}),yt(he)}),Dt}function ut(he){var Ie=m.useContext(A),Fe=Ie.mode,Ue=Ie.rtl,it=Ie.inlineIndent;if(Fe!=="inline")return null;var at=he;return Ue?{paddingRight:at*it}:{paddingLeft:at*it}}function Gt(he){var Ie=he.icon,Fe=he.props,Ue=he.children,it;return Ie===null||Ie===!1?null:(typeof Ie=="function"?it=m.createElement(Ie,(0,De.Z)({},Fe)):typeof Ie!="boolean"&&(it=Ie),it||Ue||null)}var an=["item"];function Ct(he){var Ie=he.item,Fe=(0,p.Z)(he,an);return Object.defineProperty(Fe,"item",{get:function(){return(0,d.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ie}}),Fe}var un=["title","attribute","elementRef"],Nn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],At=["active"],Qt=function(he){(0,He.Z)(Fe,he);var Ie=(0,et.Z)(Fe);function Fe(){return(0,Ce.Z)(this,Fe),Ie.apply(this,arguments)}return(0,Ge.Z)(Fe,[{key:"render",value:function(){var it=this.props,at=it.title,qe=it.attribute,yt=it.elementRef,Dt=(0,p.Z)(it,un),kt=(0,lt.Z)(Dt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,d.ZP)(!qe,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),m.createElement(l.Z.Item,(0,T.Z)({},qe,{title:typeof at=="string"?at:void 0},kt,{ref:yt}))}}]),Fe}(m.Component),Re=m.forwardRef(function(he,Ie){var Fe=he.style,Ue=he.className,it=he.eventKey,at=he.warnKey,qe=he.disabled,yt=he.itemIcon,Dt=he.children,kt=he.role,qt=he.onMouseEnter,Lt=he.onMouseLeave,nn=he.onClick,cn=he.onKeyDown,ln=he.onFocus,Xt=(0,p.Z)(he,Nn),jt=U(it),dn=m.useContext(A),Rt=dn.prefixCls,Nt=dn.onItemClick,Kt=dn.disabled,pn=dn.overflowDisabled,Jt=dn.itemIcon,fn=dn.selectedKeys,An=dn.onActive,Pn=m.useContext(Z),ni=Pn._internalRenderMenuItem,Fn="".concat(Rt,"-item"),On=m.useRef(),Zn=m.useRef(),ai=Kt||qe,qn=(0,Pt.x1)(Ie,Zn),Yn=ye(it),on=function(In){return{key:it,keyPath:(0,re.Z)(Yn).reverse(),item:On.current,domEvent:In}},bt=yt||Jt,mt=xt(it,ai,qt,Lt),Ht=mt.active,Wt=(0,p.Z)(mt,At),hn=fn.includes(it),Gn=ut(Yn.length),Vn=function(In){if(!ai){var Li=on(In);nn==null||nn(Ct(Li)),Nt(Li)}},Mn=function(In){if(cn==null||cn(In),In.which===Y.Z.ENTER){var Li=on(In);nn==null||nn(Ct(Li)),Nt(Li)}},ri=function(In){An(it),ln==null||ln(In)},ci={};he.role==="option"&&(ci["aria-selected"]=hn);var yi=m.createElement(Qt,(0,T.Z)({ref:On,elementRef:qn,role:kt===null?"none":kt||"menuitem",tabIndex:qe?null:-1,"data-menu-id":pn&&jt?null:jt},(0,lt.Z)(Xt,["extra"]),Wt,ci,{component:"li","aria-disabled":qe,style:(0,De.Z)((0,De.Z)({},Gn),Fe),className:ie()(Fn,(0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(Fn,"-active"),Ht),"".concat(Fn,"-selected"),hn),"".concat(Fn,"-disabled"),ai),Ue),onClick:Vn,onKeyDown:Mn,onFocus:ri}),Dt,m.createElement(Gt,{props:(0,De.Z)((0,De.Z)({},he),{},{isSelected:hn}),icon:bt}));return ni&&(yi=ni(yi,he,{selected:hn})),yi});function xe(he,Ie){var Fe=he.eventKey,Ue=ne(),it=ye(Fe);return m.useEffect(function(){if(Ue)return Ue.registerPath(Fe,it),function(){Ue.unregisterPath(Fe,it)}},[it]),Ue?null:m.createElement(Re,(0,T.Z)({},he,{ref:Ie}))}var Ae=m.forwardRef(xe),B=["className","children"],j=function(Ie,Fe){var Ue=Ie.className,it=Ie.children,at=(0,p.Z)(Ie,B),qe=m.useContext(A),yt=qe.prefixCls,Dt=qe.mode,kt=qe.rtl;return m.createElement("ul",(0,T.Z)({className:ie()(yt,kt&&"".concat(yt,"-rtl"),"".concat(yt,"-sub"),"".concat(yt,"-").concat(Dt==="inline"?"inline":"vertical"),Ue),role:"menu"},at,{"data-menu-list":!0,ref:Fe}),it)},te=m.forwardRef(j);te.displayName="SubMenuList";var q=te,we=C(11592);function vt(he,Ie){return(0,we.Z)(he).map(function(Fe,Ue){if(m.isValidElement(Fe)){var it,at,qe=Fe.key,yt=(it=(at=Fe.props)===null||at===void 0?void 0:at.eventKey)!==null&&it!==void 0?it:qe,Dt=yt==null;Dt&&(yt="tmp_key-".concat([].concat((0,re.Z)(Ie),[Ue]).join("-")));var kt={key:yt,eventKey:yt};return m.cloneElement(Fe,kt)}return Fe})}var st=C(65352),ft={adjustX:1,adjustY:1},Mt={topLeft:{points:["bl","tl"],overflow:ft},topRight:{points:["br","tr"],overflow:ft},bottomLeft:{points:["tl","bl"],overflow:ft},bottomRight:{points:["tr","br"],overflow:ft},leftTop:{points:["tr","tl"],overflow:ft},leftBottom:{points:["br","bl"],overflow:ft},rightTop:{points:["tl","tr"],overflow:ft},rightBottom:{points:["bl","br"],overflow:ft}},Sn={topLeft:{points:["bl","tl"],overflow:ft},topRight:{points:["br","tr"],overflow:ft},bottomLeft:{points:["tl","bl"],overflow:ft},bottomRight:{points:["tr","br"],overflow:ft},rightTop:{points:["tr","tl"],overflow:ft},rightBottom:{points:["br","bl"],overflow:ft},leftTop:{points:["tl","tr"],overflow:ft},leftBottom:{points:["bl","br"],overflow:ft}},En=null;function Ft(he,Ie,Fe){if(Ie)return Ie;if(Fe)return Fe[he]||Fe.other}var Yt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function kn(he){var Ie=he.prefixCls,Fe=he.visible,Ue=he.children,it=he.popup,at=he.popupStyle,qe=he.popupClassName,yt=he.popupOffset,Dt=he.disabled,kt=he.mode,qt=he.onVisibleChange,Lt=m.useContext(A),nn=Lt.getPopupContainer,cn=Lt.rtl,ln=Lt.subMenuOpenDelay,Xt=Lt.subMenuCloseDelay,jt=Lt.builtinPlacements,dn=Lt.triggerSubMenuAction,Rt=Lt.forceSubMenuRender,Nt=Lt.rootClassName,Kt=Lt.motion,pn=Lt.defaultMotions,Jt=m.useState(!1),fn=(0,M.Z)(Jt,2),An=fn[0],Pn=fn[1],ni=cn?(0,De.Z)((0,De.Z)({},Sn),jt):(0,De.Z)((0,De.Z)({},Mt),jt),Fn=Yt[kt],On=Ft(kt,Kt,pn),Zn=m.useRef(On);kt!=="inline"&&(Zn.current=On);var ai=(0,De.Z)((0,De.Z)({},Zn.current),{},{leavedClassName:"".concat(Ie,"-hidden"),removeOnLeave:!1,motionAppear:!0}),qn=m.useRef();return m.useEffect(function(){return qn.current=(0,Pe.Z)(function(){Pn(Fe)}),function(){Pe.Z.cancel(qn.current)}},[Fe]),m.createElement(st.Z,{prefixCls:Ie,popupClassName:ie()("".concat(Ie,"-popup"),(0,de.Z)({},"".concat(Ie,"-rtl"),cn),qe,Nt),stretch:kt==="horizontal"?"minWidth":null,getPopupContainer:nn,builtinPlacements:ni,popupPlacement:Fn,popupVisible:An,popup:it,popupStyle:at,popupAlign:yt&&{offset:yt},action:Dt?[]:[dn],mouseEnterDelay:ln,mouseLeaveDelay:Xt,onPopupVisibleChange:qt,forceRender:Rt,popupMotion:ai,fresh:!0},Ue)}var $n=C(77900);function Rn(he){var Ie=he.id,Fe=he.open,Ue=he.keyPath,it=he.children,at="inline",qe=m.useContext(A),yt=qe.prefixCls,Dt=qe.forceSubMenuRender,kt=qe.motion,qt=qe.defaultMotions,Lt=qe.mode,nn=m.useRef(!1);nn.current=Lt===at;var cn=m.useState(!nn.current),ln=(0,M.Z)(cn,2),Xt=ln[0],jt=ln[1],dn=nn.current?Fe:!1;m.useEffect(function(){nn.current&&jt(!1)},[Lt]);var Rt=(0,De.Z)({},Ft(at,kt,qt));Ue.length>1&&(Rt.motionAppear=!1);var Nt=Rt.onVisibleChanged;return Rt.onVisibleChanged=function(Kt){return!nn.current&&!Kt&&jt(!0),Nt==null?void 0:Nt(Kt)},Xt?null:m.createElement(z,{mode:at,locked:!nn.current},m.createElement($n.default,(0,T.Z)({visible:dn},Rt,{forceRender:Dt,removeOnLeave:!1,leavedClassName:"".concat(yt,"-hidden")}),function(Kt){var pn=Kt.className,Jt=Kt.style;return m.createElement(q,{id:Ie,className:pn,style:Jt},it)}))}var Bn=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],xn=["active"],sn=m.forwardRef(function(he,Ie){var Fe=he.style,Ue=he.className,it=he.title,at=he.eventKey,qe=he.warnKey,yt=he.disabled,Dt=he.internalPopupClose,kt=he.children,qt=he.itemIcon,Lt=he.expandIcon,nn=he.popupClassName,cn=he.popupOffset,ln=he.popupStyle,Xt=he.onClick,jt=he.onMouseEnter,dn=he.onMouseLeave,Rt=he.onTitleClick,Nt=he.onTitleMouseEnter,Kt=he.onTitleMouseLeave,pn=(0,p.Z)(he,Bn),Jt=U(at),fn=m.useContext(A),An=fn.prefixCls,Pn=fn.mode,ni=fn.openKeys,Fn=fn.disabled,On=fn.overflowDisabled,Zn=fn.activeKey,ai=fn.selectedKeys,qn=fn.itemIcon,Yn=fn.expandIcon,on=fn.onItemClick,bt=fn.onOpenChange,mt=fn.onActive,Ht=m.useContext(Z),Wt=Ht._internalRenderSubMenuItem,hn=m.useContext(ce),Gn=hn.isSubPathKey,Vn=ye(),Mn="".concat(An,"-submenu"),ri=Fn||yt,ci=m.useRef(),yi=m.useRef(),wi=qt!=null?qt:qn,In=Lt!=null?Lt:Yn,Li=ni.includes(at),Ti=!On&&Li,gi=Gn(ai,at),oi=xt(at,ri,Nt,Kt),gn=oi.active,mi=(0,p.Z)(oi,xn),Ai=m.useState(!1),$i=(0,M.Z)(Ai,2),Oi=$i[0],Mi=$i[1],Di=function(hi){ri||Mi(hi)},Wi=function(hi){Di(!0),jt==null||jt({key:at,domEvent:hi})},Xn=function(hi){Di(!1),dn==null||dn({key:at,domEvent:hi})},ji=m.useMemo(function(){return gn||(Pn!=="inline"?Oi||Gn([Zn],at):!1)},[Pn,gn,Zn,Oi,at,Gn]),bi=ut(Vn.length),lr=function(hi){ri||(Rt==null||Rt({key:at,domEvent:hi}),Pn==="inline"&&bt(at,!Li))},Xi=me(function(vi){Xt==null||Xt(Ct(vi)),on(vi)}),Hi=function(hi){Pn!=="inline"&&bt(at,hi)},nr=function(){mt(at)},Fi=Jt&&"".concat(Jt,"-popup"),Ni=m.useMemo(function(){return m.createElement(Gt,{icon:Pn!=="horizontal"?In:void 0,props:(0,De.Z)((0,De.Z)({},he),{},{isOpen:Ti,isSubMenu:!0})},m.createElement("i",{className:"".concat(Mn,"-arrow")}))},[Pn,In,he,Ti,Mn]),Ei=m.createElement("div",(0,T.Z)({role:"menuitem",style:bi,className:"".concat(Mn,"-title"),tabIndex:ri?null:-1,ref:ci,title:typeof it=="string"?it:null,"data-menu-id":On&&Jt?null:Jt,"aria-expanded":Ti,"aria-haspopup":!0,"aria-controls":Fi,"aria-disabled":ri,onClick:lr,onFocus:nr},mi),it,Ni),Bi=m.useRef(Pn);if(Pn!=="inline"&&Vn.length>1?Bi.current="vertical":Bi.current=Pn,!On){var Ri=Bi.current;Ei=m.createElement(kn,{mode:Ri,prefixCls:Mn,visible:!Dt&&Ti&&Pn!=="inline",popupClassName:nn,popupOffset:cn,popupStyle:ln,popup:m.createElement(z,{mode:Ri==="horizontal"?"vertical":Ri},m.createElement(q,{id:Fi,ref:yi},kt)),disabled:ri,onVisibleChange:Hi},Ei)}var fi=m.createElement(l.Z.Item,(0,T.Z)({ref:Ie,role:"none"},pn,{component:"li",style:Fe,className:ie()(Mn,"".concat(Mn,"-").concat(Pn),Ue,(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(Mn,"-open"),Ti),"".concat(Mn,"-active"),ji),"".concat(Mn,"-selected"),gi),"".concat(Mn,"-disabled"),ri)),onMouseEnter:Wi,onMouseLeave:Xn}),Ei,!On&&m.createElement(Rn,{id:Fi,open:Ti,keyPath:Vn},kt));return Wt&&(fi=Wt(fi,he,{selected:gi,active:ji,open:Ti,disabled:ri})),m.createElement(z,{onItemClick:Xi,mode:Pn==="horizontal"?"vertical":Pn,itemIcon:wi,expandIcon:In},fi)}),wn=m.forwardRef(function(he,Ie){var Fe=he.eventKey,Ue=he.children,it=ye(Fe),at=vt(Ue,it),qe=ne();m.useEffect(function(){if(qe)return qe.registerPath(Fe,it),function(){qe.unregisterPath(Fe,it)}},[it]);var yt;return qe?yt=at:yt=m.createElement(sn,(0,T.Z)({ref:Ie},he),at),m.createElement(Q.Provider,{value:it},yt)}),zn=wn,Hn=C(28788);function Se(he){var Ie=he.className,Fe=he.style,Ue=m.useContext(A),it=Ue.prefixCls,at=ne();return at?null:m.createElement("li",{role:"separator",className:ie()("".concat(it,"-item-divider"),Ie),style:Fe})}var Ee=["className","title","eventKey","children"],_t=m.forwardRef(function(he,Ie){var Fe=he.className,Ue=he.title,it=he.eventKey,at=he.children,qe=(0,p.Z)(he,Ee),yt=m.useContext(A),Dt=yt.prefixCls,kt="".concat(Dt,"-item-group");return m.createElement("li",(0,T.Z)({ref:Ie,role:"presentation"},qe,{onClick:function(Lt){return Lt.stopPropagation()},className:ie()(kt,Fe)}),m.createElement("div",{role:"presentation",className:"".concat(kt,"-title"),title:typeof Ue=="string"?Ue:void 0},Ue),m.createElement("ul",{role:"group",className:"".concat(kt,"-list")},at))}),ct=m.forwardRef(function(he,Ie){var Fe=he.eventKey,Ue=he.children,it=ye(Fe),at=vt(Ue,it),qe=ne();return qe?at:m.createElement(_t,(0,T.Z)({ref:Ie},(0,lt.Z)(he,["warnKey"])),at)}),tt=ct,$t=["label","children","key","type","extra"];function je(he,Ie,Fe){var Ue=Ie.item,it=Ie.group,at=Ie.submenu,qe=Ie.divider;return(he||[]).map(function(yt,Dt){if(yt&&(0,Hn.Z)(yt)==="object"){var kt=yt,qt=kt.label,Lt=kt.children,nn=kt.key,cn=kt.type,ln=kt.extra,Xt=(0,p.Z)(kt,$t),jt=nn!=null?nn:"tmp-".concat(Dt);return Lt||cn==="group"?cn==="group"?m.createElement(it,(0,T.Z)({key:jt},Xt,{title:qt}),je(Lt,Ie,Fe)):m.createElement(at,(0,T.Z)({key:jt},Xt,{title:qt}),je(Lt,Ie,Fe)):cn==="divider"?m.createElement(qe,(0,T.Z)({key:jt},Xt)):m.createElement(Ue,(0,T.Z)({key:jt},Xt,{extra:ln}),qt,(!!ln||ln===0)&&m.createElement("span",{className:"".concat(Fe,"-item-extra")},ln))}return null}).filter(function(yt){return yt})}function Ve(he,Ie,Fe,Ue,it){var at=he,qe=(0,De.Z)({divider:Se,item:Ae,group:tt,submenu:zn},Ue);return Ie&&(at=je(Ie,qe,it)),vt(at,Fe)}var ht=["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"],nt=[],Vt=m.forwardRef(function(he,Ie){var Fe,Ue=he,it=Ue.prefixCls,at=it===void 0?"rc-menu":it,qe=Ue.rootClassName,yt=Ue.style,Dt=Ue.className,kt=Ue.tabIndex,qt=kt===void 0?0:kt,Lt=Ue.items,nn=Ue.children,cn=Ue.direction,ln=Ue.id,Xt=Ue.mode,jt=Xt===void 0?"vertical":Xt,dn=Ue.inlineCollapsed,Rt=Ue.disabled,Nt=Ue.disabledOverflow,Kt=Ue.subMenuOpenDelay,pn=Kt===void 0?.1:Kt,Jt=Ue.subMenuCloseDelay,fn=Jt===void 0?.1:Jt,An=Ue.forceSubMenuRender,Pn=Ue.defaultOpenKeys,ni=Ue.openKeys,Fn=Ue.activeKey,On=Ue.defaultActiveFirst,Zn=Ue.selectable,ai=Zn===void 0?!0:Zn,qn=Ue.multiple,Yn=qn===void 0?!1:qn,on=Ue.defaultSelectedKeys,bt=Ue.selectedKeys,mt=Ue.onSelect,Ht=Ue.onDeselect,Wt=Ue.inlineIndent,hn=Wt===void 0?24:Wt,Gn=Ue.motion,Vn=Ue.defaultMotions,Mn=Ue.triggerSubMenuAction,ri=Mn===void 0?"hover":Mn,ci=Ue.builtinPlacements,yi=Ue.itemIcon,wi=Ue.expandIcon,In=Ue.overflowedIndicator,Li=In===void 0?"...":In,Ti=Ue.overflowedIndicatorPopupClassName,gi=Ue.getPopupContainer,oi=Ue.onClick,gn=Ue.onOpenChange,mi=Ue.onKeyDown,Ai=Ue.openAnimation,$i=Ue.openTransitionName,Oi=Ue._internalRenderMenuItem,Mi=Ue._internalRenderSubMenuItem,Di=Ue._internalComponents,Wi=(0,p.Z)(Ue,ht),Xn=m.useMemo(function(){return[Ve(nn,Lt,nt,Di,at),Ve(nn,Lt,nt,{},at)]},[nn,Lt,Di]),ji=(0,M.Z)(Xn,2),bi=ji[0],lr=ji[1],Xi=m.useState(!1),Hi=(0,M.Z)(Xi,2),nr=Hi[0],Fi=Hi[1],Ni=m.useRef(),Ei=_e(ln),Bi=cn==="rtl",Ri=(0,S.Z)(Pn,{value:ni,postState:function(di){return di||nt}}),fi=(0,M.Z)(Ri,2),vi=fi[0],hi=fi[1],Ot=function(di){var Ci=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function dt(){hi(di),gn==null||gn(di)}Ci?(0,y.flushSync)(dt):dt()},_n=m.useState(vi),bn=(0,M.Z)(_n,2),Dn=bn[0],Jn=bn[1],li=m.useRef(!1),en=m.useMemo(function(){return(jt==="inline"||jt==="vertical")&&dn?["vertical",dn]:[jt,!1]},[jt,dn]),yn=(0,M.Z)(en,2),ei=yn[0],Qn=yn[1],ui=ei==="inline",zi=m.useState(ei),Qi=(0,M.Z)(zi,2),Ui=Qi[0],ir=Qi[1],rr=m.useState(Qn),wr=(0,M.Z)(rr,2),us=wr[0],$r=wr[1];m.useEffect(function(){ir(ei),$r(Qn),li.current&&(ui?hi(Dn):Ot(nt))},[ei,Qn]);var br=m.useState(0),qi=(0,M.Z)(br,2),Tr=qi[0],cs=qi[1],Lr=Tr>=bi.length-1||Ui!=="horizontal"||Nt;m.useEffect(function(){ui&&Jn(vi)},[vi]),m.useEffect(function(){return li.current=!0,function(){li.current=!1}},[]);var fr=J(),kr=fr.registerPath,Kr=fr.unregisterPath,Yr=fr.refreshOverflowKeys,Ar=fr.isSubPathKey,Xr=fr.getKeyPath,Pr=fr.getKeys,ur=fr.getSubPathKeys,Qr=m.useMemo(function(){return{registerPath:kr,unregisterPath:Kr}},[kr,Kr]),Gr=m.useMemo(function(){return{isSubPathKey:Ar}},[Ar]);m.useEffect(function(){Yr(Lr?nt:bi.slice(Tr+1).map(function(ki){return ki.key}))},[Tr,Lr]);var qr=(0,S.Z)(Fn||On&&((Fe=bi[0])===null||Fe===void 0?void 0:Fe.key),{value:Fn}),Vr=(0,M.Z)(qr,2),_r=Vr[0],ti=Vr[1],jn=me(function(ki){ti(ki)}),Ki=me(function(){ti(void 0)});(0,m.useImperativeHandle)(Ie,function(){return{list:Ni.current,focus:function(di){var Ci,dt=Pr(),Zi=be(dt,Ei),zr=Zi.elements,Jr=Zi.key2element,Gs=Zi.element2key,es=le(Ni.current,zr),fs=_r!=null?_r:es[0]?Gs.get(es[0]):(Ci=bi.find(function(ds){return!ds.props.disabled}))===null||Ci===void 0?void 0:Ci.key,Zr=Jr.get(fs);if(fs&&Zr){var hs;Zr==null||(hs=Zr.focus)===null||hs===void 0||hs.call(Zr,di)}}}});var Gi=(0,S.Z)(on||[],{value:bt,postState:function(di){return Array.isArray(di)?di:di==null?nt:[di]}}),Ii=(0,M.Z)(Gi,2),Pi=Ii[0],sr=Ii[1],Ji=function(di){if(ai){var Ci=di.key,dt=Pi.includes(Ci),Zi;Yn?dt?Zi=Pi.filter(function(Jr){return Jr!==Ci}):Zi=[].concat((0,re.Z)(Pi),[Ci]):Zi=[Ci],sr(Zi);var zr=(0,De.Z)((0,De.Z)({},di),{},{selectedKeys:Zi});dt?Ht==null||Ht(zr):mt==null||mt(zr)}!Yn&&vi.length&&Ui!=="inline"&&Ot(nt)},hr=me(function(ki){oi==null||oi(Ct(ki)),Ji(ki)}),dr=me(function(ki,di){var Ci=vi.filter(function(Zi){return Zi!==ki});if(di)Ci.push(ki);else if(Ui!=="inline"){var dt=ur(ki);Ci=Ci.filter(function(Zi){return!dt.has(Zi)})}(0,w.Z)(vi,Ci,!0)||Ot(Ci,!0)}),er=function(di,Ci){var dt=Ci!=null?Ci:!vi.includes(di);dr(di,dt)},Or=ke(Ui,_r,Bi,Ei,Ni,Pr,Xr,ti,er,mi);m.useEffect(function(){Fi(!0)},[]);var Dr=m.useMemo(function(){return{_internalRenderMenuItem:Oi,_internalRenderSubMenuItem:Mi}},[Oi,Mi]),ws=Ui!=="horizontal"||Nt?bi:bi.map(function(ki,di){return m.createElement(z,{key:ki.key,overflowDisabled:di>Tr},ki)}),Ks=m.createElement(l.Z,(0,T.Z)({id:ln,ref:Ni,prefixCls:"".concat(at,"-overflow"),component:"ul",itemComponent:Ae,className:ie()(at,"".concat(at,"-root"),"".concat(at,"-").concat(Ui),Dt,(0,de.Z)((0,de.Z)({},"".concat(at,"-inline-collapsed"),us),"".concat(at,"-rtl"),Bi),qe),dir:cn,style:yt,role:"menu",tabIndex:qt,data:ws,renderRawItem:function(di){return di},renderRawRest:function(di){var Ci=di.length,dt=Ci?bi.slice(-Ci):null;return m.createElement(zn,{eventKey:oe,title:Li,disabled:Lr,internalPopupClose:Ci===0,popupClassName:Ti},dt)},maxCount:Ui!=="horizontal"||Nt?l.Z.INVALIDATE:l.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(di){cs(di)},onKeyDown:Or},Wi));return m.createElement(Z.Provider,{value:Dr},m.createElement(x.Provider,{value:Ei},m.createElement(z,{prefixCls:at,rootClassName:qe,mode:Ui,openKeys:vi,rtl:Bi,disabled:Rt,motion:nr?Gn:null,defaultMotions:nr?Vn:null,activeKey:_r,onActive:jn,onInactive:Ki,selectedKeys:Pi,inlineIndent:hn,subMenuOpenDelay:pn,subMenuCloseDelay:fn,forceSubMenuRender:An,builtinPlacements:ci,triggerSubMenuAction:ri,getPopupContainer:gi,itemIcon:yi,expandIcon:wi,onItemClick:hr,onOpenChange:dr},m.createElement(ce.Provider,{value:Gr},Ks),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(ae.Provider,{value:Qr},lr)))))}),Zt=Vt,It=Zt;It.Item=Ae,It.SubMenu=zn,It.ItemGroup=tt,It.Divider=Se;var wt=It},11780:function(vn,St,C){"use strict";C.d(St,{Z:function(){return W}});var T=C(71409),de=C(89490),De=C(11036),re=C(39224),M=C(59301),p=C(92310),fe=C.n(p),ie=C(29301),l=C(34280),S=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],w=void 0;function d(_,g){var O=_.prefixCls,Y=_.invalidate,Pe=_.item,Me=_.renderItem,Xe=_.responsive,Ye=_.responsiveDisabled,Tt=_.registerSize,gt=_.itemKey,Le=_.className,Je=_.style,Et=_.children,ot=_.display,rn=_.order,Ze=_.component,ge=Ze===void 0?"div":Ze,le=(0,re.Z)(_,S),G=Xe&&!ot;function be(ee){Tt(gt,ee)}M.useEffect(function(){return function(){be(null)}},[]);var ke=Me&&Pe!==w?Me(Pe,{index:rn}):Et,Ne;Y||(Ne={opacity:G?0:1,height:G?0:w,overflowY:G?"hidden":w,order:Xe?rn:w,pointerEvents:G?"none":w,position:G?"absolute":w});var k={};G&&(k["aria-hidden"]=!0);var F=M.createElement(ge,(0,T.Z)({className:fe()(!Y&&O,Le),style:(0,de.Z)((0,de.Z)({},Ne),Je)},k,le,{ref:g}),ke);return Xe&&(F=M.createElement(ie.Z,{onResize:function(oe){var J=oe.offsetWidth;be(J)},disabled:Ye},F)),F}var m=M.forwardRef(d);m.displayName="Item";var y=m,x=C(6089),N=C(4676),U=C(16089);function K(_){if(typeof MessageChannel=="undefined")(0,U.Z)(_);else{var g=new MessageChannel;g.port1.onmessage=function(){return _()},g.port2.postMessage(void 0)}}function D(){var _=M.useRef(null),g=function(Y){_.current||(_.current=[],K(function(){(0,N.unstable_batchedUpdates)(function(){_.current.forEach(function(Pe){Pe()}),_.current=null})})),_.current.push(Y)};return g}function A(_,g){var O=M.useState(g),Y=(0,De.Z)(O,2),Pe=Y[0],Me=Y[1],Xe=(0,x.Z)(function(Ye){_(function(){Me(Ye)})});return[Pe,Xe]}var P=M.createContext(null),z=["component"],se=["className"],ae=["className"],ne=function(g,O){var Y=M.useContext(P);if(!Y){var Pe=g.component,Me=Pe===void 0?"div":Pe,Xe=(0,re.Z)(g,z);return M.createElement(Me,(0,T.Z)({},Xe,{ref:O}))}var Ye=Y.className,Tt=(0,re.Z)(Y,se),gt=g.className,Le=(0,re.Z)(g,ae);return M.createElement(P.Provider,{value:null},M.createElement(y,(0,T.Z)({ref:O,className:fe()(Ye,gt)},Tt,Le)))},Q=M.forwardRef(ne);Q.displayName="RawItem";var ye=Q,ce=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Oe="responsive",Z="invalidate";function L(_){return"+ ".concat(_.length," ...")}function V(_,g){var O=_.prefixCls,Y=O===void 0?"rc-overflow":O,Pe=_.data,Me=Pe===void 0?[]:Pe,Xe=_.renderItem,Ye=_.renderRawItem,Tt=_.itemKey,gt=_.itemWidth,Le=gt===void 0?10:gt,Je=_.ssr,Et=_.style,ot=_.className,rn=_.maxCount,Ze=_.renderRest,ge=_.renderRawRest,le=_.suffix,G=_.component,be=G===void 0?"div":G,ke=_.itemComponent,Ne=_.onVisibleChange,k=(0,re.Z)(_,ce),F=Je==="full",ee=D(),oe=A(ee,null),J=(0,De.Z)(oe,2),me=J[0],Te=J[1],pe=me||0,_e=A(ee,new Map),Ce=(0,De.Z)(_e,2),Ge=Ce[0],He=Ce[1],et=A(ee,0),lt=(0,De.Z)(et,2),Pt=lt[0],xt=lt[1],ut=A(ee,0),Gt=(0,De.Z)(ut,2),an=Gt[0],Ct=Gt[1],un=A(ee,0),Nn=(0,De.Z)(un,2),At=Nn[0],Qt=Nn[1],Re=(0,M.useState)(null),xe=(0,De.Z)(Re,2),Ae=xe[0],B=xe[1],j=(0,M.useState)(null),te=(0,De.Z)(j,2),q=te[0],we=te[1],vt=M.useMemo(function(){return q===null&&F?Number.MAX_SAFE_INTEGER:q||0},[q,me]),st=(0,M.useState)(!1),ft=(0,De.Z)(st,2),Mt=ft[0],Sn=ft[1],En="".concat(Y,"-item"),Ft=Math.max(Pt,an),Yt=rn===Oe,kn=Me.length&&Yt,$n=rn===Z,Rn=kn||typeof rn=="number"&&Me.length>rn,Bn=(0,M.useMemo)(function(){var It=Me;return kn?me===null&&F?It=Me:It=Me.slice(0,Math.min(Me.length,pe/Le)):typeof rn=="number"&&(It=Me.slice(0,rn)),It},[Me,Le,me,rn,kn]),xn=(0,M.useMemo)(function(){return kn?Me.slice(vt+1):Me.slice(Bn.length)},[Me,Bn,kn,vt]),sn=(0,M.useCallback)(function(It,wt){var he;return typeof Tt=="function"?Tt(It):(he=Tt&&(It==null?void 0:It[Tt]))!==null&&he!==void 0?he:wt},[Tt]),wn=(0,M.useCallback)(Xe||function(It){return It},[Xe]);function zn(It,wt,he){q===It&&(wt===void 0||wt===Ae)||(we(It),he||(Sn(It<Me.length-1),Ne==null||Ne(It)),wt!==void 0&&B(wt))}function Hn(It,wt){Te(wt.clientWidth)}function Se(It,wt){He(function(he){var Ie=new Map(he);return wt===null?Ie.delete(It):Ie.set(It,wt),Ie})}function Ee(It,wt){Ct(wt),xt(an)}function _t(It,wt){Qt(wt)}function ct(It){return Ge.get(sn(Bn[It],It))}(0,l.Z)(function(){if(pe&&typeof Ft=="number"&&Bn){var It=At,wt=Bn.length,he=wt-1;if(!wt){zn(0,null);return}for(var Ie=0;Ie<wt;Ie+=1){var Fe=ct(Ie);if(F&&(Fe=Fe||0),Fe===void 0){zn(Ie-1,void 0,!0);break}if(It+=Fe,he===0&&It<=pe||Ie===he-1&&It+ct(he)<=pe){zn(he,null);break}else if(It+Ft>pe){zn(Ie-1,It-Fe-At+an);break}}le&&ct(0)+At>pe&&B(null)}},[pe,Ge,an,At,sn,Bn]);var tt=Mt&&!!xn.length,$t={};Ae!==null&&kn&&($t={position:"absolute",left:Ae,top:0});var je={prefixCls:En,responsive:kn,component:ke,invalidate:$n},Ve=Ye?function(It,wt){var he=sn(It,wt);return M.createElement(P.Provider,{key:he,value:(0,de.Z)((0,de.Z)({},je),{},{order:wt,item:It,itemKey:he,registerSize:Se,display:wt<=vt})},Ye(It,wt))}:function(It,wt){var he=sn(It,wt);return M.createElement(y,(0,T.Z)({},je,{order:wt,key:he,item:It,renderItem:wn,itemKey:he,registerSize:Se,display:wt<=vt}))},ht={order:tt?vt:Number.MAX_SAFE_INTEGER,className:"".concat(En,"-rest"),registerSize:Ee,display:tt},nt=Ze||L,Vt=ge?M.createElement(P.Provider,{value:(0,de.Z)((0,de.Z)({},je),ht)},ge(xn)):M.createElement(y,(0,T.Z)({},je,ht),typeof nt=="function"?nt(xn):nt),Zt=M.createElement(be,(0,T.Z)({className:fe()(!$n&&Y,ot),style:Et,ref:g},k),Bn.map(Ve),Rn?Vt:null,le&&M.createElement(y,(0,T.Z)({},je,{responsive:Yt,responsiveDisabled:!kn,order:vt,className:"".concat(En,"-suffix"),registerSize:_t,display:!0,style:$t}),le));return Yt?M.createElement(ie.Z,{onResize:Hn,disabled:!kn},Zt):Zt}var $=M.forwardRef(V);$.displayName="Overflow",$.Item=ye,$.RESPONSIVE=Oe,$.INVALIDATE=Z;var H=$,W=H},23425:function(vn,St,C){"use strict";C.d(St,{Z:function(){return ae}});var T=C(87075),de=C(71409),De=C(28788),re=C(89490),M=C(11036),p=C(92310),fe=C.n(p),ie=C(18929),l=C(10228),S=C(26112),w=C(48736),d=C(59301),m=C(17119),y=[10,20,50,100],x=function(Q){var ye=Q.pageSizeOptions,ce=ye===void 0?y:ye,Oe=Q.locale,Z=Q.changeSize,L=Q.pageSize,V=Q.goButton,$=Q.quickGo,H=Q.rootPrefixCls,W=Q.disabled,_=Q.buildOptionText,g=Q.showSizeChanger,O=Q.sizeChangerRender,Y=d.useState(""),Pe=(0,M.Z)(Y,2),Me=Pe[0],Xe=Pe[1],Ye=function(){return!Me||Number.isNaN(Me)?void 0:Number(Me)},Tt=typeof _=="function"?_:function(le){return"".concat(le," ").concat(Oe.items_per_page)},gt=function(G){Xe(G.target.value)},Le=function(G){V||Me===""||(Xe(""),!(G.relatedTarget&&(G.relatedTarget.className.indexOf("".concat(H,"-item-link"))>=0||G.relatedTarget.className.indexOf("".concat(H,"-item"))>=0))&&($==null||$(Ye())))},Je=function(G){Me!==""&&(G.keyCode===l.Z.ENTER||G.type==="click")&&(Xe(""),$==null||$(Ye()))},Et=function(){return ce.some(function(G){return G.toString()===L.toString()})?ce:ce.concat([L]).sort(function(G,be){var ke=Number.isNaN(Number(G))?0:Number(G),Ne=Number.isNaN(Number(be))?0:Number(be);return ke-Ne})},ot="".concat(H,"-options");if(!g&&!$)return null;var rn=null,Ze=null,ge=null;return g&&O&&(rn=O({disabled:W,size:L,onSizeChange:function(G){Z==null||Z(Number(G))},"aria-label":Oe.page_size,className:"".concat(ot,"-size-changer"),options:Et().map(function(le){return{label:Tt(le),value:le}})})),$&&(V&&(ge=typeof V=="boolean"?d.createElement("button",{type:"button",onClick:Je,onKeyUp:Je,disabled:W,className:"".concat(ot,"-quick-jumper-button")},Oe.jump_to_confirm):d.createElement("span",{onClick:Je,onKeyUp:Je},V)),Ze=d.createElement("div",{className:"".concat(ot,"-quick-jumper")},Oe.jump_to,d.createElement("input",{disabled:W,type:"text",value:Me,onChange:gt,onKeyUp:Je,onBlur:Le,"aria-label":Oe.page}),Oe.page,ge)),d.createElement("li",{className:ot},rn,Ze)},N=x,U=function(Q){var ye=Q.rootPrefixCls,ce=Q.page,Oe=Q.active,Z=Q.className,L=Q.showTitle,V=Q.onClick,$=Q.onKeyPress,H=Q.itemRender,W="".concat(ye,"-item"),_=fe()(W,"".concat(W,"-").concat(ce),(0,T.Z)((0,T.Z)({},"".concat(W,"-active"),Oe),"".concat(W,"-disabled"),!ce),Z),g=function(){V(ce)},O=function(Me){$(Me,V,ce)},Y=H(ce,"page",d.createElement("a",{rel:"nofollow"},ce));return Y?d.createElement("li",{title:L?String(ce):null,className:_,onClick:g,onKeyDown:O,tabIndex:0},Y):null},K=U,D=function(Q,ye,ce){return ce};function A(){}function P(ne){var Q=Number(ne);return typeof Q=="number"&&!Number.isNaN(Q)&&isFinite(Q)&&Math.floor(Q)===Q}function z(ne,Q,ye){var ce=typeof ne=="undefined"?Q:ne;return Math.floor((ye-1)/ce)+1}var se=function(Q){var ye=Q.prefixCls,ce=ye===void 0?"rc-pagination":ye,Oe=Q.selectPrefixCls,Z=Oe===void 0?"rc-select":Oe,L=Q.className,V=Q.current,$=Q.defaultCurrent,H=$===void 0?1:$,W=Q.total,_=W===void 0?0:W,g=Q.pageSize,O=Q.defaultPageSize,Y=O===void 0?10:O,Pe=Q.onChange,Me=Pe===void 0?A:Pe,Xe=Q.hideOnSinglePage,Ye=Q.align,Tt=Q.showPrevNextJumpers,gt=Tt===void 0?!0:Tt,Le=Q.showQuickJumper,Je=Q.showLessItems,Et=Q.showTitle,ot=Et===void 0?!0:Et,rn=Q.onShowSizeChange,Ze=rn===void 0?A:rn,ge=Q.locale,le=ge===void 0?m.Z:ge,G=Q.style,be=Q.totalBoundaryShowSizeChanger,ke=be===void 0?50:be,Ne=Q.disabled,k=Q.simple,F=Q.showTotal,ee=Q.showSizeChanger,oe=ee===void 0?_>ke:ee,J=Q.sizeChangerRender,me=Q.pageSizeOptions,Te=Q.itemRender,pe=Te===void 0?D:Te,_e=Q.jumpPrevIcon,Ce=Q.jumpNextIcon,Ge=Q.prevIcon,He=Q.nextIcon,et=d.useRef(null),lt=(0,ie.Z)(10,{value:g,defaultValue:Y}),Pt=(0,M.Z)(lt,2),xt=Pt[0],ut=Pt[1],Gt=(0,ie.Z)(1,{value:V,defaultValue:H,postState:function(Nt){return Math.max(1,Math.min(Nt,z(void 0,xt,_)))}}),an=(0,M.Z)(Gt,2),Ct=an[0],un=an[1],Nn=d.useState(Ct),At=(0,M.Z)(Nn,2),Qt=At[0],Re=At[1];(0,d.useEffect)(function(){Re(Ct)},[Ct]);var xe=Me!==A,Ae="current"in Q,B=Math.max(1,Ct-(Je?3:5)),j=Math.min(z(void 0,xt,_),Ct+(Je?3:5));function te(Rt,Nt){var Kt=Rt||d.createElement("button",{type:"button","aria-label":Nt,className:"".concat(ce,"-item-link")});return typeof Rt=="function"&&(Kt=d.createElement(Rt,(0,re.Z)({},Q))),Kt}function q(Rt){var Nt=Rt.target.value,Kt=z(void 0,xt,_),pn;return Nt===""?pn=Nt:Number.isNaN(Number(Nt))?pn=Qt:Nt>=Kt?pn=Kt:pn=Number(Nt),pn}function we(Rt){return P(Rt)&&Rt!==Ct&&P(_)&&_>0}var vt=_>xt?Le:!1;function st(Rt){(Rt.keyCode===l.Z.UP||Rt.keyCode===l.Z.DOWN)&&Rt.preventDefault()}function ft(Rt){var Nt=q(Rt);switch(Nt!==Qt&&Re(Nt),Rt.keyCode){case l.Z.ENTER:En(Nt);break;case l.Z.UP:En(Nt-1);break;case l.Z.DOWN:En(Nt+1);break;default:break}}function Mt(Rt){En(q(Rt))}function Sn(Rt){var Nt=z(Rt,xt,_),Kt=Ct>Nt&&Nt!==0?Nt:Ct;ut(Rt),Re(Kt),Ze==null||Ze(Ct,Rt),un(Kt),Me==null||Me(Kt,Rt)}function En(Rt){if(we(Rt)&&!Ne){var Nt=z(void 0,xt,_),Kt=Rt;return Rt>Nt?Kt=Nt:Rt<1&&(Kt=1),Kt!==Qt&&Re(Kt),un(Kt),Me==null||Me(Kt,xt),Kt}return Ct}var Ft=Ct>1,Yt=Ct<z(void 0,xt,_);function kn(){Ft&&En(Ct-1)}function $n(){Yt&&En(Ct+1)}function Rn(){En(B)}function Bn(){En(j)}function xn(Rt,Nt){if(Rt.key==="Enter"||Rt.charCode===l.Z.ENTER||Rt.keyCode===l.Z.ENTER){for(var Kt=arguments.length,pn=new Array(Kt>2?Kt-2:0),Jt=2;Jt<Kt;Jt++)pn[Jt-2]=arguments[Jt];Nt.apply(void 0,pn)}}function sn(Rt){xn(Rt,kn)}function wn(Rt){xn(Rt,$n)}function zn(Rt){xn(Rt,Rn)}function Hn(Rt){xn(Rt,Bn)}function Se(Rt){var Nt=pe(Rt,"prev",te(Ge,"prev page"));return d.isValidElement(Nt)?d.cloneElement(Nt,{disabled:!Ft}):Nt}function Ee(Rt){var Nt=pe(Rt,"next",te(He,"next page"));return d.isValidElement(Nt)?d.cloneElement(Nt,{disabled:!Yt}):Nt}function _t(Rt){(Rt.type==="click"||Rt.keyCode===l.Z.ENTER)&&En(Qt)}var ct=null,tt=(0,S.Z)(Q,{aria:!0,data:!0}),$t=F&&d.createElement("li",{className:"".concat(ce,"-total-text")},F(_,[_===0?0:(Ct-1)*xt+1,Ct*xt>_?_:Ct*xt])),je=null,Ve=z(void 0,xt,_);if(Xe&&_<=xt)return null;var ht=[],nt={rootPrefixCls:ce,onClick:En,onKeyPress:xn,showTitle:ot,itemRender:pe,page:-1},Vt=Ct-1>0?Ct-1:0,Zt=Ct+1<Ve?Ct+1:Ve,It=Le&&Le.goButton,wt=(0,De.Z)(k)==="object"?k.readOnly:!k,he=It,Ie=null;k&&(It&&(typeof It=="boolean"?he=d.createElement("button",{type:"button",onClick:_t,onKeyUp:_t},le.jump_to_confirm):he=d.createElement("span",{onClick:_t,onKeyUp:_t},It),he=d.createElement("li",{title:ot?"".concat(le.jump_to).concat(Ct,"/").concat(Ve):null,className:"".concat(ce,"-simple-pager")},he)),Ie=d.createElement("li",{title:ot?"".concat(Ct,"/").concat(Ve):null,className:"".concat(ce,"-simple-pager")},wt?Qt:d.createElement("input",{type:"text","aria-label":le.jump_to,value:Qt,disabled:Ne,onKeyDown:st,onKeyUp:ft,onChange:ft,onBlur:Mt,size:3}),d.createElement("span",{className:"".concat(ce,"-slash")},"/"),Ve));var Fe=Je?1:2;if(Ve<=3+Fe*2){Ve||ht.push(d.createElement(K,(0,de.Z)({},nt,{key:"noPager",page:1,className:"".concat(ce,"-item-disabled")})));for(var Ue=1;Ue<=Ve;Ue+=1)ht.push(d.createElement(K,(0,de.Z)({},nt,{key:Ue,page:Ue,active:Ct===Ue})))}else{var it=Je?le.prev_3:le.prev_5,at=Je?le.next_3:le.next_5,qe=pe(B,"jump-prev",te(_e,"prev page")),yt=pe(j,"jump-next",te(Ce,"next page"));gt&&(ct=qe?d.createElement("li",{title:ot?it:null,key:"prev",onClick:Rn,tabIndex:0,onKeyDown:zn,className:fe()("".concat(ce,"-jump-prev"),(0,T.Z)({},"".concat(ce,"-jump-prev-custom-icon"),!!_e))},qe):null,je=yt?d.createElement("li",{title:ot?at:null,key:"next",onClick:Bn,tabIndex:0,onKeyDown:Hn,className:fe()("".concat(ce,"-jump-next"),(0,T.Z)({},"".concat(ce,"-jump-next-custom-icon"),!!Ce))},yt):null);var Dt=Math.max(1,Ct-Fe),kt=Math.min(Ct+Fe,Ve);Ct-1<=Fe&&(kt=1+Fe*2),Ve-Ct<=Fe&&(Dt=Ve-Fe*2);for(var qt=Dt;qt<=kt;qt+=1)ht.push(d.createElement(K,(0,de.Z)({},nt,{key:qt,page:qt,active:Ct===qt})));if(Ct-1>=Fe*2&&Ct!==3&&(ht[0]=d.cloneElement(ht[0],{className:fe()("".concat(ce,"-item-after-jump-prev"),ht[0].props.className)}),ht.unshift(ct)),Ve-Ct>=Fe*2&&Ct!==Ve-2){var Lt=ht[ht.length-1];ht[ht.length-1]=d.cloneElement(Lt,{className:fe()("".concat(ce,"-item-before-jump-next"),Lt.props.className)}),ht.push(je)}Dt!==1&&ht.unshift(d.createElement(K,(0,de.Z)({},nt,{key:1,page:1}))),kt!==Ve&&ht.push(d.createElement(K,(0,de.Z)({},nt,{key:Ve,page:Ve})))}var nn=Se(Vt);if(nn){var cn=!Ft||!Ve;nn=d.createElement("li",{title:ot?le.prev_page:null,onClick:kn,tabIndex:cn?null:0,onKeyDown:sn,className:fe()("".concat(ce,"-prev"),(0,T.Z)({},"".concat(ce,"-disabled"),cn)),"aria-disabled":cn},nn)}var ln=Ee(Zt);if(ln){var Xt,jt;k?(Xt=!Yt,jt=Ft?0:null):(Xt=!Yt||!Ve,jt=Xt?null:0),ln=d.createElement("li",{title:ot?le.next_page:null,onClick:$n,tabIndex:jt,onKeyDown:wn,className:fe()("".concat(ce,"-next"),(0,T.Z)({},"".concat(ce,"-disabled"),Xt)),"aria-disabled":Xt},ln)}var dn=fe()(ce,L,(0,T.Z)((0,T.Z)((0,T.Z)((0,T.Z)((0,T.Z)({},"".concat(ce,"-start"),Ye==="start"),"".concat(ce,"-center"),Ye==="center"),"".concat(ce,"-end"),Ye==="end"),"".concat(ce,"-simple"),k),"".concat(ce,"-disabled"),Ne));return d.createElement("ul",(0,de.Z)({className:dn,style:G,ref:et},tt),$t,nn,k?Ie:ht,ln,d.createElement(N,{locale:le,rootPrefixCls:ce,disabled:Ne,selectPrefixCls:Z,changeSize:Sn,pageSize:xt,pageSizeOptions:me,quickGo:vt?En:null,goButton:he,showSizeChanger:oe,sizeChangerRender:J}))},ae=se},29301:function(vn,St,C){"use strict";C.d(St,{Z:function(){return Z}});var T=C(71409),de=C(59301),De=C(11592),re=C(48736),M=C(89490),p=C(28788),fe=C(76846),ie=C(8654),l=de.createContext(null);function S(L){var V=L.children,$=L.onBatchResize,H=de.useRef(0),W=de.useRef([]),_=de.useContext(l),g=de.useCallback(function(O,Y,Pe){H.current+=1;var Me=H.current;W.current.push({size:O,element:Y,data:Pe}),Promise.resolve().then(function(){Me===H.current&&($==null||$(W.current),W.current=[])}),_==null||_(O,Y,Pe)},[$,_]);return de.createElement(l.Provider,{value:g},V)}var w=C(76374),d=new Map;function m(L){L.forEach(function(V){var $,H=V.target;($=d.get(H))===null||$===void 0||$.forEach(function(W){return W(H)})})}var y=new w.Z(m),x=null,N=null;function U(L,V){d.has(L)||(d.set(L,new Set),y.observe(L)),d.get(L).add(V)}function K(L,V){d.has(L)&&(d.get(L).delete(V),d.get(L).size||(y.unobserve(L),d.delete(L)))}var D=C(16552),A=C(19210),P=C(46654),z=C(37205),se=function(L){(0,P.Z)($,L);var V=(0,z.Z)($);function $(){return(0,D.Z)(this,$),V.apply(this,arguments)}return(0,A.Z)($,[{key:"render",value:function(){return this.props.children}}]),$}(de.Component);function ae(L,V){var $=L.children,H=L.disabled,W=de.useRef(null),_=de.useRef(null),g=de.useContext(l),O=typeof $=="function",Y=O?$(W):$,Pe=de.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Me=!O&&de.isValidElement(Y)&&(0,ie.Yr)(Y),Xe=Me?(0,ie.C4)(Y):null,Ye=(0,ie.x1)(Xe,W),Tt=function(){var Et;return(0,fe.ZP)(W.current)||(W.current&&(0,p.Z)(W.current)==="object"?(0,fe.ZP)((Et=W.current)===null||Et===void 0?void 0:Et.nativeElement):null)||(0,fe.ZP)(_.current)};de.useImperativeHandle(V,function(){return Tt()});var gt=de.useRef(L);gt.current=L;var Le=de.useCallback(function(Je){var Et=gt.current,ot=Et.onResize,rn=Et.data,Ze=Je.getBoundingClientRect(),ge=Ze.width,le=Ze.height,G=Je.offsetWidth,be=Je.offsetHeight,ke=Math.floor(ge),Ne=Math.floor(le);if(Pe.current.width!==ke||Pe.current.height!==Ne||Pe.current.offsetWidth!==G||Pe.current.offsetHeight!==be){var k={width:ke,height:Ne,offsetWidth:G,offsetHeight:be};Pe.current=k;var F=G===Math.round(ge)?ge:G,ee=be===Math.round(le)?le:be,oe=(0,M.Z)((0,M.Z)({},k),{},{offsetWidth:F,offsetHeight:ee});g==null||g(oe,Je,rn),ot&&Promise.resolve().then(function(){ot(oe,Je)})}},[]);return de.useEffect(function(){var Je=Tt();return Je&&!H&&U(Je,Le),function(){return K(Je,Le)}},[W.current,H]),de.createElement(se,{ref:_},Me?de.cloneElement(Y,{ref:Ye}):Y)}var ne=de.forwardRef(ae),Q=ne,ye="rc-observer-key";function ce(L,V){var $=L.children,H=typeof $=="function"?[$]:(0,De.Z)($);return H.map(function(W,_){var g=(W==null?void 0:W.key)||"".concat(ye,"-").concat(_);return de.createElement(Q,(0,T.Z)({},L,{key:g,ref:_===0?V:void 0}),W)})}var Oe=de.forwardRef(ce);Oe.Collection=S;var Z=Oe},6551:function(vn,St,C){"use strict";C.d(St,{ZP:function(){return fe}});var T=C(11036),de=C(59301),De=C(47273),re=0,M=(0,De.Z)();function p(){var ie;return M?(ie=re,re+=1):ie="TEST_OR_SSR",ie}function fe(ie){var l=de.useState(),S=(0,T.Z)(l,2),w=S[0],d=S[1];return de.useEffect(function(){d("rc_select_".concat(p()))},[]),ie||w}},37463:function(vn,St,C){"use strict";C.d(St,{Ac:function(){return lt},Xo:function(){return xt},Wx:function(){return Gt},ZP:function(){return Hn},lk:function(){return A}});var T=C(71409),de=C(62730),De=C(87075),re=C(89490),M=C(11036),p=C(39224),fe=C(28788),ie=C(18929),l=C(48736),S=C(59301),w=C(92310),d=C.n(w),m=C(34280),y=C(49658),x=C(8654),N=function(Ee){var _t=Ee.className,ct=Ee.customizeIcon,tt=Ee.customizeIconProps,$t=Ee.children,je=Ee.onMouseDown,Ve=Ee.onClick,ht=typeof ct=="function"?ct(tt):ct;return S.createElement("span",{className:_t,onMouseDown:function(Vt){Vt.preventDefault(),je==null||je(Vt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Ve,"aria-hidden":!0},ht!==void 0?ht:S.createElement("span",{className:d()(_t.split(/\s+/).map(function(nt){return"".concat(nt,"-icon")}))},$t))},U=N,K=function(Ee,_t,ct,tt,$t){var je=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Ve=arguments.length>6?arguments[6]:void 0,ht=arguments.length>7?arguments[7]:void 0,nt=S.useMemo(function(){if((0,fe.Z)(tt)==="object")return tt.clearIcon;if($t)return $t},[tt,$t]),Vt=S.useMemo(function(){return!!(!je&&tt&&(ct.length||Ve)&&!(ht==="combobox"&&Ve===""))},[tt,je,ct.length,Ve,ht]);return{allowClear:Vt,clearIcon:S.createElement(U,{className:"".concat(Ee,"-clear"),onMouseDown:_t,customizeIcon:nt},"\xD7")}},D=S.createContext(null);function A(){return S.useContext(D)}function P(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ee=S.useState(!1),_t=(0,M.Z)(Ee,2),ct=_t[0],tt=_t[1],$t=S.useRef(null),je=function(){window.clearTimeout($t.current)};S.useEffect(function(){return je},[]);var Ve=function(nt,Vt){je(),$t.current=window.setTimeout(function(){tt(nt),Vt&&Vt()},Se)};return[ct,Ve,je]}function z(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ee=S.useRef(null),_t=S.useRef(null);S.useEffect(function(){return function(){window.clearTimeout(_t.current)}},[]);function ct(tt){(tt||Ee.current===null)&&(Ee.current=tt),window.clearTimeout(_t.current),_t.current=window.setTimeout(function(){Ee.current=null},Se)}return[function(){return Ee.current},ct]}function se(Se,Ee,_t,ct){var tt=S.useRef(null);tt.current={open:Ee,triggerOpen:_t,customizedTrigger:ct},S.useEffect(function(){function $t(je){var Ve;if(!((Ve=tt.current)!==null&&Ve!==void 0&&Ve.customizedTrigger)){var ht=je.target;ht.shadowRoot&&je.composed&&(ht=je.composedPath()[0]||ht),tt.current.open&&Se().filter(function(nt){return nt}).every(function(nt){return!nt.contains(ht)&&nt!==ht})&&tt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",$t),function(){return window.removeEventListener("mousedown",$t)}},[])}var ae=C(10228);function ne(Se){return Se&&![ae.Z.ESC,ae.Z.SHIFT,ae.Z.BACKSPACE,ae.Z.TAB,ae.Z.WIN_KEY,ae.Z.ALT,ae.Z.META,ae.Z.WIN_KEY_RIGHT,ae.Z.CTRL,ae.Z.SEMICOLON,ae.Z.EQUALS,ae.Z.CAPS_LOCK,ae.Z.CONTEXT_MENU,ae.Z.F1,ae.Z.F2,ae.Z.F3,ae.Z.F4,ae.Z.F5,ae.Z.F6,ae.Z.F7,ae.Z.F8,ae.Z.F9,ae.Z.F10,ae.Z.F11,ae.Z.F12].includes(Se)}var Q=C(26112),ye=C(11780);function ce(Se,Ee,_t){var ct=(0,re.Z)((0,re.Z)({},Se),_t?Ee:{});return Object.keys(Ee).forEach(function(tt){var $t=Ee[tt];typeof $t=="function"&&(ct[tt]=function(){for(var je,Ve=arguments.length,ht=new Array(Ve),nt=0;nt<Ve;nt++)ht[nt]=arguments[nt];return $t.apply(void 0,ht),(je=Se[tt])===null||je===void 0?void 0:je.call.apply(je,[Se].concat(ht))})}),ct}var Oe=ce,Z=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],L=function(Ee,_t){var ct=Ee.prefixCls,tt=Ee.id,$t=Ee.inputElement,je=Ee.autoFocus,Ve=Ee.autoComplete,ht=Ee.editable,nt=Ee.activeDescendantId,Vt=Ee.value,Zt=Ee.open,It=Ee.attrs,wt=(0,p.Z)(Ee,Z),he=$t||S.createElement("input",null),Ie=he,Fe=Ie.ref,Ue=Ie.props;return(0,l.Kp)(!("maxLength"in he.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),he=S.cloneElement(he,(0,re.Z)((0,re.Z)((0,re.Z)({type:"search"},Oe(wt,Ue,!0)),{},{id:tt,ref:(0,x.sQ)(_t,Fe),autoComplete:Ve||"off",autoFocus:je,className:d()("".concat(ct,"-selection-search-input"),Ue==null?void 0:Ue.className),role:"combobox","aria-expanded":Zt||!1,"aria-haspopup":"listbox","aria-owns":"".concat(tt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(tt,"_list"),"aria-activedescendant":Zt?nt:void 0},It),{},{value:ht?Vt:"",readOnly:!ht,unselectable:ht?null:"on",style:(0,re.Z)((0,re.Z)({},Ue.style),{},{opacity:ht?null:0})})),he},V=S.forwardRef(L),$=V;function H(Se){return Array.isArray(Se)?Se:Se!==void 0?[Se]:[]}var W=typeof window!="undefined"&&window.document&&window.document.documentElement,_=W;function g(Se){return Se!=null}function O(Se){return!Se&&Se!==0}function Y(Se){return["string","number"].includes((0,fe.Z)(Se))}function Pe(Se){var Ee=void 0;return Se&&(Y(Se.title)?Ee=Se.title.toString():Y(Se.label)&&(Ee=Se.label.toString())),Ee}function Me(Se,Ee){_?S.useLayoutEffect(Se,Ee):S.useEffect(Se,Ee)}function Xe(Se){var Ee;return(Ee=Se.key)!==null&&Ee!==void 0?Ee:Se.value}var Ye=function(Ee){Ee.preventDefault(),Ee.stopPropagation()},Tt=function(Ee){var _t=Ee.id,ct=Ee.prefixCls,tt=Ee.values,$t=Ee.open,je=Ee.searchValue,Ve=Ee.autoClearSearchValue,ht=Ee.inputRef,nt=Ee.placeholder,Vt=Ee.disabled,Zt=Ee.mode,It=Ee.showSearch,wt=Ee.autoFocus,he=Ee.autoComplete,Ie=Ee.activeDescendantId,Fe=Ee.tabIndex,Ue=Ee.removeIcon,it=Ee.maxTagCount,at=Ee.maxTagTextLength,qe=Ee.maxTagPlaceholder,yt=qe===void 0?function(Ht){return"+ ".concat(Ht.length," ...")}:qe,Dt=Ee.tagRender,kt=Ee.onToggleOpen,qt=Ee.onRemove,Lt=Ee.onInputChange,nn=Ee.onInputPaste,cn=Ee.onInputKeyDown,ln=Ee.onInputMouseDown,Xt=Ee.onInputCompositionStart,jt=Ee.onInputCompositionEnd,dn=Ee.onInputBlur,Rt=S.useRef(null),Nt=(0,S.useState)(0),Kt=(0,M.Z)(Nt,2),pn=Kt[0],Jt=Kt[1],fn=(0,S.useState)(!1),An=(0,M.Z)(fn,2),Pn=An[0],ni=An[1],Fn="".concat(ct,"-selection"),On=$t||Zt==="multiple"&&Ve===!1||Zt==="tags"?je:"",Zn=Zt==="tags"||Zt==="multiple"&&Ve===!1||It&&($t||Pn);Me(function(){Jt(Rt.current.scrollWidth)},[On]);var ai=function(Wt,hn,Gn,Vn,Mn){return S.createElement("span",{title:Pe(Wt),className:d()("".concat(Fn,"-item"),(0,De.Z)({},"".concat(Fn,"-item-disabled"),Gn))},S.createElement("span",{className:"".concat(Fn,"-item-content")},hn),Vn&&S.createElement(U,{className:"".concat(Fn,"-item-remove"),onMouseDown:Ye,onClick:Mn,customizeIcon:Ue},"\xD7"))},qn=function(Wt,hn,Gn,Vn,Mn,ri){var ci=function(wi){Ye(wi),kt(!$t)};return S.createElement("span",{onMouseDown:ci},Dt({label:hn,value:Wt,disabled:Gn,closable:Vn,onClose:Mn,isMaxTag:!!ri}))},Yn=function(Wt){var hn=Wt.disabled,Gn=Wt.label,Vn=Wt.value,Mn=!Vt&&!hn,ri=Gn;if(typeof at=="number"&&(typeof Gn=="string"||typeof Gn=="number")){var ci=String(ri);ci.length>at&&(ri="".concat(ci.slice(0,at),"..."))}var yi=function(In){In&&In.stopPropagation(),qt(Wt)};return typeof Dt=="function"?qn(Vn,ri,hn,Mn,yi):ai(Wt,ri,hn,Mn,yi)},on=function(Wt){if(!tt.length)return null;var hn=typeof yt=="function"?yt(Wt):yt;return typeof Dt=="function"?qn(void 0,hn,!1,!1,void 0,!0):ai({title:hn},hn,!1)},bt=S.createElement("div",{className:"".concat(Fn,"-search"),style:{width:pn},onFocus:function(){ni(!0)},onBlur:function(){ni(!1)}},S.createElement($,{ref:ht,open:$t,prefixCls:ct,id:_t,inputElement:null,disabled:Vt,autoFocus:wt,autoComplete:he,editable:Zn,activeDescendantId:Ie,value:On,onKeyDown:cn,onMouseDown:ln,onChange:Lt,onPaste:nn,onCompositionStart:Xt,onCompositionEnd:jt,onBlur:dn,tabIndex:Fe,attrs:(0,Q.Z)(Ee,!0)}),S.createElement("span",{ref:Rt,className:"".concat(Fn,"-search-mirror"),"aria-hidden":!0},On,"\xA0")),mt=S.createElement(ye.Z,{prefixCls:"".concat(Fn,"-overflow"),data:tt,renderItem:Yn,renderRest:on,suffix:bt,itemKey:Xe,maxCount:it});return S.createElement("span",{className:"".concat(Fn,"-wrap")},mt,!tt.length&&!On&&S.createElement("span",{className:"".concat(Fn,"-placeholder")},nt))},gt=Tt,Le=function(Ee){var _t=Ee.inputElement,ct=Ee.prefixCls,tt=Ee.id,$t=Ee.inputRef,je=Ee.disabled,Ve=Ee.autoFocus,ht=Ee.autoComplete,nt=Ee.activeDescendantId,Vt=Ee.mode,Zt=Ee.open,It=Ee.values,wt=Ee.placeholder,he=Ee.tabIndex,Ie=Ee.showSearch,Fe=Ee.searchValue,Ue=Ee.activeValue,it=Ee.maxLength,at=Ee.onInputKeyDown,qe=Ee.onInputMouseDown,yt=Ee.onInputChange,Dt=Ee.onInputPaste,kt=Ee.onInputCompositionStart,qt=Ee.onInputCompositionEnd,Lt=Ee.onInputBlur,nn=Ee.title,cn=S.useState(!1),ln=(0,M.Z)(cn,2),Xt=ln[0],jt=ln[1],dn=Vt==="combobox",Rt=dn||Ie,Nt=It[0],Kt=Fe||"";dn&&Ue&&!Xt&&(Kt=Ue),S.useEffect(function(){dn&&jt(!1)},[dn,Ue]);var pn=Vt!=="combobox"&&!Zt&&!Ie?!1:!!Kt,Jt=nn===void 0?Pe(Nt):nn,fn=S.useMemo(function(){return Nt?null:S.createElement("span",{className:"".concat(ct,"-selection-placeholder"),style:pn?{visibility:"hidden"}:void 0},wt)},[Nt,pn,wt,ct]);return S.createElement("span",{className:"".concat(ct,"-selection-wrap")},S.createElement("span",{className:"".concat(ct,"-selection-search")},S.createElement($,{ref:$t,prefixCls:ct,id:tt,open:Zt,inputElement:_t,disabled:je,autoFocus:Ve,autoComplete:ht,editable:Rt,activeDescendantId:nt,value:Kt,onKeyDown:at,onMouseDown:qe,onChange:function(Pn){jt(!0),yt(Pn)},onPaste:Dt,onCompositionStart:kt,onCompositionEnd:qt,onBlur:Lt,tabIndex:he,attrs:(0,Q.Z)(Ee,!0),maxLength:dn?it:void 0})),!dn&&Nt?S.createElement("span",{className:"".concat(ct,"-selection-item"),title:Jt,style:pn?{visibility:"hidden"}:void 0},Nt.label):null,fn)},Je=Le,Et=function(Ee,_t){var ct=(0,S.useRef)(null),tt=(0,S.useRef)(!1),$t=Ee.prefixCls,je=Ee.open,Ve=Ee.mode,ht=Ee.showSearch,nt=Ee.tokenWithEnter,Vt=Ee.disabled,Zt=Ee.prefix,It=Ee.autoClearSearchValue,wt=Ee.onSearch,he=Ee.onSearchSubmit,Ie=Ee.onToggleOpen,Fe=Ee.onInputKeyDown,Ue=Ee.onInputBlur,it=Ee.domRef;S.useImperativeHandle(_t,function(){return{focus:function(Jt){ct.current.focus(Jt)},blur:function(){ct.current.blur()}}});var at=z(0),qe=(0,M.Z)(at,2),yt=qe[0],Dt=qe[1],kt=function(Jt){var fn=Jt.which,An=ct.current instanceof HTMLTextAreaElement;!An&&je&&(fn===ae.Z.UP||fn===ae.Z.DOWN)&&Jt.preventDefault(),Fe&&Fe(Jt),fn===ae.Z.ENTER&&Ve==="tags"&&!tt.current&&!je&&(he==null||he(Jt.target.value)),!(An&&!je&&~[ae.Z.UP,ae.Z.DOWN,ae.Z.LEFT,ae.Z.RIGHT].indexOf(fn))&&ne(fn)&&Ie(!0)},qt=function(){Dt(!0)},Lt=(0,S.useRef)(null),nn=function(Jt){wt(Jt,!0,tt.current)!==!1&&Ie(!0)},cn=function(){tt.current=!0},ln=function(Jt){tt.current=!1,Ve!=="combobox"&&nn(Jt.target.value)},Xt=function(Jt){var fn=Jt.target.value;if(nt&&Lt.current&&/[\r\n]/.test(Lt.current)){var An=Lt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");fn=fn.replace(An,Lt.current)}Lt.current=null,nn(fn)},jt=function(Jt){var fn=Jt.clipboardData,An=fn==null?void 0:fn.getData("text");Lt.current=An||""},dn=function(Jt){var fn=Jt.target;if(fn!==ct.current){var An=document.body.style.msTouchAction!==void 0;An?setTimeout(function(){ct.current.focus()}):ct.current.focus()}},Rt=function(Jt){var fn=yt();Jt.target!==ct.current&&!fn&&!(Ve==="combobox"&&Vt)&&Jt.preventDefault(),(Ve!=="combobox"&&(!ht||!fn)||!je)&&(je&&It!==!1&&wt("",!0,!1),Ie())},Nt={inputRef:ct,onInputKeyDown:kt,onInputMouseDown:qt,onInputChange:Xt,onInputPaste:jt,onInputCompositionStart:cn,onInputCompositionEnd:ln,onInputBlur:Ue},Kt=Ve==="multiple"||Ve==="tags"?S.createElement(gt,(0,T.Z)({},Ee,Nt)):S.createElement(Je,(0,T.Z)({},Ee,Nt));return S.createElement("div",{ref:it,className:"".concat($t,"-selector"),onClick:dn,onMouseDown:Rt},Zt&&S.createElement("div",{className:"".concat($t,"-prefix")},Zt),Kt)},ot=S.forwardRef(Et),rn=ot,Ze=C(65352),ge=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],le=function(Ee){var _t=Ee===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:_t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:_t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:_t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:_t,adjustY:1},htmlRegion:"scroll"}}},G=function(Ee,_t){var ct=Ee.prefixCls,tt=Ee.disabled,$t=Ee.visible,je=Ee.children,Ve=Ee.popupElement,ht=Ee.animation,nt=Ee.transitionName,Vt=Ee.dropdownStyle,Zt=Ee.dropdownClassName,It=Ee.direction,wt=It===void 0?"ltr":It,he=Ee.placement,Ie=Ee.builtinPlacements,Fe=Ee.dropdownMatchSelectWidth,Ue=Ee.dropdownRender,it=Ee.dropdownAlign,at=Ee.getPopupContainer,qe=Ee.empty,yt=Ee.getTriggerDOMNode,Dt=Ee.onPopupVisibleChange,kt=Ee.onPopupMouseEnter,qt=(0,p.Z)(Ee,ge),Lt="".concat(ct,"-dropdown"),nn=Ve;Ue&&(nn=Ue(Ve));var cn=S.useMemo(function(){return Ie||le(Fe)},[Ie,Fe]),ln=ht?"".concat(Lt,"-").concat(ht):nt,Xt=typeof Fe=="number",jt=S.useMemo(function(){return Xt?null:Fe===!1?"minWidth":"width"},[Fe,Xt]),dn=Vt;Xt&&(dn=(0,re.Z)((0,re.Z)({},dn),{},{width:Fe}));var Rt=S.useRef(null);return S.useImperativeHandle(_t,function(){return{getPopupElement:function(){var Kt;return(Kt=Rt.current)===null||Kt===void 0?void 0:Kt.popupElement}}}),S.createElement(Ze.Z,(0,T.Z)({},qt,{showAction:Dt?["click"]:[],hideAction:Dt?["click"]:[],popupPlacement:he||(wt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:cn,prefixCls:Lt,popupTransitionName:ln,popup:S.createElement("div",{onMouseEnter:kt},nn),ref:Rt,stretch:jt,popupAlign:it,popupVisible:$t,getPopupContainer:at,popupClassName:d()(Zt,(0,De.Z)({},"".concat(Lt,"-empty"),qe)),popupStyle:dn,getTriggerDOMNode:yt,onPopupVisibleChange:Dt}),je)},be=S.forwardRef(G),ke=be,Ne=C(67900);function k(Se,Ee){var _t=Se.key,ct;return"value"in Se&&(ct=Se.value),_t!=null?_t:ct!==void 0?ct:"rc-index-key-".concat(Ee)}function F(Se){return typeof Se!="undefined"&&!Number.isNaN(Se)}function ee(Se,Ee){var _t=Se||{},ct=_t.label,tt=_t.value,$t=_t.options,je=_t.groupLabel,Ve=ct||(Ee?"children":"label");return{label:Ve,value:tt||"value",options:$t||"options",groupLabel:je||Ve}}function oe(Se){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_t=Ee.fieldNames,ct=Ee.childrenAsData,tt=[],$t=ee(_t,!1),je=$t.label,Ve=$t.value,ht=$t.options,nt=$t.groupLabel;function Vt(Zt,It){Array.isArray(Zt)&&Zt.forEach(function(wt){if(It||!(ht in wt)){var he=wt[Ve];tt.push({key:k(wt,tt.length),groupOption:It,data:wt,label:wt[je],value:he})}else{var Ie=wt[nt];Ie===void 0&&ct&&(Ie=wt.label),tt.push({key:k(wt,tt.length),group:!0,data:wt,label:Ie}),Vt(wt[ht],!0)}})}return Vt(Se,!1),tt}function J(Se){var Ee=(0,re.Z)({},Se);return"props"in Ee||Object.defineProperty(Ee,"props",{get:function(){return(0,l.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ee}}),Ee}var me=function(Ee,_t,ct){if(!_t||!_t.length)return null;var tt=!1,$t=function Ve(ht,nt){var Vt=(0,Ne.Z)(nt),Zt=Vt[0],It=Vt.slice(1);if(!Zt)return[ht];var wt=ht.split(Zt);return tt=tt||wt.length>1,wt.reduce(function(he,Ie){return[].concat((0,de.Z)(he),(0,de.Z)(Ve(Ie,It)))},[]).filter(Boolean)},je=$t(Ee,_t);return tt?typeof ct!="undefined"?je.slice(0,ct):je:null},Te=S.createContext(null),pe=Te;function _e(Se){var Ee=Se.visible,_t=Se.values;if(!Ee)return null;var ct=50;return S.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(_t.slice(0,ct).map(function(tt){var $t=tt.label,je=tt.value;return["number","string"].includes((0,fe.Z)($t))?$t:je}).join(", ")),_t.length>ct?", ...":null)}var Ce=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Ge=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],He=function(Ee){return Ee==="tags"||Ee==="multiple"},et=S.forwardRef(function(Se,Ee){var _t,ct=Se.id,tt=Se.prefixCls,$t=Se.className,je=Se.showSearch,Ve=Se.tagRender,ht=Se.direction,nt=Se.omitDomProps,Vt=Se.displayValues,Zt=Se.onDisplayValuesChange,It=Se.emptyOptions,wt=Se.notFoundContent,he=wt===void 0?"Not Found":wt,Ie=Se.onClear,Fe=Se.mode,Ue=Se.disabled,it=Se.loading,at=Se.getInputElement,qe=Se.getRawInputElement,yt=Se.open,Dt=Se.defaultOpen,kt=Se.onDropdownVisibleChange,qt=Se.activeValue,Lt=Se.onActiveValueChange,nn=Se.activeDescendantId,cn=Se.searchValue,ln=Se.autoClearSearchValue,Xt=Se.onSearch,jt=Se.onSearchSplit,dn=Se.tokenSeparators,Rt=Se.allowClear,Nt=Se.prefix,Kt=Se.suffixIcon,pn=Se.clearIcon,Jt=Se.OptionList,fn=Se.animation,An=Se.transitionName,Pn=Se.dropdownStyle,ni=Se.dropdownClassName,Fn=Se.dropdownMatchSelectWidth,On=Se.dropdownRender,Zn=Se.dropdownAlign,ai=Se.placement,qn=Se.builtinPlacements,Yn=Se.getPopupContainer,on=Se.showAction,bt=on===void 0?[]:on,mt=Se.onFocus,Ht=Se.onBlur,Wt=Se.onKeyUp,hn=Se.onKeyDown,Gn=Se.onMouseDown,Vn=(0,p.Z)(Se,Ce),Mn=He(Fe),ri=(je!==void 0?je:Mn)||Fe==="combobox",ci=(0,re.Z)({},Vn);Ge.forEach(function(ti){delete ci[ti]}),nt==null||nt.forEach(function(ti){delete ci[ti]});var yi=S.useState(!1),wi=(0,M.Z)(yi,2),In=wi[0],Li=wi[1];S.useEffect(function(){Li((0,y.Z)())},[]);var Ti=S.useRef(null),gi=S.useRef(null),oi=S.useRef(null),gn=S.useRef(null),mi=S.useRef(null),Ai=S.useRef(!1),$i=P(),Oi=(0,M.Z)($i,3),Mi=Oi[0],Di=Oi[1],Wi=Oi[2];S.useImperativeHandle(Ee,function(){var ti,jn;return{focus:(ti=gn.current)===null||ti===void 0?void 0:ti.focus,blur:(jn=gn.current)===null||jn===void 0?void 0:jn.blur,scrollTo:function(Gi){var Ii;return(Ii=mi.current)===null||Ii===void 0?void 0:Ii.scrollTo(Gi)},nativeElement:Ti.current||gi.current}});var Xn=S.useMemo(function(){var ti;if(Fe!=="combobox")return cn;var jn=(ti=Vt[0])===null||ti===void 0?void 0:ti.value;return typeof jn=="string"||typeof jn=="number"?String(jn):""},[cn,Fe,Vt]),ji=Fe==="combobox"&&typeof at=="function"&&at()||null,bi=typeof qe=="function"&&qe(),lr=(0,x.x1)(gi,bi==null||(_t=bi.props)===null||_t===void 0?void 0:_t.ref),Xi=S.useState(!1),Hi=(0,M.Z)(Xi,2),nr=Hi[0],Fi=Hi[1];(0,m.Z)(function(){Fi(!0)},[]);var Ni=(0,ie.Z)(!1,{defaultValue:Dt,value:yt}),Ei=(0,M.Z)(Ni,2),Bi=Ei[0],Ri=Ei[1],fi=nr?Bi:!1,vi=!he&&It;(Ue||vi&&fi&&Fe==="combobox")&&(fi=!1);var hi=vi?!1:fi,Ot=S.useCallback(function(ti){var jn=ti!==void 0?ti:!fi;Ue||(Ri(jn),fi!==jn&&(kt==null||kt(jn)))},[Ue,fi,Ri,kt]),_n=S.useMemo(function(){return(dn||[]).some(function(ti){return[`
|
|
`,`\r
|
|
`].includes(ti)})},[dn]),bn=S.useContext(pe)||{},Dn=bn.maxCount,Jn=bn.rawValues,li=function(jn,Ki,Gi){if(!(Mn&&F(Dn)&&(Jn==null?void 0:Jn.size)>=Dn)){var Ii=!0,Pi=jn;Lt==null||Lt(null);var sr=me(jn,dn,F(Dn)?Dn-Jn.size:void 0),Ji=Gi?null:sr;return Fe!=="combobox"&&Ji&&(Pi="",jt==null||jt(Ji),Ot(!1),Ii=!1),Xt&&Xn!==Pi&&Xt(Pi,{source:Ki?"typing":"effect"}),Ii}},en=function(jn){!jn||!jn.trim()||Xt(jn,{source:"submit"})};S.useEffect(function(){!fi&&!Mn&&Fe!=="combobox"&&li("",!1,!1)},[fi]),S.useEffect(function(){Bi&&Ue&&Ri(!1),Ue&&!Ai.current&&Di(!1)},[Ue]);var yn=z(),ei=(0,M.Z)(yn,2),Qn=ei[0],ui=ei[1],zi=S.useRef(!1),Qi=function(jn){var Ki=Qn(),Gi=jn.key,Ii=Gi==="Enter";if(Ii&&(Fe!=="combobox"&&jn.preventDefault(),fi||Ot(!0)),ui(!!Xn),Gi==="Backspace"&&!Ki&&Mn&&!Xn&&Vt.length){for(var Pi=(0,de.Z)(Vt),sr=null,Ji=Pi.length-1;Ji>=0;Ji-=1){var hr=Pi[Ji];if(!hr.disabled){Pi.splice(Ji,1),sr=hr;break}}sr&&Zt(Pi,{type:"remove",values:[sr]})}for(var dr=arguments.length,er=new Array(dr>1?dr-1:0),Or=1;Or<dr;Or++)er[Or-1]=arguments[Or];if(fi&&(!Ii||!zi.current)){var Dr;Ii&&(zi.current=!0),(Dr=mi.current)===null||Dr===void 0||Dr.onKeyDown.apply(Dr,[jn].concat(er))}hn==null||hn.apply(void 0,[jn].concat(er))},Ui=function(jn){for(var Ki=arguments.length,Gi=new Array(Ki>1?Ki-1:0),Ii=1;Ii<Ki;Ii++)Gi[Ii-1]=arguments[Ii];if(fi){var Pi;(Pi=mi.current)===null||Pi===void 0||Pi.onKeyUp.apply(Pi,[jn].concat(Gi))}jn.key==="Enter"&&(zi.current=!1),Wt==null||Wt.apply(void 0,[jn].concat(Gi))},ir=function(jn){var Ki=Vt.filter(function(Gi){return Gi!==jn});Zt(Ki,{type:"remove",values:[jn]})},rr=function(){zi.current=!1},wr=S.useRef(!1),us=function(){Di(!0),Ue||(mt&&!wr.current&&mt.apply(void 0,arguments),bt.includes("focus")&&Ot(!0)),wr.current=!0},$r=function(){Ai.current=!0,Di(!1,function(){wr.current=!1,Ai.current=!1,Ot(!1)}),!Ue&&(Xn&&(Fe==="tags"?Xt(Xn,{source:"submit"}):Fe==="multiple"&&Xt("",{source:"blur"})),Ht&&Ht.apply(void 0,arguments))},br=[];S.useEffect(function(){return function(){br.forEach(function(ti){return clearTimeout(ti)}),br.splice(0,br.length)}},[]);var qi=function(jn){var Ki,Gi=jn.target,Ii=(Ki=oi.current)===null||Ki===void 0?void 0:Ki.getPopupElement();if(Ii&&Ii.contains(Gi)){var Pi=setTimeout(function(){var dr=br.indexOf(Pi);if(dr!==-1&&br.splice(dr,1),Wi(),!In&&!Ii.contains(document.activeElement)){var er;(er=gn.current)===null||er===void 0||er.focus()}});br.push(Pi)}for(var sr=arguments.length,Ji=new Array(sr>1?sr-1:0),hr=1;hr<sr;hr++)Ji[hr-1]=arguments[hr];Gn==null||Gn.apply(void 0,[jn].concat(Ji))},Tr=S.useState({}),cs=(0,M.Z)(Tr,2),Lr=cs[1];function fr(){Lr({})}var kr;bi&&(kr=function(jn){Ot(jn)}),se(function(){var ti;return[Ti.current,(ti=oi.current)===null||ti===void 0?void 0:ti.getPopupElement()]},hi,Ot,!!bi);var Kr=S.useMemo(function(){return(0,re.Z)((0,re.Z)({},Se),{},{notFoundContent:he,open:fi,triggerOpen:hi,id:ct,showSearch:ri,multiple:Mn,toggleOpen:Ot})},[Se,he,hi,fi,ct,ri,Mn,Ot]),Yr=!!Kt||it,Ar;Yr&&(Ar=S.createElement(U,{className:d()("".concat(tt,"-arrow"),(0,De.Z)({},"".concat(tt,"-arrow-loading"),it)),customizeIcon:Kt,customizeIconProps:{loading:it,searchValue:Xn,open:fi,focused:Mi,showSearch:ri}}));var Xr=function(){var jn;Ie==null||Ie(),(jn=gn.current)===null||jn===void 0||jn.focus(),Zt([],{type:"clear",values:Vt}),li("",!1,!1)},Pr=K(tt,Xr,Vt,Rt,pn,Ue,Xn,Fe),ur=Pr.allowClear,Qr=Pr.clearIcon,Gr=S.createElement(Jt,{ref:mi}),qr=d()(tt,$t,(0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)({},"".concat(tt,"-focused"),Mi),"".concat(tt,"-multiple"),Mn),"".concat(tt,"-single"),!Mn),"".concat(tt,"-allow-clear"),Rt),"".concat(tt,"-show-arrow"),Yr),"".concat(tt,"-disabled"),Ue),"".concat(tt,"-loading"),it),"".concat(tt,"-open"),fi),"".concat(tt,"-customize-input"),ji),"".concat(tt,"-show-search"),ri)),Vr=S.createElement(ke,{ref:oi,disabled:Ue,prefixCls:tt,visible:hi,popupElement:Gr,animation:fn,transitionName:An,dropdownStyle:Pn,dropdownClassName:ni,direction:ht,dropdownMatchSelectWidth:Fn,dropdownRender:On,dropdownAlign:Zn,placement:ai,builtinPlacements:qn,getPopupContainer:Yn,empty:It,getTriggerDOMNode:function(jn){return gi.current||jn},onPopupVisibleChange:kr,onPopupMouseEnter:fr},bi?S.cloneElement(bi,{ref:lr}):S.createElement(rn,(0,T.Z)({},Se,{domRef:gi,prefixCls:tt,inputElement:ji,ref:gn,id:ct,prefix:Nt,showSearch:ri,autoClearSearchValue:ln,mode:Fe,activeDescendantId:nn,tagRender:Ve,values:Vt,open:fi,onToggleOpen:Ot,activeValue:qt,searchValue:Xn,onSearch:li,onSearchSubmit:en,onRemove:ir,tokenWithEnter:_n,onInputBlur:rr}))),_r;return bi?_r=Vr:_r=S.createElement("div",(0,T.Z)({className:qr},ci,{ref:Ti,onMouseDown:qi,onKeyDown:Qi,onKeyUp:Ui,onFocus:us,onBlur:$r}),S.createElement(_e,{visible:Mi&&!fi,values:Vt}),Vr,Ar,ur&&Qr),S.createElement(D.Provider,{value:Kr},_r)}),lt=et,Pt=function(){return null};Pt.isSelectOptGroup=!0;var xt=Pt,ut=function(){return null};ut.isSelectOption=!0;var Gt=ut,an=C(80547),Ct=C(2738),un=C(65283);function Nn(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var At=["disabled","title","children","style","className"];function Qt(Se){return typeof Se=="string"||typeof Se=="number"}var Re=function(Ee,_t){var ct=A(),tt=ct.prefixCls,$t=ct.id,je=ct.open,Ve=ct.multiple,ht=ct.mode,nt=ct.searchValue,Vt=ct.toggleOpen,Zt=ct.notFoundContent,It=ct.onPopupScroll,wt=S.useContext(pe),he=wt.maxCount,Ie=wt.flattenOptions,Fe=wt.onActiveValue,Ue=wt.defaultActiveFirstOption,it=wt.onSelect,at=wt.menuItemSelectedIcon,qe=wt.rawValues,yt=wt.fieldNames,Dt=wt.virtual,kt=wt.direction,qt=wt.listHeight,Lt=wt.listItemHeight,nn=wt.optionRender,cn="".concat(tt,"-item"),ln=(0,an.Z)(function(){return Ie},[je,Ie],function(on,bt){return bt[0]&&on[1]!==bt[1]}),Xt=S.useRef(null),jt=S.useMemo(function(){return Ve&&F(he)&&(qe==null?void 0:qe.size)>=he},[Ve,he,qe==null?void 0:qe.size]),dn=function(bt){bt.preventDefault()},Rt=function(bt){var mt;(mt=Xt.current)===null||mt===void 0||mt.scrollTo(typeof bt=="number"?{index:bt}:bt)},Nt=S.useCallback(function(on){return ht==="combobox"?!1:qe.has(on)},[ht,(0,de.Z)(qe).toString(),qe.size]),Kt=function(bt){for(var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ht=ln.length,Wt=0;Wt<Ht;Wt+=1){var hn=(bt+Wt*mt+Ht)%Ht,Gn=ln[hn]||{},Vn=Gn.group,Mn=Gn.data;if(!Vn&&!(Mn!=null&&Mn.disabled)&&(Nt(Mn.value)||!jt))return hn}return-1},pn=S.useState(function(){return Kt(0)}),Jt=(0,M.Z)(pn,2),fn=Jt[0],An=Jt[1],Pn=function(bt){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;An(bt);var Ht={source:mt?"keyboard":"mouse"},Wt=ln[bt];if(!Wt){Fe(null,-1,Ht);return}Fe(Wt.value,bt,Ht)};(0,S.useEffect)(function(){Pn(Ue!==!1?Kt(0):-1)},[ln.length,nt]);var ni=S.useCallback(function(on){return ht==="combobox"?String(on).toLowerCase()===nt.toLowerCase():qe.has(on)},[ht,nt,(0,de.Z)(qe).toString(),qe.size]);(0,S.useEffect)(function(){var on=setTimeout(function(){if(!Ve&&je&&qe.size===1){var mt=Array.from(qe)[0],Ht=ln.findIndex(function(Wt){var hn=Wt.data;return nt?String(hn.value).startsWith(nt):hn.value===mt});Ht!==-1&&(Pn(Ht),Rt(Ht))}});if(je){var bt;(bt=Xt.current)===null||bt===void 0||bt.scrollTo(void 0)}return function(){return clearTimeout(on)}},[je,nt]);var Fn=function(bt){bt!==void 0&&it(bt,{selected:!qe.has(bt)}),Ve||Vt(!1)};if(S.useImperativeHandle(_t,function(){return{onKeyDown:function(bt){var mt=bt.which,Ht=bt.ctrlKey;switch(mt){case ae.Z.N:case ae.Z.P:case ae.Z.UP:case ae.Z.DOWN:{var Wt=0;if(mt===ae.Z.UP?Wt=-1:mt===ae.Z.DOWN?Wt=1:Nn()&&Ht&&(mt===ae.Z.N?Wt=1:mt===ae.Z.P&&(Wt=-1)),Wt!==0){var hn=Kt(fn+Wt,Wt);Rt(hn),Pn(hn,!0)}break}case ae.Z.TAB:case ae.Z.ENTER:{var Gn,Vn=ln[fn];Vn&&!(Vn!=null&&(Gn=Vn.data)!==null&&Gn!==void 0&&Gn.disabled)&&!jt?Fn(Vn.value):Fn(void 0),je&&bt.preventDefault();break}case ae.Z.ESC:Vt(!1),je&&bt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(bt){Rt(bt)}}}),ln.length===0)return S.createElement("div",{role:"listbox",id:"".concat($t,"_list"),className:"".concat(cn,"-empty"),onMouseDown:dn},Zt);var On=Object.keys(yt).map(function(on){return yt[on]}),Zn=function(bt){return bt.label};function ai(on,bt){var mt=on.group;return{role:mt?"presentation":"option",id:"".concat($t,"_list_").concat(bt)}}var qn=function(bt){var mt=ln[bt];if(!mt)return null;var Ht=mt.data||{},Wt=Ht.value,hn=mt.group,Gn=(0,Q.Z)(Ht,!0),Vn=Zn(mt);return mt?S.createElement("div",(0,T.Z)({"aria-label":typeof Vn=="string"&&!hn?Vn:null},Gn,{key:bt},ai(mt,bt),{"aria-selected":ni(Wt)}),Wt):null},Yn={role:"listbox",id:"".concat($t,"_list")};return S.createElement(S.Fragment,null,Dt&&S.createElement("div",(0,T.Z)({},Yn,{style:{height:0,width:0,overflow:"hidden"}}),qn(fn-1),qn(fn),qn(fn+1)),S.createElement(un.Z,{itemKey:"key",ref:Xt,data:ln,height:qt,itemHeight:Lt,fullHeight:!1,onMouseDown:dn,onScroll:It,virtual:Dt,direction:kt,innerProps:Dt?null:Yn},function(on,bt){var mt=on.group,Ht=on.groupOption,Wt=on.data,hn=on.label,Gn=on.value,Vn=Wt.key;if(mt){var Mn,ri=(Mn=Wt.title)!==null&&Mn!==void 0?Mn:Qt(hn)?hn.toString():void 0;return S.createElement("div",{className:d()(cn,"".concat(cn,"-group"),Wt.className),title:ri},hn!==void 0?hn:Vn)}var ci=Wt.disabled,yi=Wt.title,wi=Wt.children,In=Wt.style,Li=Wt.className,Ti=(0,p.Z)(Wt,At),gi=(0,Ct.Z)(Ti,On),oi=Nt(Gn),gn=ci||!oi&&jt,mi="".concat(cn,"-option"),Ai=d()(cn,mi,Li,(0,De.Z)((0,De.Z)((0,De.Z)((0,De.Z)({},"".concat(mi,"-grouped"),Ht),"".concat(mi,"-active"),fn===bt&&!gn),"".concat(mi,"-disabled"),gn),"".concat(mi,"-selected"),oi)),$i=Zn(on),Oi=!at||typeof at=="function"||oi,Mi=typeof $i=="number"?$i:$i||Gn,Di=Qt(Mi)?Mi.toString():void 0;return yi!==void 0&&(Di=yi),S.createElement("div",(0,T.Z)({},(0,Q.Z)(gi),Dt?{}:ai(on,bt),{"aria-selected":ni(Gn),className:Ai,title:Di,onMouseMove:function(){fn===bt||gn||Pn(bt)},onClick:function(){gn||Fn(Gn)},style:In}),S.createElement("div",{className:"".concat(mi,"-content")},typeof nn=="function"?nn(on,{index:bt}):Mi),S.isValidElement(at)||oi,Oi&&S.createElement(U,{className:"".concat(cn,"-option-state"),customizeIcon:at,customizeIconProps:{value:Gn,disabled:gn,isSelected:oi}},oi?"\u2713":null))}))},xe=S.forwardRef(Re),Ae=xe,B=function(Se,Ee){var _t=S.useRef({values:new Map,options:new Map}),ct=S.useMemo(function(){var $t=_t.current,je=$t.values,Ve=$t.options,ht=Se.map(function(Zt){if(Zt.label===void 0){var It;return(0,re.Z)((0,re.Z)({},Zt),{},{label:(It=je.get(Zt.value))===null||It===void 0?void 0:It.label})}return Zt}),nt=new Map,Vt=new Map;return ht.forEach(function(Zt){nt.set(Zt.value,Zt),Vt.set(Zt.value,Ee.get(Zt.value)||Ve.get(Zt.value))}),_t.current.values=nt,_t.current.options=Vt,ht},[Se,Ee]),tt=S.useCallback(function($t){return Ee.get($t)||_t.current.options.get($t)},[Ee]);return[ct,tt]};function j(Se,Ee){return H(Se).join("").toUpperCase().includes(Ee)}var te=function(Se,Ee,_t,ct,tt){return S.useMemo(function(){if(!_t||ct===!1)return Se;var $t=Ee.options,je=Ee.label,Ve=Ee.value,ht=[],nt=typeof ct=="function",Vt=_t.toUpperCase(),Zt=nt?ct:function(wt,he){return tt?j(he[tt],Vt):he[$t]?j(he[je!=="children"?je:"label"],Vt):j(he[Ve],Vt)},It=nt?function(wt){return J(wt)}:function(wt){return wt};return Se.forEach(function(wt){if(wt[$t]){var he=Zt(_t,It(wt));if(he)ht.push(wt);else{var Ie=wt[$t].filter(function(Fe){return Zt(_t,It(Fe))});Ie.length&&ht.push((0,re.Z)((0,re.Z)({},wt),{},(0,De.Z)({},$t,Ie)))}return}Zt(_t,It(wt))&&ht.push(wt)}),ht},[Se,ct,tt,_t,Ee])},q=C(6551),we=C(11592),vt=["children","value"],st=["children"];function ft(Se){var Ee=Se,_t=Ee.key,ct=Ee.props,tt=ct.children,$t=ct.value,je=(0,p.Z)(ct,vt);return(0,re.Z)({key:_t,value:$t!==void 0?$t:_t,children:tt},je)}function Mt(Se){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,we.Z)(Se).map(function(_t,ct){if(!S.isValidElement(_t)||!_t.type)return null;var tt=_t,$t=tt.type.isSelectOptGroup,je=tt.key,Ve=tt.props,ht=Ve.children,nt=(0,p.Z)(Ve,st);return Ee||!$t?ft(_t):(0,re.Z)((0,re.Z)({key:"__RC_SELECT_GRP__".concat(je===null?ct:je,"__"),label:je},nt),{},{options:Mt(ht)})}).filter(function(_t){return _t})}var Sn=function(Ee,_t,ct,tt,$t){return S.useMemo(function(){var je=Ee,Ve=!Ee;Ve&&(je=Mt(_t));var ht=new Map,nt=new Map,Vt=function(wt,he,Ie){Ie&&typeof Ie=="string"&&wt.set(he[Ie],he)},Zt=function It(wt){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ie=0;Ie<wt.length;Ie+=1){var Fe=wt[Ie];!Fe[ct.options]||he?(ht.set(Fe[ct.value],Fe),Vt(nt,Fe,ct.label),Vt(nt,Fe,tt),Vt(nt,Fe,$t)):It(Fe[ct.options],!0)}};return Zt(je),{options:je,valueOptions:ht,labelOptions:nt}},[Ee,_t,ct,tt,$t])},En=Sn;function Ft(Se){var Ee=S.useRef();Ee.current=Se;var _t=S.useCallback(function(){return Ee.current.apply(Ee,arguments)},[]);return _t}function Yt(Se){var Ee=Se.mode,_t=Se.options,ct=Se.children,tt=Se.backfill,$t=Se.allowClear,je=Se.placeholder,Ve=Se.getInputElement,ht=Se.showSearch,nt=Se.onSearch,Vt=Se.defaultOpen,Zt=Se.autoFocus,It=Se.labelInValue,wt=Se.value,he=Se.inputValue,Ie=Se.optionLabelProp,Fe=isMultiple(Ee),Ue=ht!==void 0?ht:Fe||Ee==="combobox",it=_t||convertChildrenToData(ct);if(warning(Ee!=="tags"||it.every(function(Dt){return!Dt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ee==="tags"||Ee==="combobox"){var at=it.some(function(Dt){return Dt.options?Dt.options.some(function(kt){return typeof("value"in kt?kt.value:kt.key)=="number"}):typeof("value"in Dt?Dt.value:Dt.key)=="number"});warning(!at,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ee!=="combobox"||!Ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ee==="combobox"||!tt,"`backfill` only works with `combobox` mode."),warning(Ee==="combobox"||!Ve,"`getInputElement` only work with `combobox` mode."),noteOnce(Ee!=="combobox"||!Ve||!$t||!je,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),nt&&!Ue&&Ee!=="combobox"&&Ee!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Vt||Zt,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),wt!=null){var qe=toArray(wt);warning(!It||qe.every(function(Dt){return _typeof(Dt)==="object"&&("key"in Dt||"value"in Dt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Fe||Array.isArray(wt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ct){var yt=null;toNodeArray(ct).some(function(Dt){if(!React.isValidElement(Dt)||!Dt.type)return!1;var kt=Dt,qt=kt.type;if(qt.isSelectOption)return!1;if(qt.isSelectOptGroup){var Lt=toNodeArray(Dt.props.children).every(function(nn){return!React.isValidElement(nn)||!Dt.type||nn.type.isSelectOption?!0:(yt=nn.type,!1)});return!Lt}return yt=qt,!0}),yt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(yt.displayName||yt.name||yt,"`.")),warning(he===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function kn(Se,Ee){if(Se){var _t=function ct(tt){for(var $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=0;je<tt.length;je++){var Ve=tt[je];if(Ve[Ee==null?void 0:Ee.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!$t&&Array.isArray(Ve[Ee==null?void 0:Ee.options])&&ct(Ve[Ee==null?void 0:Ee.options],!0))break}};_t(Se)}}var $n=null,Rn=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Bn=["inputValue"];function xn(Se){return!Se||(0,fe.Z)(Se)!=="object"}var sn=S.forwardRef(function(Se,Ee){var _t=Se.id,ct=Se.mode,tt=Se.prefixCls,$t=tt===void 0?"rc-select":tt,je=Se.backfill,Ve=Se.fieldNames,ht=Se.inputValue,nt=Se.searchValue,Vt=Se.onSearch,Zt=Se.autoClearSearchValue,It=Zt===void 0?!0:Zt,wt=Se.onSelect,he=Se.onDeselect,Ie=Se.dropdownMatchSelectWidth,Fe=Ie===void 0?!0:Ie,Ue=Se.filterOption,it=Se.filterSort,at=Se.optionFilterProp,qe=Se.optionLabelProp,yt=Se.options,Dt=Se.optionRender,kt=Se.children,qt=Se.defaultActiveFirstOption,Lt=Se.menuItemSelectedIcon,nn=Se.virtual,cn=Se.direction,ln=Se.listHeight,Xt=ln===void 0?200:ln,jt=Se.listItemHeight,dn=jt===void 0?20:jt,Rt=Se.labelRender,Nt=Se.value,Kt=Se.defaultValue,pn=Se.labelInValue,Jt=Se.onChange,fn=Se.maxCount,An=(0,p.Z)(Se,Rn),Pn=(0,q.ZP)(_t),ni=He(ct),Fn=!!(!yt&&kt),On=S.useMemo(function(){return Ue===void 0&&ct==="combobox"?!1:Ue},[Ue,ct]),Zn=S.useMemo(function(){return ee(Ve,Fn)},[JSON.stringify(Ve),Fn]),ai=(0,ie.Z)("",{value:nt!==void 0?nt:ht,postState:function(_n){return _n||""}}),qn=(0,M.Z)(ai,2),Yn=qn[0],on=qn[1],bt=En(yt,kt,Zn,at,qe),mt=bt.valueOptions,Ht=bt.labelOptions,Wt=bt.options,hn=S.useCallback(function(Ot){var _n=H(Ot);return _n.map(function(bn){var Dn,Jn,li,en,yn;if(xn(bn))Dn=bn;else{var ei;li=bn.key,Jn=bn.label,Dn=(ei=bn.value)!==null&&ei!==void 0?ei:li}var Qn=mt.get(Dn);if(Qn){var ui;if(Jn===void 0&&(Jn=Qn==null?void 0:Qn[qe||Zn.label]),li===void 0&&(li=(ui=Qn==null?void 0:Qn.key)!==null&&ui!==void 0?ui:Dn),en=Qn==null?void 0:Qn.disabled,yn=Qn==null?void 0:Qn.title,0)var zi}return{label:Jn,value:Dn,key:li,disabled:en,title:yn}})},[Zn,qe,mt]),Gn=(0,ie.Z)(Kt,{value:Nt}),Vn=(0,M.Z)(Gn,2),Mn=Vn[0],ri=Vn[1],ci=S.useMemo(function(){var Ot,_n=ni&&Mn===null?[]:Mn,bn=hn(_n);return ct==="combobox"&&O((Ot=bn[0])===null||Ot===void 0?void 0:Ot.value)?[]:bn},[Mn,hn,ct,ni]),yi=B(ci,mt),wi=(0,M.Z)(yi,2),In=wi[0],Li=wi[1],Ti=S.useMemo(function(){if(!ct&&In.length===1){var Ot=In[0];if(Ot.value===null&&(Ot.label===null||Ot.label===void 0))return[]}return In.map(function(_n){var bn;return(0,re.Z)((0,re.Z)({},_n),{},{label:(bn=typeof Rt=="function"?Rt(_n):_n.label)!==null&&bn!==void 0?bn:_n.value})})},[ct,In,Rt]),gi=S.useMemo(function(){return new Set(In.map(function(Ot){return Ot.value}))},[In]);S.useEffect(function(){if(ct==="combobox"){var Ot,_n=(Ot=In[0])===null||Ot===void 0?void 0:Ot.value;on(g(_n)?String(_n):"")}},[In]);var oi=Ft(function(Ot,_n){var bn=_n!=null?_n:Ot;return(0,De.Z)((0,De.Z)({},Zn.value,Ot),Zn.label,bn)}),gn=S.useMemo(function(){if(ct!=="tags")return Wt;var Ot=(0,de.Z)(Wt),_n=function(Dn){return mt.has(Dn)};return(0,de.Z)(In).sort(function(bn,Dn){return bn.value<Dn.value?-1:1}).forEach(function(bn){var Dn=bn.value;_n(Dn)||Ot.push(oi(Dn,bn.label))}),Ot},[oi,Wt,mt,In,ct]),mi=te(gn,Zn,Yn,On,at),Ai=S.useMemo(function(){return ct!=="tags"||!Yn||mi.some(function(Ot){return Ot[at||"value"]===Yn})||mi.some(function(Ot){return Ot[Zn.value]===Yn})?mi:[oi(Yn)].concat((0,de.Z)(mi))},[oi,at,ct,mi,Yn,Zn]),$i=function Ot(_n){var bn=(0,de.Z)(_n).sort(function(Dn,Jn){return it(Dn,Jn,{searchValue:Yn})});return bn.map(function(Dn){return Array.isArray(Dn.options)?(0,re.Z)((0,re.Z)({},Dn),{},{options:Dn.options.length>0?Ot(Dn.options):Dn.options}):Dn})},Oi=S.useMemo(function(){return it?$i(Ai):Ai},[Ai,it,Yn]),Mi=S.useMemo(function(){return oe(Oi,{fieldNames:Zn,childrenAsData:Fn})},[Oi,Zn,Fn]),Di=function(_n){var bn=hn(_n);if(ri(bn),Jt&&(bn.length!==In.length||bn.some(function(li,en){var yn;return((yn=In[en])===null||yn===void 0?void 0:yn.value)!==(li==null?void 0:li.value)}))){var Dn=pn?bn:bn.map(function(li){return li.value}),Jn=bn.map(function(li){return J(Li(li.value))});Jt(ni?Dn:Dn[0],ni?Jn:Jn[0])}},Wi=S.useState(null),Xn=(0,M.Z)(Wi,2),ji=Xn[0],bi=Xn[1],lr=S.useState(0),Xi=(0,M.Z)(lr,2),Hi=Xi[0],nr=Xi[1],Fi=qt!==void 0?qt:ct!=="combobox",Ni=S.useCallback(function(Ot,_n){var bn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Dn=bn.source,Jn=Dn===void 0?"keyboard":Dn;nr(_n),je&&ct==="combobox"&&Ot!==null&&Jn==="keyboard"&&bi(String(Ot))},[je,ct]),Ei=function(_n,bn,Dn){var Jn=function(){var ir,rr=Li(_n);return[pn?{label:rr==null?void 0:rr[Zn.label],value:_n,key:(ir=rr==null?void 0:rr.key)!==null&&ir!==void 0?ir:_n}:_n,J(rr)]};if(bn&&wt){var li=Jn(),en=(0,M.Z)(li,2),yn=en[0],ei=en[1];wt(yn,ei)}else if(!bn&&he&&Dn!=="clear"){var Qn=Jn(),ui=(0,M.Z)(Qn,2),zi=ui[0],Qi=ui[1];he(zi,Qi)}},Bi=Ft(function(Ot,_n){var bn,Dn=ni?_n.selected:!0;Dn?bn=ni?[].concat((0,de.Z)(In),[Ot]):[Ot]:bn=In.filter(function(Jn){return Jn.value!==Ot}),Di(bn),Ei(Ot,Dn),ct==="combobox"?bi(""):(!He||It)&&(on(""),bi(""))}),Ri=function(_n,bn){Di(_n);var Dn=bn.type,Jn=bn.values;(Dn==="remove"||Dn==="clear")&&Jn.forEach(function(li){Ei(li.value,!1,Dn)})},fi=function(_n,bn){if(on(_n),bi(null),bn.source==="submit"){var Dn=(_n||"").trim();if(Dn){var Jn=Array.from(new Set([].concat((0,de.Z)(gi),[Dn])));Di(Jn),Ei(Dn,!0),on("")}return}bn.source!=="blur"&&(ct==="combobox"&&Di(_n),Vt==null||Vt(_n))},vi=function(_n){var bn=_n;ct!=="tags"&&(bn=_n.map(function(Jn){var li=Ht.get(Jn);return li==null?void 0:li.value}).filter(function(Jn){return Jn!==void 0}));var Dn=Array.from(new Set([].concat((0,de.Z)(gi),(0,de.Z)(bn))));Di(Dn),Dn.forEach(function(Jn){Ei(Jn,!0)})},hi=S.useMemo(function(){var Ot=nn!==!1&&Fe!==!1;return(0,re.Z)((0,re.Z)({},bt),{},{flattenOptions:Mi,onActiveValue:Ni,defaultActiveFirstOption:Fi,onSelect:Bi,menuItemSelectedIcon:Lt,rawValues:gi,fieldNames:Zn,virtual:Ot,direction:cn,listHeight:Xt,listItemHeight:dn,childrenAsData:Fn,maxCount:fn,optionRender:Dt})},[fn,bt,Mi,Ni,Fi,Bi,Lt,gi,Zn,nn,Fe,cn,Xt,dn,Fn,Dt]);return S.createElement(pe.Provider,{value:hi},S.createElement(lt,(0,T.Z)({},An,{id:Pn,prefixCls:$t,ref:Ee,omitDomProps:Bn,mode:ct,displayValues:Ti,onDisplayValuesChange:Ri,direction:cn,searchValue:Yn,onSearch:fi,autoClearSearchValue:It,onSearchSplit:vi,dropdownMatchSelectWidth:Fe,OptionList:Ae,emptyOptions:!Mi.length,activeValue:ji,activeDescendantId:"".concat(Pn,"_list_").concat(Hi)})))}),wn=sn;wn.Option=Gt,wn.OptGroup=xt;var zn=wn,Hn=zn},22711:function(vn,St,C){"use strict";C.r(St),C.d(St,{ResizableTextArea:function(){return Oe},default:function(){return $}});var T=C(71409),de=C(87075),De=C(89490),re=C(62730),M=C(11036),p=C(39224),fe=C(92310),ie=C.n(fe),l=C(36901),S=C(66003),w=C(30292),d=C(18929),m=C(59301),y=C(28788),x=C(29301),N=C(34280),U=C(16089),K=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,D=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],A={},P;function z(H){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=H.getAttribute("id")||H.getAttribute("data-reactid")||H.getAttribute("name");if(W&&A[_])return A[_];var g=window.getComputedStyle(H),O=g.getPropertyValue("box-sizing")||g.getPropertyValue("-moz-box-sizing")||g.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(g.getPropertyValue("padding-bottom"))+parseFloat(g.getPropertyValue("padding-top")),Pe=parseFloat(g.getPropertyValue("border-bottom-width"))+parseFloat(g.getPropertyValue("border-top-width")),Me=D.map(function(Ye){return"".concat(Ye,":").concat(g.getPropertyValue(Ye))}).join(";"),Xe={sizingStyle:Me,paddingSize:Y,borderSize:Pe,boxSizing:O};return W&&_&&(A[_]=Xe),Xe}function se(H){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),P.setAttribute("name","hiddenTextarea"),document.body.appendChild(P)),H.getAttribute("wrap")?P.setAttribute("wrap",H.getAttribute("wrap")):P.removeAttribute("wrap");var O=z(H,W),Y=O.paddingSize,Pe=O.borderSize,Me=O.boxSizing,Xe=O.sizingStyle;P.setAttribute("style","".concat(Xe,";").concat(K)),P.value=H.value||H.placeholder||"";var Ye=void 0,Tt=void 0,gt,Le=P.scrollHeight;if(Me==="border-box"?Le+=Pe:Me==="content-box"&&(Le-=Y),_!==null||g!==null){P.value=" ";var Je=P.scrollHeight-Y;_!==null&&(Ye=Je*_,Me==="border-box"&&(Ye=Ye+Y+Pe),Le=Math.max(Ye,Le)),g!==null&&(Tt=Je*g,Me==="border-box"&&(Tt=Tt+Y+Pe),gt=Le>Tt?"":"hidden",Le=Math.min(Tt,Le))}var Et={height:Le,overflowY:gt,resize:"none"};return Ye&&(Et.minHeight=Ye),Tt&&(Et.maxHeight=Tt),Et}var ae=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],ne=0,Q=1,ye=2,ce=m.forwardRef(function(H,W){var _=H,g=_.prefixCls,O=_.defaultValue,Y=_.value,Pe=_.autoSize,Me=_.onResize,Xe=_.className,Ye=_.style,Tt=_.disabled,gt=_.onChange,Le=_.onInternalAutoSize,Je=(0,p.Z)(_,ae),Et=(0,d.Z)(O,{value:Y,postState:function(Gt){return Gt!=null?Gt:""}}),ot=(0,M.Z)(Et,2),rn=ot[0],Ze=ot[1],ge=function(Gt){Ze(Gt.target.value),gt==null||gt(Gt)},le=m.useRef();m.useImperativeHandle(W,function(){return{textArea:le.current}});var G=m.useMemo(function(){return Pe&&(0,y.Z)(Pe)==="object"?[Pe.minRows,Pe.maxRows]:[]},[Pe]),be=(0,M.Z)(G,2),ke=be[0],Ne=be[1],k=!!Pe,F=function(){try{if(document.activeElement===le.current){var Gt=le.current,an=Gt.selectionStart,Ct=Gt.selectionEnd,un=Gt.scrollTop;le.current.setSelectionRange(an,Ct),le.current.scrollTop=un}}catch(Nn){}},ee=m.useState(ye),oe=(0,M.Z)(ee,2),J=oe[0],me=oe[1],Te=m.useState(),pe=(0,M.Z)(Te,2),_e=pe[0],Ce=pe[1],Ge=function(){me(ne)};(0,N.Z)(function(){k&&Ge()},[Y,ke,Ne,k]),(0,N.Z)(function(){if(J===ne)me(Q);else if(J===Q){var ut=se(le.current,!1,ke,Ne);me(ye),Ce(ut)}else F()},[J]);var He=m.useRef(),et=function(){U.Z.cancel(He.current)},lt=function(Gt){J===ye&&(Me==null||Me(Gt),Pe&&(et(),He.current=(0,U.Z)(function(){Ge()})))};m.useEffect(function(){return et},[]);var Pt=k?_e:null,xt=(0,De.Z)((0,De.Z)({},Ye),Pt);return(J===ne||J===Q)&&(xt.overflowY="hidden",xt.overflowX="hidden"),m.createElement(x.Z,{onResize:lt,disabled:!(Pe||Me)},m.createElement("textarea",(0,T.Z)({},Je,{ref:le,style:xt,className:ie()(g,Xe,(0,de.Z)({},"".concat(g,"-disabled"),Tt)),disabled:Tt,value:rn,onChange:ge})))}),Oe=ce,Z=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],L=m.forwardRef(function(H,W){var _,g=H.defaultValue,O=H.value,Y=H.onFocus,Pe=H.onBlur,Me=H.onChange,Xe=H.allowClear,Ye=H.maxLength,Tt=H.onCompositionStart,gt=H.onCompositionEnd,Le=H.suffix,Je=H.prefixCls,Et=Je===void 0?"rc-textarea":Je,ot=H.showCount,rn=H.count,Ze=H.className,ge=H.style,le=H.disabled,G=H.hidden,be=H.classNames,ke=H.styles,Ne=H.onResize,k=H.onClear,F=H.onPressEnter,ee=H.readOnly,oe=H.autoSize,J=H.onKeyDown,me=(0,p.Z)(H,Z),Te=(0,d.Z)(g,{value:O,defaultValue:g}),pe=(0,M.Z)(Te,2),_e=pe[0],Ce=pe[1],Ge=_e==null?"":String(_e),He=m.useState(!1),et=(0,M.Z)(He,2),lt=et[0],Pt=et[1],xt=m.useRef(!1),ut=m.useState(null),Gt=(0,M.Z)(ut,2),an=Gt[0],Ct=Gt[1],un=(0,m.useRef)(null),Nn=(0,m.useRef)(null),At=function(){var wn;return(wn=Nn.current)===null||wn===void 0?void 0:wn.textArea},Qt=function(){At().focus()};(0,m.useImperativeHandle)(W,function(){var sn;return{resizableTextArea:Nn.current,focus:Qt,blur:function(){At().blur()},nativeElement:((sn=un.current)===null||sn===void 0?void 0:sn.nativeElement)||At()}}),(0,m.useEffect)(function(){Pt(function(sn){return!le&&sn})},[le]);var Re=m.useState(null),xe=(0,M.Z)(Re,2),Ae=xe[0],B=xe[1];m.useEffect(function(){if(Ae){var sn;(sn=At()).setSelectionRange.apply(sn,(0,re.Z)(Ae))}},[Ae]);var j=(0,S.Z)(rn,ot),te=(_=j.max)!==null&&_!==void 0?_:Ye,q=Number(te)>0,we=j.strategy(Ge),vt=!!te&&we>te,st=function(wn,zn){var Hn=zn;!xt.current&&j.exceedFormatter&&j.max&&j.strategy(zn)>j.max&&(Hn=j.exceedFormatter(zn,{max:j.max}),zn!==Hn&&B([At().selectionStart||0,At().selectionEnd||0])),Ce(Hn),(0,w.rJ)(wn.currentTarget,wn,Me,Hn)},ft=function(wn){xt.current=!0,Tt==null||Tt(wn)},Mt=function(wn){xt.current=!1,st(wn,wn.currentTarget.value),gt==null||gt(wn)},Sn=function(wn){st(wn,wn.target.value)},En=function(wn){wn.key==="Enter"&&F&&F(wn),J==null||J(wn)},Ft=function(wn){Pt(!0),Y==null||Y(wn)},Yt=function(wn){Pt(!1),Pe==null||Pe(wn)},kn=function(wn){Ce(""),Qt(),(0,w.rJ)(At(),wn,Me)},$n=Le,Rn;j.show&&(j.showFormatter?Rn=j.showFormatter({value:Ge,count:we,maxLength:te}):Rn="".concat(we).concat(q?" / ".concat(te):""),$n=m.createElement(m.Fragment,null,$n,m.createElement("span",{className:ie()("".concat(Et,"-data-count"),be==null?void 0:be.count),style:ke==null?void 0:ke.count},Rn)));var Bn=function(wn){var zn;Ne==null||Ne(wn),(zn=At())!==null&&zn!==void 0&&zn.style.height&&Ct(!0)},xn=!oe&&!ot&&!Xe;return m.createElement(l.BaseInput,{ref:un,value:Ge,allowClear:Xe,handleReset:kn,suffix:$n,prefixCls:Et,classNames:(0,De.Z)((0,De.Z)({},be),{},{affixWrapper:ie()(be==null?void 0:be.affixWrapper,(0,de.Z)((0,de.Z)({},"".concat(Et,"-show-count"),ot),"".concat(Et,"-textarea-allow-clear"),Xe))}),disabled:le,focused:lt,className:ie()(Ze,vt&&"".concat(Et,"-out-of-range")),style:(0,De.Z)((0,De.Z)({},ge),an&&!xn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Rn=="string"?Rn:void 0}},hidden:G,readOnly:ee,onClear:k},m.createElement(Oe,(0,T.Z)({},me,{autoSize:oe,maxLength:Ye,onKeyDown:En,onChange:Sn,onFocus:Ft,onBlur:Yt,onCompositionStart:ft,onCompositionEnd:Mt,className:ie()(be==null?void 0:be.textarea),style:(0,De.Z)((0,De.Z)({},ke==null?void 0:ke.textarea),{},{resize:ge==null?void 0:ge.resize}),disabled:le,prefixCls:Et,onResize:Bn,ref:Nn,readOnly:ee})))}),V=L,$=V},29125:function(vn,St,C){"use strict";C.d(St,{G:function(){return re},Z:function(){return K}});var T=C(92310),de=C.n(T),De=C(59301);function re(D){var A=D.children,P=D.prefixCls,z=D.id,se=D.overlayInnerStyle,ae=D.bodyClassName,ne=D.className,Q=D.style;return De.createElement("div",{className:de()("".concat(P,"-content"),ne),style:Q},De.createElement("div",{className:de()("".concat(P,"-inner"),ae),id:z,role:"tooltip",style:se},typeof A=="function"?A():A))}var M=C(71409),p=C(89490),fe=C(39224),ie=C(65352),l={shiftX:64,adjustY:1},S={adjustX:1,shiftY:!0},w=[0,0],d={left:{points:["cr","cl"],overflow:S,offset:[-4,0],targetOffset:w},right:{points:["cl","cr"],overflow:S,offset:[4,0],targetOffset:w},top:{points:["bc","tc"],overflow:l,offset:[0,-4],targetOffset:w},bottom:{points:["tc","bc"],overflow:l,offset:[0,4],targetOffset:w},topLeft:{points:["bl","tl"],overflow:l,offset:[0,-4],targetOffset:w},leftTop:{points:["tr","tl"],overflow:S,offset:[-4,0],targetOffset:w},topRight:{points:["br","tr"],overflow:l,offset:[0,-4],targetOffset:w},rightTop:{points:["tl","tr"],overflow:S,offset:[4,0],targetOffset:w},bottomRight:{points:["tr","br"],overflow:l,offset:[0,4],targetOffset:w},rightBottom:{points:["bl","br"],overflow:S,offset:[4,0],targetOffset:w},bottomLeft:{points:["tl","bl"],overflow:l,offset:[0,4],targetOffset:w},leftBottom:{points:["br","bl"],overflow:S,offset:[-4,0],targetOffset:w}},m=null,y=C(80402),x=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],N=function(A,P){var z=A.overlayClassName,se=A.trigger,ae=se===void 0?["hover"]:se,ne=A.mouseEnterDelay,Q=ne===void 0?0:ne,ye=A.mouseLeaveDelay,ce=ye===void 0?.1:ye,Oe=A.overlayStyle,Z=A.prefixCls,L=Z===void 0?"rc-tooltip":Z,V=A.children,$=A.onVisibleChange,H=A.afterVisibleChange,W=A.transitionName,_=A.animation,g=A.motion,O=A.placement,Y=O===void 0?"right":O,Pe=A.align,Me=Pe===void 0?{}:Pe,Xe=A.destroyTooltipOnHide,Ye=Xe===void 0?!1:Xe,Tt=A.defaultVisible,gt=A.getTooltipContainer,Le=A.overlayInnerStyle,Je=A.arrowContent,Et=A.overlay,ot=A.id,rn=A.showArrow,Ze=rn===void 0?!0:rn,ge=A.classNames,le=A.styles,G=(0,fe.Z)(A,x),be=(0,y.Z)(ot),ke=(0,De.useRef)(null);(0,De.useImperativeHandle)(P,function(){return ke.current});var Ne=(0,p.Z)({},G);"visible"in A&&(Ne.popupVisible=A.visible);var k=function(){return De.createElement(re,{key:"content",prefixCls:L,id:be,bodyClassName:ge==null?void 0:ge.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},Le),le==null?void 0:le.body)},Et)},F=function(){var oe=De.Children.only(V),J=(oe==null?void 0:oe.props)||{},me=(0,p.Z)((0,p.Z)({},J),{},{"aria-describedby":Et?be:null});return De.cloneElement(V,me)};return De.createElement(ie.Z,(0,M.Z)({popupClassName:de()(z,ge==null?void 0:ge.root),prefixCls:L,popup:k,action:ae,builtinPlacements:d,popupPlacement:Y,ref:ke,popupAlign:Me,getPopupContainer:gt,onPopupVisibleChange:$,afterPopupVisibleChange:H,popupTransitionName:W,popupAnimation:_,popupMotion:g,defaultPopupVisible:Tt,autoDestroy:Ye,mouseLeaveDelay:ce,popupStyle:(0,p.Z)((0,p.Z)({},Oe),le==null?void 0:le.root),mouseEnterDelay:Q,arrow:Ze},Ne),F())},U=(0,De.forwardRef)(N),K=U},49658:function(vn,St){"use strict";St.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var C=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(C)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(C==null?void 0:C.substr(0,4))}},65283:function(vn,St,C){"use strict";C.d(St,{Z:function(){return rn}});var T=C(71409),de=C(28788),De=C(89490),re=C(87075),M=C(11036),p=C(39224),fe=C(92310),ie=C.n(fe),l=C(29301),S=C(70425),w=C(34280),d=C(59301),m=C(4676),y=d.forwardRef(function(Ze,ge){var le=Ze.height,G=Ze.offsetY,be=Ze.offsetX,ke=Ze.children,Ne=Ze.prefixCls,k=Ze.onInnerResize,F=Ze.innerProps,ee=Ze.rtl,oe=Ze.extra,J={},me={display:"flex",flexDirection:"column"};return G!==void 0&&(J={height:le,position:"relative",overflow:"hidden"},me=(0,De.Z)((0,De.Z)({},me),{},(0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)({transform:"translateY(".concat(G,"px)")},ee?"marginRight":"marginLeft",-be),"position","absolute"),"left",0),"right",0),"top",0))),d.createElement("div",{style:J},d.createElement(l.Z,{onResize:function(pe){var _e=pe.offsetHeight;_e&&k&&k()}},d.createElement("div",(0,T.Z)({style:me,className:ie()((0,re.Z)({},"".concat(Ne,"-holder-inner"),Ne)),ref:ge},F),ke,oe)))});y.displayName="Filler";var x=y;function N(Ze){var ge=Ze.children,le=Ze.setRef,G=d.useCallback(function(be){le(be)},[]);return d.cloneElement(ge,{ref:G})}function U(Ze,ge,le,G,be,ke,Ne,k){var F=k.getKey;return Ze.slice(ge,le+1).map(function(ee,oe){var J=ge+oe,me=Ne(ee,J,{style:{width:G},offsetX:be}),Te=F(ee);return d.createElement(N,{key:Te,setRef:function(_e){return ke(ee,_e)}},me)})}function K(Ze,ge,le,G){var be=le-Ze,ke=ge-le,Ne=Math.min(be,ke)*2;if(G<=Ne){var k=Math.floor(G/2);return G%2?le+k+1:le-k}return be>ke?le-(G-ke):le+(G-be)}function D(Ze,ge,le){var G=Ze.length,be=ge.length,ke,Ne;if(G===0&&be===0)return null;G<be?(ke=Ze,Ne=ge):(ke=ge,Ne=Ze);var k={__EMPTY_ITEM__:!0};function F(pe){return pe!==void 0?le(pe):k}for(var ee=null,oe=Math.abs(G-be)!==1,J=0;J<Ne.length;J+=1){var me=F(ke[J]),Te=F(Ne[J]);if(me!==Te){ee=J,oe=oe||me!==F(Ne[J+1]);break}}return ee===null?null:{index:ee,multiple:oe}}function A(Ze,ge,le){var G=d.useState(Ze),be=(0,M.Z)(G,2),ke=be[0],Ne=be[1],k=d.useState(null),F=(0,M.Z)(k,2),ee=F[0],oe=F[1];return d.useEffect(function(){var J=D(ke||[],Ze||[],ge);(J==null?void 0:J.index)!==void 0&&(le==null||le(J.index),oe(Ze[J.index])),Ne(Ze)},[Ze]),[ee]}var P=C(16089),z=(typeof navigator=="undefined"?"undefined":(0,de.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),se=z,ae=function(Ze,ge,le,G){var be=(0,d.useRef)(!1),ke=(0,d.useRef)(null);function Ne(){clearTimeout(ke.current),be.current=!0,ke.current=setTimeout(function(){be.current=!1},50)}var k=(0,d.useRef)({top:Ze,bottom:ge,left:le,right:G});return k.current.top=Ze,k.current.bottom=ge,k.current.left=le,k.current.right=G,function(F,ee){var oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,J=F?ee<0&&k.current.left||ee>0&&k.current.right:ee<0&&k.current.top||ee>0&&k.current.bottom;return oe&&J?(clearTimeout(ke.current),be.current=!1):(!J||be.current)&&Ne(),!be.current&&J}};function ne(Ze,ge,le,G,be,ke,Ne){var k=(0,d.useRef)(0),F=(0,d.useRef)(null),ee=(0,d.useRef)(null),oe=(0,d.useRef)(!1),J=ae(ge,le,G,be);function me(He,et){if(P.Z.cancel(F.current),!J(!1,et)){var lt=He;if(!lt._virtualHandled)lt._virtualHandled=!0;else return;k.current+=et,ee.current=et,se||lt.preventDefault(),F.current=(0,P.Z)(function(){var Pt=oe.current?10:1;Ne(k.current*Pt,!1),k.current=0})}}function Te(He,et){Ne(et,!0),se||He.preventDefault()}var pe=(0,d.useRef)(null),_e=(0,d.useRef)(null);function Ce(He){if(Ze){P.Z.cancel(_e.current),_e.current=(0,P.Z)(function(){pe.current=null},2);var et=He.deltaX,lt=He.deltaY,Pt=He.shiftKey,xt=et,ut=lt;(pe.current==="sx"||!pe.current&&Pt&<&&!et)&&(xt=lt,ut=0,pe.current="sx");var Gt=Math.abs(xt),an=Math.abs(ut);pe.current===null&&(pe.current=ke&&Gt>an?"x":"y"),pe.current==="y"?me(He,ut):Te(He,xt)}}function Ge(He){Ze&&(oe.current=He.detail===ee.current)}return[Ce,Ge]}function Q(Ze,ge,le,G){var be=d.useMemo(function(){return[new Map,[]]},[Ze,le.id,G]),ke=(0,M.Z)(be,2),Ne=ke[0],k=ke[1],F=function(oe){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oe,me=Ne.get(oe),Te=Ne.get(J);if(me===void 0||Te===void 0)for(var pe=Ze.length,_e=k.length;_e<pe;_e+=1){var Ce,Ge=Ze[_e],He=ge(Ge);Ne.set(He,_e);var et=(Ce=le.get(He))!==null&&Ce!==void 0?Ce:G;if(k[_e]=(k[_e-1]||0)+et,He===oe&&(me=_e),He===J&&(Te=_e),me!==void 0&&Te!==void 0)break}return{top:k[me-1]||0,bottom:k[Te]}};return F}var ye=C(16552),ce=C(19210),Oe=function(){function Ze(){(0,ye.Z)(this,Ze),(0,re.Z)(this,"maps",void 0),(0,re.Z)(this,"id",0),(0,re.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,ce.Z)(Ze,[{key:"set",value:function(le,G){this.diffRecords.set(le,this.maps[le]),this.maps[le]=G,this.id+=1}},{key:"get",value:function(le){return this.maps[le]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),Ze}(),Z=Oe;function L(Ze){var ge=parseFloat(Ze);return isNaN(ge)?0:ge}function V(Ze,ge,le){var G=d.useState(0),be=(0,M.Z)(G,2),ke=be[0],Ne=be[1],k=(0,d.useRef)(new Map),F=(0,d.useRef)(new Z),ee=(0,d.useRef)(0);function oe(){ee.current+=1}function J(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;oe();var pe=function(){var Ge=!1;k.current.forEach(function(He,et){if(He&&He.offsetParent){var lt=He.offsetHeight,Pt=getComputedStyle(He),xt=Pt.marginTop,ut=Pt.marginBottom,Gt=L(xt),an=L(ut),Ct=lt+Gt+an;F.current.get(et)!==Ct&&(F.current.set(et,Ct),Ge=!0)}}),Ge&&Ne(function(He){return He+1})};if(Te)pe();else{ee.current+=1;var _e=ee.current;Promise.resolve().then(function(){_e===ee.current&&pe()})}}function me(Te,pe){var _e=Ze(Te),Ce=k.current.get(_e);pe?(k.current.set(_e,pe),J()):k.current.delete(_e),!Ce!=!pe&&(pe?ge==null||ge(Te):le==null||le(Te))}return(0,d.useEffect)(function(){return oe},[]),[me,J,F.current,ke]}var $=14/15;function H(Ze,ge,le){var G=(0,d.useRef)(!1),be=(0,d.useRef)(0),ke=(0,d.useRef)(0),Ne=(0,d.useRef)(null),k=(0,d.useRef)(null),F,ee=function(Te){if(G.current){var pe=Math.ceil(Te.touches[0].pageX),_e=Math.ceil(Te.touches[0].pageY),Ce=be.current-pe,Ge=ke.current-_e,He=Math.abs(Ce)>Math.abs(Ge);He?be.current=pe:ke.current=_e;var et=le(He,He?Ce:Ge,!1,Te);et&&Te.preventDefault(),clearInterval(k.current),et&&(k.current=setInterval(function(){He?Ce*=$:Ge*=$;var lt=Math.floor(He?Ce:Ge);(!le(He,lt,!0)||Math.abs(lt)<=.1)&&clearInterval(k.current)},16))}},oe=function(){G.current=!1,F()},J=function(Te){F(),Te.touches.length===1&&!G.current&&(G.current=!0,be.current=Math.ceil(Te.touches[0].pageX),ke.current=Math.ceil(Te.touches[0].pageY),Ne.current=Te.target,Ne.current.addEventListener("touchmove",ee,{passive:!1}),Ne.current.addEventListener("touchend",oe,{passive:!0}))};F=function(){Ne.current&&(Ne.current.removeEventListener("touchmove",ee),Ne.current.removeEventListener("touchend",oe))},(0,w.Z)(function(){return Ze&&ge.current.addEventListener("touchstart",J,{passive:!0}),function(){var me;(me=ge.current)===null||me===void 0||me.removeEventListener("touchstart",J),F(),clearInterval(k.current)}},[Ze])}function W(Ze){return Math.floor(Math.pow(Ze,.5))}function _(Ze,ge){var le="touches"in Ze?Ze.touches[0]:Ze;return le[ge?"pageX":"pageY"]-window[ge?"scrollX":"scrollY"]}function g(Ze,ge,le){d.useEffect(function(){var G=ge.current;if(Ze&&G){var be=!1,ke,Ne,k=function(){P.Z.cancel(ke)},F=function me(){k(),ke=(0,P.Z)(function(){le(Ne),me()})},ee=function(Te){if(!(Te.target.draggable||Te.button!==0)){var pe=Te;pe._virtualHandled||(pe._virtualHandled=!0,be=!0)}},oe=function(){be=!1,k()},J=function(Te){if(be){var pe=_(Te,!1),_e=G.getBoundingClientRect(),Ce=_e.top,Ge=_e.bottom;if(pe<=Ce){var He=Ce-pe;Ne=-W(He),F()}else if(pe>=Ge){var et=pe-Ge;Ne=W(et),F()}else k()}};return G.addEventListener("mousedown",ee),G.ownerDocument.addEventListener("mouseup",oe),G.ownerDocument.addEventListener("mousemove",J),function(){G.removeEventListener("mousedown",ee),G.ownerDocument.removeEventListener("mouseup",oe),G.ownerDocument.removeEventListener("mousemove",J),k()}}},[Ze])}var O=10;function Y(Ze,ge,le,G,be,ke,Ne,k){var F=d.useRef(),ee=d.useState(null),oe=(0,M.Z)(ee,2),J=oe[0],me=oe[1];return(0,w.Z)(function(){if(J&&J.times<O){if(!Ze.current){me(function(j){return(0,De.Z)({},j)});return}ke();var Te=J.targetAlign,pe=J.originAlign,_e=J.index,Ce=J.offset,Ge=Ze.current.clientHeight,He=!1,et=Te,lt=null;if(Ge){for(var Pt=Te||pe,xt=0,ut=0,Gt=0,an=Math.min(ge.length-1,_e),Ct=0;Ct<=an;Ct+=1){var un=be(ge[Ct]);ut=xt;var Nn=le.get(un);Gt=ut+(Nn===void 0?G:Nn),xt=Gt}for(var At=Pt==="top"?Ce:Ge-Ce,Qt=an;Qt>=0;Qt-=1){var Re=be(ge[Qt]),xe=le.get(Re);if(xe===void 0){He=!0;break}if(At-=xe,At<=0)break}switch(Pt){case"top":lt=ut-Ce;break;case"bottom":lt=Gt-Ge+Ce;break;default:{var Ae=Ze.current.scrollTop,B=Ae+Ge;ut<Ae?et="top":Gt>B&&(et="bottom")}}lt!==null&&Ne(lt),lt!==J.lastTop&&(He=!0)}He&&me((0,De.Z)((0,De.Z)({},J),{},{times:J.times+1,targetAlign:et,lastTop:lt}))}},[J,Ze.current]),function(Te){if(Te==null){k();return}if(P.Z.cancel(F.current),typeof Te=="number")Ne(Te);else if(Te&&(0,de.Z)(Te)==="object"){var pe,_e=Te.align;"index"in Te?pe=Te.index:pe=ge.findIndex(function(He){return be(He)===Te.key});var Ce=Te.offset,Ge=Ce===void 0?0:Ce;me({times:0,index:pe,offset:Ge,originAlign:_e})}}}var Pe=d.forwardRef(function(Ze,ge){var le=Ze.prefixCls,G=Ze.rtl,be=Ze.scrollOffset,ke=Ze.scrollRange,Ne=Ze.onStartMove,k=Ze.onStopMove,F=Ze.onScroll,ee=Ze.horizontal,oe=Ze.spinSize,J=Ze.containerSize,me=Ze.style,Te=Ze.thumbStyle,pe=Ze.showScrollBar,_e=d.useState(!1),Ce=(0,M.Z)(_e,2),Ge=Ce[0],He=Ce[1],et=d.useState(null),lt=(0,M.Z)(et,2),Pt=lt[0],xt=lt[1],ut=d.useState(null),Gt=(0,M.Z)(ut,2),an=Gt[0],Ct=Gt[1],un=!G,Nn=d.useRef(),At=d.useRef(),Qt=d.useState(pe),Re=(0,M.Z)(Qt,2),xe=Re[0],Ae=Re[1],B=d.useRef(),j=function(){pe===!0||pe===!1||(clearTimeout(B.current),Ae(!0),B.current=setTimeout(function(){Ae(!1)},3e3))},te=ke-J||0,q=J-oe||0,we=d.useMemo(function(){if(be===0||te===0)return 0;var kn=be/te;return kn*q},[be,te,q]),vt=function($n){$n.stopPropagation(),$n.preventDefault()},st=d.useRef({top:we,dragging:Ge,pageY:Pt,startTop:an});st.current={top:we,dragging:Ge,pageY:Pt,startTop:an};var ft=function($n){He(!0),xt(_($n,ee)),Ct(st.current.top),Ne(),$n.stopPropagation(),$n.preventDefault()};d.useEffect(function(){var kn=function(xn){xn.preventDefault()},$n=Nn.current,Rn=At.current;return $n.addEventListener("touchstart",kn,{passive:!1}),Rn.addEventListener("touchstart",ft,{passive:!1}),function(){$n.removeEventListener("touchstart",kn),Rn.removeEventListener("touchstart",ft)}},[]);var Mt=d.useRef();Mt.current=te;var Sn=d.useRef();Sn.current=q,d.useEffect(function(){if(Ge){var kn,$n=function(xn){var sn=st.current,wn=sn.dragging,zn=sn.pageY,Hn=sn.startTop;P.Z.cancel(kn);var Se=Nn.current.getBoundingClientRect(),Ee=J/(ee?Se.width:Se.height);if(wn){var _t=(_(xn,ee)-zn)*Ee,ct=Hn;!un&&ee?ct-=_t:ct+=_t;var tt=Mt.current,$t=Sn.current,je=$t?ct/$t:0,Ve=Math.ceil(je*tt);Ve=Math.max(Ve,0),Ve=Math.min(Ve,tt),kn=(0,P.Z)(function(){F(Ve,ee)})}},Rn=function(){He(!1),k()};return window.addEventListener("mousemove",$n,{passive:!0}),window.addEventListener("touchmove",$n,{passive:!0}),window.addEventListener("mouseup",Rn,{passive:!0}),window.addEventListener("touchend",Rn,{passive:!0}),function(){window.removeEventListener("mousemove",$n),window.removeEventListener("touchmove",$n),window.removeEventListener("mouseup",Rn),window.removeEventListener("touchend",Rn),P.Z.cancel(kn)}}},[Ge]),d.useEffect(function(){return j(),function(){clearTimeout(B.current)}},[be]),d.useImperativeHandle(ge,function(){return{delayHidden:j}});var En="".concat(le,"-scrollbar"),Ft={position:"absolute",visibility:xe?null:"hidden"},Yt={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return ee?(Ft.height=8,Ft.left=0,Ft.right=0,Ft.bottom=0,Yt.height="100%",Yt.width=oe,un?Yt.left=we:Yt.right=we):(Ft.width=8,Ft.top=0,Ft.bottom=0,un?Ft.right=0:Ft.left=0,Yt.width="100%",Yt.height=oe,Yt.top=we),d.createElement("div",{ref:Nn,className:ie()(En,(0,re.Z)((0,re.Z)((0,re.Z)({},"".concat(En,"-horizontal"),ee),"".concat(En,"-vertical"),!ee),"".concat(En,"-visible"),xe)),style:(0,De.Z)((0,De.Z)({},Ft),me),onMouseDown:vt,onMouseMove:j},d.createElement("div",{ref:At,className:ie()("".concat(En,"-thumb"),(0,re.Z)({},"".concat(En,"-thumb-moving"),Ge)),style:(0,De.Z)((0,De.Z)({},Yt),Te),onMouseDown:ft}))}),Me=Pe,Xe=20;function Ye(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,le=Ze/ge*Ze;return isNaN(le)&&(le=0),le=Math.max(le,Xe),Math.floor(le)}var Tt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],gt=[],Le={overflowY:"auto",overflowAnchor:"none"};function Je(Ze,ge){var le=Ze.prefixCls,G=le===void 0?"rc-virtual-list":le,be=Ze.className,ke=Ze.height,Ne=Ze.itemHeight,k=Ze.fullHeight,F=k===void 0?!0:k,ee=Ze.style,oe=Ze.data,J=Ze.children,me=Ze.itemKey,Te=Ze.virtual,pe=Ze.direction,_e=Ze.scrollWidth,Ce=Ze.component,Ge=Ce===void 0?"div":Ce,He=Ze.onScroll,et=Ze.onVirtualScroll,lt=Ze.onVisibleChange,Pt=Ze.innerProps,xt=Ze.extraRender,ut=Ze.styles,Gt=Ze.showScrollBar,an=Gt===void 0?"optional":Gt,Ct=(0,p.Z)(Ze,Tt),un=d.useCallback(function(bt){return typeof me=="function"?me(bt):bt==null?void 0:bt[me]},[me]),Nn=V(un,null,null),At=(0,M.Z)(Nn,4),Qt=At[0],Re=At[1],xe=At[2],Ae=At[3],B=!!(Te!==!1&&ke&&Ne),j=d.useMemo(function(){return Object.values(xe.maps).reduce(function(bt,mt){return bt+mt},0)},[xe.id,xe.maps]),te=B&&oe&&(Math.max(Ne*oe.length,j)>ke||!!_e),q=pe==="rtl",we=ie()(G,(0,re.Z)({},"".concat(G,"-rtl"),q),be),vt=oe||gt,st=(0,d.useRef)(),ft=(0,d.useRef)(),Mt=(0,d.useRef)(),Sn=(0,d.useState)(0),En=(0,M.Z)(Sn,2),Ft=En[0],Yt=En[1],kn=(0,d.useState)(0),$n=(0,M.Z)(kn,2),Rn=$n[0],Bn=$n[1],xn=(0,d.useState)(!1),sn=(0,M.Z)(xn,2),wn=sn[0],zn=sn[1],Hn=function(){zn(!0)},Se=function(){zn(!1)},Ee={getKey:un};function _t(bt){Yt(function(mt){var Ht;typeof bt=="function"?Ht=bt(mt):Ht=bt;var Wt=qt(Ht);return st.current.scrollTop=Wt,Wt})}var ct=(0,d.useRef)({start:0,end:vt.length}),tt=(0,d.useRef)(),$t=A(vt,un),je=(0,M.Z)($t,1),Ve=je[0];tt.current=Ve;var ht=d.useMemo(function(){if(!B)return{scrollHeight:void 0,start:0,end:vt.length-1,offset:void 0};if(!te){var bt;return{scrollHeight:((bt=ft.current)===null||bt===void 0?void 0:bt.offsetHeight)||0,start:0,end:vt.length-1,offset:void 0}}for(var mt=0,Ht,Wt,hn,Gn=vt.length,Vn=0;Vn<Gn;Vn+=1){var Mn=vt[Vn],ri=un(Mn),ci=xe.get(ri),yi=mt+(ci===void 0?Ne:ci);yi>=Ft&&Ht===void 0&&(Ht=Vn,Wt=mt),yi>Ft+ke&&hn===void 0&&(hn=Vn),mt=yi}return Ht===void 0&&(Ht=0,Wt=0,hn=Math.ceil(ke/Ne)),hn===void 0&&(hn=vt.length-1),hn=Math.min(hn+1,vt.length-1),{scrollHeight:mt,start:Ht,end:hn,offset:Wt}},[te,B,Ft,vt,Ae,ke]),nt=ht.scrollHeight,Vt=ht.start,Zt=ht.end,It=ht.offset;ct.current.start=Vt,ct.current.end=Zt,d.useLayoutEffect(function(){var bt=xe.getRecord();if(bt.size===1){var mt=Array.from(bt.keys())[0],Ht=bt.get(mt),Wt=vt[Vt];if(Wt&&Ht===void 0){var hn=un(Wt);if(hn===mt){var Gn=xe.get(mt),Vn=Gn-Ne;_t(function(Mn){return Mn+Vn})}}}xe.resetRecord()},[nt]);var wt=d.useState({width:0,height:ke}),he=(0,M.Z)(wt,2),Ie=he[0],Fe=he[1],Ue=function(mt){Fe({width:mt.offsetWidth,height:mt.offsetHeight})},it=(0,d.useRef)(),at=(0,d.useRef)(),qe=d.useMemo(function(){return Ye(Ie.width,_e)},[Ie.width,_e]),yt=d.useMemo(function(){return Ye(Ie.height,nt)},[Ie.height,nt]),Dt=nt-ke,kt=(0,d.useRef)(Dt);kt.current=Dt;function qt(bt){var mt=bt;return Number.isNaN(kt.current)||(mt=Math.min(mt,kt.current)),mt=Math.max(mt,0),mt}var Lt=Ft<=0,nn=Ft>=Dt,cn=Rn<=0,ln=Rn>=_e,Xt=ae(Lt,nn,cn,ln),jt=function(){return{x:q?-Rn:Rn,y:Ft}},dn=(0,d.useRef)(jt()),Rt=(0,S.zX)(function(bt){if(et){var mt=(0,De.Z)((0,De.Z)({},jt()),bt);(dn.current.x!==mt.x||dn.current.y!==mt.y)&&(et(mt),dn.current=mt)}});function Nt(bt,mt){var Ht=bt;mt?((0,m.flushSync)(function(){Bn(Ht)}),Rt()):_t(Ht)}function Kt(bt){var mt=bt.currentTarget.scrollTop;mt!==Ft&&_t(mt),He==null||He(bt),Rt()}var pn=function(mt){var Ht=mt,Wt=_e?_e-Ie.width:0;return Ht=Math.max(Ht,0),Ht=Math.min(Ht,Wt),Ht},Jt=(0,S.zX)(function(bt,mt){mt?((0,m.flushSync)(function(){Bn(function(Ht){var Wt=Ht+(q?-bt:bt);return pn(Wt)})}),Rt()):_t(function(Ht){var Wt=Ht+bt;return Wt})}),fn=ne(B,Lt,nn,cn,ln,!!_e,Jt),An=(0,M.Z)(fn,2),Pn=An[0],ni=An[1];H(B,st,function(bt,mt,Ht,Wt){var hn=Wt;return Xt(bt,mt,Ht)?!1:!hn||!hn._virtualHandled?(hn&&(hn._virtualHandled=!0),Pn({preventDefault:function(){},deltaX:bt?mt:0,deltaY:bt?0:mt}),!0):!1}),g(te,st,function(bt){_t(function(mt){return mt+bt})}),(0,w.Z)(function(){function bt(Ht){var Wt=Lt&&Ht.detail<0,hn=nn&&Ht.detail>0;B&&!Wt&&!hn&&Ht.preventDefault()}var mt=st.current;return mt.addEventListener("wheel",Pn,{passive:!1}),mt.addEventListener("DOMMouseScroll",ni,{passive:!0}),mt.addEventListener("MozMousePixelScroll",bt,{passive:!1}),function(){mt.removeEventListener("wheel",Pn),mt.removeEventListener("DOMMouseScroll",ni),mt.removeEventListener("MozMousePixelScroll",bt)}},[B,Lt,nn]),(0,w.Z)(function(){if(_e){var bt=pn(Rn);Bn(bt),Rt({x:bt})}},[Ie.width,_e]);var Fn=function(){var mt,Ht;(mt=it.current)===null||mt===void 0||mt.delayHidden(),(Ht=at.current)===null||Ht===void 0||Ht.delayHidden()},On=Y(st,vt,xe,Ne,un,function(){return Re(!0)},_t,Fn);d.useImperativeHandle(ge,function(){return{nativeElement:Mt.current,getScrollInfo:jt,scrollTo:function(mt){function Ht(Wt){return Wt&&(0,de.Z)(Wt)==="object"&&("left"in Wt||"top"in Wt)}Ht(mt)?(mt.left!==void 0&&Bn(pn(mt.left)),On(mt.top)):On(mt)}}}),(0,w.Z)(function(){if(lt){var bt=vt.slice(Vt,Zt+1);lt(bt,vt)}},[Vt,Zt,vt]);var Zn=Q(vt,un,xe,Ne),ai=xt==null?void 0:xt({start:Vt,end:Zt,virtual:te,offsetX:Rn,offsetY:It,rtl:q,getSize:Zn}),qn=U(vt,Vt,Zt,_e,Rn,Qt,J,Ee),Yn=null;ke&&(Yn=(0,De.Z)((0,re.Z)({},F?"height":"maxHeight",ke),Le),B&&(Yn.overflowY="hidden",_e&&(Yn.overflowX="hidden"),wn&&(Yn.pointerEvents="none")));var on={};return q&&(on.dir="rtl"),d.createElement("div",(0,T.Z)({ref:Mt,style:(0,De.Z)((0,De.Z)({},ee),{},{position:"relative"}),className:we},on,Ct),d.createElement(l.Z,{onResize:Ue},d.createElement(Ge,{className:"".concat(G,"-holder"),style:Yn,ref:st,onScroll:Kt,onMouseEnter:Fn},d.createElement(x,{prefixCls:G,height:nt,offsetX:Rn,offsetY:It,scrollWidth:_e,onInnerResize:Re,ref:ft,innerProps:Pt,rtl:q,extra:ai},qn))),te&&nt>ke&&d.createElement(Me,{ref:it,prefixCls:G,scrollOffset:Ft,scrollRange:nt,rtl:q,onScroll:Nt,onStartMove:Hn,onStopMove:Se,spinSize:yt,containerSize:Ie.height,style:ut==null?void 0:ut.verticalScrollBar,thumbStyle:ut==null?void 0:ut.verticalScrollBarThumb,showScrollBar:an}),te&&_e>Ie.width&&d.createElement(Me,{ref:at,prefixCls:G,scrollOffset:Rn,scrollRange:_e,rtl:q,onScroll:Nt,onStartMove:Hn,onStopMove:Se,spinSize:qe,containerSize:Ie.width,horizontal:!0,style:ut==null?void 0:ut.horizontalScrollBar,thumbStyle:ut==null?void 0:ut.horizontalScrollBarThumb,showScrollBar:an}))}var Et=d.forwardRef(Je);Et.displayName="List";var ot=Et,rn=ot},83145:function(vn,St,C){"use strict";Object.defineProperty(St,"__esModule",{value:!0}),St.CopyToClipboard=void 0;var T=De(C(59301)),de=De(C(25769));function De(D){return D&&D.__esModule?D:{default:D}}function re(D){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?re=function(P){return typeof P}:re=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},re(D)}function M(D,A){var P=Object.keys(D);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(D);A&&(z=z.filter(function(se){return Object.getOwnPropertyDescriptor(D,se).enumerable})),P.push.apply(P,z)}return P}function p(D){for(var A=1;A<arguments.length;A++){var P=arguments[A]!=null?arguments[A]:{};A%2?M(P,!0).forEach(function(z){U(D,z,P[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(P)):M(P).forEach(function(z){Object.defineProperty(D,z,Object.getOwnPropertyDescriptor(P,z))})}return D}function fe(D,A){if(D==null)return{};var P=ie(D,A),z,se;if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(D);for(se=0;se<ae.length;se++)z=ae[se],!(A.indexOf(z)>=0)&&Object.prototype.propertyIsEnumerable.call(D,z)&&(P[z]=D[z])}return P}function ie(D,A){if(D==null)return{};var P={},z=Object.keys(D),se,ae;for(ae=0;ae<z.length;ae++)se=z[ae],!(A.indexOf(se)>=0)&&(P[se]=D[se]);return P}function l(D,A){if(!(D instanceof A))throw new TypeError("Cannot call a class as a function")}function S(D,A){for(var P=0;P<A.length;P++){var z=A[P];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(D,z.key,z)}}function w(D,A,P){return A&&S(D.prototype,A),P&&S(D,P),D}function d(D,A){return A&&(re(A)==="object"||typeof A=="function")?A:y(D)}function m(D){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},m(D)}function y(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function x(D,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(A&&A.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),A&&N(D,A)}function N(D,A){return N=Object.setPrototypeOf||function(z,se){return z.__proto__=se,z},N(D,A)}function U(D,A,P){return A in D?Object.defineProperty(D,A,{value:P,enumerable:!0,configurable:!0,writable:!0}):D[A]=P,D}var K=function(D){x(A,D);function A(){var P,z;l(this,A);for(var se=arguments.length,ae=new Array(se),ne=0;ne<se;ne++)ae[ne]=arguments[ne];return z=d(this,(P=m(A)).call.apply(P,[this].concat(ae))),U(y(z),"onClick",function(Q){var ye=z.props,ce=ye.text,Oe=ye.onCopy,Z=ye.children,L=ye.options,V=T.default.Children.only(Z),$=(0,de.default)(ce,L);Oe&&Oe(ce,$),V&&V.props&&typeof V.props.onClick=="function"&&V.props.onClick(Q)}),z}return w(A,[{key:"render",value:function(){var z=this.props,se=z.text,ae=z.onCopy,ne=z.options,Q=z.children,ye=fe(z,["text","onCopy","options","children"]),ce=T.default.Children.only(Q);return T.default.cloneElement(ce,p({},ye,{onClick:this.onClick}))}}]),A}(T.default.PureComponent);St.CopyToClipboard=K,U(K,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(vn,St,C){"use strict";var T=C(83145),de=T.CopyToClipboard;de.CopyToClipboard=de,vn.exports=de},76374:function(vn,St,C){"use strict";var T=function(){if(typeof Map!="undefined")return Map;function Z(L,V){var $=-1;return L.some(function(H,W){return H[0]===V?($=W,!0):!1}),$}return function(){function L(){this.__entries__=[]}return Object.defineProperty(L.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),L.prototype.get=function(V){var $=Z(this.__entries__,V),H=this.__entries__[$];return H&&H[1]},L.prototype.set=function(V,$){var H=Z(this.__entries__,V);~H?this.__entries__[H][1]=$:this.__entries__.push([V,$])},L.prototype.delete=function(V){var $=this.__entries__,H=Z($,V);~H&&$.splice(H,1)},L.prototype.has=function(V){return!!~Z(this.__entries__,V)},L.prototype.clear=function(){this.__entries__.splice(0)},L.prototype.forEach=function(V,$){$===void 0&&($=null);for(var H=0,W=this.__entries__;H<W.length;H++){var _=W[H];V.call($,_[1],_[0])}},L}()}(),de=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,De=function(){return typeof C.g!="undefined"&&C.g.Math===Math?C.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),re=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(De):function(Z){return setTimeout(function(){return Z(Date.now())},1e3/60)}}(),M=2;function p(Z,L){var V=!1,$=!1,H=0;function W(){V&&(V=!1,Z()),$&&g()}function _(){re(W)}function g(){var O=Date.now();if(V){if(O-H<M)return;$=!0}else V=!0,$=!1,setTimeout(_,L);H=O}return g}var fe=20,ie=["top","right","bottom","left","width","height","size","weight"],l=typeof MutationObserver!="undefined",S=function(){function Z(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),fe)}return Z.prototype.addObserver=function(L){~this.observers_.indexOf(L)||this.observers_.push(L),this.connected_||this.connect_()},Z.prototype.removeObserver=function(L){var V=this.observers_,$=V.indexOf(L);~$&&V.splice($,1),!V.length&&this.connected_&&this.disconnect_()},Z.prototype.refresh=function(){var L=this.updateObservers_();L&&this.refresh()},Z.prototype.updateObservers_=function(){var L=this.observers_.filter(function(V){return V.gatherActive(),V.hasActive()});return L.forEach(function(V){return V.broadcastActive()}),L.length>0},Z.prototype.connect_=function(){!de||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(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)},Z.prototype.disconnect_=function(){!de||!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)},Z.prototype.onTransitionEnd_=function(L){var V=L.propertyName,$=V===void 0?"":V,H=ie.some(function(W){return!!~$.indexOf(W)});H&&this.refresh()},Z.getInstance=function(){return this.instance_||(this.instance_=new Z),this.instance_},Z.instance_=null,Z}(),w=function(Z,L){for(var V=0,$=Object.keys(L);V<$.length;V++){var H=$[V];Object.defineProperty(Z,H,{value:L[H],enumerable:!1,writable:!1,configurable:!0})}return Z},d=function(Z){var L=Z&&Z.ownerDocument&&Z.ownerDocument.defaultView;return L||De},m=se(0,0,0,0);function y(Z){return parseFloat(Z)||0}function x(Z){for(var L=[],V=1;V<arguments.length;V++)L[V-1]=arguments[V];return L.reduce(function($,H){var W=Z["border-"+H+"-width"];return $+y(W)},0)}function N(Z){for(var L=["top","right","bottom","left"],V={},$=0,H=L;$<H.length;$++){var W=H[$],_=Z["padding-"+W];V[W]=y(_)}return V}function U(Z){var L=Z.getBBox();return se(0,0,L.width,L.height)}function K(Z){var L=Z.clientWidth,V=Z.clientHeight;if(!L&&!V)return m;var $=d(Z).getComputedStyle(Z),H=N($),W=H.left+H.right,_=H.top+H.bottom,g=y($.width),O=y($.height);if($.boxSizing==="border-box"&&(Math.round(g+W)!==L&&(g-=x($,"left","right")+W),Math.round(O+_)!==V&&(O-=x($,"top","bottom")+_)),!A(Z)){var Y=Math.round(g+W)-L,Pe=Math.round(O+_)-V;Math.abs(Y)!==1&&(g-=Y),Math.abs(Pe)!==1&&(O-=Pe)}return se(H.left,H.top,g,O)}var D=function(){return typeof SVGGraphicsElement!="undefined"?function(Z){return Z instanceof d(Z).SVGGraphicsElement}:function(Z){return Z instanceof d(Z).SVGElement&&typeof Z.getBBox=="function"}}();function A(Z){return Z===d(Z).document.documentElement}function P(Z){return de?D(Z)?U(Z):K(Z):m}function z(Z){var L=Z.x,V=Z.y,$=Z.width,H=Z.height,W=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,_=Object.create(W.prototype);return w(_,{x:L,y:V,width:$,height:H,top:V,right:L+$,bottom:H+V,left:L}),_}function se(Z,L,V,$){return{x:Z,y:L,width:V,height:$}}var ae=function(){function Z(L){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=se(0,0,0,0),this.target=L}return Z.prototype.isActive=function(){var L=P(this.target);return this.contentRect_=L,L.width!==this.broadcastWidth||L.height!==this.broadcastHeight},Z.prototype.broadcastRect=function(){var L=this.contentRect_;return this.broadcastWidth=L.width,this.broadcastHeight=L.height,L},Z}(),ne=function(){function Z(L,V){var $=z(V);w(this,{target:L,contentRect:$})}return Z}(),Q=function(){function Z(L,V,$){if(this.activeObservations_=[],this.observations_=new T,typeof L!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=L,this.controller_=V,this.callbackCtx_=$}return Z.prototype.observe=function(L){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(L instanceof d(L).Element))throw new TypeError('parameter 1 is not of type "Element".');var V=this.observations_;V.has(L)||(V.set(L,new ae(L)),this.controller_.addObserver(this),this.controller_.refresh())}},Z.prototype.unobserve=function(L){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(L instanceof d(L).Element))throw new TypeError('parameter 1 is not of type "Element".');var V=this.observations_;V.has(L)&&(V.delete(L),V.size||this.controller_.removeObserver(this))}},Z.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Z.prototype.gatherActive=function(){var L=this;this.clearActive(),this.observations_.forEach(function(V){V.isActive()&&L.activeObservations_.push(V)})},Z.prototype.broadcastActive=function(){if(this.hasActive()){var L=this.callbackCtx_,V=this.activeObservations_.map(function($){return new ne($.target,$.broadcastRect())});this.callback_.call(L,V,L),this.clearActive()}},Z.prototype.clearActive=function(){this.activeObservations_.splice(0)},Z.prototype.hasActive=function(){return this.activeObservations_.length>0},Z}(),ye=typeof WeakMap!="undefined"?new WeakMap:new T,ce=function(){function Z(L){if(!(this instanceof Z))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var V=S.getInstance(),$=new Q(L,V,this);ye.set(this,$)}return Z}();["observe","unobserve","disconnect"].forEach(function(Z){ce.prototype[Z]=function(){var L;return(L=ye.get(this))[Z].apply(L,arguments)}});var Oe=function(){return typeof De.ResizeObserver!="undefined"?De.ResizeObserver:ce}();St.Z=Oe},98040:function(vn){vn.exports=function(){var St=document.getSelection();if(!St.rangeCount)return function(){};for(var C=document.activeElement,T=[],de=0;de<St.rangeCount;de++)T.push(St.getRangeAt(de));switch(C.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":C.blur();break;default:C=null;break}return St.removeAllRanges(),function(){St.type==="Caret"&&St.removeAllRanges(),St.rangeCount||T.forEach(function(De){St.addRange(De)}),C&&C.focus()}}},93314:function(vn){"use strict";vn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},79710:function(vn,St,C){"use strict";C.d(St,{ZP:function(){return Br}});const T=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},de=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=De},De=Number.MAX_SAFE_INTEGER||9007199254740991;let re=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),M=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),p=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var fe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ie={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class l{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class S{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new l(e),this.fast_=new l(t),this.defaultTTFB_=i,this.ttfb_=new l(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new l(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new l(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new l(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function w(a,e,t){return(e=N(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function d(){return d=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},d.apply(null,arguments)}function m(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m(Object(t),!0).forEach(function(n){w(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function x(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function N(a){var e=x(a,"string");return typeof e=="symbol"?e:e+""}class U{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=K,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const K=function(){},D={trace:K,debug:K,log:K,warn:K,info:K,error:K};function A(){return d({},D)}function P(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):K}function z(a,e,t){return e[a]?e[a].bind(e):P(a,t)}const se=A();function ae(a,e,t){const n=A();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=z(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.2`)}catch(r){return A()}i.forEach(r=>{se[r]=z(r,a)})}else d(se,n);return n}const ne=se;function Q(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ye(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function ce(a,e){const t=Object.keys(a),n=Object.keys(e),i=t.length,r=n.length;return!i||!r||i===r&&!t.some(s=>n.indexOf(s)===-1)}function Oe(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",o=0;for(;o<t;){if(n=a[o++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:i=a[o++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}const Z={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function L(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var V={exports:{}},$;function H(){return $||($=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var h=o.parseURL(c);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var v=o.parseURL(u);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return f.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):u;var b=o.parseURL(c);if(!b)throw new Error("Error trying to parse base URL.");if(!b.netLoc&&b.path&&b.path[0]!=="/"){var E=i.exec(b.path);b.netLoc=E[1],b.path=E[2]}b.netLoc&&!b.path&&(b.path="/");var I={scheme:b.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(I.netLoc=b.netLoc,v.path[0]!=="/"))if(!v.path)I.path=b.path,v.params||(I.params=b.params,v.query||(I.query=b.query));else{var R=b.path,X=R.substring(0,R.lastIndexOf("/")+1)+v.path;I.path=o.normalizePath(X)}return I.path===null&&(I.path=f.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts(I)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=o})()}(V)),V.exports}var W=H();class _{constructor(){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}}}var g={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class O{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,Ye(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[g.AUDIO]:null,[g.VIDEO]:null,[g.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new _),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=W.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[g.AUDIO]=null,e[g.VIDEO]=null,e[g.AUDIOVIDEO]=null}}function Y(a){return a.sn!=="initSegment"}class Pe extends O{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(T(e)&&T(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=T(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!T(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Y(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class Me extends O{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Xe(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Xe(t,e)}}function Ye(a,e){const t=Xe(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Tt=Math.pow(2,32)-1,gt=[].push,Le={video:1,audio:2,id3:3,text:4};function Je(a){return String.fromCharCode.apply(null,a)}function Et(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function ot(a,e){const t=Ze(a,e);return t<0?4294967296+t:t}function rn(a,e){let t=ot(a,e);return t*=Math.pow(2,32),t+=ot(a,e+4),t}function Ze(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function ge(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function le(a){const e=a.byteLength;for(let t=0;t<e;){const n=ot(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function G(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=ot(a,i),s=Je(a.subarray(i+4,i+8)),o=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=G(a.subarray(i+8,o),e.slice(1));c.length&>.apply(t,c)}i=o}return t}function be(a){const e=[],t=a[0];let n=8;const i=ot(a,n);n+=4;let r=0,s=0;t===0?(r=ot(a,n),s=ot(a,n+4),n+=8):(r=rn(a,n),s=rn(a,n+8),n+=16),n+=2;let o=a.length+s;const c=Et(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const h=ot(a,f);f+=4;const v=h&2147483647;if((h&2147483648)>>>31===1)return ne.warn("SIDX has hierarchical references (not supported)"),null;const E=ot(a,f);f+=4,e.push({referenceSize:v,subsegmentDuration:E,info:{duration:E/i,start:o,end:o+v-1}}),o+=v,f+=4,n=f}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function ke(a){const e=[],t=G(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=G(r,["tkhd"])[0];if(s){let o=s[0];const c=ot(s,o===0?12:20),u=G(r,["mdia","mdhd"])[0];if(u){o=u[0];const f=ot(u,o===0?12:20),h=G(r,["mdia","hdlr"])[0];if(h){const v=Je(h.subarray(8,12)),b={soun:g.AUDIO,vide:g.VIDEO}[v],E=G(r,["mdia","minf","stbl","stsd"])[0],I=Ne(E);b?(e[c]={timescale:f,type:b,stsd:I},e[b]=y({timescale:f,id:c},I)):e[c]={timescale:f,type:v,stsd:I}}}}}return G(a,["moov","mvex","trex"]).forEach(i=>{const r=ot(i,4),s=e[r];s&&(s.default={duration:ot(i,12),flags:ot(i,20)})}),e}function Ne(a){const e=a.subarray(8),t=e.subarray(86),n=Je(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const u=G(e,[n])[0].subarray(n==="enca"?28:78);G(u,["sinf"]).forEach(h=>{const v=G(h,["schm"])[0];if(v){const b=Je(v.subarray(4,8));if(b==="cbcs"||b==="cenc"){const E=G(h,["frma"])[0];E&&(i=Je(E))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=G(t,["avcC"])[0];c&&c.length>3&&(i+="."+ee(c[1])+ee(c[2])+ee(c[3]),r=k(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=G(e,[n])[0],u=G(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=F(u,f),f+=2;const h=u[f++];if(h&128&&(f+=2),h&64&&(f+=u[f++]),u[f++]!==4)break;f=F(u,f);const v=u[f++];if(v===64)i+="."+ee(v);else break;if(f+=12,u[f++]!==5)break;f=F(u,f);const b=u[f++];let E=(b&248)>>3;E===31&&(E+=1+((b&7)<<3)+((u[f]&224)>>5)),i+="."+E}break}case"hvc1":case"hev1":{const c=G(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],h=u&31,v=ot(c,2),b=(u&32)>>5?"H":"L",E=c[12],I=c.subarray(6,12);i+="."+f+h,i+="."+v.toString(16).toUpperCase(),i+="."+b+E;let R="";for(let X=I.length;X--;){const ve=I[X];(ve||R)&&(R="."+ve.toString(16).toUpperCase()+R)}i+=R}r=k(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=k(i,t)||i;break}case"vp09":{const c=G(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],h=c[6]>>4&15;i+="."+oe(u)+"."+oe(f)+"."+oe(h)}break}case"av01":{const c=G(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,h=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,b=(c[2]&32)>>5,E=u===2&&v?b?12:10:v?10:8,I=(c[2]&16)>>4,R=(c[2]&8)>>3,X=(c[2]&4)>>2,ve=c[2]&3;i+="."+u+"."+oe(f)+h+"."+oe(E)+"."+I+"."+R+X+ve+"."+oe(1)+"."+oe(1)+"."+oe(1)+"."+0,r=k("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function k(a,e){const t=G(e,["dvvC"]),n=t.length?t[0]:G(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+oe(i)+"."+oe(r)}}function F(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function ee(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function oe(a){return(a<10?"0":"")+a}function J(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&G(a,["moov","trak"]).forEach(i=>{const s=G(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=G(s,["enca"]);const c=o.length>0;c||(o=G(s,["encv"])),o.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);G(f,["sinf"]).forEach(v=>{const b=me(v);if(b){const E=b.subarray(8,24);E.some(I=>I!==0)||(ne.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Z.hexDump(E)} -> ${Z.hexDump(t)}`),b.set(t,8))}})})}),a}function me(a){const e=G(a,["schm"])[0];if(e){const t=Je(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return G(a,["schi","tenc"])[0]}return null}function Te(a,e){return G(e,["moof","traf"]).reduce((t,n)=>{const i=G(n,["tfdt"])[0],r=i[0],s=G(n,["tfhd"]).reduce((o,c)=>{const u=ot(c,4),f=a[u];if(f){let h=ot(i,4);if(r===1){if(h===Tt)return ne.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;h*=Tt+1,h+=ot(i,8)}const v=f.timescale||9e4,b=h/v;if(T(b)&&(o===null||b<o))return b}return o},null);return s!==null&&T(s)&&(t===null||s<t)?s:t},null)}function pe(a,e){let t=0,n=0,i=0;const r=G(a,["moof","traf"]);for(let s=0;s<r.length;s++){const o=r[s],c=G(o,["tfhd"])[0],u=ot(c,4),f=e[u];if(!f)continue;const h=f.default,v=ot(c,0)|(h==null?void 0:h.flags);let b=h==null?void 0:h.duration;v&8&&(v&2?b=ot(c,12):b=ot(c,8));const E=f.timescale||9e4,I=G(o,["trun"]);for(let R=0;R<I.length;R++){if(t=_e(I[R]),!t&&b){const X=ot(I[R],4);t=b*X}f.type===g.VIDEO?n+=t/E:f.type===g.AUDIO&&(i+=t/E)}}if(n===0&&i===0){let s=1/0,o=0,c=0;const u=G(a,["sidx"]);for(let f=0;f<u.length;f++){const h=be(u[f]);if(h!=null&&h.references){s=Math.min(s,h.earliestPresentationTime/h.timescale);const v=h.references.reduce((b,E)=>b+E.info.duration||0,0);o=Math.max(o,v+h.earliestPresentationTime/h.timescale),c=o-s}}if(c&&T(c))return c}return n||i}function _e(a){const e=ot(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=ot(a,4);for(let r=0;r<i;r++){if(e&256){const s=ot(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function Ce(a,e,t){G(e,["moof","traf"]).forEach(n=>{G(n,["tfhd"]).forEach(i=>{const r=ot(i,4),s=a[r];if(!s)return;const o=s.timescale||9e4;G(n,["tfdt"]).forEach(c=>{const u=c[0],f=t*o;if(f){let h=ot(c,4);if(u===0)h-=f,h=Math.max(h,0),ge(c,4,h);else{h*=Math.pow(2,32),h+=ot(c,8),h-=f,h=Math.max(h,0);const v=Math.floor(h/(Tt+1)),b=Math.floor(h%(Tt+1));ge(c,4,v),ge(c,8,b)}}})})})}function Ge(a){const e={valid:null,remainder:null},t=G(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function He(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function et(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return G(n,["moof"]).map(c=>{const u=c.byteOffset-8;G(c,["traf"]).map(h=>{const v=G(h,["tfdt"]).map(b=>{const E=b[0];let I=ot(b,4);return E===1&&(I*=Math.pow(2,32),I+=ot(b,8)),I/i})[0];return v!==void 0&&(a=v),G(h,["tfhd"]).map(b=>{const E=ot(b,4),I=ot(b,0)&16777215,R=(I&1)!==0,X=(I&2)!==0,ve=(I&8)!==0;let ue=0;const Be=(I&16)!==0;let $e=0;const rt=(I&32)!==0;let Ke=8;E===r&&(R&&(Ke+=8),X&&(Ke+=4),ve&&(ue=ot(b,Ke),Ke+=4),Be&&($e=ot(b,Ke),Ke+=4),rt&&(Ke+=4),e.type==="video"&&(s=lt(e.codec)),G(h,["trun"]).map(Qe=>{const pt=Qe[0],ze=ot(Qe,0)&16777215,Bt=(ze&1)!==0;let tn=0;const si=(ze&4)!==0,Un=(ze&256)!==0;let Cn=0;const mn=(ze&512)!==0;let Ln=0;const Tn=(ze&1024)!==0,Ut=(ze&2048)!==0;let zt=0;const Wn=ot(Qe,4);let Kn=8;Bt&&(tn=ot(Qe,Kn),Kn+=4),si&&(Kn+=4);let ii=tn+u;for(let pi=0;pi<Wn;pi++){if(Un?(Cn=ot(Qe,Kn),Kn+=4):Cn=ue,mn?(Ln=ot(Qe,Kn),Kn+=4):Ln=$e,Tn&&(Kn+=4),Ut&&(pt===0?zt=ot(Qe,Kn):zt=Ze(Qe,Kn),Kn+=4),e.type===g.VIDEO){let xi=0;for(;xi<Ln;){const Si=ot(n,ii);if(ii+=4,Pt(s,n[ii])){const tr=n.subarray(ii,ii+Si);xt(tr,s?2:1,a+zt/i,t)}ii+=Si,xi+=Si+4}}a+=Cn/i}}))})})}),t}function lt(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Pt(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function xt(a,e,t,n){const i=ut(a);let r=0;r+=e;let s=0,o=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const u=i.length-r;let f=r;if(o<u)r+=o;else if(o>u){ne.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(i[f++]===181){const v=Et(i,f);if(f+=2,v===49){const b=ot(i,f);if(f+=4,b===1195456820){const E=i[f++];if(E===3){const I=i[f++],R=31&I,X=64&I,ve=X?2+R*3:0,ue=new Uint8Array(ve);if(X){ue[0]=I;for(let Be=1;Be<ve;Be++)ue[Be]=i[f++]}n.push({type:E,payloadType:s,pts:t,bytes:ue})}}}}}else if(s===5&&o>16){const h=[];for(let E=0;E<16;E++){const I=i[f++].toString(16);h.push(I.length==1?"0"+I:I),(E===3||E===5||E===7||E===9)&&h.push("-")}const v=o-16,b=new Uint8Array(v);for(let E=0;E<v;E++)b[E]=i[f++];n.push({payloadType:s,pts:t,uuid:h.join(""),userData:Oe(b),userDataBytes:b})}}}function ut(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function Gt(a){const e=a[0];let t="",n="",i=0,r=0,s=0,o=0,c=0,u=0;if(e===0){for(;Je(a.subarray(u,u+1))!=="\0";)t+=Je(a.subarray(u,u+1)),u+=1;for(t+=Je(a.subarray(u,u+1)),u+=1;Je(a.subarray(u,u+1))!=="\0";)n+=Je(a.subarray(u,u+1)),u+=1;n+=Je(a.subarray(u,u+1)),u+=1,i=ot(a,12),r=ot(a,16),o=ot(a,20),c=ot(a,24),u=28}else if(e===1){u+=4,i=ot(a,u),u+=4;const h=ot(a,u);u+=4;const v=ot(a,u);for(u+=4,s=Xo(2,32)*h+v,de(s)||(s=Number.MAX_SAFE_INTEGER,ne.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=ot(a,u),u+=4,c=ot(a,u),u+=4;Je(a.subarray(u,u+1))!=="\0";)t+=Je(a.subarray(u,u+1)),u+=1;for(t+=Je(a.subarray(u,u+1)),u+=1;Je(a.subarray(u,u+1))!=="\0";)n+=Je(a.subarray(u,u+1)),u+=1;n+=Je(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:c,payload:f}}function an(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function Ct(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),an([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function un(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=Nn(i);e.push(r),n+=r.size}}return e}function Nn(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,o=Z.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,f=null;if(r===0){if(e-32<c||c<22)return{offset:t,size:e};f=new Uint8Array(s,t+32,c)}else if(r===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};u=[];for(let h=0;h<c;h++)u.push(new Uint8Array(s,t+32+h*16,16))}return{version:r,systemId:o,kids:u,data:f,offset:t,size:e}}const At=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Qt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Re(a,e){const t=Qt[e];return!!t&&!!t[a.slice(0,4)]}function xe(a,e,t=!0){return!a.split(",").some(n=>!Ae(n,e,t))}function Ae(a,e,t=!0){var n;const i=Q(t);return(n=i==null?void 0:i.isTypeSupported(B(a,e)))!=null?n:!1}function B(a,e){return`${e}/mp4;codecs=${a}`}function j(a){if(a){const e=a.substring(0,4);return Qt.video[e]}return 2}function te(a){const e=At();return a.split(",").reduce((t,n)=>{const r=e&<(n)?9:Qt.video[n];return r?(r*2+t)/(t?3:2):(Qt.audio[n]+t)/(t?2:1)},0)}const q={};function we(a,e=!0){if(q[a])return q[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var n;if(Ae(t[i],"audio",e))return q[a]=t[i],t[i];if(t[i]==="mp3"&&(n=Q(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const vt=/flac|opus|mp4a\.40\.34/i;function st(a,e=!0){return a.replace(vt,t=>we(t.toLowerCase(),e))}function ft(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)Re(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function Mt(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function Sn(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}function En(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function Ft(a){const e=Q(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Yt(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const kn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function $n(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const Rn={};function Bn(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,o=r==null?void 0:r.audioCodec,c=r==null?void 0:r.channels,u=c?parseInt(c):o?1/0:2;let f=null;if(s!=null&&s.length)try{s.length===1&&s[0]?f=e.groups[s[0]].channels:f=s.reduce((h,v)=>{if(v){const b=e.groups[v];if(!b)throw new Error(`Audio track group ${v} not found`);Object.keys(b.channels).forEach(E=>{h[E]=(h[E]||0)+b.channels[E]})}return h},{2:0})}catch(h){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!f&&T(u)&&Object.keys(f).some(h=>parseInt(h)>u)}function xn(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n&&!i||!t)return Promise.resolve(kn);const r=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},o=a.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const c=n.split(","),u=navigator.userAgent;if(c.some(f=>lt(f))&&At())return Promise.resolve($n(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),r));r.push.apply(r,c.map(f=>({type:"media-source",video:y(y({},s),{},{contentType:B(En(f),"video")})})))}return i&&a.audioGroups&&a.audioGroups.forEach(s=>{var o;s&&((o=e.groups[s])==null||o.tracks.forEach(c=>{if(c.groupId===s){const u=c.channels||"",f=parseFloat(u);T(f)&&f>2&&r.push.apply(r,i.split(",").map(h=>({type:"media-source",audio:{contentType:B(h,"audio"),channels:""+f}})))}}))}),Promise.all(r.map(s=>{const o=sn(s);return Rn[o]||(Rn[o]=t.decodingInfo(s))})).then(s=>({supported:!s.some(o=>!o.supported),configurations:r,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:r,decodingInfoResults:[],error:s}))}function sn(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=Yt(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}const wn=["NONE","TYPE-0","TYPE-1",null];function zn(a){return wn.indexOf(a)>-1}const Hn=["SDR","PQ","HLG"];function Se(a){return!!a&&Hn.indexOf(a)>-1}var Ee={No:"",Yes:"YES",v2:"v2"};function _t(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?Ee.v2:Ee.Yes:Ee.No}class ct{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class tt{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return $t(this._audioGroups,e)}hasSubtitleGroup(e){return $t(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function $t(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function je(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function Ve(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||Hn.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&je(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const ht=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},nt=(a,e)=>JSON.stringify(a,ht(e));function Vt(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,c=i==null?void 0:i.videoCodec,u=s&&parseInt(s)===2;let f=!1,h=!1,v=1/0,b=1/0,E=1/0,I=1/0,R=0,X=[];const{preferHDR:ve,allowedVideoRanges:ue}=Ve(e,i);for(let Qe=r.length;Qe--;){const pt=a[r[Qe]];f||(f=pt.channels[2]>0),v=Math.min(v,pt.minHeight),b=Math.min(b,pt.minFramerate),E=Math.min(E,pt.minBitrate),ue.filter(Bt=>pt.videoRanges[Bt]>0).length>0&&(h=!0)}v=T(v)?v:0,b=T(b)?b:0;const Be=Math.max(1080,v),$e=Math.max(30,b);E=T(E)?E:t,t=Math.max(E,t),h||(e=void 0);const rt=r.length>1;return{codecSet:r.reduce((Qe,pt)=>{const ze=a[pt];if(pt===Qe)return Qe;if(X=h?ue.filter(Bt=>ze.videoRanges[Bt]>0):[],rt){if(ze.minBitrate>t)return Zt(pt,`min bitrate of ${ze.minBitrate} > current estimate of ${t}`),Qe;if(!ze.hasDefaultAudio)return Zt(pt,"no renditions with default or auto-select sound found"),Qe;if(o&&pt.indexOf(o.substring(0,4))%5!==0)return Zt(pt,`audio codec preference "${o}" not found`),Qe;if(s&&!u){if(!ze.channels[s])return Zt(pt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(ze.channels)})`),Qe}else if((!o||u)&&f&&ze.channels[2]===0)return Zt(pt,"no renditions with stereo sound found"),Qe;if(ze.minHeight>Be)return Zt(pt,`min resolution of ${ze.minHeight} > maximum of ${Be}`),Qe;if(ze.minFramerate>$e)return Zt(pt,`min framerate of ${ze.minFramerate} > maximum of ${$e}`),Qe;if(!X.some(Bt=>ze.videoRanges[Bt]>0))return Zt(pt,`no variants with VIDEO-RANGE of ${nt(X)} found`),Qe;if(c&&pt.indexOf(c.substring(0,4))%5!==0)return Zt(pt,`video codec preference "${c}" not found`),Qe;if(ze.maxScore<R)return Zt(pt,`max score of ${ze.maxScore} < selected max of ${R}`),Qe}return Qe&&(te(pt)>=te(Qe)||ze.fragmentError>a[Qe].fragmentError)?Qe:(I=ze.minIndex,R=ze.maxScore,pt)},void 0),videoRanges:X,preferHDR:ve,minFramerate:b,minBitrate:E,minIndex:I}}function Zt(a,e){ne.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function It(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function wt(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const u=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(f=>{if(!f)return;const h=e.groups[f];h&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+h.channels[v]}))}),i},{})}function he(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}}function Ie(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(Fe(a,i,t))return n}return-1}function Fe(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||Ue(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||it(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function Ue(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function it(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function at(a,e){const{audioCodec:t,channels:n}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function qe(a,e,t,n,i){const r=e[n],o=e.reduce((v,b,E)=>{const I=b.uri;return(v[I]||(v[I]=[])).push(E),v},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const c=r.videoRange,u=r.frameRate,f=r.codecSet.substring(0,4),h=yt(e,n,v=>{if(v.videoRange!==c||v.frameRate!==u||v.codecSet.substring(0,4)!==f)return!1;const b=v.audioGroups,E=t.filter(I=>!b||b.indexOf(I.groupId)!==-1);return Ie(a,E,i)>-1});return h>-1?h:yt(e,n,v=>{const b=v.audioGroups,E=t.filter(I=>!b||b.indexOf(I.groupId)!==-1);return Ie(a,E,i)>-1})}function yt(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function Dt(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class kt extends U{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!i||!c)return;const u=performance.now(),f=r?r.stats:i.stats,h=r?r.duration:i.duration,v=u-f.loading.start,b=s.minAutoLevel,E=i.level,I=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||E<=b){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const R=I>-1&&I!==E,X=!!t||R;if(!X&&(c.paused||!c.playbackRate||!c.readyState))return;const ve=s.mainForwardBufferInfo;if(!X&&ve===null)return;const ue=this.bwEstimator.getEstimateTTFB(),Be=Math.abs(c.playbackRate);if(v<=Math.max(ue,1e3*(h/(Be*2))))return;const $e=ve?ve.len/Be:0,rt=f.loading.first?f.loading.first-f.loading.start:-1,Ke=f.loaded&&rt>-1,Qe=this.getBwEstimate(),pt=s.levels,ze=pt[E],Bt=Math.max(f.loaded,Math.round(h*(i.bitrate||ze.averageBitrate)/8));let tn=Ke?v-rt:v;tn<1&&Ke&&(tn=Math.min(v,f.loaded*8/Qe));const si=Ke?f.loaded*1e3/tn:0,Un=ue/1e3,Cn=si?(Bt-f.loaded)/si:Bt*8/Qe+Un;if(Cn<=$e)return;const mn=si?si*8:Qe,Ln=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,Tn=this.hls.config.abrBandWidthUpFactor;let Ut=Number.POSITIVE_INFINITY,zt;for(zt=E-1;zt>b;zt--){const pi=pt[zt].maxBitrate,xi=!pt[zt].details||Ln;if(Ut=this.getTimeToLoadFrag(Un,mn,h*pi,xi),Ut<Math.min($e,h+Un))break}if(Ut>=Cn||Ut>h*10)return;Ke?this.bwEstimator.sample(v-Math.min(ue,rt),f.loaded):this.bwEstimator.sampleTTFB(v);const Wn=pt[zt].maxBitrate;this.getBwEstimate()*Tn>Wn&&this.resetEstimator(Wn);const Kn=this.findBestLevel(Wn,b,zt,0,$e,1,1);Kn>-1&&(zt=Kn),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${E} is loading too slowly;
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
Time to underbuffer: ${$e.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Cn.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Ut.toFixed(3)} s
|
|
TTFB estimate: ${rt|0} ms
|
|
Current BW estimate: ${T(Qe)?Qe|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${zt} @ ${Wn|0} bps`),s.nextLoadLevel=s.nextAutoLevel=zt,this.clearTimer();const ii=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===zt&&zt>0){const pi=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${zt>0?"and switching down":""}
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
Time to underbuffer: ${pi.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,zt>b){let xi=this.findBestLevel(this.hls.levels[b].bitrate,b,zt,0,pi,1,1);xi===-1&&(xi=b),this.hls.nextLoadLevel=this.hls.nextAutoLevel=xi,this.resetEstimator(this.hls.levels[xi].bitrate)}}};R||Cn>Ut*2?ii():this.timer=self.setInterval(ii,Ut*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:f})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new S(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case M.BUFFER_ADD_CODEC_ERROR:case M.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case M.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),o=r?r.stats:n.stats,c=s-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const h=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(h,u),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?e+this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;T(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===ie.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ie.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:s}=n,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=r.abrBandWidthFactor,h=r.abrBandWidthUpFactor;if(u){const R=this.findBestLevel(c,s,i,u,0,f,h);if(R>=0)return this.rebufferNotice=-1,R}let v=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!u){const R=this.bitrateTestDelay;R&&(v=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-R,this.info(`bitrate test took ${Math.round(1e3*R)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),f=h=1)}const b=this.findBestLevel(c,s,i,u,v,f,h);if(this.rebufferNotice!==b&&(this.rebufferNotice=b,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${b}`)),b>-1)return b;const E=n.levels[s],I=n.loadLevelObj;return I&&(E==null?void 0:E.bitrate)<I.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,r,s,o){var c;const u=i+r,f=this.lastLoadedFragLevel,h=f===-1?this.hls.firstLevel:f,{fragCurrent:v,partCurrent:b}=this,{levels:E,allAudioTracks:I,loadLevel:R,config:X}=this.hls;if(E.length===1)return 0;const ve=E[h],ue=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Be=R===-1||f===-1;let $e,rt="SDR",Ke=(ve==null?void 0:ve.frameRate)||0;const{audioPreference:Qe,videoPreference:pt}=X,ze=this.audioTracksByGroup||(this.audioTracksByGroup=It(I));let Bt=-1;if(Be){if(this.firstSelection!==-1)return this.firstSelection;const mn=this.codecTiers||(this.codecTiers=wt(E,ze,t,n)),Ln=Vt(mn,rt,e,Qe,pt),{codecSet:Tn,videoRanges:Ut,minFramerate:zt,minBitrate:Wn,minIndex:Kn,preferHDR:ii}=Ln;Bt=Kn,$e=Tn,rt=ii?Ut[Ut.length-1]:Ut[0],Ke=zt,e=Math.max(e,Wn),this.log(`picked start tier ${nt(Ln)}`)}else $e=ve==null?void 0:ve.codecSet,rt=ve==null?void 0:ve.videoRange;const tn=b?b.duration:v?v.duration:0,si=this.bwEstimator.getEstimateTTFB()/1e3,Un=[];for(let mn=n;mn>=t;mn--){var Cn;const Ln=E[mn],Tn=mn>h;if(!Ln)continue;if(X.useMediaCapabilities&&!Ln.supportedResult&&!Ln.supportedPromise){const xi=navigator.mediaCapabilities;typeof(xi==null?void 0:xi.decodingInfo)=="function"&&(Bn(Ln,ze,rt,Ke,e,Qe)||lt(Ln.videoCodec))?(Ln.supportedPromise=xn(Ln,ze,xi),Ln.supportedPromise.then(Si=>{if(!this.hls)return;Ln.supportedResult=Si;const tr=this.hls.levels,or=tr.indexOf(Ln);Si.error?this.warn(`MediaCapabilities decodingInfo error: "${Si.error}" for level ${or} ${nt(Si)}`):Si.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${or} ${nt(Si)}`),or>-1&&tr.length>1&&(this.log(`Removing unsupported level ${or}`),this.hls.removeLevel(or),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Ln.supportedResult=kn}if(($e&&Ln.codecSet!==$e||rt&&Ln.videoRange!==rt||Tn&&Ke>Ln.frameRate||!Tn&&Ke>0&&Ke<Ln.frameRate||Ln.supportedResult&&!((Cn=Ln.supportedResult.decodingInfoResults)!=null&&Cn[0].smooth))&&(!Be||mn!==Bt)){Un.push(mn);continue}const Ut=Ln.details,zt=(b?Ut==null?void 0:Ut.partTarget:Ut==null?void 0:Ut.averagetargetduration)||tn;let Wn;Tn?Wn=o*e:Wn=s*e;const Kn=tn&&i>=tn*2&&r===0?Ln.averageBitrate:Ln.maxBitrate,ii=this.getTimeToLoadFrag(si,Wn,Kn*zt,Ut===void 0);if(Wn>=Kn&&(mn===f||Ln.loadError===0&&Ln.fragmentError===0)&&(ii<=si||!T(ii)||ue&&!this.bitrateTestDelay||ii<u)){const xi=this.forcedAutoLevel;return mn!==R&&(xi===-1||xi!==R)&&(Un.length&&this.trace(`Skipped level(s) ${Un.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${E[Un[0]].codecs}" ${E[Un[0]].videoRange}; not compatible with "${$e}" ${rt}`),this.info(`switch candidate:${h}->${mn} adjustedbw(${Math.round(Wn)})-bitrate=${Math.round(Wn-Kn)} ttfb:${si.toFixed(1)} avgDuration:${zt.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${ii.toFixed(1)} firstSelection:${Be} codecSet:${Ln.codecSet} videoRange:${Ln.videoRange} hls.loadLevel:${R}`)),Be&&(this.firstSelection=mn),mn}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const qt={search:function(a,e){let t=0,n=a.length-1,i=null,r=null;for(;t<=n;){i=(t+n)/2|0,r=a[i];const s=e(r);if(s>0)t=i+1;else if(s<0)n=i-1;else return r}return null}};function Lt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!T(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(Xt(e,t,s))return s}return null}function nn(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&ln(t,n,r)===0||cn(r,a,Math.min(i,n))))return r;const s=qt.search(e,ln.bind(null,t,n));return s&&(s!==a||!r)?s:r}function cn(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function ln(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=a?1:t.start-n>a&&t.start?-1:0}function Xt(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function jt(a,e){return qt.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function dn(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const n=t.start,i=t.end;let r=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(r=r.concat(s))}return qt.search(r,s=>s.cc<e||s.end<=n?1:s.cc>e||s.start>=i?-1:0)}return null}function Rt(a){switch(a.details){case M.FRAG_LOAD_TIMEOUT:case M.KEY_LOAD_TIMEOUT:case M.LEVEL_LOAD_TIMEOUT:case M.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Nt(a,e){const t=Rt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Kt(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function pn(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function Jt(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(fn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function fn(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var An={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Pn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class ni extends U{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ie.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case M.FRAG_LOAD_ERROR:case M.FRAG_LOAD_TIMEOUT:case M.KEY_LOAD_ERROR:case M.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case M.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Fn();return}case M.FRAG_GAP:case M.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=An.SendAlternateToPenaltyBox;return}case M.LEVEL_EMPTY_ERROR:case M.LEVEL_PARSING_ERROR:{var s,o;const u=t.parent===ie.MAIN?t.level:i.loadLevel;t.details===M.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(o=s.levelDetails)!=null&&o.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case M.LEVEL_LOAD_ERROR:case M.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case M.AUDIO_TRACK_LOAD_ERROR:case M.AUDIO_TRACK_LOAD_TIMEOUT:case M.SUBTITLE_LOAD_ERROR:case M.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const u=i.loadLevelObj;if(u&&(r.type===fe.AUDIO_TRACK&&u.hasAudioGroup(r.groupId)||r.type===fe.SUBTITLE_TRACK&&u.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=An.SendAlternateToPenaltyBox,t.errorAction.flags=Pn.MoveAllAlternatesMatchingHost;return}}return;case M.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=i.loadLevelObj,f=u==null?void 0:u.attrs["HDCP-LEVEL"];f?t.errorAction={action:An.SendAlternateToPenaltyBox,flags:Pn.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case M.BUFFER_ADD_CODEC_ERROR:case M.REMUX_ALLOC_ERROR:case M.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:i.loadLevel)}return;case M.INTERNAL_EXCEPTION:case M.BUFFER_APPENDING_ERROR:case M.BUFFER_FULL_ERROR:case M.LEVEL_SWITCH_ERROR:case M.BUFFER_STALLED_ERROR:case M.BUFFER_SEEK_OVER_HOLE:case M.BUFFER_NUDGE_ON_STALL:t.errorAction=Fn();return}t.type===re.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Nt(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(Jt(i,r,Rt(e),e.response))return{action:An.RetryRequest,flags:Pn.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,o=Nt(e.details.startsWith("key")?s:r,e),c=t.levels.reduce((f,h)=>f+h.fragmentError,0);if(i&&(e.details!==M.FRAG_GAP&&i.fragmentError++,Jt(o,c,Rt(e),e.response)))return{action:An.RetryRequest,flags:Pn.None,retryConfig:o,retryCount:c};const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const u=e.details;i.loadError++,u===M.BUFFER_APPEND_ERROR&&i.fragmentError++;let f=-1;const{levels:h,loadLevel:v,minAutoLevel:b,maxAutoLevel:E}=n;n.autoLevelEnabled||(n.loadLevel=-1);const I=(r=e.frag)==null?void 0:r.type,X=(I===ie.AUDIO&&u===M.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===M.BUFFER_ADD_CODEC_ERROR||u===M.BUFFER_APPEND_ERROR))&&h.some(({audioCodec:rt})=>i.audioCodec!==rt),ue=e.sourceBufferName==="video"&&(u===M.BUFFER_ADD_CODEC_ERROR||u===M.BUFFER_APPEND_ERROR)&&h.some(({codecSet:rt,audioCodec:Ke})=>i.codecSet!==rt&&i.audioCodec===Ke),{type:Be,groupId:$e}=(s=e.context)!=null?s:{};for(let rt=h.length;rt--;){const Ke=(rt+v)%h.length;if(Ke!==v&&Ke>=b&&Ke<=E&&h[Ke].loadError===0){var o,c;const Qe=h[Ke];if(u===M.FRAG_GAP&&I===ie.MAIN&&e.frag){const pt=h[Ke].details;if(pt){const ze=nn(e.frag,pt.fragments,e.frag.start);if(ze!=null&&ze.gap)continue}}else{if(Be===fe.AUDIO_TRACK&&Qe.hasAudioGroup($e)||Be===fe.SUBTITLE_TRACK&&Qe.hasSubtitleGroup($e))continue;if(I===ie.AUDIO&&(o=i.audioGroups)!=null&&o.some(pt=>Qe.hasAudioGroup(pt))||I===ie.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(pt=>Qe.hasSubtitleGroup(pt))||X&&i.audioCodec===Qe.audioCodec||!X&&i.audioCodec!==Qe.audioCodec||ue&&i.codecSet===Qe.codecSet)continue}f=Ke;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:An.SendAlternateToPenaltyBox,flags:Pn.None,nextAutoLevel:f}}return{action:An.SendAlternateToPenaltyBox,flags:Pn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case An.DoNothing:break;case An.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==M.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case An.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:s}=n;switch(i){case Pn.None:this.switchLevel(e,s);break;case Pn.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=wn[wn.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===M.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Yt(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function Fn(a){const e={action:An.DoNothing,flags:Pn.None};return a&&(e.resolved=!0),e}var On={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Zn{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;const s=r.end;if(r.start<=e&&s!==null&&e<=s)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let s=r.length;s--;){const o=i[r[s]];if((o==null?void 0:o.body.type)===t&&(!n||o.buffered)){const c=o.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const h=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return h&&this.removeFragment(c.body),h})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=qn(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const c=n.elementaryStreams[o];if(!c)return;const u=t[o],f=s||c.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,f,u)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),ai(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Yn(n,i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=qn(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,o=e.end,c=e.minEndPTS||o,u=e.maxStartPTS||s;for(let f=0;f<i.length;f++){const h=i.start(f)-this.bufferPadding,v=i.end(f)+this.bufferPadding;if(u>=h&&c<=v){r.time.push({startPTS:Math.max(s,i.start(f)),endPTS:Math.min(o,i.end(f))});break}else if(s<v&&o>h){const b=Math.max(s,i.start(f)),E=Math.min(o,i.end(f));E>b&&(r.partial=!0,r.time.push({startPTS:b,endPTS:E}))}else if(o<=h)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&ai(f)&&(i=f.body.start-o,r=f.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ai(t))}getState(e){const t=qn(e),n=this.fragments[t];return n?n.buffered?ai(n)?On.PARTIAL:On.OK:On.APPENDING:On.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=qn(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let u=this.activePartLists[o];u||(this.activePartLists[o]=u=[]),u.push(i)}this.timeRanges=r;const c=r[s];this.detectEvictedFragments(s,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=qn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=qn(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=Yn(n,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(i=>i.clearElementaryStreamInfo())}}function ai(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function qn(a){return`${a.type}_${a.level}_${a.sn}`}function Yn(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var on={cbc:0,ctr:1};class bt{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case on.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case on.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function mt(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Ht{constructor(){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()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],o=n[3],c=this.invSubMix,u=c[0],f=c[1],h=c[2],v=c[3],b=new Uint32Array(256);let E=0,I=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++){let X=I^I<<1^I<<2^I<<3^I<<4;X=X>>>8^X&255^99,e[E]=X,t[X]=E;const ve=b[E],ue=b[ve],Be=b[ue];let $e=b[X]*257^X*16843008;i[E]=$e<<24|$e>>>8,r[E]=$e<<16|$e>>>16,s[E]=$e<<8|$e>>>24,o[E]=$e,$e=Be*16843009^ue*65537^ve*257^E*16843008,u[X]=$e<<24|$e>>>8,f[X]=$e<<16|$e>>>16,h[X]=$e<<8|$e>>>24,v[X]=$e,E?(E=ve^b[b[b[Be^ve]]],I^=b[b[I]]):E=I=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let o,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),h=this.sBox,v=this.rcon,b=this.invSubMix,E=b[0],I=b[1],R=b[2],X=b[3];let ve,ue;for(o=0;o<s;o++){if(o<r){ve=u[o]=t[o];continue}ue=ve,o%r===0?(ue=ue<<8|ue>>>24,ue=h[ue>>>24]<<24|h[ue>>>16&255]<<16|h[ue>>>8&255]<<8|h[ue&255],ue^=v[o/r|0]<<24):r>6&&o%r===4&&(ue=h[ue>>>24]<<24|h[ue>>>16&255]<<16|h[ue>>>8&255]<<8|h[ue&255]),u[o]=ve=(u[o-r]^ue)>>>0}for(c=0;c<s;c++)o=s-c,c&3?ue=u[o]:ue=u[o-4],c<4||o<=4?f[c]=ue:f[c]=E[h[ue>>>24]]^I[h[ue>>>16&255]]^R[h[ue>>>8&255]]^X[h[ue&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,c=o[0],u=o[1],f=o[2],h=o[3],v=this.uint8ArrayToUint32Array_(n);let b=v[0],E=v[1],I=v[2],R=v[3];const X=new Int32Array(e),ve=new Int32Array(X.length);let ue,Be,$e,rt,Ke,Qe,pt,ze,Bt,tn,si,Un,Cn,mn;const Ln=this.networkToHostOrderSwap;for(;t<X.length;){for(Bt=Ln(X[t]),tn=Ln(X[t+1]),si=Ln(X[t+2]),Un=Ln(X[t+3]),Ke=Bt^r[0],Qe=Un^r[1],pt=si^r[2],ze=tn^r[3],Cn=4,mn=1;mn<i;mn++)ue=c[Ke>>>24]^u[Qe>>16&255]^f[pt>>8&255]^h[ze&255]^r[Cn],Be=c[Qe>>>24]^u[pt>>16&255]^f[ze>>8&255]^h[Ke&255]^r[Cn+1],$e=c[pt>>>24]^u[ze>>16&255]^f[Ke>>8&255]^h[Qe&255]^r[Cn+2],rt=c[ze>>>24]^u[Ke>>16&255]^f[Qe>>8&255]^h[pt&255]^r[Cn+3],Ke=ue,Qe=Be,pt=$e,ze=rt,Cn=Cn+4;ue=s[Ke>>>24]<<24^s[Qe>>16&255]<<16^s[pt>>8&255]<<8^s[ze&255]^r[Cn],Be=s[Qe>>>24]<<24^s[pt>>16&255]<<16^s[ze>>8&255]<<8^s[Ke&255]^r[Cn+1],$e=s[pt>>>24]<<24^s[ze>>16&255]<<16^s[Ke>>8&255]<<8^s[Qe&255]^r[Cn+2],rt=s[ze>>>24]<<24^s[Ke>>16&255]<<16^s[Qe>>8&255]<<8^s[pt&255]^r[Cn+3],ve[t]=Ln(ue^b),ve[t+1]=Ln(rt^E),ve[t+2]=Ln($e^I),ve[t+3]=Ln(Be^R),b=Bt,E=tn,I=si,R=Un,t=t+4}return ve.buffer}}class Wt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=hn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function hn(a){switch(a){case on.cbc:return"AES-CBC";case on.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Gn=16;class Vn{constructor(e,{removePKCS7Padding:t=!0}={}){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.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?mt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise((r,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,n,i);const c=this.flush();c?r(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:s,remainderData:o}=this;if(i!==on.cbc||t.byteLength!==16)return ne.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=He(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new Ht),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new Wt(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new bt(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(ne.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i)))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Gn;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(ne.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Mn=Math.pow(2,17);class ri{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new In({type:re.NETWORK_ERROR,details:M.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(E=>E[0]==="GAP")){c(yi(e));return}else e.gap=!1;const u=this.loader=r?new r(i):new s(i),f=ci(e);e.loader=u;const h=pn(i.fragLoadPolicy.default),v={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Mn};e.stats=u.stats;const b={onSuccess:(E,I,R,X)=>{this.resetLoader(e,u);let ve=E.data;R.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(ve.slice(0,16)),ve=ve.slice(16)),o({frag:e,part:null,payload:ve,networkDetails:X})},onError:(E,I,R,X)=>{this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},E),error:new Error(`HTTP Error ${E.code} ${E.text}`),networkDetails:R,stats:X}))},onAbort:(E,I,R)=>{this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:R,stats:E}))},onTimeout:(E,I,R)=>{this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:R,stats:E}))}};t&&(b.onProgress=(E,I,R,X)=>t({frag:e,part:null,payload:R,networkDetails:X})),u.load(f,v,b)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(yi(e,t));return}const u=this.loader=r?new r(i):new s(i),f=ci(e,t);e.loader=u;const h=pn(i.fragLoadPolicy.default),v={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Mn};t.stats=u.stats,u.load(f,v,{onSuccess:(b,E,I,R)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const X={frag:e,part:t,payload:b.data,networkDetails:R};n(X),o(X)},onError:(b,E,I,R)=>{this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},b),error:new Error(`HTTP Error ${b.code} ${b.text}`),networkDetails:I,stats:R}))},onAbort:(b,E,I)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:I,stats:b}))},onTimeout:(b,E,I)=>{this.resetLoader(e,u),c(new In({type:re.NETWORK_ERROR,details:M.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:I,stats:b}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/r),c),h=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+h}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function ci(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(T(i)&&T(r)){var s;let o=i,c=r;if(a.sn==="initSegment"&&wi((s=a.decryptdata)==null?void 0:s.method)){const u=r-i;u%16&&(c=r+(16-u%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=c}return n}function yi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:re.MEDIA_ERROR,details:M.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new In(n)}function wi(a){return a==="AES-128"||a==="AES-256"}class In extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Li extends U{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Ti{constructor(e,t,n,i=0,r=-1,s=!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=gi(),this.buffering={audio:gi(),video:gi(),audiovideo:gi()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function gi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const oi={length:0,start:()=>0,end:()=>0};class gn{static isBuffered(e,t){if(e){const n=gn.getBuffered(e);for(let i=n.length;i--;)if(t>=n.start(i)&&t<=n.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=gn.getBuffered(e);return gn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=gn.bufferedRanges(e);if(i.length)return gn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((f,h)=>f.start-h.start||h.end-f.end);let i=-1,r=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(i=f);const h=r.length;if(h){const v=r[h-1].end;e[f].start-v<n?e[f].end>v&&(r[h-1].end=e[f].end):r.push(e[f])}else r.push(e[f])}else r=e;let s=0,o,c=t,u=t;for(let f=0;f<r.length;f++){const h=r[f].start,v=r[f].end;if(i===-1&&t>=h&&t<=v&&(i=f),t+n>=h&&t<v)c=h,u=v,s=u-t;else if(t+n<h){o=h;break}}return{len:s,start:c||0,end:u||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||oi}catch(t){return ne.log("failed to get media.buffered",t),oi}}}const mi=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ai(a){return mi.test(a)}function $i(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(mi,n=>{const i=n.substring(2,n.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):r})}return e}function Oi(a,e,t){let n=a.variableList;n||(a.variableList=n={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))r=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,r=e.VALUE;i in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=r||""}function Mi(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Di=/^(\d+)x(\d+)$/,Wi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Xn{constructor(e,t){typeof e=="string"&&(e=Xn.parseAttrList(e,t)),d(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Di.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={},r='"';for(Wi.lastIndex=0;(n=Wi.exec(e))!==null;){const s=n[1].trim();let o=n[2];const c=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let u=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))o=$i(t,o);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":ne.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const ji="com.apple.hls.interstitial";function bi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function lr(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Xi{constructor(e,t,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:n,t){const r=t.attr;for(const s in r)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==r[s]){ne.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=d(new Xn({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);T(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(ne.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(T(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===ji}get isValid(){return!!this.id&&!this._badValueForSameId&&T(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Hi=10;class nr{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?T(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Hi}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Fi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Ni(a){switch(a){case"AES-128":case"AES-256":return on.cbc;case"AES-256-CTR":return on.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Ei(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Bi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Ri(a){const e=Bi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function fi(a){const e=function(n,i,r){const s=n[i];n[i]=n[r],n[r]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function vi(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const r=i[0]==="base64",s=i[1];r?(n.splice(-1,1),t=Ei(s)):t=Ri(s)}}return t}const hi=typeof self!="undefined"?self:void 0;var Ot={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},_n={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function bn(a){switch(a){case _n.FAIRPLAY:return Ot.FAIRPLAY;case _n.PLAYREADY:return Ot.PLAYREADY;case _n.WIDEVINE:return Ot.WIDEVINE;case _n.CLEARKEY:return Ot.CLEARKEY}}var Dn={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Jn(a){if(a===Dn.WIDEVINE)return Ot.WIDEVINE;if(a===Dn.PLAYREADY)return Ot.PLAYREADY;if(a===Dn.CENC||a===Dn.CLEARKEY)return Ot.CLEARKEY}function li(a){switch(a){case Ot.FAIRPLAY:return _n.FAIRPLAY;case Ot.PLAYREADY:return _n.PLAYREADY;case Ot.WIDEVINE:return _n.WIDEVINE;case Ot.CLEARKEY:return _n.CLEARKEY}}function en(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Ot.FAIRPLAY,Ot.WIDEVINE,Ot.PLAYREADY,Ot.CLEARKEY].filter(i=>!!e[i]):[];return!n[Ot.WIDEVINE]&&t&&n.push(Ot.WIDEVINE),n}const yn=function(a){return hi!=null&&(a=hi.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function ei(a,e,t,n){let i;switch(a){case Ot.FAIRPLAY:i=["cenc","sinf"];break;case Ot.WIDEVINE:case Ot.PLAYREADY:i=["cenc"];break;case Ot.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Qn(i,e,t,n)}function Qn(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function ui(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function zi(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=Ei(o).subarray(0,16);return fi(c),c}}return null}let Qi={};class Ui{static clearKeyUriToKeyIdMap(){Qi={}}constructor(e,t,n,i=[1],r=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=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Fi(e)}isSupported(){if(this.method){if(Fi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case _n.FAIRPLAY:case _n.WIDEVINE:case _n.PLAYREADY:case _n.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Fi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(ne.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=ir(e);return new Ui(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=vi(this.uri);if(t)switch(this.keyFormat){case _n.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case _n.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Ct(n,null,t),this.keyId=zi(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Qi[this.uri];if(!n){const i=Object.keys(Qi).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Qi[this.uri]=n}this.keyId=n}return this}}function ir(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const rr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,wr=/#EXT-X-MEDIA:(.*)/g,us=/^#EXT(?:INF|-X-TARGETDURATION):/m,$r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),br=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class qi{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return W.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return us.test(e)}static parseMasterPlaylist(e,t){const n=Ai(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];rr.lastIndex=0;let s;for(;(s=rr.exec(e))!=null;)if(s[1]){var o;const u=new Xn(s[1],i),f=$i(i,s[2]),h={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:qi.resolve(f,t)},v=u.decimalResolution("RESOLUTION");v&&(h.width=v.width,h.height=v.height),kr(u.CODECS,h);const b=u["SUPPLEMENTAL-CODECS"];b&&(h.supplemental={},kr(b,h.supplemental)),(o=h.unknownCodecs)!=null&&o.length||r.push(h),i.levels.push(h)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const h=new Xn(f,i),v=h["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=h);break}case"SESSION-KEY":{const h=Lr(f,t,i);h.encrypted&&h.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(h)):ne.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const h=new Xn(f,i);Oi(i,h,t)}break}case"CONTENT-STEERING":{const h=new Xn(f,i);i.contentSteering={uri:qi.resolve(h["SERVER-URI"],t),pathwayId:h["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=fr(f);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,o={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(wr.lastIndex=0;(i=wr.exec(e))!==null;){const u=new Xn(i[1],n),f=u.TYPE;if(f){const h=o[f],v=r[f]||[];r[f]=v;const b=u.LANGUAGE,E=u["ASSOC-LANGUAGE"],I=u.CHANNELS,R=u.CHARACTERISTICS,X=u["INSTREAM-ID"],ve={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||b||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:b,url:u.URI?qi.resolve(u.URI,t):""};if(E&&(ve.assocLang=E),I&&(ve.channels=I),R&&(ve.characteristics=R),X&&(ve.instreamId=X),h!=null&&h.length){const ue=qi.findGroup(h,ve.groupId)||h[0];Kr(ve,ue,"audioCodec"),Kr(ve,ue,"textCodec")}v.push(ve)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const c={url:t},u=new nr(t),f=u.fragments,h=[];let v=null,b=0,E=0,I=0,R=0,X=0,ve=null,ue=new Pe(i,c),Be,$e,rt,Ke=-1,Qe=!1,pt=null,ze;if($r.lastIndex=0,u.m3u8=e,u.hasVariableRefs=Ai(e),((o=$r.exec(e))==null?void 0:o[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Be=$r.exec(e))!==null;){Qe&&(Qe=!1,ue=new Pe(i,c),ue.playlistOffset=I,ue.start=I,ue.sn=b,ue.cc=R,X&&(ue.bitrate=X),ue.level=n,v&&(ue.initSegment=v,v.rawProgramDateTime&&(ue.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),pt&&(ue.setByteRange(pt),pt=null)));const Un=Be[1];if(Un){ue.duration=parseFloat(Un);const Cn=(" "+Be[2]).slice(1);ue.title=Cn||null,ue.tagList.push(Cn?["INF",Un,Cn]:["INF",Un])}else if(Be[3]){if(T(ue.duration)){ue.playlistOffset=I,ue.start=I,rt&&Pr(ue,rt,u),ue.sn=b,ue.level=n,ue.cc=R,f.push(ue);const Cn=(" "+Be[3]).slice(1);ue.relurl=$i(u,Cn),Ar(ue,ve,h),ve=ue,I+=ue.duration,b++,E=0,Qe=!0}}else{if(Be=Be[0].match(br),!Be){ne.warn("No matches on slow regex match for level playlist!");continue}for($e=1;$e<Be.length&&Be[$e]===void 0;$e++);const Cn=(" "+Be[$e]).slice(1),mn=(" "+Be[$e+1]).slice(1),Ln=Be[$e+2]?(" "+Be[$e+2]).slice(1):null;switch(Cn){case"BYTERANGE":ve?ue.setByteRange(mn,ve):ue.setByteRange(mn);break;case"PROGRAM-DATE-TIME":ue.rawProgramDateTime=mn,ue.tagList.push(["PROGRAM-DATE-TIME",mn]),Ke===-1&&(Ke=f.length);break;case"PLAYLIST-TYPE":u.type&&ur(u,Cn,Be),u.type=mn.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?ur(u,Cn,Be):f.length>0&&Qr(u,Cn,Be),b=u.startSN=parseInt(mn);break;case"SKIP":{u.skippedSegments&&ur(u,Cn,Be);const Tn=new Xn(mn,u),Ut=Tn.decimalInteger("SKIPPED-SEGMENTS");if(T(Ut)){u.skippedSegments+=Ut;for(let Wn=Ut;Wn--;)f.push(null);b+=Ut}const zt=Tn.enumeratedString("RECENTLY-REMOVED-DATERANGES");zt&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(zt.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&ur(u,Cn,Be),u.targetduration=Math.max(parseInt(mn),1);break;case"VERSION":u.version!==null&&ur(u,Cn,Be),u.version=parseInt(mn);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||ur(u,Cn,Be),u.live=!1;break;case"#":(mn||Ln)&&ue.tagList.push(Ln?[mn,Ln]:[mn]);break;case"DISCONTINUITY":R++,ue.tagList.push(["DIS"]);break;case"GAP":ue.gap=!0,ue.tagList.push([Cn]);break;case"BITRATE":ue.tagList.push([Cn,mn]),X=parseInt(mn)*1e3,T(X)?ue.bitrate=X:X=0;break;case"DATERANGE":{const Tn=new Xn(mn,u),Ut=new Xi(Tn,u.dateRanges[Tn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,Ut.isValid||u.skippedSegments?u.dateRanges[Ut.id]=Ut:ne.warn(`Ignoring invalid DATERANGE tag: "${mn}"`),ue.tagList.push(["EXT-X-DATERANGE",mn]);break}case"DEFINE":{{const Tn=new Xn(mn,u);"IMPORT"in Tn?Mi(u,Tn,s):Oi(u,Tn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?ur(u,Cn,Be):f.length>0&&Qr(u,Cn,Be),u.startCC=R=parseInt(mn);break;case"KEY":{const Tn=Lr(mn,t,u);if(Tn.isSupported()){if(Tn.method==="NONE"){rt=void 0;break}rt||(rt={}),rt[Tn.keyFormat]&&(rt=d({},rt)),rt[Tn.keyFormat]=Tn}else ne.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${mn}"`);break}case"START":u.startTimeOffset=fr(mn);break;case"MAP":{const Tn=new Xn(mn,u);if(ue.duration){const Ut=new Pe(i,c);Xr(Ut,Tn,n,rt),v=Ut,ue.initSegment=v,v.rawProgramDateTime&&!ue.rawProgramDateTime&&(ue.rawProgramDateTime=v.rawProgramDateTime)}else{const Ut=ue.byteRangeEndOffset;if(Ut){const zt=ue.byteRangeStartOffset;pt=`${Ut-zt}@${zt}`}else pt=null;Xr(ue,Tn,n,rt),v=ue,Qe=!0}v.cc=R;break}case"SERVER-CONTROL":{ze&&ur(u,Cn,Be),ze=new Xn(mn),u.canBlockReload=ze.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=ze.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&ze.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=ze.optionalFloat("PART-HOLD-BACK",0),u.holdBack=ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&ur(u,Cn,Be);const Tn=new Xn(mn);u.partTarget=Tn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Tn=u.partList;Tn||(Tn=u.partList=[]);const Ut=E>0?Tn[Tn.length-1]:void 0,zt=E++,Wn=new Xn(mn,u),Kn=new Me(Wn,ue,c,zt,Ut);Tn.push(Kn),ue.duration+=Kn.duration;break}case"PRELOAD-HINT":{const Tn=new Xn(mn,u);u.preloadHint=Tn;break}case"RENDITION-REPORT":{const Tn=new Xn(mn,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(Tn);break}default:ne.warn(`line parsed but not handled: ${Be}`);break}}}ve&&!ve.relurl?(f.pop(),I-=ve.duration,u.partList&&(u.fragmentHint=ve)):u.partList&&(Ar(ue,ve,h),ue.cc=R,u.fragmentHint=ue,rt&&Pr(ue,rt,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Bt=f.length,tn=f[0],si=f[Bt-1];if(I+=u.skippedSegments*u.targetduration,I>0&&Bt&&si){u.averagetargetduration=I/Bt;const Un=si.sn;u.endSN=Un!=="initSegment"?Un:0,u.live||(si.endList=!0),tn&&u.startCC===void 0&&(u.startCC=tn.cc),Ke>0&&(Yr(f,Ke),tn&&h.unshift(tn))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(I+=u.fragmentHint.duration),u.totalduration=I,h.length&&u.dateRangeTagCount&&tn&&Tr(h,u),u.endCC=R,u}}function Tr(a,e){const t=a.length,n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let s=r.length;s--;){const o=e.dateRanges[r[s]],c=o.startDate.getTime();o.tagAnchor=n.ref;for(let u=t;u--;){const f=cs(e,c,a,u,i);if(f!==-1){o.tagAnchor=e.fragments[f].ref;break}}}}function cs(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+c*1e3){const u=t[n].sn-a.startSN,f=a.fragments;if(f.length>t.length){const v=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let b=v;b>u;b--){const E=f[b].programDateTime;if(e>=E&&e<E+f[b].duration*1e3)return b}}return u}}}return-1}function Lr(a,e,t){var n,i;const r=new Xn(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,c=r.hexadecimalInteger("IV"),u=r.KEYFORMATVERSIONS,f=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!c&&ne.error(`Invalid IV: ${r.IV}`);const h=o?qi.resolve(o,e):"",v=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Ui(s,h,f,v,c)}function fr(a){const t=new Xn(a).decimalFloatingPoint("TIME-OFFSET");return T(t)?t:null}function kr(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Re(r,n));i.length&&(e[`${n}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Kr(a,e,t){const n=e[t];n&&(a[t]=n)}function Yr(a,e){let t=a[e];for(let n=e;n--;){const i=a[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Ar(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Xr(a,e,t,n){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",n&&(a.levelkeys=n),a.initSegment=null}function Pr(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}function ur(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Qr(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Gr(a,e){const t=e.startPTS;if(T(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&i.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function qr(a,e,t,n,i,r){n-t<=0&&(ne.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let o=t,c=n;const u=e.startPTS,f=e.endPTS;if(T(u)){const R=Math.abs(u-t);T(e.deltaPTS)?e.deltaPTS=Math.max(R,e.deltaPTS):e.deltaPTS=R,o=Math.max(t,u),t=Math.min(t,u),i=Math.min(i,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),r=Math.max(r,e.endDTS)}const h=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=n,e.minEndPTS=c,e.endDTS=r;const v=e.sn;if(!a||v<a.startSN||v>a.endSN)return 0;let b;const E=v-a.startSN,I=a.fragments;for(I[E]=e,b=E;b>0;b--)Gr(I[b],I[b-1]);for(b=E;b<I.length-1;b++)Gr(I[b],I[b+1]);return a.fragmentHint&&Gr(I[I.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,h}function Vr(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let c=n.length-1;c>=0;c--){const u=n[c].initSegment;if(u){t=u;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;jn(a,e,(c,u,f,h)=>{if(!e.startCC&&u.cc!==c.cc){var v,b;const E=c.cc-u.cc;for(let I=f;I<h.length;I++)h[I].cc+=E;e.startCC=(v=(b=sr(a,e.startSN-1))==null?void 0:b.cc)!=null?v:h[0].cc,e.endCC=h[h.length-1].cc}T(c.startPTS)&&T(c.endPTS)&&(u.setStart(u.startPTS=c.startPTS),u.startDTS=c.startDTS,u.maxStartPTS=c.maxStartPTS,u.endPTS=c.endPTS,u.endDTS=c.endDTS,u.minEndPTS=c.minEndPTS,u.setDuration(c.endPTS-c.startPTS),u.duration&&(i=u),e.PTSKnown=e.alignedSliding=!0),c.hasStreams&&(u.elementaryStreams=c.elementaryStreams),u.loader=c.loader,c.hasStats&&(u.stats=c.stats),c.initSegment&&(u.initSegment=c.initSegment,t=c.initSegment)});const r=e.fragments,s=e.fragmentHint?r.concat(e.fragmentHint):r;if(t&&s.forEach(c=>{var u;c&&(!c.initSegment||c.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=r.some(c=>!c),e.deltaUpdateFailed){ne.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let c=e.skippedSegments;c--;)r.shift();e.startSN=r[0].sn}else{e.endCC=r[r.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=_r(a.dateRanges,e));const c=a.fragments.filter(u=>u.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<s.length;u++)s[u].programDateTime===null&&Ar(s[u],s[u-1],c);Tr(c,e)}ti(a.partList,e.partList,(c,u)=>{u.elementaryStreams=c.elementaryStreams,u.stats=c.stats}),i?qr(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Gi(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const c=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=c),e.driftEndTime=o,e.driftEnd=c}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function _r(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,i=d({},a);n&&n.forEach(o=>{delete i[o]});const s=Object.keys(i).length;return s&&Object.keys(t).forEach(o=>{const c=i[o],u=new Xi(t[o].attr,c);u.isValid?(i[o]=u,c||(u.tagOrder+=s)):ne.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${nt(t[o].attr)}"`)}),i}function ti(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function jn(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=i;u<=r;u++){const f=c[s+u];let h=o[u];if(n&&!h&&f&&(h=e.fragments[u]=f),f&&h){if(t(f,h,u,o),f.url&&f.url!==h.url){e.playlistParsingError=Ki(`media sequence mismatch ${h.sn}:`,a,e,f,h);return}else if(f.cc!==h.cc){e.playlistParsingError=Ki(`discontinuity sequence mismatch (${f.cc}!=${h.cc})`,a,e,f,h);return}}}}function Ki(a,e,t,n,i){return new Error(`${a} ${i.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function Gi(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=n>=0;let s=0;if(r&&n<i.length)s=i[n].start;else if(r&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(r&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Ii(e,s)}function Ii(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function Pi(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function sr(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function Ji(a,e,t){return a?hr(a.partList,e,t):null}function hr(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function dr(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function er(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function Or(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function Dr(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function ws(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Dr(t[n],a);e.fragmentHint&&Dr(e.fragmentHint,a),e.alignedSliding=!0}function Ks(a,e){a&&(ki(e,a),!e.alignedSliding&&a&&di(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&Gi(a,e,!1))}function ki(a,e){if(!Or(e,a))return;const t=Math.min(e.endCC,a.endCC),n=er(e.fragments,t),i=er(a.fragments,t);if(!n||!i)return;ne.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;ws(r,a)}function di(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=er(n,s),r=er(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=er(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,c=r.programDateTime;if(!o||!c)return;const u=(c-o)/1e3-(r.start-i.start);ws(u,a)}const Ci={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},dt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Zi extends Li{constructor(e,t,n,i,r){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=dt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:c,mediaBuffer:u,state:f}=this,h=c?c.currentTime:0,v=gn.bufferInfo(u||c,h,s.maxBufferHole);if(this.log(`media seeking to ${T(h)?h.toFixed(3):h}, state: ${f}`),this.state===dt.ENDED)this.resetLoadingState();else if(o){const b=s.maxFragLookUpTolerance,E=o.start-b,I=o.start+o.duration+b;if(!v.len||I<v.start||E>v.end){const R=h>I;(h<E||R)&&(R&&o.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(h,1/0,this.playlistType,!0);const b=this.lastCurrentTime;if(h>b&&(this.lastCurrentTime=h),!this.loadingParts){const E=Math.max(v.end,h),I=this.shouldLoadParts(this.getLevelDetails(),E);I&&(this.log(`LL-Part loading ON after seeking to ${h.toFixed(2)} with buffer @${E.toFixed(2)}`),this.loadingParts=I)}}!this.hls.hasEnoughToStart&&!v.len&&(this.log(`setting startPosition to ${h} because of seek before start`),this.nextLoadPosition=this.startPosition=h),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new ri(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Vn(e.config)}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===dt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=dt.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.nextStart;if(r&&r>i&&r<t.edge||this.media.currentTime<e.start)return!1;const o=t.partList;if(o!=null&&o.length){const u=o[o.length-1];return gn.isBuffered(this.media,u.start+u.duration/2)}const c=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(c)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===dt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=dt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{const s=r.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(s,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state,o=r.frag;if(this.fragContextChanged(o)){(s===dt.FRAG_LOADING||!this.fragCurrent&&s===dt.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=dt.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===dt.STOPPED||this.state===dt.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===On.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===On.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:r,payload:s}=n,o=r.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Fi(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Ni(o.method)).catch(u=>{throw i.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:r}),u}).then(u=>{const f=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:r,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===dt.STOPPED||this.state===dt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==dt.STOPPED&&(this.state=dt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Ci.toString(gn.getBuffered(n)):"(detached)"})`),Y(e)){var i;if(e.type!==ie.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=dt.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=dt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(c=>!c),o=new Ti(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=dt.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===dt.KEY_LOADING&&(this.state=dt.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const c=this.fragPrevious;if(Y(e)&&(!c||e.sn!==c.sn)){const h=this.shouldLoadParts(t.details,e.end);h!==this.loadingParts&&(this.log(`LL-Part loading ${h?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=h)}if(n=Math.max(e.start,n||0),this.loadingParts&&Y(e)){const h=s.partList;if(h&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const v=this.getNextPart(h,e,n);if(v>-1){const b=h[v];e=this.fragCurrent=b.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${b.index} (${v}/${h.length-1}) of ${this.fragInfo(e,!1,b)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=b.start+b.duration,this.state=dt.FRAG_LOADING;let E;return o?E=o.then(I=>!I||this.fragContextChanged(I.frag)?null:this.doFragPartsLoad(e,b,t,i)).catch(I=>this.handleFragLoadError(I)):E=this.doFragPartsLoad(e,b,t,i).catch(I=>this.handleFragLoadError(I)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:b,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):E}else if(!e.url||this.loadedEndOfParts(h,n))return Promise.resolve(null)}}if(Y(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),T(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=dt.FRAG_LOADING;const u=this.config.progressive;let f;return u&&o?f=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):f=Promise.all([this.fragmentLoader.load(e,u?i:void 0),o]).then(([h])=>(!u&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var o;const c=[],u=(o=n.details)==null?void 0:o.partList,f=h=>{this.fragmentLoader.loadPart(e,h,i).then(v=>{c[h.index]=v;const b=v.part;this.hls.trigger(p.FRAG_LOADED,v);const E=Ji(n.details,e.sn,h.index+1)||hr(u,e.sn,h.index+1);if(E)f(E);else return r({frag:e,part:b,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===M.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==dt.PARSING){!this.fragCurrent&&this.state!==dt.STOPPED&&this.state!==dt.ERROR&&(this.state=dt.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const o=this.getLevelDetails(),u=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const r=e.partList[0],s=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],c=o.details,u=s>-1?Ji(c,r,s):null,f=u?u.fragment:sr(c,r,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:o}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==dt.PARSING)return;const{data1:o,data2:c}=e;let u=o;if(o&&c&&(u=He(o,c)),!((s=u)!=null&&s.length))return;const f={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:u};if(this.hls.trigger(p.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!gn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=gn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!T(i))return null;const s=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,n,i){const r=gn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(r.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(r.nextStart,s.end)-t,i);return gn.bufferInfo(e,t,o)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=ie.MAIN){var n;const i=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start,o=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const h=r.initialLiveManifestSize;if(i<h)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${h})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t,n);const v=this.hls.startPosition,b=this.hls.liveSyncPosition,E=c?(v!==-1&&v>=s?v:b)||c.start:e;this.log(`Setting startPosition to ${E} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${b} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=E}}else e<=s&&(c=n[0]);if(!c){const h=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,h,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const h=c.sn-t.startSN;f=this.filterReplacedPrimary(n[h+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===On.OK||n===On.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(o!==null&&n.len+o.len>=r){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(zr(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(zr(this.hls.config)&&e.type!==ie.SUBTITLE){const n=this.hls.interstitialsManager,i=n==null?void 0:n.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let s=r.length;s--;){const o=r[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let o=0,c=e.length;o<c;o++){const u=e[o];if(s=s&&!u.independent,i>-1&&n<u.start)break;const f=u.loaded;f?i=-1:(r||u.independent||s)&&u.fragment===t&&(i=o),r=f}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=Lt(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=jt(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:o}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=i,f=n.partList,h=!!(this.loadingParts&&f!=null&&f.length&&c);h&&c&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let v;if(e<t){var b;const I=e<this.lastCurrentTime||e>t-u||(b=this.media)!=null&&b.paused||!this.startFragRequested?0:u;v=nn(r,s,e,I)}else v=s[s.length-1];if(v){const E=v.sn-n.startSN,I=this.fragmentTracker.getState(v);if((I===On.OK||I===On.PARTIAL&&v.gap)&&(r=v),r&&v.sn===r.sn&&(!h||f[0].fragment.sn>v.sn||!n.live&&!h)&&r&&v.level===r.level){const X=s[E+1];v.sn<o&&this.fragmentTracker.getState(X)!==On.OK?v=X:v=null}}return v}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,s=!t,o=e.alignedSliding&&T(r);if(s||!o&&!r){Ks(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const i=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,s=r?this.startTimeOffset:e.startTimeOffset;s!==null&&T(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&Y(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==dt.FRAG_LOADING_WAITING_RETRY)&&(this.state=dt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const E=this.getCurrentContext(t.chunkMeta);E&&(t.frag=E.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===M.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:o,flags:c,retryCount:u=0,retryConfig:f}=s||{},h=!!s&&!!f,v=h&&o===An.RetryRequest,b=h&&!s.resolved&&c===Pn.MoveAllAlternatesMatchingHost;if(!v&&b&&Y(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((v||b)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const E=Kt(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${E}ms`),s.resolved=!0,this.retryDate=self.performance.now()+E,this.state=dt.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!r&&o!==An.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else o===An.SendAlternateToPenaltyBox?this.state=dt.WAITING_LEVEL:this.state=dt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===dt.PARSING||this.state===dt.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ie.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==dt.STOPPED&&(this.state=dt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=gn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===dt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==dt.STOPPED&&(this.state=dt.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const f=e.elementaryStreams[u];if(f){const h=f.endPTS-f.startPTS;if(h<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${h})`),c||!1;const v=i?0:qr(r,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:r,level:n,drift:v,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var o;if(n.fragmentError===0&&this.treatAsGap(e,n),((o=this.transmuxer)==null?void 0:o.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=dt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ie.MAIN?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((i=t&&!n?e.startPTS:(n||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function zr(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class Jr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=Gs(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Gs(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}var es={exports:{}},fs;function Zr(){return fs||(fs=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function r(c,u,f,h,v){if(typeof f!="function")throw new TypeError("The listener must be a function");var b=new i(f,h||c,v),E=t?t+u:u;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],b]:c._events[E].push(b):(c._events[E]=b,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)e.call(f,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=t?t+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var v=0,b=h.length,E=new Array(b);v<b;v++)E[v]=h[v].fn;return E},o.prototype.listenerCount=function(u){var f=t?t+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,v,b,E){var I=t?t+u:u;if(!this._events[I])return!1;var R=this._events[I],X=arguments.length,ve,ue;if(R.fn){switch(R.once&&this.removeListener(u,R.fn,void 0,!0),X){case 1:return R.fn.call(R.context),!0;case 2:return R.fn.call(R.context,f),!0;case 3:return R.fn.call(R.context,f,h),!0;case 4:return R.fn.call(R.context,f,h,v),!0;case 5:return R.fn.call(R.context,f,h,v,b),!0;case 6:return R.fn.call(R.context,f,h,v,b,E),!0}for(ue=1,ve=new Array(X-1);ue<X;ue++)ve[ue-1]=arguments[ue];R.fn.apply(R.context,ve)}else{var Be=R.length,$e;for(ue=0;ue<Be;ue++)switch(R[ue].once&&this.removeListener(u,R[ue].fn,void 0,!0),X){case 1:R[ue].fn.call(R[ue].context);break;case 2:R[ue].fn.call(R[ue].context,f);break;case 3:R[ue].fn.call(R[ue].context,f,h);break;case 4:R[ue].fn.call(R[ue].context,f,h,v);break;default:if(!ve)for($e=1,ve=new Array(X-1);$e<X;$e++)ve[$e-1]=arguments[$e];R[ue].fn.apply(R[ue].context,ve)}}return!0},o.prototype.on=function(u,f,h){return r(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return r(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,v){var b=t?t+u:u;if(!this._events[b])return this;if(!f)return s(this,b),this;var E=this._events[b];if(E.fn)E.fn===f&&(!v||E.once)&&(!h||E.context===h)&&s(this,b);else{for(var I=0,R=[],X=E.length;I<X;I++)(E[I].fn!==f||v&&!E[I].once||h&&E[I].context!==h)&&R.push(E[I]);R.length?this._events[b]=R.length===1?R[0]:R:s(this,b)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(es)),es.exports}var hs=Zr(),ds=L(hs);const ps="1.6.2",ts={};function Jo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const a=ts[ps];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return ts[ps]=i,i}function tl(a){const e=ts[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return ts[a]=i,i}function nl(a){const e=ts[a||ps];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete ts[a||ps],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Ta(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Vs(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Ts(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function gs(a,e){const t=e;let n=0;for(;Vs(a,e);){n+=10;const i=Ts(a,e+6);n+=i,Ta(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function il(a,e,t,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],s=r>>2&15;if(s>12){const b=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_PARSING_ERROR,fatal:!0,error:b,reason:b.message});return}const o=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,u="mp4a.40."+o,f=i[s];let h=s;(o===5||o===29)&&(h-=3);const v=[o<<3|(h&14)>>1,(h&1)<<7|c<<3];return ne.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Aa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Da(a,e){return a[e+1]&1?7:9}function zs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function rl(a,e){return e+5<a.length}function As(a,e){return e+1<a.length&&Aa(a,e)}function sl(a,e){return rl(a,e)&&Aa(a,e)&&zs(a,e)<=a.length-e}function al(a,e){if(As(a,e)){const t=Da(a,e);if(e+t>=a.length)return!1;const n=zs(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||As(a,i)}return!1}function Ra(a,e,t,n,i){if(!a.samplerate){const r=il(e,t,n,i);if(!r)return;d(a,r)}}function Ia(a){return 1024*9e4/a}function ol(a,e){const t=Da(a,e);if(e+t<=a.length){const n=zs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ca(a,e,t,n,i){const r=Ia(a.samplerate),s=n+i*r,o=ol(e,t);let c;if(o){const{frameLength:h,headerLength:v}=o,b=v+h,E=Math.max(0,t+b-e.length);E?(c=new Uint8Array(b-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+b);const I={unit:c,pts:s};return E||a.samples.push(I),{sample:I,length:b,missing:E}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function ll(a,e){return Vs(a,e)&&Ts(a,e+6)+10<=a.length-e}function ul(a){if(a.size<2)return;const e=Oe(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function cl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Oe(a.data.subarray(t),!0);t+=n.length+1;const i=Oe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Oe(a.data.subarray(1));return{key:a.type,info:"",data:e}}function fl(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Oe(a.data.subarray(t),!0);t+=n.length+1;const i=Oe(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Oe(a.data);return{key:a.type,info:"",data:e}}function hl(a){return btoa(String.fromCharCode(...a))}function La(a,e){if(a<0)return-La(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}function dl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const i=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function pl(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function gl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function Zs(a,e=0,t=1/0){return ml(a,e,t,Uint8Array)}function ml(a,e,t,n){const i=_l(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=vl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,c=(s+e)/r,u=Math.floor(Math.max(0,Math.min(c,o))),f=Math.floor(Math.min(u+Math.max(t,0),o));return new n(i,u,f-u)}function _l(a){return a instanceof ArrayBuffer?a:a.buffer}function vl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function yl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const i=Oe(Zs(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=Oe(Zs(a.data,3+n,s));let c;return i==="-->"?c=Oe(Zs(a.data,4+n+s)):c=gl(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=c,e}function bl(a){return a.type==="PRIV"?ul(a):a.type[0]==="W"?fl(a):a.type==="APIC"?yl(a):cl(a)}function El(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Ts(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Ds=10,xl=10;function ka(a){let e=0;const t=[];for(;Vs(a,e);){const n=Ts(a,e+6);a[e+5]>>6&1&&(e+=Ds),e+=Ds;const i=e+n;for(;e+xl<i;){const r=El(a.subarray(e)),s=bl(r);s&&t.push(s),e+=r.size+Ds}Ta(a,e)&&(e+=Ds)}return t}function Pa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Sl(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function Ws(a){const e=ka(a);for(let t=0;t<e.length;t++){const n=e[t];if(Pa(n))return Sl(n)}}let cr=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function Er(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class js{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=He(this.cachedData,e),this.cachedData=null);let n=gs(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,c=n?Ws(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&T(c))&&(this.basePTS=wl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:cr.audioId3,duration:Number.POSITIVE_INFINITY});i<u;){if(this.canParse(e,i)){const f=this.appendFrame(s,e,i);f?(this.frameIndex++,this.lastPTS=f.sample.pts,i+=f.length,r=i):i=u}else ll(e,i)?(n=gs(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:cr.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===u&&r!==u){const f=e.slice(r);this.cachedData?this.cachedData=He(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Er(),id3Track:o,textTrack:Er()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Er(),id3Track:this._id3Track,textTrack:Er()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const wl=(a,e,t)=>{if(T(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Rs=null;const Tl=[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],Al=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Dl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Rl=[0,1,1,4];function Oa(a,e,t,n,i){if(t+24>e.length)return;const r=Ma(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,c={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function Ma(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=Tl[c*14+i-1]*1e3,h=Al[(t===3?0:t===2?1:2)*3+r],v=o===3?1:2,b=Dl[t][n],E=Rl[n],I=b*8*E,R=Math.floor(b*u/h+s)*E;if(Rs===null){const ue=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Rs=ue?parseInt(ue[1]):0}return!!Rs&&Rs<=87&&n===2&&u>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:h,channelCount:v,frameLength:R,samplesPerFrame:I}}}function Hs(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Fa(a,e){return e+1<a.length&&Hs(a,e)}function Il(a,e){return Hs(a,e)&&4<=a.length-e}function Na(a,e){if(e+1<a.length&&Hs(a,e)){const n=Ma(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Fa(a,r)}return!1}class Cl extends js{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=gs(e,0);let i=(n==null?void 0:n.length)||0;if(Na(e,i))return!1;for(let r=e.length;i<r;i++)if(al(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,n){Ra(e,this.observer,t,n,e.manifestCodec);const i=Ca(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ba=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const o=Math.min(n,8),c=8-o;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class Ll extends js{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=Ua(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=gs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<16}}function Ua(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+f>e.length)return-1;const h=e[t+6]>>5;let v=0;h===2?v+=2:(h&1&&h!==1&&(v+=2),h&4&&(v+=2));const b=(e[t+6]<<8|e[t+7])>>12-v&1,I=[2,1,2,3,3,4,4,5][h]+b,R=e[t+5]>>3,X=e[t+5]&7,ve=new Uint8Array([r<<6|R<<1|X>>2,(X&3)<<6|h<<3|b<<2|c>>4,c<<4&224]),ue=1536/o*9e4,Be=n+i*ue,$e=e.subarray(t,t+f);return a.config=ve,a.channelCount=I,a.samplerate=o,a.samples.push({unit:$e,pts:Be}),f}class kl extends js{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=gs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Na(e,n))return ne.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Il(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Oa(e,t,n,this.basePTS,this.frameIndex)}}const Pl=/\/emsg[-/]ID3/i;class Ol{constructor(e,t){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=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=Er("video",1),s=this.audioTrack=Er("audio",1),o=this.txtTrack=Er("text",1);if(this.id3Track=Er("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=ke(e);if(c.video){const{id:u,timescale:f,codec:h,supplemental:v}=c.video;r.id=u,r.timescale=o.timescale=f,r.codec=h,r.supplemental=v}if(c.audio){const{id:u,timescale:f,codec:h}=c.audio;s.id=u,s.timescale=f,s.codec=h}o.id=Le.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return le(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=He(this.remainderData,e));const o=Ge(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=et(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=et(e,t),{videoTrack:t,audioTrack:Er(),id3Track:i,textTrack:Er()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=G(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Gt(r);if(Pl.test(s.schemeIdUri)){const o=$a(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:cr.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=$a(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:cr.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function $a(a,e){return T(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Ml{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Vn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,on.cbc)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=ut(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}class Ka{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const s=r,o=[];let c=0,u,f,h,v=-1,b=0;for(r===-1&&(v=0,b=this.getNALuType(t,0),r=0,c=1);c<i;){if(u=t[c++],!r){r=u?0:1;continue}if(r===1){r=u?0:2;continue}if(!u)r=3;else if(u===1){if(f=c-r-1,v>=0){const E={data:t.subarray(v,f),type:b};o.push(E)}else{const E=this.getLastNalUnit(e.samples);E&&(s&&c<=4-s&&E.state&&(E.data=E.data.subarray(0,E.data.byteLength-s)),f>0&&(E.data=He(E.data,t.subarray(0,f)),E.state=0))}c<i?(h=this.getNALuType(t,c),v=c,b=h,r=0):r=-1}else r=0}if(v>=0&&r>=0){const E={data:t.subarray(v,i),type:b,state:r};o.push(E)}if(o.length===0){const E=this.getLastNalUnit(e.samples);E&&(E.data=He(E.data,t))}return e.naluState=r,o}}class ms{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&ne.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Ga extends Ka{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var f,h;switch(u.type){case 1:{let I=!1;o=!0;const R=u.data;if(c&&R.length>4){const X=this.readSliceType(R);(X===2||X===4||X===7||X===9)&&(I=!0)}if(I){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=I;break}case 5:o=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,xt(u.data,1,n.pts,t.samples);break}case 7:{var b,E;o=!0,c=!0;const I=u.data,R=this.readSPS(I);if(!e.sps||e.width!==R.width||e.height!==R.height||((b=e.pixelRatio)==null?void 0:b[0])!==R.pixelRatio[0]||((E=e.pixelRatio)==null?void 0:E[1])!==R.pixelRatio[1]){e.width=R.width,e.height=R.height,e.pixelRatio=R.pixelRatio,e.sps=[I];const X=I.subarray(1,4);let ve="avc1.";for(let ue=0;ue<3;ue++){let Be=X[ue].toString(16);Be.length<2&&(Be="0"+Be),ve+=Be}e.codec=ve}break}case 8:o=!0,e.pps=[u.data];break;case 9:o=!0,e.audFound=!0,(h=s)!=null&&h.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new ms(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,i=8,r;for(let s=0;s<e;s++)i!==0&&(r=t.readEG(),i=(n+r+256)%256),n=i===0?n:i}readSPS(e){const t=new ms(e);let n=0,i=0,r=0,s=0,o,c,u;const f=t.readUByte.bind(t),h=t.readBits.bind(t),v=t.readUEG.bind(t),b=t.readBoolean.bind(t),E=t.skipBits.bind(t),I=t.skipEG.bind(t),R=t.skipUEG.bind(t),X=this.skipScalingList.bind(this);f();const ve=f();if(h(5),E(3),f(),R(),ve===100||ve===110||ve===122||ve===244||ve===44||ve===83||ve===86||ve===118||ve===128){const Qe=v();if(Qe===3&&E(1),R(),R(),E(1),b())for(c=Qe!==3?8:12,u=0;u<c;u++)b()&&(u<6?X(16,t):X(64,t))}R();const ue=v();if(ue===0)v();else if(ue===1)for(E(1),I(),I(),o=v(),u=0;u<o;u++)I();R(),E(1);const Be=v(),$e=v(),rt=h(1);rt===0&&E(1),E(1),b()&&(n=v(),i=v(),r=v(),s=v());let Ke=[1,1];if(b()&&b())switch(f()){case 1:Ke=[1,1];break;case 2:Ke=[12,11];break;case 3:Ke=[10,11];break;case 4:Ke=[16,11];break;case 5:Ke=[40,33];break;case 6:Ke=[24,11];break;case 7:Ke=[20,11];break;case 8:Ke=[32,11];break;case 9:Ke=[80,33];break;case 10:Ke=[18,11];break;case 11:Ke=[15,11];break;case 12:Ke=[64,33];break;case 13:Ke=[160,99];break;case 14:Ke=[4,3];break;case 15:Ke=[3,2];break;case 16:Ke=[2,1];break;case 255:{Ke=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((Be+1)*16-n*2-i*2),height:(2-rt)*($e+1)*16-(rt?2:4)*(r+s),pixelRatio:Ke}}}class Va extends Ka{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var f,h;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,xt(u.data,2,n.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=d(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const b=this.readSPS(u.data);e.width=b.width,e.height=b.height,e.pixelRatio=b.pixelRatio,e.codec=b.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const E in b.params)e.params[E]=b.params[E]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const b=this.readPPS(u.data);for(const E in b)e.params[E]=b[E]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(h=s)!=null&&h.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new ms(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(e){const t=new ms(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),h=t.readUByte(),v=t.readUByte(),b=t.readUByte(),E=t.readUByte(),I=t.readUByte(),R=t.readUByte(),X=t.readUByte(),ve=[],ue=[];for(let _i=0;_i<n;_i++)ve.push(t.readBoolean()),ue.push(t.readBoolean());if(n>0)for(let _i=n;_i<8;_i++)t.readBits(2);for(let _i=0;_i<n;_i++)ve[_i]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),ue[_i]&&t.readUByte();t.readUEG();const Be=t.readUEG();Be==3&&t.skipBits(1);const $e=t.readUEG(),rt=t.readUEG(),Ke=t.readBoolean();let Qe=0,pt=0,ze=0,Bt=0;Ke&&(Qe+=t.readUEG(),pt+=t.readUEG(),ze+=t.readUEG(),Bt+=t.readUEG());const tn=t.readUEG(),si=t.readUEG(),Un=t.readUEG(),Cn=t.readBoolean();for(let _i=Cn?0:n;_i<=n;_i++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Yi=0;Yi<4;Yi++)for(let mr=0;mr<(Yi===3?2:6);mr++)if(!t.readBoolean())t.readUEG();else{const yr=Math.min(64,1<<4+(Yi<<1));Yi>1&&t.readEG();for(let ls=0;ls<yr;ls++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Tn=t.readUEG();let Ut=0;for(let _i=0;_i<Tn;_i++){let Yi=!1;if(_i!==0&&(Yi=t.readBoolean()),Yi){_i===Tn&&t.readUEG(),t.readBoolean(),t.readUEG();let mr=0;for(let jr=0;jr<=Ut;jr++){const yr=t.readBoolean();let ls=!1;yr||(ls=t.readBoolean()),(yr||ls)&&mr++}Ut=mr}else{const mr=t.readUEG(),jr=t.readUEG();Ut=mr+jr;for(let yr=0;yr<mr;yr++)t.readUEG(),t.readBoolean();for(let yr=0;yr<jr;yr++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const _i=t.readUEG();for(let Yi=0;Yi<_i;Yi++){for(let mr=0;mr<Un+4;mr++)t.readBits(1);t.readBits(1)}}let Wn=0,Kn=1,ii=1,pi=!0,xi=1,Si=0;t.readBoolean(),t.readBoolean();let tr=!1;if(t.readBoolean()){if(t.readBoolean()){const Hr=t.readUByte(),Zo=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],$s=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Hr>0&&Hr<16?(Kn=Zo[Hr-1],ii=$s[Hr-1]):Hr===255&&(Kn=t.readBits(16),ii=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),tr=t.readBoolean(),tr&&(Qe+=t.readUEG(),pt+=t.readUEG(),ze+=t.readUEG(),Bt+=t.readUEG()),t.readBoolean()&&(xi=t.readBits(32),Si=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const $s=t.readBoolean(),Wo=t.readBoolean();let xs=!1;($s||Wo)&&(xs=t.readBoolean(),xs&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),xs&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let jo=0;jo<=n;jo++){pi=t.readBoolean();const nf=pi||t.readBoolean();let Ho=!1;nf?t.readEG():Ho=t.readBoolean();const Yo=Ho?1:t.readUEG()+1;if($s)for(let Ss=0;Ss<Yo;Ss++)t.readUEG(),t.readUEG(),xs&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wo)for(let Ss=0;Ss<Yo;Ss++)t.readUEG(),t.readUEG(),xs&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Wn=t.readUEG())}let Ur=$e,zo=rt;if(Ke||tr){let _i=1,Yi=1;Be===1?_i=Yi=2:Be==2&&(_i=2),Ur=$e-_i*pt-_i*Qe,zo=rt-Yi*Bt-Yi*ze}const ef=i?["A","B","C"][i]:"",tf=o<<24|c<<16|u<<8|f;let Sa=0;for(let _i=0;_i<32;_i++)Sa=(Sa|(tf>>_i&1)<<31-_i)>>>0;let wa=Sa.toString(16);return s===1&&wa==="2"&&(wa="6"),{codecString:`hvc1.${ef}${s}.${wa}.${r?"H":"L"}${X}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,c,u,f],general_constraint_indicator_flags:[h,v,b,E,I,R],general_level_idc:X,bit_depth:tn+8,bit_depth_luma_minus8:tn,bit_depth_chroma_minus8:si,min_spatial_segmentation_idc:Wn,chroma_format_idc:Be,frame_rate:{fixed:pi,fps:Si/xi}},width:Ur,height:zo,pixelRatio:[Kn,ii]}}readPPS(e){const t=new ms(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),r=t.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Vi=188;class Mr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=Mr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Vi*5,t-Vi)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let c=i;c<t;c+=Vi)if(e[c]===71&&(t-c===Vi||e[c+Vi]===71)){if(o++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Vi*99,e.length-Vi)+1)),r||(r=Ys(e,c)===0),r&&o>1&&(s===0&&o>2||c+Vi>n))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Le[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Mr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=Mr.createTrack("audio",i),this._id3Track=Mr.createTrack("id3"),this._txtTrack=Mr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,u=this._txtTrack;let f=s.pid,h=s.pesData,v=o.pid,b=c.pid,E=o.pesData,I=c.pesData,R=null,X=this.pmtParsed,ve=this._pmtId,ue=e.length;if(this.remainderData&&(e=He(this.remainderData,e),ue=e.length,this.remainderData=null),ue<Vi&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};const Be=Math.max(0,Mr.syncOffset(e));ue-=(ue-Be)%Vi,ue<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,ue,e.buffer.byteLength-ue));let $e=0;for(let Ke=Be;Ke<ue;Ke+=Vi)if(e[Ke]===71){const Qe=!!(e[Ke+1]&64),pt=Ys(e,Ke),ze=(e[Ke+3]&48)>>4;let Bt;if(ze>1){if(Bt=Ke+5+e[Ke+4],Bt===Ke+Vi)continue}else Bt=Ke+4;switch(pt){case f:if(Qe){if(h&&(r=ns(h,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new Ga;break;case"hevc":this.videoParser=new Va;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,r,!1)}h={data:[],size:0}}h&&(h.data.push(e.subarray(Bt,Ke+Vi)),h.size+=Ke+Vi-Bt);break;case v:if(Qe){if(E&&(r=ns(E,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}E={data:[],size:0}}E&&(E.data.push(e.subarray(Bt,Ke+Vi)),E.size+=Ke+Vi-Bt);break;case b:Qe&&(I&&(r=ns(I,this.logger))&&this.parseID3PES(c,r),I={data:[],size:0}),I&&(I.data.push(e.subarray(Bt,Ke+Vi)),I.size+=Ke+Vi-Bt);break;case 0:Qe&&(Bt+=e[Bt]+1),ve=this._pmtId=Fl(e,Bt);break;case ve:{Qe&&(Bt+=e[Bt]+1);const tn=Nl(e,Bt,this.typeSupported,n,this.observer,this.logger);f=tn.videoPid,f>0&&(s.pid=f,s.segmentCodec=tn.segmentVideoCodec),v=tn.audioPid,v>0&&(o.pid=v,o.segmentCodec=tn.segmentAudioCodec),b=tn.id3Pid,b>0&&(c.pid=b),R!==null&&!X&&(this.logger.warn(`MPEG-TS PMT found at ${Ke} after unknown PID '${R}'. Backtracking to sync byte @${Be} to parse all TS packets.`),R=null,Ke=Be-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:R=pt;break}}else $e++;$e>0&&Xs(this.observer,new Error(`Found ${$e} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=h,o.pesData=E,c.pesData=I;const rt={audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};return i&&this.extractRemainingSamples(rt),rt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,s=n.pesData,o=t.pesData,c=i.pesData;let u;if(s&&(u=ns(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new Ga;break;case"hevc":this.videoParser=new Va;break}this.videoParser!==null&&(this.videoParser.parsePES(n,r,u,!0),n.pesData=null)}else n.pesData=s;if(o&&(u=ns(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(u=ns(c,this.logger))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new Ml(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const h=i.missing,v=i.sample.unit.byteLength;if(h===-1)r=He(i.sample.unit,r);else{const b=v-h;i.sample.unit.set(r.subarray(0,h),b),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!As(r,s);s++);if(s!==n){let h;const v=s<o-1;if(v?h=`AAC PES did not start with ADTS header,offset:${s}`:h="No ADTS header found in AAC PES",Xs(this.observer,new Error(h),v,this.logger),!v)return}Ra(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const h=Ia(e.samplerate);c=i.sample.pts+h}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<o;)if(f=Ca(e,r,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<o-1&&!As(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Fa(n,s)){const c=Oa(e,n,s,o,r);if(c)s+=c.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,o=0,c;for(;o<r&&(c=Ua(e,n,o,i,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=d({},t,{type:this._videoTrack?cr.emsg:cr.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Ys(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Fl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Nl(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=Ys(a,e),h=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Qs("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){Qs("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){Qs("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&h>0){let v=e+5,b=h;for(;b>2;){switch(a[v]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const I=a[v+1]+2;v+=I,b-=I}}break;case 194:case 135:return Xs(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=h+5}return s}function Xs(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Qs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function ns(a,e){let t=0,n,i,r,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=He(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>a.size-6)return null;const f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&64?(o=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),r=n[8];let h=r+9;if(a.size<=h)return null;a.size-=h;const v=new Uint8Array(a.size);for(let b=0,E=c.length;b<E;b++){n=c[b];let I=n.byteLength;if(h)if(h>I){h-=I;continue}else n=n.subarray(h),I-=h,h=0;v.set(n,t),t+=I}return i&&(i-=r+3),{data:v,pts:s,dts:o,len:i}}return null}class Bl{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===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(t===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(t===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(t===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(t===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}}}const Fr=Math.pow(2,32)-1;class We{static init(){We.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in We.types)We.types.hasOwnProperty(e)&&(We.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),n=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]);We.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);We.STTS=We.STSC=We.STCO=r,We.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),We.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),We.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),We.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);We.FTYP=We.box(We.types.ftyp,s,c,s,o),We.DINF=We.box(We.types.dinf,We.box(We.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return We.box(We.types.hdlr,We.HDLR_TYPES[e])}static mdat(e){return We.box(We.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Fr+1)),i=Math.floor(t%(Fr+1));return We.box(We.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return We.box(We.types.mdia,We.mdhd(e.timescale||0,e.duration||0),We.hdlr(e.type),We.minf(e))}static mfhd(e){return We.box(We.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?We.box(We.types.minf,We.box(We.types.smhd,We.SMHD),We.DINF,We.stbl(e)):We.box(We.types.minf,We.box(We.types.vmhd,We.VMHD),We.DINF,We.stbl(e))}static moof(e,t,n){return We.box(We.types.moof,We.mfhd(e),We.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=We.trak(e[t]);return We.box.apply(null,[We.types.moov,We.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(We.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=We.trex(e[t]);return We.box.apply(null,[We.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Fr+1)),i=Math.floor(t%(Fr+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&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 We.box(We.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return We.box(We.types.sdtp,n)}static stbl(e){return We.box(We.types.stbl,We.stsd(e),We.box(We.types.stts,We.STTS),We.box(We.types.stsc,We.STSC),We.box(We.types.stsz,We.STSZ),We.box(We.types.stco,We.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const o=We.box(We.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],h=e.pixelRatio[1];return We.box(We.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,c>>8&255,c&255,u>>8&255,u&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]),o,We.box(We.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),We.box(We.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return We.box(We.types.mp4a,We.audioStsd(e),We.box(We.types.esds,We.esds(e)))}static mp3(e){return We.box(We.types[".mp3"],We.audioStsd(e))}static ac3(e){return We.box(We.types["ac-3"],We.audioStsd(e),We.box(We.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return We.box(We.types.stsd,We.STSD,We.mp4a(e));if(t==="ac3"&&e.config)return We.box(We.types.stsd,We.STSD,We.ac3(e));if(t==="mp3"&&e.codec==="mp3")return We.box(We.types.stsd,We.STSD,We.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return We.box(We.types.stsd,We.STSD,We.avc1(e));if(t==="hevc"&&e.vps)return We.box(We.types.stsd,We.STSD,We.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,s=Math.floor(n/(Fr+1)),o=Math.floor(n%(Fr+1));return We.box(We.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&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,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=We.sdtp(e),i=e.id,r=Math.floor(t/(Fr+1)),s=Math.floor(t%(Fr+1));return We.box(We.types.traf,We.box(We.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),We.box(We.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),We.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,We.box(We.types.trak,We.tkhd(e),We.mdia(e))}static trex(e){const t=e.id;return We.box(We.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let o,c,u,f,h,v;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<i;o++)c=n[o],u=c.duration,f=c.size,h=c.flags,v=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&61440,h.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return We.box(We.types.trun,s)}static initSegment(e){We.types||We.init();const t=We.moov(e);return He(We.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let E=0;E<n.length;E+=1){s+=3;for(let I=0;I<n[E].length;I+=1)s+=2+n[E][I].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const c=n.length-1;for(let E=0;E<n.length;E+=1){o.set(new Uint8Array([32+E|(E===c?128:0),0,n[E].length]),s),s+=3;for(let I=0;I<n[E].length;I+=1)o.set(new Uint8Array([n[E][I].length>>8,n[E][I].length&255]),s),s+=2,o.set(n[E][I],s),s+=n[E][I].length}const u=We.box(We.types.hvcC,o),f=e.width,h=e.height,v=e.pixelRatio[0],b=e.pixelRatio[1];return We.box(We.types.hvc1,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,f>>8&255,f&255,h>>8&255,h&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]),u,We.box(We.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),We.box(We.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,b>>24,b>>16&255,b>>8&255,b&255])))}}We.types=void 0,We.HDLR_TYPES=void 0,We.STTS=void 0,We.STSC=void 0,We.STCO=void 0,We.STSZ=void 0,We.VMHD=void 0,We.SMHD=void 0,We.STSD=void 0,We.FTYP=void 0,We.DINF=void 0;const za=9e4;function qs(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function Ul(a,e,t=1,n=!1){return qs(a,e,1/t,n)}function _s(a,e=!1){return qs(a,1e3,1/za,e)}function $l(a,e=1){return qs(a,za,1/e)}const Kl=10*1e3,Gl=1024,Vl=1152,zl=1536;let is=null,Js=null;function Za(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class Is{constructor(e,t,n,i){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.ISGenerated=!1,is===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);is=s?parseInt(s[1]):0}if(Js===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Js=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let o=s.pts,c=o-r;return c<-4294967296&&(t=!0,o=pr(o,n),c=o-r),c>0?r:o},n);return t&&this.logger.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,c){let u,f,h,v,b,E,I=r,R=r;const X=e.pid>-1,ve=t.pid>-1,ue=t.samples.length,Be=e.samples.length>0,$e=o&&ue>0||ue>1;if((!X||Be)&&(!ve||$e)||this.ISGenerated||o){if(this.ISGenerated){var Ke,Qe,pt,ze;const Un=this.videoTrackConfig;(Un&&(t.width!==Un.width||t.height!==Un.height||((Ke=t.pixelRatio)==null?void 0:Ke[0])!==((Qe=Un.pixelRatio)==null?void 0:Qe[0])||((pt=t.pixelRatio)==null?void 0:pt[1])!==((ze=Un.pixelRatio)==null?void 0:ze[1]))||!Un&&$e||this.nextAudioPts===null&&Be)&&this.resetInitSegment()}this.ISGenerated||(h=this.generateIS(e,t,r,s));const Bt=this.isVideoContiguous;let tn=-1,si;if($e&&(tn=Zl(t.samples),!Bt&&this.config.forceKeyFrameOnDiscontinuity))if(E=!0,tn>0){this.logger.warn(`[mp4-remuxer]: Dropped ${tn} out of ${ue} video samples due to a missing keyframe`);const Un=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(tn),t.dropped+=tn,R+=(t.samples[0].pts-Un)/t.inputTimeScale,si=R}else tn===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${ue} video samples`),E=!1);if(this.ISGenerated){if(Be&&$e){const Un=this.getVideoStartPts(t.samples),mn=(pr(e.samples[0].pts,Un)-Un)/t.inputTimeScale;I+=Math.max(0,mn),R+=Math.max(0,-mn)}if(Be){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(e,t,r,s)),f=this.remuxAudio(e,I,this.isAudioContiguous,s,ve||$e||c===ie.AUDIO?R:void 0),$e){const Un=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(e,t,r,s)),u=this.remuxVideo(t,R,Bt,Un)}}else $e&&(u=this.remuxVideo(t,R,Bt,0));u&&(u.firstKeyFrame=tn,u.independent=tn!==-1,u.firstKeyFramePTS=si)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(b=Wa(n,r,this._initPTS,this._initDTS)),i.samples.length&&(v=ja(i,r,this._initPTS))),{audio:f,video:u,initSegment:h,independent:E,text:v,id3:b}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,c={},u=this._initPTS;let f=!u||i,h="audio/mp4",v,b,E;if(f&&(v=b=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(h="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:h,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):We.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(E=e.inputTimeScale,!u||E!==u.timescale?v=b=r[0].pts-Math.round(E*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:We.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(E=t.inputTimeScale,!u||E!==u.timescale){const I=this.getVideoStartPts(s),R=Math.round(E*n);b=Math.min(b,pr(s[0].dts,I)-R),v=Math.min(v,I-R)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:v,timescale:E},this._initDTS={baseTime:b,timescale:E}):v=E=void 0,{tracks:c,initPTS:v,timescale:E}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],c=s.length,u=this._initPTS;let f=this.nextAvcDts,h=8,v=this.videoSampleDuration,b,E,I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,X=!1;if(!n||f===null){const Ut=t*r,zt=s[0].pts-pr(s[0].dts,s[0].pts);is&&f!==null&&Math.abs(Ut-zt-f)<15e3?n=!0:f=Ut-zt}const ve=u.baseTime*r/u.timescale;for(let Ut=0;Ut<c;Ut++){const zt=s[Ut];zt.pts=pr(zt.pts-ve,f),zt.dts=pr(zt.dts-ve,f),zt.dts<s[Ut>0?Ut-1:Ut].dts&&(X=!0)}X&&s.sort(function(Ut,zt){const Wn=Ut.dts-zt.dts,Kn=Ut.pts-zt.pts;return Wn||Kn}),b=s[0].dts,E=s[s.length-1].dts;const ue=E-b,Be=ue?Math.round(ue/(c-1)):v||e.inputTimeScale/30;if(n){const Ut=b-f,zt=Ut>Be,Wn=Ut<-1;if((zt||Wn)&&(zt?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${_s(Ut,!0)} ms (${Ut}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${_s(-Ut,!0)} ms (${Ut}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Wn||f>=s[0].pts||is)){b=f;const Kn=s[0].pts-Ut;if(zt)s[0].dts=b,s[0].pts=Kn;else{let ii=!0;for(let pi=0;pi<s.length&&!(s[pi].dts>Kn&&ii);pi++){const xi=s[pi].pts;if(s[pi].dts-=Ut,s[pi].pts-=Ut,pi<s.length-1){const Si=s[pi+1].pts,tr=s[pi].pts,or=Si<=tr,Ur=Si<=xi;ii=or==Ur}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${_s(Kn,!0)}/${_s(b,!0)}, delta: ${_s(Ut,!0)} ms`)}}b=Math.max(0,b);let $e=0,rt=0,Ke=b;for(let Ut=0;Ut<c;Ut++){const zt=s[Ut],Wn=zt.units,Kn=Wn.length;let ii=0;for(let pi=0;pi<Kn;pi++)ii+=Wn[pi].data.length;rt+=ii,$e+=Kn,zt.length=ii,zt.dts<Ke?(zt.dts=Ke,Ke+=Be/4|0||1):Ke=zt.dts,I=Math.min(zt.pts,I),R=Math.max(zt.pts,R)}E=s[c-1].dts;const Qe=rt+4*$e+8;let pt;try{pt=new Uint8Array(Qe)}catch(Ut){this.observer.emit(p.ERROR,p.ERROR,{type:re.MUX_ERROR,details:M.REMUX_ALLOC_ERROR,fatal:!1,error:Ut,bytes:Qe,reason:`fail allocating video mdat ${Qe}`});return}const ze=new DataView(pt.buffer);ze.setUint32(0,Qe),pt.set(We.types.mdat,4);let Bt=!1,tn=Number.POSITIVE_INFINITY,si=Number.POSITIVE_INFINITY,Un=Number.NEGATIVE_INFINITY,Cn=Number.NEGATIVE_INFINITY;for(let Ut=0;Ut<c;Ut++){const zt=s[Ut],Wn=zt.units;let Kn=0;for(let xi=0,Si=Wn.length;xi<Si;xi++){const tr=Wn[xi],or=tr.data,Ur=tr.data.byteLength;ze.setUint32(h,Ur),h+=4,pt.set(or,h),h+=Ur,Kn+=4+Ur}let ii;if(Ut<c-1)v=s[Ut+1].dts-zt.dts,ii=s[Ut+1].pts-zt.pts;else{const xi=this.config,Si=Ut>0?zt.dts-s[Ut-1].dts:Be;if(ii=Ut>0?zt.pts-s[Ut-1].pts:Be,xi.stretchShortVideoTrack&&this.nextAudioPts!==null){const tr=Math.floor(xi.maxBufferHole*r),or=(i?I+i*r:this.nextAudioPts)-zt.pts;or>tr?(v=or-Si,v<0?v=Si:Bt=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${or/90} ms to the next segment; using duration ${v/90} ms for the last video frame.`)):v=Si}else v=Si}const pi=Math.round(zt.pts-zt.dts);tn=Math.min(tn,v),Un=Math.max(Un,v),si=Math.min(si,ii),Cn=Math.max(Cn,ii),o.push(Za(zt.key,v,Kn,pi))}if(o.length){if(is){if(is<70){const Ut=o[0].flags;Ut.dependsOn=2,Ut.isNonSync=0}}else if(Js&&Cn-si<Un-tn&&Be/Un<.025&&o[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ut=b;for(let zt=0,Wn=o.length;zt<Wn;zt++){const Kn=Ut+o[zt].duration,ii=Ut+o[zt].cts;if(zt<Wn-1){const pi=Kn+o[zt+1].cts;o[zt].duration=pi-ii}else o[zt].duration=zt?o[zt-1].duration:Be;o[zt].cts=0,Ut=Kn}}}v=Bt||!v?Be:v,this.nextAvcDts=f=E+v,this.videoSampleDuration=v,this.isVideoContiguous=!0;const Tn={data1:We.moof(e.sequenceNumber++,b,d(e,{samples:o})),data2:pt,startPTS:I/r,endPTS:(R+v)/r,startDTS:b/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Tn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Vl;case"ac3":return zl;default:return Gl}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,u=this.getSamplesPerFrame(e),f=u*c,h=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,b=[],E=r!==void 0;let I=e.samples,R=v?0:8,X=this.nextAudioPts||-1;const ve=t*s,ue=h.baseTime*s/h.timescale;if(this.isAudioContiguous=n=n||I.length&&X>0&&(i&&Math.abs(ve-X)<9e3||Math.abs(pr(I[0].pts-ue,ve)-X)<20*f),I.forEach(function(mn){mn.pts=pr(mn.pts-ue,ve)}),!n||X<0){if(I=I.filter(mn=>mn.pts>=0),!I.length)return;r===0?X=0:i&&!E?X=Math.max(0,ve):X=I[0].pts}if(e.segmentCodec==="aac"){const mn=this.config.maxAudioFramesDrift;for(let Ln=0,Tn=X;Ln<I.length;Ln++){const Ut=I[Ln],zt=Ut.pts,Wn=zt-Tn,Kn=Math.abs(1e3*Wn/s);if(Wn<=-mn*f&&E)Ln===0&&(this.logger.warn(`Audio frame @ ${(zt/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Wn/s)} ms.`),this.nextAudioPts=X=Tn=zt);else if(Wn>=mn*f&&Kn<Kl&&E){let ii=Math.round(Wn/f);Tn=zt-ii*f,Tn<0&&(ii--,Tn+=f),Ln===0&&(this.nextAudioPts=X=Tn),this.logger.warn(`[mp4-remuxer]: Injecting ${ii} audio frame @ ${(Tn/s).toFixed(3)}s due to ${Math.round(1e3*Wn/s)} ms gap.`);for(let pi=0;pi<ii;pi++){const xi=Math.max(Tn,0);let Si=Bl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Si||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Si=Ut.unit.subarray()),I.splice(Ln,0,{unit:Si,pts:xi}),Tn+=f,Ln++}}Ut.pts=Tn,Tn+=f}}let Be=null,$e=null,rt,Ke=0,Qe=I.length;for(;Qe--;)Ke+=I[Qe].unit.byteLength;for(let mn=0,Ln=I.length;mn<Ln;mn++){const Tn=I[mn],Ut=Tn.unit;let zt=Tn.pts;if($e!==null){const Kn=b[mn-1];Kn.duration=Math.round((zt-$e)/c)}else if(n&&e.segmentCodec==="aac"&&(zt=X),Be=zt,Ke>0){Ke+=R;try{rt=new Uint8Array(Ke)}catch(Kn){this.observer.emit(p.ERROR,p.ERROR,{type:re.MUX_ERROR,details:M.REMUX_ALLOC_ERROR,fatal:!1,error:Kn,bytes:Ke,reason:`fail allocating audio mdat ${Ke}`});return}v||(new DataView(rt.buffer).setUint32(0,Ke),rt.set(We.types.mdat,4))}else return;rt.set(Ut,R);const Wn=Ut.byteLength;R+=Wn,b.push(Za(!0,u,Wn,0)),$e=zt}const pt=b.length;if(!pt)return;const ze=b[b.length-1];this.nextAudioPts=X=$e+c*ze.duration;const Bt=v?new Uint8Array(0):We.moof(e.sequenceNumber++,Be/c,d({},e,{samples:b}));e.samples=[];const tn=Be/s,si=X/s,Cn={data1:Bt,data2:rt,startPTS:tn,endPTS:si,startDTS:tn,endDTS:si,type:"audio",hasAudio:!0,hasVideo:!1,nb:pt};return this.isAudioContiguous=!0,Cn}}function pr(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function Zl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function Wa(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const c=a.samples[o];c.pts=pr(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=pr(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function ja(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const o=a.samples[s];o.pts=pr(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class Wl{constructor(e,t,n,i){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=i}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(J(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=ke(e);i.audio&&(t=Ha(i.audio,g.AUDIO)),i.video&&(n=Ha(i.video,g.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var o,c;let{initPTS:u,lastEndTime:f}=this;const h={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};T(f)||(f=this.lastEndTime=r||0);const v=t.samples;if(!(v!=null&&v.length))return h;const b={initPTS:void 0,timescale:1};let E=this.initData;if((o=E)!=null&&o.length||(this.generateInitSegment(v),E=this.initData),!((c=E)!=null&&c.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1);const I=pe(v,E),R=Te(E,v),X=R===null?r:R;(s||!u)&&(jl(u,X,r,I)||b.timescale!==u.timescale)&&(b.initPTS=X-r,u&&u.timescale===1&&this.logger.warn(`Adjusting initPTS @${r} from ${u.baseTime/u.timescale} to ${b.initPTS}`),this.initPTS=u={baseTime:b.initPTS,timescale:1});const ve=e?X-u.baseTime/u.timescale:f,ue=ve+I;Ce(E,v,u.baseTime/u.timescale),I>0?this.lastEndTime=ue:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Be=!!E.audio,$e=!!E.video;let rt="";Be&&(rt+="audio"),$e&&(rt+="video");const Ke={data1:v,startPTS:ve,startDTS:ve,endPTS:ue,endDTS:ue,type:rt,hasAudio:Be,hasVideo:$e,nb:1,dropped:0};return h.audio=Ke.type==="audio"?Ke:void 0,h.video=Ke.type!=="audio"?Ke:void 0,h.initSegment=b,h.id3=Wa(n,r,u,u),i.samples.length&&(h.text=ja(i,r,u)),h}}function jl(a,e,t,n){if(a===null)return!0;const i=Math.max(n,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Ha(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===g.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?st(t,!1):(ne.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(ne.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let Rr;try{Rr=self.performance.now.bind(self.performance)}catch(a){Rr=Date.now}const Cs=[{demux:Ol,remux:Wl},{demux:Mr,remux:Is},{demux:Cl,remux:Is},{demux:kl,remux:Is}];Cs.splice(2,0,{demux:Ll,remux:Is});class Ya{constructor(e,t,n,i,r,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Rr();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:f,trackSwitch:h,accurateTimeOffset:v,timeOffset:b,initSegmentChange:E}=i||o,{audioCodec:I,videoCodec:R,defaultInitPts:X,duration:ve,initSegmentData:ue}=c,Be=Hl(s,t);if(Be&&Fi(Be.method)){const Qe=this.getDecrypter(),pt=Ni(Be.method);if(Qe.isSync()){let ze=Qe.softwareDecrypt(s,Be.key.buffer,Be.iv.buffer,pt);if(n.part>-1){const tn=Qe.flush();ze=tn&&tn.buffer}if(!ze)return r.executeEnd=Rr(),ea(n);s=new Uint8Array(ze)}else return this.asyncResult=!0,this.decryptionPromise=Qe.webCryptoDecrypt(s,Be.key.buffer,Be.iv.buffer,pt).then(ze=>{const Bt=this.push(ze,null,n);return this.decryptionPromise=null,Bt}),this.decryptionPromise}const $e=this.needsProbing(f,h);if($e){const Qe=this.configureTransmuxer(s);if(Qe)return this.logger.warn(`[transmuxer] ${Qe.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_PARSING_ERROR,fatal:!1,error:Qe,reason:Qe.message}),r.executeEnd=Rr(),ea(n)}(f||h||E||$e)&&this.resetInitSegment(ue,I,R,ve,t),(f||E||$e)&&this.resetInitialTimestamp(X),u||this.resetContiguity();const rt=this.transmux(s,Be,b,v,n);this.asyncResult=vs(rt);const Ke=this.currentTransmuxState;return Ke.contiguous=!0,Ke.discontinuity=!1,Ke.trackSwitch=!1,r.executeEnd=Rr(),rt}flush(e){const t=e.transmuxing;t.executeStart=Rr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const h=n.flush();h&&s.push(this.push(h.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Rr();const h=[ea(e)];return this.asyncResult?Promise.resolve(h):h}const f=c.flush(o);return vs(f)?(this.asyncResult=!0,f.then(h=>(this.flushRemux(s,h,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ie.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(i,r,s,o,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=Rr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,n,i),o.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,c,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let h=0,v=Cs.length;h<v;h++){var s;if((s=Cs[h].demux)!=null&&s.probe(e,this.logger)){r=Cs[h];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,u=r.remux,f=r.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,i,this.logger)),(!o||!(o instanceof f))&&(this.demuxer=new f(n,t,i,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Vn(this.config)),e}}function Hl(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ea=a=>({remuxResult:{},chunkMeta:a});function vs(a){return"then"in a&&a.then instanceof Function}class Yl{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class Xl{constructor(e,t,n,i,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}let Xa=0;class Qa{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Xa++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var h;const v=(h=this.workerContext)==null?void 0:h.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new ds,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const o=Ft(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(r.workerPath||Jo()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=tl(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:nt(r)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.terminateWorker(),this.error=null,this.transmuxer=new Ya(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new Ya(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Xa++;const t=this.hls.config,n=Ft(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:nt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),nl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,o,c,u,f){var h,v;u.transmuxing.start=self.performance.now();const{instanceNo:b,transmuxer:E}=this,I=s?s.start:r.start,R=r.decryptdata,X=this.frag,ve=!(X&&r.cc===X.cc),ue=!(X&&u.level===X.level),Be=X?u.sn-X.sn:-1,$e=this.part?u.part-this.part.index:-1,rt=Be===0&&u.id>1&&u.id===(X==null?void 0:X.stats.chunkCount),Ke=!ue&&(Be===1||Be===0&&($e===1||rt&&$e<=0)),Qe=self.performance.now();(ue||Be||r.stats.parsing.start===0)&&(r.stats.parsing.start=Qe),s&&($e||!Ke)&&(s.stats.parsing.start=Qe);const pt=!(X&&((h=r.initSegment)==null?void 0:h.url)===((v=X.initSegment)==null?void 0:v.url)),ze=new Xl(ve,Ke,c,ue,I,pt);if(!Ke||ve||pt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===ie.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${ve}
|
|
trackSwitch: ${ue}
|
|
contiguous: ${Ke}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${I}
|
|
initSegmentChange: ${pt}`);const Bt=new Yl(n,i,t,o,f);this.configureTransmuxer(Bt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:b,cmd:"demux",data:e,decryptdata:R,chunkMeta:u,state:ze},e instanceof ArrayBuffer?[e]:[]);else if(E){const Bt=E.push(e,R,u,ze);vs(Bt)?Bt.then(tn=>{this.handleTransmuxComplete(tn)}).catch(tn=>{this.transmuxerError(tn,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(Bt)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const i=n.flush(e);vs(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const qa=100;class Ql extends Zi{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ie.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n===ie.MAIN){const s=t.cc,o=this.fragCurrent;if(this.initPTS[s]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}/${r}`),this.mainAnchor=t,this.state===dt.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&o&&o.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,o.abortRequests(),this.resetLoadingState()):this.state===dt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),n=e.cc;return dn(t,n,e)||t&&jt(t.fragments,n)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=dt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(qa),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=dt.IDLE):this.state=dt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case dt.IDLE:this.doTickIdle();break;case dt.WAITING_TRACK:{const{levels:t,trackId:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=dt.WAITING_INIT_PTS}break}case dt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,trackId:r}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[r])||null),this.state=dt.IDLE}break}case dt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:i,cache:r,complete:s}=t,o=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=dt.FRAG_LOADING;const c=r.flush().buffer,u={frag:n,part:i,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else o&&o.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${n.cc}) cancelled because video is at cc ${o.cc}`),this.nextLoadPosition=this.findSyncFrag(o).start,this.clearWaitingFragment())}else this.state=dt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==dt.STOPPED&&(this.state=dt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[r]))return;const o=n[r],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=dt.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,g.AUDIO,ie.AUDIO));const f=this.getFwdBufferInfo(u,ie.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=dt.ENDED;return}const h=f.len,v=t.maxBufferLength,b=c.fragments,E=b[0].start,I=this.getLoadPosition(),R=this.flushing?I:f.end;if(this.switchingTrack&&i){const ue=I;c.PTSKnown&&ue<E&&(f.end>E||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=E+.05)}if(h>=v&&!this.switchingTrack&&R<b[b.length-1].start)return;let X=this.getNextFragment(R,c);if(X&&this.isLoopLoading(X,R)&&(X=this.getNextFragmentLoopLoading(X,c,f,ie.MAIN,v)),!X){this.bufferFlushed=!0;return}let ve=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&ve&&Y(X)&&!X.endList&&(!c.live||!this.loadingParts&&R<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(ve)===On.OK&&(this.mainFragLoading=ve=null),ve&&Y(ve))){if(X.start>ve.end){const Be=this.fragmentTracker.getFragAtPos(R,ie.MAIN);Be&&Be.end>ve.end&&(ve=Be,this.mainFragLoading={frag:Be,targetBufferTime:null})}if(X.start>ve.end)return}this.loadFragment(X,o,R)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new tt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==dt.STOPPED&&(this.setInterval(qa),this.state=dt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==dt.STOPPED&&(this.state=dt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const f=i[s];let h=0;if(r.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(f.details){var v;h=this.alignPlaylists(r,f.details,(v=this.levelLastLoaded)==null?void 0:v.details)}r.alignedSliding||(ki(r,u),r.alignedSliding||di(r,u),h=r.fragmentStart)}f.details=r,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,h),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===dt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=dt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const h=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new Qa(this.hls,ie.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const b=this.initPTS[n.cc],E=(t=n.initSegment)==null?void 0:t.data;if(b!==void 0){const R=i?i.index:-1,X=R!==-1,ve=new Ti(n.level,n.sn,n.stats.chunkCount,r.byteLength,R,X);v.push(r,E,h,"",n,i,f.totalduration,!1,ve,b)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${o}`);const{cache:I}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Jr,complete:!1};I.push(new Uint8Array(r)),this.state!==dt.STOPPED&&(this.state=dt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===ie.MAIN&&Y(t.frag)&&(this.mainFragLoading=t,this.state===dt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==ie.AUDIO){!this.audioOnly&&n.type===ie.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(Y(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,y({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=dt.ERROR;return}switch(t.details){case M.FRAG_GAP:case M.FRAG_PARSING_ERROR:case M.FRAG_DECRYPT_ERROR:case M.FRAG_LOAD_ERROR:case M.FRAG_LOAD_TIMEOUT:case M.KEY_LOAD_ERROR:case M.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ie.AUDIO,t);break;case M.AUDIO_TRACK_LOAD_ERROR:case M.AUDIO_TRACK_LOAD_TIMEOUT:case M.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===dt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===fe.AUDIO_TRACK&&(this.state=dt.IDLE);break;case M.BUFFER_ADD_CODEC_ERROR:case M.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case M.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case M.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==g.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==g.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===dt.ENDED&&(this.state=dt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ie.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=o,{details:h}=f,{audio:v,text:b,id3:E,initSegment:I}=r;if(this.fragContextChanged(c)||!h){this.fragmentTracker.removeFragment(c);return}if(this.state=dt.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),I!=null&&I.tracks){const R=c.initSegment||c;this._bufferInitSegment(f,I.tracks,R,s),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:n,tracks:I.tracks})}if(v){const{startPTS:R,endPTS:X,startDTS:ve,endDTS:ue}=v;u&&(u.elementaryStreams[g.AUDIO]={startPTS:R,endPTS:X,startDTS:ve,endDTS:ue}),c.setElementaryStreamInfo(g.AUDIO,R,X,ve,ue),this.bufferFragmentData(v,c,u,s)}if(E!=null&&(t=E.samples)!=null&&t.length){const R=d({id:n,frag:c,details:h},E);i.trigger(p.FRAG_PARSING_METADATA,R)}if(b){const R=d({id:n,frag:c,details:h},b);i.trigger(p.FRAG_PARSING_USERDATA,R)}}_bufferInitSegment(e,t,n,i){if(this.state!==dt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=ie.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${s}/${r.codec}]`),s&&s.split(",").length===1&&(r.levelCodec=s),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===On.NOT_LOADED||i===On.PARTIAL){var r;if(!Y(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=dt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&di(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o}=this.bufferedTrack;Fe({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,at)||(Dt(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,y({},e))}}class ta extends U{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const o=i[s];let c;try{c=new self.URL(o.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=o.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&_t(n);return new ct(o,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),o=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const f=Math.max(c||0,0);i.appliedTimelineOffset=f,i.fragments.forEach(h=>{h.start=h.playlistOffset+f})}if(i.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){Vr(n,i);const ve=i.playlistParsingError;if(ve){this.warn(ve);const ue=this.hls;if(!ue.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Be}=t;ue.trigger(p.ERROR,{type:re.NETWORK_ERROR,details:M.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:ve,reason:ve.message,level:t.level||void 0,parent:(u=i.fragments[0])==null?void 0:u.type,networkDetails:Be,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const h=this.hls.mainForwardBufferInfo,v=h?h.end-h.len:0,b=(i.edge-v)*1e3,E=Pi(i,b);if(i.requestScheduled+E<s?i.requestScheduled=s:i.requestScheduled+=E,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let I,R,X;if(i.canBlockReload&&i.endSN&&i.advanced){const ve=this.hls.config.lowLatencyMode,ue=i.lastPartSn,Be=i.endSN,$e=i.lastPartIndex,rt=$e!==-1,Ke=ue===Be;rt?Ke?(R=Be+1,X=ve?0:$e):(R=ue,X=ve?$e+1:i.maxPartIndex):R=Be+1;const Qe=i.age,pt=Qe+i.ageHeader;let ze=Math.min(pt-i.partTarget,i.targetduration*1.5);if(ze>0){if(pt>i.targetduration*3)this.log(`Playlist last advanced ${Qe.toFixed(2)}s ago. Omitting segment and part directives.`),R=void 0,X=void 0;else if(n!=null&&n.tuneInGoal&&pt-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${ze} with playlist age: ${i.age}`),ze=0;else{const Bt=Math.floor(ze/i.targetduration);if(R+=Bt,X!==void 0){const tn=Math.round(ze%i.targetduration/i.partTarget);X+=tn}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Qe.toFixed(2)}s goal: ${ze} skip sn ${Bt} to part ${X}`)}i.tuneInGoal=ze}if(I=this.getDeliveryDirectives(i,t.deliveryDirectives,R,X),ve||!Ke){i.requestScheduled=s,this.loadingPlaylist(f,I);return}}else(i.canBlockReload||i.canSkipUntil)&&(I=this.getDeliveryDirectives(i,t.deliveryDirectives,R,X));I&&R!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(E-o*2,E/2)),this.scheduleLoading(f,I,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),s=i.requestScheduled;if(r>=s){this.loadingPlaylist(e,t);return}const o=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,n,i){let r=_t(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=Ee.No),new ct(n,i,r)}checkRetry(e){const t=e.details,n=Rt(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},c=!!i&&!!o&&(r===An.RetryRequest||!i.resolved&&r===An.SendAlternateToPenaltyBox);if(c){var u;if(s>=o.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=Kt(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function Ja(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!ys(a[t].attrs,e[t].attrs))return!1;return!0}function ys(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function na(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class ql extends ta{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(v=>!n||n.indexOf(v.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(v=>v.default)&&(this.selectDefaultTrack=!1),o.forEach((v,b)=>{v.id=b});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!r&&c){const v=Ie(c,o,at);if(v>-1)r=o[v];else{const b=Ie(c,this.tracks);r=this.tracks[b]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const f={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,f);const h=this.trackId;if(u!==-1&&h===-1)this.setAudioTrack(u);else if(o.length&&h===-1){var s;const v=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(v.message),this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===fe.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&Fe(e,i,at))return i;const r=Ie(e,this.tracksInGroup,at);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=qe(e,t.levels,n,s,at);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Ie(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,y({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||Fe(e,i,at)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(Fe({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c},f,at))return u}for(let u=0;u<t.length;u++){const f=t[u];if(ys(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(ys(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Dt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(p.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class Jl{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(r){var n;if(i.onError(r),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],i=n==null?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const eo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,to="HlsJsTrackRemovedError";class eu extends Error{constructor(e){super(e),this.name=to}}class tu extends U{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:r}=this;n&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=ye(Q(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const s=this.isQueued();(r||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?d(n,i.tracks):this.sourceBuffers.forEach(r=>{const[s]=r;s&&(n[s]=d({},this.tracks[s]),this.removeBuffer(s)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,i=Q(this.appendSource);if(this.transferData=this.overrides=void 0,n&&i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),r)this._objectUrl=n.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,no(n),nu(n,o),n.load()}catch(c){n.src=o}else n.src=o}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,s=r?r.length:0,o=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(i&&r&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${nt(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${nt(i,(c,u)=>c==="initSegment"?void 0:u)}}`),!ce(i,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,r.forEach(c=>{const u=c,f=i[u];if(f){const h=f.buffer;if(h){const v=this.fragmentTracker,b=f.id;if(v.hasFragments(b)||v.hasParts(b)){const R=gn.getBuffered(h);v.detectEvictedFragments(u,R,b,null,!0)}const E=ia(u),I=[u,h];this.sourceBuffers[E]=I,h.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:s}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const c=r.sourceBuffers;for(let u=c.length;u--;)o&&c[u].abort(),r.removeSourceBuffer(c[u]);o&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&no(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ia(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Jl(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!r&&this.sourceBufferCount&&this.media&&i.some(o=>!n[o]);if(r||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(o=>{var c,u,f;const h=t[o],{id:v,codec:b,levelCodec:E,container:I,metadata:R,supplemental:X}=h;let ve=n[o];const ue=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[o],Be=ue!=null&&ue.buffer?ue:ve,$e=(Be==null?void 0:Be.pendingCodec)||(Be==null?void 0:Be.codec),rt=Be==null?void 0:Be.levelCodec;ve||(ve=n[o]={buffer:void 0,listeners:[],codec:b,supplemental:X,container:I,levelCodec:E,metadata:R,id:v});const Ke=Mt($e,rt),Qe=Ke==null?void 0:Ke.replace(eo,"$1");let pt=Mt(b,E);const ze=(f=pt)==null?void 0:f.replace(eo,"$1");pt&&Ke&&Qe!==ze&&(o.slice(0,5)==="audio"&&(pt=st(pt,this.appendSource)),this.log(`switching codec ${$e} to ${pt}`),pt!==(ve.pendingCodec||ve.codec)&&(ve.pendingCodec=pt),ve.container=I,this.appendChangeType(o,I,pt))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ie.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&gn.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,ie.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:s,frag:o,part:c,chunkMeta:u}=t,f=u.buffering[r],h=o.sn,v=self.performance.now();f.start=v;const b=o.stats.buffering,E=c?c.stats.buffering:null;b.start===0&&(b.start=v),E&&E.start===0&&(E.start=v);const I=n.audio;let R=!1;r==="audio"&&(I==null?void 0:I.container)==="audio/mpeg"&&(R=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const X=this.tracks.video,ve=X==null?void 0:X.buffer;if(ve&&h!=="initSegment"){const $e=c||o,rt=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend){const Qe=$e.start+$e.duration*.05,pt=ve.buffered,ze=this.currentOp("video");!pt.length&&!ze?this.blockAudio($e):!ze&&!gn.isBuffered(ve,Qe)&&this.lastVideoAppendEnd<Qe&&this.blockAudio($e)}else if(r==="video"){const Ke=$e.end;if(rt){const Qe=rt.frag.start;(Ke>Qe||Ke<this.lastVideoAppendEnd||gn.isBuffered(ve,Qe))&&this.unblockAudio()}this.lastVideoAppendEnd=Ke}}const ue=(c||o).start,Be={label:`append-${r}`,execute:()=>{if(f.executeStart=self.performance.now(),R){const $e=this.tracks[r];if($e){const rt=$e.buffer;if(rt){const Ke=ue-rt.timestampOffset;Math.abs(Ke)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${ue} (delta: ${Ke}) sn: ${h})`),rt.timestampOffset=ue)}}}this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const $e=self.performance.now();f.executeEnd=f.end=$e,b.first===0&&(b.first=$e),E&&E.first===0&&(E.first=$e);const rt={};this.sourceBuffers.forEach(([Ke,Qe])=>{Ke&&(rt[Ke]=gn.getBuffered(Qe))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:r,frag:o,part:c,chunkMeta:u,parent:o.type,timeRanges:rt})},onError:$e=>{var rt;const Ke={type:re.MEDIA_ERROR,parent:o.type,details:M.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:c,chunkMeta:u,error:$e,err:$e,fatal:!1},Qe=(rt=this.media)==null?void 0:rt.error;if($e.code===DOMException.QUOTA_EXCEEDED_ERR)Ke.details=M.BUFFER_FULL_ERROR;else if($e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Qe)Ke.errorAction=Fn(!0);else if($e.name===to&&this.sourceBufferCount===0)Ke.errorAction=Fn(!0);else{const pt=++this.appendErrors[r];this.warn(`Failed ${pt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${Qe||"no media error"})`),(pt>=this.hls.config.appendErrorMaxRetry||Qe)&&(Ke.fatal=!0)}this.hls.trigger(p.ERROR,Ke)}};this.append(Be,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,r),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[g.AUDIOVIDEO]?r.push("audiovideo"):(s[g.AUDIO]&&r.push("audio"),s[g.VIDEO]&&r.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const u=i?i.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:i,stats:u,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,r).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})&&(i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===M.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;T(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const i=e.config,r=n.currentTime,s=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(T(o)&&o>=0){const c=Math.max(o,s),u=Math.floor(r/s)*s-c;this.flushBackBuffer(r,s,u)}if(T(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const c=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),u=Math.max(c,s),f=Math.floor(r/s)*s+u;this.flushFrontBuffer(r,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=gn.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=gn.getBuffered(r),o=s.length;if(o<2)return;const c=s.start(o-1),u=s.end(o-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),f=Math.max(u,i);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return T(r)?{duration:r}:null;const s=this.media.duration,o=T(n.duration)?n.duration:0;return i>o&&i>s||!T(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(T(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${n}.`),i.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${nt(n)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(p.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const s=r,o=e[s];if(this.isPending(o)){const c=this.getTrackCodec(o,s),u=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${nt(o)}`);try{const f=n.addSourceBuffer(u),h=ia(s),v=[s,f];t[h]=v,o.buffer=f}catch(f){var i;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&xe(n,"video")&&(i=ft(i,n));const r=Mt(i,e.levelCodec);return r?t.slice(0,5)==="audio"?st(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=T(i.duration)?i.duration:1/0,u=T(r.duration)?r.duration:1/0,f=Math.max(0,t),h=Math.min(n,c,u);h>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${h}] from the ${e} SourceBuffer`),o.remove(f,h)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new eu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const i=(n=this.tracks[t])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const s=n.bind(this,e);i.listeners.push({event:t,listener:s}),r.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function no(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function nu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ia(a){return a==="audio"?1:0}class ra{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&T(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,ra.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&i(c,e[o+1])){r=o;break}}return r}}const ar={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},iu={HLS:"h"},bs={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},ru={[bs.OBJECT]:["br","d","ot","tb"],[bs.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[bs.SESSION]:["cid","pr","sf","sid","st","v"],[bs.STATUS]:["bs","rtp"]};class rs{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof rs?n:new rs(n))),this.value=e,this.params=t}}const su="Dict";function au(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function ou(a,e,t,n){return new Error(`failed to ${a} "${au(e)}" as ${t}`,{cause:n})}function xr(a,e,t){return ou("serialize",a,e,t)}class io{constructor(e){this.description=e}}const ro="Bare Item",lu="Boolean";function uu(a){if(typeof a!="boolean")throw xr(a,lu);return a?"?1":"?0"}const cu="Byte Sequence";function fu(a){if(ArrayBuffer.isView(a)===!1)throw xr(a,cu);return`:${hl(a)}:`}const hu="Integer";function du(a){return a<-999999999999999||999999999999999<a}function so(a){if(du(a))throw xr(a,hu);return a.toString()}function pu(a){return`@${so(a.getTime()/1e3)}`}const gu="Decimal";function mu(a){const e=La(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw xr(a,gu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const _u="String",vu=/[\x00-\x1f\x7f]+/;function yu(a){if(vu.test(a))throw xr(a,_u);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function bu(a){return a.description||a.toString().slice(7,-1)}const Eu="Token";function ao(a){const e=bu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw xr(e,Eu);return e}function sa(a){switch(typeof a){case"number":if(!T(a))throw xr(a,ro);return Number.isInteger(a)?so(a):mu(a);case"string":return yu(a);case"symbol":return ao(a);case"boolean":return uu(a);case"object":if(a instanceof Date)return pu(a);if(a instanceof Uint8Array)return fu(a);if(a instanceof io)return ao(a);default:throw xr(a,ro)}}const xu="Key";function aa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw xr(a,xu);return a}function oa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${aa(e)}`:`;${aa(e)}=${sa(t)}`).join("")}function oo(a){return a instanceof rs?`${sa(a.value)}${oa(a.params)}`:sa(a)}function Su(a){return`(${a.value.map(oo).join(" ")})${oa(a.params)}`}function wu(a,e={whitespace:!0}){if(typeof a!="object")throw xr(a,su);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof rs||(r=new rs(r));let s=aa(i);return r.value===!0?s+=oa(r.params):(s+="=",Array.isArray(r.value)?s+=Su(r):s+=oo(r)),s}).join(`,${n}`)}function Tu(a,e){return wu(a,e)}function Au(a){return a==="ot"||a==="sf"||a==="st"}function Du(a){return typeof a=="number"?T(a):a!=null&&a!==""&&a!==!1}const Ls=a=>Math.round(a),Ru=(a,e)=>(e!=null&&e.baseUrl&&(a=dl(a,e.baseUrl)),encodeURIComponent(a)),ks=a=>Ls(a/100)*100,Iu={br:Ls,d:Ls,bl:ks,dl:ks,mtp:ks,nor:Ru,rtp:ks,tb:Ls};function Cu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=d({},Iu,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let o=a[s];const c=i[s];c&&(o=c(o,e)),!(s==="v"&&o===1)&&(s=="pr"&&o===1||Du(o)&&(Au(s)&&typeof o=="string"&&(o=new io(o)),t[s]=o))}),t}function lo(a,e={}){return a?Tu(Cu(a,e),d({whitespace:!1},e)):""}function Lu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),i=Object.entries(ru).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=n.reduce((s,o)=>{var c,u;const[f,h]=o,v=((c=i.find(b=>b[1].includes(f)))===null||c===void 0?void 0:c[0])||bs.REQUEST;return(u=s[v])!==null&&u!==void 0||(s[v]={}),s[v][f]=h,s},{});return Object.entries(r).reduce((s,[o,c])=>(s[o]=lo(c,e),s),t)}function ku(a,e,t){return d(a,Lu(e,t))}const Pu="CMCD";function Ou(a,e={}){if(!a)return"";const t=lo(a,e);return`${Pu}=${encodeURIComponent(t)}`}const uo=/CMCD=[^&#]+/;function Mu(a,e,t){const n=Ou(e,t);if(!n)return a;if(uo.test(a))return a.replace(uo,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Fu{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:ar.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:s}=i,o=this.hls.levels[r.level],c=this.getObjectType(r),u={d:(s||r).duration*1e3,ot:c};(c===ar.VIDEO||c===ar.AUDIO||c==ar.MUXED)&&(u.br=o.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(r);f!=null&&f.url&&f.url!==r.url&&(u.nor=f.url),this.apply(i,u)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:iu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){d(t,this.createData());const n=t.ot===ar.INIT||t.ot===ar.VIDEO||t.ot===ar.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ku(e.headers,t,r)):e.url=Mu(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const i=e.sn-n.startSN;return n.fragments[i+1]}}getNextPart(e){var t,n;const{index:i,fragment:r}=e,s=(t=this.hls.levels[r.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:o}=r;for(let c=s.length-1;c>=0;c--){const u=s[c];if(u.index===i&&u.fragment.sn===o)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return ar.TIMED_TEXT;if(e.sn==="initSegment")return ar.INIT;if(t==="audio")return ar.AUDIO;if(t==="main")return this.hls.audioTracks.length?ar.VIDEO:ar.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===ar.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}for(const r of n)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===ar.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:gn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}}const Nu=3e5;class Bu extends U{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===An.SendAlternateToPenaltyBox&&n.flags===Pn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:u}=t.context;o&&i?s=this.getPathwayForGroupId(o,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${nt(r)} penalized: ${nt(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(r=>{i-n[r]>Nu&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,dr(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===fe.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===fe.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=r;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(o).map(f=>{const h=new Xn(f.attrs);h["PATHWAY-ID"]=s;const v=h.AUDIO&&`${h.AUDIO}_clone_${s}`,b=h.SUBTITLES&&`${h.SUBTITLES}_clone_${s}`;v&&(n[h.AUDIO]=v,h.AUDIO=v),b&&(i[h.SUBTITLES]=b,h.SUBTITLES=b);const E=fo(f.uri,h["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),I=new tt({attrs:h,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:E,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let R=1;R<f.audioGroups.length;R++)I.addGroupId("audio",`${f.audioGroups[R]}_clone_${s}`);if(f.subtitleGroups)for(let R=1;R<f.subtitleGroups.length;R++)I.addGroupId("text",`${f.subtitleGroups[R]}_clone_${s}`);return I});t.push(...u),co(this.audioTracks,n,c,s),co(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+f)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},u={onSuccess:(f,h,v,b)=>{this.log(`Loaded steering manifest: "${i}"`);const E=f.data;if((E==null?void 0:E.VERSION)!==1){this.log(`Steering VERSION ${E.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=E.TTL;const{"RELOAD-URI":I,"PATHWAY-CLONES":R,"PATHWAY-PRIORITY":X}=E;if(I)try{this.uri=new self.URL(I,i).href}catch(ue){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${I}`);return}this.scheduleRefresh(this.uri||v.url),R&&this.clonePathways(R);const ve={steeringManifest:E,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,ve),X&&this.updatePathwayPriority(X)},onError:(f,h,v,b)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${h.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${h.url} no longer available`);return}let E=this.timeToLoad*1e3;if(f.code===429){const I=this.loader;if(typeof(I==null?void 0:I.getResponseHeader)=="function"){const R=I.getResponseHeader("Retry-After");R&&(E=parseFloat(R)*1e3)}this.log(`Steering manifest ${h.url} rate limited`);return}this.scheduleRefresh(this.uri||h.url,E)},onTimeout:(f,h,v)=>{this.log(`Timeout loading steering manifest (${h.url})`),this.scheduleRefresh(this.uri||h.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function co(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const o=d({},s);return o.details=void 0,o.attrs=new Xn(o.attrs),o.url=o.attrs.URI=fo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});a.push(...r)})}function fo(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return i&&!o&&(c.host=i),r&&Object.keys(r).sort().forEach(u=>{u&&c.searchParams.set(u,r[u])}),c.href}class ss extends U{constructor(e){super("eme",e.logger),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=ss.CDMCleanupPromise?[ss.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=en(this.config));const o=s.map(li).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=bn(s);let c,u;if(n==="sinf"){if(o!==Ot.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const E=Je(new Uint8Array(i));try{const I=Ei(JSON.parse(E).sinf),R=me(I);if(!R)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(R.subarray(8,24)),u=Ot.FAIRPLAY}catch(I){this.warn(`${r} Failed to parse sinf: ${I}`);return}}else{if(o!==Ot.WIDEVINE&&o!==Ot.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const E=un(i),I=E.filter(X=>!!X.systemId&&Jn(X.systemId)===o);I.length>1&&this.warn(`${r} Using first of ${I.length} pssh found for selected key-system ${o}`);const R=I[0];if(!R){E.length===0||E.some(X=>!X.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${E.map(X=>Jn(X.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=Jn(R.systemId),R.version===0&&R.data)if(u===Ot.WIDEVINE){const X=R.data.length-22;c=new Uint8Array(R.data.subarray(X,X+16))}else u===Ot.PLAYREADY&&(c=zi(R.data))}if(!u||!c)return;const f=Z.hexDump(c),{keyIdToKeySessionPromise:h,mediaKeySessions:v}=this;let b=h[f];for(let E=0;E<v.length;E++){const I=v[E],R=I.decryptdata;if(!R.keyId)continue;const X=Z.hexDump(R.keyId);if(f===X||R.uri.replace(/-/g,"").indexOf(f)!==-1){if(b=h[X],R.pssh)break;delete h[X],R.pssh=new Uint8Array(i),R.keyId=c,b=h[f]=b.then(()=>this.generateRequestWithPreferredKeySession(I,n,i,"encrypted-event-key-match")),b.catch(ve=>this.handleError(ve));break}}if(!b){if(u!==o){this.log(`Ignoring "${t.type}" event with ${u} init data for selected key-system ${o}`);return}b=h[f]=this.getKeySystemSelectionPromise([u]).then(({keySystem:E,mediaKeys:I})=>{var R;this.throwIfDestroyed();const X=new Ui("ISO-23001-7",f,(R=li(E))!=null?R:"");return X.pssh=new Uint8Array(i),X.keyId=c,this.attemptSetMediaKeys(E,I).then(()=>{this.throwIfDestroyed();const ve=this.createMediaKeySessionContext({decryptdata:X,keySystem:E,mediaKeys:I});return this.generateRequestWithPreferredKeySession(ve,n,i,"encrypted-event-no-match")})}),b.catch(E=>this.handleError(E))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Ot.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,o,c)=>!!s&&c.indexOf(s)===o,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,o)=>{const c=u=>{const f=u.shift();this.getMediaKeysPromise(f,i,r).then(h=>s({keySystem:f,mediaKeys:h})).catch(h=>{u.length?c(u):h instanceof gr?o(h):o(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_NO_ACCESS,error:h,fatal:!0},h.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return yn===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=ei(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=r==null?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${nt(i)}`),s=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),u.then(h=>h?this.setMediaKeysServerCertificate(f,e,h):f))),o.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),o.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Z.hexDump(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Z.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Z.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=en(this.config),r=e.map(bn).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const o=li(s);o?t(o):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:o,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(o=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(o,c,u,"playlist-key")})).catch(o=>this.handleError(o))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof gr?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=bn(e.keyFormat),r=i?[i]:en(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=en(this.config)),e.length===0)throw new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${nt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r,s;const o=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(o)try{const E=o.call(this.hls,t,n,e);if(!E)throw new Error("Invalid response from configured generateRequest filter");t=E.initDataType,n=E.initData?E.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(E){var c;if(this.warn(E.message),(c=this.hls)!=null&&c.config.debug)throw E}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const f=new ds,h=e._onmessage=E=>{const I=e.mediaKeysSession;if(!I){f.emit("error",new Error("invalid state"));return}const{messageType:R,message:X}=E;this.log(`"${R}" message event for session "${I.sessionId}" message size: ${X.byteLength}`),R==="license-request"||R==="license-renewal"?this.renewLicense(e,X).catch(ve=>{f.eventNames().length?f.emit("error",ve):this.handleError(ve)}):R==="license-release"?e.keySystem===Ot.FAIRPLAY&&(this.updateKeySession(e,Bi("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${R}"`)},v=e._onkeystatuseschange=E=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const R=e.keyStatus;f.emit("keyStatus",R),R==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",h),e.mediaKeysSession.addEventListener("keystatuseschange",v);const b=new Promise((E,I)=>{f.on("error",I),f.on("keyStatus",R=>{R.startsWith("usable")?E():R==="output-restricted"?I(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):R==="internal-error"?I(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${R}"`)):R==="expired"?I(new Error("key expired while generating request")):this.warn(`unhandled key status change "${R}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var E;this.log(`Request generated for key-session "${(E=e.mediaKeysSession)==null?void 0:E.sessionId}" keyId: ${u}`)}).catch(E=>{throw new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_NO_SESSION,error:E,fatal:!1},`Error generating key-session request: ${E}`)}).then(()=>b).catch(E=>{throw f.removeAllListeners(),this.removeSession(e),E}).then(()=>(f.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const i=n;n=t,t=i}this.log(`key status change "${t}" for keyStatuses keyId: ${Z.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Z.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:r},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,b,E,I)=>{s(v.data)},onError:(v,b,E,I)=>{o(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:y({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${r}). Status: ${v.code} (${v.text})`))},onTimeout:(v,b,E)=>{o(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(v,b,E)=>{o(new Error("aborted"))}};i.load(c,f,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let f;for(let h=0,v=r.length;h<v;h++){var s,o;f=r[h];const b=(s=f.querySelector("name"))==null?void 0:s.textContent,E=(o=f.querySelector("value"))==null?void 0:o.textContent;b&&E&&e.setRequestHeader(b,E)}}const c=i.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return Bi(atob(u))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,o,s,e)}catch(f){this.error(f)}i(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)r(new gr({type:re.KEY_SYSTEM_ERROR,details:M.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==Ot.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const n=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ui.clearKeyUriToKeyIdMap();const i=n.length;ss.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(r=>{var s;this.log(`Could not clear media keys: ${r}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),n.length=0)}).catch(r=>{var s;this.log(`Could not close sessions and clear media keys: ${r}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{drmSystemOptions:r}=this.config;return(ui(r)?new Promise((o,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(o)}):Promise.resolve()).catch(o=>{var c;this.log(`Could not remove session: ${o}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${o}`)})}).then(()=>t.close()).catch(o=>{var c;this.log(`Could not close session: ${o}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${o}`)})})}}}ss.CDMCleanupPromise=void 0;class gr extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class Uu{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/r,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*o){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function ho(a,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function po(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){ne.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){ne.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function as(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function la(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Ku(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function $u(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t,r;for(;n<=i;)if(r=Math.floor((i+n)/2),e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r;return a[n].startTime-e<e-a[i].startTime?n:i}function Ku(a,e,t){const n=[],i=$u(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const o=a[r];if(o.startTime>=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Ps(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class Gu extends ta{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Ps(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;Ps(n.textTracks).forEach(s=>{as(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,h)=>{f.id=h});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const f=Ie(o,s);if(f>-1)r=s[f];else{const h=Ie(o,this.tracks);r=this.tracks[h]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||Fe(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(ys(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(ys(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(na(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===fe.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Fe(e,n))return n;const i=Ie(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Ie(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ps(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>na(n,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!T(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:o="",name:c,type:u,url:f}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:f});const h=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(h)}}function Es(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const os=.025;let Os=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Vu(a,e,t){return`${a.identifier}-${t+1}-${Es(e)}`}class zu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ua(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=ua(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=T(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ua(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<os))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Os.Range:Os.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return Zu(this)}}function ua(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<os)?e.start:e.start+e.duration}function go(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function Zu(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ca(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Wu{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const u=this.interstitial.playoutLimit,f=this.currentTime;this.startOffset+f>=u&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;let s=i.uri;try{s=go(s,r.sessionId).href}catch(c){}r.loadSource(s);const o=()=>{this.hasDetails=!0};r.once(p.LEVEL_LOADED,o),r.once(p.AUDIO_TRACK_LOADED,o),r.once(p.SUBTITLE_TRACK_LOADED,o),r.on(p.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&u.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,i=gn.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=gn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${ca(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const mo=.033;class ju extends U{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=i[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const r=n[i].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if(((n=t[i].event)==null?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let r=0;r<i;r++){const s=n[r];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&t<o+(s.duration||0))return r}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const i=n.assetList,r=i[i.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,s=this.parseDateRanges(i,{url:n.url},t),o=Object.keys(i),c=r?r.filter(u=>!o.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const h=u.cue.pre,v=u.cue.post,b=f.cue.pre,E=f.cue.post;if(h&&!b)return-1;if(b&&!h||v&&!E)return 1;if(E&&!v)return-1;if(!h&&!b&&!v&&!E){const I=u.startTime,R=f.startTime;if(I!==R)return I-R}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,r=this.parseSchedule(n,e);(t.length||(i==null?void 0:i.length)!==r.length||r.some((o,c)=>Math.abs(o.playout.start-i[c].playout.start)>.005||Math.abs(o.playout.end-i[c].playout.end)>.005))&&(this.items=r,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],c=e[o];if(c.isInterstitial){let u=this.eventMap[o];u?u.setDateRange(c):(u=new zu(c,t),this.eventMap[o]=u,n===!1&&(u.appendInPlace=n)),i.push(u)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,h)=>{const v=f.cue.pre,b=f.cue.post,E=e[h-1]||null,I=f.appendInPlace,R=b?r:f.startOffset,X=f.duration,ve=f.timelineOccupancy===Os.Range?X:0,ue=f.resumptionOffset,Be=(E==null?void 0:E.startTime)===R,$e=R+f.cumulativeDuration;let rt=I?$e+X:R+ue;if(v||!b&&R<=0){const Qe=u;u+=ve,f.timelineStart=$e;const pt=s;s+=X,n.push({event:f,start:$e,end:rt,playout:{start:pt,end:s},integrated:{start:Qe,end:u}})}else if(R<=r){if(!Be){const ze=R-c;if(ze>mo){const Bt=c,tn=u;u+=ze;const si=s;s+=ze;const Un={previousEvent:e[h-1]||null,nextEvent:f,start:Bt,end:Bt+ze,playout:{start:si,end:s},integrated:{start:tn,end:u}};n.push(Un)}else ze>0&&E&&(E.cumulativeDuration+=ze,n[n.length-1].end=R)}b&&(rt=$e),f.timelineStart=$e;const Qe=u;u+=ve;const pt=s;s+=X,n.push({event:f,start:$e,end:rt,playout:{start:pt,end:s},integrated:{start:Qe,end:u}})}else return;const Ke=f.resumeTime;b||Ke>r?c=r:c=Ke}),c<r){var o;const f=c,h=u,v=r-c;u+=v;const b=s;s+=v,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:f+v,playout:{start:b,end:s},integrated:{start:h,end:u}})}this.setDurations(r,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,i=n.live?1/0:n.edge;let r=0,s=-1;e.forEach((o,c)=>{const u=o.cue.pre,f=o.cue.post,h=u?0:f?i:o.startTime;this.updateAssetDurations(o),s===h?o.cumulativeDuration=r:(r=0,s=h),!f&&o.snapOptions.in&&(o.resumeAnchor=nn(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<mo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const b=T(o.resumeOffset)?o.resumeOffset:o.duration;r+=b})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>os?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):t?!Object.keys(t).some(s=>{const o=t[s].details,c=o.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=nn(null,o.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<os+f||Math.abs(u.end-n)<os+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;e.assetList.forEach((s,o)=>{const c=t+n;s.startOffset=n,s.timelineStart=c,i||(i=s.duration===null),r||(r=!!s.error);const u=s.error?0:s.duration||0;n+=u}),i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Nr(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Hu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=go(n,this.hls.sessionId,e.baseUrl)}catch(v){const b=this.assignAssetListError(e,M.ASSET_LIST_LOAD_ERROR,v,n);this.hls.trigger(p.ERROR,b);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),c={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,b,E,I)=>{const R=v.data,X=R==null?void 0:R.ASSETS;if(!Array.isArray(X)){const ve=this.assignAssetListError(e,M.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),E.url,b,I);this.hls.trigger(p.ERROR,ve);return}e.assetListResponse=R,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:R,networkDetails:I})},onError:(v,b,E,I)=>{const R=this.assignAssetListError(e,M.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${b.url})`),b.url,I,E);this.hls.trigger(p.ERROR,R)},onTimeout:(v,b,E)=>{const I=this.assignAssetListError(e,M.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${b.url})`),b.url,v,E);this.hls.trigger(p.ERROR,I)}};return o.load(c,f,h),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:re.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function Ir(a,e,t){Sr(a,e,t),a.addEventListener(e,t)}function Sr(a,e,t){a.removeEventListener(e,t)}function _o(a){a==null||a.play().catch(()=>{})}class Yu extends U{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(),this.checkBuffer(),s&&n<o.start||n>=o.end){var c;const v=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const b=this.findItemIndex(o);if(v>b){const E=this.schedule.findJumpRestrictedIndex(b+1,v);if(E>b){this.setSchedulePosition(E);return}}}this.setSchedulePosition(v);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(o)){const v=o.event.assetList[0];v&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,v))}return}const f=u.timelineStart,h=u.duration||0;(s&&n<f||n>=f+h)&&this.setScheduleToAssetAtTime(n,u)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const r=this.playingAsset;if(!r)return;const s=r.timelineStart+(r.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,i)=>{const r=this.schedule,s=this.playingItem,o=r.events||[],c=r.items||[],u=r.durations,f=n.map(b=>b.identifier),h=!!(o.length||f.length);if(h&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${c.map(b=>Nr(b))}`),f.length&&this.log(`Removed events ${f}`),this.playerQueue.forEach(b=>{if(b.interstitial.appendInPlace){const E=b.assetItem.timelineStart,I=b.timelineOffset-E;if(I)try{b.timelineOffset=E}catch(R){Math.abs(I)>os&&this.warn(`${R} ("${b.assetId}" ${b.timelineOffset}->${E})`)}}}),s){const b=this.updateItem(s,this.timelinePos);this.itemsMatch(s,b)&&(this.playingItem=b,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const v=this.bufferingItem;if(v){const b=this.updateItem(v,this.bufferedPos);this.itemsMatch(v,b)?this.bufferingItem=b:v.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(v.event,null))}if(n.forEach(b=>{b.assetList.forEach(E=>{this.clearAssetPlayer(E.identifier,null)})}),h||i){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Hu(e),this.schedule=new ju(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(p.MEDIA_ENDED,this.onMediaEnded,this),e.on(p.ERROR,this.onError,this),e.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(p.MEDIA_ENDED,this.onMediaEnded,this),e.off(p.ERROR,this.onError,this),e.off(p.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Sr(e,"play",this.onPlay),Sr(e,"pause",this.onPause),Sr(e,"seeking",this.onSeeking),Sr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Ir(n,"seeking",this.onSeeking),Ir(n,"timeupdate",this.onTimeupdate),Ir(n,"play",this.onPlay),Ir(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=h=>h&&e.getAssetPlayer(h.identifier),i=(h,v,b,E,I)=>{if(h){let R=h[v].start;const X=h.event;if(X){if(v==="playout"||X.timelineOccupancy!==Os.Point){const ve=n(b);(ve==null?void 0:ve.interstitial)===X&&(R+=ve.assetItem.startOffset+ve[I])}}else{const ve=E==="bufferedPos"?s():e[E];R+=ve-h.start}return R}return 0},r=(h,v)=>{if(h!==0&&v!=="primary"&&e.schedule.length){var b;const E=e.schedule.findItemIndexAtTime(h),I=(b=e.schedule.items)==null?void 0:b[E];if(I){const R=I[v].start-I.start;return h+R}}return h},s=()=>{const h=e.bufferedPos;return h===Number.MAX_VALUE?o("primary"):Math.max(h,0)},o=h=>{var v;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:e.schedule.durations[h]},c=(h,v)=>{var b,E;const I=e.effectivePlayingItem;if(I!=null&&(b=I.event)!=null&&b.restrictions.skip)return;e.log(`seek to ${h} "${v}"`);const R=e.effectivePlayingItem,X=e.schedule.findItemIndexAtTime(h,v),ve=(E=e.schedule.items)==null?void 0:E[X],ue=e.getBufferingPlayer(),Be=ue==null?void 0:ue.interstitial,$e=Be==null?void 0:Be.appendInPlace,rt=R&&e.itemsMatch(R,ve);if(R&&($e||rt)){const Qe=n(e.playingAsset),pt=(Qe==null?void 0:Qe.media)||e.primaryMedia;if(pt){const ze=v==="primary"?pt.currentTime:i(R,v,e.playingAsset,"timelinePos","currentTime"),Bt=h-ze,tn=($e?ze:pt.currentTime)+Bt;if(tn>=0&&(!Qe||$e||tn<=Qe.duration)){pt.currentTime=tn;return}}}if(ve){let Qe=h;if(v!=="primary"){const ze=ve[v].start,Bt=h-ze;Qe=ve.start+Bt}const pt=!e.isInterstitial(ve);if((!e.isInterstitial(R)||R.event.appendInPlace)&&(pt||ve.event.appendInPlace)){const ze=e.media||($e?ue==null?void 0:ue.media:null);ze&&(ze.currentTime=Qe)}else if(R){const ze=e.findItemIndex(R);if(X>ze){const tn=e.schedule.findJumpRestrictedIndex(ze+1,X);if(tn>ze){e.setSchedulePosition(tn);return}}let Bt=0;if(pt)e.timelinePos=Qe,e.checkBuffer();else{var Ke;const tn=ve==null||(Ke=ve.event)==null?void 0:Ke.assetList;if(tn){const si=h-(ve[v]||ve).start;for(let Un=tn.length;Un--;){const Cn=tn[Un];if(Cn.duration&&si>=Cn.startOffset&&si<Cn.startOffset+Cn.duration){Bt=Un;break}}}}e.setSchedulePosition(X,Bt)}}},u=()=>{const h=e.effectivePlayingItem;if(e.isInterstitial(h))return h;const v=t();return e.isInterstitial(v)?v:null},f={get currentTime(){const h=u(),v=e.effectivePlayingItem;return v&&v===h?i(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(h){const v=u(),b=e.effectivePlayingItem;b&&b===v&&c(h+b.playout.start,"playout")},get duration(){const h=u();return h?h.playout.end-h.playout.start:0},get assetPlayers(){var h;const v=(h=u())==null?void 0:h.event.assetList;return v?v.map(b=>e.getAssetPlayer(b.identifier)):[]},get playingIndex(){var h;const v=(h=u())==null?void 0:h.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var h,v;return((h=e.schedule)==null||(v=h.events)==null?void 0:v.slice(0))||[]},get schedule(){var h,v;return((h=e.schedule)==null||(v=h.items)==null?void 0:v.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const h=t();return e.findItemIndex(h)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const h=e.effectivePlayingItem;return e.findItemIndex(h)},primary:{get bufferedEnd(){return s()},get currentTime(){const h=e.timelinePos;return h>0?h:0},set currentTime(h){c(h,"primary")},get duration(){return o("primary")},get seekableStart(){var h;return((h=e.primaryDetails)==null?void 0:h.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(h){c(h,"integrated")},get duration(){return o("integrated")},get seekableStart(){var h;return r(((h=e.primaryDetails)==null?void 0:h.fragmentStart)||0,"integrated")}},skip:()=>{const h=e.effectivePlayingItem,v=h==null?void 0:h.event;if(v&&!v.restrictions.skip){const b=e.findItemIndex(h);if(v.appendInPlace){const E=h.playout.start+h.event.duration;c(E+.001,"playout")}else e.advanceAfterAssetEnded(v,b,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let r=this.media;!r&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(r=this.primaryMedia);const s=(n=r)==null?void 0:n.currentTime;if(!(s===void 0||!T(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${nt(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const s=this.hls,o=e!==s,c=o&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(r=s.transferMedia(),this.detachedData=r),f="Primary";else if(u){const b=this.getBufferingPlayer();b?(r=b.transferMedia(),f=`${b}`):f="detached MediaSource"}else f="detached media";if(!r){if(u)r=this.detachedData,this.log(`using detachedData: MediaSource ${nt(r)}`);else if(!this.detachedData||s.media===t){const b=this.playerQueue;b.length>1&&b.forEach(E=>{if(o&&E.interstitial.appendInPlace!==c){const I=E.interstitial;this.clearInterstitial(E.interstitial,null),I.appendInPlace=!1,I.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${I}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const h=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",v=h&&r?r:t;if(this.log(`${h?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${f}`),v===r){const b=o&&e.assetId===this.schedule.assetIdAtEnd;v.overrides={duration:this.schedule.duration,endOfStream:!o||b,cueRemoval:!o}}e.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.timelinePos=r,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(r>=0||!this.primaryLive){const s=this.timelinePos=r>0?r:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAfterAssetEnded(e,t,n){const i=n+1;if(!e.isAssetPastPlayoutLimit(i)&&!e.assetList[i].error)this.setSchedulePosition(t,i);else{const r=this.schedule.items;if(r){const s=t+1,o=r.length;if(s>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),o=n.findAssetIndex(r,e);this.setSchedulePosition(s,o)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?n[e]:null,r=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(r)){var o;const u=r.event,f=this.playingAsset,h=f==null?void 0:f.identifier,v=h?this.getAssetPlayer(h):null;if(v&&h&&(!this.eventItemsMatch(r,i)||t!==void 0&&h!==((o=u.assetList)==null?void 0:o[t].identifier))){var c;const b=u.findAssetIndex(f);this.log(`INTERSTITIAL_ASSET_ENDED ${b+1}/${u.assetList.length} ${ca(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:b,event:u,schedule:n.slice(0),scheduleIndex:e,player:v}),this.retreiveMediaSource(h,i),v.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&v.detachMedia()}if(!this.eventItemsMatch(r,i)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${Nr(r)}`),u.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const b=this.schedule.items;if(i&&b){const E=this.schedule.findItemIndex(i);this.advanceSchedule(E,b,t,r,s)}return}}this.advanceSchedule(e,n,t,r,s)}advanceSchedule(e,t,n,i,r){const s=e>=0?t[e]:null,o=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,h=this.schedule.findEventIndex(f.identifier);(h<e||h>e+1)&&this.clearInterstitial(f,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;n===void 0&&(n=this.schedule.findAssetIndex(u,this.timelinePos));const f=this.waitingItem;this.assetsBuffered(s,o)||this.setBufferingItem(s);let h=this.preloadAssets(u,n);if(this.eventItemsMatch(s,f||i)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${Nr(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!o){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const v=u.assetList[n];if(!v){const b=t[e+1],E=this.media;b&&E&&!this.isInterstitial(b)&&E.currentTime<b.start&&(E.currentTime=this.timelinePos=b.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(h||(h=this.getAssetPlayer(v.identifier)),h===null||h.destroyed){const b=u.assetList.length;this.warn(`asset ${n+1}/${b} player destroyed ${u}`),h=this.createAssetPlayer(u,v,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(h,n,t,e,o),this.shouldPlay&&_o(h.media)}else s!==null?(this.resumePrimary(s,e,i),this.shouldPlay&&_o(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Nr(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const r=this.schedule.items;r&&(this.log(`resumed ${Nr(e)}`),this.hls.trigger(p.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:gn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],i=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const r=y(y({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const r=y(y({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=he(t);this.playerQueue.forEach(i=>i.hls.setAudioOption(t)||i.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=he(t);this.playerQueue.forEach(i=>i.hls.setSubtitleOption(t)||t.id!==-1&&i.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const r=t[i];if(r.cue.post){var n;const s=this.schedule.findEventIndex(r.identifier),o=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const i=this.findItemIndex(e,t);return n[i]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=gn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,f;const h=this.findItemIndex(r),v=Math.min(h+1,t.length-1),b=t[v];if((c===-1&&r&&e>=r.end||(u=b.event)!=null&&u.appendInPlace&&e+.01>=b.start)&&(c=v),v-o>1&&(r==null||(f=r.event)==null?void 0:f.appendInPlace)===!1)return;if(this.bufferedPos=e,c>h&&c>o)this.bufferedToItem(b);else{const E=this.primaryDetails;this.primaryLive&&E&&e>E.edge-E.targetduration&&b.start<E.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(b)&&this.preloadAssets(b.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const c=o?o.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${Nr(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(u=>{const f=this.getAssetPlayer(u.identifier);f&&f.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))}this.hls.trigger(p.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(i||!r){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const o=n.assetList[t],c=this.primaryMedia;o&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var o;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(o=v.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const v=f-c;v>0&&(u=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const h=this.assetListLoader.loadAssetList(e,u);h&&(e.assetListLoader=h)}else if(!s&&i){for(let c=t;c<i;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,i,r,s){const o={parentIdentifier:e.identifier,identifier:Vu(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){this.log(`create HLSAssetPlayer for ${ca(t)}`);const i=this.hls,r=i.userConfig;let s=r.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=d({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const c=i.audioTracks[i.audioTrack],u=i.subtitleTracks[i.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const ue=this.timelinePos-t.timelineStart;if(ue>1){const Be=t.duration;Be&&ue<Be&&(f=ue)}}const h=t.identifier,v=y(y({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:h,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||r.audioPreference,subtitlePreference:u||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const b=v.cmcd;b!=null&&b.sessionId&&b.contentId&&(v.cmcd=d({},b,{contentId:Es(t.uri)})),this.getAssetPlayer(h)&&this.warn(`Duplicate date range identifier ${e} and asset ${h}`);const E=new Wu(this.HlsPlayerClass,v,e,t);this.playerQueue.push(E),e.assetList[n]=t;const I=ue=>{if(ue.live){const rt=new Error(`Interstitials MUST be VOD assets ${e}`),Ke={fatal:!0,type:re.OTHER_ERROR,details:M.INTERSTITIAL_ASSET_ITEM_ERROR,error:rt};this.handleAssetItemError(Ke,e,this.schedule.findEventIndex(e.identifier),n,rt.message);return}const Be=ue.edge-ue.fragmentStart,$e=t.duration;($e===null||Be>$e)&&(this.log(`Interstitial asset "${h}" duration change ${$e} > ${Be}`),t.duration=Be,this.updateSchedule())};E.on(p.LEVEL_UPDATED,(ue,{details:Be})=>I(Be)),E.on(p.LEVEL_PTS_UPDATED,(ue,{details:Be})=>I(Be));const R=(ue,Be)=>{const $e=this.getAssetPlayer(h);if($e&&Be.tracks){$e.off(p.BUFFER_CODECS,R),$e.tracks=Be.tracks;const rt=this.primaryMedia;this.bufferingAsset===$e.assetItem&&rt&&!$e.media&&this.bufferAssetPlayer($e,rt)}};E.on(p.BUFFER_CODECS,R);const X=()=>{var ue;const Be=this.getAssetPlayer(h);if(this.log(`buffered to end of asset ${Be}`),!Be)return;const $e=this.schedule.findEventIndex(e.identifier),rt=e.findAssetIndex(t),Ke=rt+1,Qe=(ue=this.schedule.items)==null?void 0:ue[$e];if(this.isInterstitial(Qe))if(rt!==-1&&!e.isAssetPastPlayoutLimit(Ke)&&!e.assetList[Ke].error)this.bufferedToItem(Qe,Ke);else{var pt;const ze=(pt=this.schedule.items)==null?void 0:pt[$e+1];ze&&this.bufferedToItem(ze)}};E.on(p.BUFFERED_TO_END,X);const ve=ue=>()=>{if(!this.getAssetPlayer(h))return;this.shouldPlay=!0;const $e=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,$e,ue)};return E.once(p.MEDIA_ENDED,ve(n)),E.once(p.PLAYOUT_LIMIT_REACHED,ve(1/0)),E.on(p.ERROR,(ue,Be)=>{const $e=this.getAssetPlayer(h);if(Be.details===M.BUFFER_STALLED_ERROR){if($e!=null&&$e.media){const rt=$e.currentTime,Ke=$e.duration-rt;rt&&e.appendInPlace&&Ke/$e.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${h} ${e} at ${$e.media.currentTime}`),X()):(this.warn(`Stalled at ${rt} of ${rt+Ke} in asset ${h} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Be,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Be.error} ${e}`)}),E.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(h))return;const Be=new Error(`Asset player destroyed unexpectedly ${h}`),$e={fatal:!0,type:re.OTHER_ERROR,details:M.INTERSTITIAL_ASSET_ITEM_ERROR,error:Be};this.handleAssetItemError($e,e,this.schedule.findEventIndex(e.identifier),n,Be.message)}),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:E}),E}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&Nr(t)}`);const i=this.playerQueue[n];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:s,assetItem:o,assetId:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[i]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${e}`),this.hls.trigger(p.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;const{interstitial:r,assetItem:s,assetId:o}=e,c=this.schedule.findEventIndex(r.identifier),u=(n=this.schedule.items)==null?void 0:n[c];if(!u)return;this.setBufferingItem(u),this.bufferingAsset=s;const f=this.getBufferingPlayer();if(f===e)return;const h=r.appendInPlace;if(h&&(f==null?void 0:f.interstitial.appendInPlace)===!1)return;const v=(f==null?void 0:f.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(h&&s!==this.playingAsset){if(!e.tracks)return;if(v&&!ce(v,e.tracks)){const b=new Error(`Asset "${o}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(v)}')`),E={fatal:!0,type:re.OTHER_ERROR,details:M.INTERSTITIAL_ASSET_ITEM_ERROR,error:b},I=r.findAssetIndex(s);this.handleAssetItemError(E,r,c,I,b.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,i,r){if(e.details===M.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;let o=null;if(s){const h=this.getAssetPlayerQueueIndex(s.identifier);o=this.playerQueue[h]||null}const c=this.schedule.items,u=d({},e,{fatal:!1,errorAction:Fn(!0),asset:s,assetListIndex:i,event:t,schedule:c,scheduleIndex:n,player:o});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,u),!e.fatal)return;const f=new Error(r);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=f),t.assetList.some(h=>!h.error)?t.appendInPlace&&(t.error=f):t.error=f,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?Nr(n):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const r=this.updateItem(n,i);if(this.itemsMatch(n,r))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var n;const i=t.event,r=i.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(r))return;const o=i.timelineStart,c=i.duration;let u=0;s.forEach((E,I)=>{const R=parseFloat(E.DURATION);this.createAsset(i,I,u,o+u,R,E.URI),u+=R}),i.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${i}`);const f=this.waitingItem,h=(f==null?void 0:f.event.identifier)===r;this.updateSchedule();const v=(n=this.bufferingItem)==null?void 0:n.event;if(h){var b;const E=this.schedule.findEventIndex(r),I=(b=this.schedule.items)==null?void 0:b[E];if(I){if(!this.playingItem&&this.timelinePos>I.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==E){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(I)}this.setSchedulePosition(E)}else if((v==null?void 0:v.identifier)===r&&v.appendInPlace){const E=i.assetList[0],I=this.getAssetPlayer(E.identifier),R=this.primaryMedia;E&&I&&R&&this.bufferAssetPlayer(I,R)}}onError(e,t){switch(t.details){case M.ASSET_LIST_PARSING_ERROR:case M.ASSET_LIST_LOAD_ERROR:case M.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case M.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const vo=500;class Xu extends Zi{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ie.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=dt.IDLE,this.setInterval(vo),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(Y(n)&&(this.fragPrevious=n),this.state=dt.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let u=0;u<r.length;u++)if(o>=r[u].start&&o<=r[u].end){s=r[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=r){s.shift();continue}else if(s[o].start<r)s[o].start=r;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(n,r,ie.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ie.SUBTITLE&&(t.details===M.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==dt.STOPPED&&(this.state=dt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Ja(this.levels,t)){this.levels=t.map(n=>new tt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new tt(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ie.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==dt.STOPPED&&this.setInterval(vo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=r[o];if(o>=r.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const h=this.mainDetails;if(s.deltaUpdateFailed||!h)return;const v=h.fragments[0];if(!c.details)s.hasProgramDateTime&&h.hasProgramDateTime?(di(s,h),u=s.fragmentStart):v&&(u=v.start,Ii(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&v&&(u=v.start,Ii(s,u))}}c.details=s,this.levelLastLoaded=c,o===i&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===dt.IDLE&&(nn(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&Fi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,Ni(i.method)).catch(o=>{throw r.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=dt.IDLE})}}doTick(){if(!this.media){this.state=dt.IDLE;return}if(this.state===dt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),s=gn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const h=u.fragments,v=h.length,b=u.edge;let E=null;const I=this.fragPrevious;if(o<b){const ve=i.maxFragLookUpTolerance,ue=o>b-ve?0:ve;E=nn(I,h,Math.max(h[0].start,o),ue),!E&&I&&I.start<h[0].start&&(E=h[0])}else E=h[v-1];if(E=this.filterReplacedPrimary(E,n.details),!E)return;const R=E.sn-u.startSN,X=h[R-1];if(X&&X.cc===E.cc&&this.fragmentTracker.getState(X)===On.NOT_LOADED&&(E=X),this.fragmentTracker.getState(E)===On.NOT_LOADED){const ve=this.mapToInitFragWhenRequired(E);ve&&this.loadFragment(ve,n,o)}}}loadFragment(e,t,n){Y(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Qu(this.tracksBuffered[this.currentTrackId]||[])}}class Qu{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const qu={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},yo=a=>String.fromCharCode(qu[a]||a),vr=15,Cr=100,Ju={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ec={17:2,18:4,21:6,22:8,23:10,19:13,20:15},tc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ic=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class rc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;ne.log(`${this.time} [${e}] ${n}`)}}}const Wr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class bo{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class sc{constructor(){this.uchar=" ",this.penState=new bo}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new bo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Cr;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<Cr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Cr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Cr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Cr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Cr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=yo(e);if(this.pos>=Cr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<Cr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Cr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class fa{constructor(e){this.rows=[],this.currRow=vr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<vr;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<vr;e++)this.rows[e].clear();this.currRow=vr-1}equals(e){let t=!0;for(let n=0;n<vr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<vr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<vr;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+nt(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<vr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[r+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+nt(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let r=0;r<vr;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class Eo{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new fa(n),this.nonDisplayedMemory=new fa(n),this.lastOutputScreen=new fa(n),this.currRollUpRow=this.displayedMemory.rows[vr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[vr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+nt(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class xo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const i=this.logger=new rc;this.channels=[null,new Eo(e,t,i),new Eo(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,o=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+Wr([t[n],t[n+1]])+"] -> ("+Wr([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(oc(i,r,c)){Ms(null,null,c),this.logger.log(3,()=>"Repeated command ("+Wr([i,r])+") is dropped");continue}Ms(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else Ms(null,null,c);if(!s&&(o=this.parseChars(i,r),o)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Wr([i,r])+" orig: "+Wr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const r=e===20||e===21||e===23?1:2,s=this.channels[r];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Wr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?Ju[e]:tc[e]:n=s===1?ec[e]:nc[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+yo(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Wr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let r;const s={};e===16||e===24?(r=Math.floor((t-32)/2),s.background=ic[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Ms(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function Ms(a,e,t){t.a=a,t.b=e}function oc(a,e,t){return t.a===a&&t.b===e}function lc(){return{a:null,b:null}}var ha=function(){if(hi!=null&&hi.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const u=c.toLowerCase();return~o.indexOf(u)?u:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const h in f)o[h]=f[h]}return o}function s(o,c,u){const f=this,h={enumerable:!0};f.hasBeenReset=!1;let v="",b=!1,E=o,I=c,R=u,X=null,ve="",ue=!0,Be="auto",$e="start",rt=50,Ke="middle",Qe=50,pt="middle";Object.defineProperty(f,"id",r({},h,{get:function(){return v},set:function(ze){v=""+ze}})),Object.defineProperty(f,"pauseOnExit",r({},h,{get:function(){return b},set:function(ze){b=!!ze}})),Object.defineProperty(f,"startTime",r({},h,{get:function(){return E},set:function(ze){if(typeof ze!="number")throw new TypeError("Start time must be set to a number.");E=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",r({},h,{get:function(){return I},set:function(ze){if(typeof ze!="number")throw new TypeError("End time must be set to a number.");I=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",r({},h,{get:function(){return R},set:function(ze){R=""+ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",r({},h,{get:function(){return X},set:function(ze){X=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",r({},h,{get:function(){return ve},set:function(ze){const Bt=n(ze);if(Bt===!1)throw new SyntaxError("An invalid or illegal string was specified.");ve=Bt,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",r({},h,{get:function(){return ue},set:function(ze){ue=!!ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",r({},h,{get:function(){return Be},set:function(ze){if(typeof ze!="number"&&ze!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Be=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",r({},h,{get:function(){return $e},set:function(ze){const Bt=i(ze);if(!Bt)throw new SyntaxError("An invalid or illegal string was specified.");$e=Bt,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",r({},h,{get:function(){return rt},set:function(ze){if(ze<0||ze>100)throw new Error("Position must be between 0 and 100.");rt=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",r({},h,{get:function(){return Ke},set:function(ze){const Bt=i(ze);if(!Bt)throw new SyntaxError("An invalid or illegal string was specified.");Ke=Bt,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",r({},h,{get:function(){return Qe},set:function(ze){if(ze<0||ze>100)throw new Error("Size must be between 0 and 100.");Qe=ze,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",r({},h,{get:function(){return pt},set:function(ze){const Bt=i(ze);if(!Bt)throw new SyntaxError("An invalid or illegal string was specified.");pt=Bt,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function So(a){function e(n,i,r,s){return(n|0)*3600+(i|0)*60+(r|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class cc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function wo(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const da=new ha(0,0,""),Fs=da.align==="middle"?"middle":"center";function fc(a,e,t){const n=a;function i(){const o=So(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,c){const u=new cc;wo(o,function(v,b){let E;switch(v){case"region":for(let I=t.length-1;I>=0;I--)if(t[I].id===b){u.set(v,t[I].region);break}break;case"vertical":u.alt(v,b,["rl","lr"]);break;case"line":E=b.split(","),u.integer(v,E[0]),u.percent(v,E[0])&&u.set("snapToLines",!1),u.alt(v,E[0],["auto"]),E.length===2&&u.alt("lineAlign",E[1],["start",Fs,"end"]);break;case"position":E=b.split(","),u.percent(v,E[0]),E.length===2&&u.alt("positionAlign",E[1],["start",Fs,"end","line-left","line-right","auto"]);break;case"size":u.percent(v,b);break;case"align":u.alt(v,b,["start",Fs,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&da.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Fs);let h=u.get("position","auto");h==="auto"&&da.position===50&&(h=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=h}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function To(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class hc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let r=t.buffer,s=0;for(r=To(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const o=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),o}function i(r){wo(r,function(s,o){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const o=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new ha(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fc(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const dc=/\r\n|\n\r|\n|\r/g,pa=function(e,t,n=0){return e.slice(n,n+t.length)===t},pc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!T(t)||!T(n)||!T(i)||!T(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function ga(a,e,t){return Es(a.toString())+Es(e.toString())+Es(t)}const gc=function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=r)!=null&&s.new;){var s;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n};function mc(a,e,t,n,i,r,s){const o=new hc,c=Oe(new Uint8Array(a)).trim().replace(dc,`
|
|
`).split(`
|
|
`),u=[],f=e?$l(e.baseTime,e.timescale):0;let h="00:00.000",v=0,b=0,E,I=!0;o.oncue=function(R){const X=t[n];let ve=t.ccOffset;const ue=(v-f)/9e4;if(X!=null&&X.new&&(b!==void 0?ve=t.ccOffset=X.start:gc(t,n,ue)),ue){if(!e){E=new Error("Missing initPTS for VTT MPEGTS");return}ve=ue-t.presentationOffset}const Be=R.endTime-R.startTime,$e=pr((R.startTime+ve-b)*9e4,i*9e4)/9e4;R.startTime=Math.max($e,0),R.endTime=Math.max($e+Be,0);const rt=R.text.trim();R.text=decodeURIComponent(encodeURIComponent(rt)),R.id||(R.id=ga(R.startTime,R.endTime,rt)),R.endTime>0&&u.push(R)},o.onparsingerror=function(R){E=R},o.onflush=function(){if(E){s(E);return}r(u)},c.forEach(R=>{if(I)if(pa(R,"X-TIMESTAMP-MAP=")){I=!1,R.slice(16).split(",").forEach(X=>{pa(X,"LOCAL:")?h=X.slice(6):pa(X,"MPEGTS:")&&(v=parseInt(X.slice(7)))});try{b=pc(h)/1e3}catch(X){E=X}return}else R===""&&(I=!1);o.parse(R+`
|
|
`)}),o.flush()}const ma="stpp.ttml.im1t",Ao=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Do=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,_c={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ro(a,e,t,n){const i=G(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Oe(o)),s=Ul(e.baseTime,1,e.timescale);try{r.forEach(o=>t(vc(o,s)))}catch(o){n(o)}}function vc(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((h,v)=>(h[v]=i.getAttribute(`ttp:${v}`)||r[v],h),{}),o=i.getAttribute("xml:space")!=="preserve",c=Io(_a(i,"styling","style")),u=Io(_a(i,"layout","region")),f=_a(i,"body","[begin]");return[].map.call(f,h=>{const v=Co(h,o);if(!v||!h.hasAttribute("begin"))return null;const b=ya(h.getAttribute("begin"),s),E=ya(h.getAttribute("dur"),s);let I=ya(h.getAttribute("end"),s);if(b===null)throw Lo(h);if(I===null){if(E===null)throw Lo(h);I=b+E}const R=new ha(b-e,I-e,v);R.id=ga(R.startTime,R.endTime,R.text);const X=u[h.getAttribute("region")],ve=c[h.getAttribute("style")],ue=yc(X,ve,c),{textAlign:Be}=ue;if(Be){const $e=_c[Be];$e&&(R.lineAlign=$e),R.align=Be}return d(R,ue),R}).filter(h=>h!==null)}function _a(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Io(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Co(a,e){return[].slice.call(a.childNodes).reduce((t,n,i)=>{var r;return n.nodeName==="br"&&i?t+`
|
|
`:(r=n.childNodes)!=null&&r.length?Co(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function yc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((o,c)=>{const u=va(e,n,c)||va(a,n,c)||va(i,n,c);return u&&(o[c]=u),o},{})}function va(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Lo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ya(a,e){if(!a)return null;let t=So(a);return t===null&&(Ao.test(a)?t=bc(a,e):Do.test(a)&&(t=Ec(a,e))),t}function bc(a,e){const t=Ao.exec(a),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function Ec(a,e){const t=Do.exec(a),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class Ns{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class xc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Ns(this,"textTrack1"),t=new Ns(this,"textTrack2"),n=new Ns(this,"textTrack3"),i=new Ns(this,"textTrack4");this.cea608Parser1=new xo(1,e,t),this.cea608Parser2=new xo(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const c=r[o],u=Sc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,i)}else{const o=this.Cues.newCue(null,t,n,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n===ie.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.onFragLoaded(p.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Po(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],o=this.getExistingTrack(r,s);if(o)n[e]=o,as(n[e]),ho(n[e],i);else{const c=this.createTextTrack("captions",r,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach(r=>{as(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)as(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===ma);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Ja(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Ps(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(o){let h=null;for(let v=0;v<o.length;v++)if(o[v]&&Po(o[v],c)){h=o[v],o[v]=null;break}h&&(f=h)}if(f)as(f);else{const h=ko(c);f=this.createTextTrack(h,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const r=`textTrack${i[1]}`,s=this.captionsProperties[r];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ie.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:u}=t.frag,f=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(u!==o+1||u===o&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===ie.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===ma?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ro(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,o=r.length-1;if(!r[n.cc]&&o===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?He(n.initSegment.data,new Uint8Array(i)).buffer:i;mc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const h=f.message==="Missing initPTS for VTT MPEGTS";h?s.push(e):this._fallbackToIMSC1(n,i),c.logger.log(`Failed to parse VTT cue: ${f}`),!(h&&o>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ro(t,this.initPTS[e.cc],()=>{n.textCodec=ma,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>po(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ie.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(!(n.type===ie.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<i.length;r++){const s=i[r].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,o[0]),this.cea608Parser2.addData(i[r].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>la(o[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>la(o[c],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],o=127&e[i++],c=127&e[i++];if(o===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(o),t[f].push(c))}}return t}}function ko(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Po(a,e){return!!a&&a.kind===ko(e)&&na(e,a)}function Sc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Oo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wc=/\s/,Tc={newCue(a,e,t,n){const i=[];let r,s,o,c,u;const f=self.VTTCue||self.TextTrackCue;for(let v=0;v<n.rows.length;v++)if(r=n.rows[v],o=!0,c=0,u="",!r.isEmpty()){var h;for(let I=0;I<r.chars.length;I++)wc.test(r.chars[I].uchar)&&o?c++:(u+=r.chars[I].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const b=To(u.trim()),E=ga(e,t,b);a!=null&&(h=a.cues)!=null&&h.getCueById(E)||(s=new f(e,t,b),s.id=E,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((v,b)=>v.line==="auto"||b.line==="auto"?0:v.line>8&&b.line>8?b.line-v.line:v.line-b.line),i.forEach(v=>po(a,v))),i}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Dc=/(\d+)-(\d+)\/(\d+)/;class Mo{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Lc,this.controller=new self.AbortController,this.stats=new _}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=Rc(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&T(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(vs(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(h=>{var v;this.response=this.loader=h;const b=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},u-(b-i.loading.start)),!h.ok){const{status:I,statusText:R}=h;throw new kc(R||"fetch, bad network response",I,h)}i.loading.first=b,i.total=Cc(h.headers)||i.total;const E=(v=this.callbacks)==null?void 0:v.onProgress;return E&&T(t.highWaterMark)?this.loadProgressively(h,i,e,t.highWaterMark,E):s?h.arrayBuffer():e.responseType==="json"?h.json():h.text()}).then(h=>{var v,b;const E=this.response;if(!E)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const I=h[o];I&&(i.loaded=i.total=I);const R={url:E.url,data:h,code:E.status},X=(v=this.callbacks)==null?void 0:v.onProgress;X&&!T(t.highWaterMark)&&X(i,e,h,E),(b=this.callbacks)==null||b.onSuccess(R,i,e,E)}).catch(h=>{var v;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const b=h&&h.code||0,E=h?h.message:null;(v=this.callbacks)==null||v.onError({code:b,text:E},e,h?h.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const s=new Jr,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,h=f.length;return t.loaded+=h,h<i||s.dataLength?(s.push(f),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Rc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(d({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Ic(a){const e=Dc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Cc(a){const e=a.get("Content-Range");if(e){const n=Ic(e);if(T(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Lc(a,e){return new self.Request(a.url,e)}class kc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Pc=/^age:\s*[\d.]+\s*$/im;class Fo{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new _,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&T(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const E=f!=null?f:t.response;if(E!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const I=t.responseType==="arraybuffer"?E.byteLength:E.length;n.loaded=n.total=I,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const R=(s=this.callbacks)==null?void 0:s.onProgress;R&&R(n,e,E,t);const X={url:t.responseURL,data:E,code:u};(o=this.callbacks)==null||o.onSuccess(X,n,e,t);return}}const h=r.loadPolicy.errorRetry,v=n.retry,b={url:e.url,data:void 0,code:u};if(Jt(h,v,!1,b))this.retry(h);else{var c;ne.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Jt(e,t,!0))this.retry(e);else{var n;ne.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Kt(e,n.retry),n.retry++,ne.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Pc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Mc=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:kt,bufferController:tu,capLevelController:ra,errorController:ni,fpsController:Uu,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:yn,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:Oc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Fc()),{},{subtitleStreamController:Xu,subtitleTrackController:Gu,timelineController:xc,audioStreamController:Ql,audioTrackController:ql,emeController:ss,cmcdController:Fu,contentSteeringController:Bu,interstitialsController:Yu});function Fc(){return{cueHandler:Tc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Nc(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=ba(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,u=[];r.forEach(f=>{const h=`${s}Loading${f}`,v=e[h];if(v!==void 0&&c){u.push(h);const b=n[o].default;switch(e[o]={default:b},f){case"TimeOut":b.maxLoadTimeMs=v,b.maxTimeToFirstByteMs=v;break;case"MaxRetry":b.errorRetry.maxNumRetry=v,b.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":b.errorRetry.retryDelayMs=v,b.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":b.errorRetry.maxRetryDelayMs=v,b.timeoutRetry.maxRetryDelayMs=v;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${nt(e[o])}`)}),y(y({},n),e)}function ba(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ba):Object.keys(a).reduce((e,t)=>(e[t]=ba(a[t]),e),{}):a}function Bc(a,e){const t=a.loader;t!==Mo&&t!==Fo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Ac()&&(a.loader=Mo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Bs=2,Uc=.1,$c=.05,Kc=100;class Gc extends Li{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Kc),this.mediaSource=t.mediaSource;const n=this.media=t.media;Ir(n,"playing",this.onMediaPlaying),Ir(n,"waiting",this.onMediaWaiting),Ir(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(Sr(n,"playing",this.onMediaPlaying),Sr(n,"waiting",this.onMediaWaiting),Sr(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const{media:s,stalled:o}=this;if(!s)return;const{seeking:c}=s,u=this.seeking&&!c,f=!this.seeking&&c,h=s.paused&&!c||s.ended||s.playbackRate===0;if(this.seeking=c,e!==t){t&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!h&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(f||u){u&&this.stallResolved(e);return}if(h){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1}));return}if(!gn.getBuffered(s).length){this.nudgeRetry=0;return}const v=gn.bufferInfo(s,e,0),b=v.nextStart||0,E=this.fragmentTracker;if(c&&E&&this.hls){const rt=No(this.hls.inFlightFragments,e),Ke=v.len>Bs,Qe=!b||rt||b-e>Bs&&!E.getPartialFragment(e);if(Ke||Qe)return;this.moved=!1}const I=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&E){if(!(v.len>0)&&!b)return;const Ke=Math.max(b,v.start||0)-e,pt=!!(I!=null&&I.live)?I.targetduration*2:Bs,ze=E.getPartialFragment(e);if(Ke>0&&(Ke<=pt||ze)){s.paused||this._trySkipBufferHole(ze);return}}const R=r.detectStallWithCurrentTimeMs,X=self.performance.now(),ve=this.waiting;if(o===null){ve>0&&X-ve<R?this.stalled=ve:this.stalled=X;return}const ue=X-o;if(!c&&(ue>=R||ve)&&this.hls){var Be;if(((Be=this.mediaSource)==null?void 0:Be.readyState)==="ended"&&!(I!=null&&I.live)&&Math.abs(e-((I==null?void 0:I.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(v),!this.media||!this.hls)return}const $e=gn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall($e,ue)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(p.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&e>i.end(0)){const r=gn.bufferedInfo(gn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=gn.timeRangesToArray(i),o=gn.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=gn.bufferedInfo(s,e,0).bufferedIndex,u=s[o].end,f=s[o+1].start;if((c===-1||c>o)&&f-u<1&&e-u<2){const h=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(h.message),this.media.currentTime+=1e-6;const v=this.fragmentTracker.getPartialFragment(e)||void 0,b=gn.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:h,reason:h.message,frag:v,buffer:b.len,bufferInfo:b})}}}}}_tryFixBufferStall(e,t){var n,i;const{fragmentTracker:r,media:s}=this,o=(n=this.hls)==null?void 0:n.config;if(!s||!r||!o)return;const c=s.currentTime,u=(i=this.hls)==null?void 0:i.latestLevelDetails,f=r.getPartialFragment(c);if((f||u!=null&&u.live&&c<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const h=e.buffered;(h&&h.length>1&&e.len>o.maxBufferHole||e.nextStart&&e.nextStart-c<o.maxBufferHole)&&(t>o.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&r!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${nt(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!n||!r)return 0;const s=i.currentTime,o=gn.bufferInfo(i,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const f=o.len<=r.maxBufferHole,h=o.len>0&&o.len<1&&i.readyState<3,v=c-s;if(v>0&&(f||h)){if(v>r.maxBufferHole){let E=!1;if(s===0){const I=n.getAppendedFrag(0,ie.MAIN);I&&c<I.end&&(E=!0)}if(!E){const I=e||n.getAppendedFrag(s,ie.MAIN);if(I){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||No(this.hls.inFlightFragments,c))return 0;let X=!1,ve=I.end;for(;ve<c;){const ue=n.getPartialFragment(ve);if(ue)ve+=ue.duration;else{X=!0;break}}if(X)return 0}}}const b=Math.max(c+$c,s+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${b}`),this.moved=!0,i.currentTime=b,!(e!=null&&e.gap)){const E=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${b}`);this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:E,reason:E.message,frag:e||void 0,buffer:o.len,bufferInfo:o})}return b}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const s=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const o=s+(i+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),n.currentTime=o,t.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function No(a,e){const t=Bo(a.main);if(t&&t.start<=e)return t;const n=Bo(a.audio);return n&&n.start<=e?n:null}function Bo(a){if(!a)return null;switch(a.state){case dt.IDLE:case dt.STOPPED:case dt.ENDED:case dt.ERROR:return null}return a.frag}const Vc=.25;function Ea(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uo(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,nt(i?y({type:i},n):n))}return r}const Us=(()=>{const a=Ea();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function zc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Zc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(p.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&as(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return ho(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Ea();if(s)for(let o=0;o<r.length;o++){const c=r[o].type;if(c===cr.emsg&&!n||!i)continue;const u=ka(r[o].data);if(u){const f=r[o].pts;let h=f+r[o].duration;h>Us&&(h=Us),h-f<=0&&(h=f+Vc);for(let b=0;b<u.length;b++){const E=u[b];if(!Pa(E)){this.updateId3CueEnds(f,c);const I=Uo(s,f,h,E,c);I&&this.id3Track.addCue(I)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===Us&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=s;if(r&&(o||c)){let u;i==="audio"?u=f=>f.type===cr.audioId3&&c:i==="video"?u=f=>f.type===cr.emsg&&o:u=f=>f.type===cr.audioId3&&c||f.type===cr.emsg&&o,la(r,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:i}=e,r=Object.keys(i);let s=this.dateRangeCuesAppended;if(n&&t){var o;if((o=n.cues)!=null&&o.length){const f=Object.keys(s).filter(h=>!r.includes(h));for(let h=f.length;h--;){const v=f[h],b=s[v].cues;delete s[v],Object.keys(b).forEach(E=>{try{const I=b[E];I.removeEventListener("enter",this.onEventCueEnter),n.removeCue(I)}catch(I){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(r.length===0||!T(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=Ea();for(let f=0;f<r.length;f++){const h=r[f],v=i[h],b=v.startTime,E=s[h],I=(E==null?void 0:E.cues)||{};let R=(E==null?void 0:E.durationKnown)||!1,X=Us;const{duration:ve,endDate:ue}=v;if(ue&&ve!==null)X=b+ve,R=!0;else if(v.endOnNext&&!R){const $e=r.reduce((rt,Ke)=>{if(Ke!==v.id){const Qe=i[Ke];if(Qe.class===v.class&&Qe.startDate>v.startDate&&(!rt||v.startDate<rt.startDate))return Qe}return rt},null);$e&&(X=$e.startTime,R=!0)}const Be=Object.keys(v.attr);for(let $e=0;$e<Be.length;$e++){const rt=Be[$e];if(!bi(rt))continue;const Ke=I[rt];if(Ke)R&&!E.durationKnown?Ke.endTime=X:Math.abs(Ke.startTime-b)>.01&&(Ke.startTime=b,Ke.endTime=X);else if(u){let Qe=v.attr[rt];lr(rt)&&(Qe=zc(Qe));const ze=Uo(u,b,X,{key:rt,data:Qe},cr.dateRange);ze&&(ze.id=h,this.id3Track.addCue(ze),I[rt]=ze,this.hls.config.interstitialsController&&(rt==="X-ASSET-LIST"||rt==="X-ASSET-URL")&&ze.addEventListener("enter",this.onEventCueEnter))}}s[h]={cues:I,dateRange:v,durationKnown:R}}}}class Wc{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||s===1||!n.live)return;const o=this.targetLatency;if(o===null)return;const c=i-o,u=Math.min(this.maxLatency,o+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,b=Math.min(h,Math.max(1,v));this.changeMediaPlaybackRate(t,b)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=r!==void 0?r:s*i);const f=i;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===M.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class jc extends ta{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let o=!1,c=!1,u=!1;t.levels.forEach(f=>{var h;const v=f.attrs;let{audioCodec:b,videoCodec:E}=f;b&&(f.audioCodec=b=st(b,n)||void 0),((h=E)==null?void 0:h.indexOf("avc1"))===0&&(E=f.videoCodec=Sn(E));const{width:I,height:R,unknownCodecs:X}=f;let ve=X?X.length:0;if(X)for(let Bt=ve;Bt--;){const tn=X[Bt];this.isAudioSupported(tn)?(f.audioCodec=b=b?`${b},${tn}`:tn,ve--,Qt.audio[b.substring(0,4)]=2):this.isVideoSupported(tn)&&(f.videoCodec=E=E?`${E},${tn}`:tn,ve--,Qt.video[E.substring(0,4)]=2)}if(o||(o=!!(I&&R)),c||(c=!!E),u||(u=!!b),ve||b&&!this.isAudioSupported(b)||E&&!this.isVideoSupported(E)){this.log(`Some or all CODECS not supported "${v.CODECS}"`);return}const{CODECS:ue,"FRAME-RATE":Be,"HDCP-LEVEL":$e,"PATHWAY-ID":rt,RESOLUTION:Ke,"VIDEO-RANGE":Qe}=v,ze=`${`${rt||"."}-`}${f.bitrate}-${Ke}-${Be}-${ue}-${Qe}-${$e}`;if(r[ze])if(r[ze].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Bt=s[ze]+=1;f.attrs["PATHWAY-ID"]=new Array(Bt+1).join(".");const tn=this.createLevel(f);r[ze]=tn,i.push(tn)}else r[ze].addGroupId("audio",v.AUDIO),r[ze].addGroupId("text",v.SUBTITLES);else{const Bt=this.createLevel(f);r[ze]=Bt,s[ze]=1,i.push(Bt)}}),this.filterAndSortMediaOptions(i,t,o,c,u)}createLevel(e){const t=new tt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),t.supportedResult=$n(i,[])}return t}isAudioSupported(e){return xe(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return xe(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],o=[],c=e;if((n||i)&&r&&(c=c.filter(({videoCodec:R,videoRange:X,width:ve,height:ue})=>(!!R||!!(ve&&ue))&&Se(X))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let R="no level with compatible codecs found in manifest",X=R;t.levels.length&&(X=`one or more CODECS in variant not supported: ${nt(t.levels.map(ue=>ue.attrs.CODECS).filter((ue,Be,$e)=>$e.indexOf(ue)===Be))}`,this.warn(X),R+=` (${X})`);const ve=new Error(R);this.hls.trigger(p.ERROR,{type:re.MEDIA_ERROR,details:M.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ve,reason:X})}});return}t.audioTracks&&(s=t.audioTracks.filter(R=>!R.audioCodec||this.isAudioSupported(R.audioCodec)),$o(s)),t.subtitles&&(o=t.subtitles,$o(o));const u=c.slice(0);c.sort((R,X)=>{if(R.attrs["HDCP-LEVEL"]!==X.attrs["HDCP-LEVEL"])return(R.attrs["HDCP-LEVEL"]||"")>(X.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&R.height!==X.height)return R.height-X.height;if(R.frameRate!==X.frameRate)return R.frameRate-X.frameRate;if(R.videoRange!==X.videoRange)return Hn.indexOf(R.videoRange)-Hn.indexOf(X.videoRange);if(R.videoCodec!==X.videoCodec){const ve=j(R.videoCodec),ue=j(X.videoCodec);if(ve!==ue)return ue-ve}if(R.uri===X.uri&&R.codecSet!==X.codecSet){const ve=te(R.codecSet),ue=te(X.codecSet);if(ve!==ue)return ue-ve}return R.averageBitrate!==X.averageBitrate?R.averageBitrate-X.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let R=0;R<u.length;R++)if(u[R].pathwayId===c[0].pathwayId){f=u[R];break}}this._levels=c;for(let R=0;R<c.length;R++)if(c[R]===f){var h;this._firstLevel=R;const X=f.bitrate,ve=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${X}`),((h=this.hls.userConfig)==null?void 0:h.abrEwmaDefaultEstimate)===void 0){const ue=Math.min(X,this.hls.config.abrEwmaDefaultEstimateMax);ue>ve&&ve===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=ue)}break}const v=r&&!i,b=this.hls.config,E=!!(b.audioStreamController&&b.audioTrackController),I={levels:c,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:E&&!v&&s.some(R=>!!R.url)};this.hls.trigger(p.MANIFEST_PARSED,I)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),h=e<0;if(this.hls.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.LEVEL_SWITCH_ERROR,level:e,fatal:h,error:f,reason:f.message}),h)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${r?" with Pathway "+r:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,i==null?void 0:i.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===fe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ie.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(p.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((r,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(o=>o.level=-1)),!1));dr(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(p.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function $o(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Ko(){return self.SourceBuffer||self.WebKitSourceBuffer}function Go(){if(!Q())return!1;const e=Ko();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Hc(){if(!Go())return!1;const a=Q();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(B(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(B(e,"audio"))))}function Yc(){var a;const e=Ko();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Xc=100;class Qc extends Zi{constructor(e,t,n){super(e,t,n,"stream-controller",ie.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,r=i?i.currentTime:null;if(r===null||!T(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,ie.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(Xc),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=dt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=dt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case dt.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=dt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=dt.IDLE;break}break}case dt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,s=i==null?void 0:i[r];this.resetStartWhenNotLoaded(s||null),this.state=dt.IDLE}}break}this.state===dt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const I={};this.altAudio===2&&(I.type="video"),this.hls.trigger(p.BUFFER_EOS,I),this.state=dt.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const u=s.details;if(!u||this.state===dt.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=dt.WAITING_LEVEL,this.startFragRequested=!1;return}const f=o.len,h=this.getMaxBufferLength(s.maxBitrate);if(f>=h)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let b=this.getNextFragment(v,u);if(this.couldBacktrack&&!this.fragPrevious&&b&&Y(b)&&this.fragmentTracker.getState(b)!==On.OK){var E;const R=((E=this.backtrackFragment)!=null?E:b).sn-u.startSN,X=u.fragments[R-1];X&&b.cc===X.cc&&(b=X,this.fragmentTracker.removeFragment(X))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(b&&this.isLoopLoading(b,v)){if(!b.gap){const R=this.audioOnly&&!this.altAudio?g.AUDIO:g.VIDEO,X=(R===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;X&&this.afterBufferFlushed(X,R,ie.MAIN)}b=this.getNextFragmentLoopLoading(b,u,o,ie.MAIN,h)}b&&(b.initSegment&&!b.initSegment.data&&!this.bitrateTest&&(b=b.initSegment),this.loadFragment(b,s,v))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===On.NOT_LOADED||i===On.PARTIAL?Y(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ie.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<r.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case dt.KEY_LOADING:case dt.FRAG_LOADING:case dt.FRAG_LOADING_WAITING_RETRY:case dt.PARSING:case dt.PARSED:this.state=dt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Ir(n,"playing",this.onMediaPlaying),Ir(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(Sr(n,"playing",this.onMediaPlaying),Sr(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(p.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!Yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==dt.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=dt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,c=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===dt.FRAG_LOADING||this.state===dt.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let h=0;if(o.live||(n=u.details)!=null&&n.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;h=this.alignPlaylists(o,u.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(u.details=o,this.levelLastLoaded=u,r||this.setStartPosition(o,h),this.hls.trigger(p.LEVEL_UPDATED,{details:o,level:s}),this.state===dt.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=dt.IDLE}r&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,c=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!c&&n.readyState<4||r<o-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level];if(!o){this.warn(`Level ${n.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=o.videoCodec,f=c.PTSKnown||!c.live,h=(t=n.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),b=this.transmuxer=this.transmuxer||new Qa(this.hls,ie.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),E=i?i.index:-1,I=E!==-1,R=new Ti(n.level,n.sn,n.stats.chunkCount,r.byteLength,E,I),X=this.initPTS[n.cc];b.push(r,h,v,u,n,i,c.totalduration,f,R,X)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(Dt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.fragmentTracker.removeAllFragments(),n.once(p.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(p.AUDIO_TRACK_SWITCHED,t)}),n.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Dt(t.url,this.hls);if(n){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const o in n){const c=n[o];if(c.id==="main"){if(r=o,i=c,o==="video"){const u=n[o];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===ie.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===dt.PARSED&&(this.state=dt.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),Y(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&gn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=dt.ERROR;return}switch(t.details){case M.FRAG_GAP:case M.FRAG_PARSING_ERROR:case M.FRAG_DECRYPT_ERROR:case M.FRAG_LOAD_ERROR:case M.FRAG_LOAD_TIMEOUT:case M.KEY_LOAD_ERROR:case M.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ie.MAIN,t);break;case M.LEVEL_LOAD_ERROR:case M.LEVEL_LOAD_TIMEOUT:case M.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===dt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===fe.LEVEL&&(this.state=dt.IDLE);break;case M.BUFFER_ADD_CODEC_ERROR:case M.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case M.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case M.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=dt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==g.AUDIO||!this.altAudio){const n=(t===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ie.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),s=gn.getBuffered(e),o=s.length?s.start(0):0,c=o-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);c>0&&(c<u||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=dt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,n),r.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=o,{video:h,text:v,id3:b,initSegment:E}=r,{details:I}=f,R=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=dt.PARSING,E){if(E!=null&&E.tracks){const ue=c.initSegment||c;this._bufferInitSegment(f,E.tracks,ue,s),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:ue,id:n,tracks:E.tracks})}const X=E.initPTS,ve=E.timescale;T(X)&&(this.initPTS[c.cc]={baseTime:X,timescale:ve},i.trigger(p.INIT_PTS_FOUND,{frag:c,id:n,initPTS:X,timescale:ve}))}if(h&&I){R&&h.type==="audiovideo"&&this.logMuxedErr(c);const X=I.fragments[c.sn-1-I.startSN],ve=c.sn===I.startSN,ue=!X||c.cc>X.cc;if(r.independent!==!1){const{startPTS:Be,endPTS:$e,startDTS:rt,endDTS:Ke}=h;if(u)u.elementaryStreams[h.type]={startPTS:Be,endPTS:$e,startDTS:rt,endDTS:Ke};else if(h.firstKeyFrame&&h.independent&&s.id===1&&!ue&&(this.couldBacktrack=!0),h.dropped&&h.independent){const Qe=this.getMainFwdBufferInfo(),pt=(Qe?Qe.end:this.getLoadPosition())+this.config.maxBufferHole,ze=h.firstKeyFramePTS?h.firstKeyFramePTS:Be;if(!ve&&pt<ze-this.config.maxBufferHole&&!ue){this.backtrack(c);return}else ue&&(c.gap=!0);c.setElementaryStreamInfo(h.type,c.start,$e,c.start,Ke,!0)}else ve&&Be-(I.appliedTimelineOffset||0)>Bs&&(c.gap=!0);c.setElementaryStreamInfo(h.type,Be,$e,rt,Ke),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(h,c,u,s,ve||ue)}else if(ve||ue)c.gap=!0;else{this.backtrack(c);return}}if(R){const{startPTS:X,endPTS:ve,startDTS:ue,endDTS:Be}=R;u&&(u.elementaryStreams[g.AUDIO]={startPTS:X,endPTS:ve,startDTS:ue,endDTS:Be}),c.setElementaryStreamInfo(g.AUDIO,X,ve,ue,Be),this.bufferFragmentData(R,c,u,s)}if(I&&b!=null&&(t=b.samples)!=null&&t.length){const X={id:n,frag:c,details:I,samples:b.samples};i.trigger(p.FRAG_PARSING_METADATA,X)}if(I&&v){const X={id:n,frag:c,details:I,samples:v.samples};i.trigger(p.FRAG_PARSING_USERDATA,X)}}logMuxedErr(e){this.warn(`${Y(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==dt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:s,audiovideo:o}=t;if(r){let u=Mt(r.codec,e.audioCodec);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const h=r.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),e.audioCodec&&e.audioCodec!==u&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${u}"`),r.levelCodec=u,r.id=ie.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${u||""}/${e.audioCodec||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ie.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const h=t[u].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:h,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ie.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=dt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(gn.isBuffered(e,n)?t=this.getAppendedFrag(n):gn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return T(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(T(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?nn(null,n.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const s=r+(t-i.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class qc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=M.KEY_LOAD_ERROR,n,i,r){return new In({type:re.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(o=>{s.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,M.KEY_LOAD_ERROR,u))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,M.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((n=o)!=null&&n.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var c;switch((c=o.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(u=>(r.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,M.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,b,E,I)=>{const{frag:R,keyInfo:X,url:ve}=E;if(!R.decryptdata||X!==this.keyUriToKeyInfo[ve])return o(this.createKeyLoadError(R,M.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),I));X.decryptdata.key=R.decryptdata.key=new Uint8Array(v.data),R.keyLoader=null,X.loader=null,s({frag:R,keyInfo:X})},onError:(v,b,E,I)=>{this.resetLoader(b),o(this.createKeyLoadError(t,M.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),E,y({url:c.url,data:void 0},v)))},onTimeout:(v,b,E)=>{this.resetLoader(b),o(this.createKeyLoadError(t,M.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),E))},onAbort:(v,b,E)=>{this.resetLoader(b),o(this.createKeyLoadError(t,M.INTERNAL_ABORTED,new Error("key loading aborted"),E))}};r.load(c,f,h)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Vo(a){const{type:e}=a;switch(e){case fe.AUDIO_TRACK:return ie.AUDIO;case fe.SUBTITLE_TRACK:return ie.SUBTITLE;default:return ie.MAIN}}function xa(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Jc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:fe.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:fe.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:fe.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:fe.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[fe.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[fe.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=this.hls.logger,f=i.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===fe.MANIFEST?r=n.manifestLoadPolicy.default:r=d({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),T((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===fe.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===fe.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===fe.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,h=u.targetduration;if(f&&h){const v=Math.max(f*3,h*.8)*1e3;r=d({},r,{maxTimeToFirstByteMs:Math.min(v,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,f,h,v)=>{const b=this.getInternalLoader(h);this.resetInternalLoader(h.type);const E=u.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,h,new Error("no EXTM3U delimiter"),v||null,f);return}f.parsing.start=performance.now(),qi.isMediaPlaylist(E)||h.type!==fe.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,h,v||null,b):this.handleMasterPlaylist(u,f,h,v)},onError:(u,f,h,v)=>{this.handleNetworkError(f,h,!1,u,v)},onTimeout:(u,f,h)=>{this.handleNetworkError(f,h,!0,void 0,u)}};i.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,o=xa(e,n),c=qi.parseMasterPlaylist(s,o);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:u,levels:f,sessionData:h,sessionKeys:v,startTimeOffset:b,variableList:E}=c;this.variableList=E;const{AUDIO:I=[],SUBTITLES:R,"CLOSED-CAPTIONS":X}=qi.parseMasterPlaylistMedia(s,o,c);I.length&&!I.some(ue=>!ue.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),I.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Xn({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:f,audioTracks:I,subtitles:R,captions:X,contentSteering:u,url:o,stats:t,networkDetails:i,sessionData:h,sessionKeys:v,startTimeOffset:b,variableList:E})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:c,type:u}=n,f=xa(e,n),h=T(c)?c:T(o)?o:0,v=Vo(n),b=qi.parseLevelPlaylist(e.data,f,h,v,0,this.variableList);if(u===fe.MANIFEST){const E={attrs:new Xn({}),bitrate:0,details:b,name:"",url:f};b.requestScheduled=t.loading.start+Pi(b,0),s.trigger(p.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:f,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=b,this.handlePlaylistLoaded(b,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(p.ERROR,{type:re.NETWORK_ERROR,details:M.MANIFEST_PARSING_ERROR,fatal:t.type===fe.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===fe.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===fe.AUDIO_TRACK||e.type===fe.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=M.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case fe.MANIFEST:c=n?M.MANIFEST_LOAD_TIMEOUT:M.MANIFEST_LOAD_ERROR,u=!0;break;case fe.LEVEL:c=n?M.LEVEL_LOAD_TIMEOUT:M.LEVEL_LOAD_ERROR,u=!1;break;case fe.AUDIO_TRACK:c=n?M.AUDIO_TRACK_LOAD_TIMEOUT:M.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case fe.SUBTITLE_TRACK:c=n?M.SUBTITLE_TRACK_LOAD_TIMEOUT:M.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const h={type:re.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:o,networkDetails:t,stats:r};if(i){const v=(t==null?void 0:t.url)||e.url;h.response=y({url:v,data:void 0},i)}this.hls.trigger(p.ERROR,h)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:c,level:u,id:f,groupId:h,deliveryDirectives:v}=i,b=xa(t,i),E=Vo(i),I=typeof i.level=="number"&&E===ie.MAIN?u:void 0;if(!e.fragments.length){const X=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:re.NETWORK_ERROR,details:M.LEVEL_EMPTY_ERROR,fatal:!1,url:b,error:X,reason:X.message,response:t,context:i,level:I,parent:E,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const R=e.playlistParsingError;if(R){if(this.hls.logger.warn(R),!o.config.ignorePlaylistParsingErrors){o.trigger(p.ERROR,{type:re.NETWORK_ERROR,details:M.LEVEL_PARSING_ERROR,fatal:!1,url:b,error:R,reason:R.message,response:t,context:i,level:I,parent:E,networkDetails:r,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case fe.MANIFEST:case fe.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||o.levels[0],level:I||0,id:f||0,stats:n,networkDetails:r,deliveryDirectives:v,withoutMultiVariant:c===fe.MANIFEST});break;case fe.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:v});break;case fe.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:v});break}}}class Br{static get version(){return ps}static isMSESupported(){return Go()}static isSupported(){return Hc()}static getMediaSource(){return Q()}static get Events(){return p}static get MetadataSchema(){return cr}static get ErrorTypes(){return re}static get ErrorDetails(){return M}static get DefaultConfig(){return Br.defaultConfig?Br.defaultConfig:Mc}static set DefaultConfig(e){Br.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ds,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=ae(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Nc(Br.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Bc(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:c}=n,u=new o(this),f=this.abrController=new i(this),h=new Zn(this),v=n.interstitialsController,b=v?this.interstitialsController=new v(this,Br):null,E=this.bufferController=new r(this,h),I=this.capLevelController=new s(this),R=new c(this),X=new Jc(this),ve=n.contentSteeringController,ue=ve?new ve(this):null,Be=this.levelController=new jc(this,ue),$e=new Zc(this),rt=new qc(this.config),Ke=this.streamController=new Qc(this,h,rt),Qe=this.gapController=new Gc(this,h);I.setStreamController(Ke),R.setStreamController(Ke);const pt=[X,Be,Ke];b&&pt.splice(1,0,b),ue&&pt.splice(1,0,ue),this.networkControllers=pt;const ze=[f,E,Qe,I,R,$e,h];this.audioTrackController=this.createController(n.audioTrackController,pt);const Bt=n.audioStreamController;Bt&&pt.push(this.audioStreamController=new Bt(this,h,rt)),this.subtitleTrackController=this.createController(n.subtitleTrackController,pt);const tn=n.subtitleStreamController;tn&&pt.push(this.subtititleStreamController=new tn(this,h,rt)),this.createController(n.timelineController,ze),rt.emeController=this.emeController=this.createController(n.emeController,ze),this.cmcdController=this.createController(n.cmcdController,ze),this.latencyController=this.createController(Wc,ze),this.coreComponents=ze,pt.push(u);const si=u.onErrorOut;typeof si=="function"&&this.on(p.ERROR,si,u),this.on(p.MANIFEST_LOADED,X.onManifestLoaded,X)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(p.ERROR,{type:re.OTHER_ERROR,details:M.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(p.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=W.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ie.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ie.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ie.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=pl()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){zn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=It(t);return xn(e,n,navigator.mediaCapabilities)}}Br.defaultConfig=void 0},16722:function(vn,St,C){"use strict";C.d(St,{Z:function(){return ie}});const T=l=>typeof l=="object"&&l!=null&&l.nodeType===1,de=(l,S)=>(!S||l!=="hidden")&&l!=="visible"&&l!=="clip",De=(l,S)=>{if(l.clientHeight<l.scrollHeight||l.clientWidth<l.scrollWidth){const w=getComputedStyle(l,null);return de(w.overflowY,S)||de(w.overflowX,S)||(d=>{const m=(y=>{if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(x){return null}})(d);return!!m&&(m.clientHeight<d.scrollHeight||m.clientWidth<d.scrollWidth)})(l)}return!1},re=(l,S,w,d,m,y,x,N)=>y<l&&x>S||y>l&&x<S?0:y<=l&&N<=w||x>=S&&N>=w?y-l-d:x>S&&N<w||y<l&&N>w?x-S+m:0,M=l=>{const S=l.parentElement;return S==null?l.getRootNode().host||null:S},p=(l,S)=>{var w,d,m,y;if(typeof document=="undefined")return[];const{scrollMode:x,block:N,inline:U,boundary:K,skipOverflowHiddenElements:D}=S,A=typeof K=="function"?K:Me=>Me!==K;if(!T(l))throw new TypeError("Invalid target");const P=document.scrollingElement||document.documentElement,z=[];let se=l;for(;T(se)&&A(se);){if(se=M(se),se===P){z.push(se);break}se!=null&&se===document.body&&De(se)&&!De(document.documentElement)||se!=null&&De(se,D)&&z.push(se)}const ae=(d=(w=window.visualViewport)==null?void 0:w.width)!=null?d:innerWidth,ne=(y=(m=window.visualViewport)==null?void 0:m.height)!=null?y:innerHeight,{scrollX:Q,scrollY:ye}=window,{height:ce,width:Oe,top:Z,right:L,bottom:V,left:$}=l.getBoundingClientRect(),{top:H,right:W,bottom:_,left:g}=(Me=>{const Xe=window.getComputedStyle(Me);return{top:parseFloat(Xe.scrollMarginTop)||0,right:parseFloat(Xe.scrollMarginRight)||0,bottom:parseFloat(Xe.scrollMarginBottom)||0,left:parseFloat(Xe.scrollMarginLeft)||0}})(l);let O=N==="start"||N==="nearest"?Z-H:N==="end"?V+_:Z+ce/2-H+_,Y=U==="center"?$+Oe/2-g+W:U==="end"?L+W:$-g;const Pe=[];for(let Me=0;Me<z.length;Me++){const Xe=z[Me],{height:Ye,width:Tt,top:gt,right:Le,bottom:Je,left:Et}=Xe.getBoundingClientRect();if(x==="if-needed"&&Z>=0&&$>=0&&V<=ne&&L<=ae&&(Xe===P&&!De(Xe)||Z>=gt&&V<=Je&&$>=Et&&L<=Le))return Pe;const ot=getComputedStyle(Xe),rn=parseInt(ot.borderLeftWidth,10),Ze=parseInt(ot.borderTopWidth,10),ge=parseInt(ot.borderRightWidth,10),le=parseInt(ot.borderBottomWidth,10);let G=0,be=0;const ke="offsetWidth"in Xe?Xe.offsetWidth-Xe.clientWidth-rn-ge:0,Ne="offsetHeight"in Xe?Xe.offsetHeight-Xe.clientHeight-Ze-le:0,k="offsetWidth"in Xe?Xe.offsetWidth===0?0:Tt/Xe.offsetWidth:0,F="offsetHeight"in Xe?Xe.offsetHeight===0?0:Ye/Xe.offsetHeight:0;if(P===Xe)G=N==="start"?O:N==="end"?O-ne:N==="nearest"?re(ye,ye+ne,ne,Ze,le,ye+O,ye+O+ce,ce):O-ne/2,be=U==="start"?Y:U==="center"?Y-ae/2:U==="end"?Y-ae:re(Q,Q+ae,ae,rn,ge,Q+Y,Q+Y+Oe,Oe),G=Math.max(0,G+ye),be=Math.max(0,be+Q);else{G=N==="start"?O-gt-Ze:N==="end"?O-Je+le+Ne:N==="nearest"?re(gt,Je,Ye,Ze,le+Ne,O,O+ce,ce):O-(gt+Ye/2)+Ne/2,be=U==="start"?Y-Et-rn:U==="center"?Y-(Et+Tt/2)+ke/2:U==="end"?Y-Le+ge+ke:re(Et,Le,Tt,rn,ge+ke,Y,Y+Oe,Oe);const{scrollLeft:ee,scrollTop:oe}=Xe;G=F===0?0:Math.max(0,Math.min(oe+G/F,Xe.scrollHeight-Ye/F+Ne)),be=k===0?0:Math.max(0,Math.min(ee+be/k,Xe.scrollWidth-Tt/k+ke)),O+=oe-G,Y+=ee-be}Pe.push({el:Xe,top:G,left:be})}return Pe},fe=l=>l===!1?{block:"end",inline:"nearest"}:(S=>S===Object(S)&&Object.keys(S).length!==0)(l)?l:{block:"start",inline:"nearest"};function ie(l,S){if(!l.isConnected||!(m=>{let y=m;for(;y&&y.parentNode;){if(y.parentNode===document)return!0;y=y.parentNode instanceof ShadowRoot?y.parentNode.host:y.parentNode}return!1})(l))return;const w=(m=>{const y=window.getComputedStyle(m);return{top:parseFloat(y.scrollMarginTop)||0,right:parseFloat(y.scrollMarginRight)||0,bottom:parseFloat(y.scrollMarginBottom)||0,left:parseFloat(y.scrollMarginLeft)||0}})(l);if((m=>typeof m=="object"&&typeof m.behavior=="function")(S))return S.behavior(p(l,S));const d=typeof S=="boolean"||S==null?void 0:S.behavior;for(const{el:m,top:y,left:x}of p(l,fe(S))){const N=y-w.top+w.bottom,U=x-w.left+w.right;m.scroll({top:N,left:U,behavior:d})}}}}]);
|
|
}()); |