You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
819 KiB
112 lines
819 KiB
!(function(){var Za=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[2524],{70557:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return Z}});var z=I(96663),Q=I(59301),ae={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"},ne=ae,V=I(7657),q=function(O,v){return Q.createElement(V.Z,(0,z.Z)({},O,{ref:v,icon:ne}))},ee=Q.forwardRef(q),Z=ee},84105:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return Z}});var z=I(96663),Q=I(59301),ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},ne=ae,V=I(7657),q=function(O,v){return Q.createElement(V.Z,(0,z.Z)({},O,{ref:v,icon:ne}))},ee=Q.forwardRef(q),Z=ee},18785:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return Z}});var z=I(96663),Q=I(59301),ae={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"},ne=ae,V=I(7657),q=function(O,v){return Q.createElement(V.Z,(0,z.Z)({},O,{ref:v,icon:ne}))},ee=Q.forwardRef(q),Z=ee},35593:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return it}});var z=I(44127),Q=I(72071),ae=I(6620),ne=I(43403),V=I(92310),q=I.n(V),ee=I(29301),Z=I(76846),o=I(96452),O=I(6089),v=I(80402),y=I(34280),u=I(49658),_=I(59301),m=I(96663),N=I(77900),F=I(8654);function M(he){var Oe=he.prefixCls,pe=he.align,Me=he.arrow,$e=he.arrowPos,G=Me||{},te=G.className,ue=G.content,Ae=$e.x,Ie=Ae===void 0?0:Ae,He=$e.y,ct=He===void 0?0:He,gt=_.useRef();if(!pe||!pe.points)return null;var st={position:"absolute"};if(pe.autoArrow!==!1){var Tt=pe.points[0],wt=pe.points[1],At=Tt[0],Ct=Tt[1],bt=wt[0],It=wt[1];At===bt||!["t","b"].includes(At)?st.top=ct:At==="t"?st.top=0:st.bottom=0,Ct===It||!["l","r"].includes(Ct)?st.left=Ie:Ct==="l"?st.left=0:st.right=0}return _.createElement("div",{ref:gt,className:q()("".concat(Oe,"-arrow"),te),style:st},ue)}function w(he){var Oe=he.prefixCls,pe=he.open,Me=he.zIndex,$e=he.mask,G=he.motion;return $e?_.createElement(N.default,(0,m.Z)({},G,{motionAppear:!0,visible:pe,removeOnLeave:!0}),function(te){var ue=te.className;return _.createElement("div",{style:{zIndex:Me},className:q()("".concat(Oe,"-mask"),ue)})}):null}var k=_.memo(function(he){var Oe=he.children;return Oe},function(he,Oe){return Oe.cache}),K=k,b=_.forwardRef(function(he,Oe){var pe=he.popup,Me=he.className,$e=he.prefixCls,G=he.style,te=he.target,ue=he.onVisibleChanged,Ae=he.open,Ie=he.keepDom,He=he.fresh,ct=he.onClick,gt=he.mask,st=he.arrow,Tt=he.arrowPos,wt=he.align,At=he.motion,Ct=he.maskMotion,bt=he.forceRender,It=he.getPopupContainer,Ye=he.autoDestroy,hn=he.portal,Ve=he.zIndex,Se=he.onMouseEnter,me=he.onMouseLeave,Fe=he.onPointerEnter,Dt=he.ready,ut=he.offsetX,Et=he.offsetY,Ke=he.offsetR,_t=he.offsetB,rt=he.onAlign,xt=he.onPrepare,ot=he.stretch,vt=he.targetWidth,$t=he.targetHeight,en=typeof pe=="function"?pe():pe,fn=Ae||Ie,Wt=(It==null?void 0:It.length)>0,Zt=_.useState(!It||!Wt),Fn=(0,Q.Z)(Zt,2),xn=Fn[0],qn=Fn[1];if((0,y.Z)(function(){!xn&&Wt&&te&&qn(!0)},[xn,Wt,te]),!xn)return null;var Yt="auto",an={left:"-1000vw",top:"-1000vh",right:Yt,bottom:Yt};if(Dt||!Ae){var Qt,Sn=wt.points,Zn=wt.dynamicInset||((Qt=wt._experimental)===null||Qt===void 0?void 0:Qt.dynamicInset),Bn=Zn&&Sn[0][1]==="r",gi=Zn&&Sn[0][0]==="b";Bn?(an.right=Ke,an.left=Yt):(an.left=ut,an.right=Yt),gi?(an.bottom=_t,an.top=Yt):(an.top=Et,an.bottom=Yt)}var mn={};return ot&&(ot.includes("height")&&$t?mn.height=$t:ot.includes("minHeight")&&$t&&(mn.minHeight=$t),ot.includes("width")&&vt?mn.width=vt:ot.includes("minWidth")&&vt&&(mn.minWidth=vt)),Ae||(mn.pointerEvents="none"),_.createElement(hn,{open:bt||fn,getContainer:It&&function(){return It(te)},autoDestroy:Ye},_.createElement(w,{prefixCls:$e,open:Ae,zIndex:Ve,mask:gt,motion:Ct}),_.createElement(ee.Z,{onResize:rt,disabled:!Ae},function(ti){return _.createElement(N.default,(0,m.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:bt,leavedClassName:"".concat($e,"-hidden")},At,{onAppearPrepare:xt,onEnterPrepare:xt,visible:Ae,onVisibleChanged:function(Un){var $n;At==null||($n=At.onVisibleChanged)===null||$n===void 0||$n.call(At,Un),ue(Un)}}),function(Yn,Un){var $n=Yn.className,Kt=Yn.style,ni=q()($e,$n,Me);return _.createElement("div",{ref:(0,F.sQ)(ti,Oe,Un),className:ni,style:(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({"--arrow-x":"".concat(Tt.x||0,"px"),"--arrow-y":"".concat(Tt.y||0,"px")},an),mn),Kt),{},{boxSizing:"border-box",zIndex:Ve},G),onMouseEnter:Se,onMouseLeave:me,onPointerEnter:Fe,onClick:ct},st&&_.createElement(M,{prefixCls:$e,arrow:st,arrowPos:Tt,align:wt}),_.createElement(K,{cache:!Ae&&!He},en))})}))}),U=b,j=_.forwardRef(function(he,Oe){var pe=he.children,Me=he.getTriggerDOMNode,$e=(0,F.Yr)(pe),G=_.useCallback(function(ue){(0,F.mH)(Oe,Me?Me(ue):ue)},[Me]),te=(0,F.x1)(G,pe.ref);return $e?_.cloneElement(pe,{ref:te}):pe}),H=j,ce=_.createContext(null),_e=ce;function re(he){return he?Array.isArray(he)?he:[he]:[]}function Y(he,Oe,pe,Me){return _.useMemo(function(){var $e=re(pe!=null?pe:Oe),G=re(Me!=null?Me:Oe),te=new Set($e),ue=new Set(G);return he&&(te.has("hover")&&(te.delete("hover"),te.add("click")),ue.has("hover")&&(ue.delete("hover"),ue.add("click"))),[te,ue]},[he,Oe,pe,Me])}var T=I(29194);function S(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],pe=arguments.length>2?arguments[2]:void 0;return pe?he[0]===Oe[0]:he[0]===Oe[0]&&he[1]===Oe[1]}function R(he,Oe,pe,Me){for(var $e=pe.points,G=Object.keys(he),te=0;te<G.length;te+=1){var ue,Ae=G[te];if(S((ue=he[Ae])===null||ue===void 0?void 0:ue.points,$e,Me))return"".concat(Oe,"-placement-").concat(Ae)}return""}function x(he,Oe,pe,Me){return Oe||(pe?{motionName:"".concat(he,"-").concat(pe)}:Me?{motionName:Me}:null)}function $(he){return he.ownerDocument.defaultView}function C(he){for(var Oe=[],pe=he==null?void 0:he.parentElement,Me=["hidden","scroll","clip","auto"];pe;){var $e=$(pe).getComputedStyle(pe),G=$e.overflowX,te=$e.overflowY,ue=$e.overflow;[G,te,ue].some(function(Ae){return Me.includes(Ae)})&&Oe.push(pe),pe=pe.parentElement}return Oe}function d(he){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(he)?Oe:he}function p(he){return d(parseFloat(he),0)}function P(he,Oe){var pe=(0,z.Z)({},he);return(Oe||[]).forEach(function(Me){if(!(Me instanceof HTMLBodyElement||Me instanceof HTMLHtmlElement)){var $e=$(Me).getComputedStyle(Me),G=$e.overflow,te=$e.overflowClipMargin,ue=$e.borderTopWidth,Ae=$e.borderBottomWidth,Ie=$e.borderLeftWidth,He=$e.borderRightWidth,ct=Me.getBoundingClientRect(),gt=Me.offsetHeight,st=Me.clientHeight,Tt=Me.offsetWidth,wt=Me.clientWidth,At=p(ue),Ct=p(Ae),bt=p(Ie),It=p(He),Ye=d(Math.round(ct.width/Tt*1e3)/1e3),hn=d(Math.round(ct.height/gt*1e3)/1e3),Ve=(Tt-wt-bt-It)*Ye,Se=(gt-st-At-Ct)*hn,me=At*hn,Fe=Ct*hn,Dt=bt*Ye,ut=It*Ye,Et=0,Ke=0;if(G==="clip"){var _t=p(te);Et=_t*Ye,Ke=_t*hn}var rt=ct.x+Dt-Et,xt=ct.y+me-Ke,ot=rt+ct.width+2*Et-Dt-ut-Ve,vt=xt+ct.height+2*Ke-me-Fe-Se;pe.left=Math.max(pe.left,rt),pe.top=Math.max(pe.top,xt),pe.right=Math.min(pe.right,ot),pe.bottom=Math.min(pe.bottom,vt)}}),pe}function W(he){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,pe="".concat(Oe),Me=pe.match(/^(.*)\%$/);return Me?he*(parseFloat(Me[1])/100):parseFloat(pe)}function se(he,Oe){var pe=Oe||[],Me=(0,Q.Z)(pe,2),$e=Me[0],G=Me[1];return[W(he.width,$e),W(he.height,G)]}function ve(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[he[0],he[1]]}function ye(he,Oe){var pe=Oe[0],Me=Oe[1],$e,G;return pe==="t"?G=he.y:pe==="b"?G=he.y+he.height:G=he.y+he.height/2,Me==="l"?$e=he.x:Me==="r"?$e=he.x+he.width:$e=he.x+he.width/2,{x:$e,y:G}}function Re(he,Oe){var pe={t:"b",b:"t",l:"r",r:"l"};return he.map(function(Me,$e){return $e===Oe?pe[Me]||"c":Me}).join("")}function Ge(he,Oe,pe,Me,$e,G,te){var ue=_.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:$e[Me]||{}}),Ae=(0,Q.Z)(ue,2),Ie=Ae[0],He=Ae[1],ct=_.useRef(0),gt=_.useMemo(function(){return Oe?C(Oe):[]},[Oe]),st=_.useRef({}),Tt=function(){st.current={}};he||Tt();var wt=(0,O.Z)(function(){if(Oe&&pe&&he){let Vn=function(Cn,ai){var fi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ni,Wn=en.x+Cn,Qn=en.y+ai,Vi=Wn+Qt,sr=Qn+an,Bi=Math.max(Wn,fi.left),hr=Math.max(Qn,fi.top),zi=Math.min(Vi,fi.right),Zi=Math.min(sr,fi.bottom);return Math.max(0,(zi-Bi)*(Zi-hr))},bi=function(){In=en.y+at,pn=In+an,wn=en.x+Lt,Kn=wn+Qt};var bt,It,Ye=Oe,hn=Ye.ownerDocument,Ve=$(Ye),Se=Ve.getComputedStyle(Ye),me=Se.width,Fe=Se.height,Dt=Se.position,ut=Ye.style.left,Et=Ye.style.top,Ke=Ye.style.right,_t=Ye.style.bottom,rt=Ye.style.overflow,xt=(0,z.Z)((0,z.Z)({},$e[Me]),G),ot=hn.createElement("div");(bt=Ye.parentElement)===null||bt===void 0||bt.appendChild(ot),ot.style.left="".concat(Ye.offsetLeft,"px"),ot.style.top="".concat(Ye.offsetTop,"px"),ot.style.position=Dt,ot.style.height="".concat(Ye.offsetHeight,"px"),ot.style.width="".concat(Ye.offsetWidth,"px"),Ye.style.left="0",Ye.style.top="0",Ye.style.right="auto",Ye.style.bottom="auto",Ye.style.overflow="hidden";var vt;if(Array.isArray(pe))vt={x:pe[0],y:pe[1],width:0,height:0};else{var $t=pe.getBoundingClientRect();vt={x:$t.x,y:$t.y,width:$t.width,height:$t.height}}var en=Ye.getBoundingClientRect(),fn=hn.documentElement,Wt=fn.clientWidth,Zt=fn.clientHeight,Fn=fn.scrollWidth,xn=fn.scrollHeight,qn=fn.scrollTop,Yt=fn.scrollLeft,an=en.height,Qt=en.width,Sn=vt.height,Zn=vt.width,Bn={left:0,top:0,right:Wt,bottom:Zt},gi={left:-Yt,top:-qn,right:Fn-Yt,bottom:xn-qn},mn=xt.htmlRegion,ti="visible",Yn="visibleFirst";mn!=="scroll"&&mn!==Yn&&(mn=ti);var Un=mn===Yn,$n=P(gi,gt),Kt=P(Bn,gt),ni=mn===ti?Kt:$n,Tn=Un?Kt:ni;Ye.style.left="auto",Ye.style.top="auto",Ye.style.right="0",Ye.style.bottom="0";var xi=Ye.getBoundingClientRect();Ye.style.left=ut,Ye.style.top=Et,Ye.style.right=Ke,Ye.style.bottom=_t,Ye.style.overflow=rt,(It=Ye.parentElement)===null||It===void 0||It.removeChild(ot);var Ft=d(Math.round(Qt/parseFloat(me)*1e3)/1e3),tn=d(Math.round(an/parseFloat(Fe)*1e3)/1e3);if(Ft===0||tn===0||(0,Z.Sh)(pe)&&!(0,T.Z)(pe))return;var mi=xt.offset,dn=xt.targetOffset,Rn=se(en,mi),Ai=(0,Q.Z)(Rn,2),yn=Ai[0],mt=Ai[1],J=se(vt,dn),fe=(0,Q.Z)(J,2),Ee=fe[0],De=fe[1];vt.x-=Ee,vt.y-=De;var be=xt.points||[],Ne=(0,Q.Z)(be,2),ke=Ne[0],ie=Ne[1],je=ve(ie),Ze=ve(ke),Ht=ye(vt,je),ht=ye(en,Ze),kt=(0,z.Z)({},xt),Lt=Ht.x-ht.x+yn,at=Ht.y-ht.y+mt,nn=Vn(Lt,at),Pt=Vn(Lt,at,Kt),on=ye(vt,["t","l"]),zt=ye(en,["t","l"]),jt=ye(vt,["b","r"]),Bt=ye(en,["b","r"]),Ut=xt.overflow||{},rn=Ut.adjustX,Ln=Ut.adjustY,Jt=Ut.shiftX,St=Ut.shiftY,We=function(ai){return typeof ai=="boolean"?ai:ai>=0},In,pn,wn,Kn;bi();var Hn=We(Ln),Gn=Ze[0]===je[0];if(Hn&&Ze[0]==="t"&&(pn>Tn.bottom||st.current.bt)){var An=at;Gn?An-=an-Sn:An=on.y-Bt.y-mt;var jn=Vn(Lt,An),ui=Vn(Lt,An,Kt);jn>nn||jn===nn&&(!Un||ui>=Pt)?(st.current.bt=!0,at=An,mt=-mt,kt.points=[Re(Ze,0),Re(je,0)]):st.current.bt=!1}if(Hn&&Ze[0]==="b"&&(In<Tn.top||st.current.tb)){var sn=at;Gn?sn+=an-Sn:sn=jt.y-zt.y-mt;var Dn=Vn(Lt,sn),Ii=Vn(Lt,sn,Kt);Dn>nn||Dn===nn&&(!Un||Ii>=Pt)?(st.current.tb=!0,at=sn,mt=-mt,kt.points=[Re(Ze,0),Re(je,0)]):st.current.tb=!1}var ci=We(rn),Si=Ze[1]===je[1];if(ci&&Ze[1]==="l"&&(Kn>Tn.right||st.current.rl)){var Xn=Lt;Si?Xn-=Qt-Zn:Xn=on.x-Bt.x-yn;var Pn=Vn(Xn,at),ii=Vn(Xn,at,Kt);Pn>nn||Pn===nn&&(!Un||ii>=Pt)?(st.current.rl=!0,Lt=Xn,yn=-yn,kt.points=[Re(Ze,1),Re(je,1)]):st.current.rl=!1}if(ci&&Ze[1]==="r"&&(wn<Tn.left||st.current.lr)){var _i=Lt;Si?_i+=Qt-Zn:_i=jt.x-zt.x-yn;var Ri=Vn(_i,at),ri=Vn(_i,at,Kt);Ri>nn||Ri===nn&&(!Un||ri>=Pt)?(st.current.lr=!0,Lt=_i,yn=-yn,kt.points=[Re(Ze,1),Re(je,1)]):st.current.lr=!1}bi();var bn=Jt===!0?0:Jt;typeof bn=="number"&&(wn<Kt.left&&(Lt-=wn-Kt.left-yn,vt.x+Zn<Kt.left+bn&&(Lt+=vt.x-Kt.left+Zn-bn)),Kn>Kt.right&&(Lt-=Kn-Kt.right-yn,vt.x>Kt.right-bn&&(Lt+=vt.x-Kt.right+bn)));var Mn=St===!0?0:St;typeof Mn=="number"&&(In<Kt.top&&(at-=In-Kt.top-mt,vt.y+Sn<Kt.top+Mn&&(at+=vt.y-Kt.top+Sn-Mn)),pn>Kt.bottom&&(at-=pn-Kt.bottom-mt,vt.y>Kt.bottom-Mn&&(at+=vt.y-Kt.bottom+Mn)));var hi=en.x+Lt,vi=hi+Qt,ei=en.y+at,Ti=ei+an,si=vt.x,Li=si+Zn,ki=vt.y,Pi=ki+Sn,ji=Math.max(hi,si),Wi=Math.min(vi,Li),yi=(ji+Wi)/2,qi=yi-hi,Mi=Math.max(ei,ki),Ci=Math.min(Ti,Pi),er=(Mi+Ci)/2,Ni=er-ei;te==null||te(Oe,kt);var Di=xi.right-en.x-(Lt+en.width),Fi=xi.bottom-en.y-(at+en.height);He({ready:!0,offsetX:Lt/Ft,offsetY:at/tn,offsetR:Di/Ft,offsetB:Fi/tn,arrowX:qi/Ft,arrowY:Ni/tn,scaleX:Ft,scaleY:tn,align:kt})}}),At=function(){ct.current+=1;var It=ct.current;Promise.resolve().then(function(){ct.current===It&&wt()})},Ct=function(){He(function(It){return(0,z.Z)((0,z.Z)({},It),{},{ready:!1})})};return(0,y.Z)(Ct,[Me]),(0,y.Z)(function(){he||Ct()},[he]),[Ie.ready,Ie.offsetX,Ie.offsetY,Ie.offsetR,Ie.offsetB,Ie.arrowX,Ie.arrowY,Ie.scaleX,Ie.scaleY,Ie.align,At]}var nt=I(19127);function pt(he,Oe,pe,Me,$e){(0,y.Z)(function(){if(he&&Oe&&pe){let ct=function(){Me(),$e()};var G=Oe,te=pe,ue=C(G),Ae=C(te),Ie=$(te),He=new Set([Ie].concat((0,nt.Z)(ue),(0,nt.Z)(Ae)));return He.forEach(function(gt){gt.addEventListener("scroll",ct,{passive:!0})}),Ie.addEventListener("resize",ct,{passive:!0}),Me(),function(){He.forEach(function(gt){gt.removeEventListener("scroll",ct),Ie.removeEventListener("resize",ct)})}}},[he,Oe,pe])}var lt=I(48736),dt=I(16089);function yt(he,Oe,pe,Me,$e,G,te,ue){var Ae=_.useRef(he),Ie=_.useRef(!1);Ae.current!==he&&(Ie.current=!0,Ae.current=he),_.useEffect(function(){var He=(0,dt.Z)(function(){Ie.current=!1});return function(){dt.Z.cancel(He)}},[he]),_.useEffect(function(){if(Oe&&Me&&(!$e||G)){var He=function(){var Dt=!1,ut=function(_t){var rt=_t.target;Dt=te(rt)},Et=function(_t){var rt=_t.target;!Ie.current&&Ae.current&&!Dt&&!te(rt)&&ue(!1)};return[ut,Et]},ct=He(),gt=(0,Q.Z)(ct,2),st=gt[0],Tt=gt[1],wt=He(),At=(0,Q.Z)(wt,2),Ct=At[0],bt=At[1],It=$(Me);It.addEventListener("mousedown",st,!0),It.addEventListener("click",Tt,!0),It.addEventListener("contextmenu",Tt,!0);var Ye=(0,o.A)(pe);if(Ye&&(Ye.addEventListener("mousedown",Ct,!0),Ye.addEventListener("click",bt,!0),Ye.addEventListener("contextmenu",bt,!0)),0)var hn,Ve,Se,me;return function(){It.removeEventListener("mousedown",st,!0),It.removeEventListener("click",Tt,!0),It.removeEventListener("contextmenu",Tt,!0),Ye&&(Ye.removeEventListener("mousedown",Ct,!0),Ye.removeEventListener("click",bt,!0),Ye.removeEventListener("contextmenu",bt,!0))}}},[Oe,pe,Me,$e,G])}var et=["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 Gt(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ne.Z,Oe=_.forwardRef(function(pe,Me){var $e=pe.prefixCls,G=$e===void 0?"rc-trigger-popup":$e,te=pe.children,ue=pe.action,Ae=ue===void 0?"hover":ue,Ie=pe.showAction,He=pe.hideAction,ct=pe.popupVisible,gt=pe.defaultPopupVisible,st=pe.onPopupVisibleChange,Tt=pe.afterPopupVisibleChange,wt=pe.mouseEnterDelay,At=pe.mouseLeaveDelay,Ct=At===void 0?.1:At,bt=pe.focusDelay,It=pe.blurDelay,Ye=pe.mask,hn=pe.maskClosable,Ve=hn===void 0?!0:hn,Se=pe.getPopupContainer,me=pe.forceRender,Fe=pe.autoDestroy,Dt=pe.destroyPopupOnHide,ut=pe.popup,Et=pe.popupClassName,Ke=pe.popupStyle,_t=pe.popupPlacement,rt=pe.builtinPlacements,xt=rt===void 0?{}:rt,ot=pe.popupAlign,vt=pe.zIndex,$t=pe.stretch,en=pe.getPopupClassNameFromAlign,fn=pe.fresh,Wt=pe.alignPoint,Zt=pe.onPopupClick,Fn=pe.onPopupAlign,xn=pe.arrow,qn=pe.popupMotion,Yt=pe.maskMotion,an=pe.popupTransitionName,Qt=pe.popupAnimation,Sn=pe.maskTransitionName,Zn=pe.maskAnimation,Bn=pe.className,gi=pe.getTriggerDOMNode,mn=(0,ae.Z)(pe,et),ti=Fe||Dt||!1,Yn=_.useState(!1),Un=(0,Q.Z)(Yn,2),$n=Un[0],Kt=Un[1];(0,y.Z)(function(){Kt((0,u.Z)())},[]);var ni=_.useRef({}),Tn=_.useContext(_e),xi=_.useMemo(function(){return{registerSubPopup:function(Xe,Xt){ni.current[Xe]=Xt,Tn==null||Tn.registerSubPopup(Xe,Xt)}}},[Tn]),Ft=(0,v.Z)(),tn=_.useState(null),mi=(0,Q.Z)(tn,2),dn=mi[0],Rn=mi[1],Ai=(0,O.Z)(function(tt){(0,Z.Sh)(tt)&&dn!==tt&&Rn(tt),Tn==null||Tn.registerSubPopup(Ft,tt)}),yn=_.useState(null),mt=(0,Q.Z)(yn,2),J=mt[0],fe=mt[1],Ee=_.useRef(null),De=(0,O.Z)(function(tt){(0,Z.Sh)(tt)&&J!==tt&&(fe(tt),Ee.current=tt)}),be=_.Children.only(te),Ne=(be==null?void 0:be.props)||{},ke={},ie=(0,O.Z)(function(tt){var Xe,Xt,On=J;return(On==null?void 0:On.contains(tt))||((Xe=(0,o.A)(On))===null||Xe===void 0?void 0:Xe.host)===tt||tt===On||(dn==null?void 0:dn.contains(tt))||((Xt=(0,o.A)(dn))===null||Xt===void 0?void 0:Xt.host)===tt||tt===dn||Object.values(ni.current).some(function(qt){return(qt==null?void 0:qt.contains(tt))||tt===qt})}),je=x(G,qn,Qt,an),Ze=x(G,Yt,Zn,Sn),Ht=_.useState(gt||!1),ht=(0,Q.Z)(Ht,2),kt=ht[0],Lt=ht[1],at=ct!=null?ct:kt,nn=(0,O.Z)(function(tt){ct===void 0&&Lt(tt)});(0,y.Z)(function(){Lt(ct||!1)},[ct]);var Pt=_.useRef(at);Pt.current=at;var on=_.useRef([]);on.current=[];var zt=(0,O.Z)(function(tt){var Xe;nn(tt),((Xe=on.current[on.current.length-1])!==null&&Xe!==void 0?Xe:at)!==tt&&(on.current.push(tt),st==null||st(tt))}),jt=_.useRef(),Bt=function(){clearTimeout(jt.current)},Ut=function(Xe){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Bt(),Xt===0?zt(Xe):jt.current=setTimeout(function(){zt(Xe)},Xt*1e3)};_.useEffect(function(){return Bt},[]);var rn=_.useState(!1),Ln=(0,Q.Z)(rn,2),Jt=Ln[0],St=Ln[1];(0,y.Z)(function(tt){(!tt||at)&&St(!0)},[at]);var We=_.useState(null),In=(0,Q.Z)(We,2),pn=In[0],wn=In[1],Kn=_.useState([0,0]),Hn=(0,Q.Z)(Kn,2),Gn=Hn[0],An=Hn[1],jn=function(Xe){An([Xe.clientX,Xe.clientY])},ui=Ge(at,dn,Wt?Gn:J,_t,xt,ot,Fn),sn=(0,Q.Z)(ui,11),Dn=sn[0],Ii=sn[1],ci=sn[2],Si=sn[3],Xn=sn[4],Pn=sn[5],ii=sn[6],_i=sn[7],Ri=sn[8],ri=sn[9],bn=sn[10],Mn=Y($n,Ae,Ie,He),hi=(0,Q.Z)(Mn,2),vi=hi[0],ei=hi[1],Ti=vi.has("click"),si=ei.has("click")||ei.has("contextMenu"),Li=(0,O.Z)(function(){Jt||bn()}),ki=function(){Pt.current&&Wt&&si&&Ut(!1)};pt(at,J,dn,Li,ki),(0,y.Z)(function(){Li()},[Gn,_t]),(0,y.Z)(function(){at&&!(xt!=null&&xt[_t])&&Li()},[JSON.stringify(ot)]);var Pi=_.useMemo(function(){var tt=R(xt,G,ri,Wt);return q()(tt,en==null?void 0:en(ri))},[ri,en,xt,G,Wt]);_.useImperativeHandle(Me,function(){return{nativeElement:Ee.current,forceAlign:Li}});var ji=_.useState(0),Wi=(0,Q.Z)(ji,2),yi=Wi[0],qi=Wi[1],Mi=_.useState(0),Ci=(0,Q.Z)(Mi,2),er=Ci[0],Ni=Ci[1],Di=function(){if($t&&J){var Xe=J.getBoundingClientRect();qi(Xe.width),Ni(Xe.height)}},Fi=function(){Di(),Li()},Vn=function(Xe){St(!1),bn(),Tt==null||Tt(Xe)},bi=function(){return new Promise(function(Xe){Di(),wn(function(){return Xe})})};(0,y.Z)(function(){pn&&(bn(),pn(),wn(null))},[pn]);function Cn(tt,Xe,Xt,On){ke[tt]=function(qt){var Oi;On==null||On(qt),Ut(Xe,Xt);for(var fr=arguments.length,ar=new Array(fr>1?fr-1:0),tr=1;tr<fr;tr++)ar[tr-1]=arguments[tr];(Oi=Ne[tt])===null||Oi===void 0||Oi.call.apply(Oi,[Ne,qt].concat(ar))}}(Ti||si)&&(ke.onClick=function(tt){var Xe;Pt.current&&si?Ut(!1):!Pt.current&&Ti&&(jn(tt),Ut(!0));for(var Xt=arguments.length,On=new Array(Xt>1?Xt-1:0),qt=1;qt<Xt;qt++)On[qt-1]=arguments[qt];(Xe=Ne.onClick)===null||Xe===void 0||Xe.call.apply(Xe,[Ne,tt].concat(On))}),yt(at,si,J,dn,Ye,Ve,ie,Ut);var ai=vi.has("hover"),fi=ei.has("hover"),Wn,Qn;ai&&(Cn("onMouseEnter",!0,wt,function(tt){jn(tt)}),Cn("onPointerEnter",!0,wt,function(tt){jn(tt)}),Wn=function(Xe){(at||Jt)&&dn!==null&&dn!==void 0&&dn.contains(Xe.target)&&Ut(!0,wt)},Wt&&(ke.onMouseMove=function(tt){var Xe;(Xe=Ne.onMouseMove)===null||Xe===void 0||Xe.call(Ne,tt)})),fi&&(Cn("onMouseLeave",!1,Ct),Cn("onPointerLeave",!1,Ct),Qn=function(){Ut(!1,Ct)}),vi.has("focus")&&Cn("onFocus",!0,bt),ei.has("focus")&&Cn("onBlur",!1,It),vi.has("contextMenu")&&(ke.onContextMenu=function(tt){var Xe;Pt.current&&ei.has("contextMenu")?Ut(!1):(jn(tt),Ut(!0)),tt.preventDefault();for(var Xt=arguments.length,On=new Array(Xt>1?Xt-1:0),qt=1;qt<Xt;qt++)On[qt-1]=arguments[qt];(Xe=Ne.onContextMenu)===null||Xe===void 0||Xe.call.apply(Xe,[Ne,tt].concat(On))}),Bn&&(ke.className=q()(Ne.className,Bn));var Vi=(0,z.Z)((0,z.Z)({},Ne),ke),sr={},Bi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Bi.forEach(function(tt){mn[tt]&&(sr[tt]=function(){for(var Xe,Xt=arguments.length,On=new Array(Xt),qt=0;qt<Xt;qt++)On[qt]=arguments[qt];(Xe=Vi[tt])===null||Xe===void 0||Xe.call.apply(Xe,[Vi].concat(On)),mn[tt].apply(mn,On)})});var hr=_.cloneElement(be,(0,z.Z)((0,z.Z)({},Vi),sr)),zi={x:Pn,y:ii},Zi=xn?(0,z.Z)({},xn!==!0?xn:{}):null;return _.createElement(_.Fragment,null,_.createElement(ee.Z,{disabled:!at,ref:De,onResize:Fi},_.createElement(H,{getTriggerDOMNode:gi},hr)),_.createElement(_e.Provider,{value:xi},_.createElement(U,{portal:he,ref:Ai,prefixCls:G,popup:ut,className:q()(Et,Pi),style:Ke,target:J,onMouseEnter:Wn,onMouseLeave:Qn,onPointerEnter:Wn,zIndex:vt,open:at,keepDom:Jt,fresh:fn,onClick:Zt,mask:Ye,motion:je,maskMotion:Ze,onVisibleChanged:Vn,onPrepare:bi,forceRender:me,autoDestroy:ti,getPopupContainer:Se,align:ri,arrow:Zi,arrowPos:zi,ready:Dn,offsetX:Ii,offsetY:ci,offsetR:Si,offsetB:Xn,onAlign:Li,stretch:$t,targetWidth:yi/_i,targetHeight:er/Ri})))});return Oe}var it=Gt(ne.Z)},86878:function(qe,xe,I){"use strict";I.r(xe),I.d(xe,{default:function(){return Ve}});var z=I(955),Q=I(6848),ae=I(12563),ne=I(93948),V=I(28103),q=I(71418),ee=I(66104),Z=I(57809),o=I(79817),O=I(43418),v=I(59301),y=I(89070),u=I(36371),_=I(83312),m=I(86248),N=I(55874),F=Object.defineProperty,M=Object.defineProperties,w=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,U=(Se,me,Fe)=>me in Se?F(Se,me,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):Se[me]=Fe,j=(Se,me)=>{for(var Fe in me||(me={}))K.call(me,Fe)&&U(Se,Fe,me[Fe]);if(k)for(var Fe of k(me))b.call(me,Fe)&&U(Se,Fe,me[Fe]);return Se},H=(Se,me)=>M(Se,w(me)),ce=(Se,me,Fe)=>new Promise((Dt,ut)=>{var Et=rt=>{try{_t(Fe.next(rt))}catch(xt){ut(xt)}},Ke=rt=>{try{_t(Fe.throw(rt))}catch(xt){ut(xt)}},_t=rt=>rt.done?Dt(rt.value):Promise.resolve(rt.value).then(Et,Ke);_t((Fe=Fe.apply(Se,me)).next())});const _e=[{name:"\u6839\u8282\u70B9",src:"/images/one.svg",color:"#CC7CF5"},{name:"\u8BFE\u7A0B",src:"/images/kc.svg",color:"#3241F7"},{name:"\u7AE0\u8282",src:"/images/zj.svg",color:"#5e54e7"},{name:"\u77E5\u8BC6\u70B9",src:"/images/zsd.svg",color:"#FFDF55"},{name:"\u5B9E\u8BAD",src:"/images/sx.svg",color:"#4E9DFF"},{name:"\u4F5C\u4E1A",src:"/images/zy.svg",color:"#445DF3"},{name:"\u89C6\u9891",src:"/images/sp.svg",color:"#6BC4DE"},{name:"\u8BFE\u4EF6",src:"/images/fj.svg",color:"#6BDE73"},{name:"\u8BD5\u5377",src:"/images/sj.svg",color:"#2D9534"},{name:"\u5176\u4ED6",src:"/images/qt.svg",color:"#2D947C"}],re=(Se,me)=>{const Fe={};let Dt=null;return Se.forEach(ut=>{Fe[ut.properties.uuid]=H(j({},ut),{id:ut.properties.uuid,children:[]})}),me.forEach(ut=>{const Et=Fe[ut.startNodeUuid],Ke=Fe[ut.endNodeUuid];Et&&(Et.id=Et.properties.uuid),Et&&Ke&&Et.children.push(Ke)}),Se.forEach(ut=>{!me.some(Ke=>Ke.endNodeUuid===ut.properties.uuid)&&(Dt=Fe[ut.properties.uuid])}),Dt},Y=(Se,me)=>{const Fe=Se.getParentData(me.id,"tree");return Fe?me.style.x>Fe.style.x?"right":"left":"center"};var S=({loading:Se,nodes:me=[],relationships:Fe=[]})=>{const Dt=(0,v.useRef)(null),ut=(0,v.useRef)(),Et=(0,v.useRef)(0);(0,v.useEffect)(()=>{(me==null?void 0:me.length)>0&&Ke()},[]);const Ke=()=>ce(void 0,null,function*(){var rt,xt,ot;const vt=re(me==null?void 0:me.map((Wt,Zt)=>{var Fn,xn,qn,Yt,an;return H(j({},Wt),{key:Zt,title:(Fn=Wt==null?void 0:Wt.properties)==null?void 0:Fn.name,newcolor:parseInt((xn=Wt==null?void 0:Wt.properties)==null?void 0:xn.color)===1?"#CC7CF5":((qn=_e==null?void 0:_e.find(Qt=>{var Sn;return(Qt==null?void 0:Qt.name)===((Sn=Wt==null?void 0:Wt.properties)==null?void 0:Sn.nodeType)}))==null?void 0:qn.color)||"#2D947C",colornodeType:parseInt((Yt=Wt==null?void 0:Wt.properties)==null?void 0:Yt.color)===1?"\u6839\u8282\u70B9":((an=_e==null?void 0:_e.find(Qt=>{var Sn;return(Qt==null?void 0:Qt.name)===((Sn=Wt==null?void 0:Wt.properties)==null?void 0:Sn.nodeType)}))==null?void 0:an.name)||"\u5176\u4ED6"})}),Fe==null?void 0:Fe.filter(Wt=>Wt.type==="\u5305\u542B"));ut!=null&&ut.current&&((rt=ut==null?void 0:ut.current)==null||rt.destroy());const $t=(0,N.RN)(vt),en=(xt=$t.nodes)==null?void 0:xt.filter((Wt,Zt,Fn)=>Zt===Fn.findIndex(xn=>xn.id===Wt.id)),fn=(ot=$t.edges)==null?void 0:ot.filter((Wt,Zt,Fn)=>Zt===Fn.findIndex(xn=>xn.source===Wt.source&&xn.target===Wt.target));_t({nodes:en,edges:fn})}),_t=rt=>{var xt,ot;ut.current=null,ut.current=new N.kJ({container:Dt.current,autoResize:!0,autoFit:{type:((xt=rt==null?void 0:rt.nodes)==null?void 0:xt.length)>20?"view":"center",options:{direction:"both",when:"always"}},animation:!(((ot=rt==null?void 0:rt.nodes)==null?void 0:ot.length)>300),data:rt,node:{style:{labelText:vt=>vt.title,labelFill:"#333333",fill:vt=>vt.newcolor,labelBackground:!1,labelPlacement:function(vt){const $t=Y(this,vt);return $t==="center"?"right":$t},ports:[{placement:"right"},{placement:"left"}]},animation:{enter:!1}},edge:{type:"cubic-horizontal",animation:{enter:!1}},layout:{type:"mindmap",direction:"H",getHeight:()=>32,getWidth:()=>32,getVGap:()=>4,getHGap:()=>80,getSide:vt=>(Et.current++,Et.current%2==0?"left":"right")},behaviors:["zoom-canvas","collapse-expand","drag-canvas"]}),ut.current.render()};return v.createElement("div",{style:{height:"100%"}},v.createElement(q.Z,{spinning:Se,className:"mt60 w100",tip:"\u52A0\u8F7D\u4E2D..."}),v.createElement("div",{style:{height:"100%"},ref:Dt}))},R=I(85057),x=I(99064),$=I(3294),C=I(23210),d={NextAbility:"NextAbility___wLOPq",AnchorDomStyle:"AnchorDomStyle___CG1xj",AnchorDom:"AnchorDom___jjRxi"},p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1lJREFUWEfFl09oXFUUxn/nvTEpbXXRos4bgwgGRYtZCIILhQSFtgEjgnShCNJV05pMqQstpV1UjW6seY1pFERB6EYEJVJbRMmALgqCixTFlgoupjOjUhdNo0068z65w0ycmcxMJmbk3e39zne+d/69c40Oz45P1PPnbwxZxEgkHjQjJUg5c4OcRM4zfpLH7LY7mftxjy13Qm1rge6ZVnK5yLEInkfctha+fG9c8+B0T4Ljvx6wQjublgL6T6r3L3EkEoeALR05Xg1a9IwTm403Lo/bUjOOpgLcV98o8hni0f/ouN7MOL8pwTPNorFKQN+kBkrGGYm+rjivkJiR9T2Gs2N2oZa3ToD78qUi33fbedWhE9Gb4JHaSKwIcDm/LjJdC3ur8BnntxqD1ZpYEZAKdTwSR7sZ9lZcnvFaLm3HKi0M5aK7yeUNVPt6dS9uuoV+l4pyBFKhTkVidL0sG8F7xkwubfvNTbiref7oeMhsxGt9+V/bHnC7BVPaqRLnusW7Hh7z2WWpUNOR2N/W0Jj3jBcRd0fi8zqsMW/iKYzDEvs8n6cxslGJjxAD7Xg945QlJzUHDLbuGj72U+zL7rG/g0k9Jvi2FpvwGcqOWSYI9abEqwaP5w/ad6n3tVk3eE/ihTYiMhaEuihx3yqQIYwDhXGbcXfJk3qWiA+BW1ewxheFtI3cO6M7FpfKXeTuFvDYWxi3Tyt2o4jpMlvDMeOSJUMtILY2EfBNIW1PDs4pcfECbyni5QZM0fN5KDdmPwehZlz462rMOHH/AK9khqyYDPU14okmPq63FGDGuXzadt/1rrZHRU4LdtYSVNsomNYDusk8kGgQ8JXn89yVl+xqEOqsxK4mqVhonQIo4jNSGLOzkiwIOWQwIehxYd7SS/8vo/Z7MtQsrggrx2BZxpH8OG+bmZJT2k2J2UaB5SlYTkG7IjRk8M62gMNuw0mGGkacMXg9f9CO9k1psFjCFfG/x2fYiS5vUAUm5PaJJvmvGGRcG645BQ1+8Dz2lowUJb40mJTHBMLltr7VfIY9UVDEB4KH12zD2AdR7KPYhaiTNKxnxHaCXfkZOXDsv+NKFOJbSJyA2FeyaipiW0qrhRPrWl4VEevDpCoi1qdZbR/H9jhtHCb/1/P8H/hZr0qiHgOCAAAAAElFTkSuQmCC",P="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA/1JREFUWEe1l19oW2UYxp/nNMmWdO1cZmcSW3TYKWwKoh3MmdBVUOmEDSeINvNGGEwRLwRR0Y12FHF44c2qTvEuCaNCRS+KiJiQP512eOFFB3XzX7FNXVnLlrRL8+e8ck6XmS45OUc9O5fnfO/7/L7n/b7vvB9h8dk1OuVaLF3po1QOqMBOEgGBBLRwgnMimFOA88KWr7zOzfGpZ3cVraSm2aC7Ryd9xVLxuCoSBqTdbPzad14lJeba6DnxxzM92WYxhgDd4xc2rCxl31YFrwFotSZcN2qZ5AetW3zDF/fvWG2UoyGANutCcfULQPb8R+GbwvjDBrf76UZu1AF0RiYeqKA8LkCnPeLXiwLOKg48Nftc6KfavOsAtJmvFgvn7BavChKcdbndu2uduAGg1Ty/OJ+wz3YD/4jJjYGu3t/7thfWdtD1JxBNnlAFx+y03SgXyeFsOKRr6QBri65w0Wi1EyiAvGaUUASbAVGswhNccbnd3VopdIBANP2hKupLBtuk0N6mbJs+GMwZCfijqXEAPSLS8S8gTmcPh45SO+EuFxcXjA4ZkkvZcMjbLLE/kvrY4VBOlSvqd9YhmNvq8t5Of3TiSZHy103qZQ4QTUYgzAO4SyiPQ9BixQkq7GcgkhpRIS//H4DaWF8kqR29PisACpWP6Iuk4oDsu0UAywQ+BRkUkZ56DSboj6amReReKwAyiV4Qz9eNJcbYg2+09zccIPIk+7MDoXTgzNmH1HLpx5vjSP5MXzSZg2CTFQArtuoAxKaquA4VTb0HkTcagOe1ElwFpM0OgEER5XQ0dQkKD2cHQvrC9kfSbwnUdxvnZ862Egw9LN9+EsucEshZCPo7OtqPLCzkXjUW1xuZaVsWoTZzXZwS02reOTrRXSlVPheRB5uWjYzbsg190fSxFiA9Gw7GzW2vQSJHbDmIfJHUZ0fDwSODpNq85uv9UBTlCVuOYl8sdZICHwTXBHgREKfpjiGu3Hmfp8P8Z0SsOkH/TDi0ZJRUWwOJBJRf59JtJcGfAvGYA3BkPhx6xdLvGESZgrJZUiEcEDjMxoHIu+nq/m1gz1//NCSR9JAK9bhpsB0DyMH5cGhIS7W+JVvKxiF4xA6NJgdbxuv0Pla9uKxrSrfHvr+jIMVzIui6FRAEZzweZfcvhx69VM1f15Z3ncncX65Uxu2G0MSdCvfPDASnaifX8GKiO6EWxwTYa4cTJDMet3KoduaGDlQ/6K1a+fKbELze7G/ZHJA5kO9vdW45aXRZNb2c3jOW2ba8Iu8Q6gsC3GbFEa2PFGGk1cPhRrM2LUEjkX1xcVyYT/WqKg8A2CmAn4B+PRdgjoDWip1XqHy5w783meij6bmhxf4NftTdgSGLQUwAAAAASUVORK5CYII=",W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAsVJREFUWEfFl0tIVGEUx39nZsxoKpGISlqmC42gxwxCEApBUhC0iR7bMLRyhrZRC6Ntecc0CtoVRRshkbKN0iJ0RmtRBj0WLUKLoEAz0po5cWe4zdWZO/czJuauzz3n9/3P6/sE02/qwSp+fm5FM4dRbUSlDqEu+7syjeg0Iq+RwENWbxqh6eiiiWvxNZrq28z870vASdD1vvZZA5kF7hIOddN05lOpf7wB3iWq+aYXED2PEjYLvMxKmEflKrVyhfquhWI+igPkTj0A2vxPgQt+kjHCoSPF1CgEmOzZQVqGQLeWJ7jjRT4SCBxkz7mXbr9LAXInT5U/uAsiHIq4lcgD5HI+Wj7ZvfSTMWqlxamJPEDS6ga9WF7ZPSEuE43ZnUUOwJb+x6/3ntUujBOqPsbOjg+egBNWK6qDRh1jd8eaqm12KnIASasftMPTuXCKSPy2rzrPr+8jnR5Cda2vLXKDaKxTsCfc/MyXkkNGAieIdN3zdwqkevei6UfAutL2Mkt4y0ZhsvcA6fTjksYrAbAdTSaaSeuw7+QMBtuECauPjHaWFcB2lkrE0cy1kn4D0i+kekZQWsoOMJHoIJPpL+2XUSFpvQFtMAZIWneA7Xl7HSQaL2xfEwDkrZCy5nyr1l0DKasdJT+mg7xgd2yg4AAmACLfVw4wcbMGqCqqWM3CIvVd9ioGEwCYM0yBHCcSu591nLLGUY16pGyYaLzNHCCbApMidAMkdqIUv5gE5OvfbWeigNhFaNSGSwD2o7KhqAIhmWHX2afGCmTb0GgQuQCSPc+ASFEAkSdEYoeMAbKDyGgUuwCM5rFJETqj2GgZyWkisVumsXPF6jcJnWVkG/uuY3lFMNhOpsp7HbvpMgsNoPaGbSyequXrOKdCBS8kNkDFr2ROKip2KXWSVdFruQNR0YeJA1HRp5m7dyr2OF3ewP/pef4HW7pxo3nDj9QAAAAASUVORK5CYII=",se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA75JREFUWEe1l19sU2UYxn9v2dwGzmSoEZJtRhY1StAQtN2YkEUiYOL/C6LhQtPWLQwXwXAlRKsXcjMUJQzFrUaCesGFjptBREJ0iXQmXOGCIQKJZDH4Z2Jm6UZ7HnNqCx30z2ktJ2lz8p3ned7ne8/7ft/5DI9Xb5dunonzJLDSgWVAi0GTjGlgIvM76RPDzXP5NnLMkl6krRSoe7naUileF7yAaCiFd5+bMYn4pL6Rd3Z/Y38U4xQ0EInId/4QbzhiG2KOl8DXYgwu4mP7mhb61x2wVD6NvAb6Vuj2+AyfSTxWSeDrOMaRulrW7Rm1yTwmZw+FOrQUh4MSzVUJnhUxTtfVsnbPqJ3J1Z2Vge4u3ZaMc8ItsKoGv2riVE0j7XuP2MWrQ5k7953/MsKIxOobEjwjanBozZ08ka2JKxkItyviOLx5I4NntX3GK4Mx253uGPfPbbVkip8qrfayTRsX6htoGzhmU2kDoYCGJIJehAx+NzgsuF+w1AunACYSHbO3zF3hEpe44GWRMWPKxAODY3Y2bdyvZ4B+QVu5Rsw4OxSzRRYK6HmJLzwKHI6O2dpcbN/jqotPsgmxVaLRo04a5jMedA18KNHjkfhldMyey4ft7dKC6Utsl3gxW1ulNH0+tlnQrzHg4VLgzPOCBrL8YKce4jLvA8tLaZqx383ArxJ3lAJ7NXDFSLtew2FHUV3jqIX8Sgjqqm0g013jEvcV1DZOWTCguJcOKDcDLj7o18/AokIGDH50MzAhWFjNDLid8c+f7EBsLKZrxtduDYxKdFbLwMsdejaVor/YzLOxDD61sF8fOND3fw10d2hJ0mEn4lGPWu46sMXCAT3tiK88kYyj0ZitysVuXKVbE1O8Legpdy+pNe6xzPtyl+JbSpowEjVG597jdiLSpZrzCXolIhJNJbnXAozxaMwWpzejYEDvITZ5EjESBj9I3A0s8MTJA/IZmwdjtvO/7XiFFiZnOIOor1SwLJ5xrrWVeyMHbCb3g2SD4zBQllCFYJvD+qHv7XOXPuubMOzXfgfWV6jrjWbsi8bM3bDS1ywDW1Zr3uRfxASLvamVhzLj+Nz5dO0aMfc0db0BdyTs112OMYxYUp58cXQ6+E08tes7+y0XmfdgsrlDDX87DEi8VBUTxr558+nOnXnBDOQGDPsVcox3Pa0R+Zwa58zH1mzB5YeUmOKGR9R0OcmrEiHPpyVj3AcfN7cy4LZasRAlT8dZsiTraaczKVaasUyixYwmxDTGBGIC42QNDH8Us9NeX92/T9xk1NzUiXsAAAAASUVORK5CYII=",ve="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAAAAXNSR0IArs4c6QAAAu5JREFUSEvlll1IU2EYx//PcW6JSuRFBRVB1I2Qtk3dh1JSXiVRF1bQXaFUBJ5tFFGCLLywTbTtUAwREoIKvIgI+iAqL3Jf0jYUpKsIiogkAsv8aOs8dWyT09zcZnrVe/m+/+f/4/2/7/ucQyhg1I+4ymeLdK0AtQHYQkT3E0LCPVbnmMjXhvIR1o72bvuZ0LSDuA2g9Wk1TIwHMsuuWL09mMtvWeAev6dWEMgBoAWAJpcZGC8Bdkct4kMQcSb9UiA7BUOo4gjAdgANOSEZBMQ0IUN2C9qSu5Ga03G1ZBFYNdZTWjSjPUUMGwg7VgJaWkPvwehLlM4PjFdf+K6sU+OwU/NVV2EH8SUAG1YHtMTlM5jcpNV5yBjwnmDC7TUCpds6qXL4RlmJLjHItHAx1nDw47m54mOLZ2gMS80sczeA3atIjYPxFIRmInRGzGLX37eUmYxBbwsTdQCo/gfwPAM3hQRflYuFMmKeyAxUEWpC3oMyQ7lIhTyNWQYPyCy7x6yOD4qdPiRV5gVMsfcEvFaBcB7AYQBCll3PMMinJbknbLZ9UmvyBur917fHrOfepTqGIdC3E6QRAT4JoDRpOkuALy5rXeP1ZyfBTPqwdJyYy6MW24CiMYQkM5iDOSM1Br0+APuZIJUk5m75Gy5+UwwahwfXTWmn6gTCJi3k50Gr48tCdEGpiQAXwAYmdMfM4uUqv2+jRvgxAmAXAW/lOJmy9lIFyMCZ5E6mwbhDJPdHLPaoOjJj8JqBIbgANKXmU0BjyNPATC8AFP9ulVMyUW2+QDXjNUAjAE8riQHYl36uKaAybwx6WxnoFwiHXpnFRysB5nwtauAfqMcUsdjCC700W3VapDkhakE6UL32PwMDUicTXykoy6SYQGLE0i5lqs0a6dGhoaI3Wz/2giAWAGUm7oqZRGf+vxhp7vqA9wAJ6ARj73JgBkYB6ohZ2p8tp8vrr00xSPZU5ZtpAmMzEbQMmgQQAfO9qFV8kk8SvwBkMTigdig/4QAAAABJRU5ErkJggg==",ye="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAABBRJREFUSEu1ln1MVXUYx7/fc87FQbRaL7PwZZZRDQTOhRxj1mLZqFz9Q8tVWyb34tVirbmsVpvOWfOPXNqGJl7kMvSfbNnLHyWbWfSuw+s95zIYTd0QFGvZ1gvG4J7ze+pc4h0uBLff38/z/Tx7fs8bMctnbuzI1RJOuRCLoSQHhAOyi1Rd4vraYo35HWOlSkLnr3PdvvUUVAJSBGAQwheZilcS6s1S7pUXIGqdCPJS2RJoJbV6QcanwOAmgWyGSPZYH4I90wLNoP0sRXaKIGeWSZjKrEWjvp8Gom7CPQfy50nAkpD4XCe+DyIb5gECyFO3XpN1/7Ha3IHiQNtaJe4RAC3jgB5MOfHPROTBecH+dSb4xS3ZWWsuX716AoJV0FgzDmgGrAMQhNIBG9EgvkvCyD8zaSwbAfqD1jOicCitsDFipPZGLFK4LQks29yT2f/br2cBLPp/gBTd51sUDeddTgKLA/bLSuStNMMugTQgsjCpq3G91VDUlAT6q+y4QArSBSTh6DTKHbhlULLL0yV4MtZYVMaVgfjtCVHn0wVLihNbYhHz7ZJQ+1I3kbgwrG2Qd9MftAKi0JA2IPGRFTErt28X7eNu+xgEFcPaGvVK+gPWVhHsSAuQ/FE3skuj4eW/+6vsnQJ5bdxoI16iP2DvF5FN8waSF3XDWBUN53cXV1uVysXRiZoE9tIMWHshqJkPkMQVzdDui4YLO0tCdrHroAUi104CknU0g/aW4UqaE5Tsg64/YNWvaL0nYN/lQr4Rwc1TaZHY5qX0cRH5YK4wQ9MeO32woMWrSJVwvhXIkum0qCFILypHpPO/Ar00AvojsUjB6dLqtoUDSn0NkTtT6fioLU82vhmwT0KkdLZQb5FqPlYM/Vn7Utdxjs8EI9gWaywqHAIG7WooqZ8NkGCnkalVtL5b0JP8M8HxVGkc7UG+ciZStCsJLK22Fw+40jMTkOCHGdlZVadqc//wqlE50jxdgUzQupR5/Y25P+xZ0j80SwPxHSJq67Sf7R1MwKuxiLnbs0n2mWLTxJslRbGsizWYh5NjryzYfkO/OF1e35A8ISKrJ0YHQ19r1Rd8742rTy7E35w4QVJmhghbEXPjsI3Xh89DyT6SX93xcOHqc83xwyLy1IgB8QuA3QsyFrw3MDBYJ5CHZkr9qC8/14zCNdEwE6PAKuvLf46bck3Hk2cOmkeeeF/0s81xb1LcO1vhKe3Iet0orBkLS6bUDNg/eUuS8OWTaoUS9zkvgLnCSPQK+bq3bKecNv4qu3tSWZN9BPcAGXWUwUcFEhJISaogSHSA2iFNv6k2Gs75a9oCMoPxpynqHQAZAG0Ijmq+7CZvxYx1WrmhPd91Vb5QboPIMggMaOyl4KLyGS3WgTzvJprx/Q3wmMIl7X6GaAAAAABJRU5ErkJggg==",Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAstJREFUSEu9lk1oE1EQx2de06xNxaNSxS+wYltMNi0iBXsSBE/tQawnIZugXtpKUS9VCGgvFgKxF9EkRfHQFA/tSRC9qKAFm2SDKdoKSgVrPUqamK8deSFbt+km2bTb7imZN/v/vbdvvhA0j9MlTzKGk3NB+7TWrv3dfe3Lgb/Z9EsiIMRd56KhEz8r+erZUTU63fJZUugVIH5raba1vRhvzei9IEqxMBBc5GsIGI5OOC7VDSzBAgBwpCiE+JxZGgfnHrUva8U6PXKPUqA3WlsDQs9cSHxnFIr8MxJQ/4YXEJOMkScSEMN8zeslNr0U/whETq0vAkZ6D9tPeb2oGIFilzveVyDyAdHRMqEZQbBe//Cw7Tu3i27ZAwo91r0XRE805AgaAnKn8wOLwq/V1DMiusD/M2zoj4ROTqkCpwcW92SSqUUA2qsrirgiNNuOz463/qkFXQuarivzLYV8bgEJXkcnHH3r7s4ljylAN6qKIY7FQo5bhoHcsdMT67dahFn1MxZt7sQxRcknAMhaXQyzjFk6IsGOr9X81k6o58RhRPmnRNRda+el6H6PaLlcDaoLLN7Zauo2EAzVPln5VjALCH6h2XZP707XAXnozyzFXQQwCkT7jJyqog/iCgKM9B6yT2hT5n/QSLEzCqGfgDq3BCp7mecpQxpSiwM6pc/7gTI+3eQ3kczLIKAwjKIr9gkAOkzUriaVQKcUSxBB+44BebtJZ9M+tQNsGxhhqsnaNLwWNMVOoIC/vDhveQOIUcZgKBJwvC3mqlaw2BF+xCVQYLRi3TS8A/wNDEb6DtpDummh1eGJn0um7igAg5tJfAbwoHG37W7NxC/fvHh1vhVzuSfbXtrWdYqdLN4qWJTk+0B00/T2VEmwVMwXKtbXzTTgWsHnlGQ3EfFBa8OD9Y4YtWB83bQhyghM9TFlTKwHyH1NGYTrgW511P8HVz1GsEaaZFwAAAAASUVORK5CYII=",Ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAcCAYAAAB2+A+pAAAAAXNSR0IArs4c6QAAB/FJREFUSEuVV1uInVcV/vblv51z5nIyk2ScZJI0GfCCYttJAjYv+iS+2BfxoVoFNUwKxQsK5tLWiTH44A2hD+1QUExRtNUmTdpYseiLIqKGChVJ0lwmaZO5ZObMnPv5915L1v7PxKTSgjMc/nP+/e/17bXWt9a3fnWcT21+P0+8ulNtfJ9iNg4ERvGn+lcNBVLwS9xYvsQLs4+Yjz0mS9/hV7fsckPPblcjeytIMmJSJAvBQLHbQCOCRoPz9mu9+eP7B6aOh9Vf0l/PbUH13lW00EIPPXgQh+23wQ0MYlhkiFFCjPM0/7t52z5wnxs/V0Iy1OYcHXbImUBc4CqWj4aFRqIiVFSCTEXuT7ww+Y3s/qvqZXqtt4RGtMB1rKGNDnL42z4X57ZskCJGmRNUkKKMBG24xZjsxhb30OQcbXLoEYW9AigmFBtEMCghQlWVMGYGMOfWDj86vPu76mf0Z3+ZF/WbWMEKt9AOwHd4zECECAnFKAs4MpQ4hmELSUuLcjQpR4c8euTBrMIHpKHFYzYY1ClGVRkTZggO/OxXqnseVt+nV/ILfMPO8QqWVRMdlmAzlEIwoEnBcoSYIyQcoYQECUXQbOCZ0SVC2zv0mOAZIJKNKoAq0ojYoqJSjOkKtpsqMp385ODI3i+ob9HJ7nm+GV/lW1hBC12Vg9fJQWLAQJEKHlqyIdeWIhjWIFZwxAHQExeesgb7IszCSIsoRGqTqmCnrWJYp888sWnffnWQn2+d9zeza2oFdW4HcgmL108sIRMPJG9Mushf/0CFZwIg94vwyvr6M7IOMsgQYVSXsd0MY9SUZo9u3jetvkm/alykxfIN1NBUnR96Vv+ySJQmUsJmeNlrOc+ZmfiDuaevCnPFMy2hRPS6UfGPYxI4IZNV8BrkNXvy8lyUIP76ECe7tkVDqOps9tjYvml1kJ5fu8yLA4uoo63zzwPmnEWqbK5V3C8px5ZzeO7m/sNdl58Q9or3FhYpR3+MsvhrpV7Jyx4LHQrYwbJjYupQFCv9ZEWlH9liKhg0SQF8mH5du0bLQ5JfyW2GBBVOEbOFYRPy1mMfmLtGXaxRD02fh/xKiVU4QRUlDKg01HkEG8Iuue+SR8t75MSBG5t1BWUdzR4bf2BaPUYvLL/Fy9U17krPejJC/I+EYhPDak1KkdbscuYuO9fk3t6mcwfkAEwqsHxIZRcqSL+X6ZgyJLJHGzLwmqjjmbqOIsX6SMxm64jJUDbJ7MzY3gC8dJNqI03kqJnO5Fn15Tdut623ffnk6onJju9cqFMeWCylNaDSX5ze+NmH3mmP3H947rcnU9gHN+gUqY5nj44LsH9hYYHqG5vckzCtZpwuDnJqSipRmpUigjCdVn3Pr1J3dMm1hiXcEkrpYFVd5hGULw+rjCs6MoFc0tiJucnkGy7XXe/vEYZXdSZtc3Zm655p9bg/eWOR6mMNzhGTxSBKGJbuhCTkWBgsfbhGXSz5JhZ8G2uuG2o34xgjqozNegAjOsOAFm6YUH45Mxo+x5qTzialIcCFxzNbp6bVE+7Um/NUH69TFw54yiI+N4DUxlBakZFezz1P1IF3Te93N113/+pt4ATDunRxQCU/kIOWlTWGrAa0dDXqefIt8gakDlk2W4pQJ7MzE/dNq8fdi3MLvj4h4aup3uTZdPodc/yJ2k93+R4uiieOpAIiDKjSz8+Mf/oz75bjz136/cmY7YOjNkOq7ezMRPD49JUFV9++Sl0YmJUE8UJFJTqhSIuySC57RNTyOa1yb9OK61TrXsilAvCQLvEGnV0c4oRTFekYUVHHDO56oqZ3uut5lyGtRmyKzMR9j3un31jwjZ0r1IFmMZYE0qQsFWkDe4s6dlhxHaz4bqhNuZ8gwrDKsEGXMKRSlJTUsQl1LLXb8YSGE7kErNIYtQlKJio8PtJ98cK8b0wuUTN4J1tTTpBIA4GBsDoXBRJwIYvPgyJ5AiKyoXEM6v5hgyQIsA7r3T54OKQxGIukju3s0Yk90+pI5/S/3/Rr7533jSDmskmkTP5FgaQ1ivxJm+x6jzYRemKVjTwRIiMdK4VIpxy1EA3pgjkhOKOVEuJhPC5jKEpmj4rHhztnXp9ztQ+85dYgjcERIZgMclgokbRNKavch9yBPIcDBVGQKYPF02KPCIcoW7En1HPwdtjE2BqXscGmT89smzqgDrbP/POaq33oqqthlXrBM/YqnFzaohgXfRUgqc9g0Mt9EXoD0z/AumavS6LoMXHhbaq0AGJbUsFIlD39bQE+1Hrp3Jyr3XvVrWLZt9Hujy/ibWGkr7HB+7vv/VeXi2lDfhd6LE1Ehi7Ra6BsIoxECXbEAlwqgI80z/5tztWmrrgabvWBRWtFU4MRAYP8FqPFVHHbuIw5d4l/EWYZEZllfJJngYoA2wT3pINyferott2PqEP1l59bpNanJNS3XAdt7wOTJdgSvnUgIVOYevuHCTnuR0SukpLg9fp4K0NbmKuBsrYYjTLsSCoo22T62MTUrHq0eWqcHE4u+Ob9t/K2kWnRSy4F/A7DMsRJzkOO7xjohExCxkAqqOBlmOn7HhuoEOpRm3aqUfybH+14IHS59ZcFfJT/YAfQCEPH0vX2+svE/3TCUq52K9InQHq7hv6LUupLa2nnUvHgVgDX+1f5fR2jZmfAmHrPVGdGFS8adwG/W699+9pDV175YsLmmYb3u5+b/Pjf/5+968/+B+0PhllE845BAAAAAElFTkSuQmCC",nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAAXNSR0IArs4c6QAABflJREFUSEu1V2tsFUUUPmdmdu+j997SQp9AEULCDxNDCCAEQoqC0R/8IRSIVqIYH7GAT2JMNKlEo4bSFowEEyXBBJUS/5AYRB4lijxU4iMSE5CWh214lL7uo3t356Ezu/e2hVsSkrrJ7s7snJ35zjnfOXMG4bbr8rkvdsVLZ9UzKxZVSiKABFA5IQS8/YcRfX8skFBBCxEQiRJuOj108/zOitlr3hg5xaj5Lvz6SV35lEX7vGwSBXdASQ6g/NVHLp1vB8CGJxkhZf7TfQQkDKgVBmpH5eClU/OrFzx7dlilEXAu/b5nbzgx+XHu9Iv0rb+35lcHAAL0TuWV/k7MDP4TjMGI7iilpG6bQbsmWjr9CRYuhmxf53uV8556qyCAjt8+PcCs+AqeHfBmzHnOvou172mo83BjbShxXzsLJ0AMDXxcteDpDQUBXDy782tCQiuFl/Zmzt80fgAONtbaicp2YheBctPbqxe98HJBABfObN9PWHiVEp43c/6GcQNw6dt3llqximOEhUC5mZbqJQ2vjgGgtY3SSB0CeNPnPj9uAC4feX+ZFS07jEhAeemW6iUbxwBwurWNWbE6goRPm7PeuidH30W463jTchop+05HlHQGm6trN71WmAOnW9uoFa8j1OI1s9eNG4Duo82P0Hj5IZAChJNqqa4dwwUXtQXsRB0hNp86u35cAbB4xSElBSgn2VI5FoCO0zvaqB373wCAlNoFdwFwckcbDWkOMD51zvi6gMXKD4GSIJzB5qraDYU50Hlq+z7CoqsRCa+Z+8y4uaDryIfLraJKQ0LlZporal8sDKDjZGsbEluHoUJkV6xwMbVCMYYsTAgyk4oRUYHSLy1lvvg7glJKCyiQgDoNC66Ul+XCSXGZHaRKyhpEBsCdbRVLG14vnIpPNO8DIKulyAKlIWChBLBQHCiLACHM31yQmFsp4QB3U3oiyiLFCtHSPjZaamSCg/SGQA4lQThJAOEBsghQ4E1lSzduHgPAtq+U4Gu4M2g2VSQhoFYEKLUBkQaLUwPGS/VsDcPQriFFQ4zFtrDwhFVm99QgDBAJimdBuo5ZXINnkWJtr6aK5S8VBtD5Y/OX0nXXeplekJ6TX5Bq7ZEC0SCIBmADYXbeKkpwUNwzC2kQqLdiA0SA4twoQ6wwsKJJQAlrKnu4YQwLtH9Qz73MYukMZBV3OAihzN4qEAljABKRUIqUWoQQi4CiqLdbCUKhEFIKLlFyBUIpCQAMpDEKYRQpK2IYTYSRhA9UPfrKNwVdMF6p917mGVVkXDzeNM9C9iZ3Bz3luVwKVxFjT2IKDZ/72gUEASlhWn9lAsA8wdc+iAi/REEFSJmNYEUYsaMWKviobFlD+x0WUOca7evigauKO+U80wfCy/h+1TGncqVWEAWgI8Fvm8ovYD9qw8vRJRzqmoky0LUAjZZoLvQk7MxkvH+1awDmkHT/vOdzFpnwpJu6ATzTD0qHkPD8ksqPd3MHevm1XmABnQm0EXwJkxN8Sf0OiEvtKNBIMbB4ua6K9pYsXFufB/DPiZ0LQqXTfnCT15mbvA5iqB+ENwQohFncLy19ILkElP+mx3IVcCBr/si3dTjrojQCNJIAligHK17BMXltYdHidb+Yea/9sf+C8tyZTv9V4MmbILJJP361BkYbP+vlQRj9RpbfowHm5InJjbpIpYA05AOITQKrZLIGdD42d8Us7P7psy0sMvFtp+8KuANdwFO9INy0yWSGfwGAPAvMpMMaBr1cQvbfhraBQ3TbALCAWlGgsVKwJlQBK50CMtO3BXv+Oph2kzeiTm/Hn7L32mbwklnPlQqopvPoSydjHd25y7T4WDJ6YISsoAjERitcRDFR9i4rn/Egi08cxK4zu4+C4A95g90pN9XzPXpZT0rpaxCQL8fU3BkAdUgGLvDjIEfNHGFzFgik8ucDCykNUVpUspiVVBcjYcf+s3IjuXo0slspuVJm0yEwxFM65SHRjFN625OIavhgYowb+HcUP3InqBEENGcUqYFoPmlCMH1C6iOUHUg8dmv9v8OxoyB3PgAEAAAAAElFTkSuQmCC",pt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAHCFJREFUeF7tnQuUXVV5x//fvnfiK6wiUFnSaoNgYiHknjuDCgUUQXloaAUMVnyAAl1VYQGhEsOcmY5zz81LeSnEqsEHal0SAV0EQQooBQVfzLkYYjNCibLEUhFTSX3M3Hv+7bm5CZkwk9nnfe65+6zFmknyfd/e33/vH+e1z7cF5khEgSU3sPToZsz30FoAkfkA9gXUXMLbSyBzAexFYO7237kXgPbfdTrzDIBtgDxDcJu0f0fnd/UM4Pl//g3IcYXS5oMWYHz9GdJKJJEeDyo9nn/k9Bc6fFmfYD48zKf/E1wA+D9xUOTgwQI8CmAckM1CjENhfJIY32jL48HCGOtdFTCABJwP1RU8xPO845SoN5A8DsDeAUOkbb5VRO726H1bKXX32GWyKe0OdHN7BpBZRq9/JQ/2PBwLzzsGIscAOLCbBxzAYyDvhVL3KoXvPLhcHunyfBLtvgFkGnkrNZ4g4p0MqKMBHp7oCGQeXH4EePeR6rbGkNyReXdy1gEDSGdArNHJo6jUYoEsBrAwZ+OUVnc2EtwgnrfBHe77blqN5rmdngakOsoKS1gsxGKCR+R5oNLum0AeoGCDtLBhbFgaabefl/Z6DpDqah7AJpaQPEWA4/MyEHnuB4G7ROQWKWP92DJ5Is99jbtvPQOItZLz0PTOhci5APaPW8geifckyHUoq3XuctnSCzkXHpDKCs6XVhuMcwDs0wuDmkKOT4O8jiW1rnGZjKfQXmZNFBaQRXUuVN5OMPy31OaIX4FtPiieUuseGpSN8YfPPmLhAFlUZ78izgHoX0rNyV7inujBBCDrPMF1Dw3Kg0XKuDCAHDrCfeb04VKSy4o0QN2Wi4isnpjEmodH5Olu6/t0/S0EIJbDsyC4FOQhRRiUrs9BZBOINa4tX+j2XLoaEGslX80WlwlwercPRBH7T+BGKclqd7n8sFvz60pADhnh3Oc9ezll7jPyPfsm/MuuP01izaYR8Zfpd9XRdYBUHb6jfZ8hqHSV0r3eWaLhgzJmy1e6SYquAWTeCJ+/d9m7HJAPdJPApq+7K8C1W5vqki0j8sdu0KYrAOkfnRjwpHw5BK/vBlFNH2dRgLhHsXnJg8Nzfpx3rXIPSLXefA+pLgewX97FNP0LpMBTIt4lY4Pl6wN5pWyca0Asp7UakEtT1sQ0l6oCXOPapdy+u8olIO31Ux6vAPCWVMfKNJaVArdSydI8ruvKHSAVh6cK2nDMy2q0TLuZKLCFkKUNW27OpPUZGs0VIFadZ4P8XJ4EMn1JWQGR97qD8vmUW52xudwAUnF4voCfyIswph/ZKUDIBQ1brsmuB8+2nAtAqg4/THBlHgQxfciHAgJZPmbLqqx7kzkgVq11BUQuzloI034OFSCvdIdKS7PsWaaAWA5vAehXETGHUWCm2+QNri2nZCVPZoBYjre5U6Izq9xNu92jwLhrK7+ka+pHJoBYjsfUMzUNdr0Crq1Sn6+pN2g5fALgS7t+tEwCGSggv3JtOSDNhlMFxHI8/3vlapoJmrYKp8CYa6v+tLJKDRDL4a0A35xWYqadIisg33RtSWUZUiqAVJzWdQJ5X5GHzOSWrgIEP9uwS36ts0SPxAGxanQgHEw0CxO8NxWg1N0hsZNMPlFAKk7rfIGY5SNJjmCPxyZ4QcMuJbYsJTFAOqtyb+rx8TPpp6AAIacltQo4EUA633N8yyxZT2F2mCZ8BbZQyYlJfE+SCCCW420wHzuZmZuyAre6top92VLsgJjPZFOeFqa5XRSI//PdWAHpFFjo+nKTZs51rwIi3llxFoKIDZB2aR5Vvt1UH+neyVWQnj+lvOZJcZUUigWQdlG3Em83dasKMsW6PQ3inq0tOSmO4nSxAGI5rWtNxcNun1VF6z/Xunbpg1GzigxIu1Yu+K9RO2L8jQJxKyCQM6PWAo4EiF9lfU6J95lC0nEPrYkXiwJEY6IlR0epKh8JkGqdoySHYknGBDEKJKCAiNTGBmU4bOjQgPib16DF+8w+gGGlN34pKTCBkhwddhOf0IBUHO9rZmenlIbYNBNJAX+nq4at3hYmSChA2nsCgrmpfhcmcePTawrI2WH2TAwMiL+bbF8f7jUbZvbaBOvyfEU2TU7imKC77wYGpFrnKrPVcpdPlh7tfnsLuEH5cJD0AwGyqM5+ReZ+V6AgAhjb3lLAExl4aFD84iFaRyBALIfXAkx3j0DyI1qZZGBEYIGI+AXN/P9emEEXgjb5CICfkXxEgKeDOmvZK0V43rPzyv+zf/h/t+PfdrXZ/e9E/G32jtVqK5SRrHVt0X7Drg3IojoXds4eqW67nEWxsKC6V1c88+de64WnichpAE4I6p+oPTEGJTcqDzc9OCQ/TbStGIJbjvftZAHBROcsslGnu9qAWLXWVRC5UCdonDbdAMiu+bbfD3m4DORb49QhRCwX9D7iDpW/HsI3M5cUAAHIq92h0kU6SWoB0vmE1r/3mKsTNE6bbgNkR+6W07oIkH8GsHeceujFkqvQxEfcEdmqZ58fq1QAAbZRyYDOJ7pagFi11hqIfCgLGbsVEF8rq04LxJcAHpqednKGa8v69NqLt6WUAPHPIh91h0qzbhA7KyDWSs5Dq/3kap94pdCL1s2A+Bm+ZgX3nfBwTxqQUMkpjcvErwfQtUdqgPgPKUoy4C6XLXsSa3ZAai0HIpkVfut2QHZectW870FwZFIztyRywI8H5VdJxU8rboqA+GeRujtU2mPhuT0CUl3NAzhJ/5nx/mkJtHs7RQGkfcmV1BOaF8mL3Yu7735jujmVmEbTT+AnpU/6x5bJEzPN7z0CYtV5IcirsoLDb7dIgBw7wvLWMv8tzseYLEl/Y7mMZTlGcbadMiCAyEXuoFwdCpCK490pwPFxChA0VpEAaZ9FanwlpA3JXwXVYnd7Kjm9cZkUqnpl2oAQuKthqzcGBqQ6ygoV3aiDGNW/aIB0IDkPwk9H0ybYG+FobaXnnTYgfmbiiTU2LI3pspzxEsuqcxCkk54007dUREDakNS5HmSobxQAPCp98ro9XTtnPW5h288CEIjY7qDUAwFSdXg/wSPCJhqXX1EBqTo8nOAPw+gk4PvH7NK/hPHNu08WgAjkgTFbpn3COO0ZxBqdPAqq5H9Om/lRVEA6Z5EvgzwzoMjjL3ihWPcvlT8E9OsK8ywAaQvjtY52h/u+u7tI0wJScVorBcHWzSelfpEBqdR5opB+NUr9Q2i7g6VpLwf0g+TXMitACK5q2KXlWoBYjvcTAAvzIGORAfH1rTjeLwR4ma7W9KS/MVycx7q7550VIAA2urY6bFZAKjWeIEJ/b49cHEUHxHJ4B8A3aYr9e9dWL9K07UqzDAEBKSc2huSOXYV7ziWWVWtdAZGL86Ju0QGp1PkxIS/R0ZuCHzcG1eE6tt1qkyUgIK90h0pLZwHEewCC1+ZF4KIDUnU4TGh/Nfkd11ZvyMvYJNGPbAHB990hNeXJ7ZQziDXCeSjzsSQSDxuz8IDUOURyVFMfA4imUKHNmnKgO/LsCt+pgIw2z4RSXw4dPAHHogNScVq2QGqa0hlANIUKbeZ573SHyzuLsU8FpM5rQGp/0B66EwEciw6I5fAygLqPbQ0gAeZOKFORa91BOX+H71RAHG8zgPmhAifkVHhAaq3lEFmhKZ8BRFOoCGbjrq38KjXtYycglRHOlzJ9QHJ1FB2QSp3LhFylKboBRFOoKGZsyoLGiIxPAcSq81yQn4kSOAnfogNiOa1LAVmtqZ0BRFOoSGYi57mDsm4qILXWVyFyRqTACTgXHxD+E8CPakpnANEUKpIZeYM7VHr7VEAcz6+09+JIgRNwLjog1TovIfkxTekMIJpCRTT7rWurdpGS9j3IQocvK4O/iBg0EfeiA1JxWksFcrmmeAYQTaGimjUhL99oy+NtQKp1Hk/yzqhBk/AvOiCWw4sAXqmpnQFEU6ioZiLyxrFBuWs7IDW+n8K1UYMm4V94QGqtCyGiWxjDAJLEJJsmplA+MDYkn2wDYjn+/8H8/5Pl7yg6INU6LyD5cU3lDSCaQkU3k6tcWy7uAOJ9E8DJ0YPGH6HogFSc1vkC+YSmcgYQTaFiMLvNtdWbdwDi7xtxUAxBYw9RdEAsx99vxd93ReswgGjJFIvRo66tDpYlN7D0s3E2YwmZQJCiAxLw/s8AksAcmynkK+dLWfpr/GtPuCnFdgM1VXRAKk7rHwXySU1RDCCaQsVhpiiHiFVrvhWibo4jYBIxCg9Inf8g5Kc0tTOAaAoVixm9UyXgWqBY2g0SpOiAWLXmeRClW2XRABJk8kS25TIfkNWAzLqRSOS2QgYoOiDVGs+hsL0wTuMwgGiIFJ8J10gmO9cGyKDogFTqzfcJ1XWakhhANIWKx0zWSsVpXS+Qd8cTMP4oRQfEqvNskJ/TVO7brq2O07TtSrNMizbsphjBL4rleH75/FPzqmbhAXF4FsDP6+kvd7q26NbQ0guZM6s8AfL/df1u9gHx96qYcX+ErPUrOiBVh+8meL2OzgL51pgtJ+nYdqtNzgC5UyqOd78AmVdxn2lAiw5Ipc53CflFzQndXv6gaduVZnkChMAD/k36TwDmog7vdCNadEAsp/lOQH1JazYTG9whdYqWbZca5QkQQDb6l1j+NriRtwNLajyKDkjV4TsI7qzDNIuO33Bt9daktM5D3HwBgp/7gDwFYN88iNOLZ5DqaPPvqdRXdPQX4qaxIXW6jm232uQMkN/4gPwJwJy8Clr0M0ilzjOE/Kqm/utdW+WusIZm37XMcgbIhAFEa9iSM7IcLgF4g2YLBhBNoWIyawNiLrFiUjNMmKrD0wl+TdPXAKIpVExm7Ussc5Mek5phwlRqPE2EN2r6GkA0hYrJzL9JN495YxIzVJiK0zxVoPzVDDqHAURHpdhsZKN5URibmOECWQ7/DuDXNb0NIJpCxWHWeVFolprEIWbYGNVa828p6hua/gYQTaFiMrvTLFaMScmwYSo1LhbhLZr+BhBNoWIyu9ksd49JybBhrDrfAnKDpr8BRFOoOMw6y939kjN+6Zl8HkV/UVit82SSfl0yncMAoqNSbDay1nxyG5uY4QL113iSJ7xN09sAoilUPGbtT24DbeAST7sBohT9DFKpT54oLN2uKYkBRFOoeMz8og2m7E88WoaMYtX5JpB3aLobQDSFisXML/tjCsfFImXoINXa5BspJf+rTp3DAKKjUkw27cJxpvRoTGqGDLOoxuOU8C5NdwOIplBxmLVLj/qBLMczxavjUDREjEqdbxDybk1XA4imUDGYbS9e3QHEbH8Qg6JhQlRX8PX0+B1NXwOIplAxmO26/YHZQCcGQUOFqDp8HcF7NJ0NIJpCRTfbZQOdgCX4o7cdIELRH/MuGp08RqnSv2tKYgDRFCqq2ZQt2MwmnlHlDO9vreBR8HifZgQDiKZQUc2mbOJptoGOKmd4f8uZ/Bug9F3NCAYQTaGimk3ZBrpzo/40gBdHDRy3f9EvsfodHuGB92vqZgDRFCqi2W9dW+3jx2g/xWoDUmt9FSK5q5hRdEAWjfK1SvEBzQE1gGgKFcmMvMEdKr19KiB1ngvyM5ECJ+BcdECslXw1WvyBpnQGEE2hIpmJnOcOSnvPlp1nkMoI50uZmyMFTsC56IBUHR5O8Iea0hlANIWKYsamLGiMyPgUQDr3IT4g86MEj9u36ID0j04MeKr8I03dDCCaQkUwG3dttWCH/84zSBuQOq8B+cEIwWN3LToglVFWRfFBTeEMIJpChTYTudYdlPOnB2S0eSaU+nLo4Ak4Fh0Qqz5hgeUxTekMIJpChTbzvHe6w+WdxcSnnkFGOA9lPhY6eAKORQekv85FHtnQlM4AoilUaLOmHOiOiF9MsX1MAaR9mVXzHoDgtaEbiNmx6IAcNsrDSooPacpmANEUKpQZ8X13SE3ZTGoaQFpXQOTiUA0k4FR0QCqjPFQUN2pKZwDRFCqUGXmlO1RauqvvcwCp1HiCCL8VqoEEnIoOSHUFD6HHhzWlM4BoChXGjJQTG0My5fPn5wDSvsxyvJ8AyMW2bEUHZGAFX9Xy+FPNATWAaAoVwmyja6vDdvebFpCK01opkA+HaCR2l6IDsqjGBUr4H5rCGUA0hQpqRnBVwy4t1wLEGp08CqqkuwQ7aF8C2RcdkMrIH+dLeY7uCgYDSKDZE8DYax3tDvc9Z1X1tGcQP2zV4f0EM98euuiA9K/kwV6LP9McSgOIplBBzATywJgtR07nMyMgVp2DIJ0gDSVhW3RABmo8qCX0i2boHAYQHZWC2ojY7qDUAwFSHWWFim7QtuK2Lzogi2o8UAn/U1M3A4imUEHMxBNrbFimfVk74xnEb6DieHcKcHyQxuK2LTog1krOQ0t79YIBJOYJRuCuhq3eOFPYPQJi1XkhyKti7lOgcEUHZGAVX95q8ueaohhANIXSNhO5yB2Uq0MBUl3NAzjZXmm6v3aDMRsWHZCA9QAMIPHOryelT/rHlskToQDxnaxay4HIYLz90o9WdEAWjfz+L1X5+Y9rKmIA0RRKy4ysu0Mle0+2e7zEagOy/Rr5xwDaH7GnfRQdkM5Z+peauhpANIXSMHsaJRlwlz+7cnc6n1kB6ZxF1kDkQxqNxm5SdEAG6nxpi5zxFL+boAaQuGYY+VF3qHTpbOG0AKms4Hzx2meRubMFjPvfiw7Iwjr3L5P/pambAURTqFnMtlHJQOOy7d+dR7rE2uFs1VpXQeTC2QLG/e9FB2TRCF+iynxSUzcDiKZQezQjr3aHShfphNI6g/iBFtW5ULF9FpmjEzgum6IDMvAx7tf6I3+tqZcBRFOoPZhNeCIDDw2K1jc42oC070Wc9HfELTogr1nBfSc8PqU57gYQTaFmNpO1ri3ahUkCAbKozv7OWSRyN3UDFB2QQ0f+Z5++8l6/0dTDAKIp1ExmnbOHbhWZ536TPlv71TpXkVw2m11s/05+JLZYcQQSbAW5Baq0BZPY4o7I1ihhrRHujTJ/qxkjMiBLlrD0aD8O9DwcSM97hQAv1Ww7HTOR1wM4NonGRGT12GCw75wCnUH8Th86wn36+nAvyEOSSKILY/qAbAH4sIj6fqs1+YOHhud8XzePgVX8s1aTupAFAsR/+qg8DHiCASEHQLwCgpfr9q1QdiKbJidxzMMj4hdp1z4CA9K5FzkL4Oe1W+k5Q/E/gLpFgFvGbNnj5jgLVnOvF0zyd5oSzQpIe+kKcRoEpwF8nWbcHjCTs11bvhA00VCA+I1UHO9rApwetMEetP8BRK52B2VnMbJdNThkhHPnlPmMpi4zAuIXf/A87wKBvCuL91Wa/c/EjMCNDVu9LUzjoQHpVCX3P8tN9bFvmCTz4CPETZTW5a7d971d+zMwwhe2yvxfzT4+B5CKw78AcL6AfrnM1F/kavY7S7MJlORod7noFgif0tfQgPhRqnWOkhzKMvtua5v03tcYKn9uR7+PvIIv+MPv+XvNPKYAUl3BI0F8luSrNP17zkxEamODMhw28UiAtC8PSrwPgkrYDvSi364VNA7+OJ8393f8o6YOOwHpX8HTPI83avr1phnRmGjJ0ZtGZFtYASIB0j6LOHwHwWmvr8N2qkf8bnVttXjgU+xr/ZoTmjm3AbFqzfMg6tOaPj1rJpAzx2z5ShQBIgPiN245rWsB+UCUjvSkr8hIaT+sCAKIeFKnol+e5kU9qZl20lzr2iXtN+YzhY0FkHkjfP7eJd4Ogf+SxxwBFNi7KX1by5zUdFkP8JeAaC2004xZPDPinq0tOWnLiOheus6oQSyA+NE7OyXdDmC/4imeXEZuU0pWmS3NFtaDOBiCqqZ9L5o9pbzmSQ8Oz/EX1kY+YgOkfT9Sb76HVIFfxkTOoosD+GvNLMejZgrrASzRtO1JMxHvrLHB8vVxJR8rIJ37kdWAzPqlVlwJ9FgcA8geB5xrXLsU6zrB2AHZDom3AcBbemzyppGuAWRmldtPBeMehEQA6Xyi6+8xMi/uDvd0POK/IXhJT2swffJbqOREnU9og2qXCCB+JyoOTxXwpqAdMvZGgaAKEHJaw5abg/rp2CcGyHZIWucL5BM6HTE2RoEwChC8oGGXrgnjq+OTKCDt+5EaHQgzKzynI4Kx6VIFKHV3SPZY+C1qZokD0jmTXCeQ90XtrPE3CuxQgOBnG3bpnKQVSQWQ9pnE4a0A35x0QiZ+Lygg33RtSeUpaWqAbIfE8z+WN2+Be2EOJ5fjmGur/uTCT42cKiCdM8kTAPNVKCAttU07ERWQX7m2HBAxSCD31AHpnEl0l1YESsYYF1uBLEpAZQJIBxK/sMH8Yg+pyS4mBcZdWy2IKVagMJkB0rncugVg7MsDAilgjHOugGxwbTklq05mCkgbklrrCohcnJUApt0cK0Be6Q6VlmbZw8wB8ZOvOvwwwZVZCmHazpcCAlk+ZsuqrHuVC0B8ESoO/dI1ZllK1jMiB+0TckHDlsSWjwRJMTeAtC+36jwb5M6SOEESMbYFUUDkve6g5KZqZ64A6ZxJ/FXAV5il8gWZ8PppbCFkaVKrcvW7MdUyd4C0Idm+5ZsPSSrLCcKKZ/xiU+BWKlmaxPccUXuYS0B2JGU5LfP5btQRzr1//J/JxplyrgFpP+HaXgjiclMtJc5hz0Wsp0S8S+IssJBEVrkHxE+6XVJIypebultJTIEMYhL3KDYvias0T5IZdAUgvgDt4nRl73JTwTHJ6ZBGbK7d2lSXxFHULY3edg0gO8Ro1wL2t4AzBbPTmB/xtUE02lugRayVG1+H9CJ1HSB+Wn5V+ef14dLOXolmfxK9sc7KasIH40+TWBOlynpWne9KQHY+5VrJV7PFZWanq6ymz57b9Xd2kpKsDrt5TR6y6mpAnn0czLMguNRsLJqHKQVAZBOINWH2BMxJBju7UQhA/Gz83XfnPHvZlTede6Y//uXUxCTWBN1NNq8CFQaQHQIvqrNfEecAPNfsn5jatJsAZJ0nuO6hQfHrDhTmKBwgu4CyUHneuRDxS8OYzS2TmbLbQF7nKbXuoUHZmEwT2UYtLCA7ZG2v62rtBGWfbOUuTOtP+2CwpNblcf1UnCoXHpBdnnjNQ7MNin/ptX+cIvZQrCdBrkNZrXOXy5ZeyLtnANkxmNXVPIBNLCF5igDH98IgR82RwF0icouUsX5smTwRNV43+fccILsOTnWUFZawWIjFBI/opoFLuq8CeYCCDdLChrFhaSTdXl7j9zQguw6KNTp5FJVaLBC/ysrCvA5Ywv3aSHCDeN4Gd7jP30m35w8DyDRToFLjCSLeyYA6GuDhxZ4l8iPAu49UtzWG5I5i5xo8OwPILJr1r+TBnodj4XnHQOQYAAcGlzlXHo+BvBdK3asUvvPgcnkkV73LWWcMIAEHpLqCh3ied5wS9QaSxwHYO2CItM23isjdHr1vK6XuHrtMNqXdgW5uzwAScfQWOnxZn2A+PMyn/xP0S2T6JVUPihg6qPujAMYB2SzEOBTGJ4nxjbY8HjSQsX9WAQNIQrNhyQ0sPboZ8z20FkDEB2ZfQM0lvL0E4r/Z34vA3O2/c6/O237/p388A2AbIM8Q3Cbt39H5XT0DeP6ffwNyXKG0+aAFGF9/hrQSSqWnw/4f5GnaW9nfPLQAAAAASUVORK5CYII=",lt=Object.defineProperty,dt=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable,he=(Se,me,Fe)=>me in Se?lt(Se,me,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):Se[me]=Fe,Oe=(Se,me)=>{for(var Fe in me||(me={}))Gt.call(me,Fe)&&he(Se,Fe,me[Fe]);if(et)for(var Fe of et(me))it.call(me,Fe)&&he(Se,Fe,me[Fe]);return Se},pe=(Se,me)=>dt(Se,yt(me));const Me={\u5B9E\u8BAD:p,\u8BD5\u5377:P,\u8BFE\u4EF6:W,\u89C6\u9891:se,\u4E3B\u80FD\u529B:ye,\u5B50\u80FD\u529B:Re,\u77E5\u8BC6\u70B9:Ge,\u8D44\u6E90:nt,\u603B\u6570:ve,\u6559\u6750:pt};var G=({type:Se,ImgProps:me})=>v.createElement("img",pe(Oe({src:(Me==null?void 0:Me[Se])||(Me==null?void 0:Me.\u8BFE\u4EF6)},me),{width:"16rem",style:Oe({width:"16rem"},(me==null?void 0:me.style)||{})})),te=I(89076),ue=I(71839),Ae=I(94941),Ie=Object.defineProperty,He=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,wt=(Se,me,Fe)=>me in Se?Ie(Se,me,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):Se[me]=Fe,At=(Se,me)=>{for(var Fe in me||(me={}))st.call(me,Fe)&&wt(Se,Fe,me[Fe]);if(gt)for(var Fe of gt(me))Tt.call(me,Fe)&&wt(Se,Fe,me[Fe]);return Se},Ct=(Se,me)=>He(Se,ct(me)),bt=(Se,me,Fe)=>new Promise((Dt,ut)=>{var Et=rt=>{try{_t(Fe.next(rt))}catch(xt){ut(xt)}},Ke=rt=>{try{_t(Fe.throw(rt))}catch(xt){ut(xt)}},_t=rt=>rt.done?Dt(rt.value):Promise.resolve(rt.value).then(Et,Ke);_t((Fe=Fe.apply(Se,me)).next())});const It=({children:Se,cout:me=1})=>{const Fe=(0,v.useRef)(null),[Dt,ut]=(0,v.useState)(0),[Et,Ke]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{Fe.current&&setTimeout(()=>{const _t=(0,z.ZR)(Fe.current,"rem",1);ut(_t)},500)},[Fe.current]),v.createElement("div",{className:"relative flex item-end "},v.createElement("div",{style:{height:Et?"auto":`${me*23.25}rem`,overflow:"hidden"}},v.createElement("div",{ref:Fe,style:{fontSize:"14rem"}},Se)),Dt>=me*23.25&&v.createElement("div",{className:"current c-blue",style:{whiteSpace:"nowrap"},onClick:()=>{Ke(!Et)}},Et?"\u6536\u8D77":"\u5C55\u793A"))},Ye=({DataProps:Se,pathsDetail:me,getUrl:Fe})=>{var Dt,ut,Et,Ke;const{detail:_t}=me,[rt,xt]=(0,v.useState)(!1);return v.createElement("div",{id:`${Se==null?void 0:Se.id}`,className:"bg-white",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"}},v.createElement("div",{style:{color:"#3061D0"}},v.createElement(G,{type:"\u5B50\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u5B50\u80FD\u529B"),v.createElement("div",{className:"c-grey-333 flex item-center",style:{fontSize:"14rem",margin:"20rem 0 10rem 0",gap:"10rem"}},v.createElement(Q.Z,{title:Se==null?void 0:Se.name},v.createElement("div",{className:"multi_ellipsis1 minW-0"},Se==null?void 0:Se.name)),v.createElement("div",{className:"flex item-center",style:{gap:"5rem"}},(Dt=Se==null?void 0:Se.ability_tags)==null?void 0:Dt.map(ot=>v.createElement(ae.default,{color:"orange",style:{fontSize:"12rem"}},ot)))),(Se==null?void 0:Se.description)&&v.createElement("div",{style:{padding:"12rem",background:"#F6F7F9"}},v.createElement(It,null,Se==null?void 0:Se.description)),v.createElement("div",{className:"flex item-center justify-center w-full",style:{margin:"20rem 0",padding:"12rem",background:"linear-gradient( 180deg, #ECF3FF 0%, rgba(255,255,255,0) 100%)"}},"\u8986\u76D6 ",v.createElement(G,{type:"\u77E5\u8BC6\u70B9",ImgProps:{style:{margin:"0 5rem"}}})," ",Se==null?void 0:Se.knowledge_count,"\u4E2A\u77E5\u8BC6\u70B9",v.createElement("span",{style:{marginLeft:"40rem"}},v.createElement(G,{type:"\u8D44\u6E90",ImgProps:{style:{marginRight:"5rem"}}}),Se==null?void 0:Se.resource_count,"\u4E2A\u8D44\u6E90\u6570")),v.createElement("div",{style:{marginBottom:"10rem"}},v.createElement(G,{type:"\u77E5\u8BC6\u70B9",ImgProps:{style:{marginRight:"5rem"}}}),"\u8986\u76D6\u77E5\u8BC6\u70B9",Se==null?void 0:Se.knowledge_count,"\u4E2A"),v.createElement("div",{style:{height:"320rem",background:"#F6F7F9"}},v.createElement(S,{loading:!1,nodes:Se==null?void 0:Se.nodes,relationships:Se==null?void 0:Se.relationships})),v.createElement("div",{style:{margin:"30rem 0 10rem"}},v.createElement(G,{type:"\u8D44\u6E90",ImgProps:{style:{marginRight:"5rem"}}}),"\u8986\u76D6\u8D44\u6E90\u6570",Se==null?void 0:Se.resource_count,"\u4E2A"),v.createElement("div",{className:"flex-wrap",style:{gap:"10rem",display:"grid",gridTemplateColumns:"1fr 1fr"}},(Ke=((ut=Se==null?void 0:Se.resource_knowledge_graphs)==null?void 0:ut.length)>4&&!rt?(Et=Se==null?void 0:Se.resource_knowledge_graphs)==null?void 0:Et.slice(0,4):Se==null?void 0:Se.resource_knowledge_graphs)==null?void 0:Ke.map(ot=>v.createElement("div",{key:ot==null?void 0:ot.id,className:"flex relative current",style:{gap:"10rem",padding:"25rem",background:"#f6f6f6",borderRadius:"10rem"},onClick:()=>bt(void 0,null,function*(){yield Fe==null?void 0:Fe(ot)})},!(_t!=null&&_t.can_managed)&&v.createElement("div",{className:"absolute c-white",style:{top:0,right:0,padding:"2rem 10rem",borderRadius:"0 10rem 0 10rem",color:(ot==null?void 0:ot.complete_rate)!=100&&"#7C3100",background:(ot==null?void 0:ot.complete_rate)!=100?"#FFC86B":"#37AD83"}},(ot==null?void 0:ot.complete_rate)==100?"\u5DF2\u5B8C\u6210":"\u672A\u5B8C\u6210"),v.createElement(ne.Z,{type:"circle",percent:ot==null?void 0:ot.complete_rate,size:60,status:"success",format:vt=>`${vt}%`,strokeWidth:10}),v.createElement(G,{type:ot==null?void 0:ot.node_type,ImgProps:{style:{width:"16rem",height:"16rem",marginTop:"3rem"}}}),v.createElement("div",{className:"flex-1 minW-0"},v.createElement(Q.Z,{title:ot==null?void 0:ot.name,placement:"topLeft"},v.createElement("div",{className:"multi_ellipsis1 c-grey-333 blod",style:{fontSize:"16rem"}},ot==null?void 0:ot.name)),v.createElement("div",{className:"c-grey-333",style:{marginTop:"10rem",fontSize:"14rem"}},"\u77E5\u8BC6\u70B9\uFF1A",(ot==null?void 0:ot.knowledge_text)||"--"),(_t==null?void 0:_t.can_managed)&&v.createElement("div",{className:"flex flex-wrap item-center v-grey-666",style:{marginTop:"20rem",fontSize:"12rem",gap:"10rem"}},v.createElement("div",null,"\u5B66\u4E60\u4EBA\u6570\uFF1A",ot==null?void 0:ot.study_count,"\u4EBA"),v.createElement("div",null,"\u638C\u63E1\u4EBA\u6570\uFF1A",ot==null?void 0:ot.complete_count,"\u4EBA"),v.createElement("div",null,"\u638C\u63E1\u7387\uFF1A",ot==null?void 0:ot.complete_rate,"%")))))),(Se==null?void 0:Se.resource_knowledge_graphs.length)>4&&v.createElement("div",{className:"flex item-center justify-center",style:{padding:"0 220rem"},onClick:()=>{xt(!rt)}},v.createElement(V.Z,{style:{borderColor:"#3061D0",marginBottom:"0rem",cursor:"pointer"},dashed:!0},v.createElement("span",{style:{color:"#3061D0"}},rt?"\u70B9\u51FB\u6536\u8D77":"\u70B9\u51FB\u5C55\u5F00\u66F4\u591A"))))},hn=({pathsDetail:Se,dispatch:me,user:Fe})=>{var Dt,ut,Et,Ke,_t,rt,xt,ot,vt,$t,en,fn,Wt,Zt,Fn,xn,qn,Yt,an,Qt,Sn,Zn,Bn,gi,mn,ti,Yn,Un,$n,Kt,ni,Tn,xi;const{detail:Ft}=Se,tn=(0,y.useParams)(),[mi,dn]=(0,v.useState)({}),[Rn,Ai]=(0,v.useState)({id:null,open:!1,resourceUrl:""}),[,yn,mt,J]=(0,_.U)(m.Ju,{subject_id:tn.pathId,id:tn==null?void 0:tn.abilityId}),[fe,Ee]=(0,v.useState)([{name:"\u638C\u63E1\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}},{name:"\u638C\u63E1\u738760%\uFF5E79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63E1\u738780%\uFF5E100%",value:0,itemStyle:{color:"rgb(223,209,38)"}}]),De=()=>bt(void 0,null,function*(){const ie=yield mt({subject_id:tn.pathId,id:tn==null?void 0:tn.abilityId})}),be=ie=>me({type:"userDetail/logWatchHistory",payload:At({},ie)});function Ne(ie){return bt(this,null,function*(){var je,Ze,Ht;let ht=yield(0,x.ZP)("/api/knowledge/v2/get_container_type.json",{method:"get",params:{url:ie==null?void 0:ie.resourceUrl}});if(localStorage.setItem("container_type_tupu",ht==null?void 0:ht.container_type),(ht==null?void 0:ht.status)===0){if((ie==null?void 0:ie.node_type)=="\u8BD5\u5377"){const kt=yield(0,Ae.Mb)({categoryId:ht==null?void 0:ht.examination_bank_id});kt!=null&&kt.exercise_id&&(0,z.xg)(`/classrooms/coursesId/exercise/${kt.exercise_id}/${(je=Fe.userInfo)==null?void 0:je.login}/initate_answer`);return}(ht==null?void 0:ht.container_type)==="video"?Ai({id:ht==null?void 0:ht.id,open:!0,resourceUrl:ie==null?void 0:ie.resourceUrl}):(ht==null?void 0:ht.container_type)==="att"?dn({url:$.Z.API_SERVER+((Ze=ht==null?void 0:ht.attachment)==null?void 0:Ze.url),file_type:(Ht=ht==null?void 0:ht.attachment)==null?void 0:Ht.file_type}):window.open(ie==null?void 0:ie.resourceUrl)}})}const ke=ie=>bt(void 0,null,function*(){var je;(ie==null?void 0:ie.resourceOrigin)===3?(0,z.xg)(ie==null?void 0:ie.resourceUrl):Ne(ie),!(Ft!=null&&Ft.can_managed)&&(yield(0,x.ZP)("/api/subject_knowledge/create_study.json",{method:"post",body:{subject_id:(je=Se==null?void 0:Se.detail)==null?void 0:je.id,uuid:(ie==null?void 0:ie.last_knowledge_uuid)||(ie==null?void 0:ie.knowledge_uuid)}}))});return(0,v.useEffect)(()=>{var ie,je;if((J==null?void 0:J.status)==0&&(Ft!=null&&Ft.can_managed)){const Ze=(je=Object==null?void 0:Object.entries(((ie=J==null?void 0:J.data)==null?void 0:ie.study_grasp_hash)||{}))==null?void 0:je.map(([Ht,ht],kt)=>({name:Ht,value:ht,itemStyle:fe[kt].itemStyle}));Ee(Ze)}},[Ft==null?void 0:Ft.can_managed,J]),(0,v.useEffect)(()=>{De()},[tn==null?void 0:tn.abilityId]),(0,v.useEffect)(()=>{me({type:"pathsDetail/getPathsDetail",payload:{id:tn.pathId,knowledge:!0}})},[]),(0,v.useEffect)(()=>(me({type:"globalSetting/footerToggle",payload:!1}),()=>{me({type:"globalSetting/footerToggle",payload:!0})}),[]),v.createElement(q.Z,{spinning:yn},v.createElement("div",{className:"ml-auto mr-auto",style:{width:"1200rem",paddingTop:"15rem"}},v.createElement(ee.Z,{style:{fontSize:"14rem",marginBottom:"20rem"},items:[{title:v.createElement("a",{className:"flex item-center",style:{fontSize:"14rem"},onClick:()=>{y.history.push(`/knowledgegraph/${tn.pathId}`)}},v.createElement(Q.Z,{title:"\u8FD4\u56DE"},v.createElement("i",{className:"iconfont icon-fanhui1",style:{fontSize:"14rem",marginRight:"20rem"}})),"\u80FD\u529B\u56FE\u8C31")},{title:"\u80FD\u529B\u8BE6\u60C5"}]}),v.createElement("div",{className:"w-full flex"},v.createElement("div",{className:"sticky flex flex-col",style:{width:"240rem",borderRadius:"4rem 0 0 4rem",maxHeight:"100vh",overflowY:"auto",overflowX:"hidden",top:0,background:"#F6F7F9"}},v.createElement("div",{style:{padding:"20rem"}},v.createElement("div",{className:"c-grey-333",style:{fontSize:"16rem"}},"\u80FD\u529B\u76EE\u6807\u56FE\u8C31"),v.createElement("div",{className:"w-full",style:{height:"200rem",marginTop:"20rem"}},v.createElement(te.Z,{isShow:!0,className:"c-grey-333",DataProps:((Dt=J==null?void 0:J.data)==null?void 0:Dt.ability_goals)||[],baifenbi:1/2,style:{backgroundSize:"auto 100%",height:"100%",width:"100%"}}))),v.createElement("div",{style:{padding:"10rem 20rem 20rem"}},v.createElement("div",{className:"c-grey-333",style:{fontSize:"16rem"}},"\u76EE\u5F55\u5BFC\u822A"),v.createElement(Z.default,{className:"w-full",value:Number(tn==null?void 0:tn.abilityId),style:{marginTop:"10rem"},onChange:ie=>{y.history.push(`/knowledgegraph/${tn.pathId}/abilityMap/detail/${ie}`)},options:((Et=(ut=J==null?void 0:J.data)==null?void 0:ut.ability_goals)==null?void 0:Et.map(ie=>({label:ie==null?void 0:ie.name,value:ie==null?void 0:ie.id})))||[],size:"large"})),v.createElement(o.default,{className:d.AnchorDomStyle,items:(_t=(Ke=J==null?void 0:J.data)==null?void 0:Ke.children_ability_goals)==null?void 0:_t.map(ie=>{var je;return{key:ie==null?void 0:ie.id,href:`#${ie==null?void 0:ie.id}`,title:v.createElement("div",{className:`current relative ${d.AnchorDom}`},v.createElement("div",{className:"flex item-center",style:{gap:"10rem"}},v.createElement("div",{className:"flex-1 minW-0 multi_ellipsis1 c-grey-333",style:{fontSize:"14rem"}},ie==null?void 0:ie.name),v.createElement("span",{style:{color:"#464F66",fontSize:"12rem"}},Ft!=null&&Ft.can_managed?v.createElement(v.Fragment,null,v.createElement("span",{className:"iconfont icon-a-60-kejian",style:{marginRight:"5rem",fontSize:"12rem"}}),ie==null?void 0:ie.knowledge_count):v.createElement("span",{style:{color:"#00C088"}},v.createElement("span",{className:"iconfont icon-xuesheng2",style:{marginRight:"5rem",fontSize:"12rem"}}),(ie==null?void 0:ie.grasp_rate)||0,"%"))),v.createElement("div",{className:"flex flex-wrap",style:{gap:"5rem",marginTop:"10rem"}},(je=ie==null?void 0:ie.ability_tags)==null?void 0:je.map(Ze=>v.createElement(ae.default,{color:"orange",style:{fontSize:"12rem"},key:Ze},Ze))),v.createElement("div",{className:"multi_ellipsis2",style:{marginTop:"20rem",color:"#464F66",fontSize:"12rem"}},ie==null?void 0:ie.description))}})})),v.createElement("div",{className:"flex-1 minW-0 flex flex-col",style:{gap:"20rem"}},v.createElement("div",{className:"bg-white relative",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"}},((xt=(rt=J==null?void 0:J.data)==null?void 0:rt.next_ability_goal)==null?void 0:xt.id)&&v.createElement("div",{className:"absolute current",style:{right:0,top:0},onClick:()=>{var ie,je;y.history.push(`/knowledgegraph/${tn.pathId}/abilityMap/detail/${(je=(ie=J==null?void 0:J.data)==null?void 0:ie.next_ability_goal)==null?void 0:je.id}`)}},v.createElement("div",{className:d.NextAbility},v.createElement("div",{className:"multi_ellipsis1"},(vt=(ot=J==null?void 0:J.data)==null?void 0:ot.next_ability_goal)==null?void 0:vt.name),v.createElement("div",null,v.createElement("span",{className:"iconfont icon-you2",style:{fontSize:"14rem"}})))),v.createElement("div",{style:{color:"#3061D0"}},v.createElement(G,{type:"\u4E3B\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u4E3B\u80FD\u529B"),v.createElement("div",{className:"c-grey-333 blod",style:{fontSize:"14rem",margin:"20rem 0 10rem 0"}},($t=J==null?void 0:J.data)==null?void 0:$t.name),((en=J==null?void 0:J.data)==null?void 0:en.description)&&v.createElement("div",{style:{padding:"12rem",background:"#F6F7F9"}},v.createElement(It,null,(fn=J==null?void 0:J.data)==null?void 0:fn.description)),(Ft==null?void 0:Ft.can_managed)&&v.createElement(v.Fragment,null,v.createElement("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"}},[{title:"\u5E73\u5747\u4E3B\u80FD\u529B\u638C\u63E1\u7387",value:(Wt=J==null?void 0:J.data)==null?void 0:Wt.children_ability_goal_grasp_rate,unit:"%",img:I(46016),bg:"#E3F1FF"},{title:"\u8986\u76D6\u77E5\u8BC6\u70B9",value:(Zt=J==null?void 0:J.data)==null?void 0:Zt.total_knowledge_count,unit:"\u4E2A",img:I(99755),bg:"#F1FDEF",ProgressTitle:"\u5360\u603B\u77E5\u8BC6\u70B9",percent:(Fn=J==null?void 0:J.data)==null?void 0:Fn.knowledge_rate,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u8986\u76D6\u8D44\u6E90\u6570",value:(xn=J==null?void 0:J.data)==null?void 0:xn.total_resource_count,unit:"\u4E2A",img:I(92691),bg:"#FFF9F4",ProgressTitle:"\u5360\u603B\u8D44\u6E90\u6570",percent:(qn=J==null?void 0:J.data)==null?void 0:qn.resource_rate,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((ie,je)=>v.createElement("div",{key:je,className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:ie==null?void 0:ie.bg,padding:"20rem 30rem"}},v.createElement("img",{src:ie==null?void 0:ie.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),v.createElement("div",{className:"c-grey-666",style:{fontSize:"14rem"}},ie==null?void 0:ie.title),v.createElement("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"}},ie==null?void 0:ie.value,v.createElement("span",{style:{fontSize:"14rem"}},ie==null?void 0:ie.unit)),(ie==null?void 0:ie.ProgressTitle)&&v.createElement("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"}},v.createElement("div",null,ie==null?void 0:ie.ProgressTitle,ie==null?void 0:ie.percent,"%"),v.createElement(ne.Z,{percent:ie==null?void 0:ie.percent,showInfo:!1,trailColor:ie==null?void 0:ie.trailColor,strokeColor:ie==null?void 0:ie.strokeColor,style:{marginBottom:"0",marginLeft:"0"}}))))),v.createElement("div",{className:"c-grey-333",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"}},"\u5B66\u4E60\u7EDF\u8BA1"),v.createElement("div",{className:"flex"},v.createElement("div",{className:"minW-0 flex flex-col",style:{gap:"13rem",width:"200rem"}},[{title:"\u5B66\u4E60\u4EBA\u6570",value:(Yt=J==null?void 0:J.data)==null?void 0:Yt.study_count,unit:"",img:I(37426),bg:"rgba(68, 95, 232, 0.1)"},{title:"\u5B66\u4E60\u5B8C\u6210\u7387",value:(an=J==null?void 0:J.data)==null?void 0:an.complete_rate,unit:"%",img:I(19150),bg:"rgba(182, 129, 0, .1)"},{title:"\u5B66\u4E60\u638C\u63E1\u7387",value:(Qt=J==null?void 0:J.data)==null?void 0:Qt.grasp_rate,unit:"%",img:I(55303),bg:"rgba(6, 145, 127, .1)"}].map((ie,je)=>v.createElement("div",{key:je,className:"relative",style:{borderRadius:"6rem",padding:"20rem",background:ie==null?void 0:ie.bg}},v.createElement("div",{style:{fontSize:"14rem"}},ie==null?void 0:ie.title),v.createElement("div",{className:"blod",style:{fontSize:"26rem"}},ie==null?void 0:ie.value,v.createElement("span",{style:{fontSize:"14rem"}},ie==null?void 0:ie.unit)),v.createElement("img",{className:"absolute",style:{right:"6rem",bottom:"6rem"},height:"35rem",src:ie==null?void 0:ie.img})))),v.createElement("div",{className:"flex-1 minW-0"},v.createElement(u.Z,{dataSource:fe,legend:{top:null,icon:"roundRect",bottom:10,itemWidth:14,itemGap:50,left:"center",formatter:ie=>ie}})))),!(Ft!=null&&Ft.can_managed)&&v.createElement(v.Fragment,null,v.createElement("div",{className:"flex item-center",style:{gap:"20rem",marginTop:"20rem"}},[{title:"\u8986\u76D6\u77E5\u8BC6\u70B9",value:(Sn=J==null?void 0:J.data)==null?void 0:Sn.total_knowledge_count,unit:"\u4E2A",percent:(Zn=J==null?void 0:J.data)==null?void 0:Zn.knowledge_rate,percenttitle:"\u5360\u603B\u77E5\u8BC6\u70B9",trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u8986\u76D6\u8D44\u6E90\u6570",value:(Bn=J==null?void 0:J.data)==null?void 0:Bn.total_resource_count,unit:"\u4E2A",percent:(gi=J==null?void 0:J.data)==null?void 0:gi.resource_rate,percenttitle:"\u5360\u603B\u8D44\u6E90\u6570",trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((ie,je)=>v.createElement("div",{key:je,className:"flex-1 minW-0 flex justify-between c-grey-333",style:{gap:"20rem",background:"#F6F7F9",borderRadius:"6rem",padding:"30rem 60rem"}},v.createElement("div",{className:"flex flex-col justify-between"},v.createElement("div",{style:{fontSize:"14rem",whiteSpace:"nowrap"}},ie==null?void 0:ie.title),v.createElement("div",{className:"blod",style:{fontSize:"26rem"}},ie==null?void 0:ie.value,v.createElement("span",{style:{fontSize:"14rem"}},ie==null?void 0:ie.unit))),v.createElement("div",{className:"relative",style:{width:"133rem",height:"75rem"}},v.createElement(ne.Z,{type:"dashboard",percent:ie==null?void 0:ie.percent,gapDegree:178,strokeWidth:10,className:"absolute",style:{right:0,top:0},trailColor:ie==null?void 0:ie.trailColor,strokeColor:ie==null?void 0:ie.strokeColor,strokeLinecap:"round",format:Ze=>v.createElement("div",{className:"c-grey-333",style:{fontSize:"12rem",textAlign:"center",marginTop:"-35rem"}},Ze,"%",v.createElement("br",null),v.createElement("br",null),ie==null?void 0:ie.percenttitle)}))))),v.createElement("div",{className:"c-grey-333 blod",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"}},"\u5B66\u4E60\u7EDF\u8BA1"),v.createElement("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"}},[{title:"\u4E3B\u80FD\u529B\u638C\u63E1\u7387",value:(mn=J==null?void 0:J.data)==null?void 0:mn.children_ability_goal_grasp_rate,unit:"%",img:I(46016),bg:"#E3F1FF"},{title:"\u5DF2\u638C\u63E1\u77E5\u8BC6\u70B9",value:((ti=J==null?void 0:J.data)==null?void 0:ti.knowledge_grasp_count)||0,unit:"\u4E2A",img:I(99755),bg:"#F1FDEF",ProgressTitle:"\u77E5\u8BC6\u70B9\u638C\u63E1\u7387",percent:((Yn=J==null?void 0:J.data)==null?void 0:Yn.knowledge_grasp_rate)||0,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u5DF2\u5B8C\u6210\u8D44\u6E90\u6570",value:((Un=J==null?void 0:J.data)==null?void 0:Un.resource_complete_count)||0,unit:"\u4E2A",img:I(92691),bg:"#FFF9F4",ProgressTitle:"\u5B8C\u6210\u8D44\u6E90\u7387",percent:(($n=J==null?void 0:J.data)==null?void 0:$n.resource_complete_rate)||0,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((ie,je)=>v.createElement("div",{key:je,className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:ie==null?void 0:ie.bg,padding:"20rem 30rem"}},v.createElement("img",{src:ie==null?void 0:ie.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),v.createElement("div",{className:"c-grey-666",style:{fontSize:"14rem"}},ie==null?void 0:ie.title),v.createElement("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"}},ie==null?void 0:ie.value,v.createElement("span",{style:{fontSize:"14rem"}},ie==null?void 0:ie.unit)),(ie==null?void 0:ie.ProgressTitle)&&v.createElement("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"}},v.createElement("div",null,ie==null?void 0:ie.ProgressTitle,ie==null?void 0:ie.percent,"%"),v.createElement(ne.Z,{percent:ie==null?void 0:ie.percent,showInfo:!1,trailColor:ie==null?void 0:ie.trailColor,strokeColor:ie==null?void 0:ie.strokeColor,style:{marginBottom:"0",marginLeft:"0"}}))))),v.createElement("div",{className:"c-grey-333 blod",style:{margin:"30rem 0 10rem 0",fontSize:"14rem"}},"\u5F00\u59CB\u5B66\u4E60"),v.createElement("div",{className:"flex flex-col",style:{gap:"10rem"}},(ni=(Kt=J==null?void 0:J.data)==null?void 0:Kt.children_ability_goals)==null?void 0:ni.map(ie=>v.createElement("div",{key:ie==null?void 0:ie.id,className:"flex item-center",style:{gap:"20rem",padding:"20rem",background:"#F6F7F9",borderRadius:"6rem"}},v.createElement("div",{className:"flex-1 minW-0 flex flex-col"},v.createElement("div",{className:"flex",style:{gap:"10rem"}},v.createElement("div",{style:{color:"#3061D0"}},v.createElement(G,{type:"\u5B50\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u5B50\u80FD\u529B"),v.createElement(Q.Z,{title:ie==null?void 0:ie.name,placement:"topLeft"},v.createElement("div",{className:"multi_ellipsis1"},ie==null?void 0:ie.name))),v.createElement("div",{className:"flex item-center",style:{gap:"10rem",marginTop:"15rem",fontSize:"14rem"}},v.createElement(ae.default,{color:"orange",style:{fontSize:"12rem",lineHeight:"1.5"}},"\u8282\u70B9"),v.createElement("span",{className:"c-grey-333"},ie==null?void 0:ie.last_knowledge_name),ie!=null&&ie.is_complete?v.createElement("span",{className:"c-green"},"\uFF08\u5DF2\u638C\u63E1\uFF09"):v.createElement("span",{className:"c-grey-666"},"\uFF08\u672A\u638C\u63E1\uFF09"))),v.createElement(R.op,{onClick:()=>bt(void 0,null,function*(){yield ke(ie)})},(ie==null?void 0:ie.complete_rate)==0?"\u5F00\u59CB\u5B66\u4E60":"\u7EE7\u7EED\u5B66\u4E60")))))),(xi=(Tn=J==null?void 0:J.data)==null?void 0:Tn.children_ability_goals)==null?void 0:xi.map(ie=>v.createElement(Ye,{key:ie==null?void 0:ie.id,DataProps:ie,pathsDetail:Se,getUrl:ke}))))),v.createElement(O.default,{open:Rn==null?void 0:Rn.open,title:"\u89C6\u9891",width:800,centered:!0,onCancel:()=>{Ai(Ct(At({},Rn),{open:!1}))},onOk:()=>{Ai(Ct(At({},Rn),{open:!1}))}},v.createElement(ue.Z,{allow_skip:!0,videoId:Rn.id,toLog:!0,src:Rn==null?void 0:Rn.resourceUrl,logWatchHistory:ie=>be(Ct(At({},ie),{container_type:localStorage.getItem("container_type_tupu")}))})),v.createElement(C.Z,{close:!0,style:{zIndex:1300,background:"rgba(1, 10, 35, 0.5)"},data:mi==null?void 0:mi.url,type:mi==null?void 0:mi.file_type,disabledDownload:!0,onClose:()=>dn({})}))};var Ve=(0,y.connect)(({pathsDetail:Se,user:me})=>({pathsDetail:Se,user:me}))(hn)},36785:function(qe,xe,I){"use strict";I.d(xe,{o2:function(){return V},yT:function(){return q}});var z=I(19127),Q=I(33166);const ae=Q.i.map(ee=>`${ee}-inverse`),ne=["success","processing","error","default","warning"];function V(ee){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,z.Z)(ae),(0,z.Z)(Q.i)).includes(ee):Q.i.includes(ee)}function q(ee){return ne.includes(ee)}},79676:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return q}});var z=I(19447);function Q(ee,Z,o,O){if(O===!1)return{adjustX:!1,adjustY:!1};const v=O&&typeof O=="object"?O:{},y={};switch(ee){case"top":case"bottom":y.shiftX=Z.dropdownArrowOffset*2+o;break;case"left":case"right":y.shiftY=Z.dropdownArrowOffsetVertical*2+o;break}const u=Object.assign(Object.assign({},y),v);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ae={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"]}},ne={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"]}},V=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function q(ee){const{arrowWidth:Z,autoAdjustOverflow:o,arrowPointAtCenter:O,offset:v,borderRadius:y,visibleFirst:u}=ee,_=Z/2,m={};return Object.keys(ae).forEach(N=>{const F=O&&ne[N]||ae[N],M=Object.assign(Object.assign({},F),{offset:[0,0]});switch(m[N]=M,V.has(N)&&(M.autoArrow=!1),N){case"top":case"topLeft":case"topRight":M.offset[1]=-_-v;break;case"bottom":case"bottomLeft":case"bottomRight":M.offset[1]=_+v;break;case"left":case"leftTop":case"leftBottom":M.offset[0]=-_-v;break;case"right":case"rightTop":case"rightBottom":M.offset[0]=_+v;break}const w=(0,z.fS)({contentRadius:y,limitVerticalRadius:!0});if(O)switch(N){case"topLeft":case"bottomLeft":M.offset[0]=-w.dropdownArrowOffset-_;break;case"topRight":case"bottomRight":M.offset[0]=w.dropdownArrowOffset+_;break;case"leftTop":case"rightTop":M.offset[1]=-w.dropdownArrowOffset-_;break;case"leftBottom":case"rightBottom":M.offset[1]=w.dropdownArrowOffset+_;break}M.overflow=Q(N,w,Z,o),u&&(M.htmlRegion="visibleFirst")}),m}},19080:function(qe,xe,I){"use strict";I.d(xe,{F:function(){return V},Z:function(){return ne}});var z=I(92310),Q=I.n(z);const ae=null;function ne(q,ee,Z){return Q()({[`${q}-status-success`]:ee==="success",[`${q}-status-warning`]:ee==="warning",[`${q}-status-error`]:ee==="error",[`${q}-status-validating`]:ee==="validating",[`${q}-has-feedback`]:Z})}const V=(q,ee)=>ee||q},27666:function(qe,xe,I){"use strict";var z=I(19127),Q=I(16089);function ae(ne){let V;const q=Z=>()=>{V=null,ne.apply(void 0,(0,z.Z)(Z))},ee=function(){if(V==null){for(var Z=arguments.length,o=new Array(Z),O=0;O<Z;O++)o[O]=arguments[O];V=(0,Q.Z)(q(o))}};return ee.cancel=()=>{Q.Z.cancel(V),V=null},ee}xe.Z=ae},81228:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return j}});var z=I(52884),Q=I(95727),ae=I(65711),ne=I(85745),V=I(59301),q=I(92310),ee=I.n(q),Z=I(29301),o=I(2738),O=I(27666),v=I(36355),y=I(83116),u=I(37613);const _=H=>{const{componentCls:ce}=H;return{[ce]:{position:"fixed",zIndex:H.zIndexPopup}}};var m=(0,y.Z)("Affix",H=>{const ce=(0,u.TS)(H,{zIndexPopup:H.zIndexBase+10});return[_(ce)]});function N(H){return H!==window?H.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function F(H,ce,_e){if(_e!==void 0&&ce.top>H.top-_e)return _e+ce.top}function M(H,ce,_e){if(_e!==void 0&&ce.bottom<H.bottom+_e){const re=window.innerHeight-ce.bottom;return _e+re}}const w=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];function k(){return typeof window!="undefined"?window:null}var K;(function(H){H[H.None=0]="None",H[H.Prepare=1]="Prepare"})(K||(K={}));let b=function(H){(0,ae.Z)(_e,H);var ce=(0,ne.Z)(_e);function _e(){var re;return(0,z.Z)(this,_e),re=ce.apply(this,arguments),re.state={status:K.None,lastAffix:!1,prevTarget:null},re.placeholderNodeRef=(0,V.createRef)(),re.fixedNodeRef=(0,V.createRef)(),re.addListeners=()=>{const Y=re.getTargetFunc(),T=Y==null?void 0:Y(),{prevTarget:S}=re.state;S!==T&&(w.forEach(R=>{S==null||S.removeEventListener(R,re.lazyUpdatePosition),T==null||T.addEventListener(R,re.lazyUpdatePosition)}),re.updatePosition(),re.setState({prevTarget:T}))},re.removeListeners=()=>{re.timer&&(clearTimeout(re.timer),re.timer=null);const{prevTarget:Y}=re.state,T=re.getTargetFunc(),S=T==null?void 0:T();w.forEach(R=>{S==null||S.removeEventListener(R,re.lazyUpdatePosition),Y==null||Y.removeEventListener(R,re.lazyUpdatePosition)}),re.updatePosition.cancel(),re.lazyUpdatePosition.cancel()},re.getOffsetTop=()=>{const{offsetBottom:Y,offsetTop:T}=re.props;return Y===void 0&&T===void 0?0:T},re.getOffsetBottom=()=>re.props.offsetBottom,re.measure=()=>{const{status:Y,lastAffix:T}=re.state,{onChange:S}=re.props,R=re.getTargetFunc();if(Y!==K.Prepare||!re.fixedNodeRef.current||!re.placeholderNodeRef.current||!R)return;const x=re.getOffsetTop(),$=re.getOffsetBottom(),C=R();if(C){const d={status:K.None},p=N(re.placeholderNodeRef.current);if(p.top===0&&p.left===0&&p.width===0&&p.height===0)return;const P=N(C),W=F(p,P,x),se=M(p,P,$);W!==void 0?(d.affixStyle={position:"fixed",top:W,width:p.width,height:p.height},d.placeholderStyle={width:p.width,height:p.height}):se!==void 0&&(d.affixStyle={position:"fixed",bottom:se,width:p.width,height:p.height},d.placeholderStyle={width:p.width,height:p.height}),d.lastAffix=!!d.affixStyle,S&&T!==d.lastAffix&&S(d.lastAffix),re.setState(d)}},re.prepareMeasure=()=>{re.setState({status:K.Prepare,affixStyle:void 0,placeholderStyle:void 0})},re.updatePosition=(0,O.Z)(()=>{re.prepareMeasure()}),re.lazyUpdatePosition=(0,O.Z)(()=>{const Y=re.getTargetFunc(),{affixStyle:T}=re.state;if(Y&&T){const S=re.getOffsetTop(),R=re.getOffsetBottom(),x=Y();if(x&&re.placeholderNodeRef.current){const $=N(x),C=N(re.placeholderNodeRef.current),d=F(C,$,S),p=M(C,$,R);if(d!==void 0&&T.top===d||p!==void 0&&T.bottom===p)return}}re.prepareMeasure()}),re}return(0,Q.Z)(_e,[{key:"getTargetFunc",value:function(){const{getTargetContainer:Y}=this.context,{target:T}=this.props;return T!==void 0?T:Y!=null?Y:k}},{key:"componentDidMount",value:function(){this.timer=setTimeout(this.addListeners)}},{key:"componentDidUpdate",value:function(Y){this.addListeners(),(Y.offsetTop!==this.props.offsetTop||Y.offsetBottom!==this.props.offsetBottom)&&this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"render",value:function(){const{affixStyle:Y,placeholderStyle:T}=this.state,{affixPrefixCls:S,rootClassName:R,children:x}=this.props,$=ee()(Y&&R,{[S]:!!Y});let C=(0,o.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange","affixPrefixCls","rootClassName"]);return V.createElement(Z.Z,{onResize:this.updatePosition},V.createElement("div",Object.assign({},C,{ref:this.placeholderNodeRef}),Y&&V.createElement("div",{style:T,"aria-hidden":"true"}),V.createElement("div",{className:$,ref:this.fixedNodeRef,style:Y},V.createElement(Z.Z,{onResize:this.updatePosition},x))))}}]),_e}(V.Component);b.contextType=v.E_;var j=(0,V.forwardRef)((H,ce)=>{const{prefixCls:_e,rootClassName:re}=H,{getPrefixCls:Y}=(0,V.useContext)(v.E_),T=Y("affix",_e),[S,R]=m(T),x=Object.assign(Object.assign({},H),{affixPrefixCls:T,rootClassName:ee()(re,R)});return S(V.createElement(b,Object.assign({},x,{ref:ce})))})},79817:function(qe,xe,I){"use strict";I.d(xe,{default:function(){return re}});var z=I(19127),Q=I(92310),ae=I.n(Q),ne=I(70425),V=I(59301),q=I(16722),ee=I(13845),Z=I(68031),o=I(81228),O=I(36355),y=V.createContext(void 0),_=Y=>{const{href:T,title:S,prefixCls:R,children:x,className:$,target:C,replace:d}=Y,p=V.useContext(y),{registerLink:P,unregisterLink:W,scrollTo:se,onClick:ve,activeLink:ye,direction:Re}=p||{};V.useEffect(()=>(P==null||P(T),()=>{W==null||W(T)}),[T]);const Ge=et=>{d&&(et.preventDefault(),window.location.replace(T)),ve==null||ve(et,{title:S,href:T}),se==null||se(T)},{getPrefixCls:nt}=V.useContext(O.E_),pt=nt("anchor",R),lt=ye===T,dt=ae()(`${pt}-link`,$,{[`${pt}-link-active`]:lt}),yt=ae()(`${pt}-link-title`,{[`${pt}-link-title-active`]:lt});return V.createElement("div",{className:dt},V.createElement("a",{className:yt,href:T,title:typeof S=="string"?S:"",target:C,onClick:Ge},S),Re!=="horizontal"?x:null)},m=I(17313),N=I(83116),F=I(37613);const M=Y=>{const{componentCls:T,holderOffsetBlock:S,motionDurationSlow:R,lineWidthBold:x,colorPrimary:$,lineType:C,colorSplit:d}=Y;return{[`${T}-wrapper`]:{marginBlockStart:-S,paddingBlockStart:S,[T]:Object.assign(Object.assign({},(0,m.Wf)(Y)),{position:"relative",paddingInlineStart:x,[`${T}-link`]:{paddingBlock:Y.linkPaddingBlock,paddingInline:`${Y.linkPaddingInlineStart}px 0`,"&-title":Object.assign(Object.assign({},m.vS),{position:"relative",display:"block",marginBlockEnd:Y.anchorTitleBlock,color:Y.colorText,transition:`all ${Y.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${T}-link-title`]:{color:Y.colorPrimary},[`${T}-link`]:{paddingBlock:Y.anchorPaddingBlockSecondary}}}),[`&:not(${T}-wrapper-horizontal)`]:{[T]:{"&::before":{position:"absolute",insetInlineStart:0,top:0,height:"100%",borderInlineStart:`${x}px ${C} ${d}`,content:'" "'},[`${T}-ink`]:{position:"absolute",insetInlineStart:0,display:"none",transform:"translateY(-50%)",transition:`top ${R} ease-in-out`,width:x,backgroundColor:$,[`&${T}-ink-visible`]:{display:"inline-block"}}}},[`${T}-fixed ${T}-ink ${T}-ink`]:{display:"none"}}}},w=Y=>{const{componentCls:T,motionDurationSlow:S,lineWidthBold:R,colorPrimary:x}=Y;return{[`${T}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${Y.lineType} ${Y.colorSplit}`,content:'" "'},[T]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${T}-link:first-of-type`]:{paddingInline:0},[`${T}-ink`]:{position:"absolute",bottom:0,transition:`left ${S} ease-in-out, width ${S} ease-in-out`,height:R,backgroundColor:x}}}}};var k=(0,N.Z)("Anchor",Y=>{const{fontSize:T,fontSizeLG:S,paddingXXS:R}=Y,x=(0,F.TS)(Y,{holderOffsetBlock:R,anchorPaddingBlockSecondary:R/2,anchorTitleBlock:T/14*3,anchorBallSize:S/2});return[M(x),w(x)]},Y=>({linkPaddingBlock:Y.paddingXXS,linkPaddingInlineStart:Y.padding}));function K(){return window}function b(Y,T){if(!Y.getClientRects().length)return 0;const S=Y.getBoundingClientRect();return S.width||S.height?T===window?(T=Y.ownerDocument.documentElement,S.top-T.clientTop):S.top-T.getBoundingClientRect().top:S.top}const U=/#([\S ]+)$/,j=Y=>{var T;const{rootClassName:S,anchorPrefixCls:R,className:x,style:$,offsetTop:C,affix:d=!0,showInkInFixed:p=!1,children:P,items:W,direction:se="vertical",bounds:ve,targetOffset:ye,onClick:Re,onChange:Ge,getContainer:nt,getCurrentAnchor:pt,replace:lt}=Y,[dt,yt]=V.useState([]),[et,Gt]=V.useState(null),it=V.useRef(et),he=V.useRef(null),Oe=V.useRef(null),pe=V.useRef(!1),{direction:Me,getTargetContainer:$e,anchor:G}=V.useContext(O.E_),te=(T=nt!=null?nt:$e)!==null&&T!==void 0?T:K,ue=JSON.stringify(dt),Ae=(0,ne.useEvent)(Ve=>{dt.includes(Ve)||yt(Se=>[].concat((0,z.Z)(Se),[Ve]))}),Ie=(0,ne.useEvent)(Ve=>{dt.includes(Ve)&&yt(Se=>Se.filter(me=>me!==Ve))}),He=()=>{var Ve;const Se=(Ve=he.current)===null||Ve===void 0?void 0:Ve.querySelector(`.${R}-link-title-active`);if(Se&&Oe.current){const{style:me}=Oe.current,Fe=se==="horizontal";me.top=Fe?"":`${Se.offsetTop+Se.clientHeight/2}px`,me.height=Fe?"":`${Se.clientHeight}px`,me.left=Fe?`${Se.offsetLeft}px`:"",me.width=Fe?`${Se.clientWidth}px`:"",Fe&&(0,q.Z)(Se,{scrollMode:"if-needed",block:"nearest"})}},ct=function(Ve){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5;const Fe=[],Dt=te();return Ve.forEach(ut=>{const Et=U.exec(ut==null?void 0:ut.toString());if(!Et)return;const Ke=document.getElementById(Et[1]);if(Ke){const _t=b(Ke,Dt);_t<Se+me&&Fe.push({link:ut,top:_t})}}),Fe.length?Fe.reduce((Et,Ke)=>Ke.top>Et.top?Ke:Et).link:""},gt=(0,ne.useEvent)(Ve=>{if(it.current===Ve)return;const Se=typeof pt=="function"?pt(Ve):Ve;Gt(Se),it.current=Se,Ge==null||Ge(Ve)}),st=V.useCallback(()=>{if(pe.current)return;const Ve=ct(dt,ye!==void 0?ye:C||0,ve);gt(Ve)},[ue,ye,C]),Tt=V.useCallback(Ve=>{gt(Ve);const Se=U.exec(Ve);if(!Se)return;const me=document.getElementById(Se[1]);if(!me)return;const Fe=te(),Dt=(0,ee.Z)(Fe,!0),ut=b(me,Fe);let Et=Dt+ut;Et-=ye!==void 0?ye:C||0,pe.current=!0,(0,Z.Z)(Et,{getContainer:te,callback(){pe.current=!1}})},[ye,C]),wt=ae()(S,`${R}-wrapper`,{[`${R}-wrapper-horizontal`]:se==="horizontal",[`${R}-rtl`]:Me==="rtl"},x,G==null?void 0:G.className),At=ae()(R,{[`${R}-fixed`]:!d&&!p}),Ct=ae()(`${R}-ink`,{[`${R}-ink-visible`]:et}),bt=Object.assign(Object.assign({maxHeight:C?`calc(100vh - ${C}px)`:"100vh"},G==null?void 0:G.style),$),It=Ve=>Array.isArray(Ve)?Ve.map(Se=>V.createElement(_,Object.assign({replace:lt},Se,{key:Se.key}),se==="vertical"&&It(Se.children))):null,Ye=V.createElement("div",{ref:he,className:wt,style:bt},V.createElement("div",{className:At},V.createElement("span",{className:Ct,ref:Oe}),"items"in Y?It(W):P));V.useEffect(()=>{const Ve=te();return st(),Ve==null||Ve.addEventListener("scroll",st),()=>{Ve==null||Ve.removeEventListener("scroll",st)}},[ue]),V.useEffect(()=>{typeof pt=="function"&>(pt(it.current||""))},[pt]),V.useEffect(()=>{He()},[se,pt,ue,et]);const hn=V.useMemo(()=>({registerLink:Ae,unregisterLink:Ie,scrollTo:Tt,activeLink:et,onClick:Re,direction:se}),[et,Re,Tt,se]);return V.createElement(y.Provider,{value:hn},d?V.createElement(o.Z,{offsetTop:C,target:te},Ye):Ye)};var ce=Y=>{const{prefixCls:T,rootClassName:S}=Y,{getPrefixCls:R}=V.useContext(O.E_),x=R("anchor",T),[$,C]=k(x);return $(V.createElement(j,Object.assign({},Y,{rootClassName:ae()(C,S),anchorPrefixCls:x})))};const _e=ce;_e.Link=_;var re=_e},66104:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return R}});var z=I(92310),Q=I.n(z),ae=I(11592),ne=I(26112),V=I(59301),q=I(92343),ee=I(36355),Z=I(84105),o=I(91857);const O=x=>{let{children:$}=x;const{getPrefixCls:C}=V.useContext(ee.E_),d=C("breadcrumb");return V.createElement("li",{className:`${d}-separator`,"aria-hidden":"true"},$===""?$:$||"/")};O.__ANT_BREADCRUMB_SEPARATOR=!0;var v=O,y=function(x,$){var C={};for(var d in x)Object.prototype.hasOwnProperty.call(x,d)&&$.indexOf(d)<0&&(C[d]=x[d]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,d=Object.getOwnPropertySymbols(x);p<d.length;p++)$.indexOf(d[p])<0&&Object.prototype.propertyIsEnumerable.call(x,d[p])&&(C[d[p]]=x[d[p]]);return C};function u(x,$){if(x.title===void 0||x.title===null)return null;const C=Object.keys($).join("|");return typeof x.title=="object"?x.title:String(x.title).replace(new RegExp(`:(${C})`,"g"),(d,p)=>$[p]||d)}function _(x,$,C,d){if(C==null)return null;const{className:p,onClick:P}=$,W=y($,["className","onClick"]),se=Object.assign(Object.assign({},(0,ne.Z)(W,{data:!0,aria:!0})),{onClick:P});return d!==void 0?V.createElement("a",Object.assign({},se,{className:Q()(`${x}-link`,p),href:d}),C):V.createElement("span",Object.assign({},se,{className:Q()(`${x}-link`,p)}),C)}function m(x,$){return(d,p,P,W,se)=>{if($)return $(d,p,P,W);const ve=u(d,p);return _(x,d,ve,se)}}var N=function(x,$){var C={};for(var d in x)Object.prototype.hasOwnProperty.call(x,d)&&$.indexOf(d)<0&&(C[d]=x[d]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,d=Object.getOwnPropertySymbols(x);p<d.length;p++)$.indexOf(d[p])<0&&Object.prototype.propertyIsEnumerable.call(x,d[p])&&(C[d[p]]=x[d[p]]);return C};const F=x=>{const{prefixCls:$,separator:C="/",children:d,menu:p,overlay:P,dropdownProps:W,href:se}=x,ye=(Re=>{if(p||P){const Ge=Object.assign({},W);if(p){const nt=p||{},{items:pt}=nt,lt=N(nt,["items"]);Ge.menu=Object.assign(Object.assign({},lt),{items:pt==null?void 0:pt.map((dt,yt)=>{var{key:et,title:Gt,label:it,path:he}=dt,Oe=N(dt,["key","title","label","path"]);let pe=it!=null?it:Gt;return he&&(pe=V.createElement("a",{href:`${se}${he}`},pe)),Object.assign(Object.assign({},Oe),{key:et!=null?et:yt,label:pe})})})}else P&&(Ge.overlay=P);return V.createElement(o.Z,Object.assign({placement:"bottom"},Ge),V.createElement("span",{className:`${$}-overlay-link`},Re,V.createElement(Z.Z,null)))}return Re})(d);return ye!=null?V.createElement(V.Fragment,null,V.createElement("li",null,ye),C&&V.createElement(v,null,C)):null},M=x=>{const{prefixCls:$,children:C,href:d}=x,p=N(x,["prefixCls","children","href"]),{getPrefixCls:P}=V.useContext(ee.E_),W=P("breadcrumb",$);return V.createElement(F,Object.assign({},p,{prefixCls:W}),_(W,p,C,d))};M.__ANT_BREADCRUMB_ITEM=!0;var w=M,k=I(17313),K=I(83116),b=I(37613);const U=x=>{const{componentCls:$,iconCls:C}=x;return{[$]:Object.assign(Object.assign({},(0,k.Wf)(x)),{color:x.itemColor,fontSize:x.fontSize,[C]:{fontSize:x.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:x.linkColor,transition:`color ${x.motionDurationMid}`,padding:`0 ${x.paddingXXS}px`,borderRadius:x.borderRadiusSM,height:x.lineHeight*x.fontSize,display:"inline-block",marginInline:-x.marginXXS,"&:hover":{color:x.linkHoverColor,backgroundColor:x.colorBgTextHover}},(0,k.Qy)(x)),"li:last-child":{color:x.lastItemColor},[`${$}-separator`]:{marginInline:x.separatorMargin,color:x.separatorColor},[`${$}-link`]:{[`
|
|
> ${C} + span,
|
|
> ${C} + a
|
|
`]:{marginInlineStart:x.marginXXS}},[`${$}-overlay-link`]:{borderRadius:x.borderRadiusSM,height:x.lineHeight*x.fontSize,display:"inline-block",padding:`0 ${x.paddingXXS}px`,marginInline:-x.marginXXS,[`> ${C}`]:{marginInlineStart:x.marginXXS,fontSize:x.fontSizeIcon},"&:hover":{color:x.linkHoverColor,backgroundColor:x.colorBgTextHover,a:{color:x.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${x.componentCls}-rtl`]:{direction:"rtl"}})}};var j=(0,K.Z)("Breadcrumb",x=>{const $=(0,b.TS)(x,{});return[U($)]},x=>({itemColor:x.colorTextDescription,lastItemColor:x.colorText,iconFontSize:x.fontSize,linkColor:x.colorTextDescription,linkHoverColor:x.colorText,separatorColor:x.colorTextDescription,separatorMargin:x.marginXS})),H=function(x,$){var C={};for(var d in x)Object.prototype.hasOwnProperty.call(x,d)&&$.indexOf(d)<0&&(C[d]=x[d]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,d=Object.getOwnPropertySymbols(x);p<d.length;p++)$.indexOf(d[p])<0&&Object.prototype.propertyIsEnumerable.call(x,d[p])&&(C[d[p]]=x[d[p]]);return C};function ce(x){const{breadcrumbName:$,children:C}=x,d=H(x,["breadcrumbName","children"]),p=Object.assign({title:$},d);return C&&(p.menu={items:C.map(P=>{var{breadcrumbName:W}=P,se=H(P,["breadcrumbName"]);return Object.assign(Object.assign({},se),{title:W})})}),p}function _e(x,$){return(0,V.useMemo)(()=>x||($?$.map(ce):null),[x,$])}var re=function(x,$){var C={};for(var d in x)Object.prototype.hasOwnProperty.call(x,d)&&$.indexOf(d)<0&&(C[d]=x[d]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,d=Object.getOwnPropertySymbols(x);p<d.length;p++)$.indexOf(d[p])<0&&Object.prototype.propertyIsEnumerable.call(x,d[p])&&(C[d[p]]=x[d[p]]);return C};const Y=(x,$)=>{if($===void 0)return $;let C=($||"").replace(/^\//,"");return Object.keys(x).forEach(d=>{C=C.replace(`:${d}`,x[d])}),C},T=x=>{const{prefixCls:$,separator:C="/",style:d,className:p,rootClassName:P,routes:W,items:se,children:ve,itemRender:ye,params:Re={}}=x,Ge=re(x,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:nt,direction:pt,breadcrumb:lt}=V.useContext(ee.E_);let dt;const yt=nt("breadcrumb",$),[et,Gt]=j(yt),it=_e(se,W),he=m(yt,ye);if(it&&it.length>0){const Me=[],$e=se||W;dt=it.map((G,te)=>{const{path:ue,key:Ae,type:Ie,menu:He,overlay:ct,onClick:gt,className:st,separator:Tt,dropdownProps:wt}=G,At=Y(Re,ue);At!==void 0&&Me.push(At);const Ct=Ae!=null?Ae:te;if(Ie==="separator")return V.createElement(v,{key:Ct},Tt);const bt={},It=te===it.length-1;He?bt.menu=He:ct&&(bt.overlay=ct);let{href:Ye}=G;return Me.length&&At!==void 0&&(Ye=`#/${Me.join("/")}`),V.createElement(F,Object.assign({key:Ct},bt,(0,ne.Z)(G,{data:!0,aria:!0}),{className:st,dropdownProps:wt,href:Ye,separator:It?"":C,onClick:gt,prefixCls:yt}),he(G,Re,$e,Me,Ye))})}else if(ve){const Me=(0,ae.Z)(ve).length;dt=(0,ae.Z)(ve).map(($e,G)=>{if(!$e)return $e;const te=G===Me-1;return(0,q.Tm)($e,{separator:te?"":C,key:G})})}const Oe=Q()(yt,lt==null?void 0:lt.className,{[`${yt}-rtl`]:pt==="rtl"},p,P,Gt),pe=Object.assign(Object.assign({},lt==null?void 0:lt.style),d);return et(V.createElement("nav",Object.assign({className:Oe,style:pe},Ge),V.createElement("ol",null,dt)))};T.Item=w,T.Separator=v;var S=T,R=S},9937:function(qe,xe,I){"use strict";I.d(xe,{M1:function(){return ee},TM:function(){return K},Xy:function(){return Z},bi:function(){return v},e5:function(){return k},ik:function(){return y},nz:function(){return V},pU:function(){return q},s7:function(){return u},x0:function(){return O}});var z=I(17313),Q=I(74207),ae=I(37613),ne=I(83116);const V=b=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:b,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),q=b=>({borderColor:b.hoverBorderColor}),ee=b=>({borderColor:b.activeBorderColor,boxShadow:b.activeShadow,outline:0}),Z=b=>({color:b.colorTextDisabled,backgroundColor:b.colorBgContainerDisabled,borderColor:b.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},q((0,ae.TS)(b,{hoverBorderColor:b.colorBorder})))}),o=b=>{const{paddingBlockLG:U,fontSizeLG:j,lineHeightLG:H,borderRadiusLG:ce,paddingInlineLG:_e}=b;return{padding:`${U}px ${_e}px`,fontSize:j,lineHeight:H,borderRadius:ce}},O=b=>({padding:`${b.paddingBlockSM}px ${b.paddingInlineSM}px`,borderRadius:b.borderRadiusSM}),v=(b,U)=>{const{componentCls:j,colorError:H,colorWarning:ce,errorActiveShadow:_e,warningActiveShadow:re,colorErrorBorderHover:Y,colorWarningBorderHover:T}=b;return{[`&-status-error:not(${U}-disabled):not(${U}-borderless)${U}`]:{borderColor:H,"&:hover":{borderColor:Y},"&:focus, &-focused":Object.assign({},ee((0,ae.TS)(b,{activeBorderColor:H,activeShadow:_e}))),[`${j}-prefix, ${j}-suffix`]:{color:H}},[`&-status-warning:not(${U}-disabled):not(${U}-borderless)${U}`]:{borderColor:ce,"&:hover":{borderColor:T},"&:focus, &-focused":Object.assign({},ee((0,ae.TS)(b,{activeBorderColor:ce,activeShadow:re}))),[`${j}-prefix, ${j}-suffix`]:{color:ce}}}},y=b=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${b.paddingBlock}px ${b.paddingInline}px`,color:b.colorText,fontSize:b.fontSize,lineHeight:b.lineHeight,backgroundColor:b.colorBgContainer,backgroundImage:"none",borderWidth:b.lineWidth,borderStyle:b.lineType,borderColor:b.colorBorder,borderRadius:b.borderRadius,transition:`all ${b.motionDurationMid}`},V(b.colorTextPlaceholder)),{"&:hover":Object.assign({},q(b)),"&:focus, &-focused":Object.assign({},ee(b)),"&-disabled, &[disabled]":Object.assign({},Z(b)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:b.controlHeight,lineHeight:b.lineHeight,verticalAlign:"bottom",transition:`all ${b.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},o(b)),"&-sm":Object.assign({},O(b)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),u=b=>{const{componentCls:U,antCls:j}=b;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:b.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${U}, &-lg > ${U}-group-addon`]:Object.assign({},o(b)),[`&-sm ${U}, &-sm > ${U}-group-addon`]:Object.assign({},O(b)),[`&-lg ${j}-select-single ${j}-select-selector`]:{height:b.controlHeightLG},[`&-sm ${j}-select-single ${j}-select-selector`]:{height:b.controlHeightSM},[`> ${U}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${U}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${b.paddingInline}px`,color:b.colorText,fontWeight:"normal",fontSize:b.fontSize,textAlign:"center",backgroundColor:b.colorFillAlter,border:`${b.lineWidth}px ${b.lineType} ${b.colorBorder}`,borderRadius:b.borderRadius,transition:`all ${b.motionDurationSlow}`,lineHeight:1,[`${j}-select`]:{margin:`-${b.paddingBlock+1}px -${b.paddingInline}px`,[`&${j}-select-single:not(${j}-select-customize-input)`]:{[`${j}-select-selector`]:{backgroundColor:"inherit",border:`${b.lineWidth}px ${b.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${j}-select-selector`]:{color:b.colorPrimary}}},[`${j}-cascader-picker`]:{margin:`-9px -${b.paddingInline}px`,backgroundColor:"transparent",[`${j}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${U}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${U}-search-with-button &`]:{zIndex:0}}},[`> ${U}:first-child, ${U}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${j}-select ${j}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${U}-affix-wrapper`]:{[`&:not(:first-child) ${U}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${U}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${U}:last-child, ${U}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${j}-select ${j}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${U}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${U}-search &`]:{borderStartStartRadius:b.borderRadius,borderEndStartRadius:b.borderRadius}},[`&:not(:first-child), ${U}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${U}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,z.dF)()),{[`${U}-group-addon, ${U}-group-wrap, > ${U}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:b.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
& > ${U}-affix-wrapper,
|
|
& > ${U}-number-affix-wrapper,
|
|
& > ${j}-picker-range
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-b.lineWidth,borderInlineEndWidth:b.lineWidth},[`${U}`]:{float:"none"},[`& > ${j}-select > ${j}-select-selector,
|
|
& > ${j}-select-auto-complete ${U},
|
|
& > ${j}-cascader-picker ${U},
|
|
& > ${U}-group-wrapper ${U}`]:{borderInlineEndWidth:b.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${j}-select-focused`]:{zIndex:1},[`& > ${j}-select > ${j}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
& > ${j}-select:first-child > ${j}-select-selector,
|
|
& > ${j}-select-auto-complete:first-child ${U},
|
|
& > ${j}-cascader-picker:first-child ${U}`]:{borderStartStartRadius:b.borderRadius,borderEndStartRadius:b.borderRadius},[`& > *:last-child,
|
|
& > ${j}-select:last-child > ${j}-select-selector,
|
|
& > ${j}-cascader-picker:last-child ${U},
|
|
& > ${j}-cascader-picker-focused:last-child ${U}`]:{borderInlineEndWidth:b.lineWidth,borderStartEndRadius:b.borderRadius,borderEndEndRadius:b.borderRadius},[`& > ${j}-select-auto-complete ${U}`]:{verticalAlign:"top"},[`${U}-group-wrapper + ${U}-group-wrapper`]:{marginInlineStart:-b.lineWidth,[`${U}-affix-wrapper`]:{borderRadius:0}},[`${U}-group-wrapper:not(:last-child)`]:{[`&${U}-search > ${U}-group`]:{[`& > ${U}-group-addon > ${U}-search-button`]:{borderRadius:0},[`& > ${U}`]:{borderStartStartRadius:b.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b.borderRadius}}}})}},_=b=>{const{componentCls:U,controlHeightSM:j,lineWidth:H}=b,_e=(j-H*2-16)/2;return{[U]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,z.Wf)(b)),y(b)),v(b,U)),{'&[type="color"]':{height:b.controlHeight,[`&${U}-lg`]:{height:b.controlHeightLG},[`&${U}-sm`]:{height:j,paddingTop:_e,paddingBottom:_e}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},m=b=>{const{componentCls:U}=b;return{[`${U}-clear-icon`]:{margin:0,color:b.colorTextQuaternary,fontSize:b.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${b.motionDurationSlow}`,"&:hover":{color:b.colorTextTertiary},"&:active":{color:b.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${b.inputAffixPadding}px`}}}},N=b=>{const{componentCls:U,inputAffixPadding:j,colorTextDescription:H,motionDurationSlow:ce,colorIcon:_e,colorIconHover:re,iconCls:Y}=b;return{[`${U}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},y(b)),{display:"inline-flex",[`&:not(${U}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},q(b)),{zIndex:1,[`${U}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${U}[disabled]`]:{background:"transparent"}},[`> input${U}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${U}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:b.paddingXS}},"&-show-count-suffix":{color:H},"&-show-count-has-suffix":{marginInlineEnd:b.paddingXXS},"&-prefix":{marginInlineEnd:j},"&-suffix":{marginInlineStart:j}}}),m(b)),{[`${Y}${U}-password-icon`]:{color:_e,cursor:"pointer",transition:`all ${ce}`,"&:hover":{color:re}}}),v(b,`${U}-affix-wrapper`))}},F=b=>{const{componentCls:U,colorError:j,colorWarning:H,borderRadiusLG:ce,borderRadiusSM:_e}=b;return{[`${U}-group`]:Object.assign(Object.assign(Object.assign({},(0,z.Wf)(b)),u(b)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${U}-group-addon`]:{borderRadius:ce,fontSize:b.fontSizeLG}},"&-sm":{[`${U}-group-addon`]:{borderRadius:_e}},"&-status-error":{[`${U}-group-addon`]:{color:j,borderColor:j}},"&-status-warning":{[`${U}-group-addon`]:{color:H,borderColor:H}},"&-disabled":{[`${U}-group-addon`]:Object.assign({},Z(b))},[`&:not(${U}-compact-first-item):not(${U}-compact-last-item)${U}-compact-item`]:{[`${U}, ${U}-group-addon`]:{borderRadius:0}},[`&:not(${U}-compact-last-item)${U}-compact-first-item`]:{[`${U}, ${U}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${U}-compact-first-item)${U}-compact-last-item`]:{[`${U}, ${U}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},M=b=>{const{componentCls:U,antCls:j}=b,H=`${U}-search`;return{[H]:{[`${U}`]:{"&:hover, &:focus":{borderColor:b.colorPrimaryHover,[`+ ${U}-group-addon ${H}-button:not(${j}-btn-primary)`]:{borderInlineStartColor:b.colorPrimaryHover}}},[`${U}-affix-wrapper`]:{borderRadius:0},[`${U}-lg`]:{lineHeight:b.lineHeightLG-2e-4},[`> ${U}-group`]:{[`> ${U}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${H}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:b.borderRadius,borderEndEndRadius:b.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${H}-button:not(${j}-btn-primary)`]:{color:b.colorTextDescription,"&:hover":{color:b.colorPrimaryHover},"&:active":{color:b.colorPrimaryActive},[`&${j}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${H}-button`]:{height:b.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${H}-button`]:{height:b.controlHeightLG},[`&-small ${H}-button`]:{height:b.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${U}-compact-item`]:{[`&:not(${U}-compact-last-item)`]:{[`${U}-group-addon`]:{[`${U}-search-button`]:{marginInlineEnd:-b.lineWidth,borderRadius:0}}},[`&:not(${U}-compact-first-item)`]:{[`${U},${U}-affix-wrapper`]:{borderRadius:0}},[`> ${U}-group-addon ${U}-search-button,
|
|
> ${U},
|
|
${U}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${U}-affix-wrapper-focused`]:{zIndex:2}}}}},w=b=>{const{componentCls:U,paddingLG:j}=b,H=`${U}-textarea`;return{[H]:{position:"relative","&-show-count":{[`> ${U}`]:{height:"100%"},[`${U}-data-count`]:{position:"absolute",bottom:-b.fontSize*b.lineHeight,insetInlineEnd:0,color:b.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${U}`]:{paddingInlineEnd:j}},[`&-affix-wrapper${H}-has-feedback`]:{[`${U}`]:{paddingInlineEnd:j}},[`&-affix-wrapper${U}-affix-wrapper`]:{padding:0,[`> textarea${U}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${U}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${U}-clear-icon`]:{position:"absolute",insetInlineEnd:b.paddingXS,insetBlockStart:b.paddingXS},[`${H}-suffix`]:{position:"absolute",top:0,insetInlineEnd:b.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function k(b){return(0,ae.TS)(b,{inputAffixPadding:b.paddingXXS})}const K=b=>{const{controlHeight:U,fontSize:j,lineHeight:H,lineWidth:ce,controlHeightSM:_e,controlHeightLG:re,fontSizeLG:Y,lineHeightLG:T,paddingSM:S,controlPaddingHorizontalSM:R,controlPaddingHorizontal:x,colorFillAlter:$,colorPrimaryHover:C,controlOutlineWidth:d,controlOutline:p,colorErrorOutline:P,colorWarningOutline:W}=b;return{paddingBlock:Math.max(Math.round((U-j*H)/2*10)/10-ce,3),paddingBlockSM:Math.max(Math.round((_e-j*H)/2*10)/10-ce,0),paddingBlockLG:Math.ceil((re-Y*T)/2*10)/10-ce,paddingInline:S-ce,paddingInlineSM:R-ce,paddingInlineLG:x-ce,addonBg:$,activeBorderColor:C,hoverBorderColor:C,activeShadow:`0 0 0 ${d}px ${p}`,errorActiveShadow:`0 0 0 ${d}px ${P}`,warningActiveShadow:`0 0 0 ${d}px ${W}`}};xe.ZP=(0,ne.Z)("Input",b=>{const U=(0,ae.TS)(b,k(b));return[_(U),w(U),N(U),F(U),M(U),(0,Q.c)(U)]},K)},8378:function(qe,xe){"use strict";const I=z=>({[z.componentCls]:{[`${z.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${z.motionDurationMid} ${z.motionEaseInOut},
|
|
opacity ${z.motionDurationMid} ${z.motionEaseInOut} !important`}},[`${z.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${z.motionDurationMid} ${z.motionEaseInOut},
|
|
opacity ${z.motionDurationMid} ${z.motionEaseInOut} !important`}}});xe.Z=I},92899:function(qe,xe,I){"use strict";I.d(xe,{Fm:function(){return y}});var z=I(93083),Q=I(95406);const ae=new z.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ne=new z.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),V=new z.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),q=new z.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ee=new z.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Z=new z.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 z.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),O=new z.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),v={"move-up":{inKeyframes:o,outKeyframes:O},"move-down":{inKeyframes:ae,outKeyframes:ne},"move-left":{inKeyframes:V,outKeyframes:q},"move-right":{inKeyframes:ee,outKeyframes:Z}},y=(u,_)=>{const{antCls:m}=u,N=`${m}-${_}`,{inKeyframes:F,outKeyframes:M}=v[_];return[(0,Q.R)(N,F,M,u.motionDurationMid),{[`
|
|
${N}-enter,
|
|
${N}-appear
|
|
`]:{opacity:0,animationTimingFunction:u.motionEaseOutCirc},[`${N}-leave`]:{animationTimingFunction:u.motionEaseInOutCirc}}]}},13826:function(qe,xe,I){"use strict";I.d(xe,{Qt:function(){return V},Uw:function(){return ne},fJ:function(){return ae},ly:function(){return q},oN:function(){return y}});var z=I(93083),Q=I(95406);const ae=new z.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ne=new z.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),V=new z.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),q=new z.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),ee=new z.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Z=new z.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),o=new z.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),O=new z.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),v={"slide-up":{inKeyframes:ae,outKeyframes:ne},"slide-down":{inKeyframes:V,outKeyframes:q},"slide-left":{inKeyframes:ee,outKeyframes:Z},"slide-right":{inKeyframes:o,outKeyframes:O}},y=(u,_)=>{const{antCls:m}=u,N=`${m}-${_}`,{inKeyframes:F,outKeyframes:M}=v[_];return[(0,Q.R)(N,F,M,u.motionDurationMid),{[`
|
|
${N}-enter,
|
|
${N}-appear
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:u.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${N}-leave`]:{animationTimingFunction:u.motionEaseInQuint}}]}},19447:function(qe,xe,I){"use strict";I.d(xe,{ZP:function(){return V},fS:function(){return ae},qN:function(){return Q}});var z=I(47585);const Q=8;function ae(q){const ee=Q,{contentRadius:Z,limitVerticalRadius:o}=q,O=Z>12?Z+2:12;return{dropdownArrowOffset:O,dropdownArrowOffsetVertical:o?ee:O}}function ne(q,ee){return q?ee:{}}function V(q,ee){const{componentCls:Z,sizePopupArrow:o,borderRadiusXS:O,borderRadiusOuter:v,boxShadowPopoverArrow:y}=q,{colorBg:u,contentRadius:_=q.borderRadiusLG,limitVerticalRadius:m,arrowDistance:N=0,arrowPlacement:F={left:!0,right:!0,top:!0,bottom:!0}}=ee,{dropdownArrowOffsetVertical:M,dropdownArrowOffset:w}=ae({contentRadius:_,limitVerticalRadius:m});return{[Z]:Object.assign(Object.assign(Object.assign(Object.assign({[`${Z}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,z.r)(o,O,v,u,y)),{"&:before":{background:u}})]},ne(!!F.top,{[[`&-placement-top ${Z}-arrow`,`&-placement-topLeft ${Z}-arrow`,`&-placement-topRight ${Z}-arrow`].join(",")]:{bottom:N,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${Z}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${Z}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-topRight ${Z}-arrow`]:{right:{_skip_check_:!0,value:w}}})),ne(!!F.bottom,{[[`&-placement-bottom ${Z}-arrow`,`&-placement-bottomLeft ${Z}-arrow`,`&-placement-bottomRight ${Z}-arrow`].join(",")]:{top:N,transform:"translateY(-100%)"},[`&-placement-bottom ${Z}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${Z}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-bottomRight ${Z}-arrow`]:{right:{_skip_check_:!0,value:w}}})),ne(!!F.left,{[[`&-placement-left ${Z}-arrow`,`&-placement-leftTop ${Z}-arrow`,`&-placement-leftBottom ${Z}-arrow`].join(",")]:{right:{_skip_check_:!0,value:N},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${Z}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${Z}-arrow`]:{top:M},[`&-placement-leftBottom ${Z}-arrow`]:{bottom:M}})),ne(!!F.right,{[[`&-placement-right ${Z}-arrow`,`&-placement-rightTop ${Z}-arrow`,`&-placement-rightBottom ${Z}-arrow`].join(",")]:{left:{_skip_check_:!0,value:N},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${Z}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${Z}-arrow`]:{top:M},[`&-placement-rightBottom ${Z}-arrow`]:{bottom:M}}))}}},47585:function(qe,xe,I){"use strict";I.d(xe,{r:function(){return z}});const z=(Q,ae,ne,V,q)=>{const ee=Q/2,Z=0,o=ee,O=ne*1/Math.sqrt(2),v=ee-ne*(1-1/Math.sqrt(2)),y=ee-ae*(1/Math.sqrt(2)),u=ne*(Math.sqrt(2)-1)+ae*(1/Math.sqrt(2)),_=2*ee-y,m=u,N=2*ee-O,F=v,M=2*ee-Z,w=o,k=ee*Math.sqrt(2)+ne*(Math.sqrt(2)-2),K=ne*(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:V,clipPath:{_multi_value_:!0,value:[`polygon(${K}px 100%, 50% ${K}px, ${2*ee-K}px 100%, ${K}px 100%)`,`path('M ${Z} ${o} A ${ne} ${ne} 0 0 0 ${O} ${v} L ${y} ${u} A ${ae} ${ae} 0 0 1 ${_} ${m} L ${N} ${F} A ${ne} ${ne} 0 0 0 ${M} ${w} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:k,height:k,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${ae}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:q,zIndex:0,background:"transparent"}}}},12563:function(qe,xe,I){"use strict";I.d(xe,{default:function(){return re}});var z=I(59301),Q=I(99267),ae=I(92310),ne=I.n(ae),V=I(36785),q=I(47729),ee=I(14088),Z=I(36355),o=I(17313),O=I(37613),v=I(83116);const y=Y=>{const{paddingXXS:T,lineWidth:S,tagPaddingHorizontal:R,componentCls:x}=Y,$=R-S,C=T-S;return{[x]:Object.assign(Object.assign({},(0,o.Wf)(Y)),{display:"inline-block",height:"auto",marginInlineEnd:Y.marginXS,paddingInline:$,fontSize:Y.tagFontSize,lineHeight:Y.tagLineHeight,whiteSpace:"nowrap",background:Y.defaultBg,border:`${Y.lineWidth}px ${Y.lineType} ${Y.colorBorder}`,borderRadius:Y.borderRadiusSM,opacity:1,transition:`all ${Y.motionDurationMid}`,textAlign:"start",position:"relative",[`&${x}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:Y.defaultColor},[`${x}-close-icon`]:{marginInlineStart:C,color:Y.colorTextDescription,fontSize:Y.tagIconSize,cursor:"pointer",transition:`all ${Y.motionDurationMid}`,"&:hover":{color:Y.colorTextHeading}},[`&${x}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${Y.iconCls}-close, ${Y.iconCls}-close:hover`]:{color:Y.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${x}-checkable-checked):hover`]:{color:Y.colorPrimary,backgroundColor:Y.colorFillSecondary},"&:active, &-checked":{color:Y.colorTextLightSolid},"&-checked":{backgroundColor:Y.colorPrimary,"&:hover":{backgroundColor:Y.colorPrimaryHover}},"&:active":{backgroundColor:Y.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${Y.iconCls} + span, > span + ${Y.iconCls}`]:{marginInlineStart:$}}),[`${x}-borderless`]:{borderColor:"transparent",background:Y.tagBorderlessBg}}},u=Y=>{const{lineWidth:T,fontSizeIcon:S}=Y,R=Y.fontSizeSM,x=`${Y.lineHeightSM*R}px`;return(0,O.TS)(Y,{tagFontSize:R,tagLineHeight:x,tagIconSize:S-2*T,tagPaddingHorizontal:8,tagBorderlessBg:Y.colorFillTertiary})},_=Y=>({defaultBg:Y.colorFillQuaternary,defaultColor:Y.colorText});var m=(0,v.Z)("Tag",Y=>{const T=u(Y);return y(T)},_),N=function(Y,T){var S={};for(var R in Y)Object.prototype.hasOwnProperty.call(Y,R)&&T.indexOf(R)<0&&(S[R]=Y[R]);if(Y!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,R=Object.getOwnPropertySymbols(Y);x<R.length;x++)T.indexOf(R[x])<0&&Object.prototype.propertyIsEnumerable.call(Y,R[x])&&(S[R[x]]=Y[R[x]]);return S},M=Y=>{const{prefixCls:T,style:S,className:R,checked:x,onChange:$,onClick:C}=Y,d=N(Y,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:p,tag:P}=z.useContext(Z.E_),W=Ge=>{$==null||$(!x),C==null||C(Ge)},se=p("tag",T),[ve,ye]=m(se),Re=ne()(se,`${se}-checkable`,{[`${se}-checkable-checked`]:x},P==null?void 0:P.className,R,ye);return ve(z.createElement("span",Object.assign({},d,{style:Object.assign(Object.assign({},S),P==null?void 0:P.style),className:Re,onClick:W})))},w=I(45157);const k=Y=>(0,w.Z)(Y,(T,S)=>{let{textColor:R,lightBorderColor:x,lightColor:$,darkColor:C}=S;return{[`${Y.componentCls}-${T}`]:{color:R,background:$,borderColor:x,"&-inverse":{color:Y.colorTextLightSolid,background:C,borderColor:C},[`&${Y.componentCls}-borderless`]:{borderColor:"transparent"}}}});var K=(0,v.b)(["Tag","preset"],Y=>{const T=u(Y);return k(T)},_);function b(Y){return typeof Y!="string"?Y:Y.charAt(0).toUpperCase()+Y.slice(1)}const U=(Y,T,S)=>{const R=b(S);return{[`${Y.componentCls}-${T}`]:{color:Y[`color${S}`],background:Y[`color${R}Bg`],borderColor:Y[`color${R}Border`],[`&${Y.componentCls}-borderless`]:{borderColor:"transparent"}}}};var j=(0,v.b)(["Tag","status"],Y=>{const T=u(Y);return[U(T,"success","Success"),U(T,"processing","Info"),U(T,"error","Error"),U(T,"warning","Warning")]},_),H=function(Y,T){var S={};for(var R in Y)Object.prototype.hasOwnProperty.call(Y,R)&&T.indexOf(R)<0&&(S[R]=Y[R]);if(Y!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,R=Object.getOwnPropertySymbols(Y);x<R.length;x++)T.indexOf(R[x])<0&&Object.prototype.propertyIsEnumerable.call(Y,R[x])&&(S[R[x]]=Y[R[x]]);return S};const ce=(Y,T)=>{const{prefixCls:S,className:R,rootClassName:x,style:$,children:C,icon:d,color:p,onClose:P,closeIcon:W,closable:se,bordered:ve=!0}=Y,ye=H(Y,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:Re,direction:Ge,tag:nt}=z.useContext(Z.E_),[pt,lt]=z.useState(!0);z.useEffect(()=>{"visible"in ye&<(ye.visible)},[ye.visible]);const dt=(0,V.o2)(p),yt=(0,V.yT)(p),et=dt||yt,Gt=Object.assign(Object.assign({backgroundColor:p&&!et?p:void 0},nt==null?void 0:nt.style),$),it=Re("tag",S),[he,Oe]=m(it),pe=ne()(it,nt==null?void 0:nt.className,{[`${it}-${p}`]:et,[`${it}-has-color`]:p&&!et,[`${it}-hidden`]:!pt,[`${it}-rtl`]:Ge==="rtl",[`${it}-borderless`]:!ve},R,x,Oe),Me=Ie=>{Ie.stopPropagation(),P==null||P(Ie),!Ie.defaultPrevented&<(!1)},[,$e]=(0,q.Z)(se,W,Ie=>Ie===null?z.createElement(Q.Z,{className:`${it}-close-icon`,onClick:Me}):z.createElement("span",{className:`${it}-close-icon`,onClick:Me},Ie),null,!1),G=typeof ye.onClick=="function"||C&&C.type==="a",te=d||null,ue=te?z.createElement(z.Fragment,null,te,C&&z.createElement("span",null,C)):C,Ae=z.createElement("span",Object.assign({},ye,{ref:T,className:pe,style:Gt}),ue,$e,dt&&z.createElement(K,{key:"preset",prefixCls:it}),yt&&z.createElement(j,{key:"status",prefixCls:it}));return he(G?z.createElement(ee.Z,{component:"Tag"},Ae):Ae)},_e=z.forwardRef(ce);_e.CheckableTag=M;var re=_e},33166:function(qe,xe,I){"use strict";I.d(xe,{i:function(){return z}});const z=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return Q}});var z=I(33166);function Q(ae,ne){return z.i.reduce((V,q)=>{const ee=ae[`${q}1`],Z=ae[`${q}3`],o=ae[`${q}6`],O=ae[`${q}7`];return Object.assign(Object.assign({},V),ne(q,{lightColor:ee,lightBorderColor:Z,darkColor:o,textColor:O}))},{})}},6848:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return re}});var z=I(59301),Q=I(92310),ae=I.n(Q),ne=I(55477),V=I(18929),q=I(62892),ee=I(79676),Z=I(92343),o=I(36355),O=I(33234),v=I(88088),y=I(17313),u=I(29878),_=I(19447),m=I(45157),N=I(37613),F=I(83116);const M=Y=>{const{componentCls:T,tooltipMaxWidth:S,tooltipColor:R,tooltipBg:x,tooltipBorderRadius:$,zIndexPopup:C,controlHeight:d,boxShadowSecondary:p,paddingSM:P,paddingXS:W,tooltipRadiusOuter:se}=Y;return[{[T]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,y.Wf)(Y)),{position:"absolute",zIndex:C,display:"block",width:"max-content",maxWidth:S,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":x,[`${T}-inner`]:{minWidth:d,minHeight:d,padding:`${P/2}px ${W}px`,color:R,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:x,borderRadius:$,boxShadow:p,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${T}-inner`]:{borderRadius:Math.min($,_.qN)}},[`${T}-content`]:{position:"relative"}}),(0,m.Z)(Y,(ve,ye)=>{let{darkColor:Re}=ye;return{[`&${T}-${ve}`]:{[`${T}-inner`]:{backgroundColor:Re},[`${T}-arrow`]:{"--antd-arrow-background-color":Re}}}})),{"&-rtl":{direction:"rtl"}})},(0,_.ZP)((0,N.TS)(Y,{borderRadiusOuter:se}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:$,limitVerticalRadius:!0}),{[`${T}-pure`]:{position:"relative",maxWidth:"none",margin:Y.sizePopupArrow}}]};var w=(Y,T)=>(0,F.Z)("Tooltip",R=>{if(T===!1)return[];const{borderRadius:x,colorTextLightSolid:$,colorBgDefault:C,borderRadiusOuter:d}=R,p=(0,N.TS)(R,{tooltipMaxWidth:250,tooltipColor:$,tooltipBorderRadius:x,tooltipBg:C,tooltipRadiusOuter:d>4?4:d});return[M(p),(0,u._y)(R,"zoom-big-fast")]},R=>{let{zIndexPopupBase:x,colorBgSpotlight:$}=R;return{zIndexPopup:x+70,colorBgDefault:$}},{resetStyle:!1})(Y),k=I(36785);function K(Y,T){const S=(0,k.o2)(T),R=ae()({[`${Y}-${T}`]:T&&S}),x={},$={};return T&&!S&&(x.background=T,$["--antd-arrow-background-color"]=T),{className:R,overlayStyle:x,arrowStyle:$}}var U=Y=>{const{prefixCls:T,className:S,placement:R="top",title:x,color:$,overlayInnerStyle:C}=Y,{getPrefixCls:d}=z.useContext(o.E_),p=d("tooltip",T),[P,W]=w(p,!0),se=K(p,$),ve=se.arrowStyle,ye=Object.assign(Object.assign({},C),se.overlayStyle),Re=ae()(W,p,`${p}-pure`,`${p}-placement-${R}`,S,se.className);return P(z.createElement("div",{className:Re,style:ve},z.createElement("div",{className:`${p}-arrow`}),z.createElement(ne.G,Object.assign({},Y,{className:W,prefixCls:p,overlayInnerStyle:ye}),x)))},j=function(Y,T){var S={};for(var R in Y)Object.prototype.hasOwnProperty.call(Y,R)&&T.indexOf(R)<0&&(S[R]=Y[R]);if(Y!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,R=Object.getOwnPropertySymbols(Y);x<R.length;x++)T.indexOf(R[x])<0&&Object.prototype.propertyIsEnumerable.call(Y,R[x])&&(S[R[x]]=Y[R[x]]);return S};const H=(Y,T)=>{const S={},R=Object.assign({},Y);return T.forEach(x=>{Y&&x in Y&&(S[x]=Y[x],delete R[x])}),{picked:S,omitted:R}};function ce(Y,T){const S=Y.type;if((S.__ANT_BUTTON===!0||Y.type==="button")&&Y.props.disabled||S.__ANT_SWITCH===!0&&(Y.props.disabled||Y.props.loading)||S.__ANT_RADIO===!0&&Y.props.disabled){const{picked:R,omitted:x}=H(Y.props.style,["position","left","right","top","bottom","float","display","zIndex"]),$=Object.assign(Object.assign({display:"inline-block"},R),{cursor:"not-allowed",width:Y.props.block?"100%":void 0}),C=Object.assign(Object.assign({},x),{pointerEvents:"none"}),d=(0,Z.Tm)(Y,{style:C,className:null});return z.createElement("span",{style:$,className:ae()(Y.props.className,`${T}-disabled-compatible-wrapper`)},d)}return Y}const _e=z.forwardRef((Y,T)=>{var S,R;const{prefixCls:x,openClassName:$,getTooltipContainer:C,overlayClassName:d,color:p,overlayInnerStyle:P,children:W,afterOpenChange:se,afterVisibleChange:ve,destroyTooltipOnHide:ye,arrow:Re=!0,title:Ge,overlay:nt,builtinPlacements:pt,arrowPointAtCenter:lt=!1,autoAdjustOverflow:dt=!0}=Y,yt=!!Re,[,et]=(0,v.Z)(),{getPopupContainer:Gt,getPrefixCls:it,direction:he}=z.useContext(o.E_),Oe=z.useRef(null),pe=()=>{var _t;(_t=Oe.current)===null||_t===void 0||_t.forceAlign()};z.useImperativeHandle(T,()=>({forceAlign:pe,forcePopupAlign:()=>{pe()}}));const[Me,$e]=(0,V.Z)(!1,{value:(S=Y.open)!==null&&S!==void 0?S:Y.visible,defaultValue:(R=Y.defaultOpen)!==null&&R!==void 0?R:Y.defaultVisible}),G=!Ge&&!nt&&Ge!==0,te=_t=>{var rt,xt;$e(G?!1:_t),G||((rt=Y.onOpenChange)===null||rt===void 0||rt.call(Y,_t),(xt=Y.onVisibleChange)===null||xt===void 0||xt.call(Y,_t))},ue=z.useMemo(()=>{var _t,rt;let xt=lt;return typeof Re=="object"&&(xt=(rt=(_t=Re.pointAtCenter)!==null&&_t!==void 0?_t:Re.arrowPointAtCenter)!==null&&rt!==void 0?rt:lt),pt||(0,ee.Z)({arrowPointAtCenter:xt,autoAdjustOverflow:dt,arrowWidth:yt?et.sizePopupArrow:0,borderRadius:et.borderRadius,offset:et.marginXXS,visibleFirst:!0})},[lt,Re,pt,et]),Ae=z.useMemo(()=>Ge===0?Ge:nt||Ge||"",[nt,Ge]),Ie=z.createElement(O.BR,null,typeof Ae=="function"?Ae():Ae),{getPopupContainer:He,placement:ct="top",mouseEnterDelay:gt=.1,mouseLeaveDelay:st=.1,overlayStyle:Tt,rootClassName:wt}=Y,At=j(Y,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Ct=it("tooltip",x),bt=it(),It=Y["data-popover-inject"];let Ye=Me;!("open"in Y)&&!("visible"in Y)&&G&&(Ye=!1);const hn=ce((0,Z.l$)(W)&&!(0,Z.M2)(W)?W:z.createElement("span",null,W),Ct),Ve=hn.props,Se=!Ve.className||typeof Ve.className=="string"?ae()(Ve.className,$||`${Ct}-open`):Ve.className,[me,Fe]=w(Ct,!It),Dt=K(Ct,p),ut=Dt.arrowStyle,Et=Object.assign(Object.assign({},P),Dt.overlayStyle),Ke=ae()(d,{[`${Ct}-rtl`]:he==="rtl"},Dt.className,wt,Fe);return me(z.createElement(ne.Z,Object.assign({},At,{showArrow:yt,placement:ct,mouseEnterDelay:gt,mouseLeaveDelay:st,prefixCls:Ct,overlayClassName:Ke,overlayStyle:Object.assign(Object.assign({},ut),Tt),getTooltipContainer:He||C||Gt,ref:Oe,builtinPlacements:ue,overlay:Ie,visible:Ye,onVisibleChange:te,afterVisibleChange:se!=null?se:ve,overlayInnerStyle:Et,arrowContent:z.createElement("span",{className:`${Ct}-arrow-content`}),motion:{motionName:(0,q.m)(bt,"zoom-big-fast",Y.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!ye}),Ye?(0,Z.Tm)(hn,{className:Se}):hn))});_e._InternalPanelDoNotUseOrYouWillBeFired=U;var re=_e},25769:function(qe,xe,I){"use strict";var z=I(98040),Q={"text/plain":"Text","text/html":"Url",default:"Text"},ae="Copy to clipboard: #{key}, Enter";function ne(q){var ee=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return q.replace(/#{\s*key\s*}/g,ee)}function V(q,ee){var Z,o,O,v,y,u,_=!1;ee||(ee={}),Z=ee.debug||!1;try{O=z(),v=document.createRange(),y=document.getSelection(),u=document.createElement("span"),u.textContent=q,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(N){if(N.stopPropagation(),ee.format)if(N.preventDefault(),typeof N.clipboardData=="undefined"){Z&&console.warn("unable to use e.clipboardData"),Z&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var F=Q[ee.format]||Q.default;window.clipboardData.setData(F,q)}else N.clipboardData.clearData(),N.clipboardData.setData(ee.format,q);ee.onCopy&&(N.preventDefault(),ee.onCopy(N.clipboardData))}),document.body.appendChild(u),v.selectNodeContents(u),y.addRange(v);var m=document.execCommand("copy");if(!m)throw new Error("copy command was unsuccessful");_=!0}catch(N){Z&&console.error("unable to copy using execCommand: ",N),Z&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(ee.format||"text",q),ee.onCopy&&ee.onCopy(window.clipboardData),_=!0}catch(F){Z&&console.error("unable to copy using clipboardData: ",F),Z&&console.error("falling back to prompt"),o=ne("message"in ee?ee.message:ae),window.prompt(o,q)}}finally{y&&(typeof y.removeRange=="function"?y.removeRange(v):y.removeAllRanges()),u&&document.body.removeChild(u),O()}return _}qe.exports=V},53184:function(qe,xe,I){"use strict";var z,Q;function ae(ne,V,q){var ee=function(Z,o){return ne.js_beautify(Z,o)};return ee.js=ne.js_beautify,ee.css=V.css_beautify,ee.html=q.html_beautify,ee.js_beautify=ne.js_beautify,ee.css_beautify=V.css_beautify,ee.html_beautify=q.html_beautify,ee}z=[I(58553),I(87804),I(40998)],Q=function(ne,V,q){return ae(ne,V,q)}.apply(xe,z),Q!==void 0&&(qe.exports=Q)},87804:function(qe,xe){var I,z;(function(){var Q;(function(){"use strict";var ne=[,,function(Z){function o(y){this.__parent=y,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 y=new o(this.__parent);return y.set_indent(this.__indent_count,this.__alignment_count),y},o.prototype.item=function(y){return y<0?this.__items[this.__items.length+y]:this.__items[y]},o.prototype.has_match=function(y){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(y))return!0;return!1},o.prototype.set_indent=function(y,u){this.is_empty()&&(this.__indent_count=y||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 y=this.__parent.current_line;return y.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),y.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),y.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,y.__items[0]===" "&&(y.__items.splice(0,1),y.__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(y){this.__items.push(y);var u=y.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=y.length-u:this.__character_count+=y.length},o.prototype.pop=function(){var y=null;return this.is_empty()||(y=this.__items.pop(),this.__character_count-=y.length),y},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 y="";return this.is_empty()?this.__parent.indent_empty_lines&&(y=this.__parent.get_indent_string(this.__indent_count)):(y=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),y+=this.__items.join("")),y};function O(y,u){this.__cache=[""],this.__indent_size=y.indent_size,this.__indent_string=y.indent_char,y.indent_with_tabs||(this.__indent_string=new Array(y.indent_size+1).join(y.indent_char)),u=u||"",y.indent_level>0&&(u=new Array(y.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}O.prototype.get_indent_size=function(y,u){var _=this.__base_string_length;return u=u||0,y<0&&(_=0),_+=y*this.__indent_size,_+=u,_},O.prototype.get_indent_string=function(y,u){var _=this.__base_string;return u=u||0,y<0&&(y=0,_=""),u+=y*this.__indent_size,this.__ensure_cache(u),_+=this.__cache[u],_},O.prototype.__ensure_cache=function(y){for(;y>=this.__cache.length;)this.__add_column()},O.prototype.__add_column=function(){var y=this.__cache.length,u=0,_="";this.__indent_size&&y>=this.__indent_size&&(u=Math.floor(y/this.__indent_size),y-=u*this.__indent_size,_=new Array(u+1).join(this.__indent_string)),y&&(_+=new Array(y+1).join(" ")),this.__cache.push(_)};function v(y,u){this.__indent_cache=new O(y,u),this.raw=!1,this._end_with_newline=y.end_with_newline,this.indent_size=y.indent_size,this.wrap_line_length=y.wrap_line_length,this.indent_empty_lines=y.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()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(y,u){return this.__indent_cache.get_indent_string(y,u)},v.prototype.get_indent_size=function(y,u){return this.__indent_cache.get_indent_size(y,u)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(y){return this.is_empty()||!y&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(y){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 _=this.__lines.join(`
|
|
`);return y!==`
|
|
`&&(_=_.replace(/[\n]/g,y)),_},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(y,u){return y=y||0,u=u||0,this.next_line.set_indent(y,u),this.__lines.length>1?(this.current_line.set_indent(y,u),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(y){for(var u=0;u<y.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(y.whitespace_before),this.current_line.push(y.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(y){this.__add_space_before_token(),this.current_line.push(y),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(y){for(var u=this.__lines.length;y<u;)this.__lines[y]._remove_indent(),y++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(y){for(y=y===void 0?!1:y,this.current_line.trim();y&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(y,u){for(var _=this.__lines.length-2;_>=0;){var m=this.__lines[_];if(m.is_empty())break;if(m.item(0).indexOf(y)!==0&&m.item(-1)!==u){this.__lines.splice(_+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}_--}},Z.exports.Output=v},,,,function(Z){function o(y,u){this.raw_options=O(y,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(y,u){var _=this.raw_options[y],m=u||[];return typeof _=="object"?_!==null&&typeof _.concat=="function"&&(m=_.concat()):typeof _=="string"&&(m=_.split(/[^a-zA-Z0-9_\/\-]+/)),m},o.prototype._get_boolean=function(y,u){var _=this.raw_options[y],m=_===void 0?!!u:!!_;return m},o.prototype._get_characters=function(y,u){var _=this.raw_options[y],m=u||"";return typeof _=="string"&&(m=_.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),m},o.prototype._get_number=function(y,u){var _=this.raw_options[y];u=parseInt(u,10),isNaN(u)&&(u=0);var m=parseInt(_,10);return isNaN(m)&&(m=u),m},o.prototype._get_selection=function(y,u,_){var m=this._get_selection_list(y,u,_);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+y+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[y]+"'");return m[0]},o.prototype._get_selection_list=function(y,u,_){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(_=_||[u[0]],!this._is_valid_selection(_,u))throw new Error("Invalid Default Value!");var m=this._get_array(y,_);if(!this._is_valid_selection(m,u))throw new Error("Invalid Option Value: The option '"+y+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[y]+"'");return m},o.prototype._is_valid_selection=function(y,u){return y.length&&u.length&&!y.some(function(_){return u.indexOf(_)===-1})};function O(y,u){var _={};y=v(y);var m;for(m in y)m!==u&&(_[m]=y[m]);if(u&&y[u])for(m in y[u])_[m]=y[u][m];return _}function v(y){var u={},_;for(_ in y){var m=_.replace(/-/g,"_");u[m]=y[_]}return u}Z.exports.Options=o,Z.exports.normalizeOpts=v,Z.exports.mergeOpts=O},,function(Z){var o=RegExp.prototype.hasOwnProperty("sticky");function O(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}O.prototype.restart=function(){this.__position=0},O.prototype.back=function(){this.__position>0&&(this.__position-=1)},O.prototype.hasNext=function(){return this.__position<this.__input_length},O.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},O.prototype.peek=function(v){var y=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(y=this.__input.charAt(v)),y},O.prototype.__match=function(v,y){v.lastIndex=y;var u=v.exec(this.__input);return u&&!(o&&v.sticky)&&u.index!==y&&(u=null),u},O.prototype.test=function(v,y){return y=y||0,y+=this.__position,y>=0&&y<this.__input_length?!!this.__match(v,y):!1},O.prototype.testChar=function(v,y){var u=this.peek(y);return v.lastIndex=0,u!==null&&v.test(u)},O.prototype.match=function(v){var y=this.__match(v,this.__position);return y?this.__position+=y[0].length:y=null,y},O.prototype.read=function(v,y,u){var _="",m;return v&&(m=this.match(v),m&&(_+=m[0])),y&&(m||!v)&&(_+=this.readUntil(y,u)),_},O.prototype.readUntil=function(v,y){var u="",_=this.__position;v.lastIndex=this.__position;var m=v.exec(this.__input);return m?(_=m.index,y&&(_+=m[0].length)):_=this.__input_length,u=this.__input.substring(this.__position,_),this.__position=_,u},O.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},O.prototype.get_regexp=function(v,y){var u=null,_="g";return y&&o&&(_="y"),typeof v=="string"&&v!==""?u=new RegExp(v,_):v&&(u=new RegExp(v.source,_)),u},O.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},O.prototype.peekUntilAfter=function(v){var y=this.__position,u=this.readUntilAfter(v);return this.__position=y,u},O.prototype.lookBack=function(v){var y=this.__position-1;return y>=v.length&&this.__input.substring(y-v.length,y).toLowerCase()===v},Z.exports.InputScanner=O},,,,,function(Z){function o(O,v){O=typeof O=="string"?O:O.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(O+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(O+/\sbeautify\signore:end\s/.source+v,"g")}o.prototype.get_directives=function(O){if(!O.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var y=this.__directive_pattern.exec(O);y;)v[y[1]]=y[2],y=this.__directive_pattern.exec(O);return v},o.prototype.readIgnored=function(O){return O.readUntilAfter(this.__directives_end_ignore_pattern)},Z.exports.Directives=o},,function(Z,o,O){var v=O(16).Beautifier,y=O(17).Options;function u(_,m){var N=new v(_,m);return N.beautify()}Z.exports=u,Z.exports.defaultOptions=function(){return new y}},function(Z,o,O){var v=O(17).Options,y=O(2).Output,u=O(8).InputScanner,_=O(13).Directives,m=new _(/\/\*/,/\*\//),N=/\r\n|[\r\n]/,F=/\r\n|[\r\n]/g,M=/\s/,w=/(?:\s|\n)+/g,k=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,K=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function b(U,j){this._source_text=U||"",this._options=new v(j),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"]}b.prototype.eatString=function(U){var j="";for(this._ch=this._input.next();this._ch;){if(j+=this._ch,this._ch==="\\")j+=this._input.next();else if(U.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return j},b.prototype.eatWhitespace=function(U){for(var j=M.test(this._input.peek()),H=0;M.test(this._input.peek());)this._ch=this._input.next(),U&&this._ch===`
|
|
`&&(H===0||H<this._options.max_preserve_newlines)&&(H++,this._output.add_new_line(!0));return j},b.prototype.foundNestedPseudoClass=function(){for(var U=0,j=1,H=this._input.peek(j);H;){if(H==="{")return!0;if(H==="(")U+=1;else if(H===")"){if(U===0)return!1;U-=1}else if(H===";"||H==="}")return!1;j++,H=this._input.peek(j)}return!1},b.prototype.print_string=function(U){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(U)},b.prototype.preserveSingleSpace=function(U){U&&(this._output.space_before_token=!0)},b.prototype.indent=function(){this._indentLevel++},b.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var U=this._source_text,j=this._options.eol;j==="auto"&&(j=`
|
|
`,U&&N.test(U||"")&&(j=U.match(N)[0])),U=U.replace(F,`
|
|
`);var H=U.match(/^[\t ]*/)[0];this._output=new y(this._options,H),this._input=new u(U),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ce=0,_e=!1,re=!1,Y=!1,T=!1,S=!1,R=this._ch,x=!1,$,C,d;$=this._input.read(w),C=$!=="",d=R,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),R=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var p=this._input.read(k),P=m.get_directives(p);P&&P.ignore==="start"&&(p+=m.readIgnored(this._input)),this.print_string(p),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(K)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(C),this.print_string(this._ch);var W=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);W.match(/[ :]$/)&&(W=this.eatString(": ").replace(/\s+$/,""),this.print_string(W),this._output.space_before_token=!0),ce===0&&W.indexOf(":")!==-1&&(re=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(C),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s+$/,""),this.print_string(se),this._output.space_before_token=!0),ce===0&&se.indexOf(":")!==-1?(re=!0,this.indent()):se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(Y=!0)):ce===0&&!re&&(T=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(C),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")re&&(re=!1,this.outdent()),T=!1,Y?(Y=!1,_e=this._indentLevel>=this._nestedLevel):_e=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&_e&&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)):(d==="("?this._output.space_before_token=!1:d!==","&&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(),d==="{"&&this._output.trim(!0),re&&(this.outdent(),re=!1),this.print_string(this._ch),_e=!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 ve=0;ve<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ve++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ve])){x=!0;break}(_e||Y)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!T&&ce===0?(this.print_string(":"),re||(re=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ye=d==='"'||d==="'";this.preserveSingleSpace(ye||C),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,ce===0?(re&&(this.outdent(),re=!1),T=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),ce++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),ce&&(ce--,this.outdent()));else{var Re=!1;this._input.lookBack("with")&&(Re=!0),this.preserveSingleSpace(C||Re),this.print_string(this._ch),re&&d==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),S=!0):(this.eatWhitespace(),ce++,this.indent())}else if(this._ch===")")ce&&(ce--,this.outdent()),S&&this._input.peek()===";"&&this._options.selector_separator_newline&&(S=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!re||S)&&ce===0&&!T?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!re&&ce===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&M.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(C),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),M.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ge=d==='"'||d==="'";this.preserveSingleSpace(Ge||C),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&x&&this._output.add_new_line()}var nt=this._output.get_code(j);return nt},Z.exports.Beautifier=b},function(Z,o,O){var v=O(6).Options;function y(u){v.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 _=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||_;var m=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var N=0;N<m.length;N++)m[N]!=="expand"?this.brace_style="collapse":this.brace_style=m[N]}y.prototype=new v,Z.exports.Options=y}],V={};function q(Z){var o=V[Z];if(o!==void 0)return o.exports;var O=V[Z]={exports:{}};return ne[Z](O,O.exports,q),O.exports}var ee=q(15);Q=ee})();var ae=Q;I=[],z=function(){return{css_beautify:ae}}.apply(xe,I),z!==void 0&&(qe.exports=z)})()},40998:function(qe,xe,I){var z,Q;(function(){var ae;(function(){"use strict";var ee=[,,function(v){function y(m){this.__parent=m,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=[]}y.prototype.clone_empty=function(){var m=new y(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},y.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},y.prototype.has_match=function(m){for(var N=this.__items.length-1;N>=0;N--)if(this.__items[N].match(m))return!0;return!1},y.prototype.set_indent=function(m,N){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=N||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},y.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)},y.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},y.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},y.prototype.is_empty=function(){return this.__items.length===0},y.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},y.prototype.push=function(m){this.__items.push(m);var N=m.lastIndexOf(`
|
|
`);N!==-1?this.__character_count=m.length-N:this.__character_count+=m.length},y.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},y.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},y.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},y.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},y.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function u(m,N){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),N=N||"",m.indent_level>0&&(N=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=N,this.__base_string_length=N.length}u.prototype.get_indent_size=function(m,N){var F=this.__base_string_length;return N=N||0,m<0&&(F=0),F+=m*this.__indent_size,F+=N,F},u.prototype.get_indent_string=function(m,N){var F=this.__base_string;return N=N||0,m<0&&(m=0,F=""),N+=m*this.__indent_size,this.__ensure_cache(N),F+=this.__cache[N],F},u.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var m=this.__cache.length,N=0,F="";this.__indent_size&&m>=this.__indent_size&&(N=Math.floor(m/this.__indent_size),m-=N*this.__indent_size,F=new Array(N+1).join(this.__indent_string)),m&&(F+=new Array(m+1).join(" ")),this.__cache.push(F)};function _(m,N){this.__indent_cache=new u(m,N),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new y(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}_.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},_.prototype.get_line_number=function(){return this.__lines.length},_.prototype.get_indent_string=function(m,N){return this.__indent_cache.get_indent_string(m,N)},_.prototype.get_indent_size=function(m,N){return this.__indent_cache.get_indent_size(m,N)},_.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},_.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},_.prototype.get_code=function(m){this.trim(!0);var N=this.current_line.pop();N&&(N[N.length-1]===`
|
|
`&&(N=N.replace(/\n+$/g,"")),this.current_line.push(N)),this._end_with_newline&&this.__add_outputline();var F=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(F=F.replace(/[\n]/g,m)),F},_.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},_.prototype.set_indent=function(m,N){return m=m||0,N=N||0,this.next_line.set_indent(m,N),this.__lines.length>1?(this.current_line.set_indent(m,N),!0):(this.current_line.set_indent(),!1)},_.prototype.add_raw_token=function(m){for(var N=0;N<m.newlines;N++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},_.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},_.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},_.prototype.remove_indent=function(m){for(var N=this.__lines.length;m<N;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},_.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},_.prototype.just_added_newline=function(){return this.current_line.is_empty()},_.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},_.prototype.ensure_empty_line_above=function(m,N){for(var F=this.__lines.length-2;F>=0;){var M=this.__lines[F];if(M.is_empty())break;if(M.item(0).indexOf(m)!==0&&M.item(-1)!==N){this.__lines.splice(F+1,0,new y(this)),this.previous_line=this.__lines[this.__lines.length-2];break}F--}},v.exports.Output=_},function(v){function y(u,_,m,N){this.type=u,this.text=_,this.comments_before=null,this.newlines=m||0,this.whitespace_before=N||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=y},,,function(v){function y(m,N){this.raw_options=u(m,N),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}y.prototype._get_array=function(m,N){var F=this.raw_options[m],M=N||[];return typeof F=="object"?F!==null&&typeof F.concat=="function"&&(M=F.concat()):typeof F=="string"&&(M=F.split(/[^a-zA-Z0-9_\/\-]+/)),M},y.prototype._get_boolean=function(m,N){var F=this.raw_options[m],M=F===void 0?!!N:!!F;return M},y.prototype._get_characters=function(m,N){var F=this.raw_options[m],M=N||"";return typeof F=="string"&&(M=F.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),M},y.prototype._get_number=function(m,N){var F=this.raw_options[m];N=parseInt(N,10),isNaN(N)&&(N=0);var M=parseInt(F,10);return isNaN(M)&&(M=N),M},y.prototype._get_selection=function(m,N,F){var M=this._get_selection_list(m,N,F);if(M.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+N+`
|
|
You passed in: '`+this.raw_options[m]+"'");return M[0]},y.prototype._get_selection_list=function(m,N,F){if(!N||N.length===0)throw new Error("Selection list cannot be empty.");if(F=F||[N[0]],!this._is_valid_selection(F,N))throw new Error("Invalid Default Value!");var M=this._get_array(m,F);if(!this._is_valid_selection(M,N))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+N+`
|
|
You passed in: '`+this.raw_options[m]+"'");return M},y.prototype._is_valid_selection=function(m,N){return m.length&&N.length&&!m.some(function(F){return N.indexOf(F)===-1})};function u(m,N){var F={};m=_(m);var M;for(M in m)M!==N&&(F[M]=m[M]);if(N&&m[N])for(M in m[N])F[M]=m[N][M];return F}function _(m){var N={},F;for(F in m){var M=F.replace(/-/g,"_");N[M]=m[F]}return N}v.exports.Options=y,v.exports.normalizeOpts=_,v.exports.mergeOpts=u},,function(v){var y=RegExp.prototype.hasOwnProperty("sticky");function u(_){this.__input=_||"",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<this.__input_length},u.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__input.charAt(this.__position),this.__position+=1),_},u.prototype.peek=function(_){var m=null;return _=_||0,_+=this.__position,_>=0&&_<this.__input_length&&(m=this.__input.charAt(_)),m},u.prototype.__match=function(_,m){_.lastIndex=m;var N=_.exec(this.__input);return N&&!(y&&_.sticky)&&N.index!==m&&(N=null),N},u.prototype.test=function(_,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(_,m):!1},u.prototype.testChar=function(_,m){var N=this.peek(m);return _.lastIndex=0,N!==null&&_.test(N)},u.prototype.match=function(_){var m=this.__match(_,this.__position);return m?this.__position+=m[0].length:m=null,m},u.prototype.read=function(_,m,N){var F="",M;return _&&(M=this.match(_),M&&(F+=M[0])),m&&(M||!_)&&(F+=this.readUntil(m,N)),F},u.prototype.readUntil=function(_,m){var N="",F=this.__position;_.lastIndex=this.__position;var M=_.exec(this.__input);return M?(F=M.index,m&&(F+=M[0].length)):F=this.__input_length,N=this.__input.substring(this.__position,F),this.__position=F,N},u.prototype.readUntilAfter=function(_){return this.readUntil(_,!0)},u.prototype.get_regexp=function(_,m){var N=null,F="g";return m&&y&&(F="y"),typeof _=="string"&&_!==""?N=new RegExp(_,F):_&&(N=new RegExp(_.source,F)),N},u.prototype.get_literal_regexp=function(_){return RegExp(_.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(_){var m=this.__position,N=this.readUntilAfter(_);return this.__position=m,N},u.prototype.lookBack=function(_){var m=this.__position-1;return m>=_.length&&this.__input.substring(m-_.length,m).toLowerCase()===_},v.exports.InputScanner=u},function(v,y,u){var _=u(8).InputScanner,m=u(3).Token,N=u(10).TokenStream,F=u(11).WhitespacePattern,M={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(k,K){this._input=new _(k),this._options=K||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new F(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new N,this._reset();for(var k,K=new m(M.START,""),b=null,U=[],j=new N;K.type!==M.EOF;){for(k=this._get_next_token(K,b);this._is_comment(k);)j.add(k),k=this._get_next_token(K,b);j.isEmpty()||(k.comments_before=j,j=new N),k.parent=b,this._is_opening(k)?(U.push(b),b=k):b&&this._is_closing(k,b)&&(k.opened=b,b.closed=k,b=U.pop(),k.parent=b),k.previous=K,K.next=k,this.__tokens.add(k),K=k}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(k,K){this._readWhitespace();var b=this._input.read(/.+/g);return b?this._create_token(M.RAW,b):this._create_token(M.EOF,"")},w.prototype._is_comment=function(k){return!1},w.prototype._is_opening=function(k){return!1},w.prototype._is_closing=function(k,K){return!1},w.prototype._create_token=function(k,K){var b=new m(k,K,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return b},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=w,v.exports.TOKEN=M},function(v){function y(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}y.prototype.restart=function(){this.__position=0},y.prototype.isEmpty=function(){return this.__tokens_length===0},y.prototype.hasNext=function(){return this.__position<this.__tokens_length},y.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},y.prototype.peek=function(u){var _=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(_=this.__tokens[u]),_},y.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},v.exports.TokenStream=y},function(v,y,u){var _=u(12).Pattern;function m(N,F){_.call(this,N,F),F?this._line_regexp=this._input.get_regexp(F._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new _,m.prototype.__set_whitespace_patterns=function(N,F){N+="\\t ",F+="\\n\\r",this._match_pattern=this._input.get_regexp("["+N+F+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+F+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var N=this._input.read(this._match_pattern);if(N===" ")this.whitespace_before_token=" ";else if(N){var F=this.__split(this._newline_regexp,N);this.newline_count=F.length-1,this.whitespace_before_token=F[this.newline_count]}return N},m.prototype.matching=function(N,F){var M=this._create();return M.__set_whitespace_patterns(N,F),M._update(),M},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(N,F){N.lastIndex=0;for(var M=0,w=[],k=N.exec(F);k;)w.push(F.substring(M,k.index)),M=k.index+k[0].length,k=N.exec(F);return M<F.length?w.push(F.substring(M,F.length)):w.push(""),w},v.exports.WhitespacePattern=m},function(v){function y(u,_){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,_&&(this._starting_pattern=this._input.get_regexp(_._starting_pattern,!0),this._match_pattern=this._input.get_regexp(_._match_pattern,!0),this._until_pattern=this._input.get_regexp(_._until_pattern),this._until_after=_._until_after)}y.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},y.prototype.read_match=function(){return this._input.match(this._match_pattern)},y.prototype.until_after=function(u){var _=this._create();return _._until_after=!0,_._until_pattern=this._input.get_regexp(u),_._update(),_},y.prototype.until=function(u){var _=this._create();return _._until_after=!1,_._until_pattern=this._input.get_regexp(u),_._update(),_},y.prototype.starting_with=function(u){var _=this._create();return _._starting_pattern=this._input.get_regexp(u,!0),_._update(),_},y.prototype.matching=function(u){var _=this._create();return _._match_pattern=this._input.get_regexp(u,!0),_._update(),_},y.prototype._create=function(){return new y(this._input,this)},y.prototype._update=function(){},v.exports.Pattern=y},function(v){function y(u,_){u=typeof u=="string"?u:u.source,_=typeof _=="string"?_:_.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+_,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+_,"g")}y.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var _={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(u);m;)_[m[1]]=m[2],m=this.__directive_pattern.exec(u);return _},y.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=y},function(v,y,u){var _=u(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function N(F,M){_.call(this,F,M),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),M&&(this.__template_pattern=this._input.get_regexp(M.__template_pattern),this._excluded=Object.assign(this._excluded,M._excluded),this._disabled=Object.assign(this._disabled,M._disabled));var w=new _(F);this.__patterns={handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:w.starting_with(/{{{/).until_after(/}}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),php:w.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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}/)}}N.prototype=new _,N.prototype._create=function(){return new N(this._input,this)},N.prototype._update=function(){this.__set_templated_pattern()},N.prototype.disable=function(F){var M=this._create();return M._disabled[F]=!0,M._update(),M},N.prototype.read_options=function(F){var M=this._create();for(var w in m)M._disabled[w]=F.templating.indexOf(w)===-1;return M._update(),M},N.prototype.exclude=function(F){var M=this._create();return M._excluded[F]=!0,M._update(),M},N.prototype.read=function(){var F="";this._match_pattern?F=this._input.read(this._starting_pattern):F=this._input.read(this._starting_pattern,this.__template_pattern);for(var M=this._read_template();M;)this._match_pattern?M+=this._input.read(this._match_pattern):M+=this._input.readUntil(this.__template_pattern),F+=M,M=this._read_template();return this._until_after&&(F+=this._input.readUntilAfter(this._until_pattern)),F},N.prototype.__set_templated_pattern=function(){var F=[];this._disabled.php||F.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||F.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||F.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||F.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(F.push(this.__patterns.django._starting_pattern.source),F.push(this.__patterns.django_value._starting_pattern.source),F.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||F.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&F.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+F.join("|")+")")},N.prototype._read_template=function(){var F="",M=this._input.peek();if(M==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(F=F||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(F=F||this.__patterns.erb.read())}else M==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(F=F||this.__patterns.handlebars_comment.read(),F=F||this.__patterns.handlebars_unescaped.read(),F=F||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(F=F||this.__patterns.django_value.read()),this._excluded.django||(F=F||this.__patterns.django_comment.read(),F=F||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(F=F||this.__patterns.smarty_comment.read(),F=F||this.__patterns.smarty_literal.read(),F=F||this.__patterns.smarty.read()));return F},v.exports.TemplatablePattern=N},,,,function(v,y,u){var _=u(19).Beautifier,m=u(20).Options;function N(F,M,w,k){var K=new _(F,M,w,k);return K.beautify()}v.exports=N,v.exports.defaultOptions=function(){return new m}},function(v,y,u){var _=u(20).Options,m=u(2).Output,N=u(21).Tokenizer,F=u(21).TOKEN,M=/\r\n|[\r\n]/,w=/\r\n|[\r\n]/g,k=function(T,S){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new m(T,S)};k.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},k.prototype.set_space_before_token=function(T,S){this._output.space_before_token=T,this._output.non_breaking_space=S},k.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},k.prototype.add_raw_token=function(T){this._output.add_raw_token(T)},k.prototype.print_preserved_newlines=function(T){var S=0;T.type!==F.TEXT&&T.previous.type!==F.TEXT&&(S=T.newlines?1:0),this.preserve_newlines&&(S=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var R=0;R<S;R++)this.print_newline(R>0);return S!==0},k.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(this._output.space_before_token=!0),!0):!1},k.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},k.prototype.print_newline=function(T){this._output.add_new_line(T)},k.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},k.prototype.indent=function(){this.indent_level++},k.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},k.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var K=function(T){for(var S=null,R=T.next;R.type!==F.EOF&&T.closed!==R;){if(R.type===F.ATTRIBUTE&&R.text==="type"){R.next&&R.next.type===F.EQUALS&&R.next.next&&R.next.next.type===F.VALUE&&(S=R.next.next.text);break}R=R.next}return S},b=function(T,S){var R=null,x=null;return S.closed?(T==="script"?R="text/javascript":T==="style"&&(R="text/css"),R=K(S)||R,R.search("text/css")>-1?x="css":R.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?x="javascript":R.search(/(text|application|dojo)\/(x-)?(html)/)>-1?x="html":R.search(/test\/null/)>-1&&(x="null"),x):null};function U(T,S){return S.indexOf(T)!==-1}function j(T,S,R){this.parent=T||null,this.tag=S?S.tag_name:"",this.indent_level=R||0,this.parser_token=S||null}function H(T){this._printer=T,this._current_frame=null}H.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},H.prototype.record_tag=function(T){var S=new j(this._current_frame,T,this._printer.indent_level);this._current_frame=S},H.prototype._try_pop_frame=function(T){var S=null;return T&&(S=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),S},H.prototype._get_frame=function(T,S){for(var R=this._current_frame;R&&T.indexOf(R.tag)===-1;){if(S&&S.indexOf(R.tag)!==-1){R=null;break}R=R.parent}return R},H.prototype.try_pop=function(T,S){var R=this._get_frame([T],S);return this._try_pop_frame(R)},H.prototype.indent_to_tag=function(T){var S=this._get_frame(T);S&&(this._printer.indent_level=S.indent_level)};function ce(T,S,R,x){this._source_text=T||"",S=S||{},this._js_beautify=R,this._css_beautify=x,this._tag_stack=null;var $=new _(S,"html");this._options=$,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"}ce.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,S=this._options.eol;this._options.eol==="auto"&&(S=`
|
|
`,T&&M.test(T)&&(S=T.match(M)[0])),T=T.replace(w,`
|
|
`);var R=T.match(/^[\t ]*/)[0],x={text:"",type:""},$=new _e(this._options),C=new k(this._options,R),d=new N(T,this._options).tokenize();this._tag_stack=new H(C);for(var p=null,P=d.next();P.type!==F.EOF;)P.type===F.TAG_OPEN||P.type===F.COMMENT?(p=this._handle_tag_open(C,P,$,x,d),$=p):P.type===F.ATTRIBUTE||P.type===F.EQUALS||P.type===F.VALUE||P.type===F.TEXT&&!$.tag_complete?p=this._handle_inside_tag(C,P,$,x):P.type===F.TAG_CLOSE?p=this._handle_tag_close(C,P,$):P.type===F.TEXT?p=this._handle_text(C,P,$):P.type===F.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(C,P):P.type===F.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(C,P):C.add_raw_token(P),x=p,P=d.next();var W=C._output.get_code(S);return W},ce.prototype._handle_control_flow_open=function(T,S){var R={text:S.text,type:S.type};return T.set_space_before_token(S.newlines||S.whitespace_before!=="",!0),S.newlines?T.print_preserved_newlines(S):T.set_space_before_token(S.newlines||S.whitespace_before!=="",!0),T.print_token(S),T.indent(),R},ce.prototype._handle_control_flow_close=function(T,S){var R={text:S.text,type:S.type};return T.deindent(),S.newlines?T.print_preserved_newlines(S):T.set_space_before_token(S.newlines||S.whitespace_before!=="",!0),T.print_token(S),R},ce.prototype._handle_tag_close=function(T,S,R){var x={text:S.text,type:S.type};return T.alignment_size=0,R.tag_complete=!0,T.set_space_before_token(S.newlines||S.whitespace_before!=="",!0),R.is_unformatted?T.add_raw_token(S):(R.tag_start_char==="<"&&(T.set_space_before_token(S.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&R.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(S)),R.indent_content&&!(R.is_unformatted||R.is_content_unformatted)&&(T.indent(),R.indent_content=!1),!R.is_inline_element&&!(R.is_unformatted||R.is_content_unformatted)&&T.set_wrap_point(),x},ce.prototype._handle_inside_tag=function(T,S,R,x){var $=R.has_wrapped_attrs,C={text:S.text,type:S.type};return T.set_space_before_token(S.newlines||S.whitespace_before!=="",!0),R.is_unformatted?T.add_raw_token(S):R.tag_start_char==="{"&&S.type===F.TEXT?T.print_preserved_newlines(S)?(S.newlines=0,T.add_raw_token(S)):T.print_token(S):(S.type===F.ATTRIBUTE?T.set_space_before_token(!0):(S.type===F.EQUALS||S.type===F.VALUE&&S.previous.type===F.EQUALS)&&T.set_space_before_token(!1),S.type===F.ATTRIBUTE&&R.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(S),$=$||S.newlines!==0),this._is_wrap_attributes_force&&R.attr_count>=this._options.wrap_attributes_min_attrs&&(x.type!==F.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(T.print_newline(!1),$=!0)),T.print_token(S),$=$||T.previous_token_wrapped(),R.has_wrapped_attrs=$),C},ce.prototype._handle_text=function(T,S,R){var x={text:S.text,type:"TK_CONTENT"};return R.custom_beautifier_name?this._print_custom_beatifier_text(T,S,R):R.is_unformatted||R.is_content_unformatted?T.add_raw_token(S):(T.traverse_whitespace(S),T.print_token(S)),x},ce.prototype._print_custom_beatifier_text=function(T,S,R){var x=this;if(S.text!==""){var $=S.text,C,d=1,p="",P="";R.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?C=this._js_beautify:R.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?C=this._css_beautify:R.custom_beautifier_name==="html"&&(C=function(Ge,nt){var pt=new ce(Ge,nt,x._js_beautify,x._css_beautify);return pt.beautify()}),this._options.indent_scripts==="keep"?d=0:this._options.indent_scripts==="separate"&&(d=-T.indent_level);var W=T.get_full_indent(d);if($=$.replace(/\n[ \t]*$/,""),R.custom_beautifier_name!=="html"&&$[0]==="<"&&$.match(/^(<!--|<!\[CDATA\[)/)){var se=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec($);if(!se){T.add_raw_token(S);return}p=W+se[1]+`
|
|
`,$=se[4],se[5]&&(P=W+se[5]),$=$.replace(/\n[ \t]*$/,""),(se[2]||se[3].indexOf(`
|
|
`)!==-1)&&(se=se[3].match(/[ \t]+$/),se&&(S.whitespace_before=se[0]))}if($)if(C){var ve=function(){this.eol=`
|
|
`};ve.prototype=this._options.raw_options;var ye=new ve;$=C(W+$,ye)}else{var Re=S.whitespace_before;Re&&($=$.replace(new RegExp(`
|
|
(`+Re+")?","g"),`
|
|
`)),$=W+$.replace(/\n/g,`
|
|
`+W)}p&&($?$=p+$+`
|
|
`+P:$=p+P),T.print_newline(!1),$&&(S.text=$,S.whitespace_before="",S.newlines=0,T.add_raw_token(S),T.print_newline(!0))}},ce.prototype._handle_tag_open=function(T,S,R,x,$){var C=this._get_tag_open_token(S);if((R.is_unformatted||R.is_content_unformatted)&&!R.is_empty_element&&S.type===F.TAG_OPEN&&!C.is_start_tag?(T.add_raw_token(S),C.start_tag_token=this._tag_stack.try_pop(C.tag_name)):(T.traverse_whitespace(S),this._set_tag_position(T,S,C,R,x),C.is_inline_element||T.set_wrap_point(),T.print_token(S)),C.is_start_tag&&this._is_wrap_attributes_force){var d=0,p;do p=$.peek(d),p.type===F.ATTRIBUTE&&(C.attr_count+=1),d+=1;while(p.type!==F.EOF&&p.type!==F.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(C.alignment_size=S.text.length+1),!C.tag_complete&&!C.is_unformatted&&(T.alignment_size=C.alignment_size),C};var _e=function(T,S,R){if(this.parent=S||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="",!R)this.tag_complete=!0;else{var x;this.tag_start_char=R.text[0],this.text=R.text,this.tag_start_char==="<"?(x=R.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=R.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[1]:"",(R.text.startsWith("{{#>")||R.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&R.next!==null?this.tag_check=R.next.text.split(" ")[0]:this.tag_check=R.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),R.type===F.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||R.closed&&R.closed.text==="/>";var $=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&($=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!T.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt($)))}};ce.prototype._get_tag_open_token=function(T){var S=new _e(this._options,this._tag_stack.get_parser_token(),T);return S.alignment_size=this._options.wrap_attributes_indent_size,S.is_end_tag=S.is_end_tag||U(S.tag_check,this._options.void_elements),S.is_empty_element=S.tag_complete||S.is_start_tag&&S.is_end_tag,S.is_unformatted=!S.tag_complete&&U(S.tag_check,this._options.unformatted),S.is_content_unformatted=!S.is_empty_element&&U(S.tag_check,this._options.content_unformatted),S.is_inline_element=U(S.tag_name,this._options.inline)||this._options.inline_custom_elements&&S.tag_name.includes("-")||S.tag_start_char==="{",S},ce.prototype._set_tag_position=function(T,S,R,x,$){if(R.is_empty_element||(R.is_end_tag?R.start_tag_token=this._tag_stack.try_pop(R.tag_name):(this._do_optional_end_element(R)&&(R.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(R),(R.tag_name==="script"||R.tag_name==="style")&&!(R.is_unformatted||R.is_content_unformatted)&&(R.custom_beautifier_name=b(R.tag_check,S)))),U(R.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),R.is_empty_element){if(R.tag_start_char==="{"&&R.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),R.indent_content=!0;var C=T.current_line_has_match(/{{#if/);C||T.print_newline(!1)}R.tag_name==="!--"&&$.type===F.TAG_CLOSE&&x.is_end_tag&&R.text.indexOf(`
|
|
`)===-1||(R.is_inline_element||R.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,R))}else if(R.is_end_tag){var d=!1;d=R.start_tag_token&&R.start_tag_token.multiline_content,d=d||!R.is_inline_element&&!(x.is_inline_element||x.is_unformatted)&&!($.type===F.TAG_CLOSE&&R.start_tag_token===x)&&$.type!=="TK_CONTENT",(R.is_content_unformatted||R.is_unformatted)&&(d=!1),d&&T.print_newline(!1)}else R.indent_content=!R.custom_beautifier_name,R.tag_start_char==="<"&&(R.tag_name==="html"?R.indent_content=this._options.indent_inner_html:R.tag_name==="head"?R.indent_content=this._options.indent_head_inner_html:R.tag_name==="body"&&(R.indent_content=this._options.indent_body_inner_html)),!(R.is_inline_element||R.is_unformatted)&&($.type!=="TK_CONTENT"||R.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,R)},ce.prototype._calcluate_parent_multiline=function(T,S){S.parent&&T._output.just_added_newline()&&!((S.is_inline_element||S.is_unformatted)&&S.parent.is_inline_element)&&(S.parent.multiline_content=!0)};var re=["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"],Y=["a","audio","del","ins","map","noscript","video"];ce.prototype._do_optional_end_element=function(T){var S=null;if(!(T.is_empty_element||!T.is_start_tag||!T.parent)){if(T.tag_name==="body")S=S||this._tag_stack.try_pop("head");else if(T.tag_name==="li")S=S||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(T.tag_name==="dd"||T.tag_name==="dt")S=S||this._tag_stack.try_pop("dt",["dl"]),S=S||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&re.indexOf(T.tag_name)!==-1){var R=T.parent.parent;(!R||Y.indexOf(R.tag_name)===-1)&&(S=S||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(S=S||this._tag_stack.try_pop("rt",["ruby","rtc"]),S=S||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?S=S||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?S=S||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?S=S||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(S=S||this._tag_stack.try_pop("caption",["table"]),S=S||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(S=S||this._tag_stack.try_pop("caption",["table"]),S=S||this._tag_stack.try_pop("colgroup",["table"]),S=S||this._tag_stack.try_pop("thead",["table"]),S=S||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(S=S||this._tag_stack.try_pop("caption",["table"]),S=S||this._tag_stack.try_pop("colgroup",["table"]),S=S||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(S=S||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),S=S||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),S}},v.exports.Beautifier=ce},function(v,y,u){var _=u(6).Options;function m(N){_.call(this,N,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}m.prototype=new _,v.exports.Options=m},function(v,y,u){var _=u(9).Tokenizer,m=u(9).TOKEN,N=u(13).Directives,F=u(14).TemplatablePattern,M=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:m.START,RAW:m.RAW,EOF:m.EOF},k=new N(/<\!--/,/-->/),K=function(b,U){_.call(this,b,U),this._current_tag_name="";var j=new F(this._input).read_options(this._options),H=new M(this._input);if(this.__patterns={word:j.until(/[\n\r\t <]/),word_control_flow_close_excluded:j.until(/[\n\r\t <}]/),single_quote:j.until_after(/'/),double_quote:j.until_after(/"/),attribute:j.until(/[\n\r\t =>]|\/>/),element_name:j.until(/[\n\r\t >\/]/),angular_control_flow_start:H.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:H.starting_with(/{{!--/).until_after(/--}}/),handlebars:H.starting_with(/{{/).until_after(/}}/),handlebars_open:H.until(/[\n\r\t }]/),handlebars_raw_close:H.until(/}}/),comment:H.starting_with(/<!--/).until_after(/-->/),cdata:H.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:H.starting_with(/<!\[/).until_after(/]>/),processing:H.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 ce=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=H.matching(ce).until_after(ce)}};K.prototype=new _,K.prototype._is_comment=function(b){return!1},K.prototype._is_opening=function(b){return b.type===w.TAG_OPEN||b.type===w.CONTROL_FLOW_OPEN},K.prototype._is_closing=function(b,U){return b.type===w.TAG_CLOSE&&U&&((b.text===">"||b.text==="/>")&&U.text[0]==="<"||b.text==="}}"&&U.text[0]==="{"&&U.text[1]==="{")||b.type===w.CONTROL_FLOW_CLOSE&&b.text==="}"&&U.text.endsWith("{")},K.prototype._reset=function(){this._current_tag_name=""},K.prototype._get_next_token=function(b,U){var j=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(w.EOF,""):(j=j||this._read_open_handlebars(H,U),j=j||this._read_attribute(H,b,U),j=j||this._read_close(H,U),j=j||this._read_script_and_style(H,b),j=j||this._read_control_flows(H,U),j=j||this._read_raw_content(H,b,U),j=j||this._read_content_word(H,U),j=j||this._read_comment_or_cdata(H),j=j||this._read_processing(H),j=j||this._read_open(H,U),j=j||this._create_token(w.UNKNOWN,this._input.next()),j)},K.prototype._read_comment_or_cdata=function(b){var U=null,j=null,H=null;if(b==="<"){var ce=this._input.peek(1);ce==="!"&&(j=this.__patterns.comment.read(),j?(H=k.get_directives(j),H&&H.ignore==="start"&&(j+=k.readIgnored(this._input))):j=this.__patterns.cdata.read()),j&&(U=this._create_token(w.COMMENT,j),U.directives=H)}return U},K.prototype._read_processing=function(b){var U=null,j=null,H=null;if(b==="<"){var ce=this._input.peek(1);(ce==="!"||ce==="?")&&(j=this.__patterns.conditional_comment.read(),j=j||this.__patterns.processing.read()),j&&(U=this._create_token(w.COMMENT,j),U.directives=H)}return U},K.prototype._read_open=function(b,U){var j=null,H=null;return(!U||U.type===w.CONTROL_FLOW_OPEN)&&b==="<"&&(j=this._input.next(),this._input.peek()==="/"&&(j+=this._input.next()),j+=this.__patterns.element_name.read(),H=this._create_token(w.TAG_OPEN,j)),H},K.prototype._read_open_handlebars=function(b,U){var j=null,H=null;return(!U||U.type===w.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&b==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(j=this.__patterns.handlebars_comment.read(),j=j||this.__patterns.handlebars.read(),H=this._create_token(w.COMMENT,j)):(j=this.__patterns.handlebars_open.read(),H=this._create_token(w.TAG_OPEN,j))),H},K.prototype._read_control_flows=function(b,U){var j="",H=null;if(!this._options.templating.includes("angular"))return H;if(b==="@"){if(j=this.__patterns.angular_control_flow_start.read(),j==="")return H;for(var ce=j.endsWith("(")?1:0,_e=0;!(j.endsWith("{")&&ce===_e);){var re=this._input.next();if(re===null)break;re==="("?ce++:re===")"&&_e++,j+=re}H=this._create_token(w.CONTROL_FLOW_OPEN,j)}else b==="}"&&U&&U.type===w.CONTROL_FLOW_OPEN&&(j=this._input.next(),H=this._create_token(w.CONTROL_FLOW_CLOSE,j));return H},K.prototype._read_close=function(b,U){var j=null,H=null;return U&&U.type===w.TAG_OPEN&&(U.text[0]==="<"&&(b===">"||b==="/"&&this._input.peek(1)===">")?(j=this._input.next(),b==="/"&&(j+=this._input.next()),H=this._create_token(w.TAG_CLOSE,j)):U.text[0]==="{"&&b==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),H=this._create_token(w.TAG_CLOSE,"}}"))),H},K.prototype._read_attribute=function(b,U,j){var H=null,ce="";if(j&&j.text[0]==="<")if(b==="=")H=this._create_token(w.EQUALS,this._input.next());else if(b==='"'||b==="'"){var _e=this._input.next();b==='"'?_e+=this.__patterns.double_quote.read():_e+=this.__patterns.single_quote.read(),H=this._create_token(w.VALUE,_e)}else ce=this.__patterns.attribute.read(),ce&&(U.type===w.EQUALS?H=this._create_token(w.VALUE,ce):H=this._create_token(w.ATTRIBUTE,ce));return H},K.prototype._is_content_unformatted=function(b){return this._options.void_elements.indexOf(b)===-1&&(this._options.content_unformatted.indexOf(b)!==-1||this._options.unformatted.indexOf(b)!==-1)},K.prototype._read_raw_content=function(b,U,j){var H="";if(j&&j.text[0]==="{")H=this.__patterns.handlebars_raw_close.read();else if(U.type===w.TAG_CLOSE&&U.opened.text[0]==="<"&&U.text[0]!=="/"){var ce=U.opened.text.substr(1).toLowerCase();this._is_content_unformatted(ce)&&(H=this._input.readUntil(new RegExp("</"+ce+"[\\n\\r\\t ]*?>","ig")))}return H?this._create_token(w.TEXT,H):null},K.prototype._read_script_and_style=function(b,U){if(U.type===w.TAG_CLOSE&&U.opened.text[0]==="<"&&U.text[0]!=="/"){var j=U.opened.text.substr(1).toLowerCase();if(j==="script"||j==="style"){var H=this._read_comment_or_cdata(b);if(H)return H.type=w.TEXT,H;var ce=this._input.readUntil(new RegExp("</"+j+"[\\n\\r\\t ]*?>","ig"));if(ce)return this._create_token(w.TEXT,ce)}}return null},K.prototype._read_content_word=function(b,U){var j="";return this._options.unformatted_content_delimiter&&b===this._options.unformatted_content_delimiter[0]&&(j=this.__patterns.unformatted_content_delimiter.read()),j||(j=U&&U.type===w.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),j?this._create_token(w.TEXT,j):null},v.exports.Tokenizer=K,v.exports.TOKEN=w}],Z={};function o(v){var y=Z[v];if(y!==void 0)return y.exports;var u=Z[v]={exports:{}};return ee[v](u,u.exports,o),u.exports}var O=o(18);ae=O})();var ne=ae;if(1)z=[I,I(58553),I(87804)],Q=function(ee){var Z=I(58553),o=I(87804);return{html_beautify:function(O,v){return ne(O,v,Z.js_beautify,o.css_beautify)}}}.apply(xe,z),Q!==void 0&&(qe.exports=Q);else var V,q})()},58553:function(qe,xe){var I,z;(function(){var Q;(function(){"use strict";var ne=[function(Z,o,O){var v=O(1).Beautifier,y=O(5).Options;function u(_,m){var N=new v(_,m);return N.beautify()}Z.exports=u,Z.exports.defaultOptions=function(){return new y}},function(Z,o,O){var v=O(2).Output,y=O(3).Token,u=O(4),_=O(5).Options,m=O(7).Tokenizer,N=O(7).line_starters,F=O(7).positionable_operators,M=O(7).TOKEN;function w(p,P){return P.indexOf(p)!==-1}function k(p){return p.replace(/^\s+/g,"")}function K(p){for(var P={},W=0;W<p.length;W++)P[p[W].replace(/-/g,"_")]=p[W];return P}function b(p,P){return p&&p.type===M.RESERVED&&p.text===P}function U(p,P){return p&&p.type===M.RESERVED&&w(p.text,P)}var j=["case","return","do","if","throw","else","await","break","continue","async"],H=["before-newline","after-newline","preserve-newline"],ce=K(H),_e=[ce.before_newline,ce.preserve_newline],re={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Y(p,P){P.multiline_frame||P.mode===re.ForInitializer||P.mode===re.Conditional||p.remove_indent(P.start_line_index)}function T(p){p=p.replace(u.allLineBreaks,`
|
|
`);for(var P=[],W=p.indexOf(`
|
|
`);W!==-1;)P.push(p.substring(0,W)),p=p.substring(W+1),W=p.indexOf(`
|
|
`);return p.length&&P.push(p),P}function S(p){return p===re.ArrayLiteral}function R(p){return w(p,[re.Expression,re.ForInitializer,re.Conditional])}function x(p,P){for(var W=0;W<p.length;W++){var se=p[W].trim();if(se.charAt(0)!==P)return!1}return!0}function $(p,P){for(var W=0,se=p.length,ve;W<se;W++)if(ve=p[W],ve&&ve.indexOf(P)!==0)return!1;return!0}function C(p,P){P=P||{},this._source_text=p||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new _(P)}C.prototype.create_flags=function(p,P){var W=0;p&&(W=p.indentation_level,!this._output.just_added_newline()&&p.line_indent_level>W&&(W=p.line_indent_level));var se={mode:P,parent:p,last_token:p?p.last_token:new y(M.START_BLOCK,""),last_word:p?p.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:W,alignment:0,line_indent_level:p?p.line_indent_level:W,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},C.prototype._reset=function(p){var P=p.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new v(this._options,P),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(re.BlockStatement);var W=new m(p,this._options);return this._tokens=W.tokenize(),p},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var p,P=this._reset(this._source_text),W=this._options.eol;this._options.eol==="auto"&&(W=`
|
|
`,P&&u.lineBreak.test(P||"")&&(W=P.match(u.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return p=this._output.get_code(W),p},C.prototype.handle_token=function(p,P){p.type===M.START_EXPR?this.handle_start_expr(p):p.type===M.END_EXPR?this.handle_end_expr(p):p.type===M.START_BLOCK?this.handle_start_block(p):p.type===M.END_BLOCK?this.handle_end_block(p):p.type===M.WORD?this.handle_word(p):p.type===M.RESERVED?this.handle_word(p):p.type===M.SEMICOLON?this.handle_semicolon(p):p.type===M.STRING?this.handle_string(p):p.type===M.EQUALS?this.handle_equals(p):p.type===M.OPERATOR?this.handle_operator(p):p.type===M.COMMA?this.handle_comma(p):p.type===M.BLOCK_COMMENT?this.handle_block_comment(p,P):p.type===M.COMMENT?this.handle_comment(p,P):p.type===M.DOT?this.handle_dot(p):p.type===M.EOF?this.handle_eof(p):p.type===M.UNKNOWN?this.handle_unknown(p,P):this.handle_unknown(p,P)},C.prototype.handle_whitespace_and_comments=function(p,P){var W=p.newlines,se=this._options.keep_array_indentation&&S(this._flags.mode);if(p.comments_before)for(var ve=p.comments_before.next();ve;)this.handle_whitespace_and_comments(ve,P),this.handle_token(ve,P),ve=p.comments_before.next();if(se)for(var ye=0;ye<W;ye+=1)this.print_newline(ye>0,P);else if(this._options.max_preserve_newlines&&W>this._options.max_preserve_newlines&&(W=this._options.max_preserve_newlines),this._options.preserve_newlines&&W>1){this.print_newline(!1,P);for(var Re=1;Re<W;Re+=1)this.print_newline(!0,P)}};var d=["async","break","continue","return","throw","yield"];C.prototype.allow_wrap_or_preserved_newline=function(p,P){if(P=P===void 0?!1:P,!this._output.just_added_newline()){var W=this._options.preserve_newlines&&p.newlines||P,se=w(this._flags.last_token.text,F)||w(p.text,F);if(se){var ve=w(this._flags.last_token.text,F)&&w(this._options.operator_position,_e)||w(p.text,F);W=W&&ve}if(W)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(U(this._flags.last_token,d))return;this._output.set_wrap_point()}}},C.prototype.print_newline=function(p,P){if(!P&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var W=this._tokens.peek();this._flags.mode===re.Statement&&!(this._flags.if_block&&b(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(p)&&(this._flags.multiline_frame=!0)},C.prototype.print_token_line_indentation=function(p){this._output.just_added_newline()&&(this._options.keep_array_indentation&&p.newlines&&(p.text==="["||S(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(p.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},C.prototype.print_token=function(p){if(this._output.raw){this._output.add_raw_token(p);return}if(this._options.comma_first&&p.previous&&p.previous.type===M.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var P=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(P),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(p),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(p),this._output.non_breaking_space=!0,this._output.add_token(p.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},C.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.set_mode=function(p){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,p),this._flags=this.create_flags(this._previous_flags,p),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===re.Statement&&Y(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.start_of_object_property=function(){return this._flags.parent.mode===re.ObjectLiteral&&this._flags.mode===re.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||U(this._flags.last_token,["get","set"]))},C.prototype.start_of_statement=function(p){var P=!1;return P=P||U(this._flags.last_token,["var","let","const"])&&p.type===M.WORD,P=P||b(this._flags.last_token,"do"),P=P||!(this._flags.parent.mode===re.ObjectLiteral&&this._flags.mode===re.Statement)&&U(this._flags.last_token,d)&&!p.newlines,P=P||b(this._flags.last_token,"else")&&!(b(p,"if")&&!p.comments_before),P=P||this._flags.last_token.type===M.END_EXPR&&(this._previous_flags.mode===re.ForInitializer||this._previous_flags.mode===re.Conditional),P=P||this._flags.last_token.type===M.WORD&&this._flags.mode===re.BlockStatement&&!this._flags.in_case&&!(p.text==="--"||p.text==="++")&&this._last_last_text!=="function"&&p.type!==M.WORD&&p.type!==M.RESERVED,P=P||this._flags.mode===re.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||U(this._flags.last_token,["get","set"])),P?(this.set_mode(re.Statement),this.indent(),this.handle_whitespace_and_comments(p,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(p,U(p,["do","for","if","while"])),!0):!1},C.prototype.handle_start_expr=function(p){this.start_of_statement(p)||this.handle_whitespace_and_comments(p);var P=re.Expression;if(p.text==="["){if(this._flags.last_token.type===M.WORD||this._flags.last_token.text===")"){U(this._flags.last_token,N)&&(this._output.space_before_token=!0),this.print_token(p),this.set_mode(P),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}P=re.ArrayLiteral,S(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,[M.START_EXPR,M.END_EXPR,M.WORD,M.OPERATOR,M.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===M.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,P=re.ForInitializer):w(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,P=re.Conditional):w(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&p.whitespace_before===""?this._output.space_before_token=!1:(w(this._flags.last_token.text,N)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(p);else if(this._flags.last_token.type===M.WORD){this._output.space_before_token=!1;var W=this._tokens.peek(-3);if(this._options.space_after_named_function&&W){var se=this._tokens.peek(-4);U(W,["async","function"])||W.text==="*"&&U(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===re.ObjectLiteral?(W.text==="{"||W.text===","||W.text==="*"&&(se.text==="{"||se.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(p);(this._flags.last_token.type===M.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===re.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===M.START_BLOCK?this.print_newline():(this._flags.last_token.type===M.END_EXPR||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===M.COMMA)&&this.allow_wrap_or_preserved_newline(p,p.newlines),this.print_token(p),this.set_mode(P),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},C.prototype.handle_end_expr=function(p){for(;this._flags.mode===re.Statement;)this.restore_mode();this.handle_whitespace_and_comments(p),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(p,p.text==="]"&&S(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===M.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(p),this.restore_mode(),Y(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===re.Conditional&&(this._previous_flags.mode=re.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},C.prototype.handle_start_block=function(p){this.handle_whitespace_and_comments(p);var P=this._tokens.peek(),W=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===M.END_EXPR?(this.set_mode(re.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(re.BlockStatement):W&&(w(W.text,[":",","])&&w(P.type,[M.STRING,M.WORD,M.RESERVED])||w(P.text,["get","set","..."])&&w(W.type,[M.WORD,M.RESERVED]))?w(this._last_last_text,["class","interface"])&&!w(W.text,[":",","])?this.set_mode(re.BlockStatement):this.set_mode(re.ObjectLiteral):this._flags.last_token.type===M.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(re.BlockStatement):w(this._flags.last_token.type,[M.EQUALS,M.START_EXPR,M.COMMA,M.OPERATOR])||U(this._flags.last_token,["return","throw","import","default"])?this.set_mode(re.ObjectLiteral):this.set_mode(re.BlockStatement),this._flags.last_token&&U(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var se=!P.comments_before&&P.text==="}",ve=se&&this._flags.last_word==="function"&&this._flags.last_token.type===M.END_EXPR;if(this._options.brace_preserve_inline){var ye=0,Re=null;this._flags.inline_frame=!0;do if(ye+=1,Re=this._tokens.peek(ye-1),Re.newlines){this._flags.inline_frame=!1;break}while(Re.type!==M.EOF&&!(Re.type===M.END_BLOCK&&Re.opened===p))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&p.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==M.OPERATOR&&(ve||this._flags.last_token.type===M.EQUALS||U(this._flags.last_token,j)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(S(this._previous_flags.mode)&&(this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.COMMA)&&((this._flags.last_token.type===M.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(p),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==M.OPERATOR&&this._flags.last_token.type!==M.START_EXPR&&(w(this._flags.last_token.type,[M.START_BLOCK,M.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(p),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},C.prototype.handle_end_block=function(p){for(this.handle_whitespace_and_comments(p);this._flags.mode===re.Statement;)this.restore_mode();var P=this._flags.last_token.type===M.START_BLOCK;this._flags.inline_frame&&!P?this._output.space_before_token=!0:this._options.brace_style==="expand"?P||this.print_newline():P||(S(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(p)},C.prototype.handle_word=function(p){if(p.type===M.RESERVED){if(w(p.text,["set","get"])&&this._flags.mode!==re.ObjectLiteral)p.type=M.WORD;else if(p.text==="import"&&w(this._tokens.peek().text,["(","."]))p.type=M.WORD;else if(w(p.text,["as","from"])&&!this._flags.import_block)p.type=M.WORD;else if(this._flags.mode===re.ObjectLiteral){var P=this._tokens.peek();P.text===":"&&(p.type=M.WORD)}}if(this.start_of_statement(p)?U(this._flags.last_token,["var","let","const"])&&p.type===M.WORD&&(this._flags.declaration_statement=!0):p.newlines&&!R(this._flags.mode)&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==M.EQUALS&&(this._options.preserve_newlines||!U(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(p),this.print_newline()):this.handle_whitespace_and_comments(p),this._flags.do_block&&!this._flags.do_while)if(b(p,"while")){this._output.space_before_token=!0,this.print_token(p),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&&b(p,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===re.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&U(p,["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(p),this._flags.in_case=!0;return}if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)&&!this.start_of_object_property()&&!(w(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===re.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(p),b(p,"function")){(w(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(w(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===M.OPERATOR))&&!this._output.just_added_blankline()&&!p.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD?U(this._flags.last_token,["get","set","new","export"])||U(this._flags.last_token,d)?this._output.space_before_token=!0:b(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===M.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||S(this._flags.mode))||this.print_newline(),this.print_token(p),this._flags.last_word=p.text;return}var W="NONE";if(this._flags.last_token.type===M.END_BLOCK?this._previous_flags.inline_frame?W="SPACE":U(p,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&p.newlines?W="NEWLINE":(W="SPACE",this._output.space_before_token=!0):W="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&this._flags.mode===re.BlockStatement?W="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&R(this._flags.mode)?W="SPACE":this._flags.last_token.type===M.STRING?W="NEWLINE":this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===re.ObjectLiteral&&w(this._last_last_text,["{",","]))?W="SPACE":this._flags.last_token.type===M.START_BLOCK?this._flags.inline_frame?W="SPACE":W="NEWLINE":this._flags.last_token.type===M.END_EXPR&&(this._output.space_before_token=!0,W="NEWLINE"),U(p,N)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?W="SPACE":W="NEWLINE"),U(p,["else","catch","finally"]))if((!(this._flags.last_token.type===M.END_BLOCK&&this._previous_flags.mode===re.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&p.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else W==="NEWLINE"?U(this._flags.last_token,j)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&U(p,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==M.END_EXPR?(this._flags.last_token.type!==M.START_EXPR||!U(p,["var","let","const"]))&&this._flags.last_token.text!==":"&&(b(p,"if")&&b(p.previous,"else")?this._output.space_before_token=!0:this.print_newline()):U(p,N)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&S(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():W==="SPACE"&&(this._output.space_before_token=!0);p.previous&&(p.previous.type===M.WORD||p.previous.type===M.RESERVED)&&(this._output.space_before_token=!0),this.print_token(p),this._flags.last_word=p.text,p.type===M.RESERVED&&(p.text==="do"?this._flags.do_block=!0:p.text==="if"?this._flags.if_block=!0:p.text==="import"?this._flags.import_block=!0:this._flags.import_block&&b(p,"from")&&(this._flags.import_block=!1))},C.prototype.handle_semicolon=function(p){this.start_of_statement(p)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(p);for(var P=this._tokens.peek();this._flags.mode===re.Statement&&!(this._flags.if_block&&b(P,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(p)},C.prototype.handle_string=function(p){p.text.startsWith("`")&&p.newlines===0&&p.whitespace_before===""&&(p.previous.text===")"||this._flags.last_token.type===M.WORD)||(this.start_of_statement(p)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(p),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(p):p.text.startsWith("`")&&this._flags.last_token.type===M.END_EXPR&&(p.previous.text==="]"||p.previous.text===")")&&p.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(p)},C.prototype.handle_equals=function(p){this.start_of_statement(p)||this.handle_whitespace_and_comments(p),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(p),this._output.space_before_token=!0},C.prototype.handle_comma=function(p){this.handle_whitespace_and_comments(p,!0),this.print_token(p),this._output.space_before_token=!0,this._flags.declaration_statement?(R(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(p)):this._flags.mode===re.ObjectLiteral||this._flags.mode===re.Statement&&this._flags.parent.mode===re.ObjectLiteral?(this._flags.mode===re.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(p)},C.prototype.handle_operator=function(p){var P=p.text==="*"&&(U(this._flags.last_token,["function","yield"])||w(this._flags.last_token.type,[M.START_BLOCK,M.COMMA,M.END_BLOCK,M.SEMICOLON])),W=w(p.text,["-","+"])&&(w(this._flags.last_token.type,[M.START_BLOCK,M.START_EXPR,M.EQUALS,M.OPERATOR])||w(this._flags.last_token.text,N)||this._flags.last_token.text===",");if(!this.start_of_statement(p)){var se=!P;this.handle_whitespace_and_comments(p,se)}if(p.text==="*"&&this._flags.last_token.type===M.DOT){this.print_token(p);return}if(p.text==="::"){this.print_token(p);return}if(w(p.text,["-","+"])&&this.start_of_object_property()){this.print_token(p);return}if(this._flags.last_token.type===M.OPERATOR&&w(this._options.operator_position,_e)&&this.allow_wrap_or_preserved_newline(p),p.text===":"&&this._flags.in_case){this.print_token(p),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==M.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ve=!0,ye=!0,Re=!1;if(p.text===":"?this._flags.ternary_depth===0?ve=!1:(this._flags.ternary_depth-=1,Re=!0):p.text==="?"&&(this._flags.ternary_depth+=1),!W&&!P&&this._options.preserve_newlines&&w(p.text,F)){var Ge=p.text===":",nt=Ge&&Re,pt=Ge&&!Re;switch(this._options.operator_position){case ce.before_newline:this._output.space_before_token=!pt,this.print_token(p),(!Ge||nt)&&this.allow_wrap_or_preserved_newline(p),this._output.space_before_token=!0;return;case ce.after_newline:this._output.space_before_token=!0,!Ge||nt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(p):this._output.space_before_token=!1,this.print_token(p),this._output.space_before_token=!0;return;case ce.preserve_newline:pt||this.allow_wrap_or_preserved_newline(p),ve=!(this._output.just_added_newline()||pt),this._output.space_before_token=ve,this.print_token(p),this._output.space_before_token=!0;return}}if(P){this.allow_wrap_or_preserved_newline(p),ve=!1;var lt=this._tokens.peek();ye=lt&&w(lt.type,[M.WORD,M.RESERVED])}else if(p.text==="...")this.allow_wrap_or_preserved_newline(p),ve=this._flags.last_token.type===M.START_BLOCK,ye=!1;else if(w(p.text,["--","++","!","~"])||W){if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR)&&this.allow_wrap_or_preserved_newline(p),ve=!1,ye=!1,p.newlines&&(p.text==="--"||p.text==="++"||p.text==="~")){var dt=U(this._flags.last_token,j)&&p.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===";"&&R(this._flags.mode)&&(ve=!0),this._flags.last_token.type===M.RESERVED?ve=!0:this._flags.last_token.type===M.END_EXPR?ve=!(this._flags.last_token.text==="]"&&(p.text==="--"||p.text==="++")):this._flags.last_token.type===M.OPERATOR&&(ve=w(p.text,["--","-","++","+"])&&w(this._flags.last_token.text,["--","-","++","+"]),w(p.text,["+","-"])&&w(this._flags.last_token.text,["--","++"])&&(ye=!0)),(this._flags.mode===re.BlockStatement&&!this._flags.inline_frame||this._flags.mode===re.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ve,this.print_token(p),this._output.space_before_token=ye},C.prototype.handle_block_comment=function(p,P){if(this._output.raw){this._output.add_raw_token(p),p.directives&&p.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(p.directives){this.print_newline(!1,P),this.print_token(p),p.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(p.text)&&!p.newlines){this._output.space_before_token=!0,this.print_token(p),this._output.space_before_token=!0;return}else this.print_block_commment(p,P)},C.prototype.print_block_commment=function(p,P){var W=T(p.text),se,ve=!1,ye=!1,Re=p.whitespace_before,Ge=Re.length;if(this.print_newline(!1,P),this.print_token_line_indentation(p),this._output.add_token(W[0]),this.print_newline(!1,P),W.length>1){for(W=W.slice(1),ve=x(W,"*"),ye=$(W,Re),ve&&(this._flags.alignment=1),se=0;se<W.length;se++)ve?(this.print_token_line_indentation(p),this._output.add_token(k(W[se]))):ye&&W[se]?(this.print_token_line_indentation(p),this._output.add_token(W[se].substring(Ge))):(this._output.current_line.set_indent(-1),this._output.add_token(W[se])),this.print_newline(!1,P);this._flags.alignment=0}},C.prototype.handle_comment=function(p,P){p.newlines?this.print_newline(!1,P):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(p),this.print_newline(!1,P)},C.prototype.handle_dot=function(p){this.start_of_statement(p)||this.handle_whitespace_and_comments(p,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),U(this._flags.last_token,j)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(p,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(p)},C.prototype.handle_unknown=function(p,P){this.print_token(p),p.text[p.text.length-1]===`
|
|
`&&this.print_newline(!1,P)},C.prototype.handle_eof=function(p){for(;this._flags.mode===re.Statement;)this.restore_mode();this.handle_whitespace_and_comments(p)},Z.exports.Beautifier=C},function(Z){function o(y){this.__parent=y,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 y=new o(this.__parent);return y.set_indent(this.__indent_count,this.__alignment_count),y},o.prototype.item=function(y){return y<0?this.__items[this.__items.length+y]:this.__items[y]},o.prototype.has_match=function(y){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(y))return!0;return!1},o.prototype.set_indent=function(y,u){this.is_empty()&&(this.__indent_count=y||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 y=this.__parent.current_line;return y.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),y.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),y.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,y.__items[0]===" "&&(y.__items.splice(0,1),y.__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(y){this.__items.push(y);var u=y.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=y.length-u:this.__character_count+=y.length},o.prototype.pop=function(){var y=null;return this.is_empty()||(y=this.__items.pop(),this.__character_count-=y.length),y},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 y="";return this.is_empty()?this.__parent.indent_empty_lines&&(y=this.__parent.get_indent_string(this.__indent_count)):(y=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),y+=this.__items.join("")),y};function O(y,u){this.__cache=[""],this.__indent_size=y.indent_size,this.__indent_string=y.indent_char,y.indent_with_tabs||(this.__indent_string=new Array(y.indent_size+1).join(y.indent_char)),u=u||"",y.indent_level>0&&(u=new Array(y.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}O.prototype.get_indent_size=function(y,u){var _=this.__base_string_length;return u=u||0,y<0&&(_=0),_+=y*this.__indent_size,_+=u,_},O.prototype.get_indent_string=function(y,u){var _=this.__base_string;return u=u||0,y<0&&(y=0,_=""),u+=y*this.__indent_size,this.__ensure_cache(u),_+=this.__cache[u],_},O.prototype.__ensure_cache=function(y){for(;y>=this.__cache.length;)this.__add_column()},O.prototype.__add_column=function(){var y=this.__cache.length,u=0,_="";this.__indent_size&&y>=this.__indent_size&&(u=Math.floor(y/this.__indent_size),y-=u*this.__indent_size,_=new Array(u+1).join(this.__indent_string)),y&&(_+=new Array(y+1).join(" ")),this.__cache.push(_)};function v(y,u){this.__indent_cache=new O(y,u),this.raw=!1,this._end_with_newline=y.end_with_newline,this.indent_size=y.indent_size,this.wrap_line_length=y.wrap_line_length,this.indent_empty_lines=y.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()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(y,u){return this.__indent_cache.get_indent_string(y,u)},v.prototype.get_indent_size=function(y,u){return this.__indent_cache.get_indent_size(y,u)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(y){return this.is_empty()||!y&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(y){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 _=this.__lines.join(`
|
|
`);return y!==`
|
|
`&&(_=_.replace(/[\n]/g,y)),_},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(y,u){return y=y||0,u=u||0,this.next_line.set_indent(y,u),this.__lines.length>1?(this.current_line.set_indent(y,u),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(y){for(var u=0;u<y.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(y.whitespace_before),this.current_line.push(y.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(y){this.__add_space_before_token(),this.current_line.push(y),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(y){for(var u=this.__lines.length;y<u;)this.__lines[y]._remove_indent(),y++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(y){for(y=y===void 0?!1:y,this.current_line.trim();y&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(y,u){for(var _=this.__lines.length-2;_>=0;){var m=this.__lines[_];if(m.is_empty())break;if(m.item(0).indexOf(y)!==0&&m.item(-1)!==u){this.__lines.splice(_+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}_--}},Z.exports.Output=v},function(Z){function o(O,v,y,u){this.type=O,this.text=v,this.comments_before=null,this.newlines=y||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}Z.exports.Token=o},function(Z,o){var O="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",y="\\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",_="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",m="(?:"+_+"|["+O+y+"])",N="(?:"+_+"|["+v+y+u+"])*";o.identifier=new RegExp(m+N,"g"),o.identifierStart=new RegExp(m),o.identifierMatch=new RegExp("(?:"+_+"|["+v+y+u+"])+");var F=/[\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(Z,o,O){var v=O(6).Options,y=["before-newline","after-newline","preserve-newline"];function u(_){v.call(this,_,"js");var m=this.raw_options.brace_style||null;m==="expand-strict"?this.raw_options.brace_style="expand":m==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var N=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var F=0;F<N.length;F++)N[F]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=N[F];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",y),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new v,Z.exports.Options=u},function(Z){function o(y,u){this.raw_options=O(y,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(y,u){var _=this.raw_options[y],m=u||[];return typeof _=="object"?_!==null&&typeof _.concat=="function"&&(m=_.concat()):typeof _=="string"&&(m=_.split(/[^a-zA-Z0-9_\/\-]+/)),m},o.prototype._get_boolean=function(y,u){var _=this.raw_options[y],m=_===void 0?!!u:!!_;return m},o.prototype._get_characters=function(y,u){var _=this.raw_options[y],m=u||"";return typeof _=="string"&&(m=_.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),m},o.prototype._get_number=function(y,u){var _=this.raw_options[y];u=parseInt(u,10),isNaN(u)&&(u=0);var m=parseInt(_,10);return isNaN(m)&&(m=u),m},o.prototype._get_selection=function(y,u,_){var m=this._get_selection_list(y,u,_);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+y+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[y]+"'");return m[0]},o.prototype._get_selection_list=function(y,u,_){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(_=_||[u[0]],!this._is_valid_selection(_,u))throw new Error("Invalid Default Value!");var m=this._get_array(y,_);if(!this._is_valid_selection(m,u))throw new Error("Invalid Option Value: The option '"+y+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[y]+"'");return m},o.prototype._is_valid_selection=function(y,u){return y.length&&u.length&&!y.some(function(_){return u.indexOf(_)===-1})};function O(y,u){var _={};y=v(y);var m;for(m in y)m!==u&&(_[m]=y[m]);if(u&&y[u])for(m in y[u])_[m]=y[u][m];return _}function v(y){var u={},_;for(_ in y){var m=_.replace(/-/g,"_");u[m]=y[_]}return u}Z.exports.Options=o,Z.exports.normalizeOpts=v,Z.exports.mergeOpts=O},function(Z,o,O){var v=O(8).InputScanner,y=O(9).Tokenizer,u=O(9).TOKEN,_=O(13).Directives,m=O(4),N=O(12).Pattern,F=O(14).TemplatablePattern;function M(x,$){return $.indexOf(x)!==-1}var w={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},k=new _(/\/\*/,/\*\//),K=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,b=/[0-9]/,U=/[^\d\.]/,j=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),H=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";H=H.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),H="\\?\\.(?!\\d) "+H,H=H.replace(/ /g,"|");var ce=new RegExp(H),_e="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),re=_e.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Y=new RegExp("^(?:"+re.join("|")+")$"),T,S=function(x,$){y.call(this,x,$),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var C=new N(this._input),d=new F(this._input).read_options(this._options);this.__patterns={template:d,identifier:d.starting_with(m.identifier).matching(m.identifierMatch),number:C.matching(K),punct:C.matching(ce),comment:C.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:C.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:C.matching(/<!--/),html_comment_end:C.matching(/-->/),include:C.starting_with(/#include/).until_after(m.lineBreak),shebang:C.starting_with(/#!/).until_after(m.lineBreak),xml:C.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:d.until(/['\\\n\r\u2028\u2029]/),double_quote:d.until(/["\\\n\r\u2028\u2029]/),template_text:d.until(/[`\\$]/),template_expression:d.until(/[`}\\]/)}};S.prototype=new y,S.prototype._is_comment=function(x){return x.type===w.COMMENT||x.type===w.BLOCK_COMMENT||x.type===w.UNKNOWN},S.prototype._is_opening=function(x){return x.type===w.START_BLOCK||x.type===w.START_EXPR},S.prototype._is_closing=function(x,$){return(x.type===w.END_BLOCK||x.type===w.END_EXPR)&&$&&(x.text==="]"&&$.text==="["||x.text===")"&&$.text==="("||x.text==="}"&&$.text==="{")},S.prototype._reset=function(){T=!1},S.prototype._get_next_token=function(x,$){var C=null;this._readWhitespace();var d=this._input.peek();return d===null?this._create_token(w.EOF,""):(C=C||this._read_non_javascript(d),C=C||this._read_string(d),C=C||this._read_pair(d,this._input.peek(1)),C=C||this._read_word(x),C=C||this._read_singles(d),C=C||this._read_comment(d),C=C||this._read_regexp(d,x),C=C||this._read_xml(d,x),C=C||this._read_punctuation(),C=C||this._create_token(w.UNKNOWN,this._input.next()),C)},S.prototype._read_word=function(x){var $;if($=this.__patterns.identifier.read(),$!=="")return $=$.replace(m.allLineBreaks,`
|
|
`),!(x.type===w.DOT||x.type===w.RESERVED&&(x.text==="set"||x.text==="get"))&&Y.test($)?($==="in"||$==="of")&&(x.type===w.WORD||x.type===w.STRING)?this._create_token(w.OPERATOR,$):this._create_token(w.RESERVED,$):this._create_token(w.WORD,$);if($=this.__patterns.number.read(),$!=="")return this._create_token(w.WORD,$)},S.prototype._read_singles=function(x){var $=null;return x==="("||x==="["?$=this._create_token(w.START_EXPR,x):x===")"||x==="]"?$=this._create_token(w.END_EXPR,x):x==="{"?$=this._create_token(w.START_BLOCK,x):x==="}"?$=this._create_token(w.END_BLOCK,x):x===";"?$=this._create_token(w.SEMICOLON,x):x==="."&&U.test(this._input.peek(1))?$=this._create_token(w.DOT,x):x===","&&($=this._create_token(w.COMMA,x)),$&&this._input.next(),$},S.prototype._read_pair=function(x,$){var C=null;return x==="#"&&$==="{"&&(C=this._create_token(w.START_BLOCK,x+$)),C&&(this._input.next(),this._input.next()),C},S.prototype._read_punctuation=function(){var x=this.__patterns.punct.read();if(x!=="")return x==="="?this._create_token(w.EQUALS,x):x==="?."?this._create_token(w.DOT,x):this._create_token(w.OPERATOR,x)},S.prototype._read_non_javascript=function(x){var $="";if(x==="#"){if(this._is_first_token()&&($=this.__patterns.shebang.read(),$))return this._create_token(w.UNKNOWN,$.trim()+`
|
|
`);if($=this.__patterns.include.read(),$)return this._create_token(w.UNKNOWN,$.trim()+`
|
|
`);x=this._input.next();var C="#";if(this._input.hasNext()&&this._input.testChar(b)){do x=this._input.next(),C+=x;while(this._input.hasNext()&&x!=="#"&&x!=="=");return x==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(C+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(C+="{}",this._input.next(),this._input.next())),this._create_token(w.WORD,C)}this._input.back()}else if(x==="<"&&this._is_first_token()){if($=this.__patterns.html_comment_start.read(),$){for(;this._input.hasNext()&&!this._input.testChar(m.newline);)$+=this._input.next();return T=!0,this._create_token(w.COMMENT,$)}}else if(T&&x==="-"&&($=this.__patterns.html_comment_end.read(),$))return T=!1,this._create_token(w.COMMENT,$);return null},S.prototype._read_comment=function(x){var $=null;if(x==="/"){var C="";if(this._input.peek(1)==="*"){C=this.__patterns.block_comment.read();var d=k.get_directives(C);d&&d.ignore==="start"&&(C+=k.readIgnored(this._input)),C=C.replace(m.allLineBreaks,`
|
|
`),$=this._create_token(w.BLOCK_COMMENT,C),$.directives=d}else this._input.peek(1)==="/"&&(C=this.__patterns.comment.read(),$=this._create_token(w.COMMENT,C))}return $},S.prototype._read_string=function(x){if(x==="`"||x==="'"||x==='"'){var $=this._input.next();return this.has_char_escapes=!1,x==="`"?$+=this._read_string_recursive("`",!0,"${"):$+=this._read_string_recursive(x),this.has_char_escapes&&this._options.unescape_strings&&($=R($)),this._input.peek()===x&&($+=this._input.next()),$=$.replace(m.allLineBreaks,`
|
|
`),this._create_token(w.STRING,$)}return null},S.prototype._allow_regexp_or_xml=function(x){return x.type===w.RESERVED&&M(x.text,["return","case","throw","else","do","typeof","yield"])||x.type===w.END_EXPR&&x.text===")"&&x.opened.previous.type===w.RESERVED&&M(x.opened.previous.text,["if","while","for"])||M(x.type,[w.COMMENT,w.START_EXPR,w.START_BLOCK,w.START,w.END_BLOCK,w.OPERATOR,w.EQUALS,w.EOF,w.SEMICOLON,w.COMMA])},S.prototype._read_regexp=function(x,$){if(x==="/"&&this._allow_regexp_or_xml($)){for(var C=this._input.next(),d=!1,p=!1;this._input.hasNext()&&(d||p||this._input.peek()!==x)&&!this._input.testChar(m.newline);)C+=this._input.peek(),d?d=!1:(d=this._input.peek()==="\\",this._input.peek()==="["?p=!0:this._input.peek()==="]"&&(p=!1)),this._input.next();return this._input.peek()===x&&(C+=this._input.next(),C+=this._input.read(m.identifier)),this._create_token(w.STRING,C)}return null},S.prototype._read_xml=function(x,$){if(this._options.e4x&&x==="<"&&this._allow_regexp_or_xml($)){var C="",d=this.__patterns.xml.read_match();if(d){for(var p=d[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),P=p.indexOf("{")===0,W=0;d;){var se=!!d[1],ve=d[2],ye=!!d[d.length-1]||ve.slice(0,8)==="![CDATA[";if(!ye&&(ve===p||P&&ve.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--W:++W),C+=d[0],W<=0)break;d=this.__patterns.xml.read_match()}return d||(C+=this._input.match(/[\s\S]*/g)[0]),C=C.replace(m.allLineBreaks,`
|
|
`),this._create_token(w.STRING,C)}}return null};function R(x){for(var $="",C=0,d=new v(x),p=null;d.hasNext();)if(p=d.match(/([\s]|[^\\]|\\\\)+/g),p&&($+=p[0]),d.peek()==="\\"){if(d.next(),d.peek()==="x")p=d.match(/x([0-9A-Fa-f]{2})/g);else if(d.peek()==="u")p=d.match(/u([0-9A-Fa-f]{4})/g),p||(p=d.match(/u\{([0-9A-Fa-f]+)\}/g));else{$+="\\",d.hasNext()&&($+=d.next());continue}if(!p||(C=parseInt(p[1],16),C>126&&C<=255&&p[0].indexOf("x")===0))return x;C>=0&&C<32||C>1114111?$+="\\"+p[0]:C===34||C===39||C===92?$+="\\"+String.fromCharCode(C):$+=String.fromCharCode(C)}return $}S.prototype._read_string_recursive=function(x,$,C){var d,p;x==="'"?p=this.__patterns.single_quote:x==='"'?p=this.__patterns.double_quote:x==="`"?p=this.__patterns.template_text:x==="}"&&(p=this.__patterns.template_expression);for(var P=p.read(),W="";this._input.hasNext();){if(W=this._input.next(),W===x||!$&&m.newline.test(W)){this._input.back();break}else W==="\\"&&this._input.hasNext()?(d=this._input.peek(),d==="x"||d==="u"?this.has_char_escapes=!0:d==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),W+=this._input.next()):C&&(C==="${"&&W==="$"&&this._input.peek()==="{"&&(W+=this._input.next()),C===W&&(x==="`"?W+=this._read_string_recursive("}",$,"`"):W+=this._read_string_recursive("`",$,"${"),this._input.hasNext()&&(W+=this._input.next())));W+=p.read(),P+=W}return P},Z.exports.Tokenizer=S,Z.exports.TOKEN=w,Z.exports.positionable_operators=j.slice(),Z.exports.line_starters=_e.slice()},function(Z){var o=RegExp.prototype.hasOwnProperty("sticky");function O(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}O.prototype.restart=function(){this.__position=0},O.prototype.back=function(){this.__position>0&&(this.__position-=1)},O.prototype.hasNext=function(){return this.__position<this.__input_length},O.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},O.prototype.peek=function(v){var y=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(y=this.__input.charAt(v)),y},O.prototype.__match=function(v,y){v.lastIndex=y;var u=v.exec(this.__input);return u&&!(o&&v.sticky)&&u.index!==y&&(u=null),u},O.prototype.test=function(v,y){return y=y||0,y+=this.__position,y>=0&&y<this.__input_length?!!this.__match(v,y):!1},O.prototype.testChar=function(v,y){var u=this.peek(y);return v.lastIndex=0,u!==null&&v.test(u)},O.prototype.match=function(v){var y=this.__match(v,this.__position);return y?this.__position+=y[0].length:y=null,y},O.prototype.read=function(v,y,u){var _="",m;return v&&(m=this.match(v),m&&(_+=m[0])),y&&(m||!v)&&(_+=this.readUntil(y,u)),_},O.prototype.readUntil=function(v,y){var u="",_=this.__position;v.lastIndex=this.__position;var m=v.exec(this.__input);return m?(_=m.index,y&&(_+=m[0].length)):_=this.__input_length,u=this.__input.substring(this.__position,_),this.__position=_,u},O.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},O.prototype.get_regexp=function(v,y){var u=null,_="g";return y&&o&&(_="y"),typeof v=="string"&&v!==""?u=new RegExp(v,_):v&&(u=new RegExp(v.source,_)),u},O.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},O.prototype.peekUntilAfter=function(v){var y=this.__position,u=this.readUntilAfter(v);return this.__position=y,u},O.prototype.lookBack=function(v){var y=this.__position-1;return y>=v.length&&this.__input.substring(y-v.length,y).toLowerCase()===v},Z.exports.InputScanner=O},function(Z,o,O){var v=O(8).InputScanner,y=O(3).Token,u=O(10).TokenStream,_=O(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},N=function(F,M){this._input=new v(F),this._options=M||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new _(this._input)};N.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var F,M=new y(m.START,""),w=null,k=[],K=new u;M.type!==m.EOF;){for(F=this._get_next_token(M,w);this._is_comment(F);)K.add(F),F=this._get_next_token(M,w);K.isEmpty()||(F.comments_before=K,K=new u),F.parent=w,this._is_opening(F)?(k.push(w),w=F):w&&this._is_closing(F,w)&&(F.opened=w,w.closed=F,w=k.pop(),F.parent=w),F.previous=M,M.next=F,this.__tokens.add(F),M=F}return this.__tokens},N.prototype._is_first_token=function(){return this.__tokens.isEmpty()},N.prototype._reset=function(){},N.prototype._get_next_token=function(F,M){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(m.RAW,w):this._create_token(m.EOF,"")},N.prototype._is_comment=function(F){return!1},N.prototype._is_opening=function(F){return!1},N.prototype._is_closing=function(F,M){return!1},N.prototype._create_token=function(F,M){var w=new y(F,M,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},N.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Z.exports.Tokenizer=N,Z.exports.TOKEN=m},function(Z){function o(O){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=O}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position<this.__tokens_length},o.prototype.next=function(){var O=null;return this.hasNext()&&(O=this.__tokens[this.__position],this.__position+=1),O},o.prototype.peek=function(O){var v=null;return O=O||0,O+=this.__position,O>=0&&O<this.__tokens_length&&(v=this.__tokens[O]),v},o.prototype.add=function(O){this.__parent_token&&(O.parent=this.__parent_token),this.__tokens.push(O),this.__tokens_length+=1},Z.exports.TokenStream=o},function(Z,o,O){var v=O(12).Pattern;function y(u,_){v.call(this,u,_),_?this._line_regexp=this._input.get_regexp(_._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}y.prototype=new v,y.prototype.__set_whitespace_patterns=function(u,_){u+="\\t ",_+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+_+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+_+"]")},y.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var _=this.__split(this._newline_regexp,u);this.newline_count=_.length-1,this.whitespace_before_token=_[this.newline_count]}return u},y.prototype.matching=function(u,_){var m=this._create();return m.__set_whitespace_patterns(u,_),m._update(),m},y.prototype._create=function(){return new y(this._input,this)},y.prototype.__split=function(u,_){u.lastIndex=0;for(var m=0,N=[],F=u.exec(_);F;)N.push(_.substring(m,F.index)),m=F.index+F[0].length,F=u.exec(_);return m<_.length?N.push(_.substring(m,_.length)):N.push(""),N},Z.exports.WhitespacePattern=y},function(Z){function o(O,v){this._input=O,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,v&&(this._starting_pattern=this._input.get_regexp(v._starting_pattern,!0),this._match_pattern=this._input.get_regexp(v._match_pattern,!0),this._until_pattern=this._input.get_regexp(v._until_pattern),this._until_after=v._until_after)}o.prototype.read=function(){var O=this._input.read(this._starting_pattern);return(!this._starting_pattern||O)&&(O+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),O},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(O){var v=this._create();return v._until_after=!0,v._until_pattern=this._input.get_regexp(O),v._update(),v},o.prototype.until=function(O){var v=this._create();return v._until_after=!1,v._until_pattern=this._input.get_regexp(O),v._update(),v},o.prototype.starting_with=function(O){var v=this._create();return v._starting_pattern=this._input.get_regexp(O,!0),v._update(),v},o.prototype.matching=function(O){var v=this._create();return v._match_pattern=this._input.get_regexp(O,!0),v._update(),v},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},Z.exports.Pattern=o},function(Z){function o(O,v){O=typeof O=="string"?O:O.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(O+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(O+/\sbeautify\signore:end\s/.source+v,"g")}o.prototype.get_directives=function(O){if(!O.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var y=this.__directive_pattern.exec(O);y;)v[y[1]]=y[2],y=this.__directive_pattern.exec(O);return v},o.prototype.readIgnored=function(O){return O.readUntilAfter(this.__directives_end_ignore_pattern)},Z.exports.Directives=o},function(Z,o,O){var v=O(12).Pattern,y={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function u(_,m){v.call(this,_,m),this.__template_pattern=null,this._disabled=Object.assign({},y),this._excluded=Object.assign({},y),m&&(this.__template_pattern=this._input.get_regexp(m.__template_pattern),this._excluded=Object.assign(this._excluded,m._excluded),this._disabled=Object.assign(this._disabled,m._disabled));var N=new v(_);this.__patterns={handlebars_comment:N.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:N.starting_with(/{{{/).until_after(/}}}/),handlebars:N.starting_with(/{{/).until_after(/}}/),php:N.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:N.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:N.starting_with(/{%/).until_after(/%}/),django_value:N.starting_with(/{{/).until_after(/}}/),django_comment:N.starting_with(/{#/).until_after(/#}/),smarty:N.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:N.starting_with(/{\*/).until_after(/\*}/),smarty_literal:N.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new v,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(_){var m=this._create();return m._disabled[_]=!0,m._update(),m},u.prototype.read_options=function(_){var m=this._create();for(var N in y)m._disabled[N]=_.templating.indexOf(N)===-1;return m._update(),m},u.prototype.exclude=function(_){var m=this._create();return m._excluded[_]=!0,m._update(),m},u.prototype.read=function(){var _="";this._match_pattern?_=this._input.read(this._starting_pattern):_=this._input.read(this._starting_pattern,this.__template_pattern);for(var m=this._read_template();m;)this._match_pattern?m+=this._input.read(this._match_pattern):m+=this._input.readUntil(this.__template_pattern),_+=m,m=this._read_template();return this._until_after&&(_+=this._input.readUntilAfter(this._until_pattern)),_},u.prototype.__set_templated_pattern=function(){var _=[];this._disabled.php||_.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||_.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||_.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||_.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(_.push(this.__patterns.django._starting_pattern.source),_.push(this.__patterns.django_value._starting_pattern.source),_.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||_.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&_.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+_.join("|")+")")},u.prototype._read_template=function(){var _="",m=this._input.peek();if(m==="<"){var N=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&N==="?"&&(_=_||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&N==="%"&&(_=_||this.__patterns.erb.read())}else m==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(_=_||this.__patterns.handlebars_comment.read(),_=_||this.__patterns.handlebars_unescaped.read(),_=_||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(_=_||this.__patterns.django_value.read()),this._excluded.django||(_=_||this.__patterns.django_comment.read(),_=_||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(_=_||this.__patterns.smarty_comment.read(),_=_||this.__patterns.smarty_literal.read(),_=_||this.__patterns.smarty.read()));return _},Z.exports.TemplatablePattern=u}],V={};function q(Z){var o=V[Z];if(o!==void 0)return o.exports;var O=V[Z]={exports:{}};return ne[Z](O,O.exports,q),O.exports}var ee=q(0);Q=ee})();var ae=Q;I=[],z=function(){return{js_beautify:ae}}.apply(xe,I),z!==void 0&&(qe.exports=z)})()},75918:function(qe,xe,I){"use strict";I.d(xe,{Wi:function(){return q},Z0:function(){return ee},aU:function(){return V},eZ:function(){return o},wY:function(){return Z}});var z=I(4348),Q=I(69323),ae=I(13268),ne=function(O,v,y,u){function _(m){return m instanceof y?m:new y(function(N){N(m)})}return new(y||(y=Promise))(function(m,N){function F(k){try{w(u.next(k))}catch(K){N(K)}}function M(k){try{w(u.throw(k))}catch(K){N(K)}}function w(k){k.done?m(k.value):_(k.value).then(F,M)}w((u=u.apply(O,v||[])).next())})};class V extends Q.JT{constructor(v,y="",u="",_=!0,m){super(),this._onDidChange=this._register(new z.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=v,this._label=y,this._cssClass=u,this._enabled=_,this._actionCallback=m}get id(){return this._id}get label(){return this._label}set label(v){this._setLabel(v)}_setLabel(v){this._label!==v&&(this._label=v,this._onDidChange.fire({label:v}))}get tooltip(){return this._tooltip||""}set tooltip(v){this._setTooltip(v)}_setTooltip(v){this._tooltip!==v&&(this._tooltip=v,this._onDidChange.fire({tooltip:v}))}get class(){return this._cssClass}set class(v){this._setClass(v)}_setClass(v){this._cssClass!==v&&(this._cssClass=v,this._onDidChange.fire({class:v}))}get enabled(){return this._enabled}set enabled(v){this._setEnabled(v)}_setEnabled(v){this._enabled!==v&&(this._enabled=v,this._onDidChange.fire({enabled:v}))}get checked(){return this._checked}set checked(v){this._setChecked(v)}_setChecked(v){this._checked!==v&&(this._checked=v,this._onDidChange.fire({checked:v}))}run(v,y){return ne(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(v))})}}class q extends Q.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new z.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new z.Q5),this.onDidRun=this._onDidRun.event}run(v,y){return ne(this,void 0,void 0,function*(){if(!v.enabled)return;this._onBeforeRun.fire({action:v});let u;try{yield this.runAction(v,y)}catch(_){u=_}this._onDidRun.fire({action:v,error:u})})}runAction(v,y){return ne(this,void 0,void 0,function*(){yield v.run(y)})}}class ee extends V{constructor(v){super(ee.ID,v,v?"separator text":"separator"),this.checked=!1,this.enabled=!1}}ee.ID="vs.actions.separator";class Z{constructor(v,y,u,_){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=v,this.label=y,this.class=_,this._actions=u}get actions(){return this._actions}dispose(){}run(){return ne(this,void 0,void 0,function*(){})}}class o extends V{constructor(){super(o.ID,ae.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(qe,xe,I){"use strict";I.d(xe,{ok:function(){return z}});function z(Q,ae){if(!Q)throw new Error(ae?`Assertion failed (${ae})`:"Assertion Failed")}},52615:function(qe,xe,I){"use strict";I.d(xe,{CM:function(){return V},JL:function(){return q},dT:function(){return Z},fK:function(){return ne},lA:function(){return ee}});var z=I(4348);class Q{constructor(){this._icons=new Map,this._onDidRegister=new z.Q5}add(O){const v=this._icons.get(O.id);v?O.description?v.description=O.description:console.error(`Duplicate registration of codicon ${O.id}`):(this._icons.set(O.id,O),this._onDidRegister.fire(O))}get(O){return this._icons.get(O)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const ae=new Q,ne=ae;function V(o,O){return new ee(o,O)}function q(o){return o?o.replace(/\$\((.*?)\)/g,(O,v)=>` ${v} `).trim():""}class ee{constructor(O,v,y){this.id=O,this.definition=v,this.description=y,ae.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var Z;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const O=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function v(_){if(_ instanceof ee)return["codicon","codicon-"+_.id];const m=O.exec(_.id);if(!m)return v(ee.error);let[,N,F]=m;const M=["codicon","codicon-"+N];return F&&M.push("codicon-modifier-"+F.substr(1)),M}o.asClassNameArray=v;function y(_){return v(_).join(" ")}o.asClassName=y;function u(_){return"."+v(_).join(".")}o.asCSSSelector=u})(Z||(Z={})),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"})}(ee||(ee={}))},79881:function(qe,xe,I){"use strict";I.d(xe,{B8:function(){return v},Cp:function(){return ne},F0:function(){return Z},L6:function(){return O},VV:function(){return ee},b1:function(){return o},dL:function(){return ae},ri:function(){return V}});class z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(u){setTimeout(()=>{throw u.stack?new Error(u.message+`
|
|
|
|
`+u.stack):u},0)}}emit(u){this.listeners.forEach(_=>{_(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}const Q=new z;function ae(y){ee(y)||Q.onUnexpectedError(y)}function ne(y){ee(y)||Q.onUnexpectedExternalError(y)}function V(y){if(y instanceof Error){let{name:u,message:_}=y;const m=y.stacktrace||y.stack;return{$isError:!0,name:u,message:_,stack:m}}return y}const q="Canceled";function ee(y){return y instanceof Error&&y.name===q&&y.message===q}function Z(){const y=new Error(q);return y.name=y.message,y}function o(y){return y?new Error(`Illegal argument: ${y}`):new Error("Illegal argument")}function O(y){return y?new Error(`Illegal state: ${y}`):new Error("Illegal state")}class v extends Error{constructor(u){super("NotSupported"),u&&(this.message=u)}}},4348:function(qe,xe,I){"use strict";I.d(xe,{D0:function(){return v},E7:function(){return y},K3:function(){return O},Q5:function(){return o},ZD:function(){return u},ju:function(){return V}});var z=I(79881),Q=I(69323),ae=I(34502),ne=I(95830),V;(function(_){_.None=()=>Q.JT.None;function m(R){return(x,$=null,C)=>{let d=!1,p;return p=R(P=>{if(!d)return p?p.dispose():d=!0,x.call($,P)},null,C),d&&p.dispose(),p}}_.once=m;function N(R,x){return b(($,C=null,d)=>R(p=>$.call(C,x(p)),null,d))}_.map=N;function F(R,x){return b(($,C=null,d)=>R(p=>{x(p),$.call(C,p)},null,d))}_.forEach=F;function M(R,x){return b(($,C=null,d)=>R(p=>x(p)&&$.call(C,p),null,d))}_.filter=M;function w(R){return R}_.signal=w;function k(...R){return(x,$=null,C)=>(0,Q.F8)(...R.map(d=>d(p=>x.call($,p),null,C)))}_.any=k;function K(R,x,$){let C=$;return N(R,d=>(C=x(C,d),C))}_.reduce=K;function b(R){let x;const $=new o({onFirstListenerAdd(){x=R($.fire,$)},onLastListenerRemove(){x.dispose()}});return $.event}function U(R,x,$=100,C=!1,d){let p,P,W,se=0;const ve=new o({leakWarningThreshold:d,onFirstListenerAdd(){p=R(ye=>{se++,P=x(P,ye),C&&!W&&(ve.fire(P),P=void 0),clearTimeout(W),W=setTimeout(()=>{const Re=P;P=void 0,W=void 0,(!C||se>1)&&ve.fire(Re),se=0},$)})},onLastListenerRemove(){p.dispose()}});return ve.event}_.debounce=U;function j(R,x=($,C)=>$===C){let $=!0,C;return M(R,d=>{const p=$||!x(d,C);return $=!1,C=d,p})}_.latch=j;function H(R,x){return[_.filter(R,x),_.filter(R,$=>!x($))]}_.split=H;function ce(R,x=!1,$=[]){let C=$.slice(),d=R(W=>{C?C.push(W):P.fire(W)});const p=()=>{C&&C.forEach(W=>P.fire(W)),C=null},P=new o({onFirstListenerAdd(){d||(d=R(W=>P.fire(W)))},onFirstListenerDidAdd(){C&&(x?setTimeout(p):p())},onLastListenerRemove(){d&&d.dispose(),d=null}});return P.event}_.buffer=ce;class _e{constructor(x){this.event=x}map(x){return new _e(N(this.event,x))}forEach(x){return new _e(F(this.event,x))}filter(x){return new _e(M(this.event,x))}reduce(x,$){return new _e(K(this.event,x,$))}latch(){return new _e(j(this.event))}debounce(x,$=100,C=!1,d){return new _e(U(this.event,x,$,C,d))}on(x,$,C){return this.event(x,$,C)}once(x,$,C){return m(this.event)(x,$,C)}}function re(R){return new _e(R)}_.chain=re;function Y(R,x,$=C=>C){const C=(...W)=>P.fire($(...W)),d=()=>R.on(x,C),p=()=>R.removeListener(x,C),P=new o({onFirstListenerAdd:d,onLastListenerRemove:p});return P.event}_.fromNodeEventEmitter=Y;function T(R,x,$=C=>C){const C=(...W)=>P.fire($(...W)),d=()=>R.addEventListener(x,C),p=()=>R.removeEventListener(x,C),P=new o({onFirstListenerAdd:d,onLastListenerRemove:p});return P.event}_.fromDOMEventEmitter=T;function S(R){return new Promise(x=>m(R)(x))}_.toPromise=S})(V||(V={}));class q{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${q._idPool++}`}start(m){this._stopWatch=new ne.G(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}q._idPool=0;let ee=-1;class Z{constructor(m,N=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=N,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let N=ee;if(typeof this.customThreshold=="number"&&(N=this.customThreshold),N<=0||m<N)return;this._stacks||(this._stacks=new Map);const F=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),M=this._stacks.get(F)||0;if(this._stacks.set(F,M+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=N*.5;let w,k=0;for(const[K,b]of this._stacks)(!w||k<b)&&(w=K,k=b);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${k}):`),console.warn(w)}return()=>{const w=this._stacks.get(F)||0;this._stacks.set(F,w-1)}}}class o{constructor(m){var N;this._disposed=!1,this._options=m,this._leakageMon=ee>0?new Z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((N=this._options)===null||N===void 0)&&N._profName?new q(this._options._profName):void 0}get event(){return this._event||(this._event=(m,N,F)=>{var M;this._listeners||(this._listeners=new ae.S);const w=this._listeners.isEmpty();w&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const k=this._listeners.push(N?[m,N]:m);w&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,N);const K=(M=this._leakageMon)===null||M===void 0?void 0:M.check(this._listeners.size),b=(0,Q.OF)(()=>{K&&K(),this._disposed||(k(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return F instanceof Q.SL?F.add(b):Array.isArray(F)&&F.push(b),b}),this._event}fire(m){var N,F;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ae.S);for(let M of this._listeners)this._deliveryQueue.push([M,m]);for((N=this._perfMon)===null||N===void 0||N.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[M,w]=this._deliveryQueue.shift();try{typeof M=="function"?M.call(void 0,w):M[0].call(M[1],w)}catch(k){(0,z.dL)(k)}}(F=this._perfMon)===null||F===void 0||F.stop()}}dispose(){var m,N,F,M,w;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(N=this._deliveryQueue)===null||N===void 0||N.clear(),(M=(F=this._options)===null||F===void 0?void 0:F.onLastListenerRemove)===null||M===void 0||M.call(F),(w=this._leakageMon)===null||w===void 0||w.dispose())}}class O extends o{constructor(m){super(m),this._isPaused=0,this._eventQueue=new ae.S,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class v extends O{constructor(m){var N;super(m),this._delay=(N=m.delay)!==null&&N!==void 0?N:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class y{constructor(){this.buffers=[]}wrapEvent(m){return(N,F,M)=>m(w=>{const k=this.buffers[this.buffers.length-1];k?k.push(()=>N.call(F,w)):N.call(F,w)},void 0,M)}bufferEvents(m){const N=[];this.buffers.push(N);const F=m();return this.buffers.pop(),N.forEach(M=>M()),F}}class u{constructor(){this.listening=!1,this.inputEvent=V.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(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(qe,xe,I){"use strict";I.d(xe,{I:function(){return z}});function z(Q){const ae=this;let ne=!1,V;return function(){return ne||(ne=!0,V=Q.apply(ae,arguments)),V}}},88226:function(qe,xe,I){"use strict";I.d(xe,{$:function(){return z}});var z;(function(Q){function ae(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}Q.is=ae;const ne=Object.freeze([]);function V(){return ne}Q.empty=V;function*q(k){yield k}Q.single=q;function ee(k){return k||ne}Q.from=ee;function Z(k){return!k||k[Symbol.iterator]().next().done===!0}Q.isEmpty=Z;function o(k){return k[Symbol.iterator]().next().value}Q.first=o;function O(k,K){for(const b of k)if(K(b))return!0;return!1}Q.some=O;function v(k,K){for(const b of k)if(K(b))return b}Q.find=v;function*y(k,K){for(const b of k)K(b)&&(yield b)}Q.filter=y;function*u(k,K){let b=0;for(const U of k)yield K(U,b++)}Q.map=u;function*_(...k){for(const K of k)for(const b of K)yield b}Q.concat=_;function*m(k){for(const K of k)for(const b of K)yield b}Q.concatNested=m;function N(k,K,b){let U=b;for(const j of k)U=K(U,j);return U}Q.reduce=N;function*F(k,K,b=k.length){for(K<0&&(K+=k.length),b<0?b+=k.length:b>k.length&&(b=k.length);K<b;K++)yield k[K]}Q.slice=F;function M(k,K=Number.POSITIVE_INFINITY){const b=[];if(K===0)return[b,k];const U=k[Symbol.iterator]();for(let j=0;j<K;j++){const H=U.next();if(H.done)return[b,Q.empty()];b.push(H.value)}return[b,{[Symbol.iterator](){return U}}]}Q.consume=M;function w(k,K,b=(U,j)=>U===j){const U=k[Symbol.iterator](),j=K[Symbol.iterator]();for(;;){const H=U.next(),ce=j.next();if(H.done!==ce.done)return!1;if(H.done)return!0;if(!b(H.value,ce.value))return!1}}Q.equals=w})(z||(z={}))},69323:function(qe,xe,I){"use strict";I.d(xe,{B9:function(){return u},F8:function(){return _},JT:function(){return F},Jz:function(){return w},OF:function(){return m},SL:function(){return N},Wf:function(){return y},XK:function(){return M},dk:function(){return O}});var z=I(17845),Q=I(88226);const ae=!1;let ne=null;function V(k){ne=k}if(ae){const k="__is_disposable_tracked__";V(new class{trackDisposable(K){const b=new Error("Potentially leaked disposable").stack;setTimeout(()=>{K[k]||console.log(b)},3e3)}setParent(K,b){if(K&&K!==F.None)try{K[k]=!0}catch(U){}}markAsDisposed(K){if(K&&K!==F.None)try{K[k]=!0}catch(b){}}markAsSingleton(K){}})}function q(k){return ne==null||ne.trackDisposable(k),k}function ee(k){ne==null||ne.markAsDisposed(k)}function Z(k,K){ne==null||ne.setParent(k,K)}function o(k,K){if(ne)for(const b of k)ne.setParent(b,K)}function O(k){return ne==null||ne.markAsSingleton(k),k}class v extends Error{constructor(K){super(`Encountered errors while disposing of store. Errors: [${K.join(", ")}]`),this.errors=K}}function y(k){return typeof k.dispose=="function"&&k.dispose.length===0}function u(k){if(Q.$.is(k)){let K=[];for(const b of k)if(b)try{b.dispose()}catch(U){K.push(U)}if(K.length===1)throw K[0];if(K.length>1)throw new v(K);return Array.isArray(k)?[]:k}else if(k)return k.dispose(),k}function _(...k){const K=m(()=>u(k));return o(k,K),K}function m(k){const K=q({dispose:(0,z.I)(()=>{ee(K),k()})});return K}class N{constructor(){this._toDispose=new Set,this._isDisposed=!1,q(this)}dispose(){this._isDisposed||(ee(this),this._isDisposed=!0,this.clear())}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(K){if(!K)return K;if(K===this)throw new Error("Cannot register a disposable on itself!");return Z(K,this),this._isDisposed?N.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(K),K}}N.DISABLE_DISPOSED_WARNING=!1;class F{constructor(){this._store=new N,q(this),Z(this._store,this)}dispose(){ee(this),this._store.dispose()}_register(K){if(K===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(K)}}F.None=Object.freeze({dispose(){}});class M{constructor(){this._isDisposed=!1,q(this)}get value(){return this._isDisposed?void 0:this._value}set value(K){var b;this._isDisposed||K===this._value||((b=this._value)===null||b===void 0||b.dispose(),K&&Z(K,this),this._value=K)}clear(){this.value=void 0}dispose(){var K;this._isDisposed=!0,ee(this),(K=this._value)===null||K===void 0||K.dispose(),this._value=void 0}clearAndLeak(){const K=this._value;return this._value=void 0,K&&Z(K,null),K}}class w{constructor(K){this.object=K}dispose(){}}},34502:function(qe,xe,I){"use strict";I.d(xe,{S:function(){return Q}});class z{constructor(ne){this.element=ne,this.next=z.Undefined,this.prev=z.Undefined}}z.Undefined=new z(void 0);class Q{constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let ne=this._first;for(;ne!==z.Undefined;){const V=ne.next;ne.prev=z.Undefined,ne.next=z.Undefined,ne=V}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(ne){return this._insert(ne,!1)}push(ne){return this._insert(ne,!0)}_insert(ne,V){const q=new z(ne);if(this._first===z.Undefined)this._first=q,this._last=q;else if(V){const Z=this._last;this._last=q,q.prev=Z,Z.next=q}else{const Z=this._first;this._first=q,q.next=Z,Z.prev=q}this._size+=1;let ee=!1;return()=>{ee||(ee=!0,this._remove(q))}}shift(){if(this._first!==z.Undefined){const ne=this._first.element;return this._remove(this._first),ne}}pop(){if(this._last!==z.Undefined){const ne=this._last.element;return this._remove(this._last),ne}}_remove(ne){if(ne.prev!==z.Undefined&&ne.next!==z.Undefined){const V=ne.prev;V.next=ne.next,ne.next.prev=V}else ne.prev===z.Undefined&&ne.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):ne.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):ne.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1}*[Symbol.iterator](){let ne=this._first;for(;ne!==z.Undefined;)yield ne.element,ne=ne.next}}},23345:function(qe,xe,I){"use strict";I.d(xe,{$L:function(){return U},ED:function(){return w},IJ:function(){return K},OS:function(){return _e},WE:function(){return H},dz:function(){return k},gn:function(){return j},li:function(){return m},r:function(){return T},tY:function(){return b},xS:function(){return ce}});var z=I(97671),Q;const ae="en";let ne=!1,V=!1,q=!1,ee=!1,Z=!1,o=!1,O=!1,v,y=null,u=null,_;const m=typeof self=="object"?self:typeof I.g=="object"?I.g:{};let N;typeof m.vscode!="undefined"&&typeof m.vscode.process!="undefined"?N=m.vscode.process:typeof z!="undefined"&&(N=z);const F=typeof((Q=N==null?void 0:N.versions)===null||Q===void 0?void 0:Q.electron)=="string"&&N.type==="renderer";if(typeof navigator=="object"&&!F)_=navigator.userAgent,ne=_.indexOf("Windows")>=0,V=_.indexOf("Macintosh")>=0,O=(_.indexOf("Macintosh")>=0||_.indexOf("iPad")>=0||_.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,q=_.indexOf("Linux")>=0,o=!0,v=navigator.language,y=v;else if(typeof N=="object"){ne=N.platform==="win32",V=N.platform==="darwin",q=N.platform==="linux",ee=q&&!!N.env.SNAP&&!!N.env.SNAP_REVISION,v=ae,y=ae;const S=N.env.VSCODE_NLS_CONFIG;if(S)try{const R=JSON.parse(S),x=R.availableLanguages["*"];v=R.locale,y=x||ae,u=R._translationsConfigFile}catch(R){}Z=!0}else console.error("Unable to resolve platform.");let M=0;V?M=1:ne?M=3:q&&(M=2);const w=ne,k=V,K=q,b=Z,U=o,j=O,H=_,ce=function(){if(m.setImmediate)return m.setImmediate.bind(m);if(typeof m.postMessage=="function"&&!m.importScripts){let x=[];m.addEventListener("message",C=>{if(C.data&&C.data.vscodeSetImmediateId)for(let d=0,p=x.length;d<p;d++){const P=x[d];if(P.id===C.data.vscodeSetImmediateId){x.splice(d,1),P.callback();return}}});let $=0;return C=>{const d=++$;x.push({id:d,callback:C}),m.postMessage({vscodeSetImmediateId:d},"*")}}if(typeof(N==null?void 0:N.nextTick)=="function")return N.nextTick.bind(N);const R=Promise.resolve();return x=>R.then(x)}(),_e=V||O?2:ne?1:3;let re=!0,Y=!1;function T(){if(!Y){Y=!0;const S=new Uint8Array(2);S[0]=1,S[1]=2,re=new Uint16Array(S.buffer)[0]===513}return re}},95830:function(qe,xe,I){"use strict";I.d(xe,{G:function(){return ae}});var z=I(23345);const Q=z.li.performance&&typeof z.li.performance.now=="function";class ae{constructor(V){this._highResolution=Q&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new ae(V)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?z.li.performance.now():Date.now()}}},82983:function(qe,xe,I){"use strict";I.d(xe,{$i:function(){return se},C8:function(){return nt},GF:function(){return v},HO:function(){return $},IO:function(){return y},K7:function(){return Ge},Kw:function(){return dt},LC:function(){return m},Mh:function(){return ce},P1:function(){return _e},PJ:function(){return yt},Qe:function(){return ve},R1:function(){return O},RP:function(){return P},S6:function(){return et},TT:function(){return w},Ut:function(){return d},V8:function(){return N},WU:function(){return ae},YK:function(){return Y},YU:function(){return ne},ZG:function(){return re},ZH:function(){return S},ab:function(){return ye},c1:function(){return pt},df:function(){return U},ec:function(){return V},fi:function(){return Gt},fy:function(){return q},j3:function(){return ee},j_:function(){return K},m5:function(){return z},mK:function(){return b},mr:function(){return u},oH:function(){return Oe},oL:function(){return Z},ok:function(){return H},ow:function(){return F},qq:function(){return j},qu:function(){return M},rL:function(){return T},uS:function(){return lt},un:function(){return o},uq:function(){return _},vH:function(){return x},xe:function(){return Re},zY:function(){return k}});function z(G){return!G||typeof G!="string"?!0:G.trim().length===0}const Q=/{(\d+)}/g;function ae(G,...te){return te.length===0?G:G.replace(Q,function(ue,Ae){const Ie=parseInt(Ae,10);return isNaN(Ie)||Ie<0||Ie>=te.length?ue:te[Ie]})}function ne(G){return G.replace(/[<>&]/g,function(te){switch(te){case"<":return"<";case">":return">";case"&":return"&";default:return te}})}function V(G){return G.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function q(G,te=" "){const ue=ee(G,te);return Z(ue,te)}function ee(G,te){if(!G||!te)return G;const ue=te.length;if(ue===0||G.length===0)return G;let Ae=0;for(;G.indexOf(te,Ae)===Ae;)Ae=Ae+ue;return G.substring(Ae)}function Z(G,te){if(!G||!te)return G;const ue=te.length,Ae=G.length;if(ue===0||Ae===0)return G;let Ie=Ae,He=-1;for(;He=G.lastIndexOf(te,Ie-1),!(He===-1||He+ue!==Ie);){if(He===0)return"";Ie=He}return G.substring(0,Ie)}function o(G){return G.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function O(G){return G.replace(/\*/g,"")}function v(G,te,ue={}){if(!G)throw new Error("Cannot create regex from empty string");te||(G=V(G)),ue.wholeWord&&(/\B/.test(G.charAt(0))||(G="\\b"+G),/\B/.test(G.charAt(G.length-1))||(G=G+"\\b"));let Ae="";return ue.global&&(Ae+="g"),ue.matchCase||(Ae+="i"),ue.multiline&&(Ae+="m"),ue.unicode&&(Ae+="u"),new RegExp(G,Ae)}function y(G){return G.source==="^"||G.source==="^$"||G.source==="$"||G.source==="^\\s*$"?!1:!!(G.exec("")&&G.lastIndex===0)}function u(G){return(G.global?"g":"")+(G.ignoreCase?"i":"")+(G.multiline?"m":"")+(G.unicode?"u":"")}function _(G){return G.split(/\r\n|\r|\n/)}function m(G){for(let te=0,ue=G.length;te<ue;te++){const Ae=G.charCodeAt(te);if(Ae!==32&&Ae!==9)return te}return-1}function N(G,te=0,ue=G.length){for(let Ae=te;Ae<ue;Ae++){const Ie=G.charCodeAt(Ae);if(Ie!==32&&Ie!==9)return G.substring(te,Ae)}return G.substring(te,ue)}function F(G,te=G.length-1){for(let ue=te;ue>=0;ue--){const Ae=G.charCodeAt(ue);if(Ae!==32&&Ae!==9)return ue}return-1}function M(G,te){return G<te?-1:G>te?1:0}function w(G,te,ue=0,Ae=G.length,Ie=0,He=te.length){for(;ue<Ae&&Ie<He;ue++,Ie++){let st=G.charCodeAt(ue),Tt=te.charCodeAt(Ie);if(st<Tt)return-1;if(st>Tt)return 1}const ct=Ae-ue,gt=He-Ie;return ct<gt?-1:ct>gt?1:0}function k(G,te){return K(G,te,0,G.length,0,te.length)}function K(G,te,ue=0,Ae=G.length,Ie=0,He=te.length){for(;ue<Ae&&Ie<He;ue++,Ie++){let st=G.charCodeAt(ue),Tt=te.charCodeAt(Ie);if(st===Tt)continue;if(st>=128||Tt>=128)return w(G.toLowerCase(),te.toLowerCase(),ue,Ae,Ie,He);b(st)&&(st-=32),b(Tt)&&(Tt-=32);const wt=st-Tt;if(wt!==0)return wt}const ct=Ae-ue,gt=He-Ie;return ct<gt?-1:ct>gt?1:0}function b(G){return G>=97&&G<=122}function U(G){return G>=65&&G<=90}function j(G,te){return G.length===te.length&&K(G,te)===0}function H(G,te){const ue=te.length;return te.length>G.length?!1:K(G,te,0,ue)===0}function ce(G,te){let ue,Ae=Math.min(G.length,te.length);for(ue=0;ue<Ae;ue++)if(G.charCodeAt(ue)!==te.charCodeAt(ue))return ue;return Ae}function _e(G,te){let ue,Ae=Math.min(G.length,te.length);const Ie=G.length-1,He=te.length-1;for(ue=0;ue<Ae;ue++)if(G.charCodeAt(Ie-ue)!==te.charCodeAt(He-ue))return ue;return Ae}function re(G){return 55296<=G&&G<=56319}function Y(G){return 56320<=G&&G<=57343}function T(G,te){return(G-55296<<10)+(te-56320)+65536}function S(G,te,ue){const Ae=G.charCodeAt(ue);if(re(Ae)&&ue+1<te){const Ie=G.charCodeAt(ue+1);if(Y(Ie))return T(Ae,Ie)}return Ae}function R(G,te){const ue=G.charCodeAt(te-1);if(Y(ue)&&te>1){const Ae=G.charCodeAt(te-2);if(re(Ae))return T(Ae,ue)}return ue}function x(G,te){const ue=it.getInstance(),Ae=te,Ie=G.length,He=S(G,Ie,te);te+=He>=65536?2:1;let ct=ue.getGraphemeBreakType(He);for(;te<Ie;){const gt=S(G,Ie,te),st=ue.getGraphemeBreakType(gt);if(Gt(ct,st))break;te+=gt>=65536?2:1,ct=st}return te-Ae}function $(G,te){const ue=it.getInstance(),Ae=te,Ie=R(G,te);te-=Ie>=65536?2:1;let He=ue.getGraphemeBreakType(Ie);for(;te>0;){const ct=R(G,te),gt=ue.getGraphemeBreakType(ct);if(Gt(gt,He))break;te-=ct>=65536?2:1,He=gt}return Ae-te}const C=/(?:[\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 d(G){return C.test(G)}const p=/(?:[\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 P(G){return p.test(G)}const W=/^[\t\n\r\x20-\x7E]*$/;function se(G){return W.test(G)}const ve=/[\u2028\u2029]/;function ye(G){return ve.test(G)}function Re(G){for(let te=0,ue=G.length;te<ue;te++)if(Ge(G.charCodeAt(te)))return!0;return!1}function Ge(G){return G=+G,G>=11904&&G<=55215||G>=63744&&G<=64255||G>=65281&&G<=65374}function nt(G){return G>=127462&&G<=127487||G===8986||G===8987||G===9200||G===9203||G>=9728&&G<=10175||G===11088||G===11093||G>=127744&&G<=128591||G>=128640&&G<=128764||G>=128992&&G<=129003||G>=129280&&G<=129535||G>=129648&&G<=129750}const pt="\uFEFF";function lt(G){return!!(G&&G.length>0&&G.charCodeAt(0)===65279)}function dt(G,te=!1){return G?(te&&(G=G.replace(/\\./g,"")),G.toLowerCase()!==G):!1}function yt(G){return G=G%(2*26),G<26?String.fromCharCode(97+G):String.fromCharCode(65+G-26)}function et(G){return it.getInstance().getGraphemeBreakType(G)}function Gt(G,te){return G===0?te!==5&&te!==7:G===2&&te===3?!1:G===4||G===2||G===3||te===4||te===2||te===3?!0:!(G===8&&(te===8||te===9||te===11||te===12)||(G===11||G===9)&&(te===9||te===10)||(G===12||G===10)&&te===10||te===5||te===13||te===7||G===1||G===13&&te===14||G===6&&te===6)}class it{constructor(){this._data=he()}static getInstance(){return it._INSTANCE||(it._INSTANCE=new it),it._INSTANCE}getGraphemeBreakType(te){if(te<32)return te===10?3:te===13?2:4;if(te<127)return 0;const ue=this._data,Ae=ue.length/3;let Ie=1;for(;Ie<=Ae;)if(te<ue[3*Ie])Ie=2*Ie;else if(te>ue[3*Ie+1])Ie=2*Ie+1;else return ue[3*Ie+2];return 0}}it._INSTANCE=null;function he(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Oe(G,te){if(G===0)return 0;const ue=pe(G,te);if(ue!==void 0)return ue;const Ae=R(te,G);return G-=Me(Ae),G}function pe(G,te){let ue=R(te,G);for(G-=Me(ue);$e(ue)||ue===65039||ue===8419;){if(G===0)return;ue=R(te,G),G-=Me(ue)}if(nt(ue)){if(G>=0){const Ae=R(te,G);Ae===8205&&(G-=Me(Ae))}return G}}function Me(G){return G>=65536?2:1}function $e(G){return 127995<=G&&G<=127999}},72999:function(qe,xe,I){"use strict";I.d(xe,{$E:function(){return m},$K:function(){return ee},D8:function(){return y},HD:function(){return Q},IU:function(){return N},Jp:function(){return Z},Kn:function(){return ae},cW:function(){return O},f6:function(){return F},hj:function(){return ne},jn:function(){return V},kJ:function(){return z},mf:function(){return v},o8:function(){return q},p_:function(){return o},vE:function(){return M}});function z(w){return Array.isArray(w)}function Q(w){return typeof w=="string"}function ae(w){return typeof w=="object"&&w!==null&&!Array.isArray(w)&&!(w instanceof RegExp)&&!(w instanceof Date)}function ne(w){return typeof w=="number"&&!isNaN(w)}function V(w){return w===!0||w===!1}function q(w){return typeof w=="undefined"}function ee(w){return!Z(w)}function Z(w){return q(w)||w===null}function o(w,k){if(!w)throw new Error(k?`Unexpected type, expected '${k}'`:"Unexpected type")}function O(w){if(Z(w))throw new Error("Assertion Failed: argument is undefined or null");return w}function v(w){return typeof w=="function"}function y(w,k){const K=Math.min(w.length,k.length);for(let b=0;b<K;b++)u(w[b],k[b])}function u(w,k){if(Q(k)){if(typeof w!==k)throw new Error(`argument does not match constraint: typeof ${k}`)}else if(v(k)){try{if(w instanceof k)return}catch(K){}if(!Z(w)&&w.constructor===k||k.length===1&&k.call(void 0,w)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function _(w){let k=[],K=Object.getPrototypeOf(w);for(;Object.prototype!==K;)k=k.concat(Object.getOwnPropertyNames(K)),K=Object.getPrototypeOf(K);return k}function m(w){const k=[];for(const K of _(w))typeof w[K]=="function"&&k.push(K);return k}function N(w,k){const K=U=>function(){const j=Array.prototype.slice.call(arguments,0);return k(U,j)};let b={};for(const U of w)b[U]=K(U);return b}function F(w){return w===null?void 0:w}function M(w,k="Unreachable"){throw new Error(k)}},13268:function(qe,xe,I){"use strict";I.d(xe,{N:function(){return Q}});function z(ae,ne){let V;return ne.length===0?V=ae:V=ae.replace(/\{(\d+)\}/g,function(q,ee){const Z=ee[0];return typeof ne[Z]!="undefined"?ne[Z]:q}),V}function Q(ae,ne,...V){return z(ne,V)}},96236:function(qe,xe,I){"use strict";I.d(xe,{BH:function(){return N},NZ:function(){return F},U8:function(){return M},co:function(){return m},eH:function(){return _},vr:function(){return u}});var z=I(75918),Q=I(52615),ae=I(4348),ne=I(88226),V=I(69323),q=I(34502),ee=I(35884),Z=I(90689),o=I(16925),O=I(49055),v=function(w,k,K,b){var U=arguments.length,j=U<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,K):b,H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,k,K,b);else for(var ce=w.length-1;ce>=0;ce--)(H=w[ce])&&(j=(U<3?H(j):U>3?H(k,K,j):H(k,K))||j);return U>3&&j&&Object.defineProperty(k,K,j),j},y=function(w,k){return function(K,b){k(K,b,w)}};function u(w){return w.command!==void 0}class _{constructor(k){this.id=_._idPool++,this._debugName=k}}_._idPool=0,_.CommandPalette=new _("CommandPalette"),_.EditorContext=new _("EditorContext"),_.SimpleEditorContext=new _("SimpleEditorContext"),_.EditorContextCopy=new _("EditorContextCopy"),_.EditorContextPeek=new _("EditorContextPeek"),_.MenubarEditMenu=new _("MenubarEditMenu"),_.MenubarCopy=new _("MenubarCopy"),_.MenubarGoMenu=new _("MenubarGoMenu"),_.MenubarSelectionMenu=new _("MenubarSelectionMenu"),_.InlineCompletionsActions=new _("InlineCompletionsActions");const m=(0,o.yh)("menuService"),N=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ae.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:w=>w===_.CommandPalette}}addCommand(w){return this.addCommands(ne.$.single(w))}addCommands(w){for(const k of w)this._commands.set(k.id,k);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,V.OF)(()=>{let k=!1;for(const K of w)k=this._commands.delete(K.id)||k;k&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(w){return this._commands.get(w)}getCommands(){const w=new Map;return this._commands.forEach((k,K)=>w.set(K,k)),w}appendMenuItem(w,k){return this.appendMenuItems(ne.$.single({id:w,item:k}))}appendMenuItems(w){const k=new Set,K=new q.S;for(const{id:b,item:U}of w){let j=this._menuItems.get(b);j||(j=new q.S,this._menuItems.set(b,j)),K.push(j.push(U)),k.add(b)}return this._onDidChangeMenu.fire(k),(0,V.OF)(()=>{if(K.size>0){for(let b of K)b();this._onDidChangeMenu.fire(k),K.clear()}})}getMenuItems(w){let k;return this._menuItems.has(w)?k=[...this._menuItems.get(w)]:k=[],w===_.CommandPalette&&this._appendImplicitItems(k),k}_appendImplicitItems(w){const k=new Set;for(const K of w)u(K)&&(k.add(K.command.id),K.alt&&k.add(K.alt.id));this._commands.forEach((K,b)=>{k.has(b)||w.push({command:K})})}};class F extends z.wY{constructor(k,K,b,U){super(`submenuitem.${k.submenu.id}`,typeof k.title=="string"?k.title:k.title.value,[],"submenu"),this.item=k,this._menuService=K,this._contextKeyService=b,this._options=U}get actions(){const k=[],K=this._menuService.createMenu(this.item.submenu,this._contextKeyService),b=K.getActions(this._options);K.dispose();for(const[,U]of b)U.length>0&&(k.push(...U),k.push(new z.Z0));return k.length&&k.pop(),k}}let M=class Ya{constructor(k,K,b,U,j){var H,ce;if(this._commandService=j,this.id=k.id,this.label=b!=null&&b.renderShortTitle&&k.shortTitle?typeof k.shortTitle=="string"?k.shortTitle:k.shortTitle.value:typeof k.title=="string"?k.title:k.title.value,this.tooltip=(ce=typeof k.tooltip=="string"?k.tooltip:(H=k.tooltip)===null||H===void 0?void 0:H.value)!==null&&ce!==void 0?ce:"",this.enabled=!k.precondition||U.contextMatchesRules(k.precondition),this.checked=void 0,k.toggled){const _e=k.toggled.condition?k.toggled:{condition:k.toggled};this.checked=U.contextMatchesRules(_e.condition),this.checked&&_e.tooltip&&(this.tooltip=typeof _e.tooltip=="string"?_e.tooltip:_e.tooltip.value),_e.title&&(this.label=typeof _e.title=="string"?_e.title:_e.title.value)}this.item=k,this.alt=K?new Ya(K,void 0,b,U,j):void 0,this._options=b,O.kS.isThemeIcon(k.icon)&&(this.class=Q.dT.asClassName(k.icon))}dispose(){}run(...k){var K,b;let U=[];return!((K=this._options)===null||K===void 0)&&K.arg&&(U=[...U,this._options.arg]),!((b=this._options)===null||b===void 0)&&b.shouldForwardArgs&&(U=[...U,...k]),this._commandService.executeCommand(this.id,...U)}};M=v([y(3,Z.i6),y(4,ee.H)],M)},35884:function(qe,xe,I){"use strict";I.d(xe,{H:function(){return ee},P:function(){return Z}});var z=I(4348),Q=I(88226),ae=I(69323),ne=I(34502),V=I(72999),q=I(16925);const ee=(0,q.yh)("commandService"),Z=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new z.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,O){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!O)throw new Error("invalid command");return this.registerCommand({id:o,handler:O})}if(o.description){const m=[];for(let F of o.description.args)m.push(F.constraint);const N=o.handler;o.handler=function(F,...M){return(0,V.D8)(M,m),N(F,...M)}}const{id:v}=o;let y=this._commands.get(v);y||(y=new ne.S,this._commands.set(v,y));let u=y.unshift(o),_=(0,ae.OF)(()=>{u();const m=this._commands.get(v);m!=null&&m.isEmpty()&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),_}registerCommandAlias(o,O){return Z.registerCommand(o,(v,...y)=>v.get(ee).executeCommand(O,...y))}getCommand(o){const O=this._commands.get(o);if(!(!O||O.isEmpty()))return Q.$.first(O)}getCommands(){const o=new Map;for(const O of this._commands.keys()){const v=this.getCommand(O);v&&o.set(O,v)}return o}};Z.registerCommand("noop",()=>{})},90689:function(qe,xe,I){"use strict";I.d(xe,{Ao:function(){return ee},Eq:function(){return T},Fb:function(){return Z},K8:function(){return x},i6:function(){return Y},uy:function(){return re}});var z=I(23345),Q=I(82983),ae=I(16925);let ne=z.WE||"";const V=new Map;V.set("false",!1),V.set("true",!0),V.set("isMac",z.dz),V.set("isLinux",z.IJ),V.set("isWindows",z.ED),V.set("isWeb",z.$L),V.set("isMacNative",z.dz&&!z.$L),V.set("isEdge",ne.indexOf("Edg/")>=0),V.set("isFirefox",ne.indexOf("Firefox")>=0),V.set("isChrome",ne.indexOf("Chrome")>=0),V.set("isSafari",ne.indexOf("Safari")>=0);const q=Object.prototype.hasOwnProperty;class ee{static has(d){return y.create(d)}static equals(d,p){return u.create(d,p)}static regex(d,p){return U.create(d,p)}static not(d){return F.create(d)}static and(...d){return ce.create(d,null)}static or(...d){return _e.create(d,null,!0)}static deserialize(d,p=!1){if(d)return this._deserializeOrExpression(d,p)}static _deserializeOrExpression(d,p){let P=d.split("||");return _e.create(P.map(W=>this._deserializeAndExpression(W,p)),null,!0)}static _deserializeAndExpression(d,p){let P=d.split("&&");return ce.create(P.map(W=>this._deserializeOne(W,p)),null)}static _deserializeOne(d,p){if(d=d.trim(),d.indexOf("!=")>=0){let P=d.split("!=");return N.create(P[0].trim(),this._deserializeValue(P[1],p))}if(d.indexOf("==")>=0){let P=d.split("==");return u.create(P[0].trim(),this._deserializeValue(P[1],p))}if(d.indexOf("=~")>=0){let P=d.split("=~");return U.create(P[0].trim(),this._deserializeRegexValue(P[1],p))}if(d.indexOf(" in ")>=0){let P=d.split(" in ");return _.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(d)){const P=d.split(">=");return k.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(d)){const P=d.split(">");return w.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(d)){const P=d.split("<=");return b.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(d)){const P=d.split("<");return K.create(P[0].trim(),P[1].trim())}return/^\!\s*/.test(d)?F.create(d.substr(1).trim()):y.create(d)}static _deserializeValue(d,p){if(d=d.trim(),d==="true")return!0;if(d==="false")return!1;let P=/^'([^']*)'$/.exec(d);return P?P[1].trim():d}static _deserializeRegexValue(d,p){if((0,Q.m5)(d)){if(p)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let P=d.indexOf("/"),W=d.lastIndexOf("/");if(P===W||P<0){if(p)throw new Error(`bad regexp-value '${d}', missing /-enclosure`);return console.warn(`bad regexp-value '${d}', missing /-enclosure`),null}let se=d.slice(P+1,W),ve=d[W+1]==="i"?"i":"";try{return new RegExp(se,ve)}catch(ye){if(p)throw new Error(`bad regexp-value '${d}', parse error: ${ye}`);return console.warn(`bad regexp-value '${d}', parse error: ${ye}`),null}}}function Z(C,d){const p=C?C.substituteConstants():void 0,P=d?d.substituteConstants():void 0;return!p&&!P?!0:!p||!P?!1:p.equals(P)}function o(C,d){return C.cmp(d)}class O{constructor(){this.type=0}cmp(d){return this.type-d.type}equals(d){return d.type===this.type}substituteConstants(){return this}evaluate(d){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}O.INSTANCE=new O;class v{constructor(){this.type=1}cmp(d){return this.type-d.type}equals(d){return d.type===this.type}substituteConstants(){return this}evaluate(d){return!0}serialize(){return"true"}keys(){return[]}negate(){return O.INSTANCE}}v.INSTANCE=new v;class y{constructor(d,p){this.key=d,this.negated=p,this.type=2}static create(d,p=null){const P=V.get(d);return typeof P=="boolean"?P?v.INSTANCE:O.INSTANCE:new y(d,p)}cmp(d){return d.type!==this.type?this.type-d.type:S(this.key,d.key)}equals(d){return d.type===this.type?this.key===d.key:!1}substituteConstants(){const d=V.get(this.key);return typeof d=="boolean"?d?v.INSTANCE:O.INSTANCE:this}evaluate(d){return!!d.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=F.create(this.key,this)),this.negated}}class u{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=4}static create(d,p,P=null){if(typeof p=="boolean")return p?y.create(d,P):F.create(d,P);const W=V.get(d);return typeof W=="boolean"?p===(W?"true":"false")?v.INSTANCE:O.INSTANCE:new u(d,p,P)}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){const d=V.get(this.key);if(typeof d=="boolean"){const p=d?"true":"false";return this.value===p?v.INSTANCE:O.INSTANCE}return this}evaluate(d){return d.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=N.create(this.key,this.value,this)),this.negated}}class _{constructor(d,p){this.key=d,this.valueKey=p,this.type=10,this.negated=null}static create(d,p){return new _(d,p)}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.valueKey,d.key,d.valueKey)}equals(d){return d.type===this.type?this.key===d.key&&this.valueKey===d.valueKey:!1}substituteConstants(){return this}evaluate(d){const p=d.getValue(this.valueKey),P=d.getValue(this.key);return Array.isArray(p)?p.indexOf(P)>=0:typeof P=="string"&&typeof p=="object"&&p!==null?q.call(p,P):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=m.create(this)),this.negated}}class m{constructor(d){this._actual=d,this.type=11}static create(d){return new m(d)}cmp(d){return d.type!==this.type?this.type-d.type:this._actual.cmp(d._actual)}equals(d){return d.type===this.type?this._actual.equals(d._actual):!1}substituteConstants(){return this}evaluate(d){return!this._actual.evaluate(d)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class N{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=5}static create(d,p,P=null){if(typeof p=="boolean")return p?F.create(d,P):y.create(d,P);const W=V.get(d);return typeof W=="boolean"?p===(W?"true":"false")?O.INSTANCE:v.INSTANCE:new N(d,p,P)}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){const d=V.get(this.key);if(typeof d=="boolean"){const p=d?"true":"false";return this.value===p?O.INSTANCE:v.INSTANCE}return this}evaluate(d){return d.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 F{constructor(d,p){this.key=d,this.negated=p,this.type=3}static create(d,p=null){const P=V.get(d);return typeof P=="boolean"?P?O.INSTANCE:v.INSTANCE:new F(d,p)}cmp(d){return d.type!==this.type?this.type-d.type:S(this.key,d.key)}equals(d){return d.type===this.type?this.key===d.key:!1}substituteConstants(){const d=V.get(this.key);return typeof d=="boolean"?d?O.INSTANCE:v.INSTANCE:this}evaluate(d){return!d.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this)),this.negated}}function M(C,d){if(typeof C=="string"){const p=parseFloat(C);isNaN(p)||(C=p)}return typeof C=="string"||typeof C=="number"?d(C):O.INSTANCE}class w{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=12}static create(d,p,P=null){return M(p,W=>new w(d,W,P))}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){return this}evaluate(d){return typeof this.value=="string"?!1:parseFloat(d.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class k{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=13}static create(d,p,P=null){return M(p,W=>new k(d,W,P))}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){return this}evaluate(d){return typeof this.value=="string"?!1:parseFloat(d.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=K.create(this.key,this.value,this)),this.negated}}class K{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=14}static create(d,p,P=null){return M(p,W=>new K(d,W,P))}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){return this}evaluate(d){return typeof this.value=="string"?!1:parseFloat(d.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class b{constructor(d,p,P){this.key=d,this.value=p,this.negated=P,this.type=15}static create(d,p,P=null){return M(p,W=>new b(d,W,P))}cmp(d){return d.type!==this.type?this.type-d.type:R(this.key,this.value,d.key,d.value)}equals(d){return d.type===this.type?this.key===d.key&&this.value===d.value:!1}substituteConstants(){return this}evaluate(d){return typeof this.value=="string"?!1:parseFloat(d.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 U{constructor(d,p){this.key=d,this.regexp=p,this.type=7,this.negated=null}static create(d,p){return new U(d,p)}cmp(d){if(d.type!==this.type)return this.type-d.type;if(this.key<d.key)return-1;if(this.key>d.key)return 1;const p=this.regexp?this.regexp.source:"",P=d.regexp?d.regexp.source:"";return p<P?-1:p>P?1:0}equals(d){if(d.type===this.type){const p=this.regexp?this.regexp.source:"",P=d.regexp?d.regexp.source:"";return this.key===d.key&&p===P}return!1}substituteConstants(){return this}evaluate(d){let p=d.getValue(this.key);return this.regexp?this.regexp.test(p):!1}serialize(){const d=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${d}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=j.create(this)),this.negated}}class j{constructor(d){this._actual=d,this.type=8}static create(d){return new j(d)}cmp(d){return d.type!==this.type?this.type-d.type:this._actual.cmp(d._actual)}equals(d){return d.type===this.type?this._actual.equals(d._actual):!1}substituteConstants(){return this}evaluate(d){return!this._actual.evaluate(d)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function H(C){let d=null;for(let p=0,P=C.length;p<P;p++){const W=C[p].substituteConstants();if(C[p]!==W&&d===null){d=[];for(let se=0;se<p;se++)d[se]=C[se]}d!==null&&(d[p]=W)}return d===null?C:d}class ce{constructor(d,p){this.expr=d,this.negated=p,this.type=6}static create(d,p){return ce._normalizeArr(d,p)}cmp(d){if(d.type!==this.type)return this.type-d.type;if(this.expr.length<d.expr.length)return-1;if(this.expr.length>d.expr.length)return 1;for(let p=0,P=this.expr.length;p<P;p++){const W=o(this.expr[p],d.expr[p]);if(W!==0)return W}return 0}equals(d){if(d.type===this.type){if(this.expr.length!==d.expr.length)return!1;for(let p=0,P=this.expr.length;p<P;p++)if(!this.expr[p].equals(d.expr[p]))return!1;return!0}return!1}substituteConstants(){const d=H(this.expr);return d===this.expr?this:ce.create(d,this.negated)}evaluate(d){for(let p=0,P=this.expr.length;p<P;p++)if(!this.expr[p].evaluate(d))return!1;return!0}static _normalizeArr(d,p){const P=[];let W=!1;for(const se of d)if(se){if(se.type===1){W=!0;continue}if(se.type===0)return O.INSTANCE;if(se.type===6){P.push(...se.expr);continue}P.push(se)}if(P.length===0&&W)return v.INSTANCE;if(P.length!==0){if(P.length===1)return P[0];P.sort(o);for(let se=1;se<P.length;se++)P[se-1].equals(P[se])&&(P.splice(se,1),se--);if(P.length===1)return P[0];for(;P.length>1;){const se=P[P.length-1];if(se.type!==9)break;P.pop();const ve=P.pop(),ye=P.length===0,Re=_e.create(se.expr.map(Ge=>ce.create([Ge,ve],null)),null,ye);Re&&(P.push(Re),P.sort(o))}return P.length===1?P[0]:new ce(P,p)}}serialize(){return this.expr.map(d=>d.serialize()).join(" && ")}keys(){const d=[];for(let p of this.expr)d.push(...p.keys());return d}negate(){if(!this.negated){const d=[];for(let p of this.expr)d.push(p.negate());this.negated=_e.create(d,this,!0)}return this.negated}}class _e{constructor(d,p){this.expr=d,this.negated=p,this.type=9}static create(d,p,P){return _e._normalizeArr(d,p,P)}cmp(d){if(d.type!==this.type)return this.type-d.type;if(this.expr.length<d.expr.length)return-1;if(this.expr.length>d.expr.length)return 1;for(let p=0,P=this.expr.length;p<P;p++){const W=o(this.expr[p],d.expr[p]);if(W!==0)return W}return 0}equals(d){if(d.type===this.type){if(this.expr.length!==d.expr.length)return!1;for(let p=0,P=this.expr.length;p<P;p++)if(!this.expr[p].equals(d.expr[p]))return!1;return!0}return!1}substituteConstants(){const d=H(this.expr);return d===this.expr?this:_e.create(d,this.negated,!1)}evaluate(d){for(let p=0,P=this.expr.length;p<P;p++)if(this.expr[p].evaluate(d))return!0;return!1}static _normalizeArr(d,p,P){let W=[],se=!1;if(d){for(let ve=0,ye=d.length;ve<ye;ve++){const Re=d[ve];if(Re){if(Re.type===0){se=!0;continue}if(Re.type===1)return v.INSTANCE;if(Re.type===9){W=W.concat(Re.expr);continue}W.push(Re)}}if(W.length===0&&se)return O.INSTANCE;W.sort(o)}if(W.length!==0){if(W.length===1)return W[0];for(let ve=1;ve<W.length;ve++)W[ve-1].equals(W[ve])&&(W.splice(ve,1),ve--);if(W.length===1)return W[0];if(P){for(let ve=0;ve<W.length;ve++)for(let ye=ve+1;ye<W.length;ye++)x(W[ve],W[ye])&&(W.splice(ye,1),ye--);if(W.length===1)return W[0]}return new _e(W,p)}}serialize(){return this.expr.map(d=>d.serialize()).join(" || ")}keys(){const d=[];for(let p of this.expr)d.push(...p.keys());return d}negate(){if(!this.negated){let d=[];for(let p of this.expr)d.push(p.negate());for(;d.length>1;){const p=d.shift(),P=d.shift(),W=[];for(const ve of $(p))for(const ye of $(P))W.push(ce.create([ve,ye],null));const se=d.length===0;d.unshift(_e.create(W,null,se))}this.negated=d[0]}return this.negated}}class re extends y{constructor(d,p,P){super(d,null),this._defaultValue=p,typeof P=="object"?re._info.push(Object.assign(Object.assign({},P),{key:d})):P!==!0&&re._info.push({key:d,description:P,type:p!=null?typeof p:void 0})}static all(){return re._info.values()}bindTo(d){return d.createKey(this.key,this._defaultValue)}getValue(d){return d.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(d){return u.create(this.key,d)}}re._info=[];const Y=(0,ae.yh)("contextKeyService"),T="setContext";function S(C,d){return C<d?-1:C>d?1:0}function R(C,d,p,P){return C<p?-1:C>p?1:d<P?-1:d>P?1:0}function x(C,d){if(d.type===6&&C.type!==9&&C.type!==6){for(const W of d.expr)if(C.equals(W))return!0}const p=C.negate(),P=$(p).concat($(d));P.sort(o);for(let W=0;W<P.length;W++){const ve=P[W].negate();for(let ye=W+1;ye<P.length;ye++){const Re=P[ye];if(ve.equals(Re))return!0}}return!1}function $(C){return C.type===9?C.expr:[C]}},16925:function(qe,xe,I){"use strict";I.d(xe,{I8:function(){return z},TG:function(){return Q},jt:function(){return V},yh:function(){return ne}});var z;(function(q){q.serviceIds=new Map,q.DI_TARGET="$di$target",q.DI_DEPENDENCIES="$di$dependencies";function ee(Z){return Z[q.DI_DEPENDENCIES]||[]}q.getServiceDependencies=ee})(z||(z={}));const Q=ne("instantiationService");function ae(q,ee,Z,o){ee[z.DI_TARGET]===ee?ee[z.DI_DEPENDENCIES].push({id:q,index:Z,optional:o}):(ee[z.DI_DEPENDENCIES]=[{id:q,index:Z,optional:o}],ee[z.DI_TARGET]=ee)}function ne(q){if(z.serviceIds.has(q))return z.serviceIds.get(q);const ee=function(Z,o,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ae(ee,Z,O,!1)};return ee.toString=()=>q,z.serviceIds.set(q,ee),ee}function V(q){return function(ee,Z,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ae(q,ee,o,!0)}}},44650:function(qe,xe,I){"use strict";I.d(xe,{B:function(){return ne}});var z=I(76068),Q=I(72999);class ae{constructor(){this.data=new Map}add(q,ee){z.ok(Q.HD(q)),z.ok(Q.Kn(ee)),z.ok(!this.data.has(q),"There is already an extension with this id"),this.data.set(q,ee)}as(q){return this.data.get(q)||null}}const ne=new ae},66213:function(qe,xe,I){"use strict";I.d(xe,{e:function(){return z}});var z;(function(Q){Q.DARK="dark",Q.LIGHT="light",Q.HIGH_CONTRAST="hc"})(z||(z={}))},49055:function(qe,xe,I){"use strict";I.d(xe,{EN:function(){return o},IP:function(){return y},Ic:function(){return m},XE:function(){return ee},bB:function(){return N},kS:function(){return O},m6:function(){return v}});var z=I(52615),Q=I(4348),ae=I(69323),ne=I(16925),V=I(44650),q=I(66213);const ee=(0,ne.yh)("themeService");var Z;(function(F){function M(w){return w&&typeof w=="object"&&typeof w.id=="string"}F.isThemeColor=M})(Z||(Z={}));function o(F){return{id:F}}var O;(function(F){function M(j){return j&&typeof j=="object"&&typeof j.id=="string"&&(typeof j.color=="undefined"||Z.isThemeColor(j.color))}F.isThemeIcon=M;const w=new RegExp(`^\\$\\((${z.dT.iconNameExpression}(?:${z.dT.iconModifierExpression})?)\\)$`);function k(j){const H=w.exec(j);if(!H)return;let[,ce]=H;return{id:ce}}F.fromString=k;function K(j,H){let ce=j.id;const _e=ce.lastIndexOf("~");return _e!==-1&&(ce=ce.substring(0,_e)),H&&(ce=`${ce}~${H}`),{id:ce}}F.modify=K;function b(j,H){var ce,_e;return j.id===H.id&&((ce=j.color)===null||ce===void 0?void 0:ce.id)===((_e=H.color)===null||_e===void 0?void 0:_e.id)}F.isEqual=b;function U(j,H){return{id:j.id,color:H?o(H):void 0}}F.asThemeIcon=U,F.asClassNameArray=z.dT.asClassNameArray,F.asClassName=z.dT.asClassName,F.asCSSSelector=z.dT.asCSSSelector})(O||(O={}));function v(F){switch(F){case q.e.DARK:return"vs-dark";case q.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const y={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Q.Q5}onColorThemeChange(M){return this.themingParticipants.push(M),this.onThemingParticipantAddedEmitter.fire(M),(0,ae.OF)(()=>{const w=this.themingParticipants.indexOf(M);this.themingParticipants.splice(w,1)})}getThemingParticipants(){return this.themingParticipants}}let _=new u;V.B.add(y.ThemingContribution,_);function m(F){return _.onColorThemeChange(F)}class N extends ae.JT{constructor(M){super(),this.themeService=M,this.theme=M.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(w=>this.onThemeChange(w)))}onThemeChange(M){this.theme=M,this.updateStyles()}updateStyles(){}}},31561:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return j}});var z=I(96663),Q=I(90493),ae=I(72071),ne=I(6620),V=I(35593),q=I(92310),ee=I.n(q),Z=I(8654),o=I(59301),O=I(10228),v=I(16089),y=O.Z.ESC,u=O.Z.TAB;function _(H){var ce=H.visible,_e=H.triggerRef,re=H.onVisibleChange,Y=H.autoFocus,T=H.overlayRef,S=o.useRef(!1),R=function(){if(ce){var d,p;(d=_e.current)===null||d===void 0||(p=d.focus)===null||p===void 0||p.call(d),re==null||re(!1)}},x=function(){var d;return(d=T.current)!==null&&d!==void 0&&d.focus?(T.current.focus(),S.current=!0,!0):!1},$=function(d){switch(d.keyCode){case y:R();break;case u:{var p=!1;S.current||(p=x()),p?d.preventDefault():R();break}}};o.useEffect(function(){return ce?(window.addEventListener("keydown",$),Y&&(0,v.Z)(x,3),function(){window.removeEventListener("keydown",$),S.current=!1}):function(){S.current=!1}},[ce])}var m=(0,o.forwardRef)(function(H,ce){var _e=H.overlay,re=H.arrow,Y=H.prefixCls,T=(0,o.useMemo)(function(){var R;return typeof _e=="function"?R=_e():R=_e,R},[_e]),S=(0,Z.sQ)(ce,T==null?void 0:T.ref);return o.createElement(o.Fragment,null,re&&o.createElement("div",{className:"".concat(Y,"-arrow")}),o.cloneElement(T,{ref:(0,Z.Yr)(T)?S:void 0}))}),N=m,F={adjustX:1,adjustY:1},M=[0,0],w={topLeft:{points:["bl","tl"],overflow:F,offset:[0,-4],targetOffset:M},top:{points:["bc","tc"],overflow:F,offset:[0,-4],targetOffset:M},topRight:{points:["br","tr"],overflow:F,offset:[0,-4],targetOffset:M},bottomLeft:{points:["tl","bl"],overflow:F,offset:[0,4],targetOffset:M},bottom:{points:["tc","bc"],overflow:F,offset:[0,4],targetOffset:M},bottomRight:{points:["tr","br"],overflow:F,offset:[0,4],targetOffset:M}},k=w,K=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function b(H,ce){var _e,re=H.arrow,Y=re===void 0?!1:re,T=H.prefixCls,S=T===void 0?"rc-dropdown":T,R=H.transitionName,x=H.animation,$=H.align,C=H.placement,d=C===void 0?"bottomLeft":C,p=H.placements,P=p===void 0?k:p,W=H.getPopupContainer,se=H.showAction,ve=H.hideAction,ye=H.overlayClassName,Re=H.overlayStyle,Ge=H.visible,nt=H.trigger,pt=nt===void 0?["hover"]:nt,lt=H.autoFocus,dt=H.overlay,yt=H.children,et=H.onVisibleChange,Gt=(0,ne.Z)(H,K),it=o.useState(),he=(0,ae.Z)(it,2),Oe=he[0],pe=he[1],Me="visible"in H?Ge:Oe,$e=o.useRef(null),G=o.useRef(null),te=o.useRef(null);o.useImperativeHandle(ce,function(){return $e.current});var ue=function(At){pe(At),et==null||et(At)};_({visible:Me,triggerRef:te,onVisibleChange:ue,autoFocus:lt,overlayRef:G});var Ae=function(At){var Ct=H.onOverlayClick;pe(!1),Ct&&Ct(At)},Ie=function(){return o.createElement(N,{ref:G,overlay:dt,prefixCls:S,arrow:Y})},He=function(){return typeof dt=="function"?Ie:Ie()},ct=function(){var At=H.minOverlayWidthMatchTrigger,Ct=H.alignPoint;return"minOverlayWidthMatchTrigger"in H?At:!Ct},gt=function(){var At=H.openClassName;return At!==void 0?At:"".concat(S,"-open")},st=o.cloneElement(yt,{className:ee()((_e=yt.props)===null||_e===void 0?void 0:_e.className,Me&>()),ref:(0,Z.Yr)(yt)?(0,Z.sQ)(te,yt.ref):void 0}),Tt=ve;return!Tt&&pt.indexOf("contextMenu")!==-1&&(Tt=["click"]),o.createElement(V.Z,(0,z.Z)({builtinPlacements:P},Gt,{prefixCls:S,ref:$e,popupClassName:ee()(ye,(0,Q.Z)({},"".concat(S,"-show-arrow"),Y)),popupStyle:Re,action:pt,showAction:se,hideAction:Tt,popupPlacement:d,popupAlign:$,popupTransitionName:R,popupAnimation:x,popupVisible:Me,stretch:ct()?"minWidth":"",popup:He(),onPopupVisibleChange:ue,onPopupClick:Ae,getPopupContainer:W}),st)}var U=o.forwardRef(b),j=U},93681:function(qe,xe,I){"use strict";I.r(xe),I.d(xe,{BaseInput:function(){return O},default:function(){return w}});var z=I(96663),Q=I(44127),ae=I(90493),ne=I(20135),V=I(92310),q=I.n(V),ee=I(59301),Z=I(5643),o=function(K){var b,U,j=K.inputElement,H=K.prefixCls,ce=K.prefix,_e=K.suffix,re=K.addonBefore,Y=K.addonAfter,T=K.className,S=K.style,R=K.disabled,x=K.readOnly,$=K.focused,C=K.triggerFocus,d=K.allowClear,p=K.value,P=K.handleReset,W=K.hidden,se=K.classes,ve=K.classNames,ye=K.dataAttrs,Re=K.styles,Ge=K.components,nt=(Ge==null?void 0:Ge.affixWrapper)||"span",pt=(Ge==null?void 0:Ge.groupWrapper)||"span",lt=(Ge==null?void 0:Ge.wrapper)||"span",dt=(Ge==null?void 0:Ge.groupAddon)||"span",yt=(0,ee.useRef)(null),et=function(Ie){var He;(He=yt.current)!==null&&He!==void 0&&He.contains(Ie.target)&&(C==null||C())},Gt=function(){var Ie;if(!d)return null;var He=!R&&!x&&p,ct="".concat(H,"-clear-icon"),gt=(0,ne.Z)(d)==="object"&&d!==null&&d!==void 0&&d.clearIcon?d.clearIcon:"\u2716";return ee.createElement("span",{onClick:P,onMouseDown:function(Tt){return Tt.preventDefault()},className:q()(ct,(Ie={},(0,ae.Z)(Ie,"".concat(ct,"-hidden"),!He),(0,ae.Z)(Ie,"".concat(ct,"-has-suffix"),!!_e),Ie)),role:"button",tabIndex:-1},gt)},it=(0,ee.cloneElement)(j,{value:p,hidden:W,className:q()((b=j.props)===null||b===void 0?void 0:b.className,!(0,Z.X3)(K)&&!(0,Z.He)(K)&&T)||null,style:(0,Q.Z)((0,Q.Z)({},(U=j.props)===null||U===void 0?void 0:U.style),!(0,Z.X3)(K)&&!(0,Z.He)(K)?S:{})});if((0,Z.X3)(K)){var he,Oe="".concat(H,"-affix-wrapper"),pe=q()(Oe,(he={},(0,ae.Z)(he,"".concat(Oe,"-disabled"),R),(0,ae.Z)(he,"".concat(Oe,"-focused"),$),(0,ae.Z)(he,"".concat(Oe,"-readonly"),x),(0,ae.Z)(he,"".concat(Oe,"-input-with-clear-btn"),_e&&d&&p),he),!(0,Z.He)(K)&&T,se==null?void 0:se.affixWrapper,ve==null?void 0:ve.affixWrapper),Me=(_e||d)&&ee.createElement("span",{className:q()("".concat(H,"-suffix"),ve==null?void 0:ve.suffix),style:Re==null?void 0:Re.suffix},Gt(),_e);it=ee.createElement(nt,(0,z.Z)({className:pe,style:(0,Q.Z)((0,Q.Z)({},(0,Z.He)(K)?void 0:S),Re==null?void 0:Re.affixWrapper),hidden:!(0,Z.He)(K)&&W,onClick:et},ye==null?void 0:ye.affixWrapper,{ref:yt}),ce&&ee.createElement("span",{className:q()("".concat(H,"-prefix"),ve==null?void 0:ve.prefix),style:Re==null?void 0:Re.prefix},ce),(0,ee.cloneElement)(j,{value:p,hidden:null}),Me)}if((0,Z.He)(K)){var $e="".concat(H,"-group"),G="".concat($e,"-addon"),te=q()("".concat(H,"-wrapper"),$e,se==null?void 0:se.wrapper),ue=q()("".concat(H,"-group-wrapper"),T,se==null?void 0:se.group);return ee.createElement(pt,{className:ue,style:S,hidden:W},ee.createElement(lt,{className:te},re&&ee.createElement(dt,{className:G},re),(0,ee.cloneElement)(it,{hidden:null}),Y&&ee.createElement(dt,{className:G},Y)))}return it},O=o,v=I(19127),y=I(72071),u=I(6620),_=I(18929),m=I(2738),N=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],F=(0,ee.forwardRef)(function(k,K){var b=k.autoComplete,U=k.onChange,j=k.onFocus,H=k.onBlur,ce=k.onPressEnter,_e=k.onKeyDown,re=k.prefixCls,Y=re===void 0?"rc-input":re,T=k.disabled,S=k.htmlSize,R=k.className,x=k.maxLength,$=k.suffix,C=k.showCount,d=k.type,p=d===void 0?"text":d,P=k.classes,W=k.classNames,se=k.styles,ve=(0,u.Z)(k,N),ye=(0,_.Z)(k.defaultValue,{value:k.value}),Re=(0,y.Z)(ye,2),Ge=Re[0],nt=Re[1],pt=(0,ee.useState)(!1),lt=(0,y.Z)(pt,2),dt=lt[0],yt=lt[1],et=(0,ee.useRef)(null),Gt=function(ue){et.current&&(0,Z.nH)(et.current,ue)};(0,ee.useImperativeHandle)(K,function(){return{focus:Gt,blur:function(){var ue;(ue=et.current)===null||ue===void 0||ue.blur()},setSelectionRange:function(ue,Ae,Ie){var He;(He=et.current)===null||He===void 0||He.setSelectionRange(ue,Ae,Ie)},select:function(){var ue;(ue=et.current)===null||ue===void 0||ue.select()},input:et.current}}),(0,ee.useEffect)(function(){yt(function(te){return te&&T?!1:te})},[T]);var it=function(ue){k.value===void 0&&nt(ue.target.value),et.current&&(0,Z.rJ)(et.current,ue,U)},he=function(ue){ce&&ue.key==="Enter"&&ce(ue),_e==null||_e(ue)},Oe=function(ue){yt(!0),j==null||j(ue)},pe=function(ue){yt(!1),H==null||H(ue)},Me=function(ue){nt(""),Gt(),et.current&&(0,Z.rJ)(et.current,ue,U)},$e=function(){var ue=(0,m.Z)(k,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return ee.createElement("input",(0,z.Z)({autoComplete:b},ue,{onChange:it,onFocus:Oe,onBlur:pe,onKeyDown:he,className:q()(Y,(0,ae.Z)({},"".concat(Y,"-disabled"),T),W==null?void 0:W.input),style:se==null?void 0:se.input,ref:et,size:S,type:p}))},G=function(){var ue=Number(x)>0;if($||C){var Ae=(0,Z.D7)(Ge),Ie=(0,v.Z)(Ae).length,He=(0,ne.Z)(C)==="object"?C.formatter({value:Ae,count:Ie,maxLength:x}):"".concat(Ie).concat(ue?" / ".concat(x):"");return ee.createElement(ee.Fragment,null,!!C&&ee.createElement("span",{className:q()("".concat(Y,"-show-count-suffix"),(0,ae.Z)({},"".concat(Y,"-show-count-has-suffix"),!!$),W==null?void 0:W.count),style:(0,Q.Z)({},se==null?void 0:se.count)},He),$)}return null};return ee.createElement(O,(0,z.Z)({},ve,{prefixCls:Y,className:R,inputElement:$e(),handleReset:Me,value:(0,Z.D7)(Ge),focused:dt,triggerFocus:Gt,suffix:G(),disabled:T,classes:P,classNames:W,styles:se}))}),M=F,w=M},5643:function(qe,xe,I){"use strict";I.d(xe,{D7:function(){return V},He:function(){return z},X3:function(){return Q},nH:function(){return ne},rJ:function(){return ae}});function z(q){return!!(q.addonBefore||q.addonAfter)}function Q(q){return!!(q.prefix||q.suffix||q.allowClear)}function ae(q,ee,Z,o){if(Z){var O=ee;if(ee.type==="click"){var v=q.cloneNode(!0);O=Object.create(ee,{target:{value:v},currentTarget:{value:v}}),v.value="",Z(O);return}if(o!==void 0){O=Object.create(ee,{target:{value:q},currentTarget:{value:q}}),q.value=o,Z(O);return}Z(O)}}function ne(q,ee){if(q){q.focus(ee);var Z=ee||{},o=Z.cursor;if(o){var O=q.value.length;switch(o){case"start":q.setSelectionRange(0,0);break;case"end":q.setSelectionRange(O,O);break;default:q.setSelectionRange(0,O)}}}}function V(q){return typeof q=="undefined"||q===null?"":String(q)}},15285:function(qe,xe,I){"use strict";I.d(xe,{iz:function(){return Tn},ck:function(){return rt},BW:function(){return ni},sN:function(){return rt},Wd:function(){return ti},ZP:function(){return mt},Xl:function(){return _e}});var z=I(96663),Q=I(90493),ae=I(44127),ne=I(19127),V=I(72071),q=I(6620),ee=I(92310),Z=I.n(ee),o=I(11780),O=I(18929),v=I(13697),y=I(48736),u=I(59301),_=I(4676),m=u.createContext(null);function N(J,fe){return J===void 0?null:"".concat(J,"-").concat(fe)}function F(J){var fe=u.useContext(m);return N(fe,J)}var M=I(80547),w=["children","locked"],k=u.createContext(null);function K(J,fe){var Ee=(0,ae.Z)({},J);return Object.keys(fe).forEach(function(De){var be=fe[De];be!==void 0&&(Ee[De]=be)}),Ee}function b(J){var fe=J.children,Ee=J.locked,De=(0,q.Z)(J,w),be=u.useContext(k),Ne=(0,M.Z)(function(){return K(be,De)},[be,De],function(ke,ie){return!Ee&&(ke[0]!==ie[0]||!(0,v.Z)(ke[1],ie[1],!0))});return u.createElement(k.Provider,{value:Ne},fe)}var U=[],j=u.createContext(null);function H(){return u.useContext(j)}var ce=u.createContext(U);function _e(J){var fe=u.useContext(ce);return u.useMemo(function(){return J!==void 0?[].concat((0,ne.Z)(fe),[J]):fe},[fe,J])}var re=u.createContext(null),Y=u.createContext({}),T=Y,S=I(29194);function R(J){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,S.Z)(J)){var Ee=J.nodeName.toLowerCase(),De=["input","select","textarea","button"].includes(Ee)||J.isContentEditable||Ee==="a"&&!!J.getAttribute("href"),be=J.getAttribute("tabindex"),Ne=Number(be),ke=null;return be&&!Number.isNaN(Ne)?ke=Ne:De&&ke===null&&(ke=0),De&&J.disabled&&(ke=null),ke!==null&&(ke>=0||fe&&ke<0)}return!1}function x(J){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ee=(0,ne.Z)(J.querySelectorAll("*")).filter(function(De){return R(De,fe)});return R(J,fe)&&Ee.unshift(J),Ee}var $=null;function C(){$=document.activeElement}function d(){$=null}function p(){if($)try{$.focus()}catch(J){}}function P(J,fe){if(fe.keyCode===9){var Ee=x(J),De=Ee[fe.shiftKey?0:Ee.length-1],be=De===document.activeElement||J===document.activeElement;if(be){var Ne=Ee[fe.shiftKey?Ee.length-1:0];Ne.focus(),fe.preventDefault()}}}var W=I(10228),se=I(16089),ve=W.Z.LEFT,ye=W.Z.RIGHT,Re=W.Z.UP,Ge=W.Z.DOWN,nt=W.Z.ENTER,pt=W.Z.ESC,lt=W.Z.HOME,dt=W.Z.END,yt=[Re,Ge,ve,ye];function et(J,fe,Ee,De){var be,Ne,ke,ie,je="prev",Ze="next",Ht="children",ht="parent";if(J==="inline"&&De===nt)return{inlineTrigger:!0};var kt=(be={},(0,Q.Z)(be,Re,je),(0,Q.Z)(be,Ge,Ze),be),Lt=(Ne={},(0,Q.Z)(Ne,ve,Ee?Ze:je),(0,Q.Z)(Ne,ye,Ee?je:Ze),(0,Q.Z)(Ne,Ge,Ht),(0,Q.Z)(Ne,nt,Ht),Ne),at=(ke={},(0,Q.Z)(ke,Re,je),(0,Q.Z)(ke,Ge,Ze),(0,Q.Z)(ke,nt,Ht),(0,Q.Z)(ke,pt,ht),(0,Q.Z)(ke,ve,Ee?Ht:ht),(0,Q.Z)(ke,ye,Ee?ht:Ht),ke),nn={inline:kt,horizontal:Lt,vertical:at,inlineSub:kt,horizontalSub:at,verticalSub:at},Pt=(ie=nn["".concat(J).concat(fe?"":"Sub")])===null||ie===void 0?void 0:ie[De];switch(Pt){case je:return{offset:-1,sibling:!0};case Ze:return{offset:1,sibling:!0};case ht:return{offset:-1,sibling:!1};case Ht:return{offset:1,sibling:!1};default:return null}}function Gt(J){for(var fe=J;fe;){if(fe.getAttribute("data-menu-list"))return fe;fe=fe.parentElement}return null}function it(J,fe){for(var Ee=J||document.activeElement;Ee;){if(fe.has(Ee))return Ee;Ee=Ee.parentElement}return null}function he(J,fe){var Ee=x(J,!0);return Ee.filter(function(De){return fe.has(De)})}function Oe(J,fe,Ee){var De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!J)return null;var be=he(J,fe),Ne=be.length,ke=be.findIndex(function(ie){return Ee===ie});return De<0?ke===-1?ke=Ne-1:ke-=1:De>0&&(ke+=1),ke=(ke+Ne)%Ne,be[ke]}var pe=function(fe,Ee){var De=new Set,be=new Map,Ne=new Map;return fe.forEach(function(ke){var ie=document.querySelector("[data-menu-id='".concat(N(Ee,ke),"']"));ie&&(De.add(ie),Ne.set(ie,ke),be.set(ke,ie))}),{elements:De,key2element:be,element2key:Ne}};function Me(J,fe,Ee,De,be,Ne,ke,ie,je,Ze){var Ht=u.useRef(),ht=u.useRef();ht.current=fe;var kt=function(){se.Z.cancel(Ht.current)};return u.useEffect(function(){return function(){kt()}},[]),function(Lt){var at=Lt.which;if([].concat(yt,[nt,pt,lt,dt]).includes(at)){var nn=Ne(),Pt=pe(nn,De),on=Pt,zt=on.elements,jt=on.key2element,Bt=on.element2key,Ut=jt.get(fe),rn=it(Ut,zt),Ln=Bt.get(rn),Jt=et(J,ke(Ln,!0).length===1,Ee,at);if(!Jt&&at!==lt&&at!==dt)return;(yt.includes(at)||[lt,dt].includes(at))&&Lt.preventDefault();var St=function(An){if(An){var jn=An,ui=An.querySelector("a");ui!=null&&ui.getAttribute("href")&&(jn=ui);var sn=Bt.get(An);ie(sn),kt(),Ht.current=(0,se.Z)(function(){ht.current===sn&&jn.focus()})}};if([lt,dt].includes(at)||Jt.sibling||!rn){var We;!rn||J==="inline"?We=be.current:We=Gt(rn);var In,pn=he(We,zt);at===lt?In=pn[0]:at===dt?In=pn[pn.length-1]:In=Oe(We,zt,rn,Jt.offset),St(In)}else if(Jt.inlineTrigger)je(Ln);else if(Jt.offset>0)je(Ln,!0),kt(),Ht.current=(0,se.Z)(function(){Pt=pe(nn,De);var Gn=rn.getAttribute("aria-controls"),An=document.getElementById(Gn),jn=Oe(An,Pt.elements);St(jn)},5);else if(Jt.offset<0){var wn=ke(Ln,!0),Kn=wn[wn.length-2],Hn=jt.get(Kn);je(Kn,!1),St(Hn)}}Ze==null||Ze(Lt)}}function $e(J){Promise.resolve().then(J)}var G="__RC_UTIL_PATH_SPLIT__",te=function(fe){return fe.join(G)},ue=function(fe){return fe.split(G)},Ae="rc-menu-more";function Ie(){var J=u.useState({}),fe=(0,V.Z)(J,2),Ee=fe[1],De=(0,u.useRef)(new Map),be=(0,u.useRef)(new Map),Ne=u.useState([]),ke=(0,V.Z)(Ne,2),ie=ke[0],je=ke[1],Ze=(0,u.useRef)(0),Ht=(0,u.useRef)(!1),ht=function(){Ht.current||Ee({})},kt=(0,u.useCallback)(function(jt,Bt){var Ut=te(Bt);be.current.set(Ut,jt),De.current.set(jt,Ut),Ze.current+=1;var rn=Ze.current;$e(function(){rn===Ze.current&&ht()})},[]),Lt=(0,u.useCallback)(function(jt,Bt){var Ut=te(Bt);be.current.delete(Ut),De.current.delete(jt)},[]),at=(0,u.useCallback)(function(jt){je(jt)},[]),nn=(0,u.useCallback)(function(jt,Bt){var Ut=De.current.get(jt)||"",rn=ue(Ut);return Bt&&ie.includes(rn[0])&&rn.unshift(Ae),rn},[ie]),Pt=(0,u.useCallback)(function(jt,Bt){return jt.some(function(Ut){var rn=nn(Ut,!0);return rn.includes(Bt)})},[nn]),on=function(){var Bt=(0,ne.Z)(De.current.keys());return ie.length&&Bt.push(Ae),Bt},zt=(0,u.useCallback)(function(jt){var Bt="".concat(De.current.get(jt)).concat(G),Ut=new Set;return(0,ne.Z)(be.current.keys()).forEach(function(rn){rn.startsWith(Bt)&&Ut.add(be.current.get(rn))}),Ut},[]);return u.useEffect(function(){return function(){Ht.current=!0}},[]),{registerPath:kt,unregisterPath:Lt,refreshOverflowKeys:at,isSubPathKey:Pt,getKeyPath:nn,getKeys:on,getSubPathKeys:zt}}function He(J){var fe=u.useRef(J);fe.current=J;var Ee=u.useCallback(function(){for(var De,be=arguments.length,Ne=new Array(be),ke=0;ke<be;ke++)Ne[ke]=arguments[ke];return(De=fe.current)===null||De===void 0?void 0:De.call.apply(De,[fe].concat(Ne))},[]);return J?Ee:void 0}var ct=Math.random().toFixed(5).toString().slice(2),gt=0;function st(J){var fe=(0,O.Z)(J,{value:J}),Ee=(0,V.Z)(fe,2),De=Ee[0],be=Ee[1];return u.useEffect(function(){gt+=1;var Ne="".concat(ct,"-").concat(gt);be("rc-menu-uuid-".concat(Ne))},[]),De}var Tt=I(52884),wt=I(95727),At=I(65711),Ct=I(85745),bt=I(2738),It=I(8654);function Ye(J,fe,Ee,De){var be=u.useContext(k),Ne=be.activeKey,ke=be.onActive,ie=be.onInactive,je={active:Ne===J};return fe||(je.onMouseEnter=function(Ze){Ee==null||Ee({key:J,domEvent:Ze}),ke(J)},je.onMouseLeave=function(Ze){De==null||De({key:J,domEvent:Ze}),ie(J)}),je}function hn(J){var fe=u.useContext(k),Ee=fe.mode,De=fe.rtl,be=fe.inlineIndent;if(Ee!=="inline")return null;var Ne=J;return De?{paddingRight:Ne*be}:{paddingLeft:Ne*be}}function Ve(J){var fe=J.icon,Ee=J.props,De=J.children,be;return fe===null||fe===!1?null:(typeof fe=="function"?be=u.createElement(fe,(0,ae.Z)({},Ee)):typeof fe!="boolean"&&(be=fe),be||De||null)}var Se=["item"];function me(J){var fe=J.item,Ee=(0,q.Z)(J,Se);return Object.defineProperty(Ee,"item",{get:function(){return(0,y.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),fe}}),Ee}var Fe=["title","attribute","elementRef"],Dt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ut=["active"],Et=function(J){(0,At.Z)(Ee,J);var fe=(0,Ct.Z)(Ee);function Ee(){return(0,Tt.Z)(this,Ee),fe.apply(this,arguments)}return(0,wt.Z)(Ee,[{key:"render",value:function(){var be=this.props,Ne=be.title,ke=be.attribute,ie=be.elementRef,je=(0,q.Z)(be,Fe),Ze=(0,bt.Z)(je,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,y.ZP)(!ke,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),u.createElement(o.Z.Item,(0,z.Z)({},ke,{title:typeof Ne=="string"?Ne:void 0},Ze,{ref:ie}))}}]),Ee}(u.Component),Ke=u.forwardRef(function(J,fe){var Ee,De=J.style,be=J.className,Ne=J.eventKey,ke=J.warnKey,ie=J.disabled,je=J.itemIcon,Ze=J.children,Ht=J.role,ht=J.onMouseEnter,kt=J.onMouseLeave,Lt=J.onClick,at=J.onKeyDown,nn=J.onFocus,Pt=(0,q.Z)(J,Dt),on=F(Ne),zt=u.useContext(k),jt=zt.prefixCls,Bt=zt.onItemClick,Ut=zt.disabled,rn=zt.overflowDisabled,Ln=zt.itemIcon,Jt=zt.selectedKeys,St=zt.onActive,We=u.useContext(T),In=We._internalRenderMenuItem,pn="".concat(jt,"-item"),wn=u.useRef(),Kn=u.useRef(),Hn=Ut||ie,Gn=(0,It.x1)(fe,Kn),An=_e(Ne),jn=function(bn){return{key:Ne,keyPath:(0,ne.Z)(An).reverse(),item:wn.current,domEvent:bn}},ui=je||Ln,sn=Ye(Ne,Hn,ht,kt),Dn=sn.active,Ii=(0,q.Z)(sn,ut),ci=Jt.includes(Ne),Si=hn(An.length),Xn=function(bn){if(!Hn){var Mn=jn(bn);Lt==null||Lt(me(Mn)),Bt(Mn)}},Pn=function(bn){if(at==null||at(bn),bn.which===W.Z.ENTER){var Mn=jn(bn);Lt==null||Lt(me(Mn)),Bt(Mn)}},ii=function(bn){St(Ne),nn==null||nn(bn)},_i={};J.role==="option"&&(_i["aria-selected"]=ci);var Ri=u.createElement(Et,(0,z.Z)({ref:wn,elementRef:Gn,role:Ht===null?"none":Ht||"menuitem",tabIndex:ie?null:-1,"data-menu-id":rn&&on?null:on},Pt,Ii,_i,{component:"li","aria-disabled":ie,style:(0,ae.Z)((0,ae.Z)({},Si),De),className:Z()(pn,(Ee={},(0,Q.Z)(Ee,"".concat(pn,"-active"),Dn),(0,Q.Z)(Ee,"".concat(pn,"-selected"),ci),(0,Q.Z)(Ee,"".concat(pn,"-disabled"),Hn),Ee),be),onClick:Xn,onKeyDown:Pn,onFocus:ii}),Ze,u.createElement(Ve,{props:(0,ae.Z)((0,ae.Z)({},J),{},{isSelected:ci}),icon:ui}));return In&&(Ri=In(Ri,J,{selected:ci})),Ri});function _t(J,fe){var Ee=J.eventKey,De=H(),be=_e(Ee);return u.useEffect(function(){if(De)return De.registerPath(Ee,be),function(){De.unregisterPath(Ee,be)}},[be]),De?null:u.createElement(Ke,(0,z.Z)({},J,{ref:fe}))}var rt=u.forwardRef(_t),xt=["className","children"],ot=function(fe,Ee){var De=fe.className,be=fe.children,Ne=(0,q.Z)(fe,xt),ke=u.useContext(k),ie=ke.prefixCls,je=ke.mode,Ze=ke.rtl;return u.createElement("ul",(0,z.Z)({className:Z()(ie,Ze&&"".concat(ie,"-rtl"),"".concat(ie,"-sub"),"".concat(ie,"-").concat(je==="inline"?"inline":"vertical"),De),role:"menu"},Ne,{"data-menu-list":!0,ref:Ee}),be)},vt=u.forwardRef(ot);vt.displayName="SubMenuList";var $t=vt,en=I(11592);function fn(J,fe){return(0,en.Z)(J).map(function(Ee,De){if(u.isValidElement(Ee)){var be,Ne,ke=Ee.key,ie=(be=(Ne=Ee.props)===null||Ne===void 0?void 0:Ne.eventKey)!==null&&be!==void 0?be:ke,je=ie==null;je&&(ie="tmp_key-".concat([].concat((0,ne.Z)(fe),[De]).join("-")));var Ze={key:ie,eventKey:ie};return u.cloneElement(Ee,Ze)}return Ee})}var Wt=I(35593),Zt={adjustX:1,adjustY:1},Fn={topLeft:{points:["bl","tl"],overflow:Zt},topRight:{points:["br","tr"],overflow:Zt},bottomLeft:{points:["tl","bl"],overflow:Zt},bottomRight:{points:["tr","br"],overflow:Zt},leftTop:{points:["tr","tl"],overflow:Zt},leftBottom:{points:["br","bl"],overflow:Zt},rightTop:{points:["tl","tr"],overflow:Zt},rightBottom:{points:["bl","br"],overflow:Zt}},xn={topLeft:{points:["bl","tl"],overflow:Zt},topRight:{points:["br","tr"],overflow:Zt},bottomLeft:{points:["tl","bl"],overflow:Zt},bottomRight:{points:["tr","br"],overflow:Zt},rightTop:{points:["tr","tl"],overflow:Zt},rightBottom:{points:["br","bl"],overflow:Zt},leftTop:{points:["tl","tr"],overflow:Zt},leftBottom:{points:["bl","br"],overflow:Zt}},qn=null;function Yt(J,fe,Ee){if(fe)return fe;if(Ee)return Ee[J]||Ee.other}var an={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Qt(J){var fe=J.prefixCls,Ee=J.visible,De=J.children,be=J.popup,Ne=J.popupStyle,ke=J.popupClassName,ie=J.popupOffset,je=J.disabled,Ze=J.mode,Ht=J.onVisibleChange,ht=u.useContext(k),kt=ht.getPopupContainer,Lt=ht.rtl,at=ht.subMenuOpenDelay,nn=ht.subMenuCloseDelay,Pt=ht.builtinPlacements,on=ht.triggerSubMenuAction,zt=ht.forceSubMenuRender,jt=ht.rootClassName,Bt=ht.motion,Ut=ht.defaultMotions,rn=u.useState(!1),Ln=(0,V.Z)(rn,2),Jt=Ln[0],St=Ln[1],We=Lt?(0,ae.Z)((0,ae.Z)({},xn),Pt):(0,ae.Z)((0,ae.Z)({},Fn),Pt),In=an[Ze],pn=Yt(Ze,Bt,Ut),wn=u.useRef(pn);Ze!=="inline"&&(wn.current=pn);var Kn=(0,ae.Z)((0,ae.Z)({},wn.current),{},{leavedClassName:"".concat(fe,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Hn=u.useRef();return u.useEffect(function(){return Hn.current=(0,se.Z)(function(){St(Ee)}),function(){se.Z.cancel(Hn.current)}},[Ee]),u.createElement(Wt.Z,{prefixCls:fe,popupClassName:Z()("".concat(fe,"-popup"),(0,Q.Z)({},"".concat(fe,"-rtl"),Lt),ke,jt),stretch:Ze==="horizontal"?"minWidth":null,getPopupContainer:kt,builtinPlacements:We,popupPlacement:In,popupVisible:Jt,popup:be,popupStyle:Ne,popupAlign:ie&&{offset:ie},action:je?[]:[on],mouseEnterDelay:at,mouseLeaveDelay:nn,onPopupVisibleChange:Ht,forceRender:zt,popupMotion:Kn,fresh:!0},De)}var Sn=I(77900);function Zn(J){var fe=J.id,Ee=J.open,De=J.keyPath,be=J.children,Ne="inline",ke=u.useContext(k),ie=ke.prefixCls,je=ke.forceSubMenuRender,Ze=ke.motion,Ht=ke.defaultMotions,ht=ke.mode,kt=u.useRef(!1);kt.current=ht===Ne;var Lt=u.useState(!kt.current),at=(0,V.Z)(Lt,2),nn=at[0],Pt=at[1],on=kt.current?Ee:!1;u.useEffect(function(){kt.current&&Pt(!1)},[ht]);var zt=(0,ae.Z)({},Yt(Ne,Ze,Ht));De.length>1&&(zt.motionAppear=!1);var jt=zt.onVisibleChanged;return zt.onVisibleChanged=function(Bt){return!kt.current&&!Bt&&Pt(!0),jt==null?void 0:jt(Bt)},nn?null:u.createElement(b,{mode:Ne,locked:!kt.current},u.createElement(Sn.default,(0,z.Z)({visible:on},zt,{forceRender:je,removeOnLeave:!1,leavedClassName:"".concat(ie,"-hidden")}),function(Bt){var Ut=Bt.className,rn=Bt.style;return u.createElement($t,{id:fe,className:Ut,style:rn},be)}))}var Bn=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],gi=["active"],mn=function(fe){var Ee,De=fe.style,be=fe.className,Ne=fe.title,ke=fe.eventKey,ie=fe.warnKey,je=fe.disabled,Ze=fe.internalPopupClose,Ht=fe.children,ht=fe.itemIcon,kt=fe.expandIcon,Lt=fe.popupClassName,at=fe.popupOffset,nn=fe.popupStyle,Pt=fe.onClick,on=fe.onMouseEnter,zt=fe.onMouseLeave,jt=fe.onTitleClick,Bt=fe.onTitleMouseEnter,Ut=fe.onTitleMouseLeave,rn=(0,q.Z)(fe,Bn),Ln=F(ke),Jt=u.useContext(k),St=Jt.prefixCls,We=Jt.mode,In=Jt.openKeys,pn=Jt.disabled,wn=Jt.overflowDisabled,Kn=Jt.activeKey,Hn=Jt.selectedKeys,Gn=Jt.itemIcon,An=Jt.expandIcon,jn=Jt.onItemClick,ui=Jt.onOpenChange,sn=Jt.onActive,Dn=u.useContext(T),Ii=Dn._internalRenderSubMenuItem,ci=u.useContext(re),Si=ci.isSubPathKey,Xn=_e(),Pn="".concat(St,"-submenu"),ii=pn||je,_i=u.useRef(),Ri=u.useRef(),ri=ht!=null?ht:Gn,bn=kt!=null?kt:An,Mn=In.includes(ke),hi=!wn&&Mn,vi=Si(Hn,ke),ei=Ye(ke,ii,Bt,Ut),Ti=ei.active,si=(0,q.Z)(ei,gi),Li=u.useState(!1),ki=(0,V.Z)(Li,2),Pi=ki[0],ji=ki[1],Wi=function(Qn){ii||ji(Qn)},yi=function(Qn){Wi(!0),on==null||on({key:ke,domEvent:Qn})},qi=function(Qn){Wi(!1),zt==null||zt({key:ke,domEvent:Qn})},Mi=u.useMemo(function(){return Ti||(We!=="inline"?Pi||Si([Kn],ke):!1)},[We,Ti,Kn,Pi,ke,Si]),Ci=hn(Xn.length),er=function(Qn){ii||(jt==null||jt({key:ke,domEvent:Qn}),We==="inline"&&ui(ke,!Mn))},Ni=He(function(Wn){Pt==null||Pt(me(Wn)),jn(Wn)}),Di=function(Qn){We!=="inline"&&ui(ke,Qn)},Fi=function(){sn(ke)},Vn=Ln&&"".concat(Ln,"-popup"),bi=u.createElement("div",(0,z.Z)({role:"menuitem",style:Ci,className:"".concat(Pn,"-title"),tabIndex:ii?null:-1,ref:_i,title:typeof Ne=="string"?Ne:null,"data-menu-id":wn&&Ln?null:Ln,"aria-expanded":hi,"aria-haspopup":!0,"aria-controls":Vn,"aria-disabled":ii,onClick:er,onFocus:Fi},si),Ne,u.createElement(Ve,{icon:We!=="horizontal"?bn:void 0,props:(0,ae.Z)((0,ae.Z)({},fe),{},{isOpen:hi,isSubMenu:!0})},u.createElement("i",{className:"".concat(Pn,"-arrow")}))),Cn=u.useRef(We);if(We!=="inline"&&Xn.length>1?Cn.current="vertical":Cn.current=We,!wn){var ai=Cn.current;bi=u.createElement(Qt,{mode:ai,prefixCls:Pn,visible:!Ze&&hi&&We!=="inline",popupClassName:Lt,popupOffset:at,popupStyle:nn,popup:u.createElement(b,{mode:ai==="horizontal"?"vertical":ai},u.createElement($t,{id:Vn,ref:Ri},Ht)),disabled:ii,onVisibleChange:Di},bi)}var fi=u.createElement(o.Z.Item,(0,z.Z)({role:"none"},rn,{component:"li",style:De,className:Z()(Pn,"".concat(Pn,"-").concat(We),be,(Ee={},(0,Q.Z)(Ee,"".concat(Pn,"-open"),hi),(0,Q.Z)(Ee,"".concat(Pn,"-active"),Mi),(0,Q.Z)(Ee,"".concat(Pn,"-selected"),vi),(0,Q.Z)(Ee,"".concat(Pn,"-disabled"),ii),Ee)),onMouseEnter:yi,onMouseLeave:qi}),bi,!wn&&u.createElement(Zn,{id:Vn,open:hi,keyPath:Xn},Ht));return Ii&&(fi=Ii(fi,fe,{selected:vi,active:Mi,open:hi,disabled:ii})),u.createElement(b,{onItemClick:Ni,mode:We==="horizontal"?"vertical":We,itemIcon:ri,expandIcon:bn},fi)};function ti(J){var fe=J.eventKey,Ee=J.children,De=_e(fe),be=fn(Ee,De),Ne=H();u.useEffect(function(){if(Ne)return Ne.registerPath(fe,De),function(){Ne.unregisterPath(fe,De)}},[De]);var ke;return Ne?ke=be:ke=u.createElement(mn,J,be),u.createElement(ce.Provider,{value:De},ke)}var Yn=I(20135),Un=["className","title","eventKey","children"],$n=["children"],Kt=function(fe){var Ee=fe.className,De=fe.title,be=fe.eventKey,Ne=fe.children,ke=(0,q.Z)(fe,Un),ie=u.useContext(k),je=ie.prefixCls,Ze="".concat(je,"-item-group");return u.createElement("li",(0,z.Z)({role:"presentation"},ke,{onClick:function(ht){return ht.stopPropagation()},className:Z()(Ze,Ee)}),u.createElement("div",{role:"presentation",className:"".concat(Ze,"-title"),title:typeof De=="string"?De:void 0},De),u.createElement("ul",{role:"group",className:"".concat(Ze,"-list")},Ne))};function ni(J){var fe=J.children,Ee=(0,q.Z)(J,$n),De=_e(Ee.eventKey),be=fn(fe,De),Ne=H();return Ne?be:u.createElement(Kt,(0,bt.Z)(Ee,["warnKey"]),be)}function Tn(J){var fe=J.className,Ee=J.style,De=u.useContext(k),be=De.prefixCls,Ne=H();return Ne?null:u.createElement("li",{role:"separator",className:Z()("".concat(be,"-item-divider"),fe),style:Ee})}var xi=["label","children","key","type"];function Ft(J){return(J||[]).map(function(fe,Ee){if(fe&&(0,Yn.Z)(fe)==="object"){var De=fe,be=De.label,Ne=De.children,ke=De.key,ie=De.type,je=(0,q.Z)(De,xi),Ze=ke!=null?ke:"tmp-".concat(Ee);return Ne||ie==="group"?ie==="group"?u.createElement(ni,(0,z.Z)({key:Ze},je,{title:be}),Ft(Ne)):u.createElement(ti,(0,z.Z)({key:Ze},je,{title:be}),Ft(Ne)):ie==="divider"?u.createElement(Tn,(0,z.Z)({key:Ze},je)):u.createElement(rt,(0,z.Z)({key:Ze},je),be)}return null}).filter(function(fe){return fe})}function tn(J,fe,Ee){var De=J;return fe&&(De=Ft(fe)),fn(De,Ee)}var mi=["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"],dn=[],Rn=u.forwardRef(function(J,fe){var Ee,De,be=J,Ne=be.prefixCls,ke=Ne===void 0?"rc-menu":Ne,ie=be.rootClassName,je=be.style,Ze=be.className,Ht=be.tabIndex,ht=Ht===void 0?0:Ht,kt=be.items,Lt=be.children,at=be.direction,nn=be.id,Pt=be.mode,on=Pt===void 0?"vertical":Pt,zt=be.inlineCollapsed,jt=be.disabled,Bt=be.disabledOverflow,Ut=be.subMenuOpenDelay,rn=Ut===void 0?.1:Ut,Ln=be.subMenuCloseDelay,Jt=Ln===void 0?.1:Ln,St=be.forceSubMenuRender,We=be.defaultOpenKeys,In=be.openKeys,pn=be.activeKey,wn=be.defaultActiveFirst,Kn=be.selectable,Hn=Kn===void 0?!0:Kn,Gn=be.multiple,An=Gn===void 0?!1:Gn,jn=be.defaultSelectedKeys,ui=be.selectedKeys,sn=be.onSelect,Dn=be.onDeselect,Ii=be.inlineIndent,ci=Ii===void 0?24:Ii,Si=be.motion,Xn=be.defaultMotions,Pn=be.triggerSubMenuAction,ii=Pn===void 0?"hover":Pn,_i=be.builtinPlacements,Ri=be.itemIcon,ri=be.expandIcon,bn=be.overflowedIndicator,Mn=bn===void 0?"...":bn,hi=be.overflowedIndicatorPopupClassName,vi=be.getPopupContainer,ei=be.onClick,Ti=be.onOpenChange,si=be.onKeyDown,Li=be.openAnimation,ki=be.openTransitionName,Pi=be._internalRenderMenuItem,ji=be._internalRenderSubMenuItem,Wi=(0,q.Z)(be,mi),yi=u.useMemo(function(){return tn(Lt,kt,dn)},[Lt,kt]),qi=u.useState(!1),Mi=(0,V.Z)(qi,2),Ci=Mi[0],er=Mi[1],Ni=u.useRef(),Di=st(nn),Fi=at==="rtl",Vn=(0,O.Z)(We,{value:In,postState:function(un){return un||dn}}),bi=(0,V.Z)(Vn,2),Cn=bi[0],ai=bi[1],fi=function(un){var En=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Nn(){ai(un),Ti==null||Ti(un)}En?(0,_.flushSync)(Nn):Nn()},Wn=u.useState(Cn),Qn=(0,V.Z)(Wn,2),Vi=Qn[0],sr=Qn[1],Bi=u.useRef(!1),hr=u.useMemo(function(){return(on==="inline"||on==="vertical")&&zt?["vertical",zt]:[on,!1]},[on,zt]),zi=(0,V.Z)(hr,2),Zi=zi[0],tt=zi[1],Xe=Zi==="inline",Xt=u.useState(Zi),On=(0,V.Z)(Xt,2),qt=On[0],Oi=On[1],fr=u.useState(tt),ar=(0,V.Z)(fr,2),tr=ar[0],ts=ar[1];u.useEffect(function(){Oi(Zi),ts(tt),Bi.current&&(Xe?ai(Vi):fi(dn))},[Zi,tt]);var ns=u.useState(0),Mr=(0,V.Z)(ns,2),vr=Mr[0],is=Mr[1],Lr=vr>=yi.length-1||qt!=="horizontal"||Bt;u.useEffect(function(){Xe&&sr(Cn)},[Cn]),u.useEffect(function(){return Bi.current=!0,function(){Bi.current=!1}},[]);var di=Ie(),Nr=di.registerPath,Fr=di.unregisterPath,Ui=di.refreshOverflowKeys,Yi=di.isSubPathKey,rs=di.getKeyPath,Xi=di.getKeys,ss=di.getSubPathKeys,Br=u.useMemo(function(){return{registerPath:Nr,unregisterPath:Fr}},[Nr,Fr]),as=u.useMemo(function(){return{isSubPathKey:Yi}},[Yi]);u.useEffect(function(){Ui(Lr?dn:yi.slice(vr+1).map(function(kn){return kn.key}))},[vr,Lr]);var os=(0,O.Z)(pn||wn&&((Ee=yi[0])===null||Ee===void 0?void 0:Ee.key),{value:pn}),zn=(0,V.Z)(os,2),dr=zn[0],or=zn[1],lr=He(function(kn){or(kn)}),ls=He(function(){or(void 0)});(0,u.useImperativeHandle)(fe,function(){return{list:Ni.current,focus:function(un){var En,Nn=Xi(),wi=pe(Nn,Di),xr=wi.elements,Cr=wi.key2element,ds=wi.element2key,Kr=he(Ni.current,xr),Sr=dr!=null?dr:Kr[0]?ds.get(Kr[0]):(En=yi.find(function(Dr){return!Dr.props.disabled}))===null||En===void 0?void 0:En.key,pr=Cr.get(Sr);if(Sr&&pr){var Ce;pr==null||(Ce=pr.focus)===null||Ce===void 0||Ce.call(pr,un)}}}});var _n=(0,O.Z)(jn||[],{value:ui,postState:function(un){return Array.isArray(un)?un:un==null?dn:[un]}}),yr=(0,V.Z)(_n,2),nr=yr[0],br=yr[1],us=function(un){if(Hn){var En=un.key,Nn=nr.includes(En),wi;An?Nn?wi=nr.filter(function(Cr){return Cr!==En}):wi=[].concat((0,ne.Z)(nr),[En]):wi=[En],br(wi);var xr=(0,ae.Z)((0,ae.Z)({},un),{},{selectedKeys:wi});Nn?Dn==null||Dn(xr):sn==null||sn(xr)}!An&&Cn.length&&qt!=="inline"&&fi(dn)},cs=He(function(kn){ei==null||ei(me(kn)),us(kn)}),Ir=He(function(kn,un){var En=Cn.filter(function(wi){return wi!==kn});if(un)En.push(kn);else if(qt!=="inline"){var Nn=ss(kn);En=En.filter(function(wi){return!Nn.has(wi)})}(0,v.Z)(Cn,En,!0)||fi(En,!0)}),Ur=function(un,En){var Nn=En!=null?En:!Cn.includes(un);Ir(un,Nn)},hs=Me(qt,dr,Fi,Di,Ni,Xi,rs,or,Ur,si);u.useEffect(function(){er(!0)},[]);var fs=u.useMemo(function(){return{_internalRenderMenuItem:Pi,_internalRenderSubMenuItem:ji}},[Pi,ji]),Er=qt!=="horizontal"||Bt?yi:yi.map(function(kn,un){return u.createElement(b,{key:kn.key,overflowDisabled:un>vr},kn)}),$r=u.createElement(o.Z,(0,z.Z)({id:nn,ref:Ni,prefixCls:"".concat(ke,"-overflow"),component:"ul",itemComponent:rt,className:Z()(ke,"".concat(ke,"-root"),"".concat(ke,"-").concat(qt),Ze,(De={},(0,Q.Z)(De,"".concat(ke,"-inline-collapsed"),tr),(0,Q.Z)(De,"".concat(ke,"-rtl"),Fi),De),ie),dir:at,style:je,role:"menu",tabIndex:ht,data:Er,renderRawItem:function(un){return un},renderRawRest:function(un){var En=un.length,Nn=En?yi.slice(-En):null;return u.createElement(ti,{eventKey:Ae,title:Mn,disabled:Lr,internalPopupClose:En===0,popupClassName:hi},Nn)},maxCount:qt!=="horizontal"||Bt?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(un){is(un)},onKeyDown:hs},Wi));return u.createElement(T.Provider,{value:fs},u.createElement(m.Provider,{value:Di},u.createElement(b,{prefixCls:ke,rootClassName:ie,mode:qt,openKeys:Cn,rtl:Fi,disabled:jt,motion:Ci?Si:null,defaultMotions:Ci?Xn:null,activeKey:dr,onActive:lr,onInactive:ls,selectedKeys:nr,inlineIndent:ci,subMenuOpenDelay:rn,subMenuCloseDelay:Jt,forceSubMenuRender:St,builtinPlacements:_i,triggerSubMenuAction:ii,getPopupContainer:vi,itemIcon:Ri,expandIcon:ri,onItemClick:cs,onOpenChange:Ir},u.createElement(re.Provider,{value:as},$r),u.createElement("div",{style:{display:"none"},"aria-hidden":!0},u.createElement(j.Provider,{value:Br},yi)))))}),Ai=Rn,yn=Ai;yn.Item=rt,yn.SubMenu=ti,yn.ItemGroup=ni,yn.Divider=Tn;var mt=yn},11780:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return C}});var z=I(96663),Q=I(44127),ae=I(72071),ne=I(6620),V=I(59301),q=I(92310),ee=I.n(q),Z=I(29301),o=I(34280),O=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],v=void 0;function y(d,p){var P=d.prefixCls,W=d.invalidate,se=d.item,ve=d.renderItem,ye=d.responsive,Re=d.responsiveDisabled,Ge=d.registerSize,nt=d.itemKey,pt=d.className,lt=d.style,dt=d.children,yt=d.display,et=d.order,Gt=d.component,it=Gt===void 0?"div":Gt,he=(0,ne.Z)(d,O),Oe=ye&&!yt;function pe(ue){Ge(nt,ue)}V.useEffect(function(){return function(){pe(null)}},[]);var Me=ve&&se!==v?ve(se,{index:et}):dt,$e;W||($e={opacity:Oe?0:1,height:Oe?0:v,overflowY:Oe?"hidden":v,order:ye?et:v,pointerEvents:Oe?"none":v,position:Oe?"absolute":v});var G={};Oe&&(G["aria-hidden"]=!0);var te=V.createElement(it,(0,z.Z)({className:ee()(!W&&P,pt),style:(0,Q.Z)((0,Q.Z)({},$e),lt)},G,he,{ref:p}),Me);return ye&&(te=V.createElement(Z.Z,{onResize:function(Ae){var Ie=Ae.offsetWidth;pe(Ie)},disabled:Re},te)),te}var u=V.forwardRef(y);u.displayName="Item";var _=u,m=I(6089),N=I(4676),F=I(16089);function M(d){if(typeof MessageChannel=="undefined")(0,F.Z)(d);else{var p=new MessageChannel;p.port1.onmessage=function(){return d()},p.port2.postMessage(void 0)}}function w(){var d=V.useRef(null),p=function(W){d.current||(d.current=[],M(function(){(0,N.unstable_batchedUpdates)(function(){d.current.forEach(function(se){se()}),d.current=null})})),d.current.push(W)};return p}function k(d,p){var P=V.useState(p),W=(0,ae.Z)(P,2),se=W[0],ve=W[1],ye=(0,m.Z)(function(Re){d(function(){ve(Re)})});return[se,ye]}var K=V.createContext(null),b=["component"],U=["className"],j=["className"],H=function(p,P){var W=V.useContext(K);if(!W){var se=p.component,ve=se===void 0?"div":se,ye=(0,ne.Z)(p,b);return V.createElement(ve,(0,z.Z)({},ye,{ref:P}))}var Re=W.className,Ge=(0,ne.Z)(W,U),nt=p.className,pt=(0,ne.Z)(p,j);return V.createElement(K.Provider,{value:null},V.createElement(_,(0,z.Z)({ref:P,className:ee()(Re,nt)},Ge,pt)))},ce=V.forwardRef(H);ce.displayName="RawItem";var _e=ce,re=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Y="responsive",T="invalidate";function S(d){return"+ ".concat(d.length," ...")}function R(d,p){var P=d.prefixCls,W=P===void 0?"rc-overflow":P,se=d.data,ve=se===void 0?[]:se,ye=d.renderItem,Re=d.renderRawItem,Ge=d.itemKey,nt=d.itemWidth,pt=nt===void 0?10:nt,lt=d.ssr,dt=d.style,yt=d.className,et=d.maxCount,Gt=d.renderRest,it=d.renderRawRest,he=d.suffix,Oe=d.component,pe=Oe===void 0?"div":Oe,Me=d.itemComponent,$e=d.onVisibleChange,G=(0,ne.Z)(d,re),te=lt==="full",ue=w(),Ae=k(ue,null),Ie=(0,ae.Z)(Ae,2),He=Ie[0],ct=Ie[1],gt=He||0,st=k(ue,new Map),Tt=(0,ae.Z)(st,2),wt=Tt[0],At=Tt[1],Ct=k(ue,0),bt=(0,ae.Z)(Ct,2),It=bt[0],Ye=bt[1],hn=k(ue,0),Ve=(0,ae.Z)(hn,2),Se=Ve[0],me=Ve[1],Fe=k(ue,0),Dt=(0,ae.Z)(Fe,2),ut=Dt[0],Et=Dt[1],Ke=(0,V.useState)(null),_t=(0,ae.Z)(Ke,2),rt=_t[0],xt=_t[1],ot=(0,V.useState)(null),vt=(0,ae.Z)(ot,2),$t=vt[0],en=vt[1],fn=V.useMemo(function(){return $t===null&&te?Number.MAX_SAFE_INTEGER:$t||0},[$t,He]),Wt=(0,V.useState)(!1),Zt=(0,ae.Z)(Wt,2),Fn=Zt[0],xn=Zt[1],qn="".concat(W,"-item"),Yt=Math.max(It,Se),an=et===Y,Qt=ve.length&&an,Sn=et===T,Zn=Qt||typeof et=="number"&&ve.length>et,Bn=(0,V.useMemo)(function(){var mt=ve;return Qt?He===null&&te?mt=ve:mt=ve.slice(0,Math.min(ve.length,gt/pt)):typeof et=="number"&&(mt=ve.slice(0,et)),mt},[ve,pt,He,et,Qt]),gi=(0,V.useMemo)(function(){return Qt?ve.slice(fn+1):ve.slice(Bn.length)},[ve,Bn,Qt,fn]),mn=(0,V.useCallback)(function(mt,J){var fe;return typeof Ge=="function"?Ge(mt):(fe=Ge&&(mt==null?void 0:mt[Ge]))!==null&&fe!==void 0?fe:J},[Ge]),ti=(0,V.useCallback)(ye||function(mt){return mt},[ye]);function Yn(mt,J,fe){$t===mt&&(J===void 0||J===rt)||(en(mt),fe||(xn(mt<ve.length-1),$e==null||$e(mt)),J!==void 0&&xt(J))}function Un(mt,J){ct(J.clientWidth)}function $n(mt,J){At(function(fe){var Ee=new Map(fe);return J===null?Ee.delete(mt):Ee.set(mt,J),Ee})}function Kt(mt,J){me(J),Ye(Se)}function ni(mt,J){Et(J)}function Tn(mt){return wt.get(mn(Bn[mt],mt))}(0,o.Z)(function(){if(gt&&typeof Yt=="number"&&Bn){var mt=ut,J=Bn.length,fe=J-1;if(!J){Yn(0,null);return}for(var Ee=0;Ee<J;Ee+=1){var De=Tn(Ee);if(te&&(De=De||0),De===void 0){Yn(Ee-1,void 0,!0);break}if(mt+=De,fe===0&&mt<=gt||Ee===fe-1&&mt+Tn(fe)<=gt){Yn(fe,null);break}else if(mt+Yt>gt){Yn(Ee-1,mt-De-ut+Se);break}}he&&Tn(0)+ut>gt&&xt(null)}},[gt,wt,Se,ut,mn,Bn]);var xi=Fn&&!!gi.length,Ft={};rt!==null&&Qt&&(Ft={position:"absolute",left:rt,top:0});var tn={prefixCls:qn,responsive:Qt,component:Me,invalidate:Sn},mi=Re?function(mt,J){var fe=mn(mt,J);return V.createElement(K.Provider,{key:fe,value:(0,Q.Z)((0,Q.Z)({},tn),{},{order:J,item:mt,itemKey:fe,registerSize:$n,display:J<=fn})},Re(mt,J))}:function(mt,J){var fe=mn(mt,J);return V.createElement(_,(0,z.Z)({},tn,{order:J,key:fe,item:mt,renderItem:ti,itemKey:fe,registerSize:$n,display:J<=fn}))},dn={order:xi?fn:Number.MAX_SAFE_INTEGER,className:"".concat(qn,"-rest"),registerSize:Kt,display:xi},Rn=Gt||S,Ai=it?V.createElement(K.Provider,{value:(0,Q.Z)((0,Q.Z)({},tn),dn)},it(gi)):V.createElement(_,(0,z.Z)({},tn,dn),typeof Rn=="function"?Rn(gi):Rn),yn=V.createElement(pe,(0,z.Z)({className:ee()(!Sn&&W,yt),style:dt,ref:p},G),Bn.map(mi),Zn?Ai:null,he&&V.createElement(_,(0,z.Z)({},tn,{responsive:an,responsiveDisabled:!Qt,order:fn,className:"".concat(qn,"-suffix"),registerSize:ni,display:!0,style:Ft}),he));return an?V.createElement(Z.Z,{onResize:Un,disabled:!Qt},yn):yn}var x=V.forwardRef(R);x.displayName="Overflow",x.Item=_e,x.RESPONSIVE=Y,x.INVALIDATE=T;var $=x,C=$},29301:function(qe,xe,I){"use strict";I.d(xe,{Z:function(){return T}});var z=I(96663),Q=I(59301),ae=I(11592),ne=I(48736),V=I(44127),q=I(20135),ee=I(76846),Z=I(8654),o=Q.createContext(null);function O(S){var R=S.children,x=S.onBatchResize,$=Q.useRef(0),C=Q.useRef([]),d=Q.useContext(o),p=Q.useCallback(function(P,W,se){$.current+=1;var ve=$.current;C.current.push({size:P,element:W,data:se}),Promise.resolve().then(function(){ve===$.current&&(x==null||x(C.current),C.current=[])}),d==null||d(P,W,se)},[x,d]);return Q.createElement(o.Provider,{value:p},R)}var v=I(76374),y=new Map;function u(S){S.forEach(function(R){var x,$=R.target;(x=y.get($))===null||x===void 0||x.forEach(function(C){return C($)})})}var _=new v.Z(u),m=null,N=null;function F(S,R){y.has(S)||(y.set(S,new Set),_.observe(S)),y.get(S).add(R)}function M(S,R){y.has(S)&&(y.get(S).delete(R),y.get(S).size||(_.unobserve(S),y.delete(S)))}var w=I(52884),k=I(95727),K=I(65711),b=I(85745),U=function(S){(0,K.Z)(x,S);var R=(0,b.Z)(x);function x(){return(0,w.Z)(this,x),R.apply(this,arguments)}return(0,k.Z)(x,[{key:"render",value:function(){return this.props.children}}]),x}(Q.Component);function j(S,R){var x=S.children,$=S.disabled,C=Q.useRef(null),d=Q.useRef(null),p=Q.useContext(o),P=typeof x=="function",W=P?x(C):x,se=Q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ve=!P&&Q.isValidElement(W)&&(0,Z.Yr)(W),ye=ve?(0,Z.C4)(W):null,Re=(0,Z.x1)(ye,C),Ge=function(){var dt;return(0,ee.ZP)(C.current)||(C.current&&(0,q.Z)(C.current)==="object"?(0,ee.ZP)((dt=C.current)===null||dt===void 0?void 0:dt.nativeElement):null)||(0,ee.ZP)(d.current)};Q.useImperativeHandle(R,function(){return Ge()});var nt=Q.useRef(S);nt.current=S;var pt=Q.useCallback(function(lt){var dt=nt.current,yt=dt.onResize,et=dt.data,Gt=lt.getBoundingClientRect(),it=Gt.width,he=Gt.height,Oe=lt.offsetWidth,pe=lt.offsetHeight,Me=Math.floor(it),$e=Math.floor(he);if(se.current.width!==Me||se.current.height!==$e||se.current.offsetWidth!==Oe||se.current.offsetHeight!==pe){var G={width:Me,height:$e,offsetWidth:Oe,offsetHeight:pe};se.current=G;var te=Oe===Math.round(it)?it:Oe,ue=pe===Math.round(he)?he:pe,Ae=(0,V.Z)((0,V.Z)({},G),{},{offsetWidth:te,offsetHeight:ue});p==null||p(Ae,lt,et),yt&&Promise.resolve().then(function(){yt(Ae,lt)})}},[]);return Q.useEffect(function(){var lt=Ge();return lt&&!$&&F(lt,pt),function(){return M(lt,pt)}},[C.current,$]),Q.createElement(U,{ref:d},ve?Q.cloneElement(W,{ref:Re}):W)}var H=Q.forwardRef(j),ce=H,_e="rc-observer-key";function re(S,R){var x=S.children,$=typeof x=="function"?[x]:(0,ae.Z)(x);return $.map(function(C,d){var p=(C==null?void 0:C.key)||"".concat(_e,"-").concat(d);return Q.createElement(ce,(0,z.Z)({},S,{key:p,ref:d===0?R:void 0}),C)})}var Y=Q.forwardRef(re);Y.Collection=O;var T=Y},55477:function(qe,xe,I){"use strict";I.d(xe,{G:function(){return u},Z:function(){return F}});var z=I(96663),Q=I(44127),ae=I(6620),ne=I(35593),V=I(59301),q={shiftX:64,adjustY:1},ee={adjustX:1,shiftY:!0},Z=[0,0],o={left:{points:["cr","cl"],overflow:ee,offset:[-4,0],targetOffset:Z},right:{points:["cl","cr"],overflow:ee,offset:[4,0],targetOffset:Z},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:Z},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:Z},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:Z},leftTop:{points:["tr","tl"],overflow:ee,offset:[-4,0],targetOffset:Z},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:Z},rightTop:{points:["tl","tr"],overflow:ee,offset:[4,0],targetOffset:Z},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:Z},rightBottom:{points:["bl","br"],overflow:ee,offset:[4,0],targetOffset:Z},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:Z},leftBottom:{points:["br","bl"],overflow:ee,offset:[-4,0],targetOffset:Z}},O=null,v=I(92310),y=I.n(v);function u(M){var w=M.children,k=M.prefixCls,K=M.id,b=M.overlayInnerStyle,U=M.className,j=M.style;return V.createElement("div",{className:y()("".concat(k,"-content"),U),style:j},V.createElement("div",{className:"".concat(k,"-inner"),id:K,role:"tooltip",style:b},typeof w=="function"?w():w))}var _=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],m=function(w,k){var K=w.overlayClassName,b=w.trigger,U=b===void 0?["hover"]:b,j=w.mouseEnterDelay,H=j===void 0?0:j,ce=w.mouseLeaveDelay,_e=ce===void 0?.1:ce,re=w.overlayStyle,Y=w.prefixCls,T=Y===void 0?"rc-tooltip":Y,S=w.children,R=w.onVisibleChange,x=w.afterVisibleChange,$=w.transitionName,C=w.animation,d=w.motion,p=w.placement,P=p===void 0?"right":p,W=w.align,se=W===void 0?{}:W,ve=w.destroyTooltipOnHide,ye=ve===void 0?!1:ve,Re=w.defaultVisible,Ge=w.getTooltipContainer,nt=w.overlayInnerStyle,pt=w.arrowContent,lt=w.overlay,dt=w.id,yt=w.showArrow,et=yt===void 0?!0:yt,Gt=(0,ae.Z)(w,_),it=(0,V.useRef)(null);(0,V.useImperativeHandle)(k,function(){return it.current});var he=(0,Q.Z)({},Gt);"visible"in w&&(he.popupVisible=w.visible);var Oe=function(){return V.createElement(u,{key:"content",prefixCls:T,id:dt,overlayInnerStyle:nt},lt)};return V.createElement(ne.Z,(0,z.Z)({popupClassName:K,prefixCls:T,popup:Oe,action:U,builtinPlacements:o,popupPlacement:P,ref:it,popupAlign:se,getPopupContainer:Ge,onPopupVisibleChange:R,afterPopupVisibleChange:x,popupTransitionName:$,popupAnimation:C,popupMotion:d,defaultPopupVisible:Re,autoDestroy:ye,mouseLeaveDelay:_e,popupStyle:re,mouseEnterDelay:H,arrow:et},he),S)},N=(0,V.forwardRef)(m),F=N},49658:function(qe,xe){"use strict";xe.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var I=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(I)||/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(I==null?void 0:I.substr(0,4))}},83145:function(qe,xe,I){"use strict";Object.defineProperty(xe,"__esModule",{value:!0}),xe.CopyToClipboard=void 0;var z=ae(I(59301)),Q=ae(I(25769));function ae(w){return w&&w.__esModule?w:{default:w}}function ne(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ne=function(K){return typeof K}:ne=function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},ne(w)}function V(w,k){var K=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);k&&(b=b.filter(function(U){return Object.getOwnPropertyDescriptor(w,U).enumerable})),K.push.apply(K,b)}return K}function q(w){for(var k=1;k<arguments.length;k++){var K=arguments[k]!=null?arguments[k]:{};k%2?V(K,!0).forEach(function(b){F(w,b,K[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(K)):V(K).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(K,b))})}return w}function ee(w,k){if(w==null)return{};var K=Z(w,k),b,U;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(w);for(U=0;U<j.length;U++)b=j[U],!(k.indexOf(b)>=0)&&Object.prototype.propertyIsEnumerable.call(w,b)&&(K[b]=w[b])}return K}function Z(w,k){if(w==null)return{};var K={},b=Object.keys(w),U,j;for(j=0;j<b.length;j++)U=b[j],!(k.indexOf(U)>=0)&&(K[U]=w[U]);return K}function o(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}function O(w,k){for(var K=0;K<k.length;K++){var b=k[K];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}function v(w,k,K){return k&&O(w.prototype,k),K&&O(w,K),w}function y(w,k){return k&&(ne(k)==="object"||typeof k=="function")?k:_(w)}function u(w){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(K){return K.__proto__||Object.getPrototypeOf(K)},u(w)}function _(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function m(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),k&&N(w,k)}function N(w,k){return N=Object.setPrototypeOf||function(b,U){return b.__proto__=U,b},N(w,k)}function F(w,k,K){return k in w?Object.defineProperty(w,k,{value:K,enumerable:!0,configurable:!0,writable:!0}):w[k]=K,w}var M=function(w){m(k,w);function k(){var K,b;o(this,k);for(var U=arguments.length,j=new Array(U),H=0;H<U;H++)j[H]=arguments[H];return b=y(this,(K=u(k)).call.apply(K,[this].concat(j))),F(_(b),"onClick",function(ce){var _e=b.props,re=_e.text,Y=_e.onCopy,T=_e.children,S=_e.options,R=z.default.Children.only(T),x=(0,Q.default)(re,S);Y&&Y(re,x),R&&R.props&&typeof R.props.onClick=="function"&&R.props.onClick(ce)}),b}return v(k,[{key:"render",value:function(){var b=this.props,U=b.text,j=b.onCopy,H=b.options,ce=b.children,_e=ee(b,["text","onCopy","options","children"]),re=z.default.Children.only(ce);return z.default.cloneElement(re,q({},_e,{onClick:this.onClick}))}}]),k}(z.default.PureComponent);xe.CopyToClipboard=M,F(M,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(qe,xe,I){"use strict";var z=I(83145),Q=z.CopyToClipboard;Q.CopyToClipboard=Q,qe.exports=Q},76374:function(qe,xe,I){"use strict";var z=function(){if(typeof Map!="undefined")return Map;function T(S,R){var x=-1;return S.some(function($,C){return $[0]===R?(x=C,!0):!1}),x}return function(){function S(){this.__entries__=[]}return Object.defineProperty(S.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),S.prototype.get=function(R){var x=T(this.__entries__,R),$=this.__entries__[x];return $&&$[1]},S.prototype.set=function(R,x){var $=T(this.__entries__,R);~$?this.__entries__[$][1]=x:this.__entries__.push([R,x])},S.prototype.delete=function(R){var x=this.__entries__,$=T(x,R);~$&&x.splice($,1)},S.prototype.has=function(R){return!!~T(this.__entries__,R)},S.prototype.clear=function(){this.__entries__.splice(0)},S.prototype.forEach=function(R,x){x===void 0&&(x=null);for(var $=0,C=this.__entries__;$<C.length;$++){var d=C[$];R.call(x,d[1],d[0])}},S}()}(),Q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ae=function(){return typeof I.g!="undefined"&&I.g.Math===Math?I.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ne=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ae):function(T){return setTimeout(function(){return T(Date.now())},1e3/60)}}(),V=2;function q(T,S){var R=!1,x=!1,$=0;function C(){R&&(R=!1,T()),x&&p()}function d(){ne(C)}function p(){var P=Date.now();if(R){if(P-$<V)return;x=!0}else R=!0,x=!1,setTimeout(d,S);$=P}return p}var ee=20,Z=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",O=function(){function T(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=q(this.refresh.bind(this),ee)}return T.prototype.addObserver=function(S){~this.observers_.indexOf(S)||this.observers_.push(S),this.connected_||this.connect_()},T.prototype.removeObserver=function(S){var R=this.observers_,x=R.indexOf(S);~x&&R.splice(x,1),!R.length&&this.connected_&&this.disconnect_()},T.prototype.refresh=function(){var S=this.updateObservers_();S&&this.refresh()},T.prototype.updateObservers_=function(){var S=this.observers_.filter(function(R){return R.gatherActive(),R.hasActive()});return S.forEach(function(R){return R.broadcastActive()}),S.length>0},T.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)},T.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)},T.prototype.onTransitionEnd_=function(S){var R=S.propertyName,x=R===void 0?"":R,$=Z.some(function(C){return!!~x.indexOf(C)});$&&this.refresh()},T.getInstance=function(){return this.instance_||(this.instance_=new T),this.instance_},T.instance_=null,T}(),v=function(T,S){for(var R=0,x=Object.keys(S);R<x.length;R++){var $=x[R];Object.defineProperty(T,$,{value:S[$],enumerable:!1,writable:!1,configurable:!0})}return T},y=function(T){var S=T&&T.ownerDocument&&T.ownerDocument.defaultView;return S||ae},u=U(0,0,0,0);function _(T){return parseFloat(T)||0}function m(T){for(var S=[],R=1;R<arguments.length;R++)S[R-1]=arguments[R];return S.reduce(function(x,$){var C=T["border-"+$+"-width"];return x+_(C)},0)}function N(T){for(var S=["top","right","bottom","left"],R={},x=0,$=S;x<$.length;x++){var C=$[x],d=T["padding-"+C];R[C]=_(d)}return R}function F(T){var S=T.getBBox();return U(0,0,S.width,S.height)}function M(T){var S=T.clientWidth,R=T.clientHeight;if(!S&&!R)return u;var x=y(T).getComputedStyle(T),$=N(x),C=$.left+$.right,d=$.top+$.bottom,p=_(x.width),P=_(x.height);if(x.boxSizing==="border-box"&&(Math.round(p+C)!==S&&(p-=m(x,"left","right")+C),Math.round(P+d)!==R&&(P-=m(x,"top","bottom")+d)),!k(T)){var W=Math.round(p+C)-S,se=Math.round(P+d)-R;Math.abs(W)!==1&&(p-=W),Math.abs(se)!==1&&(P-=se)}return U($.left,$.top,p,P)}var w=function(){return typeof SVGGraphicsElement!="undefined"?function(T){return T instanceof y(T).SVGGraphicsElement}:function(T){return T instanceof y(T).SVGElement&&typeof T.getBBox=="function"}}();function k(T){return T===y(T).document.documentElement}function K(T){return Q?w(T)?F(T):M(T):u}function b(T){var S=T.x,R=T.y,x=T.width,$=T.height,C=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,d=Object.create(C.prototype);return v(d,{x:S,y:R,width:x,height:$,top:R,right:S+x,bottom:$+R,left:S}),d}function U(T,S,R,x){return{x:T,y:S,width:R,height:x}}var j=function(){function T(S){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=U(0,0,0,0),this.target=S}return T.prototype.isActive=function(){var S=K(this.target);return this.contentRect_=S,S.width!==this.broadcastWidth||S.height!==this.broadcastHeight},T.prototype.broadcastRect=function(){var S=this.contentRect_;return this.broadcastWidth=S.width,this.broadcastHeight=S.height,S},T}(),H=function(){function T(S,R){var x=b(R);v(this,{target:S,contentRect:x})}return T}(),ce=function(){function T(S,R,x){if(this.activeObservations_=[],this.observations_=new z,typeof S!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=S,this.controller_=R,this.callbackCtx_=x}return T.prototype.observe=function(S){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(S instanceof y(S).Element))throw new TypeError('parameter 1 is not of type "Element".');var R=this.observations_;R.has(S)||(R.set(S,new j(S)),this.controller_.addObserver(this),this.controller_.refresh())}},T.prototype.unobserve=function(S){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(S instanceof y(S).Element))throw new TypeError('parameter 1 is not of type "Element".');var R=this.observations_;R.has(S)&&(R.delete(S),R.size||this.controller_.removeObserver(this))}},T.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},T.prototype.gatherActive=function(){var S=this;this.clearActive(),this.observations_.forEach(function(R){R.isActive()&&S.activeObservations_.push(R)})},T.prototype.broadcastActive=function(){if(this.hasActive()){var S=this.callbackCtx_,R=this.activeObservations_.map(function(x){return new H(x.target,x.broadcastRect())});this.callback_.call(S,R,S),this.clearActive()}},T.prototype.clearActive=function(){this.activeObservations_.splice(0)},T.prototype.hasActive=function(){return this.activeObservations_.length>0},T}(),_e=typeof WeakMap!="undefined"?new WeakMap:new z,re=function(){function T(S){if(!(this instanceof T))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var R=O.getInstance(),x=new ce(S,R,this);_e.set(this,x)}return T}();["observe","unobserve","disconnect"].forEach(function(T){re.prototype[T]=function(){var S;return(S=_e.get(this))[T].apply(S,arguments)}});var Y=function(){return typeof ae.ResizeObserver!="undefined"?ae.ResizeObserver:re}();xe.Z=Y},98040:function(qe){qe.exports=function(){var xe=document.getSelection();if(!xe.rangeCount)return function(){};for(var I=document.activeElement,z=[],Q=0;Q<xe.rangeCount;Q++)z.push(xe.getRangeAt(Q));switch(I.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":I.blur();break;default:I=null;break}return xe.removeAllRanges(),function(){xe.type==="Caret"&&xe.removeAllRanges(),xe.rangeCount||z.forEach(function(ae){xe.addRange(ae)}),I&&I.focus()}}},40846:function(qe,xe,I){"use strict";I.d(xe,{ZP:function(){return _r}});function z(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Q={exports:{}};(function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,h,f){if(f=f||{},c=c.trim(),h=h.trim(),!h){if(!f.alwaysNormalize)return c;var g=l.parseURL(c);if(!g)throw new Error("Error trying to parse base URL.");return g.path=l.normalizePath(g.path),l.buildURLFromParts(g)}var E=l.parseURL(h);if(!E)throw new Error("Error trying to parse relative URL.");if(E.scheme)return f.alwaysNormalize?(E.path=l.normalizePath(E.path),l.buildURLFromParts(E)):h;var L=l.parseURL(c);if(!L)throw new Error("Error trying to parse base URL.");if(!L.netLoc&&L.path&&L.path[0]!=="/"){var A=i.exec(L.path);L.netLoc=A[1],L.path=A[2]}L.netLoc&&!L.path&&(L.path="/");var D={scheme:L.scheme,netLoc:E.netLoc,path:null,params:E.params,query:E.query,fragment:E.fragment};if(!E.netLoc&&(D.netLoc=L.netLoc,E.path[0]!=="/"))if(!E.path)D.path=L.path,E.params||(D.params=L.params,E.query||(D.query=L.query));else{var B=L.path,X=B.substring(0,B.lastIndexOf("/")+1)+E.path;D.path=l.normalizePath(X)}return D.path===null&&(D.path=f.alwaysNormalize?l.normalizePath(E.path):E.path),l.buildURLFromParts(D)},parseURL:function(c){var h=n.exec(c);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=l})()})(Q);var ae=Q.exports;function ne(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function V(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ne(Object(t),!0).forEach(function(n){Z(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function q(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function ee(a){var e=q(a,"string");return typeof e=="symbol"?e:String(e)}function Z(a,e,t){return e=ee(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function o(){return o=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},o.apply(this,arguments)}const O=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},v=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=y},y=Number.MAX_SAFE_INTEGER||9007199254740991;let u=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a}({}),_=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),m=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.UNKNOWN="unknown",a}({});const N=function(){},F={trace:N,debug:N,log:N,warn:N,info:N,error:N};let M=F;function w(a){const e=self.console[a];return e?e.bind(self.console,`[${a}] >`):N}function k(a,...e){e.forEach(function(t){M[t]=a[t]?a[t].bind(a):w(t)})}function K(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){k(a,"debug","log","info","warn","error");try{M.log(`Debug logs enabled for "${e}" in hls.js version 1.5.20`)}catch(t){M=F}}else M=F}const b=M,U=/^(\d+)x(\d+)$/,j=/(.+?)=(".*?"|.*?)(?:,|$)/g;class H{constructor(e){typeof e=="string"&&(e=H.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;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=U.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(j.lastIndex=0;(t=j.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 ce(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function _e(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class re{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]){b.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=o(new H({}),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"]);O(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(O(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&&O(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Y{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 T={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class S{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[T.AUDIO]:null,[T.VIDEO]:null,[T.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=ae.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class R extends S{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 Y,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||!O(this.programDateTime))return null;const e=O(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,c=l[e];if(!c){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[T.AUDIO]=null,e[T.VIDEO]=null,e[T.AUDIOVIDEO]=null}}class x extends S{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 Y,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 $=10;class C{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?O(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||$}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 d(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function p(a){const e=se(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function P(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 W(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=d(s)):t=p(s)}}return t}function se(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const ve=typeof self!="undefined"?self:void 0;var ye={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Re={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Ge(a){switch(a){case Re.FAIRPLAY:return ye.FAIRPLAY;case Re.PLAYREADY:return ye.PLAYREADY;case Re.WIDEVINE:return ye.WIDEVINE;case Re.CLEARKEY:return ye.CLEARKEY}}var nt={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function pt(a){if(a===nt.WIDEVINE)return ye.WIDEVINE;if(a===nt.PLAYREADY)return ye.PLAYREADY;if(a===nt.CENC||a===nt.CLEARKEY)return ye.CLEARKEY}function lt(a){switch(a){case ye.FAIRPLAY:return Re.FAIRPLAY;case ye.PLAYREADY:return Re.PLAYREADY;case ye.WIDEVINE:return Re.WIDEVINE;case ye.CLEARKEY:return Re.CLEARKEY}}function dt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[ye.FAIRPLAY,ye.WIDEVINE,ye.PLAYREADY,ye.CLEARKEY].filter(i=>!!e[i]):[];return!n[ye.WIDEVINE]&&t&&n.push(ye.WIDEVINE),n}const yt=function(a){return ve!=null&&(a=ve.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function et(a,e,t,n){let i;switch(a){case ye.FAIRPLAY:i=["cenc","sinf"];break;case ye.WIDEVINE:case ye.PLAYREADY:i=["cenc"];break;case ye.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Gt(i,e,t,n)}function Gt(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 it(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 c=d(l).subarray(0,16);return P(c),c}}return null}function he(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const Oe=(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,pe=(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,Me=(a,e)=>{const t=e;let n=0;for(;Oe(a,e);){n+=10;const i=$e(a,e+6);n+=i,pe(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)},$e=(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},G=(a,e)=>Oe(a,e)&&$e(a,e+6)+10<=a.length-e,te=a=>{const e=Ie(a);for(let t=0;t<e.length;t++){const n=e[t];if(ue(n))return Tt(n)}},ue=a=>a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",Ae=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=$e(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}},Ie=a=>{let e=0;const t=[];for(;Oe(a,e);){const n=$e(a,e+6);e+=10;const i=e+n;for(;e+8<i;){const r=Ae(a.subarray(e)),s=He(r);s&&t.push(s),e+=r.size+10}pe(a,e)&&(e+=10)}return t},He=a=>a.type==="PRIV"?ct(a):a.type[0]==="W"?st(a):gt(a),ct=a=>{if(a.size<2)return;const e=wt(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},gt=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=wt(a.data.subarray(t),!0);t+=n.length+1;const i=wt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=wt(a.data.subarray(1));return{key:a.type,data:e}},st=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=wt(a.data.subarray(t),!0);t+=n.length+1;const i=wt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=wt(a.data);return{key:a.type,data:e}},Tt=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)}},wt=(a,e=!1)=>{const t=Ct();if(t){const h=t.decode(a);if(e){const f=h.indexOf("\0");return f!==-1?h.substring(0,f):h}return h.replace(/\0/g,"")}const n=a.length;let i,r,s,l="",c=0;for(;c<n;){if(i=a[c++],i===0&&e)return l;if(i===0||i===3)continue;switch(i>>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[c++],l+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[c++],s=a[c++],l+=String.fromCharCode((i&15)<<12|(r&63)<<6|(s&63)<<0);break}}return l};let At;function Ct(){if(!navigator.userAgent.includes("PlayStation 4"))return!At&&typeof self.TextDecoder!="undefined"&&(At=new self.TextDecoder("utf-8")),At}const bt={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}},It=Math.pow(2,32)-1,Ye=[].push,hn={video:1,audio:2,id3:3,text:4};function Ve(a){return String.fromCharCode.apply(null,a)}function Se(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function me(a,e){const t=Dt(a,e);return t<0?4294967296+t:t}function Fe(a,e){let t=me(a,e);return t*=Math.pow(2,32),t+=me(a,e+4),t}function Dt(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function ut(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Et(a){const e=a.byteLength;for(let t=0;t<e;){const n=me(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function Ke(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=me(a,i),s=Ve(a.subarray(i+4,i+8)),l=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,l));else{const c=Ke(a.subarray(i+8,l),e.slice(1));c.length&&Ye.apply(t,c)}i=l}return t}function _t(a){const e=[],t=a[0];let n=8;const i=me(a,n);n+=4;let r=0,s=0;t===0?(r=me(a,n),s=me(a,n+4),n+=8):(r=Fe(a,n),s=Fe(a,n+8),n+=16),n+=2;let l=a.length+s;const c=Se(a,n);n+=2;for(let h=0;h<c;h++){let f=n;const g=me(a,f);f+=4;const E=g&2147483647;if((g&2147483648)>>>31===1)return b.warn("SIDX has hierarchical references (not supported)"),null;const A=me(a,f);f+=4,e.push({referenceSize:E,subsegmentDuration:A,info:{duration:A/i,start:l,end:l+E-1}}),l+=E,f+=4,n=f}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function rt(a){const e=[],t=Ke(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=Ke(r,["tkhd"])[0];if(s){let l=s[0];const c=me(s,l===0?12:20),h=Ke(r,["mdia","mdhd"])[0];if(h){l=h[0];const f=me(h,l===0?12:20),g=Ke(r,["mdia","hdlr"])[0];if(g){const E=Ve(g.subarray(8,12)),L={soun:T.AUDIO,vide:T.VIDEO}[E];if(L){const A=Ke(r,["mdia","minf","stbl","stsd"])[0],D=xt(A);e[c]={timescale:f,type:L},e[L]=V({timescale:f,id:c},D)}}}}}return Ke(a,["moov","mvex","trex"]).forEach(i=>{const r=me(i,4),s=e[r];s&&(s.default={duration:me(i,12),flags:me(i,20)})}),e}function xt(a){const e=a.subarray(8),t=e.subarray(86),n=Ve(e.subarray(4,8));let i=n;const r=n==="enca"||n==="encv";if(r){const l=Ke(e,[n])[0].subarray(n==="enca"?28:78);Ke(l,["sinf"]).forEach(h=>{const f=Ke(h,["schm"])[0];if(f){const g=Ve(f.subarray(4,8));if(g==="cbcs"||g==="cenc"){const E=Ke(h,["frma"])[0];E&&(i=Ve(E))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const s=Ke(t,["avcC"])[0];i+="."+vt(s[1])+vt(s[2])+vt(s[3]);break}case"mp4a":{const s=Ke(e,[n])[0],l=Ke(s.subarray(28),["esds"])[0];if(l&&l.length>12){let c=4;if(l[c++]!==3)break;c=ot(l,c),c+=2;const h=l[c++];if(h&128&&(c+=2),h&64&&(c+=l[c++]),l[c++]!==4)break;c=ot(l,c);const f=l[c++];if(f===64)i+="."+vt(f);else break;if(c+=12,l[c++]!==5)break;c=ot(l,c);const g=l[c++];let E=(g&248)>>3;E===31&&(E+=1+((g&7)<<3)+((l[c]&224)>>5)),i+="."+E}break}case"hvc1":case"hev1":{const s=Ke(t,["hvcC"])[0],l=s[1],c=["","A","B","C"][l>>6],h=l&31,f=me(s,2),g=(l&32)>>5?"H":"L",E=s[12],L=s.subarray(6,12);i+="."+c+h,i+="."+f.toString(16).toUpperCase(),i+="."+g+E;let A="";for(let D=L.length;D--;){const B=L[D];(B||A)&&(A="."+B.toString(16).toUpperCase()+A)}i+=A;break}case"dvh1":case"dvhe":{const s=Ke(t,["dvcC"])[0],l=s[2]>>1&127,c=s[2]<<5&32|s[3]>>3&31;i+="."+$t(l)+"."+$t(c);break}case"vp09":{const s=Ke(t,["vpcC"])[0],l=s[4],c=s[5],h=s[6]>>4&15;i+="."+$t(l)+"."+$t(c)+"."+$t(h);break}case"av01":{const s=Ke(t,["av1C"])[0],l=s[1]>>>5,c=s[1]&31,h=s[2]>>>7?"H":"M",f=(s[2]&64)>>6,g=(s[2]&32)>>5,E=l===2&&f?g?12:10:f?10:8,L=(s[2]&16)>>4,A=(s[2]&8)>>3,D=(s[2]&4)>>2,B=s[2]&3;i+="."+l+"."+$t(c)+h+"."+$t(E)+"."+L+"."+A+D+B+"."+$t(1)+"."+$t(1)+"."+$t(1)+"."+0;break}}return{codec:i,encrypted:r}}function ot(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function vt(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function $t(a){return(a<10?"0":"")+a}function en(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&Ke(a,["moov","trak"]).forEach(i=>{const s=Ke(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=Ke(s,["enca"]);const c=l.length>0;c||(l=Ke(s,["encv"])),l.forEach(h=>{const f=c?h.subarray(28):h.subarray(78);Ke(f,["sinf"]).forEach(E=>{const L=fn(E);if(L){const A=L.subarray(8,24);A.some(D=>D!==0)||(b.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${bt.hexDump(A)} -> ${bt.hexDump(t)}`),L.set(t,8))}})})}),a}function fn(a){const e=Ke(a,["schm"])[0];if(e){const t=Ve(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Ke(a,["schi","tenc"])[0]}return null}function Wt(a,e){return Ke(e,["moof","traf"]).reduce((t,n)=>{const i=Ke(n,["tfdt"])[0],r=i[0],s=Ke(n,["tfhd"]).reduce((l,c)=>{const h=me(c,4),f=a[h];if(f){let g=me(i,4);if(r===1){if(g===It)return b.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;g*=It+1,g+=me(i,8)}const E=f.timescale||9e4,L=g/E;if(O(L)&&(l===null||L<l))return L}return l},null);return s!==null&&O(s)&&(t===null||s<t)?s:t},null)}function Zt(a,e){let t=0,n=0,i=0;const r=Ke(a,["moof","traf"]);for(let s=0;s<r.length;s++){const l=r[s],c=Ke(l,["tfhd"])[0],h=me(c,4),f=e[h];if(!f)continue;const g=f.default,E=me(c,0)|(g==null?void 0:g.flags);let L=g==null?void 0:g.duration;E&8&&(E&2?L=me(c,12):L=me(c,8));const A=f.timescale||9e4,D=Ke(l,["trun"]);for(let B=0;B<D.length;B++){if(t=Fn(D[B]),!t&&L){const X=me(D[B],4);t=L*X}f.type===T.VIDEO?n+=t/A:f.type===T.AUDIO&&(i+=t/A)}}if(n===0&&i===0){let s=1/0,l=0,c=0;const h=Ke(a,["sidx"]);for(let f=0;f<h.length;f++){const g=_t(h[f]);if(g!=null&&g.references){s=Math.min(s,g.earliestPresentationTime/g.timescale);const E=g.references.reduce((L,A)=>L+A.info.duration||0,0);l=Math.max(l,E+g.earliestPresentationTime/g.timescale),c=l-s}}if(c&&O(c))return c}return n||i}function Fn(a){const e=me(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=me(a,4);for(let r=0;r<i;r++){if(e&256){const s=me(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function xn(a,e,t){Ke(e,["moof","traf"]).forEach(n=>{Ke(n,["tfhd"]).forEach(i=>{const r=me(i,4),s=a[r];if(!s)return;const l=s.timescale||9e4;Ke(n,["tfdt"]).forEach(c=>{const h=c[0],f=t*l;if(f){let g=me(c,4);if(h===0)g-=f,g=Math.max(g,0),ut(c,4,g);else{g*=Math.pow(2,32),g+=me(c,8),g-=f,g=Math.max(g,0);const E=Math.floor(g/(It+1)),L=Math.floor(g%(It+1));ut(c,4,E),ut(c,8,L)}}})})})}function qn(a){const e={valid:null,remainder:null},t=Ke(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=he(a,0,n.byteOffset-8),e.remainder=he(a,n.byteOffset-8),e}function Yt(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function an(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return Ke(n,["moof"]).map(c=>{const h=c.byteOffset-8;Ke(c,["traf"]).map(g=>{const E=Ke(g,["tfdt"]).map(L=>{const A=L[0];let D=me(L,4);return A===1&&(D*=Math.pow(2,32),D+=me(L,8)),D/i})[0];return E!==void 0&&(a=E),Ke(g,["tfhd"]).map(L=>{const A=me(L,4),D=me(L,0)&16777215,B=(D&1)!==0,X=(D&2)!==0,le=(D&8)!==0;let oe=0;const we=(D&16)!==0;let de=0;const Pe=(D&32)!==0;let Te=8;A===r&&(B&&(Te+=8),X&&(Te+=4),le&&(oe=me(L,Te),Te+=4),we&&(de=me(L,Te),Te+=4),Pe&&(Te+=4),e.type==="video"&&(s=Qt(e.codec)),Ke(g,["trun"]).map(Be=>{const ze=Be[0],Le=me(Be,0)&16777215,Ue=(Le&1)!==0;let Nt=0;const Qe=(Le&4)!==0,Mt=(Le&256)!==0;let Ot=0;const Rt=(Le&512)!==0;let ln=0;const vn=(Le&1024)!==0,ft=(Le&2048)!==0;let Je=0;const cn=me(Be,4);let Vt=8;Ue&&(Nt=me(Be,Vt),Vt+=4),Qe&&(Vt+=4);let gn=Nt+h;for(let Jn=0;Jn<cn;Jn++){if(Mt?(Ot=me(Be,Vt),Vt+=4):Ot=oe,Rt?(ln=me(Be,Vt),Vt+=4):ln=de,vn&&(Vt+=4),ft&&(ze===0?Je=me(Be,Vt):Je=Dt(Be,Vt),Vt+=4),e.type===T.VIDEO){let li=0;for(;li<ln;){const pi=me(n,gn);if(gn+=4,Sn(s,n[gn])){const Gi=n.subarray(gn,gn+pi);Zn(Gi,s?2:1,a+Je/i,t)}gn+=pi,li+=pi+4}}a+=Ot/i}}))})})}),t}function Qt(a){if(!a)return!1;const e=a.indexOf("."),t=e<0?a:a.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function Sn(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Zn(a,e,t,n){const i=Bn(a);let r=0;r+=e;let s=0,l=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);l=0;do{if(r>=i.length)break;c=i[r++],l+=c}while(c===255);const h=i.length-r;let f=r;if(l<h)r+=l;else if(l>h){b.error(`Malformed SEI payload. ${l} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(i[f++]===181){const E=Se(i,f);if(f+=2,E===49){const L=me(i,f);if(f+=4,L===1195456820){const A=i[f++];if(A===3){const D=i[f++],B=31&D,X=64&D,le=X?2+B*3:0,oe=new Uint8Array(le);if(X){oe[0]=D;for(let we=1;we<le;we++)oe[we]=i[f++]}n.push({type:A,payloadType:s,pts:t,bytes:oe})}}}}}else if(s===5&&l>16){const g=[];for(let A=0;A<16;A++){const D=i[f++].toString(16);g.push(D.length==1?"0"+D:D),(A===3||A===5||A===7||A===9)&&g.push("-")}const E=l-16,L=new Uint8Array(E);for(let A=0;A<E;A++)L[A]=i[f++];n.push({payloadType:s,pts:t,uuid:g.join(""),userData:wt(L),userDataBytes:L})}}}function Bn(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function gi(a){const e=a[0];let t="",n="",i=0,r=0,s=0,l=0,c=0,h=0;if(e===0){for(;Ve(a.subarray(h,h+1))!=="\0";)t+=Ve(a.subarray(h,h+1)),h+=1;for(t+=Ve(a.subarray(h,h+1)),h+=1;Ve(a.subarray(h,h+1))!=="\0";)n+=Ve(a.subarray(h,h+1)),h+=1;n+=Ve(a.subarray(h,h+1)),h+=1,i=me(a,12),r=me(a,16),l=me(a,20),c=me(a,24),h=28}else if(e===1){h+=4,i=me(a,h),h+=4;const g=me(a,h);h+=4;const E=me(a,h);for(h+=4,s=Za(2,32)*g+E,v(s)||(s=Number.MAX_SAFE_INTEGER,b.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=me(a,h),h+=4,c=me(a,h),h+=4;Ve(a.subarray(h,h+1))!=="\0";)t+=Ve(a.subarray(h,h+1)),h+=1;for(t+=Ve(a.subarray(h,h+1)),h+=1;Ve(a.subarray(h,h+1))!=="\0";)n+=Ve(a.subarray(h,h+1)),h+=1;n+=Ve(a.subarray(h,h+1)),h+=1}const f=a.subarray(h,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:l,id:c,payload:f}}function mn(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function ti(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;if(e){n=1,i=new Uint8Array(e.length*16);for(let l=0;l<e.length;l++){const c=e[l];if(c.byteLength!==16)throw new RangeError("Invalid key");i.set(c,l*16)}}else n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),mn([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function Yn(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=Un(i);e.push(r),n+=r.size}}return e}function Un(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,l=bt.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let h=null,f=null;if(r===0){if(e-32<c||c<22)return{offset:t,size:e};f=new Uint8Array(s,t+32,c)}else if(r===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};h=[];for(let g=0;g<c;g++)h.push(new Uint8Array(s,t+32+g*16,16))}return{version:r,systemId:l,kids:h,data:f,offset:t,size:e}}let $n={};class Kt{static clearKeyUriToKeyIdMap(){$n={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Re.FAIRPLAY:case Re.WIDEVINE:case Re.PLAYREADY:case Re.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&b.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=ni(e);return new Kt(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=W(this.uri);if(t)switch(this.keyFormat){case Re.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Re.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ti(n,null,t),this.keyId=it(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=$n[this.uri];if(!n){const i=Object.keys($n).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),$n[this.uri]=n}this.keyId=n}return this}}function ni(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Tn=/\{\$([a-zA-Z0-9-_]+)\}/g;function xi(a){return Tn.test(a)}function Ft(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]=tn(a,r))}}function tn(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Tn,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 mi(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 dn(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 Rn(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ai(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}const yn={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 mt(a,e){const t=yn[e];return!!t&&!!t[a.slice(0,4)]}function J(a,e,t=!0){return!a.split(",").some(n=>!fe(n,e,t))}function fe(a,e,t=!0){var n;const i=Rn(t);return(n=i==null?void 0:i.isTypeSupported(Ee(a,e)))!=null?n:!1}function Ee(a,e){return`${e}/mp4;codecs="${a}"`}function De(a){if(a){const e=a.substring(0,4);return yn.video[e]}return 2}function be(a){return a.split(",").reduce((e,t)=>{const n=yn.video[t];return n?(n*2+e)/(e?3:2):(yn.audio[t]+e)/(e?2:1)},0)}const Ne={};function ke(a,e=!0){if(Ne[a])return Ne[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let n=0;n<t.length;n++)if(fe(t[n],"audio",e))return Ne[a]=t[n],t[n];return a}const ie=/flac|opus/i;function je(a,e=!0){return a.replace(ie,t=>ke(t.toLowerCase(),e))}function Ze(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function Ht(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const ht=/#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,kt=/#EXT-X-MEDIA:(.*)/g,Lt=/^#EXT(?:INF|-X-TARGETDURATION):/m,at=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"),nn=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 Pt{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return ae.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Lt.test(e)}static parseMasterPlaylist(e,t){const n=xi(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];ht.lastIndex=0;let s;for(;(s=ht.exec(e))!=null;)if(s[1]){var l;const h=new H(s[1]);Ft(i,h,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const f=tn(i,s[2]),g={attrs:h,bitrate:h.decimalInteger("BANDWIDTH")||h.decimalInteger("AVERAGE-BANDWIDTH"),name:h.NAME,url:Pt.resolve(f,t)},E=h.decimalResolution("RESOLUTION");E&&(g.width=E.width,g.height=E.height),jt(h.CODECS,g),(l=g.unknownCodecs)!=null&&l.length||r.push(g),i.levels.push(g)}else if(s[3]){const h=s[3],f=s[4];switch(h){case"SESSION-DATA":{const g=new H(f);Ft(i,g,["DATA-ID","LANGUAGE","VALUE","URI"]);const E=g["DATA-ID"];E&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[E]=g);break}case"SESSION-KEY":{const g=on(f,t,i);g.encrypted&&g.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(g)):b.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const g=new H(f);Ft(i,g,["NAME","VALUE","QUERYPARAM"]),mi(i,g,t)}break}case"CONTENT-STEERING":{const g=new H(f);Ft(i,g,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:Pt.resolve(g["SERVER-URI"],t),pathwayId:g["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=zt(f);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,l={AUDIO:s.map(h=>({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(kt.lastIndex=0;(i=kt.exec(e))!==null;){const h=new H(i[1]),f=h.TYPE;if(f){const g=l[f],E=r[f]||[];r[f]=E,Ft(n,h,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const L=h.LANGUAGE,A=h["ASSOC-LANGUAGE"],D=h.CHANNELS,B=h.CHARACTERISTICS,X=h["INSTREAM-ID"],le={attrs:h,bitrate:0,id:c++,groupId:h["GROUP-ID"]||"",name:h.NAME||L||"",type:f,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:L,url:h.URI?Pt.resolve(h.URI,t):""};if(A&&(le.assocLang=A),D&&(le.channels=D),B&&(le.characteristics=B),X&&(le.instreamId=X),g!=null&&g.length){const oe=Pt.findGroup(g,le.groupId)||g[0];Bt(le,oe,"audioCodec"),Bt(le,oe,"textCodec")}E.push(le)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){const l=new C(t),c=l.fragments;let h=null,f=0,g=0,E=0,L=0,A=null,D=new R(i,t),B,X,le,oe=-1,we=!1,de=null;for(at.lastIndex=0,l.m3u8=e,l.hasVariableRefs=xi(e);(B=at.exec(e))!==null;){we&&(we=!1,D=new R(i,t),D.start=E,D.sn=f,D.cc=L,D.level=n,h&&(D.initSegment=h,D.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,de&&(D.setByteRange(de),de=null)));const ze=B[1];if(ze){D.duration=parseFloat(ze);const Le=(" "+B[2]).slice(1);D.title=Le||null,D.tagList.push(Le?["INF",ze,Le]:["INF",ze])}else if(B[3]){if(O(D.duration)){D.start=E,le&&Jt(D,le,l),D.sn=f,D.level=n,D.cc=L,c.push(D);const Le=(" "+B[3]).slice(1);D.relurl=tn(l,Le),rn(D,A),A=D,E+=D.duration,f++,g=0,we=!0}}else if(B[4]){const Le=(" "+B[4]).slice(1);A?D.setByteRange(Le,A):D.setByteRange(Le)}else if(B[5])D.rawProgramDateTime=(" "+B[5]).slice(1),D.tagList.push(["PROGRAM-DATE-TIME",D.rawProgramDateTime]),oe===-1&&(oe=c.length);else{if(B=B[0].match(nn),!B){b.warn("No matches on slow regex match for level playlist!");continue}for(X=1;X<B.length&&typeof B[X]=="undefined";X++);const Le=(" "+B[X]).slice(1),Ue=(" "+B[X+1]).slice(1),Nt=B[X+2]?(" "+B[X+2]).slice(1):"";switch(Le){case"PLAYLIST-TYPE":l.type=Ue.toUpperCase();break;case"MEDIA-SEQUENCE":f=l.startSN=parseInt(Ue);break;case"SKIP":{const Qe=new H(Ue);Ft(l,Qe,["RECENTLY-REMOVED-DATERANGES"]);const Mt=Qe.decimalInteger("SKIPPED-SEGMENTS");if(O(Mt)){l.skippedSegments=Mt;for(let Rt=Mt;Rt--;)c.unshift(null);f+=Mt}const Ot=Qe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ot&&(l.recentlyRemovedDateranges=Ot.split(" "));break}case"TARGETDURATION":l.targetduration=Math.max(parseInt(Ue),1);break;case"VERSION":l.version=parseInt(Ue);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":(Ue||Nt)&&D.tagList.push(Nt?[Ue,Nt]:[Ue]);break;case"DISCONTINUITY":L++,D.tagList.push(["DIS"]);break;case"GAP":D.gap=!0,D.tagList.push([Le]);break;case"BITRATE":D.tagList.push([Le,Ue]);break;case"DATERANGE":{const Qe=new H(Ue);Ft(l,Qe,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Ft(l,Qe,Qe.clientAttrs);const Mt=new re(Qe,l.dateRanges[Qe.ID]);Mt.isValid||l.skippedSegments?l.dateRanges[Mt.id]=Mt:b.warn(`Ignoring invalid DATERANGE tag: "${Ue}"`),D.tagList.push(["EXT-X-DATERANGE",Ue]);break}case"DEFINE":{{const Qe=new H(Ue);Ft(l,Qe,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in Qe?dn(l,Qe,s):mi(l,Qe,t)}break}case"DISCONTINUITY-SEQUENCE":L=parseInt(Ue);break;case"KEY":{const Qe=on(Ue,t,l);if(Qe.isSupported()){if(Qe.method==="NONE"){le=void 0;break}le||(le={}),le[Qe.keyFormat]&&(le=o({},le)),le[Qe.keyFormat]=Qe}else b.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Ue}"`);break}case"START":l.startTimeOffset=zt(Ue);break;case"MAP":{const Qe=new H(Ue);if(Ft(l,Qe,["BYTERANGE","URI"]),D.duration){const Mt=new R(i,t);Ln(Mt,Qe,n,le),h=Mt,D.initSegment=h,h.rawProgramDateTime&&!D.rawProgramDateTime&&(D.rawProgramDateTime=h.rawProgramDateTime)}else{const Mt=D.byteRangeEndOffset;if(Mt){const Ot=D.byteRangeStartOffset;de=`${Mt-Ot}@${Ot}`}else de=null;Ln(D,Qe,n,le),h=D,we=!0}break}case"SERVER-CONTROL":{const Qe=new H(Ue);l.canBlockReload=Qe.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=Qe.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&Qe.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=Qe.optionalFloat("PART-HOLD-BACK",0),l.holdBack=Qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const Qe=new H(Ue);l.partTarget=Qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Qe=l.partList;Qe||(Qe=l.partList=[]);const Mt=g>0?Qe[Qe.length-1]:void 0,Ot=g++,Rt=new H(Ue);Ft(l,Rt,["BYTERANGE","URI"]);const ln=new x(Rt,D,t,Ot,Mt);Qe.push(ln),D.duration+=ln.duration;break}case"PRELOAD-HINT":{const Qe=new H(Ue);Ft(l,Qe,["URI"]),l.preloadHint=Qe;break}case"RENDITION-REPORT":{const Qe=new H(Ue);Ft(l,Qe,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(Qe);break}default:b.warn(`line parsed but not handled: ${B}`);break}}}A&&!A.relurl?(c.pop(),E-=A.duration,l.partList&&(l.fragmentHint=A)):l.partList&&(rn(D,A),D.cc=L,l.fragmentHint=D,le&&Jt(D,le,l));const Pe=c.length,Te=c[0],Be=c[Pe-1];if(E+=l.skippedSegments*l.targetduration,E>0&&Pe&&Be){l.averagetargetduration=E/Pe;const ze=Be.sn;l.endSN=ze!=="initSegment"?ze:0,l.live||(Be.endList=!0),Te&&(l.startCC=Te.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(E+=l.fragmentHint.duration),l.totalduration=E,l.endCC=L,oe>0&&Ut(c,oe),l}}function on(a,e,t){var n,i;const r=new H(a);Ft(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=r.METHOD)!=null?n:"",l=r.URI,c=r.hexadecimalInteger("IV"),h=r.KEYFORMATVERSIONS,f=(i=r.KEYFORMAT)!=null?i:"identity";l&&r.IV&&!c&&b.error(`Invalid IV: ${r.IV}`);const g=l?Pt.resolve(l,e):"",E=(h||"1").split("/").map(Number).filter(Number.isFinite);return new Kt(s,g,f,E,c)}function zt(a){const t=new H(a).decimalFloatingPoint("TIME-OFFSET");return O(t)?t:null}function jt(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>mt(r,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Bt(a,e,t){const n=e[t];n&&(a[t]=n)}function Ut(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 rn(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),O(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Ln(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 Jt(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 St={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},We={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function In(a){const{type:e}=a;switch(e){case St.AUDIO_TRACK:return We.AUDIO;case St.SUBTITLE_TRACK:return We.SUBTITLE;default:return We.MAIN}}function pn(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class wn{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:St.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:St.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:St.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:St.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){b.trace("[playlist-loader]: playlist request ongoing");return}b.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===St.MANIFEST?r=n.manifestLoadPolicy.default:r=o({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),O((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===St.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===St.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===St.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const f=h.partTarget,g=h.targetduration;if(f&&g){const E=Math.max(f*3,g*.8)*1e3;r=o({},r,{maxTimeToFirstByteMs:Math.min(E,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(E,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},c={onSuccess:(h,f,g,E)=>{const L=this.getInternalLoader(g);this.resetInternalLoader(g.type);const A=h.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,g,new Error("no EXTM3U delimiter"),E||null,f);return}f.parsing.start=performance.now(),Pt.isMediaPlaylist(A)?this.handleTrackOrLevelPlaylist(h,f,g,E||null,L):this.handleMasterPlaylist(h,f,g,E)},onError:(h,f,g,E)=>{this.handleNetworkError(f,g,!1,h,E)},onTimeout:(h,f,g)=>{this.handleNetworkError(f,g,!0,void 0,h)}};i.load(e,l,c)}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,l=pn(e,n),c=Pt.parseMasterPlaylist(s,l);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:h,levels:f,sessionData:g,sessionKeys:E,startTimeOffset:L,variableList:A}=c;this.variableList=A;const{AUDIO:D=[],SUBTITLES:B,"CLOSED-CAPTIONS":X}=Pt.parseMasterPlaylistMedia(s,l,c);D.length&&!D.some(oe=>!oe.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),D.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new H({}),bitrate:0,url:""})),r.trigger(u.MANIFEST_LOADED,{levels:f,audioTracks:D,subtitles:B,captions:X,contentSteering:h,url:l,stats:t,networkDetails:i,sessionData:g,sessionKeys:E,startTimeOffset:L,variableList:A})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:l,level:c,type:h}=n,f=pn(e,n),g=0,E=O(c)?c:O(l)?l:0,L=In(n),A=Pt.parseLevelPlaylist(e.data,f,E,L,g,this.variableList);if(h===St.MANIFEST){const D={attrs:new H({}),bitrate:0,details:A,name:"",url:f};s.trigger(u.MANIFEST_LOADED,{levels:[D],audioTracks:[],url:f,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=A,this.handlePlaylistLoaded(A,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(u.ERROR,{type:_.NETWORK_ERROR,details:m.MANIFEST_PARSING_ERROR,fatal:t.type===St.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===St.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===St.AUDIO_TRACK||e.type===St.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);b.warn(`[playlist-loader]: ${s}`);let c=m.UNKNOWN,h=!1;const f=this.getInternalLoader(e);switch(e.type){case St.MANIFEST:c=n?m.MANIFEST_LOAD_TIMEOUT:m.MANIFEST_LOAD_ERROR,h=!0;break;case St.LEVEL:c=n?m.LEVEL_LOAD_TIMEOUT:m.LEVEL_LOAD_ERROR,h=!1;break;case St.AUDIO_TRACK:c=n?m.AUDIO_TRACK_LOAD_TIMEOUT:m.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case St.SUBTITLE_TRACK:c=n?m.SUBTITLE_TRACK_LOAD_TIMEOUT:m.SUBTITLE_LOAD_ERROR,h=!1;break}f&&this.resetInternalLoader(e.type);const g={type:_.NETWORK_ERROR,details:c,fatal:h,url:e.url,loader:f,context:e,error:l,networkDetails:t,stats:r};if(i){const E=(t==null?void 0:t.url)||e.url;g.response=V({url:E,data:void 0},i)}this.hls.trigger(u.ERROR,g)}handlePlaylistLoaded(e,t,n,i,r,s){const l=this.hls,{type:c,level:h,id:f,groupId:g,deliveryDirectives:E}=i,L=pn(t,i),A=In(i),D=typeof i.level=="number"&&A===We.MAIN?h:void 0;if(!e.fragments.length){const X=new Error("No Segments found in Playlist");l.trigger(u.ERROR,{type:_.NETWORK_ERROR,details:m.LEVEL_EMPTY_ERROR,fatal:!1,url:L,error:X,reason:X.message,response:t,context:i,level:D,parent:A,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const B=e.playlistParsingError;if(B){l.trigger(u.ERROR,{type:_.NETWORK_ERROR,details:m.LEVEL_PARSING_ERROR,fatal:!1,url:L,error:B,reason:B.message,response:t,context:i,level:D,parent:A,networkDetails:r,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case St.MANIFEST:case St.LEVEL:l.trigger(u.LEVEL_LOADED,{details:e,level:D||0,id:f||0,stats:n,networkDetails:r,deliveryDirectives:E});break;case St.AUDIO_TRACK:l.trigger(u.AUDIO_TRACK_LOADED,{details:e,id:f||0,groupId:g||"",stats:n,networkDetails:r,deliveryDirectives:E});break;case St.SUBTITLE_TRACK:l.trigger(u.SUBTITLE_TRACK_LOADED,{details:e,id:f||0,groupId:g||"",stats:n,networkDetails:r,deliveryDirectives:E});break}}}function Kn(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 Hn(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){b.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){b.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Gn(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 An(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=ui(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function jn(a,e){if(e<a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const r=Math.floor((i+n)/2);if(e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r}return a[n].startTime-e<e-a[i].startTime?n:i}function ui(a,e,t){const n=[],i=jn(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const l=a[r];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function sn(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}var Dn={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Ii=.25;function ci(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Si(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,JSON.stringify(i?V({type:i},n):n))}return r}const Xn=(()=>{const a=ci();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Pn(a,e){return a.getTime()/1e3-e}function ii(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class _i{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&&(Gn(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;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return Kn(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ci();if(s)for(let l=0;l<r.length;l++){const c=r[l].type;if(c===Dn.emsg&&!n||!i)continue;const h=Ie(r[l].data);if(h){const f=r[l].pts;let g=f+r[l].duration;g>Xn&&(g=Xn),g-f<=0&&(g=f+Ii);for(let L=0;L<h.length;L++){const A=h[L];if(!ue(A)){this.updateId3CueEnds(f,c);const D=Si(s,f,g,A,c);D&&this.id3Track.addCue(D)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===Xn&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=s;if(r&&(l||c)){let h;i==="audio"?h=f=>f.type===Dn.audioId3&&c:i==="video"?h=f=>f.type===Dn.emsg&&l:h=f=>f.type===Dn.audioId3&&c||f.type===Dn.emsg&&l,An(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 f=Object.keys(n).filter(g=>!s.includes(g));for(let g=f.length;g--;){const E=f[g];Object.keys(n[E].cues).forEach(L=>{i.removeCue(n[E].cues[L])}),delete n[E]}}const l=t.fragments[t.fragments.length-1];if(s.length===0||!O(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=l.programDateTime/1e3-l.start,h=ci();for(let f=0;f<s.length;f++){const g=s[f],E=r[g],L=Pn(E.startDate,c),A=n[g],D=(A==null?void 0:A.cues)||{};let B=(A==null?void 0:A.durationKnown)||!1,X=Xn;const le=E.endDate;if(le)X=Pn(le,c),B=!0;else if(E.endOnNext&&!B){const we=s.reduce((de,Pe)=>{if(Pe!==E.id){const Te=r[Pe];if(Te.class===E.class&&Te.startDate>E.startDate&&(!de||E.startDate<de.startDate))return Te}return de},null);we&&(X=Pn(we.startDate,c),B=!0)}const oe=Object.keys(E.attr);for(let we=0;we<oe.length;we++){const de=oe[we];if(!ce(de))continue;const Pe=D[de];if(Pe)B&&!A.durationKnown&&(Pe.endTime=X);else if(h){let Te=E.attr[de];_e(de)&&(Te=ii(Te));const Be=Si(h,L,X,{key:de,data:Te},Dn.dateRange);Be&&(Be.id=g,this.id3Track.addCue(Be),D[de]=Be)}}n[g]={cues:D,dateRange:E,durationKnown:B}}}}class Ri{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.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,c=this.hls.userConfig;let h=l&&n||t;(c.liveSyncDuration||c.liveSyncDurationCount||h===0)&&(h=r!==void 0?r:s*i);const f=i;return h+Math.min(this.stallCount*1,f)}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===m.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&b.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,c=Math.min(this.maxLatency,s+t.targetduration);if(l<c&&l>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,r)),g=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(f,Math.max(1,g))}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 ri=["NONE","TYPE-0","TYPE-1",null];function bn(a){return ri.indexOf(a)>-1}const Mn=["SDR","PQ","HLG"];function hi(a){return!!a&&Mn.indexOf(a)>-1}var vi={No:"",Yes:"YES",v2:"v2"};function ei(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?vi.v2:vi.Yes:vi.No}class Ti{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class si{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!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 Li(this._audioGroups,e)}hasSubtitleGroup(e){return Li(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 Li(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function ki(a,e){const t=e.startPTS;if(O(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&&(b.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let l=t,c=n;const h=e.startPTS,f=e.endPTS;if(O(h)){const B=Math.abs(h-t);O(e.deltaPTS)?e.deltaPTS=Math.max(B,e.deltaPTS):e.deltaPTS=B,l=Math.max(t,h),t=Math.min(t,h),i=Math.min(i,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),r=Math.max(r,e.endDTS)}const g=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=c,e.endDTS=r;const E=e.sn;if(!a||E<a.startSN||E>a.endSN)return 0;let L;const A=E-a.startSN,D=a.fragments;for(D[A]=e,L=A;L>0;L--)ki(D[L],D[L-1]);for(L=A;L<D.length-1;L++)ki(D[L],D[L+1]);return a.fragmentHint&&ki(D[D.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,g}function ji(a,e){let t=null;const n=a.fragments;for(let l=n.length-1;l>=0;l--){const c=n[l].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;qi(a,e,(l,c,h,f)=>{if(e.skippedSegments&&c.cc!==l.cc){const g=l.cc-c.cc;for(let E=h;E<f.length;E++)f[E].cc+=g}O(l.startPTS)&&O(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(i=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,l.initSegment&&(c.initSegment=l.initSegment,t=l.initSegment)});const r=e.fragments;if(t&&(e.fragmentHint?r.concat(e.fragmentHint):r).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(l=>!l),e.deltaUpdateFailed){b.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=Wi(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=r[r.length-1].cc}yi(a.partList,e.partList,(l,c)=>{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),i?Pi(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Mi(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 Wi(a,e,t){const n=o({},a);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const r=new re(e[i].attr,n[i]);r.isValid?n[i]=r:b.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function yi(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,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=i;h<=r;h++){const f=c[s+h];let g=l[h];n&&!g&&h<n&&(g=e.fragments[h]=f),f&&g&&t(f,g,h,l)}}function Mi(a,e){const t=e.startSN+e.skippedSegments-a.startSN,n=a.fragments;t<0||t>=n.length||Ci(e,n[t].start)}function Ci(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].start+=e;a.fragmentHint&&(a.fragmentHint.start+=e)}}function er(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function Ni(a,e,t){if(!(a!=null&&a.details))return null;const n=a.details;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function Di(a,e,t){var n;return a!=null&&a.details?Fi((n=a.details)==null?void 0:n.partList,e,t):null}function Fi(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function Vn(a){a.forEach((e,t)=>{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function bi(a){switch(a.details){case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_TIMEOUT:case m.LEVEL_LOAD_TIMEOUT:case m.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Cn(a,e){const t=bi(e);return a.default[`${t?"timeout":"error"}Retry`]}function ai(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function fi(a){return V(V({},a),{errorRetry:null,timeoutRetry:null})}function Wn(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(Qn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function Qn(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}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||!O(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(Zi(e,t,s))return s}return null}function Bi(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[a.sn-e[0].sn+1]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&zi(t,n,r)===0||hr(r,a,Math.min(i,n))))return r;const s=Vi.search(e,zi.bind(null,t,n));return s&&(s!==a||!r)?s:r}function hr(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function zi(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 tt(a,e){return Vi.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}var Xe={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Xt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class On{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=b.log.bind(b,"[info]:"),this.warn=b.warn.bind(b,"[warning]:"),this.error=b.error.bind(b,"[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)===We.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 m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case m.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:Xe.DoNothing,flags:Xt.None};return}case m.FRAG_GAP:case m.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Xe.SendAlternateToPenaltyBox;return}case m.LEVEL_EMPTY_ERROR:case m.LEVEL_PARSING_ERROR:{var l,c;const h=t.parent===We.MAIN?t.level:r.loadLevel;t.details===m.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(c=l.levelDetails)!=null&&c.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,h):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,h))}return;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.SUBTITLE_LOAD_ERROR:case m.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const h=r.levels[r.loadLevel];if(h&&(s.type===St.AUDIO_TRACK&&h.hasAudioGroup(s.groupId)||s.type===St.SUBTITLE_TRACK&&h.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Xe.SendAlternateToPenaltyBox,t.errorAction.flags=Xt.MoveAllAlternatesMatchingHost;return}}return;case m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const h=r.levels[r.loadLevel],f=h==null?void 0:h.attrs["HDCP-LEVEL"];f?t.errorAction={action:Xe.SendAlternateToPenaltyBox,flags:Xt.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case m.BUFFER_ADD_CODEC_ERROR:case m.REMUX_ALLOC_ERROR:case m.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case m.INTERNAL_EXCEPTION:case m.BUFFER_APPENDING_ERROR:case m.BUFFER_FULL_ERROR:case m.LEVEL_SWITCH_ERROR:case m.BUFFER_STALLED_ERROR:case m.BUFFER_SEEK_OVER_HOLE:case m.BUFFER_NUDGE_ON_STALL:t.errorAction={action:Xe.DoNothing,flags:Xt.None};return}t.type===_.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=Cn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(Wn(i,r,bi(e),e.response))return{action:Xe.RetryRequest,flags:Xt.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=Cn(e.details.startsWith("key")?s:r,e),c=t.levels.reduce((f,g)=>f+g.fragmentError,0);if(i&&(e.details!==m.FRAG_GAP&&i.fragmentError++,Wn(l,c,bi(e),e.response)))return{action:Xe.RetryRequest,flags:Xt.None,retryConfig:l,retryCount:c};const h=this.getLevelSwitchAction(e,n);return l&&(h.retryConfig=l,h.retryCount=c),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===m.BUFFER_APPEND_ERROR&&i.fragmentError++;let f=-1;const{levels:g,loadLevel:E,minAutoLevel:L,maxAutoLevel:A}=n;n.autoLevelEnabled||(n.loadLevel=-1);const D=(r=e.frag)==null?void 0:r.type,X=(D===We.AUDIO&&h===m.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===m.BUFFER_ADD_CODEC_ERROR||h===m.BUFFER_APPEND_ERROR))&&g.some(({audioCodec:Pe})=>i.audioCodec!==Pe),oe=e.sourceBufferName==="video"&&(h===m.BUFFER_ADD_CODEC_ERROR||h===m.BUFFER_APPEND_ERROR)&&g.some(({codecSet:Pe,audioCodec:Te})=>i.codecSet!==Pe&&i.audioCodec===Te),{type:we,groupId:de}=(s=e.context)!=null?s:{};for(let Pe=g.length;Pe--;){const Te=(Pe+E)%g.length;if(Te!==E&&Te>=L&&Te<=A&&g[Te].loadError===0){var l,c;const Be=g[Te];if(h===m.FRAG_GAP&&D===We.MAIN&&e.frag){const ze=g[Te].details;if(ze){const Le=Bi(e.frag,ze.fragments,e.frag.start);if(Le!=null&&Le.gap)continue}}else{if(we===St.AUDIO_TRACK&&Be.hasAudioGroup(de)||we===St.SUBTITLE_TRACK&&Be.hasSubtitleGroup(de))continue;if(D===We.AUDIO&&(l=i.audioGroups)!=null&&l.some(ze=>Be.hasAudioGroup(ze))||D===We.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(ze=>Be.hasSubtitleGroup(ze))||X&&i.audioCodec===Be.audioCodec||!X&&i.audioCodec!==Be.audioCodec||oe&&i.codecSet===Be.codecSet)continue}f=Te;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:Xe.SendAlternateToPenaltyBox,flags:Xt.None,nextAutoLevel:f}}return{action:Xe.SendAlternateToPenaltyBox,flags:Xt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Xe.DoNothing:break;case Xe.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==m.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Xe.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 Xt.None:this.switchLevel(e,s);break;case Xt.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=ri[ri.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 qt{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=b.log.bind(b,`${t}:`),this.warn=b.warn.bind(b,`${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<i.length;s++){const l=i[s];let c;try{c=new self.URL(l.URI,t.url).href}catch(h){b.warn(`Could not construct new URL for Rendition Report: ${h}`),c=l.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const h=n&&ei(n);return new Ti(l,c>=0?c: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&&ji(n,i),!this.canLoad||!i.live)return;let c,h,f;if(i.canBlockReload&&i.endSN&&i.advanced){const B=this.hls.config.lowLatencyMode,X=i.lastPartSn,le=i.endSN,oe=i.lastPartIndex,we=oe!==-1,de=X===le,Pe=B?0:oe;we?(h=de?le+1:X,f=de?Pe:oe+1):h=le+1;const Te=i.age,Be=Te+i.ageHeader;let ze=Math.min(Be-i.partTarget,i.targetduration*1.5);if(ze>0){if(n&&ze>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${ze} with playlist age: ${i.age}`),ze=0;else{const Le=Math.floor(ze/i.targetduration);if(h+=Le,f!==void 0){const Ue=Math.round(ze%i.targetduration/i.partTarget);f+=Ue}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Te.toFixed(2)}s goal: ${ze} skip sn ${Le} to part ${f}`)}i.tuneInGoal=ze}if(c=this.getDeliveryDirectives(i,t.deliveryDirectives,h,f),B||!de){this.loadPlaylist(c);return}}else(i.canBlockReload||i.canSkipUntil)&&(c=this.getDeliveryDirectives(i,t.deliveryDirectives,h,f));const g=this.hls.mainForwardBufferInfo,E=g?g.end-g.len:0,L=(i.edge-E)*1e3,A=er(i,L);i.updated&&s>this.requestScheduled+A&&(this.requestScheduled=r.loading.start),h!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+A-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+A<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=A);let D=this.requestScheduled-s;D=Math.max(0,D),this.log(`reload live playlist ${e} in ${Math.round(D)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(c),D)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let r=ei(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=vi.No),new Ti(n,i,r)}checkRetry(e){const t=e.details,n=bi(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:l}=i||{},c=!!i&&!!l&&(r===Xe.RetryRequest||!i.resolved&&r===Xe.SendAlternateToPenaltyBox);if(c){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 f=ai(l,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}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 fr{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,c=r==null?void 0:r.channels,h=c?parseInt(c):l?1/0:2;let f=null;if(s!=null&&s.length)try{s.length===1&&s[0]?f=e.groups[s[0]].channels:f=s.reduce((g,E)=>{if(E){const L=e.groups[E];if(!L)throw new Error(`Audio track group ${E} not found`);Object.keys(L.channels).forEach(A=>{g[A]=(g[A]||0)+L.channels[A]})}return g},{2:0})}catch(g){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!f&&O(h)&&Object.keys(f).some(g=>parseInt(g)>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(c=>({type:"media-source",video:V(V({},r),{},{contentType:Ee(c,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(c=>{var h;c&&((h=e.groups[c])==null||h.tracks.forEach(f=>{if(f.groupId===c){const g=f.channels||"",E=parseFloat(g);O(E)&&E>2&&l.push.apply(l,i.split(",").map(L=>({type:"media-source",audio:{contentType:Ee(L,"audio"),channels:""+E}})))}}))}),Promise.all(l.map(c=>{const h=Mr(c);return tr[h]||(tr[h]=t.decodingInfo(c))})).then(c=>({supported:!c.some(h=>!h.supported),configurations:l,decodingInfoResults:c})).catch(c=>({supported:!1,configurations:l,decodingInfoResults:[],error:c}))}function Mr(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||Mn.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,c=s&&parseInt(s)===2;let h=!0,f=!1,g=1/0,E=1/0,L=1/0,A=0,D=[];const{preferHDR:B,allowedVideoRanges:X}=is(e,i);for(let de=r.length;de--;){const Pe=a[r[de]];h=Pe.channels[2]>0,g=Math.min(g,Pe.minHeight),E=Math.min(E,Pe.minFramerate),L=Math.min(L,Pe.minBitrate);const Te=X.filter(Be=>Pe.videoRanges[Be]>0);Te.length>0&&(f=!0,D=Te)}g=O(g)?g:0,E=O(E)?E:0;const le=Math.max(1080,g),oe=Math.max(30,E);return L=O(L)?L:t,t=Math.max(L,t),f||(e=void 0,D=[]),{codecSet:r.reduce((de,Pe)=>{const Te=a[Pe];if(Pe===de)return de;if(Te.minBitrate>t)return di(Pe,`min bitrate of ${Te.minBitrate} > current estimate of ${t}`),de;if(!Te.hasDefaultAudio)return di(Pe,"no renditions with default or auto-select sound found"),de;if(l&&Pe.indexOf(l.substring(0,4))%5!==0)return di(Pe,`audio codec preference "${l}" not found`),de;if(s&&!c){if(!Te.channels[s])return di(Pe,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Te.channels)})`),de}else if((!l||c)&&h&&Te.channels[2]===0)return di(Pe,"no renditions with stereo sound found"),de;return Te.minHeight>le?(di(Pe,`min resolution of ${Te.minHeight} > maximum of ${le}`),de):Te.minFramerate>oe?(di(Pe,`min framerate of ${Te.minFramerate} > maximum of ${oe}`),de):D.some(Be=>Te.videoRanges[Be]>0)?Te.maxScore<A?(di(Pe,`max score of ${Te.maxScore} < selected max of ${A}`),de):de&&(be(Pe)>=be(de)||Te.fragmentError>a[de].fragmentError)?de:(A=Te.maxScore,Pe):(di(Pe,`no variants with VIDEO-RANGE of ${JSON.stringify(D)} found`),de)},void 0),videoRanges:D,preferHDR:B,minFramerate:E,minBitrate:L}}function di(a,e){b.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Nr(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 c=Math.min(r.height,r.width);return l.minHeight=Math.min(l.minHeight,c),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 f=e.groups[h];f&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(g=>{l.channels[g]=(l.channels[g]||0)+f.channels[g]}))}),i},{})}function Ui(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(Yi(a,i,t))return n}return-1}function Yi(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:l}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||e.lang===r)&&(r===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||rs(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function rs(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.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((E,L,A)=>{const D=L.uri;return(E[D]||(E[D]=[])).push(A),E},{})[r.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=r.videoRange,h=r.frameRate,f=r.codecSet.substring(0,4),g=Br(e,n,E=>{if(E.videoRange!==c||E.frameRate!==h||E.codecSet.substring(0,4)!==f)return!1;const L=E.audioGroups,A=t.filter(D=>!L||L.indexOf(D.groupId)!==-1);return Ui(a,A,i)>-1});return g>-1?g:Br(e,n,E=>{const L=E.audioGroups,A=t.filter(D=>!L||L.indexOf(D.groupId)!==-1);return Ui(a,A,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<a.length;n++)if(t(a[n]))return n;return-1}class as{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:r,media:s}=i;if(!t||!s)return;const l=performance.now(),c=n?n.stats:t.stats,h=n?n.duration:t.duration,f=l-c.loading.start,g=i.minAutoLevel;if(c.aborted||c.loaded&&c.loaded===c.total||t.level<=g){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||s.paused||!s.playbackRate||!s.readyState)return;const E=i.mainForwardBufferInfo;if(E===null)return;const L=this.bwEstimator.getEstimateTTFB(),A=Math.abs(s.playbackRate);if(f<=Math.max(L,1e3*(h/(A*2))))return;const D=E.len/A,B=c.loading.first?c.loading.first-c.loading.start:-1,X=c.loaded&&B>-1,le=this.getBwEstimate(),oe=i.levels,we=oe[t.level],de=c.total||Math.max(c.loaded,Math.round(h*we.averageBitrate/8));let Pe=X?f-B:f;Pe<1&&X&&(Pe=Math.min(f,c.loaded*8/le));const Te=X?c.loaded*1e3/Pe:0,Be=Te?(de-c.loaded)/Te:de*8/le+L/1e3;if(Be<=D)return;const ze=Te?Te*8:le;let Le=Number.POSITIVE_INFINITY,Ue;for(Ue=t.level-1;Ue>g;Ue--){const Qe=oe[Ue].maxBitrate;if(Le=this.getTimeToLoadFrag(L/1e3,ze,h*Qe,!oe[Ue].details),Le<D)break}if(Le>=Be||Le>h*10)return;i.nextLoadLevel=i.nextAutoLevel=Ue,X?this.bwEstimator.sample(f-Math.min(L,B),c.loaded):this.bwEstimator.sampleTTFB(f);const Nt=oe[Ue].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>Nt&&this.resetEstimator(Nt),this.clearTimer(),b.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly;
|
|
Time to underbuffer: ${D.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Be.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Le.toFixed(3)} s
|
|
TTFB estimate: ${B|0} ms
|
|
Current BW estimate: ${O(le)?le|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Ue} @ ${Nt|0} bps`),i.trigger(u.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:c})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(b.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 fr(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 m.BUFFER_ADD_CODEC_ERROR:case m.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case m.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),l=r?r.stats:n.stats,c=s-l.loading.start,h=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&h>-1){const g=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(g,h),l.loaded)}else this.bwEstimator.sampleTTFB(c)}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;O(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===We.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,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:l,duration:c},s.realBitrate=Math.round(8*l/c)}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!==We.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 b.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,c=this.getBwEstimate(),h=this.getStarvationDelay();let f=r.abrBandWidthFactor,g=r.abrBandWidthUpFactor;if(h){const B=this.findBestLevel(c,s,i,h,0,f,g);if(B>=0)return B}let E=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay;if(!h){const B=this.bitrateTestDelay;B&&(E=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-B,b.info(`[abr] bitrate test took ${Math.round(1e3*B)}ms, set first fragment max fetchDuration to ${Math.round(1e3*E)} ms`),f=g=1)}const L=this.findBestLevel(c,s,i,h,E,f,g);if(b.info(`[abr] ${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${L}`),L>-1)return L;const A=n.levels[s],D=n.levels[n.loadLevel];return(A==null?void 0:A.bitrate)<(D==null?void 0:D.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 c;const h=i+r,f=this.lastLoadedFragLevel,g=f===-1?this.hls.firstLevel:f,{fragCurrent:E,partCurrent:L}=this,{levels:A,allAudioTracks:D,loadLevel:B,config:X}=this.hls;if(A.length===1)return 0;const le=A[g],oe=!!(le!=null&&(c=le.details)!=null&&c.live),we=B===-1||f===-1;let de,Pe="SDR",Te=(le==null?void 0:le.frameRate)||0;const{audioPreference:Be,videoPreference:ze}=X,Le=this.audioTracksByGroup||(this.audioTracksByGroup=Nr(D));if(we){if(this.firstSelection!==-1)return this.firstSelection;const Ot=this.codecTiers||(this.codecTiers=Fr(A,Le,t,n)),Rt=Lr(Ot,Pe,e,Be,ze),{codecSet:ln,videoRanges:vn,minFramerate:ft,minBitrate:Je,preferHDR:cn}=Rt;de=ln,Pe=cn?vn[vn.length-1]:vn[0],Te=ft,e=Math.max(e,Je),b.log(`[abr] picked start tier ${JSON.stringify(Rt)}`)}else de=le==null?void 0:le.codecSet,Pe=le==null?void 0:le.videoRange;const Ue=L?L.duration:E?E.duration:0,Nt=this.bwEstimator.getEstimateTTFB()/1e3,Qe=[];for(let Ot=n;Ot>=t;Ot--){var Mt;const Rt=A[Ot],ln=Ot>g;if(!Rt)continue;if(X.useMediaCapabilities&&!Rt.supportedResult&&!Rt.supportedPromise){const Jn=navigator.mediaCapabilities;typeof(Jn==null?void 0:Jn.decodingInfo)=="function"&&ts(Rt,Le,Pe,Te,e,Be)?(Rt.supportedPromise=ns(Rt,Le,Jn),Rt.supportedPromise.then(li=>{if(!this.hls)return;Rt.supportedResult=li;const pi=this.hls.levels,Gi=pi.indexOf(Rt);li.error?b.warn(`[abr] MediaCapabilities decodingInfo error: "${li.error}" for level ${Gi} ${JSON.stringify(li)}`):li.supported||(b.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Gi} ${JSON.stringify(li)}`),Gi>-1&&pi.length>1&&(b.log(`[abr] Removing unsupported level ${Gi}`),this.hls.removeLevel(Gi)))})):Rt.supportedResult=ar}if(de&&Rt.codecSet!==de||Pe&&Rt.videoRange!==Pe||ln&&Te>Rt.frameRate||!ln&&Te>0&&Te<Rt.frameRate||Rt.supportedResult&&!((Mt=Rt.supportedResult.decodingInfoResults)!=null&&Mt[0].smooth)){Qe.push(Ot);continue}const vn=Rt.details,ft=(L?vn==null?void 0:vn.partTarget:vn==null?void 0:vn.averagetargetduration)||Ue;let Je;ln?Je=l*e:Je=s*e;const cn=Ue&&i>=Ue*2&&r===0?A[Ot].averageBitrate:A[Ot].maxBitrate,Vt=this.getTimeToLoadFrag(Nt,Je,cn*ft,vn===void 0);if(Je>=cn&&(Ot===f||Rt.loadError===0&&Rt.fragmentError===0)&&(Vt<=Nt||!O(Vt)||oe&&!this.bitrateTestDelay||Vt<h)){const Jn=this.forcedAutoLevel;return Ot!==B&&(Jn===-1||Jn!==B)&&(Qe.length&&b.trace(`[abr] Skipped level(s) ${Qe.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${A[Qe[0]].codecs}" ${A[Qe[0]].videoRange}; not compatible with "${le.codecs}" ${Pe}`),b.info(`[abr] switch candidate:${g}->${Ot} adjustedbw(${Math.round(Je)})-bitrate=${Math.round(Je-cn)} ttfb:${Nt.toFixed(1)} avgDuration:${ft.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${Vt.toFixed(1)} firstSelection:${we} codecSet:${de} videoRange:${Pe} hls.loadLevel:${B}`)),we&&(this.firstSelection=Ot),Ot}}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 zn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class dr{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 c=l.range[e];c&&c.time.some(h=>{const f=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return f&&this.removeFragment(l.body),f})})}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(c=>{const h=n.elementaryStreams[c];if(!h)return;const f=t[c],g=l||h.partial===!0;s.range[c]=this.getBufferedTimes(n,i,g,f)}),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,c=e.minEndPTS||l,h=e.maxStartPTS||s;for(let f=0;f<i.length;f++){const g=i.start(f)-this.bufferPadding,E=i.end(f)+this.bufferPadding;if(h>=g&&c<=E){r.time.push({startPTS:Math.max(s,i.start(f)),endPTS:Math.min(l,i.end(f))});break}else if(s<E&&l>g){const L=Math.max(s,i.start(f)),A=Math.min(l,i.end(f));A>L&&(r.partial=!0,r.time.push({startPTS:L,endPTS:A}))}else if(l<=g)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(h=>{const f=c[h];f&&or(f)&&(i=f.body.start-l,r=f.body.end+l,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||or(t))}getState(e){const t=lr(e),n=this.fragments[t];return n?n.buffered?or(n)?zn.PARTIAL:zn.OK:zn.APPENDING:zn.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}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 c=r[l];this.detectEvictedFragments(l,c,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 c=l.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(l.buffered||r)&&this.removeFragment(c)})}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 _n{static isBuffered(e,t){try{if(e){const n=_n.getBuffered(e);for(let i=0;i<n.length;i++)if(t>=n.start(i)&&t<=n.end(i))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const i=_n.getBuffered(e),r=[];let s;for(s=0;s<i.length;s++)r.push({start:i.start(s),end:i.end(s)});return this.bufferedInfo(r,t,n)}}catch(i){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.sort(function(h,f){const g=h.start-f.start;return g||f.end-h.end});let i=[];if(n)for(let h=0;h<e.length;h++){const f=i.length;if(f){const g=i[f-1].end;e[h].start-g<n?e[h].end>g&&(i[f-1].end=e[h].end):i.push(e[h])}else i.push(e[h])}else i=e;let r=0,s,l=t,c=t;for(let h=0;h<i.length;h++){const f=i[h].start,g=i[h].end;if(t+n>=f&&t<g)l=f,c=g,r=c-t;else if(t+n<f){s=f;break}}return{len:r,start:l||0,end:c||0,nextStart:s}}static getBuffered(e){try{return e.buffered}catch(t){return b.log("failed to get media.buffered",t),ls}}}class yr{constructor(e,t,n,i=0,r=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=nr(),this.buffering={audio:nr(),video:nr(),audiovideo:nr()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function nr(){return{start:0,executeStart:0,executeEnd:0,end:0}}function br(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function us(a,e,t){return!!(e&&(t.endCC>t.startCC||a&&a.cc<t.startCC))}function cs(a,e){const t=a.fragments,n=e.fragments;if(!n.length||!t.length){b.log("No fragments to align");return}const i=br(t,n[0].cc);if(!i||i&&!i.startPTS){b.log("No frag in previous level to align on");return}return i}function Ir(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Ur(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Ir(t[n],a);e.fragmentHint&&Ir(e.fragmentHint,a),e.alignedSliding=!0}function hs(a,e,t){e&&(fs(a,t,e),!t.alignedSliding&&e&&Er(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&Mi(e,t))}function fs(a,e,t){if(us(a,t,e)){const n=cs(t,e);n&&O(n.start)&&(b.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),Ur(n.start,e))}}function Er(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=br(n,s),r=br(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=br(t,i.cc)||t[Math.floor(t.length/2)]);const l=i.programDateTime,c=r.programDateTime;if(!l||!c)return;const h=(c-l)/1e3-(r.start-i.start);Ur(h,a)}const $r=Math.pow(2,17);class kn{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new Nn({type:_.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(L=>L[0]==="GAP")){c(En(e));return}else e.gap=!1;const h=this.loader=e.loader=r?new r(i):new s(i),f=un(e),g=fi(i.fragLoadPolicy.default),E={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$r};e.stats=h.stats,h.load(f,E,{onSuccess:(L,A,D,B)=>{this.resetLoader(e,h);let X=L.data;D.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(X.slice(0,16)),X=X.slice(16)),l({frag:e,part:null,payload:X,networkDetails:B})},onError:(L,A,D,B)=>{this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:V({url:n,data:void 0},L),error:new Error(`HTTP Error ${L.code} ${L.text}`),networkDetails:D,stats:B}))},onAbort:(L,A,D)=>{this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:D,stats:L}))},onTimeout:(L,A,D)=>{this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${E.timeout}ms`),networkDetails:D,stats:L}))},onProgress:(L,A,D,B)=>{t&&t({frag:e,part:null,payload:D,networkDetails:B})}})})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(En(e,t));return}const h=this.loader=e.loader=r?new r(i):new s(i),f=un(e,t),g=fi(i.fragLoadPolicy.default),E={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$r};t.stats=h.stats,h.load(f,E,{onSuccess:(L,A,D,B)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const X={frag:e,part:t,payload:L.data,networkDetails:B};n(X),l(X)},onError:(L,A,D,B)=>{this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:V({url:f.url,data:void 0},L),error:new Error(`HTTP Error ${L.code} ${L.text}`),networkDetails:D,stats:B}))},onAbort:(L,A,D)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:D,stats:L}))},onTimeout:(L,A,D)=>{this.resetLoader(e,h),c(new Nn({type:_.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${E.timeout}ms`),networkDetails:D,stats:L}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),h=Math.min(Math.round(n.loaded/r),c),g=(c-h)*Math.round(n.loaded/h);n.total=n.loaded+g}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 un(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(O(i)&&O(r)){var s;let l=i,c=r;if(a.sn==="initSegment"&&((s=a.decryptdata)==null?void 0:s.method)==="AES-128"){const h=r-i;h%16&&(c=r+(16-h%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=c}return n}function En(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:_.MEDIA_ERROR,details:m.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new Nn(n)}class Nn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class wi{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 Cr(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?he(a,0,e-t):a}class ds{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],c=this.invSubMix,h=c[0],f=c[1],g=c[2],E=c[3],L=new Uint32Array(256);let A=0,D=0,B=0;for(B=0;B<256;B++)B<128?L[B]=B<<1:L[B]=B<<1^283;for(B=0;B<256;B++){let X=D^D<<1^D<<2^D<<3^D<<4;X=X>>>8^X&255^99,e[A]=X,t[X]=A;const le=L[A],oe=L[le],we=L[oe];let de=L[X]*257^X*16843008;i[A]=de<<24|de>>>8,r[A]=de<<16|de>>>16,s[A]=de<<8|de>>>24,l[A]=de,de=we*16843009^oe*65537^le*257^A*16843008,h[X]=de<<24|de>>>8,f[X]=de<<16|de>>>16,g[X]=de<<8|de>>>24,E[X]=de,A?(A=le^L[L[L[we^le]]],D^=L[L[D]]):A=D=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let l,c;const h=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),g=this.sBox,E=this.rcon,L=this.invSubMix,A=L[0],D=L[1],B=L[2],X=L[3];let le,oe;for(l=0;l<s;l++){if(l<r){le=h[l]=t[l];continue}oe=le,l%r===0?(oe=oe<<8|oe>>>24,oe=g[oe>>>24]<<24|g[oe>>>16&255]<<16|g[oe>>>8&255]<<8|g[oe&255],oe^=E[l/r|0]<<24):r>6&&l%r===4&&(oe=g[oe>>>24]<<24|g[oe>>>16&255]<<16|g[oe>>>8&255]<<8|g[oe&255]),h[l]=le=(h[l-r]^oe)>>>0}for(c=0;c<s;c++)l=s-c,c&3?oe=h[l]:oe=h[l-4],c<4||l<=4?f[c]=oe:f[c]=A[g[oe>>>24]]^D[g[oe>>>16&255]]^B[g[oe>>>8&255]]^X[g[oe&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,c=l[0],h=l[1],f=l[2],g=l[3],E=this.uint8ArrayToUint32Array_(n);let L=E[0],A=E[1],D=E[2],B=E[3];const X=new Int32Array(e),le=new Int32Array(X.length);let oe,we,de,Pe,Te,Be,ze,Le,Ue,Nt,Qe,Mt,Ot,Rt;const ln=this.networkToHostOrderSwap;for(;t<X.length;){for(Ue=ln(X[t]),Nt=ln(X[t+1]),Qe=ln(X[t+2]),Mt=ln(X[t+3]),Te=Ue^r[0],Be=Mt^r[1],ze=Qe^r[2],Le=Nt^r[3],Ot=4,Rt=1;Rt<i;Rt++)oe=c[Te>>>24]^h[Be>>16&255]^f[ze>>8&255]^g[Le&255]^r[Ot],we=c[Be>>>24]^h[ze>>16&255]^f[Le>>8&255]^g[Te&255]^r[Ot+1],de=c[ze>>>24]^h[Le>>16&255]^f[Te>>8&255]^g[Be&255]^r[Ot+2],Pe=c[Le>>>24]^h[Te>>16&255]^f[Be>>8&255]^g[ze&255]^r[Ot+3],Te=oe,Be=we,ze=de,Le=Pe,Ot=Ot+4;oe=s[Te>>>24]<<24^s[Be>>16&255]<<16^s[ze>>8&255]<<8^s[Le&255]^r[Ot],we=s[Be>>>24]<<24^s[ze>>16&255]<<16^s[Le>>8&255]<<8^s[Te&255]^r[Ot+1],de=s[ze>>>24]<<24^s[Le>>16&255]<<16^s[Te>>8&255]<<8^s[Be&255]^r[Ot+2],Pe=s[Le>>>24]<<24^s[Te>>16&255]<<16^s[Be>>8&255]<<8^s[ze&255]^r[Ot+3],le[t]=ln(oe^L),le[t+1]=ln(Pe^A),le[t+2]=ln(de^D),le[t+3]=ln(we^B),L=Ue,A=Nt,D=Qe,B=Mt,t=t+4}return le.buffer}}const Kr=16;class Sr{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Cr(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n){return this.useSoftware?new Promise((i,r)=>{this.softwareDecrypt(new Uint8Array(e),t,n);const s=this.flush();s?i(s.buffer):r(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n)}softwareDecrypt(e,t,n){const{currentIV:i,currentResult:r,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=Yt(s,e),this.remainderData=null);const l=this.getValidChunk(e);if(!l.length)return null;i&&(n=i);let c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new ds),c.expandKey(t);const h=r;return this.currentResult=c.decrypt(l.buffer,0,n),this.currentIV=he(l,-16).buffer,h||null}webCryptoDecrypt(e,t,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n));this.key=t,this.fastAesKey=new xr(this.subtle,t)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new wi(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(b.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=he(e,0,n),this.remainderData=he(e,n)),t}logOnce(e){this.logEnabled&&(b.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},Ce={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Dr extends os{constructor(e,t,n,i,r){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Ce.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=r,this.logPrefix=i,this.log=b.log.bind(b,`${i}:`),this.warn=b.warn.bind(b,`${i}:`),this.hls=e,this.fragmentLoader=new kn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Sr(e.config),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Ce.STOPPED}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const n=t.partList;if(n!=null&&n.length){const r=n[n.length-1];return _n.isBuffered(this.media,r.start+r.duration/2)}const i=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);const i=this.config;this.levels&&i.autoStartLoad&&this.state===Ce.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:n,mediaBuffer:i,state:r}=this,s=n?n.currentTime:0,l=_n.bufferInfo(i||n,s,e.maxBufferHole);if(this.log(`media seeking to ${O(s)?s.toFixed(3):s}, state: ${r}`),this.state===Ce.ENDED)this.resetLoadingState();else if(t){const c=e.maxFragLookUpTolerance,h=t.start-c,f=t.start+t.duration+c;if(!l.len||f<l.start||h>l.end){const g=s>f;(s<h||g)&&(g&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}n&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),!this.loadedmetadata&&!l.len&&(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=Ce.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{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===Ce.FRAG_LOADING||!this.fragCurrent&&s===Ce.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=Ce.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===Ce.STOPPED||this.state===Ce.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)===zn.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.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)===zn.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(c=>{throw i.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:e}),c}).then(c=>{const h=self.performance.now();return i.trigger(u.FRAG_DECRYPTED,{frag:e,payload:c,stats:{tstart:l,tdecrypt:h}}),n.payload=c,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===Ce.STOPPED||this.state===Ce.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=Ce.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===We.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(_n.getBuffered(l)):"(detached)"})`),e.sn!=="initSegment"){var c;if(e.type!==We.SUBTITLE){const f=e.elementaryStreams;if(!Object.keys(f).some(g=>!!f[g])){this.state=Ce.IDLE;return}}const h=(c=this.levels)==null?void 0:c[e.level];h!=null&&h.fragmentError&&(this.log(`Resetting level fragment error count of ${h.fragmentError} on frag buffered`),h.fragmentError=0)}this.state=Ce.IDLE,l&&(!this.loadedmetadata&&e.type==We.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(c=>!c),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=Ce.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(f=>{if(!this.fragContextChanged(f.frag))return this.hls.trigger(u.KEY_LOADED,f),this.state===Ce.KEY_LOADING&&(this.state=Ce.IDLE),f}),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 f=s.partList;if(f&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const g=this.getNextPart(f,e,n);if(g>-1){const E=f[g];this.log(`Loading part sn: ${e.sn} p: ${E.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${g}-${f.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=E.start+E.duration,this.state=Ce.FRAG_LOADING;let L;return l?L=l.then(A=>!A||this.fragContextChanged(A.frag)?null:this.doFragPartsLoad(e,E,t,i)).catch(A=>this.handleFragLoadError(A)):L=this.doFragPartsLoad(e,E,t,i).catch(A=>this.handleFragLoadError(A)),this.hls.trigger(u.FRAG_LOADING,{frag:e,part:E,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):L}else if(!e.url||this.loadedEndOfParts(f,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))}`),O(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ce.FRAG_LOADING;const c=this.config.progressive;let h;return c&&l?h=l.then(f=>!f||this.fragContextChanged(f==null?void 0:f.frag)?null:this.fragmentLoader.load(e,i)).catch(f=>this.handleFragLoadError(f)):h=Promise.all([this.fragmentLoader.load(e,c?i:void 0),l]).then(([f])=>(!c&&f&&i&&i(f),f)).catch(f=>this.handleFragLoadError(f)),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 c=[],h=(l=n.details)==null?void 0:l.partList,f=g=>{this.fragmentLoader.loadPart(e,g,i).then(E=>{c[g.index]=E;const L=E.part;this.hls.trigger(u.FRAG_LOADED,E);const A=Di(n,e.sn,g.index+1)||Fi(h,e.sn,g.index+1);if(A)f(A);else return r({frag:e,part:L,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===m.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(u.ERROR,t)}else this.hls.trigger(u.ERROR,{type:_.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Ce.PARSING){!this.fragCurrent&&this.state!==Ce.STOPPED&&this.state!==Ce.ERROR&&(this.state=Ce.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],c=s>-1?Di(l,r,s):null,h=c?c.fragment:Ni(l,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:c,level:l}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==Ce.PARSING)return;const{data1:l,data2:c}=e;let h=l;if(l&&c&&(h=Yt(l,c)),!((s=h)!=null&&s.length))return;const f={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:h};if(this.hls.trigger(u.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!_n.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=_n.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 O(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,r=_n.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&r.nextStart<s.end)return _n.bufferInfo(e,t,Math.max(r.nextStart,i))}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=We.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,We.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 c=r.initialLiveManifestSize;if(i<c)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${c})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s)&&(l=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=l?this.hls.liveSyncPosition||l.start:e)}else e<=s&&(l=n[0]);if(!l){const c=r.lowLatencyMode?t.partEnd:t.fragmentEnd;l=this.getFragmentAtPosition(e,c,t)}return this.mapToInitFragWhenRequired(l)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===zn.OK||n===zn.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}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 c=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(c!==null&&n.len+c.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,c=e.length;l<c;l++){const h=e[l];if(s=s&&!h.independent,i>-1&&n<h.start)break;const f=h.loaded;f?i=-1:(r||h.independent||s)&&h.fragment===t&&(i=l),r=f}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=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=tt(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:c}=n,{maxFragLookUpTolerance:h}=i,f=n.partList,g=!!(i.lowLatencyMode&&f!=null&&f.length&&c);g&&c&&!this.bitrateTest&&(s=s.concat(c),l=c.sn);let E;if(e<t){const L=e>t-h?0:h;E=Bi(r,s,e,L)}else E=s[s.length-1];if(E){const L=E.sn-n.startSN,A=this.fragmentTracker.getState(E);if((A===zn.OK||A===zn.PARTIAL&&E.gap)&&(r=E),r&&E.sn===r.sn&&(!g||f[0].fragment.sn>E.sn)&&r&&E.level===r.level){const B=s[L+1];E.sn<l&&this.fragmentTracker.getState(B)!==zn.OK?E=B:E=null}}return E}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=n.currentTime,s=e.fragments[0].start,l=e.edge,c=r>=s-t.maxFragLookUpTolerance&&r<=l;if(i!==null&&n.duration>i&&(r<i||!c)){const h=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!c&&n.readyState<4||r<l-h)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragments[0].start,s=!t,l=e.alignedSliding&&O(r);if(s||!l&&!r){const{fragPrevious:c}=this;hs(c,n,e);const h=e.fragments[0].start;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${c?c.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<t&&(n=-1),n===-1||this.lastCurrentTime===-1){const i=this.startTimeOffset!==null,r=i?this.startTimeOffset:e.startTimeOffset;r!==null&&O(r)?(n=t+r,r<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Start time offset ${r} found in ${i?"multivariant":"media"} playlist, adjust startPosition to ${n}`),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==Ce.FRAG_LOADING_WAITING_RETRY)&&(this.state=Ce.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const f=this.getCurrentContext(t.chunkMeta);f&&(t.frag=f.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===m.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,retryCount:c=0,retryConfig:h}=s||{};if(s&&l===Xe.RetryRequest&&h){this.resetStartWhenNotLoaded(this.levelLastLoaded);const f=ai(h,c);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${c+1}/${h.maxNumRetry} in ${f}ms`),s.resolved=!0,this.retryDate=self.performance.now()+f,this.state=Ce.FRAG_LOADING_WAITING_RETRY}else if(h&&s)if(this.resetFragmentErrors(e),c<h.maxNumRetry)!r&&l!==Xe.RemoveAlternatePermanently&&(s.resolved=!0);else{b.warn(`${t.details} reached or exceeded max retry (${c})`);return}else(s==null?void 0:s.action)===Xe.SendAlternateToPenaltyBox?this.state=Ce.WAITING_LEVEL:this.state=Ce.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===Ce.PARSING||this.state===Ce.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===We.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Ce.STOPPED&&(this.state=Ce.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=_n.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===Ce.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Ce.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((c,h)=>{const f=e.elementaryStreams[h];if(f){const g=f.endPTS-f.startPTS;if(g<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${g})`),c||!1;const E=i?0:Pi(s,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(u.LEVEL_PTS_UPDATED,{details:s,level:n,drift:E,type:h,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const c=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(c.message),this.hls.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Ce.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=Xa(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Xa(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}function Qa(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Ja(){const a=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(a);return{worker:new self.Worker(e),objectURL:e}}function qa(a){const e=new self.URL(a,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Qi(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ps{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=Yt(this.cachedData,e),this.cachedData=null);let n=Me(e,0),i=n?n.length:0,r;const s=this._audioTrack,l=this._id3Track,c=n?te(n):void 0,h=e.length;for((this.basePTS===null||this.frameIndex===0&&O(c))&&(this.basePTS=eo(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Dn.audioId3,duration:Number.POSITIVE_INFINITY});i<h;){if(this.canParse(e,i)){const f=this.appendFrame(s,e,i);f?(this.frameIndex++,this.lastPTS=f.sample.pts,i+=f.length,r=i):i=h}else G(e,i)?(n=Me(e,i),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Dn.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===h&&r!==h){const f=he(e,r);this.cachedData?this.cachedData=Yt(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Qi(),id3Track:l,textTrack:Qi()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Qi(),id3Track:this._id3Track,textTrack:Qi()}}destroy(){}}const eo=(a,e,t)=>{if(O(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function to(a,e,t,n){let i,r,s,l;const c=navigator.userAgent.toLowerCase(),h=n,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const g=(e[t+2]&60)>>>2;if(g>f.length-1){const E=new Error(`invalid ADTS sampling index:${g}`);a.emit(u.ERROR,u.ERROR,{type:_.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!0,error:E,reason:E.message});return}return s=(e[t+2]&1)<<2,s|=(e[t+3]&192)>>>6,b.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${g}`),/firefox/i.test(c)?g>=6?(i=5,l=new Array(4),r=g-3):(i=2,l=new Array(2),r=g):c.indexOf("android")!==-1?(i=2,l=new Array(2),r=g):(i=5,l=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&g>=6?r=g-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(g>=6&&s===1||/vivaldi/i.test(c))||!n&&s===1)&&(i=2,l=new Array(2)),r=g)),l[0]=i<<3,l[0]|=(g&14)>>1,l[1]|=(g&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:f[g],channelCount:s,codec:"mp4a.40."+i,manifestCodec:h}}function Ws(a,e){return a[e]===255&&(a[e+1]&246)===240}function Hs(a,e){return a[e+1]&1?7:9}function gs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function no(a,e){return e+5<a.length}function Gr(a,e){return e+1<a.length&&Ws(a,e)}function io(a,e){return no(a,e)&&Ws(a,e)&&gs(a,e)<=a.length-e}function ro(a,e){if(Gr(a,e)){const t=Hs(a,e);if(e+t>=a.length)return!1;const n=gs(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Gr(a,i)}return!1}function js(a,e,t,n,i){if(!a.samplerate){const r=to(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,b.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function Vs(a){return 1024*9e4/a}function so(a,e){const t=Hs(a,e);if(e+t<=a.length){const n=gs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function zs(a,e,t,n,i){const r=Vs(a.samplerate),s=n+i*r,l=so(e,t);let c;if(l){const{frameLength:g,headerLength:E}=l,L=E+g,A=Math.max(0,t+L-e.length);A?(c=new Uint8Array(L-E),c.set(e.subarray(t+E,e.length),0)):c=e.subarray(t+E,t+L);const D={unit:c,pts:s};return A||a.samples.push(D),{sample:D,length:L,missing:A}}const h=e.length-t;return c=new Uint8Array(h),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:h,missing:-1}}let Wr=null;const ao=[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],oo=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],lo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],uo=[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,c={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(c),{sample:c,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,c=t===3?3-n:n===3?3:4,h=ao[c*14+i-1]*1e3,g=oo[(t===3?0:t===2?1:2)*3+r],E=l===3?1:2,L=lo[t][n],A=uo[n],D=L*8*A,B=Math.floor(L*h/g+s)*A;if(Wr===null){const oe=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Wr=oe?parseInt(oe[1]):0}return!!Wr&&Wr<=87&&n===2&&h>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:g,channelCount:E,frameLength:B,samplesPerFrame:D}}}function ms(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Xs(a,e){return e+1<a.length&&ms(a,e)}function co(a,e){return ms(a,e)&&4<=a.length-e}function Qs(a,e){if(e+1<a.length&&ms(a,e)){const n=Ys(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Xs(a,r)}return!1}class ho extends ps{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Me(e,0);let n=(t==null?void 0:t.length)||0;if(Qs(e,n))return!1;for(let i=e.length;n<i;n++)if(ro(e,n))return b.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return io(e,t)}appendFrame(e,t,n){js(e,this.observer,t,n,e.manifestCodec);const i=zs(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const fo=/\/emsg[-/]ID3/i;class po{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=Qi("video",1),s=this.audioTrack=Qi("audio",1),l=this.txtTrack=Qi("text",1);if(this.id3Track=Qi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=rt(e);if(c.video){const{id:h,timescale:f,codec:g}=c.video;r.id=h,r.timescale=l.timescale=f,r.codec=g}if(c.audio){const{id:h,timescale:f,codec:g}=c.audio;s.id=h,s.timescale=f,s.codec=g}l.id=hn.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Et(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Yt(this.remainderData,e));const l=qn(n);this.remainderData=l.remainder,i.samples=l.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=an(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=an(e,t),{videoTrack:t,audioTrack:Qi(),id3Track:i,textTrack:Qi()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=Ke(e.samples,["emsg"]);i&&i.forEach(r=>{const s=gi(r);if(fo.test(s.schemeIdUri)){const l=O(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale;let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const h=s.payload;n.samples.push({data:h,len:h.byteLength,dts:l,pts:l,type:Dn.emsg,duration:c})}})}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),c=8-l;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<l|i[0]:i[0],e+=1,n-=l}return t};class go extends ps{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=qs(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=Me(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&te(t)!==void 0&&Js(e,n)<16}}function qs(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const l=[48e3,44100,32e3][r],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+f>e.length)return-1;const g=e[t+6]>>5;let E=0;g===2?E+=2:(g&1&&g!==1&&(E+=2),g&4&&(E+=2));const L=(e[t+6]<<8|e[t+7])>>12-E&1,D=[2,1,2,3,3,4,4,5][g]+L,B=e[t+5]>>3,X=e[t+5]&7,le=new Uint8Array([r<<6|B<<1|X>>2,(X&3)<<6|g<<3|L<<2|c>>4,c<<4&224]),oe=1536/l*9e4,we=n+i*oe,de=e.subarray(t,t+f);return a.config=le,a.channelCount=D,a.samplerate=l,a.samples.push({unit:de,pts:we}),f}class mo{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&&b.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&&b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,n=8,i;for(let r=0;r<e;r++)n!==0&&(i=this.readEG(),n=(t+i+256)%256),t=n===0?t:n}readSPS(){let e=0,t=0,n=0,i=0,r,s,l;const c=this.readUByte.bind(this),h=this.readBits.bind(this),f=this.readUEG.bind(this),g=this.readBoolean.bind(this),E=this.skipBits.bind(this),L=this.skipEG.bind(this),A=this.skipUEG.bind(this),D=this.skipScalingList.bind(this);c();const B=c();if(h(5),E(3),c(),A(),B===100||B===110||B===122||B===244||B===44||B===83||B===86||B===118||B===128){const Pe=f();if(Pe===3&&E(1),A(),A(),E(1),g())for(s=Pe!==3?8:12,l=0;l<s;l++)g()&&(l<6?D(16):D(64))}A();const X=f();if(X===0)f();else if(X===1)for(E(1),L(),L(),r=f(),l=0;l<r;l++)L();A(),E(1);const le=f(),oe=f(),we=h(1);we===0&&E(1),E(1),g()&&(e=f(),t=f(),n=f(),i=f());let de=[1,1];if(g()&&g())switch(c()){case 1:de=[1,1];break;case 2:de=[12,11];break;case 3:de=[10,11];break;case 4:de=[16,11];break;case 5:de=[40,33];break;case 6:de=[24,11];break;case 7:de=[20,11];break;case 8:de=[32,11];break;case 9:de=[80,33];break;case 10:de=[18,11];break;case 11:de=[15,11];break;case 12:de=[64,33];break;case 13:de=[160,99];break;case 14:de=[4,3];break;case 15:de=[3,2];break;case 16:de=[2,1];break;case 255:{de=[c()<<8|c(),c()<<8|c()];break}}return{width:Math.ceil((le+1)*16-e*2-t*2),height:(2-we)*(oe+1)*16-(we?2:4)*(n+i),pixelRatio:de}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class _o extends mo{parseAVCPES(e,t,n,i,r){const s=this.parseAVCNALu(e,n.data);let l=this.VideoSample,c,h=!1;n.data=null,l&&s.length&&!e.audFound&&(this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),s.forEach(f=>{var g;switch(f.type){case 1:{let D=!1;c=!0;const B=f.data;if(h&&B.length>4){const X=new ea(B).readSliceType();(X===2||X===4||X===7||X===9)&&(D=!0)}if(D){var E;(E=l)!=null&&E.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=D;break}case 5:c=!0,(g=l)!=null&&g.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:{c=!0,Zn(f.data,1,n.pts,t.samples);break}case 7:{var L,A;c=!0,h=!0;const D=f.data,X=new ea(D).readSPS();if(!e.sps||e.width!==X.width||e.height!==X.height||((L=e.pixelRatio)==null?void 0:L[0])!==X.pixelRatio[0]||((A=e.pixelRatio)==null?void 0:A[1])!==X.pixelRatio[1]){e.width=X.width,e.height=X.height,e.pixelRatio=X.pixelRatio,e.sps=[D],e.duration=r;const le=D.subarray(1,4);let oe="avc1.";for(let we=0;we<3;we++){let de=le[we].toString(16);de.length<2&&(de="0"+de),oe+=de}e.codec=oe}break}case 8:c=!0,e.pps=[f.data];break;case 9:c=!0,e.audFound=!0,l&&this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:c=!0;break;default:c=!1,l&&(l.debug+="unknown NAL "+f.type+" ");break}l&&c&&l.units.push(f)}),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,c,h,f,g=-1,E=0;for(i===-1&&(g=0,E=t[0]&31,i=0,l=1);l<n;){if(c=t[l++],!i){i=c?0:1;continue}if(i===1){i=c?0:2;continue}if(!c)i=3;else if(c===1){if(h=l-i-1,g>=0){const L={data:t.subarray(g,h),type:E};s.push(L)}else{const L=this.getLastNalUnit(e.samples);L&&(r&&l<=4-r&&L.state&&(L.data=L.data.subarray(0,L.data.byteLength-r)),h>0&&(L.data=Yt(L.data,t.subarray(0,h)),L.state=0))}l<n?(f=t[l]&31,g=l,E=f,i=0):i=-1}else i=0}if(g>=0&&i>=0){const L={data:t.subarray(g,n),type:E,state:i};s.push(L)}if(s.length===0){const L=this.getLastNalUnit(e.samples);L&&(L.data=Yt(L.data,t))}return e.naluState=i,s}}class vo{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 c=new Uint8Array(l);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=Bn(r.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}const oi=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 _o}static probe(e){const t=ur.syncOffset(e);return t>0&&b.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(oi*5,t-oi)+1,i=0;for(;i<n;){let r=!1,s=-1,l=0;for(let c=i;c<t;c+=oi)if(e[c]===71&&(t-c===oi||e[c+oi]===71)){if(l++,s===-1&&(s=c,s!==0&&(n=Math.min(s+oi*99,e.length-oi)+1)),r||(r=_s(e,c)===0),r&&l>1&&(s===0&&l>2||c+oi>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:hn[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,c=this._id3Track,h=this._txtTrack;let f=s.pid,g=s.pesData,E=l.pid,L=c.pid,A=l.pesData,D=c.pesData,B=null,X=this.pmtParsed,le=this._pmtId,oe=e.length;if(this.remainderData&&(e=Yt(this.remainderData,e),oe=e.length,this.remainderData=null),oe<oi&&!i)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:c,textTrack:h};const we=Math.max(0,ur.syncOffset(e));oe-=(oe-we)%oi,oe<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,oe,e.buffer.byteLength-oe));let de=0;for(let Te=we;Te<oe;Te+=oi)if(e[Te]===71){const Be=!!(e[Te+1]&64),ze=_s(e,Te),Le=(e[Te+3]&48)>>4;let Ue;if(Le>1){if(Ue=Te+5+e[Te+4],Ue===Te+oi)continue}else Ue=Te+4;switch(ze){case f:Be&&(g&&(r=Tr(g))&&this.videoParser.parseAVCPES(s,h,r,!1,this._duration),g={data:[],size:0}),g&&(g.data.push(e.subarray(Ue,Te+oi)),g.size+=Te+oi-Ue);break;case E:if(Be){if(A&&(r=Tr(A)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r);break}A={data:[],size:0}}A&&(A.data.push(e.subarray(Ue,Te+oi)),A.size+=Te+oi-Ue);break;case L:Be&&(D&&(r=Tr(D))&&this.parseID3PES(c,r),D={data:[],size:0}),D&&(D.data.push(e.subarray(Ue,Te+oi)),D.size+=Te+oi-Ue);break;case 0:Be&&(Ue+=e[Ue]+1),le=this._pmtId=yo(e,Ue);break;case le:{Be&&(Ue+=e[Ue]+1);const Nt=bo(e,Ue,this.typeSupported,n,this.observer);f=Nt.videoPid,f>0&&(s.pid=f,s.segmentCodec=Nt.segmentVideoCodec),E=Nt.audioPid,E>0&&(l.pid=E,l.segmentCodec=Nt.segmentAudioCodec),L=Nt.id3Pid,L>0&&(c.pid=L),B!==null&&!X&&(b.warn(`MPEG-TS PMT found at ${Te} after unknown PID '${B}'. Backtracking to sync byte @${we} to parse all TS packets.`),B=null,Te=we-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:B=ze;break}}else de++;de>0&&Hr(this.observer,new Error(`Found ${de} TS packet/s that do not start with 0x47`)),s.pesData=g,l.pesData=A,c.pesData=D;const Pe={audioTrack:l,videoTrack:s,id3Track:c,textTrack:h};return i&&this.extractRemainingSamples(Pe),Pe}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,c=i.pesData;let h;if(s&&(h=Tr(s))?(this.videoParser.parseAVCPES(n,r,h,!0,this._duration),n.pesData=null):n.pesData=s,l&&(h=Tr(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&&b.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(h=Tr(c))?(this.parseID3PES(i,h),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new vo(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 g=i.missing,E=i.sample.unit.byteLength;if(g===-1)r=Yt(i.sample.unit,r);else{const L=E-g;i.sample.unit.set(r.subarray(0,g),L),e.samples.push(i.sample),n=i.missing}}let s,l;for(s=n,l=r.length;s<l-1&&!Gr(r,s);s++);if(s!==n){let g;const E=s<l-1;if(E?g=`AAC PES did not start with ADTS header,offset:${s}`:g="No ADTS header found in AAC PES",Hr(this.observer,new Error(g),E),!E)return}js(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const g=Vs(e.samplerate);c=i.sample.pts+g}else{b.warn("[tsdemuxer]: AAC PES unknown PTS");return}let h=0,f;for(;s<l;)if(f=zs(e,r,s,c,h),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(h++;s<l-1&&!Gr(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const l=t.pts;if(l===void 0){b.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Xs(n,s)){const c=Zs(e,n,s,l,r);if(c)s+=c.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){b.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,l=0,c;for(;l<r&&(c=qs(e,n,l,i,s++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){b.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=o({},t,{type:this._videoTrack?Dn.emsg:Dn.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function _s(a,e){return((a[e+1]&31)<<8)+a[e+2]}function yo(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,c=(a[e+10]&15)<<8|a[e+11];for(e+=12+c;e<l;){const h=_s(a,e),f=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){vs("ADTS AAC");break}case 15:r.audioPid===-1&&(r.audioPid=h);break;case 21:r.id3Pid===-1&&(r.id3Pid=h);break;case 219:if(!n){vs("H.264");break}case 27:r.videoPid===-1&&(r.videoPid=h,r.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?b.log("MPEG audio found, not supported in this browser"):r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="mp3");break;case 193:if(!n){vs("AC-3");break}case 129:t.ac3?r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="ac3"):b.log("AC-3 audio found, not supported in this browser");break;case 6:if(r.audioPid===-1&&f>0){let g=e+5,E=f;for(;E>2;){switch(a[g]){case 106:t.ac3!==!0?b.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=h,r.segmentAudioCodec="ac3");break}const A=a[g+1]+2;g+=A,E-=A}}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+=f+5}return r}function Hr(a,e,t){b.warn(`parsing error: ${e.message}`),a.emit(u.ERROR,u.ERROR,{type:_.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function vs(a){b.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Tr(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]=Yt(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&&(b.warn(`${Math.round((r-s)/9e4)}s delta between PTS and DTS, align them`),r=s)):s=r),i=t[8];let f=i+9;if(a.size<=f)return null;a.size-=f;const g=new Uint8Array(a.size);for(let E=0,L=l.length;E<L;E++){t=l[E];let A=t.byteLength;if(f)if(f>A){f-=A;continue}else t=t.subarray(f),A-=f,f=0;g.set(t,e),e+=A}return n&&(n-=i+3),{data:g,pts:r,dts:s,len:n}}return null}class Eo 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=Me(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&te(t)!==void 0&&Js(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Qs(e,n))return b.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return co(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Zs(e,t,n,this.basePTS,this.frameIndex)}}class ta{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const cr=Math.pow(2,32)-1;class ge{static init(){ge.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in ge.types)ge.types.hasOwnProperty(e)&&(ge.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);ge.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);ge.STTS=ge.STSC=ge.STCO=r,ge.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ge.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ge.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ge.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);ge.FTYP=ge.box(ge.types.ftyp,s,c,s,l),ge.DINF=ge.box(ge.types.dinf,ge.box(ge.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return ge.box(ge.types.hdlr,ge.HDLR_TYPES[e])}static mdat(e){return ge.box(ge.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+1));return ge.box(ge.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return ge.box(ge.types.mdia,ge.mdhd(e.timescale,e.duration),ge.hdlr(e.type),ge.minf(e))}static mfhd(e){return ge.box(ge.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"?ge.box(ge.types.minf,ge.box(ge.types.smhd,ge.SMHD),ge.DINF,ge.stbl(e)):ge.box(ge.types.minf,ge.box(ge.types.vmhd,ge.VMHD),ge.DINF,ge.stbl(e))}static moof(e,t,n){return ge.box(ge.types.moof,ge.mfhd(e),ge.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=ge.trak(e[t]);return ge.box.apply(null,[ge.types.moov,ge.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(ge.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=ge.trex(e[t]);return ge.box.apply(null,[ge.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 ge.box(ge.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return ge.box(ge.types.sdtp,n)}static stbl(e){return ge.box(ge.types.stbl,ge.stsd(e),ge.box(ge.types.stts,ge.STTS),ge.box(ge.types.stsc,ge.STSC),ge.box(ge.types.stsz,ge.STSZ),ge.box(ge.types.stco,ge.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const l=ge.box(ge.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,h=e.height,f=e.pixelRatio[0],g=e.pixelRatio[1];return ge.box(ge.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,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,ge.box(ge.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ge.box(ge.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,g>>24,g>>16&255,g>>8&255,g&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 ge.box(ge.types.mp4a,ge.audioStsd(e),ge.box(ge.types.esds,ge.esds(e)))}static mp3(e){return ge.box(ge.types[".mp3"],ge.audioStsd(e))}static ac3(e){return ge.box(ge.types["ac-3"],ge.audioStsd(e),ge.box(ge.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?ge.box(ge.types.stsd,ge.STSD,ge.mp3(e)):e.segmentCodec==="ac3"?ge.box(ge.types.stsd,ge.STSD,ge.ac3(e)):ge.box(ge.types.stsd,ge.STSD,ge.mp4a(e)):ge.box(ge.types.stsd,ge.STSD,ge.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 ge.box(ge.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=ge.sdtp(e),i=e.id,r=Math.floor(t/(cr+1)),s=Math.floor(t%(cr+1));return ge.box(ge.types.traf,ge.box(ge.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),ge.box(ge.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])),ge.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,ge.box(ge.types.trak,ge.tkhd(e),ge.mdia(e))}static trex(e){const t=e.id;return ge.box(ge.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,c,h,f,g,E;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<i;l++)c=n[l],h=c.duration,f=c.size,g=c.flags,E=c.cts,s.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,g.isLeading<<2|g.dependsOn,g.isDependedOn<<6|g.hasRedundancy<<4|g.paddingValue<<1|g.isNonSync,g.degradPrio&61440,g.degradPrio&15,E>>>24&255,E>>>16&255,E>>>8&255,E&255],12+16*l);return ge.box(ge.types.trun,s)}static initSegment(e){ge.types||ge.init();const t=ge.moov(e);return Yt(ge.FTYP,t)}}ge.types=void 0,ge.HDLR_TYPES=void 0,ge.STTS=void 0,ge.STSC=void 0,ge.STCO=void 0,ge.STSZ=void 0,ge.VMHD=void 0,ge.SMHD=void 0,ge.STSD=void 0,ge.FTYP=void 0,ge.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 xo(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 So(a,e=1){return ys(a,na,1/e)}const To=10*1e3,ia=1024,wo=1152,Ao=1536;let wr=null,bs=null;class jr{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,wr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);wr=s?parseInt(s[1]):0}if(bs===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);bs=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){b.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){b.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){b.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,c=l-r;return c<-4294967296&&(t=!0,l=$i(l,n),c=l-r),c>0?r:l},n);return t&&b.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,l,c){let h,f,g,E,L,A,D=r,B=r;const X=e.pid>-1,le=t.pid>-1,oe=t.samples.length,we=e.samples.length>0,de=l&&oe>0||oe>1;if((!X||we)&&(!le||de)||this.ISGenerated||l){if(this.ISGenerated){var Te,Be,ze,Le;const Mt=this.videoTrackConfig;Mt&&(t.width!==Mt.width||t.height!==Mt.height||((Te=t.pixelRatio)==null?void 0:Te[0])!==((Be=Mt.pixelRatio)==null?void 0:Be[0])||((ze=t.pixelRatio)==null?void 0:ze[1])!==((Le=Mt.pixelRatio)==null?void 0:Le[1]))&&this.resetInitSegment()}else g=this.generateIS(e,t,r,s);const Ue=this.isVideoContiguous;let Nt=-1,Qe;if(de&&(Nt=Ro(t.samples),!Ue&&this.config.forceKeyFrameOnDiscontinuity))if(A=!0,Nt>0){b.warn(`[mp4-remuxer]: Dropped ${Nt} out of ${oe} video samples due to a missing keyframe`);const Mt=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Nt),t.dropped+=Nt,B+=(t.samples[0].pts-Mt)/t.inputTimeScale,Qe=B}else Nt===-1&&(b.warn(`[mp4-remuxer]: No keyframe found out of ${oe} video samples`),A=!1);if(this.ISGenerated){if(we&&de){const Mt=this.getVideoStartPts(t.samples),Rt=($i(e.samples[0].pts,Mt)-Mt)/t.inputTimeScale;D+=Math.max(0,Rt),B+=Math.max(0,-Rt)}if(we){if(e.samplerate||(b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),g=this.generateIS(e,t,r,s)),f=this.remuxAudio(e,D,this.isAudioContiguous,s,le||de||c===We.AUDIO?B:void 0),de){const Mt=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),g=this.generateIS(e,t,r,s)),h=this.remuxVideo(t,B,Ue,Mt)}}else de&&(h=this.remuxVideo(t,B,Ue,0));h&&(h.firstKeyFrame=Nt,h.independent=Nt!==-1,h.firstKeyFramePTS=Qe)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(L=ra(n,r,this._initPTS,this._initDTS)),i.samples.length&&(E=sa(i,r,this._initPTS))),{audio:f,video:h,initSegment:g,independent:A,text:E,id3:L}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,l=this.typeSupported,c={},h=this._initPTS;let f=!h||i,g="audio/mp4",E,L,A;if(f&&(E=L=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(g="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:g,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):ge.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(A=e.inputTimeScale,!h||A!==h.timescale?E=L=r[0].pts-Math.round(A*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ge.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(A=t.inputTimeScale,!h||A!==h.timescale){const D=this.getVideoStartPts(s),B=Math.round(A*n);L=Math.min(L,$i(s[0].dts,D)-B),E=Math.min(E,D-B)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:E,timescale:A},this._initDTS={baseTime:L,timescale:A}):E=A=void 0,{tracks:c,initPTS:E,timescale:A}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,l=[],c=s.length,h=this._initPTS;let f=this.nextAvcDts,g=8,E=this.videoSampleDuration,L,A,D=Number.POSITIVE_INFINITY,B=Number.NEGATIVE_INFINITY,X=!1;if(!n||f===null){const ft=t*r,Je=s[0].pts-$i(s[0].dts,s[0].pts);wr&&f!==null&&Math.abs(ft-Je-f)<15e3?n=!0:f=ft-Je}const le=h.baseTime*r/h.timescale;for(let ft=0;ft<c;ft++){const Je=s[ft];Je.pts=$i(Je.pts-le,f),Je.dts=$i(Je.dts-le,f),Je.dts<s[ft>0?ft-1:ft].dts&&(X=!0)}X&&s.sort(function(ft,Je){const cn=ft.dts-Je.dts,Vt=ft.pts-Je.pts;return cn||Vt}),L=s[0].dts,A=s[s.length-1].dts;const oe=A-L,we=oe?Math.round(oe/(c-1)):E||e.inputTimeScale/30;if(n){const ft=L-f,Je=ft>we,cn=ft<-1;if((Je||cn)&&(Je?b.warn(`AVC: ${Or(ft,!0)} ms (${ft}dts) hole between fragments detected at ${t.toFixed(3)}`):b.warn(`AVC: ${Or(-ft,!0)} ms (${ft}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!cn||f>=s[0].pts||wr)){L=f;const Vt=s[0].pts-ft;if(Je)s[0].dts=L,s[0].pts=Vt;else for(let gn=0;gn<s.length&&!(s[gn].dts>Vt);gn++)s[gn].dts-=ft,s[gn].pts-=ft;b.log(`Video: Initial PTS/DTS adjusted: ${Or(Vt,!0)}/${Or(L,!0)}, delta: ${Or(ft,!0)} ms`)}}L=Math.max(0,L);let de=0,Pe=0,Te=L;for(let ft=0;ft<c;ft++){const Je=s[ft],cn=Je.units,Vt=cn.length;let gn=0;for(let Jn=0;Jn<Vt;Jn++)gn+=cn[Jn].data.length;Pe+=gn,de+=Vt,Je.length=gn,Je.dts<Te?(Je.dts=Te,Te+=we/4|0||1):Te=Je.dts,D=Math.min(Je.pts,D),B=Math.max(Je.pts,B)}A=s[c-1].dts;const Be=Pe+4*de+8;let ze;try{ze=new Uint8Array(Be)}catch(ft){this.observer.emit(u.ERROR,u.ERROR,{type:_.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:ft,bytes:Be,reason:`fail allocating video mdat ${Be}`});return}const Le=new DataView(ze.buffer);Le.setUint32(0,Be),ze.set(ge.types.mdat,4);let Ue=!1,Nt=Number.POSITIVE_INFINITY,Qe=Number.POSITIVE_INFINITY,Mt=Number.NEGATIVE_INFINITY,Ot=Number.NEGATIVE_INFINITY;for(let ft=0;ft<c;ft++){const Je=s[ft],cn=Je.units;let Vt=0;for(let li=0,pi=cn.length;li<pi;li++){const Gi=cn[li],Pr=Gi.data,Ks=Gi.data.byteLength;Le.setUint32(g,Ks),g+=4,ze.set(Pr,g),g+=Ks,Vt+=4+Ks}let gn;if(ft<c-1)E=s[ft+1].dts-Je.dts,gn=s[ft+1].pts-Je.pts;else{const li=this.config,pi=ft>0?Je.dts-s[ft-1].dts:we;if(gn=ft>0?Je.pts-s[ft-1].pts:we,li.stretchShortVideoTrack&&this.nextAudioPts!==null){const Gi=Math.floor(li.maxBufferHole*r),Pr=(i?D+i*r:this.nextAudioPts)-Je.pts;Pr>Gi?(E=Pr-pi,E<0?E=pi:Ue=!0,b.log(`[mp4-remuxer]: It is approximately ${Pr/90} ms to the next segment; using duration ${E/90} ms for the last video frame.`)):E=pi}else E=pi}const Jn=Math.round(Je.pts-Je.dts);Nt=Math.min(Nt,E),Mt=Math.max(Mt,E),Qe=Math.min(Qe,gn),Ot=Math.max(Ot,gn),l.push(new aa(Je.key,E,Vt,Jn))}if(l.length){if(wr){if(wr<70){const ft=l[0].flags;ft.dependsOn=2,ft.isNonSync=0}}else if(bs&&Ot-Qe<Mt-Nt&&we/Mt<.025&&l[0].cts===0){b.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let ft=L;for(let Je=0,cn=l.length;Je<cn;Je++){const Vt=ft+l[Je].duration,gn=ft+l[Je].cts;if(Je<cn-1){const Jn=Vt+l[Je+1].cts;l[Je].duration=Jn-gn}else l[Je].duration=Je?l[Je-1].duration:we;l[Je].cts=0,ft=Vt}}}E=Ue||!E?we:E,this.nextAvcDts=f=A+E,this.videoSampleDuration=E,this.isVideoContiguous=!0;const vn={data1:ge.moof(e.sequenceNumber++,L,o({},e,{samples:l})),data2:ze,startPTS:D/r,endPTS:(B+E)/r,startDTS:L/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,vn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return wo;case"ac3":return Ao;default:return ia}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,c=s/l,h=this.getSamplesPerFrame(e),f=h*c,g=this._initPTS,E=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,L=[],A=r!==void 0;let D=e.samples,B=E?0:8,X=this.nextAudioPts||-1;const le=t*s,oe=g.baseTime*s/g.timescale;if(this.isAudioContiguous=n=n||D.length&&X>0&&(i&&Math.abs(le-X)<9e3||Math.abs($i(D[0].pts-oe,le)-X)<20*f),D.forEach(function(Rt){Rt.pts=$i(Rt.pts-oe,le)}),!n||X<0){if(D=D.filter(Rt=>Rt.pts>=0),!D.length)return;r===0?X=0:i&&!A?X=Math.max(0,le):X=D[0].pts}if(e.segmentCodec==="aac"){const Rt=this.config.maxAudioFramesDrift;for(let ln=0,vn=X;ln<D.length;ln++){const ft=D[ln],Je=ft.pts,cn=Je-vn,Vt=Math.abs(1e3*cn/s);if(cn<=-Rt*f&&A)ln===0&&(b.warn(`Audio frame @ ${(Je/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*cn/s)} ms.`),this.nextAudioPts=X=vn=Je);else if(cn>=Rt*f&&Vt<To&&A){let gn=Math.round(cn/f);vn=Je-gn*f,vn<0&&(gn--,vn+=f),ln===0&&(this.nextAudioPts=X=vn),b.warn(`[mp4-remuxer]: Injecting ${gn} audio frame @ ${(vn/s).toFixed(3)}s due to ${Math.round(1e3*cn/s)} ms gap.`);for(let Jn=0;Jn<gn;Jn++){const li=Math.max(vn,0);let pi=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);pi||(b.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),pi=ft.unit.subarray()),D.splice(ln,0,{unit:pi,pts:li}),vn+=f,ln++}}ft.pts=vn,vn+=f}}let we=null,de=null,Pe,Te=0,Be=D.length;for(;Be--;)Te+=D[Be].unit.byteLength;for(let Rt=0,ln=D.length;Rt<ln;Rt++){const vn=D[Rt],ft=vn.unit;let Je=vn.pts;if(de!==null){const Vt=L[Rt-1];Vt.duration=Math.round((Je-de)/c)}else if(n&&e.segmentCodec==="aac"&&(Je=X),we=Je,Te>0){Te+=B;try{Pe=new Uint8Array(Te)}catch(Vt){this.observer.emit(u.ERROR,u.ERROR,{type:_.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:Vt,bytes:Te,reason:`fail allocating audio mdat ${Te}`});return}E||(new DataView(Pe.buffer).setUint32(0,Te),Pe.set(ge.types.mdat,4))}else return;Pe.set(ft,B);const cn=ft.byteLength;B+=cn,L.push(new aa(!0,h,cn,0)),de=Je}const ze=L.length;if(!ze)return;const Le=L[L.length-1];this.nextAudioPts=X=de+c*Le.duration;const Ue=E?new Uint8Array(0):ge.moof(e.sequenceNumber++,we/c,o({},e,{samples:L}));e.samples=[];const Nt=we/s,Qe=X/s,Ot={data1:Ue,data2:Pe,startPTS:Nt,endPTS:Qe,startDTS:Nt,endDTS:Qe,type:"audio",hasAudio:!0,hasVideo:!1,nb:ze};return this.isAudioContiguous=!0,Ot}remuxEmptyAudio(e,t,n,i){const r=e.inputTimeScale,s=e.samplerate?e.samplerate:r,l=r/s,c=this.nextAudioPts,h=this._initDTS,f=h.baseTime*9e4/h.timescale,g=(c!==null?c:i.startDTS*r)+f,E=i.endDTS*r+f,L=l*ia,A=Math.ceil((E-g)/L),D=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(b.warn("[mp4-remuxer]: remux empty Audio"),!D){b.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const B=[];for(let X=0;X<A;X++){const le=g+X*L;B.push({unit:D,pts:le,dts:le})}return e.samples=B,this.remuxAudio(e,t,n,!1)}}function $i(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function Ro(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function ra(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let l=0;l<i;l++){const c=a.samples[l];c.pts=$i(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=$i(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function sa(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=$i(l.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,l)=>s.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 Lo{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(en(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=rt(e);i.audio&&(t=oa(i.audio,T.AUDIO)),i.video&&(n=oa(i.video,T.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"}:b.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var l,c;let{initPTS:h,lastEndTime:f}=this;const g={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};O(f)||(f=this.lastEndTime=r||0);const E=t.samples;if(!(E!=null&&E.length))return g;const L={initPTS:void 0,timescale:1};let A=this.initData;if((l=A)!=null&&l.length||(this.generateInitSegment(E),A=this.initData),!((c=A)!=null&&c.length))return b.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),g;this.emitInitSegment&&(L.tracks=this.initTracks,this.emitInitSegment=!1);const D=Zt(E,A),B=Wt(A,E),X=B===null?r:B;(Io(h,X,r,D)||L.timescale!==h.timescale&&s)&&(L.initPTS=X-r,h&&h.timescale===1&&b.warn(`Adjusting initPTS by ${L.initPTS-h.baseTime}`),this.initPTS=h={baseTime:L.initPTS,timescale:1});const le=e?X-h.baseTime/h.timescale:f,oe=le+D;xn(A,E,h.baseTime/h.timescale),D>0?this.lastEndTime=oe:(b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const we=!!A.audio,de=!!A.video;let Pe="";we&&(Pe+="audio"),de&&(Pe+="video");const Te={data1:E,startPTS:le,startDTS:le,endPTS:oe,endDTS:oe,type:Pe,hasAudio:we,hasVideo:de,nb:1,dropped:0};return g.audio=Te.type==="audio"?Te:void 0,g.video=Te.type!=="audio"?Te:void 0,g.initSegment=L,g.id3=ra(n,r,h,h),i.samples.length&&(g.text=sa(i,r,h)),g}}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===T.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return je(t,!1);const n="mp4a.40.5";return b.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return b.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){b.debug("Unable to use Performance API on this environment"),ir=ve==null?void 0:ve.Date.now}const Vr=[{demux:po,remux:Lo},{demux:ur,remux:jr},{demux:ho,remux:jr},{demux:Eo,remux:jr}];Vr.splice(2,0,{demux:go,remux:jr});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:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:f,trackSwitch:g,accurateTimeOffset:E,timeOffset:L,initSegmentChange:A}=i||l,{audioCodec:D,videoCodec:B,defaultInitPts:X,duration:le,initSegmentData:oe}=c,we=Co(s,t);if(we&&we.method==="AES-128"){const Be=this.getDecrypter();if(Be.isSync()){let ze=Be.softwareDecrypt(s,we.key.buffer,we.iv.buffer);if(n.part>-1&&(ze=Be.flush()),!ze)return r.executeEnd=ir(),Es(n);s=new Uint8Array(ze)}else return this.decryptionPromise=Be.webCryptoDecrypt(s,we.key.buffer,we.iv.buffer).then(ze=>{const Le=this.push(ze,null,n);return this.decryptionPromise=null,Le}),this.decryptionPromise}const de=this.needsProbing(f,g);if(de){const Be=this.configureTransmuxer(s);if(Be)return b.warn(`[transmuxer] ${Be.message}`),this.observer.emit(u.ERROR,u.ERROR,{type:_.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:Be,reason:Be.message}),r.executeEnd=ir(),Es(n)}(f||g||A||de)&&this.resetInitSegment(oe,D,B,le,t),(f||A||de)&&this.resetInitialTimestamp(X),h||this.resetContiguity();const Pe=this.transmux(s,we,L,E,n),Te=this.currentTransmuxState;return Te.contiguous=!0,Te.discontinuity=!1,Te.trackSwitch=!1,r.executeEnd=ir(),Pe}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 g=n.flush();g&&s.push(this.push(g,null,e))}const{demuxer:c,remuxer:h}=this;if(!c||!h)return t.executeEnd=ir(),[Es(e)];const f=c.flush(l);return zr(f)?f.then(g=>(this.flushRemux(s,g,e),s)):(this.flushRemux(s,f,e),s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:h}=this.currentTransmuxState;b.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const f=this.remuxer.remux(i,r,s,l,h,c,!0,this.id);e.push({remuxResult:f,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:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,l,c,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i,vendor:r}=this;let s;for(let E=0,L=Vr.length;E<L;E++){var l;if((l=Vr[E].demux)!=null&&l.probe(e)){s=Vr[E];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const c=this.demuxer,h=this.remuxer,f=s.remux,g=s.demux;(!h||!(h instanceof f))&&(this.remuxer=new f(n,t,i,r)),(!c||!(c instanceof g))&&(this.demuxer=new g(n,t,i),this.probe=g.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Sr(this.config)),e}}function Co(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Es=a=>({remuxResult:{},chunkMeta:a});function zr(a){return"then"in a&&a.then instanceof Function}class Do{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 Oo{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(c,h,f){this.fn=c,this.context=h,this.once=f||!1}function r(c,h,f,g,E){if(typeof f!="function")throw new TypeError("The listener must be a function");var L=new i(f,g||c,E),A=t?t+h:h;return c._events[A]?c._events[A].fn?c._events[A]=[c._events[A],L]:c._events[A].push(L):(c._events[A]=L,c._eventsCount++),c}function s(c,h){--c._eventsCount===0?c._events=new n:delete c._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],f,g;if(this._eventsCount===0)return h;for(g in f=this._events)e.call(f,g)&&h.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(f)):h},l.prototype.listeners=function(h){var f=t?t+h:h,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var E=0,L=g.length,A=new Array(L);E<L;E++)A[E]=g[E].fn;return A},l.prototype.listenerCount=function(h){var f=t?t+h:h,g=this._events[f];return g?g.fn?1:g.length:0},l.prototype.emit=function(h,f,g,E,L,A){var D=t?t+h:h;if(!this._events[D])return!1;var B=this._events[D],X=arguments.length,le,oe;if(B.fn){switch(B.once&&this.removeListener(h,B.fn,void 0,!0),X){case 1:return B.fn.call(B.context),!0;case 2:return B.fn.call(B.context,f),!0;case 3:return B.fn.call(B.context,f,g),!0;case 4:return B.fn.call(B.context,f,g,E),!0;case 5:return B.fn.call(B.context,f,g,E,L),!0;case 6:return B.fn.call(B.context,f,g,E,L,A),!0}for(oe=1,le=new Array(X-1);oe<X;oe++)le[oe-1]=arguments[oe];B.fn.apply(B.context,le)}else{var we=B.length,de;for(oe=0;oe<we;oe++)switch(B[oe].once&&this.removeListener(h,B[oe].fn,void 0,!0),X){case 1:B[oe].fn.call(B[oe].context);break;case 2:B[oe].fn.call(B[oe].context,f);break;case 3:B[oe].fn.call(B[oe].context,f,g);break;case 4:B[oe].fn.call(B[oe].context,f,g,E);break;default:if(!le)for(de=1,le=new Array(X-1);de<X;de++)le[de-1]=arguments[de];B[oe].fn.apply(B[oe].context,le)}}return!0},l.prototype.on=function(h,f,g){return r(this,h,f,g,!1)},l.prototype.once=function(h,f,g){return r(this,h,f,g,!0)},l.prototype.removeListener=function(h,f,g,E){var L=t?t+h:h;if(!this._events[L])return this;if(!f)return s(this,L),this;var A=this._events[L];if(A.fn)A.fn===f&&(!E||A.once)&&(!g||A.context===g)&&s(this,L);else{for(var D=0,B=[],X=A.length;D<X;D++)(A[D].fn!==f||E&&!A[D].once||g&&A[D].context!==g)&&B.push(A[D]);B.length?this._events[L]=B.length===1?B[0]:B:s(this,L)}return this},l.prototype.removeAllListeners=function(h){var f;return h?(f=t?t+h:h,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l})(ua);var ko=ua.exports,xs=z(ko);class ca{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(h,f)=>{f=f||{},f.frag=this.frag,f.id=this.id,h===u.ERROR&&(this.error=f.error),this.hls.trigger(h,f)};this.observer=new xs,this.observer.on(u.FRAG_DECRYPTED,s),this.observer.on(u.ERROR,s);const l=Rn(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},c={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||Qa())){try{r.workerPath?(b.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=qa(r.workerPath)):(b.log(`injecting Web Worker for "${t}"`),this.workerContext=Ja()),this.onwmsg=g=>this.onWorkerMessage(g);const{worker:f}=this.workerContext;f.addEventListener("message",this.onwmsg),f.onerror=g=>{const E=new Error(`${g.message} (${g.filename}:${g.lineno})`);r.enableWorker=!1,b.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(u.ERROR,{type:_.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:E})},f.postMessage({cmd:"init",typeSupported:c,vendor:"",id:t,config:JSON.stringify(r)})}catch(f){b.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.resetWorker(),this.error=null,this.transmuxer=new la(this.observer,c,r,"",t)}return}this.transmuxer=new la(this.observer,c,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,c,h,f){var g,E;h.transmuxing.start=self.performance.now();const{transmuxer:L}=this,A=s?s.start:r.start,D=r.decryptdata,B=this.frag,X=!(B&&r.cc===B.cc),le=!(B&&h.level===B.level),oe=B?h.sn-B.sn:-1,we=this.part?h.part-this.part.index:-1,de=oe===0&&h.id>1&&h.id===(B==null?void 0:B.stats.chunkCount),Pe=!le&&(oe===1||oe===0&&(we===1||de&&we<=0)),Te=self.performance.now();(le||oe||r.stats.parsing.start===0)&&(r.stats.parsing.start=Te),s&&(we||!Pe)&&(s.stats.parsing.start=Te);const Be=!(B&&((g=r.initSegment)==null?void 0:g.url)===((E=B.initSegment)==null?void 0:E.url)),ze=new Oo(X,Pe,c,le,A,Be);if(!Pe||X||Be){b.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${h.sn} p: ${h.part} level: ${h.level} id: ${h.id}
|
|
discontinuity: ${X}
|
|
trackSwitch: ${le}
|
|
contiguous: ${Pe}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${A}
|
|
initSegmentChange: ${Be}`);const Le=new Do(n,i,t,l,f);this.configureTransmuxer(Le)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:D,chunkMeta:h,state:ze},e instanceof ArrayBuffer?[e]:[]);else if(L){const Le=L.push(e,D,h,ze);zr(Le)?(L.async=!0,Le.then(Ue=>{this.handleTransmuxComplete(Ue)}).catch(Ue=>{this.transmuxerError(Ue,h,"transmuxer-interface push error")})):(L.async=!1,this.handleTransmuxComplete(Le))}}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);zr(n)||t.async?(zr(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:_.MEDIA_ERROR,details:m.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)){b.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":b[t.data.logType]&&b[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 ha=100;class Po extends Dr{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",We.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===Ce.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=Ce.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(ha),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=Ce.IDLE):(this.loadedmetadata=!1,this.state=Ce.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Ce.IDLE:this.doTickIdle();break;case Ce.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=Ce.WAITING_INIT_PTS}break}case Ce.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=Ce.IDLE}break}case Ce.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=Ce.FRAG_LOADING;const c=s.flush(),h={frag:i,part:r,payload:c,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 c=this.getLoadPosition(),h=_n.bufferInfo(this.mediaBuffer,c,this.config.maxBufferHole);zi(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=Ce.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Ce.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=Ce.WAITING_TRACK;return}const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,T.AUDIO,We.AUDIO));const h=this.getFwdBufferInfo(c,We.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,l)){e.trigger(u.BUFFER_EOS,{type:"audio"}),this.state=Ce.ENDED;return}const f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,We.MAIN),g=h.len,E=this.getMaxBufferLength(f==null?void 0:f.len),L=l.fragments,A=L[0].start,D=this.getLoadPosition(),B=this.flushing?D:h.end;if(this.switchingTrack&&n){const we=D;l.PTSKnown&&we<A&&(h.end>A||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=A+.05)}if(g>=E&&!this.switchingTrack&&B<L[L.length-1].start)return;let X=this.getNextFragment(B,l),le=!1;if(X&&this.isLoopLoading(X,B)&&(le=!!X.gap,X=this.getNextFragmentLoopLoading(X,l,h,We.MAIN,E)),!X){this.bufferFlushed=!0;return}const oe=f&&X.start>f.end+l.targetduration;if(oe||!(f!=null&&f.len)&&h.len){const we=this.getAppendedFrag(X.start,We.MAIN);if(we===null||(le||(le=!!we.gap||!!oe&&f.len===0),oe&&!le||le&&h.nextStart&&h.nextStart<we.end))return}this.loadFragment(X,s,B)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new si(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(ha):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=Ce.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Ce.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 c=0;if(r.live||(n=l.details)!=null&&n.live){this.checkLiveUpdate(r);const f=this.mainDetails;if(r.deltaUpdateFailed||!f)return;if(!l.details&&r.hasProgramDateTime&&f.hasProgramDateTime)Er(r,f),c=r.fragments[0].start;else{var h;c=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,c),this.state===Ce.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=Ce.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:r}=e,{config:s,trackId:l,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const h=c[l];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const f=h.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const g=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let E=this.transmuxer;E||(E=this.transmuxer=new ca(this.hls,We.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const L=this.initPTS[n.cc],A=(t=n.initSegment)==null?void 0:t.data;if(L!==void 0){const B=i?i.index:-1,X=B!==-1,le=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,B,X);E.push(r,A,g,"",n,i,f.totalduration,!1,le,L)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${l}`);const{cache:D}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Gs,complete:!1};D.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=Ce.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!==We.AUDIO){if(!this.loadedmetadata&&n.type===We.MAIN){const r=this.videoBuffer||this.media;r&&_n.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,V({},r)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=Ce.ERROR;return}switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(We.AUDIO,t);break;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ce.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===St.AUDIO_TRACK&&(this.state=Ce.IDLE);break;case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===m.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==T.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==T.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Ce.ENDED&&(this.state=Ce.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,We.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:c,part:h,level:f}=l,{details:g}=f,{audio:E,text:L,id3:A,initSegment:D}=r;if(this.fragContextChanged(c)||!g){this.fragmentTracker.removeFragment(c);return}if(this.state=Ce.PARSING,this.switchingTrack&&E&&this.completeAudioSwitch(this.switchingTrack),D!=null&&D.tracks){const B=c.initSegment||c;this._bufferInitSegment(f,D.tracks,B,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:n,tracks:D.tracks})}if(E){const{startPTS:B,endPTS:X,startDTS:le,endDTS:oe}=E;h&&(h.elementaryStreams[T.AUDIO]={startPTS:B,endPTS:X,startDTS:le,endDTS:oe}),c.setElementaryStreamInfo(T.AUDIO,B,X,le,oe),this.bufferFragmentData(E,c,h,s)}if(A!=null&&(t=A.samples)!=null&&t.length){const B=o({id:n,frag:c,details:g},A);i.trigger(u.FRAG_PARSING_METADATA,B)}if(L){const B=o({id:n,frag:c,details:g},L);i.trigger(u.FRAG_PARSING_USERDATA,B)}}_bufferInitSegment(e,t,n,i){if(this.state!==Ce.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 c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(u.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===zn.NOT_LOADED||i===zn.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=Ce.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragments[0].start!==t.details.fragments[0].start&&Er(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,V({},e))}}function fa(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!kr(a[t].attrs,e[t].attrs))return!1;return!0}function kr(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function Ss(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Mo extends qt{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(E=>!n||n.indexOf(E.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(E=>E.default)&&(this.selectDefaultTrack=!1),l.forEach((E,L)=>{E.id=L});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!r&&c){const E=Ui(c,l,Xi);if(E>-1)r=l[E];else{const L=Ui(c,this.tracks);r=this.tracks[L]}}let h=this.findTrackId(r);h===-1&&r&&(h=this.findTrackId(null));const f={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,f);const g=this.trackId;if(h!==-1&&g===-1)this.setAudioTrack(h);else if(l.length&&g===-1){var s;const E=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(E.message),this.hls.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:E})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===St.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,V({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||Yi(e,i,Xi)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:c}=e;for(let h=0;h<t.length;h++){const f=t[h];if(Yi({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:c},f,Xi))return h}for(let h=0;h<t.length;h++){const f=t[h];if(kr(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return h}for(let h=0;h<t.length;h++){const f=t[h];if(kr(e.attrs,f.attrs,["LANGUAGE"]))return h}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();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 audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(u.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}}const da=500;class No extends Dr{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",We.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=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.ERROR,this.onError,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,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.ERROR,this.onError,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Ce.IDLE,this.setInterval(da),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragPrevious=n,this.state=Ce.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const l=n.start;for(let h=0;h<r.length;h++)if(l>=r[h].start&&l<=r[h].end){s=r[h];break}const c=n.start+n.duration;s?s.end=c:(s={start:l,end:c},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;l<s.length;){if(s[l].end<=r){s.shift();continue}else if(s[l].start<r)s[l].start=r;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,r,We.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===We.MAIN){var n;(n=this.media)!=null&&n.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===We.SUBTITLE&&(t.details===m.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Ce.STOPPED&&(this.state=Ce.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&fa(this.levels,t)){this.levels=t.map(n=>new si(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new si(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,We.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(da)}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 c=r[l];if(l>=r.length||!c)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=c.details)!=null&&n.live){const g=this.mainDetails;if(s.deltaUpdateFailed||!g)return;const E=g.fragments[0];if(!c.details)s.hasProgramDateTime&&g.hasProgramDateTime?(Er(s,g),h=s.fragments[0].start):E&&(h=E.start,Ci(s,h));else{var f;h=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),h===0&&E&&(h=E.start,Ci(s,h))}}c.details=s,this.levelLastLoaded=c,l===i&&(!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,h),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===Ce.IDLE&&(Bi(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&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:_.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();r.trigger(u.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=Ce.IDLE})}}doTick(){if(!this.media){this.state=Ce.IDLE;return}if(this.state===Ce.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=_n.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:l,len:c}=s,h=this.getFwdBufferInfo(this.media,We.MAIN),f=n.details,g=this.getMaxBufferLength(h==null?void 0:h.len)+f.levelTargetDuration;if(c>g)return;const E=f.fragments,L=E.length,A=f.edge;let D=null;const B=this.fragPrevious;if(l<A){const X=i.maxFragLookUpTolerance,le=l>A-X?0:X;D=Bi(B,E,Math.max(E[0].start,l),le),!D&&B&&B.start<E[0].start&&(D=E[0])}else D=E[L-1];if(!D)return;if(D=this.mapToInitFragWhenRequired(D),D.sn!=="initSegment"){const X=D.sn-f.startSN,le=E[X-1];le&&le.cc===D.cc&&this.fragmentTracker.getState(le)===zn.NOT_LOADED&&(D=le)}this.fragmentTracker.getState(D)===zn.NOT_LOADED&&this.loadFragment(D,n,l)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,n){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,n))}get mediaBufferTimeRanges(){return new Fo(this.tracksBuffered[this.currentTrackId]||[])}}class Fo{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class Bo extends qt{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=sn(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(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),sn(this.media.textTracks).forEach(t=>{Gn(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(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,g)=>{f.id=g});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!r&&l){this.selectDefaultTrack=!1;const f=Ui(l,s);if(f>-1)r=s[f];else{const g=Ui(l,this.tracks);r=this.tracks[g]}}let c=this.findTrackId(r);c===-1&&r&&(c=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),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||Yi(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(kr(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(kr(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(Ss(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===St.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Yi(e,n))return n;const i=Ui(e,this.tracksInGroup);if(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=sn(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||!O(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:c,type:h,url:f}=i;this.hls.trigger(u.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:h,url:f});const g=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(g)}}class Uo{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){b.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 $o{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&&b.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Ai(Rn(e.config.preferManagedMediaSource)),this.log=b.log.bind(b,t),this.warn=b.warn.bind(b,t),this.error=b.error.bind(b,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 Uo(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=Rn(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 c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,ga(n),Ko(n,l),n.load()}catch(c){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&&ga(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 c=this.tracks[s];if(c&&typeof c.buffer.changeType=="function"){var l;const{id:h,codec:f,levelCodec:g,container:E,metadata:L}=t[s],A=Ze(c.codec,c.levelCodec),D=A==null?void 0:A.replace(pa,"$1");let B=Ze(f,g);const X=(l=B)==null?void 0:l.replace(pa,"$1");if(B&&D!==X){s.slice(0,5)==="audio"&&(B=je(B,this.appendSource));const le=`${E};codecs=${B}`;this.appendChangeType(s,le),this.log(`switching codec ${A} to ${B}`),this.tracks[s]={buffer:c.buffer,codec:f,container:E,levelCodec:g,metadata:L,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:c,part:h,chunkMeta:f}=t,g=f.buffering[l],E=self.performance.now();g.start=E;const L=c.stats.buffering,A=h?h.stats.buffering:null;L.start===0&&(L.start=E),A&&A.start===0&&(A.start=E);const D=r.audio;let B=!1;l==="audio"&&(D==null?void 0:D.container)==="audio/mpeg"&&(B=!this.lastMpegAudioChunk||f.id===1||this.lastMpegAudioChunk.sn!==f.sn,this.lastMpegAudioChunk=f);const X=c.start,le={execute:()=>{if(g.executeStart=self.performance.now(),B){const oe=this.sourceBuffer[l];if(oe){const we=X-oe.timestampOffset;Math.abs(we)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${X} (delta: ${we}) sn: ${c.sn})`),oe.timestampOffset=X)}}this.appendExecutor(s,l)},onStart:()=>{},onComplete:()=>{const oe=self.performance.now();g.executeEnd=g.end=oe,L.first===0&&(L.first=oe),A&&A.first===0&&(A.first=oe);const{sourceBuffer:we}=this,de={};for(const Pe in we)de[Pe]=_n.getBuffered(we[Pe]);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:c,part:h,chunkMeta:f,parent:c.type,timeRanges:de})},onError:oe=>{const we={type:_.MEDIA_ERROR,parent:c.type,details:m.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:c,part:h,chunkMeta:f,error:oe,err:oe,fatal:!1};if(oe.code===DOMException.QUOTA_EXCEEDED_ERR)we.details=m.BUFFER_FULL_ERROR;else{const de=++this.appendErrors[l];we.details=m.BUFFER_APPEND_ERROR,this.warn(`Failed ${de}/${n.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),de>=n.config.appendErrorMaxRetry&&(we.fatal=!0)}n.trigger(u.ERROR,we)}};i.append(le,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[T.AUDIOVIDEO]?r.push("audiovideo"):(s[T.AUDIO]&&r.push("audio"),s[T.VIDEO]&&r.push("video"));const l=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);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,c=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(O(c)&&c>0){const h=Math.max(c,l),f=Math.floor(s/l)*l-h;this.flushBackBuffer(s,l,f)}if(O(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const h=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),f=Math.max(h,l),g=Math.floor(s/l)*l+f;this.flushFrontBuffer(s,l,g)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(l=>{const c=r[l];if(c){const h=_n.getBuffered(c);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(c.ended&&h.end(h.length-1)-e<t*2){this.log(`Cannot flush ${l} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:l})}}})}flushFrontBuffer(e,t,n){const{sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(s=>{const l=i[s];if(l){const c=_n.getBuffered(l),h=c.length;if(h<2)return;const f=c.start(h-1),g=c.end(h-1);if(n>f||e>=f&&e<=g)return;if(l.ended&&e-g<2*t){this.log(`Cannot flush ${s} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:f,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=O(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>l&&r>s||!O(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:_.MEDIA_ERROR,details:m.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=je(l,this.appendSource));const c=`${s.container};codecs=${l}`;this.log(`creating sourceBuffer(${c})`);try{const h=t[r]=n.addSourceBuffer(c),f=r;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(f,"bufferedchange",(g,E)=>{const L=E.removedRanges;L!=null&&L.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:_.MEDIA_ERROR,details:m.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:r,mimeType:c})}}}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:_.MEDIA_ERROR,details:m.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,c=l[e];if(!i||!r||!c){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const h=O(i.duration)?i.duration:1/0,f=O(r.duration)?r.duration:1/0,g=Math.max(0,t),E=Math.min(n,h,f);E>g&&(!c.ending||c.ended)?(c.ended=!1,this.log(`Removing [${g},${E}] from the ${e} SourceBuffer`),c.remove(g,E)):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 ga(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ko(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Go={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},ma=a=>String.fromCharCode(Go[a]||a),Hi=15,rr=100,Wo={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ho={17:2,18:4,21:6,22:8,23:10,19:13,20:15},jo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Vo={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 Zo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;b.log(`${this.time} [${e}] ${n}`)}}}const gr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class _a{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Yo{constructor(){this.uchar=" ",this.penState=new _a}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class Xo{constructor(e){this.chars=[],this.pos=0,this.currPenState=new _a,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<rr;t++)this.chars.push(new Yo);this.logger=e}equals(e){for(let t=0;t<rr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<rr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<rr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>rr&&(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<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=ma(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<rr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<rr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ts{constructor(e){this.rows=[],this.currRow=Hi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Hi;t++)this.rows.push(new Xo(e));this.logger=e}reset(){for(let e=0;e<Hi;e++)this.rows[e].clear();this.currRow=Hi-1}equals(e){let t=!0;for(let n=0;n<Hi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Hi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Hi;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<Hi;l++)this.rows[l].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[r].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let h=0;h<this.nrRollUpRows;h++)this.rows[t-this.nrRollUpRows+h+1].copy(s.rows[r+h])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+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;r<Hi;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class 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 Ts(n),this.nonDisplayedMemory=new Ts(n),this.lastOutputScreen=new Ts(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;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+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=Jo(),this.logger=void 0;const i=this.logger=new Zo;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<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,l=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+gr([t[n],t[n+1]])+"] -> ("+gr([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(Qo(i,r,c)){Zr(null,null,c),this.logger.log(3,()=>"Repeated command ("+gr([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,c);if(!s&&(l=this.parseChars(i,r),l)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+gr([i,r])+" orig: "+gr([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 ("+gr([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?Wo[e]:jo[e]:n=s===1?Ho[e]:Vo[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 '"+ma(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 = "+gr(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;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Zr(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function Zr(a,e,t){t.a=a,t.b=e}function Qo(a,e,t){return t.a===a&&t.b===e}function Jo(){return{a:null,b:null}}class Yr{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var ws=function(){if(ve!=null&&ve.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const h=c.toLowerCase();return~l.indexOf(h)?h:!1}function n(l){return t(a,l)}function i(l){return t(e,l)}function r(l,...c){let h=1;for(;h<arguments.length;h++){const f=arguments[h];for(const g in f)l[g]=f[g]}return l}function s(l,c,h){const f=this,g={enumerable:!0};f.hasBeenReset=!1;let E="",L=!1,A=l,D=c,B=h,X=null,le="",oe=!0,we="auto",de="start",Pe=50,Te="middle",Be=50,ze="middle";Object.defineProperty(f,"id",r({},g,{get:function(){return E},set:function(Le){E=""+Le}})),Object.defineProperty(f,"pauseOnExit",r({},g,{get:function(){return L},set:function(Le){L=!!Le}})),Object.defineProperty(f,"startTime",r({},g,{get:function(){return A},set:function(Le){if(typeof Le!="number")throw new TypeError("Start time must be set to a number.");A=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",r({},g,{get:function(){return D},set:function(Le){if(typeof Le!="number")throw new TypeError("End time must be set to a number.");D=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",r({},g,{get:function(){return B},set:function(Le){B=""+Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",r({},g,{get:function(){return X},set:function(Le){X=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",r({},g,{get:function(){return le},set:function(Le){const Ue=n(Le);if(Ue===!1)throw new SyntaxError("An invalid or illegal string was specified.");le=Ue,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",r({},g,{get:function(){return oe},set:function(Le){oe=!!Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",r({},g,{get:function(){return we},set:function(Le){if(typeof Le!="number"&&Le!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");we=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",r({},g,{get:function(){return de},set:function(Le){const Ue=i(Le);if(!Ue)throw new SyntaxError("An invalid or illegal string was specified.");de=Ue,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",r({},g,{get:function(){return Pe},set:function(Le){if(Le<0||Le>100)throw new Error("Position must be between 0 and 100.");Pe=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",r({},g,{get:function(){return Te},set:function(Le){const Ue=i(Le);if(!Ue)throw new SyntaxError("An invalid or illegal string was specified.");Te=Ue,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",r({},g,{get:function(){return Be},set:function(Le){if(Le<0||Le>100)throw new Error("Size must be between 0 and 100.");Be=Le,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",r({},g,{get:function(){return ze},set:function(Le){const Ue=i(Le);if(!Ue)throw new SyntaxError("An invalid or illegal string was specified.");ze=Ue,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class qo{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function ba(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 el{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Ea(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],c=s[1];e(l,c)}}const As=new ws(0,0,""),Xr=As.align==="middle"?"middle":"center";function tl(a,e,t){const n=a;function i(){const l=ba(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function r(l,c){const h=new el;Ea(l,function(E,L){let A;switch(E){case"region":for(let D=t.length-1;D>=0;D--)if(t[D].id===L){h.set(E,t[D].region);break}break;case"vertical":h.alt(E,L,["rl","lr"]);break;case"line":A=L.split(","),h.integer(E,A[0]),h.percent(E,A[0])&&h.set("snapToLines",!1),h.alt(E,A[0],["auto"]),A.length===2&&h.alt("lineAlign",A[1],["start",Xr,"end"]);break;case"position":A=L.split(","),h.percent(E,A[0]),A.length===2&&h.alt("positionAlign",A[1],["start",Xr,"end","line-left","line-right","auto"]);break;case"size":h.percent(E,L);break;case"align":h.alt(E,L,["start",Xr,"end","left","right"]);break}},/:/,/\s/),c.region=h.get("region",null),c.vertical=h.get("vertical","");let f=h.get("line","auto");f==="auto"&&As.line===-1&&(f=-1),c.line=f,c.lineAlign=h.get("lineAlign","start"),c.snapToLines=h.get("snapToLines",!0),c.size=h.get("size",100),c.align=h.get("align",Xr);let g=h.get("position","auto");g==="auto"&&As.position===50&&(g=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=g}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(/<br(?: \/)?>/gi,`
|
|
`)}class nl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new qo,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<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const l=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),l}function i(r){Ea(r,function(s,l){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const l=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new ws(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{tl(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 il=/\r\n|\n\r|\n|\r/g,Rs=function(e,t,n=0){return e.slice(n,n+t.length)===t},rl=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(!O(t)||!O(n)||!O(i)||!O(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 Is(a,e,t){return Ls(a.toString())+Ls(e.toString())+Ls(t)}const sl=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 al(a,e,t,n,i,r,s){const l=new nl,c=wt(new Uint8Array(a)).trim().replace(il,`
|
|
`).split(`
|
|
`),h=[],f=e?So(e.baseTime,e.timescale):0;let g="00:00.000",E=0,L=0,A,D=!0;l.oncue=function(B){const X=t[n];let le=t.ccOffset;const oe=(E-f)/9e4;if(X!=null&&X.new&&(L!==void 0?le=t.ccOffset=X.start:sl(t,n,oe)),oe){if(!e){A=new Error("Missing initPTS for VTT MPEGTS");return}le=oe-t.presentationOffset}const we=B.endTime-B.startTime,de=$i((B.startTime+le-L)*9e4,i*9e4)/9e4;B.startTime=Math.max(de,0),B.endTime=Math.max(de+we,0);const Pe=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(Pe)),B.id||(B.id=Is(B.startTime,B.endTime,Pe)),B.endTime>0&&h.push(B)},l.onparsingerror=function(B){A=B},l.onflush=function(){if(A){s(A);return}r(h)},c.forEach(B=>{if(D)if(Rs(B,"X-TIMESTAMP-MAP=")){D=!1,B.slice(16).split(",").forEach(X=>{Rs(X,"LOCAL:")?g=X.slice(6):Rs(X,"MPEGTS:")&&(E=parseInt(X.slice(7)))});try{L=rl(g)/1e3}catch(X){A=X}return}else B===""&&(D=!1);l.parse(B+`
|
|
`)}),l.flush()}const Cs="stpp.ttml.im1t",Sa=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ta=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ol={left:"start",center:"center",right:"end",start:"start",end:"end"};function wa(a,e,t,n){const i=Ke(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(l=>wt(l)),s=xo(e.baseTime,1,e.timescale);try{r.forEach(l=>t(ll(l,s)))}catch(l){n(l)}}function ll(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((g,E)=>(g[E]=i.getAttribute(`ttp:${E}`)||r[E],g),{}),l=i.getAttribute("xml:space")!=="preserve",c=Aa(Ds(i,"styling","style")),h=Aa(Ds(i,"layout","region")),f=Ds(i,"body","[begin]");return[].map.call(f,g=>{const E=Ra(g,l);if(!E||!g.hasAttribute("begin"))return null;const L=ks(g.getAttribute("begin"),s),A=ks(g.getAttribute("dur"),s);let D=ks(g.getAttribute("end"),s);if(L===null)throw La(g);if(D===null){if(A===null)throw La(g);D=L+A}const B=new ws(L-e,D-e,E);B.id=Is(B.startTime,B.endTime,B.text);const X=h[g.getAttribute("region")],le=c[g.getAttribute("style")],oe=ul(X,le,c),{textAlign:we}=oe;if(we){const de=ol[we];de&&(B.lineAlign=de),B.align=we}return o(B,oe),B}).filter(g=>g!==null)}function Ds(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Aa(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Ra(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?Ra(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function ul(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,c)=>{const h=Os(e,n,c)||Os(a,n,c)||Os(i,n,c);return h&&(l[c]=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=ba(a);return t===null&&(Sa.test(a)?t=cl(a,e):Ta.test(a)&&(t=hl(a,e))),t}function cl(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=Ta.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 c=r[l],h=dl(c[0],c[1],t,n);if(h>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[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<n.textTracks.length;i++){const r=n.textTracks[i];if(Ca(r,{name:e,lang:t,attrs:{}}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],l=this.getExistingTrack(r,s);if(l)n[e]=l,Gn(n[e]),Kn(n[e],i);else{const c=this.createTextTrack("captions",r,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(u.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{Gn(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;n<t.length;n++)Gn(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===Cs);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(fa(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?sn(s.textTracks):null;if(this.tracks.forEach((c,h)=>{let f;if(l){let g=null;for(let E=0;E<l.length;E++)if(l[E]&&Ca(l[E],c)){g=l[E],l[E]=null;break}g&&(f=g)}if(f)Gn(f);else{const g=Ia(c);f=this.createTextTrack(g,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),l!=null&&l.length){const c=l.filter(h=>h!==null).map(h=>h.label);c.length&&b.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(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===We.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:l}=this,{cc:c,sn:h}=t.frag,f=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(h!==l+1||h===l&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=h,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===We.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const l=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===Cs?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;wa(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{b.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 c=this.hls,h=(t=n.initSegment)!=null&&t.data?Yt(n.initSegment.data,new Uint8Array(i)):i;al(h,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const g=f.message==="Missing initPTS for VTT MPEGTS";g?s.push(e):this._fallbackToIMSC1(n,i),b.log(`Failed to parse VTT cue: ${f}`),!(g&&l>n.cc)&&c.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||wa(t,this.initPTS[e.cc],()=>{n.textCodec=Cs,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=>Hn(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===We.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===We.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let l=0;l<s.length;l++){const c=s[l].bytes;if(c){const h=this.extractCea608Data(c);n.addData(s[l].pts,h[0]),i.addData(s[l].pts,h[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>An(l[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>An(l[c],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],l=127&e[i++],c=127&e[i++];if(l===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(l),t[f].push(c))}}return t}}function Ia(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Ca(a,e){return!!a&&a.kind===Ia(e)&&Ss(e,a)}function dl(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Da(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Ps{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&O(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&b.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,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,c)=>c?l.width!==c.width||l.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=s||c.height>=s)&&i(c,e[l+1])){r=l;break}}return r}}class pl{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,c=1e3*s/r,h=this.hls;if(h.trigger(u.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>h.config.fpsDroppedMonitoringThreshold*l){let f=h.currentLevel;b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=f)&&(f=f-1,h.trigger(u.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:h.currentLevel}),h.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Qr="[eme]";class Ar{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=Ar.CDMCleanupPromise?[Ar.CDMCleanupPromise]:[],this.debug=b.debug.bind(b,Qr),this.log=b.log.bind(b,Qr),this.warn=b.warn.bind(b,Qr),this.error=b.error.bind(b,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(lt).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=Ge(s);let c,h;if(n==="sinf"){if(l!==ye.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const A=Ve(new Uint8Array(i));try{const D=d(JSON.parse(A).sinf),B=fn(D);if(!B)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=B.subarray(8,24),h=ye.FAIRPLAY}catch(D){this.warn(`${r} Failed to parse sinf: ${D}`);return}}else{if(l!==ye.WIDEVINE&&l!==ye.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const A=Yn(i),D=A.filter(X=>!!X.systemId&&pt(X.systemId)===l);D.length>1&&this.warn(`${r} Using first of ${D.length} pssh found for selected key-system ${l}`);const B=D[0];if(!B){A.length===0||A.some(X=>!X.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${A.map(X=>pt(X.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(h=pt(B.systemId),B.version===0&&B.data)if(h===ye.WIDEVINE){const X=B.data.length-22;c=B.data.subarray(X,X+16)}else h===ye.PLAYREADY&&(c=it(B.data))}if(!h||!c){this.log(`Unable to handle ${r} with key-system ${l}`);return}const f=bt.hexDump(c),{keyIdToKeySessionPromise:g,mediaKeySessions:E}=this;let L=g[f];for(let A=0;A<E.length;A++){const D=E[A],B=D.decryptdata;if(!B.keyId)continue;const X=bt.hexDump(B.keyId);if(f===X||B.uri.replace(/-/g,"").indexOf(f)!==-1){if(L=g[X],B.pssh)break;delete g[X],B.pssh=new Uint8Array(i),B.keyId=c,L=g[f]=L.then(()=>this.generateRequestWithPreferredKeySession(D,n,i,"encrypted-event-key-match")),L.catch(le=>this.handleError(le));break}}if(!L){if(h!==l){this.log(`Ignoring "${r}" with ${h} init data for selected key-system ${l}`);return}L=g[f]=this.getKeySystemSelectionPromise([h]).then(({keySystem:A,mediaKeys:D})=>{var B;this.throwIfDestroyed();const X=new Kt("ISO-23001-7",f,(B=lt(A))!=null?B:"");return X.pssh=new Uint8Array(i),X.keyId=c,this.attemptSetMediaKeys(A,D).then(()=>{this.throwIfDestroyed();const le=this.createMediaKeySessionContext({decryptdata:X,keySystem:A,mediaKeys:D});return this.generateRequestWithPreferredKeySession(le,n,i,"encrypted-event-no-match")})}),L.catch(A=>this.handleError(A))}})}},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===ye.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,c)=>!!s&&c.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 c=h=>{const f=h.shift();this.getMediaKeysPromise(f,i,r).then(g=>s({keySystem:f,mediaKeys:g})).catch(g=>{h.length?c(h):g instanceof Ki?l(g):l(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_ACCESS,error:g,fatal:!0},g.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return yt===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=et(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(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const h=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),h.then(g=>g?this.setMediaKeysServerCertificate(f,e,g):f))),l.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),l.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${bt.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 bt.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${bt.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(Ge).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const l=lt(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 c=this.createMediaKeySessionContext({keySystem:s,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(c,"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:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Ge(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:_.KEY_SYSTEM_ERROR,details:m.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 A=l.call(this.hls,t,n,e);if(!A)throw new Error("Invalid response from configured generateRequest filter");t=A.initDataType,n=e.decryptdata.pssh=A.initData?new Uint8Array(A.initData):null}catch(A){var c;if(this.warn(A.message),(c=this.hls)!=null&&c.config.debug)throw A}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 f=new xs,g=e._onmessage=A=>{const D=e.mediaKeysSession;if(!D){f.emit("error",new Error("invalid state"));return}const{messageType:B,message:X}=A;this.log(`"${B}" message event for session "${D.sessionId}" message size: ${X.byteLength}`),B==="license-request"||B==="license-renewal"?this.renewLicense(e,X).catch(le=>{this.handleError(le),f.emit("error",le)}):B==="license-release"?e.keySystem===ye.FAIRPLAY&&(this.updateKeySession(e,se("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${B}"`)},E=e._onkeystatuseschange=A=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const B=e.keyStatus;f.emit("keyStatus",B),B==="expired"&&(this.warn(`${e.keySystem} expired for key ${h}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",g),e.mediaKeysSession.addEventListener("keystatuseschange",E);const L=new Promise((A,D)=>{f.on("error",D),f.on("keyStatus",B=>{B.startsWith("usable")?A():B==="output-restricted"?D(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):B==="internal-error"?D(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${B}"`)):B==="expired"?D(new Error("key expired while generating request")):this.warn(`unhandled key status change "${B}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var A;this.log(`Request generated for key-session "${(A=e.mediaKeysSession)==null?void 0:A.sessionId}" keyId: ${h}`)}).catch(A=>{throw new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_SESSION,error:A,fatal:!1},`Error generating key-session request: ${A}`)}).then(()=>L).catch(A=>{throw f.removeAllListeners(),this.removeSession(e),A}).then(()=>(f.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${bt.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${bt.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 c={responseType:"arraybuffer",url:r},h=t.certLoadPolicy.default,f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},g={onSuccess:(E,L,A,D)=>{s(E.data)},onError:(E,L,A,D)=>{l(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:V({url:c.url,data:void 0},E)},`"${e}" certificate request failed (${r}). Status: ${E.code} (${E.text})`))},onTimeout:(E,L,A)=>{l(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:A,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(E,L,A)=>{l(new Error("aborted"))}};i.load(c,f,g)})):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:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Ki({type:_.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let f;for(let g=0,E=r.length;g<E;g++){var s,l;f=r[g];const L=(s=f.querySelector("name"))==null?void 0:s.textContent,A=(l=f.querySelector("value"))==null?void 0:l.textContent;L&&A&&e.setRequestHeader(L,A)}}const c=i.querySelector("Challenge"),h=c==null?void 0:c.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return se(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 c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const h=this.config.licenseResponseCallback;if(h)try{c=h.call(this.hls,l,s,e)}catch(f){this.error(f)}i(c)}else{const c=n.errorRetry,h=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||l.status>=400&&l.status<500)r(new Ki({type:_.KEY_SYSTEM_ERROR,details:m.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 f=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:c,licenseChallenge:h})=>{e.keySystem==ye.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(c,h)),c.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={},Kt.clearKeyUriToKeyIdMap();const n=t.length;Ar.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}`)})}}}Ar.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 Ei;(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"})(Ei||(Ei={}));var Ms;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(Ms||(Ms={}));var mr;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(mr||(mr={}));const gl={[mr.OBJECT]:["br","d","ot","tb"],[mr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[mr.SESSION]:["cid","pr","sf","sid","st","v"],[mr.STATUS]:["bs","rtp"]};class Rr{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof Rr?n:new Rr(n))),this.value=e,this.params=t}}class Oa{constructor(e){this.description=void 0,this.description=e}}const ml="Dict";function _l(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 vl(a,e,t,n){return new Error(`failed to ${a} "${_l(e)}" as ${t}`,{cause:n})}const ka="Bare Item",yl="Boolean",bl="Byte Sequence",El="Decimal",xl="Integer";function Sl(a){return a<-999999999999999||999999999999999<a}const Tl=/[\x00-\x1f\x7f]+/,wl="Token",Al="Key";function Ji(a,e,t){return vl("serialize",a,e,t)}function Rl(a){if(typeof a!="boolean")throw Ji(a,yl);return a?"?1":"?0"}function Ll(a){return btoa(String.fromCharCode(...a))}function Il(a){if(ArrayBuffer.isView(a)===!1)throw Ji(a,bl);return`:${Ll(a)}:`}function Pa(a){if(Sl(a))throw Ji(a,xl);return a.toString()}function Cl(a){return`@${Pa(a.getTime()/1e3)}`}function Ma(a,e){if(a<0)return-Ma(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}function Dl(a){const e=Ma(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Ji(a,El);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ol="String";function kl(a){if(Tl.test(a))throw Ji(a,Ol);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Pl(a){return a.description||a.toString().slice(7,-1)}function Na(a){const e=Pl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ji(e,wl);return e}function Ns(a){switch(typeof a){case"number":if(!O(a))throw Ji(a,ka);return Number.isInteger(a)?Pa(a):Dl(a);case"string":return kl(a);case"symbol":return Na(a);case"boolean":return Rl(a);case"object":if(a instanceof Date)return Cl(a);if(a instanceof Uint8Array)return Il(a);if(a instanceof Oa)return Na(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)}=${Ns(t)}`).join("")}function Fa(a){return a instanceof Rr?`${Ns(a.value)}${Bs(a.params)}`:Ns(a)}function Ml(a){return`(${a.value.map(Fa).join(" ")})${Bs(a.params)}`}function Nl(a,e={whitespace:!0}){if(typeof a!="object")throw Ji(a,ml);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Rr||(r=new Rr(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 Fl(a,e){return Nl(a,e)}const Bl=a=>a==="ot"||a==="sf"||a==="st",Ul=a=>typeof a=="number"?O(a):a!=null&&a!==""&&a!==!1;function $l(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 Kl(){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),Gl=(a,e)=>(e!=null&&e.baseUrl&&(a=$l(a,e.baseUrl)),encodeURIComponent(a)),qr=a=>Jr(a/100)*100,Wl={br:Jr,d:Jr,bl:qr,dl:qr,mtp:qr,nor:Gl,rtp:qr,tb:Jr};function Hl(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=o({},Wl,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 c=i[s];c&&(l=c(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||Ul(l)&&(Bl(s)&&typeof l=="string"&&(l=new Oa(l)),t[s]=l))}),t}function Ba(a,e={}){return a?Fl(Hl(a,e),o({whitespace:!1},e)):""}function jl(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,c;const[h,f]=s,g=((l=n.find(E=>E[1].includes(h)))==null?void 0:l[0])||mr.REQUEST;return(c=r[g])!=null||(r[g]={}),r[g][h]=f,r},{});return Object.entries(i).reduce((r,[s,l])=>(r[s]=Ba(l,e),r),{})}function Vl(a,e,t){return o(a,jl(e,t))}const zl="CMCD";function Zl(a,e={}){if(!a)return"";const t=Ba(a,e);return`${zl}=${encodeURIComponent(t)}`}const Ua=/CMCD=[^&#]+/;function Yl(a,e,t){const n=Zl(e,t);if(!n)return a;if(Ua.test(a))return a.replace(Ua,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Xl{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:Ei.MANIFEST,su:!this.initialized})}catch(r){b.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),c={d:r.duration*1e3,ot:l};(l===Ei.VIDEO||l===Ei.AUDIO||l==Ei.MUXED)&&(c.br=s.bitrate/1e3,c.tb=this.getTopBandwidth(l)/1e3,c.bl=this.getBufferLength(l)),this.apply(i,c)}catch(r){b.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||Kl(),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:Ms.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===Ei.INIT||t.ot===Ei.VIDEO||t.ot===Ei.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={}),Vl(e.headers,t)):e.url=Yl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ei.TIMED_TEXT;if(e.sn==="initSegment")return Ei.INIT;if(t==="audio")return Ei.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ei.VIDEO:Ei.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Ei.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===Ei.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:_n.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 Ql=3e5;class Jl{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=b.log.bind(b,"[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)===Xe.SendAlternateToPenaltyBox&&n.flags===Xt.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:h}=t.context;l&&i?s=this.getPathwayForGroupId(l,h,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=i.reduce((l,c)=>(l.indexOf(c.pathwayId)===-1&&l.push(c.pathwayId),l),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||b.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]>Ql&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Vn(t),this.hls.trigger(u.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[l];c&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.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<i.length;r++)if(t===St.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===St.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":c}=r;if(t.some(f=>f.pathwayId===s))return;const h=this.getLevelsForPathway(l).map(f=>{const g=new H(f.attrs);g["PATHWAY-ID"]=s;const E=g.AUDIO&&`${g.AUDIO}_clone_${s}`,L=g.SUBTITLES&&`${g.SUBTITLES}_clone_${s}`;E&&(n[g.AUDIO]=E,g.AUDIO=E),L&&(i[g.SUBTITLES]=L,g.SUBTITLES=L);const A=Ka(f.uri,g["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),D=new si({attrs:g,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:A,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let B=1;B<f.audioGroups.length;B++)D.addGroupId("audio",`${f.audioGroups[B]}_clone_${s}`);if(f.subtitleGroups)for(let B=1;B<f.subtitleGroups.length;B++)D.addGroupId("text",`${f.subtitleGroups[B]}_clone_${s}`);return D});t.push(...h),$a(this.audioTracks,n,c,s),$a(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+f)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},h={onSuccess:(f,g,E,L)=>{this.log(`Loaded steering manifest: "${i}"`);const A=f.data;if(A.VERSION!==1){this.log(`Steering VERSION ${A.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=A.TTL;const{"RELOAD-URI":D,"PATHWAY-CLONES":B,"PATHWAY-PRIORITY":X}=A;if(D)try{this.uri=new self.URL(D,i).href}catch(oe){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${D}`);return}this.scheduleRefresh(this.uri||E.url),B&&this.clonePathways(B);const le={steeringManifest:A,url:i.toString()};this.hls.trigger(u.STEERING_MANIFEST_LOADED,le),X&&this.updatePathwayPriority(X)},onError:(f,g,E,L)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${g.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${g.url} no longer available`);return}let A=this.timeToLoad*1e3;if(f.code===429){const D=this.loader;if(typeof(D==null?void 0:D.getResponseHeader)=="function"){const B=D.getResponseHeader("Retry-After");B&&(A=parseFloat(B)*1e3)}this.log(`Steering manifest ${g.url} rate limited`);return}this.scheduleRefresh(this.uri||g.url,A)},onTimeout:(f,g,E)=>{this.log(`Timeout loading steering manifest (${g.url})`),this.scheduleRefresh(this.uri||g.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,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 H(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 c=new self.URL(a);return i&&!l&&(c.host=i),r&&Object.keys(r).sort().forEach(h=>{h&&c.searchParams.set(h,r[h])}),c.href}const ql=/^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 Y,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&&O(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 g=l!=null?l:t.response;if(g!=null){n.loading.end=Math.max(self.performance.now(),n.loading.first);const E=t.responseType==="arraybuffer"?g.byteLength:g.length;if(n.loaded=n.total=E,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const L=this.callbacks.onProgress;if(L&&L(n,e,g,t),!this.callbacks)return;const A={url:t.responseURL,data:g,code:s};this.callbacks.onSuccess(A,n,e,t);return}}const c=r.loadPolicy.errorRetry,h=n.retry,f={url:e.url,data:void 0,code:s};Wn(c,h,!1,f)?this.retry(c):(b.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(Wn(e,t,!0))this.retry(e);else{var n;b.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=ai(e,n.retry),n.retry++,b.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&&ql.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 eu(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const tu=/(\d+)-(\d+)\/(\d+)/;class Wa{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||su,this.controller=new self.AbortController,this.stats=new Y}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=nu(e,this.controller.signal),s=n.onProgress,l=e.responseType==="arraybuffer",c=l?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:f}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=h&&O(h)?h:f,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(g=>{this.response=this.loader=g;const E=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=f,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},f-(E-i.loading.start)),!g.ok){const{status:L,statusText:A}=g;throw new au(A||"fetch, bad network response",L,g)}return i.loading.first=E,i.total=ru(g.headers)||i.total,s&&O(t.highWaterMark)?this.loadProgressively(g,i,e,t.highWaterMark,s):l?g.arrayBuffer():e.responseType==="json"?g.json():g.text()}).then(g=>{const E=this.response;if(!E)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const L=g[c];L&&(i.loaded=i.total=L);const A={url:E.url,data:g,code:E.status};s&&!O(t.highWaterMark)&&s(i,e,g,E),n.onSuccess(A,i,e,E)}).catch(g=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const E=g&&g.code||0,L=g?g.message:null;n.onError({code:E,text:L},e,g?g.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(),c=()=>l.read().then(h=>{if(h.done)return s.dataLength&&r(t,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const f=h.value,g=f.length;return t.loaded+=g,g<i||s.dataLength?(s.push(f),s.dataLength>=i&&r(t,n,s.flush(),e)):r(t,n,f,e),c()}).catch(()=>Promise.reject());return c()}}function nu(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 iu(a){const e=tu.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function ru(a){const e=a.get("Content-Range");if(e){const n=iu(e);if(O(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function su(a,e){return new self.Request(a.url,e)}class au extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const ou=/\s/,lu={newCue(a,e,t,n){const i=[];let r,s,l,c,h;const f=self.VTTCue||self.TextTrackCue;for(let E=0;E<n.rows.length;E++)if(r=n.rows[E],l=!0,c=0,h="",!r.isEmpty()){var g;for(let D=0;D<r.chars.length;D++)ou.test(r.chars[D].uchar)&&l?c++:(h+=r.chars[D].uchar,l=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const L=xa(h.trim()),A=Is(e,t,L);a!=null&&(g=a.cues)!=null&&g.getCueById(A)||(s=new f(e,t,L),s.id=A,s.line=E+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((E,L)=>E.line==="auto"||L.line==="auto"?0:E.line>8&&L.line>8?L.line-E.line:E.line-L.line),i.forEach(E=>Hn(a,E))),i}},uu={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ha=V(V({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:$o,capLevelController:Ps,errorController:On,fpsController:pl,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:yt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:uu},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},cu()),{},{subtitleStreamController:No,subtitleTrackController:Bo,timelineController:fl,audioStreamController:Po,audioTrackController:Mo,emeController:Ar,cmcdController:Xl,contentSteeringController:Jl});function cu(){return{cueHandler:lu,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,c=[];i.forEach(h=>{const f=`${r}Loading${h}`,g=e[f];if(g!==void 0&&l){c.push(f);const E=t[s].default;switch(e[s]={default:E},h){case"TimeOut":E.maxLoadTimeMs=g,E.maxTimeToFirstByteMs=g;break;case"MaxRetry":E.errorRetry.maxNumRetry=g,E.timeoutRetry.maxNumRetry=g;break;case"RetryDelay":E.errorRetry.retryDelayMs=g,E.timeoutRetry.retryDelayMs=g;break;case"MaxRetryTimeout":E.errorRetry.maxRetryDelayMs=g,E.timeoutRetry.maxRetryDelayMs=g;break}}}),c.length&&b.warn(`hls.js config: "${c.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),V(V({},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!==Wa&&e!==Ga?(b.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):eu()&&(a.loader=Wa,a.progressive=!0,a.enableSoftwareAES=!0,b.log("[config]: Progressive streaming enabled, using FetchLoader"))}let $s;class du extends qt{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,c=!1,h=!1;t.levels.forEach(f=>{var g,E;const L=f.attrs;let{audioCodec:A,videoCodec:D}=f;((g=A)==null?void 0:g.indexOf("mp4a.40.34"))!==-1&&($s||($s=/chrome|firefox/i.test(navigator.userAgent)),$s&&(f.audioCodec=A=void 0)),A&&(f.audioCodec=A=je(A,n)),((E=D)==null?void 0:E.indexOf("avc1"))===0&&(D=f.videoCodec=Ht(D));const{width:B,height:X,unknownCodecs:le}=f;if(l||(l=!!(B&&X)),c||(c=!!D),h||(h=!!A),le!=null&&le.length||A&&!J(A,"audio",n)||D&&!J(D,"video",n))return;const{CODECS:oe,"FRAME-RATE":we,"HDCP-LEVEL":de,"PATHWAY-ID":Pe,RESOLUTION:Te,"VIDEO-RANGE":Be}=L,Le=`${`${Pe||"."}-`}${f.bitrate}-${Te}-${we}-${oe}-${Be}-${de}`;if(r[Le])if(r[Le].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Ue=s[Le]+=1;f.attrs["PATHWAY-ID"]=new Array(Ue+1).join(".");const Nt=new si(f);r[Le]=Nt,i.push(Nt)}else r[Le].addGroupId("audio",L.AUDIO),r[Le].addGroupId("text",L.SUBTITLES);else{const Ue=new si(f);r[Le]=Ue,s[Le]=1,i.push(Ue)}}),this.filterAndSortMediaOptions(i,t,l,c,h)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],l=[],c=e;if((n||i)&&r&&(c=c.filter(({videoCodec:A,videoRange:D,width:B,height:X})=>(!!A||!!(B&&X))&&hi(D))),c.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 A=new Error("no level with compatible codecs found in manifest");this.hls.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:A,reason:A.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:A}=this.hls.config;s=t.audioTracks.filter(D=>!D.audioCodec||J(D.audioCodec,"audio",A)),ja(s)}t.subtitles&&(l=t.subtitles,ja(l));const h=c.slice(0);c.sort((A,D)=>{if(A.attrs["HDCP-LEVEL"]!==D.attrs["HDCP-LEVEL"])return(A.attrs["HDCP-LEVEL"]||"")>(D.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&A.height!==D.height)return A.height-D.height;if(A.frameRate!==D.frameRate)return A.frameRate-D.frameRate;if(A.videoRange!==D.videoRange)return Mn.indexOf(A.videoRange)-Mn.indexOf(D.videoRange);if(A.videoCodec!==D.videoCodec){const B=De(A.videoCodec),X=De(D.videoCodec);if(B!==X)return X-B}if(A.uri===D.uri&&A.codecSet!==D.codecSet){const B=be(A.codecSet),X=be(D.codecSet);if(B!==X)return X-B}return A.averageBitrate!==D.averageBitrate?A.averageBitrate-D.averageBitrate:0});let f=h[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==h.length)){for(let A=0;A<h.length;A++)if(h[A].pathwayId===c[0].pathwayId){f=h[A];break}}this._levels=c;for(let A=0;A<c.length;A++)if(c[A]===f){var g;this._firstLevel=A;const D=f.bitrate,B=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${D}`),((g=this.hls.userConfig)==null?void 0:g.abrEwmaDefaultEstimate)===void 0){const X=Math.min(D,this.hls.config.abrEwmaDefaultEstimateMax);X>B&&B===Ha.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=X)}break}const E=r&&!i,L={levels:c,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!E&&s.some(A=>!!A.url)};this.hls.trigger(u.MANIFEST_PARSED,L),(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 f=new Error("invalid level idx"),g=e<0;if(this.hls.trigger(u.ERROR,{type:_.OTHER_ERROR,details:m.LEVEL_SWITCH_ERROR,level:e,fatal:g,error:f,reason:f.message}),g)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 c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(u.LEVEL_SWITCHING,c);const h=s.details;if(!h||h.live){const f=this.switchParams(s.uri,i==null?void 0:i.details,h);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===St.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===We.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));Vn(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 ja(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class pu{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=m.KEY_LOAD_ERROR,n,i,r){return new Nn({type:_.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{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,m.KEY_LOAD_ERROR,h))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,m.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 c;switch((c=l.mediaKeySessionContext)==null?void 0:c.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,m.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=n.keyLoadPolicy.default,f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},g={onSuccess:(E,L,A,D)=>{const{frag:B,keyInfo:X,url:le}=A;if(!B.decryptdata||X!==this.keyUriToKeyInfo[le])return l(this.createKeyLoadError(B,m.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),D));X.decryptdata.key=B.decryptdata.key=new Uint8Array(E.data),B.keyLoader=null,X.loader=null,s({frag:B,keyInfo:X})},onError:(E,L,A,D)=>{this.resetLoader(L),l(this.createKeyLoadError(t,m.KEY_LOAD_ERROR,new Error(`HTTP Error ${E.code} loading key ${E.text}`),A,V({url:c.url,data:void 0},E)))},onTimeout:(E,L,A)=>{this.resetLoader(L),l(this.createKeyLoadError(t,m.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),A))},onAbort:(E,L,A)=>{this.resetLoader(L),l(this.createKeyLoadError(t,m.INTERNAL_ABORTED,new Error("key loading aborted"),A))}};r.load(c,f,g)})}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 za(){if(!Rn())return!1;const e=Va();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function gu(){if(!za())return!1;const a=Rn();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(Ee(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ee(e,"audio"))))}function mu(){var a;const e=Va();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const _u=250,es=2,vu=.1,yu=.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,c=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 B=self.performance.now()-r;b.warn(`playback not stuck anymore @${s}, after ${Math.round(B)}ms`),this.stallReported=!1}this.stalled=null}return}if(h||c){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!_n.getBuffered(i).length){this.nudgeRetry=0;return}const f=_n.bufferInfo(i,s,0),g=f.nextStart||0;if(l){const B=f.len>es,X=!g||t&&t.start<=s||g-s>es&&!this.fragmentTracker.getPartialFragment(s);if(B||X)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E;if(!(f.len>0)&&!g)return;const X=Math.max(g,f.start||0)-s,le=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,we=(le==null||(E=le.details)==null?void 0:E.live)?le.details.targetduration*2:es,de=this.fragmentTracker.getPartialFragment(s);if(X>0&&(X<=we||de)){i.paused||this._trySkipBufferHole(de);return}}const L=self.performance.now();if(r===null){this.stalled=L;return}const A=L-r;if(!l&&A>=_u&&(this._reportStall(f),!this.media))return;const D=_n.bufferInfo(i,s,n.maxBufferHole);this._tryFixBufferStall(D,A)}_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-s<n.maxBufferHole)&&t>n.highBufferWatchdogPeriod*1e3&&(b.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)})`);b.warn(r.message),t.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.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=_n.bufferInfo(i,r,0),l=r<s.start?s.start:s.nextStart;if(l){const c=s.len<=t.maxBufferHole,h=s.len>0&&s.len<1&&i.readyState<3,f=l-r;if(f>0&&(c||h)){if(f>t.maxBufferHole){const{fragmentTracker:E}=this;let L=!1;if(r===0){const A=E.getAppendedFrag(0,We.MAIN);A&&l<A.end&&(L=!0)}if(!L){const A=e||E.getAppendedFrag(r,We.MAIN);if(A){let D=!1,B=A.end;for(;B<l;){const X=E.getPartialFragment(B);if(X)B+=X.duration;else{D=!0;break}}if(D)return 0}}}const g=Math.max(l+yu,r+vu);if(b.warn(`skipping hole, adjusting currentTime from ${r} to ${g}`),this.moved=!0,this.stalled=null,i.currentTime=g,e&&!e.gap){const E=new Error(`fragment loaded with buffer holes, seeking from ${r} to ${g}`);n.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:E,reason:E.message,frag:e})}return g}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:n,nudgeRetry:i}=this;if(n===null)return;const r=n.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const s=r+(i+1)*e.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${r} to ${s}`);b.warn(l.message),n.currentTime=s,t.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1})}else{const s=new Error(`Playhead still not moving while enough data buffered @${r} after ${e.nudgeMaxRetry} nudges`);b.error(s.message),t.trigger(u.ERROR,{type:_.MEDIA_ERROR,details:m.BUFFER_STALLED_ERROR,error:s,fatal:!0})}}}const Eu=100;class xu extends Dr{constructor(e,t,n){super(e,t,n,"[stream-controller]",We.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_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_LOADED,this.onLevelLoaded,this),e.on(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(u.ERROR,this.onError,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,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.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(u.ERROR,this.onError,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:n}=this;if(this.stopLoad(),this.setInterval(Eu),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(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=Ce.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Ce.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ce.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=Ce.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Ce.IDLE;break}break}case Ce.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=Ce.IDLE}}break}this.state===Ce.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 c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const D={};this.altAudio&&(D.type="video"),this.hls.trigger(u.BUFFER_EOS,D),this.state=Ce.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===Ce.WAITING_LEVEL||h.live&&this.levelLastLoaded!==s){this.level=r,this.state=Ce.WAITING_LEVEL;return}const f=l.len,g=this.getMaxBufferLength(s.maxBitrate);if(f>=g)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const E=this.backtrackFragment?this.backtrackFragment.start:l.end;let L=this.getNextFragment(E,h);if(this.couldBacktrack&&!this.fragPrevious&&L&&L.sn!=="initSegment"&&this.fragmentTracker.getState(L)!==zn.OK){var A;const B=((A=this.backtrackFragment)!=null?A:L).sn-h.startSN,X=h.fragments[B-1];X&&L.cc===X.cc&&(L=X,this.fragmentTracker.removeFragment(X))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(L&&this.isLoopLoading(L,E)){if(!L.gap){const B=this.audioOnly&&!this.altAudio?T.AUDIO:T.VIDEO,X=(B===T.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;X&&this.afterBufferFlushed(X,B,We.MAIN)}L=this.getNextFragmentLoopLoading(L,h,l,We.MAIN,g)}L&&(L.initSegment&&!L.initSegment.data&&!this.bitrateTest&&(L=L.initSegment),this.loadFragment(L,s,E))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===zn.NOT_LOADED||i===zn.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,We.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<r.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],h=this.fragLastKbps;h&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*h)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,h=l.duration,f=Math.max(s.end,c+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Ce.KEY_LOADING:case Ce.FRAG_LOADING:case Ce.FRAG_LOADING_WAITING_RETRY:case Ce.PARSING:case Ce.PARSED:this.state=Ce.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new bu(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;O(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const n=this.getMainFwdBufferInfo();if(n===null||n.len===0){this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(u.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!mu(),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!==Ce.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=Ce.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 c=i[r],h=this.fragCurrent;h&&(this.state===Ce.FRAG_LOADING||this.state===Ce.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let f=0;if(s.live||(n=c.details)!=null&&n.live){var g;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;f=this.alignPlaylists(s,c.details,(g=this.levelLastLoaded)==null?void 0:g.details)}if(c.details=s,this.levelLastLoaded=c,this.hls.trigger(u.LEVEL_UPDATED,{details:s,level:r}),this.state===Ce.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=Ce.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,f),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],c=l.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const h=l.videoCodec,f=c.PTSKnown||!c.live,g=(t=n.initSegment)==null?void 0:t.data,E=this._getAudioCodec(l),L=this.transmuxer=this.transmuxer||new ca(this.hls,We.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),A=i?i.index:-1,D=A!==-1,B=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,A,D),X=this.initPTS[n.cc];L.push(r,g,E,h,n,i,c.totalduration,f,B,X)}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 c=n[l];if(c.id==="main"){if(r=l,i=c,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!==We.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===Ce.PARSED&&(this.state=Ce.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=Ce.ERROR;return}switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(We.MAIN,t);break;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ce.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===St.LEVEL&&(this.state=Ce.IDLE);break;case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===m.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!_n.getBuffered(e).length){const n=this.state!==Ce.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Ce.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==T.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===T.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,We.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&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=_n.getBuffered(e),s=(i.length?i.start(0):0)-n;s>0&&(s<this.config.maxBufferHole||s<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${s} to match buffer start`),n+=s,this.startPosition=n),this.log(`seek to target start position ${n} from current time ${t}`),e.currentTime=n}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Ce.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:c,part:h,level:f}=l,{video:g,text:E,id3:L,initSegment:A}=r,{details:D}=f,B=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=Ce.PARSING,A){if(A!=null&&A.tracks){const oe=c.initSegment||c;this._bufferInitSegment(f,A.tracks,oe,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:oe,id:n,tracks:A.tracks})}const X=A.initPTS,le=A.timescale;O(X)&&(this.initPTS[c.cc]={baseTime:X,timescale:le},i.trigger(u.INIT_PTS_FOUND,{frag:c,id:n,initPTS:X,timescale:le}))}if(g&&D&&c.sn!=="initSegment"){const X=D.fragments[c.sn-1-D.startSN],le=c.sn===D.startSN,oe=!X||c.cc>X.cc;if(r.independent!==!1){const{startPTS:we,endPTS:de,startDTS:Pe,endDTS:Te}=g;if(h)h.elementaryStreams[g.type]={startPTS:we,endPTS:de,startDTS:Pe,endDTS:Te};else if(g.firstKeyFrame&&g.independent&&s.id===1&&!oe&&(this.couldBacktrack=!0),g.dropped&&g.independent){const Be=this.getMainFwdBufferInfo(),ze=(Be?Be.end:this.getLoadPosition())+this.config.maxBufferHole,Le=g.firstKeyFramePTS?g.firstKeyFramePTS:we;if(!le&&ze<Le-this.config.maxBufferHole&&!oe){this.backtrack(c);return}else oe&&(c.gap=!0);c.setElementaryStreamInfo(g.type,c.start,de,c.start,Te,!0)}else le&&we>es&&(c.gap=!0);c.setElementaryStreamInfo(g.type,we,de,Pe,Te),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(g,c,h,s,le||oe)}else if(le||oe)c.gap=!0;else{this.backtrack(c);return}}if(B){const{startPTS:X,endPTS:le,startDTS:oe,endDTS:we}=B;h&&(h.elementaryStreams[T.AUDIO]={startPTS:X,endPTS:le,startDTS:oe,endDTS:we}),c.setElementaryStreamInfo(T.AUDIO,X,le,oe,we),this.bufferFragmentData(B,c,h,s)}if(D&&L!=null&&(t=L.samples)!=null&&t.length){const X={id:n,frag:c,details:D,samples:L.samples};i.trigger(u.FRAG_PARSING_METADATA,X)}if(D&&E){const X={id:n,frag:c,details:D,samples:E.samples};i.trigger(u.FRAG_PARSING_USERDATA,X)}}_bufferInitSegment(e,t,n,i){if(this.state!==Ce.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 c=e.audioCodec;const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){c&&(c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5");const f=r.metadata;f&&"channelCount"in f&&(f.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(c="mp4a.40.5")}c&&c.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(c="mp4a.40.2",this.log(`Android: force audio codec to ${c}`)),e.audioCodec&&e.audioCodec!==c&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${c}"`),r.levelCodec=c,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${c||""}/${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(c=>{const f=t[c].initSegment;f!=null&&f.byteLength&&this.hls.trigger(u.BUFFER_APPENDING,{type:c,data:f,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,We.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=Ce.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(_n.isBuffered(e,n)?t=this.getAppendedFrag(n):_n.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&&O(t)&&O(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 za()}static isSupported(){return gu()}static getMediaSource(){return Rn()}static get Events(){return u}static get ErrorTypes(){return _}static get ErrorDetails(){return m}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,K(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,c=new s(this),h=this.abrController=new n(this),f=this.bufferController=new i(this),g=this.capLevelController=new r(this),E=new l(this),L=new wn(this),A=new _i(this),D=t.contentSteeringController,B=D?new D(this):null,X=this.levelController=new du(this,B),le=new dr(this),oe=new pu(this.config),we=this.streamController=new xu(this,le,oe);g.setStreamController(we),E.setStreamController(we);const de=[L,X,we];B&&de.splice(1,0,B),this.networkControllers=de;const Pe=[h,f,g,E,A,le];this.audioTrackController=this.createController(t.audioTrackController,de);const Te=t.audioStreamController;Te&&de.push(new Te(this,le,oe)),this.subtitleTrackController=this.createController(t.subtitleTrackController,de);const Be=t.subtitleStreamController;Be&&de.push(new Be(this,le,oe)),this.createController(t.timelineController,Pe),oe.emeController=this.emeController=this.createController(t.emeController,Pe),this.cmcdController=this.createController(t.cmcdController,Pe),this.latencyController=this.createController(Ri,Pe),this.coreComponents=Pe,de.push(c);const ze=c.onErrorOut;typeof ze=="function"&&this.on(u.ERROR,ze,c)}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(b.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:_.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){b.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){b.log("attachMedia"),this._media=e,this.trigger(u.MEDIA_ATTACHING,{media:e})}detachMedia(){b.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=ae.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,b.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){b.log(`startLoad(${e})`),this.started=!0,this.resumeBuffering();for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].startLoad(e),!(!this.started||!this.networkControllers));t++);}stopLoad(){b.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}resumeBuffering(){b.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()})}pauseBuffering(){b.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()})}swapAudioCodec(){b.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){b.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){b.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){b.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){b.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){b.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){b.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&&(b.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){bn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}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}}]);
|
|
}()); |