!(function(){var Za=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[6444],{70557:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},18785:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},52671:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},8657:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},56082:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},33853:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},15075:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},43531:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},38819:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ue}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},fe=ve,oe=b(7657),W=function(G,D){return q.createElement(oe.Z,(0,F.Z)({},G,{ref:D,icon:fe}))},_e=q.forwardRef(W),ue=_e},35593:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return Ye}});var F=b(44127),q=b(72071),ve=b(6620),fe=b(43403),oe=b(92310),W=b.n(oe),_e=b(29301),ue=b(76846),o=b(96452),G=b(6089),D=b(80402),f=b(34280),u=b(49658),g=b(59301),p=b(96663),I=b(77900),H=b(8654);function L(Q){var ce=Q.prefixCls,Y=Q.align,M=Q.arrow,pe=Q.arrowPos,k=M||{},B=k.className,P=k.content,re=pe.x,N=re===void 0?0:re,ae=pe.y,le=ae===void 0?0:ae,ge=g.useRef();if(!Y||!Y.points)return null;var Ee={position:"absolute"};if(Y.autoArrow!==!1){var Ce=Y.points[0],Ne=Y.points[1],Ke=Ce[0],Oe=Ce[1],He=Ne[0],Ze=Ne[1];Ke===He||!["t","b"].includes(Ke)?Ee.top=le:Ke==="t"?Ee.top=0:Ee.bottom=0,Oe===Ze||!["l","r"].includes(Oe)?Ee.left=N:Oe==="l"?Ee.left=0:Ee.right=0}return g.createElement("div",{ref:ge,className:W()("".concat(ce,"-arrow"),B),style:Ee},P)}function w(Q){var ce=Q.prefixCls,Y=Q.open,M=Q.zIndex,pe=Q.mask,k=Q.motion;return pe?g.createElement(I.default,(0,p.Z)({},k,{motionAppear:!0,visible:Y,removeOnLeave:!0}),function(B){var P=B.className;return g.createElement("div",{style:{zIndex:M},className:W()("".concat(ce,"-mask"),P)})}):null}var O=g.memo(function(Q){var ce=Q.children;return ce},function(Q,ce){return ce.cache}),A=O,E=g.forwardRef(function(Q,ce){var Y=Q.popup,M=Q.className,pe=Q.prefixCls,k=Q.style,B=Q.target,P=Q.onVisibleChanged,re=Q.open,N=Q.keepDom,ae=Q.fresh,le=Q.onClick,ge=Q.mask,Ee=Q.arrow,Ce=Q.arrowPos,Ne=Q.align,Ke=Q.motion,Oe=Q.maskMotion,He=Q.forceRender,Ze=Q.getPopupContainer,Le=Q.autoDestroy,ut=Q.portal,ft=Q.zIndex,wt=Q.onMouseEnter,Qe=Q.onMouseLeave,Kt=Q.onPointerEnter,Wt=Q.ready,Gt=Q.offsetX,Mt=Q.offsetY,pt=Q.offsetR,ht=Q.offsetB,mt=Q.onAlign,Tt=Q.onPrepare,Et=Q.stretch,kt=Q.targetWidth,Xt=Q.targetHeight,an=typeof Y=="function"?Y():Y,Qt=re||N,cn=(Ze==null?void 0:Ze.length)>0,Ht=g.useState(!Ze||!cn),Vt=(0,q.Z)(Ht,2),_t=Vt[0],We=Vt[1];if((0,f.Z)(function(){!_t&&cn&&B&&We(!0)},[_t,cn,B]),!_t)return null;var c="auto",m={left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(Wt||!re){var x,K=Ne.points,ie=Ne.dynamicInset||((x=Ne._experimental)===null||x===void 0?void 0:x.dynamicInset),be=ie&&K[0][1]==="r",Ae=ie&&K[0][0]==="b";be?(m.right=pt,m.left=c):(m.left=Gt,m.right=c),Ae?(m.bottom=ht,m.top=c):(m.top=Mt,m.bottom=c)}var nt={};return Et&&(Et.includes("height")&&Xt?nt.height=Xt:Et.includes("minHeight")&&Xt&&(nt.minHeight=Xt),Et.includes("width")&&kt?nt.width=kt:Et.includes("minWidth")&&kt&&(nt.minWidth=kt)),re||(nt.pointerEvents="none"),g.createElement(ut,{open:He||Qt,getContainer:Ze&&function(){return Ze(B)},autoDestroy:Le},g.createElement(w,{prefixCls:pe,open:re,zIndex:ft,mask:ge,motion:Oe}),g.createElement(_e.Z,{onResize:mt,disabled:!re},function(qe){return g.createElement(I.default,(0,p.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:He,leavedClassName:"".concat(pe,"-hidden")},Ke,{onAppearPrepare:Tt,onEnterPrepare:Tt,visible:re,onVisibleChanged:function(Ut){var jt;Ke==null||(jt=Ke.onVisibleChanged)===null||jt===void 0||jt.call(Ke,Ut),P(Ut)}}),function(rt,Ut){var jt=rt.className,lt=rt.style,Zt=W()(pe,jt,M);return g.createElement("div",{ref:(0,H.sQ)(qe,ce,Ut),className:Zt,style:(0,F.Z)((0,F.Z)((0,F.Z)((0,F.Z)({"--arrow-x":"".concat(Ce.x||0,"px"),"--arrow-y":"".concat(Ce.y||0,"px")},m),nt),lt),{},{boxSizing:"border-box",zIndex:ft},k),onMouseEnter:wt,onMouseLeave:Qe,onPointerEnter:Kt,onClick:le},Ee&&g.createElement(L,{prefixCls:pe,arrow:Ee,arrowPos:Ce,align:Ne}),g.createElement(A,{cache:!re&&!ae},an))})}))}),J=E,te=g.forwardRef(function(Q,ce){var Y=Q.children,M=Q.getTriggerDOMNode,pe=(0,H.Yr)(Y),k=g.useCallback(function(P){(0,H.mH)(ce,M?M(P):P)},[M]),B=(0,H.x1)(k,Y.ref);return pe?g.cloneElement(Y,{ref:B}):Y}),ne=te,ye=g.createContext(null),we=ye;function Se(Q){return Q?Array.isArray(Q)?Q:[Q]:[]}function he(Q,ce,Y,M){return g.useMemo(function(){var pe=Se(Y!=null?Y:ce),k=Se(M!=null?M:ce),B=new Set(pe),P=new Set(k);return Q&&(B.has("hover")&&(B.delete("hover"),B.add("click")),P.has("hover")&&(P.delete("hover"),P.add("click"))),[B,P]},[Q,ce,Y,M])}var V=b(29194);function T(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Y=arguments.length>2?arguments[2]:void 0;return Y?Q[0]===ce[0]:Q[0]===ce[0]&&Q[1]===ce[1]}function C(Q,ce,Y,M){for(var pe=Y.points,k=Object.keys(Q),B=0;B1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Q)?ce:Q}function y(Q){return v(parseFloat(Q),0)}function $(Q,ce){var Y=(0,F.Z)({},Q);return(ce||[]).forEach(function(M){if(!(M instanceof HTMLBodyElement||M instanceof HTMLHtmlElement)){var pe=z(M).getComputedStyle(M),k=pe.overflow,B=pe.overflowClipMargin,P=pe.borderTopWidth,re=pe.borderBottomWidth,N=pe.borderLeftWidth,ae=pe.borderRightWidth,le=M.getBoundingClientRect(),ge=M.offsetHeight,Ee=M.clientHeight,Ce=M.offsetWidth,Ne=M.clientWidth,Ke=y(P),Oe=y(re),He=y(N),Ze=y(ae),Le=v(Math.round(le.width/Ce*1e3)/1e3),ut=v(Math.round(le.height/ge*1e3)/1e3),ft=(Ce-Ne-He-Ze)*Le,wt=(ge-Ee-Ke-Oe)*ut,Qe=Ke*ut,Kt=Oe*ut,Wt=He*Le,Gt=Ze*Le,Mt=0,pt=0;if(k==="clip"){var ht=y(B);Mt=ht*Le,pt=ht*ut}var mt=le.x+Wt-Mt,Tt=le.y+Qe-pt,Et=mt+le.width+2*Mt-Wt-Gt-ft,kt=Tt+le.height+2*pt-Qe-Kt-wt;Y.left=Math.max(Y.left,mt),Y.top=Math.max(Y.top,Tt),Y.right=Math.min(Y.right,Et),Y.bottom=Math.min(Y.bottom,kt)}}),Y}function j(Q){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Y="".concat(ce),M=Y.match(/^(.*)\%$/);return M?Q*(parseFloat(M[1])/100):parseFloat(Y)}function me(Q,ce){var Y=ce||[],M=(0,q.Z)(Y,2),pe=M[0],k=M[1];return[j(Q.width,pe),j(Q.height,k)]}function xe(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Q[0],Q[1]]}function Re(Q,ce){var Y=ce[0],M=ce[1],pe,k;return Y==="t"?k=Q.y:Y==="b"?k=Q.y+Q.height:k=Q.y+Q.height/2,M==="l"?pe=Q.x:M==="r"?pe=Q.x+Q.width:pe=Q.x+Q.width/2,{x:pe,y:k}}function Ie(Q,ce){var Y={t:"b",b:"t",l:"r",r:"l"};return Q.map(function(M,pe){return pe===ce?Y[M]||"c":M}).join("")}function et(Q,ce,Y,M,pe,k,B){var P=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:pe[M]||{}}),re=(0,q.Z)(P,2),N=re[0],ae=re[1],le=g.useRef(0),ge=g.useMemo(function(){return ce?Z(ce):[]},[ce]),Ee=g.useRef({}),Ce=function(){Ee.current={}};Q||Ce();var Ne=(0,G.Z)(function(){if(ce&&Y&&Q){let si=function(Yn,gi){var Ei=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zt,ri=an.x+Yn,ui=an.y+gi,Vi=ri+x,sr=ui+m,Bi=Math.max(ri,Ei.left),dr=Math.max(ui,Ei.top),Wi=Math.min(Vi,Ei.right),Zi=Math.min(sr,Ei.bottom);return Math.max(0,(Wi-Bi)*(Zi-dr))},Ti=function(){Kn=an.y+Jt,Pn=Kn+m,Un=an.x+hn,Xn=Un+x};var He,Ze,Le=ce,ut=Le.ownerDocument,ft=z(Le),wt=ft.getComputedStyle(Le),Qe=wt.width,Kt=wt.height,Wt=wt.position,Gt=Le.style.left,Mt=Le.style.top,pt=Le.style.right,ht=Le.style.bottom,mt=Le.style.overflow,Tt=(0,F.Z)((0,F.Z)({},pe[M]),k),Et=ut.createElement("div");(He=Le.parentElement)===null||He===void 0||He.appendChild(Et),Et.style.left="".concat(Le.offsetLeft,"px"),Et.style.top="".concat(Le.offsetTop,"px"),Et.style.position=Wt,Et.style.height="".concat(Le.offsetHeight,"px"),Et.style.width="".concat(Le.offsetWidth,"px"),Le.style.left="0",Le.style.top="0",Le.style.right="auto",Le.style.bottom="auto",Le.style.overflow="hidden";var kt;if(Array.isArray(Y))kt={x:Y[0],y:Y[1],width:0,height:0};else{var Xt=Y.getBoundingClientRect();kt={x:Xt.x,y:Xt.y,width:Xt.width,height:Xt.height}}var an=Le.getBoundingClientRect(),Qt=ut.documentElement,cn=Qt.clientWidth,Ht=Qt.clientHeight,Vt=Qt.scrollWidth,_t=Qt.scrollHeight,We=Qt.scrollTop,c=Qt.scrollLeft,m=an.height,x=an.width,K=kt.height,ie=kt.width,be={left:0,top:0,right:cn,bottom:Ht},Ae={left:-c,top:-We,right:Vt-c,bottom:_t-We},nt=Tt.htmlRegion,qe="visible",rt="visibleFirst";nt!=="scroll"&&nt!==rt&&(nt=qe);var Ut=nt===rt,jt=$(Ae,ge),lt=$(be,ge),Zt=nt===qe?lt:jt,Ct=Ut?lt:Zt;Le.style.left="auto",Le.style.top="auto",Le.style.right="0",Le.style.bottom="0";var Fe=Le.getBoundingClientRect();Le.style.left=Gt,Le.style.top=Mt,Le.style.right=pt,Le.style.bottom=ht,Le.style.overflow=mt,(Ze=Le.parentElement)===null||Ze===void 0||Ze.removeChild(Et);var Be=v(Math.round(x/parseFloat(Qe)*1e3)/1e3),ct=v(Math.round(m/parseFloat(Kt)*1e3)/1e3);if(Be===0||ct===0||(0,ue.Sh)(Y)&&!(0,V.Z)(Y))return;var Lt=Tt.offset,Ft=Tt.targetOffset,dn=me(an,Lt),pn=(0,q.Z)(dn,2),It=pn[0],xt=pn[1],De=me(kt,Ft),Me=(0,q.Z)(De,2),Ge=Me[0],st=Me[1];kt.x-=Ge,kt.y-=st;var Xe=Tt.points||[],tt=(0,q.Z)(Xe,2),Je=tt[0],Dt=tt[1],zt=xe(Dt),Bt=xe(Je),rn=Re(kt,zt),un=Re(an,Bt),gn=(0,F.Z)({},Tt),hn=rn.x-un.x+It,Jt=rn.y-un.y+xt,An=si(hn,Jt),_n=si(hn,Jt,lt),In=Re(kt,["t","l"]),wn=Re(an,["t","l"]),yn=Re(kt,["b","r"]),En=Re(an,["b","r"]),xn=Tt.overflow||{},Tn=xn.adjustX,zn=xn.adjustY,Ln=xn.shiftX,fn=xn.shiftY,$t=function(gi){return typeof gi=="boolean"?gi:gi>=0},Kn,Pn,Un,Xn;Ti();var ti=$t(zn),Qn=Bt[0]===zt[0];if(ti&&Bt[0]==="t"&&(Pn>Ct.bottom||Ee.current.bt)){var Nn=Jt;Qn?Nn-=m-K:Nn=In.y-En.y-xt;var Jn=si(hn,Nn),qt=si(hn,Nn,lt);Jn>An||Jn===An&&(!Ut||qt>=_n)?(Ee.current.bt=!0,Jt=Nn,xt=-xt,gn.points=[Ie(Bt,0),Ie(zt,0)]):Ee.current.bt=!1}if(ti&&Bt[0]==="b"&&(KnAn||on===An&&(!Ut||Cn>=_n)?(Ee.current.tb=!0,Jt=Ot,xt=-xt,gn.points=[Ie(Bt,0),Ie(zt,0)]):Ee.current.tb=!1}var On=$t(Tn),oi=Bt[1]===zt[1];if(On&&Bt[1]==="l"&&(Xn>Ct.right||Ee.current.rl)){var Gn=hn;oi?Gn-=x-ie:Gn=In.x-En.x-It;var Zn=si(Gn,Jt),li=si(Gn,Jt,lt);Zn>An||Zn===An&&(!Ut||li>=_n)?(Ee.current.rl=!0,hn=Gn,It=-It,gn.points=[Ie(Bt,1),Ie(zt,1)]):Ee.current.rl=!1}if(On&&Bt[1]==="r"&&(UnAn||fi===An&&(!Ut||pi>=_n)?(Ee.current.lr=!0,hn=di,It=-It,gn.points=[Ie(Bt,1),Ie(zt,1)]):Ee.current.lr=!1}Ti();var Vn=Ln===!0?0:Ln;typeof Vn=="number"&&(Unlt.right&&(hn-=Xn-lt.right-It,kt.x>lt.right-Vn&&(hn+=kt.x-lt.right+Vn)));var ni=fn===!0?0:fn;typeof ni=="number"&&(Knlt.bottom&&(Jt-=Pn-lt.bottom-xt,kt.y>lt.bottom-ni&&(Jt+=kt.y-lt.bottom+ni)));var yi=an.x+hn,Si=yi+x,hi=an.y+Jt,Ai=hi+m,mi=kt.x,Ci=mi+ie,ki=kt.y,Pi=ki+K,zi=Math.max(yi,mi),ji=Math.min(Si,Ci),wi=(zi+ji)/2,qi=wi-yi,Ni=Math.max(hi,ki),Ii=Math.min(Ai,Pi),er=(Ni+Ii)/2,Mi=er-hi;B==null||B(ce,gn);var Di=Fe.right-an.x-(hn+an.width),Fi=Fe.bottom-an.y-(Jt+an.height);ae({ready:!0,offsetX:hn/Be,offsetY:Jt/ct,offsetR:Di/Be,offsetB:Fi/ct,arrowX:qi/Be,arrowY:Mi/ct,scaleX:Be,scaleY:ct,align:gn})}}),Ke=function(){le.current+=1;var Ze=le.current;Promise.resolve().then(function(){le.current===Ze&&Ne()})},Oe=function(){ae(function(Ze){return(0,F.Z)((0,F.Z)({},Ze),{},{ready:!1})})};return(0,f.Z)(Oe,[M]),(0,f.Z)(function(){Q||Oe()},[Q]),[N.ready,N.offsetX,N.offsetY,N.offsetR,N.offsetB,N.arrowX,N.arrowY,N.scaleX,N.scaleY,N.align,Ke]}var ot=b(19127);function Ve(Q,ce,Y,M,pe){(0,f.Z)(function(){if(Q&&ce&&Y){let le=function(){M(),pe()};var k=ce,B=Y,P=Z(k),re=Z(B),N=z(B),ae=new Set([N].concat((0,ot.Z)(P),(0,ot.Z)(re)));return ae.forEach(function(ge){ge.addEventListener("scroll",le,{passive:!0})}),N.addEventListener("resize",le,{passive:!0}),M(),function(){ae.forEach(function(ge){ge.removeEventListener("scroll",le),N.removeEventListener("resize",le)})}}},[Q,ce,Y])}var Rt=b(48736),dt=b(16089);function St(Q,ce,Y,M,pe,k,B,P){var re=g.useRef(Q),N=g.useRef(!1);re.current!==Q&&(N.current=!0,re.current=Q),g.useEffect(function(){var ae=(0,dt.Z)(function(){N.current=!1});return function(){dt.Z.cancel(ae)}},[Q]),g.useEffect(function(){if(ce&&M&&(!pe||k)){var ae=function(){var Wt=!1,Gt=function(ht){var mt=ht.target;Wt=B(mt)},Mt=function(ht){var mt=ht.target;!N.current&&re.current&&!Wt&&!B(mt)&&P(!1)};return[Gt,Mt]},le=ae(),ge=(0,q.Z)(le,2),Ee=ge[0],Ce=ge[1],Ne=ae(),Ke=(0,q.Z)(Ne,2),Oe=Ke[0],He=Ke[1],Ze=z(M);Ze.addEventListener("mousedown",Ee,!0),Ze.addEventListener("click",Ce,!0),Ze.addEventListener("contextmenu",Ce,!0);var Le=(0,o.A)(Y);if(Le&&(Le.addEventListener("mousedown",Oe,!0),Le.addEventListener("click",He,!0),Le.addEventListener("contextmenu",He,!0)),0)var ut,ft,wt,Qe;return function(){Ze.removeEventListener("mousedown",Ee,!0),Ze.removeEventListener("click",Ce,!0),Ze.removeEventListener("contextmenu",Ce,!0),Le&&(Le.removeEventListener("mousedown",Oe,!0),Le.removeEventListener("click",He,!0),Le.removeEventListener("contextmenu",He,!0))}}},[ce,Y,M,pe,k])}var At=["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 ke(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fe.Z,ce=g.forwardRef(function(Y,M){var pe=Y.prefixCls,k=pe===void 0?"rc-trigger-popup":pe,B=Y.children,P=Y.action,re=P===void 0?"hover":P,N=Y.showAction,ae=Y.hideAction,le=Y.popupVisible,ge=Y.defaultPopupVisible,Ee=Y.onPopupVisibleChange,Ce=Y.afterPopupVisibleChange,Ne=Y.mouseEnterDelay,Ke=Y.mouseLeaveDelay,Oe=Ke===void 0?.1:Ke,He=Y.focusDelay,Ze=Y.blurDelay,Le=Y.mask,ut=Y.maskClosable,ft=ut===void 0?!0:ut,wt=Y.getPopupContainer,Qe=Y.forceRender,Kt=Y.autoDestroy,Wt=Y.destroyPopupOnHide,Gt=Y.popup,Mt=Y.popupClassName,pt=Y.popupStyle,ht=Y.popupPlacement,mt=Y.builtinPlacements,Tt=mt===void 0?{}:mt,Et=Y.popupAlign,kt=Y.zIndex,Xt=Y.stretch,an=Y.getPopupClassNameFromAlign,Qt=Y.fresh,cn=Y.alignPoint,Ht=Y.onPopupClick,Vt=Y.onPopupAlign,_t=Y.arrow,We=Y.popupMotion,c=Y.maskMotion,m=Y.popupTransitionName,x=Y.popupAnimation,K=Y.maskTransitionName,ie=Y.maskAnimation,be=Y.className,Ae=Y.getTriggerDOMNode,nt=(0,ve.Z)(Y,At),qe=Kt||Wt||!1,rt=g.useState(!1),Ut=(0,q.Z)(rt,2),jt=Ut[0],lt=Ut[1];(0,f.Z)(function(){lt((0,u.Z)())},[]);var Zt=g.useRef({}),Ct=g.useContext(we),Fe=g.useMemo(function(){return{registerSubPopup:function(en,Dn){Zt.current[en]=Dn,Ct==null||Ct.registerSubPopup(en,Dn)}}},[Ct]),Be=(0,D.Z)(),ct=g.useState(null),Lt=(0,q.Z)(ct,2),Ft=Lt[0],dn=Lt[1],pn=(0,G.Z)(function(sn){(0,ue.Sh)(sn)&&Ft!==sn&&dn(sn),Ct==null||Ct.registerSubPopup(Be,sn)}),It=g.useState(null),xt=(0,q.Z)(It,2),De=xt[0],Me=xt[1],Ge=g.useRef(null),st=(0,G.Z)(function(sn){(0,ue.Sh)(sn)&&De!==sn&&(Me(sn),Ge.current=sn)}),Xe=g.Children.only(B),tt=(Xe==null?void 0:Xe.props)||{},Je={},Dt=(0,G.Z)(function(sn){var en,Dn,qn=De;return(qn==null?void 0:qn.contains(sn))||((en=(0,o.A)(qn))===null||en===void 0?void 0:en.host)===sn||sn===qn||(Ft==null?void 0:Ft.contains(sn))||((Dn=(0,o.A)(Ft))===null||Dn===void 0?void 0:Dn.host)===sn||sn===Ft||Object.values(Zt.current).some(function(kn){return(kn==null?void 0:kn.contains(sn))||sn===kn})}),zt=R(k,We,x,m),Bt=R(k,c,ie,K),rn=g.useState(ge||!1),un=(0,q.Z)(rn,2),gn=un[0],hn=un[1],Jt=le!=null?le:gn,An=(0,G.Z)(function(sn){le===void 0&&hn(sn)});(0,f.Z)(function(){hn(le||!1)},[le]);var _n=g.useRef(Jt);_n.current=Jt;var In=g.useRef([]);In.current=[];var wn=(0,G.Z)(function(sn){var en;An(sn),((en=In.current[In.current.length-1])!==null&&en!==void 0?en:Jt)!==sn&&(In.current.push(sn),Ee==null||Ee(sn))}),yn=g.useRef(),En=function(){clearTimeout(yn.current)},xn=function(en){var Dn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;En(),Dn===0?wn(en):yn.current=setTimeout(function(){wn(en)},Dn*1e3)};g.useEffect(function(){return En},[]);var Tn=g.useState(!1),zn=(0,q.Z)(Tn,2),Ln=zn[0],fn=zn[1];(0,f.Z)(function(sn){(!sn||Jt)&&fn(!0)},[Jt]);var $t=g.useState(null),Kn=(0,q.Z)($t,2),Pn=Kn[0],Un=Kn[1],Xn=g.useState([0,0]),ti=(0,q.Z)(Xn,2),Qn=ti[0],Nn=ti[1],Jn=function(en){Nn([en.clientX,en.clientY])},qt=et(Jt,Ft,cn?Qn:De,ht,Tt,Et,Vt),Ot=(0,q.Z)(qt,11),on=Ot[0],Cn=Ot[1],On=Ot[2],oi=Ot[3],Gn=Ot[4],Zn=Ot[5],li=Ot[6],di=Ot[7],fi=Ot[8],pi=Ot[9],Vn=Ot[10],ni=he(jt,re,N,ae),yi=(0,q.Z)(ni,2),Si=yi[0],hi=yi[1],Ai=Si.has("click"),mi=hi.has("click")||hi.has("contextMenu"),Ci=(0,G.Z)(function(){Ln||Vn()}),ki=function(){_n.current&&cn&&mi&&xn(!1)};Ve(Jt,De,Ft,Ci,ki),(0,f.Z)(function(){Ci()},[Qn,ht]),(0,f.Z)(function(){Jt&&!(Tt!=null&&Tt[ht])&&Ci()},[JSON.stringify(Et)]);var Pi=g.useMemo(function(){var sn=C(Tt,k,pi,cn);return W()(sn,an==null?void 0:an(pi))},[pi,an,Tt,k,cn]);g.useImperativeHandle(M,function(){return{nativeElement:Ge.current,forceAlign:Ci}});var zi=g.useState(0),ji=(0,q.Z)(zi,2),wi=ji[0],qi=ji[1],Ni=g.useState(0),Ii=(0,q.Z)(Ni,2),er=Ii[0],Mi=Ii[1],Di=function(){if(Xt&&De){var en=De.getBoundingClientRect();qi(en.width),Mi(en.height)}},Fi=function(){Di(),Ci()},si=function(en){fn(!1),Vn(),Ce==null||Ce(en)},Ti=function(){return new Promise(function(en){Di(),Un(function(){return en})})};(0,f.Z)(function(){Pn&&(Vn(),Pn(),Un(null))},[Pn]);function Yn(sn,en,Dn,qn){Je[sn]=function(kn){var Oi;qn==null||qn(kn),xn(en,Dn);for(var hr=arguments.length,ar=new Array(hr>1?hr-1:0),tr=1;tr1?Dn-1:0),kn=1;kn1?Dn-1:0),kn=1;knp in g?fe(g,p,{enumerable:!0,configurable:!0,writable:!0,value:I}):g[p]=I,D=(g,p)=>{for(var I in p||(p={}))ue.call(p,I)&&G(g,I,p[I]);if(_e)for(var I of _e(p))o.call(p,I)&&G(g,I,p[I]);return g},f=(g,p)=>oe(g,W(p));const u=({img:g,buttonProps:p={},styles:I={},customText:H,ButtonText:L,ButtonClick:w,Buttonclass:O,ButtonTwo:A,imgStyles:E,loading:J=!1})=>F.createElement("section",{className:"tc animated fadeIn",style:D(D({},{color:"#999",margin:"100px auto",visibility:J?"hidden":"visible"}),I)},F.createElement("img",{src:g||q,style:f(D({},E),{pointerEvents:"none",userSelect:"none"})}),F.createElement("p",{className:"mt20 font14"},H||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),L&&F.createElement(ve.ZP,D({className:O,onClick:w},p),L),A&&A);Pe.Z=u},23210:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return O}});var F=b(59301),q={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ve=b(3113),fe=b(70557),oe=b(23954),W=b(6848),_e=b(955),ue=b(94941),o=b(8797),G=b(3294),D=b(19381),f=b(59301),u=Object.defineProperty,g=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,H=(A,E,J)=>E in A?u(A,E,{enumerable:!0,configurable:!0,writable:!0,value:J}):A[E]=J,L=(A,E)=>{for(var J in E||(E={}))p.call(E,J)&&H(A,J,E[J]);if(g)for(var J of g(E))I.call(E,J)&&H(A,J,E[J]);return A},w=(A,E,J)=>new Promise((te,ne)=>{var ye=he=>{try{Se(J.next(he))}catch(V){ne(V)}},we=he=>{try{Se(J.throw(he))}catch(V){ne(V)}},Se=he=>he.done?te(he.value):Promise.resolve(he.value).then(ye,we);Se((J=J.apply(A,E)).next())}),O=({editOffice:A="view",data:E,theme:J,type:te,filename:ne,monacoEditor:ye,className:we,style:Se,close:he,onClose:V,hasMask:T,disabledDownload:C,onImgDimensions:R,showNodata:z,recordInfo:Z})=>{const[v,y]=(0,F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[$,j]=(0,F.useState)(""),[me,xe]=(0,F.useState)(),Re=window.ENV==="build"?"/react/build":"",Ie=location.host.startsWith("localhost")?G.Z.PROXY_SERVER:G.Z.API_SERVER,ot=10*(1024*1024),Ve=(0,F.useRef)();E!=null&&E.startsWith("/api")&&te!=="txt"&&(E=G.Z.API_SERVER+E);const Rt=ke=>ke.substring(ke.lastIndexOf("/")+1).split(".").pop();ne&&ye&&(ye.filename=ne),(0,F.useEffect)(()=>{var ke,Ye;const Q=(Ye=(ke=document.cookie)==null?void 0:ke.replace(/\s/g,""))==null?void 0:Ye.split(";");Q==null||Q.map(ce=>{let Y=ce.split("=");Y[0]==="_educoder_session"&&j(Y[1])})},[]),(0,F.useEffect)(()=>{te==="office"&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?xe({url:E,fileType:Rt(E),model:E.indexOf("model=edit")?"edit":"view"}):dt())},[te,E]);const dt=()=>w(void 0,null,function*(){console.log("data:",E);let ke=E;E.startsWith("http")||(ke=location.origin+ke);let Ye=new URL(ke).pathname.split("/").pop();const Q=yield(0,ue.gJ)({attachment_id:Ye});Q.url=Ie+Q.url,xe(Q)}),St=()=>{if(E.startsWith("http")||E.startsWith("blob:")){At();return}(0,_e.Sv)(ne||"educoder",E,ne)},At=()=>{Z&&(0,D.fc)({id:Z==null?void 0:Z.id,watch_type:1,course_id:Z==null?void 0:Z.course_id}),(0,_e.Nd)(ne||"educoder",decodeURIComponent(E))};return f.createElement("div",{style:L({},Se||{}),className:`${T&&q.bgBlack} ${te?q.wrp:"hide"}`},he&&f.createElement("div",{className:q.close,ref:Ve},!!R&&f.createElement(W.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ve.current},f.createElement("span",{onClick:()=>{V(),R()}},f.createElement("i",{className:"icon-yulanpizhu"}))),!C&&f.createElement(W.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ve.current},f.createElement("span",{onClick:At},f.createElement("i",{className:"icon-quxiaozhiding"}))),f.createElement(W.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ve.current},f.createElement("span",{className:"",onClick:V},f.createElement("i",{className:"icon-guanbi1"})))),f.createElement("div",{className:`${q[we]} ${we} ${q.monaco} ${te==="txt"?"show":"hide"}`},te==="txt"&&f.createElement(f.Fragment,null,f.createElement(oe.ZP,L({},ye)))),te==="audio"&&f.createElement("audio",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${E}`,autoPlay:!0}),te==="video"&&f.createElement(f.Fragment,null,(E==null?void 0:E.indexOf("http"))>-1?f.createElement("video",{controls:!0,src:`${E}`,autoPlay:!0}):f.createElement("video",{controls:!0,src:`data:video/mp4;base64,${E}`,autoPlay:!0})),te==="office"&&me&&f.createElement("iframe",{src:`${Re}/office.html?key=${me.key}&url=${btoa(me.url)}&callbackUrl=${Ie+(me.callbackUrl||"")}&fileType=${me.fileType}&title=${me.title||""}&model=${A}&officeServer=${G.Z.ONLYOFFICE}&disabledDownload=${!!C}`}),te==="html"&&f.createElement("iframe",{src:E+"&disposition=inline"}),te==="pdf"&&f.createElement("iframe",{src:`${Re}/js/pdfview/index.html?filename=${ne||"educoder.pdf"}&url=${encodeURIComponent(E)}&disabledDownload=${!!C}`}),te==="image"&&f.createElement("img",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:image/png;base64,"}${E}`}),(te==="other"||te==="download")&&f.createElement(f.Fragment,null,z?f.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:f.createElement(ve.ZP,{icon:f.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:St,disabled:C},"\u4E0B\u8F7D")}):f.createElement(ve.ZP,{type:"primary",size:"middle",onClick:St,disabled:C},f.createElement(fe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},71839:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return p}});var F=b(59301),q=b(8591),ve=b(38854),fe=b(29382),oe=b(40846),W=b(24065),_e=b(56102),ue=b(4901),o={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},G=(I,H,L)=>new Promise((w,O)=>{var A=te=>{try{J(L.next(te))}catch(ne){O(ne)}},E=te=>{try{J(L.throw(te))}catch(ne){O(ne)}},J=te=>te.done?w(te.value):Promise.resolve(te.value).then(A,E);J((L=L.apply(I,H)).next())});function D(I){if(isNaN(I))return{minutes:"00",seconds:"00"};const H=new Date(I*1e3).toISOString().substr(11,8);return{hour:H.substr(0,2),minutes:H.substr(3,2),seconds:H.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function f(I,H){return I-H}function u(I){I.sort(f);let H=0;for(let L=0;L{},handlePlay:te=()=>{},handlePlayEnded:ne=()=>{},autoPlay:ye=!1,onPlayEnded:we=()=>{},isShowWaterMark:Se=!0},he)=>{var V;H=H==null?void 0:H.replace("http://","https://");const C=((V=H==null?void 0:H.split("."))==null?void 0:V.pop())==="flv",R=(0,F.useRef)(),z=(0,F.useRef)(),Z=(0,F.useRef)(),v=(0,F.useRef)(),y=(0,F.useRef)(),$=(0,F.useRef)(),j=(0,F.useRef)(),me=(0,F.useRef)(),xe=(0,F.useRef)(),Re=(0,F.useRef)(),Ie=(0,F.useRef)(),et=(0,F.useRef)(),ot=(0,F.useRef)(),Ve=(0,F.useRef)(),Rt=navigator.userAgent.toLowerCase().match(g),dt=Rt?Rt[0]:"pc",St=(0,F.useRef)(!1),At=(0,W.eY)();let ke=0,Ye=0,Q=0,ce=null,Y=!1,M=20,pe=1,k=!1,B=!1,P=[];(0,F.useImperativeHandle)(he,()=>({getLastUpdatedTime:()=>R.current.currentTime,getDuration:()=>R.current.duration})),q.ZP.config({maxCount:1,getContainer:()=>Z.current});const re=(0,F.useCallback)((Ne,Ke=!1)=>{let Oe={point:R.current.currentTime};ce?(Oe.log_id=ce,Oe.watch_duration=u(P),Oe.total_duration=Ye):(A?(Oe.video_id=parseInt(w,10),Oe.course_id=A):Oe.video_id=w,Oe.duration=ke,Oe.device=dt),Ke&&(Oe.ed="1");function He(){return G(this,null,function*(){k=!0,ce=yield O==null?void 0:O(Oe),k=!1,Ne&&Ne()})}He()},[w,A]);(0,F.useEffect)(()=>{R.current&&(v.current.style.display="none",y.current.style.display="block"),q.ZP.destroy();let Ne=null;return fe.Z.isSupported&&C&&H&&(H==null?void 0:H.indexOf(".m3u8"))<0?(Ne=fe.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:H,muted:!1}),R.current&&(Ne.attachMediaElement(R.current),Ne.load())):R.current.setAttribute("src",H),ae(),()=>{Ne&&(Ne.unload(),Ne.pause(),Ne.destroy(),Ne=null)}},[R,C,H]);function N(){R.current.paused?(v.current.style.display="none",y.current.style.display="block"):(v.current.style.display="block",y.current.style.display="none")}function ae(){Ie.current.style.display="none",ot.current.style.display="none",et.current.style.display="none",R.current.muted||R.current.volume===0?Ie.current.style.display="block":R.current.volume>0&&R.current.volume<=.5?ot.current.style.display="block":et.current.style.display="block"}(0,F.useEffect)(()=>{const Ne=document.getElementById("play"),Ke=document.querySelectorAll(".playback-icons use");function Oe(){te(),E&&!St.current&&(R.current.currentTime=E),St.current=!0,P.push(R.current.currentTime),Y||(Y=!0,L&&re())}function He(){return G(this,null,function*(){N(),P.push(R.current.currentTime),L&&re(()=>{ce=null,Q=0,Y=!1,k=!1,B=!1,P=[],Ye=0,pe=1},!0),we()})}function Ze(){$.current.value=Math.round(R.current.currentTime),j.current.value=Math.round(R.current.currentTime)}function Le(){const mt=D(Math.round(R.current.currentTime));xe.current.innerText=`${mt.hour>0?mt.hour+":":""}${mt.minutes}:${mt.seconds}`,xe.current.setAttribute("datetime",`${mt.hour>0?" "+mt.hour+" ":""}${mt.minutes}m ${mt.seconds}s`)}function ut(){var mt,Tt,Et,kt,Xt,an,Qt;const cn=Math.round((mt=R.current)==null?void 0:mt.duration);(Et=(Tt=$.current)==null?void 0:Tt.setAttribute)==null||Et.call(Tt,"max",cn),(Xt=(kt=j.current)==null?void 0:kt.setAttribute)==null||Xt.call(kt,"max",cn);const Ht=D(cn);me.current&&(me.current.innerText=`${Ht.hour>0?Ht.hour+":":""}${Ht.minutes}:${Ht.seconds}`,(Qt=(an=me.current).setAttribute)==null||Qt.call(an,"datetime",`${Ht.hour>0?" "+Ht.hour+" ":""}${Ht.minutes}m ${Ht.seconds}s`))}function ft(){try{const mt=Math.round(R.current.duration);$.current.setAttribute("max",mt),j.current.setAttribute("max",mt);const Tt=D(mt);me.current.innerText=`${Tt.hour>0?Tt.hour+":":""}${Tt.minutes}:${Tt.seconds}`,me.current.setAttribute("datetime",`${Tt.hour>0?" "+Tt.hour+" ":""}${Tt.minutes}m ${Tt.seconds}s`),Ze(),Le();const{width:Et,height:kt,x:Xt,y:an}=z.current.getBoundingClientRect();if(Xt<0||an<0||!Et)return;if(!B){let Qt=R.current.currentTime,cn=Qt-Q;Math.abs(cn)<10?(Ye+=Math.abs(cn),Q=Qt,k||Ye-pe*M>=0&&(pe++,P.push(Q),L&&re())):(Q=Qt,L&&re())}}catch(mt){console.log(mt)}}function wt(){B=!0}function Qe(){R.current.playing&&P.push(R.current.currentTime,Q),Q=R.current.currentTime,B=!1}function Kt(){ke=R.current.duration,ke<=20&&(M=ke/3),R.current.addEventListener("play",Oe)}function Wt(mt){mt.preventDefault(),(0,ue.vp)()?(R.current.style.width="100%",R.current.style.height="100%"):R.current.style.cssText=""}function Gt(){J()}function Mt(mt){if(!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const Tt=mt.target.dataset.seek?mt.target.dataset.seek:mt.target.value;R.current.currentTime=Tt,j.current.value=Tt,$.current.value=Tt}function pt(mt){const Tt=Math.round(mt.offsetX/mt.target.clientWidth*parseInt(mt.target.getAttribute("max"),10));$.current.setAttribute("data-seek",Tt);const Et=D(Tt);Re.current.textContent=`${Et.hour>0?Et.hour+":":""}${Et.minutes}:${Et.seconds}`;const kt=R.current.getBoundingClientRect();Re.current.style.left=`${mt.pageX-kt.left}px`}function ht(mt){switch(mt.code){case"Space":mt.preventDefault(),Ee();break;case"ArrowRight":if(mt.preventDefault(),!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime>=R.current.duration)break;R.current.currentTime=parseInt(R.current.currentTime)+5,Ze();break;case"ArrowLeft":if(mt.preventDefault(),!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime===0)break;R.current.currentTime=parseInt(R.current.currentTime)-5,Ze();break;case"ArrowUp":mt.preventDefault(),R.current.volume<1&&(R.current.volume=(parseInt(R.current.volume*10)+1)/10);break;case"ArrowDown":mt.preventDefault(),R.current.volume>0&&(R.current.volume=(parseInt(R.current.volume*10)-1)/10);break}}return Z.current.addEventListener((0,ue.gH)(),Wt),R.current.addEventListener("canplay",Kt),R.current.addEventListener("ended",He),R.current.addEventListener("seeking",wt),R.current.addEventListener("seeked",Qe),R.current.addEventListener("loadedmetadata",ut),$.current.addEventListener("mousemove",pt),$.current.addEventListener("input",Mt),R.current.addEventListener("timeupdate",ft),R.current.addEventListener("pause",Gt),R.current.addEventListener("volumechange",ae),document.addEventListener("keydown",ht),()=>{var mt,Tt,Et,kt,Xt,an,Qt,cn,Ht,Vt,_t,We;(mt=R.current)==null||mt.removeEventListener("canplay",Kt),(Tt=R.current)==null||Tt.removeEventListener("play",Oe),(Et=R.current)==null||Et.removeEventListener("ended",He),(kt=R.current)==null||kt.removeEventListener("seeking",wt),(Xt=R.current)==null||Xt.removeEventListener("seeked",Qe),(an=$.current)==null||an.removeEventListener("mousemove",pt),(Qt=$.current)==null||Qt.removeEventListener("input",Mt),(cn=R.current)==null||cn.removeEventListener("timeupdate",ft),(Ht=R.current)==null||Ht.removeEventListener("pause",Gt),(Vt=R.current)==null||Vt.removeEventListener("loadedmetadata",ut),(_t=R.current)==null||_t.removeEventListener("volumechange",ae),document.removeEventListener("keydown",ht),(We=R.current)!=null&&We.playing&&(P.push(Q,R.current.currentTime),L&&re())}},[R,H]),(0,F.useEffect)(()=>{if(R.current.onended=()=>{ne(R)},R.current.oncontextmenu=()=>!1,(H==null?void 0:H.indexOf(".m3u8"))>-1){if(R.current.canPlayType("application/vnd.apple.mpegurl"))R.current.src=H;else if(oe.ZP.isSupported()){var Ne=new oe.ZP;Ne.loadSource(H),Ne.attachMedia(R.current)}}},[H]);const[le,ge]=(0,F.useState)(1),Ee=()=>{R.current.paused||R.current.ended?R.current.play():R.current.pause(),N()};function Ce(){R.current.muted=!R.current.muted,R.current.muted?(Ve.current.setAttribute("data-volume",volume.value),Ve.current.value=0):Ve.current.value=Ve.current.dataset.volume}return F.createElement("div",{style:{position:"relative"},ref:Z},F.createElement("div",{ref:z,className:`${o.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${o.animate__loop}`},Se&&At?At.login:" "),F.createElement("div",{className:o.container},F.createElement("div",{className:o["video-container"],id:"video-container"},F.createElement("div",{className:o["playback-animation"],id:"playback-animation"},F.createElement("svg",{className:o["playback-icons"]},F.createElement("use",{className:"hidden",href:"#play-icon"}),F.createElement("use",{href:"#pause"}))),F.createElement("video",{className:o.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:R,autoPlay:ye}),F.createElement("div",{className:`${o["video-controls"]} `,id:"video-controls"},F.createElement("div",{className:o["bottom-controls"]},F.createElement("div",{className:o["left-controls"]},F.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ee},F.createElement("svg",{className:o["playback-icons"]},F.createElement("use",{ref:y,href:"#play-icon"}),F.createElement("use",{ref:v,style:{display:"none"},href:"#pause"}))),F.createElement("div",{className:o.time},F.createElement("time",{id:"time-elapsed",ref:xe},"00:00"),F.createElement("span",null," / "),F.createElement("time",{id:"duration",ref:me},"00:00"))),F.createElement("div",{className:o["right-controls"]},I&&F.createElement(ve.Z,{placement:"top",overlayClassName:o.rateOverlay,getPopupContainer:Ne=>Ne.parentNode,menu:{items:[{key:"1",label:F.createElement("span",{onClick:()=>{ge(1),R.current.playbackRate=1}},"1.0x")},{key:"2",label:F.createElement("span",{onClick:()=>{ge(1.5),R.current.playbackRate=1.5}},"1.5x")},{key:"3",label:F.createElement("span",{onClick:()=>{ge(2),R.current.playbackRate=2}},"2.0x")}]}},F.createElement("div",{className:`${o.controlText} mr5`},"\u500D\u901F")),F.createElement(_e.CopyToClipboard,{text:H,onCopy:()=>q.ZP.success("\u590D\u5236\u6210\u529F")},F.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},F.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),F.createElement("div",{className:o["volume-controls"]},F.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:o["volume-button"],id:"volume-button",onClick:Ce},F.createElement("i",{ref:Ie,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),F.createElement("i",{ref:ot,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),F.createElement("i",{ref:et,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),F.createElement("input",{className:o.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Ve,style:{display:"none"},onClick:ae})),F.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:o["fullscreen-button"],onClick:()=>{(0,ue.vp)()?(0,ue.BU)():(0,ue.Dj)(Z.current)}},F.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),F.createElement("div",{className:o["video-progress"]},F.createElement("progress",{ref:j,value:"0",min:"0"}),F.createElement("input",{className:o.seek,ref:$,value:"0",min:"0",type:"range",step:"1"}),F.createElement("div",{className:o["seek-tooltip"],ref:Re,id:"seek-tooltip"},"00:00"))))),F.createElement("svg",{style:{display:"none"}},F.createElement("defs",null,F.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},F.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),F.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},F.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),F.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},F.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),F.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},F.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),F.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},F.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),F.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},F.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),F.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},F.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),F.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},F.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},23954:function(yt,Pe,b){"use strict";b.d(Pe,{SV:function(){return pe},ZP:function(){return M}});var F=b(59301),q=b(76374);const ve={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"]},fe={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"]},oe={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 ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)}]},W={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(` `)}]},_e={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 ue=b(53184),o=b.n(ue),G=Object.defineProperty,D=Object.defineProperties,f=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,I=(k,B,P)=>B in k?G(k,B,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[B]=P,H=(k,B)=>{for(var P in B||(B={}))g.call(B,P)&&I(k,P,B[P]);if(u)for(var P of u(B))p.call(B,P)&&I(k,P,B[P]);return k},L=(k,B)=>D(k,f(B)),w=(k,B,P)=>new Promise((re,N)=>{var ae=Ee=>{try{ge(P.next(Ee))}catch(Ce){N(Ce)}},le=Ee=>{try{ge(P.throw(Ee))}catch(Ce){N(Ce)}},ge=Ee=>Ee.done?re(Ee.value):Promise.resolve(Ee.value).then(ae,le);ge((P=P.apply(k,B)).next())});const O={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"]}},A=(k,B)=>B.map(P=>({label:P,kind:k.languages.CompletionItemKind.Keyword,insertText:P})),E=k=>Object.keys(O.tables).map(B=>({label:B,kind:k.languages.CompletionItemKind.Variable,insertText:B})),J=(k,B)=>{const P=O.tables[k];return P?P.map(re=>({label:re,kind:B.languages.CompletionItemKind.Field,insertText:re})):[]};function te(k,B,P,re,N){let ae=B.getWordUntilPosition(P),le={startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},ge=re.map(Ee=>({label:Ee,kind:k.languages.CompletionItemKind.Keyword,insertText:Ee,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}));return N.map(Ee=>{ge.push(L(H({},Ee),{range:le}))}),ge}var ne=k=>{O.languages.map(N=>(k.languages.registerDocumentFormattingEditProvider(N,{provideDocumentFormattingEdits(ae,le,ge){return w(this,null,function*(){const Ee=o()(ae.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:ae.getFullModelRange(),text:Ee}]})}}),N));const B=oe.quickKey.map(N=>({label:N.label,kind:k.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),P=W.quickKey.map(N=>({label:N.label,kind:k.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),re=fe.quickKey.map(N=>({label:N.label,kind:k.languages.CompletionItemKind.Method,insertText:N.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}));k.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(N,ae){var le=N.getWordUntilPosition(ae),ge={startLineNumber:ae.lineNumber,endLineNumber:ae.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn},Ee=N.getLineContent(ae.lineNumber).substring(le.startColumn-2,le.endColumn);return{suggestions:[...oe.keywords.map(Ce=>({label:Ce,kind:k.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...oe.quickKey.map(Ce=>({label:Ce.label,kind:k.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Ee.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(N,ae){var le=N.getWordUntilPosition(ae),ge={startLineNumber:ae.lineNumber,endLineNumber:ae.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn};return{suggestions:[...ve.keywords.map(Ee=>({label:Ee,kind:k.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(N,ae){var le=N.getWordUntilPosition(ae),ge={startLineNumber:ae.lineNumber,endLineNumber:ae.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn},Ee=N.getLineContent(ae.lineNumber).substring(le.startColumn-2,le.endColumn);return{suggestions:[...fe.keywords.map(Ce=>({label:Ce,kind:k.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...fe.quickKey.map(Ce=>({label:Ce.label,kind:k.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Ee.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(N,ae){var le=N.getWordUntilPosition(ae),ge={startLineNumber:ae.lineNumber,endLineNumber:ae.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn},Ee=N.getLineContent(ae.lineNumber).substring(le.startColumn-2,le.endColumn);return{suggestions:[..._e.keywords.map(Ce=>({label:Ce,kind:k.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),..._e.quickKey.map(Ce=>({label:Ce.label,kind:k.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Ee.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(N,ae){var le=N.getWordUntilPosition(ae),ge={startLineNumber:ae.lineNumber,endLineNumber:ae.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn},Ee=N.getLineContent(ae.lineNumber).substring(le.startColumn-2,le.endColumn);return{suggestions:[...W.keywords.map(Ce=>({label:Ce,kind:k.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...W.quickKey.map(Ce=>({label:Ce.label,kind:k.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Ee.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}})};const ye="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var we=Object.defineProperty,Se=(k,B,P)=>B in k?we(k,B,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[B]=P,he=(k,B,P)=>Se(k,typeof B!="symbol"?B+"":B,P);const V=class Ya{constructor(B,P,re){this.placeholder=B,this.editor=P,this.monaco=re,P.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Ya.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)}};he(V,"ID","editor.widget.placeholderHint");var C=V,R=b(96236),z=b(8591),Z=b(6848),v=b(89392),y=b(34604),$=b(56102),j=Object.defineProperty,me=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ot=(k,B,P)=>B in k?j(k,B,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[B]=P,Ve=(k,B)=>{for(var P in B||(B={}))Ie.call(B,P)&&ot(k,P,B[P]);if(Re)for(var P of Re(B))et.call(B,P)&&ot(k,P,B[P]);return k},Rt=(k,B)=>me(k,xe(B)),dt=(k,B)=>{var P={};for(var re in k)Ie.call(k,re)&&B.indexOf(re)<0&&(P[re]=k[re]);if(k!=null&&Re)for(var re of Re(k))B.indexOf(re)<0&&et.call(k,re)&&(P[re]=k[re]);return P},St=(k,B,P)=>new Promise((re,N)=>{var ae=Ee=>{try{ge(P.next(Ee))}catch(Ce){N(Ce)}},le=Ee=>{try{ge(P.throw(Ee))}catch(Ce){N(Ce)}},ge=Ee=>Ee.done?re(Ee.value):Promise.resolve(Ee.value).then(ae,le);ge((P=P.apply(k,B)).next())});function At(k){return/^\d+$/.test(k)?`${k}px`:k}function ke(){}let Ye=!1;const Q={"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 ce(k=[]){let B=k;if(Array.isArray(k)){for(let P=0;P{var B=k,{width:P="100%",height:re="100%",value:N,language:ae="javascript",style:le={},options:ge={},overrideServices:Ee={},theme:Ce="vs-dark",onEditBlur:Ne,isCopy:Ke=!1,onSave:Oe,autoHeight:He=!1,forbidCopy:Ze=!1,onChange:Le=ke,editorDidMount:ut=ke,onFocus:ft=ke,onBreakPoint:wt=ke,breakPointValue:Qe=[],filename:Kt="educoder.txt",errorLine:Wt,errorContent:Gt="",highlightLine:Mt,openBreakPoint:pt=!1,placeholder:ht=""}=B,mt=dt(B,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder"]);const Tt=(0,F.useRef)(),Et=(0,F.useRef)({}),kt=(0,F.useRef)(),Xt=(0,F.useRef)(),an=(0,F.useRef)([]),Qt=(0,F.useRef)(!1),cn=(0,F.useRef)(),Ht=(0,F.useRef)(),Vt=(0,F.useRef)(!1),[_t,We]=(0,F.useState)(!1);function c(){let Fe;return Tt.current&&(Fe=new q.Z(Be=>{for(let ct of Be)(ct.target.offsetHeight>0||ct.target.offsetWidth>0)&&Et.current.instance.layout()}),Fe.observe(Tt.current)),Fe}function m(){z.ZP.warning({content:decodeURIComponent(ye),key:"monaco-editor-tip"})}const x=()=>{let Fe=Et.current.instance;if(N!=null&&Fe&&_t){const Be=Fe.getModel();Be&&N!==Be.getValue()&&(Ye=!0,Be.setValue(N),Fe.layout(),Ye=!1)}};(0,F.useEffect)(()=>{const Fe=y.Z.subscribe("formatDocument",Be=>{var ct;let Lt=Et.current.instance;(ct=Lt==null?void 0:Lt.getAction)==null||ct.call(Lt,"editor.action.formatDocument").run()});return window.updateMonacoValue=Be=>{Le(Be)},Fe},[]),(0,F.useEffect)(()=>{var Fe;let Be=Et.current.instance;Xt.current&&clearTimeout(Xt.current),Xt.current=setTimeout(()=>{x()},500),N&&(N!=null&&N.length)&&((Fe=Be==null?void 0:Be.updateOptions)==null||Fe.call(Be,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(N.split(/\r\n|\r|\n/g).length))+3,5)}))},[N,_t,Et.current]),(0,F.useEffect)(()=>{if(Wt&&Et.current&&Et.current.instance){let Be=Et.current.instance;Be.changeViewZones(function(ct){var Lt=document.createElement("div");Lt.style.padding="10px 20px",Lt.style.width="calc(100% - 20px)",Lt.className="my-error-line-wrp",Lt.innerHTML=Gt,ct.addZone({afterLineNumber:Wt||11,heightInLines:3,domNode:Lt})});var Fe={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}};Be.addOverlayWidget(Fe),Be.revealPositionInCenter({lineNumber:20,column:1})}},[Wt,Et.current,_t]);const K=(Fe="",Be)=>{if(!Fe||Fe.trim()==="")return!0;const Lt=Et.current.instance.getModel().getLineTokens(Be);let Ft=!1;for(let dn=0;dn<2;dn++)Lt.getStandardTokenType(dn)===1&&(Ft=!0);return Ft};(0,F.useEffect)(()=>{var Fe;const Be=(Fe=Et.current)==null?void 0:Fe.instance;if(Be&&_t&&Ze){const ct=Be.onDidBlurEditorWidget(()=>{Vt.current=!1}),Lt=Be.onDidFocusEditorText(()=>{Vt.current=!0});return()=>{ct.dispose(),Lt.dispose()}}},[Et.current,_t,Ze]),(0,F.useEffect)(()=>{var Fe;if((Fe=Et.current)!=null&&Fe.instance&&_t&&pt){let Be=Et.current.instance,ct=Be.getModel();if(!ct)return;(()=>{var tt;let Je=[],Dt=[];const zt=ct.getAllDecorations();for(let rn of zt)rn.options.className==="highlighted-line"&&(Je.push((tt=rn==null?void 0:rn.range)==null?void 0:tt.startLineNumber),Dt.push(rn==null?void 0:rn.id));if(Mt===Je[0])return;ct.deltaDecorations(Dt,[]);const Bt=ct.getLineCount();Mt&&Mt<=Bt&&(Be.deltaDecorations([],[{range:new Y.Range(Mt,1,Mt,ct.getLineMaxColumn(Mt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Be.revealLineInCenter(Mt))})();const Ft=(tt=!1)=>{var Je;let Dt=[],zt=[];const Bt=ct.getAllDecorations();for(let rn of Bt)rn.options.linesDecorationsClassName==="breakpoints-select"&&(Dt.push((Je=rn==null?void 0:rn.range)==null?void 0:Je.startLineNumber),zt.push(rn==null?void 0:rn.id));if(tt)return{lines:Dt,ids:zt};wt(Dt)},dn=tt=>St(void 0,null,function*(){let Je={range:new Y.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ct.deltaDecorations([],[Je]),Ft()}),pn=tt=>St(void 0,null,function*(){let Je=[];const Dt=Be.getLineDecorations(tt);for(let zt of Dt)zt.options.linesDecorationsClassName==="breakpoints-select"&&Je.push(zt.id);yield ct.deltaDecorations(Je,[]),Ft()}),It=tt=>{let Je=Be.getLineDecorations(tt);for(let Dt of Je)if(Dt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,v.isEqual)(Qe,Ft(!0).lines)){ct.deltaDecorations(Ft(!0).ids,[]);const tt=Qe.map(Je=>({range:new Y.Range(Je,1,Je,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ct.deltaDecorations([],tt)}const xt=Be.onDidChangeModelContent(tt=>{let Je=Be.getPosition();if(Je){let Dt=Je.lineNumber;clearTimeout(Ht.current),Ht.current=setTimeout(()=>{K(ct.getLineContent(Dt),Dt)?pn(Dt):It(Dt)?(pn(Dt),dn(Dt)):Ft()},100)}}),De=Be.onMouseDown(tt=>{var Je,Dt,zt;if(tt.target.detail&&((zt=(Dt=(Je=tt.target)==null?void 0:Je.element)==null?void 0:Dt.className)!=null&&zt.includes("line-numbers"))){let Bt=tt.target.position.lineNumber;if(K(ct.getLineContent(Bt),Bt))return;It(Bt)?pn(Bt):dn(Bt)}}),Me=tt=>{let Je={range:new Y.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};an.current=Be.deltaDecorations(an.current,[Je])},Ge=()=>{an.current=Be.deltaDecorations(an.current,[])},st=Be.onMouseMove(tt=>{var Je,Dt,zt;if(Ge(),tt.target.detail&&((zt=(Dt=(Je=tt.target)==null?void 0:Je.element)==null?void 0:Dt.className)!=null&&zt.includes("line-numbers"))){let Bt=tt.target.position.lineNumber;if(K(ct.getLineContent(Bt),Bt))return;Me(Bt)}}),Xe=Be.onMouseLeave(()=>{Ge()});return()=>{xt.dispose(),De.dispose(),st.dispose(),Xe.dispose()}}},[Et.current,_t,Qe,Mt,pt,ae]),(0,F.useEffect)(()=>{var Fe;(Fe=Et.current)!=null&&Fe.instance&&pt&&Et.current.instance.setPosition({lineNumber:0,column:0})},[Mt]);function ie(){let Fe=Et.current.instance;if(Fe){const Be=Fe.getSelection(),ct=Et.current.pastePos||{},Lt=new Y.Range(ct.startLineNumber||Be.endLineNumber,ct.startColumn||Be.endColumn,ct.endLineNumber||Be.endLineNumber,ct.endColumn||Be.endColumn);setTimeout(()=>{Fe.executeEdits("",[{range:Lt,text:""}])},300)}}function be(Fe){(window.navigator.platform.match("Mac")?Fe.metaKey:Fe.ctrlKey)&&Fe.keyCode==83&&(Fe.preventDefault(),Oe())}const Ae=()=>{if(He&&Et.current.instance){const Fe=Et.current.instance.getContentHeight();Zt(Fe{if(!Vt.current)return;const{keyCode:Be,ctrlKey:ct,metaKey:Lt,target:Ft,type:dn}=Fe;return(dn==="paste"||(Be===67||Be===86)&&(Lt||ct))&&Ft.nodeName==="TEXTAREA"&&(m(),Fe.preventDefault()),!1};function rt(Fe,Be){var ct=window.URL||window.webkitURL||window,Lt=new Blob([Be]),Ft=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ft.href=ct.createObjectURL(Lt),Ft.download=Fe,nt(Ft)}(0,F.useEffect)(()=>{Ae()},[Ae]),(0,F.useEffect)(()=>{Tt.current&&!_t&&Promise.all([b.e(8909),b.e(3267)]).then(b.bind(b,71448)).then(Fe=>{try{Y=Fe,Et.current.instance=Y.editor.create(Tt.current,{value:N,language:ce(ae),theme:Ce,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ee);const Be=Et.current.instance;let Ft=[...R.BH._menuItems].find(xt=>xt[0]._debugName=="EditorContext")[1],dn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],pn=(xt,De)=>{var Me,Ge;let st=xt._first;do De.includes((Ge=(Me=st.element)==null?void 0:Me.command)==null?void 0:Ge.id)&&xt._remove(st);while(st=st.next)};if(ut(Be,Y),setTimeout(()=>{Ae(),Et.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{rt(Kt||"educoder.txt",Be.getValue())}})},500),Et.current.subscription=Be.onDidChangeModelContent(xt=>{Qt.current?clearTimeout(cn.current):(Ae(),Le(Be.getValue(),xt)),cn.current=setTimeout(()=>{Qt.current=!1},500)}),window.Monaco||ne(Y,ce(ae)),Ze&&(pn(Ft,dn),Tt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",qe),window.removeEventListener("paste",qe),window.addEventListener("keydown",qe),window.addEventListener("paste",qe)),window.Monaco=Y,Ne&&Be.onDidBlurEditorWidget(()=>{Ne(Be.getValue())}),ft&&Be.onDidFocusEditorText(()=>{ft(Be.getValue())}),Ze)try{Be.onDidPaste(xt=>{const De=Be.getSelection(),Me=Et.current.pastePos||{},Ge=new Y.Range(Me.startLineNumber||De.endLineNumber,Me.startColumn||De.endColumn,Me.endLineNumber||De.endLineNumber,Me.endColumn||De.endColumn);Be.executeEdits("",[{range:xt.range,text:""}])})}catch(xt){}let It=c();return ht&&typeof ht=="string"&&new C(ht,Be,Y),We(!0),()=>{const xt=Et.current.instance;xt.dispose();const De=xt.getModel();De&&De.dispose(),Et.current.subscription&&Et.current.subscription.dispose(),It.unobserve(Tt.current)}}catch(Be){}})},[]),(0,F.useEffect)(()=>{if(Et.current.instance&&_t)return document.addEventListener("keydown",be,!1),()=>{document.removeEventListener("keydown",be)}},[Oe,_t]),(0,F.useEffect)(()=>{let Fe=Et.current.instance;if(Fe&&_t){let Be=ce(ae);Y.editor.setModelLanguage(Fe.getModel(),Be)}},[ae,_t]),(0,F.useEffect)(()=>{Et.current.instance&&_t&&Y.editor.setTheme(Ce)},[Ce,_t]),(0,F.useEffect)(()=>{let Fe=Et.current.instance;kt.current=ge,Fe&&_t&&(Fe.updateOptions(Ve({},ge)),setTimeout(()=>{Fe.getModel().updateOptions(Ve({},ge))},200))},[JSON.stringify(ge),_t]),(0,F.useEffect)(()=>{let Fe=Et.current.instance;Fe&&_t&&Fe.layout()},[P,re,_t]);const[Ut,jt]=(0,F.useState)(At(P)),[lt,Zt]=(0,F.useState)(At(re)),Ct=Rt(Ve({},le),{width:Ut,height:lt,position:"relative"});return F.createElement("div",{className:"my-monaco-editor",ref:Tt,style:Ct},Ke&&F.createElement($.CopyToClipboard,{text:N,onCopy:()=>z.ZP.success("\u590D\u5236\u6210\u529F")},F.createElement(Z.Z,{title:"\u590D\u5236\u4EE3\u7801"},F.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},F.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function pe({width:k="100%",height:B="100%",original:P,modified:re,language:N,options:ae={}}){const le=(0,F.useRef)(),[ge,Ee]=(0,F.useState)(null);function Ce(He){let Ze;return le.current&&(Ze=new q.Z(Le=>{for(let ut of Le)(ut.target.offsetHeight>0||ut.target.offsetWidth>0)&&He.layout()}),Ze.observe(le.current)),Ze}(0,F.useEffect)(()=>(le.current&&Promise.all([b.e(8909),b.e(9404)]).then(b.bind(b,2550)).then(He=>{Y=He;const Ze=Y.editor.createDiffEditor(le.current,Rt(Ve({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},ae),{wordWrap:!0}));Ee(Ze);let Le=Ce(Ze);return()=>{Ze.dispose();const ut=Ze.getModel();ut&&ut.dispose(),Le.unobserve(le.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,F.useEffect)(()=>{ge&&ge.setModel({original:Y.editor.createModel(P,N),modified:Y.editor.createModel(re,N)})},[P,re,N,ge]);const Ne=At(k),Ke=At(B),Oe={width:Ne,height:Ke};return F.createElement("div",{className:"my-diff-editor",ref:le,style:Oe})}},58856:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return q}});var F=b(59301);function q(ve,fe){const oe=(0,F.useRef)();(0,F.useEffect)(()=>{oe.current=ve}),(0,F.useEffect)(()=>{function W(){oe.current()}if(fe!==null){let _e=setInterval(W,fe);return()=>clearInterval(_e)}},[fe])}},64930:function(yt,Pe,b){"use strict";b.r(Pe),b.d(Pe,{default:function(){return N},formatQuery:function(){return P}});var F=b(59301),q=b(89070),ve=b(71418),fe={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},oe=b(24334),W=b(71839),_e=b(43418),ue=b(13570),o=b(78673),G=b(64165),D={contentWrap:"contentWrap___xMJQi",title:"title___z4t4P",footer:"footer___CLzrT",footer_left:"footer_left___N2sZZ",footer_bfcs:"footer_bfcs___UmvUE",footer_bfcs_value:"footer_bfcs_value___yiYga",pingfen:"pingfen___aEEMe",fenshu:"fenshu___I6HCo",radioGroup:"radioGroup___RT1dL",wrap:"wrap___QZGSJ",introName:"introName___m17tA",rating:"rating___MXLBr",modalRating:"modalRating___aluwj",zdbf:"zdbf___9PNEF"},f=b(58856),u=b(75730),g=b(955),p=b(59301),I=Object.defineProperty,H=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,O=(ae,le,ge)=>le in ae?I(ae,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ae[le]=ge,A=(ae,le)=>{for(var ge in le||(le={}))L.call(le,ge)&&O(ae,ge,le[ge]);if(H)for(var ge of H(le))w.call(le,ge)&&O(ae,ge,le[ge]);return ae},E=(ae,le)=>{var ge={};for(var Ee in ae)L.call(ae,Ee)&&le.indexOf(Ee)<0&&(ge[Ee]=ae[Ee]);if(ae!=null&&H)for(var Ee of H(ae))le.indexOf(Ee)<0&&w.call(ae,Ee)&&(ge[Ee]=ae[Ee]);return ge},J=(ae,le,ge)=>new Promise((Ee,Ce)=>{var Ne=He=>{try{Oe(ge.next(He))}catch(Ze){Ce(Ze)}},Ke=He=>{try{Oe(ge.throw(He))}catch(Ze){Ce(Ze)}},Oe=He=>He.done?Ee(He.value):Promise.resolve(He.value).then(Ne,Ke);Oe((ge=ge.apply(ae,le)).next())});const te=ae=>{var le=ae,{videoDetail:ge,globalSetting:Ee,loading:Ce,dispatch:Ne}=le,Ke=E(le,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Oe,selectParams:He,videoList:Ze}=ge,{subject_id:Le,videoId:ut}=Oe,{checkBoxValue:ft,radioValue:wt}=He,Qe={videoId:ut},Kt={query:Oe},Wt=(0,F.useRef)(),Gt=(0,F.useRef)(),Mt=(0,F.useRef)(),pt=(0,F.useRef)(5),{video_item:ht}=ge.detail||{};(0,f.Z)(()=>J(void 0,null,function*(){Gt.current&&(console.log("videoRef lastUpdatedTime: ",Wt.current.getLastUpdatedTime()),console.log(Wt.current),yield mt())}),pt.current*1e3);const mt=(Ht=!1)=>{const Vt=Ht?{is_f:1}:{};return(0,u.DH)(A(A({},Vt),{id:Qe.videoId,point:Wt.current.getLastUpdatedTime(),total:Wt.current.getDuration()}))},Tt=Ht=>(Ht.ed==="1"&&(Gt.current=!1,mt(!0)),!Gt.current&&!Ht.ed&&(Gt.current=!0,pt.current=Wt.current.getDuration()<=5?1:5,mt()),Ne({type:"userDetail/logWatchHistory",payload:Ht})),Et=()=>{Gt.current=!1},kt=()=>{Gt.current=!0},Xt=()=>{Mt.current=5,_e.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:p.createElement("div",{className:"tc font14"},p.createElement(ue.Z,{defaultValue:Mt.current,onChange:Ht=>Mt.current=Ht,className:D.modalRating})),onOk:()=>J(void 0,null,function*(){if((yield(0,u.jK)({id:Qe.videoId,star:Mt.current})).status===0){const{course_id:Vt}=(0,g.oP)();Ne({type:"videoDetail/getVideoDetail",payload:{id:Qe.videoId,videoId:Qe.videoId,course_id:Vt,subject_id:Le}})}})})},an=Ht=>{const Vt=window.filterVideoSign,_t=Vt.findIndex(ie=>ie.id===ut);if(_t===Vt.length-1)return;const c=Vt[_t+1].id,m=Vt[_t+1].can_view,x=Vt[_t+1].link,K=Vt[_t+1].is_public;if(window.checkBoxValue){if(x){window.open(x);return}if(!m){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:p.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!K){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:p.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Ne({type:"videoDetail/handleListItemClick",payload:{videoId:c}}),window.videoTimer=setTimeout(()=>{Ht.current.play()},2e3)}},Qt=(Ht,Vt)=>{if(Ht==="checkBox"){const _t=Vt;window.checkBoxValue=_t,Ne({type:"videoDetail/setSelectValue",payload:{radioValue:wt,checkBoxValue:_t}});return}Ne({type:"videoDetail/setSelectValue",payload:{checkBoxValue:ft,radioValue:Vt.target.value}})},cn=()=>Ze.findIndex(_t=>_t.id===ut)===Ze.length-1?p.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):p.createElement("div",null,p.createElement(o.Z,{onChange:_t=>{Qt("checkBox",_t)},defaultChecked:ft,size:"small"}),p.createElement("span",{className:D.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return p.createElement("aside",{className:D.contentWrap},p.createElement("aside",{className:D.wrap},p.createElement("header",null),p.createElement("div",{className:D.title},ht==null?void 0:ht.name),!(ht!=null&&ht.can_edit)&&!(ht!=null&&ht.is_public)?p.createElement(G.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):p.createElement(W.Z,{ref:Wt,startTime:ht==null?void 0:ht.last_point,src:ht!=null&&ht.is_link?ht==null?void 0:ht.link:(ht==null?void 0:ht.play_url)&&oe.Base64.decode(ht==null?void 0:ht.play_url),videoId:ht==null?void 0:ht.video_id,logWatchHistory:Tt,handlePause:Et,handlePlay:kt,allow_skip:ht==null?void 0:ht.allow_skip,handlePlayEnded:an,toLog:()=>{}}),p.createElement("div",{className:D.footer},p.createElement("div",{className:D.footer_left},p.createElement("div",{className:D.pingfen},"\u8BC4\u5206"),p.createElement(ue.Z,{value:ht==null?void 0:ht.star,disabled:!0,className:D.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),p.createElement("div",{className:D.fenshu},(ht==null?void 0:ht.star)||0,"\u5206")),!(ht!=null&&ht.can_edit)&&!(ht!=null&&ht.is_public)?null:p.createElement("div",null,p.createElement("div",{className:D.checkBox},cn()))),p.createElement("div",{className:"mt10"},(ht==null?void 0:ht.description)&&p.createElement("span",{className:D.introName},"\u7B80\u4ECB\uFF1A",ht.description))))};var ne=(0,q.connect)(({videoDetail:ae,loading:le,globalSetting:ge})=>({videoDetail:ae,globalSetting:ge,loading:le}))(te),ye=b(8591),we=b(17574),Se={flex_box_center:"flex_box_center___yWqSL",flex_space_between:"flex_space_between___LgFmv",flex_box_vertical_center:"flex_box_vertical_center____lt6U",flex_box_center_end:"flex_box_center_end___UqkaD",flex_box_column:"flex_box_column___V8XLF",list:"list___8tjfT",tree_style:"tree_style___ZzDvO",title:"title___IVfkQ",gray:"gray___RnyYk",brght:"brght___EWRNa",s1:"s1___dPBQg",s3:"s3___SRBBG",active:"active___hsNCX",tree_line:"tree_line___EGn30",tabs_style:"tabs_style___Nwkiq",tabs_item:"tabs_item___Vzu_U",tabs_item_active:"tabs_item_active___BcIwZ"},he=b(94941),V=b(49692),T=b(3294),C=b(59301),R=Object.defineProperty,z=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,j=(ae,le,ge)=>le in ae?R(ae,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ae[le]=ge,me=(ae,le)=>{for(var ge in le||(le={}))y.call(le,ge)&&j(ae,ge,le[ge]);if(v)for(var ge of v(le))$.call(le,ge)&&j(ae,ge,le[ge]);return ae},xe=(ae,le)=>z(ae,Z(le)),Re=(ae,le)=>{var ge={};for(var Ee in ae)y.call(ae,Ee)&&le.indexOf(Ee)<0&&(ge[Ee]=ae[Ee]);if(ae!=null&&v)for(var Ee of v(ae))le.indexOf(Ee)<0&&$.call(ae,Ee)&&(ge[Ee]=ae[Ee]);return ge},Ie=(ae,le,ge)=>new Promise((Ee,Ce)=>{var Ne=He=>{try{Oe(ge.next(He))}catch(Ze){Ce(Ze)}},Ke=He=>{try{Oe(ge.throw(He))}catch(Ze){Ce(Ze)}},Oe=He=>He.done?Ee(He.value):Promise.resolve(He.value).then(Ne,Ke);Oe((ge=ge.apply(ae,le)).next())});const et=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:C.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:C.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:Se.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:C.createElement("i",{className:"iconfont icon-shipin font20"}),bq:C.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:Se.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:C.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:C.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:Se.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:C.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:C.createElement("span",null)}],ot=ae=>{var le=ae,{dispatch:ge,pathsDetail:Ee,videoDetail:Ce,user:Ne}=le,Ke=Re(le,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Oe,stages:He,cust_seq:Ze,active:Le}=Ce,{subject_id:ut,course_id:ft}=Oe,wt=(0,q.useParams)(),[Qe]=(0,q.useSearchParams)(),[Kt,Wt]=(0,F.useState)([]),[Gt,Mt]=(0,F.useState)([(Le==null?void 0:Le.id)||Number(wt.videoId)]),[pt,ht]=(0,F.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),mt=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,F.useEffect)(()=>{ge(ut?{type:"videoDetail/getStageData",payload:{subject_id:ut,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:ft}})},[]),(0,F.useEffect)(()=>{Tt()},[Ce==null?void 0:Ce.stages]);const Tt=()=>{let _t=Kt;He.forEach((We,c)=>{_t.push({title:C.createElement("div",{title:We.stage_name,className:Se.title},We.stage_name),value:We==null?void 0:We.stage_id,key:We==null?void 0:We.stage_id,icon:C.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Et(We.items||[])})}),Wt(_t)},Et=_t=>{function We(c){var m;const x=c.children,K=Array.isArray(x)&&x.length>0,ie=c==null?void 0:c.id,{name:be,item_type:Ae,id:nt}=c,qe=(m=et.find(jt=>jt.type===Ae))==null?void 0:m.bq,rt=Se.brght,Ut=Le.id===nt?`${rt} ${Se.active}`:rt;return{title:C.createElement("div",{onClick:()=>Qt(c),className:rt,title:be},qe,C.createElement("div",{className:Se.s3},be)),value:ie,key:ie,icon:C.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:K?x==null?void 0:x.map(jt=>We(jt)):[]}}return _t==null?void 0:_t.map(c=>We(c))},kt=(_t,We)=>Ie(void 0,null,function*(){ge({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u7A0D\u540E..."}});const c=We?yield(0,V.BK)({id:_t}):yield(0,V.Ir)({id:_t});if(ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),c!=null&&c.game_identifier||c!=null&&c.identifier){(0,g.xg)(We?`/tasks/${c==null?void 0:c.identifier}/jupyter`:`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?an(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&Xt(c==null?void 0:c.message)}),Xt=_t=>{_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",_t,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},an=_t=>{_t=_t!=null&&_t.includes(".json")?_t:`${_t}.json`,_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>Ie(void 0,null,function*(){const We=yield(0,he.L8)({url:_t});if(!We)return;ye.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const c=yield(0,V.Ir)({id:We.shixun_identifier});if(c!=null&&c.game_identifier){(0,g.xg)(`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?an(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&Xt(c==null?void 0:c.message)})})},Qt=_t=>{var We,c,m,x,K;if((_t==null?void 0:_t.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:ie,item_type:be,identifier:Ae,is_jupyter:nt,url:qe,link:rt}=_t;if(be==="VideoItem"&&!rt){if(!((We=Ne.userInfo)!=null&&We.admin)&&!((c=Ne.userInfo)!=null&&c.business)&&!_t.can_view){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:C.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}ge({type:"videoDetail/handleListItemClick",payload:{videoId:ie}}),ge({type:"videoDetail/getVideoDetail",payload:xe(me({id:ie},Oe),{videoId:ie}),callback:Ut=>{if(Ut&&Ut.video_item&&!Ut.video_item.can_edit&&!_t.is_public){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:C.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(be==="VideoItem"&&rt){_t.link&&(0,u.DH)({is_f:1,id:_t.id,point:0,total:0}),window.open(rt);return}if(be==="Shixun"){kt(Ae,nt);return}if(be==="Attachment"){if(rt){(0,g.xg)(rt);return}let Ut=(x=_t==null?void 0:_t.name)==null?void 0:x.substr((m=_t==null?void 0:_t.name)==null?void 0:m.lastIndexOf("."));if(mt.includes(Ut.toUpperCase())){ge({type:"videoDetail/handleListItemClick",payload:{attachmentId:ie}});return}else{if(!((K=Ee.detail)!=null&&K.allow_download)){ye.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,g.FH)(_t.name,T.Z.API_SERVER+_t.url);return}}window.open(T.Z.IMG_SERVER+qe)},cn=_t=>{let We=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],c=["","\u5341","\u767E","\u5343","\u4E07"];_t=parseInt(_t);let m=ie=>{let be=ie.toString().split("").reverse(),Ae="";for(var nt=0;nt0&&be[nt]==0&&be[nt-1]==0?"":We[be[nt]]+(be[nt]==0?c[0]:c[nt]))+Ae;return Ae},x=Math.floor(_t/1e4),K=_t%1e4;return K.toString().length<4&&(K="0"+K),x?m(x)+"\u4E07"+m(K):m(_t)},Ht=(_t,We,c,m)=>{var x;const{name:K,item_type:ie,id:be}=_t,Ae=`${We+1}-${c+1}-${m+1}`,nt=(x=et.find(Ut=>Ut.type===ie))==null?void 0:x.icon,qe=Se.brght,rt=Le.id===be?`${qe} ${Se.active}`:qe;return C.createElement("div",{key:Ae,onClick:()=>Qt(_t),className:rt,style:{paddingLeft:52}},C.createElement("span",{className:Se.s1},nt),!!Ze&&C.createElement("span",{className:Se.s2},Ae),C.createElement("span",{className:Se.s3},"\u203B ",K))},Vt=(_t,We,c)=>{var m;const{name:x,item_type:K,id:ie,children:be}=_t,Ae=`${We+1}-${c+1}`,nt=(m=et.find(Ut=>Ut.type===K))==null?void 0:m.icon,qe=Se.brght,rt=Le.id===ie?`${qe} ${Se.active}`:qe;return C.createElement(F.Fragment,{key:Ae},C.createElement("div",{onClick:()=>Qt(_t),className:rt},C.createElement("span",{className:Se.s1},nt),!!Ze&&C.createElement("span",{className:Se.s2},Ae),C.createElement("span",{className:Se.s3},"\u203B ",x)),!!be.length&&be.map((Ut,jt)=>Ht(Ut,We,c,jt)))};return C.createElement("aside",{className:Se.list},C.createElement("div",{className:Se.tabs_style},C.createElement("div",{className:Se.tabs_item,onClick:()=>{ht("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",pt=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&C.createElement("div",{className:Se.tabs_item_active}))),C.createElement("div",{className:Se.tree_style},(Kt==null?void 0:Kt.length)>0&&C.createElement(we.default,{selectedKeys:Gt,onSelect:(_t,We)=>{Mt([..._t])},blockNode:!0,treeData:Kt,defaultExpandAll:!0,className:Se.tree_line})))};var Ve=(0,q.connect)(({user:ae,videoDetail:le,loading:ge,globalSetting:Ee,pathsDetail:Ce})=>({user:ae,videoDetail:le,globalSetting:Ee,loading:ge,pathsDetail:Ce}))(ot),Rt=b(23210),dt=b(59301),St=Object.defineProperty,At=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,Y=(ae,le,ge)=>le in ae?St(ae,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ae[le]=ge,M=(ae,le)=>{for(var ge in le||(le={}))Q.call(le,ge)&&Y(ae,ge,le[ge]);if(Ye)for(var ge of Ye(le))ce.call(le,ge)&&Y(ae,ge,le[ge]);return ae},pe=(ae,le)=>At(ae,ke(le)),k=(ae,le)=>{var ge={};for(var Ee in ae)Q.call(ae,Ee)&&le.indexOf(Ee)<0&&(ge[Ee]=ae[Ee]);if(ae!=null&&Ye)for(var Ee of Ye(ae))le.indexOf(Ee)<0&&ce.call(ae,Ee)&&(ge[Ee]=ae[Ee]);return ge},B=(ae,le,ge)=>new Promise((Ee,Ce)=>{var Ne=He=>{try{Oe(ge.next(He))}catch(Ze){Ce(Ze)}},Ke=He=>{try{Oe(ge.throw(He))}catch(Ze){Ce(Ze)}},Oe=He=>He.done?Ee(He.value):Promise.resolve(He.value).then(Ne,Ke);Oe((ge=ge.apply(ae,le)).next())});const P=ae=>{const{subject_id:le}=ae;return{subject_id:le,course_id:le}},re=ae=>{var le=ae,{videoDetail:ge,globalSetting:Ee,loading:Ce,pathsDetail:Ne,dispatch:Ke}=le,Oe=k(le,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),He,Ze;const{queryParams:Le,videoList:ut,attachmentList:ft,active:wt}=ge,{subject_id:Qe,videoId:Kt}=Le,Wt={videoId:Kt};(0,F.useEffect)(()=>{if(wt){const{item_type:pt,id:ht}=wt;pt==="VideoItem"&&Ke({type:"videoDetail/getVideoDetail",payload:pe(M({},Le),{id:ht})})}},[wt.id]),console.log("---",wt),(0,F.useEffect)(()=>{Qe&&Gt()},[]);function Gt(){return B(this,null,function*(){const pt=yield Ke({type:"pathsDetail/getPathsDetail",payload:{id:Qe}})})}(0,F.useEffect)(()=>{var pt,ht;(0,g.Dk)((ht=(pt=ge.detail)==null?void 0:pt.video_item)==null?void 0:ht.name)},[ge]);let Mt={width:1200};return wt&&wt.item_type==="Attachment"&&wt.content_type==="application/pdf"&&(Mt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),dt.createElement(ve.Z,{spinning:!1},dt.createElement("section",{className:fe.bg},dt.createElement("div",{className:fe.container,style:Mt},dt.createElement(Ve,null),wt&&wt.item_type==="VideoItem"&&dt.createElement(ne,null),wt&&wt.item_type==="Attachment"&&wt.content_type==="application/pdf"&&wt.url&&dt.createElement("div",{className:fe.widthle},dt.createElement(Rt.Z,{disabledDownload:!((He=Ne.detail)!=null&&He.allow_download),type:"pdf",filename:wt.name,data:T.Z.API_SERVER+wt.url,style:{position:"absolute",zIndex:1}})),wt&&wt.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(wt.content_type)&&wt.url&&dt.createElement("div",{className:fe.widthle},dt.createElement(Rt.Z,{disabledDownload:!((Ze=Ne.detail)!=null&&Ze.allow_download),type:"office",data:T.Z.API_SERVER+wt.url,style:{position:"absolute",zIndex:1}})))))};var N=(0,q.connect)(({videoDetail:ae,loading:le,globalSetting:ge,pathsDetail:Ee})=>({videoDetail:ae,globalSetting:ge,loading:le,pathsDetail:Ee}))(re)},4901:function(yt,Pe,b){"use strict";b.d(Pe,{BU:function(){return q},Dj:function(){return F},gH:function(){return ve},vp:function(){return fe}});function F(oe){try{oe.mozRequestFullScreen?oe.mozRequestFullScreen():oe.webkitRequestFullScreen&&oe.webkitRequestFullScreen()}catch(W){console.log(W,":e")}}function q(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const ve=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function fe(){var oe=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,W=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",oe),window.isFullScreen?window.isFullScreen:oe!=null}},29382:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return _t}});class F{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,m){return c.__proto__=m,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");let m=Object(c);for(let x=1;x ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","error",x),oe.ENABLE_ERROR&&(console.error?console.error(x):console.warn?console.warn(x):console.log(x))}static i(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","info",x),oe.ENABLE_INFO&&(console.info?console.info(x):console.log(x))}static w(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","warn",x),oe.ENABLE_WARN&&(console.warn?console.warn(x):console.log(x))}static d(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","debug",x),oe.ENABLE_DEBUG&&(console.debug?console.debug(x):console.log(x))}static v(c,m){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${m}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","verbose",x),oe.ENABLE_VERBOSE&&console.log(x)}}oe.GLOBAL_TAG="flv.js",oe.FORCE_GLOBAL_TAG=!1,oe.ENABLE_ERROR=!0,oe.ENABLE_INFO=!0,oe.ENABLE_WARN=!0,oe.ENABLE_DEBUG=!0,oe.ENABLE_VERBOSE=!0,oe.ENABLE_CALLBACK=!1,oe.emitter=new(fe());var W=oe;class _e{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024}}var ue=_e;class o{constructor(c){this._message=c}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class G extends o{constructor(c){super(c)}get name(){return"IllegalStateException"}}class D extends o{constructor(c){super(c)}get name(){return"InvalidArgumentException"}}class f extends o{constructor(c){super(c)}get name(){return"NotImplementedException"}}const u={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},g={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class p{constructor(c){this._type=c||"undefined",this._status=u.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=u.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===u.kConnecting||this._status===u.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(c){this._onContentLengthKnown=c}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(c){this._onURLRedirect=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}open(c,m){throw new f("Unimplemented abstract function!")}abort(){throw new f("Unimplemented abstract function!")}}let I={};function H(){let We=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(We)||/(opr)[\/]([\w.]+)/.exec(We)||/(chrome)[ \/]([\w.]+)/.exec(We)||/(iemobile)[\/]([\w.]+)/.exec(We)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(We)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(We)||/(webkit)[ \/]([\w.]+)/.exec(We)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(We)||/(msie) ([\w.]+)/.exec(We)||We.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(We)||We.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(We)||[],m=/(ipad)/.exec(We)||/(ipod)/.exec(We)||/(windows phone)/.exec(We)||/(iphone)/.exec(We)||/(kindle)/.exec(We)||/(android)/.exec(We)||/(windows)/.exec(We)||/(mac)/.exec(We)||/(linux)/.exec(We)||/(cros)/.exec(We)||[],x={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:m[0]||""},K={};if(x.browser){K[x.browser]=!0;let ie=x.majorVersion.split(".");K.version={major:parseInt(x.majorVersion,10),string:x.version},ie.length>1&&(K.version.minor=parseInt(ie[1],10)),ie.length>2&&(K.version.build=parseInt(ie[2],10))}if(x.platform&&(K[x.platform]=!0),(K.chrome||K.opr||K.safari)&&(K.webkit=!0),K.rv||K.iemobile){K.rv&&delete K.rv;let ie="msie";x.browser=ie,K[ie]=!0}if(K.edge){delete K.edge;let ie="msedge";x.browser=ie,K[ie]=!0}if(K.opr){let ie="opera";x.browser=ie,K[ie]=!0}if(K.safari&&K.android){let ie="android";x.browser=ie,K[ie]=!0}K.name=x.browser,K.platform=x.platform;for(let ie in I)I.hasOwnProperty(ie)&&delete I[ie];Object.assign(I,K)}H();var L=I;class w extends p{static isSupported(){try{let c=L.msedge&&L.version.minor>=15048,m=L.msedge?c:!0;return self.fetch&&self.ReadableStream&&m}catch(c){return!1}}constructor(c,m){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=c,this._config=m,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(c,m){this._dataSource=c,this._range=m;let x=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(x=c.redirectedURL);let K=this._seekHandler.getConfig(x,m),ie=new self.Headers;if(typeof K.headers=="object"){let Ae=K.headers;for(let nt in Ae)Ae.hasOwnProperty(nt)&&ie.append(nt,Ae[nt])}let be={method:"GET",headers:ie,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Ae in this._config.headers)ie.append(Ae,this._config.headers[Ae]);c.cors===!1&&(be.mode="same-origin"),c.withCredentials&&(be.credentials="include"),c.referrerPolicy&&(be.referrerPolicy=c.referrerPolicy),this._status=u.kConnecting,self.fetch(K.url,be).then(Ae=>{if(this._requestAbort){this._requestAbort=!1,this._status=u.kIdle;return}if(Ae.ok&&Ae.status>=200&&Ae.status<=299){if(Ae.url!==K.url&&this._onURLRedirect){let qe=this._seekHandler.removeURLParameters(Ae.url);this._onURLRedirect(qe)}let nt=Ae.headers.get("Content-Length");return nt!=null&&(this._contentLength=parseInt(nt),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Ae.body.getReader())}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:Ae.status,msg:Ae.statusText});else throw new o("FetchStreamLoader: Http code invalid, "+Ae.status+" "+Ae.statusText)}).catch(Ae=>{if(this._status=u.kError,this._onError)this._onError(g.EXCEPTION,{code:-1,msg:Ae.message});else throw Ae})}abort(){this._requestAbort=!0}_pump(c){return c.read().then(m=>{if(m.done)if(this._contentLength!==null&&this._receivedLength{if(m.code===11&&L.msedge)return;this._status=u.kError;let x=0,K=null;if((m.code===19||m.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength299))if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new o("MozChunkedLoader: Http code invalid, "+m.status+" "+m.statusText);else this._status=u.kBuffering}}_onProgress(c){if(this._status===u.kError)return;this._contentLength===null&&c.total!==null&&c.total!==0&&(this._contentLength=c.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let m=c.target.response,x=this._range.from+this._receivedLength;this._receivedLength+=m.byteLength,this._onDataArrival&&this._onDataArrival(m,x,this._receivedLength)}_onLoadEnd(c){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===u.kError)return;this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(c){this._status=u.kError;let m=0,x=null;if(this._contentLength&&c.loaded=200&&m.status<=299){if(this._status=LoaderStatus.kBuffering,m.responseURL!=null){let K=this._seekHandler.removeURLParameters(m.responseURL);m.responseURL!==this._currentRequestURL&&K!==this._currentRedirectedURL&&(this._currentRedirectedURL=K,this._onURLRedirect&&this._onURLRedirect(K))}let x=m.getResponseHeader("Content-Length");if(x!=null&&this._contentLength==null){let K=parseInt(x);K>0&&(this._contentLength=K,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+m.status+" "+m.statusText);else if(m.readyState===3&&m.status>=200&&m.status<=299){this._status=LoaderStatus.kBuffering;let x=m.response;this._reader.readAsArrayBuffer(x)}}_xhrOnError(c){this._status=LoaderStatus.kError;let m=LoaderErrors.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type};if(this._onError)this._onError(m,x);else throw new RuntimeException(x.msg)}_msrOnProgress(c){let x=c.target.result;if(x==null){this._doReconnectIfNeeded();return}let K=x.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=x.byteLength;let ie=this._totalRange.from+this._receivedLength;this._receivedLength+=K.byteLength,this._onDataArrival&&this._onDataArrival(K,ie,this._receivedLength),x.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${ie+K.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(x=this._range.from+this._contentLength-1),this._currentRequestRange={from:m,to:x},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(c,m){this._lastTimeLoaded=0;let x=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?x=this._currentRedirectedURL:c.redirectedURL!=null&&(x=c.redirectedURL));let K=this._seekHandler.getConfig(x,m);this._currentRequestURL=K.url;let ie=this._xhr=new XMLHttpRequest;if(ie.open("GET",K.url,!0),ie.responseType="arraybuffer",ie.onreadystatechange=this._onReadyStateChange.bind(this),ie.onprogress=this._onProgress.bind(this),ie.onload=this._onLoad.bind(this),ie.onerror=this._onXhrError.bind(this),c.withCredentials&&(ie.withCredentials=!0),typeof K.headers=="object"){let be=K.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&ie.setRequestHeader(Ae,be[Ae])}if(typeof this._config.headers=="object"){let be=this._config.headers;for(let Ae in be)be.hasOwnProperty(Ae)&&ie.setRequestHeader(Ae,be[Ae])}ie.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=u.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(c){let m=c.target;if(m.readyState===2){if(m.responseURL!=null){let x=this._seekHandler.removeURLParameters(m.responseURL);m.responseURL!==this._currentRequestURL&&x!==this._currentRedirectedURL&&(this._currentRedirectedURL=x,this._onURLRedirect&&this._onURLRedirect(x))}if(m.status>=200&&m.status<=299){if(this._waitForTotalLength)return;this._status=u.kBuffering}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:m.status,msg:m.statusText});else throw new o("RangeLoader: Http code invalid, "+m.status+" "+m.statusText)}}_onProgress(c){if(this._status===u.kError)return;if(this._contentLength===null){let x=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,x=!0;let K=c.total;this._internalAbort(),K!=null&K!==0&&(this._totalLength=K)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,x){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let m=c.loaded-this._lastTimeLoaded;this._lastTimeLoaded=c.loaded,this._speedSampler.addBytes(m)}_normalizeSpeed(c){let m=this._chunkSizeKBList,x=m.length-1,K=0,ie=0,be=x;if(c=m[K]&&c=3&&(m=this._speedSampler.currentKBps)),m!==0){let be=this._normalizeSpeed(m);this._currentSpeedNormalized!==be&&(this._currentSpeedNormalized=be,this._currentChunkSizeKB=be)}let x=c.target.response,K=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength;let ie=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength{this._dispatchArrayBuffer(m.result)},m.readAsArrayBuffer(c.data)}else{this._status=u.kError;let m={code:-1,msg:"Unsupported WebSocket message type: "+c.data.constructor.name};if(this._onError)this._onError(g.EXCEPTION,m);else throw new o(m.msg)}}_dispatchArrayBuffer(c){let m=c,x=this._receivedLength;this._receivedLength+=m.byteLength,this._onDataArrival&&this._onDataArrival(m,x,this._receivedLength)}_onWebSocketError(c){this._status=u.kError;let m={code:c.code,msg:c.message};if(this._onError)this._onError(g.EXCEPTION,m);else throw new o(m.msg)}}var Se=we;class he{constructor(c){this._zeroStart=c||!1}getConfig(c,m){let x={};if(m.from!==0||m.to!==-1){let K;m.to!==-1?K=`bytes=${m.from.toString()}-${m.to.toString()}`:K=`bytes=${m.from.toString()}-`,x.Range=K}else this._zeroStart&&(x.Range="bytes=0-");return{url:c,headers:x}}removeURLParameters(c){return c}}var V=he;class T{constructor(c,m){this._startName=c,this._endName=m}getConfig(c,m){let x=c;if(m.from!==0||m.to!==-1){let K=!0;x.indexOf("?")===-1&&(x+="?",K=!1),K&&(x+="&"),x+=`${this._startName}=${m.from.toString()}`,m.to!==-1&&(x+=`&${this._endName}=${m.to.toString()}`)}return{url:x,headers:{}}}removeURLParameters(c){let m=c.split("?")[0],x,K=c.indexOf("?");K!==-1&&(x=c.substring(K+1));let ie="";if(x!=null&&x.length>0){let be=x.split("&");for(let Ae=0;Ae0;nt[0]!==this._startName&&nt[0]!==this._endName&&(qe&&(ie+="&"),ie+=be[Ae])}}return ie.length===0?m:m+"?"+ie}}var C=T;class R{constructor(c,m,x){this.TAG="IOController",this._config=m,this._extraData=x,this._stashInitialSize=1024*384,m.stashInitialSize!=null&&m.stashInitialSize>0&&(this._stashInitialSize=m.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,m.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new ue,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(c){this._extraData=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onSeeked(){return this._onSeeked}set onSeeked(c){this._onSeeked=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}get onRedirect(){return this._onRedirect}set onRedirect(c){this._onRedirect=c}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(c){this._onRecoveredEarlyEof=c}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===ye?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let c=this._config;if(c.seekType==="range")this._seekHandler=new V(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){let m=c.seekParamStart||"bstart",x=c.seekParamEnd||"bend";this._seekHandler=new C(m,x)}else if(c.seekType==="custom"){if(typeof c.customSeekHandler!="function")throw new D("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}else throw new D(`Invalid seekType in config: ${c.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=Se;else if(O.isSupported())this._loaderClass=O;else if(E.isSupported())this._loaderClass=E;else if(ye.isSupported())this._loaderClass=ye;else throw new o("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}}seek(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)}_internalSeek(c,m){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(m),this._loader.destroy(),this._loader=null;let x={from:c,to:-1};this._currentRange={from:x.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,x),this._onSeeked&&this._onSeeked()}updateUrl(c){if(!c||typeof c!="string"||c.length===0)throw new D("Url must be a non-empty string!");this._dataSource.url=c}_expandBuffer(c){let m=this._stashSize;for(;m+1024*1024*10){let K=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(x,0,m).set(K,0)}this._stashBuffer=x,this._bufferSize=m}_normalizeSpeed(c){let m=this._speedNormalizeList,x=m.length-1,K=0,ie=0,be=x;if(c=m[K]&&c=512&&c<=1024?m=Math.floor(c*1.5):m=c*2,m>8192&&(m=8192);let x=m*1024+1024*1024*1;this._bufferSize0){let be=this._stashBuffer.slice(0,this._stashUsed),Ae=this._dispatchChunks(be,this._stashByteStart);if(Ae0){let nt=new Uint8Array(be,Ae);ie.set(nt,0),this._stashUsed=nt.byteLength,this._stashByteStart+=Ae}}else this._stashUsed=0,this._stashByteStart+=Ae;this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ie.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else{let be=this._dispatchChunks(c,m);if(bethis._bufferSize&&(this._expandBuffer(Ae),ie=new Uint8Array(this._stashBuffer,0,this._bufferSize)),ie.set(new Uint8Array(c,be),0),this._stashUsed+=Ae,this._stashByteStart=m+be}}}else if(this._stashUsed===0){let ie=this._dispatchChunks(c,m);if(iethis._bufferSize&&this._expandBuffer(be),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(c,ie),0),this._stashUsed+=be,this._stashByteStart=m+ie}}else{this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength);let ie=new Uint8Array(this._stashBuffer,0,this._bufferSize);ie.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;let be=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(be0){let Ae=new Uint8Array(this._stashBuffer,be);ie.set(Ae,0)}this._stashUsed-=be,this._stashByteStart+=be}}_flushStashBuffer(c){if(this._stashUsed>0){let m=this._stashBuffer.slice(0,this._stashUsed),x=this._dispatchChunks(m,this._stashByteStart),K=m.byteLength-x;if(x0){let ie=new Uint8Array(this._stashBuffer,0,this._bufferSize),be=new Uint8Array(m,x);ie.set(be,0),this._stashUsed=be.byteLength,this._stashByteStart+=x}return 0}return this._stashUsed=0,this._stashByteStart=0,K}return 0}_onLoaderComplete(c,m){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(c,m){switch(W.e(this.TAG,`Loader error, code = ${m.code}, msg = ${m.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=g.UNRECOVERABLE_EARLY_EOF),c){case g.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let x=this._currentRange.to+1;x0){let m=xe.getConfig();c.emit("change",m)}}static registerListener(c){xe.emitter.addListener("change",c)}static removeListener(c){xe.emitter.removeListener("change",c)}static addLogListener(c){W.emitter.addListener("log",c),W.emitter.listenerCount("log")>0&&(W.ENABLE_CALLBACK=!0,xe._notifyChange())}static removeLogListener(c){W.emitter.removeListener("log",c),W.emitter.listenerCount("log")===0&&(W.ENABLE_CALLBACK=!1,xe._notifyChange())}}xe.emitter=new(fe());var Re=xe;class Ie{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,m=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&c&&m}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(c){if(this.keyframesIndex==null)return null;let m=this.keyframesIndex,x=this._search(m.times,c);return{index:x,milliseconds:m.times[x],fileposition:m.filepositions[x]}}_search(c,m){let x=0,K=c.length-1,ie=0,be=0,Ae=K;for(m=c[ie]&&m=128){c.push(String.fromCharCode(ie&65535)),x+=2;continue}}}else if(m[x]<240){if(ot(m,x,2)){let ie=(m[x]&15)<<12|(m[x+1]&63)<<6|m[x+2]&63;if(ie>=2048&&(ie&63488)!==55296){c.push(String.fromCharCode(ie&65535)),x+=3;continue}}}else if(m[x]<248&&ot(m,x,3)){let ie=(m[x]&7)<<18|(m[x+1]&63)<<12|(m[x+2]&63)<<6|m[x+3]&63;if(ie>65536&&ie<1114112){ie-=65536,c.push(String.fromCharCode(ie>>>10|55296)),c.push(String.fromCharCode(ie&1023|56320)),x+=4;continue}}}c.push("\uFFFD"),++x}return c.join("")}var Rt=Ve;let dt=function(){let We=new ArrayBuffer(2);return new DataView(We).setInt16(0,256,!0),new Int16Array(We)[0]===256}();class St{static parseScriptData(c,m,x){let K={};try{let ie=St.parseValue(c,m,x),be=St.parseValue(c,m+ie.size,x-ie.size);K[ie.data]=be.data}catch(ie){W.e("AMF",ie.toString())}return K}static parseObject(c,m,x){if(x<3)throw new G("Data not enough when parse ScriptDataObject");let K=St.parseString(c,m,x),ie=St.parseValue(c,m+K.size,x-K.size),be=ie.objectEnd;return{data:{name:K.data,value:ie.data},size:K.size+ie.size,objectEnd:be}}static parseVariable(c,m,x){return St.parseObject(c,m,x)}static parseString(c,m,x){if(x<2)throw new G("Data not enough when parse String");let ie=new DataView(c,m,x).getUint16(0,!dt),be;return ie>0?be=Rt(new Uint8Array(c,m+2,ie)):be="",{data:be,size:2+ie}}static parseLongString(c,m,x){if(x<4)throw new G("Data not enough when parse LongString");let ie=new DataView(c,m,x).getUint32(0,!dt),be;return ie>0?be=Rt(new Uint8Array(c,m+4,ie)):be="",{data:be,size:4+ie}}static parseDate(c,m,x){if(x<10)throw new G("Data size invalid when parse Date");let K=new DataView(c,m,x),ie=K.getFloat64(0,!dt),be=K.getInt16(8,!dt);return ie+=be*60*1e3,{data:new Date(ie),size:10}}static parseValue(c,m,x){if(x<1)throw new G("Data not enough when parse Value");let K=new DataView(c,m,x),ie=1,be=K.getUint8(0),Ae,nt=!1;try{switch(be){case 0:Ae=K.getFloat64(1,!dt),ie+=8;break;case 1:{Ae=!!K.getUint8(1),ie+=1;break}case 2:{let qe=St.parseString(c,m+1,x-1);Ae=qe.data,ie+=qe.size;break}case 3:{Ae={};let qe=0;for((K.getUint32(x-4,!dt)&16777215)===9&&(qe=3);ie32)throw new D("ExpGolomb: readBits() bits exceeded max 32bits!");if(c<=this._current_word_bits_left){let be=this._current_word>>>32-c;return this._current_word<<=c,this._current_word_bits_left-=c,be}let m=this._current_word_bits_left?this._current_word:0;m=m>>>32-this._current_word_bits_left;let x=c-this._current_word_bits_left;this._fillCurrentWord();let K=Math.min(x,this._current_word_bits_left),ie=this._current_word>>>32-K;return this._current_word<<=K,this._current_word_bits_left-=K,m=m<>>c)return this._current_word<<=c,this._current_word_bits_left-=c,c;return this._fillCurrentWord(),c+this._skipLeadingZero()}readUEG(){let c=this._skipLeadingZero();return this.readBits(c+1)-1}readSEG(){let c=this.readUEG();return c&1?c+1>>>1:-1*(c>>>1)}}var Ye=ke;class Q{static _ebsp2rbsp(c){let m=c,x=m.byteLength,K=new Uint8Array(x),ie=0;for(let be=0;be=2&&m[be]===3&&m[be-1]===0&&m[be-2]===0||(K[ie]=m[be],ie++);return new Uint8Array(K.buffer,0,ie)}static parseSPS(c){let m=Q._ebsp2rbsp(c),x=new Ye(m);x.readByte();let K=x.readByte();x.readByte();let ie=x.readByte();x.readUEG();let be=Q.getProfileString(K),Ae=Q.getLevelString(ie),nt=1,qe=420,rt=[0,420,422,444],Ut=8;if((K===100||K===110||K===122||K===244||K===44||K===83||K===86||K===118||K===128||K===138||K===144)&&(nt=x.readUEG(),nt===3&&x.readBits(1),nt<=3&&(qe=rt[nt]),Ut=x.readUEG()+8,x.readUEG(),x.readBits(1),x.readBool())){let rn=nt!==3?8:12;for(let un=0;un0&&rn<16?(pn=un[rn-1],It=gn[rn-1]):rn===255&&(pn=x.readByte()<<8|x.readByte(),It=x.readByte()<<8|x.readByte())}if(x.readBool()&&x.readBool(),x.readBool()&&(x.readBits(4),x.readBool()&&x.readBits(24)),x.readBool()&&(x.readUEG(),x.readUEG()),x.readBool()){let rn=x.readBits(32),un=x.readBits(32);De=x.readBool(),Me=un,Ge=rn*2,xt=Me/Ge}}let Xe=1;(pn!==1||It!==1)&&(Xe=pn/It);let tt=0,Je=0;if(nt===0)tt=1,Je=2-Fe;else{let rn=nt===3?1:2,un=nt===1?2:1;tt=rn,Je=un*(2-Fe)}let Dt=(Zt+1)*16,zt=(2-Fe)*((Ct+1)*16);Dt-=(Be+ct)*tt,zt-=(Lt+Ft)*Je;let Bt=Math.ceil(Dt*Xe);return x.destroy(),x=null,{profile_string:be,level_string:Ae,bit_depth:Ut,ref_frames:lt,chroma_format:qe,chroma_format_string:Q.getChromaFormatString(qe),frame_rate:{fixed:De,fps:xt,fps_den:Ge,fps_num:Me},sar_ratio:{width:pn,height:It},codec_size:{width:Dt,height:zt},present_size:{width:Bt,height:zt}}}static _skipScalingList(c,m){let x=8,K=8,ie=0;for(let be=0;be>>8&255|(We&255)<<8}function k(We){return(We&4278190080)>>>24|(We&16711680)>>>8|(We&65280)<<8|(We&255)<<24}function B(We,c){return We[c]<<24|We[c+1]<<16|We[c+2]<<8|We[c+3]}class P{constructor(c,m){this.TAG="FLVDemuxer",this._config=m,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=c.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=c.hasAudioTrack,this._hasVideo=c.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new et,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let x=new ArrayBuffer(2);return new DataView(x).setInt16(0,256,!0),new Int16Array(x)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(c){let m=new Uint8Array(c),x={match:!1};if(m[0]!==70||m[1]!==76||m[2]!==86||m[3]!==1)return x;let K=(m[4]&4)>>>2!==0,ie=(m[4]&1)!==0,be=B(m,5);return be<9?x:{match:!0,consumed:be,dataOffset:be,hasAudioTrack:K,hasVideoTrack:ie}}bindDataSource(c){return c.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(c){this._onTrackMetadata=c}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(c){this._onMediaInfo=c}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(c){this._onMetaDataArrived=c}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(c){this._onScriptDataArrived=c}get onError(){return this._onError}set onError(c){this._onError=c}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(c){this._onDataAvailable=c}get timestampBase(){return this._timestampBase}set timestampBase(c){this._timestampBase=c}get overridedDuration(){return this._duration}set overridedDuration(c){this._durationOverrided=!0,this._duration=c,this._mediaInfo.duration=c}set overridedHasAudio(c){this._hasAudioFlagOverrided=!0,this._hasAudio=c,this._mediaInfo.hasAudio=c}set overridedHasVideo(c){this._hasVideoFlagOverrided=!0,this._hasVideo=c,this._mediaInfo.hasVideo=c}resetMediaInfo(){this._mediaInfo=new et}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(c,m){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new G("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let x=0,K=this._littleEndian;if(m===0)if(c.byteLength>13)x=P.probe(c).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,m+x!==this._dataOffset&&W.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(c,x).getUint32(0,!K)!==0&&W.w(this.TAG,"PrevTagSize0 !== 0 !!!"),x+=4);xc.byteLength)break;let be=ie.getUint8(0),Ae=ie.getUint32(0,!K)&16777215;if(x+11+Ae+4>c.byteLength)break;if(be!==8&&be!==9&&be!==18){W.w(this.TAG,`Unsupported tag type ${be}, skipped`),x+=11+Ae+4;continue}let nt=ie.getUint8(4),qe=ie.getUint8(5),rt=ie.getUint8(6),Ut=ie.getUint8(7),jt=rt|qe<<8|nt<<16|Ut<<24;(ie.getUint32(7,!K)&16777215)!==0&&W.w(this.TAG,"Meet tag which has StreamID != 0!");let Zt=x+11;switch(be){case 8:this._parseAudioData(c,Zt,Ae,jt);break;case 9:this._parseVideoData(c,Zt,Ae,jt,m+x);break;case 18:this._parseScriptData(c,Zt,Ae);break}let Ct=ie.getUint32(11+Ae,!K);Ct!==11+Ae&&W.w(this.TAG,`Invalid PrevTagSize ${Ct}`),x+=11+Ae+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),x}_parseScriptData(c,m,x){let K=At.parseScriptData(c,m,x);if(K.hasOwnProperty("onMetaData")){if(K.onMetaData==null||typeof K.onMetaData!="object"){W.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&W.w(this.TAG,"Found another onMetaData tag!"),this._metadata=K;let ie=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},ie)),typeof ie.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=ie.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof ie.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=ie.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof ie.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=ie.audiodatarate),typeof ie.videodatarate=="number"&&(this._mediaInfo.videoDataRate=ie.videodatarate),typeof ie.width=="number"&&(this._mediaInfo.width=ie.width),typeof ie.height=="number"&&(this._mediaInfo.height=ie.height),typeof ie.duration=="number"){if(!this._durationOverrided){let be=Math.floor(ie.duration*this._timescale);this._duration=be,this._mediaInfo.duration=be}}else this._mediaInfo.duration=0;if(typeof ie.framerate=="number"){let be=Math.floor(ie.framerate*1e3);if(be>0){let Ae=be/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ae,this._referenceFrameRate.fps_num=be,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ae}}if(typeof ie.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let be=ie.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(be),ie.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=ie,W.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(K).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},K))}_parseKeyframesIndex(c){let m=[],x=[];for(let K=1;K>>4;if(nt!==2&&nt!==10){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+nt);return}let qe=0,rt=(Ae&12)>>>2;if(rt>=0&&rt<=4)qe=this._flvSoundRateTable[rt];else{this._onError(M.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+rt);return}let Ut=(Ae&2)>>>1,jt=Ae&1,lt=this._audioMetadata,Zt=this._audioTrack;if(lt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),lt=this._audioMetadata={},lt.type="audio",lt.id=Zt.id,lt.timescale=this._timescale,lt.duration=this._duration,lt.audioSampleRate=qe,lt.channelCount=jt===0?1:2),nt===10){let Ct=this._parseAACAudioData(c,m+1,x-1);if(Ct==null)return;if(Ct.packetType===0){lt.config&&W.w(this.TAG,"Found another AudioSpecificConfig!");let Fe=Ct.data;lt.audioSampleRate=Fe.samplingRate,lt.channelCount=Fe.channelCount,lt.codec=Fe.codec,lt.originalCodec=Fe.originalCodec,lt.config=Fe.config,lt.refSampleDuration=1024/lt.audioSampleRate*lt.timescale,W.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",lt);let Be=this._mediaInfo;Be.audioCodec=lt.originalCodec,Be.audioSampleRate=lt.audioSampleRate,Be.audioChannelCount=lt.channelCount,Be.hasVideo?Be.videoCodec!=null&&(Be.mimeType='video/x-flv; codecs="'+Be.videoCodec+","+Be.audioCodec+'"'):Be.mimeType='video/x-flv; codecs="'+Be.audioCodec+'"',Be.isComplete()&&this._onMediaInfo(Be)}else if(Ct.packetType===1){let Fe=this._timestampBase+K,Be={unit:Ct.data,length:Ct.data.byteLength,dts:Fe,pts:Fe};Zt.samples.push(Be),Zt.length+=Ct.data.length}else W.e(this.TAG,`Flv: Unsupported AAC data type ${Ct.packetType}`)}else if(nt===2){if(!lt.codec){let ct=this._parseMP3AudioData(c,m+1,x-1,!0);if(ct==null)return;lt.audioSampleRate=ct.samplingRate,lt.channelCount=ct.channelCount,lt.codec=ct.codec,lt.originalCodec=ct.originalCodec,lt.refSampleDuration=1152/lt.audioSampleRate*lt.timescale,W.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",lt);let Lt=this._mediaInfo;Lt.audioCodec=lt.codec,Lt.audioSampleRate=lt.audioSampleRate,Lt.audioChannelCount=lt.channelCount,Lt.audioDataRate=ct.bitRate,Lt.hasVideo?Lt.videoCodec!=null&&(Lt.mimeType='video/x-flv; codecs="'+Lt.videoCodec+","+Lt.audioCodec+'"'):Lt.mimeType='video/x-flv; codecs="'+Lt.audioCodec+'"',Lt.isComplete()&&this._onMediaInfo(Lt)}let Ct=this._parseMP3AudioData(c,m+1,x-1,!1);if(Ct==null)return;let Fe=this._timestampBase+K,Be={unit:Ct,length:Ct.byteLength,dts:Fe,pts:Fe};Zt.samples.push(Be),Zt.length+=Ct.length}}_parseAACAudioData(c,m,x){if(x<=1){W.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let K={},ie=new Uint8Array(c,m,x);return K.packetType=ie[0],ie[0]===0?K.data=this._parseAACAudioSpecificConfig(c,m+1,x-1):K.data=ie.subarray(1),K}_parseAACAudioSpecificConfig(c,m,x){let K=new Uint8Array(c,m,x),ie=null,be=0,Ae=0,nt=null,qe=0,rt=null;if(be=Ae=K[0]>>>3,qe=(K[0]&7)<<1|K[1]>>>7,qe<0||qe>=this._mpegSamplingRates.length){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let Ut=this._mpegSamplingRates[qe],jt=(K[1]&120)>>>3;if(jt<0||jt>=8){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}be===5&&(rt=(K[1]&7)<<1|K[2]>>>7,nt=(K[2]&124)>>>2);let lt=self.navigator.userAgent.toLowerCase();return lt.indexOf("firefox")!==-1?qe>=6?(be=5,ie=new Array(4),rt=qe-3):(be=2,ie=new Array(2),rt=qe):lt.indexOf("android")!==-1?(be=2,ie=new Array(2),rt=qe):(be=5,rt=qe,ie=new Array(4),qe>=6?rt=qe-3:jt===1&&(be=2,ie=new Array(2),rt=qe)),ie[0]=be<<3,ie[0]|=(qe&15)>>>1,ie[1]=(qe&15)<<7,ie[1]|=(jt&15)<<3,be===5&&(ie[1]|=(rt&15)>>>1,ie[2]=(rt&1)<<7,ie[2]|=8,ie[3]=0),{config:ie,samplingRate:Ut,channelCount:jt,codec:"mp4a.40."+be,originalCodec:"mp4a.40."+Ae}}_parseMP3AudioData(c,m,x,K){if(x<4){W.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let ie=this._littleEndian,be=new Uint8Array(c,m,x),Ae=null;if(K){if(be[0]!==255)return;let nt=be[1]>>>3&3,qe=(be[1]&6)>>1,rt=(be[2]&240)>>>4,Ut=(be[2]&12)>>>2,lt=(be[3]>>>6&3)!==3?2:1,Zt=0,Ct=0,Fe=34,Be="mp3";switch(nt){case 0:Zt=this._mpegAudioV25SampleRateTable[Ut];break;case 2:Zt=this._mpegAudioV20SampleRateTable[Ut];break;case 3:Zt=this._mpegAudioV10SampleRateTable[Ut];break}switch(qe){case 1:Fe=34,rt>>4,nt=be&15;if(nt!==7){this._onError(M.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${nt}`);return}this._parseAVCVideoPacket(c,m+1,x-1,K,ie,Ae)}_parseAVCVideoPacket(c,m,x,K,ie,be){if(x<4){W.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Ae=this._littleEndian,nt=new DataView(c,m,x),qe=nt.getUint8(0),Ut=(nt.getUint32(0,!Ae)&16777215)<<8>>8;if(qe===0)this._parseAVCDecoderConfigurationRecord(c,m+4,x-4);else if(qe===1)this._parseAVCVideoData(c,m+4,x-4,K,ie,be,Ut);else if(qe!==2){this._onError(M.FORMAT_ERROR,`Flv: Invalid video packet type ${qe}`);return}}_parseAVCDecoderConfigurationRecord(c,m,x){if(x<7){W.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let K=this._videoMetadata,ie=this._videoTrack,be=this._littleEndian,Ae=new DataView(c,m,x);K?typeof K.avcc!="undefined"&&W.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),K=this._videoMetadata={},K.type="video",K.id=ie.id,K.timescale=this._timescale,K.duration=this._duration);let nt=Ae.getUint8(0),qe=Ae.getUint8(1),rt=Ae.getUint8(2),Ut=Ae.getUint8(3);if(nt!==1||qe===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ae.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(M.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let jt=Ae.getUint8(5)&31;if(jt===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else jt>1&&W.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${jt}`);let lt=6;for(let Ct=0;Ct1&&W.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${Zt}`);lt++;for(let Ct=0;Ct=x){W.w(this.TAG,`Malformed Nalu near timestamp ${Zt}, offset = ${jt}, dataSize = ${x}`);break}let Fe=qe.getUint32(jt,!nt);if(lt===3&&(Fe>>>=8),Fe>x-lt){W.w(this.TAG,`Malformed Nalus near timestamp ${Zt}, NaluSize > DataSize!`);return}let Be=qe.getUint8(jt+lt)&31;Be===5&&(Ct=!0);let ct=new Uint8Array(c,m+jt,lt+Fe),Lt={type:Be,data:ct};rt.push(Lt),Ut+=ct.byteLength,jt+=lt+Fe}if(rt.length){let Fe=this._videoTrack,Be={units:rt,length:Ut,isKeyframe:Ct,dts:Zt,cts:Ae,pts:Zt+Ae};Ct&&(Be.fileposition=ie),Fe.samples.push(Be),Fe.length+=Ut}}}var re=P;class N{static init(){N.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let m in N.types)N.types.hasOwnProperty(m)&&(N.types[m]=[m.charCodeAt(0),m.charCodeAt(1),m.charCodeAt(2),m.charCodeAt(3)]);let c=N.constants={};c.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),c.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),c.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSC=c.STCO=c.STTS,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.HDLR_VIDEO=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]),c.HDLR_AUDIO=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]),c.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(c){let m=8,x=null,K=Array.prototype.slice.call(arguments,1),ie=K.length;for(let Ae=0;Ae>>24&255,x[1]=m>>>16&255,x[2]=m>>>8&255,x[3]=m&255,x.set(c,4);let be=8;for(let Ae=0;Ae>>24&255,c>>>16&255,c>>>8&255,c&255,m>>>24&255,m>>>16&255,m>>>8&255,m&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]))}static trak(c){return N.box(N.types.trak,N.tkhd(c),N.mdia(c))}static tkhd(c){let m=c.id,x=c.duration,K=c.presentWidth,ie=c.presentHeight;return N.box(N.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&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,K>>>8&255,K&255,0,0,ie>>>8&255,ie&255,0,0]))}static mdia(c){return N.box(N.types.mdia,N.mdhd(c),N.hdlr(c),N.minf(c))}static mdhd(c){let m=c.timescale,x=c.duration;return N.box(N.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,85,196,0,0]))}static hdlr(c){let m=null;return c.type==="audio"?m=N.constants.HDLR_AUDIO:m=N.constants.HDLR_VIDEO,N.box(N.types.hdlr,m)}static minf(c){let m=null;return c.type==="audio"?m=N.box(N.types.smhd,N.constants.SMHD):m=N.box(N.types.vmhd,N.constants.VMHD),N.box(N.types.minf,m,N.dinf(),N.stbl(c))}static dinf(){return N.box(N.types.dinf,N.box(N.types.dref,N.constants.DREF))}static stbl(c){return N.box(N.types.stbl,N.stsd(c),N.box(N.types.stts,N.constants.STTS),N.box(N.types.stsc,N.constants.STSC),N.box(N.types.stsz,N.constants.STSZ),N.box(N.types.stco,N.constants.STCO))}static stsd(c){return c.type==="audio"?c.codec==="mp3"?N.box(N.types.stsd,N.constants.STSD_PREFIX,N.mp3(c)):N.box(N.types.stsd,N.constants.STSD_PREFIX,N.mp4a(c)):N.box(N.types.stsd,N.constants.STSD_PREFIX,N.avc1(c))}static mp3(c){let m=c.channelCount,x=c.audioSampleRate,K=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return N.box(N.types[".mp3"],K)}static mp4a(c){let m=c.channelCount,x=c.audioSampleRate,K=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return N.box(N.types.mp4a,K,N.esds(c))}static esds(c){let m=c.config||[],x=m.length,K=new Uint8Array([0,0,0,0,3,23+x,0,1,0,4,15+x,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([x]).concat(m).concat([6,1,2]));return N.box(N.types.esds,K)}static avc1(c){let m=c.avcc,x=c.codecWidth,K=c.codecHeight,ie=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,x>>>8&255,x&255,K>>>8&255,K&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return N.box(N.types.avc1,ie,N.box(N.types.avcC,m))}static mvex(c){return N.box(N.types.mvex,N.trex(c))}static trex(c){let m=c.id,x=new Uint8Array([0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return N.box(N.types.trex,x)}static moof(c,m){return N.box(N.types.moof,N.mfhd(c.sequenceNumber),N.traf(c,m))}static mfhd(c){let m=new Uint8Array([0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255]);return N.box(N.types.mfhd,m)}static traf(c,m){let x=c.id,K=N.box(N.types.tfhd,new Uint8Array([0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255])),ie=N.box(N.types.tfdt,new Uint8Array([0,0,0,0,m>>>24&255,m>>>16&255,m>>>8&255,m&255])),be=N.sdtp(c),Ae=N.trun(c,be.byteLength+16+16+8+16+8+8);return N.box(N.types.traf,K,ie,Ae,be)}static sdtp(c){let m=c.samples||[],x=m.length,K=new Uint8Array(4+x);for(let ie=0;ie>>24&255,K>>>16&255,K>>>8&255,K&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255],0);for(let Ae=0;Ae>>24&255,nt>>>16&255,nt>>>8&255,nt&255,qe>>>24&255,qe>>>16&255,qe>>>8&255,qe&255,rt.isLeading<<2|rt.dependsOn,rt.isDependedOn<<6|rt.hasRedundancy<<4|rt.isNonSync,0,0,Ut>>>24&255,Ut>>>16&255,Ut>>>8&255,Ut&255],12+16*Ae)}return N.box(N.types.trun,be)}static mdat(c){return N.box(N.types.mdat,c)}}N.init();var ae=N;class le{static getSilentFrame(c,m){if(c==="mp4a.40.2"){if(m===1)return new Uint8Array([0,200,0,128,35,128]);if(m===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(m===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(m===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(m===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(m===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])}else{if(m===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(m===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(m===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])}return null}}var ge=le;class Ee{constructor(c,m,x,K,ie){this.dts=c,this.pts=m,this.duration=x,this.originalDts=K,this.isSyncPoint=ie,this.fileposition=null}}class Ce{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(c){c.isSyncPoint=!0,this.syncPoints.push(c)}}class Ne{constructor(){this._list=[]}clear(){this._list=[]}appendArray(c){let m=this._list;c.length!==0&&(m.length>0&&c[0].originalDts=m[ie].dts&&cm[K].lastSample.originalDts&&c=m[K].lastSample.originalDts&&(K===m.length-1||K0&&(ie=this._searchNearestSegmentBefore(x.originalBeginDts)+1),this._lastAppendLocation=ie,this._list.splice(ie,0,x)}getLastSegmentBefore(c){let m=this._searchNearestSegmentBefore(c);return m>=0?this._list[m]:null}getLastSampleBefore(c){let m=this.getLastSegmentBefore(c);return m!=null?m.lastSample:null}getLastSyncPointBefore(c){let m=this._searchNearestSegmentBefore(c),x=this._list[m].syncPoints;for(;x.length===0&&m>0;)m--,x=this._list[m].syncPoints;return x.length>0?x[x.length-1]:null}}class Oe{constructor(c){this.TAG="MP4Remuxer",this._config=c,this._isLive=c.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ke("audio"),this._videoSegmentInfoList=new Ke("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661)),this._fillSilentAfterSeek=L.msedge||L.msie,this._mp3UseMpegAudio=!L.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(c){return c.onDataAvailable=this.remux.bind(this),c.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(c){this._onInitSegment=c}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(c){this._onMediaSegment=c}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(c){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(c,m){if(!this._onMediaSegment)throw new G("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(c,m),this._remuxVideo(m),this._remuxAudio(c)}_onTrackMetadataReceived(c,m){let x=null,K="mp4",ie=m.codec;if(c==="audio")this._audioMeta=m,m.codec==="mp3"&&this._mp3UseMpegAudio?(K="mpeg",ie="",x=new Uint8Array):x=ae.generateInitSegment(m);else if(c==="video")this._videoMeta=m,x=ae.generateInitSegment(m);else return;if(!this._onInitSegment)throw new G("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(c,{type:c,data:x.buffer,codec:ie,container:`${c}/${K}`,mediaDuration:m.duration})}_calculateDtsBase(c,m){this._dtsBaseInited||(c.samples&&c.samples.length&&(this._audioDtsBase=c.samples[0].dts),m.samples&&m.samples.length&&(this._videoDtsBase=m.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let c=this._videoStashedLastSample,m=this._audioStashedLastSample,x={type:"video",id:1,sequenceNumber:0,samples:[],length:0};c!=null&&(x.samples.push(c),x.length=c.length);let K={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};m!=null&&(K.samples.push(m),K.length=m.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(x,!0),this._remuxAudio(K,!0)}_remuxAudio(c,m){if(this._audioMeta==null)return;let x=c,K=x.samples,ie,be=-1,Ae=-1,nt=-1,qe=this._audioMeta.refSampleDuration,rt=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Ut=this._dtsBaseInited&&this._audioNextDts===void 0,jt=!1;if(!K||K.length===0||K.length===1&&!m)return;let lt=0,Zt=null,Ct=0;rt?(lt=0,Ct=x.length):(lt=8,Ct=8+x.length);let Fe=null;if(K.length>1&&(Fe=K.pop(),Ct-=Fe.length),this._audioStashedLastSample!=null){let It=this._audioStashedLastSample;this._audioStashedLastSample=null,K.unshift(It),Ct+=It.length}Fe!=null&&(this._audioStashedLastSample=Fe);let Be=K[0].dts-this._dtsBase;if(this._audioNextDts)ie=Be-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())ie=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(jt=!0);else{let It=this._audioSegmentInfoList.getLastSampleBefore(Be);if(It!=null){let xt=Be-(It.originalDts+It.duration);xt<=3&&(xt=0);let De=It.dts+It.duration+xt;ie=Be-De}else ie=0}if(jt){let It=Be-ie,xt=this._videoSegmentInfoList.getLastSegmentBefore(Be);if(xt!=null&&xt.beginDts=1?st=ct[ct.length-1].duration:st=Math.floor(qe);let Xe=!1,tt=null;if(st>qe*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!L.safari){Xe=!0;let Je=Math.abs(st-qe),Dt=Math.ceil(Je/qe),zt=Ge+qe;W.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. dts: ${Ge+st} ms, expected: ${Ge+Math.round(qe)} ms, delta: ${Math.round(Je)} ms, generate: ${Dt} frames`);let Bt=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Bt==null&&(W.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Bt=De),tt=[];for(let un=0;un0){let Jt=tt[tt.length-1];Jt.duration=gn-Jt.dts}let hn={dts:gn,pts:gn,cts:0,unit:Bt,size:Bt.byteLength,duration:0,originalDts:Me,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};tt.push(hn),Ct+=hn.size,zt+=qe}let rn=tt[tt.length-1];rn.duration=Ge+st-rn.dts,st=Math.round(qe)}ct.push({dts:Ge,pts:Ge,cts:0,unit:xt.unit,size:xt.unit.byteLength,duration:st,originalDts:Me,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Xe&&ct.push.apply(ct,tt)}rt?Zt=new Uint8Array(Ct):(Zt=new Uint8Array(Ct),Zt[0]=Ct>>>24&255,Zt[1]=Ct>>>16&255,Zt[2]=Ct>>>8&255,Zt[3]=Ct&255,Zt.set(ae.types.mdat,4));for(let It=0;It1&&(lt=K.pop(),jt-=lt.length),this._videoStashedLastSample!=null){let Lt=this._videoStashedLastSample;this._videoStashedLastSample=null,K.unshift(Lt),jt+=Lt.length}lt!=null&&(this._videoStashedLastSample=lt);let Zt=K[0].dts-this._dtsBase;if(this._videoNextDts)ie=Zt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())ie=0;else{let Lt=this._videoSegmentInfoList.getLastSampleBefore(Zt);if(Lt!=null){let Ft=Zt-(Lt.originalDts+Lt.duration);Ft<=3&&(Ft=0);let dn=Lt.dts+Lt.duration+Ft;ie=Zt-dn}else ie=0}let Ct=new Ce,Fe=[];for(let Lt=0;Lt=1?Me=Fe[Fe.length-1].duration:Me=Math.floor(this._videoMeta.refSampleDuration),pn){let Ge=new Ee(It,De,Me,Ft.dts,!0);Ge.fileposition=Ft.fileposition,Ct.appendSyncPoint(Ge)}Fe.push({dts:It,pts:De,cts:xt,units:Ft.units,size:Ft.length,isKeyframe:pn,duration:Me,originalDts:dn,flags:{isLeading:0,dependsOn:pn?2:1,isDependedOn:pn?1:0,hasRedundancy:0,isNonSync:pn?0:1}})}Ut=new Uint8Array(jt),Ut[0]=jt>>>24&255,Ut[1]=jt>>>16&255,Ut[2]=jt>>>8&255,Ut[3]=jt&255,Ut.set(ae.types.mdat,4);for(let Lt=0;Lt{K.timestampBase=x,x+=K.duration,K.cors=c.cors,K.withCredentials=c.withCredentials,m.referrerPolicy&&(K.referrerPolicy=m.referrerPolicy)}),!isNaN(x)&&this._mediaDataSource.duration!==x&&(this._mediaDataSource.duration=x),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(c,m){this._currentSegmentIndex=c;let x=this._mediaDataSource.segments[c],K=this._ioctl=new z(x,this._config,c);K.onError=this._onIOException.bind(this),K.onSeeked=this._onIOSeeked.bind(this),K.onComplete=this._onIOComplete.bind(this),K.onRedirect=this._onIORedirect.bind(this),K.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),m?this._demuxer.bindDataSource(this._ioctl):K.onDataArrival=this._onInitChunkArrival.bind(this),K.open(m)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(c){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let m=this._searchSegmentIndexContains(c);if(m===this._currentSegmentIndex){let x=this._mediaInfo.segments[m];if(x==null)this._pendingSeekTime=c;else{let K=x.getNearestKeyframe(c);this._remuxer.seek(K.milliseconds),this._ioctl.seek(K.fileposition),this._pendingResolveSeekPoint=K.milliseconds}}else{let x=this._mediaInfo.segments[m];if(x==null)this._pendingSeekTime=c,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(m);else{let K=x.getNearestKeyframe(c);this._internalAbort(),this._remuxer.seek(c),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[m].timestampBase,this._loadSegment(m,K.fileposition),this._pendingResolveSeekPoint=K.milliseconds,this._reportSegmentMediaInfo(m)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(c){let m=this._mediaDataSource.segments,x=m.length-1;for(let K=0;K0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,K=this._demuxer.parseChunks(c,m);else if((x=re.probe(c)).match){this._demuxer=new re(x,this._config),this._remuxer||(this._remuxer=new He(this._config));let ie=this._mediaDataSource;ie.duration!=null&&!isNaN(ie.duration)&&(this._demuxer.overridedDuration=ie.duration),typeof ie.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=ie.hasAudio),typeof ie.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=ie.hasVideo),this._demuxer.timestampBase=ie.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),K=this._demuxer.parseChunks(c,m)}else x=null,W.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Le.DEMUX_ERROR,M.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),K=0;return K}_onMediaInfo(c){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},c),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,et.prototype));let m=Object.assign({},c);Object.setPrototypeOf(m,et.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=m,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let x=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(x)})}_onMetaDataArrived(c){this._emitter.emit(Le.METADATA_ARRIVED,c)}_onScriptDataArrived(c){this._emitter.emit(Le.SCRIPTDATA_ARRIVED,c)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(c){let x=c+1;x0&&x[0].originalDts===K&&(K=x[0].pts),this._emitter.emit(Le.RECOMMEND_SEEKPOINT,K)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(c){let m=this._mediaInfo.segments[c],x=Object.assign({},m);x.duration=this._mediaInfo.duration,x.segmentCount=this._mediaInfo.segmentCount,delete x.segments,delete x.keyframesIndex,this._emitter.emit(Le.MEDIA_INFO,x)}_reportStatisticsInfo(){let c={};c.url=this._ioctl.currentURL,c.hasRedirect=this._ioctl.hasRedirect,c.hasRedirect&&(c.redirectedURL=this._ioctl.currentRedirectedURL),c.speed=this._ioctl.currentSpeed,c.loaderType=this._ioctl.loaderType,c.currentSegmentIndex=this._currentSegmentIndex,c.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.STATISTICS_INFO,c)}}var ft=ut,Qe=function(We){let c="TransmuxingWorker",m=null,x=Ct.bind(this);q.install(),We.addEventListener("message",function(Fe){switch(Fe.data.cmd){case"init":m=new ft(Fe.data.param[0],Fe.data.param[1]),m.on(Le.IO_ERROR,jt.bind(this)),m.on(Le.DEMUX_ERROR,lt.bind(this)),m.on(Le.INIT_SEGMENT,K.bind(this)),m.on(Le.MEDIA_SEGMENT,ie.bind(this)),m.on(Le.LOADING_COMPLETE,be.bind(this)),m.on(Le.RECOVERED_EARLY_EOF,Ae.bind(this)),m.on(Le.MEDIA_INFO,nt.bind(this)),m.on(Le.METADATA_ARRIVED,qe.bind(this)),m.on(Le.SCRIPTDATA_ARRIVED,rt.bind(this)),m.on(Le.STATISTICS_INFO,Ut.bind(this)),m.on(Le.RECOMMEND_SEEKPOINT,Zt.bind(this));break;case"destroy":m&&(m.destroy(),m=null),We.postMessage({msg:"destroyed"});break;case"start":m.start();break;case"stop":m.stop();break;case"seek":m.seek(Fe.data.param);break;case"pause":m.pause();break;case"resume":m.resume();break;case"logging_config":{let Be=Fe.data.param;Re.applyConfig(Be),Be.enableCallback===!0?Re.addLogListener(x):Re.removeLogListener(x);break}}});function K(Fe,Be){let ct={msg:Le.INIT_SEGMENT,data:{type:Fe,data:Be}};We.postMessage(ct,[Be.data])}function ie(Fe,Be){let ct={msg:Le.MEDIA_SEGMENT,data:{type:Fe,data:Be}};We.postMessage(ct,[Be.data])}function be(){let Fe={msg:Le.LOADING_COMPLETE};We.postMessage(Fe)}function Ae(){let Fe={msg:Le.RECOVERED_EARLY_EOF};We.postMessage(Fe)}function nt(Fe){let Be={msg:Le.MEDIA_INFO,data:Fe};We.postMessage(Be)}function qe(Fe){let Be={msg:Le.METADATA_ARRIVED,data:Fe};We.postMessage(Be)}function rt(Fe){let Be={msg:Le.SCRIPTDATA_ARRIVED,data:Fe};We.postMessage(Be)}function Ut(Fe){let Be={msg:Le.STATISTICS_INFO,data:Fe};We.postMessage(Be)}function jt(Fe,Be){We.postMessage({msg:Le.IO_ERROR,data:{type:Fe,info:Be}})}function lt(Fe,Be){We.postMessage({msg:Le.DEMUX_ERROR,data:{type:Fe,info:Be}})}function Zt(Fe){We.postMessage({msg:Le.RECOMMEND_SEEKPOINT,data:Fe})}function Ct(Fe,Be){We.postMessage({msg:"logcat_callback",data:{type:Fe,logcat:Be}})}};class Kt{constructor(c,m){if(this.TAG="Transmuxer",this._emitter=new(fe()),m.enableWorker&&typeof Worker!="undefined")try{let x=b(82059);this._worker=x(Qe),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[c,m]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Re.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Re.getConfig()})}catch(x){W.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ft(c,m)}else this._controller=new ft(c,m);if(this._controller){let x=this._controller;x.on(Le.IO_ERROR,this._onIOError.bind(this)),x.on(Le.DEMUX_ERROR,this._onDemuxError.bind(this)),x.on(Le.INIT_SEGMENT,this._onInitSegment.bind(this)),x.on(Le.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),x.on(Le.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),x.on(Le.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),x.on(Le.MEDIA_INFO,this._onMediaInfo.bind(this)),x.on(Le.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),x.on(Le.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),x.on(Le.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),x.on(Le.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Re.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(c){this._worker?this._worker.postMessage({cmd:"seek",param:c}):this._controller.seek(c)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(c,m){Promise.resolve().then(()=>{this._emitter.emit(Le.INIT_SEGMENT,c,m)})}_onMediaSegment(c,m){Promise.resolve().then(()=>{this._emitter.emit(Le.MEDIA_SEGMENT,c,m)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Le.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Le.RECOVERED_EARLY_EOF)})}_onMediaInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Le.MEDIA_INFO,c)})}_onMetaDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Le.METADATA_ARRIVED,c)})}_onScriptDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Le.SCRIPTDATA_ARRIVED,c)})}_onStatisticsInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Le.STATISTICS_INFO,c)})}_onIOError(c,m){Promise.resolve().then(()=>{this._emitter.emit(Le.IO_ERROR,c,m)})}_onDemuxError(c,m){Promise.resolve().then(()=>{this._emitter.emit(Le.DEMUX_ERROR,c,m)})}_onRecommendSeekpoint(c){Promise.resolve().then(()=>{this._emitter.emit(Le.RECOMMEND_SEEKPOINT,c)})}_onLoggingConfigChanged(c){this._worker&&this._worker.postMessage({cmd:"logging_config",param:c})}_onWorkerMessage(c){let m=c.data,x=m.data;if(m.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(m.msg){case Le.INIT_SEGMENT:case Le.MEDIA_SEGMENT:this._emitter.emit(m.msg,x.type,x.data);break;case Le.LOADING_COMPLETE:case Le.RECOVERED_EARLY_EOF:this._emitter.emit(m.msg);break;case Le.MEDIA_INFO:Object.setPrototypeOf(x,et.prototype),this._emitter.emit(m.msg,x);break;case Le.METADATA_ARRIVED:case Le.SCRIPTDATA_ARRIVED:case Le.STATISTICS_INFO:this._emitter.emit(m.msg,x);break;case Le.IO_ERROR:case Le.DEMUX_ERROR:this._emitter.emit(m.msg,x.type,x.info);break;case Le.RECOMMEND_SEEKPOINT:this._emitter.emit(m.msg,x);break;case"logcat_callback":W.emitter.emit("log",x.type,x.logcat);break;default:break}}}var Wt=Kt,Mt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class pt{constructor(c){this.TAG="MSEController",this._config=c,this._emitter=new(fe()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Ne}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,m){this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaSource)throw new G("MediaSource has been attached to an HTMLMediaElement!");let m=this._mediaSource=new window.MediaSource;m.addEventListener("sourceopen",this.e.onSourceOpen),m.addEventListener("sourceended",this.e.onSourceEnded),m.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=c,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),c.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let c=this._mediaSource;for(let m in this._sourceBuffers){let x=this._pendingSegments[m];x.splice(0,x.length),this._pendingSegments[m]=null,this._pendingRemoveRanges[m]=null,this._lastInitSegments[m]=null;let K=this._sourceBuffers[m];if(K){if(c.readyState!=="closed"){try{c.removeSourceBuffer(K)}catch(ie){W.e(this.TAG,ie.message)}K.removeEventListener("error",this.e.onSourceBufferError),K.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[m]=null,this._sourceBuffers[m]=null}}if(c.readyState==="open")try{c.endOfStream()}catch(m){W.e(this.TAG,m.message)}c.removeEventListener("sourceopen",this.e.onSourceOpen),c.removeEventListener("sourceended",this.e.onSourceEnded),c.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(c,m){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(c),this._pendingSegments[c.type].push(c);return}let x=c,K=`${x.container}`;x.codec&&x.codec.length>0&&(K+=`;codecs=${x.codec}`);let ie=!1;if(W.v(this.TAG,"Received Initialization Segment, mimeType: "+K),this._lastInitSegments[x.type]=x,K!==this._mimeTypes[x.type]){if(this._mimeTypes[x.type])W.v(this.TAG,`Notice: ${x.type} mimeType changed, origin: ${this._mimeTypes[x.type]}, target: ${K}`);else{ie=!0;try{let be=this._sourceBuffers[x.type]=this._mediaSource.addSourceBuffer(K);be.addEventListener("error",this.e.onSourceBufferError),be.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(be){W.e(this.TAG,be.message),this._emitter.emit(Mt.ERROR,{code:be.code,msg:be.message});return}}this._mimeTypes[x.type]=K}m||this._pendingSegments[x.type].push(x),ie||this._sourceBuffers[x.type]&&!this._sourceBuffers[x.type].updating&&this._doAppendSegments(),L.safari&&x.container==="audio/mpeg"&&x.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=x.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(c){let m=c;this._pendingSegments[m.type].push(m),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let x=this._sourceBuffers[m.type];x&&!x.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(c){for(let m in this._sourceBuffers){if(!this._sourceBuffers[m])continue;let x=this._sourceBuffers[m];if(this._mediaSource.readyState==="open")try{x.abort()}catch(ie){W.e(this.TAG,ie.message)}this._idrList.clear();let K=this._pendingSegments[m];if(K.splice(0,K.length),this._mediaSource.readyState!=="closed"){for(let ie=0;ie=1&&c-K.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let c=this._mediaElement.currentTime;for(let m in this._sourceBuffers){let x=this._sourceBuffers[m];if(x){let K=x.buffered,ie=!1;for(let be=0;be=this._config.autoCleanupMaxBackwardDuration){ie=!0;let qe=c-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[m].push({start:Ae,end:qe})}}else nt0&&(isNaN(m)||x>m)&&(W.v(this.TAG,`Update MediaSource duration from ${m} to ${x}`),this._mediaSource.duration=x),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let c in this._pendingRemoveRanges){if(!this._sourceBuffers[c]||this._sourceBuffers[c].updating)continue;let m=this._sourceBuffers[c],x=this._pendingRemoveRanges[c];for(;x.length&&!m.updating;){let K=x.shift();m.remove(K.start,K.end)}}}_doAppendSegments(){let c=this._pendingSegments;for(let m in c)if(!(!this._sourceBuffers[m]||this._sourceBuffers[m].updating)&&c[m].length>0){let x=c[m].shift();if(x.timestampOffset){let K=this._sourceBuffers[m].timestampOffset,ie=x.timestampOffset/1e3;Math.abs(K-ie)>.1&&(W.v(this.TAG,`Update MPEG audio timestampOffset from ${K} to ${ie}`),this._sourceBuffers[m].timestampOffset=ie),delete x.timestampOffset}if(!x.data||x.data.byteLength===0)continue;try{this._sourceBuffers[m].appendBuffer(x.data),this._isBufferFull=!1,m==="video"&&x.hasOwnProperty("info")&&this._idrList.appendArray(x.info.syncPoints)}catch(K){this._pendingSegments[m].unshift(x),K.code===22?(this._isBufferFull||this._emitter.emit(Mt.BUFFER_FULL),this._isBufferFull=!0):(W.e(this.TAG,K.message),this._emitter.emit(Mt.ERROR,{code:K.code,msg:K.message}))}}}_onSourceOpen(){if(W.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let c=this._pendingSourceBufferInit;for(;c.length;){let m=c.shift();this.appendInitSegment(m,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Mt.SOURCE_OPEN)}_onSourceEnded(){W.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){W.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let c=this._pendingSegments;return c.video.length>0||c.audio.length>0}_hasPendingRemoveRanges(){let c=this._pendingRemoveRanges;return c.video.length>0||c.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Mt.UPDATE_END)}_onSourceBufferError(c){W.e(this.TAG,`SourceBuffer Error: ${c}`)}}var ht=pt;const mt={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Tt={NETWORK_EXCEPTION:g.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.CODEC_UNSUPPORTED};class Et{constructor(c,m){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(fe()),this._config=v(),typeof m=="object"&&Object.assign(this._config,m),c.type.toLowerCase()!=="flv")throw new D("FlvPlayer requires an flv MediaDataSource input!");c.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=c,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let x=L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661);this._alwaysSeekKeyframe=!!(x||L.msedge||L.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,m){c===me.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),c.addEventListener("seeking",this.e.onvSeeking),c.addEventListener("canplay",this.e.onvCanPlay),c.addEventListener("stalled",this.e.onvStalled),c.addEventListener("progress",this.e.onvProgress),this._msectl=new ht(this._config),this._msectl.on(Mt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Mt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Mt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Mt.ERROR,m=>{this._emitter.emit(me.ERROR,mt.MEDIA_ERROR,Tt.MEDIA_MSE_ERROR,m)}),this._msectl.attachMediaElement(c),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(m){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new G("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new G("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Wt(this._mediaDataSource,this._config),this._transmuxer.on(Le.INIT_SEGMENT,(c,m)=>{this._msectl.appendInitSegment(m)}),this._transmuxer.on(Le.MEDIA_SEGMENT,(c,m)=>{if(this._msectl.appendMediaSegment(m),this._config.lazyLoad&&!this._config.isLive){let x=this._mediaElement.currentTime;m.info.endDts>=(x+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(W.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Le.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(me.LOADING_COMPLETE)}),this._transmuxer.on(Le.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(me.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Le.IO_ERROR,(c,m)=>{this._emitter.emit(me.ERROR,mt.NETWORK_ERROR,c,m)}),this._transmuxer.on(Le.DEMUX_ERROR,(c,m)=>{this._emitter.emit(me.ERROR,mt.MEDIA_ERROR,c,{code:-1,msg:m})}),this._transmuxer.on(Le.MEDIA_INFO,c=>{this._mediaInfo=c,this._emitter.emit(me.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(Le.METADATA_ARRIVED,c=>{this._emitter.emit(me.METADATA_ARRIVED,c)}),this._transmuxer.on(Le.SCRIPTDATA_ARRIVED,c=>{this._emitter.emit(me.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(Le.STATISTICS_INFO,c=>{this._statisticsInfo=this._fillStatisticsInfo(c),this._emitter.emit(me.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Le.RECOMMEND_SEEKPOINT,c=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._internalSeek(c):this._pendingSeekTime=c}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(c){if(c.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return c;let m=!0,x=0,K=0;if(this._mediaElement.getVideoPlaybackQuality){let ie=this._mediaElement.getVideoPlaybackQuality();x=ie.totalVideoFrames,K=ie.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,K=this._mediaElement.webkitDroppedFrameCount):m=!1;return m&&(c.decodedFrames=x,c.droppedFrames=K),c}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let c=this._mediaElement.buffered,m=this._mediaElement.currentTime,x=0,K=0;for(let ie=0;ie=m+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(W.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){W.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let c=this._mediaElement.currentTime,m=this._mediaElement.buffered,x=!1;for(let K=0;K=ie&&c=be-this._config.lazyLoadRecoverDuration&&(x=!0);break}}x&&(window.clearInterval(this._progressChecker),this._progressChecker=null,x&&(W.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(c){let m=this._mediaElement.buffered;for(let x=0;x=K&&c0){let ie=this._mediaElement.buffered.start(0);(ie<1&&c0&&m.currentTime0){let K=x.start(0);if(K<1&&m{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,m)}off(c,m){this._emitter.removeListener(c,m)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(m){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new G("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._mediaElement.currentTime=c:this._pendingSeekTime=c}get mediaInfo(){let m={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(m.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(m.width=this._mediaElement.videoWidth,m.height=this._mediaElement.videoHeight)),m}get statisticsInfo(){let c={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return c;let m=!0,x=0,K=0;if(this._mediaElement.getVideoPlaybackQuality){let ie=this._mediaElement.getVideoPlaybackQuality();x=ie.totalVideoFrames,K=ie.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,K=this._mediaElement.webkitDroppedFrameCount):m=!1;return m&&(c.decodedFrames=x,c.droppedFrames=K),c}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}}var an=Xt;q.install();function Qt(We,c){let m=We;if(m==null||typeof m!="object")throw new D("MediaDataSource must be an javascript object!");if(!m.hasOwnProperty("type"))throw new D("MediaDataSource must has type field to indicate video file type!");switch(m.type){case"flv":return new kt(m,c);default:return new an(m,c)}}function cn(){return $.supportMSEH264Playback()}function Ht(){return $.getFeatureList()}let Vt={};Vt.createPlayer=Qt,Vt.isSupported=cn,Vt.getFeatureList=Ht,Vt.BaseLoader=p,Vt.LoaderStatus=u,Vt.LoaderErrors=g,Vt.Events=me,Vt.ErrorTypes=mt,Vt.ErrorDetails=Tt,Vt.FlvPlayer=kt,Vt.NativePlayer=an,Vt.LoggingControl=Re,Object.defineProperty(Vt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var _t=Vt},36785:function(yt,Pe,b){"use strict";b.d(Pe,{o2:function(){return oe},yT:function(){return W}});var F=b(19127),q=b(33166);const ve=q.i.map(_e=>`${_e}-inverse`),fe=["success","processing","error","default","warning"];function oe(_e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,F.Z)(ve),(0,F.Z)(q.i)).includes(_e):q.i.includes(_e)}function W(_e){return fe.includes(_e)}},79676:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return W}});var F=b(19447);function q(_e,ue,o,G){if(G===!1)return{adjustX:!1,adjustY:!1};const D=G&&typeof G=="object"?G:{},f={};switch(_e){case"top":case"bottom":f.shiftX=ue.dropdownArrowOffset*2+o;break;case"left":case"right":f.shiftY=ue.dropdownArrowOffsetVertical*2+o;break}const u=Object.assign(Object.assign({},f),D);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ve={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},fe={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},oe=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function W(_e){const{arrowWidth:ue,autoAdjustOverflow:o,arrowPointAtCenter:G,offset:D,borderRadius:f,visibleFirst:u}=_e,g=ue/2,p={};return Object.keys(ve).forEach(I=>{const H=G&&fe[I]||ve[I],L=Object.assign(Object.assign({},H),{offset:[0,0]});switch(p[I]=L,oe.has(I)&&(L.autoArrow=!1),I){case"top":case"topLeft":case"topRight":L.offset[1]=-g-D;break;case"bottom":case"bottomLeft":case"bottomRight":L.offset[1]=g+D;break;case"left":case"leftTop":case"leftBottom":L.offset[0]=-g-D;break;case"right":case"rightTop":case"rightBottom":L.offset[0]=g+D;break}const w=(0,F.fS)({contentRadius:f,limitVerticalRadius:!0});if(G)switch(I){case"topLeft":case"bottomLeft":L.offset[0]=-w.dropdownArrowOffset-g;break;case"topRight":case"bottomRight":L.offset[0]=w.dropdownArrowOffset+g;break;case"leftTop":case"rightTop":L.offset[1]=-w.dropdownArrowOffset-g;break;case"leftBottom":case"rightBottom":L.offset[1]=w.dropdownArrowOffset+g;break}L.overflow=q(I,w,ue,o),u&&(L.htmlRegion="visibleFirst")}),p}},98447:function(yt,Pe,b){"use strict";b.d(Pe,{C2:function(){return oe}});var F=b(17313),q=b(37613),ve=b(83116);const fe=W=>{const{checkboxCls:_e}=W,ue=`${_e}-wrapper`;return[{[`${_e}-group`]:Object.assign(Object.assign({},(0,F.Wf)(W)),{display:"inline-flex",flexWrap:"wrap",columnGap:W.marginXS,[`> ${W.antCls}-row`]:{flex:1}}),[ue]:Object.assign(Object.assign({},(0,F.Wf)(W)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${ue}`]:{marginInlineStart:0},[`&${ue}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[_e]:Object.assign(Object.assign({},(0,F.Wf)(W)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:W.borderRadiusSM,alignSelf:"center",[`${_e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${_e}-inner`]:Object.assign({},(0,F.oN)(W))},[`${_e}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:W.checkboxSize,height:W.checkboxSize,direction:"ltr",backgroundColor:W.colorBgContainer,border:`${W.lineWidth}px ${W.lineType} ${W.colorBorder}`,borderRadius:W.borderRadiusSM,borderCollapse:"separate",transition:`all ${W.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:W.checkboxSize/14*5,height:W.checkboxSize/14*8,border:`${W.lineWidthBold}px solid ${W.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${W.motionDurationFast} ${W.motionEaseInBack}, opacity ${W.motionDurationFast}`}},"& + span":{paddingInlineStart:W.paddingXS,paddingInlineEnd:W.paddingXS}})},{[` ${ue}:not(${ue}-disabled), ${_e}:not(${_e}-disabled) `]:{[`&:hover ${_e}-inner`]:{borderColor:W.colorPrimary}},[`${ue}:not(${ue}-disabled)`]:{[`&:hover ${_e}-checked:not(${_e}-disabled) ${_e}-inner`]:{backgroundColor:W.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${_e}-checked:not(${_e}-disabled):after`]:{borderColor:W.colorPrimaryHover}}},{[`${_e}-checked`]:{[`${_e}-inner`]:{backgroundColor:W.colorPrimary,borderColor:W.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${W.motionDurationMid} ${W.motionEaseOutBack} ${W.motionDurationFast}`}}},[` ${ue}-checked:not(${ue}-disabled), ${_e}-checked:not(${_e}-disabled) `]:{[`&:hover ${_e}-inner`]:{backgroundColor:W.colorPrimaryHover,borderColor:"transparent"}}},{[_e]:{"&-indeterminate":{[`${_e}-inner`]:{backgroundColor:W.colorBgContainer,borderColor:W.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:W.fontSizeLG/2,height:W.fontSizeLG/2,backgroundColor:W.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${ue}-disabled`]:{cursor:"not-allowed"},[`${_e}-disabled`]:{[`&, ${_e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${_e}-inner`]:{background:W.colorBgContainerDisabled,borderColor:W.colorBorder,"&:after":{borderColor:W.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:W.colorTextDisabled},[`&${_e}-indeterminate ${_e}-inner::after`]:{background:W.colorTextDisabled}}}]};function oe(W,_e){const ue=(0,q.TS)(_e,{checkboxCls:`.${W}`,checkboxSize:_e.controlInteractiveSize});return[fe(ue)]}Pe.ZP=(0,ve.Z)("Checkbox",(W,_e)=>{let{prefixCls:ue}=_e;return[oe(ue,W)]})},91857:function(yt,Pe,b){"use strict";var F=b(59301),q=b(38819),ve=b(92310),fe=b.n(ve),oe=b(31561),W=b(70425),_e=b(18929),ue=b(2738),o=b(79676),G=b(53487),D=b(92343),f=b(36355),u=b(20834),g=b(40875),p=b(88088),I=b(47211);const H=null,L=E=>{const{menu:J,arrow:te,prefixCls:ne,children:ye,trigger:we,disabled:Se,dropdownRender:he,getPopupContainer:V,overlayClassName:T,rootClassName:C,open:R,onOpenChange:z,visible:Z,onVisibleChange:v,mouseEnterDelay:y=.15,mouseLeaveDelay:$=.1,autoAdjustOverflow:j=!0,placement:me="",overlay:xe,transitionName:Re}=E,{getPopupContainer:Ie,getPrefixCls:et,direction:ot}=F.useContext(f.E_),Ve=F.useMemo(()=>{const ae=et();return Re!==void 0?Re:me.includes("top")?`${ae}-slide-down`:`${ae}-slide-up`},[et,me,Re]),Rt=F.useMemo(()=>me?me.includes("Center")?me.slice(0,me.indexOf("Center")):me:ot==="rtl"?"bottomRight":"bottomLeft",[me,ot]),dt=et("dropdown",ne),[St,At]=(0,I.Z)(dt),[,ke]=(0,p.Z)(),Ye=F.Children.only(ye),Q=(0,D.Tm)(Ye,{className:fe()(`${dt}-trigger`,{[`${dt}-rtl`]:ot==="rtl"},Ye.props.className),disabled:Se}),ce=Se?[]:we;let Y;ce&&ce.includes("contextMenu")&&(Y=!0);const[M,pe]=(0,_e.Z)(!1,{value:R!=null?R:Z}),k=(0,W.useEvent)(ae=>{z==null||z(ae),v==null||v(ae),pe(ae)}),B=fe()(T,C,At,{[`${dt}-rtl`]:ot==="rtl"}),P=(0,o.Z)({arrowPointAtCenter:typeof te=="object"&&te.pointAtCenter,autoAdjustOverflow:j,offset:ke.marginXXS,arrowWidth:te?ke.sizePopupArrow:0,borderRadius:ke.borderRadius}),re=F.useCallback(()=>{pe(!1)},[]),N=()=>{let ae;return J!=null&&J.items?ae=F.createElement(u.default,Object.assign({},J)):typeof xe=="function"?ae=xe():ae=xe,he&&(ae=he(ae)),ae=F.Children.only(typeof ae=="string"?F.createElement("span",null,ae):ae),F.createElement(g.J,{prefixCls:`${dt}-menu`,expandIcon:F.createElement("span",{className:`${dt}-menu-submenu-arrow`},F.createElement(q.Z,{className:`${dt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:re,validator:le=>{let{mode:ge}=le}},ae)};return St(F.createElement(oe.Z,Object.assign({alignPoint:Y},(0,ue.Z)(E,["rootClassName"]),{mouseEnterDelay:y,mouseLeaveDelay:$,visible:M,builtinPlacements:P,arrow:!!te,overlayClassName:B,prefixCls:dt,getPopupContainer:V||Ie,transitionName:Ve,trigger:ce,overlay:N,placement:Rt,onVisibleChange:k}),Q))};function w(E){return Object.assign(Object.assign({},E),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const O=(0,G.Z)(L,"dropdown",E=>E,w),A=E=>F.createElement(O,Object.assign({},E),F.createElement("span",null));L._InternalPanelDoNotUseOrYouWillBeFired=A,Pe.Z=L},38854:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return p}});var F=b(91857),q=b(92310),ve=b.n(q),fe=b(59301),oe=b(18785),W=b(3113),_e=b(36355),ue=b(81327),o=b(33234),G=b(47211),D=function(I,H){var L={};for(var w in I)Object.prototype.hasOwnProperty.call(I,w)&&H.indexOf(w)<0&&(L[w]=I[w]);if(I!=null&&typeof Object.getOwnPropertySymbols=="function")for(var O=0,w=Object.getOwnPropertySymbols(I);O{const{getPopupContainer:H,getPrefixCls:L,direction:w}=fe.useContext(_e.E_),{prefixCls:O,type:A="default",danger:E,disabled:J,loading:te,onClick:ne,htmlType:ye,children:we,className:Se,menu:he,arrow:V,autoFocus:T,overlay:C,trigger:R,align:z,open:Z,onOpenChange:v,placement:y,getPopupContainer:$,href:j,icon:me=fe.createElement(oe.Z,null),title:xe,buttonsRender:Re=N=>N,mouseEnterDelay:Ie,mouseLeaveDelay:et,overlayClassName:ot,overlayStyle:Ve,destroyPopupOnHide:Rt,dropdownRender:dt}=I,St=D(I,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),At=L("dropdown",O),ke=`${At}-button`,[Ye,Q]=(0,G.Z)(At),ce={menu:he,arrow:V,autoFocus:T,align:z,disabled:J,trigger:J?[]:R,onOpenChange:v,getPopupContainer:$||H,mouseEnterDelay:Ie,mouseLeaveDelay:et,overlayClassName:ot,overlayStyle:Ve,destroyPopupOnHide:Rt,dropdownRender:dt},{compactSize:Y,compactItemClassnames:M}=(0,o.ri)(At,w),pe=ve()(ke,M,Se,Q);"overlay"in I&&(ce.overlay=C),"open"in I&&(ce.open=Z),"placement"in I?ce.placement=y:ce.placement=w==="rtl"?"bottomLeft":"bottomRight";const k=fe.createElement(W.ZP,{type:A,danger:E,disabled:J,loading:te,onClick:ne,htmlType:ye,href:j,title:xe},we),B=fe.createElement(W.ZP,{type:A,danger:E,icon:me}),[P,re]=Re([k,B]);return Ye(fe.createElement(ue.Z.Compact,Object.assign({className:pe,size:Y,block:!0},St),P,fe.createElement(F.Z,Object.assign({},ce),re)))};f.__ANT_BUTTON=!0;var u=f;const g=F.Z;g.Button=u;var p=g},47211:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return D}});var F=b(17313),q=b(13826),ve=b(92899),fe=b(29878),oe=b(19447),W=b(83116),_e=b(37613),o=f=>{const{componentCls:u,menuCls:g,colorError:p,colorTextLightSolid:I}=f,H=`${g}-item`;return{[`${u}, ${u}-menu-submenu`]:{[`${g} ${H}`]:{[`&${H}-danger:not(${H}-disabled)`]:{color:p,"&:hover":{color:I,backgroundColor:p}}}}}};const G=f=>{const{componentCls:u,menuCls:g,zIndexPopup:p,dropdownArrowDistance:I,sizePopupArrow:H,antCls:L,iconCls:w,motionDurationMid:O,dropdownPaddingVertical:A,fontSize:E,dropdownEdgeChildPadding:J,colorTextDisabled:te,fontSizeIcon:ne,controlPaddingHorizontal:ye,colorBgElevated:we}=f;return[{[u]:Object.assign(Object.assign({},(0,F.Wf)(f)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:p,display:"block","&::before":{position:"absolute",insetBlock:-I+H/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${L}-btn`]:{[`& > ${w}-down, & > ${L}-btn-icon > ${w}-down`]:{fontSize:ne}},[`${u}-wrap`]:{position:"relative",[`${L}-btn > ${w}-down`]:{fontSize:ne},[`${w}-down::before`]:{transition:`transform ${O}`}},[`${u}-wrap-open`]:{[`${w}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomLeft, &${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomLeft, &${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottom, &${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottom, &${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomRight, &${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomRight`]:{animationName:q.fJ},[`&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topLeft, &${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topLeft, &${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-top, &${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-top, &${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topRight, &${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topRight`]:{animationName:q.Qt},[`&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomLeft, &${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottom, &${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomRight`]:{animationName:q.Uw},[`&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topLeft, &${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-top, &${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topRight`]:{animationName:q.ly}})},(0,oe.ZP)(f,{colorBg:we,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${u} ${g}`]:{position:"relative",margin:0},[`${g}-submenu-popup`]:{position:"absolute",zIndex:p,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${u}, ${u}-menu-submenu`]:{[g]:Object.assign(Object.assign({padding:J,listStyleType:"none",backgroundColor:we,backgroundClip:"padding-box",borderRadius:f.borderRadiusLG,outline:"none",boxShadow:f.boxShadowSecondary},(0,F.Qy)(f)),{[`${g}-item-group-title`]:{padding:`${A}px ${ye}px`,color:f.colorTextDescription,transition:`all ${O}`},[`${g}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${g}-item-icon`]:{minWidth:E,marginInlineEnd:f.marginXS,fontSize:f.fontSizeSM},[`${g}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${O}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${g}-item, ${g}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${A}px ${ye}px`,color:f.colorText,fontWeight:"normal",fontSize:E,lineHeight:f.lineHeight,cursor:"pointer",transition:`all ${O}`,borderRadius:f.borderRadiusSM,"&:hover, &-active":{backgroundColor:f.controlItemBgHover}},(0,F.Qy)(f)),{"&-selected":{color:f.colorPrimary,backgroundColor:f.controlItemBgActive,"&:hover, &-active":{backgroundColor:f.controlItemBgActiveHover}},"&-disabled":{color:te,cursor:"not-allowed","&:hover":{color:te,backgroundColor:we,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${f.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:f.colorSplit},[`${u}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:f.paddingXS,[`${u}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:f.colorTextDescription,fontSize:ne,fontStyle:"normal"}}}),[`${g}-item-group-list`]:{margin:`0 ${f.marginXS}px`,padding:0,listStyle:"none"},[`${g}-submenu-title`]:{paddingInlineEnd:ye+f.fontSizeSM},[`${g}-submenu-vertical`]:{position:"relative"},[`${g}-submenu${g}-submenu-disabled ${u}-menu-submenu-title`]:{[`&, ${u}-menu-submenu-arrow-icon`]:{color:te,backgroundColor:we,cursor:"not-allowed"}},[`${g}-submenu-selected ${u}-menu-submenu-title`]:{color:f.colorPrimary}})}},[(0,q.oN)(f,"slide-up"),(0,q.oN)(f,"slide-down"),(0,ve.Fm)(f,"move-up"),(0,ve.Fm)(f,"move-down"),(0,fe._y)(f,"zoom-big")]]};var D=(0,W.Z)("Dropdown",(f,u)=>{let{rootPrefixCls:g}=u;const{marginXXS:p,sizePopupArrow:I,controlHeight:H,fontSize:L,lineHeight:w,paddingXXS:O,componentCls:A,borderRadiusLG:E}=f,J=(H-L*w)/2,{dropdownArrowOffset:te}=(0,oe.fS)({contentRadius:E}),ne=(0,_e.TS)(f,{menuCls:`${A}-menu`,rootPrefixCls:g,dropdownArrowDistance:I/2+p,dropdownArrowOffset:te,dropdownPaddingVertical:J,dropdownEdgeChildPadding:O});return[G(ne),o(ne)]},f=>({zIndexPopup:f.zIndexPopupBase+50}))},64165:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return O}});var F=b(92310),q=b.n(F),ve=b(59301),fe=b(36355),oe=b(9763),W=b(64993),_e=b(88088),o=()=>{const[,A]=(0,_e.Z)(),J=new W.C(A.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return ve.createElement("svg",{style:J,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{fill:"none",fillRule:"evenodd"},ve.createElement("g",{transform:"translate(24 31.67)"},ve.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),ve.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),ve.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),ve.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),ve.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),ve.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),ve.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},ve.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),ve.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},D=()=>{const[,A]=(0,_e.Z)(),{colorFill:E,colorFillTertiary:J,colorFillQuaternary:te,colorBgContainer:ne}=A,{borderColor:ye,shadowColor:we,contentColor:Se}=(0,ve.useMemo)(()=>({borderColor:new W.C(E).onBackground(ne).toHexShortString(),shadowColor:new W.C(J).onBackground(ne).toHexShortString(),contentColor:new W.C(te).onBackground(ne).toHexShortString()}),[E,J,te,ne]);return ve.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},ve.createElement("ellipse",{fill:we,cx:"32",cy:"33",rx:"32",ry:"7"}),ve.createElement("g",{fillRule:"nonzero",stroke:ye},ve.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),ve.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Se}))))},f=b(83116),u=b(37613);const g=A=>{const{componentCls:E,margin:J,marginXS:te,marginXL:ne,fontSize:ye,lineHeight:we}=A;return{[E]:{marginInline:te,fontSize:ye,lineHeight:we,textAlign:"center",[`${E}-image`]:{height:A.emptyImgHeight,marginBottom:te,opacity:A.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${E}-description`]:{color:A.colorText},[`${E}-footer`]:{marginTop:J},"&-normal":{marginBlock:ne,color:A.colorTextDisabled,[`${E}-description`]:{color:A.colorTextDisabled},[`${E}-image`]:{height:A.emptyImgHeightMD}},"&-small":{marginBlock:te,color:A.colorTextDisabled,[`${E}-image`]:{height:A.emptyImgHeightSM}}}}};var p=(0,f.Z)("Empty",A=>{const{componentCls:E,controlHeightLG:J}=A,te=(0,u.TS)(A,{emptyImgCls:`${E}-img`,emptyImgHeight:J*2.5,emptyImgHeightMD:J,emptyImgHeightSM:J*.875});return[g(te)]}),I=function(A,E){var J={};for(var te in A)Object.prototype.hasOwnProperty.call(A,te)&&E.indexOf(te)<0&&(J[te]=A[te]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ne=0,te=Object.getOwnPropertySymbols(A);ne{var{className:E,rootClassName:J,prefixCls:te,image:ne=H,description:ye,children:we,imageStyle:Se,style:he}=A,V=I(A,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:T,direction:C,empty:R}=ve.useContext(fe.E_),z=T("empty",te),[Z,v]=p(z),[y]=(0,oe.Z)("Empty"),$=typeof ye!="undefined"?ye:y==null?void 0:y.description,j=typeof $=="string"?$:"empty";let me=null;return typeof ne=="string"?me=ve.createElement("img",{alt:j,src:ne}):me=ne,Z(ve.createElement("div",Object.assign({className:q()(v,z,R==null?void 0:R.className,{[`${z}-normal`]:ne===L,[`${z}-rtl`]:C==="rtl"},E,J),style:Object.assign(Object.assign({},R==null?void 0:R.style),he)},V),ve.createElement("div",{className:`${z}-image`,style:Se},me),$&&ve.createElement("div",{className:`${z}-description`},$),we&&ve.createElement("div",{className:`${z}-footer`},we)))};w.PRESENTED_IMAGE_DEFAULT=H,w.PRESENTED_IMAGE_SIMPLE=L;var O=w},45818:function(yt,Pe,b){"use strict";b.d(Pe,{D:function(){return O},Z:function(){return J}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},fe=ve,oe=b(7657),W=function(ne,ye){return q.createElement(oe.Z,(0,F.Z)({},ne,{ref:ye,icon:fe}))},_e=q.forwardRef(W),ue=_e,o=b(33853),G=b(38819),D=b(92310),f=b.n(D),u=b(2738),p=te=>!isNaN(parseFloat(te))&&isFinite(te),I=b(36355),H=b(84966),L=function(te,ne){var ye={};for(var we in te)Object.prototype.hasOwnProperty.call(te,we)&&ne.indexOf(we)<0&&(ye[we]=te[we]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,we=Object.getOwnPropertySymbols(te);Se{let te=0;return function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return te+=1,`${ne}${te}`}})();var J=q.forwardRef((te,ne)=>{const{prefixCls:ye,className:we,trigger:Se,children:he,defaultCollapsed:V=!1,theme:T="dark",style:C={},collapsible:R=!1,reverseArrow:z=!1,width:Z=200,collapsedWidth:v=80,zeroWidthTriggerStyle:y,breakpoint:$,onCollapse:j,onBreakpoint:me}=te,xe=L(te,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Re}=(0,q.useContext)(H.Gs),[Ie,et]=(0,q.useState)("collapsed"in te?te.collapsed:V),[ot,Ve]=(0,q.useState)(!1);(0,q.useEffect)(()=>{"collapsed"in te&&et(te.collapsed)},[te.collapsed]);const Rt=(Q,ce)=>{"collapsed"in te||et(Q),j==null||j(Q,ce)},dt=(0,q.useRef)();dt.current=Q=>{Ve(Q.matches),me==null||me(Q.matches),Ie!==Q.matches&&Rt(Q.matches,"responsive")},(0,q.useEffect)(()=>{function Q(Y){return dt.current(Y)}let ce;if(typeof window!="undefined"){const{matchMedia:Y}=window;if(Y&&$&&$ in w){ce=Y(`(max-width: ${w[$]})`);try{ce.addEventListener("change",Q)}catch(M){ce.addListener(Q)}Q(ce)}}return()=>{try{ce==null||ce.removeEventListener("change",Q)}catch(Y){ce==null||ce.removeListener(Q)}}},[$]),(0,q.useEffect)(()=>{const Q=A("ant-sider-");return Re.addSider(Q),()=>Re.removeSider(Q)},[]);const St=()=>{Rt(!Ie,"clickTrigger")},{getPrefixCls:At}=(0,q.useContext)(I.E_),ke=()=>{const Q=At("layout-sider",ye),ce=(0,u.Z)(xe,["collapsed"]),Y=Ie?v:Z,M=p(Y)?`${Y}px`:String(Y),pe=parseFloat(String(v||0))===0?q.createElement("span",{onClick:St,className:f()(`${Q}-zero-width-trigger`,`${Q}-zero-width-trigger-${z?"right":"left"}`),style:y},Se||q.createElement(ue,null)):null,P={expanded:z?q.createElement(G.Z,null):q.createElement(o.Z,null),collapsed:z?q.createElement(o.Z,null):q.createElement(G.Z,null)}[Ie?"collapsed":"expanded"],re=Se!==null?pe||q.createElement("div",{className:`${Q}-trigger`,onClick:St,style:{width:M}},Se||P):null,N=Object.assign(Object.assign({},C),{flex:`0 0 ${M}`,maxWidth:M,minWidth:M,width:M}),ae=f()(Q,`${Q}-${T}`,{[`${Q}-collapsed`]:!!Ie,[`${Q}-has-trigger`]:R&&Se!==null&&!pe,[`${Q}-below`]:!!ot,[`${Q}-zero-width`]:parseFloat(M)===0},we);return q.createElement("aside",Object.assign({className:ae},ce,{style:N,ref:ne}),q.createElement("div",{className:`${Q}-children`},he),R||ot&&pe?re:null)},Ye=q.useMemo(()=>({siderCollapsed:Ie}),[Ie]);return q.createElement(O.Provider,{value:Ye},ke())})},84966:function(yt,Pe,b){"use strict";b.d(Pe,{VY:function(){return O},$_:function(){return w},h4:function(){return L},Gs:function(){return u},ZP:function(){return A}});var F=b(19127),q=b(92310),ve=b.n(q),fe=b(2738),oe=b(59301),W=b(36355),_e=b(83116),o=E=>{const{componentCls:J,bodyBg:te,lightSiderBg:ne,lightTriggerBg:ye,lightTriggerColor:we}=E;return{[`${J}-sider-light`]:{background:ne,[`${J}-sider-trigger`]:{color:we,background:ye},[`${J}-sider-zero-width-trigger`]:{color:we,background:ye,border:`1px solid ${te}`,borderInlineStart:0}}}};const G=E=>{const{antCls:J,componentCls:te,colorText:ne,triggerColor:ye,footerBg:we,triggerBg:Se,headerHeight:he,headerPadding:V,headerColor:T,footerPadding:C,triggerHeight:R,zeroTriggerHeight:z,zeroTriggerWidth:Z,motionDurationMid:v,motionDurationSlow:y,fontSize:$,borderRadius:j,bodyBg:me,headerBg:xe,siderBg:Re}=E;return{[te]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:me,"&, *":{boxSizing:"border-box"},[`&${te}-has-sider`]:{flexDirection:"row",[`> ${te}, > ${te}-content`]:{width:0}},[`${te}-header, &${te}-footer`]:{flex:"0 0 auto"},[`${te}-sider`]:{position:"relative",minWidth:0,background:Re,transition:`all ${v}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${J}-menu${J}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:R},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:R,color:ye,lineHeight:`${R}px`,textAlign:"center",background:Se,cursor:"pointer",transition:`all ${v}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:he,insetInlineEnd:-Z,zIndex:1,width:Z,height:z,color:ye,fontSize:E.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Re,borderStartStartRadius:0,borderStartEndRadius:j,borderEndEndRadius:j,borderEndStartRadius:0,cursor:"pointer",transition:`background ${y} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${y}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Z,borderStartStartRadius:j,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:j}}}}},o(E)),{"&-rtl":{direction:"rtl"}}),[`${te}-header`]:{height:he,padding:V,color:T,lineHeight:`${he}px`,background:xe,[`${J}-menu`]:{lineHeight:"inherit"}},[`${te}-footer`]:{padding:C,color:ne,fontSize:$,background:we},[`${te}-content`]:{flex:"auto",minHeight:0}}};var D=(0,_e.Z)("Layout",E=>[G(E)],E=>{const{colorBgLayout:J,controlHeight:te,controlHeightLG:ne,colorText:ye,controlHeightSM:we,marginXXS:Se,colorTextLightSolid:he,colorBgContainer:V}=E,T=ne*1.25;return{colorBgHeader:"#001529",colorBgBody:J,colorBgTrigger:"#002140",bodyBg:J,headerBg:"#001529",headerHeight:te*2,headerPadding:`0 ${T}px`,headerColor:ye,footerPadding:`${we}px ${T}px`,footerBg:J,siderBg:"#001529",triggerHeight:ne+Se*2,triggerBg:"#002140",triggerColor:he,zeroTriggerWidth:ne,zeroTriggerHeight:ne,lightSiderBg:V,lightTriggerBg:V,lightTriggerColor:ye}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),f=function(E,J){var te={};for(var ne in E)Object.prototype.hasOwnProperty.call(E,ne)&&J.indexOf(ne)<0&&(te[ne]=E[ne]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ye=0,ne=Object.getOwnPropertySymbols(E);yenull,removeSider:()=>null}});function g(E){let{suffixCls:J,tagName:te,displayName:ne}=E;return ye=>oe.forwardRef((Se,he)=>oe.createElement(ye,Object.assign({ref:he,suffixCls:J,tagName:te},Se)))}const p=oe.forwardRef((E,J)=>{const{prefixCls:te,suffixCls:ne,className:ye,tagName:we}=E,Se=f(E,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:he}=oe.useContext(W.E_),V=he("layout",te),[T,C]=D(V),R=ne?`${V}-${ne}`:V;return T(oe.createElement(we,Object.assign({className:ve()(te||R,ye,C),ref:J},Se)))}),I=oe.forwardRef((E,J)=>{const{direction:te}=oe.useContext(W.E_),[ne,ye]=oe.useState([]),{prefixCls:we,className:Se,rootClassName:he,children:V,hasSider:T,tagName:C,style:R}=E,z=f(E,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Z=(0,fe.Z)(z,["suffixCls"]),{getPrefixCls:v,layout:y}=oe.useContext(W.E_),$=v("layout",we),[j,me]=D($),xe=ve()($,{[`${$}-has-sider`]:typeof T=="boolean"?T:ne.length>0,[`${$}-rtl`]:te==="rtl"},y==null?void 0:y.className,Se,he,me),Re=oe.useMemo(()=>({siderHook:{addSider:Ie=>{ye(et=>[].concat((0,F.Z)(et),[Ie]))},removeSider:Ie=>{ye(et=>et.filter(ot=>ot!==Ie))}}}),[]);return j(oe.createElement(u.Provider,{value:Re},oe.createElement(C,Object.assign({ref:J,className:xe,style:Object.assign(Object.assign({},y==null?void 0:y.style),R)},Z),V)))}),H=g({tagName:"div",displayName:"Layout"})(I),L=g({suffixCls:"header",tagName:"header",displayName:"Header"})(p),w=g({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(p),O=g({suffixCls:"content",tagName:"main",displayName:"Content"})(p);var A=H},40875:function(yt,Pe,b){"use strict";b.d(Pe,{J:function(){return W}});var F=b(59301),q=b(33234),ve=b(70425),fe=function(_e,ue){var o={};for(var G in _e)Object.prototype.hasOwnProperty.call(_e,G)&&ue.indexOf(G)<0&&(o[G]=_e[G]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var D=0,G=Object.getOwnPropertySymbols(_e);D{const{children:o}=_e,G=fe(_e,["children"]),D=F.useContext(oe),f=F.useMemo(()=>Object.assign(Object.assign({},D),G),[D,G.prefixCls,G.mode,G.selectable]);return F.createElement(oe.Provider,{value:f},F.createElement(q.BR,null,(0,ve.supportNodeRef)(o)?F.cloneElement(o,{ref:ue}):o))});Pe.Z=oe},20834:function(yt,Pe,b){"use strict";b.d(Pe,{default:function(){return Ye}});var F=b(15285),q=b(59301),ve=b(45818),fe=b(92310),oe=b.n(fe),W=b(36355),_e=function(Q,ce){var Y={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ce.indexOf(M)<0&&(Y[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe{const{prefixCls:ce,className:Y,dashed:M}=Q,pe=_e(Q,["prefixCls","className","dashed"]),{getPrefixCls:k}=q.useContext(W.E_),B=k("menu",ce),P=oe()({[`${B}-item-divider-dashed`]:!!M},Y);return q.createElement(F.iz,Object.assign({className:P},pe))},G=b(11592),D=b(2738),f=b(6848),u=b(92343),p=(0,q.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),H=Q=>{var ce;const{className:Y,children:M,icon:pe,title:k,danger:B}=Q,{prefixCls:P,firstLevel:re,direction:N,disableMenuItemTitleTooltip:ae,inlineCollapsed:le}=q.useContext(p),ge=He=>{const Ze=q.createElement("span",{className:`${P}-title-content`},M);return(!pe||(0,u.l$)(M)&&M.type==="span")&&M&&He&&re&&typeof M=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},M.charAt(0)):Ze},{siderCollapsed:Ee}=q.useContext(ve.D);let Ce=k;typeof k=="undefined"?Ce=re?M:"":k===!1&&(Ce="");const Ne={title:Ce};!Ee&&!le&&(Ne.title=null,Ne.open=!1);const Ke=(0,G.Z)(M).length;let Oe=q.createElement(F.ck,Object.assign({},(0,D.Z)(Q,["title","icon","danger"]),{className:oe()({[`${P}-item-danger`]:B,[`${P}-item-only-child`]:(pe?Ke+1:Ke)===1},Y),title:typeof k=="string"?k:void 0}),(0,u.Tm)(pe,{className:oe()((0,u.l$)(pe)?(ce=pe.props)===null||ce===void 0?void 0:ce.className:"",`${P}-item-icon`)}),ge(le));return ae||(Oe=q.createElement(f.Z,Object.assign({},Ne,{placement:N==="rtl"?"left":"right",overlayClassName:`${P}-inline-collapsed-tooltip`}),Oe)),Oe},w=Q=>{var ce;const{popupClassName:Y,icon:M,title:pe,theme:k}=Q,B=q.useContext(p),{prefixCls:P,inlineCollapsed:re,theme:N}=B,ae=(0,F.Xl)();let le;if(!M)le=re&&!ae.length&&pe&&typeof pe=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},pe.charAt(0)):q.createElement("span",{className:`${P}-title-content`},pe);else{const Ee=(0,u.l$)(pe)&&pe.type==="span";le=q.createElement(q.Fragment,null,(0,u.Tm)(M,{className:oe()((0,u.l$)(M)?(ce=M.props)===null||ce===void 0?void 0:ce.className:"",`${P}-item-icon`)}),Ee?pe:q.createElement("span",{className:`${P}-title-content`},pe))}const ge=q.useMemo(()=>Object.assign(Object.assign({},B),{firstLevel:!1}),[B]);return q.createElement(p.Provider,{value:ge},q.createElement(F.Wd,Object.assign({},(0,D.Z)(Q,["icon"]),{title:le,popupClassName:oe()(P,Y,`${P}-${k||N}`)})))},O=b(18785),A=b(70425),E=b(62892),J=b(40875),te=function(Q,ce){var Y={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ce.indexOf(M)<0&&(Y[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe{if(ce&&typeof ce=="object"){const M=ce,{label:pe,children:k,key:B,type:P}=M,re=te(M,["label","children","key","type"]),N=B!=null?B:`tmp-${Y}`;return k||P==="group"?P==="group"?q.createElement(F.BW,Object.assign({key:N},re,{title:pe}),ne(k)):q.createElement(w,Object.assign({key:N},re,{title:pe}),ne(k)):P==="divider"?q.createElement(o,Object.assign({key:N},re)):q.createElement(H,Object.assign({key:N},re),pe)}return null}).filter(ce=>ce)}function ye(Q){return q.useMemo(()=>Q&&ne(Q),[Q])}var we=b(64993),Se=b(17313),he=b(8378),V=b(13826),T=b(29878),C=b(83116),R=b(37613),Z=Q=>{const{componentCls:ce,motionDurationSlow:Y,horizontalLineHeight:M,colorSplit:pe,lineWidth:k,lineType:B,itemPaddingInline:P}=Q;return{[`${ce}-horizontal`]:{lineHeight:M,border:0,borderBottom:`${k}px ${B} ${pe}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${ce}-item, ${ce}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:P},[`> ${ce}-item:hover, > ${ce}-item-active, > ${ce}-submenu ${ce}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${ce}-item, ${ce}-submenu-title`]:{transition:[`border-color ${Y}`,`background ${Y}`].join(",")},[`${ce}-submenu-arrow`]:{display:"none"}}}},y=Q=>{let{componentCls:ce,menuArrowOffset:Y}=Q;return{[`${ce}-rtl`]:{direction:"rtl"},[`${ce}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${ce}-rtl${ce}-vertical, ${ce}-submenu-rtl ${ce}-vertical`]:{[`${ce}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${Y})`},"&::after":{transform:`rotate(45deg) translateY(${Y})`}}}}};const $=Q=>Object.assign({},(0,Se.oN)(Q));var me=(Q,ce)=>{const{componentCls:Y,itemColor:M,itemSelectedColor:pe,groupTitleColor:k,itemBg:B,subMenuItemBg:P,itemSelectedBg:re,activeBarHeight:N,activeBarWidth:ae,activeBarBorderWidth:le,motionDurationSlow:ge,motionEaseInOut:Ee,motionEaseOut:Ce,itemPaddingInline:Ne,motionDurationMid:Ke,itemHoverColor:Oe,lineType:He,colorSplit:Ze,itemDisabledColor:Le,dangerItemColor:ut,dangerItemHoverColor:ft,dangerItemSelectedColor:wt,dangerItemActiveBg:Qe,dangerItemSelectedBg:Kt,itemHoverBg:Wt,itemActiveBg:Gt,menuSubMenuBg:Mt,horizontalItemSelectedColor:pt,horizontalItemSelectedBg:ht,horizontalItemBorderRadius:mt,horizontalItemHoverBg:Tt,popupBg:Et}=Q;return{[`${Y}-${ce}, ${Y}-${ce} > ${Y}`]:{color:M,background:B,[`&${Y}-root:focus-visible`]:Object.assign({},$(Q)),[`${Y}-item-group-title`]:{color:k},[`${Y}-submenu-selected`]:{[`> ${Y}-submenu-title`]:{color:pe}},[`${Y}-item-disabled, ${Y}-submenu-disabled`]:{color:`${Le} !important`},[`${Y}-item:not(${Y}-item-selected):not(${Y}-submenu-selected)`]:{[`&:hover, > ${Y}-submenu-title:hover`]:{color:Oe}},[`&:not(${Y}-horizontal)`]:{[`${Y}-item:not(${Y}-item-selected)`]:{"&:hover":{backgroundColor:Wt},"&:active":{backgroundColor:Gt}},[`${Y}-submenu-title`]:{"&:hover":{backgroundColor:Wt},"&:active":{backgroundColor:Gt}}},[`${Y}-item-danger`]:{color:ut,[`&${Y}-item:hover`]:{[`&:not(${Y}-item-selected):not(${Y}-submenu-selected)`]:{color:ft}},[`&${Y}-item:active`]:{background:Qe}},[`${Y}-item a`]:{"&, &:hover":{color:"inherit"}},[`${Y}-item-selected`]:{color:pe,[`&${Y}-item-danger`]:{color:wt},"a, a:hover":{color:"inherit"}},[`& ${Y}-item-selected`]:{backgroundColor:re,[`&${Y}-item-danger`]:{backgroundColor:Kt}},[`${Y}-item, ${Y}-submenu-title`]:{[`&:not(${Y}-item-disabled):focus-visible`]:Object.assign({},$(Q))},[`&${Y}-submenu > ${Y}`]:{backgroundColor:Mt},[`&${Y}-popup > ${Y}`]:{backgroundColor:Et},[`&${Y}-horizontal`]:Object.assign(Object.assign({},ce==="dark"?{borderBottom:0}:{}),{[`> ${Y}-item, > ${Y}-submenu`]:{top:le,marginTop:-le,marginBottom:0,borderRadius:mt,"&::after":{position:"absolute",insetInline:Ne,bottom:0,borderBottom:`${N}px solid transparent`,transition:`border-color ${ge} ${Ee}`,content:'""'},"&:hover, &-active, &-open":{background:Tt,"&::after":{borderBottomWidth:N,borderBottomColor:pt}},"&-selected":{color:pt,backgroundColor:ht,"&:hover":{backgroundColor:ht},"&::after":{borderBottomWidth:N,borderBottomColor:pt}}}}),[`&${Y}-root`]:{[`&${Y}-inline, &${Y}-vertical`]:{borderInlineEnd:`${le}px ${He} ${Ze}`}},[`&${Y}-inline`]:{[`${Y}-sub${Y}-inline`]:{background:P},[`${Y}-item, ${Y}-submenu-title`]:le&&ae?{width:`calc(100% + ${le}px)`}:{},[`${Y}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${ae}px solid ${pe}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Ke} ${Ce}`,`opacity ${Ke} ${Ce}`].join(","),content:'""'},[`&${Y}-item-danger`]:{"&::after":{borderInlineEndColor:wt}}},[`${Y}-selected, ${Y}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Ke} ${Ee}`,`opacity ${Ke} ${Ee}`].join(",")}}}}}};const xe=Q=>{const{componentCls:ce,itemHeight:Y,itemMarginInline:M,padding:pe,menuArrowSize:k,marginXS:B,itemMarginBlock:P}=Q,re=pe+k+B;return{[`${ce}-item`]:{position:"relative",overflow:"hidden"},[`${ce}-item, ${ce}-submenu-title`]:{height:Y,lineHeight:`${Y}px`,paddingInline:pe,overflow:"hidden",textOverflow:"ellipsis",marginInline:M,marginBlock:P,width:`calc(100% - ${M*2}px)`},[`> ${ce}-item, > ${ce}-submenu > ${ce}-submenu-title`]:{height:Y,lineHeight:`${Y}px`},[`${ce}-item-group-list ${ce}-submenu-title, ${ce}-submenu-title`]:{paddingInlineEnd:re}}};var Ie=Q=>{const{componentCls:ce,iconCls:Y,itemHeight:M,colorTextLightSolid:pe,dropdownWidth:k,controlHeightLG:B,motionDurationMid:P,motionEaseOut:re,paddingXL:N,itemMarginInline:ae,fontSizeLG:le,motionDurationSlow:ge,paddingXS:Ee,boxShadowSecondary:Ce,collapsedWidth:Ne,collapsedIconSize:Ke}=Q,Oe={height:M,lineHeight:`${M}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[ce]:{"&-inline, &-vertical":Object.assign({[`&${ce}-root`]:{boxShadow:"none"}},xe(Q))},[`${ce}-submenu-popup`]:{[`${ce}-vertical`]:Object.assign(Object.assign({},xe(Q)),{boxShadow:Ce})}},{[`${ce}-submenu-popup ${ce}-vertical${ce}-sub`]:{minWidth:k,maxHeight:`calc(100vh - ${B*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${ce}-inline`]:{width:"100%",[`&${ce}-root`]:{[`${ce}-item, ${ce}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${ge}`,`background ${ge}`,`padding ${P} ${re}`].join(","),[`> ${ce}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${ce}-sub${ce}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${ce}-submenu > ${ce}-submenu-title`]:Oe,[`& ${ce}-item-group-title`]:{paddingInlineStart:N}},[`${ce}-item`]:Oe}},{[`${ce}-inline-collapsed`]:{width:Ne,[`&${ce}-root`]:{[`${ce}-item, ${ce}-submenu ${ce}-submenu-title`]:{[`> ${ce}-inline-collapsed-noicon`]:{fontSize:le,textAlign:"center"}}},[`> ${ce}-item, > ${ce}-item-group > ${ce}-item-group-list > ${ce}-item, > ${ce}-item-group > ${ce}-item-group-list > ${ce}-submenu > ${ce}-submenu-title, > ${ce}-submenu > ${ce}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${le/2}px - ${ae}px)`,textOverflow:"clip",[` ${ce}-submenu-arrow, ${ce}-submenu-expand-icon `]:{opacity:0},[`${ce}-item-icon, ${Y}`]:{margin:0,fontSize:Ke,lineHeight:`${M}px`,"+ span":{display:"inline-block",opacity:0}}},[`${ce}-item-icon, ${Y}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${ce}-item-icon, ${Y}`]:{display:"none"},"a, a:hover":{color:pe}},[`${ce}-item-group-title`]:Object.assign(Object.assign({},Se.vS),{paddingInline:Ee})}}]};const et=Q=>{const{componentCls:ce,motionDurationSlow:Y,motionDurationMid:M,motionEaseInOut:pe,motionEaseOut:k,iconCls:B,iconSize:P,iconMarginInlineEnd:re}=Q;return{[`${ce}-item, ${ce}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${Y}`,`background ${Y}`,`padding ${Y} ${pe}`].join(","),[`${ce}-item-icon, ${B}`]:{minWidth:P,fontSize:P,transition:[`font-size ${M} ${k}`,`margin ${Y} ${pe}`,`color ${Y}`].join(","),"+ span":{marginInlineStart:re,opacity:1,transition:[`opacity ${Y} ${pe}`,`margin ${Y}`,`color ${Y}`].join(",")}},[`${ce}-item-icon`]:Object.assign({},(0,Se.Ro)()),[`&${ce}-item-only-child`]:{[`> ${B}, > ${ce}-item-icon`]:{marginInlineEnd:0}}},[`${ce}-item-disabled, ${ce}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${ce}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},ot=Q=>{const{componentCls:ce,motionDurationSlow:Y,motionEaseInOut:M,borderRadius:pe,menuArrowSize:k,menuArrowOffset:B}=Q;return{[`${ce}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:Q.margin,width:k,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${Y} ${M}, opacity ${Y}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:k*.6,height:k*.15,backgroundColor:"currentcolor",borderRadius:pe,transition:[`background ${Y} ${M}`,`transform ${Y} ${M}`,`top ${Y} ${M}`,`color ${Y} ${M}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${B})`},"&::after":{transform:`rotate(-45deg) translateY(${B})`}}}}},Ve=Q=>{const{antCls:ce,componentCls:Y,fontSize:M,motionDurationSlow:pe,motionDurationMid:k,motionEaseInOut:B,paddingXS:P,padding:re,colorSplit:N,lineWidth:ae,zIndexPopup:le,borderRadiusLG:ge,subMenuItemBorderRadius:Ee,menuArrowSize:Ce,menuArrowOffset:Ne,lineType:Ke,menuPanelMaskInset:Oe,groupTitleLineHeight:He,groupTitleFontSize:Ze}=Q;return[{"":{[`${Y}`]:Object.assign(Object.assign({},(0,Se.dF)()),{"&-hidden":{display:"none"}})},[`${Y}-submenu-hidden`]:{display:"none"}},{[Y]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Se.Wf)(Q)),(0,Se.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:M,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${pe} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${Y}-item`]:{flex:"none"}},[`${Y}-item, ${Y}-submenu, ${Y}-submenu-title`]:{borderRadius:Q.itemBorderRadius},[`${Y}-item-group-title`]:{padding:`${P}px ${re}px`,fontSize:Ze,lineHeight:He,transition:`all ${pe}`},[`&-horizontal ${Y}-submenu`]:{transition:[`border-color ${pe} ${B}`,`background ${pe} ${B}`].join(",")},[`${Y}-submenu, ${Y}-submenu-inline`]:{transition:[`border-color ${pe} ${B}`,`background ${pe} ${B}`,`padding ${k} ${B}`].join(",")},[`${Y}-submenu ${Y}-sub`]:{cursor:"initial",transition:[`background ${pe} ${B}`,`padding ${pe} ${B}`].join(",")},[`${Y}-title-content`]:{transition:`color ${pe}`},[`${Y}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${Y}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:N,borderStyle:Ke,borderWidth:0,borderTopWidth:ae,marginBlock:ae,padding:0,"&-dashed":{borderStyle:"dashed"}}}),et(Q)),{[`${Y}-item-group`]:{[`${Y}-item-group-list`]:{margin:0,padding:0,[`${Y}-item, ${Y}-submenu-title`]:{paddingInline:`${M*2}px ${re}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:le,borderRadius:ge,boxShadow:"none",transformOrigin:"0 0",[`&${Y}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${Oe}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:Oe},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:Q.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:Q.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:Q.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:Q.paddingXS},[`> ${Y}`]:Object.assign(Object.assign(Object.assign({borderRadius:ge},et(Q)),ot(Q)),{[`${Y}-item, ${Y}-submenu > ${Y}-submenu-title`]:{borderRadius:Ee},[`${Y}-submenu-title::after`]:{transition:`transform ${pe} ${B}`}})}}),ot(Q)),{[`&-inline-collapsed ${Y}-submenu-arrow, &-inline ${Y}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Ne})`},"&::after":{transform:`rotate(45deg) translateX(-${Ne})`}},[`${Y}-submenu-open${Y}-submenu-inline > ${Y}-submenu-title > ${Y}-submenu-arrow`]:{transform:`translateY(-${Ce*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Ne})`},"&::before":{transform:`rotate(45deg) translateX(${Ne})`}}})},{[`${ce}-layout-header`]:{[Y]:{lineHeight:"inherit"}}}]};var Rt=(Q,ce)=>(0,C.Z)("Menu",M=>{if(ce===!1)return[];const{colorBgElevated:pe,colorPrimary:k,colorTextLightSolid:B,controlHeightLG:P,fontSize:re,darkItemColor:N,darkDangerItemColor:ae,darkItemBg:le,darkSubMenuItemBg:ge,darkItemSelectedColor:Ee,darkItemSelectedBg:Ce,darkDangerItemSelectedBg:Ne,darkItemHoverBg:Ke,darkGroupTitleColor:Oe,darkItemHoverColor:He,darkItemDisabledColor:Ze,darkDangerItemHoverColor:Le,darkDangerItemSelectedColor:ut,darkDangerItemActiveBg:ft}=M,wt=re/7*5,Qe=(0,R.TS)(M,{menuArrowSize:wt,menuHorizontalHeight:P*1.15,menuArrowOffset:`${wt*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:pe}),Kt=(0,R.TS)(Qe,{itemColor:N,itemHoverColor:He,groupTitleColor:Oe,itemSelectedColor:Ee,itemBg:le,popupBg:le,subMenuItemBg:ge,itemActiveBg:"transparent",itemSelectedBg:Ce,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Ke,itemDisabledColor:Ze,dangerItemColor:ae,dangerItemHoverColor:Le,dangerItemSelectedColor:ut,dangerItemActiveBg:ft,dangerItemSelectedBg:Ne,menuSubMenuBg:ge,horizontalItemSelectedColor:B,horizontalItemSelectedBg:k});return[Ve(Qe),Z(Qe),Ie(Qe),me(Qe,"light"),me(Kt,"dark"),y(Qe),(0,he.Z)(Qe),(0,V.oN)(Qe,"slide-up"),(0,V.oN)(Qe,"slide-down"),(0,T._y)(Qe,"zoom-big")]},M=>{const{colorPrimary:pe,colorError:k,colorTextDisabled:B,colorErrorBg:P,colorText:re,colorTextDescription:N,colorBgContainer:ae,colorFillAlter:le,colorFillContent:ge,lineWidth:Ee,lineWidthBold:Ce,controlItemBgActive:Ne,colorBgTextHover:Ke,controlHeightLG:Oe,lineHeight:He,colorBgElevated:Ze,marginXXS:Le,padding:ut,fontSize:ft,controlHeightSM:wt,fontSizeLG:Qe,colorTextLightSolid:Kt,colorErrorHover:Wt}=M,Gt=new we.C(Kt).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:M.zIndexPopupBase+50,radiusItem:M.borderRadiusLG,itemBorderRadius:M.borderRadiusLG,radiusSubMenuItem:M.borderRadiusSM,subMenuItemBorderRadius:M.borderRadiusSM,colorItemText:re,itemColor:re,colorItemTextHover:re,itemHoverColor:re,colorItemTextHoverHorizontal:pe,horizontalItemHoverColor:pe,colorGroupTitle:N,groupTitleColor:N,colorItemTextSelected:pe,itemSelectedColor:pe,colorItemTextSelectedHorizontal:pe,horizontalItemSelectedColor:pe,colorItemBg:ae,itemBg:ae,colorItemBgHover:Ke,itemHoverBg:Ke,colorItemBgActive:ge,itemActiveBg:Ne,colorSubItemBg:le,subMenuItemBg:le,colorItemBgSelected:Ne,itemSelectedBg:Ne,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:Ce,activeBarHeight:Ce,colorActiveBarBorderSize:Ee,activeBarBorderWidth:Ee,colorItemTextDisabled:B,itemDisabledColor:B,colorDangerItemText:k,dangerItemColor:k,colorDangerItemTextHover:k,dangerItemHoverColor:k,colorDangerItemTextSelected:k,dangerItemSelectedColor:k,colorDangerItemBgActive:P,dangerItemActiveBg:P,colorDangerItemBgSelected:P,dangerItemSelectedBg:P,itemMarginInline:M.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Oe,groupTitleLineHeight:He,collapsedWidth:Oe*2,popupBg:Ze,itemMarginBlock:Le,itemPaddingInline:ut,horizontalLineHeight:`${Oe*1.15}px`,iconSize:ft,iconMarginInlineEnd:wt-ft,collapsedIconSize:Qe,groupTitleFontSize:ft,darkItemDisabledColor:new we.C(Kt).setAlpha(.25).toRgbString(),darkItemColor:Gt,darkDangerItemColor:k,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Kt,darkItemSelectedBg:pe,darkDangerItemSelectedBg:k,darkItemHoverBg:"transparent",darkGroupTitleColor:Gt,darkItemHoverColor:Kt,darkDangerItemHoverColor:Wt,darkDangerItemSelectedColor:Kt,darkDangerItemActiveBg:k}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(Q),dt=function(Q,ce){var Y={};for(var M in Q)Object.prototype.hasOwnProperty.call(Q,M)&&ce.indexOf(M)<0&&(Y[M]=Q[M]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(Q);pe{var Y,M;const pe=q.useContext(J.Z),k=pe||{},{getPrefixCls:B,getPopupContainer:P,direction:re,menu:N}=q.useContext(W.E_),ae=B(),{prefixCls:le,className:ge,style:Ee,theme:Ce="light",expandIcon:Ne,_internalDisableMenuItemTitleTooltip:Ke,inlineCollapsed:Oe,siderCollapsed:He,items:Ze,children:Le,rootClassName:ut,mode:ft,selectable:wt,onClick:Qe,overflowedIndicatorPopupClassName:Kt}=Q,Wt=dt(Q,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Gt=(0,D.Z)(Wt,["collapsedWidth"]),Mt=ye(Ze)||Le;(Y=k.validator)===null||Y===void 0||Y.call(k,{mode:ft});const pt=(0,A.useEvent)(function(){var Vt;Qe==null||Qe.apply(void 0,arguments),(Vt=k.onClick)===null||Vt===void 0||Vt.call(k)}),ht=k.mode||ft,mt=wt!=null?wt:k.selectable,Tt=q.useMemo(()=>He!==void 0?He:Oe,[Oe,He]),Et={horizontal:{motionName:`${ae}-slide-up`},inline:(0,E.Z)(ae),other:{motionName:`${ae}-zoom-big`}},kt=B("menu",le||k.prefixCls),[Xt,an]=Rt(kt,!pe),Qt=oe()(`${kt}-${Ce}`,N==null?void 0:N.className,ge);let cn;if(typeof Ne=="function")cn=Ne;else if(Ne===null||Ne===!1)cn=null;else if(k.expandIcon===null||k.expandIcon===!1)cn=null;else{const Vt=Ne!=null?Ne:k.expandIcon;cn=(0,u.Tm)(Vt,{className:oe()(`${kt}-submenu-expand-icon`,(0,u.l$)(Vt)?(M=Vt.props)===null||M===void 0?void 0:M.className:"")})}const Ht=q.useMemo(()=>({prefixCls:kt,inlineCollapsed:Tt||!1,direction:re,firstLevel:!0,theme:Ce,mode:ht,disableMenuItemTitleTooltip:Ke}),[kt,Tt,re,Ke,Ce]);return Xt(q.createElement(J.Z.Provider,{value:null},q.createElement(p.Provider,{value:Ht},q.createElement(F.ZP,Object.assign({getPopupContainer:P,overflowedIndicator:q.createElement(O.Z,null),overflowedIndicatorPopupClassName:oe()(kt,`${kt}-${Ce}`,Kt),mode:ht,selectable:mt,onClick:pt},Gt,{inlineCollapsed:Tt,style:Object.assign(Object.assign({},N==null?void 0:N.style),Ee),className:Qt,prefixCls:kt,direction:re,defaultMotions:Et,expandIcon:cn,ref:ce,rootClassName:oe()(ut,an)}),Mt))))});const ke=(0,q.forwardRef)((Q,ce)=>{const Y=(0,q.useRef)(null),M=q.useContext(ve.D);return(0,q.useImperativeHandle)(ce,()=>({menu:Y.current,focus:pe=>{var k;(k=Y.current)===null||k===void 0||k.focus(pe)}})),q.createElement(At,Object.assign({ref:Y},Q,M))});ke.Item=H,ke.SubMenu=w,ke.Divider=o,ke.ItemGroup=F.BW;var Ye=ke},13570:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return $}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},fe=ve,oe=b(7657),W=function(me,xe){return q.createElement(oe.Z,(0,F.Z)({},me,{ref:xe,icon:fe}))},_e=q.forwardRef(W),ue=_e,o=b(92310),G=b.n(o),D=b(90493),f=b(72071),u=b(6620),g=b(18929),p=b(10228),I=b(26112);function H(j,me){var xe=j.disabled,Re=j.prefixCls,Ie=j.character,et=j.characterRender,ot=j.index,Ve=j.count,Rt=j.value,dt=j.allowHalf,St=j.focused,At=j.onHover,ke=j.onClick,Ye=function(P){At(P,ot)},Q=function(P){ke(P,ot)},ce=function(P){P.keyCode===p.Z.ENTER&&ke(P,ot)},Y=ot+1,M=new Set([Re]);Rt===0&&ot===0&&St?M.add("".concat(Re,"-focused")):dt&&Rt+.5>=Y&&Rtot?"true":"false","aria-posinset":ot+1,"aria-setsize":Ve,tabIndex:xe?-1:0},q.createElement("div",{className:"".concat(Re,"-first")},pe),q.createElement("div",{className:"".concat(Re,"-second")},pe)));return et&&(k=et(k,j)),k}var L=q.forwardRef(H);function w(){var j=q.useRef({});function me(Re){return j.current[Re]}function xe(Re){return function(Ie){j.current[Re]=Ie}}return[me,xe]}function O(j){var me=j.pageXOffset,xe="scrollLeft";if(typeof me!="number"){var Re=j.document;me=Re.documentElement[xe],typeof me!="number"&&(me=Re.body[xe])}return me}function A(j){var me,xe,Re=j.ownerDocument,Ie=Re.body,et=Re&&Re.documentElement,ot=j.getBoundingClientRect();return me=ot.left,xe=ot.top,me-=et.clientLeft||Ie.clientLeft||0,xe-=et.clientTop||Ie.clientTop||0,{left:me,top:xe}}function E(j){var me=A(j),xe=j.ownerDocument,Re=xe.defaultView||xe.parentWindow;return me.left+=O(Re),me.left}var J=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function te(j,me){var xe,Re=j.prefixCls,Ie=Re===void 0?"rc-rate":Re,et=j.className,ot=j.defaultValue,Ve=j.value,Rt=j.count,dt=Rt===void 0?5:Rt,St=j.allowHalf,At=St===void 0?!1:St,ke=j.allowClear,Ye=ke===void 0?!0:ke,Q=j.character,ce=Q===void 0?"\u2605":Q,Y=j.characterRender,M=j.disabled,pe=j.direction,k=pe===void 0?"ltr":pe,B=j.tabIndex,P=B===void 0?0:B,re=j.autoFocus,N=j.onHoverChange,ae=j.onChange,le=j.onFocus,ge=j.onBlur,Ee=j.onKeyDown,Ce=j.onMouseLeave,Ne=(0,u.Z)(j,J),Ke=w(),Oe=(0,f.Z)(Ke,2),He=Oe[0],Ze=Oe[1],Le=q.useRef(null),ut=function(){if(!M){var Ae;(Ae=Le.current)===null||Ae===void 0||Ae.focus()}};q.useImperativeHandle(me,function(){return{focus:ut,blur:function(){if(!M){var Ae;(Ae=Le.current)===null||Ae===void 0||Ae.blur()}}}});var ft=(0,g.Z)(ot||0,{value:Ve}),wt=(0,f.Z)(ft,2),Qe=wt[0],Kt=wt[1],Wt=(0,g.Z)(null),Gt=(0,f.Z)(Wt,2),Mt=Gt[0],pt=Gt[1],ht=function(Ae,nt){var qe=k==="rtl",rt=Ae+1;if(At){var Ut=He(Ae),jt=E(Ut),lt=Ut.clientWidth;(qe&&nt-jt>lt/2||!qe&&nt-jt0&&!qe||nt===p.Z.RIGHT&&rt>0&&qe?(At?rt-=.5:rt-=1,mt(rt),Ae.preventDefault()):nt===p.Z.LEFT&&rt{const{componentCls:me}=j;return{[`${me}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:j.marginXS},"> div":{transition:`all ${j.motionDurationMid}, outline 0s`,"&:hover":{transform:j.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${j.lineWidth}px dashed ${j.starColor}`,transform:j.starHoverScale}},"&-first, &-second":{color:j.starBg,transition:`all ${j.motionDurationMid}`,userSelect:"none",[j.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${me}-star-first, &-half ${me}-star-second`]:{opacity:1},[`&-half ${me}-star-first, &-full ${me}-star-second`]:{color:"inherit"}}}},R=j=>({[`&-rtl${j.componentCls}`]:{direction:"rtl"}}),z=j=>{const{componentCls:me}=j;return{[me]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,he.Wf)(j)),{display:"inline-block",margin:0,padding:0,color:j.starColor,fontSize:j.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${me} ${me}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),C(j)),{[`+ ${me}-text`]:{display:"inline-block",marginInlineStart:j.marginXS,fontSize:j.fontSize}}),R(j))}};var Z=(0,V.Z)("Rate",j=>{const me=(0,T.TS)(j,{});return[z(me)]},j=>({starColor:j.yellow6,starSize:j.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:j.colorFillContent})),v=function(j,me){var xe={};for(var Re in j)Object.prototype.hasOwnProperty.call(j,Re)&&me.indexOf(Re)<0&&(xe[Re]=j[Re]);if(j!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,Re=Object.getOwnPropertySymbols(j);Ie{const{prefixCls:xe,className:Re,rootClassName:Ie,style:et,tooltips:ot,character:Ve=q.createElement(ue,null)}=j,Rt=v(j,["prefixCls","className","rootClassName","style","tooltips","character"]),dt=(M,pe)=>{let{index:k}=pe;return ot?q.createElement(Se.Z,{title:ot[k]},M):M},{getPrefixCls:St,direction:At,rate:ke}=q.useContext(we.E_),Ye=St("rate",xe),[Q,ce]=Z(Ye),Y=Object.assign(Object.assign({},ke==null?void 0:ke.style),et);return Q(q.createElement(ye,Object.assign({ref:me,character:Ve,characterRender:dt},Rt,{className:G()(Re,Ie,ce,ke==null?void 0:ke.className),style:Y,prefixCls:Ye,direction:At})))})},81327:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return H}});var F=b(59301),q=b(92310),ve=b.n(q),fe=b(11592),oe=b(36355),W=b(33234);const _e=F.createContext({latestIndex:0}),ue=_e.Provider;var G=L=>{let{className:w,index:O,children:A,split:E,style:J}=L;const{latestIndex:te}=F.useContext(_e);return A==null?null:F.createElement(F.Fragment,null,F.createElement("div",{className:w,style:J},A),O{var O,A;const{getPrefixCls:E,space:J,direction:te}=F.useContext(oe.E_),{size:ne=(J==null?void 0:J.size)||"small",align:ye,className:we,rootClassName:Se,children:he,direction:V="horizontal",prefixCls:T,split:C,style:R,wrap:z=!1,classNames:Z,styles:v}=L,y=g(L,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[$,j]=Array.isArray(ne)?ne:[ne,ne],me=f(j),xe=f($),Re=u(j),Ie=u($),et=(0,fe.Z)(he,{keepEmpty:!0}),ot=ye===void 0&&V==="horizontal"?"center":ye,Ve=E("space",T),[Rt,dt]=(0,D.Z)(Ve),St=ve()(Ve,J==null?void 0:J.className,dt,`${Ve}-${V}`,{[`${Ve}-rtl`]:te==="rtl",[`${Ve}-align-${ot}`]:ot,[`${Ve}-gap-row-${j}`]:me,[`${Ve}-gap-col-${$}`]:xe},we,Se),At=ve()(`${Ve}-item`,(O=Z==null?void 0:Z.item)!==null&&O!==void 0?O:(A=J==null?void 0:J.classNames)===null||A===void 0?void 0:A.item);let ke=0;const Ye=et.map((Y,M)=>{var pe,k;Y!=null&&(ke=M);const B=Y&&Y.key||`${At}-${M}`;return F.createElement(G,{className:At,key:B,index:M,split:C,style:(pe=v==null?void 0:v.item)!==null&&pe!==void 0?pe:(k=J==null?void 0:J.styles)===null||k===void 0?void 0:k.item},Y)}),Q=F.useMemo(()=>({latestIndex:ke}),[ke]);if(et.length===0)return null;const ce={};return z&&(ce.flexWrap="wrap"),!xe&&Ie&&(ce.columnGap=$),!me&&Re&&(ce.rowGap=j),Rt(F.createElement("div",Object.assign({ref:w,className:St,style:Object.assign(Object.assign(Object.assign({},ce),J==null?void 0:J.style),R)},y),F.createElement(ue,{value:Q},Ye)))});I.Compact=W.ZP;var H=I},8378:function(yt,Pe){"use strict";const b=F=>({[F.componentCls]:{[`${F.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${F.motionDurationMid} ${F.motionEaseInOut}, opacity ${F.motionDurationMid} ${F.motionEaseInOut} !important`}},[`${F.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${F.motionDurationMid} ${F.motionEaseInOut}, opacity ${F.motionDurationMid} ${F.motionEaseInOut} !important`}}});Pe.Z=b},92899:function(yt,Pe,b){"use strict";b.d(Pe,{Fm:function(){return f}});var F=b(93083),q=b(95406);const ve=new F.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),fe=new F.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),oe=new F.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),W=new F.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_e=new F.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ue=new F.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o=new F.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),G=new F.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),D={"move-up":{inKeyframes:o,outKeyframes:G},"move-down":{inKeyframes:ve,outKeyframes:fe},"move-left":{inKeyframes:oe,outKeyframes:W},"move-right":{inKeyframes:_e,outKeyframes:ue}},f=(u,g)=>{const{antCls:p}=u,I=`${p}-${g}`,{inKeyframes:H,outKeyframes:L}=D[g];return[(0,q.R)(I,H,L,u.motionDurationMid),{[` ${I}-enter, ${I}-appear `]:{opacity:0,animationTimingFunction:u.motionEaseOutCirc},[`${I}-leave`]:{animationTimingFunction:u.motionEaseInOutCirc}}]}},13826:function(yt,Pe,b){"use strict";b.d(Pe,{Qt:function(){return oe},Uw:function(){return fe},fJ:function(){return ve},ly:function(){return W},oN:function(){return f}});var F=b(93083),q=b(95406);const ve=new F.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),fe=new F.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),oe=new F.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),W=new F.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),_e=new F.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ue=new F.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),o=new F.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),G=new F.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),D={"slide-up":{inKeyframes:ve,outKeyframes:fe},"slide-down":{inKeyframes:oe,outKeyframes:W},"slide-left":{inKeyframes:_e,outKeyframes:ue},"slide-right":{inKeyframes:o,outKeyframes:G}},f=(u,g)=>{const{antCls:p}=u,I=`${p}-${g}`,{inKeyframes:H,outKeyframes:L}=D[g];return[(0,q.R)(I,H,L,u.motionDurationMid),{[` ${I}-enter, ${I}-appear `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:u.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${I}-leave`]:{animationTimingFunction:u.motionEaseInQuint}}]}},19447:function(yt,Pe,b){"use strict";b.d(Pe,{ZP:function(){return oe},fS:function(){return ve},qN:function(){return q}});var F=b(47585);const q=8;function ve(W){const _e=q,{contentRadius:ue,limitVerticalRadius:o}=W,G=ue>12?ue+2:12;return{dropdownArrowOffset:G,dropdownArrowOffsetVertical:o?_e:G}}function fe(W,_e){return W?_e:{}}function oe(W,_e){const{componentCls:ue,sizePopupArrow:o,borderRadiusXS:G,borderRadiusOuter:D,boxShadowPopoverArrow:f}=W,{colorBg:u,contentRadius:g=W.borderRadiusLG,limitVerticalRadius:p,arrowDistance:I=0,arrowPlacement:H={left:!0,right:!0,top:!0,bottom:!0}}=_e,{dropdownArrowOffsetVertical:L,dropdownArrowOffset:w}=ve({contentRadius:g,limitVerticalRadius:p});return{[ue]:Object.assign(Object.assign(Object.assign(Object.assign({[`${ue}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,F.r)(o,G,D,u,f)),{"&:before":{background:u}})]},fe(!!H.top,{[[`&-placement-top ${ue}-arrow`,`&-placement-topLeft ${ue}-arrow`,`&-placement-topRight ${ue}-arrow`].join(",")]:{bottom:I,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${ue}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${ue}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-topRight ${ue}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!H.bottom,{[[`&-placement-bottom ${ue}-arrow`,`&-placement-bottomLeft ${ue}-arrow`,`&-placement-bottomRight ${ue}-arrow`].join(",")]:{top:I,transform:"translateY(-100%)"},[`&-placement-bottom ${ue}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${ue}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-bottomRight ${ue}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!H.left,{[[`&-placement-left ${ue}-arrow`,`&-placement-leftTop ${ue}-arrow`,`&-placement-leftBottom ${ue}-arrow`].join(",")]:{right:{_skip_check_:!0,value:I},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${ue}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${ue}-arrow`]:{top:L},[`&-placement-leftBottom ${ue}-arrow`]:{bottom:L}})),fe(!!H.right,{[[`&-placement-right ${ue}-arrow`,`&-placement-rightTop ${ue}-arrow`,`&-placement-rightBottom ${ue}-arrow`].join(",")]:{left:{_skip_check_:!0,value:I},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${ue}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${ue}-arrow`]:{top:L},[`&-placement-rightBottom ${ue}-arrow`]:{bottom:L}}))}}},47585:function(yt,Pe,b){"use strict";b.d(Pe,{r:function(){return F}});const F=(q,ve,fe,oe,W)=>{const _e=q/2,ue=0,o=_e,G=fe*1/Math.sqrt(2),D=_e-fe*(1-1/Math.sqrt(2)),f=_e-ve*(1/Math.sqrt(2)),u=fe*(Math.sqrt(2)-1)+ve*(1/Math.sqrt(2)),g=2*_e-f,p=u,I=2*_e-G,H=D,L=2*_e-ue,w=o,O=_e*Math.sqrt(2)+fe*(Math.sqrt(2)-2),A=fe*(Math.sqrt(2)-1);return{pointerEvents:"none",width:q,height:q,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:q,height:q/2,background:oe,clipPath:{_multi_value_:!0,value:[`polygon(${A}px 100%, 50% ${A}px, ${2*_e-A}px 100%, ${A}px 100%)`,`path('M ${ue} ${o} A ${fe} ${fe} 0 0 0 ${G} ${D} L ${f} ${u} A ${ve} ${ve} 0 0 1 ${g} ${p} L ${I} ${H} A ${fe} ${fe} 0 0 0 ${L} ${w} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:O,height:O,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${ve}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:W,zIndex:0,background:"transparent"}}}},78673:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return V}});var F=b(58617),q=b(92310),ve=b.n(q),fe=b(96663),oe=b(90493),W=b(72071),_e=b(6620),ue=b(59301),o=b(18929),G=b(10228),D=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],f=ue.forwardRef(function(T,C){var R,z=T.prefixCls,Z=z===void 0?"rc-switch":z,v=T.className,y=T.checked,$=T.defaultChecked,j=T.disabled,me=T.loadingIcon,xe=T.checkedChildren,Re=T.unCheckedChildren,Ie=T.onClick,et=T.onChange,ot=T.onKeyDown,Ve=(0,_e.Z)(T,D),Rt=(0,o.Z)(!1,{value:y,defaultValue:$}),dt=(0,W.Z)(Rt,2),St=dt[0],At=dt[1];function ke(Y,M){var pe=St;return j||(pe=Y,At(pe),et==null||et(pe,M)),pe}function Ye(Y){Y.which===G.Z.LEFT?ke(!1,Y):Y.which===G.Z.RIGHT&&ke(!0,Y),ot==null||ot(Y)}function Q(Y){var M=ke(!St,Y);Ie==null||Ie(M,Y)}var ce=ve()(Z,v,(R={},(0,oe.Z)(R,"".concat(Z,"-checked"),St),(0,oe.Z)(R,"".concat(Z,"-disabled"),j),R));return ue.createElement("button",(0,fe.Z)({},Ve,{type:"button",role:"switch","aria-checked":St,disabled:j,className:ce,ref:C,onKeyDown:Ye,onClick:Q}),me,ue.createElement("span",{className:"".concat(Z,"-inner")},ue.createElement("span",{className:"".concat(Z,"-inner-checked")},xe),ue.createElement("span",{className:"".concat(Z,"-inner-unchecked")},Re)))});f.displayName="Switch";var u=f,g=b(14088),p=b(36355),I=b(1684),H=b(19716),L=b(64993),w=b(17313),O=b(83116),A=b(37613);const E=T=>{const{componentCls:C,trackHeightSM:R,trackPadding:z,trackMinWidthSM:Z,innerMinMarginSM:v,innerMaxMarginSM:y,handleSizeSM:$}=T,j=`${C}-inner`;return{[C]:{[`&${C}-small`]:{minWidth:Z,height:R,lineHeight:`${R}px`,[`${C}-inner`]:{paddingInlineStart:y,paddingInlineEnd:v,[`${j}-checked`]:{marginInlineStart:`calc(-100% + ${$+z*2}px - ${y*2}px)`,marginInlineEnd:`calc(100% - ${$+z*2}px + ${y*2}px)`},[`${j}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`${C}-handle`]:{width:$,height:$},[`${C}-loading-icon`]:{top:($-T.switchLoadingIconSize)/2,fontSize:T.switchLoadingIconSize},[`&${C}-checked`]:{[`${C}-inner`]:{paddingInlineStart:v,paddingInlineEnd:y,[`${j}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${j}-unchecked`]:{marginInlineStart:`calc(100% - ${$+z*2}px + ${y*2}px)`,marginInlineEnd:`calc(-100% + ${$+z*2}px - ${y*2}px)`}},[`${C}-handle`]:{insetInlineStart:`calc(100% - ${$+z}px)`}},[`&:not(${C}-disabled):active`]:{[`&:not(${C}-checked) ${j}`]:{[`${j}-unchecked`]:{marginInlineStart:T.marginXXS/2,marginInlineEnd:-T.marginXXS/2}},[`&${C}-checked ${j}`]:{[`${j}-checked`]:{marginInlineStart:-T.marginXXS/2,marginInlineEnd:T.marginXXS/2}}}}}}},J=T=>{const{componentCls:C,handleSize:R}=T;return{[C]:{[`${C}-loading-icon${T.iconCls}`]:{position:"relative",top:(R-T.fontSize)/2,color:T.switchLoadingIconColor,verticalAlign:"top"},[`&${C}-checked ${C}-loading-icon`]:{color:T.switchColor}}}},te=T=>{const{componentCls:C,motion:R,trackPadding:z,handleBg:Z,handleShadow:v,handleSize:y}=T,$=`${C}-handle`;return{[C]:{[$]:{position:"absolute",top:z,insetInlineStart:z,width:y,height:y,transition:`all ${T.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Z,borderRadius:y/2,boxShadow:v,transition:`all ${T.switchDuration} ease-in-out`,content:'""'}},[`&${C}-checked ${$}`]:{insetInlineStart:`calc(100% - ${y+z}px)`},[`&:not(${C}-disabled):active`]:R?{[`${$}::before`]:{insetInlineEnd:T.switchHandleActiveInset,insetInlineStart:0},[`&${C}-checked ${$}::before`]:{insetInlineEnd:0,insetInlineStart:T.switchHandleActiveInset}}:{}}}},ne=T=>{const{componentCls:C,trackHeight:R,trackPadding:z,innerMinMargin:Z,innerMaxMargin:v,handleSize:y}=T,$=`${C}-inner`;return{[C]:{[$]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:v,paddingInlineEnd:Z,transition:`padding-inline-start ${T.switchDuration} ease-in-out, padding-inline-end ${T.switchDuration} ease-in-out`,[`${$}-checked, ${$}-unchecked`]:{display:"block",color:T.colorTextLightSolid,fontSize:T.fontSizeSM,transition:`margin-inline-start ${T.switchDuration} ease-in-out, margin-inline-end ${T.switchDuration} ease-in-out`,pointerEvents:"none"},[`${$}-checked`]:{marginInlineStart:`calc(-100% + ${y+z*2}px - ${v*2}px)`,marginInlineEnd:`calc(100% - ${y+z*2}px + ${v*2}px)`},[`${$}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`&${C}-checked ${$}`]:{paddingInlineStart:Z,paddingInlineEnd:v,[`${$}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${$}-unchecked`]:{marginInlineStart:`calc(100% - ${y+z*2}px + ${v*2}px)`,marginInlineEnd:`calc(-100% + ${y+z*2}px - ${v*2}px)`}},[`&:not(${C}-disabled):active`]:{[`&:not(${C}-checked) ${$}`]:{[`${$}-unchecked`]:{marginInlineStart:z*2,marginInlineEnd:-z*2}},[`&${C}-checked ${$}`]:{[`${$}-checked`]:{marginInlineStart:-z*2,marginInlineEnd:z*2}}}}}},ye=T=>{const{componentCls:C,trackHeight:R,trackMinWidth:z}=T;return{[C]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(T)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:z,height:R,lineHeight:`${R}px`,verticalAlign:"middle",background:T.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${T.motionDurationMid}`,userSelect:"none",[`&:hover:not(${C}-disabled)`]:{background:T.colorTextTertiary}}),(0,w.Qy)(T)),{[`&${C}-checked`]:{background:T.switchColor,[`&:hover:not(${C}-disabled)`]:{background:T.colorPrimaryHover}},[`&${C}-loading, &${C}-disabled`]:{cursor:"not-allowed",opacity:T.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${C}-rtl`]:{direction:"rtl"}})}};var we=(0,O.Z)("Switch",T=>{const C=(0,A.TS)(T,{switchDuration:T.motionDurationMid,switchColor:T.colorPrimary,switchDisabledOpacity:T.opacityLoading,switchLoadingIconSize:T.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${T.opacityLoading})`,switchHandleActiveInset:"-30%"});return[ye(C),ne(C),te(C),J(C),E(C)]},T=>{const{fontSize:C,lineHeight:R,controlHeight:z,colorWhite:Z}=T,v=C*R,y=z/2,$=2,j=v-$*2,me=y-$*2;return{trackHeight:v,trackHeightSM:y,trackMinWidth:j*2+$*4,trackMinWidthSM:me*2+$*2,trackPadding:$,handleBg:Z,handleSize:j,handleSizeSM:me,handleShadow:`0 2px 4px 0 ${new L.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:j/2,innerMaxMargin:j+$+$*2,innerMinMarginSM:me/2,innerMaxMarginSM:me+$+$*2}}),Se=function(T,C){var R={};for(var z in T)Object.prototype.hasOwnProperty.call(T,z)&&C.indexOf(z)<0&&(R[z]=T[z]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Z=0,z=Object.getOwnPropertySymbols(T);Z{const{prefixCls:R,size:z,disabled:Z,loading:v,className:y,rootClassName:$,style:j}=T,me=Se(T,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:xe,direction:Re,switch:Ie}=ue.useContext(p.E_),et=ue.useContext(I.Z),ot=(Z!=null?Z:et)||v,Ve=xe("switch",R),Rt=ue.createElement("div",{className:`${Ve}-handle`},v&&ue.createElement(F.Z,{className:`${Ve}-loading-icon`})),[dt,St]=we(Ve),At=(0,H.Z)(z),ke=ve()(Ie==null?void 0:Ie.className,{[`${Ve}-small`]:At==="small",[`${Ve}-loading`]:v,[`${Ve}-rtl`]:Re==="rtl"},y,$,St),Ye=Object.assign(Object.assign({},Ie==null?void 0:Ie.style),j);return dt(ue.createElement(g.Z,{component:"Switch"},ue.createElement(u,Object.assign({},me,{prefixCls:Ve,className:ke,style:Ye,disabled:ot,ref:C,loadingIcon:Rt}))))});he.__ANT_SWITCH=!0;var V=he},33166:function(yt,Pe,b){"use strict";b.d(Pe,{i:function(){return F}});const F=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return q}});var F=b(33166);function q(ve,fe){return F.i.reduce((oe,W)=>{const _e=ve[`${W}1`],ue=ve[`${W}3`],o=ve[`${W}6`],G=ve[`${W}7`];return Object.assign(Object.assign({},oe),fe(W,{lightColor:_e,lightBorderColor:ue,darkColor:o,textColor:G}))},{})}},6848:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return Se}});var F=b(59301),q=b(92310),ve=b.n(q),fe=b(55477),oe=b(18929),W=b(62892),_e=b(79676),ue=b(92343),o=b(36355),G=b(33234),D=b(88088),f=b(17313),u=b(29878),g=b(19447),p=b(45157),I=b(37613),H=b(83116);const L=he=>{const{componentCls:V,tooltipMaxWidth:T,tooltipColor:C,tooltipBg:R,tooltipBorderRadius:z,zIndexPopup:Z,controlHeight:v,boxShadowSecondary:y,paddingSM:$,paddingXS:j,tooltipRadiusOuter:me}=he;return[{[V]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,f.Wf)(he)),{position:"absolute",zIndex:Z,display:"block",width:"max-content",maxWidth:T,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":R,[`${V}-inner`]:{minWidth:v,minHeight:v,padding:`${$/2}px ${j}px`,color:C,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:R,borderRadius:z,boxShadow:y,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${V}-inner`]:{borderRadius:Math.min(z,g.qN)}},[`${V}-content`]:{position:"relative"}}),(0,p.Z)(he,(xe,Re)=>{let{darkColor:Ie}=Re;return{[`&${V}-${xe}`]:{[`${V}-inner`]:{backgroundColor:Ie},[`${V}-arrow`]:{"--antd-arrow-background-color":Ie}}}})),{"&-rtl":{direction:"rtl"}})},(0,g.ZP)((0,I.TS)(he,{borderRadiusOuter:me}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:z,limitVerticalRadius:!0}),{[`${V}-pure`]:{position:"relative",maxWidth:"none",margin:he.sizePopupArrow}}]};var w=(he,V)=>(0,H.Z)("Tooltip",C=>{if(V===!1)return[];const{borderRadius:R,colorTextLightSolid:z,colorBgDefault:Z,borderRadiusOuter:v}=C,y=(0,I.TS)(C,{tooltipMaxWidth:250,tooltipColor:z,tooltipBorderRadius:R,tooltipBg:Z,tooltipRadiusOuter:v>4?4:v});return[L(y),(0,u._y)(C,"zoom-big-fast")]},C=>{let{zIndexPopupBase:R,colorBgSpotlight:z}=C;return{zIndexPopup:R+70,colorBgDefault:z}},{resetStyle:!1})(he),O=b(36785);function A(he,V){const T=(0,O.o2)(V),C=ve()({[`${he}-${V}`]:V&&T}),R={},z={};return V&&!T&&(R.background=V,z["--antd-arrow-background-color"]=V),{className:C,overlayStyle:R,arrowStyle:z}}var J=he=>{const{prefixCls:V,className:T,placement:C="top",title:R,color:z,overlayInnerStyle:Z}=he,{getPrefixCls:v}=F.useContext(o.E_),y=v("tooltip",V),[$,j]=w(y,!0),me=A(y,z),xe=me.arrowStyle,Re=Object.assign(Object.assign({},Z),me.overlayStyle),Ie=ve()(j,y,`${y}-pure`,`${y}-placement-${C}`,T,me.className);return $(F.createElement("div",{className:Ie,style:xe},F.createElement("div",{className:`${y}-arrow`}),F.createElement(fe.G,Object.assign({},he,{className:j,prefixCls:y,overlayInnerStyle:Re}),R)))},te=function(he,V){var T={};for(var C in he)Object.prototype.hasOwnProperty.call(he,C)&&V.indexOf(C)<0&&(T[C]=he[C]);if(he!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,C=Object.getOwnPropertySymbols(he);R{const T={},C=Object.assign({},he);return V.forEach(R=>{he&&R in he&&(T[R]=he[R],delete C[R])}),{picked:T,omitted:C}};function ye(he,V){const T=he.type;if((T.__ANT_BUTTON===!0||he.type==="button")&&he.props.disabled||T.__ANT_SWITCH===!0&&(he.props.disabled||he.props.loading)||T.__ANT_RADIO===!0&&he.props.disabled){const{picked:C,omitted:R}=ne(he.props.style,["position","left","right","top","bottom","float","display","zIndex"]),z=Object.assign(Object.assign({display:"inline-block"},C),{cursor:"not-allowed",width:he.props.block?"100%":void 0}),Z=Object.assign(Object.assign({},R),{pointerEvents:"none"}),v=(0,ue.Tm)(he,{style:Z,className:null});return F.createElement("span",{style:z,className:ve()(he.props.className,`${V}-disabled-compatible-wrapper`)},v)}return he}const we=F.forwardRef((he,V)=>{var T,C;const{prefixCls:R,openClassName:z,getTooltipContainer:Z,overlayClassName:v,color:y,overlayInnerStyle:$,children:j,afterOpenChange:me,afterVisibleChange:xe,destroyTooltipOnHide:Re,arrow:Ie=!0,title:et,overlay:ot,builtinPlacements:Ve,arrowPointAtCenter:Rt=!1,autoAdjustOverflow:dt=!0}=he,St=!!Ie,[,At]=(0,D.Z)(),{getPopupContainer:ke,getPrefixCls:Ye,direction:Q}=F.useContext(o.E_),ce=F.useRef(null),Y=()=>{var ht;(ht=ce.current)===null||ht===void 0||ht.forceAlign()};F.useImperativeHandle(V,()=>({forceAlign:Y,forcePopupAlign:()=>{Y()}}));const[M,pe]=(0,oe.Z)(!1,{value:(T=he.open)!==null&&T!==void 0?T:he.visible,defaultValue:(C=he.defaultOpen)!==null&&C!==void 0?C:he.defaultVisible}),k=!et&&!ot&&et!==0,B=ht=>{var mt,Tt;pe(k?!1:ht),k||((mt=he.onOpenChange)===null||mt===void 0||mt.call(he,ht),(Tt=he.onVisibleChange)===null||Tt===void 0||Tt.call(he,ht))},P=F.useMemo(()=>{var ht,mt;let Tt=Rt;return typeof Ie=="object"&&(Tt=(mt=(ht=Ie.pointAtCenter)!==null&&ht!==void 0?ht:Ie.arrowPointAtCenter)!==null&&mt!==void 0?mt:Rt),Ve||(0,_e.Z)({arrowPointAtCenter:Tt,autoAdjustOverflow:dt,arrowWidth:St?At.sizePopupArrow:0,borderRadius:At.borderRadius,offset:At.marginXXS,visibleFirst:!0})},[Rt,Ie,Ve,At]),re=F.useMemo(()=>et===0?et:ot||et||"",[ot,et]),N=F.createElement(G.BR,null,typeof re=="function"?re():re),{getPopupContainer:ae,placement:le="top",mouseEnterDelay:ge=.1,mouseLeaveDelay:Ee=.1,overlayStyle:Ce,rootClassName:Ne}=he,Ke=te(he,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Oe=Ye("tooltip",R),He=Ye(),Ze=he["data-popover-inject"];let Le=M;!("open"in he)&&!("visible"in he)&&k&&(Le=!1);const ut=ye((0,ue.l$)(j)&&!(0,ue.M2)(j)?j:F.createElement("span",null,j),Oe),ft=ut.props,wt=!ft.className||typeof ft.className=="string"?ve()(ft.className,z||`${Oe}-open`):ft.className,[Qe,Kt]=w(Oe,!Ze),Wt=A(Oe,y),Gt=Wt.arrowStyle,Mt=Object.assign(Object.assign({},$),Wt.overlayStyle),pt=ve()(v,{[`${Oe}-rtl`]:Q==="rtl"},Wt.className,Ne,Kt);return Qe(F.createElement(fe.Z,Object.assign({},Ke,{showArrow:St,placement:le,mouseEnterDelay:ge,mouseLeaveDelay:Ee,prefixCls:Oe,overlayClassName:pt,overlayStyle:Object.assign(Object.assign({},Gt),Ce),getTooltipContainer:ae||Z||ke,ref:ce,builtinPlacements:P,overlay:N,visible:Le,onVisibleChange:B,afterVisibleChange:me!=null?me:xe,overlayInnerStyle:Mt,arrowContent:F.createElement("span",{className:`${Oe}-arrow-content`}),motion:{motionName:(0,W.m)(He,"zoom-big-fast",he.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Re}),Le?(0,ue.Tm)(ut,{className:wt}):ut))});we._InternalPanelDoNotUseOrYouWillBeFired=J;var Se=we},17574:function(yt,Pe,b){"use strict";b.d(Pe,{default:function(){return y}});var F=b(43858),q=b(19127),ve=b(52671),fe=b(8657),oe=b(96663),W=b(59301),_e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},ue=_e,o=b(7657),G=function(j,me){return W.createElement(o.Z,(0,oe.Z)({},j,{ref:me,icon:ue}))},D=W.forwardRef(G),f=D,u=b(92310),g=b.n(u),p=b(35654),I=b(71430),H=b(36355),L=b(56082),w=b(62892),O=b(20648);const A=4;function E($){const{dropPosition:j,dropLevelOffset:me,prefixCls:xe,indent:Re,direction:Ie="ltr"}=$,et=Ie==="ltr"?"left":"right",ot=Ie==="ltr"?"right":"left",Ve={[et]:-me*Re+A,[ot]:0};switch(j){case-1:Ve.top=-3;break;case 1:Ve.bottom=-3;break;default:Ve.bottom=-3,Ve[et]=Re+A;break}return W.createElement("div",{style:Ve,className:`${xe}-drop-indicator`})}var J=b(71997),ne=W.forwardRef(($,j)=>{const{getPrefixCls:me,direction:xe,virtual:Re,tree:Ie}=W.useContext(H.E_),{prefixCls:et,className:ot,showIcon:Ve=!1,showLine:Rt,switcherIcon:dt,blockNode:St=!1,children:At,checkable:ke=!1,selectable:Ye=!0,draggable:Q,motion:ce,style:Y}=$,M=me("tree",et),pe=me(),k=ce!=null?ce:Object.assign(Object.assign({},(0,w.Z)(pe)),{motionAppear:!1}),B=Object.assign(Object.assign({},$),{checkable:ke,selectable:Ye,showIcon:Ve,motion:k,blockNode:St,showLine:!!Rt,dropIndicatorRender:E}),[P,re]=(0,O.ZP)(M),N=W.useMemo(()=>{if(!Q)return!1;let le={};switch(typeof Q){case"function":le.nodeDraggable=Q;break;case"object":le=Object.assign({},Q);break;default:break}return le.icon!==!1&&(le.icon=le.icon||W.createElement(L.Z,null)),le},[Q]),ae=le=>W.createElement(J.Z,{prefixCls:M,switcherIcon:dt,treeNodeProps:le,showLine:Rt});return P(W.createElement(F.Z,Object.assign({itemHeight:20,ref:j,virtual:Re},B,{style:Object.assign(Object.assign({},Ie==null?void 0:Ie.style),Y),prefixCls:M,className:g()({[`${M}-icon-hide`]:!Ve,[`${M}-block-node`]:St,[`${M}-unselectable`]:!Ye,[`${M}-rtl`]:xe==="rtl"},Ie==null?void 0:Ie.className,ot,re),direction:xe,checkable:ke&&W.createElement("span",{className:`${M}-checkbox-inner`}),selectable:Ye,switcherIcon:ae,draggable:N}),At))}),ye;(function($){$[$.None=0]="None",$[$.Start=1]="Start",$[$.End=2]="End"})(ye||(ye={}));function we($,j){function me(xe){const{key:Re,children:Ie}=xe;j(Re,xe)!==!1&&we(Ie||[],j)}$.forEach(me)}function Se($){let{treeData:j,expandedKeys:me,startKey:xe,endKey:Re}=$;const Ie=[];let et=ye.None;if(xe&&xe===Re)return[xe];if(!xe||!Re)return[];function ot(Ve){return Ve===xe||Ve===Re}return we(j,Ve=>{if(et===ye.End)return!1;if(ot(Ve)){if(Ie.push(Ve),et===ye.None)et=ye.Start;else if(et===ye.Start)return et=ye.End,!1}else et===ye.Start&&Ie.push(Ve);return me.includes(Ve)}),Ie}function he($,j){const me=(0,q.Z)(j),xe=[];return we($,(Re,Ie)=>{const et=me.indexOf(Re);return et!==-1&&(xe.push(Ie),me.splice(et,1)),!!me.length}),xe}var V=function($,j){var me={};for(var xe in $)Object.prototype.hasOwnProperty.call($,xe)&&j.indexOf(xe)<0&&(me[xe]=$[xe]);if($!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Re=0,xe=Object.getOwnPropertySymbols($);Re{var{defaultExpandAll:me,defaultExpandParent:xe,defaultExpandedKeys:Re}=$,Ie=V($,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const et=W.useRef(),ot=W.useRef(),Ve=()=>{const{keyEntities:N}=(0,I.I8)(C(Ie));let ae;return me?ae=Object.keys(N):xe?ae=(0,p.r7)(Ie.expandedKeys||Re||[],N):ae=Ie.expandedKeys||Re,ae},[Rt,dt]=W.useState(Ie.selectedKeys||Ie.defaultSelectedKeys||[]),[St,At]=W.useState(()=>Ve());W.useEffect(()=>{"selectedKeys"in Ie&&dt(Ie.selectedKeys)},[Ie.selectedKeys]),W.useEffect(()=>{"expandedKeys"in Ie&&At(Ie.expandedKeys)},[Ie.expandedKeys]);const ke=(N,ae)=>{var le;return"expandedKeys"in Ie||At(N),(le=Ie.onExpand)===null||le===void 0?void 0:le.call(Ie,N,ae)},Ye=(N,ae)=>{var le;const{multiple:ge}=Ie,{node:Ee,nativeEvent:Ce}=ae,{key:Ne=""}=Ee,Ke=C(Ie),Oe=Object.assign(Object.assign({},ae),{selected:!0}),He=(Ce==null?void 0:Ce.ctrlKey)||(Ce==null?void 0:Ce.metaKey),Ze=Ce==null?void 0:Ce.shiftKey;let Le;ge&&He?(Le=N,et.current=Ne,ot.current=Le,Oe.selectedNodes=he(Ke,Le)):ge&&Ze?(Le=Array.from(new Set([].concat((0,q.Z)(ot.current||[]),(0,q.Z)(Se({treeData:Ke,expandedKeys:St,startKey:Ne,endKey:et.current}))))),Oe.selectedNodes=he(Ke,Le)):(Le=[Ne],et.current=Ne,ot.current=Le,Oe.selectedNodes=he(Ke,Le)),(le=Ie.onSelect)===null||le===void 0||le.call(Ie,Le,Oe),"selectedKeys"in Ie||dt(Le)},{getPrefixCls:Q,direction:ce}=W.useContext(H.E_),{prefixCls:Y,className:M,showIcon:pe=!0,expandAction:k="click"}=Ie,B=V(Ie,["prefixCls","className","showIcon","expandAction"]),P=Q("tree",Y),re=g()(`${P}-directory`,{[`${P}-directory-rtl`]:ce==="rtl"},M);return W.createElement(ne,Object.assign({icon:T,ref:j,blockNode:!0},B,{showIcon:pe,expandAction:k,prefixCls:P,className:re,expandedKeys:St,selectedKeys:Rt,onSelect:Ye,onExpand:ke}))};var Z=W.forwardRef(R);const v=ne;v.DirectoryTree=Z,v.TreeNode=F.O;var y=v},20648:function(yt,Pe,b){"use strict";b.d(Pe,{TM:function(){return u},Yk:function(){return f}});var F=b(93083),q=b(98447),ve=b(17313),fe=b(8378),oe=b(37613),W=b(83116);const _e=new F.Keyframes("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),ue=(g,p)=>({[`.${g}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${p.motionDurationSlow}`}}}),o=(g,p)=>({[`.${g}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:p.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${p.lineWidthBold}px solid ${p.colorPrimary}`,borderRadius:"50%",content:'""'}}}),G=(g,p)=>{const{treeCls:I,treeNodeCls:H,treeNodePadding:L,titleHeight:w,nodeSelectedBg:O,nodeHoverBg:A}=p,E=p.paddingXS;return{[I]:Object.assign(Object.assign({},(0,ve.Wf)(p)),{background:p.colorBgContainer,borderRadius:p.borderRadius,transition:`background-color ${p.motionDurationSlow}`,[`&${I}-rtl`]:{[`${I}-switcher`]:{"&_close":{[`${I}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${I}-active-focused)`]:Object.assign({},(0,ve.oN)(p)),[`${I}-list-holder-inner`]:{alignItems:"flex-start"},[`&${I}-block-node`]:{[`${I}-list-holder-inner`]:{alignItems:"stretch",[`${I}-node-content-wrapper`]:{flex:"auto"},[`${H}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:L,insetInlineStart:0,border:`1px solid ${p.colorPrimary}`,opacity:0,animationName:_e,animationDuration:p.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${H}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${L}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${I}-node-content-wrapper`]:{color:p.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${I}-node-content-wrapper`]:Object.assign({},(0,ve.oN)(p)),[`&:not(${H}-disabled).filter-node ${I}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${I}-draggable-icon`]:{flexShrink:0,width:w,lineHeight:`${w}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${p.motionDurationSlow}`,[`${H}:hover &`]:{opacity:.45}},[`&${H}-disabled`]:{[`${I}-draggable-icon`]:{visibility:"hidden"}}}},[`${I}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:w}},[`${I}-draggable-icon`]:{visibility:"hidden"},[`${I}-switcher`]:Object.assign(Object.assign({},ue(g,p)),{position:"relative",flex:"none",alignSelf:"stretch",width:w,margin:0,lineHeight:`${w}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${I}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:p.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,marginInlineStart:-1,borderInlineEnd:`1px solid ${p.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:w/2*.8,height:w/2,borderBottom:`1px solid ${p.colorBorder}`,content:'""'}}}),[`${I}-checkbox`]:{top:"initial",marginInlineEnd:E},[`${I}-node-content-wrapper, ${I}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:w,margin:0,padding:`0 ${p.paddingXS/2}px`,color:"inherit",lineHeight:`${w}px`,background:"transparent",borderRadius:p.borderRadius,cursor:"pointer",transition:`all ${p.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:A},[`&${I}-node-selected`]:{backgroundColor:O},[`${I}-iconEle`]:{display:"inline-block",width:w,height:w,lineHeight:`${w}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${I}-unselectable ${I}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${I}-node-content-wrapper`]:Object.assign({lineHeight:`${w}px`,userSelect:"none"},o(g,p)),[`${H}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${p.colorPrimary}`}},"&-show-line":{[`${I}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,borderInlineEnd:`1px solid ${p.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${I}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${H}-leaf-last`]:{[`${I}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${w/2}px !important`}}}}})}},D=g=>{const{treeCls:p,treeNodeCls:I,treeNodePadding:H,directoryNodeSelectedBg:L,directoryNodeSelectedColor:w}=g;return{[`${p}${p}-directory`]:{[I]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:H,insetInlineStart:0,transition:`background-color ${g.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:g.controlItemBgHover}},"> *":{zIndex:1},[`${p}-switcher`]:{transition:`color ${g.motionDurationMid}`},[`${p}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${p}-node-selected`]:{color:w,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:L},[`${p}-switcher`]:{color:w},[`${p}-node-content-wrapper`]:{color:w,background:"transparent"}}}}}},f=(g,p)=>{const I=`.${g}`,H=`${I}-treenode`,L=p.paddingXS/2,w=(0,oe.TS)(p,{treeCls:I,treeNodeCls:H,treeNodePadding:L});return[G(g,w),D(w)]},u=g=>{const{controlHeightSM:p}=g;return{titleHeight:p,nodeHoverBg:g.controlItemBgHover,nodeSelectedBg:g.controlItemBgActive}};Pe.ZP=(0,W.Z)("Tree",(g,p)=>{let{prefixCls:I}=p;return[{[g.componentCls]:(0,q.C2)(`${I}-checkbox`,g)},f(I,g),(0,fe.Z)(g)]},g=>{const{colorTextLightSolid:p,colorPrimary:I}=g;return Object.assign(Object.assign({},u(g)),{directoryNodeSelectedColor:p,directoryNodeSelectedBg:I})})},71997:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return H}});var F=b(96663),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},fe=ve,oe=b(7657),W=function(w,O){return q.createElement(oe.Z,(0,F.Z)({},w,{ref:O,icon:fe}))},_e=q.forwardRef(W),ue=_e,o=b(52671),G=b(58617),D=b(15075),f=b(43531),u=b(92310),g=b.n(u),p=b(92343),H=L=>{const{prefixCls:w,switcherIcon:O,treeNodeProps:A,showLine:E}=L,{isLeaf:J,expanded:te,loading:ne}=A;if(ne)return q.createElement(G.Z,{className:`${w}-switcher-loading-icon`});let ye;if(E&&typeof E=="object"&&(ye=E.showLeafIcon),J){if(!E)return null;if(typeof ye!="boolean"&&ye){const he=typeof ye=="function"?ye(A):ye,V=`${w}-switcher-line-custom-icon`;return(0,p.l$)(he)?(0,p.Tm)(he,{className:g()(he.props.className||"",V)}):he}return ye?q.createElement(o.Z,{className:`${w}-switcher-line-icon`}):q.createElement("span",{className:`${w}-switcher-leaf-line`})}const we=`${w}-switcher-icon`,Se=typeof O=="function"?O(A):O;return(0,p.l$)(Se)?(0,p.Tm)(Se,{className:g()(Se.props.className||"",we)}):Se!==void 0?Se:E?te?q.createElement(D.Z,{className:`${w}-switcher-line-icon`}):q.createElement(f.Z,{className:`${w}-switcher-line-icon`}):q.createElement(ue,{className:we})}},25769:function(yt,Pe,b){"use strict";var F=b(98040),q={"text/plain":"Text","text/html":"Url",default:"Text"},ve="Copy to clipboard: #{key}, Enter";function fe(W){var _e=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return W.replace(/#{\s*key\s*}/g,_e)}function oe(W,_e){var ue,o,G,D,f,u,g=!1;_e||(_e={}),ue=_e.debug||!1;try{G=F(),D=document.createRange(),f=document.getSelection(),u=document.createElement("span"),u.textContent=W,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(I){if(I.stopPropagation(),_e.format)if(I.preventDefault(),typeof I.clipboardData=="undefined"){ue&&console.warn("unable to use e.clipboardData"),ue&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var H=q[_e.format]||q.default;window.clipboardData.setData(H,W)}else I.clipboardData.clearData(),I.clipboardData.setData(_e.format,W);_e.onCopy&&(I.preventDefault(),_e.onCopy(I.clipboardData))}),document.body.appendChild(u),D.selectNodeContents(u),f.addRange(D);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");g=!0}catch(I){ue&&console.error("unable to copy using execCommand: ",I),ue&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(_e.format||"text",W),_e.onCopy&&_e.onCopy(window.clipboardData),g=!0}catch(H){ue&&console.error("unable to copy using clipboardData: ",H),ue&&console.error("falling back to prompt"),o=fe("message"in _e?_e.message:ve),window.prompt(o,W)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(D):f.removeAllRanges()),u&&document.body.removeChild(u),G()}return g}yt.exports=oe},3867:function(yt,Pe,b){var F=b(97671);(function(q,ve){yt.exports=ve()})(this,function(){"use strict";function q(B){var P=typeof B;return B!==null&&(P==="object"||P==="function")}function ve(B){return typeof B=="function"}var fe=void 0;Array.isArray?fe=Array.isArray:fe=function(B){return Object.prototype.toString.call(B)==="[object Array]"};var oe=fe,W=0,_e=void 0,ue=void 0,o=function(P,re){E[W]=P,E[W+1]=re,W+=2,W===2&&(ue?ue(J):ne())};function G(B){ue=B}function D(B){o=B}var f=typeof window!="undefined"?window:void 0,u=f||{},g=u.MutationObserver||u.WebKitMutationObserver,p=typeof self=="undefined"&&typeof F!="undefined"&&{}.toString.call(F)==="[object process]",I=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function H(){return function(){return F.nextTick(J)}}function L(){return typeof _e!="undefined"?function(){_e(J)}:A()}function w(){var B=0,P=new g(J),re=document.createTextNode("");return P.observe(re,{characterData:!0}),function(){re.data=B=++B%2}}function O(){var B=new MessageChannel;return B.port1.onmessage=J,function(){return B.port2.postMessage(0)}}function A(){var B=setTimeout;return function(){return B(J,1)}}var E=new Array(1e3);function J(){for(var B=0;B0&&(ne=A[0]),ne instanceof Error)throw ne;var ye=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw ye.context=ne,ye}var we=te[O];if(we===void 0)return!1;if(typeof we=="function")b(we,this,A);else for(var Se=we.length,he=u(we,Se),E=0;E0&&ne.length>J&&!ne.warned){ne.warned=!0;var ye=new Error("Possible EventEmitter memory leak detected. "+ne.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");ye.name="MaxListenersExceededWarning",ye.emitter=w,ye.type=O,ye.count=ne.length,q(ye)}return w}fe.prototype.addListener=function(O,A){return ue(this,O,A,!1)},fe.prototype.on=fe.prototype.addListener,fe.prototype.prependListener=function(O,A){return ue(this,O,A,!0)};function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function G(w,O,A){var E={fired:!1,wrapFn:void 0,target:w,type:O,listener:A},J=o.bind(E);return J.listener=A,E.wrapFn=J,J}fe.prototype.once=function(O,A){return W(A),this.on(O,G(this,O,A)),this},fe.prototype.prependOnceListener=function(O,A){return W(A),this.prependListener(O,G(this,O,A)),this},fe.prototype.removeListener=function(O,A){var E,J,te,ne,ye;if(W(A),J=this._events,J===void 0)return this;if(E=J[O],E===void 0)return this;if(E===A||E.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete J[O],J.removeListener&&this.emit("removeListener",O,E.listener||A));else if(typeof E!="function"){for(te=-1,ne=E.length-1;ne>=0;ne--)if(E[ne]===A||E[ne].listener===A){ye=E[ne].listener,te=ne;break}if(te<0)return this;te===0?E.shift():g(E,te),E.length===1&&(J[O]=E[0]),J.removeListener!==void 0&&this.emit("removeListener",O,ye||A)}return this},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(O){var A,E,J;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[O]),this;if(arguments.length===0){var te=Object.keys(E),ne;for(J=0;J=0;J--)this.removeListener(O,A[J]);return this};function D(w,O,A){var E=w._events;if(E===void 0)return[];var J=E[O];return J===void 0?[]:typeof J=="function"?A?[J.listener||J]:[J]:A?p(J):u(J,J.length)}fe.prototype.listeners=function(O){return D(this,O,!0)},fe.prototype.rawListeners=function(O){return D(this,O,!1)},fe.listenerCount=function(w,O){return typeof w.listenerCount=="function"?w.listenerCount(O):f.call(w,O)},fe.prototype.listenerCount=f;function f(w){var O=this._events;if(O!==void 0){var A=O[w];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}fe.prototype.eventNames=function(){return this._eventsCount>0?F(this._events):[]};function u(w,O){for(var A=new Array(O),E=0;E>>6)+ue(128|C&63):ue(224|C>>>12&15)+ue(128|C>>>6&63)+ue(128|C&63)}else{var C=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return ue(240|C>>>18&7)+ue(128|C>>>12&63)+ue(128|C>>>6&63)+ue(128|C&63)}},G=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(G,o)},f=function(T){var C=[0,2,1][T.length%3],R=T.charCodeAt(0)<<16|(T.length>1?T.charCodeAt(1):0)<<8|(T.length>2?T.charCodeAt(2):0),z=[W.charAt(R>>>18),W.charAt(R>>>12&63),C>=2?"=":W.charAt(R>>>6&63),C>=1?"=":W.charAt(R&63)];return z.join("")},u=ve.btoa&&typeof ve.btoa=="function"?function(T){return ve.btoa(T)}:function(T){if(T.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return T.replace(/[\s\S]{1,3}/g,f)},g=function(T){return u(D(String(T)))},p=function(T){return T.replace(/[+\/]/g,function(C){return C=="+"?"-":"_"}).replace(/=/g,"")},I=function(T,C){return C?p(g(T)):g(T)},H=function(T){return I(T,!0)},L;ve.Uint8Array&&(L=function(T,C){for(var R="",z=0,Z=T.length;z>>18)+W.charAt(j>>>12&63)+(typeof y!="undefined"?W.charAt(j>>>6&63):"=")+(typeof $!="undefined"?W.charAt(j&63):"=")}return C?p(R):R});var w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(T){switch(T.length){case 4:var C=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),R=C-65536;return ue((R>>>10)+55296)+ue((R&1023)+56320);case 3:return ue((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return ue((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},A=function(T){return T.replace(w,O)},E=function(T){var C=T.length,R=C%4,z=(C>0?_e[T.charAt(0)]<<18:0)|(C>1?_e[T.charAt(1)]<<12:0)|(C>2?_e[T.charAt(2)]<<6:0)|(C>3?_e[T.charAt(3)]:0),Z=[ue(z>>>16),ue(z>>>8&255),ue(z&255)];return Z.length-=[0,0,2,1][R],Z.join("")},J=ve.atob&&typeof ve.atob=="function"?function(T){return ve.atob(T)}:function(T){return T.replace(/\S{1,4}/g,E)},te=function(T){return J(String(T).replace(/[^A-Za-z0-9\+\/]/g,""))},ne=function(T){return A(J(T))},ye=function(T){return String(T).replace(/[-_]/g,function(C){return C=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},we=function(T){return ne(ye(T))},Se;ve.Uint8Array&&(Se=function(T){return Uint8Array.from(te(ye(T)),function(C){return C.charCodeAt(0)})});var he=function(){var T=ve.Base64;return ve.Base64=fe,T};if(ve.Base64={VERSION:oe,atob:te,btoa:u,fromBase64:we,toBase64:I,utob:D,encode:I,encodeURI:H,btou:A,decode:we,noConflict:he,fromUint8Array:L,toUint8Array:Se},typeof Object.defineProperty=="function"){var V=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}};ve.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",V(function(){return we(this)})),Object.defineProperty(String.prototype,"toBase64",V(function(T){return I(this,T)})),Object.defineProperty(String.prototype,"toBase64URI",V(function(){return I(this,!0)}))}}return ve.Meteor&&(Base64=ve.Base64),yt.exports?yt.exports.Base64=ve.Base64:(F=[],q=function(){return ve.Base64}.apply(Pe,F),q!==void 0&&(yt.exports=q)),{Base64:ve.Base64}})},53184:function(yt,Pe,b){"use strict";var F,q;function ve(fe,oe,W){var _e=function(ue,o){return fe.js_beautify(ue,o)};return _e.js=fe.js_beautify,_e.css=oe.css_beautify,_e.html=W.html_beautify,_e.js_beautify=fe.js_beautify,_e.css_beautify=oe.css_beautify,_e.html_beautify=W.html_beautify,_e}F=[b(58553),b(87804),b(40998)],q=function(fe,oe,W){return ve(fe,oe,W)}.apply(Pe,F),q!==void 0&&(yt.exports=q)},87804:function(yt,Pe){var b,F;(function(){var q;(function(){"use strict";var fe=[,,function(ue){function o(f){this.__parent=f,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var f=new o(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},o.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},o.prototype.has_match=function(f){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(f){this.__items.push(f);var u=f.lastIndexOf(` `);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function G(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}G.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},G.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},G.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function D(f,u){this.__indent_cache=new G(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},D.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(` `);return f!==` `&&(g=g.replace(/[\n]/g,f)),g},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(f){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var p=this.__lines[g];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},ue.exports.Output=D},,,,function(ue){function o(f,u){this.raw_options=G(f,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(f,u){var g=this.raw_options[f],p=u||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(p=g.concat()):typeof g=="string"&&(p=g.split(/[^a-zA-Z0-9_\/\-]+/)),p},o.prototype._get_boolean=function(f,u){var g=this.raw_options[f],p=g===void 0?!!u:!!g;return p},o.prototype._get_characters=function(f,u){var g=this.raw_options[f],p=u||"";return typeof g=="string"&&(p=g.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),p},o.prototype._get_number=function(f,u){var g=this.raw_options[f];u=parseInt(u,10),isNaN(u)&&(u=0);var p=parseInt(g,10);return isNaN(p)&&(p=u),p},o.prototype._get_selection=function(f,u,g){var p=this._get_selection_list(f,u,g);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values: `+u+` You passed in: '`+this.raw_options[f]+"'");return p[0]},o.prototype._get_selection_list=function(f,u,g){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[u[0]],!this._is_valid_selection(g,u))throw new Error("Invalid Default Value!");var p=this._get_array(f,g);if(!this._is_valid_selection(p,u))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values: `+u+` You passed in: '`+this.raw_options[f]+"'");return p},o.prototype._is_valid_selection=function(f,u){return f.length&&u.length&&!f.some(function(g){return u.indexOf(g)===-1})};function G(f,u){var g={};f=D(f);var p;for(p in f)p!==u&&(g[p]=f[p]);if(u&&f[u])for(p in f[u])g[p]=f[u][p];return g}function D(f){var u={},g;for(g in f){var p=g.replace(/-/g,"_");u[p]=f[g]}return u}ue.exports.Options=o,ue.exports.normalizeOpts=D,ue.exports.mergeOpts=G},,function(ue){var o=RegExp.prototype.hasOwnProperty("sticky");function G(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position=0&&D=0&&f=D.length&&this.__input.substring(f-D.length,f).toLowerCase()===D},ue.exports.InputScanner=G},,,,,function(ue){function o(G,D){G=typeof G=="string"?G:G.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(G+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(G+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(G){if(!G.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(G);f;)D[f[1]]=f[2],f=this.__directive_pattern.exec(G);return D},o.prototype.readIgnored=function(G){return G.readUntilAfter(this.__directives_end_ignore_pattern)},ue.exports.Directives=o},,function(ue,o,G){var D=G(16).Beautifier,f=G(17).Options;function u(g,p){var I=new D(g,p);return I.beautify()}ue.exports=u,ue.exports.defaultOptions=function(){return new f}},function(ue,o,G){var D=G(17).Options,f=G(2).Output,u=G(8).InputScanner,g=G(13).Directives,p=new g(/\/\*/,/\*\//),I=/\r\n|[\r\n]/,H=/\r\n|[\r\n]/g,L=/\s/,w=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function E(J,te){this._source_text=J||"",this._options=new D(te),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"]}E.prototype.eatString=function(J){var te="";for(this._ch=this._input.next();this._ch;){if(te+=this._ch,this._ch==="\\")te+=this._input.next();else if(J.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return te},E.prototype.eatWhitespace=function(J){for(var te=L.test(this._input.peek()),ne=0;L.test(this._input.peek());)this._ch=this._input.next(),J&&this._ch===` `&&(ne===0||ne0&&this._indentLevel--},E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var J=this._source_text,te=this._options.eol;te==="auto"&&(te=` `,J&&I.test(J||"")&&(te=J.match(I)[0])),J=J.replace(H,` `);var ne=J.match(/^[\t ]*/)[0];this._output=new f(this._options,ne),this._input=new u(J),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ye=0,we=!1,Se=!1,he=!1,V=!1,T=!1,C=this._ch,R=!1,z,Z,v;z=this._input.read(w),Z=z!=="",v=C,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),C=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var y=this._input.read(O),$=p.get_directives(y);$&&$.ignore==="start"&&(y+=p.readIgnored(this._input)),this.print_string(y),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(A)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Z),this.print_string(this._ch);var j=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);j.match(/[ :]$/)&&(j=this.eatString(": ").replace(/\s+$/,""),this.print_string(j),this._output.space_before_token=!0),ye===0&&j.indexOf(":")!==-1&&(Se=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Z),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var me=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);me.match(/[ :]$/)&&(me=this.eatString(": ").replace(/\s+$/,""),this.print_string(me),this._output.space_before_token=!0),ye===0&&me.indexOf(":")!==-1?(Se=!0,this.indent()):me in this.NESTED_AT_RULE?(this._nestedLevel+=1,me in this.CONDITIONAL_GROUP_RULE&&(he=!0)):ye===0&&!Se&&(V=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Se&&(Se=!1,this.outdent()),V=!1,he?(he=!1,we=this._indentLevel>=this._nestedLevel):we=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&we&&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)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),Se&&(this.outdent(),Se=!1),this.print_string(this._ch),we=!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 xe=0;xe"||this._ch==="+"||this._ch==="~")&&!Se&&ye===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&&L.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Z),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),L.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 et=v==='"'||v==="'";this.preserveSingleSpace(et||Z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&R&&this._output.add_new_line()}var ot=this._output.get_code(te);return ot},ue.exports.Beautifier=E},function(ue,o,G){var D=G(6).Options;function f(u){D.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var g=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||g;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var I=0;I=0;I--)if(this.__items[I].match(p))return!0;return!1},f.prototype.set_indent=function(p,I){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=I||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(p){this.__items.push(p);var I=p.lastIndexOf(` `);I!==-1?this.__character_count=p.length-I:this.__character_count+=p.length},f.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function u(p,I){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),I=I||"",p.indent_level>0&&(I=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=I,this.__base_string_length=I.length}u.prototype.get_indent_size=function(p,I){var H=this.__base_string_length;return I=I||0,p<0&&(H=0),H+=p*this.__indent_size,H+=I,H},u.prototype.get_indent_string=function(p,I){var H=this.__base_string;return I=I||0,p<0&&(p=0,H=""),I+=p*this.__indent_size,this.__ensure_cache(I),H+=this.__cache[I],H},u.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var p=this.__cache.length,I=0,H="";this.__indent_size&&p>=this.__indent_size&&(I=Math.floor(p/this.__indent_size),p-=I*this.__indent_size,H=new Array(I+1).join(this.__indent_string)),p&&(H+=new Array(p+1).join(" ")),this.__cache.push(H)};function g(p,I){this.__indent_cache=new u(p,I),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(p,I){return this.__indent_cache.get_indent_string(p,I)},g.prototype.get_indent_size=function(p,I){return this.__indent_cache.get_indent_size(p,I)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){this.trim(!0);var I=this.current_line.pop();I&&(I[I.length-1]===` `&&(I=I.replace(/\n+$/g,"")),this.current_line.push(I)),this._end_with_newline&&this.__add_outputline();var H=this.__lines.join(` `);return p!==` `&&(H=H.replace(/[\n]/g,p)),H},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,I){return p=p||0,I=I||0,this.next_line.set_indent(p,I),this.__lines.length>1?(this.current_line.set_indent(p,I),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var I=0;I1&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(p,I){for(var H=this.__lines.length-2;H>=0;){var L=this.__lines[H];if(L.is_empty())break;if(L.item(0).indexOf(p)!==0&&L.item(-1)!==I){this.__lines.splice(H+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}H--}},D.exports.Output=g},function(D){function f(u,g,p,I){this.type=u,this.text=g,this.comments_before=null,this.newlines=p||0,this.whitespace_before=I||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=f},,,function(D){function f(p,I){this.raw_options=u(p,I),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"])}f.prototype._get_array=function(p,I){var H=this.raw_options[p],L=I||[];return typeof H=="object"?H!==null&&typeof H.concat=="function"&&(L=H.concat()):typeof H=="string"&&(L=H.split(/[^a-zA-Z0-9_\/\-]+/)),L},f.prototype._get_boolean=function(p,I){var H=this.raw_options[p],L=H===void 0?!!I:!!H;return L},f.prototype._get_characters=function(p,I){var H=this.raw_options[p],L=I||"";return typeof H=="string"&&(L=H.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),L},f.prototype._get_number=function(p,I){var H=this.raw_options[p];I=parseInt(I,10),isNaN(I)&&(I=0);var L=parseInt(H,10);return isNaN(L)&&(L=I),L},f.prototype._get_selection=function(p,I,H){var L=this._get_selection_list(p,I,H);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values: `+I+` You passed in: '`+this.raw_options[p]+"'");return L[0]},f.prototype._get_selection_list=function(p,I,H){if(!I||I.length===0)throw new Error("Selection list cannot be empty.");if(H=H||[I[0]],!this._is_valid_selection(H,I))throw new Error("Invalid Default Value!");var L=this._get_array(p,H);if(!this._is_valid_selection(L,I))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values: `+I+` You passed in: '`+this.raw_options[p]+"'");return L},f.prototype._is_valid_selection=function(p,I){return p.length&&I.length&&!p.some(function(H){return I.indexOf(H)===-1})};function u(p,I){var H={};p=g(p);var L;for(L in p)L!==I&&(H[L]=p[L]);if(I&&p[I])for(L in p[I])H[L]=p[I][L];return H}function g(p){var I={},H;for(H in p){var L=H.replace(/-/g,"_");I[L]=p[H]}return I}D.exports.Options=f,D.exports.normalizeOpts=g,D.exports.mergeOpts=u},,function(D){var f=RegExp.prototype.hasOwnProperty("sticky");function u(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position=0&&g=0&&p=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},D.exports.InputScanner=u},function(D,f,u){var g=u(8).InputScanner,p=u(3).Token,I=u(10).TokenStream,H=u(11).WhitespacePattern,L={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(O,A){this._input=new g(O),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new H(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new I,this._reset();for(var O,A=new p(L.START,""),E=null,J=[],te=new I;A.type!==L.EOF;){for(O=this._get_next_token(A,E);this._is_comment(O);)te.add(O),O=this._get_next_token(A,E);te.isEmpty()||(O.comments_before=te,te=new I),O.parent=E,this._is_opening(O)?(J.push(E),E=O):E&&this._is_closing(O,E)&&(O.opened=E,E.closed=O,E=J.pop(),O.parent=E),O.previous=A,A.next=O,this.__tokens.add(O),A=O}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(O,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(L.RAW,E):this._create_token(L.EOF,"")},w.prototype._is_comment=function(O){return!1},w.prototype._is_opening=function(O){return!1},w.prototype._is_closing=function(O,A){return!1},w.prototype._create_token=function(O,A){var E=new p(O,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=w,D.exports.TOKEN=L},function(D){function f(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position=0&&u/),erb:w.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:w.starting_with(/{%/).until_after(/%}/),django_value:w.starting_with(/{{/).until_after(/}}/),django_comment:w.starting_with(/{#/).until_after(/#}/),smarty:w.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:w.starting_with(/{\*/).until_after(/\*}/),smarty_literal:w.starting_with(/{literal}/).until_after(/{\/literal}/)}}I.prototype=new g,I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){this.__set_templated_pattern()},I.prototype.disable=function(H){var L=this._create();return L._disabled[H]=!0,L._update(),L},I.prototype.read_options=function(H){var L=this._create();for(var w in p)L._disabled[w]=H.templating.indexOf(w)===-1;return L._update(),L},I.prototype.exclude=function(H){var L=this._create();return L._excluded[H]=!0,L._update(),L},I.prototype.read=function(){var H="";this._match_pattern?H=this._input.read(this._starting_pattern):H=this._input.read(this._starting_pattern,this.__template_pattern);for(var L=this._read_template();L;)this._match_pattern?L+=this._input.read(this._match_pattern):L+=this._input.readUntil(this.__template_pattern),H+=L,L=this._read_template();return this._until_after&&(H+=this._input.readUntilAfter(this._until_pattern)),H},I.prototype.__set_templated_pattern=function(){var H=[];this._disabled.php||H.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||H.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(H.push(this.__patterns.django._starting_pattern.source),H.push(this.__patterns.django_value._starting_pattern.source),H.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||H.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&H.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+H.join("|")+")")},I.prototype._read_template=function(){var H="",L=this._input.peek();if(L==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(H=H||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(H=H||this.__patterns.erb.read())}else L==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(H=H||this.__patterns.handlebars_comment.read(),H=H||this.__patterns.handlebars_unescaped.read(),H=H||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(H=H||this.__patterns.django_value.read()),this._excluded.django||(H=H||this.__patterns.django_comment.read(),H=H||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(H=H||this.__patterns.smarty_comment.read(),H=H||this.__patterns.smarty_literal.read(),H=H||this.__patterns.smarty.read()));return H},D.exports.TemplatablePattern=I},,,,function(D,f,u){var g=u(19).Beautifier,p=u(20).Options;function I(H,L,w,O){var A=new g(H,L,w,O);return A.beautify()}D.exports=I,D.exports.defaultOptions=function(){return new p}},function(D,f,u){var g=u(20).Options,p=u(2).Output,I=u(21).Tokenizer,H=u(21).TOKEN,L=/\r\n|[\r\n]/,w=/\r\n|[\r\n]/g,O=function(V,T){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=V.max_preserve_newlines,this.preserve_newlines=V.preserve_newlines,this._output=new p(V,T)};O.prototype.current_line_has_match=function(V){return this._output.current_line.has_match(V)},O.prototype.set_space_before_token=function(V,T){this._output.space_before_token=V,this._output.non_breaking_space=T},O.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},O.prototype.add_raw_token=function(V){this._output.add_raw_token(V)},O.prototype.print_preserved_newlines=function(V){var T=0;V.type!==H.TEXT&&V.previous.type!==H.TEXT&&(T=V.newlines?1:0),this.preserve_newlines&&(T=V.newlines0);return T!==0},O.prototype.traverse_whitespace=function(V){return V.whitespace_before||V.newlines?(this.print_preserved_newlines(V)||(this._output.space_before_token=!0),!0):!1},O.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},O.prototype.print_newline=function(V){this._output.add_new_line(V)},O.prototype.print_token=function(V){V.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(V.text))},O.prototype.indent=function(){this.indent_level++},O.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},O.prototype.get_full_indent=function(V){return V=this.indent_level+(V||0),V<1?"":this._output.get_indent_string(V)};var A=function(V){for(var T=null,C=V.next;C.type!==H.EOF&&V.closed!==C;){if(C.type===H.ATTRIBUTE&&C.text==="type"){C.next&&C.next.type===H.EQUALS&&C.next.next&&C.next.next.type===H.VALUE&&(T=C.next.next.text);break}C=C.next}return T},E=function(V,T){var C=null,R=null;return T.closed?(V==="script"?C="text/javascript":V==="style"&&(C="text/css"),C=A(T)||C,C.search("text/css")>-1?R="css":C.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":C.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":C.search(/test\/null/)>-1&&(R="null"),R):null};function J(V,T){return T.indexOf(V)!==-1}function te(V,T,C){this.parent=V||null,this.tag=T?T.tag_name:"",this.indent_level=C||0,this.parser_token=T||null}function ne(V){this._printer=V,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(V){var T=new te(this._current_frame,V,this._printer.indent_level);this._current_frame=T},ne.prototype._try_pop_frame=function(V){var T=null;return V&&(T=V.parser_token,this._printer.indent_level=V.indent_level,this._current_frame=V.parent),T},ne.prototype._get_frame=function(V,T){for(var C=this._current_frame;C&&V.indexOf(C.tag)===-1;){if(T&&T.indexOf(C.tag)!==-1){C=null;break}C=C.parent}return C},ne.prototype.try_pop=function(V,T){var C=this._get_frame([V],T);return this._try_pop_frame(C)},ne.prototype.indent_to_tag=function(V){var T=this._get_frame(V);T&&(this._printer.indent_level=T.indent_level)};function ye(V,T,C,R){this._source_text=V||"",T=T||{},this._js_beautify=C,this._css_beautify=R,this._tag_stack=null;var z=new g(T,"html");this._options=z,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"}ye.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var V=this._source_text,T=this._options.eol;this._options.eol==="auto"&&(T=` `,V&&L.test(V)&&(T=V.match(L)[0])),V=V.replace(w,` `);var C=V.match(/^[\t ]*/)[0],R={text:"",type:""},z=new we(this._options),Z=new O(this._options,C),v=new I(V,this._options).tokenize();this._tag_stack=new ne(Z);for(var y=null,$=v.next();$.type!==H.EOF;)$.type===H.TAG_OPEN||$.type===H.COMMENT?(y=this._handle_tag_open(Z,$,z,R,v),z=y):$.type===H.ATTRIBUTE||$.type===H.EQUALS||$.type===H.VALUE||$.type===H.TEXT&&!z.tag_complete?y=this._handle_inside_tag(Z,$,z,R):$.type===H.TAG_CLOSE?y=this._handle_tag_close(Z,$,z):$.type===H.TEXT?y=this._handle_text(Z,$,z):$.type===H.CONTROL_FLOW_OPEN?y=this._handle_control_flow_open(Z,$):$.type===H.CONTROL_FLOW_CLOSE?y=this._handle_control_flow_close(Z,$):Z.add_raw_token($),R=y,$=v.next();var j=Z._output.get_code(T);return j},ye.prototype._handle_control_flow_open=function(V,T){var C={text:T.text,type:T.type};return V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),T.newlines?V.print_preserved_newlines(T):V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),V.print_token(T),V.indent(),C},ye.prototype._handle_control_flow_close=function(V,T){var C={text:T.text,type:T.type};return V.deindent(),T.newlines?V.print_preserved_newlines(T):V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),V.print_token(T),C},ye.prototype._handle_tag_close=function(V,T,C){var R={text:T.text,type:T.type};return V.alignment_size=0,C.tag_complete=!0,V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),C.is_unformatted?V.add_raw_token(T):(C.tag_start_char==="<"&&(V.set_space_before_token(T.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&C.has_wrapped_attrs&&V.print_newline(!1)),V.print_token(T)),C.indent_content&&!(C.is_unformatted||C.is_content_unformatted)&&(V.indent(),C.indent_content=!1),!C.is_inline_element&&!(C.is_unformatted||C.is_content_unformatted)&&V.set_wrap_point(),R},ye.prototype._handle_inside_tag=function(V,T,C,R){var z=C.has_wrapped_attrs,Z={text:T.text,type:T.type};return V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),C.is_unformatted?V.add_raw_token(T):C.tag_start_char==="{"&&T.type===H.TEXT?V.print_preserved_newlines(T)?(T.newlines=0,V.add_raw_token(T)):V.print_token(T):(T.type===H.ATTRIBUTE?V.set_space_before_token(!0):(T.type===H.EQUALS||T.type===H.VALUE&&T.previous.type===H.EQUALS)&&V.set_space_before_token(!1),T.type===H.ATTRIBUTE&&C.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(V.traverse_whitespace(T),z=z||T.newlines!==0),this._is_wrap_attributes_force&&C.attr_count>=this._options.wrap_attributes_min_attrs&&(R.type!==H.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(V.print_newline(!1),z=!0)),V.print_token(T),z=z||V.previous_token_wrapped(),C.has_wrapped_attrs=z),Z},ye.prototype._handle_text=function(V,T,C){var R={text:T.text,type:"TK_CONTENT"};return C.custom_beautifier_name?this._print_custom_beatifier_text(V,T,C):C.is_unformatted||C.is_content_unformatted?V.add_raw_token(T):(V.traverse_whitespace(T),V.print_token(T)),R},ye.prototype._print_custom_beatifier_text=function(V,T,C){var R=this;if(T.text!==""){var z=T.text,Z,v=1,y="",$="";C.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Z=this._js_beautify:C.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Z=this._css_beautify:C.custom_beautifier_name==="html"&&(Z=function(et,ot){var Ve=new ye(et,ot,R._js_beautify,R._css_beautify);return Ve.beautify()}),this._options.indent_scripts==="keep"?v=0:this._options.indent_scripts==="separate"&&(v=-V.indent_level);var j=V.get_full_indent(v);if(z=z.replace(/\n[ \t]*$/,""),C.custom_beautifier_name!=="html"&&z[0]==="<"&&z.match(/^(|]]>)$/.exec(z);if(!me){V.add_raw_token(T);return}y=j+me[1]+` `,z=me[4],me[5]&&($=j+me[5]),z=z.replace(/\n[ \t]*$/,""),(me[2]||me[3].indexOf(` `)!==-1)&&(me=me[3].match(/[ \t]+$/),me&&(T.whitespace_before=me[0]))}if(z)if(Z){var xe=function(){this.eol=` `};xe.prototype=this._options.raw_options;var Re=new xe;z=Z(j+z,Re)}else{var Ie=T.whitespace_before;Ie&&(z=z.replace(new RegExp(` (`+Ie+")?","g"),` `)),z=j+z.replace(/\n/g,` `+j)}y&&(z?z=y+z+` `+$:z=y+$),V.print_newline(!1),z&&(T.text=z,T.whitespace_before="",T.newlines=0,V.add_raw_token(T),V.print_newline(!0))}},ye.prototype._handle_tag_open=function(V,T,C,R,z){var Z=this._get_tag_open_token(T);if((C.is_unformatted||C.is_content_unformatted)&&!C.is_empty_element&&T.type===H.TAG_OPEN&&!Z.is_start_tag?(V.add_raw_token(T),Z.start_tag_token=this._tag_stack.try_pop(Z.tag_name)):(V.traverse_whitespace(T),this._set_tag_position(V,T,Z,C,R),Z.is_inline_element||V.set_wrap_point(),V.print_token(T)),Z.is_start_tag&&this._is_wrap_attributes_force){var v=0,y;do y=z.peek(v),y.type===H.ATTRIBUTE&&(Z.attr_count+=1),v+=1;while(y.type!==H.EOF&&y.type!==H.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Z.alignment_size=T.text.length+1),!Z.tag_complete&&!Z.is_unformatted&&(V.alignment_size=Z.alignment_size),Z};var we=function(V,T,C){if(this.parent=T||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="",!C)this.tag_complete=!0;else{var R;this.tag_start_char=C.text[0],this.text=C.text,this.tag_start_char==="<"?(R=C.text.match(/^<([^\s>]*)/),this.tag_check=R?R[1]:""):(R=C.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=R?R[1]:"",(C.text.startsWith("{{#>")||C.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&C.next!==null?this.tag_check=C.next.text.split(" ")[0]:this.tag_check=C.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),C.type===H.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||C.closed&&C.closed.text==="/>";var z=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(z=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!V.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(z)))}};ye.prototype._get_tag_open_token=function(V){var T=new we(this._options,this._tag_stack.get_parser_token(),V);return T.alignment_size=this._options.wrap_attributes_indent_size,T.is_end_tag=T.is_end_tag||J(T.tag_check,this._options.void_elements),T.is_empty_element=T.tag_complete||T.is_start_tag&&T.is_end_tag,T.is_unformatted=!T.tag_complete&&J(T.tag_check,this._options.unformatted),T.is_content_unformatted=!T.is_empty_element&&J(T.tag_check,this._options.content_unformatted),T.is_inline_element=J(T.tag_name,this._options.inline)||this._options.inline_custom_elements&&T.tag_name.includes("-")||T.tag_start_char==="{",T},ye.prototype._set_tag_position=function(V,T,C,R,z){if(C.is_empty_element||(C.is_end_tag?C.start_tag_token=this._tag_stack.try_pop(C.tag_name):(this._do_optional_end_element(C)&&(C.is_inline_element||V.print_newline(!1)),this._tag_stack.record_tag(C),(C.tag_name==="script"||C.tag_name==="style")&&!(C.is_unformatted||C.is_content_unformatted)&&(C.custom_beautifier_name=E(C.tag_check,T)))),J(C.tag_check,this._options.extra_liners)&&(V.print_newline(!1),V._output.just_added_blankline()||V.print_newline(!0)),C.is_empty_element){if(C.tag_start_char==="{"&&C.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),C.indent_content=!0;var Z=V.current_line_has_match(/{{#if/);Z||V.print_newline(!1)}C.tag_name==="!--"&&z.type===H.TAG_CLOSE&&R.is_end_tag&&C.text.indexOf(` `)===-1||(C.is_inline_element||C.is_unformatted||V.print_newline(!1),this._calcluate_parent_multiline(V,C))}else if(C.is_end_tag){var v=!1;v=C.start_tag_token&&C.start_tag_token.multiline_content,v=v||!C.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(z.type===H.TAG_CLOSE&&C.start_tag_token===R)&&z.type!=="TK_CONTENT",(C.is_content_unformatted||C.is_unformatted)&&(v=!1),v&&V.print_newline(!1)}else C.indent_content=!C.custom_beautifier_name,C.tag_start_char==="<"&&(C.tag_name==="html"?C.indent_content=this._options.indent_inner_html:C.tag_name==="head"?C.indent_content=this._options.indent_head_inner_html:C.tag_name==="body"&&(C.indent_content=this._options.indent_body_inner_html)),!(C.is_inline_element||C.is_unformatted)&&(z.type!=="TK_CONTENT"||C.is_content_unformatted)&&V.print_newline(!1),this._calcluate_parent_multiline(V,C)},ye.prototype._calcluate_parent_multiline=function(V,T){T.parent&&V._output.just_added_newline()&&!((T.is_inline_element||T.is_unformatted)&&T.parent.is_inline_element)&&(T.parent.multiline_content=!0)};var Se=["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"],he=["a","audio","del","ins","map","noscript","video"];ye.prototype._do_optional_end_element=function(V){var T=null;if(!(V.is_empty_element||!V.is_start_tag||!V.parent)){if(V.tag_name==="body")T=T||this._tag_stack.try_pop("head");else if(V.tag_name==="li")T=T||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(V.tag_name==="dd"||V.tag_name==="dt")T=T||this._tag_stack.try_pop("dt",["dl"]),T=T||this._tag_stack.try_pop("dd",["dl"]);else if(V.parent.tag_name==="p"&&Se.indexOf(V.tag_name)!==-1){var C=V.parent.parent;(!C||he.indexOf(C.tag_name)===-1)&&(T=T||this._tag_stack.try_pop("p"))}else V.tag_name==="rp"||V.tag_name==="rt"?(T=T||this._tag_stack.try_pop("rt",["ruby","rtc"]),T=T||this._tag_stack.try_pop("rp",["ruby","rtc"])):V.tag_name==="optgroup"?T=T||this._tag_stack.try_pop("optgroup",["select"]):V.tag_name==="option"?T=T||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):V.tag_name==="colgroup"?T=T||this._tag_stack.try_pop("caption",["table"]):V.tag_name==="thead"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"])):V.tag_name==="tbody"||V.tag_name==="tfoot"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("thead",["table"]),T=T||this._tag_stack.try_pop("tbody",["table"])):V.tag_name==="tr"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(V.tag_name==="th"||V.tag_name==="td")&&(T=T||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),T=T||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return V.parent=this._tag_stack.get_parser_token(),T}},D.exports.Beautifier=ye},function(D,f,u){var g=u(6).Options;function p(I){g.call(this,I,"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"])}p.prototype=new g,D.exports.Options=p},function(D,f,u){var g=u(9).Tokenizer,p=u(9).TOKEN,I=u(13).Directives,H=u(14).TemplatablePattern,L=u(12).Pattern,w={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:p.START,RAW:p.RAW,EOF:p.EOF},O=new I(/<\!--/,/-->/),A=function(E,J){g.call(this,E,J),this._current_tag_name="";var te=new H(this._input).read_options(this._options),ne=new L(this._input);if(this.__patterns={word:te.until(/[\n\r\t <]/),word_control_flow_close_excluded:te.until(/[\n\r\t <}]/),single_quote:te.until_after(/'/),double_quote:te.until_after(/"/),attribute:te.until(/[\n\r\t =>]|\/>/),element_name:te.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(//),cdata:ne.starting_with(//),conditional_comment:ne.starting_with(//),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 ye=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ne.matching(ye).until_after(ye)}};A.prototype=new g,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===w.TAG_OPEN||E.type===w.CONTROL_FLOW_OPEN},A.prototype._is_closing=function(E,J){return E.type===w.TAG_CLOSE&&J&&((E.text===">"||E.text==="/>")&&J.text[0]==="<"||E.text==="}}"&&J.text[0]==="{"&&J.text[1]==="{")||E.type===w.CONTROL_FLOW_CLOSE&&E.text==="}"&&J.text.endsWith("{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,J){var te=null;this._readWhitespace();var ne=this._input.peek();return ne===null?this._create_token(w.EOF,""):(te=te||this._read_open_handlebars(ne,J),te=te||this._read_attribute(ne,E,J),te=te||this._read_close(ne,J),te=te||this._read_script_and_style(ne,E),te=te||this._read_control_flows(ne,J),te=te||this._read_raw_content(ne,E,J),te=te||this._read_content_word(ne,J),te=te||this._read_comment_or_cdata(ne),te=te||this._read_processing(ne),te=te||this._read_open(ne,J),te=te||this._create_token(w.UNKNOWN,this._input.next()),te)},A.prototype._read_comment_or_cdata=function(E){var J=null,te=null,ne=null;if(E==="<"){var ye=this._input.peek(1);ye==="!"&&(te=this.__patterns.comment.read(),te?(ne=O.get_directives(te),ne&&ne.ignore==="start"&&(te+=O.readIgnored(this._input))):te=this.__patterns.cdata.read()),te&&(J=this._create_token(w.COMMENT,te),J.directives=ne)}return J},A.prototype._read_processing=function(E){var J=null,te=null,ne=null;if(E==="<"){var ye=this._input.peek(1);(ye==="!"||ye==="?")&&(te=this.__patterns.conditional_comment.read(),te=te||this.__patterns.processing.read()),te&&(J=this._create_token(w.COMMENT,te),J.directives=ne)}return J},A.prototype._read_open=function(E,J){var te=null,ne=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&E==="<"&&(te=this._input.next(),this._input.peek()==="/"&&(te+=this._input.next()),te+=this.__patterns.element_name.read(),ne=this._create_token(w.TAG_OPEN,te)),ne},A.prototype._read_open_handlebars=function(E,J){var te=null,ne=null;return(!J||J.type===w.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&E==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(te=this.__patterns.handlebars_comment.read(),te=te||this.__patterns.handlebars.read(),ne=this._create_token(w.COMMENT,te)):(te=this.__patterns.handlebars_open.read(),ne=this._create_token(w.TAG_OPEN,te))),ne},A.prototype._read_control_flows=function(E,J){var te="",ne=null;if(!this._options.templating.includes("angular"))return ne;if(E==="@"){if(te=this.__patterns.angular_control_flow_start.read(),te==="")return ne;for(var ye=te.endsWith("(")?1:0,we=0;!(te.endsWith("{")&&ye===we);){var Se=this._input.next();if(Se===null)break;Se==="("?ye++:Se===")"&&we++,te+=Se}ne=this._create_token(w.CONTROL_FLOW_OPEN,te)}else E==="}"&&J&&J.type===w.CONTROL_FLOW_OPEN&&(te=this._input.next(),ne=this._create_token(w.CONTROL_FLOW_CLOSE,te));return ne},A.prototype._read_close=function(E,J){var te=null,ne=null;return J&&J.type===w.TAG_OPEN&&(J.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(te=this._input.next(),E==="/"&&(te+=this._input.next()),ne=this._create_token(w.TAG_CLOSE,te)):J.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ne=this._create_token(w.TAG_CLOSE,"}}"))),ne},A.prototype._read_attribute=function(E,J,te){var ne=null,ye="";if(te&&te.text[0]==="<")if(E==="=")ne=this._create_token(w.EQUALS,this._input.next());else if(E==='"'||E==="'"){var we=this._input.next();E==='"'?we+=this.__patterns.double_quote.read():we+=this.__patterns.single_quote.read(),ne=this._create_token(w.VALUE,we)}else ye=this.__patterns.attribute.read(),ye&&(J.type===w.EQUALS?ne=this._create_token(w.VALUE,ye):ne=this._create_token(w.ATTRIBUTE,ye));return ne},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,J,te){var ne="";if(te&&te.text[0]==="{")ne=this.__patterns.handlebars_raw_close.read();else if(J.type===w.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var ye=J.opened.text.substr(1).toLowerCase();this._is_content_unformatted(ye)&&(ne=this._input.readUntil(new RegExp("","ig")))}return ne?this._create_token(w.TEXT,ne):null},A.prototype._read_script_and_style=function(E,J){if(J.type===w.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var te=J.opened.text.substr(1).toLowerCase();if(te==="script"||te==="style"){var ne=this._read_comment_or_cdata(E);if(ne)return ne.type=w.TEXT,ne;var ye=this._input.readUntil(new RegExp("","ig"));if(ye)return this._create_token(w.TEXT,ye)}}return null},A.prototype._read_content_word=function(E,J){var te="";return this._options.unformatted_content_delimiter&&E===this._options.unformatted_content_delimiter[0]&&(te=this.__patterns.unformatted_content_delimiter.read()),te||(te=J&&J.type===w.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),te?this._create_token(w.TEXT,te):null},D.exports.Tokenizer=A,D.exports.TOKEN=w}],ue={};function o(D){var f=ue[D];if(f!==void 0)return f.exports;var u=ue[D]={exports:{}};return _e[D](u,u.exports,o),u.exports}var G=o(18);ve=G})();var fe=ve;if(1)F=[b,b(58553),b(87804)],q=function(_e){var ue=b(58553),o=b(87804);return{html_beautify:function(G,D){return fe(G,D,ue.js_beautify,o.css_beautify)}}}.apply(Pe,F),q!==void 0&&(yt.exports=q);else var oe,W})()},58553:function(yt,Pe){var b,F;(function(){var q;(function(){"use strict";var fe=[function(ue,o,G){var D=G(1).Beautifier,f=G(5).Options;function u(g,p){var I=new D(g,p);return I.beautify()}ue.exports=u,ue.exports.defaultOptions=function(){return new f}},function(ue,o,G){var D=G(2).Output,f=G(3).Token,u=G(4),g=G(5).Options,p=G(7).Tokenizer,I=G(7).line_starters,H=G(7).positionable_operators,L=G(7).TOKEN;function w(y,$){return $.indexOf(y)!==-1}function O(y){return y.replace(/^\s+/g,"")}function A(y){for(var $={},j=0;jj&&(j=y.line_indent_level));var me={mode:$,parent:y,last_token:y?y.last_token:new f(L.START_BLOCK,""),last_word:y?y.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:j,alignment:0,line_indent_level:y?y.line_indent_level:j,start_line_index:this._output.get_line_number(),ternary_depth:0};return me},Z.prototype._reset=function(y){var $=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new D(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Se.BlockStatement);var j=new p(y,this._options);return this._tokens=j.tokenize(),y},Z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,$=this._reset(this._source_text),j=this._options.eol;this._options.eol==="auto"&&(j=` `,$&&u.lineBreak.test($||"")&&(j=$.match(u.lineBreak)[0]));for(var me=this._tokens.next();me;)this.handle_token(me),this._last_last_text=this._flags.last_token.text,this._flags.last_token=me,me=this._tokens.next();return y=this._output.get_code(j),y},Z.prototype.handle_token=function(y,$){y.type===L.START_EXPR?this.handle_start_expr(y):y.type===L.END_EXPR?this.handle_end_expr(y):y.type===L.START_BLOCK?this.handle_start_block(y):y.type===L.END_BLOCK?this.handle_end_block(y):y.type===L.WORD?this.handle_word(y):y.type===L.RESERVED?this.handle_word(y):y.type===L.SEMICOLON?this.handle_semicolon(y):y.type===L.STRING?this.handle_string(y):y.type===L.EQUALS?this.handle_equals(y):y.type===L.OPERATOR?this.handle_operator(y):y.type===L.COMMA?this.handle_comma(y):y.type===L.BLOCK_COMMENT?this.handle_block_comment(y,$):y.type===L.COMMENT?this.handle_comment(y,$):y.type===L.DOT?this.handle_dot(y):y.type===L.EOF?this.handle_eof(y):y.type===L.UNKNOWN?this.handle_unknown(y,$):this.handle_unknown(y,$)},Z.prototype.handle_whitespace_and_comments=function(y,$){var j=y.newlines,me=this._options.keep_array_indentation&&T(this._flags.mode);if(y.comments_before)for(var xe=y.comments_before.next();xe;)this.handle_whitespace_and_comments(xe,$),this.handle_token(xe,$),xe=y.comments_before.next();if(me)for(var Re=0;Re0,$);else if(this._options.max_preserve_newlines&&j>this._options.max_preserve_newlines&&(j=this._options.max_preserve_newlines),this._options.preserve_newlines&&j>1){this.print_newline(!1,$);for(var Ie=1;Ie0&&(!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))},Z.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Se.Statement&&he(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.start_of_object_property=function(){return this._flags.parent.mode===Se.ObjectLiteral&&this._flags.mode===Se.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"]))},Z.prototype.start_of_statement=function(y){var $=!1;return $=$||J(this._flags.last_token,["var","let","const"])&&y.type===L.WORD,$=$||E(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===Se.ObjectLiteral&&this._flags.mode===Se.Statement)&&J(this._flags.last_token,v)&&!y.newlines,$=$||E(this._flags.last_token,"else")&&!(E(y,"if")&&!y.comments_before),$=$||this._flags.last_token.type===L.END_EXPR&&(this._previous_flags.mode===Se.ForInitializer||this._previous_flags.mode===Se.Conditional),$=$||this._flags.last_token.type===L.WORD&&this._flags.mode===Se.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==L.WORD&&y.type!==L.RESERVED,$=$||this._flags.mode===Se.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"])),$?(this.set_mode(Se.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,J(y,["do","for","if","while"])),!0):!1},Z.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var $=Se.Expression;if(y.text==="["){if(this._flags.last_token.type===L.WORD||this._flags.last_token.text===")"){J(this._flags.last_token,I)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=Se.ArrayLiteral,T(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()),w(this._flags.last_token.type,[L.START_EXPR,L.END_EXPR,L.WORD,L.OPERATOR,L.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===L.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=Se.ForInitializer):w(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=Se.Conditional):w(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(w(this._flags.last_token.text,I)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===L.WORD){this._output.space_before_token=!1;var j=this._tokens.peek(-3);if(this._options.space_after_named_function&&j){var me=this._tokens.peek(-4);J(j,["async","function"])||j.text==="*"&&J(me,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Se.ObjectLiteral?(j.text==="{"||j.text===","||j.text==="*"&&(me.text==="{"||me.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(y);(this._flags.last_token.type===L.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===Se.ObjectLiteral&&w(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===L.START_BLOCK?this.print_newline():(this._flags.last_token.type===L.END_EXPR||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===L.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Z.prototype.handle_end_expr=function(y){for(;this._flags.mode===Se.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===L.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(y),this.restore_mode(),he(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Se.Conditional&&(this._previous_flags.mode=Se.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Z.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var $=this._tokens.peek(),j=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===L.END_EXPR?(this.set_mode(Se.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Se.BlockStatement):j&&(w(j.text,[":",","])&&w($.type,[L.STRING,L.WORD,L.RESERVED])||w($.text,["get","set","..."])&&w(j.type,[L.WORD,L.RESERVED]))?w(this._last_last_text,["class","interface"])&&!w(j.text,[":",","])?this.set_mode(Se.BlockStatement):this.set_mode(Se.ObjectLiteral):this._flags.last_token.type===L.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Se.BlockStatement):w(this._flags.last_token.type,[L.EQUALS,L.START_EXPR,L.COMMA,L.OPERATOR])||J(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Se.ObjectLiteral):this.set_mode(Se.BlockStatement),this._flags.last_token&&J(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var me=!$.comments_before&&$.text==="}",xe=me&&this._flags.last_word==="function"&&this._flags.last_token.type===L.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Ie=null;this._flags.inline_frame=!0;do if(Re+=1,Ie=this._tokens.peek(Re-1),Ie.newlines){this._flags.inline_frame=!1;break}while(Ie.type!==L.EOF&&!(Ie.type===L.END_BLOCK&&Ie.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==L.OPERATOR&&(xe||this._flags.last_token.type===L.EQUALS||J(this._flags.last_token,te)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.COMMA)&&((this._flags.last_token.type===L.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==L.OPERATOR&&this._flags.last_token.type!==L.START_EXPR&&(w(this._flags.last_token.type,[L.START_BLOCK,L.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!me&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Z.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===Se.Statement;)this.restore_mode();var $=this._flags.last_token.type===L.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},Z.prototype.handle_word=function(y){if(y.type===L.RESERVED){if(w(y.text,["set","get"])&&this._flags.mode!==Se.ObjectLiteral)y.type=L.WORD;else if(y.text==="import"&&w(this._tokens.peek().text,["(","."]))y.type=L.WORD;else if(w(y.text,["as","from"])&&!this._flags.import_block)y.type=L.WORD;else if(this._flags.mode===Se.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(y.type=L.WORD)}}if(this.start_of_statement(y)?J(this._flags.last_token,["var","let","const"])&&y.type===L.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!C(this._flags.mode)&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==L.EQUALS&&(this._options.preserve_newlines||!J(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(E(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&E(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Se.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&J(y,["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(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)&&!this.start_of_object_property()&&!(w(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Se.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(y),E(y,"function")){(w(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(w(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===L.OPERATOR))&&!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD?J(this._flags.last_token,["get","set","new","export"])||J(this._flags.last_token,v)?this._output.space_before_token=!0:E(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===L.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(C(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var j="NONE";if(this._flags.last_token.type===L.END_BLOCK?this._previous_flags.inline_frame?j="SPACE":J(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?j="NEWLINE":(j="SPACE",this._output.space_before_token=!0):j="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&this._flags.mode===Se.BlockStatement?j="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&C(this._flags.mode)?j="SPACE":this._flags.last_token.type===L.STRING?j="NEWLINE":this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===Se.ObjectLiteral&&w(this._last_last_text,["{",","]))?j="SPACE":this._flags.last_token.type===L.START_BLOCK?this._flags.inline_frame?j="SPACE":j="NEWLINE":this._flags.last_token.type===L.END_EXPR&&(this._output.space_before_token=!0,j="NEWLINE"),J(y,I)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?j="SPACE":j="NEWLINE"),J(y,["else","catch","finally"]))if((!(this._flags.last_token.type===L.END_BLOCK&&this._previous_flags.mode===Se.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var me=this._output.current_line;me.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else j==="NEWLINE"?J(this._flags.last_token,te)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&J(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==L.END_EXPR?(this._flags.last_token.type!==L.START_EXPR||!J(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(E(y,"if")&&E(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):J(y,I)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():j==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===L.WORD||y.previous.type===L.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===L.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&E(y,"from")&&(this._flags.import_block=!1))},Z.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var $=this._tokens.peek();this._flags.mode===Se.Statement&&!(this._flags.if_block&&E($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},Z.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===L.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===L.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},Z.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},Z.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(C(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(y)):this._flags.mode===Se.ObjectLiteral||this._flags.mode===Se.Statement&&this._flags.parent.mode===Se.ObjectLiteral?(this._flags.mode===Se.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},Z.prototype.handle_operator=function(y){var $=y.text==="*"&&(J(this._flags.last_token,["function","yield"])||w(this._flags.last_token.type,[L.START_BLOCK,L.COMMA,L.END_BLOCK,L.SEMICOLON])),j=w(y.text,["-","+"])&&(w(this._flags.last_token.type,[L.START_BLOCK,L.START_EXPR,L.EQUALS,L.OPERATOR])||w(this._flags.last_token.text,I)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var me=!$;this.handle_whitespace_and_comments(y,me)}if(y.text==="*"&&this._flags.last_token.type===L.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(w(y.text,["-","+"])&&this.start_of_object_property()){this.print_token(y);return}if(this._flags.last_token.type===L.OPERATOR&&w(this._options.operator_position,we)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==L.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 xe=!0,Re=!0,Ie=!1;if(y.text===":"?this._flags.ternary_depth===0?xe=!1:(this._flags.ternary_depth-=1,Ie=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!j&&!$&&this._options.preserve_newlines&&w(y.text,H)){var et=y.text===":",ot=et&&Ie,Ve=et&&!Ie;switch(this._options.operator_position){case ye.before_newline:this._output.space_before_token=!Ve,this.print_token(y),(!et||ot)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case ye.after_newline:this._output.space_before_token=!0,!et||ot?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case ye.preserve_newline:Ve||this.allow_wrap_or_preserved_newline(y),xe=!(this._output.just_added_newline()||Ve),this._output.space_before_token=xe,this.print_token(y),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(y),xe=!1;var Rt=this._tokens.peek();Re=Rt&&w(Rt.type,[L.WORD,L.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),xe=this._flags.last_token.type===L.START_BLOCK,Re=!1;else if(w(y.text,["--","++","!","~"])||j){if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),xe=!1,Re=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var dt=J(this._flags.last_token,te)&&y.newlines;dt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(dt,!0)}this._flags.last_token.text===";"&&C(this._flags.mode)&&(xe=!0),this._flags.last_token.type===L.RESERVED?xe=!0:this._flags.last_token.type===L.END_EXPR?xe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===L.OPERATOR&&(xe=w(y.text,["--","-","++","+"])&&w(this._flags.last_token.text,["--","-","++","+"]),w(y.text,["+","-"])&&w(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===Se.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Se.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||xe,this.print_token(y),this._output.space_before_token=Re},Z.prototype.handle_block_comment=function(y,$){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,$),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,$)},Z.prototype.print_block_commment=function(y,$){var j=V(y.text),me,xe=!1,Re=!1,Ie=y.whitespace_before,et=Ie.length;if(this.print_newline(!1,$),this.print_token_line_indentation(y),this._output.add_token(j[0]),this.print_newline(!1,$),j.length>1){for(j=j.slice(1),xe=R(j,"*"),Re=z(j,Ie),xe&&(this._flags.alignment=1),me=0;me=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(f){this.__items.push(f);var u=f.lastIndexOf(` `);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function G(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}G.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},G.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},G.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function D(f,u){this.__indent_cache=new G(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},D.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(` `);return f!==` `&&(g=g.replace(/[\n]/g,f)),g},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(f){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var p=this.__lines[g];if(p.is_empty())break;if(p.item(0).indexOf(f)!==0&&p.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},ue.exports.Output=D},function(ue){function o(G,D,f,u){this.type=G,this.text=D,this.comments_before=null,this.newlines=f||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ue.exports.Token=o},function(ue,o){var G="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",D="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\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",g="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",p="(?:"+g+"|["+G+f+"])",I="(?:"+g+"|["+D+f+u+"])*";o.identifier=new RegExp(p+I,"g"),o.identifierStart=new RegExp(p),o.identifierMatch=new RegExp("(?:"+g+"|["+D+f+u+"])+");var H=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;o.newline=/[\n\r\u2028\u2029]/,o.lineBreak=new RegExp(`\r |`+o.newline.source),o.allLineBreaks=new RegExp(o.lineBreak.source,"g")},function(ue,o,G){var D=G(6).Options,f=["before-newline","after-newline","preserve-newline"];function u(g){D.call(this,g,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var I=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var H=0;H>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ne=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ne=ne.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ne="\\?\\.(?!\\d) "+ne,ne=ne.replace(/ /g,"|");var ye=new RegExp(ne),we="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Se=we.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),he=new RegExp("^(?:"+Se.join("|")+")$"),V,T=function(R,z){f.call(this,R,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Z=new I(this._input),v=new H(this._input).read_options(this._options);this.__patterns={template:v,identifier:v.starting_with(p.identifier).matching(p.identifierMatch),number:Z.matching(A),punct:Z.matching(ye),comment:Z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Z.matching(//),include:Z.starting_with(/#include/).until_after(p.lineBreak),shebang:Z.starting_with(/#!/).until_after(p.lineBreak),xml:Z.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:v.until(/['\\\n\r\u2028\u2029]/),double_quote:v.until(/["\\\n\r\u2028\u2029]/),template_text:v.until(/[`\\$]/),template_expression:v.until(/[`}\\]/)}};T.prototype=new f,T.prototype._is_comment=function(R){return R.type===w.COMMENT||R.type===w.BLOCK_COMMENT||R.type===w.UNKNOWN},T.prototype._is_opening=function(R){return R.type===w.START_BLOCK||R.type===w.START_EXPR},T.prototype._is_closing=function(R,z){return(R.type===w.END_BLOCK||R.type===w.END_EXPR)&&z&&(R.text==="]"&&z.text==="["||R.text===")"&&z.text==="("||R.text==="}"&&z.text==="{")},T.prototype._reset=function(){V=!1},T.prototype._get_next_token=function(R,z){var Z=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(w.EOF,""):(Z=Z||this._read_non_javascript(v),Z=Z||this._read_string(v),Z=Z||this._read_pair(v,this._input.peek(1)),Z=Z||this._read_word(R),Z=Z||this._read_singles(v),Z=Z||this._read_comment(v),Z=Z||this._read_regexp(v,R),Z=Z||this._read_xml(v,R),Z=Z||this._read_punctuation(),Z=Z||this._create_token(w.UNKNOWN,this._input.next()),Z)},T.prototype._read_word=function(R){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(p.allLineBreaks,` `),!(R.type===w.DOT||R.type===w.RESERVED&&(R.text==="set"||R.text==="get"))&&he.test(z)?(z==="in"||z==="of")&&(R.type===w.WORD||R.type===w.STRING)?this._create_token(w.OPERATOR,z):this._create_token(w.RESERVED,z):this._create_token(w.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(w.WORD,z)},T.prototype._read_singles=function(R){var z=null;return R==="("||R==="["?z=this._create_token(w.START_EXPR,R):R===")"||R==="]"?z=this._create_token(w.END_EXPR,R):R==="{"?z=this._create_token(w.START_BLOCK,R):R==="}"?z=this._create_token(w.END_BLOCK,R):R===";"?z=this._create_token(w.SEMICOLON,R):R==="."&&J.test(this._input.peek(1))?z=this._create_token(w.DOT,R):R===","&&(z=this._create_token(w.COMMA,R)),z&&this._input.next(),z},T.prototype._read_pair=function(R,z){var Z=null;return R==="#"&&z==="{"&&(Z=this._create_token(w.START_BLOCK,R+z)),Z&&(this._input.next(),this._input.next()),Z},T.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(w.EQUALS,R):R==="?."?this._create_token(w.DOT,R):this._create_token(w.OPERATOR,R)},T.prototype._read_non_javascript=function(R){var z="";if(R==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(w.UNKNOWN,z.trim()+` `);if(z=this.__patterns.include.read(),z)return this._create_token(w.UNKNOWN,z.trim()+` `);R=this._input.next();var Z="#";if(this._input.hasNext()&&this._input.testChar(E)){do R=this._input.next(),Z+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Z+="{}",this._input.next(),this._input.next())),this._create_token(w.WORD,Z)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)z+=this._input.next();return V=!0,this._create_token(w.COMMENT,z)}}else if(V&&R==="-"&&(z=this.__patterns.html_comment_end.read(),z))return V=!1,this._create_token(w.COMMENT,z);return null},T.prototype._read_comment=function(R){var z=null;if(R==="/"){var Z="";if(this._input.peek(1)==="*"){Z=this.__patterns.block_comment.read();var v=O.get_directives(Z);v&&v.ignore==="start"&&(Z+=O.readIgnored(this._input)),Z=Z.replace(p.allLineBreaks,` `),z=this._create_token(w.BLOCK_COMMENT,Z),z.directives=v}else this._input.peek(1)==="/"&&(Z=this.__patterns.comment.read(),z=this._create_token(w.COMMENT,Z))}return z},T.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var z=this._input.next();return this.has_char_escapes=!1,R==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(z=C(z)),this._input.peek()===R&&(z+=this._input.next()),z=z.replace(p.allLineBreaks,` `),this._create_token(w.STRING,z)}return null},T.prototype._allow_regexp_or_xml=function(R){return R.type===w.RESERVED&&L(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===w.END_EXPR&&R.text===")"&&R.opened.previous.type===w.RESERVED&&L(R.opened.previous.text,["if","while","for"])||L(R.type,[w.COMMENT,w.START_EXPR,w.START_BLOCK,w.START,w.END_BLOCK,w.OPERATOR,w.EQUALS,w.EOF,w.SEMICOLON,w.COMMA])},T.prototype._read_regexp=function(R,z){if(R==="/"&&this._allow_regexp_or_xml(z)){for(var Z=this._input.next(),v=!1,y=!1;this._input.hasNext()&&(v||y||this._input.peek()!==R)&&!this._input.testChar(p.newline);)Z+=this._input.peek(),v?v=!1:(v=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===R&&(Z+=this._input.next(),Z+=this._input.read(p.identifier)),this._create_token(w.STRING,Z)}return null},T.prototype._read_xml=function(R,z){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(z)){var Z="",v=this.__patterns.xml.read_match();if(v){for(var y=v[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=y.indexOf("{")===0,j=0;v;){var me=!!v[1],xe=v[2],Re=!!v[v.length-1]||xe.slice(0,8)==="![CDATA[";if(!Re&&(xe===y||$&&xe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(me?--j:++j),Z+=v[0],j<=0)break;v=this.__patterns.xml.read_match()}return v||(Z+=this._input.match(/[\s\S]*/g)[0]),Z=Z.replace(p.allLineBreaks,` `),this._create_token(w.STRING,Z)}}return null};function C(R){for(var z="",Z=0,v=new D(R),y=null;v.hasNext();)if(y=v.match(/([\s]|[^\\]|\\\\)+/g),y&&(z+=y[0]),v.peek()==="\\"){if(v.next(),v.peek()==="x")y=v.match(/x([0-9A-Fa-f]{2})/g);else if(v.peek()==="u")y=v.match(/u([0-9A-Fa-f]{4})/g),y||(y=v.match(/u\{([0-9A-Fa-f]+)\}/g));else{z+="\\",v.hasNext()&&(z+=v.next());continue}if(!y||(Z=parseInt(y[1],16),Z>126&&Z<=255&&y[0].indexOf("x")===0))return R;Z>=0&&Z<32||Z>1114111?z+="\\"+y[0]:Z===34||Z===39||Z===92?z+="\\"+String.fromCharCode(Z):z+=String.fromCharCode(Z)}return z}T.prototype._read_string_recursive=function(R,z,Z){var v,y;R==="'"?y=this.__patterns.single_quote:R==='"'?y=this.__patterns.double_quote:R==="`"?y=this.__patterns.template_text:R==="}"&&(y=this.__patterns.template_expression);for(var $=y.read(),j="";this._input.hasNext();){if(j=this._input.next(),j===R||!z&&p.newline.test(j)){this._input.back();break}else j==="\\"&&this._input.hasNext()?(v=this._input.peek(),v==="x"||v==="u"?this.has_char_escapes=!0:v==="\r"&&this._input.peek(1)===` `&&this._input.next(),j+=this._input.next()):Z&&(Z==="${"&&j==="$"&&this._input.peek()==="{"&&(j+=this._input.next()),Z===j&&(R==="`"?j+=this._read_string_recursive("}",z,"`"):j+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(j+=this._input.next())));j+=y.read(),$+=j}return $},ue.exports.Tokenizer=T,ue.exports.TOKEN=w,ue.exports.positionable_operators=te.slice(),ue.exports.line_starters=we.slice()},function(ue){var o=RegExp.prototype.hasOwnProperty("sticky");function G(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position=0&&D=0&&f=D.length&&this.__input.substring(f-D.length,f).toLowerCase()===D},ue.exports.InputScanner=G},function(ue,o,G){var D=G(8).InputScanner,f=G(3).Token,u=G(10).TokenStream,g=G(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(H,L){this._input=new D(H),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new g(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var H,L=new f(p.START,""),w=null,O=[],A=new u;L.type!==p.EOF;){for(H=this._get_next_token(L,w);this._is_comment(H);)A.add(H),H=this._get_next_token(L,w);A.isEmpty()||(H.comments_before=A,A=new u),H.parent=w,this._is_opening(H)?(O.push(w),w=H):w&&this._is_closing(H,w)&&(H.opened=w,w.closed=H,w=O.pop(),H.parent=w),H.previous=L,L.next=H,this.__tokens.add(H),L=H}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(H,L){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(p.RAW,w):this._create_token(p.EOF,"")},I.prototype._is_comment=function(H){return!1},I.prototype._is_opening=function(H){return!1},I.prototype._is_closing=function(H,L){return!1},I.prototype._create_token=function(H,L){var w=new f(H,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ue.exports.Tokenizer=I,ue.exports.TOKEN=p},function(ue){function o(G){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=G}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position=0&&G/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new D,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(g){var p=this._create();return p._disabled[g]=!0,p._update(),p},u.prototype.read_options=function(g){var p=this._create();for(var I in f)p._disabled[I]=g.templating.indexOf(I)===-1;return p._update(),p},u.prototype.exclude=function(g){var p=this._create();return p._excluded[g]=!0,p._update(),p},u.prototype.read=function(){var g="";this._match_pattern?g=this._input.read(this._starting_pattern):g=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),g+=p,p=this._read_template();return this._until_after&&(g+=this._input.readUntilAfter(this._until_pattern)),g},u.prototype.__set_templated_pattern=function(){var g=[];this._disabled.php||g.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||g.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(g.push(this.__patterns.django._starting_pattern.source),g.push(this.__patterns.django_value._starting_pattern.source),g.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||g.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&g.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+g.join("|")+")")},u.prototype._read_template=function(){var g="",p=this._input.peek();if(p==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(g=g||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(g=g||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(g=g||this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars_unescaped.read(),g=g||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(g=g||this.__patterns.django_value.read()),this._excluded.django||(g=g||this.__patterns.django_comment.read(),g=g||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(g=g||this.__patterns.smarty_comment.read(),g=g||this.__patterns.smarty_literal.read(),g=g||this.__patterns.smarty.read()));return g},ue.exports.TemplatablePattern=u}],oe={};function W(ue){var o=oe[ue];if(o!==void 0)return o.exports;var G=oe[ue]={exports:{}};return fe[ue](G,G.exports,W),G.exports}var _e=W(0);q=_e})();var ve=q;b=[],F=function(){return{js_beautify:ve}}.apply(Pe,b),F!==void 0&&(yt.exports=F)})()},75918:function(yt,Pe,b){"use strict";b.d(Pe,{Wi:function(){return W},Z0:function(){return _e},aU:function(){return oe},eZ:function(){return o},wY:function(){return ue}});var F=b(4348),q=b(69323),ve=b(13268),fe=function(G,D,f,u){function g(p){return p instanceof f?p:new f(function(I){I(p)})}return new(f||(f=Promise))(function(p,I){function H(O){try{w(u.next(O))}catch(A){I(A)}}function L(O){try{w(u.throw(O))}catch(A){I(A)}}function w(O){O.done?p(O.value):g(O.value).then(H,L)}w((u=u.apply(G,D||[])).next())})};class oe extends q.JT{constructor(D,f="",u="",g=!0,p){super(),this._onDidChange=this._register(new F.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=f,this._cssClass=u,this._enabled=g,this._actionCallback=p}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,f){return fe(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class W extends q.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new F.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new F.Q5),this.onDidRun=this._onDidRun.event}run(D,f){return fe(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let u;try{yield this.runAction(D,f)}catch(g){u=g}this._onDidRun.fire({action:D,error:u})})}runAction(D,f){return fe(this,void 0,void 0,function*(){yield D.run(f)})}}class _e extends oe{constructor(D){super(_e.ID,D,D?"separator text":"separator"),this.checked=!1,this.enabled=!1}}_e.ID="vs.actions.separator";class ue{constructor(D,f,u,g){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=f,this.class=g,this._actions=u}get actions(){return this._actions}dispose(){}run(){return fe(this,void 0,void 0,function*(){})}}class o extends oe{constructor(){super(o.ID,ve.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(yt,Pe,b){"use strict";b.d(Pe,{ok:function(){return F}});function F(q,ve){if(!q)throw new Error(ve?`Assertion failed (${ve})`:"Assertion Failed")}},52615:function(yt,Pe,b){"use strict";b.d(Pe,{CM:function(){return oe},JL:function(){return W},dT:function(){return ue},fK:function(){return fe},lA:function(){return _e}});var F=b(4348);class q{constructor(){this._icons=new Map,this._onDidRegister=new F.Q5}add(G){const D=this._icons.get(G.id);D?G.description?D.description=G.description:console.error(`Duplicate registration of codicon ${G.id}`):(this._icons.set(G.id,G),this._onDidRegister.fire(G))}get(G){return this._icons.get(G)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const ve=new q,fe=ve;function oe(o,G){return new _e(o,G)}function W(o){return o?o.replace(/\$\((.*?)\)/g,(G,D)=>` ${D} `).trim():""}class _e{constructor(G,D,f){this.id=G,this.definition=D,this.description=f,ve.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ue;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const G=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function D(g){if(g instanceof _e)return["codicon","codicon-"+g.id];const p=G.exec(g.id);if(!p)return D(_e.error);let[,I,H]=p;const L=["codicon","codicon-"+I];return H&&L.push("codicon-modifier-"+H.substr(1)),L}o.asClassNameArray=D;function f(g){return D(g).join(" ")}o.asClassName=f;function u(g){return"."+D(g).join(".")}o.asCSSSelector=u})(ue||(ue={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(_e||(_e={}))},79881:function(yt,Pe,b){"use strict";b.d(Pe,{B8:function(){return D},Cp:function(){return fe},F0:function(){return ue},L6:function(){return G},VV:function(){return _e},b1:function(){return o},dL:function(){return ve},ri:function(){return oe}});class F{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(u){setTimeout(()=>{throw u.stack?new Error(u.message+` `+u.stack):u},0)}}emit(u){this.listeners.forEach(g=>{g(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}const q=new F;function ve(f){_e(f)||q.onUnexpectedError(f)}function fe(f){_e(f)||q.onUnexpectedExternalError(f)}function oe(f){if(f instanceof Error){let{name:u,message:g}=f;const p=f.stacktrace||f.stack;return{$isError:!0,name:u,message:g,stack:p}}return f}const W="Canceled";function _e(f){return f instanceof Error&&f.name===W&&f.message===W}function ue(){const f=new Error(W);return f.name=f.message,f}function o(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function G(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class D extends Error{constructor(u){super("NotSupported"),u&&(this.message=u)}}},4348:function(yt,Pe,b){"use strict";b.d(Pe,{D0:function(){return D},E7:function(){return f},K3:function(){return G},Q5:function(){return o},ZD:function(){return u},ju:function(){return oe}});var F=b(79881),q=b(69323),ve=b(34502),fe=b(95830),oe;(function(g){g.None=()=>q.JT.None;function p(C){return(R,z=null,Z)=>{let v=!1,y;return y=C($=>{if(!v)return y?y.dispose():v=!0,R.call(z,$)},null,Z),v&&y.dispose(),y}}g.once=p;function I(C,R){return E((z,Z=null,v)=>C(y=>z.call(Z,R(y)),null,v))}g.map=I;function H(C,R){return E((z,Z=null,v)=>C(y=>{R(y),z.call(Z,y)},null,v))}g.forEach=H;function L(C,R){return E((z,Z=null,v)=>C(y=>R(y)&&z.call(Z,y),null,v))}g.filter=L;function w(C){return C}g.signal=w;function O(...C){return(R,z=null,Z)=>(0,q.F8)(...C.map(v=>v(y=>R.call(z,y),null,Z)))}g.any=O;function A(C,R,z){let Z=z;return I(C,v=>(Z=R(Z,v),Z))}g.reduce=A;function E(C){let R;const z=new o({onFirstListenerAdd(){R=C(z.fire,z)},onLastListenerRemove(){R.dispose()}});return z.event}function J(C,R,z=100,Z=!1,v){let y,$,j,me=0;const xe=new o({leakWarningThreshold:v,onFirstListenerAdd(){y=C(Re=>{me++,$=R($,Re),Z&&!j&&(xe.fire($),$=void 0),clearTimeout(j),j=setTimeout(()=>{const Ie=$;$=void 0,j=void 0,(!Z||me>1)&&xe.fire(Ie),me=0},z)})},onLastListenerRemove(){y.dispose()}});return xe.event}g.debounce=J;function te(C,R=(z,Z)=>z===Z){let z=!0,Z;return L(C,v=>{const y=z||!R(v,Z);return z=!1,Z=v,y})}g.latch=te;function ne(C,R){return[g.filter(C,R),g.filter(C,z=>!R(z))]}g.split=ne;function ye(C,R=!1,z=[]){let Z=z.slice(),v=C(j=>{Z?Z.push(j):$.fire(j)});const y=()=>{Z&&Z.forEach(j=>$.fire(j)),Z=null},$=new o({onFirstListenerAdd(){v||(v=C(j=>$.fire(j)))},onFirstListenerDidAdd(){Z&&(R?setTimeout(y):y())},onLastListenerRemove(){v&&v.dispose(),v=null}});return $.event}g.buffer=ye;class we{constructor(R){this.event=R}map(R){return new we(I(this.event,R))}forEach(R){return new we(H(this.event,R))}filter(R){return new we(L(this.event,R))}reduce(R,z){return new we(A(this.event,R,z))}latch(){return new we(te(this.event))}debounce(R,z=100,Z=!1,v){return new we(J(this.event,R,z,Z,v))}on(R,z,Z){return this.event(R,z,Z)}once(R,z,Z){return p(this.event)(R,z,Z)}}function Se(C){return new we(C)}g.chain=Se;function he(C,R,z=Z=>Z){const Z=(...j)=>$.fire(z(...j)),v=()=>C.on(R,Z),y=()=>C.removeListener(R,Z),$=new o({onFirstListenerAdd:v,onLastListenerRemove:y});return $.event}g.fromNodeEventEmitter=he;function V(C,R,z=Z=>Z){const Z=(...j)=>$.fire(z(...j)),v=()=>C.addEventListener(R,Z),y=()=>C.removeEventListener(R,Z),$=new o({onFirstListenerAdd:v,onLastListenerRemove:y});return $.event}g.fromDOMEventEmitter=V;function T(C){return new Promise(R=>p(C)(R))}g.toPromise=T})(oe||(oe={}));class W{constructor(p){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${p}_${W._idPool++}`}start(p){this._stopWatch=new fe.G(!0),this._listenerCount=p}stop(){if(this._stopWatch){const p=this._stopWatch.elapsed();this._elapsedOverall+=p,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${p.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}W._idPool=0;let _e=-1;class ue{constructor(p,I=Math.random().toString(18).slice(2,5)){this.customThreshold=p,this.name=I,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(p){let I=_e;if(typeof this.customThreshold=="number"&&(I=this.customThreshold),I<=0||p{const w=this._stacks.get(H)||0;this._stacks.set(H,w-1)}}}class o{constructor(p){var I;this._disposed=!1,this._options=p,this._leakageMon=_e>0?new ue(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((I=this._options)===null||I===void 0)&&I._profName?new W(this._options._profName):void 0}get event(){return this._event||(this._event=(p,I,H)=>{var L;this._listeners||(this._listeners=new ve.S);const w=this._listeners.isEmpty();w&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const O=this._listeners.push(I?[p,I]:p);w&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,p,I);const A=(L=this._leakageMon)===null||L===void 0?void 0:L.check(this._listeners.size),E=(0,q.OF)(()=>{A&&A(),this._disposed||(O(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return H instanceof q.SL?H.add(E):Array.isArray(H)&&H.push(E),E}),this._event}fire(p){var I,H;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ve.S);for(let L of this._listeners)this._deliveryQueue.push([L,p]);for((I=this._perfMon)===null||I===void 0||I.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[L,w]=this._deliveryQueue.shift();try{typeof L=="function"?L.call(void 0,w):L[0].call(L[1],w)}catch(O){(0,F.dL)(O)}}(H=this._perfMon)===null||H===void 0||H.stop()}}dispose(){var p,I,H,L,w;this._disposed||(this._disposed=!0,(p=this._listeners)===null||p===void 0||p.clear(),(I=this._deliveryQueue)===null||I===void 0||I.clear(),(L=(H=this._options)===null||H===void 0?void 0:H.onLastListenerRemove)===null||L===void 0||L.call(H),(w=this._leakageMon)===null||w===void 0||w.dispose())}}class G extends o{constructor(p){super(p),this._isPaused=0,this._eventQueue=new ve.S,this._mergeFn=p==null?void 0:p.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const p=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(p))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(p){this._listeners&&(this._isPaused!==0?this._eventQueue.push(p):super.fire(p))}}class D extends G{constructor(p){var I;super(p),this._delay=(I=p.delay)!==null&&I!==void 0?I:100}fire(p){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(p)}}class f{constructor(){this.buffers=[]}wrapEvent(p){return(I,H,L)=>p(w=>{const O=this.buffers[this.buffers.length-1];O?O.push(()=>I.call(H,w)):I.call(H,w)},void 0,L)}bufferEvents(p){const I=[];this.buffers.push(I);const H=p();return this.buffers.pop(),I.forEach(L=>L()),H}}class u{constructor(){this.listening=!1,this.inputEvent=oe.None,this.inputEventListener=q.JT.None,this.emitter=new o({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(yt,Pe,b){"use strict";b.d(Pe,{I:function(){return F}});function F(q){const ve=this;let fe=!1,oe;return function(){return fe||(fe=!0,oe=q.apply(ve,arguments)),oe}}},88226:function(yt,Pe,b){"use strict";b.d(Pe,{$:function(){return F}});var F;(function(q){function ve(O){return O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}q.is=ve;const fe=Object.freeze([]);function oe(){return fe}q.empty=oe;function*W(O){yield O}q.single=W;function _e(O){return O||fe}q.from=_e;function ue(O){return!O||O[Symbol.iterator]().next().done===!0}q.isEmpty=ue;function o(O){return O[Symbol.iterator]().next().value}q.first=o;function G(O,A){for(const E of O)if(A(E))return!0;return!1}q.some=G;function D(O,A){for(const E of O)if(A(E))return E}q.find=D;function*f(O,A){for(const E of O)A(E)&&(yield E)}q.filter=f;function*u(O,A){let E=0;for(const J of O)yield A(J,E++)}q.map=u;function*g(...O){for(const A of O)for(const E of A)yield E}q.concat=g;function*p(O){for(const A of O)for(const E of A)yield E}q.concatNested=p;function I(O,A,E){let J=E;for(const te of O)J=A(J,te);return J}q.reduce=I;function*H(O,A,E=O.length){for(A<0&&(A+=O.length),E<0?E+=O.length:E>O.length&&(E=O.length);AJ===te){const J=O[Symbol.iterator](),te=A[Symbol.iterator]();for(;;){const ne=J.next(),ye=te.next();if(ne.done!==ye.done)return!1;if(ne.done)return!0;if(!E(ne.value,ye.value))return!1}}q.equals=w})(F||(F={}))},69323:function(yt,Pe,b){"use strict";b.d(Pe,{B9:function(){return u},F8:function(){return g},JT:function(){return H},Jz:function(){return w},OF:function(){return p},SL:function(){return I},Wf:function(){return f},XK:function(){return L},dk:function(){return G}});var F=b(17845),q=b(88226);const ve=!1;let fe=null;function oe(O){fe=O}if(ve){const O="__is_disposable_tracked__";oe(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[O]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==H.None)try{A[O]=!0}catch(J){}}markAsDisposed(A){if(A&&A!==H.None)try{A[O]=!0}catch(E){}}markAsSingleton(A){}})}function W(O){return fe==null||fe.trackDisposable(O),O}function _e(O){fe==null||fe.markAsDisposed(O)}function ue(O,A){fe==null||fe.setParent(O,A)}function o(O,A){if(fe)for(const E of O)fe.setParent(E,A)}function G(O){return fe==null||fe.markAsSingleton(O),O}class D extends Error{constructor(A){super(`Encountered errors while disposing of store. Errors: [${A.join(", ")}]`),this.errors=A}}function f(O){return typeof O.dispose=="function"&&O.dispose.length===0}function u(O){if(q.$.is(O)){let A=[];for(const E of O)if(E)try{E.dispose()}catch(J){A.push(J)}if(A.length===1)throw A[0];if(A.length>1)throw new D(A);return Array.isArray(O)?[]:O}else if(O)return O.dispose(),O}function g(...O){const A=p(()=>u(O));return o(O,A),A}function p(O){const A=W({dispose:(0,F.I)(()=>{_e(A),O()})});return A}class I{constructor(){this._toDispose=new Set,this._isDisposed=!1,W(this)}dispose(){this._isDisposed||(_e(this),this._isDisposed=!0,this.clear())}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(A){if(!A)return A;if(A===this)throw new Error("Cannot register a disposable on itself!");return ue(A,this),this._isDisposed?I.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(A),A}}I.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new I,W(this),ue(this._store,this)}dispose(){_e(this),this._store.dispose()}_register(A){if(A===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(A)}}H.None=Object.freeze({dispose(){}});class L{constructor(){this._isDisposed=!1,W(this)}get value(){return this._isDisposed?void 0:this._value}set value(A){var E;this._isDisposed||A===this._value||((E=this._value)===null||E===void 0||E.dispose(),A&&ue(A,this),this._value=A)}clear(){this.value=void 0}dispose(){var A;this._isDisposed=!0,_e(this),(A=this._value)===null||A===void 0||A.dispose(),this._value=void 0}clearAndLeak(){const A=this._value;return this._value=void 0,A&&ue(A,null),A}}class w{constructor(A){this.object=A}dispose(){}}},34502:function(yt,Pe,b){"use strict";b.d(Pe,{S:function(){return q}});class F{constructor(fe){this.element=fe,this.next=F.Undefined,this.prev=F.Undefined}}F.Undefined=new F(void 0);class q{constructor(){this._first=F.Undefined,this._last=F.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===F.Undefined}clear(){let fe=this._first;for(;fe!==F.Undefined;){const oe=fe.next;fe.prev=F.Undefined,fe.next=F.Undefined,fe=oe}this._first=F.Undefined,this._last=F.Undefined,this._size=0}unshift(fe){return this._insert(fe,!1)}push(fe){return this._insert(fe,!0)}_insert(fe,oe){const W=new F(fe);if(this._first===F.Undefined)this._first=W,this._last=W;else if(oe){const ue=this._last;this._last=W,W.prev=ue,ue.next=W}else{const ue=this._first;this._first=W,W.next=ue,ue.prev=W}this._size+=1;let _e=!1;return()=>{_e||(_e=!0,this._remove(W))}}shift(){if(this._first!==F.Undefined){const fe=this._first.element;return this._remove(this._first),fe}}pop(){if(this._last!==F.Undefined){const fe=this._last.element;return this._remove(this._last),fe}}_remove(fe){if(fe.prev!==F.Undefined&&fe.next!==F.Undefined){const oe=fe.prev;oe.next=fe.next,fe.next.prev=oe}else fe.prev===F.Undefined&&fe.next===F.Undefined?(this._first=F.Undefined,this._last=F.Undefined):fe.next===F.Undefined?(this._last=this._last.prev,this._last.next=F.Undefined):fe.prev===F.Undefined&&(this._first=this._first.next,this._first.prev=F.Undefined);this._size-=1}*[Symbol.iterator](){let fe=this._first;for(;fe!==F.Undefined;)yield fe.element,fe=fe.next}}},23345:function(yt,Pe,b){"use strict";b.d(Pe,{$L:function(){return J},ED:function(){return w},IJ:function(){return A},OS:function(){return we},WE:function(){return ne},dz:function(){return O},gn:function(){return te},li:function(){return p},r:function(){return V},tY:function(){return E},xS:function(){return ye}});var F=b(97671),q;const ve="en";let fe=!1,oe=!1,W=!1,_e=!1,ue=!1,o=!1,G=!1,D,f=null,u=null,g;const p=typeof self=="object"?self:typeof b.g=="object"?b.g:{};let I;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?I=p.vscode.process:typeof F!="undefined"&&(I=F);const H=typeof((q=I==null?void 0:I.versions)===null||q===void 0?void 0:q.electron)=="string"&&I.type==="renderer";if(typeof navigator=="object"&&!H)g=navigator.userAgent,fe=g.indexOf("Windows")>=0,oe=g.indexOf("Macintosh")>=0,G=(g.indexOf("Macintosh")>=0||g.indexOf("iPad")>=0||g.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=g.indexOf("Linux")>=0,o=!0,D=navigator.language,f=D;else if(typeof I=="object"){fe=I.platform==="win32",oe=I.platform==="darwin",W=I.platform==="linux",_e=W&&!!I.env.SNAP&&!!I.env.SNAP_REVISION,D=ve,f=ve;const T=I.env.VSCODE_NLS_CONFIG;if(T)try{const C=JSON.parse(T),R=C.availableLanguages["*"];D=C.locale,f=R||ve,u=C._translationsConfigFile}catch(C){}ue=!0}else console.error("Unable to resolve platform.");let L=0;oe?L=1:fe?L=3:W&&(L=2);const w=fe,O=oe,A=W,E=ue,J=o,te=G,ne=g,ye=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let R=[];p.addEventListener("message",Z=>{if(Z.data&&Z.data.vscodeSetImmediateId)for(let v=0,y=R.length;v{const v=++z;R.push({id:v,callback:Z}),p.postMessage({vscodeSetImmediateId:v},"*")}}if(typeof(I==null?void 0:I.nextTick)=="function")return I.nextTick.bind(I);const C=Promise.resolve();return R=>C.then(R)}(),we=oe||G?2:fe?1:3;let Se=!0,he=!1;function V(){if(!he){he=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2,Se=new Uint16Array(T.buffer)[0]===513}return Se}},95830:function(yt,Pe,b){"use strict";b.d(Pe,{G:function(){return ve}});var F=b(23345);const q=F.li.performance&&typeof F.li.performance.now=="function";class ve{constructor(oe){this._highResolution=q&&oe,this._startTime=this._now(),this._stopTime=-1}static create(oe=!0){return new ve(oe)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?F.li.performance.now():Date.now()}}},82983:function(yt,Pe,b){"use strict";b.d(Pe,{$i:function(){return me},C8:function(){return ot},GF:function(){return D},HO:function(){return z},IO:function(){return f},K7:function(){return et},Kw:function(){return dt},LC:function(){return p},Mh:function(){return ye},P1:function(){return we},PJ:function(){return St},Qe:function(){return xe},R1:function(){return G},RP:function(){return $},S6:function(){return At},TT:function(){return w},Ut:function(){return v},V8:function(){return I},WU:function(){return ve},YK:function(){return he},YU:function(){return fe},ZG:function(){return Se},ZH:function(){return T},ab:function(){return Re},c1:function(){return Ve},df:function(){return J},ec:function(){return oe},fi:function(){return ke},fy:function(){return W},j3:function(){return _e},j_:function(){return A},m5:function(){return F},mK:function(){return E},mr:function(){return u},oH:function(){return ce},oL:function(){return ue},ok:function(){return ne},ow:function(){return H},qq:function(){return te},qu:function(){return L},rL:function(){return V},uS:function(){return Rt},un:function(){return o},uq:function(){return g},vH:function(){return R},xe:function(){return Ie},zY:function(){return O}});function F(k){return!k||typeof k!="string"?!0:k.trim().length===0}const q=/{(\d+)}/g;function ve(k,...B){return B.length===0?k:k.replace(q,function(P,re){const N=parseInt(re,10);return isNaN(N)||N<0||N>=B.length?P:B[N]})}function fe(k){return k.replace(/[<>&]/g,function(B){switch(B){case"<":return"<";case">":return">";case"&":return"&";default:return B}})}function oe(k){return k.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function W(k,B=" "){const P=_e(k,B);return ue(P,B)}function _e(k,B){if(!k||!B)return k;const P=B.length;if(P===0||k.length===0)return k;let re=0;for(;k.indexOf(B,re)===re;)re=re+P;return k.substring(re)}function ue(k,B){if(!k||!B)return k;const P=B.length,re=k.length;if(P===0||re===0)return k;let N=re,ae=-1;for(;ae=k.lastIndexOf(B,N-1),!(ae===-1||ae+P!==N);){if(ae===0)return"";N=ae}return k.substring(0,N)}function o(k){return k.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function G(k){return k.replace(/\*/g,"")}function D(k,B,P={}){if(!k)throw new Error("Cannot create regex from empty string");B||(k=oe(k)),P.wholeWord&&(/\B/.test(k.charAt(0))||(k="\\b"+k),/\B/.test(k.charAt(k.length-1))||(k=k+"\\b"));let re="";return P.global&&(re+="g"),P.matchCase||(re+="i"),P.multiline&&(re+="m"),P.unicode&&(re+="u"),new RegExp(k,re)}function f(k){return k.source==="^"||k.source==="^$"||k.source==="$"||k.source==="^\\s*$"?!1:!!(k.exec("")&&k.lastIndex===0)}function u(k){return(k.global?"g":"")+(k.ignoreCase?"i":"")+(k.multiline?"m":"")+(k.unicode?"u":"")}function g(k){return k.split(/\r\n|\r|\n/)}function p(k){for(let B=0,P=k.length;B=0;P--){const re=k.charCodeAt(P);if(re!==32&&re!==9)return P}return-1}function L(k,B){return kB?1:0}function w(k,B,P=0,re=k.length,N=0,ae=B.length){for(;PCe)return 1}const le=re-P,ge=ae-N;return lege?1:0}function O(k,B){return A(k,B,0,k.length,0,B.length)}function A(k,B,P=0,re=k.length,N=0,ae=B.length){for(;P=128||Ce>=128)return w(k.toLowerCase(),B.toLowerCase(),P,re,N,ae);E(Ee)&&(Ee-=32),E(Ce)&&(Ce-=32);const Ne=Ee-Ce;if(Ne!==0)return Ne}const le=re-P,ge=ae-N;return lege?1:0}function E(k){return k>=97&&k<=122}function J(k){return k>=65&&k<=90}function te(k,B){return k.length===B.length&&A(k,B)===0}function ne(k,B){const P=B.length;return B.length>k.length?!1:A(k,B,0,P)===0}function ye(k,B){let P,re=Math.min(k.length,B.length);for(P=0;P1){const re=k.charCodeAt(B-2);if(Se(re))return V(re,P)}return P}function R(k,B){const P=Ye.getInstance(),re=B,N=k.length,ae=T(k,N,B);B+=ae>=65536?2:1;let le=P.getGraphemeBreakType(ae);for(;B=65536?2:1,le=Ee}return B-re}function z(k,B){const P=Ye.getInstance(),re=B,N=C(k,B);B-=N>=65536?2:1;let ae=P.getGraphemeBreakType(N);for(;B>0;){const le=C(k,B),ge=P.getGraphemeBreakType(le);if(ke(ge,ae))break;B-=le>=65536?2:1,ae=ge}return re-B}const Z=/(?:[\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 v(k){return Z.test(k)}const y=/(?:[\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 $(k){return y.test(k)}const j=/^[\t\n\r\x20-\x7E]*$/;function me(k){return j.test(k)}const xe=/[\u2028\u2029]/;function Re(k){return xe.test(k)}function Ie(k){for(let B=0,P=k.length;B=11904&&k<=55215||k>=63744&&k<=64255||k>=65281&&k<=65374}function ot(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 Ve="\uFEFF";function Rt(k){return!!(k&&k.length>0&&k.charCodeAt(0)===65279)}function dt(k,B=!1){return k?(B&&(k=k.replace(/\\./g,"")),k.toLowerCase()!==k):!1}function St(k){return k=k%(2*26),k<26?String.fromCharCode(97+k):String.fromCharCode(65+k-26)}function At(k){return Ye.getInstance().getGraphemeBreakType(k)}function ke(k,B){return k===0?B!==5&&B!==7:k===2&&B===3?!1:k===4||k===2||k===3||B===4||B===2||B===3?!0:!(k===8&&(B===8||B===9||B===11||B===12)||(k===11||k===9)&&(B===9||B===10)||(k===12||k===10)&&B===10||B===5||B===13||B===7||k===1||k===13&&B===14||k===6&&B===6)}class Ye{constructor(){this._data=Q()}static getInstance(){return Ye._INSTANCE||(Ye._INSTANCE=new Ye),Ye._INSTANCE}getGraphemeBreakType(B){if(B<32)return B===10?3:B===13?2:4;if(B<127)return 0;const P=this._data,re=P.length/3;let N=1;for(;N<=re;)if(BP[3*N+1])N=2*N+1;else return P[3*N+2];return 0}}Ye._INSTANCE=null;function Q(){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 ce(k,B){if(k===0)return 0;const P=Y(k,B);if(P!==void 0)return P;const re=C(B,k);return k-=M(re),k}function Y(k,B){let P=C(B,k);for(k-=M(P);pe(P)||P===65039||P===8419;){if(k===0)return;P=C(B,k),k-=M(P)}if(ot(P)){if(k>=0){const re=C(B,k);re===8205&&(k-=M(re))}return k}}function M(k){return k>=65536?2:1}function pe(k){return 127995<=k&&k<=127999}},72999:function(yt,Pe,b){"use strict";b.d(Pe,{$E:function(){return p},$K:function(){return _e},D8:function(){return f},HD:function(){return q},IU:function(){return I},Jp:function(){return ue},Kn:function(){return ve},cW:function(){return G},f6:function(){return H},hj:function(){return fe},jn:function(){return oe},kJ:function(){return F},mf:function(){return D},o8:function(){return W},p_:function(){return o},vE:function(){return L}});function F(w){return Array.isArray(w)}function q(w){return typeof w=="string"}function ve(w){return typeof w=="object"&&w!==null&&!Array.isArray(w)&&!(w instanceof RegExp)&&!(w instanceof Date)}function fe(w){return typeof w=="number"&&!isNaN(w)}function oe(w){return w===!0||w===!1}function W(w){return typeof w=="undefined"}function _e(w){return!ue(w)}function ue(w){return W(w)||w===null}function o(w,O){if(!w)throw new Error(O?`Unexpected type, expected '${O}'`:"Unexpected type")}function G(w){if(ue(w))throw new Error("Assertion Failed: argument is undefined or null");return w}function D(w){return typeof w=="function"}function f(w,O){const A=Math.min(w.length,O.length);for(let E=0;Efunction(){const te=Array.prototype.slice.call(arguments,0);return O(J,te)};let E={};for(const J of w)E[J]=A(J);return E}function H(w){return w===null?void 0:w}function L(w,O="Unreachable"){throw new Error(O)}},13268:function(yt,Pe,b){"use strict";b.d(Pe,{N:function(){return q}});function F(ve,fe){let oe;return fe.length===0?oe=ve:oe=ve.replace(/\{(\d+)\}/g,function(W,_e){const ue=_e[0];return typeof fe[ue]!="undefined"?fe[ue]:W}),oe}function q(ve,fe,...oe){return F(fe,oe)}},96236:function(yt,Pe,b){"use strict";b.d(Pe,{BH:function(){return I},NZ:function(){return H},U8:function(){return L},co:function(){return p},eH:function(){return g},vr:function(){return u}});var F=b(75918),q=b(52615),ve=b(4348),fe=b(88226),oe=b(69323),W=b(34502),_e=b(35884),ue=b(90689),o=b(16925),G=b(49055),D=function(w,O,A,E){var J=arguments.length,te=J<3?O:E===null?E=Object.getOwnPropertyDescriptor(O,A):E,ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(w,O,A,E);else for(var ye=w.length-1;ye>=0;ye--)(ne=w[ye])&&(te=(J<3?ne(te):J>3?ne(O,A,te):ne(O,A))||te);return J>3&&te&&Object.defineProperty(O,A,te),te},f=function(w,O){return function(A,E){O(A,E,w)}};function u(w){return w.command!==void 0}class g{constructor(O){this.id=g._idPool++,this._debugName=O}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const p=(0,o.yh)("menuService"),I=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ve.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:w=>w===g.CommandPalette}}addCommand(w){return this.addCommands(fe.$.single(w))}addCommands(w){for(const O of w)this._commands.set(O.id,O);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,oe.OF)(()=>{let O=!1;for(const A of w)O=this._commands.delete(A.id)||O;O&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(w){return this._commands.get(w)}getCommands(){const w=new Map;return this._commands.forEach((O,A)=>w.set(A,O)),w}appendMenuItem(w,O){return this.appendMenuItems(fe.$.single({id:w,item:O}))}appendMenuItems(w){const O=new Set,A=new W.S;for(const{id:E,item:J}of w){let te=this._menuItems.get(E);te||(te=new W.S,this._menuItems.set(E,te)),A.push(te.push(J)),O.add(E)}return this._onDidChangeMenu.fire(O),(0,oe.OF)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(O),A.clear()}})}getMenuItems(w){let O;return this._menuItems.has(w)?O=[...this._menuItems.get(w)]:O=[],w===g.CommandPalette&&this._appendImplicitItems(O),O}_appendImplicitItems(w){const O=new Set;for(const A of w)u(A)&&(O.add(A.command.id),A.alt&&O.add(A.alt.id));this._commands.forEach((A,E)=>{O.has(E)||w.push({command:A})})}};class H extends F.wY{constructor(O,A,E,J){super(`submenuitem.${O.submenu.id}`,typeof O.title=="string"?O.title:O.title.value,[],"submenu"),this.item=O,this._menuService=A,this._contextKeyService=E,this._options=J}get actions(){const O=[],A=this._menuService.createMenu(this.item.submenu,this._contextKeyService),E=A.getActions(this._options);A.dispose();for(const[,J]of E)J.length>0&&(O.push(...J),O.push(new F.Z0));return O.length&&O.pop(),O}}let L=class Xa{constructor(O,A,E,J,te){var ne,ye;if(this._commandService=te,this.id=O.id,this.label=E!=null&&E.renderShortTitle&&O.shortTitle?typeof O.shortTitle=="string"?O.shortTitle:O.shortTitle.value:typeof O.title=="string"?O.title:O.title.value,this.tooltip=(ye=typeof O.tooltip=="string"?O.tooltip:(ne=O.tooltip)===null||ne===void 0?void 0:ne.value)!==null&&ye!==void 0?ye:"",this.enabled=!O.precondition||J.contextMatchesRules(O.precondition),this.checked=void 0,O.toggled){const we=O.toggled.condition?O.toggled:{condition:O.toggled};this.checked=J.contextMatchesRules(we.condition),this.checked&&we.tooltip&&(this.tooltip=typeof we.tooltip=="string"?we.tooltip:we.tooltip.value),we.title&&(this.label=typeof we.title=="string"?we.title:we.title.value)}this.item=O,this.alt=A?new Xa(A,void 0,E,J,te):void 0,this._options=E,G.kS.isThemeIcon(O.icon)&&(this.class=q.dT.asClassName(O.icon))}dispose(){}run(...O){var A,E;let J=[];return!((A=this._options)===null||A===void 0)&&A.arg&&(J=[...J,this._options.arg]),!((E=this._options)===null||E===void 0)&&E.shouldForwardArgs&&(J=[...J,...O]),this._commandService.executeCommand(this.id,...J)}};L=D([f(3,ue.i6),f(4,_e.H)],L)},35884:function(yt,Pe,b){"use strict";b.d(Pe,{H:function(){return _e},P:function(){return ue}});var F=b(4348),q=b(88226),ve=b(69323),fe=b(34502),oe=b(72999),W=b(16925);const _e=(0,W.yh)("commandService"),ue=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new F.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,G){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!G)throw new Error("invalid command");return this.registerCommand({id:o,handler:G})}if(o.description){const p=[];for(let H of o.description.args)p.push(H.constraint);const I=o.handler;o.handler=function(H,...L){return(0,oe.D8)(L,p),I(H,...L)}}const{id:D}=o;let f=this._commands.get(D);f||(f=new fe.S,this._commands.set(D,f));let u=f.unshift(o),g=(0,ve.OF)(()=>{u();const p=this._commands.get(D);p!=null&&p.isEmpty()&&this._commands.delete(D)});return this._onDidRegisterCommand.fire(D),g}registerCommandAlias(o,G){return ue.registerCommand(o,(D,...f)=>D.get(_e).executeCommand(G,...f))}getCommand(o){const G=this._commands.get(o);if(!(!G||G.isEmpty()))return q.$.first(G)}getCommands(){const o=new Map;for(const G of this._commands.keys()){const D=this.getCommand(G);D&&o.set(G,D)}return o}};ue.registerCommand("noop",()=>{})},90689:function(yt,Pe,b){"use strict";b.d(Pe,{Ao:function(){return _e},Eq:function(){return V},Fb:function(){return ue},K8:function(){return R},i6:function(){return he},uy:function(){return Se}});var F=b(23345),q=b(82983),ve=b(16925);let fe=F.WE||"";const oe=new Map;oe.set("false",!1),oe.set("true",!0),oe.set("isMac",F.dz),oe.set("isLinux",F.IJ),oe.set("isWindows",F.ED),oe.set("isWeb",F.$L),oe.set("isMacNative",F.dz&&!F.$L),oe.set("isEdge",fe.indexOf("Edg/")>=0),oe.set("isFirefox",fe.indexOf("Firefox")>=0),oe.set("isChrome",fe.indexOf("Chrome")>=0),oe.set("isSafari",fe.indexOf("Safari")>=0);const W=Object.prototype.hasOwnProperty;class _e{static has(v){return f.create(v)}static equals(v,y){return u.create(v,y)}static regex(v,y){return J.create(v,y)}static not(v){return H.create(v)}static and(...v){return ye.create(v,null)}static or(...v){return we.create(v,null,!0)}static deserialize(v,y=!1){if(v)return this._deserializeOrExpression(v,y)}static _deserializeOrExpression(v,y){let $=v.split("||");return we.create($.map(j=>this._deserializeAndExpression(j,y)),null,!0)}static _deserializeAndExpression(v,y){let $=v.split("&&");return ye.create($.map(j=>this._deserializeOne(j,y)),null)}static _deserializeOne(v,y){if(v=v.trim(),v.indexOf("!=")>=0){let $=v.split("!=");return I.create($[0].trim(),this._deserializeValue($[1],y))}if(v.indexOf("==")>=0){let $=v.split("==");return u.create($[0].trim(),this._deserializeValue($[1],y))}if(v.indexOf("=~")>=0){let $=v.split("=~");return J.create($[0].trim(),this._deserializeRegexValue($[1],y))}if(v.indexOf(" in ")>=0){let $=v.split(" in ");return g.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(v)){const $=v.split(">=");return O.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(v)){const $=v.split(">");return w.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(v)){const $=v.split("<=");return E.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(v)){const $=v.split("<");return A.create($[0].trim(),$[1].trim())}return/^\!\s*/.test(v)?H.create(v.substr(1).trim()):f.create(v)}static _deserializeValue(v,y){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;let $=/^'([^']*)'$/.exec(v);return $?$[1].trim():v}static _deserializeRegexValue(v,y){if((0,q.m5)(v)){if(y)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let $=v.indexOf("/"),j=v.lastIndexOf("/");if($===j||$<0){if(y)throw new Error(`bad regexp-value '${v}', missing /-enclosure`);return console.warn(`bad regexp-value '${v}', missing /-enclosure`),null}let me=v.slice($+1,j),xe=v[j+1]==="i"?"i":"";try{return new RegExp(me,xe)}catch(Re){if(y)throw new Error(`bad regexp-value '${v}', parse error: ${Re}`);return console.warn(`bad regexp-value '${v}', parse error: ${Re}`),null}}}function ue(Z,v){const y=Z?Z.substituteConstants():void 0,$=v?v.substituteConstants():void 0;return!y&&!$?!0:!y||!$?!1:y.equals($)}function o(Z,v){return Z.cmp(v)}class G{constructor(){this.type=0}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!1}serialize(){return"false"}keys(){return[]}negate(){return D.INSTANCE}}G.INSTANCE=new G;class D{constructor(){this.type=1}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!0}serialize(){return"true"}keys(){return[]}negate(){return G.INSTANCE}}D.INSTANCE=new D;class f{constructor(v,y){this.key=v,this.negated=y,this.type=2}static create(v,y=null){const $=oe.get(v);return typeof $=="boolean"?$?D.INSTANCE:G.INSTANCE:new f(v,y)}cmp(v){return v.type!==this.type?this.type-v.type:T(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=oe.get(this.key);return typeof v=="boolean"?v?D.INSTANCE:G.INSTANCE:this}evaluate(v){return!!v.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=H.create(this.key,this)),this.negated}}class u{constructor(v,y,$){this.key=v,this.value=y,this.negated=$,this.type=4}static create(v,y,$=null){if(typeof y=="boolean")return y?f.create(v,$):H.create(v,$);const j=oe.get(v);return typeof j=="boolean"?y===(j?"true":"false")?D.INSTANCE:G.INSTANCE:new u(v,y,$)}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=oe.get(this.key);if(typeof v=="boolean"){const y=v?"true":"false";return this.value===y?D.INSTANCE:G.INSTANCE}return this}evaluate(v){return v.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class g{constructor(v,y){this.key=v,this.valueKey=y,this.type=10,this.negated=null}static create(v,y){return new g(v,y)}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.valueKey,v.key,v.valueKey)}equals(v){return v.type===this.type?this.key===v.key&&this.valueKey===v.valueKey:!1}substituteConstants(){return this}evaluate(v){const y=v.getValue(this.valueKey),$=v.getValue(this.key);return Array.isArray(y)?y.indexOf($)>=0:typeof $=="string"&&typeof y=="object"&&y!==null?W.call(y,$):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p.create(this)),this.negated}}class p{constructor(v){this._actual=v,this.type=11}static create(v){return new p(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class I{constructor(v,y,$){this.key=v,this.value=y,this.negated=$,this.type=5}static create(v,y,$=null){if(typeof y=="boolean")return y?H.create(v,$):f.create(v,$);const j=oe.get(v);return typeof j=="boolean"?y===(j?"true":"false")?G.INSTANCE:D.INSTANCE:new I(v,y,$)}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=oe.get(this.key);if(typeof v=="boolean"){const y=v?"true":"false";return this.value===y?G.INSTANCE:D.INSTANCE}return this}evaluate(v){return v.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class H{constructor(v,y){this.key=v,this.negated=y,this.type=3}static create(v,y=null){const $=oe.get(v);return typeof $=="boolean"?$?G.INSTANCE:D.INSTANCE:new H(v,y)}cmp(v){return v.type!==this.type?this.type-v.type:T(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=oe.get(this.key);return typeof v=="boolean"?v?G.INSTANCE:D.INSTANCE:this}evaluate(v){return!v.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function L(Z,v){if(typeof Z=="string"){const y=parseFloat(Z);isNaN(y)||(Z=y)}return typeof Z=="string"||typeof Z=="number"?v(Z):G.INSTANCE}class w{constructor(v,y,$){this.key=v,this.value=y,this.negated=$,this.type=12}static create(v,y,$=null){return L(y,j=>new w(v,j,$))}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class O{constructor(v,y,$){this.key=v,this.value=y,this.negated=$,this.type=13}static create(v,y,$=null){return L(y,j=>new O(v,j,$))}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.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 A{constructor(v,y,$){this.key=v,this.value=y,this.negated=$,this.type=14}static create(v,y,$=null){return L(y,j=>new A(v,j,$))}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))new E(v,j,$))}cmp(v){return v.type!==this.type?this.type-v.type:C(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class J{constructor(v,y){this.key=v,this.regexp=y,this.type=7,this.negated=null}static create(v,y){return new J(v,y)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.keyv.key)return 1;const y=this.regexp?this.regexp.source:"",$=v.regexp?v.regexp.source:"";return y<$?-1:y>$?1:0}equals(v){if(v.type===this.type){const y=this.regexp?this.regexp.source:"",$=v.regexp?v.regexp.source:"";return this.key===v.key&&y===$}return!1}substituteConstants(){return this}evaluate(v){let y=v.getValue(this.key);return this.regexp?this.regexp.test(y):!1}serialize(){const v=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${v}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=te.create(this)),this.negated}}class te{constructor(v){this._actual=v,this.type=8}static create(v){return new te(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ne(Z){let v=null;for(let y=0,$=Z.length;y<$;y++){const j=Z[y].substituteConstants();if(Z[y]!==j&&v===null){v=[];for(let me=0;mev.expr.length)return 1;for(let y=0,$=this.expr.length;y<$;y++){const j=o(this.expr[y],v.expr[y]);if(j!==0)return j}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let y=0,$=this.expr.length;y<$;y++)if(!this.expr[y].equals(v.expr[y]))return!1;return!0}return!1}substituteConstants(){const v=ne(this.expr);return v===this.expr?this:ye.create(v,this.negated)}evaluate(v){for(let y=0,$=this.expr.length;y<$;y++)if(!this.expr[y].evaluate(v))return!1;return!0}static _normalizeArr(v,y){const $=[];let j=!1;for(const me of v)if(me){if(me.type===1){j=!0;continue}if(me.type===0)return G.INSTANCE;if(me.type===6){$.push(...me.expr);continue}$.push(me)}if($.length===0&&j)return D.INSTANCE;if($.length!==0){if($.length===1)return $[0];$.sort(o);for(let me=1;me<$.length;me++)$[me-1].equals($[me])&&($.splice(me,1),me--);if($.length===1)return $[0];for(;$.length>1;){const me=$[$.length-1];if(me.type!==9)break;$.pop();const xe=$.pop(),Re=$.length===0,Ie=we.create(me.expr.map(et=>ye.create([et,xe],null)),null,Re);Ie&&($.push(Ie),$.sort(o))}return $.length===1?$[0]:new ye($,y)}}serialize(){return this.expr.map(v=>v.serialize()).join(" && ")}keys(){const v=[];for(let y of this.expr)v.push(...y.keys());return v}negate(){if(!this.negated){const v=[];for(let y of this.expr)v.push(y.negate());this.negated=we.create(v,this,!0)}return this.negated}}class we{constructor(v,y){this.expr=v,this.negated=y,this.type=9}static create(v,y,$){return we._normalizeArr(v,y,$)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.lengthv.expr.length)return 1;for(let y=0,$=this.expr.length;y<$;y++){const j=o(this.expr[y],v.expr[y]);if(j!==0)return j}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let y=0,$=this.expr.length;y<$;y++)if(!this.expr[y].equals(v.expr[y]))return!1;return!0}return!1}substituteConstants(){const v=ne(this.expr);return v===this.expr?this:we.create(v,this.negated,!1)}evaluate(v){for(let y=0,$=this.expr.length;y<$;y++)if(this.expr[y].evaluate(v))return!0;return!1}static _normalizeArr(v,y,$){let j=[],me=!1;if(v){for(let xe=0,Re=v.length;xev.serialize()).join(" || ")}keys(){const v=[];for(let y of this.expr)v.push(...y.keys());return v}negate(){if(!this.negated){let v=[];for(let y of this.expr)v.push(y.negate());for(;v.length>1;){const y=v.shift(),$=v.shift(),j=[];for(const xe of z(y))for(const Re of z($))j.push(ye.create([xe,Re],null));const me=v.length===0;v.unshift(we.create(j,null,me))}this.negated=v[0]}return this.negated}}class Se extends f{constructor(v,y,$){super(v,null),this._defaultValue=y,typeof $=="object"?Se._info.push(Object.assign(Object.assign({},$),{key:v})):$!==!0&&Se._info.push({key:v,description:$,type:y!=null?typeof y:void 0})}static all(){return Se._info.values()}bindTo(v){return v.createKey(this.key,this._defaultValue)}getValue(v){return v.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(v){return u.create(this.key,v)}}Se._info=[];const he=(0,ve.yh)("contextKeyService"),V="setContext";function T(Z,v){return Zv?1:0}function C(Z,v,y,$){return Zy?1:v<$?-1:v>$?1:0}function R(Z,v){if(v.type===6&&Z.type!==9&&Z.type!==6){for(const j of v.expr)if(Z.equals(j))return!0}const y=Z.negate(),$=z(y).concat(z(v));$.sort(o);for(let j=0;j<$.length;j++){const xe=$[j].negate();for(let Re=j+1;Re<$.length;Re++){const Ie=$[Re];if(xe.equals(Ie))return!0}}return!1}function z(Z){return Z.type===9?Z.expr:[Z]}},16925:function(yt,Pe,b){"use strict";b.d(Pe,{I8:function(){return F},TG:function(){return q},jt:function(){return oe},yh:function(){return fe}});var F;(function(W){W.serviceIds=new Map,W.DI_TARGET="$di$target",W.DI_DEPENDENCIES="$di$dependencies";function _e(ue){return ue[W.DI_DEPENDENCIES]||[]}W.getServiceDependencies=_e})(F||(F={}));const q=fe("instantiationService");function ve(W,_e,ue,o){_e[F.DI_TARGET]===_e?_e[F.DI_DEPENDENCIES].push({id:W,index:ue,optional:o}):(_e[F.DI_DEPENDENCIES]=[{id:W,index:ue,optional:o}],_e[F.DI_TARGET]=_e)}function fe(W){if(F.serviceIds.has(W))return F.serviceIds.get(W);const _e=function(ue,o,G){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ve(_e,ue,G,!1)};return _e.toString=()=>W,F.serviceIds.set(W,_e),_e}function oe(W){return function(_e,ue,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ve(W,_e,o,!0)}}},44650:function(yt,Pe,b){"use strict";b.d(Pe,{B:function(){return fe}});var F=b(76068),q=b(72999);class ve{constructor(){this.data=new Map}add(W,_e){F.ok(q.HD(W)),F.ok(q.Kn(_e)),F.ok(!this.data.has(W),"There is already an extension with this id"),this.data.set(W,_e)}as(W){return this.data.get(W)||null}}const fe=new ve},66213:function(yt,Pe,b){"use strict";b.d(Pe,{e:function(){return F}});var F;(function(q){q.DARK="dark",q.LIGHT="light",q.HIGH_CONTRAST="hc"})(F||(F={}))},49055:function(yt,Pe,b){"use strict";b.d(Pe,{EN:function(){return o},IP:function(){return f},Ic:function(){return p},XE:function(){return _e},bB:function(){return I},kS:function(){return G},m6:function(){return D}});var F=b(52615),q=b(4348),ve=b(69323),fe=b(16925),oe=b(44650),W=b(66213);const _e=(0,fe.yh)("themeService");var ue;(function(H){function L(w){return w&&typeof w=="object"&&typeof w.id=="string"}H.isThemeColor=L})(ue||(ue={}));function o(H){return{id:H}}var G;(function(H){function L(te){return te&&typeof te=="object"&&typeof te.id=="string"&&(typeof te.color=="undefined"||ue.isThemeColor(te.color))}H.isThemeIcon=L;const w=new RegExp(`^\\$\\((${F.dT.iconNameExpression}(?:${F.dT.iconModifierExpression})?)\\)$`);function O(te){const ne=w.exec(te);if(!ne)return;let[,ye]=ne;return{id:ye}}H.fromString=O;function A(te,ne){let ye=te.id;const we=ye.lastIndexOf("~");return we!==-1&&(ye=ye.substring(0,we)),ne&&(ye=`${ye}~${ne}`),{id:ye}}H.modify=A;function E(te,ne){var ye,we;return te.id===ne.id&&((ye=te.color)===null||ye===void 0?void 0:ye.id)===((we=ne.color)===null||we===void 0?void 0:we.id)}H.isEqual=E;function J(te,ne){return{id:te.id,color:ne?o(ne):void 0}}H.asThemeIcon=J,H.asClassNameArray=F.dT.asClassNameArray,H.asClassName=F.dT.asClassName,H.asCSSSelector=F.dT.asCSSSelector})(G||(G={}));function D(H){switch(H){case W.e.DARK:return"vs-dark";case W.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new q.Q5}onColorThemeChange(L){return this.themingParticipants.push(L),this.onThemingParticipantAddedEmitter.fire(L),(0,ve.OF)(()=>{const w=this.themingParticipants.indexOf(L);this.themingParticipants.splice(w,1)})}getThemingParticipants(){return this.themingParticipants}}let g=new u;oe.B.add(f.ThemingContribution,g);function p(H){return g.onColorThemeChange(H)}class I extends ve.JT{constructor(L){super(),this.themeService=L,this.theme=L.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(w=>this.onThemeChange(w)))}onThemeChange(L){this.theme=L,this.updateStyles()}updateStyles(){}}},31561:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return te}});var F=b(96663),q=b(90493),ve=b(72071),fe=b(6620),oe=b(35593),W=b(92310),_e=b.n(W),ue=b(8654),o=b(59301),G=b(10228),D=b(16089),f=G.Z.ESC,u=G.Z.TAB;function g(ne){var ye=ne.visible,we=ne.triggerRef,Se=ne.onVisibleChange,he=ne.autoFocus,V=ne.overlayRef,T=o.useRef(!1),C=function(){if(ye){var v,y;(v=we.current)===null||v===void 0||(y=v.focus)===null||y===void 0||y.call(v),Se==null||Se(!1)}},R=function(){var v;return(v=V.current)!==null&&v!==void 0&&v.focus?(V.current.focus(),T.current=!0,!0):!1},z=function(v){switch(v.keyCode){case f:C();break;case u:{var y=!1;T.current||(y=R()),y?v.preventDefault():C();break}}};o.useEffect(function(){return ye?(window.addEventListener("keydown",z),he&&(0,D.Z)(R,3),function(){window.removeEventListener("keydown",z),T.current=!1}):function(){T.current=!1}},[ye])}var p=(0,o.forwardRef)(function(ne,ye){var we=ne.overlay,Se=ne.arrow,he=ne.prefixCls,V=(0,o.useMemo)(function(){var C;return typeof we=="function"?C=we():C=we,C},[we]),T=(0,ue.sQ)(ye,V==null?void 0:V.ref);return o.createElement(o.Fragment,null,Se&&o.createElement("div",{className:"".concat(he,"-arrow")}),o.cloneElement(V,{ref:(0,ue.Yr)(V)?T:void 0}))}),I=p,H={adjustX:1,adjustY:1},L=[0,0],w={topLeft:{points:["bl","tl"],overflow:H,offset:[0,-4],targetOffset:L},top:{points:["bc","tc"],overflow:H,offset:[0,-4],targetOffset:L},topRight:{points:["br","tr"],overflow:H,offset:[0,-4],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:H,offset:[0,4],targetOffset:L},bottom:{points:["tc","bc"],overflow:H,offset:[0,4],targetOffset:L},bottomRight:{points:["tr","br"],overflow:H,offset:[0,4],targetOffset:L}},O=w,A=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function E(ne,ye){var we,Se=ne.arrow,he=Se===void 0?!1:Se,V=ne.prefixCls,T=V===void 0?"rc-dropdown":V,C=ne.transitionName,R=ne.animation,z=ne.align,Z=ne.placement,v=Z===void 0?"bottomLeft":Z,y=ne.placements,$=y===void 0?O:y,j=ne.getPopupContainer,me=ne.showAction,xe=ne.hideAction,Re=ne.overlayClassName,Ie=ne.overlayStyle,et=ne.visible,ot=ne.trigger,Ve=ot===void 0?["hover"]:ot,Rt=ne.autoFocus,dt=ne.overlay,St=ne.children,At=ne.onVisibleChange,ke=(0,fe.Z)(ne,A),Ye=o.useState(),Q=(0,ve.Z)(Ye,2),ce=Q[0],Y=Q[1],M="visible"in ne?et:ce,pe=o.useRef(null),k=o.useRef(null),B=o.useRef(null);o.useImperativeHandle(ye,function(){return pe.current});var P=function(Ke){Y(Ke),At==null||At(Ke)};g({visible:M,triggerRef:B,onVisibleChange:P,autoFocus:Rt,overlayRef:k});var re=function(Ke){var Oe=ne.onOverlayClick;Y(!1),Oe&&Oe(Ke)},N=function(){return o.createElement(I,{ref:k,overlay:dt,prefixCls:T,arrow:he})},ae=function(){return typeof dt=="function"?N:N()},le=function(){var Ke=ne.minOverlayWidthMatchTrigger,Oe=ne.alignPoint;return"minOverlayWidthMatchTrigger"in ne?Ke:!Oe},ge=function(){var Ke=ne.openClassName;return Ke!==void 0?Ke:"".concat(T,"-open")},Ee=o.cloneElement(St,{className:_e()((we=St.props)===null||we===void 0?void 0:we.className,M&&ge()),ref:(0,ue.Yr)(St)?(0,ue.sQ)(B,St.ref):void 0}),Ce=xe;return!Ce&&Ve.indexOf("contextMenu")!==-1&&(Ce=["click"]),o.createElement(oe.Z,(0,F.Z)({builtinPlacements:$},ke,{prefixCls:T,ref:pe,popupClassName:_e()(Re,(0,q.Z)({},"".concat(T,"-show-arrow"),he)),popupStyle:Ie,action:Ve,showAction:me,hideAction:Ce,popupPlacement:v,popupAlign:z,popupTransitionName:C,popupAnimation:R,popupVisible:M,stretch:le()?"minWidth":"",popup:ae(),onPopupVisibleChange:P,onPopupClick:re,getPopupContainer:j}),Ee)}var J=o.forwardRef(E),te=J},15285:function(yt,Pe,b){"use strict";b.d(Pe,{iz:function(){return Ct},ck:function(){return mt},BW:function(){return Zt},sN:function(){return mt},Wd:function(){return qe},ZP:function(){return xt},Xl:function(){return we}});var F=b(96663),q=b(90493),ve=b(44127),fe=b(19127),oe=b(72071),W=b(6620),_e=b(92310),ue=b.n(_e),o=b(11780),G=b(18929),D=b(13697),f=b(48736),u=b(59301),g=b(4676),p=u.createContext(null);function I(De,Me){return De===void 0?null:"".concat(De,"-").concat(Me)}function H(De){var Me=u.useContext(p);return I(Me,De)}var L=b(80547),w=["children","locked"],O=u.createContext(null);function A(De,Me){var Ge=(0,ve.Z)({},De);return Object.keys(Me).forEach(function(st){var Xe=Me[st];Xe!==void 0&&(Ge[st]=Xe)}),Ge}function E(De){var Me=De.children,Ge=De.locked,st=(0,W.Z)(De,w),Xe=u.useContext(O),tt=(0,L.Z)(function(){return A(Xe,st)},[Xe,st],function(Je,Dt){return!Ge&&(Je[0]!==Dt[0]||!(0,D.Z)(Je[1],Dt[1],!0))});return u.createElement(O.Provider,{value:tt},Me)}var J=[],te=u.createContext(null);function ne(){return u.useContext(te)}var ye=u.createContext(J);function we(De){var Me=u.useContext(ye);return u.useMemo(function(){return De!==void 0?[].concat((0,fe.Z)(Me),[De]):Me},[Me,De])}var Se=u.createContext(null),he=u.createContext({}),V=he,T=b(29194);function C(De){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,T.Z)(De)){var Ge=De.nodeName.toLowerCase(),st=["input","select","textarea","button"].includes(Ge)||De.isContentEditable||Ge==="a"&&!!De.getAttribute("href"),Xe=De.getAttribute("tabindex"),tt=Number(Xe),Je=null;return Xe&&!Number.isNaN(tt)?Je=tt:st&&Je===null&&(Je=0),st&&De.disabled&&(Je=null),Je!==null&&(Je>=0||Me&&Je<0)}return!1}function R(De){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ge=(0,fe.Z)(De.querySelectorAll("*")).filter(function(st){return C(st,Me)});return C(De,Me)&&Ge.unshift(De),Ge}var z=null;function Z(){z=document.activeElement}function v(){z=null}function y(){if(z)try{z.focus()}catch(De){}}function $(De,Me){if(Me.keyCode===9){var Ge=R(De),st=Ge[Me.shiftKey?0:Ge.length-1],Xe=st===document.activeElement||De===document.activeElement;if(Xe){var tt=Ge[Me.shiftKey?Ge.length-1:0];tt.focus(),Me.preventDefault()}}}var j=b(10228),me=b(16089),xe=j.Z.LEFT,Re=j.Z.RIGHT,Ie=j.Z.UP,et=j.Z.DOWN,ot=j.Z.ENTER,Ve=j.Z.ESC,Rt=j.Z.HOME,dt=j.Z.END,St=[Ie,et,xe,Re];function At(De,Me,Ge,st){var Xe,tt,Je,Dt,zt="prev",Bt="next",rn="children",un="parent";if(De==="inline"&&st===ot)return{inlineTrigger:!0};var gn=(Xe={},(0,q.Z)(Xe,Ie,zt),(0,q.Z)(Xe,et,Bt),Xe),hn=(tt={},(0,q.Z)(tt,xe,Ge?Bt:zt),(0,q.Z)(tt,Re,Ge?zt:Bt),(0,q.Z)(tt,et,rn),(0,q.Z)(tt,ot,rn),tt),Jt=(Je={},(0,q.Z)(Je,Ie,zt),(0,q.Z)(Je,et,Bt),(0,q.Z)(Je,ot,rn),(0,q.Z)(Je,Ve,un),(0,q.Z)(Je,xe,Ge?rn:un),(0,q.Z)(Je,Re,Ge?un:rn),Je),An={inline:gn,horizontal:hn,vertical:Jt,inlineSub:gn,horizontalSub:Jt,verticalSub:Jt},_n=(Dt=An["".concat(De).concat(Me?"":"Sub")])===null||Dt===void 0?void 0:Dt[st];switch(_n){case zt:return{offset:-1,sibling:!0};case Bt:return{offset:1,sibling:!0};case un:return{offset:-1,sibling:!1};case rn:return{offset:1,sibling:!1};default:return null}}function ke(De){for(var Me=De;Me;){if(Me.getAttribute("data-menu-list"))return Me;Me=Me.parentElement}return null}function Ye(De,Me){for(var Ge=De||document.activeElement;Ge;){if(Me.has(Ge))return Ge;Ge=Ge.parentElement}return null}function Q(De,Me){var Ge=R(De,!0);return Ge.filter(function(st){return Me.has(st)})}function ce(De,Me,Ge){var st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!De)return null;var Xe=Q(De,Me),tt=Xe.length,Je=Xe.findIndex(function(Dt){return Ge===Dt});return st<0?Je===-1?Je=tt-1:Je-=1:st>0&&(Je+=1),Je=(Je+tt)%tt,Xe[Je]}var Y=function(Me,Ge){var st=new Set,Xe=new Map,tt=new Map;return Me.forEach(function(Je){var Dt=document.querySelector("[data-menu-id='".concat(I(Ge,Je),"']"));Dt&&(st.add(Dt),tt.set(Dt,Je),Xe.set(Je,Dt))}),{elements:st,key2element:Xe,element2key:tt}};function M(De,Me,Ge,st,Xe,tt,Je,Dt,zt,Bt){var rn=u.useRef(),un=u.useRef();un.current=Me;var gn=function(){me.Z.cancel(rn.current)};return u.useEffect(function(){return function(){gn()}},[]),function(hn){var Jt=hn.which;if([].concat(St,[ot,Ve,Rt,dt]).includes(Jt)){var An=tt(),_n=Y(An,st),In=_n,wn=In.elements,yn=In.key2element,En=In.element2key,xn=yn.get(Me),Tn=Ye(xn,wn),zn=En.get(Tn),Ln=At(De,Je(zn,!0).length===1,Ge,Jt);if(!Ln&&Jt!==Rt&&Jt!==dt)return;(St.includes(Jt)||[Rt,dt].includes(Jt))&&hn.preventDefault();var fn=function(Nn){if(Nn){var Jn=Nn,qt=Nn.querySelector("a");qt!=null&&qt.getAttribute("href")&&(Jn=qt);var Ot=En.get(Nn);Dt(Ot),gn(),rn.current=(0,me.Z)(function(){un.current===Ot&&Jn.focus()})}};if([Rt,dt].includes(Jt)||Ln.sibling||!Tn){var $t;!Tn||De==="inline"?$t=Xe.current:$t=ke(Tn);var Kn,Pn=Q($t,wn);Jt===Rt?Kn=Pn[0]:Jt===dt?Kn=Pn[Pn.length-1]:Kn=ce($t,wn,Tn,Ln.offset),fn(Kn)}else if(Ln.inlineTrigger)zt(zn);else if(Ln.offset>0)zt(zn,!0),gn(),rn.current=(0,me.Z)(function(){_n=Y(An,st);var Qn=Tn.getAttribute("aria-controls"),Nn=document.getElementById(Qn),Jn=ce(Nn,_n.elements);fn(Jn)},5);else if(Ln.offset<0){var Un=Je(zn,!0),Xn=Un[Un.length-2],ti=yn.get(Xn);zt(Xn,!1),fn(ti)}}Bt==null||Bt(hn)}}function pe(De){Promise.resolve().then(De)}var k="__RC_UTIL_PATH_SPLIT__",B=function(Me){return Me.join(k)},P=function(Me){return Me.split(k)},re="rc-menu-more";function N(){var De=u.useState({}),Me=(0,oe.Z)(De,2),Ge=Me[1],st=(0,u.useRef)(new Map),Xe=(0,u.useRef)(new Map),tt=u.useState([]),Je=(0,oe.Z)(tt,2),Dt=Je[0],zt=Je[1],Bt=(0,u.useRef)(0),rn=(0,u.useRef)(!1),un=function(){rn.current||Ge({})},gn=(0,u.useCallback)(function(yn,En){var xn=B(En);Xe.current.set(xn,yn),st.current.set(yn,xn),Bt.current+=1;var Tn=Bt.current;pe(function(){Tn===Bt.current&&un()})},[]),hn=(0,u.useCallback)(function(yn,En){var xn=B(En);Xe.current.delete(xn),st.current.delete(yn)},[]),Jt=(0,u.useCallback)(function(yn){zt(yn)},[]),An=(0,u.useCallback)(function(yn,En){var xn=st.current.get(yn)||"",Tn=P(xn);return En&&Dt.includes(Tn[0])&&Tn.unshift(re),Tn},[Dt]),_n=(0,u.useCallback)(function(yn,En){return yn.some(function(xn){var Tn=An(xn,!0);return Tn.includes(En)})},[An]),In=function(){var En=(0,fe.Z)(st.current.keys());return Dt.length&&En.push(re),En},wn=(0,u.useCallback)(function(yn){var En="".concat(st.current.get(yn)).concat(k),xn=new Set;return(0,fe.Z)(Xe.current.keys()).forEach(function(Tn){Tn.startsWith(En)&&xn.add(Xe.current.get(Tn))}),xn},[]);return u.useEffect(function(){return function(){rn.current=!0}},[]),{registerPath:gn,unregisterPath:hn,refreshOverflowKeys:Jt,isSubPathKey:_n,getKeyPath:An,getKeys:In,getSubPathKeys:wn}}function ae(De){var Me=u.useRef(De);Me.current=De;var Ge=u.useCallback(function(){for(var st,Xe=arguments.length,tt=new Array(Xe),Je=0;Je1&&(wn.motionAppear=!1);var yn=wn.onVisibleChanged;return wn.onVisibleChanged=function(En){return!gn.current&&!En&&_n(!0),yn==null?void 0:yn(En)},An?null:u.createElement(E,{mode:tt,locked:!gn.current},u.createElement(K.default,(0,F.Z)({visible:In},wn,{forceRender:zt,removeOnLeave:!1,leavedClassName:"".concat(Dt,"-hidden")}),function(En){var xn=En.className,Tn=En.style;return u.createElement(Xt,{id:Me,className:xn,style:Tn},Xe)}))}var be=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ae=["active"],nt=function(Me){var Ge,st=Me.style,Xe=Me.className,tt=Me.title,Je=Me.eventKey,Dt=Me.warnKey,zt=Me.disabled,Bt=Me.internalPopupClose,rn=Me.children,un=Me.itemIcon,gn=Me.expandIcon,hn=Me.popupClassName,Jt=Me.popupOffset,An=Me.popupStyle,_n=Me.onClick,In=Me.onMouseEnter,wn=Me.onMouseLeave,yn=Me.onTitleClick,En=Me.onTitleMouseEnter,xn=Me.onTitleMouseLeave,Tn=(0,W.Z)(Me,be),zn=H(Je),Ln=u.useContext(O),fn=Ln.prefixCls,$t=Ln.mode,Kn=Ln.openKeys,Pn=Ln.disabled,Un=Ln.overflowDisabled,Xn=Ln.activeKey,ti=Ln.selectedKeys,Qn=Ln.itemIcon,Nn=Ln.expandIcon,Jn=Ln.onItemClick,qt=Ln.onOpenChange,Ot=Ln.onActive,on=u.useContext(V),Cn=on._internalRenderSubMenuItem,On=u.useContext(Se),oi=On.isSubPathKey,Gn=we(),Zn="".concat(fn,"-submenu"),li=Pn||zt,di=u.useRef(),fi=u.useRef(),pi=un!=null?un:Qn,Vn=gn!=null?gn:Nn,ni=Kn.includes(Je),yi=!Un&&ni,Si=oi(ti,Je),hi=Le(Je,li,En,xn),Ai=hi.active,mi=(0,W.Z)(hi,Ae),Ci=u.useState(!1),ki=(0,oe.Z)(Ci,2),Pi=ki[0],zi=ki[1],ji=function(ui){li||zi(ui)},wi=function(ui){ji(!0),In==null||In({key:Je,domEvent:ui})},qi=function(ui){ji(!1),wn==null||wn({key:Je,domEvent:ui})},Ni=u.useMemo(function(){return Ai||($t!=="inline"?Pi||oi([Xn],Je):!1)},[$t,Ai,Xn,Pi,Je,oi]),Ii=ut(Gn.length),er=function(ui){li||(yn==null||yn({key:Je,domEvent:ui}),$t==="inline"&&qt(Je,!ni))},Mi=ae(function(ri){_n==null||_n(Qe(ri)),Jn(ri)}),Di=function(ui){$t!=="inline"&&qt(Je,ui)},Fi=function(){Ot(Je)},si=zn&&"".concat(zn,"-popup"),Ti=u.createElement("div",(0,F.Z)({role:"menuitem",style:Ii,className:"".concat(Zn,"-title"),tabIndex:li?null:-1,ref:di,title:typeof tt=="string"?tt:null,"data-menu-id":Un&&zn?null:zn,"aria-expanded":yi,"aria-haspopup":!0,"aria-controls":si,"aria-disabled":li,onClick:er,onFocus:Fi},mi),tt,u.createElement(ft,{icon:$t!=="horizontal"?Vn:void 0,props:(0,ve.Z)((0,ve.Z)({},Me),{},{isOpen:yi,isSubMenu:!0})},u.createElement("i",{className:"".concat(Zn,"-arrow")}))),Yn=u.useRef($t);if($t!=="inline"&&Gn.length>1?Yn.current="vertical":Yn.current=$t,!Un){var gi=Yn.current;Ti=u.createElement(x,{mode:gi,prefixCls:Zn,visible:!Bt&&yi&&$t!=="inline",popupClassName:hn,popupOffset:Jt,popupStyle:An,popup:u.createElement(E,{mode:gi==="horizontal"?"vertical":gi},u.createElement(Xt,{id:si,ref:fi},rn)),disabled:li,onVisibleChange:Di},Ti)}var Ei=u.createElement(o.Z.Item,(0,F.Z)({role:"none"},Tn,{component:"li",style:st,className:ue()(Zn,"".concat(Zn,"-").concat($t),Xe,(Ge={},(0,q.Z)(Ge,"".concat(Zn,"-open"),yi),(0,q.Z)(Ge,"".concat(Zn,"-active"),Ni),(0,q.Z)(Ge,"".concat(Zn,"-selected"),Si),(0,q.Z)(Ge,"".concat(Zn,"-disabled"),li),Ge)),onMouseEnter:wi,onMouseLeave:qi}),Ti,!Un&&u.createElement(ie,{id:si,open:yi,keyPath:Gn},rn));return Cn&&(Ei=Cn(Ei,Me,{selected:Si,active:Ni,open:yi,disabled:li})),u.createElement(E,{onItemClick:Mi,mode:$t==="horizontal"?"vertical":$t,itemIcon:pi,expandIcon:Vn},Ei)};function qe(De){var Me=De.eventKey,Ge=De.children,st=we(Me),Xe=Qt(Ge,st),tt=ne();u.useEffect(function(){if(tt)return tt.registerPath(Me,st),function(){tt.unregisterPath(Me,st)}},[st]);var Je;return tt?Je=Xe:Je=u.createElement(nt,De,Xe),u.createElement(ye.Provider,{value:st},Je)}var rt=b(20135),Ut=["className","title","eventKey","children"],jt=["children"],lt=function(Me){var Ge=Me.className,st=Me.title,Xe=Me.eventKey,tt=Me.children,Je=(0,W.Z)(Me,Ut),Dt=u.useContext(O),zt=Dt.prefixCls,Bt="".concat(zt,"-item-group");return u.createElement("li",(0,F.Z)({role:"presentation"},Je,{onClick:function(un){return un.stopPropagation()},className:ue()(Bt,Ge)}),u.createElement("div",{role:"presentation",className:"".concat(Bt,"-title"),title:typeof st=="string"?st:void 0},st),u.createElement("ul",{role:"group",className:"".concat(Bt,"-list")},tt))};function Zt(De){var Me=De.children,Ge=(0,W.Z)(De,jt),st=we(Ge.eventKey),Xe=Qt(Me,st),tt=ne();return tt?Xe:u.createElement(lt,(0,He.Z)(Ge,["warnKey"]),Xe)}function Ct(De){var Me=De.className,Ge=De.style,st=u.useContext(O),Xe=st.prefixCls,tt=ne();return tt?null:u.createElement("li",{role:"separator",className:ue()("".concat(Xe,"-item-divider"),Me),style:Ge})}var Fe=["label","children","key","type"];function Be(De){return(De||[]).map(function(Me,Ge){if(Me&&(0,rt.Z)(Me)==="object"){var st=Me,Xe=st.label,tt=st.children,Je=st.key,Dt=st.type,zt=(0,W.Z)(st,Fe),Bt=Je!=null?Je:"tmp-".concat(Ge);return tt||Dt==="group"?Dt==="group"?u.createElement(Zt,(0,F.Z)({key:Bt},zt,{title:Xe}),Be(tt)):u.createElement(qe,(0,F.Z)({key:Bt},zt,{title:Xe}),Be(tt)):Dt==="divider"?u.createElement(Ct,(0,F.Z)({key:Bt},zt)):u.createElement(mt,(0,F.Z)({key:Bt},zt),Xe)}return null}).filter(function(Me){return Me})}function ct(De,Me,Ge){var st=De;return Me&&(st=Be(Me)),Qt(st,Ge)}var Lt=["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"],Ft=[],dn=u.forwardRef(function(De,Me){var Ge,st,Xe=De,tt=Xe.prefixCls,Je=tt===void 0?"rc-menu":tt,Dt=Xe.rootClassName,zt=Xe.style,Bt=Xe.className,rn=Xe.tabIndex,un=rn===void 0?0:rn,gn=Xe.items,hn=Xe.children,Jt=Xe.direction,An=Xe.id,_n=Xe.mode,In=_n===void 0?"vertical":_n,wn=Xe.inlineCollapsed,yn=Xe.disabled,En=Xe.disabledOverflow,xn=Xe.subMenuOpenDelay,Tn=xn===void 0?.1:xn,zn=Xe.subMenuCloseDelay,Ln=zn===void 0?.1:zn,fn=Xe.forceSubMenuRender,$t=Xe.defaultOpenKeys,Kn=Xe.openKeys,Pn=Xe.activeKey,Un=Xe.defaultActiveFirst,Xn=Xe.selectable,ti=Xn===void 0?!0:Xn,Qn=Xe.multiple,Nn=Qn===void 0?!1:Qn,Jn=Xe.defaultSelectedKeys,qt=Xe.selectedKeys,Ot=Xe.onSelect,on=Xe.onDeselect,Cn=Xe.inlineIndent,On=Cn===void 0?24:Cn,oi=Xe.motion,Gn=Xe.defaultMotions,Zn=Xe.triggerSubMenuAction,li=Zn===void 0?"hover":Zn,di=Xe.builtinPlacements,fi=Xe.itemIcon,pi=Xe.expandIcon,Vn=Xe.overflowedIndicator,ni=Vn===void 0?"...":Vn,yi=Xe.overflowedIndicatorPopupClassName,Si=Xe.getPopupContainer,hi=Xe.onClick,Ai=Xe.onOpenChange,mi=Xe.onKeyDown,Ci=Xe.openAnimation,ki=Xe.openTransitionName,Pi=Xe._internalRenderMenuItem,zi=Xe._internalRenderSubMenuItem,ji=(0,W.Z)(Xe,Lt),wi=u.useMemo(function(){return ct(hn,gn,Ft)},[hn,gn]),qi=u.useState(!1),Ni=(0,oe.Z)(qi,2),Ii=Ni[0],er=Ni[1],Mi=u.useRef(),Di=Ee(An),Fi=Jt==="rtl",si=(0,G.Z)($t,{value:Kn,postState:function(Fn){return Fn||Ft}}),Ti=(0,oe.Z)(si,2),Yn=Ti[0],gi=Ti[1],Ei=function(Fn){var Wn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ii(){gi(Fn),Ai==null||Ai(Fn)}Wn?(0,g.flushSync)(ii):ii()},ri=u.useState(Yn),ui=(0,oe.Z)(ri,2),Vi=ui[0],sr=ui[1],Bi=u.useRef(!1),dr=u.useMemo(function(){return(In==="inline"||In==="vertical")&&wn?["vertical",wn]:[In,!1]},[In,wn]),Wi=(0,oe.Z)(dr,2),Zi=Wi[0],sn=Wi[1],en=Zi==="inline",Dn=u.useState(Zi),qn=(0,oe.Z)(Dn,2),kn=qn[0],Oi=qn[1],hr=u.useState(sn),ar=(0,oe.Z)(hr,2),tr=ar[0],ts=ar[1];u.useEffect(function(){Oi(Zi),ts(sn),Bi.current&&(en?gi(Vi):Ei(Ft))},[Zi,sn]);var ns=u.useState(0),Nr=(0,oe.Z)(ns,2),vr=Nr[0],is=Nr[1],Lr=vr>=wi.length-1||kn!=="horizontal"||En;u.useEffect(function(){en&&sr(Yn)},[Yn]),u.useEffect(function(){return Bi.current=!0,function(){Bi.current=!1}},[]);var bi=N(),Mr=bi.registerPath,Fr=bi.unregisterPath,Ui=bi.refreshOverflowKeys,Yi=bi.isSubPathKey,rs=bi.getKeyPath,Xi=bi.getKeys,ss=bi.getSubPathKeys,Br=u.useMemo(function(){return{registerPath:Mr,unregisterPath:Fr}},[Mr,Fr]),as=u.useMemo(function(){return{isSubPathKey:Yi}},[Yi]);u.useEffect(function(){Ui(Lr?Ft:wi.slice(vr+1).map(function(ei){return ei.key}))},[vr,Lr]);var os=(0,G.Z)(Pn||Un&&((Ge=wi[0])===null||Ge===void 0?void 0:Ge.key),{value:Pn}),ai=(0,oe.Z)(os,2),fr=ai[0],or=ai[1],lr=ae(function(ei){or(ei)}),ls=ae(function(){or(void 0)});(0,u.useImperativeHandle)(Me,function(){return{list:Mi.current,focus:function(Fn){var Wn,ii=Xi(),Li=Y(ii,Di),xr=Li.elements,Ir=Li.key2element,fs=Li.element2key,Kr=Q(Mi.current,xr),Sr=fr!=null?fr:Kr[0]?fs.get(Kr[0]):(Wn=wi.find(function(Dr){return!Dr.props.disabled}))===null||Wn===void 0?void 0:Wn.key,pr=Ir.get(Sr);if(Sr&&pr){var vt;pr==null||(vt=pr.focus)===null||vt===void 0||vt.call(pr,Fn)}}}});var jn=(0,G.Z)(Jn||[],{value:qt,postState:function(Fn){return Array.isArray(Fn)?Fn:Fn==null?Ft:[Fn]}}),yr=(0,oe.Z)(jn,2),nr=yr[0],Er=yr[1],us=function(Fn){if(ti){var Wn=Fn.key,ii=nr.includes(Wn),Li;Nn?ii?Li=nr.filter(function(Ir){return Ir!==Wn}):Li=[].concat((0,fe.Z)(nr),[Wn]):Li=[Wn],Er(Li);var xr=(0,ve.Z)((0,ve.Z)({},Fn),{},{selectedKeys:Li});ii?on==null||on(xr):Ot==null||Ot(xr)}!Nn&&Yn.length&&kn!=="inline"&&Ei(Ft)},cs=ae(function(ei){hi==null||hi(Qe(ei)),us(ei)}),Cr=ae(function(ei,Fn){var Wn=Yn.filter(function(Li){return Li!==ei});if(Fn)Wn.push(ei);else if(kn!=="inline"){var ii=ss(ei);Wn=Wn.filter(function(Li){return!ii.has(Li)})}(0,D.Z)(Yn,Wn,!0)||Ei(Wn,!0)}),Ur=function(Fn,Wn){var ii=Wn!=null?Wn:!Yn.includes(Fn);Cr(Fn,ii)},ds=M(kn,fr,Fi,Di,Mi,Xi,rs,or,Ur,mi);u.useEffect(function(){er(!0)},[]);var hs=u.useMemo(function(){return{_internalRenderMenuItem:Pi,_internalRenderSubMenuItem:zi}},[Pi,zi]),br=kn!=="horizontal"||En?wi:wi.map(function(ei,Fn){return u.createElement(E,{key:ei.key,overflowDisabled:Fn>vr},ei)}),$r=u.createElement(o.Z,(0,F.Z)({id:An,ref:Mi,prefixCls:"".concat(Je,"-overflow"),component:"ul",itemComponent:mt,className:ue()(Je,"".concat(Je,"-root"),"".concat(Je,"-").concat(kn),Bt,(st={},(0,q.Z)(st,"".concat(Je,"-inline-collapsed"),tr),(0,q.Z)(st,"".concat(Je,"-rtl"),Fi),st),Dt),dir:Jt,style:zt,role:"menu",tabIndex:un,data:br,renderRawItem:function(Fn){return Fn},renderRawRest:function(Fn){var Wn=Fn.length,ii=Wn?wi.slice(-Wn):null;return u.createElement(qe,{eventKey:re,title:ni,disabled:Lr,internalPopupClose:Wn===0,popupClassName:yi},ii)},maxCount:kn!=="horizontal"||En?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Fn){is(Fn)},onKeyDown:ds},ji));return u.createElement(V.Provider,{value:hs},u.createElement(p.Provider,{value:Di},u.createElement(E,{prefixCls:Je,rootClassName:Dt,mode:kn,openKeys:Yn,rtl:Fi,disabled:yn,motion:Ii?oi:null,defaultMotions:Ii?Gn:null,activeKey:fr,onActive:lr,onInactive:ls,selectedKeys:nr,inlineIndent:On,subMenuOpenDelay:Tn,subMenuCloseDelay:Ln,forceSubMenuRender:fn,builtinPlacements:di,triggerSubMenuAction:li,getPopupContainer:Si,itemIcon:fi,expandIcon:pi,onItemClick:cs,onOpenChange:Cr},u.createElement(Se.Provider,{value:as},$r),u.createElement("div",{style:{display:"none"},"aria-hidden":!0},u.createElement(te.Provider,{value:Br},wi)))))}),pn=dn,It=pn;It.Item=mt,It.SubMenu=qe,It.ItemGroup=Zt,It.Divider=Ct;var xt=It},11780:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return Z}});var F=b(96663),q=b(44127),ve=b(72071),fe=b(6620),oe=b(59301),W=b(92310),_e=b.n(W),ue=b(29301),o=b(34280),G=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],D=void 0;function f(v,y){var $=v.prefixCls,j=v.invalidate,me=v.item,xe=v.renderItem,Re=v.responsive,Ie=v.responsiveDisabled,et=v.registerSize,ot=v.itemKey,Ve=v.className,Rt=v.style,dt=v.children,St=v.display,At=v.order,ke=v.component,Ye=ke===void 0?"div":ke,Q=(0,fe.Z)(v,G),ce=Re&&!St;function Y(P){et(ot,P)}oe.useEffect(function(){return function(){Y(null)}},[]);var M=xe&&me!==D?xe(me,{index:At}):dt,pe;j||(pe={opacity:ce?0:1,height:ce?0:D,overflowY:ce?"hidden":D,order:Re?At:D,pointerEvents:ce?"none":D,position:ce?"absolute":D});var k={};ce&&(k["aria-hidden"]=!0);var B=oe.createElement(Ye,(0,F.Z)({className:_e()(!j&&$,Ve),style:(0,q.Z)((0,q.Z)({},pe),Rt)},k,Q,{ref:y}),M);return Re&&(B=oe.createElement(ue.Z,{onResize:function(re){var N=re.offsetWidth;Y(N)},disabled:Ie},B)),B}var u=oe.forwardRef(f);u.displayName="Item";var g=u,p=b(6089),I=b(4676),H=b(16089);function L(v){if(typeof MessageChannel=="undefined")(0,H.Z)(v);else{var y=new MessageChannel;y.port1.onmessage=function(){return v()},y.port2.postMessage(void 0)}}function w(){var v=oe.useRef(null),y=function(j){v.current||(v.current=[],L(function(){(0,I.unstable_batchedUpdates)(function(){v.current.forEach(function(me){me()}),v.current=null})})),v.current.push(j)};return y}function O(v,y){var $=oe.useState(y),j=(0,ve.Z)($,2),me=j[0],xe=j[1],Re=(0,p.Z)(function(Ie){v(function(){xe(Ie)})});return[me,Re]}var A=oe.createContext(null),E=["component"],J=["className"],te=["className"],ne=function(y,$){var j=oe.useContext(A);if(!j){var me=y.component,xe=me===void 0?"div":me,Re=(0,fe.Z)(y,E);return oe.createElement(xe,(0,F.Z)({},Re,{ref:$}))}var Ie=j.className,et=(0,fe.Z)(j,J),ot=y.className,Ve=(0,fe.Z)(y,te);return oe.createElement(A.Provider,{value:null},oe.createElement(g,(0,F.Z)({ref:$,className:_e()(Ie,ot)},et,Ve)))},ye=oe.forwardRef(ne);ye.displayName="RawItem";var we=ye,Se=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],he="responsive",V="invalidate";function T(v){return"+ ".concat(v.length," ...")}function C(v,y){var $=v.prefixCls,j=$===void 0?"rc-overflow":$,me=v.data,xe=me===void 0?[]:me,Re=v.renderItem,Ie=v.renderRawItem,et=v.itemKey,ot=v.itemWidth,Ve=ot===void 0?10:ot,Rt=v.ssr,dt=v.style,St=v.className,At=v.maxCount,ke=v.renderRest,Ye=v.renderRawRest,Q=v.suffix,ce=v.component,Y=ce===void 0?"div":ce,M=v.itemComponent,pe=v.onVisibleChange,k=(0,fe.Z)(v,Se),B=Rt==="full",P=w(),re=O(P,null),N=(0,ve.Z)(re,2),ae=N[0],le=N[1],ge=ae||0,Ee=O(P,new Map),Ce=(0,ve.Z)(Ee,2),Ne=Ce[0],Ke=Ce[1],Oe=O(P,0),He=(0,ve.Z)(Oe,2),Ze=He[0],Le=He[1],ut=O(P,0),ft=(0,ve.Z)(ut,2),wt=ft[0],Qe=ft[1],Kt=O(P,0),Wt=(0,ve.Z)(Kt,2),Gt=Wt[0],Mt=Wt[1],pt=(0,oe.useState)(null),ht=(0,ve.Z)(pt,2),mt=ht[0],Tt=ht[1],Et=(0,oe.useState)(null),kt=(0,ve.Z)(Et,2),Xt=kt[0],an=kt[1],Qt=oe.useMemo(function(){return Xt===null&&B?Number.MAX_SAFE_INTEGER:Xt||0},[Xt,ae]),cn=(0,oe.useState)(!1),Ht=(0,ve.Z)(cn,2),Vt=Ht[0],_t=Ht[1],We="".concat(j,"-item"),c=Math.max(Ze,wt),m=At===he,x=xe.length&&m,K=At===V,ie=x||typeof At=="number"&&xe.length>At,be=(0,oe.useMemo)(function(){var xt=xe;return x?ae===null&&B?xt=xe:xt=xe.slice(0,Math.min(xe.length,ge/Ve)):typeof At=="number"&&(xt=xe.slice(0,At)),xt},[xe,Ve,ae,At,x]),Ae=(0,oe.useMemo)(function(){return x?xe.slice(Qt+1):xe.slice(be.length)},[xe,be,x,Qt]),nt=(0,oe.useCallback)(function(xt,De){var Me;return typeof et=="function"?et(xt):(Me=et&&(xt==null?void 0:xt[et]))!==null&&Me!==void 0?Me:De},[et]),qe=(0,oe.useCallback)(Re||function(xt){return xt},[Re]);function rt(xt,De,Me){Xt===xt&&(De===void 0||De===mt)||(an(xt),Me||(_t(xtge){rt(Ge-1,xt-st-Gt+wt);break}}Q&&Ct(0)+Gt>ge&&Tt(null)}},[ge,Ne,wt,Gt,nt,be]);var Fe=Vt&&!!Ae.length,Be={};mt!==null&&x&&(Be={position:"absolute",left:mt,top:0});var ct={prefixCls:We,responsive:x,component:M,invalidate:K},Lt=Ie?function(xt,De){var Me=nt(xt,De);return oe.createElement(A.Provider,{key:Me,value:(0,q.Z)((0,q.Z)({},ct),{},{order:De,item:xt,itemKey:Me,registerSize:jt,display:De<=Qt})},Ie(xt,De))}:function(xt,De){var Me=nt(xt,De);return oe.createElement(g,(0,F.Z)({},ct,{order:De,key:Me,item:xt,renderItem:qe,itemKey:Me,registerSize:jt,display:De<=Qt}))},Ft={order:Fe?Qt:Number.MAX_SAFE_INTEGER,className:"".concat(We,"-rest"),registerSize:lt,display:Fe},dn=ke||T,pn=Ye?oe.createElement(A.Provider,{value:(0,q.Z)((0,q.Z)({},ct),Ft)},Ye(Ae)):oe.createElement(g,(0,F.Z)({},ct,Ft),typeof dn=="function"?dn(Ae):dn),It=oe.createElement(Y,(0,F.Z)({className:_e()(!K&&j,St),style:dt,ref:y},k),be.map(Lt),ie?pn:null,Q&&oe.createElement(g,(0,F.Z)({},ct,{responsive:m,responsiveDisabled:!x,order:Qt,className:"".concat(We,"-suffix"),registerSize:Zt,display:!0,style:Be}),Q));return m?oe.createElement(ue.Z,{onResize:Ut,disabled:!x},It):It}var R=oe.forwardRef(C);R.displayName="Overflow",R.Item=we,R.RESPONSIVE=he,R.INVALIDATE=V;var z=R,Z=z},29301:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return V}});var F=b(96663),q=b(59301),ve=b(11592),fe=b(48736),oe=b(44127),W=b(20135),_e=b(76846),ue=b(8654),o=q.createContext(null);function G(T){var C=T.children,R=T.onBatchResize,z=q.useRef(0),Z=q.useRef([]),v=q.useContext(o),y=q.useCallback(function($,j,me){z.current+=1;var xe=z.current;Z.current.push({size:$,element:j,data:me}),Promise.resolve().then(function(){xe===z.current&&(R==null||R(Z.current),Z.current=[])}),v==null||v($,j,me)},[R,v]);return q.createElement(o.Provider,{value:y},C)}var D=b(76374),f=new Map;function u(T){T.forEach(function(C){var R,z=C.target;(R=f.get(z))===null||R===void 0||R.forEach(function(Z){return Z(z)})})}var g=new D.Z(u),p=null,I=null;function H(T,C){f.has(T)||(f.set(T,new Set),g.observe(T)),f.get(T).add(C)}function L(T,C){f.has(T)&&(f.get(T).delete(C),f.get(T).size||(g.unobserve(T),f.delete(T)))}var w=b(52884),O=b(95727),A=b(65711),E=b(85745),J=function(T){(0,A.Z)(R,T);var C=(0,E.Z)(R);function R(){return(0,w.Z)(this,R),C.apply(this,arguments)}return(0,O.Z)(R,[{key:"render",value:function(){return this.props.children}}]),R}(q.Component);function te(T,C){var R=T.children,z=T.disabled,Z=q.useRef(null),v=q.useRef(null),y=q.useContext(o),$=typeof R=="function",j=$?R(Z):R,me=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),xe=!$&&q.isValidElement(j)&&(0,ue.Yr)(j),Re=xe?(0,ue.C4)(j):null,Ie=(0,ue.x1)(Re,Z),et=function(){var dt;return(0,_e.ZP)(Z.current)||(Z.current&&(0,W.Z)(Z.current)==="object"?(0,_e.ZP)((dt=Z.current)===null||dt===void 0?void 0:dt.nativeElement):null)||(0,_e.ZP)(v.current)};q.useImperativeHandle(C,function(){return et()});var ot=q.useRef(T);ot.current=T;var Ve=q.useCallback(function(Rt){var dt=ot.current,St=dt.onResize,At=dt.data,ke=Rt.getBoundingClientRect(),Ye=ke.width,Q=ke.height,ce=Rt.offsetWidth,Y=Rt.offsetHeight,M=Math.floor(Ye),pe=Math.floor(Q);if(me.current.width!==M||me.current.height!==pe||me.current.offsetWidth!==ce||me.current.offsetHeight!==Y){var k={width:M,height:pe,offsetWidth:ce,offsetHeight:Y};me.current=k;var B=ce===Math.round(Ye)?Ye:ce,P=Y===Math.round(Q)?Q:Y,re=(0,oe.Z)((0,oe.Z)({},k),{},{offsetWidth:B,offsetHeight:P});y==null||y(re,Rt,At),St&&Promise.resolve().then(function(){St(re,Rt)})}},[]);return q.useEffect(function(){var Rt=et();return Rt&&!z&&H(Rt,Ve),function(){return L(Rt,Ve)}},[Z.current,z]),q.createElement(J,{ref:v},xe?q.cloneElement(j,{ref:Ie}):j)}var ne=q.forwardRef(te),ye=ne,we="rc-observer-key";function Se(T,C){var R=T.children,z=typeof R=="function"?[R]:(0,ve.Z)(R);return z.map(function(Z,v){var y=(Z==null?void 0:Z.key)||"".concat(we,"-").concat(v);return q.createElement(ye,(0,F.Z)({},T,{key:y,ref:v===0?C:void 0}),Z)})}var he=q.forwardRef(Se);he.Collection=G;var V=he},55477:function(yt,Pe,b){"use strict";b.d(Pe,{G:function(){return u},Z:function(){return H}});var F=b(96663),q=b(44127),ve=b(6620),fe=b(35593),oe=b(59301),W={shiftX:64,adjustY:1},_e={adjustX:1,shiftY:!0},ue=[0,0],o={left:{points:["cr","cl"],overflow:_e,offset:[-4,0],targetOffset:ue},right:{points:["cl","cr"],overflow:_e,offset:[4,0],targetOffset:ue},top:{points:["bc","tc"],overflow:W,offset:[0,-4],targetOffset:ue},bottom:{points:["tc","bc"],overflow:W,offset:[0,4],targetOffset:ue},topLeft:{points:["bl","tl"],overflow:W,offset:[0,-4],targetOffset:ue},leftTop:{points:["tr","tl"],overflow:_e,offset:[-4,0],targetOffset:ue},topRight:{points:["br","tr"],overflow:W,offset:[0,-4],targetOffset:ue},rightTop:{points:["tl","tr"],overflow:_e,offset:[4,0],targetOffset:ue},bottomRight:{points:["tr","br"],overflow:W,offset:[0,4],targetOffset:ue},rightBottom:{points:["bl","br"],overflow:_e,offset:[4,0],targetOffset:ue},bottomLeft:{points:["tl","bl"],overflow:W,offset:[0,4],targetOffset:ue},leftBottom:{points:["br","bl"],overflow:_e,offset:[-4,0],targetOffset:ue}},G=null,D=b(92310),f=b.n(D);function u(L){var w=L.children,O=L.prefixCls,A=L.id,E=L.overlayInnerStyle,J=L.className,te=L.style;return oe.createElement("div",{className:f()("".concat(O,"-content"),J),style:te},oe.createElement("div",{className:"".concat(O,"-inner"),id:A,role:"tooltip",style:E},typeof w=="function"?w():w))}var g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],p=function(w,O){var A=w.overlayClassName,E=w.trigger,J=E===void 0?["hover"]:E,te=w.mouseEnterDelay,ne=te===void 0?0:te,ye=w.mouseLeaveDelay,we=ye===void 0?.1:ye,Se=w.overlayStyle,he=w.prefixCls,V=he===void 0?"rc-tooltip":he,T=w.children,C=w.onVisibleChange,R=w.afterVisibleChange,z=w.transitionName,Z=w.animation,v=w.motion,y=w.placement,$=y===void 0?"right":y,j=w.align,me=j===void 0?{}:j,xe=w.destroyTooltipOnHide,Re=xe===void 0?!1:xe,Ie=w.defaultVisible,et=w.getTooltipContainer,ot=w.overlayInnerStyle,Ve=w.arrowContent,Rt=w.overlay,dt=w.id,St=w.showArrow,At=St===void 0?!0:St,ke=(0,ve.Z)(w,g),Ye=(0,oe.useRef)(null);(0,oe.useImperativeHandle)(O,function(){return Ye.current});var Q=(0,q.Z)({},ke);"visible"in w&&(Q.popupVisible=w.visible);var ce=function(){return oe.createElement(u,{key:"content",prefixCls:V,id:dt,overlayInnerStyle:ot},Rt)};return oe.createElement(fe.Z,(0,F.Z)({popupClassName:A,prefixCls:V,popup:ce,action:J,builtinPlacements:o,popupPlacement:$,ref:Ye,popupAlign:me,getPopupContainer:et,onPopupVisibleChange:C,afterPopupVisibleChange:R,popupTransitionName:z,popupAnimation:Z,popupMotion:v,defaultPopupVisible:Ie,autoDestroy:Re,mouseLeaveDelay:we,popupStyle:Se,mouseEnterDelay:ne,arrow:At},Q),T)},I=(0,oe.forwardRef)(p),H=I},39417:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return ne}});var F=b(96663),q=b(90493),ve=b(6620),fe=b(44127),oe=b(52884),W=b(95727),_e=b(89866),ue=b(65711),o=b(85745),G=b(92310),D=b.n(G),f=b(26112),u=b(59301),g=b(39378),p=function(we){for(var Se=we.prefixCls,he=we.level,V=we.isStart,T=we.isEnd,C="".concat(Se,"-indent-unit"),R=[],z=0;z0&&arguments[0]!==void 0?arguments[0]:[],ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Y=Q.length,M=ce.length;if(Math.abs(Y-M)!==1)return{add:!1,key:null};function pe(k,B){var P=new Map;k.forEach(function(N){P.set(N,!0)});var re=B.filter(function(N){return!P.has(N)});return re.length===1?re[0]:null}return Y ").concat(ce);return ce}var et=I.forwardRef(function(Q,ce){var Y=Q.prefixCls,M=Q.data,pe=Q.selectable,k=Q.checkable,B=Q.expandedKeys,P=Q.selectedKeys,re=Q.checkedKeys,N=Q.loadedKeys,ae=Q.loadingKeys,le=Q.halfCheckedKeys,ge=Q.keyEntities,Ee=Q.disabled,Ce=Q.dragging,Ne=Q.dragOverNodeKey,Ke=Q.dropPosition,Oe=Q.motion,He=Q.height,Ze=Q.itemHeight,Le=Q.virtual,ut=Q.focusable,ft=Q.activeItem,wt=Q.focused,Qe=Q.tabIndex,Kt=Q.onKeyDown,Wt=Q.onFocus,Gt=Q.onBlur,Mt=Q.onActiveChange,pt=Q.onListChangeStart,ht=Q.onListChangeEnd,mt=(0,A.Z)(Q,z),Tt=I.useRef(null),Et=I.useRef(null);I.useImperativeHandle(ce,function(){return{scrollTo:function(Be){Tt.current.scrollTo(Be)},getIndentWidth:function(){return Et.current.offsetWidth}}});var kt=I.useState(B),Xt=(0,O.Z)(kt,2),an=Xt[0],Qt=Xt[1],cn=I.useState(M),Ht=(0,O.Z)(cn,2),Vt=Ht[0],_t=Ht[1],We=I.useState(M),c=(0,O.Z)(We,2),m=c[0],x=c[1],K=I.useState([]),ie=(0,O.Z)(K,2),be=ie[0],Ae=ie[1],nt=I.useState(null),qe=(0,O.Z)(nt,2),rt=qe[0],Ut=qe[1],jt=I.useRef(M);jt.current=M;function lt(){var Fe=jt.current;_t(Fe),x(Fe),Ae([]),Ut(null),ht()}(0,E.Z)(function(){Qt(B);var Fe=C(an,B);if(Fe.key!==null)if(Fe.add){var Be=Vt.findIndex(function(It){var xt=It.key;return xt===Fe.key}),ct=xe(R(Vt,M,Fe.key),Le,He,Ze),Lt=Vt.slice();Lt.splice(Be+1,0,me),x(Lt),Ae(ct),Ut("show")}else{var Ft=M.findIndex(function(It){var xt=It.key;return xt===Fe.key}),dn=xe(R(M,Vt,Fe.key),Le,He,Ze),pn=M.slice();pn.splice(Ft+1,0,me),x(pn),Ae(dn),Ut("hide")}else Vt!==M&&(_t(M),x(M))},[B,M]),I.useEffect(function(){Ce||lt()},[Ce]);var Zt=Oe?m:M,Ct={expandedKeys:B,selectedKeys:P,loadedKeys:N,loadingKeys:ae,checkedKeys:re,halfCheckedKeys:le,dragOverNodeKey:Ne,dropPosition:Ke,keyEntities:ge};return I.createElement(I.Fragment,null,wt&&ft&&I.createElement("span",{style:Z,"aria-live":"assertive"},Ie(ft)),I.createElement("div",null,I.createElement("input",{style:Z,disabled:ut===!1||Ee,tabIndex:ut!==!1?Qe:null,onKeyDown:Kt,onFocus:Wt,onBlur:Gt,value:"",onChange:v,"aria-label":"for screen reader"})),I.createElement("div",{className:"".concat(Y,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},I.createElement("div",{className:"".concat(Y,"-indent")},I.createElement("div",{ref:Et,className:"".concat(Y,"-indent-unit")}))),I.createElement(J.Z,(0,F.Z)({},mt,{data:Zt,itemKey:Re,height:He,fullHeight:!1,virtual:Le,itemHeight:Ze,prefixCls:"".concat(Y,"-list"),ref:Tt,onVisibleChange:function(Be,ct){var Lt=new Set(Be),Ft=ct.filter(function(dn){return!Lt.has(dn)});Ft.some(function(dn){return Re(dn)===y})&<()}}),function(Fe){var Be=Fe.pos,ct=(0,F.Z)({},(w(Fe.data),Fe.data)),Lt=Fe.title,Ft=Fe.key,dn=Fe.isStart,pn=Fe.isEnd,It=(0,we.km)(Ft,Be);delete ct.key,delete ct.children;var xt=(0,we.H8)(It,Ct);return I.createElement(T,(0,F.Z)({},ct,xt,{title:Lt,active:!!ft&&Ft===ft.key,pos:Be,data:Fe.data,isStart:dn,isEnd:pn,motion:Oe,motionNodes:Ft===y?be:null,motionType:rt,onMotionStart:pt,onMotionEnd:lt,treeNodeRequiredProps:Ct,onMouseMove:function(){Mt(null)}}))}))});et.displayName="NodeList";var ot=et,Ve=b(35654),Rt=b(90782),dt=b(67841),St=10,At=function(Q){(0,o.Z)(Y,Q);var ce=(0,G.Z)(Y);function Y(){var M;(0,W.Z)(this,Y);for(var pe=arguments.length,k=new Array(pe),B=0;B2&&arguments[2]!==void 0?arguments[2]:!1,le=M.state,ge=le.dragChildrenKeys,Ee=le.dropPosition,Ce=le.dropTargetKey,Ne=le.dropTargetPos,Ke=le.dropAllowed;if(Ke){var Oe=M.props.onDrop;if(M.setState({dragOverNodeKey:null}),M.cleanDragState(),Ce!==null){var He=(0,fe.Z)((0,fe.Z)({},(0,we.H8)(Ce,M.getTreeNodeRequiredProps())),{},{active:((N=M.getActiveItem())===null||N===void 0?void 0:N.key)===Ce,data:(0,dt.Z)(M.state.keyEntities,Ce).node}),Ze=ge.indexOf(Ce)!==-1;(0,p.ZP)(!Ze,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Le=(0,Ve.yx)(Ne),ut={event:P,node:(0,we.F)(He),dragNode:M.dragNode?(0,we.F)(M.dragNode.props):null,dragNodesKeys:[M.dragNode.props.eventKey].concat(ge),dropToGap:Ee!==0,dropPosition:Ee+Number(Le[Le.length-1])};ae||Oe==null||Oe(ut),M.dragNode=null}}},M.cleanDragState=function(){var P=M.state.draggingNodeKey;P!==null&&M.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),M.dragStartMousePosition=null,M.currentMouseOverDroppableNodeKey=null},M.triggerExpandActionExpand=function(P,re){var N=M.state,ae=N.expandedKeys,le=N.flattenNodes,ge=re.expanded,Ee=re.key,Ce=re.isLeaf;if(!(Ce||P.shiftKey||P.metaKey||P.ctrlKey)){var Ne=le.filter(function(Oe){return Oe.key===Ee})[0],Ke=(0,we.F)((0,fe.Z)((0,fe.Z)({},(0,we.H8)(Ee,M.getTreeNodeRequiredProps())),{},{data:Ne.data}));M.setExpandedKeys(ge?(0,Ve._5)(ae,Ee):(0,Ve.L0)(ae,Ee)),M.onNodeExpand(P,Ke)}},M.onNodeClick=function(P,re){var N=M.props,ae=N.onClick,le=N.expandAction;le==="click"&&M.triggerExpandActionExpand(P,re),ae==null||ae(P,re)},M.onNodeDoubleClick=function(P,re){var N=M.props,ae=N.onDoubleClick,le=N.expandAction;le==="doubleClick"&&M.triggerExpandActionExpand(P,re),ae==null||ae(P,re)},M.onNodeSelect=function(P,re){var N=M.state.selectedKeys,ae=M.state,le=ae.keyEntities,ge=ae.fieldNames,Ee=M.props,Ce=Ee.onSelect,Ne=Ee.multiple,Ke=re.selected,Oe=re[ge.key],He=!Ke;He?Ne?N=(0,Ve.L0)(N,Oe):N=[Oe]:N=(0,Ve._5)(N,Oe);var Ze=N.map(function(Le){var ut=(0,dt.Z)(le,Le);return ut?ut.node:null}).filter(function(Le){return Le});M.setUncontrolledState({selectedKeys:N}),Ce==null||Ce(N,{event:"select",selected:He,node:re,selectedNodes:Ze,nativeEvent:P.nativeEvent})},M.onNodeCheck=function(P,re,N){var ae=M.state,le=ae.keyEntities,ge=ae.checkedKeys,Ee=ae.halfCheckedKeys,Ce=M.props,Ne=Ce.checkStrictly,Ke=Ce.onCheck,Oe=re.key,He,Ze={event:"check",node:re,checked:N,nativeEvent:P.nativeEvent};if(Ne){var Le=N?(0,Ve.L0)(ge,Oe):(0,Ve._5)(ge,Oe),ut=(0,Ve._5)(Ee,Oe);He={checked:Le,halfChecked:ut},Ze.checkedNodes=Le.map(function(Gt){return(0,dt.Z)(le,Gt)}).filter(function(Gt){return Gt}).map(function(Gt){return Gt.node}),M.setUncontrolledState({checkedKeys:Le})}else{var ft=(0,Rt.S)([].concat((0,oe.Z)(ge),[Oe]),!0,le),wt=ft.checkedKeys,Qe=ft.halfCheckedKeys;if(!N){var Kt=new Set(wt);Kt.delete(Oe);var Wt=(0,Rt.S)(Array.from(Kt),{checked:!1,halfCheckedKeys:Qe},le);wt=Wt.checkedKeys,Qe=Wt.halfCheckedKeys}He=wt,Ze.checkedNodes=[],Ze.checkedNodesPositions=[],Ze.halfCheckedKeys=Qe,wt.forEach(function(Gt){var Mt=(0,dt.Z)(le,Gt);if(Mt){var pt=Mt.node,ht=Mt.pos;Ze.checkedNodes.push(pt),Ze.checkedNodesPositions.push({node:pt,pos:ht})}}),M.setUncontrolledState({checkedKeys:wt},!1,{halfCheckedKeys:Qe})}Ke==null||Ke(He,Ze)},M.onNodeLoad=function(P){var re=P.key,N=new Promise(function(ae,le){M.setState(function(ge){var Ee=ge.loadedKeys,Ce=Ee===void 0?[]:Ee,Ne=ge.loadingKeys,Ke=Ne===void 0?[]:Ne,Oe=M.props,He=Oe.loadData,Ze=Oe.onLoad;if(!He||Ce.indexOf(re)!==-1||Ke.indexOf(re)!==-1)return null;var Le=He(P);return Le.then(function(){var ut=M.state.loadedKeys,ft=(0,Ve.L0)(ut,re);Ze==null||Ze(ft,{event:"load",node:P}),M.setUncontrolledState({loadedKeys:ft}),M.setState(function(wt){return{loadingKeys:(0,Ve._5)(wt.loadingKeys,re)}}),ae()}).catch(function(ut){if(M.setState(function(wt){return{loadingKeys:(0,Ve._5)(wt.loadingKeys,re)}}),M.loadingRetryTimes[re]=(M.loadingRetryTimes[re]||0)+1,M.loadingRetryTimes[re]>=St){var ft=M.state.loadedKeys;(0,p.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),M.setUncontrolledState({loadedKeys:(0,Ve.L0)(ft,re)}),ae()}le(ut)}),{loadingKeys:(0,Ve.L0)(Ke,re)}})});return N.catch(function(){}),N},M.onNodeMouseEnter=function(P,re){var N=M.props.onMouseEnter;N==null||N({event:P,node:re})},M.onNodeMouseLeave=function(P,re){var N=M.props.onMouseLeave;N==null||N({event:P,node:re})},M.onNodeContextMenu=function(P,re){var N=M.props.onRightClick;N&&(P.preventDefault(),N({event:P,node:re}))},M.onFocus=function(){var P=M.props.onFocus;M.setState({focused:!0});for(var re=arguments.length,N=new Array(re),ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!M.destroyed){var ae=!1,le=!0,ge={};Object.keys(P).forEach(function(Ee){if(Ee in M.props){le=!1;return}ae=!0,ge[Ee]=P[Ee]}),ae&&(!re||le)&&M.setState((0,fe.Z)((0,fe.Z)({},ge),N))}},M.scrollTo=function(P){M.listRef.current.scrollTo(P)},M}return(0,_e.Z)(Y,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var pe=this.props.activeKey;pe!==void 0&&pe!==this.state.activeKey&&(this.setState({activeKey:pe}),pe!==null&&this.scrollTo({key:pe}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var pe,k=this.state,B=k.focused,P=k.flattenNodes,re=k.keyEntities,N=k.draggingNodeKey,ae=k.activeKey,le=k.dropLevelOffset,ge=k.dropContainerKey,Ee=k.dropTargetKey,Ce=k.dropPosition,Ne=k.dragOverNodeKey,Ke=k.indent,Oe=this.props,He=Oe.prefixCls,Ze=Oe.className,Le=Oe.style,ut=Oe.showLine,ft=Oe.focusable,wt=Oe.tabIndex,Qe=wt===void 0?0:wt,Kt=Oe.selectable,Wt=Oe.showIcon,Gt=Oe.icon,Mt=Oe.switcherIcon,pt=Oe.draggable,ht=Oe.checkable,mt=Oe.checkStrictly,Tt=Oe.disabled,Et=Oe.motion,kt=Oe.loadData,Xt=Oe.filterTreeNode,an=Oe.height,Qt=Oe.itemHeight,cn=Oe.virtual,Ht=Oe.titleRender,Vt=Oe.dropIndicatorRender,_t=Oe.onContextMenu,We=Oe.onScroll,c=Oe.direction,m=Oe.rootClassName,x=Oe.rootStyle,K=(0,g.Z)(this.props,{aria:!0,data:!0}),ie;return pt&&((0,ve.Z)(pt)==="object"?ie=pt:typeof pt=="function"?ie={nodeDraggable:pt}:ie={}),I.createElement(H.k.Provider,{value:{prefixCls:He,selectable:Kt,showIcon:Wt,icon:Gt,switcherIcon:Mt,draggable:ie,draggingNodeKey:N,checkable:ht,checkStrictly:mt,disabled:Tt,keyEntities:re,dropLevelOffset:le,dropContainerKey:ge,dropTargetKey:Ee,dropPosition:Ce,dragOverNodeKey:Ne,indent:Ke,direction:c,dropIndicatorRender:Vt,loadData:kt,filterTreeNode:Xt,titleRender:Ht,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},I.createElement("div",{role:"tree",className:f()(He,Ze,m,(pe={},(0,q.Z)(pe,"".concat(He,"-show-line"),ut),(0,q.Z)(pe,"".concat(He,"-focused"),B),(0,q.Z)(pe,"".concat(He,"-active-focused"),ae!==null),pe)),style:x},I.createElement(ot,(0,F.Z)({ref:this.listRef,prefixCls:He,style:Le,data:P,disabled:Tt,selectable:Kt,checkable:!!ht,motion:Et,dragging:N!==null,height:an,itemHeight:Qt,virtual:cn,focusable:ft,focused:B,tabIndex:Qe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:_t,onScroll:We},this.getTreeNodeRequiredProps(),K))))}}],[{key:"getDerivedStateFromProps",value:function(pe,k){var B=k.prevProps,P={prevProps:pe};function re(ft){return!B&&ft in pe||B&&B[ft]!==pe[ft]}var N,ae=k.fieldNames;if(re("fieldNames")&&(ae=(0,we.w$)(pe.fieldNames),P.fieldNames=ae),re("treeData")?N=pe.treeData:re("children")&&((0,p.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),N=(0,we.zn)(pe.children)),N){P.treeData=N;var le=(0,we.I8)(N,{fieldNames:ae});P.keyEntities=(0,fe.Z)((0,q.Z)({},y,j),le.keyEntities)}var ge=P.keyEntities||k.keyEntities;if(re("expandedKeys")||B&&re("autoExpandParent"))P.expandedKeys=pe.autoExpandParent||!B&&pe.defaultExpandParent?(0,Ve.r7)(pe.expandedKeys,ge):pe.expandedKeys;else if(!B&&pe.defaultExpandAll){var Ee=(0,fe.Z)({},ge);delete Ee[y],P.expandedKeys=Object.keys(Ee).map(function(ft){return Ee[ft].key})}else!B&&pe.defaultExpandedKeys&&(P.expandedKeys=pe.autoExpandParent||pe.defaultExpandParent?(0,Ve.r7)(pe.defaultExpandedKeys,ge):pe.defaultExpandedKeys);if(P.expandedKeys||delete P.expandedKeys,N||P.expandedKeys){var Ce=(0,we.oH)(N||k.treeData,P.expandedKeys||k.expandedKeys,ae);P.flattenNodes=Ce}if(pe.selectable&&(re("selectedKeys")?P.selectedKeys=(0,Ve.BT)(pe.selectedKeys,pe):!B&&pe.defaultSelectedKeys&&(P.selectedKeys=(0,Ve.BT)(pe.defaultSelectedKeys,pe))),pe.checkable){var Ne;if(re("checkedKeys")?Ne=(0,Ve.E6)(pe.checkedKeys)||{}:!B&&pe.defaultCheckedKeys?Ne=(0,Ve.E6)(pe.defaultCheckedKeys)||{}:N&&(Ne=(0,Ve.E6)(pe.checkedKeys)||{checkedKeys:k.checkedKeys,halfCheckedKeys:k.halfCheckedKeys}),Ne){var Ke=Ne,Oe=Ke.checkedKeys,He=Oe===void 0?[]:Oe,Ze=Ke.halfCheckedKeys,Le=Ze===void 0?[]:Ze;if(!pe.checkStrictly){var ut=(0,Rt.S)(He,!0,ge);He=ut.checkedKeys,Le=ut.halfCheckedKeys}P.checkedKeys=He,P.halfCheckedKeys=Le}}return re("loadedKeys")&&(P.loadedKeys=pe.loadedKeys),P}}]),Y}(I.Component);At.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:L,allowDrop:function(){return!0},expandAction:!1},At.TreeNode=ne.Z;var ke=At,Ye=ke},35654:function(yt,Pe,b){"use strict";b.d(Pe,{BT:function(){return I},E6:function(){return w},L0:function(){return G},OM:function(){return p},_5:function(){return o},r7:function(){return O},wA:function(){return f},yx:function(){return D}});var F=b(19127),q=b(20135),ve=b(48736),fe=b(59301),oe=b(39417),W=b(67841),_e=b(71430),ue=null;function o(A,E){if(!A)return[];var J=A.slice(),te=J.indexOf(E);return te>=0&&J.splice(te,1),J}function G(A,E){var J=(A||[]).slice();return J.indexOf(E)===-1&&J.push(E),J}function D(A){return A.split("-")}function f(A,E){var J=[],te=(0,W.Z)(E,A);function ne(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];ye.forEach(function(we){var Se=we.key,he=we.children;J.push(Se),ne(he)})}return ne(te.children),J}function u(A){if(A.parent){var E=D(A.pos);return Number(E[E.length-1])===A.parent.children.length-1}return!1}function g(A){var E=D(A.pos);return Number(E[E.length-1])===0}function p(A,E,J,te,ne,ye,we,Se,he,V){var T,C=A.clientX,R=A.clientY,z=A.target.getBoundingClientRect(),Z=z.top,v=z.height,y=(V==="rtl"?-1:1)*(((ne==null?void 0:ne.x)||0)-C),$=(y-12)/te,j=(0,W.Z)(Se,J.props.eventKey);if(R-1.5?ye({dragNode:St,dropNode:At,dropPosition:1})?Ve=1:ke=!1:ye({dragNode:St,dropNode:At,dropPosition:0})?Ve=0:ye({dragNode:St,dropNode:At,dropPosition:1})?Ve=1:ke=!1:ye({dragNode:St,dropNode:At,dropPosition:1})?Ve=1:ke=!1,{dropPosition:Ve,dropLevelOffset:Rt,dropTargetKey:j.key,dropTargetPos:j.pos,dragOverNodeKey:ot,dropContainerKey:Ve===0?null:((T=j.parent)===null||T===void 0?void 0:T.key)||null,dropAllowed:ke}}function I(A,E){if(A){var J=E.multiple;return J?A.slice():A.length?[A[0]]:A}}var H=function(E){return E};function L(A,E){if(!A)return[];var J=E||{},te=J.processProps,ne=te===void 0?H:te,ye=Array.isArray(A)?A:[A];return ye.map(function(we){var Se=we.children,he=_objectWithoutProperties(we,ue),V=L(Se,E);return React.createElement(TreeNode,_extends({key:he.key},ne(he)),V)})}function w(A){if(!A)return null;var E;if(Array.isArray(A))E={checkedKeys:A,halfCheckedKeys:void 0};else if((0,q.Z)(A)==="object")E={checkedKeys:A.checked||void 0,halfCheckedKeys:A.halfChecked||void 0};else return(0,ve.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return E}function O(A,E){var J=new Set;function te(ne){if(!J.has(ne)){var ye=(0,W.Z)(E,ne);if(ye){J.add(ne);var we=ye.parent,Se=ye.node;Se.disabled||we&&te(we.key)}}}return(A||[]).forEach(function(ne){te(ne)}),(0,F.Z)(J)}},90782:function(yt,Pe,b){"use strict";b.d(Pe,{S:function(){return _e}});var F=b(48736),q=b(67841);function ve(ue,o){var G=new Set;return ue.forEach(function(D){o.has(D)||G.add(D)}),G}function fe(ue){var o=ue||{},G=o.disabled,D=o.disableCheckbox,f=o.checkable;return!!(G||D)||f===!1}function oe(ue,o,G,D){for(var f=new Set(ue),u=new Set,g=0;g<=G;g+=1){var p=o.get(g)||new Set;p.forEach(function(w){var O=w.key,A=w.node,E=w.children,J=E===void 0?[]:E;f.has(O)&&!D(A)&&J.filter(function(te){return!D(te.node)}).forEach(function(te){f.add(te.key)})})}for(var I=new Set,H=G;H>=0;H-=1){var L=o.get(H)||new Set;L.forEach(function(w){var O=w.parent,A=w.node;if(!(D(A)||!w.parent||I.has(w.parent.key))){if(D(w.parent.node)){I.add(O.key);return}var E=!0,J=!1;(O.children||[]).filter(function(te){return!D(te.node)}).forEach(function(te){var ne=te.key,ye=f.has(ne);E&&!ye&&(E=!1),!J&&(ye||u.has(ne))&&(J=!0)}),E&&f.add(O.key),J&&u.add(O.key),I.add(O.key)}})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(ve(u,f))}}function W(ue,o,G,D,f){for(var u=new Set(ue),g=new Set(o),p=0;p<=D;p+=1){var I=G.get(p)||new Set;I.forEach(function(O){var A=O.key,E=O.node,J=O.children,te=J===void 0?[]:J;!u.has(A)&&!g.has(A)&&!f(E)&&te.filter(function(ne){return!f(ne.node)}).forEach(function(ne){u.delete(ne.key)})})}g=new Set;for(var H=new Set,L=D;L>=0;L-=1){var w=G.get(L)||new Set;w.forEach(function(O){var A=O.parent,E=O.node;if(!(f(E)||!O.parent||H.has(O.parent.key))){if(f(O.parent.node)){H.add(A.key);return}var J=!0,te=!1;(A.children||[]).filter(function(ne){return!f(ne.node)}).forEach(function(ne){var ye=ne.key,we=u.has(ye);J&&!we&&(J=!1),!te&&(we||g.has(ye))&&(te=!0)}),J||u.delete(A.key),te&&g.add(A.key),H.add(A.key)}})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(ve(g,u))}}function _e(ue,o,G,D){var f=[],u;D?u=D:u=fe;var g=new Set(ue.filter(function(L){var w=!!(0,q.Z)(G,L);return w||f.push(L),w})),p=new Map,I=0;Object.keys(G).forEach(function(L){var w=G[L],O=w.level,A=p.get(O);A||(A=new Set,p.set(O,A)),A.add(w),I=Math.max(I,O)}),(0,F.ZP)(!f.length,"Tree missing follow keys: ".concat(f.slice(0,100).map(function(L){return"'".concat(L,"'")}).join(", ")));var H;return o===!0?H=oe(g,p,I,u):H=W(g,o.halfCheckedKeys,p,I,u),H}},67841:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return F}});function F(q,ve){return q[ve]}},71430:function(yt,Pe,b){"use strict";b.d(Pe,{F:function(){return O},H8:function(){return w},I8:function(){return L},km:function(){return f},oH:function(){return I},w$:function(){return u},zn:function(){return p}});var F=b(20135),q=b(19127),ve=b(44127),fe=b(6620),oe=b(11592),W=b(2738),_e=b(48736),ue=b(67841),o=["children"];function G(A,E){return"".concat(A,"-").concat(E)}function D(A){return A&&A.type&&A.type.isTreeNode}function f(A,E){return A!=null?A:E}function u(A){var E=A||{},J=E.title,te=E._title,ne=E.key,ye=E.children,we=J||"title";return{title:we,_title:te||[we],key:ne||"key",children:ye||"children"}}function g(A,E){var J=new Map;function te(ne){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ne||[]).forEach(function(we){var Se=we[E.key],he=we[E.children];warning(Se!=null,"Tree node must have a certain key: [".concat(ye).concat(Se,"]"));var V=String(Se);warning(!J.has(V)||Se===null||Se===void 0,"Same 'key' exist in the Tree: ".concat(V)),J.set(V,!0),te(he,"".concat(ye).concat(V," > "))})}te(A)}function p(A){function E(J){var te=(0,oe.Z)(J);return te.map(function(ne){if(!D(ne))return(0,_e.ZP)(!ne,"Tree/TreeNode can only accept TreeNode as children."),null;var ye=ne.key,we=ne.props,Se=we.children,he=(0,fe.Z)(we,o),V=(0,ve.Z)({key:ye},he),T=E(Se);return T.length&&(V.children=T),V}).filter(function(ne){return ne})}return E(A)}function I(A,E,J){var te=u(J),ne=te._title,ye=te.key,we=te.children,Se=new Set(E===!0?[]:E),he=[];function V(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return T.map(function(R,z){for(var Z=G(C?C.pos:"0",z),v=f(R[ye],Z),y,$=0;$1&&arguments[1]!==void 0?arguments[1]:{},J=E.initWrapper,te=E.processEntity,ne=E.onProcessFinished,ye=E.externalGetKey,we=E.childrenPropName,Se=E.fieldNames,he=arguments.length>2?arguments[2]:void 0,V=ye||he,T={},C={},R={posEntities:T,keyEntities:C};return J&&(R=J(R)||R),H(A,function(z){var Z=z.node,v=z.index,y=z.pos,$=z.key,j=z.parentPos,me=z.level,xe=z.nodes,Re={node:Z,nodes:xe,index:v,key:$,pos:y,level:me},Ie=f($,y);T[y]=Re,C[Ie]=Re,Re.parent=T[j],Re.parent&&(Re.parent.children=Re.parent.children||[],Re.parent.children.push(Re)),te&&te(Re,R)},{externalGetKey:V,childrenPropName:we,fieldNames:Se}),ne&&ne(R),R}function w(A,E){var J=E.expandedKeys,te=E.selectedKeys,ne=E.loadedKeys,ye=E.loadingKeys,we=E.checkedKeys,Se=E.halfCheckedKeys,he=E.dragOverNodeKey,V=E.dropPosition,T=E.keyEntities,C=(0,ue.Z)(T,A),R={eventKey:A,expanded:J.indexOf(A)!==-1,selected:te.indexOf(A)!==-1,loaded:ne.indexOf(A)!==-1,loading:ye.indexOf(A)!==-1,checked:we.indexOf(A)!==-1,halfChecked:Se.indexOf(A)!==-1,pos:String(C?C.pos:""),dragOver:he===A&&V===0,dragOverGapTop:he===A&&V===-1,dragOverGapBottom:he===A&&V===1};return R}function O(A){var E=A.data,J=A.expanded,te=A.selected,ne=A.checked,ye=A.loaded,we=A.loading,Se=A.halfChecked,he=A.dragOver,V=A.dragOverGapTop,T=A.dragOverGapBottom,C=A.pos,R=A.active,z=A.eventKey,Z=(0,ve.Z)((0,ve.Z)({},E),{},{expanded:J,selected:te,checked:ne,loaded:ye,loading:we,halfChecked:Se,dragOver:he,dragOverGapTop:V,dragOverGapBottom:T,pos:C,active:R,key:z});return"props"in Z||Object.defineProperty(Z,"props",{get:function(){return(0,_e.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),A}}),Z}},49658:function(yt,Pe){"use strict";Pe.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=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(b)||/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(b==null?void 0:b.substr(0,4))}},24916:function(yt,Pe,b){"use strict";b.d(Pe,{Z:function(){return At}});var F=b(96663),q=b(20135),ve=b(44127),fe=b(90493),oe=b(72071),W=b(6620),_e=b(92310),ue=b.n(_e),o=b(29301),G=b(70425),D=b(34280),f=b(59301),u=b(4676),g=f.forwardRef(function(ke,Ye){var Q=ke.height,ce=ke.offsetY,Y=ke.offsetX,M=ke.children,pe=ke.prefixCls,k=ke.onInnerResize,B=ke.innerProps,P=ke.rtl,re=ke.extra,N={},ae={display:"flex",flexDirection:"column"};return ce!==void 0&&(N={height:Q,position:"relative",overflow:"hidden"},ae=(0,ve.Z)((0,ve.Z)({},ae),{},(0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)({transform:"translateY(".concat(ce,"px)")},P?"marginRight":"marginLeft",-Y),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:N},f.createElement(o.Z,{onResize:function(ge){var Ee=ge.offsetHeight;Ee&&k&&k()}},f.createElement("div",(0,F.Z)({style:ae,className:ue()((0,fe.Z)({},"".concat(pe,"-holder-inner"),pe)),ref:Ye},B),M,re)))});g.displayName="Filler";var p=g;function I(ke){var Ye=ke.children,Q=ke.setRef,ce=f.useCallback(function(Y){Q(Y)},[]);return f.cloneElement(Ye,{ref:ce})}function H(ke,Ye,Q,ce,Y,M,pe,k){var B=k.getKey;return ke.slice(Ye,Q+1).map(function(P,re){var N=Ye+re,ae=pe(P,N,{style:{width:ce},offsetX:Y}),le=B(P);return f.createElement(I,{key:le,setRef:function(Ee){return M(P,Ee)}},ae)})}function L(ke,Ye,Q,ce){var Y=Q-ke,M=Ye-Q,pe=Math.min(Y,M)*2;if(ce<=pe){var k=Math.floor(ce/2);return ce%2?Q+k+1:Q-k}return Y>M?Q-(ce-M):Q+(ce-Y)}function w(ke,Ye,Q){var ce=ke.length,Y=Ye.length,M,pe;if(ce===0&&Y===0)return null;ce2&&arguments[2]!==void 0?arguments[2]:!1,N=B?P<0&&k.current.left||P>0&&k.current.right:P<0&&k.current.top||P>0&&k.current.bottom;return re&&N?(clearTimeout(M.current),Y.current=!1):(!N||Y.current)&&pe(),!Y.current&&N}};function ne(ke,Ye,Q,ce,Y,M,pe){var k=(0,f.useRef)(0),B=(0,f.useRef)(null),P=(0,f.useRef)(null),re=(0,f.useRef)(!1),N=te(Ye,Q,ce,Y);function ae(Ke,Oe){if(A.Z.cancel(B.current),!N(!1,Oe)){var He=Ke;if(!He._virtualHandled)He._virtualHandled=!0;else return;k.current+=Oe,P.current=Oe,J||He.preventDefault(),B.current=(0,A.Z)(function(){var Ze=re.current?10:1;pe(k.current*Ze,!1),k.current=0})}}function le(Ke,Oe){pe(Oe,!0),J||Ke.preventDefault()}var ge=(0,f.useRef)(null),Ee=(0,f.useRef)(null);function Ce(Ke){if(ke){A.Z.cancel(Ee.current),Ee.current=(0,A.Z)(function(){ge.current=null},2);var Oe=Ke.deltaX,He=Ke.deltaY,Ze=Ke.shiftKey,Le=Oe,ut=He;(ge.current==="sx"||!ge.current&&Ze&&He&&!Oe)&&(Le=He,ut=0,ge.current="sx");var ft=Math.abs(Le),wt=Math.abs(ut);ge.current===null&&(ge.current=M&&ft>wt?"x":"y"),ge.current==="y"?ae(Ke,ut):le(Ke,Le)}}function Ne(Ke){ke&&(re.current=Ke.detail===P.current)}return[Ce,Ne]}function ye(ke,Ye,Q,ce){var Y=f.useMemo(function(){return[new Map,[]]},[ke,Q.id,ce]),M=(0,oe.Z)(Y,2),pe=M[0],k=M[1],B=function(re){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:re,ae=pe.get(re),le=pe.get(N);if(ae===void 0||le===void 0)for(var ge=ke.length,Ee=k.length;Ee0&&arguments[0]!==void 0?arguments[0]:!1;re();var ge=function(){var Ne=!1;k.current.forEach(function(Ke,Oe){if(Ke&&Ke.offsetParent){var He=Ke.offsetHeight,Ze=getComputedStyle(Ke),Le=Ze.marginTop,ut=Ze.marginBottom,ft=T(Le),wt=T(ut),Qe=He+ft+wt;B.current.get(Oe)!==Qe&&(B.current.set(Oe,Qe),Ne=!0)}}),Ne&&pe(function(Ke){return Ke+1})};if(le)ge();else{P.current+=1;var Ee=P.current;Promise.resolve().then(function(){Ee===P.current&&ge()})}}function ae(le,ge){var Ee=ke(le),Ce=k.current.get(Ee);ge?(k.current.set(Ee,ge),N()):k.current.delete(Ee),!Ce!=!ge&&(ge?Ye==null||Ye(le):Q==null||Q(le))}return(0,f.useEffect)(function(){return re},[]),[ae,N,B.current,M]}var R=14/15;function z(ke,Ye,Q){var ce=(0,f.useRef)(!1),Y=(0,f.useRef)(0),M=(0,f.useRef)(0),pe=(0,f.useRef)(null),k=(0,f.useRef)(null),B,P=function(le){if(ce.current){var ge=Math.ceil(le.touches[0].pageX),Ee=Math.ceil(le.touches[0].pageY),Ce=Y.current-ge,Ne=M.current-Ee,Ke=Math.abs(Ce)>Math.abs(Ne);Ke?Y.current=ge:M.current=Ee;var Oe=Q(Ke,Ke?Ce:Ne,!1,le);Oe&&le.preventDefault(),clearInterval(k.current),Oe&&(k.current=setInterval(function(){Ke?Ce*=R:Ne*=R;var He=Math.floor(Ke?Ce:Ne);(!Q(Ke,He,!0)||Math.abs(He)<=.1)&&clearInterval(k.current)},16))}},re=function(){ce.current=!1,B()},N=function(le){B(),le.touches.length===1&&!ce.current&&(ce.current=!0,Y.current=Math.ceil(le.touches[0].pageX),M.current=Math.ceil(le.touches[0].pageY),pe.current=le.target,pe.current.addEventListener("touchmove",P,{passive:!1}),pe.current.addEventListener("touchend",re,{passive:!0}))};B=function(){pe.current&&(pe.current.removeEventListener("touchmove",P),pe.current.removeEventListener("touchend",re))},(0,D.Z)(function(){return ke&&Ye.current.addEventListener("touchstart",N,{passive:!0}),function(){var ae;(ae=Ye.current)===null||ae===void 0||ae.removeEventListener("touchstart",N),B(),clearInterval(k.current)}},[ke])}function Z(ke){return Math.floor(Math.pow(ke,.5))}function v(ke,Ye){var Q="touches"in ke?ke.touches[0]:ke;return Q[Ye?"pageX":"pageY"]-window[Ye?"scrollX":"scrollY"]}function y(ke,Ye,Q){f.useEffect(function(){var ce=Ye.current;if(ke&&ce){var Y=!1,M,pe,k=function(){A.Z.cancel(M)},B=function ae(){k(),M=(0,A.Z)(function(){Q(pe),ae()})},P=function(le){if(!le.target.draggable){var ge=le;ge._virtualHandled||(ge._virtualHandled=!0,Y=!0)}},re=function(){Y=!1,k()},N=function(le){if(Y){var ge=v(le,!1),Ee=ce.getBoundingClientRect(),Ce=Ee.top,Ne=Ee.bottom;if(ge<=Ce){var Ke=Ce-ge;pe=-Z(Ke),B()}else if(ge>=Ne){var Oe=ge-Ne;pe=Z(Oe),B()}else k()}};return ce.addEventListener("mousedown",P),ce.ownerDocument.addEventListener("mouseup",re),ce.ownerDocument.addEventListener("mousemove",N),function(){ce.removeEventListener("mousedown",P),ce.ownerDocument.removeEventListener("mouseup",re),ce.ownerDocument.removeEventListener("mousemove",N),k()}}},[ke])}var $=10;function j(ke,Ye,Q,ce,Y,M,pe,k){var B=f.useRef(),P=f.useState(null),re=(0,oe.Z)(P,2),N=re[0],ae=re[1];return(0,D.Z)(function(){if(N&&N.times<$){if(!ke.current){ae(function(Et){return(0,ve.Z)({},Et)});return}M();var le=N.targetAlign,ge=N.originAlign,Ee=N.index,Ce=N.offset,Ne=ke.current.clientHeight,Ke=!1,Oe=le,He=null;if(Ne){for(var Ze=le||ge,Le=0,ut=0,ft=0,wt=Math.min(Ye.length-1,Ee),Qe=0;Qe<=wt;Qe+=1){var Kt=Y(Ye[Qe]);ut=Le;var Wt=Q.get(Kt);ft=ut+(Wt===void 0?ce:Wt),Le=ft}for(var Gt=Ze==="top"?Ce:Ne-Ce,Mt=wt;Mt>=0;Mt-=1){var pt=Y(Ye[Mt]),ht=Q.get(pt);if(ht===void 0){Ke=!0;break}if(Gt-=ht,Gt<=0)break}switch(Ze){case"top":He=ut-Ce;break;case"bottom":He=ft-Ne+Ce;break;default:{var mt=ke.current.scrollTop,Tt=mt+Ne;utTt&&(Oe="bottom")}}He!==null&&pe(He),He!==N.lastTop&&(Ke=!0)}Ke&&ae((0,ve.Z)((0,ve.Z)({},N),{},{times:N.times+1,targetAlign:Oe,lastTop:He}))}},[N,ke.current]),function(le){if(le==null){k();return}if(A.Z.cancel(B.current),typeof le=="number")pe(le);else if(le&&(0,q.Z)(le)==="object"){var ge,Ee=le.align;"index"in le?ge=le.index:ge=Ye.findIndex(function(Ke){return Y(Ke)===le.key});var Ce=le.offset,Ne=Ce===void 0?0:Ce;ae({times:0,index:ge,offset:Ne,originAlign:Ee})}}}var me=f.forwardRef(function(ke,Ye){var Q=ke.prefixCls,ce=ke.rtl,Y=ke.scrollOffset,M=ke.scrollRange,pe=ke.onStartMove,k=ke.onStopMove,B=ke.onScroll,P=ke.horizontal,re=ke.spinSize,N=ke.containerSize,ae=ke.style,le=ke.thumbStyle,ge=ke.showScrollBar,Ee=f.useState(!1),Ce=(0,oe.Z)(Ee,2),Ne=Ce[0],Ke=Ce[1],Oe=f.useState(null),He=(0,oe.Z)(Oe,2),Ze=He[0],Le=He[1],ut=f.useState(null),ft=(0,oe.Z)(ut,2),wt=ft[0],Qe=ft[1],Kt=!ce,Wt=f.useRef(),Gt=f.useRef(),Mt=f.useState(ge),pt=(0,oe.Z)(Mt,2),ht=pt[0],mt=pt[1],Tt=f.useRef(),Et=function(){ge===!0||ge===!1||(clearTimeout(Tt.current),mt(!0),Tt.current=setTimeout(function(){mt(!1)},3e3))},kt=M-N||0,Xt=N-re||0,an=f.useMemo(function(){if(Y===0||kt===0)return 0;var x=Y/kt;return x*Xt},[Y,kt,Xt]),Qt=function(K){K.stopPropagation(),K.preventDefault()},cn=f.useRef({top:an,dragging:Ne,pageY:Ze,startTop:wt});cn.current={top:an,dragging:Ne,pageY:Ze,startTop:wt};var Ht=function(K){Ke(!0),Le(v(K,P)),Qe(cn.current.top),pe(),K.stopPropagation(),K.preventDefault()};f.useEffect(function(){var x=function(Ae){Ae.preventDefault()},K=Wt.current,ie=Gt.current;return K.addEventListener("touchstart",x,{passive:!1}),ie.addEventListener("touchstart",Ht,{passive:!1}),function(){K.removeEventListener("touchstart",x),ie.removeEventListener("touchstart",Ht)}},[]);var Vt=f.useRef();Vt.current=kt;var _t=f.useRef();_t.current=Xt,f.useEffect(function(){if(Ne){var x,K=function(Ae){var nt=cn.current,qe=nt.dragging,rt=nt.pageY,Ut=nt.startTop;A.Z.cancel(x);var jt=Wt.current.getBoundingClientRect(),lt=N/(P?jt.width:jt.height);if(qe){var Zt=(v(Ae,P)-rt)*lt,Ct=Ut;!Kt&&P?Ct-=Zt:Ct+=Zt;var Fe=Vt.current,Be=_t.current,ct=Be?Ct/Be:0,Lt=Math.ceil(ct*Fe);Lt=Math.max(Lt,0),Lt=Math.min(Lt,Fe),x=(0,A.Z)(function(){B(Lt,P)})}},ie=function(){Ke(!1),k()};return window.addEventListener("mousemove",K,{passive:!0}),window.addEventListener("touchmove",K,{passive:!0}),window.addEventListener("mouseup",ie,{passive:!0}),window.addEventListener("touchend",ie,{passive:!0}),function(){window.removeEventListener("mousemove",K),window.removeEventListener("touchmove",K),window.removeEventListener("mouseup",ie),window.removeEventListener("touchend",ie),A.Z.cancel(x)}}},[Ne]),f.useEffect(function(){return Et(),function(){clearTimeout(Tt.current)}},[Y]),f.useImperativeHandle(Ye,function(){return{delayHidden:Et}});var We="".concat(Q,"-scrollbar"),c={position:"absolute",visibility:ht?null:"hidden"},m={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return P?(c.height=8,c.left=0,c.right=0,c.bottom=0,m.height="100%",m.width=re,Kt?m.left=an:m.right=an):(c.width=8,c.top=0,c.bottom=0,Kt?c.right=0:c.left=0,m.width="100%",m.height=re,m.top=an),f.createElement("div",{ref:Wt,className:ue()(We,(0,fe.Z)((0,fe.Z)((0,fe.Z)({},"".concat(We,"-horizontal"),P),"".concat(We,"-vertical"),!P),"".concat(We,"-visible"),ht)),style:(0,ve.Z)((0,ve.Z)({},c),ae),onMouseDown:Qt,onMouseMove:Et},f.createElement("div",{ref:Gt,className:ue()("".concat(We,"-thumb"),(0,fe.Z)({},"".concat(We,"-thumb-moving"),Ne)),style:(0,ve.Z)((0,ve.Z)({},m),le),onMouseDown:Ht}))}),xe=me,Re=20;function Ie(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Q=ke/Ye*ke;return isNaN(Q)&&(Q=0),Q=Math.max(Q,Re),Math.floor(Q)}var et=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ot=[],Ve={overflowY:"auto",overflowAnchor:"none"};function Rt(ke,Ye){var Q=ke.prefixCls,ce=Q===void 0?"rc-virtual-list":Q,Y=ke.className,M=ke.height,pe=ke.itemHeight,k=ke.fullHeight,B=k===void 0?!0:k,P=ke.style,re=ke.data,N=ke.children,ae=ke.itemKey,le=ke.virtual,ge=ke.direction,Ee=ke.scrollWidth,Ce=ke.component,Ne=Ce===void 0?"div":Ce,Ke=ke.onScroll,Oe=ke.onVirtualScroll,He=ke.onVisibleChange,Ze=ke.innerProps,Le=ke.extraRender,ut=ke.styles,ft=ke.showScrollBar,wt=ft===void 0?"optional":ft,Qe=(0,W.Z)(ke,et),Kt=f.useCallback(function(qt){return typeof ae=="function"?ae(qt):qt==null?void 0:qt[ae]},[ae]),Wt=C(Kt,null,null),Gt=(0,oe.Z)(Wt,4),Mt=Gt[0],pt=Gt[1],ht=Gt[2],mt=Gt[3],Tt=!!(le!==!1&&M&&pe),Et=f.useMemo(function(){return Object.values(ht.maps).reduce(function(qt,Ot){return qt+Ot},0)},[ht.id,ht.maps]),kt=Tt&&re&&(Math.max(pe*re.length,Et)>M||!!Ee),Xt=ge==="rtl",an=ue()(ce,(0,fe.Z)({},"".concat(ce,"-rtl"),Xt),Y),Qt=re||ot,cn=(0,f.useRef)(),Ht=(0,f.useRef)(),Vt=(0,f.useRef)(),_t=(0,f.useState)(0),We=(0,oe.Z)(_t,2),c=We[0],m=We[1],x=(0,f.useState)(0),K=(0,oe.Z)(x,2),ie=K[0],be=K[1],Ae=(0,f.useState)(!1),nt=(0,oe.Z)(Ae,2),qe=nt[0],rt=nt[1],Ut=function(){rt(!0)},jt=function(){rt(!1)},lt={getKey:Kt};function Zt(qt){m(function(Ot){var on;typeof qt=="function"?on=qt(Ot):on=qt;var Cn=un(on);return cn.current.scrollTop=Cn,Cn})}var Ct=(0,f.useRef)({start:0,end:Qt.length}),Fe=(0,f.useRef)(),Be=O(Qt,Kt),ct=(0,oe.Z)(Be,1),Lt=ct[0];Fe.current=Lt;var Ft=f.useMemo(function(){if(!Tt)return{scrollHeight:void 0,start:0,end:Qt.length-1,offset:void 0};if(!kt){var qt;return{scrollHeight:((qt=Ht.current)===null||qt===void 0?void 0:qt.offsetHeight)||0,start:0,end:Qt.length-1,offset:void 0}}for(var Ot=0,on,Cn,On,oi=Qt.length,Gn=0;Gn=c&&on===void 0&&(on=Gn,Cn=Ot),fi>c+M&&On===void 0&&(On=Gn),Ot=fi}return on===void 0&&(on=0,Cn=0,On=Math.ceil(M/pe)),On===void 0&&(On=Qt.length-1),On=Math.min(On+1,Qt.length-1),{scrollHeight:Ot,start:on,end:On,offset:Cn}},[kt,Tt,c,Qt,mt,M]),dn=Ft.scrollHeight,pn=Ft.start,It=Ft.end,xt=Ft.offset;Ct.current.start=pn,Ct.current.end=It,f.useLayoutEffect(function(){var qt=ht.getRecord();if(qt.size===1){var Ot=Array.from(qt)[0],on=Qt[pn];if(on){var Cn=Kt(on);if(Cn===Ot){var On=ht.get(Ot),oi=On-pe;Zt(function(Gn){return Gn+oi})}}}ht.resetRecord()},[dn]);var De=f.useState({width:0,height:M}),Me=(0,oe.Z)(De,2),Ge=Me[0],st=Me[1],Xe=function(Ot){st({width:Ot.offsetWidth,height:Ot.offsetHeight})},tt=(0,f.useRef)(),Je=(0,f.useRef)(),Dt=f.useMemo(function(){return Ie(Ge.width,Ee)},[Ge.width,Ee]),zt=f.useMemo(function(){return Ie(Ge.height,dn)},[Ge.height,dn]),Bt=dn-M,rn=(0,f.useRef)(Bt);rn.current=Bt;function un(qt){var Ot=qt;return Number.isNaN(rn.current)||(Ot=Math.min(Ot,rn.current)),Ot=Math.max(Ot,0),Ot}var gn=c<=0,hn=c>=Bt,Jt=ie<=0,An=ie>=Ee,_n=te(gn,hn,Jt,An),In=function(){return{x:Xt?-ie:ie,y:c}},wn=(0,f.useRef)(In()),yn=(0,G.useEvent)(function(qt){if(Oe){var Ot=(0,ve.Z)((0,ve.Z)({},In()),qt);(wn.current.x!==Ot.x||wn.current.y!==Ot.y)&&(Oe(Ot),wn.current=Ot)}});function En(qt,Ot){var on=qt;Ot?((0,u.flushSync)(function(){be(on)}),yn()):Zt(on)}function xn(qt){var Ot=qt.currentTarget.scrollTop;Ot!==c&&Zt(Ot),Ke==null||Ke(qt),yn()}var Tn=function(Ot){var on=Ot,Cn=Ee?Ee-Ge.width:0;return on=Math.max(on,0),on=Math.min(on,Cn),on},zn=(0,G.useEvent)(function(qt,Ot){Ot?((0,u.flushSync)(function(){be(function(on){var Cn=on+(Xt?-qt:qt);return Tn(Cn)})}),yn()):Zt(function(on){var Cn=on+qt;return Cn})}),Ln=ne(Tt,gn,hn,Jt,An,!!Ee,zn),fn=(0,oe.Z)(Ln,2),$t=fn[0],Kn=fn[1];z(Tt,cn,function(qt,Ot,on,Cn){var On=Cn;return _n(qt,Ot,on)?!1:!On||!On._virtualHandled?(On&&(On._virtualHandled=!0),$t({preventDefault:function(){},deltaX:qt?Ot:0,deltaY:qt?0:Ot}),!0):!1}),y(kt,cn,function(qt){Zt(function(Ot){return Ot+qt})}),(0,D.Z)(function(){function qt(on){var Cn=gn&&on.detail<0,On=hn&&on.detail>0;Tt&&!Cn&&!On&&on.preventDefault()}var Ot=cn.current;return Ot.addEventListener("wheel",$t,{passive:!1}),Ot.addEventListener("DOMMouseScroll",Kn,{passive:!0}),Ot.addEventListener("MozMousePixelScroll",qt,{passive:!1}),function(){Ot.removeEventListener("wheel",$t),Ot.removeEventListener("DOMMouseScroll",Kn),Ot.removeEventListener("MozMousePixelScroll",qt)}},[Tt,gn,hn]),(0,D.Z)(function(){if(Ee){var qt=Tn(ie);be(qt),yn({x:qt})}},[Ge.width,Ee]);var Pn=function(){var Ot,on;(Ot=tt.current)===null||Ot===void 0||Ot.delayHidden(),(on=Je.current)===null||on===void 0||on.delayHidden()},Un=j(cn,Qt,ht,pe,Kt,function(){return pt(!0)},Zt,Pn);f.useImperativeHandle(Ye,function(){return{nativeElement:Vt.current,getScrollInfo:In,scrollTo:function(Ot){function on(Cn){return Cn&&(0,q.Z)(Cn)==="object"&&("left"in Cn||"top"in Cn)}on(Ot)?(Ot.left!==void 0&&be(Tn(Ot.left)),Un(Ot.top)):Un(Ot)}}}),(0,D.Z)(function(){if(He){var qt=Qt.slice(pn,It+1);He(qt,Qt)}},[pn,It,Qt]);var Xn=ye(Qt,Kt,ht,pe),ti=Le==null?void 0:Le({start:pn,end:It,virtual:kt,offsetX:ie,offsetY:xt,rtl:Xt,getSize:Xn}),Qn=H(Qt,pn,It,Ee,ie,Mt,N,lt),Nn=null;M&&(Nn=(0,ve.Z)((0,fe.Z)({},B?"height":"maxHeight",M),Ve),Tt&&(Nn.overflowY="hidden",Ee&&(Nn.overflowX="hidden"),qe&&(Nn.pointerEvents="none")));var Jn={};return Xt&&(Jn.dir="rtl"),f.createElement("div",(0,F.Z)({ref:Vt,style:(0,ve.Z)((0,ve.Z)({},P),{},{position:"relative"}),className:an},Jn,Qe),f.createElement(o.Z,{onResize:Xe},f.createElement(Ne,{className:"".concat(ce,"-holder"),style:Nn,ref:cn,onScroll:xn,onMouseEnter:Pn},f.createElement(p,{prefixCls:ce,height:dn,offsetX:ie,offsetY:xt,scrollWidth:Ee,onInnerResize:pt,ref:Ht,innerProps:Ze,rtl:Xt,extra:ti},Qn))),kt&&dn>M&&f.createElement(xe,{ref:tt,prefixCls:ce,scrollOffset:c,scrollRange:dn,rtl:Xt,onScroll:En,onStartMove:Ut,onStopMove:jt,spinSize:zt,containerSize:Ge.height,style:ut==null?void 0:ut.verticalScrollBar,thumbStyle:ut==null?void 0:ut.verticalScrollBarThumb,showScrollBar:wt}),kt&&Ee>Ge.width&&f.createElement(xe,{ref:Je,prefixCls:ce,scrollOffset:ie,scrollRange:Ee,rtl:Xt,onScroll:En,onStartMove:Ut,onStopMove:jt,spinSize:Dt,containerSize:Ge.width,horizontal:!0,style:ut==null?void 0:ut.horizontalScrollBar,thumbStyle:ut==null?void 0:ut.horizontalScrollBarThumb,showScrollBar:wt}))}var dt=f.forwardRef(Rt);dt.displayName="List";var St=dt,At=St},83145:function(yt,Pe,b){"use strict";Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.CopyToClipboard=void 0;var F=ve(b(59301)),q=ve(b(25769));function ve(w){return w&&w.__esModule?w:{default:w}}function fe(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(A){return typeof A}:fe=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fe(w)}function oe(w,O){var A=Object.keys(w);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(w);O&&(E=E.filter(function(J){return Object.getOwnPropertyDescriptor(w,J).enumerable})),A.push.apply(A,E)}return A}function W(w){for(var O=1;O=0)&&Object.prototype.propertyIsEnumerable.call(w,E)&&(A[E]=w[E])}return A}function ue(w,O){if(w==null)return{};var A={},E=Object.keys(w),J,te;for(te=0;te=0)&&(A[J]=w[J]);return A}function o(w,O){if(!(w instanceof O))throw new TypeError("Cannot call a class as a function")}function G(w,O){for(var A=0;A0},V.prototype.connect_=function(){!q||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(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)},V.prototype.disconnect_=function(){!q||!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)},V.prototype.onTransitionEnd_=function(T){var C=T.propertyName,R=C===void 0?"":C,z=ue.some(function(Z){return!!~R.indexOf(Z)});z&&this.refresh()},V.getInstance=function(){return this.instance_||(this.instance_=new V),this.instance_},V.instance_=null,V}(),D=function(V,T){for(var C=0,R=Object.keys(T);C0},V}(),we=typeof WeakMap!="undefined"?new WeakMap:new F,Se=function(){function V(T){if(!(this instanceof V))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var C=G.getInstance(),R=new ye(T,C,this);we.set(this,R)}return V}();["observe","unobserve","disconnect"].forEach(function(V){Se.prototype[V]=function(){var T;return(T=we.get(this))[V].apply(T,arguments)}});var he=function(){return typeof ve.ResizeObserver!="undefined"?ve.ResizeObserver:Se}();Pe.Z=he},98040:function(yt){yt.exports=function(){var Pe=document.getSelection();if(!Pe.rangeCount)return function(){};for(var b=document.activeElement,F=[],q=0;q`):I}function O(a,...e){e.forEach(function(t){L[t]=a[t]?a[t].bind(a):w(t)})}function A(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){O(a,"debug","log","info","warn","error");try{L.log(`Debug logs enabled for "${e}" in hls.js version 1.5.20`)}catch(t){L=H}}else L=H}const E=L,J=/^(\d+)x(\d+)$/,te=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ne{constructor(e){typeof e=="string"&&(e=ne.parseAttrList(e)),o(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;iNumber.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]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=J.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(te.lastIndex=0;(t=te.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const s=t[1].trim();n[s]=r}return n}}function ye(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function we(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Se{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){E.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=o(new ne({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=new Date(this.attr["END-DATE"]);G(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(G(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 isValid(){return!!this.id&&!this._badValueForSameId&&G(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class he{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 V={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class T{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[V.AUDIO]:null,[V.VIDEO]:null,[V.AUDIOVIDEO]:null},this.baseurl=e}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 byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ve.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class C extends T{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=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.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new he,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 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||!G(this.programDateTime))return null;const e=G(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}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:l}=this,d=l[e];if(!d){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}d.startPTS=Math.min(d.startPTS,t),d.endPTS=Math.max(d.endPTS,n),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[V.AUDIO]=null,e[V.VIDEO]=null,e[V.AUDIOVIDEO]=null}}class R extends T{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.stats=new he,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)}}const z=10;class Z{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.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 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.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,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?G(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||z}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 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 lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function v(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function y(a){const e=me(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function $(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 j(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=v(s)):t=y(s)}}return t}function me(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const xe=typeof self!="undefined"?self:void 0;var Re={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Ie={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function et(a){switch(a){case Ie.FAIRPLAY:return Re.FAIRPLAY;case Ie.PLAYREADY:return Re.PLAYREADY;case Ie.WIDEVINE:return Re.WIDEVINE;case Ie.CLEARKEY:return Re.CLEARKEY}}var ot={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Ve(a){if(a===ot.WIDEVINE)return Re.WIDEVINE;if(a===ot.PLAYREADY)return Re.PLAYREADY;if(a===ot.CENC||a===ot.CLEARKEY)return Re.CLEARKEY}function Rt(a){switch(a){case Re.FAIRPLAY:return Ie.FAIRPLAY;case Re.PLAYREADY:return Ie.PLAYREADY;case Re.WIDEVINE:return Ie.WIDEVINE;case Re.CLEARKEY:return Ie.CLEARKEY}}function dt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Re.FAIRPLAY,Re.WIDEVINE,Re.PLAYREADY,Re.CLEARKEY].filter(i=>!!e[i]):[];return!n[Re.WIDEVINE]&&t&&n.push(Re.WIDEVINE),n}const St=function(a){return xe!=null&&(a=xe.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function At(a,e,t,n){let i;switch(a){case Re.FAIRPLAY:i=["cenc","sinf"];break;case Re.WIDEVINE:case Re.PLAYREADY:i=["cenc"];break;case Re.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return ke(i,e,t,n)}function ke(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 Ye(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 l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const d=v(l).subarray(0,16);return $(d),d}}return null}function Q(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const ce=(a,e)=>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,Y=(a,e)=>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,M=(a,e)=>{const t=e;let n=0;for(;ce(a,e);){n+=10;const i=pe(a,e+6);n+=i,Y(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)},pe=(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},k=(a,e)=>ce(a,e)&&pe(a,e+6)+10<=a.length-e,B=a=>{const e=N(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",re=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=pe(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}},N=a=>{let e=0;const t=[];for(;ce(a,e);){const n=pe(a,e+6);e+=10;const i=e+n;for(;e+8a.type==="PRIV"?le(a):a.type[0]==="W"?Ee(a):ge(a),le=a=>{if(a.size<2)return;const e=Ne(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},ge=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Ne(a.data.subarray(t),!0);t+=n.length+1;const i=Ne(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ne(a.data.subarray(1));return{key:a.type,data:e}},Ee=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Ne(a.data.subarray(t),!0);t+=n.length+1;const i=Ne(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ne(a.data);return{key:a.type,data:e}},Ce=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)}},Ne=(a,e=!1)=>{const t=Oe();if(t){const h=t.decode(a);if(e){const _=h.indexOf("\0");return _!==-1?h.substring(0,_):h}return h.replace(/\0/g,"")}const n=a.length;let i,r,s,l="",d=0;for(;d>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:r=a[d++],l+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[d++],s=a[d++],l+=String.fromCharCode((i&15)<<12|(r&63)<<6|(s&63)<<0);break}}return l};let Ke;function Oe(){if(!navigator.userAgent.includes("PlayStation 4"))return!Ke&&typeof self.TextDecoder!="undefined"&&(Ke=new self.TextDecoder("utf-8")),Ke}const He={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Mt(a){const e=a.byteLength;for(let t=0;t8&&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 pt(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,l));else{const d=pt(a.subarray(i+8,l),e.slice(1));d.length&&Le.apply(t,d)}i=l}return t}function ht(a){const e=[],t=a[0];let n=8;const i=Qe(a,n);n+=4;let r=0,s=0;t===0?(r=Qe(a,n),s=Qe(a,n+4),n+=8):(r=Kt(a,n),s=Kt(a,n+8),n+=16),n+=2;let l=a.length+s;const d=wt(a,n);n+=2;for(let h=0;h>>31===1)return E.warn("SIDX has hierarchical references (not supported)"),null;const X=Qe(a,_);_+=4,e.push({referenceSize:U,subsegmentDuration:X,info:{duration:X/i,start:l,end:l+U-1}}),l+=U,_+=4,n=_}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:d,references:e}}function mt(a){const e=[],t=pt(a,["moov","trak"]);for(let i=0;i{const r=Qe(i,4),s=e[r];s&&(s.default={duration:Qe(i,12),flags:Qe(i,20)})}),e}function Tt(a){const e=a.subarray(8),t=e.subarray(86),n=ft(e.subarray(4,8));let i=n;const r=n==="enca"||n==="encv";if(r){const l=pt(e,[n])[0].subarray(n==="enca"?28:78);pt(l,["sinf"]).forEach(h=>{const _=pt(h,["schm"])[0];if(_){const S=ft(_.subarray(4,8));if(S==="cbcs"||S==="cenc"){const U=pt(h,["frma"])[0];U&&(i=ft(U))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const s=pt(t,["avcC"])[0];i+="."+kt(s[1])+kt(s[2])+kt(s[3]);break}case"mp4a":{const s=pt(e,[n])[0],l=pt(s.subarray(28),["esds"])[0];if(l&&l.length>12){let d=4;if(l[d++]!==3)break;d=Et(l,d),d+=2;const h=l[d++];if(h&128&&(d+=2),h&64&&(d+=l[d++]),l[d++]!==4)break;d=Et(l,d);const _=l[d++];if(_===64)i+="."+kt(_);else break;if(d+=12,l[d++]!==5)break;d=Et(l,d);const S=l[d++];let U=(S&248)>>3;U===31&&(U+=1+((S&7)<<3)+((l[d]&224)>>5)),i+="."+U}break}case"hvc1":case"hev1":{const s=pt(t,["hvcC"])[0],l=s[1],d=["","A","B","C"][l>>6],h=l&31,_=Qe(s,2),S=(l&32)>>5?"H":"L",U=s[12],ee=s.subarray(6,12);i+="."+d+h,i+="."+_.toString(16).toUpperCase(),i+="."+S+U;let X="";for(let se=ee.length;se--;){const de=ee[se];(de||X)&&(X="."+de.toString(16).toUpperCase()+X)}i+=X;break}case"dvh1":case"dvhe":{const s=pt(t,["dvcC"])[0],l=s[2]>>1&127,d=s[2]<<5&32|s[3]>>3&31;i+="."+Xt(l)+"."+Xt(d);break}case"vp09":{const s=pt(t,["vpcC"])[0],l=s[4],d=s[5],h=s[6]>>4&15;i+="."+Xt(l)+"."+Xt(d)+"."+Xt(h);break}case"av01":{const s=pt(t,["av1C"])[0],l=s[1]>>>5,d=s[1]&31,h=s[2]>>>7?"H":"M",_=(s[2]&64)>>6,S=(s[2]&32)>>5,U=l===2&&_?S?12:10:_?10:8,ee=(s[2]&16)>>4,X=(s[2]&8)>>3,se=(s[2]&4)>>2,de=s[2]&3;i+="."+l+"."+Xt(d)+h+"."+Xt(U)+"."+ee+"."+X+se+de+"."+Xt(1)+"."+Xt(1)+"."+Xt(1)+"."+0;break}}return{codec:i,encrypted:r}}function Et(a,e){const t=e+5;for(;a[e++]&128&&e{const s=pt(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=pt(s,["enca"]);const d=l.length>0;d||(l=pt(s,["encv"])),l.forEach(h=>{const _=d?h.subarray(28):h.subarray(78);pt(_,["sinf"]).forEach(U=>{const ee=Qt(U);if(ee){const X=ee.subarray(8,24);X.some(se=>se!==0)||(E.log(`[eme] Patching keyId in 'enc${d?"a":"v"}>sinf>>tenc' box: ${He.hexDump(X)} -> ${He.hexDump(t)}`),ee.set(t,8))}})})}),a}function Qt(a){const e=pt(a,["schm"])[0];if(e){const t=ft(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return pt(a,["schi","tenc"])[0]}return null}function cn(a,e){return pt(e,["moof","traf"]).reduce((t,n)=>{const i=pt(n,["tfdt"])[0],r=i[0],s=pt(n,["tfhd"]).reduce((l,d)=>{const h=Qe(d,4),_=a[h];if(_){let S=Qe(i,4);if(r===1){if(S===Ze)return E.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;S*=Ze+1,S+=Qe(i,8)}const U=_.timescale||9e4,ee=S/U;if(G(ee)&&(l===null||eeee+X.info.duration||0,0);l=Math.max(l,U+S.earliestPresentationTime/S.timescale),d=l-s}}if(d&&G(d))return d}return n||i}function Vt(a){const e=Qe(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=Qe(a,4);for(let r=0;r{pt(n,["tfhd"]).forEach(i=>{const r=Qe(i,4),s=a[r];if(!s)return;const l=s.timescale||9e4;pt(n,["tfdt"]).forEach(d=>{const h=d[0],_=t*l;if(_){let S=Qe(d,4);if(h===0)S-=_,S=Math.max(S,0),Gt(d,4,S);else{S*=Math.pow(2,32),S+=Qe(d,8),S-=_,S=Math.max(S,0);const U=Math.floor(S/(Ze+1)),ee=Math.floor(S%(Ze+1));Gt(d,4,U),Gt(d,8,ee)}}})})})}function We(a){const e={valid:null,remainder:null},t=pt(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=Q(a,0,n.byteOffset-8),e.remainder=Q(a,n.byteOffset-8),e}function c(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function m(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return pt(n,["moof"]).map(d=>{const h=d.byteOffset-8;pt(d,["traf"]).map(S=>{const U=pt(S,["tfdt"]).map(ee=>{const X=ee[0];let se=Qe(ee,4);return X===1&&(se*=Math.pow(2,32),se+=Qe(ee,8)),se/i})[0];return U!==void 0&&(a=U),pt(S,["tfhd"]).map(ee=>{const X=Qe(ee,4),se=Qe(ee,0)&16777215,de=(se&1)!==0,Te=(se&2)!==0,$e=(se&8)!==0;let Ue=0;const at=(se&16)!==0;let je=0;const bt=(se&32)!==0;let it=8;X===r&&(de&&(it+=8),Te&&(it+=4),$e&&(Ue=Qe(ee,it),it+=4),at&&(je=Qe(ee,it),it+=4),bt&&(it+=4),e.type==="video"&&(s=x(e.codec)),pt(S,["trun"]).map(Pt=>{const Yt=Pt[0],gt=Qe(Pt,0)&16777215,Nt=(gt&1)!==0;let Sn=0;const tn=(gt&4)!==0,bn=(gt&256)!==0;let vn=0;const mn=(gt&512)!==0;let Mn=0;const Hn=(gt&1024)!==0,ln=(gt&2048)!==0;let nn=0;const Bn=Qe(Pt,4);let Rn=8;Nt&&(Sn=Qe(Pt,Rn),Rn+=4),tn&&(Rn+=4);let $n=Sn+h;for(let ci=0;ci>1&63;return t===39||t===40}else return(e&31)===6}function ie(a,e,t,n){const i=be(a);let r=0;r+=e;let s=0,l=0,d=0;for(;r=i.length)break;d=i[r++],s+=d}while(d===255);l=0;do{if(r>=i.length)break;d=i[r++],l+=d}while(d===255);const h=i.length-r;let _=r;if(lh){E.error(`Malformed SEI payload. ${l} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(i[_++]===181){const U=wt(i,_);if(_+=2,U===49){const ee=Qe(i,_);if(_+=4,ee===1195456820){const X=i[_++];if(X===3){const se=i[_++],de=31&se,Te=64&se,$e=Te?2+de*3:0,Ue=new Uint8Array($e);if(Te){Ue[0]=se;for(let at=1;at<$e;at++)Ue[at]=i[_++]}n.push({type:X,payloadType:s,pts:t,bytes:Ue})}}}}}else if(s===5&&l>16){const S=[];for(let X=0;X<16;X++){const se=i[_++].toString(16);S.push(se.length==1?"0"+se:se),(X===3||X===5||X===7||X===9)&&S.push("-")}const U=l-16,ee=new Uint8Array(U);for(let X=0;X>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i0?(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),nt([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function rt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,l=He.hexDump(new Uint8Array(s,t+12,16)),d=a.getUint32(28);let h=null,_=null;if(r===0){if(e-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Ie.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=qe(n,null,t),this.keyId=Ye(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=jt[this.uri];if(!n){const i=Object.keys(jt).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),jt[this.uri]=n}this.keyId=n}return this}}function Zt(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Ct=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fe(a){return Ct.test(a)}function Be(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],r=e[i];r&&(e[i]=ct(a,r))}}function ct(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Ct,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 Lt(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 Ft(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}"`))}function dn(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function pn(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}const It={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,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 xt(a,e){const t=It[e];return!!t&&!!t[a.slice(0,4)]}function De(a,e,t=!0){return!a.split(",").some(n=>!Me(n,e,t))}function Me(a,e,t=!0){var n;const i=dn(t);return(n=i==null?void 0:i.isTypeSupported(Ge(a,e)))!=null?n:!1}function Ge(a,e){return`${e}/mp4;codecs="${a}"`}function st(a){if(a){const e=a.substring(0,4);return It.video[e]}return 2}function Xe(a){return a.split(",").reduce((e,t)=>{const n=It.video[t];return n?(n*2+e)/(e?3:2):(It.audio[t]+e)/(e?2:1)},0)}const tt={};function Je(a,e=!0){if(tt[a])return tt[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let n=0;nJe(t.toLowerCase(),e))}function Bt(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function rn(a){const e=a.split(",");for(let t=0;t2){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(",")}const un=/#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,gn=/#EXT-X-MEDIA:(.*)/g,hn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Jt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),An=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(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 _n{static findGroup(e,t){for(let n=0;n0&&r.length({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for(gn.lastIndex=0;(i=gn.exec(e))!==null;){const h=new ne(i[1]),_=h.TYPE;if(_){const S=l[_],U=r[_]||[];r[_]=U,Be(n,h,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const ee=h.LANGUAGE,X=h["ASSOC-LANGUAGE"],se=h.CHANNELS,de=h.CHARACTERISTICS,Te=h["INSTREAM-ID"],$e={attrs:h,bitrate:0,id:d++,groupId:h["GROUP-ID"]||"",name:h.NAME||ee||"",type:_,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:ee,url:h.URI?_n.resolve(h.URI,t):""};if(X&&($e.assocLang=X),se&&($e.channels=se),de&&($e.characteristics=de),Te&&($e.instreamId=Te),S!=null&&S.length){const Ue=_n.findGroup(S,$e.groupId)||S[0];En($e,Ue,"audioCodec"),En($e,Ue,"textCodec")}U.push($e)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){const l=new Z(t),d=l.fragments;let h=null,_=0,S=0,U=0,ee=0,X=null,se=new C(i,t),de,Te,$e,Ue=-1,at=!1,je=null;for(Jt.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Fe(e);(de=Jt.exec(e))!==null;){at&&(at=!1,se=new C(i,t),se.start=U,se.sn=_,se.cc=ee,se.level=n,h&&(se.initSegment=h,se.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,je&&(se.setByteRange(je),je=null)));const Yt=de[1];if(Yt){se.duration=parseFloat(Yt);const gt=(" "+de[2]).slice(1);se.title=gt||null,se.tagList.push(gt?["INF",Yt,gt]:["INF",Yt])}else if(de[3]){if(G(se.duration)){se.start=U,$e&&Ln(se,$e,l),se.sn=_,se.level=n,se.cc=ee,d.push(se);const gt=(" "+de[3]).slice(1);se.relurl=ct(l,gt),Tn(se,X),X=se,U+=se.duration,_++,S=0,at=!0}}else if(de[4]){const gt=(" "+de[4]).slice(1);X?se.setByteRange(gt,X):se.setByteRange(gt)}else if(de[5])se.rawProgramDateTime=(" "+de[5]).slice(1),se.tagList.push(["PROGRAM-DATE-TIME",se.rawProgramDateTime]),Ue===-1&&(Ue=d.length);else{if(de=de[0].match(An),!de){E.warn("No matches on slow regex match for level playlist!");continue}for(Te=1;Te0&&tn.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=tn.optionalFloat("PART-HOLD-BACK",0),l.holdBack=tn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const tn=new ne(Nt);l.partTarget=tn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let tn=l.partList;tn||(tn=l.partList=[]);const bn=S>0?tn[tn.length-1]:void 0,vn=S++,mn=new ne(Nt);Be(l,mn,["BYTERANGE","URI"]);const Mn=new R(mn,se,t,vn,bn);tn.push(Mn),se.duration+=Mn.duration;break}case"PRELOAD-HINT":{const tn=new ne(Nt);Be(l,tn,["URI"]),l.preloadHint=tn;break}case"RENDITION-REPORT":{const tn=new ne(Nt);Be(l,tn,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(tn);break}default:E.warn(`line parsed but not handled: ${de}`);break}}}X&&!X.relurl?(d.pop(),U-=X.duration,l.partList&&(l.fragmentHint=X)):l.partList&&(Tn(se,X),se.cc=ee,l.fragmentHint=se,$e&&Ln(se,$e,l));const bt=d.length,it=d[0],Pt=d[bt-1];if(U+=l.skippedSegments*l.targetduration,U>0&&bt&&Pt){l.averagetargetduration=U/bt;const Yt=Pt.sn;l.endSN=Yt!=="initSegment"?Yt:0,l.live||(Pt.endList=!0),it&&(l.startCC=it.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(U+=l.fragmentHint.duration),l.totalduration=U,l.endCC=ee,Ue>0&&xn(d,Ue),l}}function In(a,e,t){var n,i;const r=new ne(a);Be(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=r.METHOD)!=null?n:"",l=r.URI,d=r.hexadecimalInteger("IV"),h=r.KEYFORMATVERSIONS,_=(i=r.KEYFORMAT)!=null?i:"identity";l&&r.IV&&!d&&E.error(`Invalid IV: ${r.IV}`);const S=l?_n.resolve(l,e):"",U=(h||"1").split("/").map(Number).filter(Number.isFinite);return new lt(s,S,_,U,d)}function wn(a){const t=new ne(a).decimalFloatingPoint("TIME-OFFSET");return G(t)?t:null}function yn(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>xt(r,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function En(a,e,t){const n=e[t];n&&(a[t]=n)}function xn(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 Tn(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),G(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function zn(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 Ln(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)}var fn={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},$t={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Kn(a){const{type:e}=a;switch(e){case fn.AUDIO_TRACK:return $t.AUDIO;case fn.SUBTITLE_TRACK:return $t.SUBTITLE;default:return $t.MAIN}}function Pn(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Un{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,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:fn.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:l}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:fn.LEVEL,url:s,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:fn.AUDIO_TRACK,url:r,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:fn.SUBTITLE_TRACK,url:r,deliveryDirectives:s})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const h=i.context;if(h&&h.url===e.url&&h.level===e.level){E.trace("[playlist-loader]: playlist request ongoing");return}E.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===fn.MANIFEST?r=n.manifestLoadPolicy.default:r=o({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),G((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===fn.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===fn.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===fn.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const _=h.partTarget,S=h.targetduration;if(_&&S){const U=Math.max(_*3,S*.8)*1e3;r=o({},r,{maxTimeToFirstByteMs:Math.min(U,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(U,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},l={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},d={onSuccess:(h,_,S,U)=>{const ee=this.getInternalLoader(S);this.resetInternalLoader(S.type);const X=h.data;if(X.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,S,new Error("no EXTM3U delimiter"),U||null,_);return}_.parsing.start=performance.now(),_n.isMediaPlaylist(X)?this.handleTrackOrLevelPlaylist(h,_,S,U||null,ee):this.handleMasterPlaylist(h,_,S,U)},onError:(h,_,S,U)=>{this.handleNetworkError(_,S,!1,h,U)},onTimeout:(h,_,S)=>{this.handleNetworkError(_,S,!0,void 0,h)}};i.load(e,l,d)}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,l=Pn(e,n),d=_n.parseMasterPlaylist(s,l);if(d.playlistParsingError){this.handleManifestParsingError(e,n,d.playlistParsingError,i,t);return}const{contentSteering:h,levels:_,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X}=d;this.variableList=X;const{AUDIO:se=[],SUBTITLES:de,"CLOSED-CAPTIONS":Te}=_n.parseMasterPlaylistMedia(s,l,d);se.length&&!se.some(Ue=>!Ue.url)&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(E.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),se.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ne({}),bitrate:0,url:""})),r.trigger(u.MANIFEST_LOADED,{levels:_,audioTracks:se,subtitles:de,captions:Te,contentSteering:h,url:l,stats:t,networkDetails:i,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:l,level:d,type:h}=n,_=Pn(e,n),S=0,U=G(d)?d:G(l)?l:0,ee=Kn(n),X=_n.parseLevelPlaylist(e.data,_,U,ee,S,this.variableList);if(h===fn.MANIFEST){const se={attrs:new ne({}),bitrate:0,details:X,name:"",url:_};s.trigger(u.MANIFEST_LOADED,{levels:[se],audioTracks:[],url:_,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=X,this.handlePlaylistLoaded(X,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.MANIFEST_PARSING_ERROR,fatal:t.type===fn.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===fn.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===fn.AUDIO_TRACK||e.type===fn.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);E.warn(`[playlist-loader]: ${s}`);let d=p.UNKNOWN,h=!1;const _=this.getInternalLoader(e);switch(e.type){case fn.MANIFEST:d=n?p.MANIFEST_LOAD_TIMEOUT:p.MANIFEST_LOAD_ERROR,h=!0;break;case fn.LEVEL:d=n?p.LEVEL_LOAD_TIMEOUT:p.LEVEL_LOAD_ERROR,h=!1;break;case fn.AUDIO_TRACK:d=n?p.AUDIO_TRACK_LOAD_TIMEOUT:p.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case fn.SUBTITLE_TRACK:d=n?p.SUBTITLE_TRACK_LOAD_TIMEOUT:p.SUBTITLE_LOAD_ERROR,h=!1;break}_&&this.resetInternalLoader(e.type);const S={type:g.NETWORK_ERROR,details:d,fatal:h,url:e.url,loader:_,context:e,error:l,networkDetails:t,stats:r};if(i){const U=(t==null?void 0:t.url)||e.url;S.response=oe({url:U,data:void 0},i)}this.hls.trigger(u.ERROR,S)}handlePlaylistLoaded(e,t,n,i,r,s){const l=this.hls,{type:d,level:h,id:_,groupId:S,deliveryDirectives:U}=i,ee=Pn(t,i),X=Kn(i),se=typeof i.level=="number"&&X===$t.MAIN?h:void 0;if(!e.fragments.length){const Te=new Error("No Segments found in Playlist");l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.LEVEL_EMPTY_ERROR,fatal:!1,url:ee,error:Te,reason:Te.message,response:t,context:i,level:se,parent:X,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const de=e.playlistParsingError;if(de){l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:p.LEVEL_PARSING_ERROR,fatal:!1,url:ee,error:de,reason:de.message,response:t,context:i,level:se,parent:X,networkDetails:r,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),d){case fn.MANIFEST:case fn.LEVEL:l.trigger(u.LEVEL_LOADED,{details:e,level:se||0,id:_||0,stats:n,networkDetails:r,deliveryDirectives:U});break;case fn.AUDIO_TRACK:l.trigger(u.AUDIO_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break;case fn.SUBTITLE_TRACK:l.trigger(u.SUBTITLE_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break}}}function Xn(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 ti(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){E.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){E.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Qn(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function Nn(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=qt(a.cues,e,t);for(let s=0;sa[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const r=Math.floor((i+n)/2);if(ea[r].startTime&&n-1)for(let r=i,s=a.length;r=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function Ot(a){const e=[];for(let t=0;t{const a=On();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Zn(a,e){return a.getTime()/1e3-e}function li(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class di{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Qn(this.id3Track),this.id3Track=null,this.media=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;tGn&&(S=Gn),S-_<=0&&(S=_+Cn);for(let ee=0;ee_.type===on.audioId3&&d:i==="video"?h=_=>_.type===on.emsg&&l:h=_=>_.type===on.audioId3&&d||_.type===on.emsg&&l,Nn(r,t,n,h)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:r}=t,s=Object.keys(r);if(i){const _=Object.keys(n).filter(S=>!s.includes(S));for(let S=_.length;S--;){const U=_[S];Object.keys(n[U].cues).forEach(ee=>{i.removeCue(n[U].cues[ee])}),delete n[U]}}const l=t.fragments[t.fragments.length-1];if(s.length===0||!G(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=l.programDateTime/1e3-l.start,h=On();for(let _=0;_{if(bt!==U.id){const it=r[bt];if(it.class===U.class&&it.startDate>U.startDate&&(!je||U.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,d=this.hls.userConfig;let h=l&&n||t;(d.liveSyncDuration||d.liveSyncDurationCount||h===0)&&(h=r!==void 0?r:s*i);const _=i;return h+Math.min(this.stallCount*1,_)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,l=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;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,levelDetails:t}=this;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.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(u.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(u.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===p.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&E.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const s=this.targetLatency;if(s===null)return;const l=n-s,d=Math.min(this.maxLatency,s+t.targetduration);if(l.05&&this.forwardBufferLength>1){const _=Math.min(2,Math.max(1,r)),S=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(_,Math.max(1,S))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const pi=["NONE","TYPE-0","TYPE-1",null];function Vn(a){return pi.indexOf(a)>-1}const ni=["SDR","PQ","HLG"];function yi(a){return!!a&&ni.indexOf(a)>-1}var Si={No:"",Yes:"YES",v2:"v2"};function hi(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n!!t).map(t=>t.substring(0,4)).join(","),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 Ci(this._audioGroups,e)}hasSubtitleGroup(e){return Ci(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 Ci(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function ki(a,e){const t=e.startPTS;if(G(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.duration=n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function Pi(a,e,t,n,i,r){n-t<=0&&(E.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let l=t,d=n;const h=e.startPTS,_=e.endPTS;if(G(h)){const de=Math.abs(h-t);G(e.deltaPTS)?e.deltaPTS=Math.max(de,e.deltaPTS):e.deltaPTS=de,l=Math.max(t,h),t=Math.min(t,h),i=Math.min(i,e.startDTS),d=Math.min(n,_),n=Math.max(n,_),r=Math.max(r,e.endDTS)}const S=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=n,e.minEndPTS=d,e.endDTS=r;const U=e.sn;if(!a||Ua.endSN)return 0;let ee;const X=U-a.startSN,se=a.fragments;for(se[X]=e,ee=X;ee>0;ee--)ki(se[ee],se[ee-1]);for(ee=X;ee=0;l--){const d=n[l].initSegment;if(d){t=d;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;qi(a,e,(l,d,h,_)=>{if(e.skippedSegments&&d.cc!==l.cc){const S=l.cc-d.cc;for(let U=h;U<_.length;U++)_[U].cc+=S}G(l.startPTS)&&G(l.endPTS)&&(d.start=d.startPTS=l.startPTS,d.startDTS=l.startDTS,d.maxStartPTS=l.maxStartPTS,d.endPTS=l.endPTS,d.endDTS=l.endDTS,d.minEndPTS=l.minEndPTS,d.duration=l.endPTS-l.startPTS,d.duration&&(i=d),e.PTSKnown=e.alignedSliding=!0),d.elementaryStreams=l.elementaryStreams,d.loader=l.loader,d.stats=l.stats,l.initSegment&&(d.initSegment=l.initSegment,t=l.initSegment)});const r=e.fragments;if(t&&(e.fragmentHint?r.concat(e.fragmentHint):r).forEach(d=>{var h;d&&(!d.initSegment||d.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(d.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(l=>!l),e.deltaUpdateFailed){E.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)r.shift();e.startSN=r[0].sn}else e.canSkipDateRanges&&(e.dateRanges=ji(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=r[r.length-1].cc}wi(a.partList,e.partList,(l,d)=>{d.elementaryStreams=l.elementaryStreams,d.stats=l.stats}),i?Pi(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Ni(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const s=e.advancedDateTime;if(e.advanced&&s){const l=e.edge;e.driftStart||(e.driftStartTime=s,e.driftStart=l),e.driftEndTime=s,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function ji(a,e,t){const n=o({},a);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const r=new Se(e[i].attr,n[i]);r.isValid?n[i]=r:E.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function wi(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],l=e[i+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function qi(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,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,d=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=i;h<=r;h++){const _=d[s+h];let S=l[h];n&&!S&&h=n.length||Ii(e,n[t].start)}function Ii(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;ne){const r=n[n.length-1].duration*1e3;r{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function Ti(a){switch(a.details){case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_TIMEOUT:case p.LEVEL_LOAD_TIMEOUT:case p.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Yn(a,e){const t=Ti(e);return a.default[`${t?"timeout":"error"}Retry`]}function gi(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Ei(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function ri(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e499)}const Vi={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 sr(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!G(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;r0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&Wi(t,n,r)===0||dr(r,a,Math.min(i,n))))return r;const s=Vi.search(e,Wi.bind(null,t,n));return s&&(s!==a||!r)?s:r}function dr(a,e,t){if(e&&e.start===0&&e.level0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function Wi(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 Zi(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function sn(a,e){return Vi.search(a,t=>t.cce?-1:0)}var en={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Dn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class qn{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=E.log.bind(E,"[info]:"),this.warn=E.warn.bind(E,"[warning]:"),this.error=E.error.bind(E,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.ERROR,this.onError,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.ERROR,this.onError,this),e.off(u.ERROR,this.onErrorOut,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.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)===$t.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const r=this.hls,s=t.context;switch(t.details){case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case p.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:en.DoNothing,flags:Dn.None};return}case p.FRAG_GAP:case p.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=en.SendAlternateToPenaltyBox;return}case p.LEVEL_EMPTY_ERROR:case p.LEVEL_PARSING_ERROR:{var l,d;const h=t.parent===$t.MAIN?t.level:r.loadLevel;t.details===p.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(d=l.levelDetails)!=null&&d.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,h):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,h))}return;case p.LEVEL_LOAD_ERROR:case p.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case p.AUDIO_TRACK_LOAD_ERROR:case p.AUDIO_TRACK_LOAD_TIMEOUT:case p.SUBTITLE_LOAD_ERROR:case p.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const h=r.levels[r.loadLevel];if(h&&(s.type===fn.AUDIO_TRACK&&h.hasAudioGroup(s.groupId)||s.type===fn.SUBTITLE_TRACK&&h.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=en.SendAlternateToPenaltyBox,t.errorAction.flags=Dn.MoveAllAlternatesMatchingHost;return}}return;case p.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const h=r.levels[r.loadLevel],_=h==null?void 0:h.attrs["HDCP-LEVEL"];_?t.errorAction={action:en.SendAlternateToPenaltyBox,flags:Dn.MoveAllAlternatesMatchingHDCP,hdcpLevel:_}:this.keySystemError(t)}return;case p.BUFFER_ADD_CODEC_ERROR:case p.REMUX_ALLOC_ERROR:case p.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case p.INTERNAL_EXCEPTION:case p.BUFFER_APPENDING_ERROR:case p.BUFFER_FULL_ERROR:case p.LEVEL_SWITCH_ERROR:case p.BUFFER_STALLED_ERROR:case p.BUFFER_SEEK_OVER_HOLE:case p.BUFFER_NUDGE_ON_STALL:t.errorAction={action:en.DoNothing,flags:Dn.None};return}t.type===g.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=Yn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(ri(i,r,Ti(e),e.response))return{action:en.RetryRequest,flags:Dn.None,retryConfig:i,retryCount:r};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=r),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,l=Yn(e.details.startsWith("key")?s:r,e),d=t.levels.reduce((_,S)=>_+S.fragmentError,0);if(i&&(e.details!==p.FRAG_GAP&&i.fragmentError++,ri(l,d,Ti(e),e.response)))return{action:en.RetryRequest,flags:Dn.None,retryConfig:l,retryCount:d};const h=this.getLevelSwitchAction(e,n);return l&&(h.retryConfig=l,h.retryCount=d),h}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const h=e.details;i.loadError++,h===p.BUFFER_APPEND_ERROR&&i.fragmentError++;let _=-1;const{levels:S,loadLevel:U,minAutoLevel:ee,maxAutoLevel:X}=n;n.autoLevelEnabled||(n.loadLevel=-1);const se=(r=e.frag)==null?void 0:r.type,Te=(se===$t.AUDIO&&h===p.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===p.BUFFER_ADD_CODEC_ERROR||h===p.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:bt})=>i.audioCodec!==bt),Ue=e.sourceBufferName==="video"&&(h===p.BUFFER_ADD_CODEC_ERROR||h===p.BUFFER_APPEND_ERROR)&&S.some(({codecSet:bt,audioCodec:it})=>i.codecSet!==bt&&i.audioCodec===it),{type:at,groupId:je}=(s=e.context)!=null?s:{};for(let bt=S.length;bt--;){const it=(bt+U)%S.length;if(it!==U&&it>=ee&&it<=X&&S[it].loadError===0){var l,d;const Pt=S[it];if(h===p.FRAG_GAP&&se===$t.MAIN&&e.frag){const Yt=S[it].details;if(Yt){const gt=Bi(e.frag,Yt.fragments,e.frag.start);if(gt!=null&>.gap)continue}}else{if(at===fn.AUDIO_TRACK&&Pt.hasAudioGroup(je)||at===fn.SUBTITLE_TRACK&&Pt.hasSubtitleGroup(je))continue;if(se===$t.AUDIO&&(l=i.audioGroups)!=null&&l.some(Yt=>Pt.hasAudioGroup(Yt))||se===$t.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(Yt=>Pt.hasSubtitleGroup(Yt))||Te&&i.audioCodec===Pt.audioCodec||!Te&&i.audioCodec!==Pt.audioCodec||Ue&&i.codecSet===Pt.codecSet)continue}_=it;break}}if(_>-1&&n.loadLevel!==_)return e.levelRetry=!0,this.playlistError=0,{action:en.SendAlternateToPenaltyBox,flags:Dn.None,nextAutoLevel:_}}return{action:en.SendAlternateToPenaltyBox,flags:Dn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case en.DoNothing:break;case en.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==p.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 en.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 Dn.None:this.switchLevel(e,s);break;case Dn.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=pi[pi.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){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)}}class kn{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=E.log.bind(E,`${t}:`),this.warn=E.warn.bind(E,`${t}:`),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.requestScheduled=-1,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=0&&_>t.partTarget&&(d+=1)}const h=n&&hi(n);return new Ai(l,d>=0?d:void 0,h)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),l=r.loading.first?Math.max(0,s-r.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&zi(n,i),!this.canLoad||!i.live)return;let d,h,_;if(i.canBlockReload&&i.endSN&&i.advanced){const de=this.hls.config.lowLatencyMode,Te=i.lastPartSn,$e=i.endSN,Ue=i.lastPartIndex,at=Ue!==-1,je=Te===$e,bt=de?0:Ue;at?(h=je?$e+1:Te,_=je?bt:Ue+1):h=$e+1;const it=i.age,Pt=it+i.ageHeader;let Yt=Math.min(Pt-i.partTarget,i.targetduration*1.5);if(Yt>0){if(n&&Yt>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Yt} with playlist age: ${i.age}`),Yt=0;else{const gt=Math.floor(Yt/i.targetduration);if(h+=gt,_!==void 0){const Nt=Math.round(Yt%i.targetduration/i.partTarget);_+=Nt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${it.toFixed(2)}s goal: ${Yt} skip sn ${gt} to part ${_}`)}i.tuneInGoal=Yt}if(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_),de||!je){this.loadPlaylist(d);return}}else(i.canBlockReload||i.canSkipUntil)&&(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_));const S=this.hls.mainForwardBufferInfo,U=S?S.end-S.len:0,ee=(i.edge-U)*1e3,X=er(i,ee);i.updated&&s>this.requestScheduled+X&&(this.requestScheduled=r.loading.start),h!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+X-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+Xthis.loadPlaylist(d),se)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let r=hi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=Si.No),new Ai(n,i,r)}checkRetry(e){const t=e.details,n=Ti(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:l}=i||{},d=!!i&&!!l&&(r===en.RetryRequest||!i.resolved&&r===en.SendAlternateToPenaltyBox);if(d){var h;if(this.requestScheduled=-1,s>=l.maxNumRetry)return!1;if(n&&(h=e.context)!=null&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const _=gi(l,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),_),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${_}ms`)}e.levelRetry=!0,i.resolved=!0}return d}}class Oi{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 hr{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 Oi(e),this.fast_=new Oi(t),this.defaultTTFB_=i,this.ttfb_=new Oi(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new Oi(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Oi(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Oi(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_}destroy(){}}const ar={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},tr={};function ts(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,l=r==null?void 0:r.audioCodec,d=r==null?void 0:r.channels,h=d?parseInt(d):l?1/0:2;let _=null;if(s!=null&&s.length)try{s.length===1&&s[0]?_=e.groups[s[0]].channels:_=s.reduce((S,U)=>{if(U){const ee=e.groups[U];if(!ee)throw new Error(`Audio track group ${U} not found`);Object.keys(ee.channels).forEach(X=>{S[X]=(S[X]||0)+ee.channels[X]})}return S},{2:0})}catch(S){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))||!!_&&G(h)&&Object.keys(_).some(S=>parseInt(S)>h)}function ns(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n||!i||!t)return Promise.resolve(ar);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},s=a.videoRange;s!=="SDR"&&(r.transferFunction=s.toLowerCase());const l=n.split(",").map(d=>({type:"media-source",video:oe(oe({},r),{},{contentType:Ge(d,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(d=>{var h;d&&((h=e.groups[d])==null||h.tracks.forEach(_=>{if(_.groupId===d){const S=_.channels||"",U=parseFloat(S);G(U)&&U>2&&l.push.apply(l,i.split(",").map(ee=>({type:"media-source",audio:{contentType:Ge(ee,"audio"),channels:""+U}})))}}))}),Promise.all(l.map(d=>{const h=Nr(d);return tr[h]||(tr[h]=t.decodingInfo(d))})).then(d=>({supported:!d.some(h=>!h.supported),configurations:l,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:l,decodingInfoResults:[],error:d}))}function Nr(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=n.contentType.split('"')[1];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""}function vr(){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 is(a,e){let t=!1,n=[];return a&&(t=a!=="SDR",n=[a]),e&&(n=e.allowedVideoRanges||ni.slice(0),t=e.preferHDR!==void 0?e.preferHDR:vr(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function Lr(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,d=s&&parseInt(s)===2;let h=!0,_=!1,S=1/0,U=1/0,ee=1/0,X=0,se=[];const{preferHDR:de,allowedVideoRanges:Te}=is(e,i);for(let je=r.length;je--;){const bt=a[r[je]];h=bt.channels[2]>0,S=Math.min(S,bt.minHeight),U=Math.min(U,bt.minFramerate),ee=Math.min(ee,bt.minBitrate);const it=Te.filter(Pt=>bt.videoRanges[Pt]>0);it.length>0&&(_=!0,se=it)}S=G(S)?S:0,U=G(U)?U:0;const $e=Math.max(1080,S),Ue=Math.max(30,U);return ee=G(ee)?ee:t,t=Math.max(ee,t),_||(e=void 0,se=[]),{codecSet:r.reduce((je,bt)=>{const it=a[bt];if(bt===je)return je;if(it.minBitrate>t)return bi(bt,`min bitrate of ${it.minBitrate} > current estimate of ${t}`),je;if(!it.hasDefaultAudio)return bi(bt,"no renditions with default or auto-select sound found"),je;if(l&&bt.indexOf(l.substring(0,4))%5!==0)return bi(bt,`audio codec preference "${l}" not found`),je;if(s&&!d){if(!it.channels[s])return bi(bt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(it.channels)})`),je}else if((!l||d)&&h&&it.channels[2]===0)return bi(bt,"no renditions with stereo sound found"),je;return it.minHeight>$e?(bi(bt,`min resolution of ${it.minHeight} > maximum of ${$e}`),je):it.minFramerate>Ue?(bi(bt,`min framerate of ${it.minFramerate} > maximum of ${Ue}`),je):se.some(Pt=>it.videoRanges[Pt]>0)?it.maxScore=Xe(je)||it.fragmentError>a[je].fragmentError)?je:(X=it.maxScore,bt):(bi(bt,`no variants with VIDEO-RANGE of ${JSON.stringify(se)} found`),je)},void 0),videoRanges:se,preferHDR:de,minFramerate:U,minBitrate:ee}}function bi(a,e){E.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Mr(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 Fr(a,e,t,n){return a.slice(t,n+1).reduce((i,r)=>{if(!r.codecSet)return i;const s=r.audioGroups;let l=i[r.codecSet];l||(i[r.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,r.bitrate);const d=Math.min(r.height,r.width);return l.minHeight=Math.min(l.minHeight,d),l.minFramerate=Math.min(l.minFramerate,r.frameRate),l.maxScore=Math.max(l.maxScore,r.score),l.fragmentError+=r.fragmentError,l.videoRanges[r.videoRange]=(l.videoRanges[r.videoRange]||0)+1,s&&s.forEach(h=>{if(!h)return;const _=e.groups[h];_&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?_.hasDefault:_.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(_.channels).forEach(S=>{l.channels[S]=(l.channels[S]||0)+_.channels[S]}))}),i},{})}function Ui(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;nn.indexOf(i)===-1)}function Xi(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 ss(a,e,t,n,i){const r=e[n],l=e.reduce((U,ee,X)=>{const se=ee.uri;return(U[se]||(U[se]=[])).push(X),U},{})[r.uri];l.length>1&&(n=Math.max.apply(Math,l));const d=r.videoRange,h=r.frameRate,_=r.codecSet.substring(0,4),S=Br(e,n,U=>{if(U.videoRange!==d||U.frameRate!==h||U.codecSet.substring(0,4)!==_)return!1;const ee=U.audioGroups,X=t.filter(se=>!ee||ee.indexOf(se.groupId)!==-1);return Ui(a,X,i)>-1});return S>-1?S:Br(e,n,U=>{const ee=U.audioGroups,X=t.filter(se=>!ee||ee.indexOf(se.groupId)!==-1);return Ui(a,X,i)>-1})}function Br(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:r,media:s}=i;if(!t||!s)return;const l=performance.now(),d=n?n.stats:t.stats,h=n?n.duration:t.duration,_=l-d.loading.start,S=i.minAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||t.level<=S){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||s.paused||!s.playbackRate||!s.readyState)return;const U=i.mainForwardBufferInfo;if(U===null)return;const ee=this.bwEstimator.getEstimateTTFB(),X=Math.abs(s.playbackRate);if(_<=Math.max(ee,1e3*(h/(X*2))))return;const se=U.len/X,de=d.loading.first?d.loading.first-d.loading.start:-1,Te=d.loaded&&de>-1,$e=this.getBwEstimate(),Ue=i.levels,at=Ue[t.level],je=d.total||Math.max(d.loaded,Math.round(h*at.averageBitrate/8));let bt=Te?_-de:_;bt<1&&Te&&(bt=Math.min(_,d.loaded*8/$e));const it=Te?d.loaded*1e3/bt:0,Pt=it?(je-d.loaded)/it:je*8/$e+ee/1e3;if(Pt<=se)return;const Yt=it?it*8:$e;let gt=Number.POSITIVE_INFINITY,Nt;for(Nt=t.level-1;Nt>S;Nt--){const tn=Ue[Nt].maxBitrate;if(gt=this.getTimeToLoadFrag(ee/1e3,Yt,h*tn,!Ue[Nt].details),gt=Pt||gt>h*10)return;i.nextLoadLevel=i.nextAutoLevel=Nt,Te?this.bwEstimator.sample(_-Math.min(ee,de),d.loaded):this.bwEstimator.sampleTTFB(_);const Sn=Ue[Nt].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>Sn&&this.resetEstimator(Sn),this.clearTimer(),E.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly; Time to underbuffer: ${se.toFixed(3)} s Estimated load time for current fragment: ${Pt.toFixed(3)} s Estimated load time for down switch fragment: ${gt.toFixed(3)} s TTFB estimate: ${de|0} ms Current BW estimate: ${G($e)?$e|0:"Unknown"} bps New BW estimate: ${this.getBwEstimate()|0} bps Switching to level ${Nt} @ ${Sn|0} bps`),i.trigger(u.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:d})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(E.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 hr(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(u.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 p.BUFFER_ADD_CODEC_ERROR:case p.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case p.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(),l=r?r.stats:n.stats,d=s-l.loading.start,h=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&h>-1){const S=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(d-Math.min(S,h),l.loaded)}else this.bwEstimator.sampleTTFB(d)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;G(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===$t.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],l=(s.loaded?s.loaded.bytes:0)+i.loaded,d=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:l,duration:d},s.realBitrate=Math.round(8*l/d)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(u.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!==$t.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,l=Math.min(Math.max(s,t),e);return E.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}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,{maxAutoLevel:i,config:r,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,d=this.getBwEstimate(),h=this.getStarvationDelay();let _=r.abrBandWidthFactor,S=r.abrBandWidthUpFactor;if(h){const de=this.findBestLevel(d,s,i,h,0,_,S);if(de>=0)return de}let U=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay;if(!h){const de=this.bitrateTestDelay;de&&(U=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-de,E.info(`[abr] bitrate test took ${Math.round(1e3*de)}ms, set first fragment max fetchDuration to ${Math.round(1e3*U)} ms`),_=S=1)}const ee=this.findBestLevel(d,s,i,h,U,_,S);if(E.info(`[abr] ${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${ee}`),ee>-1)return ee;const X=n.levels[s],se=n.levels[n.loadLevel];return(X==null?void 0:X.bitrate)<(se==null?void 0:se.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,l){var d;const h=i+r,_=this.lastLoadedFragLevel,S=_===-1?this.hls.firstLevel:_,{fragCurrent:U,partCurrent:ee}=this,{levels:X,allAudioTracks:se,loadLevel:de,config:Te}=this.hls;if(X.length===1)return 0;const $e=X[S],Ue=!!($e!=null&&(d=$e.details)!=null&&d.live),at=de===-1||_===-1;let je,bt="SDR",it=($e==null?void 0:$e.frameRate)||0;const{audioPreference:Pt,videoPreference:Yt}=Te,gt=this.audioTracksByGroup||(this.audioTracksByGroup=Mr(se));if(at){if(this.firstSelection!==-1)return this.firstSelection;const vn=this.codecTiers||(this.codecTiers=Fr(X,gt,t,n)),mn=Lr(vn,bt,e,Pt,Yt),{codecSet:Mn,videoRanges:Hn,minFramerate:ln,minBitrate:nn,preferHDR:Bn}=mn;je=Mn,bt=Bn?Hn[Hn.length-1]:Hn[0],it=ln,e=Math.max(e,nn),E.log(`[abr] picked start tier ${JSON.stringify(mn)}`)}else je=$e==null?void 0:$e.codecSet,bt=$e==null?void 0:$e.videoRange;const Nt=ee?ee.duration:U?U.duration:0,Sn=this.bwEstimator.getEstimateTTFB()/1e3,tn=[];for(let vn=n;vn>=t;vn--){var bn;const mn=X[vn],Mn=vn>S;if(!mn)continue;if(Te.useMediaCapabilities&&!mn.supportedResult&&!mn.supportedPromise){const ci=navigator.mediaCapabilities;typeof(ci==null?void 0:ci.decodingInfo)=="function"&&ts(mn,gt,bt,it,e,Pt)?(mn.supportedPromise=ns(mn,gt,ci),mn.supportedPromise.then(vi=>{if(!this.hls)return;mn.supportedResult=vi;const xi=this.hls.levels,Gi=xi.indexOf(mn);vi.error?E.warn(`[abr] MediaCapabilities decodingInfo error: "${vi.error}" for level ${Gi} ${JSON.stringify(vi)}`):vi.supported||(E.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Gi} ${JSON.stringify(vi)}`),Gi>-1&&xi.length>1&&(E.log(`[abr] Removing unsupported level ${Gi}`),this.hls.removeLevel(Gi)))})):mn.supportedResult=ar}if(je&&mn.codecSet!==je||bt&&mn.videoRange!==bt||Mn&&it>mn.frameRate||!Mn&&it>0&&it=Nt*2&&r===0?X[vn].averageBitrate:X[vn].maxBitrate,Rn=this.getTimeToLoadFrag(Sn,nn,Bn*ln,Hn===void 0);if(nn>=Bn&&(vn===_||mn.loadError===0&&mn.fragmentError===0)&&(Rn<=Sn||!G(Rn)||Ue&&!this.bitrateTestDelay||Rn${vn} adjustedbw(${Math.round(nn)})-bitrate=${Math.round(nn-Bn)} ttfb:${Sn.toFixed(1)} avgDuration:${ln.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${Rn.toFixed(1)} firstSelection:${at} codecSet:${je} videoRange:${bt} hls.loadLevel:${de}`)),at&&(this.firstSelection=vn),vn}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class os{constructor(){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(){}}var ai={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class fr{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(u.BUFFER_APPENDED,this.onBufferAppended,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.BUFFER_APPENDED,this.onBufferAppended,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.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){const{fragments:n}=this,i=Object.keys(n);for(let r=i.length;r--;){const s=n[i[r]];if((s==null?void 0:s.body.type)===t&&s.buffered){const l=s.body;if(l.start<=e&&e<=l.end)return l}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l||r>=l.body.sn)return;if(!l.buffered&&!l.loaded){l.body.type===n&&this.removeFragment(l.body);return}const d=l.range[e];d&&d.time.some(h=>{const _=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return _&&this.removeFragment(l.body),_})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const r=lr(n),s=this.fragments[r];if(!s||s.buffered&&n.gap)return;const l=!n.relurl;Object.keys(t).forEach(d=>{const h=n.elementaryStreams[d];if(!h)return;const _=t[d],S=l||h.partial===!0;s.range[d]=this.getBufferedTimes(n,i,S,_)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=n.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),or(s)||this.removeParts(n.sn-1,n.type)):this.removeFragment(s.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=lr(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,l=e.end,d=e.minEndPTS||l,h=e.maxStartPTS||s;for(let _=0;_=S&&d<=U){r.time.push({startPTS:Math.max(s,i.start(_)),endPTS:Math.min(l,i.end(_))});break}else if(sS){const ee=Math.max(s,i.start(_)),X=Math.min(l,i.end(_));X>ee&&(r.partial=!0,r.time.push({startPTS:ee,endPTS:X}))}else if(l<=S)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:l,fragments:d}=this;return Object.keys(d).forEach(h=>{const _=d[h];_&&or(_)&&(i=_.body.start-l,r=_.body.end+l,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=_.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||or(t))}getState(e){const t=lr(e),n=this.fragments[t];return n?n.buffered?or(n)?ai.PARTIAL:ai.OK:ai.APPENDING:ai.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const r=i?null:t,s=lr(n);this.fragments[s]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r}=t;if(n.sn==="initSegment")return;const s=n.type;if(i){let l=this.activePartLists[s];l||(this.activePartLists[s]=l=[]),l.push(i)}this.timeRanges=r,Object.keys(r).forEach(l=>{const d=r[l];this.detectEvictedFragments(l,d,s,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=lr(e);return!!this.fragments[t]}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 l=this.fragments[s];if(!l)return;const d=l.body;d.type!==n||i&&!d.gap||d.starte&&(l.buffered||r)&&this.removeFragment(d)})}removeFragment(e){const t=lr(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function or(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 lr(a){return`${a.type}_${a.level}_${a.sn}`}const ls={length:0,start:()=>0,end:()=>0};class jn{static isBuffered(e,t){try{if(e){const n=jn.getBuffered(e);for(let i=0;i=n.start(i)&&t<=n.end(i))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const i=jn.getBuffered(e),r=[];let s;for(s=0;sS&&(i[_-1].end=e[h].end):i.push(e[h])}else i.push(e[h])}else i=e;let r=0,s,l=t,d=t;for(let h=0;h=_&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(ee=>ee[0]==="GAP")){d(Wn(e));return}else e.gap=!1;const h=this.loader=e.loader=r?new r(i):new s(i),_=Fn(e),S=Ei(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$r};e.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,se,de)=>{this.resetLoader(e,h);let Te=ee.data;se.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Te.slice(0,16)),Te=Te.slice(16)),l({frag:e,part:null,payload:Te,networkDetails:de})},onError:(ee,X,se,de)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:n,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:se,stats:de}))},onAbort:(ee,X,se)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:se,stats:ee}))},onTimeout:(ee,X,se)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:se,stats:ee}))},onProgress:(ee,X,se,de)=>{t&&t({frag:e,part:null,payload:se,networkDetails:de})}})})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,d)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){d(Wn(e,t));return}const h=this.loader=e.loader=r?new r(i):new s(i),_=Fn(e,t),S=Ei(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$r};t.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,se,de)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const Te={frag:e,part:t,payload:ee.data,networkDetails:de};n(Te),l(Te)},onError:(ee,X,se,de)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:_.url,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:se,stats:de}))},onAbort:(ee,X,se)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:se,stats:ee}))},onTimeout:(ee,X,se)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:p.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:se,stats:ee}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const d=Math.round(e.duration/t.duration),h=Math.min(Math.round(n.loaded/r),d),S=(d-h)*Math.round(n.loaded/h);n.total=n.loaded+S}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=i.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Fn(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(G(i)&&G(r)){var s;let l=i,d=r;if(a.sn==="initSegment"&&((s=a.decryptdata)==null?void 0:s.method)==="AES-128"){const h=r-i;h%16&&(d=r+(16-h%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=d}return n}function Wn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:g.MEDIA_ERROR,details:p.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new ii(n)}class ii extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Li{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class xr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Ir(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?Q(a,0,e-t):a}class fs{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],l=n[3],d=this.invSubMix,h=d[0],_=d[1],S=d[2],U=d[3],ee=new Uint32Array(256);let X=0,se=0,de=0;for(de=0;de<256;de++)de<128?ee[de]=de<<1:ee[de]=de<<1^283;for(de=0;de<256;de++){let Te=se^se<<1^se<<2^se<<3^se<<4;Te=Te>>>8^Te&255^99,e[X]=Te,t[Te]=X;const $e=ee[X],Ue=ee[$e],at=ee[Ue];let je=ee[Te]*257^Te*16843008;i[X]=je<<24|je>>>8,r[X]=je<<16|je>>>16,s[X]=je<<8|je>>>24,l[X]=je,je=at*16843009^Ue*65537^$e*257^X*16843008,h[Te]=je<<24|je>>>8,_[Te]=je<<16|je>>>16,S[Te]=je<<8|je>>>24,U[Te]=je,X?(X=$e^ee[ee[ee[at^$e]]],se^=ee[ee[se]]):X=se=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new Li(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(E.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Kr;return n!==e.length&&(t=Q(e,0,n),this.remainderData=Q(e,n)),t}logOnce(e){this.logEnabled&&(E.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr={toString:function(a){let e="";const t=a.length;for(let n=0;nl.end){const S=s>_;(s{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state;if(this.fragContextChanged(e)){(s===vt.FRAG_LOADING||!this.fragCurrent&&s===vt.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=vt.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(u.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===vt.STOPPED||this.state===vt.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)===ai.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),d=this.backtrackFragment;((d?e.sn-d.sn:0)===1||this.reduceMaxBufferLength(l,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)===ai.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)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(u.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:r}=n,s=e.decryptdata;if(r&&r.byteLength>0&&s!=null&&s.key&&s.iv&&s.method==="AES-128"){const l=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer).catch(d=>{throw i.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_DECRYPT_ERROR,fatal:!1,error:d,reason:d.message,frag:e}),d}).then(d=>{const h=self.performance.now();return i.trigger(u.FRAG_DECRYPTED,{frag:e,payload:d,stats:{tstart:l,tdecrypt:h}}),n.payload=d,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===vt.STOPPED||this.state===vt.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=vt.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){var n,i,r,s;const l=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===$t.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${l?pr.toString(jn.getBuffered(l)):"(detached)"})`),e.sn!=="initSegment"){var d;if(e.type!==$t.SUBTITLE){const _=e.elementaryStreams;if(!Object.keys(_).some(S=>!!_[S])){this.state=vt.IDLE;return}}const h=(d=this.levels)==null?void 0:d[e.level];h!=null&&h.fragmentError&&(this.log(`Resetting level fragment error count of ${h.fragmentError} on frag buffered`),h.fragmentError=0)}this.state=vt.IDLE,l&&(!this.loadedmetadata&&e.type==$t.MAIN&&l.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((s=this.fragPrevious)==null?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(d=>!d),l=new yr(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let l=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=vt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(_=>{if(!this.fragContextChanged(_.frag))return this.hls.trigger(u.KEY_LOADED,_),this.state===vt.KEY_LOADING&&(this.state=vt.IDLE),_}),this.hls.trigger(u.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const _=s.partList;if(_&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const S=this.getNextPart(_,e,n);if(S>-1){const U=_[S];this.log(`Loading part sn: ${e.sn} p: ${U.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${S}-${_.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=U.start+U.duration,this.state=vt.FRAG_LOADING;let ee;return l?ee=l.then(X=>!X||this.fragContextChanged(X.frag)?null:this.doFragPartsLoad(e,U,t,i)).catch(X=>this.handleFragLoadError(X)):ee=this.doFragPartsLoad(e,U,t,i).catch(X=>this.handleFragLoadError(X)),this.hls.trigger(u.FRAG_LOADING,{frag:e,part:U,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):ee}else if(!e.url||this.loadedEndOfParts(_,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),G(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=vt.FRAG_LOADING;const d=this.config.progressive;let h;return d&&l?h=l.then(_=>!_||this.fragContextChanged(_==null?void 0:_.frag)?null:this.fragmentLoader.load(e,i)).catch(_=>this.handleFragLoadError(_)):h=Promise.all([this.fragmentLoader.load(e,d?i:void 0),l]).then(([_])=>(!d&&_&&i&&i(_),_)).catch(_=>this.handleFragLoadError(_)),this.hls.trigger(u.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var l;const d=[],h=(l=n.details)==null?void 0:l.partList,_=S=>{this.fragmentLoader.loadPart(e,S,i).then(U=>{d[S.index]=U;const ee=U.part;this.hls.trigger(u.FRAG_LOADED,U);const X=Di(n,e.sn,S.index+1)||Fi(h,e.sn,S.index+1);if(X)_(X);else return r({frag:e,part:ee,partsLoaded:d})}).catch(s)};_(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===p.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(u.ERROR,t)}else this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==vt.PARSING){!this.fragCurrent&&this.state!==vt.STOPPED&&this.state!==vt.ERROR&&(this.state=vt.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),this.updateLevelTiming(n,i,r,e.partial)}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 level ${i}. The current chunk will not be buffered.`),null;const l=t[i],d=s>-1?Di(l,r,s):null,h=d?d.fragment:Mi(l,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:d,level:l}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==vt.PARSING)return;const{data1:l,data2:d}=e;let h=l;if(l&&d&&(h=c(l,d)),!((s=h)!=null&&s.length))return;const _={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:h};if(this.hls.trigger(u.BUFFER_APPENDING,_),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!jn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=jn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),l=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return G(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,r=jn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&r.nextStart=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=$t.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,$t.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start;let l;if(t.live){const d=r.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,n,i,r){const s=e.gap,l=this.getNextFragment(this.nextLoadPosition,t);if(l===null)return l;if(e=l,s&&e&&!e.gap&&n.nextStart){const d=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(d!==null&&n.len+d.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),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 l=0,d=e.length;l-1&&nn.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=sr(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=sn(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:l}=n;const{fragmentHint:d}=n,{maxFragLookUpTolerance:h}=i,_=n.partList,S=!!(i.lowLatencyMode&&_!=null&&_.length&&d);S&&d&&!this.bitrateTest&&(s=s.concat(d),l=d.sn);let U;if(et-h?0:h;U=Bi(r,s,e,ee)}else U=s[s.length-1];if(U){const ee=U.sn-n.startSN,X=this.fragmentTracker.getState(U);if((X===ai.OK||X===ai.PARTIAL&&U.gap)&&(r=U),r&&U.sn===r.sn&&(!S||_[0].fragment.sn>U.sn)&&r&&U.level===r.level){const de=s[ee+1];U.sn=s-t.maxFragLookUpTolerance&&r<=l;if(i!==null&&n.duration>i&&(r${e.startSN} prev-sn: ${d?d.sn:"na"} fragments: ${i}`),h}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;if(n ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===p.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,retryCount:d=0,retryConfig:h}=s||{};if(s&&l===en.RetryRequest&&h){this.resetStartWhenNotLoaded(this.levelLastLoaded);const _=gi(h,d);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${d+1}/${h.maxNumRetry} in ${_}ms`),s.resolved=!0,this.retryDate=self.performance.now()+_,this.state=vt.FRAG_LOADING_WAITING_RETRY}else if(h&&s)if(this.resetFragmentErrors(e),d.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===$t.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==vt.STOPPED&&(this.state=vt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=jn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===vt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=vt.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${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){var r;const s=n.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((d,h)=>{const _=e.elementaryStreams[h];if(_){const S=_.endPTS-_.startPTS;if(S<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${S})`),d||!1;const U=i?0:Pi(s,e,_.startPTS,_.endPTS,_.startDTS,_.endDTS);return this.hls.trigger(u.LEVEL_PTS_UPDATED,{details:s,level:n,drift:U,type:h,frag:e,start:_.startPTS,end:_.endPTS}),!0}return d},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const d=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(d.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,error:d,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=vt.PARSED,this.hls.trigger(u.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),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}}class Gs{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=Qa(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Qa(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:on.audioId3,duration:Number.POSITIVE_INFINITY});i{if(G(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function no(a,e,t,n){let i,r,s,l;const d=navigator.userAgent.toLowerCase(),h=n,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const S=(e[t+2]&60)>>>2;if(S>_.length-1){const U=new Error(`invalid ADTS sampling index:${S}`);a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!0,error:U,reason:U.message});return}return s=(e[t+2]&1)<<2,s|=(e[t+3]&192)>>>6,E.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${S}`),/firefox/i.test(d)?S>=6?(i=5,l=new Array(4),r=S-3):(i=2,l=new Array(2),r=S):d.indexOf("android")!==-1?(i=2,l=new Array(2),r=S):(i=5,l=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&S>=6?r=S-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(S>=6&&s===1||/vivaldi/i.test(d))||!n&&s===1)&&(i=2,l=new Array(2)),r=S)),l[0]=i<<3,l[0]|=(S&14)>>1,l[1]|=(S&1)<<7,l[1]|=s<<3,i===5&&(l[1]|=(r&14)>>1,l[2]=(r&1)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:_[S],channelCount:s,codec:"mp4a.40."+i,manifestCodec:h}}function js(a,e){return a[e]===255&&(a[e+1]&246)===240}function Hs(a,e){return a[e+1]&1?7:9}function ms(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function io(a,e){return e+5=a.length)return!1;const n=ms(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Gr(a,i)}return!1}function zs(a,e,t,n,i){if(!a.samplerate){const r=no(e,t,n,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,E.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function Vs(a){return 1024*9e4/a}function ao(a,e){const t=Hs(a,e);if(e+t<=a.length){const n=ms(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ws(a,e,t,n,i){const r=Vs(a.samplerate),s=n+i*r,l=ao(e,t);let d;if(l){const{frameLength:S,headerLength:U}=l,ee=U+S,X=Math.max(0,t+ee-e.length);X?(d=new Uint8Array(ee-U),d.set(e.subarray(t+U,e.length),0)):d=e.subarray(t+U,t+ee);const se={unit:d,pts:s};return X||a.samples.push(se),{sample:se,length:ee,missing:X}}const h=e.length-t;return d=new Uint8Array(h),d.set(e.subarray(t,e.length),0),{sample:{unit:d,pts:s},length:h,missing:-1}}let jr=null;const oo=[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],lo=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],co=[0,1,1,4];function Zs(a,e,t,n,i){if(t+24>e.length)return;const r=Ys(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,l=n+i*s,d={unit:e.subarray(t,t+r.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(d),{sample:d,length:r.frameLength,missing:0}}}function Ys(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,l=a[e+3]>>6,d=t===3?3-n:n===3?3:4,h=oo[d*14+i-1]*1e3,S=lo[(t===3?0:t===2?1:2)*3+r],U=l===3?1:2,ee=uo[t][n],X=co[n],se=ee*8*X,de=Math.floor(ee*h/S+s)*X;if(jr===null){const Ue=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);jr=Ue?parseInt(Ue[1]):0}return!!jr&&jr<=87&&n===2&&h>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:S,channelCount:U,frameLength:de,samplesPerFrame:se}}}function gs(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Xs(a,e){return e+1{const s=Ae(r);if(po.test(s.schemeIdUri)){const l=G(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale;let d=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;d<=.001&&(d=Number.POSITIVE_INFINITY);const h=s.payload;n.samples.push({data:h,len:h.byteLength,dts:l,pts:l,type:on.emsg,duration:d})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const Js=(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 l=Math.min(n,8),d=8-l;r[0]=4278190080>>>24+d<>d,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const l=[48e3,44100,32e3][r],d=e[t+4]&63,_=[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][d*3+r]*2;if(t+_>e.length)return-1;const S=e[t+6]>>5;let U=0;S===2?U+=2:(S&1&&S!==1&&(U+=2),S&4&&(U+=2));const ee=(e[t+6]<<8|e[t+7])>>12-U&1,se=[2,1,2,3,3,4,4,5][S]+ee,de=e[t+5]>>3,Te=e[t+5]&7,$e=new Uint8Array([r<<6|de<<1|Te>>2,(Te&3)<<6|S<<3|ee<<2|d>>4,d<<4&224]),Ue=1536/l*9e4,at=n+i*Ue,je=e.subarray(t,t+_);return a.config=$e,a.channelCount=se,a.samplerate=l,a.samples.push({unit:je,pts:at}),_}class _o{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,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)}e.debug.length&&E.log(e.pts+"/"+e.dts+":"+e.debug)}}class ea{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&&E.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<>>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)}skipScalingList(e){let t=8,n=8,i;for(let r=0;r{var S;switch(_.type){case 1:{let se=!1;d=!0;const de=_.data;if(h&&de.length>4){const Te=new ea(de).readSliceType();(Te===2||Te===4||Te===7||Te===9)&&(se=!0)}if(se){var U;(U=l)!=null&&U.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null)}l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.frame=!0,l.key=se;break}case 5:d=!0,(S=l)!=null&&S.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.key=!0,l.frame=!0;break;case 6:{d=!0,ie(_.data,1,n.pts,t.samples);break}case 7:{var ee,X;d=!0,h=!0;const se=_.data,Te=new ea(se).readSPS();if(!e.sps||e.width!==Te.width||e.height!==Te.height||((ee=e.pixelRatio)==null?void 0:ee[0])!==Te.pixelRatio[0]||((X=e.pixelRatio)==null?void 0:X[1])!==Te.pixelRatio[1]){e.width=Te.width,e.height=Te.height,e.pixelRatio=Te.pixelRatio,e.sps=[se],e.duration=r;const $e=se.subarray(1,4);let Ue="avc1.";for(let at=0;at<3;at++){let je=$e[at].toString(16);je.length<2&&(je="0"+je),Ue+=je}e.codec=Ue}break}case 8:d=!0,e.pps=[_.data];break;case 9:d=!0,e.audFound=!0,l&&this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:d=!0;break;default:d=!1,l&&(l.debug+="unknown NAL "+_.type+" ");break}l&&d&&l.units.push(_)}),i&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const r=i,s=[];let l=0,d,h,_,S=-1,U=0;for(i===-1&&(S=0,U=t[0]&31,i=0,l=1);l=0){const ee={data:t.subarray(S,h),type:U};s.push(ee)}else{const ee=this.getLastNalUnit(e.samples);ee&&(r&&l<=4-r&&ee.state&&(ee.data=ee.data.subarray(0,ee.data.byteLength-r)),h>0&&(ee.data=c(ee.data,t.subarray(0,h)),ee.state=0))}l=0&&i>=0){const ee={data:t.subarray(S,n),type:U,state:i};s.push(ee)}if(s.length===0){const ee=this.getLastNalUnit(e.samples);ee&&(ee.data=c(ee.data,t))}return e.naluState=i,s}}class yo{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Sr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}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(l=>{const d=new Uint8Array(l);i.set(d,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{r.data=this.getAvcDecryptedUnit(s,d),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}}}}const _i=188;class ur{constructor(e,t,n){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._duration=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.videoParser=new vo}static probe(e){const t=ur.syncOffset(e);return t>0&&E.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(_i*5,t-_i)+1,i=0;for(;i1&&(s===0&&l>2||d+_i>n))return s}else{if(l)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ut[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=ur.createTrack("video"),this._audioTrack=ur.createTrack("audio",i),this._id3Track=ur.createTrack("id3"),this._txtTrack=ur.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}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,l=this._audioTrack,d=this._id3Track,h=this._txtTrack;let _=s.pid,S=s.pesData,U=l.pid,ee=d.pid,X=l.pesData,se=d.pesData,de=null,Te=this.pmtParsed,$e=this._pmtId,Ue=e.length;if(this.remainderData&&(e=c(this.remainderData,e),Ue=e.length,this.remainderData=null),Ue<_i&&!i)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};const at=Math.max(0,ur.syncOffset(e));Ue-=(Ue-at)%_i,Ue>4;let Nt;if(gt>1){if(Nt=it+5+e[it+4],Nt===it+_i)continue}else Nt=it+4;switch(Yt){case _:Pt&&(S&&(r=wr(S))&&this.videoParser.parseAVCPES(s,h,r,!1,this._duration),S={data:[],size:0}),S&&(S.data.push(e.subarray(Nt,it+_i)),S.size+=it+_i-Nt);break;case U:if(Pt){if(X&&(r=wr(X)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r);break}X={data:[],size:0}}X&&(X.data.push(e.subarray(Nt,it+_i)),X.size+=it+_i-Nt);break;case ee:Pt&&(se&&(r=wr(se))&&this.parseID3PES(d,r),se={data:[],size:0}),se&&(se.data.push(e.subarray(Nt,it+_i)),se.size+=it+_i-Nt);break;case 0:Pt&&(Nt+=e[Nt]+1),$e=this._pmtId=Eo(e,Nt);break;case $e:{Pt&&(Nt+=e[Nt]+1);const Sn=bo(e,Nt,this.typeSupported,n,this.observer);_=Sn.videoPid,_>0&&(s.pid=_,s.segmentCodec=Sn.segmentVideoCodec),U=Sn.audioPid,U>0&&(l.pid=U,l.segmentCodec=Sn.segmentAudioCodec),ee=Sn.id3Pid,ee>0&&(d.pid=ee),de!==null&&!Te&&(E.warn(`MPEG-TS PMT found at ${it} after unknown PID '${de}'. Backtracking to sync byte @${at} to parse all TS packets.`),de=null,it=at-188),Te=this.pmtParsed=!0;break}case 17:case 8191:break;default:de=Yt;break}}else je++;je>0&&Hr(this.observer,new Error(`Found ${je} TS packet/s that do not start with 0x47`)),s.pesData=S,l.pesData=X,d.pesData=se;const bt={audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};return i&&this.extractRemainingSamples(bt),bt}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,l=t.pesData,d=i.pesData;let h;if(s&&(h=wr(s))?(this.videoParser.parseAVCPES(n,r,h,!0,this._duration),n.pesData=null):n.pesData=s,l&&(h=wr(l))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,h);break;case"mp3":this.parseMPEGPES(t,h);break;case"ac3":this.parseAC3PES(t,h);break}t.pesData=null}else l!=null&&l.size&&E.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;d&&(h=wr(d))?(this.parseID3PES(i,h),i.pesData=null):i.pesData=d}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new yo(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._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const S=i.missing,U=i.sample.unit.byteLength;if(S===-1)r=c(i.sample.unit,r);else{const ee=U-S;i.sample.unit.set(r.subarray(0,S),ee),e.samples.push(i.sample),n=i.missing}}let s,l;for(s=n,l=r.length;s0;)l+=d}}parseID3PES(e,t){if(t.pts===void 0){E.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=o({},t,{type:this._videoTrack?on.emsg:on.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function _s(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Eo(a,e){return(a[e+10]&31)<<8|a[e+11]}function bo(a,e,t,n,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=(a[e+1]&15)<<8|a[e+2],l=e+3+s-4,d=(a[e+10]&15)<<8|a[e+11];for(e+=12+d;e0){let S=e+5,U=_;for(;U>2;){switch(a[S]){case 106:t.ac3!==!0?E.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=h,r.segmentAudioCodec="ac3");break}const X=a[S+1]+2;S+=X,U-=X}}break;case 194:case 135:return Hr(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return Hr(i,new Error("Unsupported HEVC in M2TS found")),r}e+=_+5}return r}function Hr(a,e,t){E.warn(`parsing error: ${e.message}`),a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function vs(a){E.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function wr(a){let e=0,t,n,i,r,s;const l=a.data;if(!a||a.size===0)return null;for(;l[0].length<19&&l.length>1;)l[0]=c(l[0],l[1]),l.splice(1,1);if(t=l[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>a.size-6)return null;const h=t[7];h&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,h&64?(s=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-s>60*9e4&&(E.warn(`${Math.round((r-s)/9e4)}s delta between PTS and DTS, align them`),r=s)):s=r),i=t[8];let _=i+9;if(a.size<=_)return null;a.size-=_;const S=new Uint8Array(a.size);for(let U=0,ee=l.length;UX){_-=X;continue}else t=t.subarray(_),X-=_,_=0;S.set(t,e),e+=X}return n&&(n-=i+3),{data:S,pts:r,dts:s,len:n}}return null}class xo extends ps{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=M(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&B(t)!==void 0&&Js(e,n)<=16)return!1;for(let i=e.length;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>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 ze.box(ze.types.mdia,ze.mdhd(e.timescale,e.duration),ze.hdlr(e.type),ze.minf(e))}static mfhd(e){return ze.box(ze.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"?ze.box(ze.types.minf,ze.box(ze.types.smhd,ze.SMHD),ze.DINF,ze.stbl(e)):ze.box(ze.types.minf,ze.box(ze.types.vmhd,ze.VMHD),ze.DINF,ze.stbl(e))}static moof(e,t,n){return ze.box(ze.types.moof,ze.mfhd(e),ze.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=ze.trak(e[t]);return ze.box.apply(null,[ze.types.moov,ze.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(ze.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=ze.trex(e[t]);return ze.box.apply(null,[ze.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+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 ze.box(ze.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const l=ze.box(ze.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),d=e.width,h=e.height,_=e.pixelRatio[0],S=e.pixelRatio[1];return ze.box(ze.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,d>>8&255,d&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]),l,ze.box(ze.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ze.box(ze.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,S>>24,S>>16&255,S>>8&255,S&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return ze.box(ze.types.mp4a,ze.audioStsd(e),ze.box(ze.types.esds,ze.esds(e)))}static mp3(e){return ze.box(ze.types[".mp3"],ze.audioStsd(e))}static ac3(e){return ze.box(ze.types["ac-3"],ze.audioStsd(e),ze.box(ze.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?ze.box(ze.types.stsd,ze.STSD,ze.mp3(e)):e.segmentCodec==="ac3"?ze.box(ze.types.stsd,ze.STSD,ze.ac3(e)):ze.box(ze.types.stsd,ze.STSD,ze.mp4a(e)):ze.box(ze.types.stsd,ze.STSD,ze.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,r=e.height,s=Math.floor(n/(cr+1)),l=Math.floor(n%(cr+1));return ze.box(ze.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,l>>24,l>>16&255,l>>8&255,l&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=ze.sdtp(e),i=e.id,r=Math.floor(t/(cr+1)),s=Math.floor(t%(cr+1));return ze.box(ze.types.traf,ze.box(ze.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),ze.box(ze.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])),ze.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,ze.box(ze.types.trak,ze.tkhd(e),ze.mdia(e))}static trex(e){const t=e.id;return ze.box(ze.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 l,d,h,_,S,U;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),l=0;l>>24&255,h>>>16&255,h>>>8&255,h&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.paddingValue<<1|S.isNonSync,S.degradPrio&61440,S.degradPrio&15,U>>>24&255,U>>>16&255,U>>>8&255,U&255],12+16*l);return ze.box(ze.types.trun,s)}static initSegment(e){ze.types||ze.init();const t=ze.moov(e);return c(ze.FTYP,t)}}ze.types=void 0,ze.HDLR_TYPES=void 0,ze.STTS=void 0,ze.STSC=void 0,ze.STCO=void 0,ze.STSZ=void 0,ze.VMHD=void 0,ze.SMHD=void 0,ze.STSD=void 0,ze.FTYP=void 0,ze.DINF=void 0;const na=9e4;function ys(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function So(a,e,t=1,n=!1){return ys(a,e,1/t,n)}function Or(a,e=!1){return ys(a,1e3,1/na,e)}function wo(a,e=1){return ys(a,na,1/e)}const To=10*1e3,ia=1024,Ro=1152,Ao=1536;let Tr=null,Es=null;class zr{constructor(e,t,n,i=""){if(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.ISGenerated=!1,Tr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Tr=s?parseInt(s[1]):0}if(Es===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Es=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){E.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){E.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){E.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 l=s.pts,d=l-r;return d<-4294967296&&(t=!0,l=$i(l,n),d=l-r),d>0?r:l},n);return t&&E.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,l,d){let h,_,S,U,ee,X,se=r,de=r;const Te=e.pid>-1,$e=t.pid>-1,Ue=t.samples.length,at=e.samples.length>0,je=l&&Ue>0||Ue>1;if((!Te||at)&&(!$e||je)||this.ISGenerated||l){if(this.ISGenerated){var it,Pt,Yt,gt;const bn=this.videoTrackConfig;bn&&(t.width!==bn.width||t.height!==bn.height||((it=t.pixelRatio)==null?void 0:it[0])!==((Pt=bn.pixelRatio)==null?void 0:Pt[0])||((Yt=t.pixelRatio)==null?void 0:Yt[1])!==((gt=bn.pixelRatio)==null?void 0:gt[1]))&&this.resetInitSegment()}else S=this.generateIS(e,t,r,s);const Nt=this.isVideoContiguous;let Sn=-1,tn;if(je&&(Sn=Lo(t.samples),!Nt&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Sn>0){E.warn(`[mp4-remuxer]: Dropped ${Sn} out of ${Ue} video samples due to a missing keyframe`);const bn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Sn),t.dropped+=Sn,de+=(t.samples[0].pts-bn)/t.inputTimeScale,tn=de}else Sn===-1&&(E.warn(`[mp4-remuxer]: No keyframe found out of ${Ue} video samples`),X=!1);if(this.ISGenerated){if(at&&je){const bn=this.getVideoStartPts(t.samples),mn=($i(e.samples[0].pts,bn)-bn)/t.inputTimeScale;se+=Math.max(0,mn),de+=Math.max(0,-mn)}if(at){if(e.samplerate||(E.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(e,t,r,s)),_=this.remuxAudio(e,se,this.isAudioContiguous,s,$e||je||d===$t.AUDIO?de:void 0),je){const bn=_?_.endPTS-_.startPTS:0;t.inputTimeScale||(E.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(e,t,r,s)),h=this.remuxVideo(t,de,Nt,bn)}}else je&&(h=this.remuxVideo(t,de,Nt,0));h&&(h.firstKeyFrame=Sn,h.independent=Sn!==-1,h.firstKeyFramePTS=tn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(ee=ra(n,r,this._initPTS,this._initDTS)),i.samples.length&&(U=sa(i,r,this._initPTS))),{audio:_,video:h,initSegment:S,independent:X,text:U,id3:ee}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,l=this.typeSupported,d={},h=this._initPTS;let _=!h||i,S="audio/mp4",U,ee,X;if(_&&(U=ee=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(S="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}d.audio={id:"audio",container:S,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):ze.initSegment([e]),metadata:{channelCount:e.channelCount}},_&&(X=e.inputTimeScale,!h||X!==h.timescale?U=ee=r[0].pts-Math.round(X*n):_=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ze.initSegment([t]),metadata:{width:t.width,height:t.height}},_)if(X=t.inputTimeScale,!h||X!==h.timescale){const se=this.getVideoStartPts(s),de=Math.round(X*n);ee=Math.min(ee,$i(s[0].dts,se)-de),U=Math.min(U,se-de)}else _=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(d).length)return this.ISGenerated=!0,_?(this._initPTS={baseTime:U,timescale:X},this._initDTS={baseTime:ee,timescale:X}):U=X=void 0,{tracks:d,initPTS:U,timescale:X}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,l=[],d=s.length,h=this._initPTS;let _=this.nextAvcDts,S=8,U=this.videoSampleDuration,ee,X,se=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,Te=!1;if(!n||_===null){const ln=t*r,nn=s[0].pts-$i(s[0].dts,s[0].pts);Tr&&_!==null&&Math.abs(ln-nn-_)<15e3?n=!0:_=ln-nn}const $e=h.baseTime*r/h.timescale;for(let ln=0;ln0?ln-1:ln].dts&&(Te=!0)}Te&&s.sort(function(ln,nn){const Bn=ln.dts-nn.dts,Rn=ln.pts-nn.pts;return Bn||Rn}),ee=s[0].dts,X=s[s.length-1].dts;const Ue=X-ee,at=Ue?Math.round(Ue/(d-1)):U||e.inputTimeScale/30;if(n){const ln=ee-_,nn=ln>at,Bn=ln<-1;if((nn||Bn)&&(nn?E.warn(`AVC: ${Or(ln,!0)} ms (${ln}dts) hole between fragments detected at ${t.toFixed(3)}`):E.warn(`AVC: ${Or(-ln,!0)} ms (${ln}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Bn||_>=s[0].pts||Tr)){ee=_;const Rn=s[0].pts-ln;if(nn)s[0].dts=ee,s[0].pts=Rn;else for(let $n=0;$nRn);$n++)s[$n].dts-=ln,s[$n].pts-=ln;E.log(`Video: Initial PTS/DTS adjusted: ${Or(Rn,!0)}/${Or(ee,!0)}, delta: ${Or(ln,!0)} ms`)}}ee=Math.max(0,ee);let je=0,bt=0,it=ee;for(let ln=0;ln0?nn.dts-s[ln-1].dts:at;if($n=ln>0?nn.pts-s[ln-1].pts:at,vi.stretchShortVideoTrack&&this.nextAudioPts!==null){const Gi=Math.floor(vi.maxBufferHole*r),Pr=(i?se+i*r:this.nextAudioPts)-nn.pts;Pr>Gi?(U=Pr-xi,U<0?U=xi:Nt=!0,E.log(`[mp4-remuxer]: It is approximately ${Pr/90} ms to the next segment; using duration ${U/90} ms for the last video frame.`)):U=xi}else U=xi}const ci=Math.round(nn.pts-nn.dts);Sn=Math.min(Sn,U),bn=Math.max(bn,U),tn=Math.min(tn,$n),vn=Math.max(vn,$n),l.push(new aa(nn.key,U,Rn,ci))}if(l.length){if(Tr){if(Tr<70){const ln=l[0].flags;ln.dependsOn=2,ln.isNonSync=0}}else if(Es&&vn-tn0&&(i&&Math.abs($e-Te)<9e3||Math.abs($i(se[0].pts-Ue,$e)-Te)<20*_),se.forEach(function(mn){mn.pts=$i(mn.pts-Ue,$e)}),!n||Te<0){if(se=se.filter(mn=>mn.pts>=0),!se.length)return;r===0?Te=0:i&&!X?Te=Math.max(0,$e):Te=se[0].pts}if(e.segmentCodec==="aac"){const mn=this.config.maxAudioFramesDrift;for(let Mn=0,Hn=Te;Mn=mn*_&&Rn0){it+=de;try{bt=new Uint8Array(it)}catch(Rn){this.observer.emit(u.ERROR,u.ERROR,{type:g.MUX_ERROR,details:p.REMUX_ALLOC_ERROR,fatal:!1,error:Rn,bytes:it,reason:`fail allocating audio mdat ${it}`});return}U||(new DataView(bt.buffer).setUint32(0,it),bt.set(ze.types.mdat,4))}else return;bt.set(ln,de);const Bn=ln.byteLength;de+=Bn,ee.push(new aa(!0,h,Bn,0)),je=nn}const Yt=ee.length;if(!Yt)return;const gt=ee[ee.length-1];this.nextAudioPts=Te=je+d*gt.duration;const Nt=U?new Uint8Array(0):ze.moof(e.sequenceNumber++,at/d,o({},e,{samples:ee}));e.samples=[];const Sn=at/s,tn=Te/s,vn={data1:Nt,data2:bt,startPTS:Sn,endPTS:tn,startDTS:Sn,endDTS:tn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Yt};return this.isAudioContiguous=!0,vn}remuxEmptyAudio(e,t,n,i){const r=e.inputTimeScale,s=e.samplerate?e.samplerate:r,l=r/s,d=this.nextAudioPts,h=this._initDTS,_=h.baseTime*9e4/h.timescale,S=(d!==null?d:i.startDTS*r)+_,U=i.endDTS*r+_,ee=l*ia,X=Math.ceil((U-S)/ee),se=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(E.warn("[mp4-remuxer]: remux empty Audio"),!se){E.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const de=[];for(let Te=0;Te4294967296;)a+=t;return a}function Lo(a){for(let e=0;es.pts-l.pts);const r=a.samples;return a.samples=[],{samples:r}}class aa{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class Co{constructor(){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}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(an(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=mt(e);i.audio&&(t=oa(i.audio,V.AUDIO)),i.video&&(n=oa(i.video,V.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,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,initSegment:e,id:"main"}:E.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var l,d;let{initPTS:h,lastEndTime:_}=this;const S={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};G(_)||(_=this.lastEndTime=r||0);const U=t.samples;if(!(U!=null&&U.length))return S;const ee={initPTS:void 0,timescale:1};let X=this.initData;if((l=X)!=null&&l.length||(this.generateInitSegment(U),X=this.initData),!((d=X)!=null&&d.length))return E.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(ee.tracks=this.initTracks,this.emitInitSegment=!1);const se=Ht(U,X),de=cn(X,U),Te=de===null?r:de;(Io(h,Te,r,se)||ee.timescale!==h.timescale&&s)&&(ee.initPTS=Te-r,h&&h.timescale===1&&E.warn(`Adjusting initPTS by ${ee.initPTS-h.baseTime}`),this.initPTS=h={baseTime:ee.initPTS,timescale:1});const $e=e?Te-h.baseTime/h.timescale:_,Ue=$e+se;_t(X,U,h.baseTime/h.timescale),se>0?this.lastEndTime=Ue:(E.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const at=!!X.audio,je=!!X.video;let bt="";at&&(bt+="audio"),je&&(bt+="video");const it={data1:U,startPTS:$e,startDTS:$e,endPTS:Ue,endDTS:Ue,type:bt,hasAudio:at,hasVideo:je,nb:1,dropped:0};return S.audio=it.type==="audio"?it:void 0,S.video=it.type!=="audio"?it:void 0,S.initSegment=ee,S.id3=ra(n,r,h,h),i.samples.length&&(S.text=sa(i,r,h)),S}}function Io(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 oa(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===V.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return zt(t,!1);const n="mp4a.40.5";return E.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return E.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let ir;try{ir=self.performance.now.bind(self.performance)}catch(a){E.debug("Unable to use Performance API on this environment"),ir=xe==null?void 0:xe.Date.now}const Vr=[{demux:mo,remux:Co},{demux:ur,remux:zr},{demux:fo,remux:zr},{demux:xo,remux:zr}];Vr.splice(2,0,{demux:go,remux:zr});class la{constructor(e,t,n,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=ir();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:d}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:_,trackSwitch:S,accurateTimeOffset:U,timeOffset:ee,initSegmentChange:X}=i||l,{audioCodec:se,videoCodec:de,defaultInitPts:Te,duration:$e,initSegmentData:Ue}=d,at=Do(s,t);if(at&&at.method==="AES-128"){const Pt=this.getDecrypter();if(Pt.isSync()){let Yt=Pt.softwareDecrypt(s,at.key.buffer,at.iv.buffer);if(n.part>-1&&(Yt=Pt.flush()),!Yt)return r.executeEnd=ir(),bs(n);s=new Uint8Array(Yt)}else return this.decryptionPromise=Pt.webCryptoDecrypt(s,at.key.buffer,at.iv.buffer).then(Yt=>{const gt=this.push(Yt,null,n);return this.decryptionPromise=null,gt}),this.decryptionPromise}const je=this.needsProbing(_,S);if(je){const Pt=this.configureTransmuxer(s);if(Pt)return E.warn(`[transmuxer] ${Pt.message}`),this.observer.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,fatal:!1,error:Pt,reason:Pt.message}),r.executeEnd=ir(),bs(n)}(_||S||X||je)&&this.resetInitSegment(Ue,se,de,$e,t),(_||X||je)&&this.resetInitialTimestamp(Te),h||this.resetContiguity();const bt=this.transmux(s,at,ee,U,n),it=this.currentTransmuxState;return it.contiguous=!0,it.discontinuity=!1,it.trackSwitch=!1,r.executeEnd=ir(),bt}flush(e){const t=e.transmuxing;t.executeStart=ir();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const s=[],{timeOffset:l}=i;if(n){const S=n.flush();S&&s.push(this.push(S,null,e))}const{demuxer:d,remuxer:h}=this;if(!d||!h)return t.executeEnd=ir(),[bs(e)];const _=d.flush(l);return Wr(_)?_.then(S=>(this.flushRemux(s,S,e),s)):(this.flushRemux(s,_,e),s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:l}=t,{accurateTimeOffset:d,timeOffset:h}=this.currentTransmuxState;E.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const _=this.remuxer.remux(i,r,s,l,h,d,!0,this.id);e.push({remuxResult:_,chunkMeta:n}),n.transmuxing.executeEnd=ir()}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:l}=this;!s||!l||(s.resetInitSegment(e,t,n,i),l.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:l,textTrack:d}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,l,d,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,vendor:r}=this;let s;for(let U=0,ee=Vr.length;U0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const bs=a=>({remuxResult:{},chunkMeta:a});function Wr(a){return"then"in a&&a.then instanceof Function}class Oo{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 ko{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}}var ua={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(d,h,_){this.fn=d,this.context=h,this.once=_||!1}function r(d,h,_,S,U){if(typeof _!="function")throw new TypeError("The listener must be a function");var ee=new i(_,S||d,U),X=t?t+h:h;return d._events[X]?d._events[X].fn?d._events[X]=[d._events[X],ee]:d._events[X].push(ee):(d._events[X]=ee,d._eventsCount++),d}function s(d,h){--d._eventsCount===0?d._events=new n:delete d._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],_,S;if(this._eventsCount===0)return h;for(S in _=this._events)e.call(_,S)&&h.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(_)):h},l.prototype.listeners=function(h){var _=t?t+h:h,S=this._events[_];if(!S)return[];if(S.fn)return[S.fn];for(var U=0,ee=S.length,X=new Array(ee);U{_=_||{},_.frag=this.frag,_.id=this.id,h===u.ERROR&&(this.error=_.error),this.hls.trigger(h,_)};this.observer=new xs,this.observer.on(u.FRAG_DECRYPTED,s),this.observer.on(u.ERROR,s);const l=dn(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},d={mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:l.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker!="undefined"&&(r.workerPath||Ja())){try{r.workerPath?(E.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=eo(r.workerPath)):(E.log(`injecting Web Worker for "${t}"`),this.workerContext=qa()),this.onwmsg=S=>this.onWorkerMessage(S);const{worker:_}=this.workerContext;_.addEventListener("message",this.onwmsg),_.onerror=S=>{const U=new Error(`${S.message} (${S.filename}:${S.lineno})`);r.enableWorker=!1,E.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:U})},_.postMessage({cmd:"init",typeSupported:d,vendor:"",id:t,config:JSON.stringify(r)})}catch(_){E.warn(`Error setting up "${t}" Web Worker, fallback to inline`,_),this.resetWorker(),this.error=null,this.transmuxer=new la(this.observer,d,r,"",t)}return}this.transmuxer=new la(this.observer,d,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,l,d,h,_){var S,U;h.transmuxing.start=self.performance.now();const{transmuxer:ee}=this,X=s?s.start:r.start,se=r.decryptdata,de=this.frag,Te=!(de&&r.cc===de.cc),$e=!(de&&h.level===de.level),Ue=de?h.sn-de.sn:-1,at=this.part?h.part-this.part.index:-1,je=Ue===0&&h.id>1&&h.id===(de==null?void 0:de.stats.chunkCount),bt=!$e&&(Ue===1||Ue===0&&(at===1||je&&at<=0)),it=self.performance.now();($e||Ue||r.stats.parsing.start===0)&&(r.stats.parsing.start=it),s&&(at||!bt)&&(s.stats.parsing.start=it);const Pt=!(de&&((S=r.initSegment)==null?void 0:S.url)===((U=de.initSegment)==null?void 0:U.url)),Yt=new ko(Te,bt,d,$e,X,Pt);if(!bt||Te||Pt){E.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${h.sn} p: ${h.part} level: ${h.level} id: ${h.id} discontinuity: ${Te} trackSwitch: ${$e} contiguous: ${bt} accurateTimeOffset: ${d} timeOffset: ${X} initSegmentChange: ${Pt}`);const gt=new Oo(n,i,t,l,_);this.configureTransmuxer(gt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:se,chunkMeta:h,state:Yt},e instanceof ArrayBuffer?[e]:[]);else if(ee){const gt=ee.push(e,se,h,Yt);Wr(gt)?(ee.async=!0,gt.then(Nt=>{this.handleTransmuxComplete(Nt)}).catch(Nt=>{this.transmuxerError(Nt,h,"transmuxer-interface push error")})):(ee.async=!1,this.handleTransmuxComplete(gt))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);Wr(n)||t.async?(Wr(n)||(n=Promise.resolve(n)),n.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){E.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":E[t.data.logType]&&E[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const da=100;class No extends Dr{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",$t.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-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.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.ERROR,this.onError,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n==="main"){const s=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}`),this.videoTrackCC=s,this.state===vt.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=vt.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(da),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=vt.IDLE):(this.loadedmetadata=!1,this.state=vt.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case vt.IDLE:this.doTickIdle();break;case vt.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,r=n==null||(e=n[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=vt.WAITING_INIT_PTS}break}case vt.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[s])||null),this.state=vt.IDLE}break}case vt.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:r,cache:s,complete:l}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=vt.FRAG_LOADING;const d=s.flush(),h={frag:i,part:r,payload:d,networkDetails:null};this._handleFragmentLoadProgress(h),l&&super._handleFragmentLoadComplete(h)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const d=this.getLoadPosition(),h=jn.bufferInfo(this.mediaBuffer,d,this.config.maxBufferHole);Wi(h.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${h.end} is needed`),this.clearWaitingFragment())}}else this.state=vt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=vt.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,r=e.config;if(!this.buffering||!n&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const s=t[i],l=s.details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l)){this.state=vt.WAITING_TRACK;return}const d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,V.AUDIO,$t.AUDIO));const h=this.getFwdBufferInfo(d,$t.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,l)){e.trigger(u.BUFFER_EOS,{type:"audio"}),this.state=vt.ENDED;return}const _=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,$t.MAIN),S=h.len,U=this.getMaxBufferLength(_==null?void 0:_.len),ee=l.fragments,X=ee[0].start,se=this.getLoadPosition(),de=this.flushing?se:h.end;if(this.switchingTrack&&n){const at=se;l.PTSKnown&&atX||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=X+.05)}if(S>=U&&!this.switchingTrack&&de_.end+l.targetduration;if(Ue||!(_!=null&&_.len)&&h.len){const at=this.getAppendedFrag(Te.start,$t.MAIN);if(at===null||($e||($e=!!at.gap||!!Ue&&_.len===0),Ue&&!$e||$e&&h.nextStart&&h.nextStartnew mi(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.setInterval(da):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=vt.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=vt.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(u.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:s}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${s}`);return}this.log(`Audio track ${s} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const l=i[s];let d=0;if(r.live||(n=l.details)!=null&&n.live){this.checkLiveUpdate(r);const _=this.mainDetails;if(r.deltaUpdateFailed||!_)return;if(!l.details&&r.hasProgramDateTime&&_.hasProgramDateTime)br(r,_),d=r.fragments[0].start;else{var h;d=this.alignPlaylists(r,l.details,(h=this.levelLastLoaded)==null?void 0:h.details)}}l.details=r,this.levelLastLoaded=l,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,d),this.state===vt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=vt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:r}=e,{config:s,trackId:l,levels:d}=this;if(!d){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 h=d[l];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const _=h.details;if(!_){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const S=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let U=this.transmuxer;U||(U=this.transmuxer=new ca(this.hls,$t.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const ee=this.initPTS[n.cc],X=(t=n.initSegment)==null?void 0:t.data;if(ee!==void 0){const de=i?i.index:-1,Te=de!==-1,$e=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,de,Te);U.push(r,X,S,"",n,i,_.totalduration,!1,$e,ee)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${_.startSN} ,${_.endSN}],track ${l}`);const{cache:se}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Gs,complete:!1};se.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=vt.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==$t.AUDIO){if(!this.loadedmetadata&&n.type===$t.MAIN){const r=this.videoBuffer||this.media;r&&jn.getBuffered(r).length&&(this.loadedmetadata=!0)}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(n.sn!=="initSegment"){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(u.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case p.FRAG_GAP:case p.FRAG_PARSING_ERROR:case p.FRAG_DECRYPT_ERROR:case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($t.AUDIO,t);break;case p.AUDIO_TRACK_LOAD_ERROR:case p.AUDIO_TRACK_LOAD_TIMEOUT:case p.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===fn.AUDIO_TRACK&&(this.state=vt.IDLE);break;case p.BUFFER_APPEND_ERROR:case p.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===p.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case p.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==V.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==V.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===vt.ENDED&&(this.state=vt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,$t.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{details:S}=_,{audio:U,text:ee,id3:X,initSegment:se}=r;if(this.fragContextChanged(d)||!S){this.fragmentTracker.removeFragment(d);return}if(this.state=vt.PARSING,this.switchingTrack&&U&&this.completeAudioSwitch(this.switchingTrack),se!=null&&se.tracks){const de=d.initSegment||d;this._bufferInitSegment(_,se.tracks,de,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:de,id:n,tracks:se.tracks})}if(U){const{startPTS:de,endPTS:Te,startDTS:$e,endDTS:Ue}=U;h&&(h.elementaryStreams[V.AUDIO]={startPTS:de,endPTS:Te,startDTS:$e,endDTS:Ue}),d.setElementaryStreamInfo(V.AUDIO,de,Te,$e,Ue),this.bufferFragmentData(U,d,h,s)}if(X!=null&&(t=X.samples)!=null&&t.length){const de=o({id:n,frag:d,details:S},X);i.trigger(u.FRAG_PARSING_METADATA,de)}if(ee){const de=o({id:n,frag:d,details:S},ee);i.trigger(u.FRAG_PARSING_USERDATA,de)}}_bufferInitSegment(e,t,n,i){if(this.state!==vt.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="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(u.BUFFER_CODECS,t);const l=r.initSegment;if(l!=null&&l.byteLength){const d={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(u.BUFFER_APPENDING,d)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ai.NOT_LOADED||i===ai.PARTIAL){var r;if(e.sn==="initSegment")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=vt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragments[0].start!==t.details.fragments[0].start&&br(t.details,s)}else this.startFragRequested=!0,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:l}=this.bufferedTrack;Yi({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:l},e,Xi)||(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(u.AUDIO_TRACK_SWITCHED,oe({},e))}}function ha(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function Ss(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Mo extends kn{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.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 l=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,l)}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(l=>(i==null?void 0:i.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(U=>!n||n.indexOf(U.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(U=>U.default)&&(this.selectDefaultTrack=!1),l.forEach((U,ee)=>{U.id=ee});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const d=this.hls.config.audioPreference;if(!r&&d){const U=Ui(d,l,Xi);if(U>-1)r=l[U];else{const ee=Ui(d,this.tracks);r=this.tracks[ee]}}let h=this.findTrackId(r);h===-1&&r&&(h=this.findTrackId(null));const _={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(u.AUDIO_TRACKS_UPDATED,_);const S=this.trackId;if(h!==-1&&S===-1)this.setAudioTrack(h);else if(l.length&&S===-1){var s;const U=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(U.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:U})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===fn.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-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&&Yi(e,i,Xi))return i;const r=Ui(e,this.tracksInGroup,Xi);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 l=ss(e,t.levels,n,s,Xi);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=Ui(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.clearTimer(),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(u.AUDIO_TRACK_SWITCHING,oe({},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=r[h].start&&l<=r[h].end){s=r[h];break}const d=n.start+n.duration;s?s.end=d:(s={start:l,end:d},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}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 l=0;lnew mi(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new mi(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,$t.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.setInterval(fa)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:l}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const d=r[l];if(l>=r.length||!d)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let h=0;if(s.live||(n=d.details)!=null&&n.live){const S=this.mainDetails;if(s.deltaUpdateFailed||!S)return;const U=S.fragments[0];if(!d.details)s.hasProgramDateTime&&S.hasProgramDateTime?(br(s,S),h=s.fragments[0].start):U&&(h=U.start,Ii(s,h));else{var _;h=this.alignPlaylists(s,d.details,(_=this.levelLastLoaded)==null?void 0:_.details),h===0&&U&&(h=U.start,Ii(s,h))}}d.details=s,this.levelLastLoaded=d,l===i&&(!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,h),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===vt.IDLE&&(Bi(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.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&&i.method==="AES-128"){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(l=>{throw r.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const d=performance.now();r.trigger(u.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:d}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=vt.IDLE})}}doTick(){if(!this.media){this.state=vt.IDLE;return}if(this.state===vt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,r=this.getLoadPosition(),s=jn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:l,len:d}=s,h=this.getFwdBufferInfo(this.media,$t.MAIN),_=n.details,S=this.getMaxBufferLength(h==null?void 0:h.len)+_.levelTargetDuration;if(d>S)return;const U=_.fragments,ee=U.length,X=_.edge;let se=null;const de=this.fragPrevious;if(lX-Te?0:Te;se=Bi(de,U,Math.max(U[0].start,l),$e),!se&&de&&de.start{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)}}}}class Uo extends kn{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.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Ot(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.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(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Ot(this.media.textTracks).forEach(t=>{Qn(t)}),this.subtitleTrack=-1,this.media=null}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 l=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,l)}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(_=>!n||n.indexOf(_.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(_=>_.default)&&(this.selectDefaultTrack=!1),s.forEach((_,S)=>{_.id=S});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!r&&l){this.selectDefaultTrack=!1;const _=Ui(l,s);if(_>-1)r=s[_];else{const S=Ui(l,this.tracks);r=this.tracks[S]}}let d=this.findTrackId(r);d===-1&&r&&(d=this.findTrackId(null));const h={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(u.SUBTITLE_TRACKS_UPDATED,h),d!==-1&&this.trackId===-1&&this.setSubtitleTrack(d)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Ui(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(u.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ot(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>Ss(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||!G(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(u.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:l="",name:d,type:h,url:_}=i;this.hls.trigger(u.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:d,type:h,url:_});const S=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(S)}}class $o{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){E.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const pa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Ko{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(u.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),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&&E.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=pn(dn(e.config.preferManagedMediaSource)),this.log=E.log.bind(E,t),this.warn=E.warn.bind(E,t),this.error=E.error.bind(E,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_APPENDING,this.onBufferAppending,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.BUFFER_EOS,this.onBufferEos,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(u.FRAG_PARSED,this.onFragParsed,this),e.on(u.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_APPENDING,this.onBufferAppending,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.BUFFER_EOS,this.onBufferEos,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(u.FRAG_PARSED,this.onFragParsed,this),e.off(u.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new $o(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=dn(this.appendSource);if(n&&i){var r;const s=this.mediaSource=new i;this.log(`created media source: ${(r=s.constructor)==null?void 0:r.name}`),s.addEventListener("sourceopen",this._onMediaSourceOpen),s.addEventListener("sourceended",this._onMediaSourceEnded),s.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.addEventListener("startstreaming",this._onStartStreaming),s.addEventListener("endstreaming",this._onEndStreaming));const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const d=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||d&&s instanceof d,ma(n),Go(n,l),n.load()}catch(d){n.src=l}else n.src=l;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&ma(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(u.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer(),this.hls.resumeBuffering()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(s=>{if(n){const d=this.tracks[s];if(d&&typeof d.buffer.changeType=="function"){var l;const{id:h,codec:_,levelCodec:S,container:U,metadata:ee}=t[s],X=Bt(d.codec,d.levelCodec),se=X==null?void 0:X.replace(pa,"$1");let de=Bt(_,S);const Te=(l=de)==null?void 0:l.replace(pa,"$1");if(de&&se!==Te){s.slice(0,5)==="audio"&&(de=zt(de,this.appendSource));const $e=`${U};codecs=${de}`;this.appendChangeType(s,$e),this.log(`switching codec ${X} to ${de}`),this.tracks[s]={buffer:d.buffer,codec:_,container:U,levelCodec:S,metadata:ee,id:h}}}}else this.pendingTracks[s]=t[s]}),n)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:r}=this,{data:s,type:l,frag:d,part:h,chunkMeta:_}=t,S=_.buffering[l],U=self.performance.now();S.start=U;const ee=d.stats.buffering,X=h?h.stats.buffering:null;ee.start===0&&(ee.start=U),X&&X.start===0&&(X.start=U);const se=r.audio;let de=!1;l==="audio"&&(se==null?void 0:se.container)==="audio/mpeg"&&(de=!this.lastMpegAudioChunk||_.id===1||this.lastMpegAudioChunk.sn!==_.sn,this.lastMpegAudioChunk=_);const Te=d.start,$e={execute:()=>{if(S.executeStart=self.performance.now(),de){const Ue=this.sourceBuffer[l];if(Ue){const at=Te-Ue.timestampOffset;Math.abs(at)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Te} (delta: ${at}) sn: ${d.sn})`),Ue.timestampOffset=Te)}}this.appendExecutor(s,l)},onStart:()=>{},onComplete:()=>{const Ue=self.performance.now();S.executeEnd=S.end=Ue,ee.first===0&&(ee.first=Ue),X&&X.first===0&&(X.first=Ue);const{sourceBuffer:at}=this,je={};for(const bt in at)je[bt]=jn.getBuffered(at[bt]);this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(u.BUFFER_APPENDED,{type:l,frag:d,part:h,chunkMeta:_,parent:d.type,timeRanges:je})},onError:Ue=>{const at={type:g.MEDIA_ERROR,parent:d.type,details:p.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:d,part:h,chunkMeta:_,error:Ue,err:Ue,fatal:!1};if(Ue.code===DOMException.QUOTA_EXCEEDED_ERR)at.details=p.BUFFER_FULL_ERROR;else{const je=++this.appendErrors[l];at.details=p.BUFFER_APPEND_ERROR,this.warn(`Failed ${je}/${n.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),je>=n.config.appendErrorMaxRetry&&(at.fatal=!0)}n.trigger(u.ERROR,at)}};i.append($e,l,!!this.pendingTracks[l])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(u.BUFFER_FLUSHED,{type:r})},onError:s=>{this.warn(`Failed to remove from ${r} SourceBuffer`,s)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{n.append(i(r),r)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[V.AUDIOVIDEO]?r.push("audiovideo"):(s[V.AUDIO]&&r.push("audio"),s[V.VIDEO]&&r.push("video"));const l=()=>{const d=self.performance.now();n.stats.buffering.end=d,i&&(i.stats.buffering.end=d);const h=i?i.stats:n.stats;this.hls.trigger(u.FRAG_BUFFERED,{frag:n,part:i,stats:h,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(l,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const s=this.sourceBuffer[r];return s&&(!t.type||t.type===r)&&(s.ending=!0,s.ended||(s.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!s||s.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const s=this.sourceBuffer[r];s&&(s.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,s=n.currentTime,l=t.levelTargetDuration,d=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(G(d)&&d>0){const h=Math.max(d,l),_=Math.floor(s/l)*l-h;this.flushBackBuffer(s,l,_)}if(G(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const h=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),_=Math.max(h,l),S=Math.floor(s/l)*l+_;this.flushFrontBuffer(s,l,S)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(l=>{const d=r[l];if(d){const h=jn.getBuffered(d);if(h.length>0&&n>h.start(0)){if(this.hls.trigger(u.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(u.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(d.ended&&h.end(h.length-1)-e{const l=i[s];if(l){const d=jn.getBuffered(l),h=d.length;if(h<2)return;const _=d.start(h-1),S=d.end(h-1);if(n>_||e>=_&&e<=S)return;if(l.ended&&e-S<2*t){this.log(`Cannot flush ${s} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:_,endOffset:1/0,type:s})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,s=n.duration,l=G(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>l&&r>s||!G(s))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,n[0].start),s=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${s}.`),t.setLiveSeekableRange(r,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(u.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(s=>{t.executeNext(s)});else{const s=new Error("could not create source buffer for media codec(s)");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:s,reason:s.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const s=e[r];if(!s)throw Error(`source buffer exists for track ${r}, however track does not`);let l=((i=s.levelCodec)==null?void 0:i.indexOf(","))===-1?s.levelCodec:s.codec;l&&r.slice(0,5)==="audio"&&(l=zt(l,this.appendSource));const d=`${s.container};codecs=${l}`;this.log(`creating sourceBuffer(${d})`);try{const h=t[r]=n.addSourceBuffer(d),_=r;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(_,"bufferedchange",(S,U)=>{const ee=U.removedRanges;ee!=null&&ee.length&&this.hls.trigger(u.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:h,codec:l,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(h){this.error(`error while trying to add sourceBuffer: ${h.message}`),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:r,mimeType:d})}}}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{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.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(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r,operationQueue:s,sourceBuffer:l}=this,d=l[e];if(!i||!r||!d){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const h=G(i.duration)?i.duration:1/0,_=G(r.duration)?r.duration:1/0,S=Math.max(0,t),U=Math.min(n,h,_);U>S&&(!d.ending||d.ended)?(d.ended=!1,this.log(`Removing [${S},${U}] from the ${e} SourceBuffer`),d.remove(S,U)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(r=>n.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const s=this.sourceBuffer[r];s!=null&&s.updating||n.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const r=n.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function ma(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Go(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const jo={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},ga=a=>String.fromCharCode(jo[a]||a),Hi=15,rr=100,Ho={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},zo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Vo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Wo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Zo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Yo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;E.log(`${this.time} [${e}] ${n}`)}}}const mr=function(e){const t=[];for(let n=0;nrr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=rr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const t=ga(e);if(this.pos>=rr){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"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(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;r0&&(e?n="["+t.join(" | ")+"]":n=t.join(` `)),n}getTextAndFormat(){return this.rows}}class va{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 ws(n),this.nonDisplayedMemory=new ws(n),this.lastOutputScreen=new ws(n),this.currRollUpRow=this.displayedMemory.rows[Hi-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[Hi-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;nt+": "+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: "+JSON.stringify(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 ya{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=qo(),this.logger=void 0;const i=this.logger=new Yo;this.channels=[null,new va(e,t,i),new va(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"["+mr([t[n],t[n+1]])+"] -> ("+mr([i,r])+")");const d=this.cmdHistory;if(i>=16&&i<=31){if(Jo(i,r,d)){Zr(null,null,d),this.logger.log(3,()=>"Repeated command ("+mr([i,r])+") is dropped");continue}Zr(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 Zr(null,null,d);if(!s&&(l=this.parseChars(i,r),l)){const _=this.currentChannel;_&&_>0?this.channels[_].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+mr([i,r])+" orig: "+mr([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 ("+mr([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?Ho[e]:Vo[e]:n=s===1?zo[e]:Wo[e];const l=this.channels[s];return l?(l.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 '"+ga(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 = "+mr(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=Zo[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Ts=function(){if(xe!=null&&xe.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,d){if(typeof d!="string"||!Array.isArray(l))return!1;const h=d.toLowerCase();return~l.indexOf(h)?h:!1}function n(l){return t(a,l)}function i(l){return t(e,l)}function r(l,...d){let h=1;for(;h100)throw new Error("Position must be between 0 and 100.");bt=gt,this.hasBeenReset=!0}})),Object.defineProperty(_,"positionAlign",r({},S,{get:function(){return it},set:function(gt){const Nt=i(gt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");it=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"size",r({},S,{get:function(){return Pt},set:function(gt){if(gt<0||gt>100)throw new Error("Size must be between 0 and 100.");Pt=gt,this.hasBeenReset=!0}})),Object.defineProperty(_,"align",r({},S,{get:function(){return Yt},set:function(gt){const Nt=i(gt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");Yt=Nt,this.hasBeenReset=!0}})),_.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class el{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ea(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 tl{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=0&&n<=100)return this.set(e,n),!0}return!1}}function ba(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 l=s[0],d=s[1];e(l,d)}}const Rs=new Ts(0,0,""),Xr=Rs.align==="middle"?"middle":"center";function nl(a,e,t){const n=a;function i(){const l=Ea(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function r(l,d){const h=new tl;ba(l,function(U,ee){let X;switch(U){case"region":for(let se=t.length-1;se>=0;se--)if(t[se].id===ee){h.set(U,t[se].region);break}break;case"vertical":h.alt(U,ee,["rl","lr"]);break;case"line":X=ee.split(","),h.integer(U,X[0]),h.percent(U,X[0])&&h.set("snapToLines",!1),h.alt(U,X[0],["auto"]),X.length===2&&h.alt("lineAlign",X[1],["start",Xr,"end"]);break;case"position":X=ee.split(","),h.percent(U,X[0]),X.length===2&&h.alt("positionAlign",X[1],["start",Xr,"end","line-left","line-right","auto"]);break;case"size":h.percent(U,ee);break;case"align":h.alt(U,ee,["start",Xr,"end","left","right"]);break}},/:/,/\s/),d.region=h.get("region",null),d.vertical=h.get("vertical","");let _=h.get("line","auto");_==="auto"&&Rs.line===-1&&(_=-1),d.line=_,d.lineAlign=h.get("lineAlign","start"),d.snapToLines=h.get("snapToLines",!0),d.size=h.get("size",100),d.align=h.get("align",Xr);let S=h.get("position","auto");S==="auto"&&Rs.position===50&&(S=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=S}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 xa(a){return a.replace(//gi,` `)}class il{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new el,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=xa(r);s")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{nl(r,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=r.indexOf("-->")!==-1;if(!r||l&&(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 rl=/\r\n|\n\r|\n|\r/g,As=function(e,t,n=0){return e.slice(n,n+t.length)===t},sl=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(!G(t)||!G(n)||!G(i)||!G(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t},Ls=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function Cs(a,e,t){return Ls(a.toString())+Ls(e.toString())+Ls(t)}const al=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 ol(a,e,t,n,i,r,s){const l=new il,d=Ne(new Uint8Array(a)).trim().replace(rl,` `).split(` `),h=[],_=e?wo(e.baseTime,e.timescale):0;let S="00:00.000",U=0,ee=0,X,se=!0;l.oncue=function(de){const Te=t[n];let $e=t.ccOffset;const Ue=(U-_)/9e4;if(Te!=null&&Te.new&&(ee!==void 0?$e=t.ccOffset=Te.start:al(t,n,Ue)),Ue){if(!e){X=new Error("Missing initPTS for VTT MPEGTS");return}$e=Ue-t.presentationOffset}const at=de.endTime-de.startTime,je=$i((de.startTime+$e-ee)*9e4,i*9e4)/9e4;de.startTime=Math.max(je,0),de.endTime=Math.max(je+at,0);const bt=de.text.trim();de.text=decodeURIComponent(encodeURIComponent(bt)),de.id||(de.id=Cs(de.startTime,de.endTime,bt)),de.endTime>0&&h.push(de)},l.onparsingerror=function(de){X=de},l.onflush=function(){if(X){s(X);return}r(h)},d.forEach(de=>{if(se)if(As(de,"X-TIMESTAMP-MAP=")){se=!1,de.slice(16).split(",").forEach(Te=>{As(Te,"LOCAL:")?S=Te.slice(6):As(Te,"MPEGTS:")&&(U=parseInt(Te.slice(7)))});try{ee=sl(S)/1e3}catch(Te){X=Te}return}else de===""&&(se=!1);l.parse(de+` `)}),l.flush()}const Is="stpp.ttml.im1t",Sa=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,wa=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ll={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ta(a,e,t,n){const i=pt(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(l=>Ne(l)),s=So(e.baseTime,1,e.timescale);try{r.forEach(l=>t(ul(l,s)))}catch(l){n(l)}}function ul(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((S,U)=>(S[U]=i.getAttribute(`ttp:${U}`)||r[U],S),{}),l=i.getAttribute("xml:space")!=="preserve",d=Ra(Ds(i,"styling","style")),h=Ra(Ds(i,"layout","region")),_=Ds(i,"body","[begin]");return[].map.call(_,S=>{const U=Aa(S,l);if(!U||!S.hasAttribute("begin"))return null;const ee=ks(S.getAttribute("begin"),s),X=ks(S.getAttribute("dur"),s);let se=ks(S.getAttribute("end"),s);if(ee===null)throw La(S);if(se===null){if(X===null)throw La(S);se=ee+X}const de=new Ts(ee-e,se-e,U);de.id=Cs(de.startTime,de.endTime,de.text);const Te=h[S.getAttribute("region")],$e=d[S.getAttribute("style")],Ue=cl(Te,$e,d),{textAlign:at}=Ue;if(at){const je=ll[at];je&&(de.lineAlign=je),de.align=at}return o(de,Ue),de}).filter(S=>S!==null)}function Ds(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Ra(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Aa(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?Aa(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function cl(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((l,d)=>{const h=Os(e,n,d)||Os(a,n,d)||Os(i,n,d);return h&&(l[d]=h),l},{})}function Os(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function La(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ks(a,e){if(!a)return null;let t=Ea(a);return t===null&&(Sa.test(a)?t=dl(a,e):wa.test(a)&&(t=hl(a,e))),t}function dl(a,e){const t=Sa.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 hl(a,e){const t=wa.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 fl{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=Da(),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(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Yr(this,"textTrack1"),t=new Yr(this,"textTrack2"),n=new Yr(this,"textTrack3"),i=new Yr(this,"textTrack4");this.cea608Parser1=new ya(1,e,t),this.cea608Parser2=new ya(3,n,i)}}addCues(e,t,n,i,r){let s=!1;for(let l=r.length;l--;){const d=r[l],h=pl(d[0],d[1],t,n);if(h>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],n),s=!0,h/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,i)}else{const l=this.Cues.newCue(null,t,n,i);this.hls.trigger(u.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(u.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i{Qn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Da(),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;nr.textCodec===Is);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ha(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?Ot(s.textTracks):null;if(this.tracks.forEach((d,h)=>{let _;if(l){let S=null;for(let U=0;Uh!==null).map(h=>h.label);d.length&&E.warn(`Media element contains unused subtitle tracks: ${d.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(u.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===$t.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:l}=this,{cc:d,sn:h}=t.frag,_=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(h!==l+1||h===l&&_!==this.lastPartIndex+1||d!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=d,this.lastSn=h,this.lastPartIndex=_}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===$t.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const l=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===Is?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ta(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{E.log(`Failed to parse IMSC1: ${i}`),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,l=r.length-1;if(!r[n.cc]&&l===-1){s.push(e);return}const d=this.hls,h=(t=n.initSegment)!=null&&t.data?c(n.initSegment.data,new Uint8Array(i)):i;ol(h,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,_=>{this._appendCues(_,n.level),d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},_=>{const S=_.message==="Missing initPTS for VTT MPEGTS";S?s.push(e):this._fallbackToIMSC1(n,i),E.log(`Failed to parse VTT cue: ${_}`),!(S&&l>n.cc)&&d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:_})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ta(t,this.initPTS[e.cc],()=>{n.textCodec=Is,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=>ti(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(u.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===$t.SUBTITLE&&this.onFragLoaded(u.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:r,samples:s}=t;if(!(r.type===$t.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let l=0;lNn(l[d],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(d=>Nn(l[d],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;rthis.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,Ps.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 e}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=(l,d)=>d?l.width!==d.width||l.height!==d.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let l=0;l=s||d.height>=s)&&i(d,e[l+1])){r=l;break}}return r}}class ml{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(u.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHING,this.onMediaAttaching,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)}}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,d=1e3*s/r,h=this.hls;if(h.trigger(u.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),d>0&&s>h.config.fpsDroppedMonitoringThreshold*l){let _=h.currentLevel;E.warn("drop FPS ratio greater than max allowed value for currentLevel: "+_),_>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=_)&&(_=_-1,h.trigger(u.FPS_DROP_LEVEL_CAPPING,{level:_,droppedLevel:h.currentLevel}),h.autoLevelCapping=_,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)}}const Qr="[eme]";class Rr{constructor(e){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=Rr.CDMCleanupPromise?[Rr.CDMCleanupPromise]:[],this.debug=E.debug.bind(E,Qr),this.log=E.log.bind(E,Qr),this.warn=E.warn.bind(E,Qr),this.error=E.error.bind(E,Qr),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=dt(this.config));const l=s.map(Rt).filter(d=>!!d);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=et(s);let d,h;if(n==="sinf"){if(l!==Re.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=ft(new Uint8Array(i));try{const se=v(JSON.parse(X).sinf),de=Qt(se);if(!de)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");d=de.subarray(8,24),h=Re.FAIRPLAY}catch(se){this.warn(`${r} Failed to parse sinf: ${se}`);return}}else{if(l!==Re.WIDEVINE&&l!==Re.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=rt(i),se=X.filter(Te=>!!Te.systemId&&Ve(Te.systemId)===l);se.length>1&&this.warn(`${r} Using first of ${se.length} pssh found for selected key-system ${l}`);const de=se[0];if(!de){X.length===0||X.some(Te=>!Te.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${X.map(Te=>Ve(Te.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(h=Ve(de.systemId),de.version===0&&de.data)if(h===Re.WIDEVINE){const Te=de.data.length-22;d=de.data.subarray(Te,Te+16)}else h===Re.PLAYREADY&&(d=Ye(de.data))}if(!h||!d){this.log(`Unable to handle ${r} with key-system ${l}`);return}const _=He.hexDump(d),{keyIdToKeySessionPromise:S,mediaKeySessions:U}=this;let ee=S[_];for(let X=0;Xthis.generateRequestWithPreferredKeySession(se,n,i,"encrypted-event-key-match")),ee.catch($e=>this.handleError($e));break}}if(!ee){if(h!==l){this.log(`Ignoring "${r}" with ${h} init data for selected key-system ${l}`);return}ee=S[_]=this.getKeySystemSelectionPromise([h]).then(({keySystem:X,mediaKeys:se})=>{var de;this.throwIfDestroyed();const Te=new lt("ISO-23001-7",_,(de=Rt(X))!=null?de:"");return Te.pssh=new Uint8Array(i),Te.keyId=d,this.attemptSetMediaKeys(X,se).then(()=>{this.throwIfDestroyed();const $e=this.createMediaKeySessionContext({decryptdata:Te,keySystem:X,mediaKeys:se});return this.generateRequestWithPreferredKeySession($e,n,i,"encrypted-event-no-match")})}),ee.catch(X=>this.handleError(X))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Re.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,l,d)=>!!s&&d.indexOf(s)===l,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,l)=>{const d=h=>{const _=h.shift();this.getMediaKeysPromise(_,i,r).then(S=>s({keySystem:_,mediaKeys:S})).catch(S=>{h.length?d(h):S instanceof Ki?l(S):l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_ACCESS,error:S,fatal:!0},S.message))})};d(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return St===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=At(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: ${JSON.stringify(i)}`),s=this.requestMediaKeySystemAccess(e,i);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(d=>{this.log(`Failed to obtain access to key-system "${e}": ${d}`)}),s.then(d=>{this.log(`Access for key-system "${d.keySystem}" obtained`);const h=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=d.createMediaKeys().then(_=>(this.log(`Media-keys created for "${e}"`),h.then(S=>S?this.setMediaKeysServerCertificate(_,e,S):_))),l.mediaKeys.catch(_=>{this.error(`Failed to create media-keys for "${e}"}: ${_}`)}),l.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${He.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,"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 He.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${He.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=dt(this.config),r=e.map(et).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const l=Rt(s);l?t(l):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.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:s,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(s,l).then(()=>{this.throwIfDestroyed();const d=this.createMediaKeySessionContext({keySystem:s,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(d,"cenc",t.pssh,"playlist-key")}))),r.catch(s=>this.handleError(s))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Ki?this.hls.trigger(u.ERROR,e.data):this.hls.trigger(u.ERROR,{type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=et(e.keyFormat),r=i?[i]:dt(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=dt(this.config)),e.length===0)throw new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({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 l=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const X=l.call(this.hls,t,n,e);if(!X)throw new Error("Invalid response from configured generateRequest filter");t=X.initDataType,n=e.decryptdata.pssh=X.initData?new Uint8Array(X.initData):null}catch(X){var d;if(this.warn(X.message),(d=this.hls)!=null&&d.config.debug)throw X}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const h=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${h} (init data type: ${t} length: ${n?n.byteLength:null})`);const _=new xs,S=e._onmessage=X=>{const se=e.mediaKeysSession;if(!se){_.emit("error",new Error("invalid state"));return}const{messageType:de,message:Te}=X;this.log(`"${de}" message event for session "${se.sessionId}" message size: ${Te.byteLength}`),de==="license-request"||de==="license-renewal"?this.renewLicense(e,Te).catch($e=>{this.handleError($e),_.emit("error",$e)}):de==="license-release"?e.keySystem===Re.FAIRPLAY&&(this.updateKeySession(e,me("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${de}"`)},U=e._onkeystatuseschange=X=>{if(!e.mediaKeysSession){_.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const de=e.keyStatus;_.emit("keyStatus",de),de==="expired"&&(this.warn(`${e.keySystem} expired for key ${h}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",S),e.mediaKeysSession.addEventListener("keystatuseschange",U);const ee=new Promise((X,se)=>{_.on("error",se),_.on("keyStatus",de=>{de.startsWith("usable")?X():de==="output-restricted"?se(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):de==="internal-error"?se(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${de}"`)):de==="expired"?se(new Error("key expired while generating request")):this.warn(`unhandled key status change "${de}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var X;this.log(`Request generated for key-session "${(X=e.mediaKeysSession)==null?void 0:X.sessionId}" keyId: ${h}`)}).catch(X=>{throw new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_NO_SESSION,error:X,fatal:!1},`Error generating key-session request: ${X}`)}).then(()=>ee).catch(X=>{throw _.removeAllListeners(),this.removeSession(e),X}).then(()=>(_.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${He.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${He.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,l)=>{const d={responseType:"arraybuffer",url:r},h=t.certLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,se)=>{s(U.data)},onError:(U,ee,X,se)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:oe({url:d.url,data:void 0},U)},`"${e}" certificate request failed (${r}). Status: ${U.code} (${U.text})`))},onTimeout:(U,ee,X)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:{url:d.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(U,ee,X)=>{l(new Error("aborted"))}};i.load(d,_,S)})):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 Ki({type:g.KEY_SYSTEM_ERROR,details:p.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 Ki({type:g.KEY_SYSTEM_ERROR,details:p.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 _;for(let S=0,U=r.length;S in key message");return me(atob(h))}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 l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let d=l.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const h=this.config.licenseResponseCallback;if(h)try{d=h.call(this.hls,l,s,e)}catch(_){this.error(_)}i(d)}else{const d=n.errorRetry,h=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||l.status>=400&&l.status<500)r(new Ki({type:g.KEY_SYSTEM_ERROR,details:p.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const _=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${_} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:d,licenseChallenge:h})=>{e.keySystem==Re.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(d,h)),d.send(h)})})}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,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},lt.clearKeyUriToKeyIdMap();const n=t.length;Rr.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}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);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Rr.CDMCleanupPromise=void 0;class Ki 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}}var Ri;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(Ri||(Ri={}));var Ns;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(Ns||(Ns={}));var gr;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(gr||(gr={}));const gl={[gr.OBJECT]:["br","d","ot","tb"],[gr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[gr.SESSION]:["cid","pr","sf","sid","st","v"],[gr.STATUS]:["bs","rtp"]};class Ar{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof Ar?n:new Ar(n))),this.value=e,this.params=t}}class Oa{constructor(e){this.description=void 0,this.description=e}}const _l="Dict";function vl(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 yl(a,e,t,n){return new Error(`failed to ${a} "${vl(e)}" as ${t}`,{cause:n})}const ka="Bare Item",El="Boolean",bl="Byte Sequence",xl="Decimal",Sl="Integer";function wl(a){return a<-999999999999999||99999999999999912)throw Ji(a,xl);const t=e.toString();return t.includes(".")?t:`${t}.0`}const kl="String";function Pl(a){if(Tl.test(a))throw Ji(a,kl);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Ma(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ji(e,Rl);return e}function Ms(a){switch(typeof a){case"number":if(!G(a))throw Ji(a,ka);return Number.isInteger(a)?Pa(a):Ol(a);case"string":return Pl(a);case"symbol":return Ma(a);case"boolean":return Ll(a);case"object":if(a instanceof Date)return Dl(a);if(a instanceof Uint8Array)return Il(a);if(a instanceof Oa)return Ma(a);default:throw Ji(a,ka)}}function Fs(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ji(a,Al);return a}function Bs(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Fs(e)}`:`;${Fs(e)}=${Ms(t)}`).join("")}function Fa(a){return a instanceof Ar?`${Ms(a.value)}${Bs(a.params)}`:Ms(a)}function Ml(a){return`(${a.value.map(Fa).join(" ")})${Bs(a.params)}`}function Fl(a,e={whitespace:!0}){if(typeof a!="object")throw Ji(a,_l);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Ar||(r=new Ar(r));let s=Fs(i);return r.value===!0?s+=Bs(r.params):(s+="=",Array.isArray(r.value)?s+=Ml(r):s+=Fa(r)),s}).join(`,${n}`)}function Bl(a,e){return Fl(a,e)}const Ul=a=>a==="ot"||a==="sf"||a==="st",$l=a=>typeof a=="number"?G(a):a!=null&&a!==""&&a!==!1;function Kl(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 Gl(){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)})}}}const Jr=a=>Math.round(a),jl=(a,e)=>(e!=null&&e.baseUrl&&(a=Kl(a,e.baseUrl)),encodeURIComponent(a)),qr=a=>Jr(a/100)*100,Hl={br:Jr,d:Jr,bl:qr,dl:qr,mtp:qr,nor:jl,rtp:qr,tb:Jr};function zl(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=o({},Hl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let l=a[s];const d=i[s];d&&(l=d(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||$l(l)&&(Ul(s)&&typeof l=="string"&&(l=new Oa(l)),t[s]=l))}),t}function Ba(a,e={}){return a?Bl(zl(a,e),o({whitespace:!1},e)):""}function Vl(a,e={}){if(!a)return{};const t=Object.entries(a),n=Object.entries(gl).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,s)=>{var l,d;const[h,_]=s,S=((l=n.find(U=>U[1].includes(h)))==null?void 0:l[0])||gr.REQUEST;return(d=r[S])!=null||(r[S]={}),r[S][h]=_,r},{});return Object.entries(i).reduce((r,[s,l])=>(r[s]=Ba(l,e),r),{})}function Wl(a,e,t){return o(a,Vl(e,t))}const Zl="CMCD";function Yl(a,e={}){if(!a)return"";const t=Ba(a,e);return`${Zl}=${encodeURIComponent(t)}`}const Ua=/CMCD=[^&#]+/;function Xl(a,e,t){const n=Yl(e,t);if(!n)return a;if(Ua.test(a))return a.replace(Ua,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Ql{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:Ri.MANIFEST,su:!this.initialized})}catch(r){E.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,s=this.hls.levels[r.level],l=this.getObjectType(r),d={d:r.duration*1e3,ot:l};(l===Ri.VIDEO||l===Ri.AUDIO||l==Ri.MUXED)&&(d.br=s.bitrate/1e3,d.tb=this.getTopBandwidth(l)/1e3,d.bl=this.getBufferLength(l)),this.apply(i,d)}catch(r){E.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||Gl(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHED,this.onMediaDetached,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHED,this.onMediaDetached,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=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:Ns.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){o(t,this.createData());const n=t.ot===Ri.INIT||t.ot===Ri.VIDEO||t.ot===Ri.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((r,s)=>(i.includes(s)&&(r[s]=t[s]),r),{})),this.useHeaders?(e.headers||(e.headers={}),Wl(e.headers,t)):e.url=Xl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ri.TIMED_TEXT;if(e.sn==="initSegment")return Ri.INIT;if(t==="audio")return Ri.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ri.VIDEO:Ri.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Ri.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.hls.media,n=e===Ri.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:jn.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,l){t(r),this.loader.load(r,s,l)}}}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,l){t(r),this.loader.load(r,s,l)}}}}const Jl=3e5;class ql{constructor(e){this.hls=void 0,this.log=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.log=E.log.bind(E,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.ERROR,this.onError,this))}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)===en.SendAlternateToPenaltyBox&&n.flags===Dn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:d,type:h}=t.context;l&&i?s=this.getPathwayForGroupId(l,h,s):d&&(s=d)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=i.reduce((l,d)=>(l.indexOf(d.pathwayId)===-1&&l.push(d.pathwayId),l),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||E.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(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]>Jl&&delete n[r]});for(let r=0;r0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,si(t),this.hls.trigger(u.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[l];d&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${h.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":d}=r;if(t.some(_=>_.pathwayId===s))return;const h=this.getLevelsForPathway(l).map(_=>{const S=new ne(_.attrs);S["PATHWAY-ID"]=s;const U=S.AUDIO&&`${S.AUDIO}_clone_${s}`,ee=S.SUBTITLES&&`${S.SUBTITLES}_clone_${s}`;U&&(n[S.AUDIO]=U,S.AUDIO=U),ee&&(i[S.SUBTITLES]=ee,S.SUBTITLES=ee);const X=Ka(_.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),se=new mi({attrs:S,audioCodec:_.audioCodec,bitrate:_.bitrate,height:_.height,name:_.name,url:X,videoCodec:_.videoCodec,width:_.width});if(_.audioGroups)for(let de=1;de<_.audioGroups.length;de++)se.addGroupId("audio",`${_.audioGroups[de]}_clone_${s}`);if(_.subtitleGroups)for(let de=1;de<_.subtitleGroups.length;de++)se.addGroupId("text",`${_.subtitleGroups[de]}_clone_${s}`);return se});t.push(...h),$a(this.audioTracks,n,d,s),$a(this.subtitleTracks,i,d,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(_){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const _=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+_)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},d={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},h={onSuccess:(_,S,U,ee)=>{this.log(`Loaded steering manifest: "${i}"`);const X=_.data;if(X.VERSION!==1){this.log(`Steering VERSION ${X.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=X.TTL;const{"RELOAD-URI":se,"PATHWAY-CLONES":de,"PATHWAY-PRIORITY":Te}=X;if(se)try{this.uri=new self.URL(se,i).href}catch(Ue){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${se}`);return}this.scheduleRefresh(this.uri||U.url),de&&this.clonePathways(de);const $e={steeringManifest:X,url:i.toString()};this.hls.trigger(u.STEERING_MANIFEST_LOADED,$e),Te&&this.updatePathwayPriority(Te)},onError:(_,S,U,ee)=>{if(this.log(`Error loading steering manifest: ${_.code} ${_.text} (${S.url})`),this.stopLoad(),_.code===410){this.enabled=!1,this.log(`Steering manifest ${S.url} no longer available`);return}let X=this.timeToLoad*1e3;if(_.code===429){const se=this.loader;if(typeof(se==null?void 0:se.getResponseHeader)=="function"){const de=se.getResponseHeader("Retry-After");de&&(X=parseFloat(de)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,X)},onTimeout:(_,S,U)=>{this.log(`Timeout loading steering manifest (${S.url})`),this.scheduleRefresh(this.uri||S.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,d,h)}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 $a(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const l=o({},s);return l.details=void 0,l.attrs=new ne(l.attrs),l.url=l.attrs.URI=Ka(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=n,l});a.push(...r)})}function Ka(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const d=new self.URL(a);return i&&!l&&(d.host=i),r&&Object.keys(r).sort().forEach(h=>{h&&d.searchParams.set(h,r[h])}),d.href}const eu=/^age:\s*[\d.]+\s*$/im;class Ga{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 he,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=>{this.callbacks.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 l in i)e.setRequestHeader(l,i[l]);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&&G(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 s=t.status,l=t.responseType==="text"?t.responseText:null;if(s>=200&&s<300){const S=l!=null?l:t.response;if(S!=null){n.loading.end=Math.max(self.performance.now(),n.loading.first);const U=t.responseType==="arraybuffer"?S.byteLength:S.length;if(n.loaded=n.total=U,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const ee=this.callbacks.onProgress;if(ee&&ee(n,e,S,t),!this.callbacks)return;const X={url:t.responseURL,data:S,code:s};this.callbacks.onSuccess(X,n,e,t);return}}const d=r.loadPolicy.errorRetry,h=n.retry,_={url:e.url,data:void 0,code:s};ri(d,h,!1,_)?this.retry(d):(E.error(`${s} while loading ${e.url}`),this.callbacks.onError({code:s,text:t.statusText},e,t,n))}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(ri(e,t,!0))this.retry(e);else{var n;E.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=gi(e,n.retry),n.retry++,E.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&&eu.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}}function tu(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const nu=/(\d+)-(\d+)\/(\d+)/;class ja{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||au,this.controller=new self.AbortController,this.stats=new he}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=iu(e,this.controller.signal),s=n.onProgress,l=e.responseType==="arraybuffer",d=l?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:_}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=h&&G(h)?h:_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(S=>{this.response=this.loader=S;const U=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},_-(U-i.loading.start)),!S.ok){const{status:ee,statusText:X}=S;throw new ou(X||"fetch, bad network response",ee,S)}return i.loading.first=U,i.total=su(S.headers)||i.total,s&&G(t.highWaterMark)?this.loadProgressively(S,i,e,t.highWaterMark,s):l?S.arrayBuffer():e.responseType==="json"?S.json():S.text()}).then(S=>{const U=this.response;if(!U)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const ee=S[d];ee&&(i.loaded=i.total=ee);const X={url:U.url,data:S,code:U.status};s&&!G(t.highWaterMark)&&s(i,e,S,U),n.onSuccess(X,i,e,U)}).catch(S=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const U=S&&S.code||0,ee=S?S.message:null;n.onError({code:U,text:ee},e,S?S.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 Gs,l=e.body.getReader(),d=()=>l.read().then(h=>{if(h.done)return s.dataLength&&r(t,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const _=h.value,S=_.length;return t.loaded+=S,S=i&&r(t,n,s.flush(),e)):r(t,n,_,e),d()}).catch(()=>Promise.reject());return d()}}function iu(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(o({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ru(a){const e=nu.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function su(a){const e=a.get("Content-Range");if(e){const n=ru(e);if(G(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function au(a,e){return new self.Request(a.url,e)}class ou extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const lu=/\s/,uu={newCue(a,e,t,n){const i=[];let r,s,l,d,h;const _=self.VTTCue||self.TextTrackCue;for(let U=0;U=16?d--:d++;const ee=xa(h.trim()),X=Cs(e,t,ee);a!=null&&(S=a.cues)!=null&&S.getCueById(X)||(s=new _(e,t,ee),s.id=X,s.line=U+1,s.align="left",s.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((U,ee)=>U.line==="auto"||ee.line==="auto"?0:U.line>8&&ee.line>8?ee.line-U.line:U.line-ee.line),i.forEach(U=>ti(a,U))),i}},cu={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ha=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,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,loader:Ga,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:as,bufferController:Ko,capLevelController:Ps,errorController:qn,fpsController:ml,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:St,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:cu},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}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},du()),{},{subtitleStreamController:Fo,subtitleTrackController:Uo,timelineController:fl,audioStreamController:No,audioTrackController:Mo,emeController:Rr,cmcdController:Ql,contentSteeringController:ql});function du(){return{cueHandler:uu,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 hu(a,e){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 t=Us(a),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(r=>{const s=`${r==="level"?"playlist":r}LoadPolicy`,l=e[s]===void 0,d=[];i.forEach(h=>{const _=`${r}Loading${h}`,S=e[_];if(S!==void 0&&l){d.push(_);const U=t[s].default;switch(e[s]={default:U},h){case"TimeOut":U.maxLoadTimeMs=S,U.maxTimeToFirstByteMs=S;break;case"MaxRetry":U.errorRetry.maxNumRetry=S,U.timeoutRetry.maxNumRetry=S;break;case"RetryDelay":U.errorRetry.retryDelayMs=S,U.timeoutRetry.retryDelayMs=S;break;case"MaxRetryTimeout":U.errorRetry.maxRetryDelayMs=S,U.timeoutRetry.maxRetryDelayMs=S;break}}}),d.length&&E.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),oe(oe({},t),e)}function Us(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Us):Object.keys(a).reduce((e,t)=>(e[t]=Us(a[t]),e),{}):a}function fu(a){const e=a.loader;e!==ja&&e!==Ga?(E.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):tu()&&(a.loader=ja,a.progressive=!0,a.enableSoftwareAES=!0,E.log("[config]: Progressive streaming enabled, using FetchLoader"))}let $s;class pu extends kn{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.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 l=!1,d=!1,h=!1;t.levels.forEach(_=>{var S,U;const ee=_.attrs;let{audioCodec:X,videoCodec:se}=_;((S=X)==null?void 0:S.indexOf("mp4a.40.34"))!==-1&&($s||($s=/chrome|firefox/i.test(navigator.userAgent)),$s&&(_.audioCodec=X=void 0)),X&&(_.audioCodec=X=zt(X,n)),((U=se)==null?void 0:U.indexOf("avc1"))===0&&(se=_.videoCodec=rn(se));const{width:de,height:Te,unknownCodecs:$e}=_;if(l||(l=!!(de&&Te)),d||(d=!!se),h||(h=!!X),$e!=null&&$e.length||X&&!De(X,"audio",n)||se&&!De(se,"video",n))return;const{CODECS:Ue,"FRAME-RATE":at,"HDCP-LEVEL":je,"PATHWAY-ID":bt,RESOLUTION:it,"VIDEO-RANGE":Pt}=ee,gt=`${`${bt||"."}-`}${_.bitrate}-${it}-${at}-${Ue}-${Pt}-${je}`;if(r[gt])if(r[gt].uri!==_.url&&!_.attrs["PATHWAY-ID"]){const Nt=s[gt]+=1;_.attrs["PATHWAY-ID"]=new Array(Nt+1).join(".");const Sn=new mi(_);r[gt]=Sn,i.push(Sn)}else r[gt].addGroupId("audio",ee.AUDIO),r[gt].addGroupId("text",ee.SUBTITLES);else{const Nt=new mi(_);r[gt]=Nt,s[gt]=1,i.push(Nt)}}),this.filterAndSortMediaOptions(i,t,l,d,h)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],l=[],d=e;if((n||i)&&r&&(d=d.filter(({videoCodec:X,videoRange:se,width:de,height:Te})=>(!!X||!!(de&&Te))&&yi(se))),d.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const X=new Error("no level with compatible codecs found in manifest");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:X,reason:X.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:X}=this.hls.config;s=t.audioTracks.filter(se=>!se.audioCodec||De(se.audioCodec,"audio",X)),za(s)}t.subtitles&&(l=t.subtitles,za(l));const h=d.slice(0);d.sort((X,se)=>{if(X.attrs["HDCP-LEVEL"]!==se.attrs["HDCP-LEVEL"])return(X.attrs["HDCP-LEVEL"]||"")>(se.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&X.height!==se.height)return X.height-se.height;if(X.frameRate!==se.frameRate)return X.frameRate-se.frameRate;if(X.videoRange!==se.videoRange)return ni.indexOf(X.videoRange)-ni.indexOf(se.videoRange);if(X.videoCodec!==se.videoCodec){const de=st(X.videoCodec),Te=st(se.videoCodec);if(de!==Te)return Te-de}if(X.uri===se.uri&&X.codecSet!==se.codecSet){const de=Xe(X.codecSet),Te=Xe(se.codecSet);if(de!==Te)return Te-de}return X.averageBitrate!==se.averageBitrate?X.averageBitrate-se.averageBitrate:0});let _=h[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==h.length)){for(let X=0;Xde&&de===Ha.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Te)}break}const U=r&&!i,ee={levels:d,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!U&&s.some(X=>!!X.url)};this.hls.trigger(u.MANIFEST_PARSED,ee),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const _=new Error("invalid level idx"),S=e<0;if(this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.LEVEL_SWITCH_ERROR,level:e,fatal:S,error:_,reason:_.message}),S)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],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&s.details&&i&&r===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${r?" with Pathway "+r:""}`);const d={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(u.LEVEL_SWITCHING,d);const h=s.details;if(!h||h.live){const _=this.switchParams(s.uri,i==null?void 0:i.details,h);this.loadPlaylist(_)}}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}onError(e,t){t.fatal||!t.context||t.context.type===fn.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===$t.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=this._levels[i];if(!s){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0),this.playlistLoaded(i,t,s.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}const r=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(u.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||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;const n=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(s=>s.level=-1)),!1));si(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(u.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(u.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function za(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class mu{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=p.KEY_LOAD_ERROR,n,i,r){return new ii({type:g.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{s.setKeyFormat(l)});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 h=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,p.KEY_LOAD_ERROR,h))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,p.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return r.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var d;switch((d=l.mediaKeySessionContext)==null?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(h=>(r.key=h.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=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(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,p.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,l)=>{const d={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=n.keyLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,se)=>{const{frag:de,keyInfo:Te,url:$e}=X;if(!de.decryptdata||Te!==this.keyUriToKeyInfo[$e])return l(this.createKeyLoadError(de,p.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),se));Te.decryptdata.key=de.decryptdata.key=new Uint8Array(U.data),de.keyLoader=null,Te.loader=null,s({frag:de,keyInfo:Te})},onError:(U,ee,X,se)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.KEY_LOAD_ERROR,new Error(`HTTP Error ${U.code} loading key ${U.text}`),X,oe({url:d.url,data:void 0},U)))},onTimeout:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),X))},onAbort:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,p.INTERNAL_ABORTED,new Error("key loading aborted"),X))}};r.load(d,_,S)})}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 Va(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wa(){if(!dn())return!1;const e=Va();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function gu(){if(!Wa())return!1;const a=dn();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(Ge(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ge(e,"audio"))))}function _u(){var a;const e=Va();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const vu=250,es=2,yu=.1,Eu=.05;class bu{constructor(e,t,n,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:r}=this;if(i===null)return;const{currentTime:s,seeking:l}=i,d=this.seeking&&!l,h=!this.seeking&&l;if(this.seeking=l,s!==e){if(this.moved=!0,l||(this.nudgeRetry=0),r!==null){if(this.stallReported){const de=self.performance.now()-r;E.warn(`playback not stuck anymore @${s}, after ${Math.round(de)}ms`),this.stallReported=!1}this.stalled=null}return}if(h||d){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!jn.getBuffered(i).length){this.nudgeRetry=0;return}const _=jn.bufferInfo(i,s,0),S=_.nextStart||0;if(l){const de=_.len>es,Te=!S||t&&t.start<=s||S-s>es&&!this.fragmentTracker.getPartialFragment(s);if(de||Te)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var U;if(!(_.len>0)&&!S)return;const Te=Math.max(S,_.start||0)-s,$e=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,at=($e==null||(U=$e.details)==null?void 0:U.live)?$e.details.targetduration*2:es,je=this.fragmentTracker.getPartialFragment(s);if(Te>0&&(Te<=at||je)){i.paused||this._trySkipBufferHole(je);return}}const ee=self.performance.now();if(r===null){this.stalled=ee;return}const X=ee-r;if(!l&&X>=vu&&(this._reportStall(_),!this.media))return;const se=jn.bufferInfo(i,s,n.maxBufferHole);this._tryFixBufferStall(se,X)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:r}=this;if(r===null)return;const s=r.currentTime,l=i.getPartialFragment(s);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-sn.highBufferWatchdogPeriod*1e3&&(E.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);E.warn(r.message),t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:p.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const r=i.currentTime,s=jn.bufferInfo(i,r,0),l=r0&&s.len<1&&i.readyState<3,_=l-r;if(_>0&&(d||h)){if(_>t.maxBufferHole){const{fragmentTracker:U}=this;let ee=!1;if(r===0){const X=U.getAppendedFrag(0,$t.MAIN);X&&l1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=vt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=vt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case vt.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)){if(this.waitForCdnTuneIn(r))break;this.state=vt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=vt.IDLE;break}break}case vt.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=vt.IDLE}}break}this.state===vt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(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],l=this.getMainFwdBufferInfo();if(l===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(l,d)){const se={};this.altAudio&&(se.type="video"),this.hls.trigger(u.BUFFER_EOS,se),this.state=vt.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 h=s.details;if(!h||this.state===vt.WAITING_LEVEL||h.live&&this.levelLastLoaded!==s){this.level=r,this.state=vt.WAITING_LEVEL;return}const _=l.len,S=this.getMaxBufferLength(s.maxBitrate);if(_>=S)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const U=this.backtrackFragment?this.backtrackFragment.start:l.end;let ee=this.getNextFragment(U,h);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"&&this.fragmentTracker.getState(ee)!==ai.OK){var X;const de=((X=this.backtrackFragment)!=null?X:ee).sn-h.startSN,Te=h.fragments[de-1];Te&&ee.cc===Te.cc&&(ee=Te,this.fragmentTracker.removeFragment(Te))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(ee&&this.isLoopLoading(ee,U)){if(!ee.gap){const de=this.audioOnly&&!this.altAudio?V.AUDIO:V.VIDEO,Te=(de===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Te&&this.afterBufferFlushed(Te,de,$t.MAIN)}ee=this.getNextFragmentLoopLoading(ee,h,l,$t.MAIN,S)}ee&&(ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),this.loadFragment(ee,s,U))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ai.NOT_LOADED||i===ai.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):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)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,$t.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 l=this.getMainFwdBufferInfo();if(!l||l.len{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&&!_u(),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!==vt.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=vt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,r=t.level,s=t.details,l=s.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${l}`);const d=i[r],h=this.fragCurrent;h&&(this.state===vt.FRAG_LOADING||this.state===vt.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let _=0;if(s.live||(n=d.details)!=null&&n.live){var S;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;_=this.alignPlaylists(s,d.details,(S=this.levelLastLoaded)==null?void 0:S.details)}if(d.details=s,this.levelLastLoaded=d,this.hls.trigger(u.LEVEL_UPDATED,{details:s,level:r}),this.state===vt.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=vt.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,_),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,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 l=s[n.level],d=l.details;if(!d){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const h=l.videoCodec,_=d.PTSKnown||!d.live,S=(t=n.initSegment)==null?void 0:t.data,U=this._getAudioCodec(l),ee=this.transmuxer=this.transmuxer||new ca(this.hls,$t.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=i?i.index:-1,se=X!==-1,de=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,X,se),Te=this.initPTS[n.cc];ee.push(r,S,U,h,n,i,d.totalduration,_,de,Te)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){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();const r=this.hls;n&&(r.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(u.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const l in n){const d=n[l];if(d.id==="main"){if(r=l,i=d,l==="video"){const h=n[l];h&&(this.videoBuffer=h.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;if(n&&n.type!==$t.MAIN)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}`),this.state===vt.PARSED&&(this.state=vt.IDLE);return}const r=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=vt.ERROR;return}switch(t.details){case p.FRAG_GAP:case p.FRAG_PARSING_ERROR:case p.FRAG_DECRYPT_ERROR:case p.FRAG_LOAD_ERROR:case p.FRAG_LOAD_TIMEOUT:case p.KEY_LOAD_ERROR:case p.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($t.MAIN,t);break;case p.LEVEL_LOAD_ERROR:case p.LEVEL_LOAD_TIMEOUT:case p.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===vt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===fn.LEVEL&&(this.state=vt.IDLE);break;case p.BUFFER_APPEND_ERROR:case p.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===p.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case p.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!jn.getBuffered(e).length){const n=this.state!==vt.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=vt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==V.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,$t.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),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&&t0&&(s{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=vt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(u.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{video:S,text:U,id3:ee,initSegment:X}=r,{details:se}=_,de=this.altAudio?void 0:r.audio;if(this.fragContextChanged(d)){this.fragmentTracker.removeFragment(d);return}if(this.state=vt.PARSING,X){if(X!=null&&X.tracks){const Ue=d.initSegment||d;this._bufferInitSegment(_,X.tracks,Ue,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:Ue,id:n,tracks:X.tracks})}const Te=X.initPTS,$e=X.timescale;G(Te)&&(this.initPTS[d.cc]={baseTime:Te,timescale:$e},i.trigger(u.INIT_PTS_FOUND,{frag:d,id:n,initPTS:Te,timescale:$e}))}if(S&&se&&d.sn!=="initSegment"){const Te=se.fragments[d.sn-1-se.startSN],$e=d.sn===se.startSN,Ue=!Te||d.cc>Te.cc;if(r.independent!==!1){const{startPTS:at,endPTS:je,startDTS:bt,endDTS:it}=S;if(h)h.elementaryStreams[S.type]={startPTS:at,endPTS:je,startDTS:bt,endDTS:it};else if(S.firstKeyFrame&&S.independent&&s.id===1&&!Ue&&(this.couldBacktrack=!0),S.dropped&&S.independent){const Pt=this.getMainFwdBufferInfo(),Yt=(Pt?Pt.end:this.getLoadPosition())+this.config.maxBufferHole,gt=S.firstKeyFramePTS?S.firstKeyFramePTS:at;if(!$e&&Ytes&&(d.gap=!0);d.setElementaryStreamInfo(S.type,at,je,bt,it),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(S,d,h,s,$e||Ue)}else if($e||Ue)d.gap=!0;else{this.backtrack(d);return}}if(de){const{startPTS:Te,endPTS:$e,startDTS:Ue,endDTS:at}=de;h&&(h.elementaryStreams[V.AUDIO]={startPTS:Te,endPTS:$e,startDTS:Ue,endDTS:at}),d.setElementaryStreamInfo(V.AUDIO,Te,$e,Ue,at),this.bufferFragmentData(de,d,h,s)}if(se&&ee!=null&&(t=ee.samples)!=null&&t.length){const Te={id:n,frag:d,details:se,samples:ee.samples};i.trigger(u.FRAG_PARSING_METADATA,Te)}if(se&&U){const Te={id:n,frag:d,details:se,samples:U.samples};i.trigger(u.FRAG_PARSING_USERDATA,Te)}}_bufferInitSegment(e,t,n,i){if(this.state!==vt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:s,audiovideo:l}=t;if(r){let d=e.audioCodec;const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const _=r.metadata;_&&"channelCount"in _&&(_.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),r.levelCodec=d,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${r.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(u.BUFFER_CODECS,t),Object.keys(t).forEach(d=>{const _=t[d].initSegment;_!=null&&_.byteLength&&this.hls.trigger(u.BUFFER_APPENDING,{type:d,data:_,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,$t.MAIN)}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=vt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(jn.isBuffered(e,n)?t=this.getAppendedFrag(n):jn.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(u.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(u.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&G(t)&&G(n.programDateTime)){const i=n.programDateTime+(t-n.start)*1e3;return new Date(i)}}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 _r{static get version(){return"1.5.20"}static isMSESupported(){return Wa()}static isSupported(){return gu()}static getMediaSource(){return dn()}static get Events(){return u}static get ErrorTypes(){return g}static get ErrorDetails(){return p}static get DefaultConfig(){return _r.defaultConfig?_r.defaultConfig:Ha}static set DefaultConfig(e){_r.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new xs,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.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,A(e.debug||!1,"Hls instance");const t=this.config=hu(_r.DefaultConfig,e);this.userConfig=e,t.progressive&&fu(t);const{abrController:n,bufferController:i,capLevelController:r,errorController:s,fpsController:l}=t,d=new s(this),h=this.abrController=new n(this),_=this.bufferController=new i(this),S=this.capLevelController=new r(this),U=new l(this),ee=new Un(this),X=new di(this),se=t.contentSteeringController,de=se?new se(this):null,Te=this.levelController=new pu(this,de),$e=new fr(this),Ue=new mu(this.config),at=this.streamController=new Su(this,$e,Ue);S.setStreamController(at),U.setStreamController(at);const je=[ee,Te,at];de&&je.splice(1,0,de),this.networkControllers=je;const bt=[h,_,S,U,X,$e];this.audioTrackController=this.createController(t.audioTrackController,je);const it=t.audioStreamController;it&&je.push(new it(this,$e,Ue)),this.subtitleTrackController=this.createController(t.subtitleTrackController,je);const Pt=t.subtitleStreamController;Pt&&je.push(new Pt(this,$e,Ue)),this.createController(t.timelineController,bt),Ue.emeController=this.emeController=this.createController(t.emeController,bt),this.cmcdController=this.createController(t.cmcdController,bt),this.latencyController=this.createController(fi,bt),this.coreComponents=bt,je.push(d);const Yt=d.onErrorOut;typeof Yt=="function"&&this.on(u.ERROR,Yt,d)}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(E.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===u.ERROR;this.trigger(u.ERROR,{type:g.OTHER_ERROR,details:p.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){E.log("destroy"),this.trigger(u.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){E.log("attachMedia"),this._media=e,this.trigger(u.MEDIA_ATTACHING,{media:e})}detachMedia(){E.log("detachMedia"),this.trigger(u.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=ve.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,E.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(u.MANIFEST_LOADING,{url:e})}startLoad(e=-1){E.log(`startLoad(${e})`),this.started=!0,this.resumeBuffering();for(let t=0;t{e.resumeBuffering&&e.resumeBuffering()})}pauseBuffering(){E.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()})}swapAudioCodec(){E.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){E.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){E.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){E.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){E.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){E.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){E.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 ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(E.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Vn(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=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()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||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}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}_r.defaultConfig=void 0}}]); }());