You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1035 lines
1.0 MiB
1035 lines
1.0 MiB
!(function(){var ol=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[2829],{65030:function(bn,St,k){"use strict";k.d(St,{Z:function(){return ke}});var A=k(98506),ue=k(16886),Ae=k(33346),ne=k(43403),F=k(92310),g=k.n(F),oe=k(29301),q=k(76846),l=k(96452),S=k(6089),T=k(80402),d=k(34280),m=k(49658),y=k(59301),x=k(67711),U=k(77900),N=k(8654);function V(se){var Q=se.prefixCls,$=se.align,de=se.arrow,we=se.arrowPos,Ce=de||{},P=Ce.className,te=Ce.content,ge=we.x,Ee=ge===void 0?0:ge,Te=we.y,Ue=Te===void 0?0:Te,et=y.useRef();if(!$||!$.points)return null;var Ne={position:"absolute"};if($.autoArrow!==!1){var De=$.points[0],Ke=$.points[1],_t=De[0],nt=De[1],lt=Ke[0],ye=Ke[1];_t===lt||!["t","b"].includes(_t)?Ne.top=Ue:_t==="t"?Ne.top=0:Ne.bottom=0,nt===ye||!["l","r"].includes(nt)?Ne.left=Ee:nt==="l"?Ne.left=0:Ne.right=0}return y.createElement("div",{ref:et,className:g()("".concat(Q,"-arrow"),P),style:Ne},te)}function I(se){var Q=se.prefixCls,$=se.open,de=se.zIndex,we=se.mask,Ce=se.motion;return we?y.createElement(U.default,(0,x.Z)({},Ce,{motionAppear:!0,visible:$,removeOnLeave:!0}),function(P){var te=P.className;return y.createElement("div",{style:{zIndex:de},className:g()("".concat(Q,"-mask"),te)})}):null}var L=y.memo(function(se){var Q=se.children;return Q},function(se,Q){return Q.cache}),O=L,z=y.forwardRef(function(se,Q){var $=se.popup,de=se.className,we=se.prefixCls,Ce=se.style,P=se.target,te=se.onVisibleChanged,ge=se.open,Ee=se.keepDom,Te=se.fresh,Ue=se.onClick,et=se.mask,Ne=se.arrow,De=se.arrowPos,Ke=se.align,_t=se.motion,nt=se.maskMotion,lt=se.forceRender,ye=se.getPopupContainer,wt=se.autoDestroy,Qe=se.portal,We=se.zIndex,Mt=se.onMouseEnter,$t=se.onMouseLeave,rt=se.onPointerEnter,Jt=se.onPointerDownCapture,Tn=se.ready,It=se.offsetX,en=se.offsetY,Ie=se.offsetR,ve=se.offsetB,be=se.onAlign,M=se.onPrepare,Z=se.stretch,ie=se.targetWidth,le=se.targetHeight,_e=typeof $=="function"?$():$,it=ge||Ee,bt=(ye==null?void 0:ye.length)>0,Ct=y.useState(!ye||!bt),zt=(0,ue.Z)(Ct,2),En=zt[0],Dn=zt[1];if((0,d.Z)(function(){!En&&bt&&P&&Dn(!0)},[En,bt,P]),!En)return null;var dn="auto",un={left:"-1000vw",top:"-1000vh",right:dn,bottom:dn};if(Tn||!ge){var Fn,Vn=Ke.points,Nn=Ke.dynamicInset||((Fn=Ke._experimental)===null||Fn===void 0?void 0:Fn.dynamicInset),zn=Nn&&Vn[0][1]==="r",Rt=Nn&&Vn[0][0]==="b";zn?(un.right=Ie,un.left=dn):(un.left=It,un.right=dn),Rt?(un.bottom=ve,un.top=dn):(un.top=en,un.bottom=dn)}var at={};return Z&&(Z.includes("height")&&le?at.height=le:Z.includes("minHeight")&&le&&(at.minHeight=le),Z.includes("width")&&ie?at.width=ie:Z.includes("minWidth")&&ie&&(at.minWidth=ie)),ge||(at.pointerEvents="none"),y.createElement(Qe,{open:lt||it,getContainer:ye&&function(){return ye(P)},autoDestroy:wt},y.createElement(I,{prefixCls:we,open:ge,zIndex:We,mask:et,motion:nt}),y.createElement(oe.Z,{onResize:be,disabled:!ge},function(Kt){return y.createElement(U.default,(0,x.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:lt,leavedClassName:"".concat(we,"-hidden")},_t,{onAppearPrepare:M,onEnterPrepare:M,visible:ge,onVisibleChanged:function($n){var me;_t==null||(me=_t.onVisibleChanged)===null||me===void 0||me.call(_t,$n),te($n)}}),function(xn,$n){var me=xn.className,pe=xn.style,vt=g()(we,me,de);return y.createElement("div",{ref:(0,N.sQ)(Kt,Q,$n),className:vt,style:(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({"--arrow-x":"".concat(De.x||0,"px"),"--arrow-y":"".concat(De.y||0,"px")},un),at),pe),{},{boxSizing:"border-box",zIndex:We},Ce),onMouseEnter:Mt,onMouseLeave:$t,onPointerEnter:rt,onClick:Ue,onPointerDownCapture:Jt},Ne&&y.createElement(V,{prefixCls:we,arrow:Ne,arrowPos:De,align:Ke}),y.createElement(O,{cache:!ge&&!Te},_e))})}))}),ee=z,re=y.forwardRef(function(se,Q){var $=se.children,de=se.getTriggerDOMNode,we=(0,N.Yr)($),Ce=y.useCallback(function(te){(0,N.mH)(Q,de?de(te):te)},[de]),P=(0,N.x1)(Ce,(0,N.C4)($));return we?y.cloneElement($,{ref:P}):$}),J=re,X=y.createContext(null),xe=X;function he(se){return se?Array.isArray(se)?se:[se]:[]}function Ze(se,Q,$,de){return y.useMemo(function(){var we=he($!=null?$:Q),Ce=he(de!=null?de:Q),P=new Set(we),te=new Set(Ce);return se&&(P.has("hover")&&(P.delete("hover"),P.add("click")),te.has("hover")&&(te.delete("hover"),te.add("click"))),[P,te]},[se,Q,$,de])}var K=k(29194);function R(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],$=arguments.length>2?arguments[2]:void 0;return $?se[0]===Q[0]:se[0]===Q[0]&&se[1]===Q[1]}function B(se,Q,$,de){for(var we=$.points,Ce=Object.keys(se),P=0;P<Ce.length;P+=1){var te,ge=Ce[P];if(R((te=se[ge])===null||te===void 0?void 0:te.points,we,de))return"".concat(Q,"-placement-").concat(ge)}return""}function G(se,Q,$,de){return Q||($?{motionName:"".concat(se,"-").concat($)}:de?{motionName:de}:null)}function W(se){return se.ownerDocument.defaultView}function H(se){for(var Q=[],$=se==null?void 0:se.parentElement,de=["hidden","scroll","clip","auto"];$;){var we=W($).getComputedStyle($),Ce=we.overflowX,P=we.overflowY,te=we.overflow;[Ce,P,te].some(function(ge){return de.includes(ge)})&&Q.push($),$=$.parentElement}return Q}function _(se){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(se)?Q:se}function v(se){return _(parseFloat(se),0)}function C(se,Q){var $=(0,A.Z)({},se);return(Q||[]).forEach(function(de){if(!(de instanceof HTMLBodyElement||de instanceof HTMLHtmlElement)){var we=W(de).getComputedStyle(de),Ce=we.overflow,P=we.overflowClipMargin,te=we.borderTopWidth,ge=we.borderBottomWidth,Ee=we.borderLeftWidth,Te=we.borderRightWidth,Ue=de.getBoundingClientRect(),et=de.offsetHeight,Ne=de.clientHeight,De=de.offsetWidth,Ke=de.clientWidth,_t=v(te),nt=v(ge),lt=v(Ee),ye=v(Te),wt=_(Math.round(Ue.width/De*1e3)/1e3),Qe=_(Math.round(Ue.height/et*1e3)/1e3),We=(De-Ke-lt-ye)*wt,Mt=(et-Ne-_t-nt)*Qe,$t=_t*Qe,rt=nt*Qe,Jt=lt*wt,Tn=ye*wt,It=0,en=0;if(Ce==="clip"){var Ie=v(P);It=Ie*wt,en=Ie*Qe}var ve=Ue.x+Jt-It,be=Ue.y+$t-en,M=ve+Ue.width+2*It-Jt-Tn-We,Z=be+Ue.height+2*en-$t-rt-Mt;$.left=Math.max($.left,ve),$.top=Math.max($.top,be),$.right=Math.min($.right,M),$.bottom=Math.min($.bottom,Z)}}),$}function Y(se){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$="".concat(Q),de=$.match(/^(.*)\%$/);return de?se*(parseFloat(de[1])/100):parseFloat($)}function Se(se,Q){var $=Q||[],de=(0,ue.Z)($,2),we=de[0],Ce=de[1];return[Y(se.width,we),Y(se.height,Ce)]}function Re(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[se[0],se[1]]}function Ye(se,Q){var $=Q[0],de=Q[1],we,Ce;return $==="t"?Ce=se.y:$==="b"?Ce=se.y+se.height:Ce=se.y+se.height/2,de==="l"?we=se.x:de==="r"?we=se.x+se.width:we=se.x+se.width/2,{x:we,y:Ce}}function He(se,Q){var $={t:"b",b:"t",l:"r",r:"l"};return se.map(function(de,we){return we===Q?$[de]||"c":de}).join("")}function ot(se,Q,$,de,we,Ce,P){var te=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:we[de]||{}}),ge=(0,ue.Z)(te,2),Ee=ge[0],Te=ge[1],Ue=y.useRef(0),et=y.useMemo(function(){return Q?H(Q):[]},[Q]),Ne=y.useRef({}),De=function(){Ne.current={}};se||De();var Ke=(0,S.Z)(function(){if(Q&&$&&se){let Jn=function(jn,tn){var Pn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pt,Rn=it.x+jn,Ln=it.y+tn,ni=Rn+Rt,fi=Ln+zn,Wi=Math.max(Rn,Pn.left),sn=Math.max(Ln,Pn.top),An=Math.min(ni,Pn.right),Kn=Math.min(fi,Pn.bottom);return Math.max(0,(An-Wi)*(Kn-sn))},di=function(){ti=it.y+Qt,li=ti+zn,Gn=it.x+Xt,_n=Gn+Rt};var lt,ye,wt,Qe,We=Q,Mt=We.ownerDocument,$t=W(We),rt=$t.getComputedStyle(We),Jt=rt.position,Tn=We.style.left,It=We.style.top,en=We.style.right,Ie=We.style.bottom,ve=We.style.overflow,be=(0,A.Z)((0,A.Z)({},we[de]),Ce),M=Mt.createElement("div");(lt=We.parentElement)===null||lt===void 0||lt.appendChild(M),M.style.left="".concat(We.offsetLeft,"px"),M.style.top="".concat(We.offsetTop,"px"),M.style.position=Jt,M.style.height="".concat(We.offsetHeight,"px"),M.style.width="".concat(We.offsetWidth,"px"),We.style.left="0",We.style.top="0",We.style.right="auto",We.style.bottom="auto",We.style.overflow="hidden";var Z;if(Array.isArray($))Z={x:$[0],y:$[1],width:0,height:0};else{var ie,le,_e=$.getBoundingClientRect();_e.x=(ie=_e.x)!==null&&ie!==void 0?ie:_e.left,_e.y=(le=_e.y)!==null&&le!==void 0?le:_e.top,Z={x:_e.x,y:_e.y,width:_e.width,height:_e.height}}var it=We.getBoundingClientRect(),bt=$t.getComputedStyle(We),Ct=bt.height,zt=bt.width;it.x=(ye=it.x)!==null&&ye!==void 0?ye:it.left,it.y=(wt=it.y)!==null&&wt!==void 0?wt:it.top;var En=Mt.documentElement,Dn=En.clientWidth,dn=En.clientHeight,un=En.scrollWidth,Fn=En.scrollHeight,Vn=En.scrollTop,Nn=En.scrollLeft,zn=it.height,Rt=it.width,at=Z.height,Kt=Z.width,xn={left:0,top:0,right:Dn,bottom:dn},$n={left:-Nn,top:-Vn,right:un-Nn,bottom:Fn-Vn},me=be.htmlRegion,pe="visible",vt="visibleFirst";me!=="scroll"&&me!==vt&&(me=pe);var qe=me===vt,pt=C($n,et),Dt=C(xn,et),Pt=me===pe?Dt:pt,Tt=qe?Dt:Pt;We.style.left="auto",We.style.top="auto",We.style.right="0",We.style.bottom="0";var Bt=We.getBoundingClientRect();We.style.left=Tn,We.style.top=It,We.style.right=en,We.style.bottom=Ie,We.style.overflow=ve,(Qe=We.parentElement)===null||Qe===void 0||Qe.removeChild(M);var tt=_(Math.round(Rt/parseFloat(zt)*1e3)/1e3),Ot=_(Math.round(zn/parseFloat(Ct)*1e3)/1e3);if(tt===0||Ot===0||(0,q.Sh)($)&&!(0,K.Z)($))return;var Ft=be.offset,Lt=be.targetOffset,gt=Se(it,Ft),ce=(0,ue.Z)(gt,2),Le=ce[0],Fe=ce[1],Ge=Se(Z,Lt),ct=(0,ue.Z)(Ge,2),ft=ct[0],Et=ct[1];Z.x-=ft,Z.y-=Et;var Ut=be.points||[],Gt=(0,ue.Z)(Ut,2),Yt=Gt[0],kn=Gt[1],qt=Re(kn),Zt=Re(Yt),fn=Ye(Z,qt),gn=Ye(it,Zt),mn=(0,A.Z)({},be),Xt=fn.x-gn.x+Le,Qt=fn.y-gn.y+Fe,kt=Jn(Xt,Qt),Nt=Jn(Xt,Qt,Dt),Vt=Ye(Z,["t","l"]),pn=Ye(it,["t","l"]),cn=Ye(Z,["b","r"]),Ht=Ye(it,["b","r"]),Mn=be.overflow||{},Hn=Mn.adjustX,qn=Mn.adjustY,vn=Mn.shiftX,ai=Mn.shiftY,Qn=function(tn){return typeof tn=="boolean"?tn:tn>=0},ti,li,Gn,_n;di();var xt=Qn(qn),yt=Zt[0]===qt[0];if(xt&&Zt[0]==="t"&&(li>Tt.bottom||Ne.current.bt)){var Wt=Qt;yt?Wt-=zn-at:Wt=Vt.y-Ht.y-Fe;var jt=Jn(Xt,Wt),yn=Jn(Xt,Wt,Dt);jt>kt||jt===kt&&(!qe||yn>=Nt)?(Ne.current.bt=!0,Qt=Wt,Fe=-Fe,mn.points=[He(Zt,0),He(qt,0)]):Ne.current.bt=!1}if(xt&&Zt[0]==="b"&&(ti<Tt.top||Ne.current.tb)){var Un=Qt;yt?Un+=zn-at:Un=cn.y-pn.y-Fe;var Wn=Jn(Xt,Un),Bn=Jn(Xt,Un,Dt);Wn>kt||Wn===kt&&(!qe||Bn>=Nt)?(Ne.current.tb=!0,Qt=Un,Fe=-Fe,mn.points=[He(Zt,0),He(qt,0)]):Ne.current.tb=!1}var ri=Qn(Hn),bi=Zt[1]===qt[1];if(ri&&Zt[1]==="l"&&(_n>Tt.right||Ne.current.rl)){var _i=Xt;bi?_i-=Rt-Kt:_i=Vt.x-Ht.x-Le;var ci=Jn(_i,Qt),Yn=Jn(_i,Qt,Dt);ci>kt||ci===kt&&(!qe||Yn>=Nt)?(Ne.current.rl=!0,Xt=_i,Le=-Le,mn.points=[He(Zt,1),He(qt,1)]):Ne.current.rl=!1}if(ri&&Zt[1]==="r"&&(Gn<Tt.left||Ne.current.lr)){var wi=Xt;bi?wi+=Rt-Kt:wi=cn.x-pn.x-Le;var Ti=Jn(wi,Qt),Di=Jn(wi,Qt,Dt);Ti>kt||Ti===kt&&(!qe||Di>=Nt)?(Ne.current.lr=!0,Xt=wi,Le=-Le,mn.points=[He(Zt,1),He(qt,1)]):Ne.current.lr=!1}di();var rn=vn===!0?0:vn;typeof rn=="number"&&(Gn<Dt.left&&(Xt-=Gn-Dt.left-Le,Z.x+Kt<Dt.left+rn&&(Xt+=Z.x-Dt.left+Kt-rn)),_n>Dt.right&&(Xt-=_n-Dt.right-Le,Z.x>Dt.right-rn&&(Xt+=Z.x-Dt.right+rn)));var gi=ai===!0?0:ai;typeof gi=="number"&&(ti<Dt.top&&(Qt-=ti-Dt.top-Fe,Z.y+at<Dt.top+gi&&(Qt+=Z.y-Dt.top+at-gi)),li>Dt.bottom&&(Qt-=li-Dt.bottom-Fe,Z.y>Dt.bottom-gi&&(Qt+=Z.y-Dt.bottom+gi)));var hi=it.x+Xt,Ii=hi+Rt,Fi=it.y+Qt,Ni=Fi+zn,ki=Z.x,Ri=ki+Kt,oi=Z.y,Oi=oi+at,Xi=Math.max(hi,ki),Ei=Math.min(Ii,Ri),ir=(Xi+Ei)/2,rr=ir-hi,Qi=Math.max(Fi,oi),Ui=Math.min(Ni,Oi),Vi=(Qi+Ui)/2,$i=Vi-Fi;P==null||P(Q,mn);var xi=Bt.right-it.x-(Xt+it.width),Mi=Bt.bottom-it.y-(Qt+it.height);tt===1&&(Xt=Math.round(Xt),xi=Math.round(xi)),Ot===1&&(Qt=Math.round(Qt),Mi=Math.round(Mi));var Hi={ready:!0,offsetX:Xt/tt,offsetY:Qt/Ot,offsetR:xi/tt,offsetB:Mi/Ot,arrowX:rr/tt,arrowY:$i/Ot,scaleX:tt,scaleY:Ot,align:mn};Te(Hi)}}),_t=function(){Ue.current+=1;var ye=Ue.current;Promise.resolve().then(function(){Ue.current===ye&&Ke()})},nt=function(){Te(function(ye){return(0,A.Z)((0,A.Z)({},ye),{},{ready:!1})})};return(0,d.Z)(nt,[de]),(0,d.Z)(function(){se||nt()},[se]),[Ee.ready,Ee.offsetX,Ee.offsetY,Ee.offsetR,Ee.offsetB,Ee.arrowX,Ee.arrowY,Ee.scaleX,Ee.scaleY,Ee.align,_t]}var dt=k(15142);function Me(se,Q,$,de,we){(0,d.Z)(function(){if(se&&Q&&$){let Ue=function(){de(),we()};var Ce=Q,P=$,te=H(Ce),ge=H(P),Ee=W(P),Te=new Set([Ee].concat((0,dt.Z)(te),(0,dt.Z)(ge)));return Te.forEach(function(et){et.addEventListener("scroll",Ue,{passive:!0})}),Ee.addEventListener("resize",Ue,{passive:!0}),de(),function(){Te.forEach(function(et){et.removeEventListener("scroll",Ue),Ee.removeEventListener("resize",Ue)})}}},[se,Q,$])}var ht=k(48736);function Oe(se,Q,$,de,we,Ce,P,te){var ge=y.useRef(se);ge.current=se;var Ee=y.useRef(!1);y.useEffect(function(){if(Q&&de&&(!we||Ce)){var Ue=function(){Ee.current=!1},et=function(wt){var Qe;ge.current&&!P(((Qe=wt.composedPath)===null||Qe===void 0||(Qe=Qe.call(wt))===null||Qe===void 0?void 0:Qe[0])||wt.target)&&!Ee.current&&te(!1)},Ne=W(de);Ne.addEventListener("pointerdown",Ue,!0),Ne.addEventListener("mousedown",et,!0),Ne.addEventListener("contextmenu",et,!0);var De=(0,l.A)($);if(De&&(De.addEventListener("mousedown",et,!0),De.addEventListener("contextmenu",et,!0)),0)var Ke,_t,nt,lt;return function(){Ne.removeEventListener("pointerdown",Ue,!0),Ne.removeEventListener("mousedown",et,!0),Ne.removeEventListener("contextmenu",et,!0),De&&(De.removeEventListener("mousedown",et,!0),De.removeEventListener("contextmenu",et,!0))}}},[Q,$,de,we,Ce]);function Te(){Ee.current=!0}return Te}var mt=["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 ze(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ne.Z,Q=y.forwardRef(function($,de){var we=$.prefixCls,Ce=we===void 0?"rc-trigger-popup":we,P=$.children,te=$.action,ge=te===void 0?"hover":te,Ee=$.showAction,Te=$.hideAction,Ue=$.popupVisible,et=$.defaultPopupVisible,Ne=$.onPopupVisibleChange,De=$.afterPopupVisibleChange,Ke=$.mouseEnterDelay,_t=$.mouseLeaveDelay,nt=_t===void 0?.1:_t,lt=$.focusDelay,ye=$.blurDelay,wt=$.mask,Qe=$.maskClosable,We=Qe===void 0?!0:Qe,Mt=$.getPopupContainer,$t=$.forceRender,rt=$.autoDestroy,Jt=$.destroyPopupOnHide,Tn=$.popup,It=$.popupClassName,en=$.popupStyle,Ie=$.popupPlacement,ve=$.builtinPlacements,be=ve===void 0?{}:ve,M=$.popupAlign,Z=$.zIndex,ie=$.stretch,le=$.getPopupClassNameFromAlign,_e=$.fresh,it=$.alignPoint,bt=$.onPopupClick,Ct=$.onPopupAlign,zt=$.arrow,En=$.popupMotion,Dn=$.maskMotion,dn=$.popupTransitionName,un=$.popupAnimation,Fn=$.maskTransitionName,Vn=$.maskAnimation,Nn=$.className,zn=$.getTriggerDOMNode,Rt=(0,Ae.Z)($,mt),at=rt||Jt||!1,Kt=y.useState(!1),xn=(0,ue.Z)(Kt,2),$n=xn[0],me=xn[1];(0,d.Z)(function(){me((0,m.Z)())},[]);var pe=y.useRef({}),vt=y.useContext(xe),qe=y.useMemo(function(){return{registerSubPopup:function(An,Kn){pe.current[An]=Kn,vt==null||vt.registerSubPopup(An,Kn)}}},[vt]),pt=(0,T.Z)(),Dt=y.useState(null),Pt=(0,ue.Z)(Dt,2),Tt=Pt[0],Bt=Pt[1],tt=y.useRef(null),Ot=(0,S.Z)(function(sn){tt.current=sn,(0,q.Sh)(sn)&&Tt!==sn&&Bt(sn),vt==null||vt.registerSubPopup(pt,sn)}),Ft=y.useState(null),Lt=(0,ue.Z)(Ft,2),gt=Lt[0],ce=Lt[1],Le=y.useRef(null),Fe=(0,S.Z)(function(sn){(0,q.Sh)(sn)&>!==sn&&(ce(sn),Le.current=sn)}),Ge=y.Children.only(P),ct=(Ge==null?void 0:Ge.props)||{},ft={},Et=(0,S.Z)(function(sn){var An,Kn,ui=gt;return(ui==null?void 0:ui.contains(sn))||((An=(0,l.A)(ui))===null||An===void 0?void 0:An.host)===sn||sn===ui||(Tt==null?void 0:Tt.contains(sn))||((Kn=(0,l.A)(Tt))===null||Kn===void 0?void 0:Kn.host)===sn||sn===Tt||Object.values(pe.current).some(function(pi){return(pi==null?void 0:pi.contains(sn))||sn===pi})}),Ut=G(Ce,En,un,dn),Gt=G(Ce,Dn,Vn,Fn),Yt=y.useState(et||!1),kn=(0,ue.Z)(Yt,2),qt=kn[0],Zt=kn[1],fn=Ue!=null?Ue:qt,gn=(0,S.Z)(function(sn){Ue===void 0&&Zt(sn)});(0,d.Z)(function(){Zt(Ue||!1)},[Ue]);var mn=y.useRef(fn);mn.current=fn;var Xt=y.useRef([]);Xt.current=[];var Qt=(0,S.Z)(function(sn){var An;gn(sn),((An=Xt.current[Xt.current.length-1])!==null&&An!==void 0?An:fn)!==sn&&(Xt.current.push(sn),Ne==null||Ne(sn))}),kt=y.useRef(),Nt=function(){clearTimeout(kt.current)},Vt=function(An){var Kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Nt(),Kn===0?Qt(An):kt.current=setTimeout(function(){Qt(An)},Kn*1e3)};y.useEffect(function(){return Nt},[]);var pn=y.useState(!1),cn=(0,ue.Z)(pn,2),Ht=cn[0],Mn=cn[1];(0,d.Z)(function(sn){(!sn||fn)&&Mn(!0)},[fn]);var Hn=y.useState(null),qn=(0,ue.Z)(Hn,2),vn=qn[0],ai=qn[1],Qn=y.useState(null),ti=(0,ue.Z)(Qn,2),li=ti[0],Gn=ti[1],_n=function(An){Gn([An.clientX,An.clientY])},xt=ot(fn,Tt,it&&li!==null?li:gt,Ie,be,M,Ct),yt=(0,ue.Z)(xt,11),Wt=yt[0],jt=yt[1],yn=yt[2],Un=yt[3],Wn=yt[4],Bn=yt[5],ri=yt[6],bi=yt[7],_i=yt[8],ci=yt[9],Yn=yt[10],wi=Ze($n,ge,Ee,Te),Ti=(0,ue.Z)(wi,2),Di=Ti[0],rn=Ti[1],gi=Di.has("click"),hi=rn.has("click")||rn.has("contextMenu"),Ii=(0,S.Z)(function(){Ht||Yn()}),Fi=function(){mn.current&&it&&hi&&Vt(!1)};Me(fn,gt,Tt,Ii,Fi),(0,d.Z)(function(){Ii()},[li,Ie]),(0,d.Z)(function(){fn&&!(be!=null&&be[Ie])&&Ii()},[JSON.stringify(M)]);var Ni=y.useMemo(function(){var sn=B(be,Ce,ci,it);return g()(sn,le==null?void 0:le(ci))},[ci,le,be,Ce,it]);y.useImperativeHandle(de,function(){return{nativeElement:Le.current,popupElement:tt.current,forceAlign:Ii}});var ki=y.useState(0),Ri=(0,ue.Z)(ki,2),oi=Ri[0],Oi=Ri[1],Xi=y.useState(0),Ei=(0,ue.Z)(Xi,2),ir=Ei[0],rr=Ei[1],Qi=function(){if(ie&>){var An=gt.getBoundingClientRect();Oi(An.width),rr(An.height)}},Ui=function(){Qi(),Ii()},Vi=function(An){Mn(!1),Yn(),De==null||De(An)},$i=function(){return new Promise(function(An){Qi(),ai(function(){return An})})};(0,d.Z)(function(){vn&&(Yn(),vn(),ai(null))},[vn]);function xi(sn,An,Kn,ui){ft[sn]=function(pi){var sr;ui==null||ui(pi),Vt(An,Kn);for(var zi=arguments.length,fr=new Array(zi>1?zi-1:0),Bi=1;Bi<zi;Bi++)fr[Bi-1]=arguments[Bi];(sr=ct[sn])===null||sr===void 0||sr.call.apply(sr,[ct,pi].concat(fr))}}(gi||hi)&&(ft.onClick=function(sn){var An;mn.current&&hi?Vt(!1):!mn.current&&gi&&(_n(sn),Vt(!0));for(var Kn=arguments.length,ui=new Array(Kn>1?Kn-1:0),pi=1;pi<Kn;pi++)ui[pi-1]=arguments[pi];(An=ct.onClick)===null||An===void 0||An.call.apply(An,[ct,sn].concat(ui))});var Mi=Oe(fn,hi,gt,Tt,wt,We,Et,Vt),Hi=Di.has("hover"),Jn=rn.has("hover"),di,jn;Hi&&(xi("onMouseEnter",!0,Ke,function(sn){_n(sn)}),xi("onPointerEnter",!0,Ke,function(sn){_n(sn)}),di=function(An){(fn||Ht)&&Tt!==null&&Tt!==void 0&&Tt.contains(An.target)&&Vt(!0,Ke)},it&&(ft.onMouseMove=function(sn){var An;(An=ct.onMouseMove)===null||An===void 0||An.call(ct,sn)})),Jn&&(xi("onMouseLeave",!1,nt),xi("onPointerLeave",!1,nt),jn=function(){Vt(!1,nt)}),Di.has("focus")&&xi("onFocus",!0,lt),rn.has("focus")&&xi("onBlur",!1,ye),Di.has("contextMenu")&&(ft.onContextMenu=function(sn){var An;mn.current&&rn.has("contextMenu")?Vt(!1):(_n(sn),Vt(!0)),sn.preventDefault();for(var Kn=arguments.length,ui=new Array(Kn>1?Kn-1:0),pi=1;pi<Kn;pi++)ui[pi-1]=arguments[pi];(An=ct.onContextMenu)===null||An===void 0||An.call.apply(An,[ct,sn].concat(ui))}),Nn&&(ft.className=g()(ct.className,Nn));var tn=y.useRef(!1);tn.current||(tn.current=$t||fn||Ht);var Pn=(0,A.Z)((0,A.Z)({},ct),ft),Rn={},Ln=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ln.forEach(function(sn){Rt[sn]&&(Rn[sn]=function(){for(var An,Kn=arguments.length,ui=new Array(Kn),pi=0;pi<Kn;pi++)ui[pi]=arguments[pi];(An=Pn[sn])===null||An===void 0||An.call.apply(An,[Pn].concat(ui)),Rt[sn].apply(Rt,ui)})});var ni=y.cloneElement(Ge,(0,A.Z)((0,A.Z)({},Pn),Rn)),fi={x:Bn,y:ri},Wi=zt?(0,A.Z)({},zt!==!0?zt:{}):null;return y.createElement(y.Fragment,null,y.createElement(oe.Z,{disabled:!fn,ref:Fe,onResize:Ui},y.createElement(J,{getTriggerDOMNode:zn},ni)),tn.current&&y.createElement(xe.Provider,{value:qe},y.createElement(ee,{portal:se,ref:Ot,prefixCls:Ce,popup:Tn,className:g()(It,Ni),style:en,target:gt,onMouseEnter:di,onMouseLeave:jn,onPointerEnter:di,zIndex:Z,open:fn,keepDom:Ht,fresh:_e,onClick:bt,onPointerDownCapture:Mi,mask:wt,motion:Ut,maskMotion:Gt,onVisibleChanged:Vi,onPrepare:$i,forceRender:$t,autoDestroy:at,getPopupContainer:Mt,align:ci,arrow:Wi,arrowPos:fi,ready:Wt,offsetX:jt,offsetY:yn,offsetR:Un,offsetB:Wn,onAlign:Ii,stretch:ie,targetWidth:oi/bi,targetHeight:ir/_i})))});return Q}var ke=ze(ne.Z)},57884:function(bn,St,k){"use strict";var A=k(59301),ue=k(93314),Ae=k(99571),ne=Object.defineProperty,F=Object.defineProperties,g=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,S=(y,x,U)=>x in y?ne(y,x,{enumerable:!0,configurable:!0,writable:!0,value:U}):y[x]=U,T=(y,x)=>{for(var U in x||(x={}))q.call(x,U)&&S(y,U,x[U]);if(oe)for(var U of oe(x))l.call(x,U)&&S(y,U,x[U]);return y},d=(y,x)=>F(y,g(x));const m=({img:y,buttonProps:x={},styles:U={},customText:N,ButtonText:V,ButtonClick:I,Buttonclass:L,ButtonTwo:O,imgStyles:z,loading:ee=!1,className:re=""})=>A.createElement("section",{className:`tc animated fadeIn ${re}`,style:T({color:"#999",margin:"100px auto",visibility:ee?"hidden":"visible"},U)},A.createElement("img",{src:y||ue,style:d(T({},z),{pointerEvents:"none",userSelect:"none"})}),A.createElement("p",{className:"mt20 font14"},N||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),V&&A.createElement(Ae.ZP,T({className:L,onClick:I},x),V),O&&O);St.Z=m},41550:function(bn,St,k){"use strict";k.d(St,{Z:function(){return L}});var A=k(59301),ue={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Ae=k(99571),ne=k(70557),F=k(51124),g=k(25399),oe=k(49661),q=k(72664),l=k(57884),S=k(90524),T=k(14794),d=k(59301),m=Object.defineProperty,y=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,N=(O,z,ee)=>z in O?m(O,z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):O[z]=ee,V=(O,z)=>{for(var ee in z||(z={}))x.call(z,ee)&&N(O,ee,z[ee]);if(y)for(var ee of y(z))U.call(z,ee)&&N(O,ee,z[ee]);return O},I=(O,z,ee)=>new Promise((re,J)=>{var X=Ze=>{try{he(ee.next(Ze))}catch(K){J(K)}},xe=Ze=>{try{he(ee.throw(Ze))}catch(K){J(K)}},he=Ze=>Ze.done?re(Ze.value):Promise.resolve(Ze.value).then(X,xe);he((ee=ee.apply(O,z)).next())}),L=({editOffice:O="view",data:z,issaver:ee,onSaver:re,theme:J,type:X,filename:xe,monacoEditor:he,className:Ze,style:K,close:R,onClose:B,hasMask:G,disabledDownload:W,onImgDimensions:H,showNodata:_,recordInfo:v})=>{const[C,Y]=(0,A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Se,Re]=(0,A.useState)(""),[Ye,He]=(0,A.useState)(),ot=window.ENV==="build"?"/react/build":"",dt=location.host.startsWith("localhost")?S.Z.PROXY_SERVER:S.Z.API_SERVER,ht=10*(1024*1024),Oe=(0,A.useRef)();z!=null&&z.startsWith("/api")&&X!=="txt"&&(z=S.Z.API_SERVER+z);const mt=$=>$.substring($.lastIndexOf("/")+1).split(".").pop();xe&&he&&(he.filename=xe),(0,A.useEffect)(()=>{var $,de;const we=(de=($=document.cookie)==null?void 0:$.replace(/\s/g,""))==null?void 0:de.split(";");we==null||we.map(Ce=>{let P=Ce.split("=");P[0]==="_educoder_session"&&Re(P[1])})},[]),(0,A.useEffect)(()=>{X==="office"&&(z.indexOf("bigfilescdn.")>-1||z.indexOf("bigfiles1")>-1?He({url:z,fileType:mt(z),model:z.indexOf("model=edit")?"edit":"view"}):ke())},[X,z]);function ze($){return I(this,null,function*(){$.data.type==="pdfdata"&&(re($.data.data),window.removeEventListener("message",ze,!1)),console.log("mess---:",$.data)})}const ke=()=>I(void 0,null,function*(){console.log("data:",z);let $=z;z.startsWith("http")||($=location.origin+$);let de=new URL($).pathname.split("/").pop();const we=yield(0,q.gJ)({attachment_id:de});we.url=dt+we.url,He(we)}),se=()=>{if(z.startsWith("http")||z.startsWith("blob:")){Q();return}(0,oe.Sv)(xe||"educoder",z,xe)},Q=()=>{v&&(0,T.fc)({id:v==null?void 0:v.id,watch_type:1,course_id:v==null?void 0:v.course_id}),(0,oe.Nd)(xe||"educoder",decodeURIComponent(z))};return d.createElement("div",{style:V({},K||{}),className:`${G&&ue.bgBlack} ${X?ue.wrp:"hide"}`},R&&d.createElement("div",{className:ue.close,ref:Oe},!!H&&d.createElement(g.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Oe.current},d.createElement("span",{onClick:()=>{B(),H()}},d.createElement("i",{className:"icon-yulanpizhu"}))),!W&&d.createElement(g.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Oe.current},d.createElement("span",{onClick:Q},d.createElement("i",{className:"icon-quxiaozhiding"}))),ee&&d.createElement(g.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Oe.current},d.createElement("span",{className:"",onClick:()=>{const $=document.getElementById("pdfiframe");window.addEventListener("message",ze,!1),setTimeout(()=>{$.contentWindow.postMessage("getData","*")},300)}},d.createElement("i",{className:"icon-baocun"}))),d.createElement(g.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Oe.current},d.createElement("span",{className:"",onClick:()=>{B()}},d.createElement("i",{className:"icon-guanbi1"})))),d.createElement("div",{className:`${ue[Ze]} ${Ze} ${ue.monaco} ${X==="txt"?"show":"hide"}`},X==="txt"&&d.createElement(d.Fragment,null,d.createElement(F.ZP,V({},he)))),X==="audio"&&d.createElement("audio",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${z}`,autoPlay:!0}),X==="video"&&d.createElement(d.Fragment,null,(z==null?void 0:z.indexOf("http"))>-1?d.createElement("video",{controls:!0,src:`${z}`,autoPlay:!0}):d.createElement("video",{controls:!0,src:`data:video/mp4;base64,${z}`,autoPlay:!0})),X==="office"&&Ye&&d.createElement("iframe",{src:`${ot}/office.html?key=${Ye.key}&url=${btoa(Ye.url)}&callbackUrl=${dt+(Ye.callbackUrl||"")}&fileType=${Ye.fileType}&title=${Ye.title||""}&model=${O}&officeServer=${S.Z.ONLYOFFICE}&disabledDownload=${!!W}`}),X==="html"&&d.createElement("iframe",{src:z+"&disposition=inline"}),X==="pdf"&&d.createElement("iframe",{id:"pdfiframe",src:`${ot}/js/pdfview/index.html?filename=${xe||"educoder.pdf"}&url=${encodeURIComponent(z)}&disabledDownload=${!!W}&model=${O}`}),X==="image"&&d.createElement("img",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:image/png;base64,"}${z}`}),(X==="other"||X==="download")&&d.createElement(d.Fragment,null,_?d.createElement(l.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:d.createElement(Ae.ZP,{icon:d.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:se,disabled:W},"\u4E0B\u8F7D")}):d.createElement(Ae.ZP,{type:"primary",size:"middle",onClick:se,disabled:W},d.createElement(ne.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),X==="flowChart"&&d.createElement("div",{className:"embed"},d.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${z||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},38394:function(bn,St,k){"use strict";k.d(St,{z:function(){return he},Z:function(){return Ze}});var A=k(59301),ue=k(88831),Ae=k(90290),ne=k(64018),F=k(39394),g=k(90524),oe=k(49661),q=k(15342),l=k(77736),S=k(99571),T=k(1012),d=k(41550),m=k(59301),x=({html:K})=>{const R=(0,A.useRef)(null),B=(0,A.useRef)(null),G=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 56px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,A.useEffect)(()=>{const W=R.current.attachShadow({mode:"open"});B.current=document.createElement("div"),B.current.className="markdown-body",B.current.innerHTML=K,W.appendChild(B.current);const H=document.createElement("style");return H.textContent=G,W.appendChild(H),()=>{W.innerHTML=""}},[]),(0,A.useEffect)(()=>{B.current&&(B.current.innerHTML=K)},[K]),m.createElement("div",{ref:R})};function U(K){const R=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],B=new RegExp(`\\b(${R.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return K.replace(B,"").trim()}var N={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},V=Object.defineProperty,I=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,z=(K,R,B)=>R in K?V(K,R,{enumerable:!0,configurable:!0,writable:!0,value:B}):K[R]=B,ee=(K,R)=>{for(var B in R||(R={}))L.call(R,B)&&z(K,B,R[B]);if(I)for(var B of I(R))O.call(R,B)&&z(K,B,R[B]);return K};const re="@\u2581\u2581@",J="@\u2581@",X=/<pre[^>]*>/g;function xe(K){let R=document.createElement("div");return R.innerHTML=K,R.childNodes.length===0?"":R.childNodes[0].nodeValue}const he=(K,R)=>{K=K||"";const B=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,G=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,W=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,H=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return R?K.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(B,(_,v,C,Y,Se,Re,Ye)=>{const He=v||Y||Re,ot=C||Se||Ye||"?";return g.Z.API_SERVER+"/api/attachments/"+He+ot+"&t="+(0,oe.Jn)(He,Date.now())+(_.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(K=K.replace(H,(_,v,C,Y,Se,Re,Ye)=>{const He=v||Y||Re,ot=C||Se||Ye||"?";return g.Z.API_SERVER+"/attachments/download/"+He+ot+"&t="+(0,oe.Jn)(He,Date.now())+(_.indexOf(")")>-1?")":"&")}).replace(B,(_,v,C,Y,Se,Re,Ye)=>{const He=v||Y||Re,ot=C||Se||Ye||"?";return g.Z.API_SERVER+"/api/attachments/"+He+ot+"&t="+(0,oe.Jn)(He,Date.now())+(_.indexOf(")")>-1?")":"&")}).replace(G,(_,v,C,Y,Se)=>{const Re=v||Y,Ye=C||Se||"";return'"'+g.Z.API_SERVER+"/api/attachments/"+Re+Ye+Re+Ye+"&t="+(0,oe.Jn)(Re,Date.now())}).replace(W,(_,v,C,Y,Se)=>{const Re=v||Y,Ye=C||Se||"";return"("+g.Z.API_SERVER+"/files/uploads/"+Re+Ye+Re+Ye+"&t="+(0,oe.Jn)(Re,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),K)};var Ze=({value:K="",edit:R=!1,className:B,showTextOnly:G,showLines:W,style:H={},stylesPrev:_={},highlightKeywords:v,showProgramFill:C,isProgramFill:Y,disabledFill:Se=!1,programFillValue:Re,openEditor:Ye=()=>{},onFillChange:He=Me=>{},onFillBlur:ot=()=>{},onFillFocus:dt=()=>{}})=>{let Me=U(String(K||""));const ht=(0,A.useRef)(),Oe=(0,A.useRef)(),[mt,ze]=(0,A.useState)(""),[ke,se]=(0,A.useState)("office"),[Q,$]=(0,A.useState)([]),de=(0,A.useRef)("a"+(0,T.Z)()),we={},Ce=ye=>/<style[\s\S]*?>/i.test(ye||""),P=(ye,wt,Qe)=>{const We=document.createElement(ye===J?"input":"textarea");We.style.width="100%",We.style.height=ye===J?"40px":"151px",We.rows=5,We.spellcheck=!1,We.name="edu-program-fill",We.placeholder="\u8BF7\u8F93\u5165",We.dataset.id=wt;const Mt=Object.keys(we).length;return we[Mt]=We,`<span class="edu-program-fill-wrap ${ye===J?"":"show"}" style="width:${ye===J?"600px":"100%"}" title=${Qe||""}><span>${We.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function te(ye){return ye=ye.replace(/!\[.*?\]\(.*?\)/g,""),ye=ye.replace(/\[.*?\]\(.*?\)/g,""),ye=ye.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),ye=ye.replace(/<embed.*?>/g,""),ye=ye.replace(/<img.*?>/g,""),ye=ye.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),ye=ye.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),ye=ye.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),ye=ye.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),ye}const ge=ye=>!G&&Ce(Me)?ye:ye.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(wt,Qe){let We=Qe.replace(/(\n|\r)/g,"").split("}"),Mt=[];return We.map($t=>{$t!=""&&Mt.push(`.${de.current} ${$t}`)}),`<style>${Mt.join("}")}</style>`}),Ee=(0,A.useMemo)(()=>{try{const We=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Mt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$t=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,rt=/\(\/attachments\/download\//g;Me=Me.replace(rt,"("+g.Z.API_SERVER+"/attachments/download/").replace(We,"("+g.Z.API_SERVER+"/api/attachments/").replace(Mt,'"'+g.Z.API_SERVER+"/api/attachments/").replace($t,'"'+g.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),ht.current.style.display="none"}catch(We){}if(C){let We=-1;return Me=Me.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Mt,$t,rt){var Jt;return++We,P(Mt,We,(Jt=Re==null?void 0:Re[We])==null?void 0:Jt.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${ge(Me||"")}</pre>`}let ye=ge(Me);ye=(0,Ae.ZP)(ye);const wt=(0,Ae.ez)();Me.match(/\[TOC\]/)&&(ye=ye.replace("<p>[TOC]</p>",(0,Ae.Qv)()),(0,Ae.Iy)()),ye=ye.replace(/(__special_katext_id_\d+__)/g,(We,Mt)=>{const{type:$t,expression:rt}=wt[Mt];return(0,q.renderToString)(xe(rt)||"",{displayMode:$t==="block",throwOnError:!1,output:"html"})}),ye=ye.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Ae.AL)();const Qe=document.createElement("div");if(Qe.innerHTML=ye,G)return Qe.innerText;if(v){const We=v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ne(Qe,We),Qe.innerHTML}return setTimeout(()=>_t(),500),Qe.innerHTML},[Me,v]);(0,A.useEffect)(()=>{De.current&&De.current.querySelectorAll(["input","textarea"]).forEach(wt=>{wt.oninput=Te,wt.onblur=Ue,wt.onfocus=et})},[Q]),(0,A.useEffect)(()=>{var ye,wt,Qe,We,Mt;if(Re!=null&&Re.length)try{const $t=De.current.querySelectorAll(".edu-program-fill-score"),rt=De.current.querySelectorAll('[name="edu-program-fill"]');for(const[Jt,Tn]of rt.entries())Tn.value=((ye=Re==null?void 0:Re[Jt])==null?void 0:ye.value)||"",((wt=Re==null?void 0:Re[Jt])==null?void 0:wt.type)==="warning"?Tn.className="program-fill-warning":((Qe=Re==null?void 0:Re[Jt])==null?void 0:Qe.type)==="success"?Tn.className="program-fill-success":Tn.className="";for(const[Jt,Tn]of $t.entries())Tn.innerHTML=(We=Re==null?void 0:Re[Jt])!=null&&We.score?`${(Mt=Re==null?void 0:Re[Jt])==null?void 0:Mt.score}\u5206`:"";$(Re)}catch($t){console.log($t,"error")}},[Re]);const Te=ye=>{Q[ye.target.dataset.id]=Q[ye.target.dataset.id]||{},Q[ye.target.dataset.id].value=ye.target.value,$([...Q]),He(Q,ye.target.dataset.id)},Ue=ye=>{Q[ye.target.dataset.id]=Q[ye.target.dataset.id]||{},Q[ye.target.dataset.id].value=ye.target.value,$([...Q]),ot(Q,ye.target.dataset.id)},et=ye=>{Q[ye.target.dataset.id]=Q[ye.target.dataset.id]||{},Q[ye.target.dataset.id].value=ye.target.value,$([...Q]),dt(Q,ye.target.dataset.id)};function Ne(ye,wt){return ye.childNodes.forEach(Qe=>{var We;if(Qe.childNodes.length>0)Ne(Qe,wt);else if(Qe.nodeName!=="IMG")if(Qe.innerHTML)Qe.innerHTML=(We=Qe.innerHTML)==null?void 0:We.replace(new RegExp(wt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Mt=document.createElement("span");Mt.innerHTML=Qe.textContent.replace(new RegExp(wt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Qe.replaceWith(Mt)}})}const De=(0,A.useRef)();Ae.jb.WebkitLineClamp=W,W&&(H=ee(ee({},H),Ae.jb));function Ke(ye){let wt=ye.target;if(wt.tagName.toUpperCase()==="A"){let Qe=wt.getAttribute("href");if(Qe.indexOf("office")>-1)ye.preventDefault(),ze(Qe),se("office");else if(Qe.indexOf("application/pdf")>-1)ye.preventDefault(),ze(Qe),se("pdf");else if(Qe.indexOf("text/html")>-1)ye.preventDefault(),ze(Qe),se("html");else if(Qe.startsWith("#")){ye.preventDefault();let We=document.getElementById(Qe.replace("#",""));We&&We.scrollIntoView(!0)}}}const _t=()=>{var ye;const wt=(ye=De.current)==null?void 0:ye.querySelectorAll("video");wt==null||wt.forEach(Qe=>{if(Qe.oncontextmenu=()=>!1,Qe.src.indexOf(".m3u8")>-1&&!Qe.canPlayType("application/vnd.apple.mpegurl")){if(F.ZP.isSupported()){var We=new F.ZP;We.loadSource(Qe.src),We.attachMedia(Qe)}}})};(0,A.useEffect)(()=>{if(De.current&&Ee&&Ee.match(X)&&window.PR.prettyPrint(),De.current)return De.current.addEventListener("click",Ke),()=>{var ye;(ye=De.current)==null||ye.removeEventListener("click",Ke),(0,Ae.AL)(),(0,Ae.Iy)()}},[Ee,De.current,Ke]);const nt=ye=>{ye.target.nodeName==="IMG"&&ye.target.className.indexOf("draw-flowchart")>-1?(ht.current.style.zIndex=1,ht.current.style.display="flex",ht.current.style.width=ye.target.clientWidth+"px",ht.current.style.height=ye.target.clientHeight+"px",ht.current.style.top=ye.target.offsetTop+"px",ht.current.style.left=ye.target.offsetLeft+"px",ye.target.id&&(Oe.current=ye.target.id)):ht.current.style.display="none"},lt=()=>{ht.current.style.display="none"};return(0,A.useEffect)(()=>{var ye;const wt=Qe=>{Qe.preventDefault(),Qe.clipboardData.setData("text",window.getSelection().toString())};return(ye=De.current)==null||ye.addEventListener("copy",wt),()=>{var Qe;(Qe=De.current)==null||Qe.removeEventListener("copy",wt)}},[De.current]),A.createElement("div",{style:{position:"relative"},onMouseLeave:lt},G&&A.createElement("div",{ref:De,className:`${N.mdBody} `},Ee),!G&&!Ce(Ee)&&A.createElement("div",{ref:De,style:ee({},H),onMouseOver:nt,className:`${B||""} ${Se?"disabled-fill":""} markdown-body ${N.mdBody} ${de.current}`,dangerouslySetInnerHTML:{__html:Ee}}),!G&&Ce(Ee)&&A.createElement(x,{html:Ee}),A.createElement("div",{ref:ht,className:`${N.button} ${R?"":N.previewFlowChart}`},A.createElement(l.Z,null,A.createElement(S.ZP,{onClick:()=>{R?Ye(Oe.current):(ze(Oe.current),se("flowChart"))}},R?"\u7F16\u8F91":"\u9884\u89C8"))),A.createElement(d.Z,{close:!0,data:mt,type:mt!=null&&mt.length?ke:"",style:ee({},_),onClose:()=>ze("")}))}},51124:function(bn,St,k){"use strict";k.d(St,{SV:function(){return ht},ZP:function(){return Me}});var A=k(59301),ue=k(76374);const Ae={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},ne={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},F={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},g={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},oe={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var q=k(53184),l=k.n(q),S=(Oe,mt,ze)=>new Promise((ke,se)=>{var Q=we=>{try{de(ze.next(we))}catch(Ce){se(Ce)}},$=we=>{try{de(ze.throw(we))}catch(Ce){se(Ce)}},de=we=>we.done?ke(we.value):Promise.resolve(we.value).then(Q,$);de((ze=ze.apply(Oe,mt)).next())});const T={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},d=(Oe,mt,ze,ke)=>{const se=mt.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:ze.lineNumber,endColumn:ze.column});return Array.from(new Set(se.match(/\b\w{2,}\b/g)||[])).map($=>({label:$,kind:Oe.languages.CompletionItemKind.Text,insertText:$,range:ke}))},m=(Oe,mt,ze,ke)=>{Oe.languages.registerCompletionItemProvider(mt,{provideCompletionItems(se,Q){const $=se.getWordUntilPosition(Q),de={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:$.startColumn,endColumn:$.endColumn},we=se.getLineContent(Q.lineNumber).substring($.startColumn-2,$.endColumn);return{suggestions:[...d(Oe,se,Q,de),...ze.map(P=>({label:P,kind:Oe.languages.CompletionItemKind.Keyword,documentation:P,insertText:P,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de})),...ke.map(P=>({label:P.label,kind:Oe.languages.CompletionItemKind.Snippet,documentation:P.content,insertText:we.startsWith("#")?P.content.replace(/#/,""):P.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}))]}}})};var y=Oe=>{T.languages.forEach(mt=>{Oe.languages.registerDocumentFormattingEditProvider(mt,{provideDocumentFormattingEdits(ze){return S(this,null,function*(){const ke=l()(ze.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:ze.getFullModelRange(),text:ke}]})}})}),m(Oe,"java",ne.keywords,ne.quickKey),m(Oe,"cpp",F.keywords,F.quickKey),m(Oe,"c",Ae.keywords,[]),m(Oe,"python",g.keywords,g.quickKey),m(Oe,"scala",oe.keywords,oe.quickKey)};const x="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var U=Object.defineProperty,N=(Oe,mt,ze)=>mt in Oe?U(Oe,mt,{enumerable:!0,configurable:!0,writable:!0,value:ze}):Oe[mt]=ze,V=(Oe,mt,ze)=>N(Oe,typeof mt!="symbol"?mt+"":mt,ze);const I=class ll{constructor(mt,ze,ke){this.placeholder=mt,this.editor=ze,this.monaco=ke,ze.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return ll.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};V(I,"ID","editor.widget.placeholderHint");var O=I,z=k(96236),ee=k(6767),re=k(25399),J=k(89392),X=k(33796),xe=k(56102),he=Object.defineProperty,Ze=Object.defineProperties,K=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,W=(Oe,mt,ze)=>mt in Oe?he(Oe,mt,{enumerable:!0,configurable:!0,writable:!0,value:ze}):Oe[mt]=ze,H=(Oe,mt)=>{for(var ze in mt||(mt={}))B.call(mt,ze)&&W(Oe,ze,mt[ze]);if(R)for(var ze of R(mt))G.call(mt,ze)&&W(Oe,ze,mt[ze]);return Oe},_=(Oe,mt)=>Ze(Oe,K(mt)),v=(Oe,mt)=>{var ze={};for(var ke in Oe)B.call(Oe,ke)&&mt.indexOf(ke)<0&&(ze[ke]=Oe[ke]);if(Oe!=null&&R)for(var ke of R(Oe))mt.indexOf(ke)<0&&G.call(Oe,ke)&&(ze[ke]=Oe[ke]);return ze},C=(Oe,mt,ze)=>new Promise((ke,se)=>{var Q=we=>{try{de(ze.next(we))}catch(Ce){se(Ce)}},$=we=>{try{de(ze.throw(we))}catch(Ce){se(Ce)}},de=we=>we.done?ke(we.value):Promise.resolve(we.value).then(Q,$);de((ze=ze.apply(Oe,mt)).next())});function Y(Oe){return/^\d+$/.test(Oe)?`${Oe}px`:Oe}function Se(){}let Re=!1;const Ye={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function He(Oe=[]){let mt=Oe;if(Array.isArray(Oe)){for(let ze=0;ze<Oe.length;ze++){let ke=Ye[Oe[ze]];if(ke)return ke}return mt[0]}return Ye[mt]||mt}let ot=null;const dt=()=>C(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Oe){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Oe)}});var Me=Oe=>{var mt=Oe,{width:ze="100%",height:ke="100%",value:se,language:Q="javascript",style:$={},options:de={},overrideServices:we={},theme:Ce="vs-dark",onEditBlur:P,isCopy:te=!1,onSave:ge,autoHeight:Ee=!1,forbidCopy:Te=!1,onChange:Ue=Se,editorDidMount:et=Se,onFocus:Ne=Se,onBreakPoint:De=Se,breakPointValue:Ke=[],filename:_t="educoder.txt",errorLine:nt,errorContent:lt="",highlightLine:ye,openBreakPoint:wt=!1,placeholder:Qe="",showMiniMap:We=!0}=mt,Mt=v(mt,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const $t=(0,A.useRef)(),rt=(0,A.useRef)({}),Jt=(0,A.useRef)(),Tn=(0,A.useRef)(),It=(0,A.useRef)([]),en=(0,A.useRef)(!1),Ie=(0,A.useRef)(),ve=(0,A.useRef)(),be=(0,A.useRef)(!1),[M,Z]=(0,A.useState)(!1);function ie(){let Rt;return $t.current&&(Rt=new ue.Z(at=>{for(let Kt of at)(Kt.target.offsetHeight>0||Kt.target.offsetWidth>0)&&rt.current.instance.layout()}),Rt.observe($t.current)),Rt}function le(){ee.ZP.warning({content:decodeURIComponent(x),key:"monaco-editor-tip"})}const _e=()=>{let Rt=rt.current.instance;if(se!=null&&Rt&&M){const at=Rt.getModel();at&&se!==at.getValue()&&(Re=!0,at.setValue(se),Rt.layout(),Re=!1)}};(0,A.useEffect)(()=>{const Rt=X.Z.subscribe("formatDocument",at=>{var Kt;let xn=rt.current.instance;(Kt=xn==null?void 0:xn.getAction)==null||Kt.call(xn,"editor.action.formatDocument").run()});return window.updateMonacoValue=at=>{Ue(at)},Rt},[]),(0,A.useEffect)(()=>{var Rt;let at=rt.current.instance;Tn.current&&clearTimeout(Tn.current),Tn.current=setTimeout(()=>{_e()},500),se&&(se!=null&&se.length)&&((Rt=at==null?void 0:at.updateOptions)==null||Rt.call(at,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(se.split(/\r\n|\r|\n/g).length))+3,5)}))},[se,M,rt.current]),(0,A.useEffect)(()=>{if(nt&&rt.current&&rt.current.instance){let at=rt.current.instance;at.changeViewZones(function(Kt){var xn=document.createElement("div");xn.style.padding="10px 20px",xn.style.width="calc(100% - 20px)",xn.className="my-error-line-wrp",xn.innerHTML=lt,Kt.addZone({afterLineNumber:nt||11,heightInLines:3,domNode:xn})});var Rt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};at.addOverlayWidget(Rt),at.revealPositionInCenter({lineNumber:20,column:1})}},[nt,rt.current,M]);const it=(Rt="",at)=>{if(!Rt||Rt.trim()==="")return!0;const xn=rt.current.instance.getModel().getLineTokens(at);let $n=!1;for(let me=0;me<2;me++)xn.getStandardTokenType(me)===1&&($n=!0);return $n};(0,A.useEffect)(()=>{var Rt;const at=(Rt=rt.current)==null?void 0:Rt.instance;if(at&&M&&Te){const Kt=at.onDidBlurEditorWidget(()=>{be.current=!1}),xn=at.onDidFocusEditorText(()=>{be.current=!0});return()=>{Kt.dispose(),xn.dispose()}}},[rt.current,M,Te]),(0,A.useEffect)(()=>{var Rt;if((Rt=rt.current)!=null&&Rt.instance&&M&&wt){let at=rt.current.instance,Kt=at.getModel();if(!Kt)return;(()=>{var tt;let Ot=[],Ft=[];const Lt=Kt.getAllDecorations();for(let ce of Lt)ce.options.className==="highlighted-line"&&(Ot.push((tt=ce==null?void 0:ce.range)==null?void 0:tt.startLineNumber),Ft.push(ce==null?void 0:ce.id));if(ye===Ot[0])return;Kt.deltaDecorations(Ft,[]);const gt=Kt.getLineCount();ye&&ye<=gt&&(at.deltaDecorations([],[{range:new ot.Range(ye,1,ye,Kt.getLineMaxColumn(ye)),options:{isWholeLine:!0,className:"highlighted-line"}}]),at.revealLineInCenter(ye))})();const $n=(tt=!1)=>{var Ot;let Ft=[],Lt=[];const gt=Kt.getAllDecorations();for(let ce of gt)ce.options.linesDecorationsClassName==="breakpoints-select"&&(Ft.push((Ot=ce==null?void 0:ce.range)==null?void 0:Ot.startLineNumber),Lt.push(ce==null?void 0:ce.id));if(tt)return{lines:Ft,ids:Lt};De(Ft)},me=tt=>C(void 0,null,function*(){let Ot={range:new ot.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Kt.deltaDecorations([],[Ot]),$n()}),pe=tt=>C(void 0,null,function*(){let Ot=[];const Ft=at.getLineDecorations(tt);for(let Lt of Ft)Lt.options.linesDecorationsClassName==="breakpoints-select"&&Ot.push(Lt.id);yield Kt.deltaDecorations(Ot,[]),$n()}),vt=tt=>{let Ot=at.getLineDecorations(tt);for(let Ft of Ot)if(Ft.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,J.isEqual)(Ke,$n(!0).lines)){Kt.deltaDecorations($n(!0).ids,[]);const tt=Ke.map(Ot=>({range:new ot.Range(Ot,1,Ot,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Kt.deltaDecorations([],tt)}const qe=at.onDidChangeModelContent(tt=>{let Ot=at.getPosition();if(Ot){let Ft=Ot.lineNumber;clearTimeout(ve.current),ve.current=setTimeout(()=>{it(Kt.getLineContent(Ft),Ft)?pe(Ft):vt(Ft)?(pe(Ft),me(Ft)):$n()},100)}}),pt=at.onMouseDown(tt=>{var Ot,Ft,Lt;if(tt.target.detail&&((Lt=(Ft=(Ot=tt.target)==null?void 0:Ot.element)==null?void 0:Ft.className)!=null&&Lt.includes("line-numbers"))){let gt=tt.target.position.lineNumber;if(it(Kt.getLineContent(gt),gt))return;vt(gt)?pe(gt):me(gt)}}),Dt=tt=>{let Ot={range:new ot.Range(tt,1,tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};It.current=at.deltaDecorations(It.current,[Ot])},Pt=()=>{It.current=at.deltaDecorations(It.current,[])},Tt=at.onMouseMove(tt=>{var Ot,Ft,Lt;if(Pt(),tt.target.detail&&((Lt=(Ft=(Ot=tt.target)==null?void 0:Ot.element)==null?void 0:Ft.className)!=null&&Lt.includes("line-numbers"))){let gt=tt.target.position.lineNumber;if(it(Kt.getLineContent(gt),gt))return;Dt(gt)}}),Bt=at.onMouseLeave(()=>{Pt()});return()=>{qe.dispose(),pt.dispose(),Tt.dispose(),Bt.dispose()}}},[rt.current,M,Ke,ye,wt,Q]),(0,A.useEffect)(()=>{var Rt;(Rt=rt.current)!=null&&Rt.instance&&wt&&rt.current.instance.setPosition({lineNumber:0,column:0})},[ye]);function bt(){let Rt=rt.current.instance;if(Rt){const at=Rt.getSelection(),Kt=rt.current.pastePos||{},xn=new ot.Range(Kt.startLineNumber||at.endLineNumber,Kt.startColumn||at.endColumn,Kt.endLineNumber||at.endLineNumber,Kt.endColumn||at.endColumn);setTimeout(()=>{Rt.executeEdits("",[{range:xn,text:""}])},300)}}function Ct(Rt){(window.navigator.platform.match("Mac")?Rt.metaKey:Rt.ctrlKey)&&Rt.keyCode==83&&(Rt.preventDefault(),ge())}const zt=()=>{if(Ee&&rt.current.instance){const Rt=rt.current.instance.getContentHeight();Nn(Rt<ke?ke:Rt)}else Nn(ke)};function En(Rt){var at=document.createEvent("MouseEvents");at.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Rt.dispatchEvent(at)}const Dn=Rt=>{if(!be.current)return;const{keyCode:at,ctrlKey:Kt,metaKey:xn,target:$n,type:me}=Rt;return(me==="paste"||(at===67||at===86)&&(xn||Kt))&&$n.nodeName==="TEXTAREA"&&(le(),Rt.preventDefault()),!1};function dn(Rt,at){var Kt=window.URL||window.webkitURL||window,xn=new Blob([at]),$n=document.createElementNS("http://www.w3.org/1999/xhtml","a");$n.href=Kt.createObjectURL(xn),$n.download=Rt,En($n)}(0,A.useEffect)(()=>{zt()},[zt]),(0,A.useEffect)(()=>{$t.current&&!M&&Promise.all([k.e(8909),k.e(5028)]).then(k.bind(k,71448)).then(Rt=>{try{ot=Rt,rt.current.instance=ot.editor.create($t.current,{value:se,language:He(Q),theme:Ce,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:We||!1}},we);const at=rt.current.instance;let $n=[...z.BH._menuItems].find(qe=>qe[0]._debugName=="EditorContext")[1],me=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],pe=(qe,pt)=>{var Dt,Pt;let Tt=qe._first;do pt.includes((Pt=(Dt=Tt.element)==null?void 0:Dt.command)==null?void 0:Pt.id)&&qe._remove(Tt);while(Tt=Tt.next)};if(et(at,ot),setTimeout(()=>{zt(),rt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{dn(_t||"educoder.txt",at.getValue())}})},500),rt.current.subscription=at.onDidChangeModelContent(qe=>{en.current?clearTimeout(Ie.current):(zt(),Ue(at.getValue(),qe)),Ie.current=setTimeout(()=>{en.current=!1},500)}),window.Monaco||y(ot,He(Q)),Te&&(pe($n,me),$t.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Dn),window.removeEventListener("paste",Dn),window.addEventListener("keydown",Dn),window.addEventListener("paste",Dn)),window.Monaco=ot,P&&at.onDidBlurEditorWidget(()=>{P(at.getValue())}),Ne&&at.onDidFocusEditorText(()=>{Te&&dt(),Ne(at.getValue())}),Te){dt();try{at.onDidPaste(qe=>{const pt=at.getSelection(),Dt=rt.current.pastePos||{},Pt=new ot.Range(Dt.startLineNumber||pt.endLineNumber,Dt.startColumn||pt.endColumn,Dt.endLineNumber||pt.endLineNumber,Dt.endColumn||pt.endColumn);at.executeEdits("",[{range:qe.range,text:""}])})}catch(qe){}}let vt=ie();return Qe&&typeof Qe=="string"&&new O(Qe,at,ot),Z(!0),()=>{const qe=rt.current.instance;qe.dispose();const pt=qe.getModel();pt&&pt.dispose(),rt.current.subscription&&rt.current.subscription.dispose(),vt.unobserve($t.current)}}catch(at){}})},[]),(0,A.useEffect)(()=>{if(rt.current.instance&&M)return document.addEventListener("keydown",Ct,!1),()=>{document.removeEventListener("keydown",Ct)}},[ge,M]),(0,A.useEffect)(()=>{let Rt=rt.current.instance;if(Rt&&M){let at=He(Q);ot.editor.setModelLanguage(Rt.getModel(),at)}},[Q,M]),(0,A.useEffect)(()=>{rt.current.instance&&M&&ot.editor.setTheme(Ce)},[Ce,M]),(0,A.useEffect)(()=>{let Rt=rt.current.instance;Jt.current=de,Rt&&M&&(Rt.updateOptions(H({},de)),setTimeout(()=>{Rt.getModel().updateOptions(H({},de))},200))},[JSON.stringify(de),M]),(0,A.useEffect)(()=>{let Rt=rt.current.instance;Rt&&M&&Rt.layout()},[ze,ke,M]);const[un,Fn]=(0,A.useState)(Y(ze)),[Vn,Nn]=(0,A.useState)(Y(ke)),zn=_(H({},$),{width:un,height:Vn,position:"relative"});return A.createElement("div",{className:"my-monaco-editor",ref:$t,style:zn},te&&A.createElement(xe.CopyToClipboard,{text:se,onCopy:()=>ee.ZP.success("\u590D\u5236\u6210\u529F")},A.createElement(re.Z,{title:"\u590D\u5236\u4EE3\u7801"},A.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},A.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ht({width:Oe="100%",height:mt="100%",original:ze,modified:ke,language:se,options:Q={}}){const $=(0,A.useRef)(),[de,we]=(0,A.useState)(null);function Ce(Ee){let Te;return $.current&&(Te=new ue.Z(Ue=>{for(let et of Ue)(et.target.offsetHeight>0||et.target.offsetWidth>0)&&Ee.layout()}),Te.observe($.current)),Te}(0,A.useEffect)(()=>($.current&&Promise.all([k.e(8909),k.e(9404)]).then(k.bind(k,2550)).then(Ee=>{ot=Ee;const Te=ot.editor.createDiffEditor($.current,_(H({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Q),{wordWrap:!0}));we(Te);let Ue=Ce(Te);return()=>{Te.dispose();const et=Te.getModel();et&&et.dispose(),Ue.unobserve($.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,A.useEffect)(()=>{de&&de.setModel({original:ot.editor.createModel(ze,se),modified:ot.editor.createModel(ke,se)})},[ze,ke,se,de]);const P=Y(Oe),te=Y(mt),ge={width:P,height:te};return A.createElement("div",{className:"my-diff-editor",ref:$,style:ge})}},30750:function(bn,St,k){"use strict";k.r(St),k.d(St,{default:function(){return dt}});var A=k(59301),ue=k(76560),Ae=k(61186),ne=k.n(Ae),F=k(93041),g=k(24404),oe=k(77019),q=k(5269),l=k(37285),S=k(458),T=k(13747),d=k(90524),m=k(57884),y=k(28284),x=k(62957),U=k(6767),N=k(37568),V=k(93440),I={flex_box_center:"flex_box_center___N_gPw",flex_space_between:"flex_space_between___f_LaO",flex_box_vertical_center:"flex_box_vertical_center___silBX",flex_box_center_end:"flex_box_center_end___Nt5TD",flex_box_column:"flex_box_column___xc67X",tabs:"tabs___JYWDM",active:"active___siUX9",list:"list___IZLen",tags:"tags___V_Bdb",searchWrp:"searchWrp___MhTxO",newlight:"newlight___pybQh"},L=Object.defineProperty,O=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,re=(Me,ht,Oe)=>ht in Me?L(Me,ht,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):Me[ht]=Oe,J=(Me,ht)=>{for(var Oe in ht||(ht={}))z.call(ht,Oe)&&re(Me,Oe,ht[Oe]);if(O)for(var Oe of O(ht))ee.call(ht,Oe)&&re(Me,Oe,ht[Oe]);return Me},X=(Me,ht,Oe)=>new Promise((mt,ze)=>{var ke=$=>{try{Q(Oe.next($))}catch(de){ze(de)}},se=$=>{try{Q(Oe.throw($))}catch(de){ze(de)}},Q=$=>$.done?mt($.value):Promise.resolve($.value).then(ke,se);Q((Oe=Oe.apply(Me,ht)).next())});const xe=({messages:Me,loading:ht,user:Oe,dispatch:mt})=>{var ze;const ke=(0,ue.useParams)(),se=(0,ue.useLocation)(),{actionTabs:Q}=Me,[$]=y.default.useForm(),{recentContacts:de}=Me,[we,Ce]=(0,A.useState)(""),[P,te]=(0,A.useState)([]),[ge,Ee]=(0,A.useState)(!1),[Te,Ue]=(0,A.useState)();(0,A.useEffect)(()=>{Me.actionTabs.key==="\u5199\u79C1\u4FE1"&&et()},[Me.actionTabs.key]);const et=()=>X(void 0,null,function*(){var De;const Ke=yield mt({type:"messages/getRecentContacts",payload:{id:(De=Oe==null?void 0:Oe.userInfo)==null?void 0:De.user_id,keyword:we}});te(J({},Ke))}),Ne=()=>X(void 0,null,function*(){if(we!==""){const De=yield mt({type:"messages/getUsersForPrivateMessages",payload:{keyword:we}});te(J({},De))}});return(0,A.useEffect)(()=>{Ne()},[we]),A.createElement(x.default,{centered:!0,title:"\u5199\u79C1\u4FE1",open:Me.actionTabs.key==="\u5199\u79C1\u4FE1",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{height:320},onOk:()=>X(void 0,null,function*(){var De,Ke,_t;yield $.validateFields();const nt=$.getFieldValue(),lt=`/api/course_modules/${ke.categoryId}/add_second_category.json`,ye=yield(0,V.w0)({content:nt.content,target_id:Te,userId:(De=Oe==null?void 0:Oe.userInfo)==null?void 0:De.user_id});ye.status===0&&(U.ZP.success("\u6DFB\u52A0\u6210\u529F"),mt({type:"messages/setActionTabs",payload:{}}),ue.history.push(`/messages/${(Ke=Oe==null?void 0:Oe.userInfo)==null?void 0:Ke.login}/message_detail?target_ids=${(_t=ye==null?void 0:ye.private_message)==null?void 0:_t.receiver_id}`))}),onCancel:()=>{mt({type:"messages/setActionTabs",payload:{}})}},A.createElement(y.default,{form:$,initialValues:{name:""}},A.createElement(y.default.Item,{name:"users",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u9001\u5BF9\u8C61"}]},A.createElement(N.default.Search,{onFocus:()=>Ee(!0),onSearch:De=>{Ce(De)},placeholder:"\u53D1\u9001\u7ED9..."})),ge&&A.createElement(S.Z,{loading:ht["messages/getUsersForPrivateMessages"]},A.createElement("aside",{className:I.searchWrp,style:{maxHeight:260,overflow:"auto"}},A.createElement("p",{className:"c-light-black mt10"},we===""?"\u6700\u8FD1\u8054\u7CFB\u4EBA":"\u641C\u7D22\u7ED3\u679C"),(ze=P==null?void 0:P.users)==null?void 0:ze.map(function(De,Ke){return A.createElement(oe.Z,{key:Ke,align:"middle",className:"mt15 current",onClick:()=>{Ue(De.id),$.setFieldsValue({users:De.name}),Ee(!1)}},A.createElement(q.Z,{flex:"58px"},A.createElement("img",{style:{width:48,borderRadius:48},src:d.Z.IMG_SERVER+"/images/"+(De==null?void 0:De.image_url),alt:""})),A.createElement(q.Z,null,De.name))}))),A.createElement(y.default.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9"}],className:ge&&"hide",name:"content"},A.createElement(N.default.TextArea,{rows:10,maxLength:200}))))};var he=(0,ue.connect)(({messages:Me,loading:ht,user:Oe})=>({messages:Me,user:Oe,loading:ht.effects}))(xe),Ze=k(38394),K=k(15993),R=Object.defineProperty,B=Object.defineProperties,G=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,v=(Me,ht,Oe)=>ht in Me?R(Me,ht,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):Me[ht]=Oe,C=(Me,ht)=>{for(var Oe in ht||(ht={}))H.call(ht,Oe)&&v(Me,Oe,ht[Oe]);if(W)for(var Oe of W(ht))_.call(ht,Oe)&&v(Me,Oe,ht[Oe]);return Me},Y=(Me,ht)=>B(Me,G(ht)),Se=(Me,ht)=>{var Oe={};for(var mt in Me)H.call(Me,mt)&&ht.indexOf(mt)<0&&(Oe[mt]=Me[mt]);if(Me!=null&&W)for(var mt of W(Me))ht.indexOf(mt)<0&&_.call(Me,mt)&&(Oe[mt]=Me[mt]);return Oe};const{SubMenu:Re}=F.default,{Sider:Ye,Content:He}=g.default,ot=Me=>{var ht=Me,{messages:Oe,globalSetting:mt,loading:ze,user:ke,dispatch:se}=ht,Q=Se(ht,["messages","globalSetting","loading","user","dispatch"]),$,de;const we=(0,ue.useParams)(),{userInfo:Ce}=ke,{tidingsList:P,privateMessage:te}=Oe,[ge,Ee]=(0,A.useState)({per_page:10,page:1});(0,A.useEffect)(()=>{ge.page=1,Te()},[we.userId]);const Te=()=>{se({type:"messages/getPrivateMessages",payload:C(C({},ge),we)})},Ue=De=>{var Ke,_t;Q.history.push(`/messages/${(Ke=ke==null?void 0:ke.userInfo)==null?void 0:Ke.login}/message_detail?target_ids=${(_t=De==null?void 0:De.target)==null?void 0:_t.id}`)},et=De=>{var Ke;Q.history.push(`/users/${(Ke=De==null?void 0:De.target)==null?void 0:Ke.login}`)},Ne=(0,A.useMemo)(()=>(Ce==null?void 0:Ce.is_teacher)&&(Ce==null?void 0:Ce.professional_certification),[Ce]);return A.createElement("section",{className:I.bg},A.createElement("section",{className:"edu-container mt20"},A.createElement(oe.Z,{gutter:[20,20]},A.createElement(K.Z,null),A.createElement(q.Z,{flex:"1"},A.createElement("aside",{className:"bg-white"},A.createElement("aside",{className:"pt30 pl30 pr30 font16"},A.createElement(oe.Z,null,A.createElement(q.Z,{flex:"1"},"\u5168\u90E8\u79C1\u4FE1"),Ne&&A.createElement(q.Z,null,A.createElement("span",{className:"c-blue current",onClick:()=>{var De;se({type:"messages/setActionTabs",payload:{key:"\u5199\u79C1\u4FE1",bodyParams:Y(C({},ge),{user_id:(De=ke==null?void 0:ke.userInfo)==null?void 0:De.user_id})}})}},"\u5199\u79C1\u4FE1")))),A.createElement(l.Z,null),A.createElement("aside",{className:I.list},A.createElement(S.Z,{active:!0,avatar:{size:40},paragraph:{rows:5},loading:ze["messages/getPrivateMessages"]},!(($=te==null?void 0:te.private_messages)!=null&&$.length)&&A.createElement(m.Z,null),(de=te==null?void 0:te.private_messages)==null?void 0:de.map(function(De,Ke){var _t,nt;return A.createElement("aside",null,A.createElement(oe.Z,null,A.createElement(q.Z,{flex:"58px",onClick:()=>et(De)},A.createElement("img",{src:d.Z.IMG_SERVER+"/images/"+((_t=De==null?void 0:De.target)==null?void 0:_t.image_url),alt:""})),A.createElement(q.Z,{flex:1},A.createElement(oe.Z,null,A.createElement(q.Z,{span:24},A.createElement(oe.Z,null,A.createElement(q.Z,{flex:"1"},A.createElement("span",{onClick:()=>et(De)},(nt=De==null?void 0:De.target)==null?void 0:nt.name),A.createElement("span",{className:"ml15"},"\u4E0E\u4F60\u7684\u79C1\u4FE1"),A.createElement("span",{className:"c-light-black mr15"},"[",De==null?void 0:De.message_count,"\u6761]"),A.createElement("span",{className:"ml15 c-light-black"},ne()(De.send_time).fromNow())),A.createElement(q.Z,null,(De==null?void 0:De.unread)&&A.createElement("span",{className:I.newlight})))),A.createElement(q.Z,{span:24,onClick:()=>Ue(De)},A.createElement("div",{className:"mt15"},A.createElement(Ze.Z,{value:De.content||""})))))))})))),A.createElement("aside",{className:"tc mt20"},!ze["messages/getTidings"]&&A.createElement(T.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:De=>{ge.page=De,Ee(C({},ge)),Te()},current:ge.page||1,total:te==null?void 0:te.count}))))),A.createElement(he,null))};var dt=(0,ue.connect)(({messages:Me,loading:ht,user:Oe,globalSetting:mt})=>({messages:Me,globalSetting:mt,user:Oe,loading:ht.effects}))(ot)},15993:function(bn,St,k){"use strict";k.d(St,{Z:function(){return I}});var A=k(59301),ue=k(76560),Ae=k(93041),ne=k(24404),F=k(5269),g=k(90524),oe={flex_box_center:"flex_box_center___cQVhO",flex_space_between:"flex_space_between___L36a6",flex_box_vertical_center:"flex_box_vertical_center___sIHwG",flex_box_center_end:"flex_box_center_end___OqNyE",flex_box_column:"flex_box_column___Ct7XG",userInfo:"userInfo____uyMZ",navInfo:"navInfo___acXs6",actived:"actived___WhZza",newTip:"newTip___Jdd6B"},q=Object.defineProperty,l=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,d=(L,O,z)=>O in L?q(L,O,{enumerable:!0,configurable:!0,writable:!0,value:z}):L[O]=z,m=(L,O)=>{for(var z in O||(O={}))S.call(O,z)&&d(L,z,O[z]);if(l)for(var z of l(O))T.call(O,z)&&d(L,z,O[z]);return L},y=(L,O)=>{var z={};for(var ee in L)S.call(L,ee)&&O.indexOf(ee)<0&&(z[ee]=L[ee]);if(L!=null&&l)for(var ee of l(L))O.indexOf(ee)<0&&T.call(L,ee)&&(z[ee]=L[ee]);return z};const{SubMenu:x}=Ae.default,{Sider:U,Content:N}=ne.default,V=L=>{var O=L,{messages:z,globalSetting:ee,loading:re,user:J,dispatch:X}=O,xe=y(O,["messages","globalSetting","loading","user","dispatch"]);const he=(0,ue.useParams)(),{userInfo:Ze}=J,K=(0,ue.useLocation)(),{tidingsList:R,privateMessage:B,unreadInfo:G}=z,[W,H]=(0,A.useState)({per_page:10,page:1});(0,A.useEffect)(()=>{_()},[he.userId]);const _=()=>{X({type:"messages/unreadMessageInfo",payload:m(m({},W),he)})};return A.createElement(F.Z,{flex:"264px"},A.createElement("aside",{className:oe.userInfo},A.createElement("img",{className:"mt40",src:g.Z.IMG_SERVER+"/images/"+(Ze==null?void 0:Ze.image_url)}),A.createElement("p",{className:"font24 mt10"},Ze==null?void 0:Ze.username),A.createElement("p",{className:"mt20"},Ze==null?void 0:Ze.user_identity)),A.createElement("ul",{className:oe.navInfo},A.createElement(ue.Link,{to:`/messages/${Ze==null?void 0:Ze.login}/user_tidings`},A.createElement("li",{className:K.pathname.indexOf("user_tidings")>-1&&oe.actived},"\u6D88\u606F",!!(G!=null&&G.unread_tiding_count)&&A.createElement("span",{className:oe.newTip},G==null?void 0:G.unread_tiding_count))),A.createElement(ue.Link,{to:`/messages/${Ze==null?void 0:Ze.login}/private_messages`},A.createElement("li",{className:(K.pathname.indexOf("private_messages")>-1||K.pathname.indexOf("message_detail")>-1)&&oe.actived},"\u79C1\u4FE1",!!(G!=null&&G.unread_message_count)&&A.createElement("span",{className:oe.newTip},G==null?void 0:G.unread_message_count)))))};var I=(0,ue.connect)(({messages:L,loading:O,user:z,globalSetting:ee})=>({messages:L,globalSetting:ee,user:z,loading:O.effects}))(V)},90290:function(bn,St,k){"use strict";k.d(St,{AL:function(){return O},Iy:function(){return T},Qv:function(){return y},ez:function(){return L},jb:function(){return d}});var A=k(32834),ue=k.n(A),Ae=k(11690),ne=k.n(Ae);let F=1;function g(X,xe){const he=X.match(/^(\s+)(?:```)/);if(he===null)return xe;const Ze=he[1];return xe.split(`
|
|
`).map(K=>{const R=K.match(/^\s+/);if(R===null)return K;const[B]=R;return B.length>=Ze.length?K.slice(Ze.length):K}).join(`
|
|
`)}let oe=[],q=["<ul>"];const l=new(ue()).Renderer,S=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){oe.length=0,q=["<ul>"]}const d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(X,xe,he,Ze){if(xe>=X.length||X[xe].level<=he)return xe;var K=X[xe];Ze.push("<li><a href='#"+F+K.anchor+"'>"+K.text+"</a>"),xe++;var R=[];return xe=m(X,xe,K.level,R),R.length>0&&(Ze.push("<ul>"),R.forEach(function(B){Ze.push(B)}),Ze.push("</ul>")),Ze.push("</li>"),xe=m(X,xe,he,Ze),xe}function y(){return m(oe,0,0,q),q.push("</ul>"),q.join("")}const x={heading(X){const xe=S.exec(X);if(F+=1,xe)return{type:"heading",raw:xe[0],depth:xe[1].length,text:xe[2]}},fences(X){const xe=this.rules.block.fences.exec(X);if(xe){const he=xe[0];let Ze=g(he,xe[3]||"");const K=xe[2]?xe[2].trim():xe[2];if(["latex","katex","math"].indexOf(K)>=0){const R=V(),B=Ze;Ze=R,I[R]={type:"block",expression:B}}return{type:"code",raw:he,lang:K,text:Ze}}}},U=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let N=0;const V=()=>`__special_katext_id_${N++}__`;let I={};function L(){return I}function O(){N=0,I={}}function z(X){return X=X.replace(U,(xe,he)=>{const Ze=V();return I[Ze]={type:"inline",expression:he},Ze}),X}const ee=l.listitem;l.listitem=function(X){return ee(z(X))};const re=l.paragraph;l.paragraph=function(X){return re(z(X))};const J=l.tablecell;l.tablecell=function(X,xe){return J(z(X),xe)},l.code=function(X,xe,he){const Ze=(xe||"").match(/\S*/)[0];return Ze?["latex","katex","math"].indexOf(Ze)>=0?`<p class='editormd-tex'>${X}</p>`:`<pre class="prettyprint linenums"><code class="language-${xe}">${he?X:(0,Ae.escape)(X,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(he?X:(0,Ae.escape)(X,!0))+"</code></pre>"},l.heading=function(X,xe,he){let Ze=this.options.headerPrefix+he.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return oe.push({anchor:Ze,level:xe,text:X}),"<h"+xe+' id="'+F+Ze+'">'+X+"</h"+xe+">"},ue().setOptions({silent:!0,gfm:!0,pedantic:!1}),ue().use({tokenizer:x,renderer:l}),St.ZP=ue()},64018:function(){var bn,St,k,A=!1,ue,Ae;window.PR_SHOULD_USE_CONTINUATION=!0;var ne,F;(function(){var g=window,oe=["break,continue,do,else,for,if,return,while"],q=[oe,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],l=[q,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[l,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],T=[l,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[l,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],m="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[l,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],x="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",U=[oe,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],N=[oe,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],V=[oe,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[S,d,T,y,x,U,N,V],L=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,O="str",z="kwd",ee="com",re="typ",J="lit",X="pun",xe="pln",he="tag",Ze="dec",K="src",R="atn",B="atv",G="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(Q){for(var $=0,de=!1,we=!1,Ce=0,P=Q.length;Ce<P;++Ce){var te=Q[Ce];if(te.ignoreCase)we=!0;else if(/[a-z]/i.test(te.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){de=!0,we=!1;break}}var ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ee(De){var Ke=De.charCodeAt(0);if(Ke!==92)return Ke;var _t=De.charAt(1);return Ke=ge[_t],Ke||("0"<=_t&&_t<="7"?parseInt(De.substring(1),8):_t==="u"||_t==="x"?parseInt(De.substring(2),16):De.charCodeAt(1))}function Te(De){if(De<32)return(De<16?"\\x0":"\\x")+De.toString(16);var Ke=String.fromCharCode(De);return Ke==="\\"||Ke==="-"||Ke==="]"||Ke==="^"?"\\"+Ke:Ke}function Ue(De){var Ke=De.substring(1,De.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),_t=[],nt=Ke[0]==="^",lt=["["];nt&<.push("^");for(var ye=nt?1:0,wt=Ke.length;ye<wt;++ye){var Qe=Ke[ye];if(/\\[bdsw]/i.test(Qe))lt.push(Qe);else{var We=Ee(Qe),Mt;ye+2<wt&&Ke[ye+1]==="-"?(Mt=Ee(Ke[ye+2]),ye+=2):Mt=We,_t.push([We,Mt]),Mt<65||We>122||(Mt<65||We>90||_t.push([Math.max(65,We)|32,Math.min(Mt,90)|32]),Mt<97||We>122||_t.push([Math.max(97,We)&-33,Math.min(Mt,122)&-33]))}}_t.sort(function(Tn,It){return Tn[0]-It[0]||It[1]-Tn[1]});for(var $t=[],rt=[],ye=0;ye<_t.length;++ye){var Jt=_t[ye];Jt[0]<=rt[1]+1?rt[1]=Math.max(rt[1],Jt[1]):$t.push(rt=Jt)}for(var ye=0;ye<$t.length;++ye){var Jt=$t[ye];lt.push(Te(Jt[0])),Jt[1]>Jt[0]&&(Jt[1]+1>Jt[0]&<.push("-"),lt.push(Te(Jt[1])))}return lt.push("]"),lt.join("")}function et(De){for(var Ke=De.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),_t=Ke.length,nt=[],lt=0,ye=0;lt<_t;++lt){var wt=Ke[lt];if(wt==="(")++ye;else if(wt.charAt(0)==="\\"){var Qe=+wt.substring(1);Qe&&(Qe<=ye?nt[Qe]=-1:Ke[lt]=Te(Qe))}}for(var lt=1;lt<nt.length;++lt)nt[lt]===-1&&(nt[lt]=++$);for(var lt=0,ye=0;lt<_t;++lt){var wt=Ke[lt];if(wt==="(")++ye,nt[ye]||(Ke[lt]="(?:");else if(wt.charAt(0)==="\\"){var Qe=+wt.substring(1);Qe&&Qe<=ye&&(Ke[lt]="\\"+nt[Qe])}}for(var lt=0;lt<_t;++lt)Ke[lt]==="^"&&Ke[lt+1]!=="^"&&(Ke[lt]="");if(De.ignoreCase&&de)for(var lt=0;lt<_t;++lt){var wt=Ke[lt],We=wt.charAt(0);wt.length>=2&&We==="["?Ke[lt]=Ue(wt):We!=="\\"&&(Ke[lt]=wt.replace(/[a-zA-Z]/g,function(rt){var Jt=rt.charCodeAt(0);return"["+String.fromCharCode(Jt&-33,Jt|32)+"]"}))}return Ke.join("")}for(var Ne=[],Ce=0,P=Q.length;Ce<P;++Ce){var te=Q[Ce];if(te.global||te.multiline)throw new Error(""+te);Ne.push("(?:"+et(te)+")")}return new RegExp(Ne.join("|"),we?"gi":"g")}function _(Q,$){var de=/(?:^|\s)nocode(?:\s|$)/,we=[],Ce=0,P=[],te=0;function ge(Ee){var Te=Ee.nodeType;if(Te==1){if(de.test(Ee.className))return;for(var Ue=Ee.firstChild;Ue;Ue=Ue.nextSibling)ge(Ue);var et=Ee.nodeName.toLowerCase();(et==="br"||et==="li")&&(we[te]=`
|
|
`,P[te<<1]=Ce++,P[te++<<1|1]=Ee)}else if(Te==3||Te==4){var Ne=Ee.nodeValue;Ne.length&&($?Ne=Ne.replace(/\r\n?/g,`
|
|
`):Ne=Ne.replace(/[ \t\r\n]+/g," "),we[te]=Ne,P[te<<1]=Ce,Ce+=Ne.length,P[te++<<1|1]=Ee)}}return ge(Q),{sourceCode:we.join("").replace(/\n$/,""),spans:P}}function v(Q,$,de,we,Ce){if(de){var P={sourceNode:Q,pre:1,langExtension:null,numberLines:null,sourceCode:de,spans:null,basePos:$,decorations:null};we(P),Ce.push.apply(Ce,P.decorations)}}var C=/\S/;function Y(Q){for(var $=void 0,de=Q.firstChild;de;de=de.nextSibling){var we=de.nodeType;$=we===1?$?Q:de:we===3&&C.test(de.nodeValue)?Q:$}return $===Q?void 0:$}function Se(Q,$){var de={},we;(function(){for(var te=Q.concat($),ge=[],Ee={},Te=0,Ue=te.length;Te<Ue;++Te){var et=te[Te],Ne=et[3];if(Ne)for(var De=Ne.length;--De>=0;)de[Ne.charAt(De)]=et;var Ke=et[1],_t=""+Ke;Ee.hasOwnProperty(_t)||(ge.push(Ke),Ee[_t]=null)}ge.push(/[\0-\uffff]/),we=H(ge)})();var Ce=$.length,P=function(te){for(var ge=te.sourceCode,Ee=te.basePos,Te=te.sourceNode,Ue=[Ee,xe],et=0,Ne=ge.match(we)||[],De={},Ke=0,_t=Ne.length;Ke<_t;++Ke){var nt=Ne[Ke],lt=De[nt],ye=void 0,wt;if(typeof lt=="string")wt=!1;else{var Qe=de[nt.charAt(0)];if(Qe)ye=nt.match(Qe[1]),lt=Qe[0];else{for(var We=0;We<Ce;++We)if(Qe=$[We],ye=nt.match(Qe[1]),ye){lt=Qe[0];break}ye||(lt=xe)}wt=lt.length>=5&<.substring(0,5)==="lang-",wt&&!(ye&&typeof ye[1]=="string")&&(wt=!1,lt=K),wt||(De[nt]=lt)}var Mt=et;if(et+=nt.length,!wt)Ue.push(Ee+Mt,lt);else{var $t=ye[1],rt=nt.indexOf($t),Jt=rt+$t.length;ye[2]&&(Jt=nt.length-ye[2].length,rt=Jt-$t.length);var Tn=lt.substring(5);v(Te,Ee+Mt,nt.substring(0,rt),P,Ue),v(Te,Ee+Mt+rt,$t,ht(Tn,$t),Ue),v(Te,Ee+Mt+Jt,nt.substring(Jt),P,Ue)}}te.decorations=Ue};return P}function Re(Q){var $=[],de=[];Q.tripleQuotedStrings?$.push([O,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Q.multiLineStrings?$.push([O,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):$.push([O,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Q.verbatimStrings&&de.push([O,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var we=Q.hashComments;we&&(Q.cStyleComments?(we>1?$.push([ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):$.push([ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),de.push([O,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):$.push([ee,/^#[^\r\n]*/,null,"#"])),Q.cStyleComments&&(de.push([ee,/^\/\/[^\r\n]*/,null]),de.push([ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ce=Q.regexLiterals;if(Ce){var P=Ce>1?"":`
|
|
\r`,te=P?".":"[\\S\\s]",ge="/(?=[^/*"+P+"])(?:[^/\\x5B\\x5C"+P+"]|\\x5C"+te+"|\\x5B(?:[^\\x5C\\x5D"+P+"]|\\x5C"+te+")*(?:\\x5D|$))+/";de.push(["lang-regex",RegExp("^"+W+"("+ge+")")])}var Ee=Q.types;Ee&&de.push([re,Ee]);var Te=(""+Q.keywords).replace(/^ | $/g,"");Te.length&&de.push([z,new RegExp("^(?:"+Te.replace(/[\s,]+/g,"|")+")\\b"),null]),$.push([xe,/^\s+/,null,` \r
|
|
\xA0`]);var Ue="^.[^\\s\\w.$@'\"`/\\\\]*";return Q.regexLiterals&&(Ue+="(?!s*/)"),de.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[re,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[xe,/^[a-z_$][a-z_$@0-9]*/i,null],[J,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[xe,/^\\[\s\S]?/,null],[X,new RegExp(Ue),null]),Se($,de)}var Ye=Re({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function He(Q,$,de){for(var we=/(?:^|\s)nocode(?:\s|$)/,Ce=/\r\n?|\n/,P=Q.ownerDocument,te=P.createElement("li");Q.firstChild;)te.appendChild(Q.firstChild);var ge=[te];function Ee(Ke){var _t=Ke.nodeType;if(_t==1&&!we.test(Ke.className))if(Ke.nodeName==="br")Te(Ke),Ke.parentNode&&Ke.parentNode.removeChild(Ke);else for(var nt=Ke.firstChild;nt;nt=nt.nextSibling)Ee(nt);else if((_t==3||_t==4)&&de){var lt=Ke.nodeValue,ye=lt.match(Ce);if(ye){var wt=lt.substring(0,ye.index);Ke.nodeValue=wt;var Qe=lt.substring(ye.index+ye[0].length);if(Qe){var We=Ke.parentNode;We.insertBefore(P.createTextNode(Qe),Ke.nextSibling)}Te(Ke),wt||Ke.parentNode.removeChild(Ke)}}}function Te(Ke){for(;!Ke.nextSibling;)if(Ke=Ke.parentNode,!Ke)return;function _t(ye,wt){var Qe=wt?ye.cloneNode(!1):ye,We=ye.parentNode;if(We){var Mt=_t(We,1),$t=ye.nextSibling;Mt.appendChild(Qe);for(var rt=$t;rt;rt=$t)$t=rt.nextSibling,Mt.appendChild(rt)}return Qe}for(var nt=_t(Ke.nextSibling,0),lt;(lt=nt.parentNode)&<.nodeType===1;)nt=lt;ge.push(nt)}for(var Ue=0;Ue<ge.length;++Ue)Ee(ge[Ue]);$===($|0)&&ge[0].setAttribute("value",$);var et=P.createElement("ol");et.className="linenums";for(var Ne=Math.max(0,$-1|0)||0,Ue=0,De=ge.length;Ue<De;++Ue)te=ge[Ue],te.className="L"+(Ue+Ne)%10,te.firstChild||te.appendChild(P.createTextNode("\xA0")),et.appendChild(te);Q.appendChild(et)}function ot(Q){var $=/\bMSIE\s(\d+)/.exec(navigator.userAgent);$=$&&+$[1]<=8;var de=/\n/g,we=Q.sourceCode,Ce=we.length,P=0,te=Q.spans,ge=te.length,Ee=0,Te=Q.decorations,Ue=Te.length,et=0;Te[Ue]=Ce;var Ne,De;for(De=Ne=0;De<Ue;)Te[De]!==Te[De+2]?(Te[Ne++]=Te[De++],Te[Ne++]=Te[De++]):De+=2;for(Ue=Ne,De=Ne=0;De<Ue;){for(var Ke=Te[De],_t=Te[De+1],nt=De+2;nt+2<=Ue&&Te[nt+1]===_t;)nt+=2;Te[Ne++]=Ke,Te[Ne++]=_t,De=nt}Ue=Te.length=Ne;var lt=Q.sourceNode,ye="";lt&&(ye=lt.style.display,lt.style.display="none");try{for(var wt=null;Ee<ge;){var Qe=te[Ee],We=te[Ee+2]||Ce,Mt=Te[et+2]||Ce,nt=Math.min(We,Mt),$t=te[Ee+1],rt;if($t.nodeType!==1&&(rt=we.substring(P,nt))){$&&(rt=rt.replace(de,"\r")),$t.nodeValue=rt;var Jt=$t.ownerDocument,Tn=Jt.createElement("span");Tn.className=Te[et+1];var It=$t.parentNode;It.replaceChild(Tn,$t),Tn.appendChild($t),P<We&&(te[Ee+1]=$t=Jt.createTextNode(we.substring(nt,We)),It.insertBefore($t,Tn.nextSibling))}P=nt,P>=We&&(Ee+=2),P>=Mt&&(et+=2)}}finally{lt&&(lt.style.display=ye)}}var dt={};function Me(Q,$){for(var de=$.length;--de>=0;){var we=$[de];dt.hasOwnProperty(we)?g.console&&console.warn("cannot override language handler %s",we):dt[we]=Q}}function ht(Q,$){return Q&&dt.hasOwnProperty(Q)||(Q=/^\s*</.test($)?"default-markup":"default-code"),dt[Q]}Me(Ye,["default-code"]),Me(Se([],[[xe,/^[^<?]+/],[Ze,/^<!\w[^>]*(?:>|$)/],[ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[X,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Me(Se([[xe,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[he,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[X,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Me(Se([],[[B,/^[\s\S]+/]]),["uq.val"]),Me(Re({keywords:S,hashComments:!0,cStyleComments:!0,types:L}),["c","cc","cpp","cxx","cyc","m"]),Me(Re({keywords:"null,true,false"}),["json"]),Me(Re({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:L}),["cs"]),Me(Re({keywords:T,cStyleComments:!0}),["java"]),Me(Re({keywords:V,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Me(Re({keywords:U,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Me(Re({keywords:x,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Me(Re({keywords:N,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Me(Re({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Me(Re({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Me(Se([],[[O,/^[\s\S]+/]]),["regex"]);function Oe(Q){var $=Q.langExtension;try{var de=_(Q.sourceNode,Q.pre),we=de.sourceCode;Q.sourceCode=we,Q.spans=de.spans,Q.basePos=0,ht($,we)(Q),ot(Q)}catch(Ce){g.console&&console.log(Ce&&Ce.stack||Ce)}}function mt(Q,$,de){var we=de||!1,Ce=$||null,P=document.createElement("div");P.innerHTML="<pre>"+Q+"</pre>",P=P.firstChild,we&&He(P,we,!0);var te={langExtension:Ce,numberLines:we,sourceNode:P,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Oe(te),P.innerHTML}function ze(Q,$){var de=$||document.body,we=de.ownerDocument||document;function Ce(Qe){return de.getElementsByTagName(Qe)}for(var P=[Ce("pre"),Ce("code"),Ce("xmp")],te=[],ge=0;ge<P.length;++ge)for(var Ee=0,Te=P[ge].length;Ee<Te;++Ee)te.push(P[ge][Ee]);P=null;var Ue=Date;Ue.now||(Ue={now:function(){return+new Date}});var et=0,Ne=/\blang(?:uage)?-([\w.]+)(?!\S)/,De=/\bprettyprint\b/,Ke=/\bprettyprinted\b/,_t=/pre|xmp/i,nt=/^code$/i,lt=/^(?:pre|code|xmp)$/i,ye={};function wt(){for(var Qe=g.PR_SHOULD_USE_CONTINUATION?Ue.now()+250:1/0;et<te.length&&Ue.now()<Qe;et++){for(var We=te[et],Mt=ye,$t=We;$t=$t.previousSibling;){var rt=$t.nodeType,Jt=(rt===7||rt===8)&&$t.nodeValue;if(Jt?!/^\??prettify\b/.test(Jt):rt!==3||/\S/.test($t.nodeValue))break;if(Jt){Mt={},Jt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(bt,Ct,zt){Mt[Ct]=zt});break}}var Tn=We.className;if((Mt!==ye||De.test(Tn))&&!Ke.test(Tn)){for(var It=!1,en=We.parentNode;en;en=en.parentNode){var Ie=en.tagName;if(lt.test(Ie)&&en.className&&De.test(en.className)){It=!0;break}}if(!It){We.className+=" prettyprinted";var ve=Mt.lang;if(!ve){ve=Tn.match(Ne);var be;!ve&&(be=Y(We))&&nt.test(be.tagName)&&(ve=be.className.match(Ne)),ve&&(ve=ve[1])}var M;if(_t.test(We.tagName))M=1;else{var Z=We.currentStyle,ie=we.defaultView,le=Z?Z.whiteSpace:ie&&ie.getComputedStyle?ie.getComputedStyle(We,null).getPropertyValue("white-space"):0;M=le&&le.substring(0,3)==="pre"}var _e=Mt.linenums;(_e=_e==="true"||+_e)||(_e=Tn.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&He(We,_e,M);var it={langExtension:ve,sourceNode:We,numberLines:_e,pre:M,sourceCode:null,basePos:null,spans:null,decorations:null};Oe(it)}}}et<te.length?g.setTimeout(wt,250):typeof Q=="function"&&Q()}wt()}var ke=g.PR={createSimpleLexer:Se,registerLangHandler:Me,sourceDecorator:Re,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:B,PR_COMMENT:ee,PR_DECLARATION:Ze,PR_KEYWORD:z,PR_LITERAL:J,PR_NOCODE:G,PR_PLAIN:xe,PR_PUNCTUATION:X,PR_SOURCE:K,PR_STRING:O,PR_TAG:he,PR_TYPE:re,prettyPrintOne:A?g.prettyPrintOne=mt:ne=mt,prettyPrint:F=A?g.prettyPrint=ze:F=ze},se=g.define;typeof se=="function"&&se.amd&&se("google-code-prettify",[],function(){return ke})})()},25769:function(bn,St,k){"use strict";var A=k(98040),ue={"text/plain":"Text","text/html":"Url",default:"Text"},Ae="Copy to clipboard: #{key}, Enter";function ne(g){var oe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return g.replace(/#{\s*key\s*}/g,oe)}function F(g,oe){var q,l,S,T,d,m,y=!1;oe||(oe={}),q=oe.debug||!1;try{S=A(),T=document.createRange(),d=document.getSelection(),m=document.createElement("span"),m.textContent=g,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(U){if(U.stopPropagation(),oe.format)if(U.preventDefault(),typeof U.clipboardData=="undefined"){q&&console.warn("unable to use e.clipboardData"),q&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var N=ue[oe.format]||ue.default;window.clipboardData.setData(N,g)}else U.clipboardData.clearData(),U.clipboardData.setData(oe.format,g);oe.onCopy&&(U.preventDefault(),oe.onCopy(U.clipboardData))}),document.body.appendChild(m),T.selectNodeContents(m),d.addRange(T);var x=document.execCommand("copy");if(!x)throw new Error("copy command was unsuccessful");y=!0}catch(U){q&&console.error("unable to copy using execCommand: ",U),q&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(oe.format||"text",g),oe.onCopy&&oe.onCopy(window.clipboardData),y=!0}catch(N){q&&console.error("unable to copy using clipboardData: ",N),q&&console.error("falling back to prompt"),l=ne("message"in oe?oe.message:Ae),window.prompt(l,g)}}finally{d&&(typeof d.removeRange=="function"?d.removeRange(T):d.removeAllRanges()),m&&document.body.removeChild(m),S()}return y}bn.exports=F},53184:function(bn,St,k){"use strict";var A,ue;function Ae(ne,F,g){var oe=function(q,l){return ne.js_beautify(q,l)};return oe.js=ne.js_beautify,oe.css=F.css_beautify,oe.html=g.html_beautify,oe.js_beautify=ne.js_beautify,oe.css_beautify=F.css_beautify,oe.html_beautify=g.html_beautify,oe}A=[k(58553),k(87804),k(40998)],ue=function(ne,F,g){return Ae(ne,F,g)}.apply(St,A),ue!==void 0&&(bn.exports=ue)},87804:function(bn,St){var k,A;(function(){var ue;(function(){"use strict";var ne=[,,function(q){function l(d){this.__parent=d,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var d=new l(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},l.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},l.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},l.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},l.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function S(d,m){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(d,m){var y=this.__base_string_length;return m=m||0,d<0&&(y=0),y+=d*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(d,m){var y=this.__base_string;return m=m||0,d<0&&(d=0,y=""),m+=d*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var d=this.__cache.length,m=0,y="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),d&&(y+=new Array(d+1).join(" ")),this.__cache.push(y)};function T(d,m){this.__indent_cache=new S(d,m),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}T.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},T.prototype.get_line_number=function(){return this.__lines.length},T.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},T.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},T.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},T.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},T.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(y=y.replace(/[\n]/g,d)),y},T.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},T.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},T.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},T.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},T.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(" "))},T.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},T.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},T.prototype.just_added_newline=function(){return this.current_line.is_empty()},T.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},T.prototype.ensure_empty_line_above=function(d,m){for(var y=this.__lines.length-2;y>=0;){var x=this.__lines[y];if(x.is_empty())break;if(x.item(0).indexOf(d)!==0&&x.item(-1)!==m){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},q.exports.Output=T},,,,function(q){function l(d,m){this.raw_options=S(d,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(d,m){var y=this.raw_options[d],x=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(x=y.concat()):typeof y=="string"&&(x=y.split(/[^a-zA-Z0-9_\/\-]+/)),x},l.prototype._get_boolean=function(d,m){var y=this.raw_options[d],x=y===void 0?!!m:!!y;return x},l.prototype._get_characters=function(d,m){var y=this.raw_options[d],x=m||"";return typeof y=="string"&&(x=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),x},l.prototype._get_number=function(d,m){var y=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var x=parseInt(y,10);return isNaN(x)&&(x=m),x},l.prototype._get_selection=function(d,m,y){var x=this._get_selection_list(d,m,y);if(x.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x[0]},l.prototype._get_selection_list=function(d,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var x=this._get_array(d,y);if(!this._is_valid_selection(x,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x},l.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(y){return m.indexOf(y)===-1})};function S(d,m){var y={};d=T(d);var x;for(x in d)x!==m&&(y[x]=d[x]);if(m&&d[m])for(x in d[m])y[x]=d[m][x];return y}function T(d){var m={},y;for(y in d){var x=y.replace(/-/g,"_");m[x]=d[y]}return m}q.exports.Options=l,q.exports.normalizeOpts=T,q.exports.mergeOpts=S},,function(q){var l=RegExp.prototype.hasOwnProperty("sticky");function S(T){this.__input=T||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var T=null;return this.hasNext()&&(T=this.__input.charAt(this.__position),this.__position+=1),T},S.prototype.peek=function(T){var d=null;return T=T||0,T+=this.__position,T>=0&&T<this.__input_length&&(d=this.__input.charAt(T)),d},S.prototype.__match=function(T,d){T.lastIndex=d;var m=T.exec(this.__input);return m&&!(l&&T.sticky)&&m.index!==d&&(m=null),m},S.prototype.test=function(T,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(T,d):!1},S.prototype.testChar=function(T,d){var m=this.peek(d);return T.lastIndex=0,m!==null&&T.test(m)},S.prototype.match=function(T){var d=this.__match(T,this.__position);return d?this.__position+=d[0].length:d=null,d},S.prototype.read=function(T,d,m){var y="",x;return T&&(x=this.match(T),x&&(y+=x[0])),d&&(x||!T)&&(y+=this.readUntil(d,m)),y},S.prototype.readUntil=function(T,d){var m="",y=this.__position;T.lastIndex=this.__position;var x=T.exec(this.__input);return x?(y=x.index,d&&(y+=x[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(T){return this.readUntil(T,!0)},S.prototype.get_regexp=function(T,d){var m=null,y="g";return d&&l&&(y="y"),typeof T=="string"&&T!==""?m=new RegExp(T,y):T&&(m=new RegExp(T.source,y)),m},S.prototype.get_literal_regexp=function(T){return RegExp(T.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(T){var d=this.__position,m=this.readUntilAfter(T);return this.__position=d,m},S.prototype.lookBack=function(T){var d=this.__position-1;return d>=T.length&&this.__input.substring(d-T.length,d).toLowerCase()===T},q.exports.InputScanner=S},,,,,function(q){function l(S,T){S=typeof S=="string"?S:S.source,T=typeof T=="string"?T:T.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+T,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+T,"g")}l.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var T={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(S);d;)T[d[1]]=d[2],d=this.__directive_pattern.exec(S);return T},l.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},q.exports.Directives=l},,function(q,l,S){var T=S(16).Beautifier,d=S(17).Options;function m(y,x){var U=new T(y,x);return U.beautify()}q.exports=m,q.exports.defaultOptions=function(){return new d}},function(q,l,S){var T=S(17).Options,d=S(2).Output,m=S(8).InputScanner,y=S(13).Directives,x=new y(/\/\*/,/\*\//),U=/\r\n|[\r\n]/,N=/\r\n|[\r\n]/g,V=/\s/,I=/(?:\s|\n)+/g,L=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,O=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function z(ee,re){this._source_text=ee||"",this._options=new T(re),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}z.prototype.eatString=function(ee){var re="";for(this._ch=this._input.next();this._ch;){if(re+=this._ch,this._ch==="\\")re+=this._input.next();else if(ee.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return re},z.prototype.eatWhitespace=function(ee){for(var re=V.test(this._input.peek()),J=0;V.test(this._input.peek());)this._ch=this._input.next(),ee&&this._ch===`
|
|
`&&(J===0||J<this._options.max_preserve_newlines)&&(J++,this._output.add_new_line(!0));return re},z.prototype.foundNestedPseudoClass=function(){for(var ee=0,re=1,J=this._input.peek(re);J;){if(J==="{")return!0;if(J==="(")ee+=1;else if(J===")"){if(ee===0)return!1;ee-=1}else if(J===";"||J==="}")return!1;re++,J=this._input.peek(re)}return!1},z.prototype.print_string=function(ee){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(ee)},z.prototype.preserveSingleSpace=function(ee){ee&&(this._output.space_before_token=!0)},z.prototype.indent=function(){this._indentLevel++},z.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ee=this._source_text,re=this._options.eol;re==="auto"&&(re=`
|
|
`,ee&&U.test(ee||"")&&(re=ee.match(U)[0])),ee=ee.replace(N,`
|
|
`);var J=ee.match(/^[\t ]*/)[0];this._output=new d(this._options,J),this._input=new m(ee),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var X=0,xe=!1,he=!1,Ze=!1,K=!1,R=!1,B=this._ch,G=!1,W,H,_;W=this._input.read(I),H=W!=="",_=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var v=this._input.read(L),C=x.get_directives(v);C&&C.ignore==="start"&&(v+=x.readIgnored(this._input)),this.print_string(v),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(O)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(H),this.print_string(this._ch);var Y=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Y.match(/[ :]$/)&&(Y=this.eatString(": ").replace(/\s+$/,""),this.print_string(Y),this._output.space_before_token=!0),X===0&&Y.indexOf(":")!==-1&&(he=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(H),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),X===0&&Se.indexOf(":")!==-1?(he=!0,this.indent()):Se in this.NESTED_AT_RULE?(this._nestedLevel+=1,Se in this.CONDITIONAL_GROUP_RULE&&(Ze=!0)):X===0&&!he&&(K=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")he&&(he=!1,this.outdent()),K=!1,Ze?(Ze=!1,xe=this._indentLevel>=this._nestedLevel):xe=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&xe&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(_==="("?this._output.space_before_token=!1:_!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),_==="{"&&this._output.trim(!0),he&&(this.outdent(),he=!1),this.print_string(this._ch),xe=!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 Re=0;Re<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Re++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Re])){G=!0;break}(xe||Ze)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!K&&X===0?(this.print_string(":"),he||(he=!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=_==='"'||_==="'";this.preserveSingleSpace(Ye||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")G=!1,X===0?(he&&(this.outdent(),he=!1),K=!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(),X++,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(")")),X&&(X--,this.outdent()));else{var He=!1;this._input.lookBack("with")&&(He=!0),this.preserveSingleSpace(H||He),this.print_string(this._ch),he&&_==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),R=!0):(this.eatWhitespace(),X++,this.indent())}else if(this._ch===")")X&&(X--,this.outdent()),R&&this._input.peek()===";"&&this._options.selector_separator_newline&&(R=!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&&(!he||R)&&X===0&&!K?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!he&&X===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&&V.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),V.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 ot=_==='"'||_==="'";this.preserveSingleSpace(ot||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&G&&this._output.add_new_line()}var dt=this._output.get_code(re);return dt},q.exports.Beautifier=z},function(q,l,S){var T=S(6).Options;function d(m){T.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var x=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var U=0;U<x.length;U++)x[U]!=="expand"?this.brace_style="collapse":this.brace_style=x[U]}d.prototype=new T,q.exports.Options=d}],F={};function g(q){var l=F[q];if(l!==void 0)return l.exports;var S=F[q]={exports:{}};return ne[q](S,S.exports,g),S.exports}var oe=g(15);ue=oe})();var Ae=ue;k=[],A=function(){return{css_beautify:Ae}}.apply(St,k),A!==void 0&&(bn.exports=A)})()},40998:function(bn,St,k){var A,ue;(function(){var Ae;(function(){"use strict";var oe=[,,function(T){function d(x){this.__parent=x,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var x=new d(this.__parent);return x.set_indent(this.__indent_count,this.__alignment_count),x},d.prototype.item=function(x){return x<0?this.__items[this.__items.length+x]:this.__items[x]},d.prototype.has_match=function(x){for(var U=this.__items.length-1;U>=0;U--)if(this.__items[U].match(x))return!0;return!1},d.prototype.set_indent=function(x,U){this.is_empty()&&(this.__indent_count=x||0,this.__alignment_count=U||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var x=this.__parent.current_line;return x.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),x.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),x.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,x.__items[0]===" "&&(x.__items.splice(0,1),x.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(x){this.__items.push(x);var U=x.lastIndexOf(`
|
|
`);U!==-1?this.__character_count=x.length-U:this.__character_count+=x.length},d.prototype.pop=function(){var x=null;return this.is_empty()||(x=this.__items.pop(),this.__character_count-=x.length),x},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var x="";return this.is_empty()?this.__parent.indent_empty_lines&&(x=this.__parent.get_indent_string(this.__indent_count)):(x=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),x+=this.__items.join("")),x};function m(x,U){this.__cache=[""],this.__indent_size=x.indent_size,this.__indent_string=x.indent_char,x.indent_with_tabs||(this.__indent_string=new Array(x.indent_size+1).join(x.indent_char)),U=U||"",x.indent_level>0&&(U=new Array(x.indent_level+1).join(this.__indent_string)),this.__base_string=U,this.__base_string_length=U.length}m.prototype.get_indent_size=function(x,U){var N=this.__base_string_length;return U=U||0,x<0&&(N=0),N+=x*this.__indent_size,N+=U,N},m.prototype.get_indent_string=function(x,U){var N=this.__base_string;return U=U||0,x<0&&(x=0,N=""),U+=x*this.__indent_size,this.__ensure_cache(U),N+=this.__cache[U],N},m.prototype.__ensure_cache=function(x){for(;x>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var x=this.__cache.length,U=0,N="";this.__indent_size&&x>=this.__indent_size&&(U=Math.floor(x/this.__indent_size),x-=U*this.__indent_size,N=new Array(U+1).join(this.__indent_string)),x&&(N+=new Array(x+1).join(" ")),this.__cache.push(N)};function y(x,U){this.__indent_cache=new m(x,U),this.raw=!1,this._end_with_newline=x.end_with_newline,this.indent_size=x.indent_size,this.wrap_line_length=x.wrap_line_length,this.indent_empty_lines=x.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(x,U){return this.__indent_cache.get_indent_string(x,U)},y.prototype.get_indent_size=function(x,U){return this.__indent_cache.get_indent_size(x,U)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(x){return this.is_empty()||!x&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(x){this.trim(!0);var 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 N=this.__lines.join(`
|
|
`);return x!==`
|
|
`&&(N=N.replace(/[\n]/g,x)),N},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(x,U){return x=x||0,U=U||0,this.next_line.set_indent(x,U),this.__lines.length>1?(this.current_line.set_indent(x,U),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(x){for(var U=0;U<x.newlines;U++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(x.whitespace_before),this.current_line.push(x.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(x){this.__add_space_before_token(),this.current_line.push(x),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(x){for(var U=this.__lines.length;x<U;)this.__lines[x]._remove_indent(),x++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(x){for(x=x===void 0?!1:x,this.current_line.trim();x&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(x,U){for(var N=this.__lines.length-2;N>=0;){var V=this.__lines[N];if(V.is_empty())break;if(V.item(0).indexOf(x)!==0&&V.item(-1)!==U){this.__lines.splice(N+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}N--}},T.exports.Output=y},function(T){function d(m,y,x,U){this.type=m,this.text=y,this.comments_before=null,this.newlines=x||0,this.whitespace_before=U||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}T.exports.Token=d},,,function(T){function d(x,U){this.raw_options=m(x,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"])}d.prototype._get_array=function(x,U){var N=this.raw_options[x],V=U||[];return typeof N=="object"?N!==null&&typeof N.concat=="function"&&(V=N.concat()):typeof N=="string"&&(V=N.split(/[^a-zA-Z0-9_\/\-]+/)),V},d.prototype._get_boolean=function(x,U){var N=this.raw_options[x],V=N===void 0?!!U:!!N;return V},d.prototype._get_characters=function(x,U){var N=this.raw_options[x],V=U||"";return typeof N=="string"&&(V=N.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),V},d.prototype._get_number=function(x,U){var N=this.raw_options[x];U=parseInt(U,10),isNaN(U)&&(U=0);var V=parseInt(N,10);return isNaN(V)&&(V=U),V},d.prototype._get_selection=function(x,U,N){var V=this._get_selection_list(x,U,N);if(V.length!==1)throw new Error("Invalid Option Value: The option '"+x+`' can only be one of the following values:
|
|
`+U+`
|
|
You passed in: '`+this.raw_options[x]+"'");return V[0]},d.prototype._get_selection_list=function(x,U,N){if(!U||U.length===0)throw new Error("Selection list cannot be empty.");if(N=N||[U[0]],!this._is_valid_selection(N,U))throw new Error("Invalid Default Value!");var V=this._get_array(x,N);if(!this._is_valid_selection(V,U))throw new Error("Invalid Option Value: The option '"+x+`' can contain only the following values:
|
|
`+U+`
|
|
You passed in: '`+this.raw_options[x]+"'");return V},d.prototype._is_valid_selection=function(x,U){return x.length&&U.length&&!x.some(function(N){return U.indexOf(N)===-1})};function m(x,U){var N={};x=y(x);var V;for(V in x)V!==U&&(N[V]=x[V]);if(U&&x[U])for(V in x[U])N[V]=x[U][V];return N}function y(x){var U={},N;for(N in x){var V=N.replace(/-/g,"_");U[V]=x[N]}return U}T.exports.Options=d,T.exports.normalizeOpts=y,T.exports.mergeOpts=m},,function(T){var d=RegExp.prototype.hasOwnProperty("sticky");function m(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},m.prototype.peek=function(y){var x=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(x=this.__input.charAt(y)),x},m.prototype.__match=function(y,x){y.lastIndex=x;var U=y.exec(this.__input);return U&&!(d&&y.sticky)&&U.index!==x&&(U=null),U},m.prototype.test=function(y,x){return x=x||0,x+=this.__position,x>=0&&x<this.__input_length?!!this.__match(y,x):!1},m.prototype.testChar=function(y,x){var U=this.peek(x);return y.lastIndex=0,U!==null&&y.test(U)},m.prototype.match=function(y){var x=this.__match(y,this.__position);return x?this.__position+=x[0].length:x=null,x},m.prototype.read=function(y,x,U){var N="",V;return y&&(V=this.match(y),V&&(N+=V[0])),x&&(V||!y)&&(N+=this.readUntil(x,U)),N},m.prototype.readUntil=function(y,x){var U="",N=this.__position;y.lastIndex=this.__position;var V=y.exec(this.__input);return V?(N=V.index,x&&(N+=V[0].length)):N=this.__input_length,U=this.__input.substring(this.__position,N),this.__position=N,U},m.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},m.prototype.get_regexp=function(y,x){var U=null,N="g";return x&&d&&(N="y"),typeof y=="string"&&y!==""?U=new RegExp(y,N):y&&(U=new RegExp(y.source,N)),U},m.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(y){var x=this.__position,U=this.readUntilAfter(y);return this.__position=x,U},m.prototype.lookBack=function(y){var x=this.__position-1;return x>=y.length&&this.__input.substring(x-y.length,x).toLowerCase()===y},T.exports.InputScanner=m},function(T,d,m){var y=m(8).InputScanner,x=m(3).Token,U=m(10).TokenStream,N=m(11).WhitespacePattern,V={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(L,O){this._input=new y(L),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new N(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new U,this._reset();for(var L,O=new x(V.START,""),z=null,ee=[],re=new U;O.type!==V.EOF;){for(L=this._get_next_token(O,z);this._is_comment(L);)re.add(L),L=this._get_next_token(O,z);re.isEmpty()||(L.comments_before=re,re=new U),L.parent=z,this._is_opening(L)?(ee.push(z),z=L):z&&this._is_closing(L,z)&&(L.opened=z,z.closed=L,z=ee.pop(),L.parent=z),L.previous=O,O.next=L,this.__tokens.add(L),O=L}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(L,O){this._readWhitespace();var z=this._input.read(/.+/g);return z?this._create_token(V.RAW,z):this._create_token(V.EOF,"")},I.prototype._is_comment=function(L){return!1},I.prototype._is_opening=function(L){return!1},I.prototype._is_closing=function(L,O){return!1},I.prototype._create_token=function(L,O){var z=new x(L,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return z},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},T.exports.Tokenizer=I,T.exports.TOKEN=V},function(T){function d(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},d.prototype.peek=function(m){var y=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(y=this.__tokens[m]),y},d.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},T.exports.TokenStream=d},function(T,d,m){var y=m(12).Pattern;function x(U,N){y.call(this,U,N),N?this._line_regexp=this._input.get_regexp(N._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}x.prototype=new y,x.prototype.__set_whitespace_patterns=function(U,N){U+="\\t ",N+="\\n\\r",this._match_pattern=this._input.get_regexp("["+U+N+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+N+"]")},x.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 N=this.__split(this._newline_regexp,U);this.newline_count=N.length-1,this.whitespace_before_token=N[this.newline_count]}return U},x.prototype.matching=function(U,N){var V=this._create();return V.__set_whitespace_patterns(U,N),V._update(),V},x.prototype._create=function(){return new x(this._input,this)},x.prototype.__split=function(U,N){U.lastIndex=0;for(var V=0,I=[],L=U.exec(N);L;)I.push(N.substring(V,L.index)),V=L.index+L[0].length,L=U.exec(N);return V<N.length?I.push(N.substring(V,N.length)):I.push(""),I},T.exports.WhitespacePattern=x},function(T){function d(m,y){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}d.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(m){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(m),y._update(),y},d.prototype.until=function(m){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(m),y._update(),y},d.prototype.starting_with=function(m){var y=this._create();return y._starting_pattern=this._input.get_regexp(m,!0),y._update(),y},d.prototype.matching=function(m){var y=this._create();return y._match_pattern=this._input.get_regexp(m,!0),y._update(),y},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},T.exports.Pattern=d},function(T){function d(m,y){m=typeof m=="string"?m:m.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+y,"g")}d.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var x=this.__directive_pattern.exec(m);x;)y[x[1]]=x[2],x=this.__directive_pattern.exec(m);return y},d.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},T.exports.Directives=d},function(T,d,m){var y=m(12).Pattern,x={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function U(N,V){y.call(this,N,V),this.__template_pattern=null,this._disabled=Object.assign({},x),this._excluded=Object.assign({},x),V&&(this.__template_pattern=this._input.get_regexp(V.__template_pattern),this._excluded=Object.assign(this._excluded,V._excluded),this._disabled=Object.assign(this._disabled,V._disabled));var I=new y(N);this.__patterns={handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:I.starting_with(/{{{/).until_after(/}}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),php:I.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}U.prototype=new y,U.prototype._create=function(){return new U(this._input,this)},U.prototype._update=function(){this.__set_templated_pattern()},U.prototype.disable=function(N){var V=this._create();return V._disabled[N]=!0,V._update(),V},U.prototype.read_options=function(N){var V=this._create();for(var I in x)V._disabled[I]=N.templating.indexOf(I)===-1;return V._update(),V},U.prototype.exclude=function(N){var V=this._create();return V._excluded[N]=!0,V._update(),V},U.prototype.read=function(){var N="";this._match_pattern?N=this._input.read(this._starting_pattern):N=this._input.read(this._starting_pattern,this.__template_pattern);for(var V=this._read_template();V;)this._match_pattern?V+=this._input.read(this._match_pattern):V+=this._input.readUntil(this.__template_pattern),N+=V,V=this._read_template();return this._until_after&&(N+=this._input.readUntilAfter(this._until_pattern)),N},U.prototype.__set_templated_pattern=function(){var N=[];this._disabled.php||N.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||N.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||N.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||N.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(N.push(this.__patterns.django._starting_pattern.source),N.push(this.__patterns.django_value._starting_pattern.source),N.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||N.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&N.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+N.join("|")+")")},U.prototype._read_template=function(){var N="",V=this._input.peek();if(V==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(N=N||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(N=N||this.__patterns.erb.read())}else V==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(N=N||this.__patterns.handlebars_comment.read(),N=N||this.__patterns.handlebars_unescaped.read(),N=N||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(N=N||this.__patterns.django_value.read()),this._excluded.django||(N=N||this.__patterns.django_comment.read(),N=N||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(N=N||this.__patterns.smarty_comment.read(),N=N||this.__patterns.smarty_literal.read(),N=N||this.__patterns.smarty.read()));return N},T.exports.TemplatablePattern=U},,,,function(T,d,m){var y=m(19).Beautifier,x=m(20).Options;function U(N,V,I,L){var O=new y(N,V,I,L);return O.beautify()}T.exports=U,T.exports.defaultOptions=function(){return new x}},function(T,d,m){var y=m(20).Options,x=m(2).Output,U=m(21).Tokenizer,N=m(21).TOKEN,V=/\r\n|[\r\n]/,I=/\r\n|[\r\n]/g,L=function(K,R){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=K.max_preserve_newlines,this.preserve_newlines=K.preserve_newlines,this._output=new x(K,R)};L.prototype.current_line_has_match=function(K){return this._output.current_line.has_match(K)},L.prototype.set_space_before_token=function(K,R){this._output.space_before_token=K,this._output.non_breaking_space=R},L.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},L.prototype.add_raw_token=function(K){this._output.add_raw_token(K)},L.prototype.print_preserved_newlines=function(K){var R=0;K.type!==N.TEXT&&K.previous.type!==N.TEXT&&(R=K.newlines?1:0),this.preserve_newlines&&(R=K.newlines<this.max_preserve_newlines+1?K.newlines:this.max_preserve_newlines+1);for(var B=0;B<R;B++)this.print_newline(B>0);return R!==0},L.prototype.traverse_whitespace=function(K){return K.whitespace_before||K.newlines?(this.print_preserved_newlines(K)||(this._output.space_before_token=!0),!0):!1},L.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},L.prototype.print_newline=function(K){this._output.add_new_line(K)},L.prototype.print_token=function(K){K.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(K.text))},L.prototype.indent=function(){this.indent_level++},L.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},L.prototype.get_full_indent=function(K){return K=this.indent_level+(K||0),K<1?"":this._output.get_indent_string(K)};var O=function(K){for(var R=null,B=K.next;B.type!==N.EOF&&K.closed!==B;){if(B.type===N.ATTRIBUTE&&B.text==="type"){B.next&&B.next.type===N.EQUALS&&B.next.next&&B.next.next.type===N.VALUE&&(R=B.next.next.text);break}B=B.next}return R},z=function(K,R){var B=null,G=null;return R.closed?(K==="script"?B="text/javascript":K==="style"&&(B="text/css"),B=O(R)||B,B.search("text/css")>-1?G="css":B.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?G="javascript":B.search(/(text|application|dojo)\/(x-)?(html)/)>-1?G="html":B.search(/test\/null/)>-1&&(G="null"),G):null};function ee(K,R){return R.indexOf(K)!==-1}function re(K,R,B){this.parent=K||null,this.tag=R?R.tag_name:"",this.indent_level=B||0,this.parser_token=R||null}function J(K){this._printer=K,this._current_frame=null}J.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},J.prototype.record_tag=function(K){var R=new re(this._current_frame,K,this._printer.indent_level);this._current_frame=R},J.prototype._try_pop_frame=function(K){var R=null;return K&&(R=K.parser_token,this._printer.indent_level=K.indent_level,this._current_frame=K.parent),R},J.prototype._get_frame=function(K,R){for(var B=this._current_frame;B&&K.indexOf(B.tag)===-1;){if(R&&R.indexOf(B.tag)!==-1){B=null;break}B=B.parent}return B},J.prototype.try_pop=function(K,R){var B=this._get_frame([K],R);return this._try_pop_frame(B)},J.prototype.indent_to_tag=function(K){var R=this._get_frame(K);R&&(this._printer.indent_level=R.indent_level)};function X(K,R,B,G){this._source_text=K||"",R=R||{},this._js_beautify=B,this._css_beautify=G,this._tag_stack=null;var W=new y(R,"html");this._options=W,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"}X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var K=this._source_text,R=this._options.eol;this._options.eol==="auto"&&(R=`
|
|
`,K&&V.test(K)&&(R=K.match(V)[0])),K=K.replace(I,`
|
|
`);var B=K.match(/^[\t ]*/)[0],G={text:"",type:""},W=new xe(this._options),H=new L(this._options,B),_=new U(K,this._options).tokenize();this._tag_stack=new J(H);for(var v=null,C=_.next();C.type!==N.EOF;)C.type===N.TAG_OPEN||C.type===N.COMMENT?(v=this._handle_tag_open(H,C,W,G,_),W=v):C.type===N.ATTRIBUTE||C.type===N.EQUALS||C.type===N.VALUE||C.type===N.TEXT&&!W.tag_complete?v=this._handle_inside_tag(H,C,W,G):C.type===N.TAG_CLOSE?v=this._handle_tag_close(H,C,W):C.type===N.TEXT?v=this._handle_text(H,C,W):C.type===N.CONTROL_FLOW_OPEN?v=this._handle_control_flow_open(H,C):C.type===N.CONTROL_FLOW_CLOSE?v=this._handle_control_flow_close(H,C):H.add_raw_token(C),G=v,C=_.next();var Y=H._output.get_code(R);return Y},X.prototype._handle_control_flow_open=function(K,R){var B={text:R.text,type:R.type};return K.set_space_before_token(R.newlines||R.whitespace_before!=="",!0),R.newlines?K.print_preserved_newlines(R):K.set_space_before_token(R.newlines||R.whitespace_before!=="",!0),K.print_token(R),K.indent(),B},X.prototype._handle_control_flow_close=function(K,R){var B={text:R.text,type:R.type};return K.deindent(),R.newlines?K.print_preserved_newlines(R):K.set_space_before_token(R.newlines||R.whitespace_before!=="",!0),K.print_token(R),B},X.prototype._handle_tag_close=function(K,R,B){var G={text:R.text,type:R.type};return K.alignment_size=0,B.tag_complete=!0,K.set_space_before_token(R.newlines||R.whitespace_before!=="",!0),B.is_unformatted?K.add_raw_token(R):(B.tag_start_char==="<"&&(K.set_space_before_token(R.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&B.has_wrapped_attrs&&K.print_newline(!1)),K.print_token(R)),B.indent_content&&!(B.is_unformatted||B.is_content_unformatted)&&(K.indent(),B.indent_content=!1),!B.is_inline_element&&!(B.is_unformatted||B.is_content_unformatted)&&K.set_wrap_point(),G},X.prototype._handle_inside_tag=function(K,R,B,G){var W=B.has_wrapped_attrs,H={text:R.text,type:R.type};return K.set_space_before_token(R.newlines||R.whitespace_before!=="",!0),B.is_unformatted?K.add_raw_token(R):B.tag_start_char==="{"&&R.type===N.TEXT?K.print_preserved_newlines(R)?(R.newlines=0,K.add_raw_token(R)):K.print_token(R):(R.type===N.ATTRIBUTE?K.set_space_before_token(!0):(R.type===N.EQUALS||R.type===N.VALUE&&R.previous.type===N.EQUALS)&&K.set_space_before_token(!1),R.type===N.ATTRIBUTE&&B.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(K.traverse_whitespace(R),W=W||R.newlines!==0),this._is_wrap_attributes_force&&B.attr_count>=this._options.wrap_attributes_min_attrs&&(G.type!==N.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(K.print_newline(!1),W=!0)),K.print_token(R),W=W||K.previous_token_wrapped(),B.has_wrapped_attrs=W),H},X.prototype._handle_text=function(K,R,B){var G={text:R.text,type:"TK_CONTENT"};return B.custom_beautifier_name?this._print_custom_beatifier_text(K,R,B):B.is_unformatted||B.is_content_unformatted?K.add_raw_token(R):(K.traverse_whitespace(R),K.print_token(R)),G},X.prototype._print_custom_beatifier_text=function(K,R,B){var G=this;if(R.text!==""){var W=R.text,H,_=1,v="",C="";B.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?H=this._js_beautify:B.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?H=this._css_beautify:B.custom_beautifier_name==="html"&&(H=function(ot,dt){var Me=new X(ot,dt,G._js_beautify,G._css_beautify);return Me.beautify()}),this._options.indent_scripts==="keep"?_=0:this._options.indent_scripts==="separate"&&(_=-K.indent_level);var Y=K.get_full_indent(_);if(W=W.replace(/\n[ \t]*$/,""),B.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var Se=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!Se){K.add_raw_token(R);return}v=Y+Se[1]+`
|
|
`,W=Se[4],Se[5]&&(C=Y+Se[5]),W=W.replace(/\n[ \t]*$/,""),(Se[2]||Se[3].indexOf(`
|
|
`)!==-1)&&(Se=Se[3].match(/[ \t]+$/),Se&&(R.whitespace_before=Se[0]))}if(W)if(H){var Re=function(){this.eol=`
|
|
`};Re.prototype=this._options.raw_options;var Ye=new Re;W=H(Y+W,Ye)}else{var He=R.whitespace_before;He&&(W=W.replace(new RegExp(`
|
|
(`+He+")?","g"),`
|
|
`)),W=Y+W.replace(/\n/g,`
|
|
`+Y)}v&&(W?W=v+W+`
|
|
`+C:W=v+C),K.print_newline(!1),W&&(R.text=W,R.whitespace_before="",R.newlines=0,K.add_raw_token(R),K.print_newline(!0))}},X.prototype._handle_tag_open=function(K,R,B,G,W){var H=this._get_tag_open_token(R);if((B.is_unformatted||B.is_content_unformatted)&&!B.is_empty_element&&R.type===N.TAG_OPEN&&!H.is_start_tag?(K.add_raw_token(R),H.start_tag_token=this._tag_stack.try_pop(H.tag_name)):(K.traverse_whitespace(R),this._set_tag_position(K,R,H,B,G),H.is_inline_element||K.set_wrap_point(),K.print_token(R)),H.is_start_tag&&this._is_wrap_attributes_force){var _=0,v;do v=W.peek(_),v.type===N.ATTRIBUTE&&(H.attr_count+=1),_+=1;while(v.type!==N.EOF&&v.type!==N.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(H.alignment_size=R.text.length+1),!H.tag_complete&&!H.is_unformatted&&(K.alignment_size=H.alignment_size),H};var xe=function(K,R,B){if(this.parent=R||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="",!B)this.tag_complete=!0;else{var G;this.tag_start_char=B.text[0],this.text=B.text,this.tag_start_char==="<"?(G=B.text.match(/^<([^\s>]*)/),this.tag_check=G?G[1]:""):(G=B.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=G?G[1]:"",(B.text.startsWith("{{#>")||B.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&B.next!==null?this.tag_check=B.next.text.split(" ")[0]:this.tag_check=B.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),B.type===N.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||B.closed&&B.closed.text==="/>";var W=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(W=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!K.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(W)))}};X.prototype._get_tag_open_token=function(K){var R=new xe(this._options,this._tag_stack.get_parser_token(),K);return R.alignment_size=this._options.wrap_attributes_indent_size,R.is_end_tag=R.is_end_tag||ee(R.tag_check,this._options.void_elements),R.is_empty_element=R.tag_complete||R.is_start_tag&&R.is_end_tag,R.is_unformatted=!R.tag_complete&&ee(R.tag_check,this._options.unformatted),R.is_content_unformatted=!R.is_empty_element&&ee(R.tag_check,this._options.content_unformatted),R.is_inline_element=ee(R.tag_name,this._options.inline)||this._options.inline_custom_elements&&R.tag_name.includes("-")||R.tag_start_char==="{",R},X.prototype._set_tag_position=function(K,R,B,G,W){if(B.is_empty_element||(B.is_end_tag?B.start_tag_token=this._tag_stack.try_pop(B.tag_name):(this._do_optional_end_element(B)&&(B.is_inline_element||K.print_newline(!1)),this._tag_stack.record_tag(B),(B.tag_name==="script"||B.tag_name==="style")&&!(B.is_unformatted||B.is_content_unformatted)&&(B.custom_beautifier_name=z(B.tag_check,R)))),ee(B.tag_check,this._options.extra_liners)&&(K.print_newline(!1),K._output.just_added_blankline()||K.print_newline(!0)),B.is_empty_element){if(B.tag_start_char==="{"&&B.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),B.indent_content=!0;var H=K.current_line_has_match(/{{#if/);H||K.print_newline(!1)}B.tag_name==="!--"&&W.type===N.TAG_CLOSE&&G.is_end_tag&&B.text.indexOf(`
|
|
`)===-1||(B.is_inline_element||B.is_unformatted||K.print_newline(!1),this._calcluate_parent_multiline(K,B))}else if(B.is_end_tag){var _=!1;_=B.start_tag_token&&B.start_tag_token.multiline_content,_=_||!B.is_inline_element&&!(G.is_inline_element||G.is_unformatted)&&!(W.type===N.TAG_CLOSE&&B.start_tag_token===G)&&W.type!=="TK_CONTENT",(B.is_content_unformatted||B.is_unformatted)&&(_=!1),_&&K.print_newline(!1)}else B.indent_content=!B.custom_beautifier_name,B.tag_start_char==="<"&&(B.tag_name==="html"?B.indent_content=this._options.indent_inner_html:B.tag_name==="head"?B.indent_content=this._options.indent_head_inner_html:B.tag_name==="body"&&(B.indent_content=this._options.indent_body_inner_html)),!(B.is_inline_element||B.is_unformatted)&&(W.type!=="TK_CONTENT"||B.is_content_unformatted)&&K.print_newline(!1),this._calcluate_parent_multiline(K,B)},X.prototype._calcluate_parent_multiline=function(K,R){R.parent&&K._output.just_added_newline()&&!((R.is_inline_element||R.is_unformatted)&&R.parent.is_inline_element)&&(R.parent.multiline_content=!0)};var he=["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"],Ze=["a","audio","del","ins","map","noscript","video"];X.prototype._do_optional_end_element=function(K){var R=null;if(!(K.is_empty_element||!K.is_start_tag||!K.parent)){if(K.tag_name==="body")R=R||this._tag_stack.try_pop("head");else if(K.tag_name==="li")R=R||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(K.tag_name==="dd"||K.tag_name==="dt")R=R||this._tag_stack.try_pop("dt",["dl"]),R=R||this._tag_stack.try_pop("dd",["dl"]);else if(K.parent.tag_name==="p"&&he.indexOf(K.tag_name)!==-1){var B=K.parent.parent;(!B||Ze.indexOf(B.tag_name)===-1)&&(R=R||this._tag_stack.try_pop("p"))}else K.tag_name==="rp"||K.tag_name==="rt"?(R=R||this._tag_stack.try_pop("rt",["ruby","rtc"]),R=R||this._tag_stack.try_pop("rp",["ruby","rtc"])):K.tag_name==="optgroup"?R=R||this._tag_stack.try_pop("optgroup",["select"]):K.tag_name==="option"?R=R||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):K.tag_name==="colgroup"?R=R||this._tag_stack.try_pop("caption",["table"]):K.tag_name==="thead"?(R=R||this._tag_stack.try_pop("caption",["table"]),R=R||this._tag_stack.try_pop("colgroup",["table"])):K.tag_name==="tbody"||K.tag_name==="tfoot"?(R=R||this._tag_stack.try_pop("caption",["table"]),R=R||this._tag_stack.try_pop("colgroup",["table"]),R=R||this._tag_stack.try_pop("thead",["table"]),R=R||this._tag_stack.try_pop("tbody",["table"])):K.tag_name==="tr"?(R=R||this._tag_stack.try_pop("caption",["table"]),R=R||this._tag_stack.try_pop("colgroup",["table"]),R=R||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(K.tag_name==="th"||K.tag_name==="td")&&(R=R||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),R=R||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return K.parent=this._tag_stack.get_parser_token(),R}},T.exports.Beautifier=X},function(T,d,m){var y=m(6).Options;function x(U){y.call(this,U,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}x.prototype=new y,T.exports.Options=x},function(T,d,m){var y=m(9).Tokenizer,x=m(9).TOKEN,U=m(13).Directives,N=m(14).TemplatablePattern,V=m(12).Pattern,I={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:x.START,RAW:x.RAW,EOF:x.EOF},L=new U(/<\!--/,/-->/),O=function(z,ee){y.call(this,z,ee),this._current_tag_name="";var re=new N(this._input).read_options(this._options),J=new V(this._input);if(this.__patterns={word:re.until(/[\n\r\t <]/),word_control_flow_close_excluded:re.until(/[\n\r\t <}]/),single_quote:re.until_after(/'/),double_quote:re.until_after(/"/),attribute:re.until(/[\n\r\t =>]|\/>/),element_name:re.until(/[\n\r\t >\/]/),angular_control_flow_start:J.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:J.starting_with(/{{!--/).until_after(/--}}/),handlebars:J.starting_with(/{{/).until_after(/}}/),handlebars_open:J.until(/[\n\r\t }]/),handlebars_raw_close:J.until(/}}/),comment:J.starting_with(/<!--/).until_after(/-->/),cdata:J.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:J.starting_with(/<!\[/).until_after(/]>/),processing:J.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 X=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=J.matching(X).until_after(X)}};O.prototype=new y,O.prototype._is_comment=function(z){return!1},O.prototype._is_opening=function(z){return z.type===I.TAG_OPEN||z.type===I.CONTROL_FLOW_OPEN},O.prototype._is_closing=function(z,ee){return z.type===I.TAG_CLOSE&&ee&&((z.text===">"||z.text==="/>")&&ee.text[0]==="<"||z.text==="}}"&&ee.text[0]==="{"&&ee.text[1]==="{")||z.type===I.CONTROL_FLOW_CLOSE&&z.text==="}"&&ee.text.endsWith("{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(z,ee){var re=null;this._readWhitespace();var J=this._input.peek();return J===null?this._create_token(I.EOF,""):(re=re||this._read_open_handlebars(J,ee),re=re||this._read_attribute(J,z,ee),re=re||this._read_close(J,ee),re=re||this._read_script_and_style(J,z),re=re||this._read_control_flows(J,ee),re=re||this._read_raw_content(J,z,ee),re=re||this._read_content_word(J,ee),re=re||this._read_comment_or_cdata(J),re=re||this._read_processing(J),re=re||this._read_open(J,ee),re=re||this._create_token(I.UNKNOWN,this._input.next()),re)},O.prototype._read_comment_or_cdata=function(z){var ee=null,re=null,J=null;if(z==="<"){var X=this._input.peek(1);X==="!"&&(re=this.__patterns.comment.read(),re?(J=L.get_directives(re),J&&J.ignore==="start"&&(re+=L.readIgnored(this._input))):re=this.__patterns.cdata.read()),re&&(ee=this._create_token(I.COMMENT,re),ee.directives=J)}return ee},O.prototype._read_processing=function(z){var ee=null,re=null,J=null;if(z==="<"){var X=this._input.peek(1);(X==="!"||X==="?")&&(re=this.__patterns.conditional_comment.read(),re=re||this.__patterns.processing.read()),re&&(ee=this._create_token(I.COMMENT,re),ee.directives=J)}return ee},O.prototype._read_open=function(z,ee){var re=null,J=null;return(!ee||ee.type===I.CONTROL_FLOW_OPEN)&&z==="<"&&(re=this._input.next(),this._input.peek()==="/"&&(re+=this._input.next()),re+=this.__patterns.element_name.read(),J=this._create_token(I.TAG_OPEN,re)),J},O.prototype._read_open_handlebars=function(z,ee){var re=null,J=null;return(!ee||ee.type===I.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&z==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(re=this.__patterns.handlebars_comment.read(),re=re||this.__patterns.handlebars.read(),J=this._create_token(I.COMMENT,re)):(re=this.__patterns.handlebars_open.read(),J=this._create_token(I.TAG_OPEN,re))),J},O.prototype._read_control_flows=function(z,ee){var re="",J=null;if(!this._options.templating.includes("angular"))return J;if(z==="@"){if(re=this.__patterns.angular_control_flow_start.read(),re==="")return J;for(var X=re.endsWith("(")?1:0,xe=0;!(re.endsWith("{")&&X===xe);){var he=this._input.next();if(he===null)break;he==="("?X++:he===")"&&xe++,re+=he}J=this._create_token(I.CONTROL_FLOW_OPEN,re)}else z==="}"&&ee&&ee.type===I.CONTROL_FLOW_OPEN&&(re=this._input.next(),J=this._create_token(I.CONTROL_FLOW_CLOSE,re));return J},O.prototype._read_close=function(z,ee){var re=null,J=null;return ee&&ee.type===I.TAG_OPEN&&(ee.text[0]==="<"&&(z===">"||z==="/"&&this._input.peek(1)===">")?(re=this._input.next(),z==="/"&&(re+=this._input.next()),J=this._create_token(I.TAG_CLOSE,re)):ee.text[0]==="{"&&z==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),J=this._create_token(I.TAG_CLOSE,"}}"))),J},O.prototype._read_attribute=function(z,ee,re){var J=null,X="";if(re&&re.text[0]==="<")if(z==="=")J=this._create_token(I.EQUALS,this._input.next());else if(z==='"'||z==="'"){var xe=this._input.next();z==='"'?xe+=this.__patterns.double_quote.read():xe+=this.__patterns.single_quote.read(),J=this._create_token(I.VALUE,xe)}else X=this.__patterns.attribute.read(),X&&(ee.type===I.EQUALS?J=this._create_token(I.VALUE,X):J=this._create_token(I.ATTRIBUTE,X));return J},O.prototype._is_content_unformatted=function(z){return this._options.void_elements.indexOf(z)===-1&&(this._options.content_unformatted.indexOf(z)!==-1||this._options.unformatted.indexOf(z)!==-1)},O.prototype._read_raw_content=function(z,ee,re){var J="";if(re&&re.text[0]==="{")J=this.__patterns.handlebars_raw_close.read();else if(ee.type===I.TAG_CLOSE&&ee.opened.text[0]==="<"&&ee.text[0]!=="/"){var X=ee.opened.text.substr(1).toLowerCase();this._is_content_unformatted(X)&&(J=this._input.readUntil(new RegExp("</"+X+"[\\n\\r\\t ]*?>","ig")))}return J?this._create_token(I.TEXT,J):null},O.prototype._read_script_and_style=function(z,ee){if(ee.type===I.TAG_CLOSE&&ee.opened.text[0]==="<"&&ee.text[0]!=="/"){var re=ee.opened.text.substr(1).toLowerCase();if(re==="script"||re==="style"){var J=this._read_comment_or_cdata(z);if(J)return J.type=I.TEXT,J;var X=this._input.readUntil(new RegExp("</"+re+"[\\n\\r\\t ]*?>","ig"));if(X)return this._create_token(I.TEXT,X)}}return null},O.prototype._read_content_word=function(z,ee){var re="";return this._options.unformatted_content_delimiter&&z===this._options.unformatted_content_delimiter[0]&&(re=this.__patterns.unformatted_content_delimiter.read()),re||(re=ee&&ee.type===I.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),re?this._create_token(I.TEXT,re):null},T.exports.Tokenizer=O,T.exports.TOKEN=I}],q={};function l(T){var d=q[T];if(d!==void 0)return d.exports;var m=q[T]={exports:{}};return oe[T](m,m.exports,l),m.exports}var S=l(18);Ae=S})();var ne=Ae;if(1)A=[k,k(58553),k(87804)],ue=function(oe){var q=k(58553),l=k(87804);return{html_beautify:function(S,T){return ne(S,T,q.js_beautify,l.css_beautify)}}}.apply(St,A),ue!==void 0&&(bn.exports=ue);else var F,g})()},58553:function(bn,St){var k,A;(function(){var ue;(function(){"use strict";var ne=[function(q,l,S){var T=S(1).Beautifier,d=S(5).Options;function m(y,x){var U=new T(y,x);return U.beautify()}q.exports=m,q.exports.defaultOptions=function(){return new d}},function(q,l,S){var T=S(2).Output,d=S(3).Token,m=S(4),y=S(5).Options,x=S(7).Tokenizer,U=S(7).line_starters,N=S(7).positionable_operators,V=S(7).TOKEN;function I(v,C){return C.indexOf(v)!==-1}function L(v){return v.replace(/^\s+/g,"")}function O(v){for(var C={},Y=0;Y<v.length;Y++)C[v[Y].replace(/-/g,"_")]=v[Y];return C}function z(v,C){return v&&v.type===V.RESERVED&&v.text===C}function ee(v,C){return v&&v.type===V.RESERVED&&I(v.text,C)}var re=["case","return","do","if","throw","else","await","break","continue","async"],J=["before-newline","after-newline","preserve-newline"],X=O(J),xe=[X.before_newline,X.preserve_newline],he={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Ze(v,C){C.multiline_frame||C.mode===he.ForInitializer||C.mode===he.Conditional||v.remove_indent(C.start_line_index)}function K(v){v=v.replace(m.allLineBreaks,`
|
|
`);for(var C=[],Y=v.indexOf(`
|
|
`);Y!==-1;)C.push(v.substring(0,Y)),v=v.substring(Y+1),Y=v.indexOf(`
|
|
`);return v.length&&C.push(v),C}function R(v){return v===he.ArrayLiteral}function B(v){return I(v,[he.Expression,he.ForInitializer,he.Conditional])}function G(v,C){for(var Y=0;Y<v.length;Y++){var Se=v[Y].trim();if(Se.charAt(0)!==C)return!1}return!0}function W(v,C){for(var Y=0,Se=v.length,Re;Y<Se;Y++)if(Re=v[Y],Re&&Re.indexOf(C)!==0)return!1;return!0}function H(v,C){C=C||{},this._source_text=v||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(C)}H.prototype.create_flags=function(v,C){var Y=0;v&&(Y=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>Y&&(Y=v.line_indent_level));var Se={mode:C,parent:v,last_token:v?v.last_token:new d(V.START_BLOCK,""),last_word:v?v.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:v?v.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return Se},H.prototype._reset=function(v){var C=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new T(this._options,C),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(he.BlockStatement);var Y=new x(v,this._options);return this._tokens=Y.tokenize(),v},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,C=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
|
|
`,C&&m.lineBreak.test(C||"")&&(Y=C.match(m.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 v=this._output.get_code(Y),v},H.prototype.handle_token=function(v,C){v.type===V.START_EXPR?this.handle_start_expr(v):v.type===V.END_EXPR?this.handle_end_expr(v):v.type===V.START_BLOCK?this.handle_start_block(v):v.type===V.END_BLOCK?this.handle_end_block(v):v.type===V.WORD?this.handle_word(v):v.type===V.RESERVED?this.handle_word(v):v.type===V.SEMICOLON?this.handle_semicolon(v):v.type===V.STRING?this.handle_string(v):v.type===V.EQUALS?this.handle_equals(v):v.type===V.OPERATOR?this.handle_operator(v):v.type===V.COMMA?this.handle_comma(v):v.type===V.BLOCK_COMMENT?this.handle_block_comment(v,C):v.type===V.COMMENT?this.handle_comment(v,C):v.type===V.DOT?this.handle_dot(v):v.type===V.EOF?this.handle_eof(v):v.type===V.UNKNOWN?this.handle_unknown(v,C):this.handle_unknown(v,C)},H.prototype.handle_whitespace_and_comments=function(v,C){var Y=v.newlines,Se=this._options.keep_array_indentation&&R(this._flags.mode);if(v.comments_before)for(var Re=v.comments_before.next();Re;)this.handle_whitespace_and_comments(Re,C),this.handle_token(Re,C),Re=v.comments_before.next();if(Se)for(var Ye=0;Ye<Y;Ye+=1)this.print_newline(Ye>0,C);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,C);for(var He=1;He<Y;He+=1)this.print_newline(!0,C)}};var _=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(v,C){if(C=C===void 0?!1:C,!this._output.just_added_newline()){var Y=this._options.preserve_newlines&&v.newlines||C,Se=I(this._flags.last_token.text,N)||I(v.text,N);if(Se){var Re=I(this._flags.last_token.text,N)&&I(this._options.operator_position,xe)||I(v.text,N);Y=Y&&Re}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(ee(this._flags.last_token,_))return;this._output.set_wrap_point()}}},H.prototype.print_newline=function(v,C){if(!C&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==V.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var Y=this._tokens.peek();this._flags.mode===he.Statement&&!(this._flags.if_block&&z(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||R(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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))},H.prototype.print_token=function(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===V.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var C=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(C),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.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))},H.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===he.Statement&&Ze(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===he.ObjectLiteral&&this._flags.mode===he.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ee(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(v){var C=!1;return C=C||ee(this._flags.last_token,["var","let","const"])&&v.type===V.WORD,C=C||z(this._flags.last_token,"do"),C=C||!(this._flags.parent.mode===he.ObjectLiteral&&this._flags.mode===he.Statement)&&ee(this._flags.last_token,_)&&!v.newlines,C=C||z(this._flags.last_token,"else")&&!(z(v,"if")&&!v.comments_before),C=C||this._flags.last_token.type===V.END_EXPR&&(this._previous_flags.mode===he.ForInitializer||this._previous_flags.mode===he.Conditional),C=C||this._flags.last_token.type===V.WORD&&this._flags.mode===he.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==V.WORD&&v.type!==V.RESERVED,C=C||this._flags.mode===he.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||ee(this._flags.last_token,["get","set"])),C?(this.set_mode(he.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,ee(v,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var C=he.Expression;if(v.text==="["){if(this._flags.last_token.type===V.WORD||this._flags.last_token.text===")"){ee(this._flags.last_token,U)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(C),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}C=he.ArrayLiteral,R(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()),I(this._flags.last_token.type,[V.START_EXPR,V.END_EXPR,V.WORD,V.OPERATOR,V.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===V.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,C=he.ForInitializer):I(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,C=he.Conditional):I(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(I(this._flags.last_token.text,U)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===V.EQUALS||this._flags.last_token.type===V.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===V.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var Se=this._tokens.peek(-4);ee(Y,["async","function"])||Y.text==="*"&&ee(Se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===he.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.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(v);(this._flags.last_token.type===V.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===he.ObjectLiteral&&I(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===V.START_BLOCK?this.print_newline():(this._flags.last_token.type===V.END_EXPR||this._flags.last_token.type===V.START_EXPR||this._flags.last_token.type===V.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===V.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(C),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(v){for(;this._flags.mode===he.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&R(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===V.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(v),this.restore_mode(),Ze(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===he.Conditional&&(this._previous_flags.mode=he.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var C=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===V.END_EXPR?(this.set_mode(he.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(he.BlockStatement):Y&&(I(Y.text,[":",","])&&I(C.type,[V.STRING,V.WORD,V.RESERVED])||I(C.text,["get","set","..."])&&I(Y.type,[V.WORD,V.RESERVED]))?I(this._last_last_text,["class","interface"])&&!I(Y.text,[":",","])?this.set_mode(he.BlockStatement):this.set_mode(he.ObjectLiteral):this._flags.last_token.type===V.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(he.BlockStatement):I(this._flags.last_token.type,[V.EQUALS,V.START_EXPR,V.COMMA,V.OPERATOR])||ee(this._flags.last_token,["return","throw","import","default"])?this.set_mode(he.ObjectLiteral):this.set_mode(he.BlockStatement),this._flags.last_token&&ee(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Se=!C.comments_before&&C.text==="}",Re=Se&&this._flags.last_word==="function"&&this._flags.last_token.type===V.END_EXPR;if(this._options.brace_preserve_inline){var Ye=0,He=null;this._flags.inline_frame=!0;do if(Ye+=1,He=this._tokens.peek(Ye-1),He.newlines){this._flags.inline_frame=!1;break}while(He.type!==V.EOF&&!(He.type===V.END_BLOCK&&He.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==V.OPERATOR&&(Re||this._flags.last_token.type===V.EQUALS||ee(this._flags.last_token,re)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(R(this._previous_flags.mode)&&(this._flags.last_token.type===V.START_EXPR||this._flags.last_token.type===V.COMMA)&&((this._flags.last_token.type===V.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===V.COMMA||this._flags.last_token.type===V.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==V.OPERATOR&&this._flags.last_token.type!==V.START_EXPR&&(I(this._flags.last_token.type,[V.START_BLOCK,V.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!Se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===he.Statement;)this.restore_mode();var C=this._flags.last_token.type===V.START_BLOCK;this._flags.inline_frame&&!C?this._output.space_before_token=!0:this._options.brace_style==="expand"?C||this.print_newline():C||(R(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(v)},H.prototype.handle_word=function(v){if(v.type===V.RESERVED){if(I(v.text,["set","get"])&&this._flags.mode!==he.ObjectLiteral)v.type=V.WORD;else if(v.text==="import"&&I(this._tokens.peek().text,["(","."]))v.type=V.WORD;else if(I(v.text,["as","from"])&&!this._flags.import_block)v.type=V.WORD;else if(this._flags.mode===he.ObjectLiteral){var C=this._tokens.peek();C.text===":"&&(v.type=V.WORD)}}if(this.start_of_statement(v)?ee(this._flags.last_token,["var","let","const"])&&v.type===V.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==V.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==V.EQUALS&&(this._options.preserve_newlines||!ee(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(z(v,"while")){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&z(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===he.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&ee(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===V.COMMA||this._flags.last_token.type===V.START_EXPR||this._flags.last_token.type===V.EQUALS||this._flags.last_token.type===V.OPERATOR)&&!this.start_of_object_property()&&!(I(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===he.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(v),z(v,"function")){(I(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(I(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===V.OPERATOR))&&!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===V.RESERVED||this._flags.last_token.type===V.WORD?ee(this._flags.last_token,["get","set","new","export"])||ee(this._flags.last_token,_)?this._output.space_before_token=!0:z(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===V.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||R(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var Y="NONE";if(this._flags.last_token.type===V.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":ee(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===V.SEMICOLON&&this._flags.mode===he.BlockStatement?Y="NEWLINE":this._flags.last_token.type===V.SEMICOLON&&B(this._flags.mode)?Y="SPACE":this._flags.last_token.type===V.STRING?Y="NEWLINE":this._flags.last_token.type===V.RESERVED||this._flags.last_token.type===V.WORD||this._flags.last_token.text==="*"&&(I(this._last_last_text,["function","yield"])||this._flags.mode===he.ObjectLiteral&&I(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===V.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===V.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),ee(v,U)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),ee(v,["else","catch","finally"]))if((!(this._flags.last_token.type===V.END_BLOCK&&this._previous_flags.mode===he.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.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 Y==="NEWLINE"?ee(this._flags.last_token,re)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&ee(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==V.END_EXPR?(this._flags.last_token.type!==V.START_EXPR||!ee(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(z(v,"if")&&z(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):ee(v,U)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&R(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===V.WORD||v.previous.type===V.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===V.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&z(v,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var C=this._tokens.peek();this._flags.mode===he.Statement&&!(this._flags.if_block&&z(C,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},H.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===V.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===V.RESERVED||this._flags.last_token.type===V.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===V.COMMA||this._flags.last_token.type===V.START_EXPR||this._flags.last_token.type===V.EQUALS||this._flags.last_token.type===V.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===V.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},H.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},H.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(B(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(v)):this._flags.mode===he.ObjectLiteral||this._flags.mode===he.Statement&&this._flags.parent.mode===he.ObjectLiteral?(this._flags.mode===he.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},H.prototype.handle_operator=function(v){var C=v.text==="*"&&(ee(this._flags.last_token,["function","yield"])||I(this._flags.last_token.type,[V.START_BLOCK,V.COMMA,V.END_BLOCK,V.SEMICOLON])),Y=I(v.text,["-","+"])&&(I(this._flags.last_token.type,[V.START_BLOCK,V.START_EXPR,V.EQUALS,V.OPERATOR])||I(this._flags.last_token.text,U)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var Se=!C;this.handle_whitespace_and_comments(v,Se)}if(v.text==="*"&&this._flags.last_token.type===V.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(I(v.text,["-","+"])&&this.start_of_object_property()){this.print_token(v);return}if(this._flags.last_token.type===V.OPERATOR&&I(this._options.operator_position,xe)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==V.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 Re=!0,Ye=!0,He=!1;if(v.text===":"?this._flags.ternary_depth===0?Re=!1:(this._flags.ternary_depth-=1,He=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!C&&this._options.preserve_newlines&&I(v.text,N)){var ot=v.text===":",dt=ot&&He,Me=ot&&!He;switch(this._options.operator_position){case X.before_newline:this._output.space_before_token=!Me,this.print_token(v),(!ot||dt)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case X.after_newline:this._output.space_before_token=!0,!ot||dt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case X.preserve_newline:Me||this.allow_wrap_or_preserved_newline(v),Re=!(this._output.just_added_newline()||Me),this._output.space_before_token=Re,this.print_token(v),this._output.space_before_token=!0;return}}if(C){this.allow_wrap_or_preserved_newline(v),Re=!1;var ht=this._tokens.peek();Ye=ht&&I(ht.type,[V.WORD,V.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),Re=this._flags.last_token.type===V.START_BLOCK,Ye=!1;else if(I(v.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===V.COMMA||this._flags.last_token.type===V.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),Re=!1,Ye=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var Oe=ee(this._flags.last_token,re)&&v.newlines;Oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Oe,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(Re=!0),this._flags.last_token.type===V.RESERVED?Re=!0:this._flags.last_token.type===V.END_EXPR?Re=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===V.OPERATOR&&(Re=I(v.text,["--","-","++","+"])&&I(this._flags.last_token.text,["--","-","++","+"]),I(v.text,["+","-"])&&I(this._flags.last_token.text,["--","++"])&&(Ye=!0)),(this._flags.mode===he.BlockStatement&&!this._flags.inline_frame||this._flags.mode===he.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Re,this.print_token(v),this._output.space_before_token=Ye},H.prototype.handle_block_comment=function(v,C){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,C),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,C)},H.prototype.print_block_commment=function(v,C){var Y=K(v.text),Se,Re=!1,Ye=!1,He=v.whitespace_before,ot=He.length;if(this.print_newline(!1,C),this.print_token_line_indentation(v),this._output.add_token(Y[0]),this.print_newline(!1,C),Y.length>1){for(Y=Y.slice(1),Re=G(Y,"*"),Ye=W(Y,He),Re&&(this._flags.alignment=1),Se=0;Se<Y.length;Se++)Re?(this.print_token_line_indentation(v),this._output.add_token(L(Y[Se]))):Ye&&Y[Se]?(this.print_token_line_indentation(v),this._output.add_token(Y[Se].substring(ot))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[Se])),this.print_newline(!1,C);this._flags.alignment=0}},H.prototype.handle_comment=function(v,C){v.newlines?this.print_newline(!1,C):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,C)},H.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),ee(this._flags.last_token,re)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},H.prototype.handle_unknown=function(v,C){this.print_token(v),v.text[v.text.length-1]===`
|
|
`&&this.print_newline(!1,C)},H.prototype.handle_eof=function(v){for(;this._flags.mode===he.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},q.exports.Beautifier=H},function(q){function l(d){this.__parent=d,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var d=new l(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},l.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},l.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},l.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
|
|
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},l.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function S(d,m){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}S.prototype.get_indent_size=function(d,m){var y=this.__base_string_length;return m=m||0,d<0&&(y=0),y+=d*this.__indent_size,y+=m,y},S.prototype.get_indent_string=function(d,m){var y=this.__base_string;return m=m||0,d<0&&(d=0,y=""),m+=d*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},S.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},S.prototype.__add_column=function(){var d=this.__cache.length,m=0,y="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),d&&(y+=new Array(d+1).join(" ")),this.__cache.push(y)};function T(d,m){this.__indent_cache=new S(d,m),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}T.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},T.prototype.get_line_number=function(){return this.__lines.length},T.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},T.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},T.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},T.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},T.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
|
|
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(y=y.replace(/[\n]/g,d)),y},T.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},T.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},T.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},T.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},T.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(" "))},T.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},T.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},T.prototype.just_added_newline=function(){return this.current_line.is_empty()},T.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},T.prototype.ensure_empty_line_above=function(d,m){for(var y=this.__lines.length-2;y>=0;){var x=this.__lines[y];if(x.is_empty())break;if(x.item(0).indexOf(d)!==0&&x.item(-1)!==m){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},q.exports.Output=T},function(q){function l(S,T,d,m){this.type=S,this.text=T,this.comments_before=null,this.newlines=d||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}q.exports.Token=l},function(q,l){var S="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",T="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",m="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",x="(?:"+y+"|["+S+d+"])",U="(?:"+y+"|["+T+d+m+"])*";l.identifier=new RegExp(x+U,"g"),l.identifierStart=new RegExp(x),l.identifierMatch=new RegExp("(?:"+y+"|["+T+d+m+"])+");var N=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;l.newline=/[\n\r\u2028\u2029]/,l.lineBreak=new RegExp(`\r
|
|
|`+l.newline.source),l.allLineBreaks=new RegExp(l.lineBreak.source,"g")},function(q,l,S){var T=S(6).Options,d=["before-newline","after-newline","preserve-newline"];function m(y){T.call(this,y,"js");var x=this.raw_options.brace_style||null;x==="expand-strict"?this.raw_options.brace_style="expand":x==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var U=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var N=0;N<U.length;N++)U[N]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=U[N];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",d),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}m.prototype=new T,q.exports.Options=m},function(q){function l(d,m){this.raw_options=S(d,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(d,m){var y=this.raw_options[d],x=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(x=y.concat()):typeof y=="string"&&(x=y.split(/[^a-zA-Z0-9_\/\-]+/)),x},l.prototype._get_boolean=function(d,m){var y=this.raw_options[d],x=y===void 0?!!m:!!y;return x},l.prototype._get_characters=function(d,m){var y=this.raw_options[d],x=m||"";return typeof y=="string"&&(x=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),x},l.prototype._get_number=function(d,m){var y=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var x=parseInt(y,10);return isNaN(x)&&(x=m),x},l.prototype._get_selection=function(d,m,y){var x=this._get_selection_list(d,m,y);if(x.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x[0]},l.prototype._get_selection_list=function(d,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var x=this._get_array(d,y);if(!this._is_valid_selection(x,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+m+`
|
|
You passed in: '`+this.raw_options[d]+"'");return x},l.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(y){return m.indexOf(y)===-1})};function S(d,m){var y={};d=T(d);var x;for(x in d)x!==m&&(y[x]=d[x]);if(m&&d[m])for(x in d[m])y[x]=d[m][x];return y}function T(d){var m={},y;for(y in d){var x=y.replace(/-/g,"_");m[x]=d[y]}return m}q.exports.Options=l,q.exports.normalizeOpts=T,q.exports.mergeOpts=S},function(q,l,S){var T=S(8).InputScanner,d=S(9).Tokenizer,m=S(9).TOKEN,y=S(13).Directives,x=S(4),U=S(12).Pattern,N=S(14).TemplatablePattern;function V(G,W){return W.indexOf(G)!==-1}var I={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:m.START,RAW:m.RAW,EOF:m.EOF},L=new y(/\/\*/,/\*\//),O=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,z=/[0-9]/,ee=/[^\d\.]/,re=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),J=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";J=J.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),J="\\?\\.(?!\\d) "+J,J=J.replace(/ /g,"|");var X=new RegExp(J),xe="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),he=xe.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Ze=new RegExp("^(?:"+he.join("|")+")$"),K,R=function(G,W){d.call(this,G,W),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new U(this._input),_=new N(this._input).read_options(this._options);this.__patterns={template:_,identifier:_.starting_with(x.identifier).matching(x.identifierMatch),number:H.matching(O),punct:H.matching(X),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(x.lineBreak),shebang:H.starting_with(/#!/).until_after(x.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:_.until(/['\\\n\r\u2028\u2029]/),double_quote:_.until(/["\\\n\r\u2028\u2029]/),template_text:_.until(/[`\\$]/),template_expression:_.until(/[`}\\]/)}};R.prototype=new d,R.prototype._is_comment=function(G){return G.type===I.COMMENT||G.type===I.BLOCK_COMMENT||G.type===I.UNKNOWN},R.prototype._is_opening=function(G){return G.type===I.START_BLOCK||G.type===I.START_EXPR},R.prototype._is_closing=function(G,W){return(G.type===I.END_BLOCK||G.type===I.END_EXPR)&&W&&(G.text==="]"&&W.text==="["||G.text===")"&&W.text==="("||G.text==="}"&&W.text==="{")},R.prototype._reset=function(){K=!1},R.prototype._get_next_token=function(G,W){var H=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(I.EOF,""):(H=H||this._read_non_javascript(_),H=H||this._read_string(_),H=H||this._read_pair(_,this._input.peek(1)),H=H||this._read_word(G),H=H||this._read_singles(_),H=H||this._read_comment(_),H=H||this._read_regexp(_,G),H=H||this._read_xml(_,G),H=H||this._read_punctuation(),H=H||this._create_token(I.UNKNOWN,this._input.next()),H)},R.prototype._read_word=function(G){var W;if(W=this.__patterns.identifier.read(),W!=="")return W=W.replace(x.allLineBreaks,`
|
|
`),!(G.type===I.DOT||G.type===I.RESERVED&&(G.text==="set"||G.text==="get"))&&Ze.test(W)?(W==="in"||W==="of")&&(G.type===I.WORD||G.type===I.STRING)?this._create_token(I.OPERATOR,W):this._create_token(I.RESERVED,W):this._create_token(I.WORD,W);if(W=this.__patterns.number.read(),W!=="")return this._create_token(I.WORD,W)},R.prototype._read_singles=function(G){var W=null;return G==="("||G==="["?W=this._create_token(I.START_EXPR,G):G===")"||G==="]"?W=this._create_token(I.END_EXPR,G):G==="{"?W=this._create_token(I.START_BLOCK,G):G==="}"?W=this._create_token(I.END_BLOCK,G):G===";"?W=this._create_token(I.SEMICOLON,G):G==="."&&ee.test(this._input.peek(1))?W=this._create_token(I.DOT,G):G===","&&(W=this._create_token(I.COMMA,G)),W&&this._input.next(),W},R.prototype._read_pair=function(G,W){var H=null;return G==="#"&&W==="{"&&(H=this._create_token(I.START_BLOCK,G+W)),H&&(this._input.next(),this._input.next()),H},R.prototype._read_punctuation=function(){var G=this.__patterns.punct.read();if(G!=="")return G==="="?this._create_token(I.EQUALS,G):G==="?."?this._create_token(I.DOT,G):this._create_token(I.OPERATOR,G)},R.prototype._read_non_javascript=function(G){var W="";if(G==="#"){if(this._is_first_token()&&(W=this.__patterns.shebang.read(),W))return this._create_token(I.UNKNOWN,W.trim()+`
|
|
`);if(W=this.__patterns.include.read(),W)return this._create_token(I.UNKNOWN,W.trim()+`
|
|
`);G=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(z)){do G=this._input.next(),H+=G;while(this._input.hasNext()&&G!=="#"&&G!=="=");return G==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(I.WORD,H)}this._input.back()}else if(G==="<"&&this._is_first_token()){if(W=this.__patterns.html_comment_start.read(),W){for(;this._input.hasNext()&&!this._input.testChar(x.newline);)W+=this._input.next();return K=!0,this._create_token(I.COMMENT,W)}}else if(K&&G==="-"&&(W=this.__patterns.html_comment_end.read(),W))return K=!1,this._create_token(I.COMMENT,W);return null},R.prototype._read_comment=function(G){var W=null;if(G==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var _=L.get_directives(H);_&&_.ignore==="start"&&(H+=L.readIgnored(this._input)),H=H.replace(x.allLineBreaks,`
|
|
`),W=this._create_token(I.BLOCK_COMMENT,H),W.directives=_}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),W=this._create_token(I.COMMENT,H))}return W},R.prototype._read_string=function(G){if(G==="`"||G==="'"||G==='"'){var W=this._input.next();return this.has_char_escapes=!1,G==="`"?W+=this._read_string_recursive("`",!0,"${"):W+=this._read_string_recursive(G),this.has_char_escapes&&this._options.unescape_strings&&(W=B(W)),this._input.peek()===G&&(W+=this._input.next()),W=W.replace(x.allLineBreaks,`
|
|
`),this._create_token(I.STRING,W)}return null},R.prototype._allow_regexp_or_xml=function(G){return G.type===I.RESERVED&&V(G.text,["return","case","throw","else","do","typeof","yield"])||G.type===I.END_EXPR&&G.text===")"&&G.opened.previous.type===I.RESERVED&&V(G.opened.previous.text,["if","while","for"])||V(G.type,[I.COMMENT,I.START_EXPR,I.START_BLOCK,I.START,I.END_BLOCK,I.OPERATOR,I.EQUALS,I.EOF,I.SEMICOLON,I.COMMA])},R.prototype._read_regexp=function(G,W){if(G==="/"&&this._allow_regexp_or_xml(W)){for(var H=this._input.next(),_=!1,v=!1;this._input.hasNext()&&(_||v||this._input.peek()!==G)&&!this._input.testChar(x.newline);)H+=this._input.peek(),_?_=!1:(_=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===G&&(H+=this._input.next(),H+=this._input.read(x.identifier)),this._create_token(I.STRING,H)}return null},R.prototype._read_xml=function(G,W){if(this._options.e4x&&G==="<"&&this._allow_regexp_or_xml(W)){var H="",_=this.__patterns.xml.read_match();if(_){for(var v=_[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),C=v.indexOf("{")===0,Y=0;_;){var Se=!!_[1],Re=_[2],Ye=!!_[_.length-1]||Re.slice(0,8)==="![CDATA[";if(!Ye&&(Re===v||C&&Re.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Se?--Y:++Y),H+=_[0],Y<=0)break;_=this.__patterns.xml.read_match()}return _||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(x.allLineBreaks,`
|
|
`),this._create_token(I.STRING,H)}}return null};function B(G){for(var W="",H=0,_=new T(G),v=null;_.hasNext();)if(v=_.match(/([\s]|[^\\]|\\\\)+/g),v&&(W+=v[0]),_.peek()==="\\"){if(_.next(),_.peek()==="x")v=_.match(/x([0-9A-Fa-f]{2})/g);else if(_.peek()==="u")v=_.match(/u([0-9A-Fa-f]{4})/g),v||(v=_.match(/u\{([0-9A-Fa-f]+)\}/g));else{W+="\\",_.hasNext()&&(W+=_.next());continue}if(!v||(H=parseInt(v[1],16),H>126&&H<=255&&v[0].indexOf("x")===0))return G;H>=0&&H<32||H>1114111?W+="\\"+v[0]:H===34||H===39||H===92?W+="\\"+String.fromCharCode(H):W+=String.fromCharCode(H)}return W}R.prototype._read_string_recursive=function(G,W,H){var _,v;G==="'"?v=this.__patterns.single_quote:G==='"'?v=this.__patterns.double_quote:G==="`"?v=this.__patterns.template_text:G==="}"&&(v=this.__patterns.template_expression);for(var C=v.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===G||!W&&x.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(_=this._input.peek(),_==="x"||_==="u"?this.has_char_escapes=!0:_==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Y+=this._input.next()):H&&(H==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),H===Y&&(G==="`"?Y+=this._read_string_recursive("}",W,"`"):Y+=this._read_string_recursive("`",W,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=v.read(),C+=Y}return C},q.exports.Tokenizer=R,q.exports.TOKEN=I,q.exports.positionable_operators=re.slice(),q.exports.line_starters=xe.slice()},function(q){var l=RegExp.prototype.hasOwnProperty("sticky");function S(T){this.__input=T||"",this.__input_length=this.__input.length,this.__position=0}S.prototype.restart=function(){this.__position=0},S.prototype.back=function(){this.__position>0&&(this.__position-=1)},S.prototype.hasNext=function(){return this.__position<this.__input_length},S.prototype.next=function(){var T=null;return this.hasNext()&&(T=this.__input.charAt(this.__position),this.__position+=1),T},S.prototype.peek=function(T){var d=null;return T=T||0,T+=this.__position,T>=0&&T<this.__input_length&&(d=this.__input.charAt(T)),d},S.prototype.__match=function(T,d){T.lastIndex=d;var m=T.exec(this.__input);return m&&!(l&&T.sticky)&&m.index!==d&&(m=null),m},S.prototype.test=function(T,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(T,d):!1},S.prototype.testChar=function(T,d){var m=this.peek(d);return T.lastIndex=0,m!==null&&T.test(m)},S.prototype.match=function(T){var d=this.__match(T,this.__position);return d?this.__position+=d[0].length:d=null,d},S.prototype.read=function(T,d,m){var y="",x;return T&&(x=this.match(T),x&&(y+=x[0])),d&&(x||!T)&&(y+=this.readUntil(d,m)),y},S.prototype.readUntil=function(T,d){var m="",y=this.__position;T.lastIndex=this.__position;var x=T.exec(this.__input);return x?(y=x.index,d&&(y+=x[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},S.prototype.readUntilAfter=function(T){return this.readUntil(T,!0)},S.prototype.get_regexp=function(T,d){var m=null,y="g";return d&&l&&(y="y"),typeof T=="string"&&T!==""?m=new RegExp(T,y):T&&(m=new RegExp(T.source,y)),m},S.prototype.get_literal_regexp=function(T){return RegExp(T.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},S.prototype.peekUntilAfter=function(T){var d=this.__position,m=this.readUntilAfter(T);return this.__position=d,m},S.prototype.lookBack=function(T){var d=this.__position-1;return d>=T.length&&this.__input.substring(d-T.length,d).toLowerCase()===T},q.exports.InputScanner=S},function(q,l,S){var T=S(8).InputScanner,d=S(3).Token,m=S(10).TokenStream,y=S(11).WhitespacePattern,x={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},U=function(N,V){this._input=new T(N),this._options=V||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};U.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var N,V=new d(x.START,""),I=null,L=[],O=new m;V.type!==x.EOF;){for(N=this._get_next_token(V,I);this._is_comment(N);)O.add(N),N=this._get_next_token(V,I);O.isEmpty()||(N.comments_before=O,O=new m),N.parent=I,this._is_opening(N)?(L.push(I),I=N):I&&this._is_closing(N,I)&&(N.opened=I,I.closed=N,I=L.pop(),N.parent=I),N.previous=V,V.next=N,this.__tokens.add(N),V=N}return this.__tokens},U.prototype._is_first_token=function(){return this.__tokens.isEmpty()},U.prototype._reset=function(){},U.prototype._get_next_token=function(N,V){this._readWhitespace();var I=this._input.read(/.+/g);return I?this._create_token(x.RAW,I):this._create_token(x.EOF,"")},U.prototype._is_comment=function(N){return!1},U.prototype._is_opening=function(N){return!1},U.prototype._is_closing=function(N,V){return!1},U.prototype._create_token=function(N,V){var I=new d(N,V,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return I},U.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},q.exports.Tokenizer=U,q.exports.TOKEN=x},function(q){function l(S){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=S}l.prototype.restart=function(){this.__position=0},l.prototype.isEmpty=function(){return this.__tokens_length===0},l.prototype.hasNext=function(){return this.__position<this.__tokens_length},l.prototype.next=function(){var S=null;return this.hasNext()&&(S=this.__tokens[this.__position],this.__position+=1),S},l.prototype.peek=function(S){var T=null;return S=S||0,S+=this.__position,S>=0&&S<this.__tokens_length&&(T=this.__tokens[S]),T},l.prototype.add=function(S){this.__parent_token&&(S.parent=this.__parent_token),this.__tokens.push(S),this.__tokens_length+=1},q.exports.TokenStream=l},function(q,l,S){var T=S(12).Pattern;function d(m,y){T.call(this,m,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new T,d.prototype.__set_whitespace_patterns=function(m,y){m+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var y=this.__split(this._newline_regexp,m);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return m},d.prototype.matching=function(m,y){var x=this._create();return x.__set_whitespace_patterns(m,y),x._update(),x},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(m,y){m.lastIndex=0;for(var x=0,U=[],N=m.exec(y);N;)U.push(y.substring(x,N.index)),x=N.index+N[0].length,N=m.exec(y);return x<y.length?U.push(y.substring(x,y.length)):U.push(""),U},q.exports.WhitespacePattern=d},function(q){function l(S,T){this._input=S,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,T&&(this._starting_pattern=this._input.get_regexp(T._starting_pattern,!0),this._match_pattern=this._input.get_regexp(T._match_pattern,!0),this._until_pattern=this._input.get_regexp(T._until_pattern),this._until_after=T._until_after)}l.prototype.read=function(){var S=this._input.read(this._starting_pattern);return(!this._starting_pattern||S)&&(S+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),S},l.prototype.read_match=function(){return this._input.match(this._match_pattern)},l.prototype.until_after=function(S){var T=this._create();return T._until_after=!0,T._until_pattern=this._input.get_regexp(S),T._update(),T},l.prototype.until=function(S){var T=this._create();return T._until_after=!1,T._until_pattern=this._input.get_regexp(S),T._update(),T},l.prototype.starting_with=function(S){var T=this._create();return T._starting_pattern=this._input.get_regexp(S,!0),T._update(),T},l.prototype.matching=function(S){var T=this._create();return T._match_pattern=this._input.get_regexp(S,!0),T._update(),T},l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){},q.exports.Pattern=l},function(q){function l(S,T){S=typeof S=="string"?S:S.source,T=typeof T=="string"?T:T.source,this.__directives_block_pattern=new RegExp(S+/ beautify( \w+[:]\w+)+ /.source+T,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(S+/\sbeautify\signore:end\s/.source+T,"g")}l.prototype.get_directives=function(S){if(!S.match(this.__directives_block_pattern))return null;var T={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(S);d;)T[d[1]]=d[2],d=this.__directive_pattern.exec(S);return T},l.prototype.readIgnored=function(S){return S.readUntilAfter(this.__directives_end_ignore_pattern)},q.exports.Directives=l},function(q,l,S){var T=S(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function m(y,x){T.call(this,y,x),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),x&&(this.__template_pattern=this._input.get_regexp(x.__template_pattern),this._excluded=Object.assign(this._excluded,x._excluded),this._disabled=Object.assign(this._disabled,x._disabled));var U=new T(y);this.__patterns={handlebars_comment:U.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:U.starting_with(/{{{/).until_after(/}}}/),handlebars:U.starting_with(/{{/).until_after(/}}/),php:U.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:U.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:U.starting_with(/{%/).until_after(/%}/),django_value:U.starting_with(/{{/).until_after(/}}/),django_comment:U.starting_with(/{#/).until_after(/#}/),smarty:U.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:U.starting_with(/{\*/).until_after(/\*}/),smarty_literal:U.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new T,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(y){var x=this._create();return x._disabled[y]=!0,x._update(),x},m.prototype.read_options=function(y){var x=this._create();for(var U in d)x._disabled[U]=y.templating.indexOf(U)===-1;return x._update(),x},m.prototype.exclude=function(y){var x=this._create();return x._excluded[y]=!0,x._update(),x},m.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var x=this._read_template();x;)this._match_pattern?x+=this._input.read(this._match_pattern):x+=this._input.readUntil(this.__template_pattern),y+=x,x=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},m.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},m.prototype._read_template=function(){var y="",x=this._input.peek();if(x==="<"){var U=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&U==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&U==="%"&&(y=y||this.__patterns.erb.read())}else x==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},q.exports.TemplatablePattern=m}],F={};function g(q){var l=F[q];if(l!==void 0)return l.exports;var S=F[q]={exports:{}};return ne[q](S,S.exports,g),S.exports}var oe=g(0);ue=oe})();var Ae=ue;k=[],A=function(){return{js_beautify:Ae}}.apply(St,k),A!==void 0&&(bn.exports=A)})()},32834:function(bn){(function(St,k){bn.exports=k()})(this,function(){"use strict";function St(Ie,ve){for(var be=0;be<ve.length;be++){var M=ve[be];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(Ie,M.key,M)}}function k(Ie,ve,be){return ve&&St(Ie.prototype,ve),be&&St(Ie,be),Ie}function A(Ie,ve){if(Ie){if(typeof Ie=="string")return ue(Ie,ve);var be=Object.prototype.toString.call(Ie).slice(8,-1);if(be==="Object"&&Ie.constructor&&(be=Ie.constructor.name),be==="Map"||be==="Set")return Array.from(Ie);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return ue(Ie,ve)}}function ue(Ie,ve){(ve==null||ve>Ie.length)&&(ve=Ie.length);for(var be=0,M=new Array(ve);be<ve;be++)M[be]=Ie[be];return M}function Ae(Ie,ve){var be=typeof Symbol!="undefined"&&Ie[Symbol.iterator]||Ie["@@iterator"];if(be)return(be=be.call(Ie)).next.bind(be);if(Array.isArray(Ie)||(be=A(Ie))||ve&&Ie&&typeof Ie.length=="number"){be&&(Ie=be);var M=0;return function(){return M>=Ie.length?{done:!0}:{done:!1,value:Ie[M++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ne={exports:{}};function F(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function g(Ie){ne.exports.defaults=Ie}ne.exports={defaults:F(),getDefaults:F,changeDefaults:g};var oe=/[&<>"']/,q=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,T={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(ve){return T[ve]};function m(Ie,ve){if(ve){if(oe.test(Ie))return Ie.replace(q,d)}else if(l.test(Ie))return Ie.replace(S,d);return Ie}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x(Ie){return Ie.replace(y,function(ve,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var U=/(^|[^\[])\^/g;function N(Ie,ve){Ie=Ie.source||Ie,ve=ve||"";var be={replace:function(Z,ie){return ie=ie.source||ie,ie=ie.replace(U,"$1"),Ie=Ie.replace(Z,ie),be},getRegex:function(){return new RegExp(Ie,ve)}};return be}var V=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Ie,ve,be){if(Ie){var M;try{M=decodeURIComponent(x(be)).replace(V,"").toLowerCase()}catch(Z){return null}if(M.indexOf("javascript:")===0||M.indexOf("vbscript:")===0||M.indexOf("data:")===0)return null}ve&&!I.test(be)&&(be=J(ve,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(Z){return null}return be}var O={},z=/^[^:]+:\/*[^/]*$/,ee=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function J(Ie,ve){O[" "+Ie]||(z.test(Ie)?O[" "+Ie]=Ie+"/":O[" "+Ie]=Ze(Ie,"/",!0)),Ie=O[" "+Ie];var be=Ie.indexOf(":")===-1;return ve.substring(0,2)==="//"?be?ve:Ie.replace(ee,"$1")+ve:ve.charAt(0)==="/"?be?ve:Ie.replace(re,"$1")+ve:Ie+ve}var X={exec:function(){}};function xe(Ie){for(var ve=1,be,M;ve<arguments.length;ve++){be=arguments[ve];for(M in be)Object.prototype.hasOwnProperty.call(be,M)&&(Ie[M]=be[M])}return Ie}function he(Ie,ve){var be=Ie.replace(/\|/g,function(ie,le,_e){for(var it=!1,bt=le;--bt>=0&&_e[bt]==="\\";)it=!it;return it?"|":" |"}),M=be.split(/ \|/),Z=0;if(M.length>ve)M.splice(ve);else for(;M.length<ve;)M.push("");for(;Z<M.length;Z++)M[Z]=M[Z].trim().replace(/\\\|/g,"|");return M}function Ze(Ie,ve,be){var M=Ie.length;if(M===0)return"";for(var Z=0;Z<M;){var ie=Ie.charAt(M-Z-1);if(ie===ve&&!be)Z++;else if(ie!==ve&&be)Z++;else break}return Ie.substr(0,M-Z)}function K(Ie,ve){if(Ie.indexOf(ve[1])===-1)return-1;for(var be=Ie.length,M=0,Z=0;Z<be;Z++)if(Ie[Z]==="\\")Z++;else if(Ie[Z]===ve[0])M++;else if(Ie[Z]===ve[1]&&(M--,M<0))return Z;return-1}function R(Ie){Ie&&Ie.sanitize&&!Ie.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function B(Ie,ve){if(ve<1)return"";for(var be="";ve>1;)ve&1&&(be+=Ie),ve>>=1,Ie+=Ie;return be+Ie}var G={escape:m,unescape:x,edit:N,cleanUrl:L,resolveUrl:J,noopTest:X,merge:xe,splitCells:he,rtrim:Ze,findClosingBracket:K,checkSanitizeDeprecation:R,repeatString:B},W=ne.exports.defaults,H=G.rtrim,_=G.splitCells,v=G.escape,C=G.findClosingBracket;function Y(Ie,ve,be){var M=ve.href,Z=ve.title?v(ve.title):null,ie=Ie[1].replace(/\\([\[\]])/g,"$1");return Ie[0].charAt(0)!=="!"?{type:"link",raw:be,href:M,title:Z,text:ie}:{type:"image",raw:be,href:M,title:Z,text:v(ie)}}function Se(Ie,ve){var be=Ie.match(/^(\s+)(?:```)/);if(be===null)return ve;var M=be[1];return ve.split(`
|
|
`).map(function(Z){var ie=Z.match(/^\s+/);if(ie===null)return Z;var le=ie[0];return le.length>=M.length?Z.slice(M.length):Z}).join(`
|
|
`)}var Re=function(){function Ie(be){this.options=be||W}var ve=Ie.prototype;return ve.space=function(M){var Z=this.rules.block.newline.exec(M);if(Z)return Z[0].length>1?{type:"space",raw:Z[0]}:{raw:`
|
|
`}},ve.code=function(M){var Z=this.rules.block.code.exec(M);if(Z){var ie=Z[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:Z[0],codeBlockStyle:"indented",text:this.options.pedantic?ie:H(ie,`
|
|
`)}}},ve.fences=function(M){var Z=this.rules.block.fences.exec(M);if(Z){var ie=Z[0],le=Se(ie,Z[3]||"");return{type:"code",raw:ie,lang:Z[2]?Z[2].trim():Z[2],text:le}}},ve.heading=function(M){var Z=this.rules.block.heading.exec(M);if(Z){var ie=Z[2].trim();if(/#$/.test(ie)){var le=H(ie,"#");(this.options.pedantic||!le||/ $/.test(le))&&(ie=le.trim())}return{type:"heading",raw:Z[0],depth:Z[1].length,text:ie}}},ve.nptable=function(M){var Z=this.rules.block.nptable.exec(M);if(Z){var ie={type:"table",header:_(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Z[0]};if(ie.header.length===ie.align.length){var le=ie.align.length,_e;for(_e=0;_e<le;_e++)/^ *-+: *$/.test(ie.align[_e])?ie.align[_e]="right":/^ *:-+: *$/.test(ie.align[_e])?ie.align[_e]="center":/^ *:-+ *$/.test(ie.align[_e])?ie.align[_e]="left":ie.align[_e]=null;for(le=ie.cells.length,_e=0;_e<le;_e++)ie.cells[_e]=_(ie.cells[_e],ie.header.length);return ie}}},ve.hr=function(M){var Z=this.rules.block.hr.exec(M);if(Z)return{type:"hr",raw:Z[0]}},ve.blockquote=function(M){var Z=this.rules.block.blockquote.exec(M);if(Z){var ie=Z[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Z[0],text:ie}}},ve.list=function(M){var Z=this.rules.block.list.exec(M);if(Z){var ie=Z[0],le=Z[2],_e=le.length>1,it={type:"list",raw:ie,ordered:_e,start:_e?+le.slice(0,-1):"",loose:!1,items:[]},bt=Z[0].match(this.rules.block.item),Ct=!1,zt,En,Dn,dn,un,Fn,Vn,Nn,zn,Rt=bt.length;Dn=this.rules.block.listItemStart.exec(bt[0]);for(var at=0;at<Rt;at++){if(zt=bt[at],ie=zt,this.options.pedantic||(zn=zt.match(new RegExp("\\n\\s*\\n {0,"+(Dn[0].length-1)+"}\\S")),zn&&(un=zt.length-zn.index+bt.slice(at+1).join(`
|
|
`).length,it.raw=it.raw.substring(0,it.raw.length-un),zt=zt.substring(0,zn.index),ie=zt,Rt=at+1)),at!==Rt-1){if(dn=this.rules.block.listItemStart.exec(bt[at+1]),this.options.pedantic?dn[1].length>Dn[1].length:dn[1].length>=Dn[0].length||dn[1].length>3){bt.splice(at,2,bt[at]+(!this.options.pedantic&&dn[1].length<Dn[0].length&&!bt[at].match(/\n$/)?"":`
|
|
`)+bt[at+1]),at--,Rt--;continue}else(!this.options.pedantic||this.options.smartLists?dn[2][dn[2].length-1]!==le[le.length-1]:_e===(dn[2].length===1))&&(un=bt.slice(at+1).join(`
|
|
`).length,it.raw=it.raw.substring(0,it.raw.length-un),at=Rt-1);Dn=dn}En=zt.length,zt=zt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~zt.indexOf(`
|
|
`)&&(En-=zt.length,zt=this.options.pedantic?zt.replace(/^ {1,4}/gm,""):zt.replace(new RegExp("^ {1,"+En+"}","gm"),"")),zt=H(zt,`
|
|
`),at!==Rt-1&&(ie=ie+`
|
|
`),Fn=Ct||/\n\n(?!\s*$)/.test(ie),at!==Rt-1&&(Ct=ie.slice(-2)===`
|
|
|
|
`,Fn||(Fn=Ct)),Fn&&(it.loose=!0),this.options.gfm&&(Vn=/^\[[ xX]\] /.test(zt),Nn=void 0,Vn&&(Nn=zt[1]!==" ",zt=zt.replace(/^\[[ xX]\] +/,""))),it.items.push({type:"list_item",raw:ie,task:Vn,checked:Nn,loose:Fn,text:zt})}return it}},ve.html=function(M){var Z=this.rules.block.html.exec(M);if(Z)return{type:this.options.sanitize?"paragraph":"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):v(Z[0]):Z[0]}},ve.def=function(M){var Z=this.rules.block.def.exec(M);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var ie=Z[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ie,raw:Z[0],href:Z[2],title:Z[3]}}},ve.table=function(M){var Z=this.rules.block.table.exec(M);if(Z){var ie={type:"table",header:_(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ie.header.length===ie.align.length){ie.raw=Z[0];var le=ie.align.length,_e;for(_e=0;_e<le;_e++)/^ *-+: *$/.test(ie.align[_e])?ie.align[_e]="right":/^ *:-+: *$/.test(ie.align[_e])?ie.align[_e]="center":/^ *:-+ *$/.test(ie.align[_e])?ie.align[_e]="left":ie.align[_e]=null;for(le=ie.cells.length,_e=0;_e<le;_e++)ie.cells[_e]=_(ie.cells[_e].replace(/^ *\| *| *\| *$/g,""),ie.header.length);return ie}}},ve.lheading=function(M){var Z=this.rules.block.lheading.exec(M);if(Z)return{type:"heading",raw:Z[0],depth:Z[2].charAt(0)==="="?1:2,text:Z[1]}},ve.paragraph=function(M){var Z=this.rules.block.paragraph.exec(M);if(Z)return{type:"paragraph",raw:Z[0],text:Z[1].charAt(Z[1].length-1)===`
|
|
`?Z[1].slice(0,-1):Z[1]}},ve.text=function(M){var Z=this.rules.block.text.exec(M);if(Z)return{type:"text",raw:Z[0],text:Z[0]}},ve.escape=function(M){var Z=this.rules.inline.escape.exec(M);if(Z)return{type:"escape",raw:Z[0],text:v(Z[1])}},ve.tag=function(M,Z,ie){var le=this.rules.inline.tag.exec(M);if(le)return!Z&&/^<a /i.test(le[0])?Z=!0:Z&&/^<\/a>/i.test(le[0])&&(Z=!1),!ie&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?ie=!0:ie&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(ie=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:Z,inRawBlock:ie,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):v(le[0]):le[0]}},ve.link=function(M){var Z=this.rules.inline.link.exec(M);if(Z){var ie=Z[2].trim();if(!this.options.pedantic&&/^</.test(ie)){if(!/>$/.test(ie))return;var le=H(ie.slice(0,-1),"\\");if((ie.length-le.length)%2===0)return}else{var _e=C(Z[2],"()");if(_e>-1){var it=Z[0].indexOf("!")===0?5:4,bt=it+Z[1].length+_e;Z[2]=Z[2].substring(0,_e),Z[0]=Z[0].substring(0,bt).trim(),Z[3]=""}}var Ct=Z[2],zt="";if(this.options.pedantic){var En=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ct);En&&(Ct=En[1],zt=En[3])}else zt=Z[3]?Z[3].slice(1,-1):"";return Ct=Ct.trim(),/^</.test(Ct)&&(this.options.pedantic&&!/>$/.test(ie)?Ct=Ct.slice(1):Ct=Ct.slice(1,-1)),Y(Z,{href:Ct&&Ct.replace(this.rules.inline._escapes,"$1"),title:zt&&zt.replace(this.rules.inline._escapes,"$1")},Z[0])}},ve.reflink=function(M,Z){var ie;if((ie=this.rules.inline.reflink.exec(M))||(ie=this.rules.inline.nolink.exec(M))){var le=(ie[2]||ie[1]).replace(/\s+/g," ");if(le=Z[le.toLowerCase()],!le||!le.href){var _e=ie[0].charAt(0);return{type:"text",raw:_e,text:_e}}return Y(ie,le,ie[0])}},ve.emStrong=function(M,Z,ie){ie===void 0&&(ie="");var le=this.rules.inline.emStrong.lDelim.exec(M);if(le&&!(le[3]&&ie.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var _e=le[1]||le[2]||"";if(!_e||_e&&(ie===""||this.rules.inline.punctuation.exec(ie))){var it=le[0].length-1,bt,Ct,zt=it,En=0,Dn=le[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dn.lastIndex=0,Z=Z.slice(-1*M.length+it);(le=Dn.exec(Z))!=null;)if(bt=le[1]||le[2]||le[3]||le[4]||le[5]||le[6],!!bt){if(Ct=bt.length,le[3]||le[4]){zt+=Ct;continue}else if((le[5]||le[6])&&it%3&&!((it+Ct)%3)){En+=Ct;continue}if(zt-=Ct,!(zt>0))return Ct=Math.min(Ct,Ct+zt+En),Math.min(it,Ct)%2?{type:"em",raw:M.slice(0,it+le.index+Ct+1),text:M.slice(1,it+le.index+Ct)}:{type:"strong",raw:M.slice(0,it+le.index+Ct+1),text:M.slice(2,it+le.index+Ct-1)}}}}},ve.codespan=function(M){var Z=this.rules.inline.code.exec(M);if(Z){var ie=Z[2].replace(/\n/g," "),le=/[^ ]/.test(ie),_e=/^ /.test(ie)&&/ $/.test(ie);return le&&_e&&(ie=ie.substring(1,ie.length-1)),ie=v(ie,!0),{type:"codespan",raw:Z[0],text:ie}}},ve.br=function(M){var Z=this.rules.inline.br.exec(M);if(Z)return{type:"br",raw:Z[0]}},ve.del=function(M){var Z=this.rules.inline.del.exec(M);if(Z)return{type:"del",raw:Z[0],text:Z[2]}},ve.autolink=function(M,Z){var ie=this.rules.inline.autolink.exec(M);if(ie){var le,_e;return ie[2]==="@"?(le=v(this.options.mangle?Z(ie[1]):ie[1]),_e="mailto:"+le):(le=v(ie[1]),_e=le),{type:"link",raw:ie[0],text:le,href:_e,tokens:[{type:"text",raw:le,text:le}]}}},ve.url=function(M,Z){var ie;if(ie=this.rules.inline.url.exec(M)){var le,_e;if(ie[2]==="@")le=v(this.options.mangle?Z(ie[0]):ie[0]),_e="mailto:"+le;else{var it;do it=ie[0],ie[0]=this.rules.inline._backpedal.exec(ie[0])[0];while(it!==ie[0]);le=v(ie[0]),ie[1]==="www."?_e="http://"+le:_e=le}return{type:"link",raw:ie[0],text:le,href:_e,tokens:[{type:"text",raw:le,text:le}]}}},ve.inlineText=function(M,Z,ie){var le=this.rules.inline.text.exec(M);if(le){var _e;return Z?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):v(le[0]):le[0]:_e=v(this.options.smartypants?ie(le[0]):le[0]),{type:"text",raw:le[0],text:_e}}},Ie}(),Ye=G.noopTest,He=G.edit,ot=G.merge,dt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ye,table:Ye,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};dt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,dt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,dt.def=He(dt.def).replace("label",dt._label).replace("title",dt._title).getRegex(),dt.bullet=/(?:[*+-]|\d{1,9}[.)])/,dt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,dt.item=He(dt.item,"gm").replace(/bull/g,dt.bullet).getRegex(),dt.listItemStart=He(/^( *)(bull) */).replace("bull",dt.bullet).getRegex(),dt.list=He(dt.list).replace(/bull/g,dt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+dt.def.source+")").getRegex(),dt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",dt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,dt.html=He(dt.html,"i").replace("comment",dt._comment).replace("tag",dt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt.paragraph=He(dt._paragraph).replace("hr",dt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",dt._tag).getRegex(),dt.blockquote=He(dt.blockquote).replace("paragraph",dt.paragraph).getRegex(),dt.normal=ot({},dt),dt.gfm=ot({},dt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),dt.gfm.nptable=He(dt.gfm.nptable).replace("hr",dt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",dt._tag).getRegex(),dt.gfm.table=He(dt.gfm.table).replace("hr",dt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",dt._tag).getRegex(),dt.pedantic=ot({},dt.normal,{html:He(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",dt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,paragraph:He(dt.normal._paragraph).replace("hr",dt.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",dt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Me={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ye,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ye,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Me._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Me.punctuation=He(Me.punctuation).replace(/punctuation/g,Me._punctuation).getRegex(),Me.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Me.escapedEmSt=/\\\*|\\_/g,Me._comment=He(dt._comment).replace("(?:-->|$)","-->").getRegex(),Me.emStrong.lDelim=He(Me.emStrong.lDelim).replace(/punct/g,Me._punctuation).getRegex(),Me.emStrong.rDelimAst=He(Me.emStrong.rDelimAst,"g").replace(/punct/g,Me._punctuation).getRegex(),Me.emStrong.rDelimUnd=He(Me.emStrong.rDelimUnd,"g").replace(/punct/g,Me._punctuation).getRegex(),Me._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Me._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Me._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Me.autolink=He(Me.autolink).replace("scheme",Me._scheme).replace("email",Me._email).getRegex(),Me._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Me.tag=He(Me.tag).replace("comment",Me._comment).replace("attribute",Me._attribute).getRegex(),Me._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Me._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Me._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Me.link=He(Me.link).replace("label",Me._label).replace("href",Me._href).replace("title",Me._title).getRegex(),Me.reflink=He(Me.reflink).replace("label",Me._label).getRegex(),Me.reflinkSearch=He(Me.reflinkSearch,"g").replace("reflink",Me.reflink).replace("nolink",Me.nolink).getRegex(),Me.normal=ot({},Me),Me.pedantic=ot({},Me.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:He(/^!?\[(label)\]\((.*?)\)/).replace("label",Me._label).getRegex(),reflink:He(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Me._label).getRegex()}),Me.gfm=ot({},Me.normal,{escape:He(Me.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Me.gfm.url=He(Me.gfm.url,"i").replace("email",Me.gfm._extended_email).getRegex(),Me.breaks=ot({},Me.gfm,{br:He(Me.br).replace("{2,}","*").getRegex(),text:He(Me.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ht={block:dt,inline:Me},Oe=Re,mt=ne.exports.defaults,ze=ht.block,ke=ht.inline,se=G.repeatString;function Q(Ie){return Ie.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function $(Ie){var ve="",be,M,Z=Ie.length;for(be=0;be<Z;be++)M=Ie.charCodeAt(be),Math.random()>.5&&(M="x"+M.toString(16)),ve+="&#"+M+";";return ve}var de=function(){function Ie(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||mt,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var M={block:ze.normal,inline:ke.normal};this.options.pedantic?(M.block=ze.pedantic,M.inline=ke.pedantic):this.options.gfm&&(M.block=ze.gfm,this.options.breaks?M.inline=ke.breaks:M.inline=ke.gfm),this.tokenizer.rules=M}Ie.lex=function(M,Z){var ie=new Ie(Z);return ie.lex(M)},Ie.lexInline=function(M,Z){var ie=new Ie(Z);return ie.inlineTokens(M)};var ve=Ie.prototype;return ve.lex=function(M){return M=M.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(M,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(M,Z,ie){Z===void 0&&(Z=[]),ie===void 0&&(ie=!0),this.options.pedantic&&(M=M.replace(/^ +$/gm,""));for(var le,_e,it,bt;M;){if(le=this.tokenizer.space(M)){M=M.substring(le.raw.length),le.type&&Z.push(le);continue}if(le=this.tokenizer.code(M)){M=M.substring(le.raw.length),bt=Z[Z.length-1],bt&&bt.type==="paragraph"?(bt.raw+=`
|
|
`+le.raw,bt.text+=`
|
|
`+le.text):Z.push(le);continue}if(le=this.tokenizer.fences(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.heading(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.nptable(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.hr(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.blockquote(M)){M=M.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],ie),Z.push(le);continue}if(le=this.tokenizer.list(M)){for(M=M.substring(le.raw.length),it=le.items.length,_e=0;_e<it;_e++)le.items[_e].tokens=this.blockTokens(le.items[_e].text,[],!1);Z.push(le);continue}if(le=this.tokenizer.html(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(ie&&(le=this.tokenizer.def(M))){M=M.substring(le.raw.length),this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.lheading(M)){M=M.substring(le.raw.length),Z.push(le);continue}if(ie&&(le=this.tokenizer.paragraph(M))){M=M.substring(le.raw.length),Z.push(le);continue}if(le=this.tokenizer.text(M)){M=M.substring(le.raw.length),bt=Z[Z.length-1],bt&&bt.type==="text"?(bt.raw+=`
|
|
`+le.raw,bt.text+=`
|
|
`+le.text):Z.push(le);continue}if(M){var Ct="Infinite loop on byte: "+M.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return Z},ve.inline=function(M){var Z,ie,le,_e,it,bt,Ct=M.length;for(Z=0;Z<Ct;Z++)switch(bt=M[Z],bt.type){case"paragraph":case"text":case"heading":{bt.tokens=[],this.inlineTokens(bt.text,bt.tokens);break}case"table":{for(bt.tokens={header:[],cells:[]},_e=bt.header.length,ie=0;ie<_e;ie++)bt.tokens.header[ie]=[],this.inlineTokens(bt.header[ie],bt.tokens.header[ie]);for(_e=bt.cells.length,ie=0;ie<_e;ie++)for(it=bt.cells[ie],bt.tokens.cells[ie]=[],le=0;le<it.length;le++)bt.tokens.cells[ie][le]=[],this.inlineTokens(it[le],bt.tokens.cells[ie][le]);break}case"blockquote":{this.inline(bt.tokens);break}case"list":{for(_e=bt.items.length,ie=0;ie<_e;ie++)this.inline(bt.items[ie].tokens);break}}return M},ve.inlineTokens=function(M,Z,ie,le){Z===void 0&&(Z=[]),ie===void 0&&(ie=!1),le===void 0&&(le=!1);var _e,it,bt=M,Ct,zt,En;if(this.tokens.links){var Dn=Object.keys(this.tokens.links);if(Dn.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(bt))!=null;)Dn.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(bt=bt.slice(0,Ct.index)+"["+se("a",Ct[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(bt))!=null;)bt=bt.slice(0,Ct.index)+"["+se("a",Ct[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Ct=this.tokenizer.rules.inline.escapedEmSt.exec(bt))!=null;)bt=bt.slice(0,Ct.index)+"++"+bt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;M;){if(zt||(En=""),zt=!1,_e=this.tokenizer.escape(M)){M=M.substring(_e.raw.length),Z.push(_e);continue}if(_e=this.tokenizer.tag(M,ie,le)){M=M.substring(_e.raw.length),ie=_e.inLink,le=_e.inRawBlock;var dn=Z[Z.length-1];dn&&_e.type==="text"&&dn.type==="text"?(dn.raw+=_e.raw,dn.text+=_e.text):Z.push(_e);continue}if(_e=this.tokenizer.link(M)){M=M.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,le)),Z.push(_e);continue}if(_e=this.tokenizer.reflink(M,this.tokens.links)){M=M.substring(_e.raw.length);var un=Z[Z.length-1];_e.type==="link"?(_e.tokens=this.inlineTokens(_e.text,[],!0,le),Z.push(_e)):un&&_e.type==="text"&&un.type==="text"?(un.raw+=_e.raw,un.text+=_e.text):Z.push(_e);continue}if(_e=this.tokenizer.emStrong(M,bt,En)){M=M.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ie,le),Z.push(_e);continue}if(_e=this.tokenizer.codespan(M)){M=M.substring(_e.raw.length),Z.push(_e);continue}if(_e=this.tokenizer.br(M)){M=M.substring(_e.raw.length),Z.push(_e);continue}if(_e=this.tokenizer.del(M)){M=M.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ie,le),Z.push(_e);continue}if(_e=this.tokenizer.autolink(M,$)){M=M.substring(_e.raw.length),Z.push(_e);continue}if(!ie&&(_e=this.tokenizer.url(M,$))){M=M.substring(_e.raw.length),Z.push(_e);continue}if(_e=this.tokenizer.inlineText(M,le,Q)){M=M.substring(_e.raw.length),_e.raw.slice(-1)!=="_"&&(En=_e.raw.slice(-1)),zt=!0,it=Z[Z.length-1],it&&it.type==="text"?(it.raw+=_e.raw,it.text+=_e.text):Z.push(_e);continue}if(M){var Fn="Infinite loop on byte: "+M.charCodeAt(0);if(this.options.silent){console.error(Fn);break}else throw new Error(Fn)}}return Z},k(Ie,null,[{key:"rules",get:function(){return{block:ze,inline:ke}}}]),Ie}(),we=ne.exports.defaults,Ce=G.cleanUrl,P=G.escape,te=function(){function Ie(be){this.options=be||we}var ve=Ie.prototype;return ve.code=function(M,Z,ie){var le=(Z||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(M,le);_e!=null&&_e!==M&&(ie=!0,M=_e)}return M=M.replace(/\n$/,"")+`
|
|
`,le?'<pre><code class="'+this.options.langPrefix+P(le,!0)+'">'+(ie?M:P(M,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ie?M:P(M,!0))+`</code></pre>
|
|
`},ve.blockquote=function(M){return`<blockquote>
|
|
`+M+`</blockquote>
|
|
`},ve.html=function(M){return M},ve.heading=function(M,Z,ie,le){return this.options.headerIds?"<h"+Z+' id="'+this.options.headerPrefix+le.slug(ie)+'">'+M+"</h"+Z+`>
|
|
`:"<h"+Z+">"+M+"</h"+Z+`>
|
|
`},ve.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ve.list=function(M,Z,ie){var le=Z?"ol":"ul",_e=Z&&ie!==1?' start="'+ie+'"':"";return"<"+le+_e+`>
|
|
`+M+"</"+le+`>
|
|
`},ve.listitem=function(M){return"<li>"+M+`</li>
|
|
`},ve.checkbox=function(M){return"<input "+(M?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ve.paragraph=function(M){return"<p>"+M+`</p>
|
|
`},ve.table=function(M,Z){return Z&&(Z="<tbody>"+Z+"</tbody>"),`<table>
|
|
<thead>
|
|
`+M+`</thead>
|
|
`+Z+`</table>
|
|
`},ve.tablerow=function(M){return`<tr>
|
|
`+M+`</tr>
|
|
`},ve.tablecell=function(M,Z){var ie=Z.header?"th":"td",le=Z.align?"<"+ie+' align="'+Z.align+'">':"<"+ie+">";return le+M+"</"+ie+`>
|
|
`},ve.strong=function(M){return"<strong>"+M+"</strong>"},ve.em=function(M){return"<em>"+M+"</em>"},ve.codespan=function(M){return"<code>"+M+"</code>"},ve.br=function(){return this.options.xhtml?"<br/>":"<br>"},ve.del=function(M){return"<del>"+M+"</del>"},ve.link=function(M,Z,ie){if(M=Ce(this.options.sanitize,this.options.baseUrl,M),M===null)return ie;var le='<a href="'+P(M)+'"';return Z&&(le+=' title="'+Z+'"'),le+=">"+ie+"</a>",le},ve.image=function(M,Z,ie){if(M=Ce(this.options.sanitize,this.options.baseUrl,M),M===null)return ie;var le='<img src="'+M+'" alt="'+ie+'"';return Z&&(le+=' title="'+Z+'"'),le+=this.options.xhtml?"/>":">",le},ve.text=function(M){return M},Ie}(),ge=function(){function Ie(){}var ve=Ie.prototype;return ve.strong=function(M){return M},ve.em=function(M){return M},ve.codespan=function(M){return M},ve.del=function(M){return M},ve.html=function(M){return M},ve.text=function(M){return M},ve.link=function(M,Z,ie){return""+ie},ve.image=function(M,Z,ie){return""+ie},ve.br=function(){return""},Ie}(),Ee=function(){function Ie(){this.seen={}}var ve=Ie.prototype;return ve.serialize=function(M){return M.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ve.getNextSafeSlug=function(M,Z){var ie=M,le=0;if(this.seen.hasOwnProperty(ie)){le=this.seen[M];do le++,ie=M+"-"+le;while(this.seen.hasOwnProperty(ie))}return Z||(this.seen[M]=le,this.seen[ie]=0),ie},ve.slug=function(M,Z){Z===void 0&&(Z={});var ie=this.serialize(M);return this.getNextSafeSlug(ie,Z.dryrun)},Ie}(),Te=te,Ue=ge,et=Ee,Ne=ne.exports.defaults,De=G.unescape,Ke=function(){function Ie(be){this.options=be||Ne,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new et}Ie.parse=function(M,Z){var ie=new Ie(Z);return ie.parse(M)},Ie.parseInline=function(M,Z){var ie=new Ie(Z);return ie.parseInline(M)};var ve=Ie.prototype;return ve.parse=function(M,Z){Z===void 0&&(Z=!0);var ie="",le,_e,it,bt,Ct,zt,En,Dn,dn,un,Fn,Vn,Nn,zn,Rt,at,Kt,xn,$n=M.length;for(le=0;le<$n;le++)switch(un=M[le],un.type){case"space":continue;case"hr":{ie+=this.renderer.hr();continue}case"heading":{ie+=this.renderer.heading(this.parseInline(un.tokens),un.depth,De(this.parseInline(un.tokens,this.textRenderer)),this.slugger);continue}case"code":{ie+=this.renderer.code(un.text,un.lang,un.escaped);continue}case"table":{for(Dn="",En="",bt=un.header.length,_e=0;_e<bt;_e++)En+=this.renderer.tablecell(this.parseInline(un.tokens.header[_e]),{header:!0,align:un.align[_e]});for(Dn+=this.renderer.tablerow(En),dn="",bt=un.cells.length,_e=0;_e<bt;_e++){for(zt=un.tokens.cells[_e],En="",Ct=zt.length,it=0;it<Ct;it++)En+=this.renderer.tablecell(this.parseInline(zt[it]),{header:!1,align:un.align[it]});dn+=this.renderer.tablerow(En)}ie+=this.renderer.table(Dn,dn);continue}case"blockquote":{dn=this.parse(un.tokens),ie+=this.renderer.blockquote(dn);continue}case"list":{for(Fn=un.ordered,Vn=un.start,Nn=un.loose,bt=un.items.length,dn="",_e=0;_e<bt;_e++)Rt=un.items[_e],at=Rt.checked,Kt=Rt.task,zn="",Rt.task&&(xn=this.renderer.checkbox(at),Nn?Rt.tokens.length>0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=xn+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=xn+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:xn}):zn+=xn),zn+=this.parse(Rt.tokens,Nn),dn+=this.renderer.listitem(zn,Kt,at);ie+=this.renderer.list(dn,Fn,Vn);continue}case"html":{ie+=this.renderer.html(un.text);continue}case"paragraph":{ie+=this.renderer.paragraph(this.parseInline(un.tokens));continue}case"text":{for(dn=un.tokens?this.parseInline(un.tokens):un.text;le+1<$n&&M[le+1].type==="text";)un=M[++le],dn+=`
|
|
`+(un.tokens?this.parseInline(un.tokens):un.text);ie+=Z?this.renderer.paragraph(dn):dn;continue}default:{var me='Token with "'+un.type+'" type was not found.';if(this.options.silent){console.error(me);return}else throw new Error(me)}}return ie},ve.parseInline=function(M,Z){Z=Z||this.renderer;var ie="",le,_e,it=M.length;for(le=0;le<it;le++)switch(_e=M[le],_e.type){case"escape":{ie+=Z.text(_e.text);break}case"html":{ie+=Z.html(_e.text);break}case"link":{ie+=Z.link(_e.href,_e.title,this.parseInline(_e.tokens,Z));break}case"image":{ie+=Z.image(_e.href,_e.title,_e.text);break}case"strong":{ie+=Z.strong(this.parseInline(_e.tokens,Z));break}case"em":{ie+=Z.em(this.parseInline(_e.tokens,Z));break}case"codespan":{ie+=Z.codespan(_e.text);break}case"br":{ie+=Z.br();break}case"del":{ie+=Z.del(this.parseInline(_e.tokens,Z));break}case"text":{ie+=Z.text(_e.text);break}default:{var bt='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}return ie},Ie}(),_t=de,nt=Ke,lt=Re,ye=te,wt=ge,Qe=Ee,We=G.merge,Mt=G.checkSanitizeDeprecation,$t=G.escape,rt=ne.exports.getDefaults,Jt=ne.exports.changeDefaults,Tn=ne.exports.defaults;function It(Ie,ve,be){if(typeof Ie=="undefined"||Ie===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ie!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ie)+", string expected");if(typeof ve=="function"&&(be=ve,ve=null),ve=We({},It.defaults,ve||{}),Mt(ve),be){var M=ve.highlight,Z;try{Z=_t.lex(Ie,ve)}catch(it){return be(it)}var ie=function(bt){var Ct;if(!bt)try{ve.walkTokens&&It.walkTokens(Z,ve.walkTokens),Ct=nt.parse(Z,ve)}catch(zt){bt=zt}return ve.highlight=M,bt?be(bt):be(null,Ct)};if(!M||M.length<3||(delete ve.highlight,!Z.length))return ie();var le=0;It.walkTokens(Z,function(it){it.type==="code"&&(le++,setTimeout(function(){M(it.text,it.lang,function(bt,Ct){if(bt)return ie(bt);Ct!=null&&Ct!==it.text&&(it.text=Ct,it.escaped=!0),le--,le===0&&ie()})},0))}),le===0&&ie();return}try{var _e=_t.lex(Ie,ve);return ve.walkTokens&&It.walkTokens(_e,ve.walkTokens),nt.parse(_e,ve)}catch(it){if(it.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+$t(it.message+"",!0)+"</pre>";throw it}}It.options=It.setOptions=function(Ie){return We(It.defaults,Ie),Jt(It.defaults),It},It.getDefaults=rt,It.defaults=Tn,It.use=function(Ie){var ve=We({},Ie);if(Ie.renderer&&function(){var M=It.defaults.renderer||new ye,Z=function(_e){var it=M[_e];M[_e]=function(){for(var bt=arguments.length,Ct=new Array(bt),zt=0;zt<bt;zt++)Ct[zt]=arguments[zt];var En=Ie.renderer[_e].apply(M,Ct);return En===!1&&(En=it.apply(M,Ct)),En}};for(var ie in Ie.renderer)Z(ie);ve.renderer=M}(),Ie.tokenizer&&function(){var M=It.defaults.tokenizer||new lt,Z=function(_e){var it=M[_e];M[_e]=function(){for(var bt=arguments.length,Ct=new Array(bt),zt=0;zt<bt;zt++)Ct[zt]=arguments[zt];var En=Ie.tokenizer[_e].apply(M,Ct);return En===!1&&(En=it.apply(M,Ct)),En}};for(var ie in Ie.tokenizer)Z(ie);ve.tokenizer=M}(),Ie.walkTokens){var be=It.defaults.walkTokens;ve.walkTokens=function(M){Ie.walkTokens(M),be&&be(M)}}It.setOptions(ve)},It.walkTokens=function(Ie,ve){for(var be=Ae(Ie),M;!(M=be()).done;){var Z=M.value;switch(ve(Z),Z.type){case"table":{for(var ie=Ae(Z.tokens.header),le;!(le=ie()).done;){var _e=le.value;It.walkTokens(_e,ve)}for(var it=Ae(Z.tokens.cells),bt;!(bt=it()).done;)for(var Ct=bt.value,zt=Ae(Ct),En;!(En=zt()).done;){var Dn=En.value;It.walkTokens(Dn,ve)}break}case"list":{It.walkTokens(Z.items,ve);break}default:Z.tokens&&It.walkTokens(Z.tokens,ve)}}},It.parseInline=function(Ie,ve){if(typeof Ie=="undefined"||Ie===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ie!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ie)+", string expected");ve=We({},It.defaults,ve||{}),Mt(ve);try{var be=_t.lexInline(Ie,ve);return ve.walkTokens&&It.walkTokens(be,ve.walkTokens),nt.parseInline(be,ve)}catch(M){if(M.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+$t(M.message+"",!0)+"</pre>";throw M}},It.Parser=nt,It.parser=nt.parse,It.Renderer=ye,It.TextRenderer=wt,It.Lexer=_t,It.lexer=_t.lex,It.Tokenizer=lt,It.Slugger=Qe,It.parse=It;var en=It;return en})},11690:function(bn){const St=/[&<>"']/,k=/[&<>"']/g,A=/[<>"']|&(?!#?\w+;)/,ue=/[<>"']|&(?!#?\w+;)/g,Ae={"&":"&","<":"<",">":">",'"':""","'":"'"},ne=J=>Ae[J];function F(J,X){if(X){if(St.test(J))return J.replace(k,ne)}else if(A.test(J))return J.replace(ue,ne);return J}const g=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function oe(J){return J.replace(g,(X,xe)=>(xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""))}const q=/(^|[^\[])\^/g;function l(J,X){J=J.source||J,X=X||"";const xe={replace:(he,Ze)=>(Ze=Ze.source||Ze,Ze=Ze.replace(q,"$1"),J=J.replace(he,Ze),xe),getRegex:()=>new RegExp(J,X)};return xe}const S=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(J,X,xe){if(J){let he;try{he=decodeURIComponent(oe(xe)).replace(S,"").toLowerCase()}catch(Ze){return null}if(he.indexOf("javascript:")===0||he.indexOf("vbscript:")===0||he.indexOf("data:")===0)return null}X&&!T.test(xe)&&(xe=N(X,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(he){return null}return xe}const m={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,U=/^([^:]+:\/*[^/]*)[\s\S]*$/;function N(J,X){m[" "+J]||(y.test(J)?m[" "+J]=J+"/":m[" "+J]=O(J,"/",!0)),J=m[" "+J];const xe=J.indexOf(":")===-1;return X.substring(0,2)==="//"?xe?X:J.replace(x,"$1")+X:X.charAt(0)==="/"?xe?X:J.replace(U,"$1")+X:J+X}const V={exec:function(){}};function I(J){let X=1,xe,he;for(;X<arguments.length;X++){xe=arguments[X];for(he in xe)Object.prototype.hasOwnProperty.call(xe,he)&&(J[he]=xe[he])}return J}function L(J,X){const xe=J.replace(/\|/g,(K,R,B)=>{let G=!1,W=R;for(;--W>=0&&B[W]==="\\";)G=!G;return G?"|":" |"}),he=xe.split(/ \|/);let Ze=0;if(he.length>X)he.splice(X);else for(;he.length<X;)he.push("");for(;Ze<he.length;Ze++)he[Ze]=he[Ze].trim().replace(/\\\|/g,"|");return he}function O(J,X,xe){const he=J.length;if(he===0)return"";let Ze=0;for(;Ze<he;){const K=J.charAt(he-Ze-1);if(K===X&&!xe)Ze++;else if(K!==X&&xe)Ze++;else break}return J.substr(0,he-Ze)}function z(J,X){if(J.indexOf(X[1])===-1)return-1;const xe=J.length;let he=0,Ze=0;for(;Ze<xe;Ze++)if(J[Ze]==="\\")Ze++;else if(J[Ze]===X[0])he++;else if(J[Ze]===X[1]&&(he--,he<0))return Ze;return-1}function ee(J){J&&J.sanitize&&!J.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function re(J,X){if(X<1)return"";let xe="";for(;X>1;)X&1&&(xe+=J),X>>=1,J+=J;return xe+J}bn.exports={escape:F,unescape:oe,edit:l,cleanUrl:d,resolveUrl:N,noopTest:V,merge:I,splitCells:L,rtrim:O,findClosingBracket:z,checkSanitizeDeprecation:ee,repeatString:re}},75918:function(bn,St,k){"use strict";k.d(St,{Wi:function(){return g},Z0:function(){return oe},aU:function(){return F},eZ:function(){return l},wY:function(){return q}});var A=k(4348),ue=k(69323),Ae=k(13268),ne=function(S,T,d,m){function y(x){return x instanceof d?x:new d(function(U){U(x)})}return new(d||(d=Promise))(function(x,U){function N(L){try{I(m.next(L))}catch(O){U(O)}}function V(L){try{I(m.throw(L))}catch(O){U(O)}}function I(L){L.done?x(L.value):y(L.value).then(N,V)}I((m=m.apply(S,T||[])).next())})};class F extends ue.JT{constructor(T,d="",m="",y=!0,x){super(),this._onDidChange=this._register(new A.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=T,this._label=d,this._cssClass=m,this._enabled=y,this._actionCallback=x}get id(){return this._id}get label(){return this._label}set label(T){this._setLabel(T)}_setLabel(T){this._label!==T&&(this._label=T,this._onDidChange.fire({label:T}))}get tooltip(){return this._tooltip||""}set tooltip(T){this._setTooltip(T)}_setTooltip(T){this._tooltip!==T&&(this._tooltip=T,this._onDidChange.fire({tooltip:T}))}get class(){return this._cssClass}set class(T){this._setClass(T)}_setClass(T){this._cssClass!==T&&(this._cssClass=T,this._onDidChange.fire({class:T}))}get enabled(){return this._enabled}set enabled(T){this._setEnabled(T)}_setEnabled(T){this._enabled!==T&&(this._enabled=T,this._onDidChange.fire({enabled:T}))}get checked(){return this._checked}set checked(T){this._setChecked(T)}_setChecked(T){this._checked!==T&&(this._checked=T,this._onDidChange.fire({checked:T}))}run(T,d){return ne(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(T))})}}class g extends ue.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new A.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new A.Q5),this.onDidRun=this._onDidRun.event}run(T,d){return ne(this,void 0,void 0,function*(){if(!T.enabled)return;this._onBeforeRun.fire({action:T});let m;try{yield this.runAction(T,d)}catch(y){m=y}this._onDidRun.fire({action:T,error:m})})}runAction(T,d){return ne(this,void 0,void 0,function*(){yield T.run(d)})}}class oe extends F{constructor(T){super(oe.ID,T,T?"separator text":"separator"),this.checked=!1,this.enabled=!1}}oe.ID="vs.actions.separator";class q{constructor(T,d,m,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=T,this.label=d,this.class=y,this._actions=m}get actions(){return this._actions}dispose(){}run(){return ne(this,void 0,void 0,function*(){})}}class l extends F{constructor(){super(l.ID,Ae.N("submenu.empty","(empty)"),void 0,!1)}}l.ID="vs.actions.empty"},76068:function(bn,St,k){"use strict";k.d(St,{ok:function(){return A}});function A(ue,Ae){if(!ue)throw new Error(Ae?`Assertion failed (${Ae})`:"Assertion Failed")}},52615:function(bn,St,k){"use strict";k.d(St,{CM:function(){return F},JL:function(){return g},dT:function(){return q},fK:function(){return ne},lA:function(){return oe}});var A=k(4348);class ue{constructor(){this._icons=new Map,this._onDidRegister=new A.Q5}add(S){const T=this._icons.get(S.id);T?S.description?T.description=S.description:console.error(`Duplicate registration of codicon ${S.id}`):(this._icons.set(S.id,S),this._onDidRegister.fire(S))}get(S){return this._icons.get(S)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Ae=new ue,ne=Ae;function F(l,S){return new oe(l,S)}function g(l){return l?l.replace(/\$\((.*?)\)/g,(S,T)=>` ${T} `).trim():""}class oe{constructor(S,T,d){this.id=S,this.definition=T,this.description=d,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 q;(function(l){l.iconNameSegment="[A-Za-z0-9]+",l.iconNameExpression="[A-Za-z0-9\\-]+",l.iconModifierExpression="~[A-Za-z]+";const S=new RegExp(`^(${l.iconNameExpression})(${l.iconModifierExpression})?$`);function T(y){if(y instanceof oe)return["codicon","codicon-"+y.id];const x=S.exec(y.id);if(!x)return T(oe.error);let[,U,N]=x;const V=["codicon","codicon-"+U];return N&&V.push("codicon-modifier-"+N.substr(1)),V}l.asClassNameArray=T;function d(y){return T(y).join(" ")}l.asClassName=d;function m(y){return"."+T(y).join(".")}l.asCSSSelector=m})(q||(q={})),function(l){l.add=new l("add",{fontCharacter:"\\ea60"}),l.plus=new l("plus",l.add.definition),l.gistNew=new l("gist-new",l.add.definition),l.repoCreate=new l("repo-create",l.add.definition),l.lightbulb=new l("lightbulb",{fontCharacter:"\\ea61"}),l.lightBulb=new l("light-bulb",{fontCharacter:"\\ea61"}),l.repo=new l("repo",{fontCharacter:"\\ea62"}),l.repoDelete=new l("repo-delete",{fontCharacter:"\\ea62"}),l.gistFork=new l("gist-fork",{fontCharacter:"\\ea63"}),l.repoForked=new l("repo-forked",{fontCharacter:"\\ea63"}),l.gitPullRequest=new l("git-pull-request",{fontCharacter:"\\ea64"}),l.gitPullRequestAbandoned=new l("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),l.recordKeys=new l("record-keys",{fontCharacter:"\\ea65"}),l.keyboard=new l("keyboard",{fontCharacter:"\\ea65"}),l.tag=new l("tag",{fontCharacter:"\\ea66"}),l.tagAdd=new l("tag-add",{fontCharacter:"\\ea66"}),l.tagRemove=new l("tag-remove",{fontCharacter:"\\ea66"}),l.person=new l("person",{fontCharacter:"\\ea67"}),l.personFollow=new l("person-follow",{fontCharacter:"\\ea67"}),l.personOutline=new l("person-outline",{fontCharacter:"\\ea67"}),l.personFilled=new l("person-filled",{fontCharacter:"\\ea67"}),l.gitBranch=new l("git-branch",{fontCharacter:"\\ea68"}),l.gitBranchCreate=new l("git-branch-create",{fontCharacter:"\\ea68"}),l.gitBranchDelete=new l("git-branch-delete",{fontCharacter:"\\ea68"}),l.sourceControl=new l("source-control",{fontCharacter:"\\ea68"}),l.mirror=new l("mirror",{fontCharacter:"\\ea69"}),l.mirrorPublic=new l("mirror-public",{fontCharacter:"\\ea69"}),l.star=new l("star",{fontCharacter:"\\ea6a"}),l.starAdd=new l("star-add",{fontCharacter:"\\ea6a"}),l.starDelete=new l("star-delete",{fontCharacter:"\\ea6a"}),l.starEmpty=new l("star-empty",{fontCharacter:"\\ea6a"}),l.comment=new l("comment",{fontCharacter:"\\ea6b"}),l.commentAdd=new l("comment-add",{fontCharacter:"\\ea6b"}),l.alert=new l("alert",{fontCharacter:"\\ea6c"}),l.warning=new l("warning",{fontCharacter:"\\ea6c"}),l.search=new l("search",{fontCharacter:"\\ea6d"}),l.searchSave=new l("search-save",{fontCharacter:"\\ea6d"}),l.logOut=new l("log-out",{fontCharacter:"\\ea6e"}),l.signOut=new l("sign-out",{fontCharacter:"\\ea6e"}),l.logIn=new l("log-in",{fontCharacter:"\\ea6f"}),l.signIn=new l("sign-in",{fontCharacter:"\\ea6f"}),l.eye=new l("eye",{fontCharacter:"\\ea70"}),l.eyeUnwatch=new l("eye-unwatch",{fontCharacter:"\\ea70"}),l.eyeWatch=new l("eye-watch",{fontCharacter:"\\ea70"}),l.circleFilled=new l("circle-filled",{fontCharacter:"\\ea71"}),l.primitiveDot=new l("primitive-dot",{fontCharacter:"\\ea71"}),l.closeDirty=new l("close-dirty",{fontCharacter:"\\ea71"}),l.debugBreakpoint=new l("debug-breakpoint",{fontCharacter:"\\ea71"}),l.debugBreakpointDisabled=new l("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),l.debugHint=new l("debug-hint",{fontCharacter:"\\ea71"}),l.primitiveSquare=new l("primitive-square",{fontCharacter:"\\ea72"}),l.edit=new l("edit",{fontCharacter:"\\ea73"}),l.pencil=new l("pencil",{fontCharacter:"\\ea73"}),l.info=new l("info",{fontCharacter:"\\ea74"}),l.issueOpened=new l("issue-opened",{fontCharacter:"\\ea74"}),l.gistPrivate=new l("gist-private",{fontCharacter:"\\ea75"}),l.gitForkPrivate=new l("git-fork-private",{fontCharacter:"\\ea75"}),l.lock=new l("lock",{fontCharacter:"\\ea75"}),l.mirrorPrivate=new l("mirror-private",{fontCharacter:"\\ea75"}),l.close=new l("close",{fontCharacter:"\\ea76"}),l.removeClose=new l("remove-close",{fontCharacter:"\\ea76"}),l.x=new l("x",{fontCharacter:"\\ea76"}),l.repoSync=new l("repo-sync",{fontCharacter:"\\ea77"}),l.sync=new l("sync",{fontCharacter:"\\ea77"}),l.clone=new l("clone",{fontCharacter:"\\ea78"}),l.desktopDownload=new l("desktop-download",{fontCharacter:"\\ea78"}),l.beaker=new l("beaker",{fontCharacter:"\\ea79"}),l.microscope=new l("microscope",{fontCharacter:"\\ea79"}),l.vm=new l("vm",{fontCharacter:"\\ea7a"}),l.deviceDesktop=new l("device-desktop",{fontCharacter:"\\ea7a"}),l.file=new l("file",{fontCharacter:"\\ea7b"}),l.fileText=new l("file-text",{fontCharacter:"\\ea7b"}),l.more=new l("more",{fontCharacter:"\\ea7c"}),l.ellipsis=new l("ellipsis",{fontCharacter:"\\ea7c"}),l.kebabHorizontal=new l("kebab-horizontal",{fontCharacter:"\\ea7c"}),l.mailReply=new l("mail-reply",{fontCharacter:"\\ea7d"}),l.reply=new l("reply",{fontCharacter:"\\ea7d"}),l.organization=new l("organization",{fontCharacter:"\\ea7e"}),l.organizationFilled=new l("organization-filled",{fontCharacter:"\\ea7e"}),l.organizationOutline=new l("organization-outline",{fontCharacter:"\\ea7e"}),l.newFile=new l("new-file",{fontCharacter:"\\ea7f"}),l.fileAdd=new l("file-add",{fontCharacter:"\\ea7f"}),l.newFolder=new l("new-folder",{fontCharacter:"\\ea80"}),l.fileDirectoryCreate=new l("file-directory-create",{fontCharacter:"\\ea80"}),l.trash=new l("trash",{fontCharacter:"\\ea81"}),l.trashcan=new l("trashcan",{fontCharacter:"\\ea81"}),l.history=new l("history",{fontCharacter:"\\ea82"}),l.clock=new l("clock",{fontCharacter:"\\ea82"}),l.folder=new l("folder",{fontCharacter:"\\ea83"}),l.fileDirectory=new l("file-directory",{fontCharacter:"\\ea83"}),l.symbolFolder=new l("symbol-folder",{fontCharacter:"\\ea83"}),l.logoGithub=new l("logo-github",{fontCharacter:"\\ea84"}),l.markGithub=new l("mark-github",{fontCharacter:"\\ea84"}),l.github=new l("github",{fontCharacter:"\\ea84"}),l.terminal=new l("terminal",{fontCharacter:"\\ea85"}),l.console=new l("console",{fontCharacter:"\\ea85"}),l.repl=new l("repl",{fontCharacter:"\\ea85"}),l.zap=new l("zap",{fontCharacter:"\\ea86"}),l.symbolEvent=new l("symbol-event",{fontCharacter:"\\ea86"}),l.error=new l("error",{fontCharacter:"\\ea87"}),l.stop=new l("stop",{fontCharacter:"\\ea87"}),l.variable=new l("variable",{fontCharacter:"\\ea88"}),l.symbolVariable=new l("symbol-variable",{fontCharacter:"\\ea88"}),l.array=new l("array",{fontCharacter:"\\ea8a"}),l.symbolArray=new l("symbol-array",{fontCharacter:"\\ea8a"}),l.symbolModule=new l("symbol-module",{fontCharacter:"\\ea8b"}),l.symbolPackage=new l("symbol-package",{fontCharacter:"\\ea8b"}),l.symbolNamespace=new l("symbol-namespace",{fontCharacter:"\\ea8b"}),l.symbolObject=new l("symbol-object",{fontCharacter:"\\ea8b"}),l.symbolMethod=new l("symbol-method",{fontCharacter:"\\ea8c"}),l.symbolFunction=new l("symbol-function",{fontCharacter:"\\ea8c"}),l.symbolConstructor=new l("symbol-constructor",{fontCharacter:"\\ea8c"}),l.symbolBoolean=new l("symbol-boolean",{fontCharacter:"\\ea8f"}),l.symbolNull=new l("symbol-null",{fontCharacter:"\\ea8f"}),l.symbolNumeric=new l("symbol-numeric",{fontCharacter:"\\ea90"}),l.symbolNumber=new l("symbol-number",{fontCharacter:"\\ea90"}),l.symbolStructure=new l("symbol-structure",{fontCharacter:"\\ea91"}),l.symbolStruct=new l("symbol-struct",{fontCharacter:"\\ea91"}),l.symbolParameter=new l("symbol-parameter",{fontCharacter:"\\ea92"}),l.symbolTypeParameter=new l("symbol-type-parameter",{fontCharacter:"\\ea92"}),l.symbolKey=new l("symbol-key",{fontCharacter:"\\ea93"}),l.symbolText=new l("symbol-text",{fontCharacter:"\\ea93"}),l.symbolReference=new l("symbol-reference",{fontCharacter:"\\ea94"}),l.goToFile=new l("go-to-file",{fontCharacter:"\\ea94"}),l.symbolEnum=new l("symbol-enum",{fontCharacter:"\\ea95"}),l.symbolValue=new l("symbol-value",{fontCharacter:"\\ea95"}),l.symbolRuler=new l("symbol-ruler",{fontCharacter:"\\ea96"}),l.symbolUnit=new l("symbol-unit",{fontCharacter:"\\ea96"}),l.activateBreakpoints=new l("activate-breakpoints",{fontCharacter:"\\ea97"}),l.archive=new l("archive",{fontCharacter:"\\ea98"}),l.arrowBoth=new l("arrow-both",{fontCharacter:"\\ea99"}),l.arrowDown=new l("arrow-down",{fontCharacter:"\\ea9a"}),l.arrowLeft=new l("arrow-left",{fontCharacter:"\\ea9b"}),l.arrowRight=new l("arrow-right",{fontCharacter:"\\ea9c"}),l.arrowSmallDown=new l("arrow-small-down",{fontCharacter:"\\ea9d"}),l.arrowSmallLeft=new l("arrow-small-left",{fontCharacter:"\\ea9e"}),l.arrowSmallRight=new l("arrow-small-right",{fontCharacter:"\\ea9f"}),l.arrowSmallUp=new l("arrow-small-up",{fontCharacter:"\\eaa0"}),l.arrowUp=new l("arrow-up",{fontCharacter:"\\eaa1"}),l.bell=new l("bell",{fontCharacter:"\\eaa2"}),l.bold=new l("bold",{fontCharacter:"\\eaa3"}),l.book=new l("book",{fontCharacter:"\\eaa4"}),l.bookmark=new l("bookmark",{fontCharacter:"\\eaa5"}),l.debugBreakpointConditionalUnverified=new l("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),l.debugBreakpointConditional=new l("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),l.debugBreakpointConditionalDisabled=new l("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),l.debugBreakpointDataUnverified=new l("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),l.debugBreakpointData=new l("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),l.debugBreakpointDataDisabled=new l("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),l.debugBreakpointLogUnverified=new l("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),l.debugBreakpointLog=new l("debug-breakpoint-log",{fontCharacter:"\\eaab"}),l.debugBreakpointLogDisabled=new l("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),l.briefcase=new l("briefcase",{fontCharacter:"\\eaac"}),l.broadcast=new l("broadcast",{fontCharacter:"\\eaad"}),l.browser=new l("browser",{fontCharacter:"\\eaae"}),l.bug=new l("bug",{fontCharacter:"\\eaaf"}),l.calendar=new l("calendar",{fontCharacter:"\\eab0"}),l.caseSensitive=new l("case-sensitive",{fontCharacter:"\\eab1"}),l.check=new l("check",{fontCharacter:"\\eab2"}),l.checklist=new l("checklist",{fontCharacter:"\\eab3"}),l.chevronDown=new l("chevron-down",{fontCharacter:"\\eab4"}),l.dropDownButton=new l("drop-down-button",l.chevronDown.definition),l.chevronLeft=new l("chevron-left",{fontCharacter:"\\eab5"}),l.chevronRight=new l("chevron-right",{fontCharacter:"\\eab6"}),l.chevronUp=new l("chevron-up",{fontCharacter:"\\eab7"}),l.chromeClose=new l("chrome-close",{fontCharacter:"\\eab8"}),l.chromeMaximize=new l("chrome-maximize",{fontCharacter:"\\eab9"}),l.chromeMinimize=new l("chrome-minimize",{fontCharacter:"\\eaba"}),l.chromeRestore=new l("chrome-restore",{fontCharacter:"\\eabb"}),l.circleOutline=new l("circle-outline",{fontCharacter:"\\eabc"}),l.debugBreakpointUnverified=new l("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),l.circleSlash=new l("circle-slash",{fontCharacter:"\\eabd"}),l.circuitBoard=new l("circuit-board",{fontCharacter:"\\eabe"}),l.clearAll=new l("clear-all",{fontCharacter:"\\eabf"}),l.clippy=new l("clippy",{fontCharacter:"\\eac0"}),l.closeAll=new l("close-all",{fontCharacter:"\\eac1"}),l.cloudDownload=new l("cloud-download",{fontCharacter:"\\eac2"}),l.cloudUpload=new l("cloud-upload",{fontCharacter:"\\eac3"}),l.code=new l("code",{fontCharacter:"\\eac4"}),l.collapseAll=new l("collapse-all",{fontCharacter:"\\eac5"}),l.colorMode=new l("color-mode",{fontCharacter:"\\eac6"}),l.commentDiscussion=new l("comment-discussion",{fontCharacter:"\\eac7"}),l.compareChanges=new l("compare-changes",{fontCharacter:"\\eafd"}),l.creditCard=new l("credit-card",{fontCharacter:"\\eac9"}),l.dash=new l("dash",{fontCharacter:"\\eacc"}),l.dashboard=new l("dashboard",{fontCharacter:"\\eacd"}),l.database=new l("database",{fontCharacter:"\\eace"}),l.debugContinue=new l("debug-continue",{fontCharacter:"\\eacf"}),l.debugDisconnect=new l("debug-disconnect",{fontCharacter:"\\ead0"}),l.debugPause=new l("debug-pause",{fontCharacter:"\\ead1"}),l.debugRestart=new l("debug-restart",{fontCharacter:"\\ead2"}),l.debugStart=new l("debug-start",{fontCharacter:"\\ead3"}),l.debugStepInto=new l("debug-step-into",{fontCharacter:"\\ead4"}),l.debugStepOut=new l("debug-step-out",{fontCharacter:"\\ead5"}),l.debugStepOver=new l("debug-step-over",{fontCharacter:"\\ead6"}),l.debugStop=new l("debug-stop",{fontCharacter:"\\ead7"}),l.debug=new l("debug",{fontCharacter:"\\ead8"}),l.deviceCameraVideo=new l("device-camera-video",{fontCharacter:"\\ead9"}),l.deviceCamera=new l("device-camera",{fontCharacter:"\\eada"}),l.deviceMobile=new l("device-mobile",{fontCharacter:"\\eadb"}),l.diffAdded=new l("diff-added",{fontCharacter:"\\eadc"}),l.diffIgnored=new l("diff-ignored",{fontCharacter:"\\eadd"}),l.diffModified=new l("diff-modified",{fontCharacter:"\\eade"}),l.diffRemoved=new l("diff-removed",{fontCharacter:"\\eadf"}),l.diffRenamed=new l("diff-renamed",{fontCharacter:"\\eae0"}),l.diff=new l("diff",{fontCharacter:"\\eae1"}),l.discard=new l("discard",{fontCharacter:"\\eae2"}),l.editorLayout=new l("editor-layout",{fontCharacter:"\\eae3"}),l.emptyWindow=new l("empty-window",{fontCharacter:"\\eae4"}),l.exclude=new l("exclude",{fontCharacter:"\\eae5"}),l.extensions=new l("extensions",{fontCharacter:"\\eae6"}),l.eyeClosed=new l("eye-closed",{fontCharacter:"\\eae7"}),l.fileBinary=new l("file-binary",{fontCharacter:"\\eae8"}),l.fileCode=new l("file-code",{fontCharacter:"\\eae9"}),l.fileMedia=new l("file-media",{fontCharacter:"\\eaea"}),l.filePdf=new l("file-pdf",{fontCharacter:"\\eaeb"}),l.fileSubmodule=new l("file-submodule",{fontCharacter:"\\eaec"}),l.fileSymlinkDirectory=new l("file-symlink-directory",{fontCharacter:"\\eaed"}),l.fileSymlinkFile=new l("file-symlink-file",{fontCharacter:"\\eaee"}),l.fileZip=new l("file-zip",{fontCharacter:"\\eaef"}),l.files=new l("files",{fontCharacter:"\\eaf0"}),l.filter=new l("filter",{fontCharacter:"\\eaf1"}),l.flame=new l("flame",{fontCharacter:"\\eaf2"}),l.foldDown=new l("fold-down",{fontCharacter:"\\eaf3"}),l.foldUp=new l("fold-up",{fontCharacter:"\\eaf4"}),l.fold=new l("fold",{fontCharacter:"\\eaf5"}),l.folderActive=new l("folder-active",{fontCharacter:"\\eaf6"}),l.folderOpened=new l("folder-opened",{fontCharacter:"\\eaf7"}),l.gear=new l("gear",{fontCharacter:"\\eaf8"}),l.gift=new l("gift",{fontCharacter:"\\eaf9"}),l.gistSecret=new l("gist-secret",{fontCharacter:"\\eafa"}),l.gist=new l("gist",{fontCharacter:"\\eafb"}),l.gitCommit=new l("git-commit",{fontCharacter:"\\eafc"}),l.gitCompare=new l("git-compare",{fontCharacter:"\\eafd"}),l.gitMerge=new l("git-merge",{fontCharacter:"\\eafe"}),l.githubAction=new l("github-action",{fontCharacter:"\\eaff"}),l.githubAlt=new l("github-alt",{fontCharacter:"\\eb00"}),l.globe=new l("globe",{fontCharacter:"\\eb01"}),l.grabber=new l("grabber",{fontCharacter:"\\eb02"}),l.graph=new l("graph",{fontCharacter:"\\eb03"}),l.gripper=new l("gripper",{fontCharacter:"\\eb04"}),l.heart=new l("heart",{fontCharacter:"\\eb05"}),l.home=new l("home",{fontCharacter:"\\eb06"}),l.horizontalRule=new l("horizontal-rule",{fontCharacter:"\\eb07"}),l.hubot=new l("hubot",{fontCharacter:"\\eb08"}),l.inbox=new l("inbox",{fontCharacter:"\\eb09"}),l.issueClosed=new l("issue-closed",{fontCharacter:"\\eba4"}),l.issueReopened=new l("issue-reopened",{fontCharacter:"\\eb0b"}),l.issues=new l("issues",{fontCharacter:"\\eb0c"}),l.italic=new l("italic",{fontCharacter:"\\eb0d"}),l.jersey=new l("jersey",{fontCharacter:"\\eb0e"}),l.json=new l("json",{fontCharacter:"\\eb0f"}),l.kebabVertical=new l("kebab-vertical",{fontCharacter:"\\eb10"}),l.key=new l("key",{fontCharacter:"\\eb11"}),l.law=new l("law",{fontCharacter:"\\eb12"}),l.lightbulbAutofix=new l("lightbulb-autofix",{fontCharacter:"\\eb13"}),l.linkExternal=new l("link-external",{fontCharacter:"\\eb14"}),l.link=new l("link",{fontCharacter:"\\eb15"}),l.listOrdered=new l("list-ordered",{fontCharacter:"\\eb16"}),l.listUnordered=new l("list-unordered",{fontCharacter:"\\eb17"}),l.liveShare=new l("live-share",{fontCharacter:"\\eb18"}),l.loading=new l("loading",{fontCharacter:"\\eb19"}),l.location=new l("location",{fontCharacter:"\\eb1a"}),l.mailRead=new l("mail-read",{fontCharacter:"\\eb1b"}),l.mail=new l("mail",{fontCharacter:"\\eb1c"}),l.markdown=new l("markdown",{fontCharacter:"\\eb1d"}),l.megaphone=new l("megaphone",{fontCharacter:"\\eb1e"}),l.mention=new l("mention",{fontCharacter:"\\eb1f"}),l.milestone=new l("milestone",{fontCharacter:"\\eb20"}),l.mortarBoard=new l("mortar-board",{fontCharacter:"\\eb21"}),l.move=new l("move",{fontCharacter:"\\eb22"}),l.multipleWindows=new l("multiple-windows",{fontCharacter:"\\eb23"}),l.mute=new l("mute",{fontCharacter:"\\eb24"}),l.noNewline=new l("no-newline",{fontCharacter:"\\eb25"}),l.note=new l("note",{fontCharacter:"\\eb26"}),l.octoface=new l("octoface",{fontCharacter:"\\eb27"}),l.openPreview=new l("open-preview",{fontCharacter:"\\eb28"}),l.package_=new l("package",{fontCharacter:"\\eb29"}),l.paintcan=new l("paintcan",{fontCharacter:"\\eb2a"}),l.pin=new l("pin",{fontCharacter:"\\eb2b"}),l.play=new l("play",{fontCharacter:"\\eb2c"}),l.run=new l("run",{fontCharacter:"\\eb2c"}),l.plug=new l("plug",{fontCharacter:"\\eb2d"}),l.preserveCase=new l("preserve-case",{fontCharacter:"\\eb2e"}),l.preview=new l("preview",{fontCharacter:"\\eb2f"}),l.project=new l("project",{fontCharacter:"\\eb30"}),l.pulse=new l("pulse",{fontCharacter:"\\eb31"}),l.question=new l("question",{fontCharacter:"\\eb32"}),l.quote=new l("quote",{fontCharacter:"\\eb33"}),l.radioTower=new l("radio-tower",{fontCharacter:"\\eb34"}),l.reactions=new l("reactions",{fontCharacter:"\\eb35"}),l.references=new l("references",{fontCharacter:"\\eb36"}),l.refresh=new l("refresh",{fontCharacter:"\\eb37"}),l.regex=new l("regex",{fontCharacter:"\\eb38"}),l.remoteExplorer=new l("remote-explorer",{fontCharacter:"\\eb39"}),l.remote=new l("remote",{fontCharacter:"\\eb3a"}),l.remove=new l("remove",{fontCharacter:"\\eb3b"}),l.replaceAll=new l("replace-all",{fontCharacter:"\\eb3c"}),l.replace=new l("replace",{fontCharacter:"\\eb3d"}),l.repoClone=new l("repo-clone",{fontCharacter:"\\eb3e"}),l.repoForcePush=new l("repo-force-push",{fontCharacter:"\\eb3f"}),l.repoPull=new l("repo-pull",{fontCharacter:"\\eb40"}),l.repoPush=new l("repo-push",{fontCharacter:"\\eb41"}),l.report=new l("report",{fontCharacter:"\\eb42"}),l.requestChanges=new l("request-changes",{fontCharacter:"\\eb43"}),l.rocket=new l("rocket",{fontCharacter:"\\eb44"}),l.rootFolderOpened=new l("root-folder-opened",{fontCharacter:"\\eb45"}),l.rootFolder=new l("root-folder",{fontCharacter:"\\eb46"}),l.rss=new l("rss",{fontCharacter:"\\eb47"}),l.ruby=new l("ruby",{fontCharacter:"\\eb48"}),l.saveAll=new l("save-all",{fontCharacter:"\\eb49"}),l.saveAs=new l("save-as",{fontCharacter:"\\eb4a"}),l.save=new l("save",{fontCharacter:"\\eb4b"}),l.screenFull=new l("screen-full",{fontCharacter:"\\eb4c"}),l.screenNormal=new l("screen-normal",{fontCharacter:"\\eb4d"}),l.searchStop=new l("search-stop",{fontCharacter:"\\eb4e"}),l.server=new l("server",{fontCharacter:"\\eb50"}),l.settingsGear=new l("settings-gear",{fontCharacter:"\\eb51"}),l.settings=new l("settings",{fontCharacter:"\\eb52"}),l.shield=new l("shield",{fontCharacter:"\\eb53"}),l.smiley=new l("smiley",{fontCharacter:"\\eb54"}),l.sortPrecedence=new l("sort-precedence",{fontCharacter:"\\eb55"}),l.splitHorizontal=new l("split-horizontal",{fontCharacter:"\\eb56"}),l.splitVertical=new l("split-vertical",{fontCharacter:"\\eb57"}),l.squirrel=new l("squirrel",{fontCharacter:"\\eb58"}),l.starFull=new l("star-full",{fontCharacter:"\\eb59"}),l.starHalf=new l("star-half",{fontCharacter:"\\eb5a"}),l.symbolClass=new l("symbol-class",{fontCharacter:"\\eb5b"}),l.symbolColor=new l("symbol-color",{fontCharacter:"\\eb5c"}),l.symbolConstant=new l("symbol-constant",{fontCharacter:"\\eb5d"}),l.symbolEnumMember=new l("symbol-enum-member",{fontCharacter:"\\eb5e"}),l.symbolField=new l("symbol-field",{fontCharacter:"\\eb5f"}),l.symbolFile=new l("symbol-file",{fontCharacter:"\\eb60"}),l.symbolInterface=new l("symbol-interface",{fontCharacter:"\\eb61"}),l.symbolKeyword=new l("symbol-keyword",{fontCharacter:"\\eb62"}),l.symbolMisc=new l("symbol-misc",{fontCharacter:"\\eb63"}),l.symbolOperator=new l("symbol-operator",{fontCharacter:"\\eb64"}),l.symbolProperty=new l("symbol-property",{fontCharacter:"\\eb65"}),l.wrench=new l("wrench",{fontCharacter:"\\eb65"}),l.wrenchSubaction=new l("wrench-subaction",{fontCharacter:"\\eb65"}),l.symbolSnippet=new l("symbol-snippet",{fontCharacter:"\\eb66"}),l.tasklist=new l("tasklist",{fontCharacter:"\\eb67"}),l.telescope=new l("telescope",{fontCharacter:"\\eb68"}),l.textSize=new l("text-size",{fontCharacter:"\\eb69"}),l.threeBars=new l("three-bars",{fontCharacter:"\\eb6a"}),l.thumbsdown=new l("thumbsdown",{fontCharacter:"\\eb6b"}),l.thumbsup=new l("thumbsup",{fontCharacter:"\\eb6c"}),l.tools=new l("tools",{fontCharacter:"\\eb6d"}),l.triangleDown=new l("triangle-down",{fontCharacter:"\\eb6e"}),l.triangleLeft=new l("triangle-left",{fontCharacter:"\\eb6f"}),l.triangleRight=new l("triangle-right",{fontCharacter:"\\eb70"}),l.triangleUp=new l("triangle-up",{fontCharacter:"\\eb71"}),l.twitter=new l("twitter",{fontCharacter:"\\eb72"}),l.unfold=new l("unfold",{fontCharacter:"\\eb73"}),l.unlock=new l("unlock",{fontCharacter:"\\eb74"}),l.unmute=new l("unmute",{fontCharacter:"\\eb75"}),l.unverified=new l("unverified",{fontCharacter:"\\eb76"}),l.verified=new l("verified",{fontCharacter:"\\eb77"}),l.versions=new l("versions",{fontCharacter:"\\eb78"}),l.vmActive=new l("vm-active",{fontCharacter:"\\eb79"}),l.vmOutline=new l("vm-outline",{fontCharacter:"\\eb7a"}),l.vmRunning=new l("vm-running",{fontCharacter:"\\eb7b"}),l.watch=new l("watch",{fontCharacter:"\\eb7c"}),l.whitespace=new l("whitespace",{fontCharacter:"\\eb7d"}),l.wholeWord=new l("whole-word",{fontCharacter:"\\eb7e"}),l.window=new l("window",{fontCharacter:"\\eb7f"}),l.wordWrap=new l("word-wrap",{fontCharacter:"\\eb80"}),l.zoomIn=new l("zoom-in",{fontCharacter:"\\eb81"}),l.zoomOut=new l("zoom-out",{fontCharacter:"\\eb82"}),l.listFilter=new l("list-filter",{fontCharacter:"\\eb83"}),l.listFlat=new l("list-flat",{fontCharacter:"\\eb84"}),l.listSelection=new l("list-selection",{fontCharacter:"\\eb85"}),l.selection=new l("selection",{fontCharacter:"\\eb85"}),l.listTree=new l("list-tree",{fontCharacter:"\\eb86"}),l.debugBreakpointFunctionUnverified=new l("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),l.debugBreakpointFunction=new l("debug-breakpoint-function",{fontCharacter:"\\eb88"}),l.debugBreakpointFunctionDisabled=new l("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),l.debugStackframeActive=new l("debug-stackframe-active",{fontCharacter:"\\eb89"}),l.debugStackframeDot=new l("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),l.debugStackframe=new l("debug-stackframe",{fontCharacter:"\\eb8b"}),l.debugStackframeFocused=new l("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),l.debugBreakpointUnsupported=new l("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),l.symbolString=new l("symbol-string",{fontCharacter:"\\eb8d"}),l.debugReverseContinue=new l("debug-reverse-continue",{fontCharacter:"\\eb8e"}),l.debugStepBack=new l("debug-step-back",{fontCharacter:"\\eb8f"}),l.debugRestartFrame=new l("debug-restart-frame",{fontCharacter:"\\eb90"}),l.callIncoming=new l("call-incoming",{fontCharacter:"\\eb92"}),l.callOutgoing=new l("call-outgoing",{fontCharacter:"\\eb93"}),l.menu=new l("menu",{fontCharacter:"\\eb94"}),l.expandAll=new l("expand-all",{fontCharacter:"\\eb95"}),l.feedback=new l("feedback",{fontCharacter:"\\eb96"}),l.groupByRefType=new l("group-by-ref-type",{fontCharacter:"\\eb97"}),l.ungroupByRefType=new l("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),l.account=new l("account",{fontCharacter:"\\eb99"}),l.bellDot=new l("bell-dot",{fontCharacter:"\\eb9a"}),l.debugConsole=new l("debug-console",{fontCharacter:"\\eb9b"}),l.library=new l("library",{fontCharacter:"\\eb9c"}),l.output=new l("output",{fontCharacter:"\\eb9d"}),l.runAll=new l("run-all",{fontCharacter:"\\eb9e"}),l.syncIgnored=new l("sync-ignored",{fontCharacter:"\\eb9f"}),l.pinned=new l("pinned",{fontCharacter:"\\eba0"}),l.githubInverted=new l("github-inverted",{fontCharacter:"\\eba1"}),l.debugAlt=new l("debug-alt",{fontCharacter:"\\eb91"}),l.serverProcess=new l("server-process",{fontCharacter:"\\eba2"}),l.serverEnvironment=new l("server-environment",{fontCharacter:"\\eba3"}),l.pass=new l("pass",{fontCharacter:"\\eba4"}),l.stopCircle=new l("stop-circle",{fontCharacter:"\\eba5"}),l.playCircle=new l("play-circle",{fontCharacter:"\\eba6"}),l.record=new l("record",{fontCharacter:"\\eba7"}),l.debugAltSmall=new l("debug-alt-small",{fontCharacter:"\\eba8"}),l.vmConnect=new l("vm-connect",{fontCharacter:"\\eba9"}),l.cloud=new l("cloud",{fontCharacter:"\\ebaa"}),l.merge=new l("merge",{fontCharacter:"\\ebab"}),l.exportIcon=new l("export",{fontCharacter:"\\ebac"}),l.graphLeft=new l("graph-left",{fontCharacter:"\\ebad"}),l.magnet=new l("magnet",{fontCharacter:"\\ebae"}),l.notebook=new l("notebook",{fontCharacter:"\\ebaf"}),l.redo=new l("redo",{fontCharacter:"\\ebb0"}),l.checkAll=new l("check-all",{fontCharacter:"\\ebb1"}),l.pinnedDirty=new l("pinned-dirty",{fontCharacter:"\\ebb2"}),l.passFilled=new l("pass-filled",{fontCharacter:"\\ebb3"}),l.circleLargeFilled=new l("circle-large-filled",{fontCharacter:"\\ebb4"}),l.circleLargeOutline=new l("circle-large-outline",{fontCharacter:"\\ebb5"}),l.combine=new l("combine",{fontCharacter:"\\ebb6"}),l.gather=new l("gather",{fontCharacter:"\\ebb6"}),l.table=new l("table",{fontCharacter:"\\ebb7"}),l.variableGroup=new l("variable-group",{fontCharacter:"\\ebb8"}),l.typeHierarchy=new l("type-hierarchy",{fontCharacter:"\\ebb9"}),l.typeHierarchySub=new l("type-hierarchy-sub",{fontCharacter:"\\ebba"}),l.typeHierarchySuper=new l("type-hierarchy-super",{fontCharacter:"\\ebbb"}),l.gitPullRequestCreate=new l("git-pull-request-create",{fontCharacter:"\\ebbc"}),l.runAbove=new l("run-above",{fontCharacter:"\\ebbd"}),l.runBelow=new l("run-below",{fontCharacter:"\\ebbe"}),l.notebookTemplate=new l("notebook-template",{fontCharacter:"\\ebbf"}),l.debugRerun=new l("debug-rerun",{fontCharacter:"\\ebc0"}),l.workspaceTrusted=new l("workspace-trusted",{fontCharacter:"\\ebc1"}),l.workspaceUntrusted=new l("workspace-untrusted",{fontCharacter:"\\ebc2"}),l.workspaceUnspecified=new l("workspace-unspecified",{fontCharacter:"\\ebc3"}),l.terminalCmd=new l("terminal-cmd",{fontCharacter:"\\ebc4"}),l.terminalDebian=new l("terminal-debian",{fontCharacter:"\\ebc5"}),l.terminalLinux=new l("terminal-linux",{fontCharacter:"\\ebc6"}),l.terminalPowershell=new l("terminal-powershell",{fontCharacter:"\\ebc7"}),l.terminalTmux=new l("terminal-tmux",{fontCharacter:"\\ebc8"}),l.terminalUbuntu=new l("terminal-ubuntu",{fontCharacter:"\\ebc9"}),l.terminalBash=new l("terminal-bash",{fontCharacter:"\\ebca"}),l.arrowSwap=new l("arrow-swap",{fontCharacter:"\\ebcb"}),l.copy=new l("copy",{fontCharacter:"\\ebcc"}),l.personAdd=new l("person-add",{fontCharacter:"\\ebcd"}),l.filterFilled=new l("filter-filled",{fontCharacter:"\\ebce"}),l.wand=new l("wand",{fontCharacter:"\\ebcf"}),l.debugLineByLine=new l("debug-line-by-line",{fontCharacter:"\\ebd0"}),l.inspect=new l("inspect",{fontCharacter:"\\ebd1"}),l.layers=new l("layers",{fontCharacter:"\\ebd2"}),l.layersDot=new l("layers-dot",{fontCharacter:"\\ebd3"}),l.layersActive=new l("layers-active",{fontCharacter:"\\ebd4"}),l.compass=new l("compass",{fontCharacter:"\\ebd5"}),l.compassDot=new l("compass-dot",{fontCharacter:"\\ebd6"}),l.compassActive=new l("compass-active",{fontCharacter:"\\ebd7"}),l.azure=new l("azure",{fontCharacter:"\\ebd8"}),l.issueDraft=new l("issue-draft",{fontCharacter:"\\ebd9"}),l.gitPullRequestClosed=new l("git-pull-request-closed",{fontCharacter:"\\ebda"}),l.gitPullRequestDraft=new l("git-pull-request-draft",{fontCharacter:"\\ebdb"}),l.debugAll=new l("debug-all",{fontCharacter:"\\ebdc"}),l.debugCoverage=new l("debug-coverage",{fontCharacter:"\\ebdd"}),l.runErrors=new l("run-errors",{fontCharacter:"\\ebde"}),l.folderLibrary=new l("folder-library",{fontCharacter:"\\ebdf"}),l.debugContinueSmall=new l("debug-continue-small",{fontCharacter:"\\ebe0"}),l.beakerStop=new l("beaker-stop",{fontCharacter:"\\ebe1"}),l.graphLine=new l("graph-line",{fontCharacter:"\\ebe2"}),l.graphScatter=new l("graph-scatter",{fontCharacter:"\\ebe3"}),l.pieChart=new l("pie-chart",{fontCharacter:"\\ebe4"}),l.bracket=new l("bracket",l.json.definition),l.bracketDot=new l("bracket-dot",{fontCharacter:"\\ebe5"}),l.bracketError=new l("bracket-error",{fontCharacter:"\\ebe6"}),l.lockSmall=new l("lock-small",{fontCharacter:"\\ebe7"}),l.azureDevops=new l("azure-devops",{fontCharacter:"\\ebe8"}),l.verifiedFilled=new l("verified-filled",{fontCharacter:"\\ebe9"})}(oe||(oe={}))},79881:function(bn,St,k){"use strict";k.d(St,{B8:function(){return T},Cp:function(){return ne},F0:function(){return q},L6:function(){return S},VV:function(){return oe},b1:function(){return l},dL:function(){return Ae},ri:function(){return F}});class A{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(y=>{y(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const ue=new A;function Ae(d){oe(d)||ue.onUnexpectedError(d)}function ne(d){oe(d)||ue.onUnexpectedExternalError(d)}function F(d){if(d instanceof Error){let{name:m,message:y}=d;const x=d.stacktrace||d.stack;return{$isError:!0,name:m,message:y,stack:x}}return d}const g="Canceled";function oe(d){return d instanceof Error&&d.name===g&&d.message===g}function q(){const d=new Error(g);return d.name=d.message,d}function l(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function S(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class T extends Error{constructor(m){super("NotSupported"),m&&(this.message=m)}}},4348:function(bn,St,k){"use strict";k.d(St,{D0:function(){return T},E7:function(){return d},K3:function(){return S},Q5:function(){return l},ZD:function(){return m},ju:function(){return F}});var A=k(79881),ue=k(69323),Ae=k(34502),ne=k(95830),F;(function(y){y.None=()=>ue.JT.None;function x(B){return(G,W=null,H)=>{let _=!1,v;return v=B(C=>{if(!_)return v?v.dispose():_=!0,G.call(W,C)},null,H),_&&v.dispose(),v}}y.once=x;function U(B,G){return z((W,H=null,_)=>B(v=>W.call(H,G(v)),null,_))}y.map=U;function N(B,G){return z((W,H=null,_)=>B(v=>{G(v),W.call(H,v)},null,_))}y.forEach=N;function V(B,G){return z((W,H=null,_)=>B(v=>G(v)&&W.call(H,v),null,_))}y.filter=V;function I(B){return B}y.signal=I;function L(...B){return(G,W=null,H)=>(0,ue.F8)(...B.map(_=>_(v=>G.call(W,v),null,H)))}y.any=L;function O(B,G,W){let H=W;return U(B,_=>(H=G(H,_),H))}y.reduce=O;function z(B){let G;const W=new l({onFirstListenerAdd(){G=B(W.fire,W)},onLastListenerRemove(){G.dispose()}});return W.event}function ee(B,G,W=100,H=!1,_){let v,C,Y,Se=0;const Re=new l({leakWarningThreshold:_,onFirstListenerAdd(){v=B(Ye=>{Se++,C=G(C,Ye),H&&!Y&&(Re.fire(C),C=void 0),clearTimeout(Y),Y=setTimeout(()=>{const He=C;C=void 0,Y=void 0,(!H||Se>1)&&Re.fire(He),Se=0},W)})},onLastListenerRemove(){v.dispose()}});return Re.event}y.debounce=ee;function re(B,G=(W,H)=>W===H){let W=!0,H;return V(B,_=>{const v=W||!G(_,H);return W=!1,H=_,v})}y.latch=re;function J(B,G){return[y.filter(B,G),y.filter(B,W=>!G(W))]}y.split=J;function X(B,G=!1,W=[]){let H=W.slice(),_=B(Y=>{H?H.push(Y):C.fire(Y)});const v=()=>{H&&H.forEach(Y=>C.fire(Y)),H=null},C=new l({onFirstListenerAdd(){_||(_=B(Y=>C.fire(Y)))},onFirstListenerDidAdd(){H&&(G?setTimeout(v):v())},onLastListenerRemove(){_&&_.dispose(),_=null}});return C.event}y.buffer=X;class xe{constructor(G){this.event=G}map(G){return new xe(U(this.event,G))}forEach(G){return new xe(N(this.event,G))}filter(G){return new xe(V(this.event,G))}reduce(G,W){return new xe(O(this.event,G,W))}latch(){return new xe(re(this.event))}debounce(G,W=100,H=!1,_){return new xe(ee(this.event,G,W,H,_))}on(G,W,H){return this.event(G,W,H)}once(G,W,H){return x(this.event)(G,W,H)}}function he(B){return new xe(B)}y.chain=he;function Ze(B,G,W=H=>H){const H=(...Y)=>C.fire(W(...Y)),_=()=>B.on(G,H),v=()=>B.removeListener(G,H),C=new l({onFirstListenerAdd:_,onLastListenerRemove:v});return C.event}y.fromNodeEventEmitter=Ze;function K(B,G,W=H=>H){const H=(...Y)=>C.fire(W(...Y)),_=()=>B.addEventListener(G,H),v=()=>B.removeEventListener(G,H),C=new l({onFirstListenerAdd:_,onLastListenerRemove:v});return C.event}y.fromDOMEventEmitter=K;function R(B){return new Promise(G=>x(B)(G))}y.toPromise=R})(F||(F={}));class g{constructor(x){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${x}_${g._idPool++}`}start(x){this._stopWatch=new ne.G(!0),this._listenerCount=x}stop(){if(this._stopWatch){const x=this._stopWatch.elapsed();this._elapsedOverall+=x,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${x.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}g._idPool=0;let oe=-1;class q{constructor(x,U=Math.random().toString(18).slice(2,5)){this.customThreshold=x,this.name=U,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(x){let U=oe;if(typeof this.customThreshold=="number"&&(U=this.customThreshold),U<=0||x<U)return;this._stacks||(this._stacks=new Map);const N=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),V=this._stacks.get(N)||0;if(this._stacks.set(N,V+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=U*.5;let I,L=0;for(const[O,z]of this._stacks)(!I||L<z)&&(I=O,L=z);console.warn(`[${this.name}] potential listener LEAK detected, having ${x} listeners already. MOST frequent listener (${L}):`),console.warn(I)}return()=>{const I=this._stacks.get(N)||0;this._stacks.set(N,I-1)}}}class l{constructor(x){var U;this._disposed=!1,this._options=x,this._leakageMon=oe>0?new q(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((U=this._options)===null||U===void 0)&&U._profName?new g(this._options._profName):void 0}get event(){return this._event||(this._event=(x,U,N)=>{var V;this._listeners||(this._listeners=new Ae.S);const I=this._listeners.isEmpty();I&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const L=this._listeners.push(U?[x,U]:x);I&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,x,U);const O=(V=this._leakageMon)===null||V===void 0?void 0:V.check(this._listeners.size),z=(0,ue.OF)(()=>{O&&O(),this._disposed||(L(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return N instanceof ue.SL?N.add(z):Array.isArray(N)&&N.push(z),z}),this._event}fire(x){var U,N;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ae.S);for(let V of this._listeners)this._deliveryQueue.push([V,x]);for((U=this._perfMon)===null||U===void 0||U.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[V,I]=this._deliveryQueue.shift();try{typeof V=="function"?V.call(void 0,I):V[0].call(V[1],I)}catch(L){(0,A.dL)(L)}}(N=this._perfMon)===null||N===void 0||N.stop()}}dispose(){var x,U,N,V,I;this._disposed||(this._disposed=!0,(x=this._listeners)===null||x===void 0||x.clear(),(U=this._deliveryQueue)===null||U===void 0||U.clear(),(V=(N=this._options)===null||N===void 0?void 0:N.onLastListenerRemove)===null||V===void 0||V.call(N),(I=this._leakageMon)===null||I===void 0||I.dispose())}}class S extends l{constructor(x){super(x),this._isPaused=0,this._eventQueue=new Ae.S,this._mergeFn=x==null?void 0:x.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const x=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(x))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(x){this._listeners&&(this._isPaused!==0?this._eventQueue.push(x):super.fire(x))}}class T extends S{constructor(x){var U;super(x),this._delay=(U=x.delay)!==null&&U!==void 0?U:100}fire(x){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(x)}}class d{constructor(){this.buffers=[]}wrapEvent(x){return(U,N,V)=>x(I=>{const L=this.buffers[this.buffers.length-1];L?L.push(()=>U.call(N,I)):U.call(N,I)},void 0,V)}bufferEvents(x){const U=[];this.buffers.push(U);const N=x();return this.buffers.pop(),U.forEach(V=>V()),N}}class m{constructor(){this.listening=!1,this.inputEvent=F.None,this.inputEventListener=ue.JT.None,this.emitter=new l({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(x){this.inputEvent=x,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=x(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(bn,St,k){"use strict";k.d(St,{I:function(){return A}});function A(ue){const Ae=this;let ne=!1,F;return function(){return ne||(ne=!0,F=ue.apply(Ae,arguments)),F}}},88226:function(bn,St,k){"use strict";k.d(St,{$:function(){return A}});var A;(function(ue){function Ae(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}ue.is=Ae;const ne=Object.freeze([]);function F(){return ne}ue.empty=F;function*g(L){yield L}ue.single=g;function oe(L){return L||ne}ue.from=oe;function q(L){return!L||L[Symbol.iterator]().next().done===!0}ue.isEmpty=q;function l(L){return L[Symbol.iterator]().next().value}ue.first=l;function S(L,O){for(const z of L)if(O(z))return!0;return!1}ue.some=S;function T(L,O){for(const z of L)if(O(z))return z}ue.find=T;function*d(L,O){for(const z of L)O(z)&&(yield z)}ue.filter=d;function*m(L,O){let z=0;for(const ee of L)yield O(ee,z++)}ue.map=m;function*y(...L){for(const O of L)for(const z of O)yield z}ue.concat=y;function*x(L){for(const O of L)for(const z of O)yield z}ue.concatNested=x;function U(L,O,z){let ee=z;for(const re of L)ee=O(ee,re);return ee}ue.reduce=U;function*N(L,O,z=L.length){for(O<0&&(O+=L.length),z<0?z+=L.length:z>L.length&&(z=L.length);O<z;O++)yield L[O]}ue.slice=N;function V(L,O=Number.POSITIVE_INFINITY){const z=[];if(O===0)return[z,L];const ee=L[Symbol.iterator]();for(let re=0;re<O;re++){const J=ee.next();if(J.done)return[z,ue.empty()];z.push(J.value)}return[z,{[Symbol.iterator](){return ee}}]}ue.consume=V;function I(L,O,z=(ee,re)=>ee===re){const ee=L[Symbol.iterator](),re=O[Symbol.iterator]();for(;;){const J=ee.next(),X=re.next();if(J.done!==X.done)return!1;if(J.done)return!0;if(!z(J.value,X.value))return!1}}ue.equals=I})(A||(A={}))},69323:function(bn,St,k){"use strict";k.d(St,{B9:function(){return m},F8:function(){return y},JT:function(){return N},Jz:function(){return I},OF:function(){return x},SL:function(){return U},Wf:function(){return d},XK:function(){return V},dk:function(){return S}});var A=k(17845),ue=k(88226);const Ae=!1;let ne=null;function F(L){ne=L}if(Ae){const L="__is_disposable_tracked__";F(new class{trackDisposable(O){const z=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[L]||console.log(z)},3e3)}setParent(O,z){if(O&&O!==N.None)try{O[L]=!0}catch(ee){}}markAsDisposed(O){if(O&&O!==N.None)try{O[L]=!0}catch(z){}}markAsSingleton(O){}})}function g(L){return ne==null||ne.trackDisposable(L),L}function oe(L){ne==null||ne.markAsDisposed(L)}function q(L,O){ne==null||ne.setParent(L,O)}function l(L,O){if(ne)for(const z of L)ne.setParent(z,O)}function S(L){return ne==null||ne.markAsSingleton(L),L}class T extends Error{constructor(O){super(`Encountered errors while disposing of store. Errors: [${O.join(", ")}]`),this.errors=O}}function d(L){return typeof L.dispose=="function"&&L.dispose.length===0}function m(L){if(ue.$.is(L)){let O=[];for(const z of L)if(z)try{z.dispose()}catch(ee){O.push(ee)}if(O.length===1)throw O[0];if(O.length>1)throw new T(O);return Array.isArray(L)?[]:L}else if(L)return L.dispose(),L}function y(...L){const O=x(()=>m(L));return l(L,O),O}function x(L){const O=g({dispose:(0,A.I)(()=>{oe(O),L()})});return O}class U{constructor(){this._toDispose=new Set,this._isDisposed=!1,g(this)}dispose(){this._isDisposed||(oe(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(O){if(!O)return O;if(O===this)throw new Error("Cannot register a disposable on itself!");return q(O,this),this._isDisposed?U.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(O),O}}U.DISABLE_DISPOSED_WARNING=!1;class N{constructor(){this._store=new U,g(this),q(this._store,this)}dispose(){oe(this),this._store.dispose()}_register(O){if(O===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(O)}}N.None=Object.freeze({dispose(){}});class V{constructor(){this._isDisposed=!1,g(this)}get value(){return this._isDisposed?void 0:this._value}set value(O){var z;this._isDisposed||O===this._value||((z=this._value)===null||z===void 0||z.dispose(),O&&q(O,this),this._value=O)}clear(){this.value=void 0}dispose(){var O;this._isDisposed=!0,oe(this),(O=this._value)===null||O===void 0||O.dispose(),this._value=void 0}clearAndLeak(){const O=this._value;return this._value=void 0,O&&q(O,null),O}}class I{constructor(O){this.object=O}dispose(){}}},34502:function(bn,St,k){"use strict";k.d(St,{S:function(){return ue}});class A{constructor(ne){this.element=ne,this.next=A.Undefined,this.prev=A.Undefined}}A.Undefined=new A(void 0);class ue{constructor(){this._first=A.Undefined,this._last=A.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===A.Undefined}clear(){let ne=this._first;for(;ne!==A.Undefined;){const F=ne.next;ne.prev=A.Undefined,ne.next=A.Undefined,ne=F}this._first=A.Undefined,this._last=A.Undefined,this._size=0}unshift(ne){return this._insert(ne,!1)}push(ne){return this._insert(ne,!0)}_insert(ne,F){const g=new A(ne);if(this._first===A.Undefined)this._first=g,this._last=g;else if(F){const q=this._last;this._last=g,g.prev=q,q.next=g}else{const q=this._first;this._first=g,g.next=q,q.prev=g}this._size+=1;let oe=!1;return()=>{oe||(oe=!0,this._remove(g))}}shift(){if(this._first!==A.Undefined){const ne=this._first.element;return this._remove(this._first),ne}}pop(){if(this._last!==A.Undefined){const ne=this._last.element;return this._remove(this._last),ne}}_remove(ne){if(ne.prev!==A.Undefined&&ne.next!==A.Undefined){const F=ne.prev;F.next=ne.next,ne.next.prev=F}else ne.prev===A.Undefined&&ne.next===A.Undefined?(this._first=A.Undefined,this._last=A.Undefined):ne.next===A.Undefined?(this._last=this._last.prev,this._last.next=A.Undefined):ne.prev===A.Undefined&&(this._first=this._first.next,this._first.prev=A.Undefined);this._size-=1}*[Symbol.iterator](){let ne=this._first;for(;ne!==A.Undefined;)yield ne.element,ne=ne.next}}},23345:function(bn,St,k){"use strict";k.d(St,{$L:function(){return ee},ED:function(){return I},IJ:function(){return O},OS:function(){return xe},WE:function(){return J},dz:function(){return L},gn:function(){return re},li:function(){return x},r:function(){return K},tY:function(){return z},xS:function(){return X}});var A=k(97671),ue;const Ae="en";let ne=!1,F=!1,g=!1,oe=!1,q=!1,l=!1,S=!1,T,d=null,m=null,y;const x=typeof self=="object"?self:typeof k.g=="object"?k.g:{};let U;typeof x.vscode!="undefined"&&typeof x.vscode.process!="undefined"?U=x.vscode.process:typeof A!="undefined"&&(U=A);const N=typeof((ue=U==null?void 0:U.versions)===null||ue===void 0?void 0:ue.electron)=="string"&&U.type==="renderer";if(typeof navigator=="object"&&!N)y=navigator.userAgent,ne=y.indexOf("Windows")>=0,F=y.indexOf("Macintosh")>=0,S=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,g=y.indexOf("Linux")>=0,l=!0,T=navigator.language,d=T;else if(typeof U=="object"){ne=U.platform==="win32",F=U.platform==="darwin",g=U.platform==="linux",oe=g&&!!U.env.SNAP&&!!U.env.SNAP_REVISION,T=Ae,d=Ae;const R=U.env.VSCODE_NLS_CONFIG;if(R)try{const B=JSON.parse(R),G=B.availableLanguages["*"];T=B.locale,d=G||Ae,m=B._translationsConfigFile}catch(B){}q=!0}else console.error("Unable to resolve platform.");let V=0;F?V=1:ne?V=3:g&&(V=2);const I=ne,L=F,O=g,z=q,ee=l,re=S,J=y,X=function(){if(x.setImmediate)return x.setImmediate.bind(x);if(typeof x.postMessage=="function"&&!x.importScripts){let G=[];x.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let _=0,v=G.length;_<v;_++){const C=G[_];if(C.id===H.data.vscodeSetImmediateId){G.splice(_,1),C.callback();return}}});let W=0;return H=>{const _=++W;G.push({id:_,callback:H}),x.postMessage({vscodeSetImmediateId:_},"*")}}if(typeof(U==null?void 0:U.nextTick)=="function")return U.nextTick.bind(U);const B=Promise.resolve();return G=>B.then(G)}(),xe=F||S?2:ne?1:3;let he=!0,Ze=!1;function K(){if(!Ze){Ze=!0;const R=new Uint8Array(2);R[0]=1,R[1]=2,he=new Uint16Array(R.buffer)[0]===513}return he}},95830:function(bn,St,k){"use strict";k.d(St,{G:function(){return Ae}});var A=k(23345);const ue=A.li.performance&&typeof A.li.performance.now=="function";class Ae{constructor(F){this._highResolution=ue&&F,this._startTime=this._now(),this._stopTime=-1}static create(F=!0){return new Ae(F)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?A.li.performance.now():Date.now()}}},82983:function(bn,St,k){"use strict";k.d(St,{$i:function(){return Se},C8:function(){return dt},GF:function(){return T},HO:function(){return W},IO:function(){return d},K7:function(){return ot},Kw:function(){return Oe},LC:function(){return x},Mh:function(){return X},P1:function(){return xe},PJ:function(){return mt},Qe:function(){return Re},R1:function(){return S},RP:function(){return C},S6:function(){return ze},TT:function(){return I},Ut:function(){return _},V8:function(){return U},WU:function(){return Ae},YK:function(){return Ze},YU:function(){return ne},ZG:function(){return he},ZH:function(){return R},ab:function(){return Ye},c1:function(){return Me},df:function(){return ee},ec:function(){return F},fi:function(){return ke},fy:function(){return g},j3:function(){return oe},j_:function(){return O},m5:function(){return A},mK:function(){return z},mr:function(){return m},oH:function(){return $},oL:function(){return q},ok:function(){return J},ow:function(){return N},qq:function(){return re},qu:function(){return V},rL:function(){return K},uS:function(){return ht},un:function(){return l},uq:function(){return y},vH:function(){return G},xe:function(){return He},zY:function(){return L}});function A(P){return!P||typeof P!="string"?!0:P.trim().length===0}const ue=/{(\d+)}/g;function Ae(P,...te){return te.length===0?P:P.replace(ue,function(ge,Ee){const Te=parseInt(Ee,10);return isNaN(Te)||Te<0||Te>=te.length?ge:te[Te]})}function ne(P){return P.replace(/[<>&]/g,function(te){switch(te){case"<":return"<";case">":return">";case"&":return"&";default:return te}})}function F(P){return P.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function g(P,te=" "){const ge=oe(P,te);return q(ge,te)}function oe(P,te){if(!P||!te)return P;const ge=te.length;if(ge===0||P.length===0)return P;let Ee=0;for(;P.indexOf(te,Ee)===Ee;)Ee=Ee+ge;return P.substring(Ee)}function q(P,te){if(!P||!te)return P;const ge=te.length,Ee=P.length;if(ge===0||Ee===0)return P;let Te=Ee,Ue=-1;for(;Ue=P.lastIndexOf(te,Te-1),!(Ue===-1||Ue+ge!==Te);){if(Ue===0)return"";Te=Ue}return P.substring(0,Te)}function l(P){return P.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function S(P){return P.replace(/\*/g,"")}function T(P,te,ge={}){if(!P)throw new Error("Cannot create regex from empty string");te||(P=F(P)),ge.wholeWord&&(/\B/.test(P.charAt(0))||(P="\\b"+P),/\B/.test(P.charAt(P.length-1))||(P=P+"\\b"));let Ee="";return ge.global&&(Ee+="g"),ge.matchCase||(Ee+="i"),ge.multiline&&(Ee+="m"),ge.unicode&&(Ee+="u"),new RegExp(P,Ee)}function d(P){return P.source==="^"||P.source==="^$"||P.source==="$"||P.source==="^\\s*$"?!1:!!(P.exec("")&&P.lastIndex===0)}function m(P){return(P.global?"g":"")+(P.ignoreCase?"i":"")+(P.multiline?"m":"")+(P.unicode?"u":"")}function y(P){return P.split(/\r\n|\r|\n/)}function x(P){for(let te=0,ge=P.length;te<ge;te++){const Ee=P.charCodeAt(te);if(Ee!==32&&Ee!==9)return te}return-1}function U(P,te=0,ge=P.length){for(let Ee=te;Ee<ge;Ee++){const Te=P.charCodeAt(Ee);if(Te!==32&&Te!==9)return P.substring(te,Ee)}return P.substring(te,ge)}function N(P,te=P.length-1){for(let ge=te;ge>=0;ge--){const Ee=P.charCodeAt(ge);if(Ee!==32&&Ee!==9)return ge}return-1}function V(P,te){return P<te?-1:P>te?1:0}function I(P,te,ge=0,Ee=P.length,Te=0,Ue=te.length){for(;ge<Ee&&Te<Ue;ge++,Te++){let De=P.charCodeAt(ge),Ke=te.charCodeAt(Te);if(De<Ke)return-1;if(De>Ke)return 1}const et=Ee-ge,Ne=Ue-Te;return et<Ne?-1:et>Ne?1:0}function L(P,te){return O(P,te,0,P.length,0,te.length)}function O(P,te,ge=0,Ee=P.length,Te=0,Ue=te.length){for(;ge<Ee&&Te<Ue;ge++,Te++){let De=P.charCodeAt(ge),Ke=te.charCodeAt(Te);if(De===Ke)continue;if(De>=128||Ke>=128)return I(P.toLowerCase(),te.toLowerCase(),ge,Ee,Te,Ue);z(De)&&(De-=32),z(Ke)&&(Ke-=32);const _t=De-Ke;if(_t!==0)return _t}const et=Ee-ge,Ne=Ue-Te;return et<Ne?-1:et>Ne?1:0}function z(P){return P>=97&&P<=122}function ee(P){return P>=65&&P<=90}function re(P,te){return P.length===te.length&&O(P,te)===0}function J(P,te){const ge=te.length;return te.length>P.length?!1:O(P,te,0,ge)===0}function X(P,te){let ge,Ee=Math.min(P.length,te.length);for(ge=0;ge<Ee;ge++)if(P.charCodeAt(ge)!==te.charCodeAt(ge))return ge;return Ee}function xe(P,te){let ge,Ee=Math.min(P.length,te.length);const Te=P.length-1,Ue=te.length-1;for(ge=0;ge<Ee;ge++)if(P.charCodeAt(Te-ge)!==te.charCodeAt(Ue-ge))return ge;return Ee}function he(P){return 55296<=P&&P<=56319}function Ze(P){return 56320<=P&&P<=57343}function K(P,te){return(P-55296<<10)+(te-56320)+65536}function R(P,te,ge){const Ee=P.charCodeAt(ge);if(he(Ee)&&ge+1<te){const Te=P.charCodeAt(ge+1);if(Ze(Te))return K(Ee,Te)}return Ee}function B(P,te){const ge=P.charCodeAt(te-1);if(Ze(ge)&&te>1){const Ee=P.charCodeAt(te-2);if(he(Ee))return K(Ee,ge)}return ge}function G(P,te){const ge=se.getInstance(),Ee=te,Te=P.length,Ue=R(P,Te,te);te+=Ue>=65536?2:1;let et=ge.getGraphemeBreakType(Ue);for(;te<Te;){const Ne=R(P,Te,te),De=ge.getGraphemeBreakType(Ne);if(ke(et,De))break;te+=Ne>=65536?2:1,et=De}return te-Ee}function W(P,te){const ge=se.getInstance(),Ee=te,Te=B(P,te);te-=Te>=65536?2:1;let Ue=ge.getGraphemeBreakType(Te);for(;te>0;){const et=B(P,te),Ne=ge.getGraphemeBreakType(et);if(ke(Ne,Ue))break;te-=et>=65536?2:1,Ue=Ne}return Ee-te}const H=/(?:[\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 _(P){return H.test(P)}const v=/(?:[\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 C(P){return v.test(P)}const Y=/^[\t\n\r\x20-\x7E]*$/;function Se(P){return Y.test(P)}const Re=/[\u2028\u2029]/;function Ye(P){return Re.test(P)}function He(P){for(let te=0,ge=P.length;te<ge;te++)if(ot(P.charCodeAt(te)))return!0;return!1}function ot(P){return P=+P,P>=11904&&P<=55215||P>=63744&&P<=64255||P>=65281&&P<=65374}function dt(P){return P>=127462&&P<=127487||P===8986||P===8987||P===9200||P===9203||P>=9728&&P<=10175||P===11088||P===11093||P>=127744&&P<=128591||P>=128640&&P<=128764||P>=128992&&P<=129003||P>=129280&&P<=129535||P>=129648&&P<=129750}const Me="\uFEFF";function ht(P){return!!(P&&P.length>0&&P.charCodeAt(0)===65279)}function Oe(P,te=!1){return P?(te&&(P=P.replace(/\\./g,"")),P.toLowerCase()!==P):!1}function mt(P){return P=P%(2*26),P<26?String.fromCharCode(97+P):String.fromCharCode(65+P-26)}function ze(P){return se.getInstance().getGraphemeBreakType(P)}function ke(P,te){return P===0?te!==5&&te!==7:P===2&&te===3?!1:P===4||P===2||P===3||te===4||te===2||te===3?!0:!(P===8&&(te===8||te===9||te===11||te===12)||(P===11||P===9)&&(te===9||te===10)||(P===12||P===10)&&te===10||te===5||te===13||te===7||P===1||P===13&&te===14||P===6&&te===6)}class se{constructor(){this._data=Q()}static getInstance(){return se._INSTANCE||(se._INSTANCE=new se),se._INSTANCE}getGraphemeBreakType(te){if(te<32)return te===10?3:te===13?2:4;if(te<127)return 0;const ge=this._data,Ee=ge.length/3;let Te=1;for(;Te<=Ee;)if(te<ge[3*Te])Te=2*Te;else if(te>ge[3*Te+1])Te=2*Te+1;else return ge[3*Te+2];return 0}}se._INSTANCE=null;function Q(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function $(P,te){if(P===0)return 0;const ge=de(P,te);if(ge!==void 0)return ge;const Ee=B(te,P);return P-=we(Ee),P}function de(P,te){let ge=B(te,P);for(P-=we(ge);Ce(ge)||ge===65039||ge===8419;){if(P===0)return;ge=B(te,P),P-=we(ge)}if(dt(ge)){if(P>=0){const Ee=B(te,P);Ee===8205&&(P-=we(Ee))}return P}}function we(P){return P>=65536?2:1}function Ce(P){return 127995<=P&&P<=127999}},72999:function(bn,St,k){"use strict";k.d(St,{$E:function(){return x},$K:function(){return oe},D8:function(){return d},HD:function(){return ue},IU:function(){return U},Jp:function(){return q},Kn:function(){return Ae},cW:function(){return S},f6:function(){return N},hj:function(){return ne},jn:function(){return F},kJ:function(){return A},mf:function(){return T},o8:function(){return g},p_:function(){return l},vE:function(){return V}});function A(I){return Array.isArray(I)}function ue(I){return typeof I=="string"}function Ae(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)&&!(I instanceof RegExp)&&!(I instanceof Date)}function ne(I){return typeof I=="number"&&!isNaN(I)}function F(I){return I===!0||I===!1}function g(I){return typeof I=="undefined"}function oe(I){return!q(I)}function q(I){return g(I)||I===null}function l(I,L){if(!I)throw new Error(L?`Unexpected type, expected '${L}'`:"Unexpected type")}function S(I){if(q(I))throw new Error("Assertion Failed: argument is undefined or null");return I}function T(I){return typeof I=="function"}function d(I,L){const O=Math.min(I.length,L.length);for(let z=0;z<O;z++)m(I[z],L[z])}function m(I,L){if(ue(L)){if(typeof I!==L)throw new Error(`argument does not match constraint: typeof ${L}`)}else if(T(L)){try{if(I instanceof L)return}catch(O){}if(!q(I)&&I.constructor===L||L.length===1&&L.call(void 0,I)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(I){let L=[],O=Object.getPrototypeOf(I);for(;Object.prototype!==O;)L=L.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return L}function x(I){const L=[];for(const O of y(I))typeof I[O]=="function"&&L.push(O);return L}function U(I,L){const O=ee=>function(){const re=Array.prototype.slice.call(arguments,0);return L(ee,re)};let z={};for(const ee of I)z[ee]=O(ee);return z}function N(I){return I===null?void 0:I}function V(I,L="Unreachable"){throw new Error(L)}},13268:function(bn,St,k){"use strict";k.d(St,{N:function(){return ue}});function A(Ae,ne){let F;return ne.length===0?F=Ae:F=Ae.replace(/\{(\d+)\}/g,function(g,oe){const q=oe[0];return typeof ne[q]!="undefined"?ne[q]:g}),F}function ue(Ae,ne,...F){return A(ne,F)}},96236:function(bn,St,k){"use strict";k.d(St,{BH:function(){return U},NZ:function(){return N},U8:function(){return V},co:function(){return x},eH:function(){return y},vr:function(){return m}});var A=k(75918),ue=k(52615),Ae=k(4348),ne=k(88226),F=k(69323),g=k(34502),oe=k(35884),q=k(90689),l=k(16925),S=k(49055),T=function(I,L,O,z){var ee=arguments.length,re=ee<3?L:z===null?z=Object.getOwnPropertyDescriptor(L,O):z,J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(I,L,O,z);else for(var X=I.length-1;X>=0;X--)(J=I[X])&&(re=(ee<3?J(re):ee>3?J(L,O,re):J(L,O))||re);return ee>3&&re&&Object.defineProperty(L,O,re),re},d=function(I,L){return function(O,z){L(O,z,I)}};function m(I){return I.command!==void 0}class y{constructor(L){this.id=y._idPool++,this._debugName=L}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const x=(0,l.yh)("menuService"),U=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ae.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:I=>I===y.CommandPalette}}addCommand(I){return this.addCommands(ne.$.single(I))}addCommands(I){for(const L of I)this._commands.set(L.id,L);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,F.OF)(()=>{let L=!1;for(const O of I)L=this._commands.delete(O.id)||L;L&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(I){return this._commands.get(I)}getCommands(){const I=new Map;return this._commands.forEach((L,O)=>I.set(O,L)),I}appendMenuItem(I,L){return this.appendMenuItems(ne.$.single({id:I,item:L}))}appendMenuItems(I){const L=new Set,O=new g.S;for(const{id:z,item:ee}of I){let re=this._menuItems.get(z);re||(re=new g.S,this._menuItems.set(z,re)),O.push(re.push(ee)),L.add(z)}return this._onDidChangeMenu.fire(L),(0,F.OF)(()=>{if(O.size>0){for(let z of O)z();this._onDidChangeMenu.fire(L),O.clear()}})}getMenuItems(I){let L;return this._menuItems.has(I)?L=[...this._menuItems.get(I)]:L=[],I===y.CommandPalette&&this._appendImplicitItems(L),L}_appendImplicitItems(I){const L=new Set;for(const O of I)m(O)&&(L.add(O.command.id),O.alt&&L.add(O.alt.id));this._commands.forEach((O,z)=>{L.has(z)||I.push({command:O})})}};class N extends A.wY{constructor(L,O,z,ee){super(`submenuitem.${L.submenu.id}`,typeof L.title=="string"?L.title:L.title.value,[],"submenu"),this.item=L,this._menuService=O,this._contextKeyService=z,this._options=ee}get actions(){const L=[],O=this._menuService.createMenu(this.item.submenu,this._contextKeyService),z=O.getActions(this._options);O.dispose();for(const[,ee]of z)ee.length>0&&(L.push(...ee),L.push(new A.Z0));return L.length&&L.pop(),L}}let V=class ul{constructor(L,O,z,ee,re){var J,X;if(this._commandService=re,this.id=L.id,this.label=z!=null&&z.renderShortTitle&&L.shortTitle?typeof L.shortTitle=="string"?L.shortTitle:L.shortTitle.value:typeof L.title=="string"?L.title:L.title.value,this.tooltip=(X=typeof L.tooltip=="string"?L.tooltip:(J=L.tooltip)===null||J===void 0?void 0:J.value)!==null&&X!==void 0?X:"",this.enabled=!L.precondition||ee.contextMatchesRules(L.precondition),this.checked=void 0,L.toggled){const xe=L.toggled.condition?L.toggled:{condition:L.toggled};this.checked=ee.contextMatchesRules(xe.condition),this.checked&&xe.tooltip&&(this.tooltip=typeof xe.tooltip=="string"?xe.tooltip:xe.tooltip.value),xe.title&&(this.label=typeof xe.title=="string"?xe.title:xe.title.value)}this.item=L,this.alt=O?new ul(O,void 0,z,ee,re):void 0,this._options=z,S.kS.isThemeIcon(L.icon)&&(this.class=ue.dT.asClassName(L.icon))}dispose(){}run(...L){var O,z;let ee=[];return!((O=this._options)===null||O===void 0)&&O.arg&&(ee=[...ee,this._options.arg]),!((z=this._options)===null||z===void 0)&&z.shouldForwardArgs&&(ee=[...ee,...L]),this._commandService.executeCommand(this.id,...ee)}};V=T([d(3,q.i6),d(4,oe.H)],V)},35884:function(bn,St,k){"use strict";k.d(St,{H:function(){return oe},P:function(){return q}});var A=k(4348),ue=k(88226),Ae=k(69323),ne=k(34502),F=k(72999),g=k(16925);const oe=(0,g.yh)("commandService"),q=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new A.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(l,S){if(!l)throw new Error("invalid command");if(typeof l=="string"){if(!S)throw new Error("invalid command");return this.registerCommand({id:l,handler:S})}if(l.description){const x=[];for(let N of l.description.args)x.push(N.constraint);const U=l.handler;l.handler=function(N,...V){return(0,F.D8)(V,x),U(N,...V)}}const{id:T}=l;let d=this._commands.get(T);d||(d=new ne.S,this._commands.set(T,d));let m=d.unshift(l),y=(0,Ae.OF)(()=>{m();const x=this._commands.get(T);x!=null&&x.isEmpty()&&this._commands.delete(T)});return this._onDidRegisterCommand.fire(T),y}registerCommandAlias(l,S){return q.registerCommand(l,(T,...d)=>T.get(oe).executeCommand(S,...d))}getCommand(l){const S=this._commands.get(l);if(!(!S||S.isEmpty()))return ue.$.first(S)}getCommands(){const l=new Map;for(const S of this._commands.keys()){const T=this.getCommand(S);T&&l.set(S,T)}return l}};q.registerCommand("noop",()=>{})},90689:function(bn,St,k){"use strict";k.d(St,{Ao:function(){return oe},Eq:function(){return K},Fb:function(){return q},K8:function(){return G},i6:function(){return Ze},uy:function(){return he}});var A=k(23345),ue=k(82983),Ae=k(16925);let ne=A.WE||"";const F=new Map;F.set("false",!1),F.set("true",!0),F.set("isMac",A.dz),F.set("isLinux",A.IJ),F.set("isWindows",A.ED),F.set("isWeb",A.$L),F.set("isMacNative",A.dz&&!A.$L),F.set("isEdge",ne.indexOf("Edg/")>=0),F.set("isFirefox",ne.indexOf("Firefox")>=0),F.set("isChrome",ne.indexOf("Chrome")>=0),F.set("isSafari",ne.indexOf("Safari")>=0);const g=Object.prototype.hasOwnProperty;class oe{static has(_){return d.create(_)}static equals(_,v){return m.create(_,v)}static regex(_,v){return ee.create(_,v)}static not(_){return N.create(_)}static and(..._){return X.create(_,null)}static or(..._){return xe.create(_,null,!0)}static deserialize(_,v=!1){if(_)return this._deserializeOrExpression(_,v)}static _deserializeOrExpression(_,v){let C=_.split("||");return xe.create(C.map(Y=>this._deserializeAndExpression(Y,v)),null,!0)}static _deserializeAndExpression(_,v){let C=_.split("&&");return X.create(C.map(Y=>this._deserializeOne(Y,v)),null)}static _deserializeOne(_,v){if(_=_.trim(),_.indexOf("!=")>=0){let C=_.split("!=");return U.create(C[0].trim(),this._deserializeValue(C[1],v))}if(_.indexOf("==")>=0){let C=_.split("==");return m.create(C[0].trim(),this._deserializeValue(C[1],v))}if(_.indexOf("=~")>=0){let C=_.split("=~");return ee.create(C[0].trim(),this._deserializeRegexValue(C[1],v))}if(_.indexOf(" in ")>=0){let C=_.split(" in ");return y.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const C=_.split(">=");return L.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const C=_.split(">");return I.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const C=_.split("<=");return z.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const C=_.split("<");return O.create(C[0].trim(),C[1].trim())}return/^\!\s*/.test(_)?N.create(_.substr(1).trim()):d.create(_)}static _deserializeValue(_,v){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let C=/^'([^']*)'$/.exec(_);return C?C[1].trim():_}static _deserializeRegexValue(_,v){if((0,ue.m5)(_)){if(v)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let C=_.indexOf("/"),Y=_.lastIndexOf("/");if(C===Y||C<0){if(v)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let Se=_.slice(C+1,Y),Re=_[Y+1]==="i"?"i":"";try{return new RegExp(Se,Re)}catch(Ye){if(v)throw new Error(`bad regexp-value '${_}', parse error: ${Ye}`);return console.warn(`bad regexp-value '${_}', parse error: ${Ye}`),null}}}function q(H,_){const v=H?H.substituteConstants():void 0,C=_?_.substituteConstants():void 0;return!v&&!C?!0:!v||!C?!1:v.equals(C)}function l(H,_){return H.cmp(_)}class S{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return T.INSTANCE}}S.INSTANCE=new S;class T{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return S.INSTANCE}}T.INSTANCE=new T;class d{constructor(_,v){this.key=_,this.negated=v,this.type=2}static create(_,v=null){const C=F.get(_);return typeof C=="boolean"?C?T.INSTANCE:S.INSTANCE:new d(_,v)}cmp(_){return _.type!==this.type?this.type-_.type:R(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=F.get(this.key);return typeof _=="boolean"?_?T.INSTANCE:S.INSTANCE:this}evaluate(_){return!!_.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=N.create(this.key,this)),this.negated}}class m{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=4}static create(_,v,C=null){if(typeof v=="boolean")return v?d.create(_,C):N.create(_,C);const Y=F.get(_);return typeof Y=="boolean"?v===(Y?"true":"false")?T.INSTANCE:S.INSTANCE:new m(_,v,C)}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=F.get(this.key);if(typeof _=="boolean"){const v=_?"true":"false";return this.value===v?T.INSTANCE:S.INSTANCE}return this}evaluate(_){return _.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=U.create(this.key,this.value,this)),this.negated}}class y{constructor(_,v){this.key=_,this.valueKey=v,this.type=10,this.negated=null}static create(_,v){return new y(_,v)}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const v=_.getValue(this.valueKey),C=_.getValue(this.key);return Array.isArray(v)?v.indexOf(C)>=0:typeof C=="string"&&typeof v=="object"&&v!==null?g.call(v,C):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=x.create(this)),this.negated}}class x{constructor(_){this._actual=_,this.type=11}static create(_){return new x(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class U{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=5}static create(_,v,C=null){if(typeof v=="boolean")return v?N.create(_,C):d.create(_,C);const Y=F.get(_);return typeof Y=="boolean"?v===(Y?"true":"false")?S.INSTANCE:T.INSTANCE:new U(_,v,C)}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=F.get(this.key);if(typeof _=="boolean"){const v=_?"true":"false";return this.value===v?S.INSTANCE:T.INSTANCE}return this}evaluate(_){return _.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class N{constructor(_,v){this.key=_,this.negated=v,this.type=3}static create(_,v=null){const C=F.get(_);return typeof C=="boolean"?C?S.INSTANCE:T.INSTANCE:new N(_,v)}cmp(_){return _.type!==this.type?this.type-_.type:R(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=F.get(this.key);return typeof _=="boolean"?_?S.INSTANCE:T.INSTANCE:this}evaluate(_){return!_.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function V(H,_){if(typeof H=="string"){const v=parseFloat(H);isNaN(v)||(H=v)}return typeof H=="string"||typeof H=="number"?_(H):S.INSTANCE}class I{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=12}static create(_,v,C=null){return V(v,Y=>new I(_,Y,C))}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=z.create(this.key,this.value,this)),this.negated}}class L{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=13}static create(_,v,C=null){return V(v,Y=>new L(_,Y,C))}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=14}static create(_,v,C=null){return V(v,Y=>new O(_,Y,C))}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this.key,this.value,this)),this.negated}}class z{constructor(_,v,C){this.key=_,this.value=v,this.negated=C,this.type=15}static create(_,v,C=null){return V(v,Y=>new z(_,Y,C))}cmp(_){return _.type!==this.type?this.type-_.type:B(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class ee{constructor(_,v){this.key=_,this.regexp=v,this.type=7,this.negated=null}static create(_,v){return new ee(_,v)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const v=this.regexp?this.regexp.source:"",C=_.regexp?_.regexp.source:"";return v<C?-1:v>C?1:0}equals(_){if(_.type===this.type){const v=this.regexp?this.regexp.source:"",C=_.regexp?_.regexp.source:"";return this.key===_.key&&v===C}return!1}substituteConstants(){return this}evaluate(_){let v=_.getValue(this.key);return this.regexp?this.regexp.test(v):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=re.create(this)),this.negated}}class re{constructor(_){this._actual=_,this.type=8}static create(_){return new re(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function J(H){let _=null;for(let v=0,C=H.length;v<C;v++){const Y=H[v].substituteConstants();if(H[v]!==Y&&_===null){_=[];for(let Se=0;Se<v;Se++)_[Se]=H[Se]}_!==null&&(_[v]=Y)}return _===null?H:_}class X{constructor(_,v){this.expr=_,this.negated=v,this.type=6}static create(_,v){return X._normalizeArr(_,v)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let v=0,C=this.expr.length;v<C;v++){const Y=l(this.expr[v],_.expr[v]);if(Y!==0)return Y}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let v=0,C=this.expr.length;v<C;v++)if(!this.expr[v].equals(_.expr[v]))return!1;return!0}return!1}substituteConstants(){const _=J(this.expr);return _===this.expr?this:X.create(_,this.negated)}evaluate(_){for(let v=0,C=this.expr.length;v<C;v++)if(!this.expr[v].evaluate(_))return!1;return!0}static _normalizeArr(_,v){const C=[];let Y=!1;for(const Se of _)if(Se){if(Se.type===1){Y=!0;continue}if(Se.type===0)return S.INSTANCE;if(Se.type===6){C.push(...Se.expr);continue}C.push(Se)}if(C.length===0&&Y)return T.INSTANCE;if(C.length!==0){if(C.length===1)return C[0];C.sort(l);for(let Se=1;Se<C.length;Se++)C[Se-1].equals(C[Se])&&(C.splice(Se,1),Se--);if(C.length===1)return C[0];for(;C.length>1;){const Se=C[C.length-1];if(Se.type!==9)break;C.pop();const Re=C.pop(),Ye=C.length===0,He=xe.create(Se.expr.map(ot=>X.create([ot,Re],null)),null,Ye);He&&(C.push(He),C.sort(l))}return C.length===1?C[0]:new X(C,v)}}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let v of this.expr)_.push(...v.keys());return _}negate(){if(!this.negated){const _=[];for(let v of this.expr)_.push(v.negate());this.negated=xe.create(_,this,!0)}return this.negated}}class xe{constructor(_,v){this.expr=_,this.negated=v,this.type=9}static create(_,v,C){return xe._normalizeArr(_,v,C)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let v=0,C=this.expr.length;v<C;v++){const Y=l(this.expr[v],_.expr[v]);if(Y!==0)return Y}return 0}equals(_){if(_.type===this.type){if(this.expr.length!==_.expr.length)return!1;for(let v=0,C=this.expr.length;v<C;v++)if(!this.expr[v].equals(_.expr[v]))return!1;return!0}return!1}substituteConstants(){const _=J(this.expr);return _===this.expr?this:xe.create(_,this.negated,!1)}evaluate(_){for(let v=0,C=this.expr.length;v<C;v++)if(this.expr[v].evaluate(_))return!0;return!1}static _normalizeArr(_,v,C){let Y=[],Se=!1;if(_){for(let Re=0,Ye=_.length;Re<Ye;Re++){const He=_[Re];if(He){if(He.type===0){Se=!0;continue}if(He.type===1)return T.INSTANCE;if(He.type===9){Y=Y.concat(He.expr);continue}Y.push(He)}}if(Y.length===0&&Se)return S.INSTANCE;Y.sort(l)}if(Y.length!==0){if(Y.length===1)return Y[0];for(let Re=1;Re<Y.length;Re++)Y[Re-1].equals(Y[Re])&&(Y.splice(Re,1),Re--);if(Y.length===1)return Y[0];if(C){for(let Re=0;Re<Y.length;Re++)for(let Ye=Re+1;Ye<Y.length;Ye++)G(Y[Re],Y[Ye])&&(Y.splice(Ye,1),Ye--);if(Y.length===1)return Y[0]}return new xe(Y,v)}}serialize(){return this.expr.map(_=>_.serialize()).join(" || ")}keys(){const _=[];for(let v of this.expr)_.push(...v.keys());return _}negate(){if(!this.negated){let _=[];for(let v of this.expr)_.push(v.negate());for(;_.length>1;){const v=_.shift(),C=_.shift(),Y=[];for(const Re of W(v))for(const Ye of W(C))Y.push(X.create([Re,Ye],null));const Se=_.length===0;_.unshift(xe.create(Y,null,Se))}this.negated=_[0]}return this.negated}}class he extends d{constructor(_,v,C){super(_,null),this._defaultValue=v,typeof C=="object"?he._info.push(Object.assign(Object.assign({},C),{key:_})):C!==!0&&he._info.push({key:_,description:C,type:v!=null?typeof v:void 0})}static all(){return he._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return m.create(this.key,_)}}he._info=[];const Ze=(0,Ae.yh)("contextKeyService"),K="setContext";function R(H,_){return H<_?-1:H>_?1:0}function B(H,_,v,C){return H<v?-1:H>v?1:_<C?-1:_>C?1:0}function G(H,_){if(_.type===6&&H.type!==9&&H.type!==6){for(const Y of _.expr)if(H.equals(Y))return!0}const v=H.negate(),C=W(v).concat(W(_));C.sort(l);for(let Y=0;Y<C.length;Y++){const Re=C[Y].negate();for(let Ye=Y+1;Ye<C.length;Ye++){const He=C[Ye];if(Re.equals(He))return!0}}return!1}function W(H){return H.type===9?H.expr:[H]}},16925:function(bn,St,k){"use strict";k.d(St,{I8:function(){return A},TG:function(){return ue},jt:function(){return F},yh:function(){return ne}});var A;(function(g){g.serviceIds=new Map,g.DI_TARGET="$di$target",g.DI_DEPENDENCIES="$di$dependencies";function oe(q){return q[g.DI_DEPENDENCIES]||[]}g.getServiceDependencies=oe})(A||(A={}));const ue=ne("instantiationService");function Ae(g,oe,q,l){oe[A.DI_TARGET]===oe?oe[A.DI_DEPENDENCIES].push({id:g,index:q,optional:l}):(oe[A.DI_DEPENDENCIES]=[{id:g,index:q,optional:l}],oe[A.DI_TARGET]=oe)}function ne(g){if(A.serviceIds.has(g))return A.serviceIds.get(g);const oe=function(q,l,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ae(oe,q,S,!1)};return oe.toString=()=>g,A.serviceIds.set(g,oe),oe}function F(g){return function(oe,q,l){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Ae(g,oe,l,!0)}}},44650:function(bn,St,k){"use strict";k.d(St,{B:function(){return ne}});var A=k(76068),ue=k(72999);class Ae{constructor(){this.data=new Map}add(g,oe){A.ok(ue.HD(g)),A.ok(ue.Kn(oe)),A.ok(!this.data.has(g),"There is already an extension with this id"),this.data.set(g,oe)}as(g){return this.data.get(g)||null}}const ne=new Ae},66213:function(bn,St,k){"use strict";k.d(St,{e:function(){return A}});var A;(function(ue){ue.DARK="dark",ue.LIGHT="light",ue.HIGH_CONTRAST="hc"})(A||(A={}))},49055:function(bn,St,k){"use strict";k.d(St,{EN:function(){return l},IP:function(){return d},Ic:function(){return x},XE:function(){return oe},bB:function(){return U},kS:function(){return S},m6:function(){return T}});var A=k(52615),ue=k(4348),Ae=k(69323),ne=k(16925),F=k(44650),g=k(66213);const oe=(0,ne.yh)("themeService");var q;(function(N){function V(I){return I&&typeof I=="object"&&typeof I.id=="string"}N.isThemeColor=V})(q||(q={}));function l(N){return{id:N}}var S;(function(N){function V(re){return re&&typeof re=="object"&&typeof re.id=="string"&&(typeof re.color=="undefined"||q.isThemeColor(re.color))}N.isThemeIcon=V;const I=new RegExp(`^\\$\\((${A.dT.iconNameExpression}(?:${A.dT.iconModifierExpression})?)\\)$`);function L(re){const J=I.exec(re);if(!J)return;let[,X]=J;return{id:X}}N.fromString=L;function O(re,J){let X=re.id;const xe=X.lastIndexOf("~");return xe!==-1&&(X=X.substring(0,xe)),J&&(X=`${X}~${J}`),{id:X}}N.modify=O;function z(re,J){var X,xe;return re.id===J.id&&((X=re.color)===null||X===void 0?void 0:X.id)===((xe=J.color)===null||xe===void 0?void 0:xe.id)}N.isEqual=z;function ee(re,J){return{id:re.id,color:J?l(J):void 0}}N.asThemeIcon=ee,N.asClassNameArray=A.dT.asClassNameArray,N.asClassName=A.dT.asClassName,N.asCSSSelector=A.dT.asCSSSelector})(S||(S={}));function T(N){switch(N){case g.e.DARK:return"vs-dark";case g.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ue.Q5}onColorThemeChange(V){return this.themingParticipants.push(V),this.onThemingParticipantAddedEmitter.fire(V),(0,Ae.OF)(()=>{const I=this.themingParticipants.indexOf(V);this.themingParticipants.splice(I,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new m;F.B.add(d.ThemingContribution,y);function x(N){return y.onColorThemeChange(N)}class U extends Ae.JT{constructor(V){super(),this.themeService=V,this.theme=V.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(I=>this.onThemeChange(I)))}onThemeChange(V){this.theme=V,this.updateStyles()}updateStyles(){}}},66003:function(bn,St,k){"use strict";k.d(St,{Z:function(){return oe}});var A=k(33346),ue=k(98506),Ae=k(26420),ne=k(59301),F=["show"];function g(q,l){if(!l.max)return!0;var S=l.strategy(q);return S<=l.max}function oe(q,l){return ne.useMemo(function(){var S={};l&&(S.show=(0,Ae.Z)(l)==="object"&&l.formatter?l.formatter:!!l),S=(0,ue.Z)((0,ue.Z)({},S),q);var T=S,d=T.show,m=(0,A.Z)(T,F);return(0,ue.Z)((0,ue.Z)({},m),{},{show:!!d,showFormatter:typeof d=="function"?d:void 0,strategy:m.strategy||function(y){return y.length}})},[q,l])}},36901:function(bn,St,k){"use strict";k.r(St),k.d(St,{BaseInput:function(){return S},default:function(){return L}});var A=k(98506),ue=k(67711),Ae=k(52873),ne=k(26420),F=k(92310),g=k.n(F),oe=k(59301),q=k(30292),l=oe.forwardRef(function(O,z){var ee,re,J,X=O.inputElement,xe=O.children,he=O.prefixCls,Ze=O.prefix,K=O.suffix,R=O.addonBefore,B=O.addonAfter,G=O.className,W=O.style,H=O.disabled,_=O.readOnly,v=O.focused,C=O.triggerFocus,Y=O.allowClear,Se=O.value,Re=O.handleReset,Ye=O.hidden,He=O.classes,ot=O.classNames,dt=O.dataAttrs,Me=O.styles,ht=O.components,Oe=O.onClear,mt=xe!=null?xe:X,ze=(ht==null?void 0:ht.affixWrapper)||"span",ke=(ht==null?void 0:ht.groupWrapper)||"span",se=(ht==null?void 0:ht.wrapper)||"span",Q=(ht==null?void 0:ht.groupAddon)||"span",$=(0,oe.useRef)(null),de=function(wt){var Qe;(Qe=$.current)!==null&&Qe!==void 0&&Qe.contains(wt.target)&&(C==null||C())},we=(0,q.X3)(O),Ce=(0,oe.cloneElement)(mt,{value:Se,className:g()((ee=mt.props)===null||ee===void 0?void 0:ee.className,!we&&(ot==null?void 0:ot.variant))||null}),P=(0,oe.useRef)(null);if(oe.useImperativeHandle(z,function(){return{nativeElement:P.current||$.current}}),we){var te=null;if(Y){var ge=!H&&!_&&Se,Ee="".concat(he,"-clear-icon"),Te=(0,ne.Z)(Y)==="object"&&Y!==null&&Y!==void 0&&Y.clearIcon?Y.clearIcon:"\u2716";te=oe.createElement("button",{type:"button",tabIndex:-1,onClick:function(wt){Re==null||Re(wt),Oe==null||Oe()},onMouseDown:function(wt){return wt.preventDefault()},className:g()(Ee,(0,Ae.Z)((0,Ae.Z)({},"".concat(Ee,"-hidden"),!ge),"".concat(Ee,"-has-suffix"),!!K))},Te)}var Ue="".concat(he,"-affix-wrapper"),et=g()(Ue,(0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)({},"".concat(he,"-disabled"),H),"".concat(Ue,"-disabled"),H),"".concat(Ue,"-focused"),v),"".concat(Ue,"-readonly"),_),"".concat(Ue,"-input-with-clear-btn"),K&&Y&&Se),He==null?void 0:He.affixWrapper,ot==null?void 0:ot.affixWrapper,ot==null?void 0:ot.variant),Ne=(K||Y)&&oe.createElement("span",{className:g()("".concat(he,"-suffix"),ot==null?void 0:ot.suffix),style:Me==null?void 0:Me.suffix},te,K);Ce=oe.createElement(ze,(0,ue.Z)({className:et,style:Me==null?void 0:Me.affixWrapper,onClick:de},dt==null?void 0:dt.affixWrapper,{ref:$}),Ze&&oe.createElement("span",{className:g()("".concat(he,"-prefix"),ot==null?void 0:ot.prefix),style:Me==null?void 0:Me.prefix},Ze),Ce,Ne)}if((0,q.He)(O)){var De="".concat(he,"-group"),Ke="".concat(De,"-addon"),_t="".concat(De,"-wrapper"),nt=g()("".concat(he,"-wrapper"),De,He==null?void 0:He.wrapper,ot==null?void 0:ot.wrapper),lt=g()(_t,(0,Ae.Z)({},"".concat(_t,"-disabled"),H),He==null?void 0:He.group,ot==null?void 0:ot.groupWrapper);Ce=oe.createElement(ke,{className:lt,ref:P},oe.createElement(se,{className:nt},R&&oe.createElement(Q,{className:Ke},R),Ce,B&&oe.createElement(Q,{className:Ke},B)))}return oe.cloneElement(Ce,{className:g()((re=Ce.props)===null||re===void 0?void 0:re.className,G)||null,style:(0,A.Z)((0,A.Z)({},(J=Ce.props)===null||J===void 0?void 0:J.style),W),hidden:Ye})}),S=l,T=k(15142),d=k(16886),m=k(33346),y=k(18929),x=k(2738),U=k(66003),N=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],V=(0,oe.forwardRef)(function(O,z){var ee=O.autoComplete,re=O.onChange,J=O.onFocus,X=O.onBlur,xe=O.onPressEnter,he=O.onKeyDown,Ze=O.onKeyUp,K=O.prefixCls,R=K===void 0?"rc-input":K,B=O.disabled,G=O.htmlSize,W=O.className,H=O.maxLength,_=O.suffix,v=O.showCount,C=O.count,Y=O.type,Se=Y===void 0?"text":Y,Re=O.classes,Ye=O.classNames,He=O.styles,ot=O.onCompositionStart,dt=O.onCompositionEnd,Me=(0,m.Z)(O,N),ht=(0,oe.useState)(!1),Oe=(0,d.Z)(ht,2),mt=Oe[0],ze=Oe[1],ke=(0,oe.useRef)(!1),se=(0,oe.useRef)(!1),Q=(0,oe.useRef)(null),$=(0,oe.useRef)(null),de=function(en){Q.current&&(0,q.nH)(Q.current,en)},we=(0,y.Z)(O.defaultValue,{value:O.value}),Ce=(0,d.Z)(we,2),P=Ce[0],te=Ce[1],ge=P==null?"":String(P),Ee=(0,oe.useState)(null),Te=(0,d.Z)(Ee,2),Ue=Te[0],et=Te[1],Ne=(0,U.Z)(C,v),De=Ne.max||H,Ke=Ne.strategy(ge),_t=!!De&&Ke>De;(0,oe.useImperativeHandle)(z,function(){var It;return{focus:de,blur:function(){var Ie;(Ie=Q.current)===null||Ie===void 0||Ie.blur()},setSelectionRange:function(Ie,ve,be){var M;(M=Q.current)===null||M===void 0||M.setSelectionRange(Ie,ve,be)},select:function(){var Ie;(Ie=Q.current)===null||Ie===void 0||Ie.select()},input:Q.current,nativeElement:((It=$.current)===null||It===void 0?void 0:It.nativeElement)||Q.current}}),(0,oe.useEffect)(function(){se.current&&(se.current=!1),ze(function(It){return It&&B?!1:It})},[B]);var nt=function(en,Ie,ve){var be=Ie;if(!ke.current&&Ne.exceedFormatter&&Ne.max&&Ne.strategy(Ie)>Ne.max){if(be=Ne.exceedFormatter(Ie,{max:Ne.max}),Ie!==be){var M,Z;et([((M=Q.current)===null||M===void 0?void 0:M.selectionStart)||0,((Z=Q.current)===null||Z===void 0?void 0:Z.selectionEnd)||0])}}else if(ve.source==="compositionEnd")return;te(be),Q.current&&(0,q.rJ)(Q.current,en,re,be)};(0,oe.useEffect)(function(){if(Ue){var It;(It=Q.current)===null||It===void 0||It.setSelectionRange.apply(It,(0,T.Z)(Ue))}},[Ue]);var lt=function(en){nt(en,en.target.value,{source:"change"})},ye=function(en){ke.current=!1,nt(en,en.currentTarget.value,{source:"compositionEnd"}),dt==null||dt(en)},wt=function(en){xe&&en.key==="Enter"&&!se.current&&(se.current=!0,xe(en)),he==null||he(en)},Qe=function(en){en.key==="Enter"&&(se.current=!1),Ze==null||Ze(en)},We=function(en){ze(!0),J==null||J(en)},Mt=function(en){se.current&&(se.current=!1),ze(!1),X==null||X(en)},$t=function(en){te(""),de(),Q.current&&(0,q.rJ)(Q.current,en,re)},rt=_t&&"".concat(R,"-out-of-range"),Jt=function(){var en=(0,x.Z)(O,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return oe.createElement("input",(0,ue.Z)({autoComplete:ee},en,{onChange:lt,onFocus:We,onBlur:Mt,onKeyDown:wt,onKeyUp:Qe,className:g()(R,(0,Ae.Z)({},"".concat(R,"-disabled"),B),Ye==null?void 0:Ye.input),style:He==null?void 0:He.input,ref:Q,size:G,type:Se,onCompositionStart:function(ve){ke.current=!0,ot==null||ot(ve)},onCompositionEnd:ye}))},Tn=function(){var en=Number(De)>0;if(_||Ne.show){var Ie=Ne.showFormatter?Ne.showFormatter({value:ge,count:Ke,maxLength:De}):"".concat(Ke).concat(en?" / ".concat(De):"");return oe.createElement(oe.Fragment,null,Ne.show&&oe.createElement("span",{className:g()("".concat(R,"-show-count-suffix"),(0,Ae.Z)({},"".concat(R,"-show-count-has-suffix"),!!_),Ye==null?void 0:Ye.count),style:(0,A.Z)({},He==null?void 0:He.count)},Ie),_)}return null};return oe.createElement(S,(0,ue.Z)({},Me,{prefixCls:R,className:g()(W,rt),handleReset:$t,value:ge,focused:mt,triggerFocus:de,suffix:Tn(),disabled:B,classes:Re,classNames:Ye,styles:He}),Jt())}),I=V,L=I},30292:function(bn,St,k){"use strict";k.d(St,{He:function(){return A},X3:function(){return ue},nH:function(){return F},rJ:function(){return ne}});function A(g){return!!(g.addonBefore||g.addonAfter)}function ue(g){return!!(g.prefix||g.suffix||g.allowClear)}function Ae(g,oe,q){var l=oe.cloneNode(!0),S=Object.create(g,{target:{value:l},currentTarget:{value:l}});return l.value=q,typeof oe.selectionStart=="number"&&typeof oe.selectionEnd=="number"&&(l.selectionStart=oe.selectionStart,l.selectionEnd=oe.selectionEnd),l.setSelectionRange=function(){oe.setSelectionRange.apply(oe,arguments)},S}function ne(g,oe,q,l){if(q){var S=oe;if(oe.type==="click"){S=Ae(oe,g,""),q(S);return}if(g.type!=="file"&&l!==void 0){S=Ae(oe,g,l),q(S);return}q(S)}}function F(g,oe){if(g){g.focus(oe);var q=oe||{},l=q.cursor;if(l){var S=g.value.length;switch(l){case"start":g.setSelectionRange(0,0);break;case"end":g.setSelectionRange(S,S);break;default:g.setSelectionRange(0,S)}}}}},28321:function(bn,St,k){"use strict";k.d(St,{iz:function(){return me},ck:function(){return be},BW:function(){return pt},sN:function(){return be},Wd:function(){return xn},ZP:function(){return gt},Xl:function(){return xe}});var A=k(67711),ue=k(52873),Ae=k(98506),ne=k(15142),F=k(16886),g=k(33346),oe=k(92310),q=k.n(oe),l=k(11780),S=k(18929),T=k(13697),d=k(48736),m=k(59301),y=k(4676),x=m.createContext(null);function U(ce,Le){return ce===void 0?null:"".concat(ce,"-").concat(Le)}function N(ce){var Le=m.useContext(x);return U(Le,ce)}var V=k(80547),I=["children","locked"],L=m.createContext(null);function O(ce,Le){var Fe=(0,Ae.Z)({},ce);return Object.keys(Le).forEach(function(Ge){var ct=Le[Ge];ct!==void 0&&(Fe[Ge]=ct)}),Fe}function z(ce){var Le=ce.children,Fe=ce.locked,Ge=(0,g.Z)(ce,I),ct=m.useContext(L),ft=(0,V.Z)(function(){return O(ct,Ge)},[ct,Ge],function(Et,Ut){return!Fe&&(Et[0]!==Ut[0]||!(0,T.Z)(Et[1],Ut[1],!0))});return m.createElement(L.Provider,{value:ft},Le)}var ee=[],re=m.createContext(null);function J(){return m.useContext(re)}var X=m.createContext(ee);function xe(ce){var Le=m.useContext(X);return m.useMemo(function(){return ce!==void 0?[].concat((0,ne.Z)(Le),[ce]):Le},[Le,ce])}var he=m.createContext(null),Ze=m.createContext({}),K=Ze,R=k(29194);function B(ce){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,R.Z)(ce)){var Fe=ce.nodeName.toLowerCase(),Ge=["input","select","textarea","button"].includes(Fe)||ce.isContentEditable||Fe==="a"&&!!ce.getAttribute("href"),ct=ce.getAttribute("tabindex"),ft=Number(ct),Et=null;return ct&&!Number.isNaN(ft)?Et=ft:Ge&&Et===null&&(Et=0),Ge&&ce.disabled&&(Et=null),Et!==null&&(Et>=0||Le&&Et<0)}return!1}function G(ce){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=(0,ne.Z)(ce.querySelectorAll("*")).filter(function(Ge){return B(Ge,Le)});return B(ce,Le)&&Fe.unshift(ce),Fe}var W=null;function H(){W=document.activeElement}function _(){W=null}function v(){if(W)try{W.focus()}catch(ce){}}function C(ce,Le){if(Le.keyCode===9){var Fe=G(ce),Ge=Fe[Le.shiftKey?0:Fe.length-1],ct=Ge===document.activeElement||ce===document.activeElement;if(ct){var ft=Fe[Le.shiftKey?Fe.length-1:0];ft.focus(),Le.preventDefault()}}}var Y=k(10228),Se=k(16089),Re=Y.Z.LEFT,Ye=Y.Z.RIGHT,He=Y.Z.UP,ot=Y.Z.DOWN,dt=Y.Z.ENTER,Me=Y.Z.ESC,ht=Y.Z.HOME,Oe=Y.Z.END,mt=[He,ot,Re,Ye];function ze(ce,Le,Fe,Ge){var ct,ft="prev",Et="next",Ut="children",Gt="parent";if(ce==="inline"&&Ge===dt)return{inlineTrigger:!0};var Yt=(0,ue.Z)((0,ue.Z)({},He,ft),ot,Et),kn=(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},Re,Fe?Et:ft),Ye,Fe?ft:Et),ot,Ut),dt,Ut),qt=(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},He,ft),ot,Et),dt,Ut),Me,Gt),Re,Fe?Ut:Gt),Ye,Fe?Gt:Ut),Zt={inline:Yt,horizontal:kn,vertical:qt,inlineSub:Yt,horizontalSub:qt,verticalSub:qt},fn=(ct=Zt["".concat(ce).concat(Le?"":"Sub")])===null||ct===void 0?void 0:ct[Ge];switch(fn){case ft:return{offset:-1,sibling:!0};case Et:return{offset:1,sibling:!0};case Gt:return{offset:-1,sibling:!1};case Ut:return{offset:1,sibling:!1};default:return null}}function ke(ce){for(var Le=ce;Le;){if(Le.getAttribute("data-menu-list"))return Le;Le=Le.parentElement}return null}function se(ce,Le){for(var Fe=ce||document.activeElement;Fe;){if(Le.has(Fe))return Fe;Fe=Fe.parentElement}return null}function Q(ce,Le){var Fe=G(ce,!0);return Fe.filter(function(Ge){return Le.has(Ge)})}function $(ce,Le,Fe){var Ge=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!ce)return null;var ct=Q(ce,Le),ft=ct.length,Et=ct.findIndex(function(Ut){return Fe===Ut});return Ge<0?Et===-1?Et=ft-1:Et-=1:Ge>0&&(Et+=1),Et=(Et+ft)%ft,ct[Et]}var de=function(Le,Fe){var Ge=new Set,ct=new Map,ft=new Map;return Le.forEach(function(Et){var Ut=document.querySelector("[data-menu-id='".concat(U(Fe,Et),"']"));Ut&&(Ge.add(Ut),ft.set(Ut,Et),ct.set(Et,Ut))}),{elements:Ge,key2element:ct,element2key:ft}};function we(ce,Le,Fe,Ge,ct,ft,Et,Ut,Gt,Yt){var kn=m.useRef(),qt=m.useRef();qt.current=Le;var Zt=function(){Se.Z.cancel(kn.current)};return m.useEffect(function(){return function(){Zt()}},[]),function(fn){var gn=fn.which;if([].concat(mt,[dt,Me,ht,Oe]).includes(gn)){var mn=ft(),Xt=de(mn,Ge),Qt=Xt,kt=Qt.elements,Nt=Qt.key2element,Vt=Qt.element2key,pn=Nt.get(Le),cn=se(pn,kt),Ht=Vt.get(cn),Mn=ze(ce,Et(Ht,!0).length===1,Fe,gn);if(!Mn&&gn!==ht&&gn!==Oe)return;(mt.includes(gn)||[ht,Oe].includes(gn))&&fn.preventDefault();var Hn=function(_n){if(_n){var xt=_n,yt=_n.querySelector("a");yt!=null&&yt.getAttribute("href")&&(xt=yt);var Wt=Vt.get(_n);Ut(Wt),Zt(),kn.current=(0,Se.Z)(function(){qt.current===Wt&&xt.focus()})}};if([ht,Oe].includes(gn)||Mn.sibling||!cn){var qn;!cn||ce==="inline"?qn=ct.current:qn=ke(cn);var vn,ai=Q(qn,kt);gn===ht?vn=ai[0]:gn===Oe?vn=ai[ai.length-1]:vn=$(qn,kt,cn,Mn.offset),Hn(vn)}else if(Mn.inlineTrigger)Gt(Ht);else if(Mn.offset>0)Gt(Ht,!0),Zt(),kn.current=(0,Se.Z)(function(){Xt=de(mn,Ge);var Gn=cn.getAttribute("aria-controls"),_n=document.getElementById(Gn),xt=$(_n,Xt.elements);Hn(xt)},5);else if(Mn.offset<0){var Qn=Et(Ht,!0),ti=Qn[Qn.length-2],li=Nt.get(ti);Gt(ti,!1),Hn(li)}}Yt==null||Yt(fn)}}function Ce(ce){Promise.resolve().then(ce)}var P="__RC_UTIL_PATH_SPLIT__",te=function(Le){return Le.join(P)},ge=function(Le){return Le.split(P)},Ee="rc-menu-more";function Te(){var ce=m.useState({}),Le=(0,F.Z)(ce,2),Fe=Le[1],Ge=(0,m.useRef)(new Map),ct=(0,m.useRef)(new Map),ft=m.useState([]),Et=(0,F.Z)(ft,2),Ut=Et[0],Gt=Et[1],Yt=(0,m.useRef)(0),kn=(0,m.useRef)(!1),qt=function(){kn.current||Fe({})},Zt=(0,m.useCallback)(function(Nt,Vt){var pn=te(Vt);ct.current.set(pn,Nt),Ge.current.set(Nt,pn),Yt.current+=1;var cn=Yt.current;Ce(function(){cn===Yt.current&&qt()})},[]),fn=(0,m.useCallback)(function(Nt,Vt){var pn=te(Vt);ct.current.delete(pn),Ge.current.delete(Nt)},[]),gn=(0,m.useCallback)(function(Nt){Gt(Nt)},[]),mn=(0,m.useCallback)(function(Nt,Vt){var pn=Ge.current.get(Nt)||"",cn=ge(pn);return Vt&&Ut.includes(cn[0])&&cn.unshift(Ee),cn},[Ut]),Xt=(0,m.useCallback)(function(Nt,Vt){return Nt.filter(function(pn){return pn!==void 0}).some(function(pn){var cn=mn(pn,!0);return cn.includes(Vt)})},[mn]),Qt=function(){var Vt=(0,ne.Z)(Ge.current.keys());return Ut.length&&Vt.push(Ee),Vt},kt=(0,m.useCallback)(function(Nt){var Vt="".concat(Ge.current.get(Nt)).concat(P),pn=new Set;return(0,ne.Z)(ct.current.keys()).forEach(function(cn){cn.startsWith(Vt)&&pn.add(ct.current.get(cn))}),pn},[]);return m.useEffect(function(){return function(){kn.current=!0}},[]),{registerPath:Zt,unregisterPath:fn,refreshOverflowKeys:gn,isSubPathKey:Xt,getKeyPath:mn,getKeys:Qt,getSubPathKeys:kt}}function Ue(ce){var Le=m.useRef(ce);Le.current=ce;var Fe=m.useCallback(function(){for(var Ge,ct=arguments.length,ft=new Array(ct),Et=0;Et<ct;Et++)ft[Et]=arguments[Et];return(Ge=Le.current)===null||Ge===void 0?void 0:Ge.call.apply(Ge,[Le].concat(ft))},[]);return ce?Fe:void 0}var et=Math.random().toFixed(5).toString().slice(2),Ne=0;function De(ce){var Le=(0,S.Z)(ce,{value:ce}),Fe=(0,F.Z)(Le,2),Ge=Fe[0],ct=Fe[1];return m.useEffect(function(){Ne+=1;var ft="".concat(et,"-").concat(Ne);ct("rc-menu-uuid-".concat(ft))},[]),Ge}var Ke=k(42573),_t=k(58698),nt=k(74700),lt=k(45080),ye=k(2738),wt=k(8654);function Qe(ce,Le,Fe,Ge){var ct=m.useContext(L),ft=ct.activeKey,Et=ct.onActive,Ut=ct.onInactive,Gt={active:ft===ce};return Le||(Gt.onMouseEnter=function(Yt){Fe==null||Fe({key:ce,domEvent:Yt}),Et(ce)},Gt.onMouseLeave=function(Yt){Ge==null||Ge({key:ce,domEvent:Yt}),Ut(ce)}),Gt}function We(ce){var Le=m.useContext(L),Fe=Le.mode,Ge=Le.rtl,ct=Le.inlineIndent;if(Fe!=="inline")return null;var ft=ce;return Ge?{paddingRight:ft*ct}:{paddingLeft:ft*ct}}function Mt(ce){var Le=ce.icon,Fe=ce.props,Ge=ce.children,ct;return Le===null||Le===!1?null:(typeof Le=="function"?ct=m.createElement(Le,(0,Ae.Z)({},Fe)):typeof Le!="boolean"&&(ct=Le),ct||Ge||null)}var $t=["item"];function rt(ce){var Le=ce.item,Fe=(0,g.Z)(ce,$t);return Object.defineProperty(Fe,"item",{get:function(){return(0,d.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Le}}),Fe}var Jt=["title","attribute","elementRef"],Tn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],It=["active"],en=function(ce){(0,nt.Z)(Fe,ce);var Le=(0,lt.Z)(Fe);function Fe(){return(0,Ke.Z)(this,Fe),Le.apply(this,arguments)}return(0,_t.Z)(Fe,[{key:"render",value:function(){var ct=this.props,ft=ct.title,Et=ct.attribute,Ut=ct.elementRef,Gt=(0,g.Z)(ct,Jt),Yt=(0,ye.Z)(Gt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,d.ZP)(!Et,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),m.createElement(l.Z.Item,(0,A.Z)({},Et,{title:typeof ft=="string"?ft:void 0},Yt,{ref:Ut}))}}]),Fe}(m.Component),Ie=m.forwardRef(function(ce,Le){var Fe=ce.style,Ge=ce.className,ct=ce.eventKey,ft=ce.warnKey,Et=ce.disabled,Ut=ce.itemIcon,Gt=ce.children,Yt=ce.role,kn=ce.onMouseEnter,qt=ce.onMouseLeave,Zt=ce.onClick,fn=ce.onKeyDown,gn=ce.onFocus,mn=(0,g.Z)(ce,Tn),Xt=N(ct),Qt=m.useContext(L),kt=Qt.prefixCls,Nt=Qt.onItemClick,Vt=Qt.disabled,pn=Qt.overflowDisabled,cn=Qt.itemIcon,Ht=Qt.selectedKeys,Mn=Qt.onActive,Hn=m.useContext(K),qn=Hn._internalRenderMenuItem,vn="".concat(kt,"-item"),ai=m.useRef(),Qn=m.useRef(),ti=Vt||Et,li=(0,wt.x1)(Le,Qn),Gn=xe(ct),_n=function(Yn){return{key:ct,keyPath:(0,ne.Z)(Gn).reverse(),item:ai.current,domEvent:Yn}},xt=Ut||cn,yt=Qe(ct,ti,kn,qt),Wt=yt.active,jt=(0,g.Z)(yt,It),yn=Ht.includes(ct),Un=We(Gn.length),Wn=function(Yn){if(!ti){var wi=_n(Yn);Zt==null||Zt(rt(wi)),Nt(wi)}},Bn=function(Yn){if(fn==null||fn(Yn),Yn.which===Y.Z.ENTER){var wi=_n(Yn);Zt==null||Zt(rt(wi)),Nt(wi)}},ri=function(Yn){Mn(ct),gn==null||gn(Yn)},bi={};ce.role==="option"&&(bi["aria-selected"]=yn);var _i=m.createElement(en,(0,A.Z)({ref:ai,elementRef:li,role:Yt===null?"none":Yt||"menuitem",tabIndex:Et?null:-1,"data-menu-id":pn&&Xt?null:Xt},(0,ye.Z)(mn,["extra"]),jt,bi,{component:"li","aria-disabled":Et,style:(0,Ae.Z)((0,Ae.Z)({},Un),Fe),className:q()(vn,(0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(vn,"-active"),Wt),"".concat(vn,"-selected"),yn),"".concat(vn,"-disabled"),ti),Ge),onClick:Wn,onKeyDown:Bn,onFocus:ri}),Gt,m.createElement(Mt,{props:(0,Ae.Z)((0,Ae.Z)({},ce),{},{isSelected:yn}),icon:xt}));return qn&&(_i=qn(_i,ce,{selected:yn})),_i});function ve(ce,Le){var Fe=ce.eventKey,Ge=J(),ct=xe(Fe);return m.useEffect(function(){if(Ge)return Ge.registerPath(Fe,ct),function(){Ge.unregisterPath(Fe,ct)}},[ct]),Ge?null:m.createElement(Ie,(0,A.Z)({},ce,{ref:Le}))}var be=m.forwardRef(ve),M=["className","children"],Z=function(Le,Fe){var Ge=Le.className,ct=Le.children,ft=(0,g.Z)(Le,M),Et=m.useContext(L),Ut=Et.prefixCls,Gt=Et.mode,Yt=Et.rtl;return m.createElement("ul",(0,A.Z)({className:q()(Ut,Yt&&"".concat(Ut,"-rtl"),"".concat(Ut,"-sub"),"".concat(Ut,"-").concat(Gt==="inline"?"inline":"vertical"),Ge),role:"menu"},ft,{"data-menu-list":!0,ref:Fe}),ct)},ie=m.forwardRef(Z);ie.displayName="SubMenuList";var le=ie,_e=k(11592);function it(ce,Le){return(0,_e.Z)(ce).map(function(Fe,Ge){if(m.isValidElement(Fe)){var ct,ft,Et=Fe.key,Ut=(ct=(ft=Fe.props)===null||ft===void 0?void 0:ft.eventKey)!==null&&ct!==void 0?ct:Et,Gt=Ut==null;Gt&&(Ut="tmp_key-".concat([].concat((0,ne.Z)(Le),[Ge]).join("-")));var Yt={key:Ut,eventKey:Ut};return m.cloneElement(Fe,Yt)}return Fe})}var bt=k(65030),Ct={adjustX:1,adjustY:1},zt={topLeft:{points:["bl","tl"],overflow:Ct},topRight:{points:["br","tr"],overflow:Ct},bottomLeft:{points:["tl","bl"],overflow:Ct},bottomRight:{points:["tr","br"],overflow:Ct},leftTop:{points:["tr","tl"],overflow:Ct},leftBottom:{points:["br","bl"],overflow:Ct},rightTop:{points:["tl","tr"],overflow:Ct},rightBottom:{points:["bl","br"],overflow:Ct}},En={topLeft:{points:["bl","tl"],overflow:Ct},topRight:{points:["br","tr"],overflow:Ct},bottomLeft:{points:["tl","bl"],overflow:Ct},bottomRight:{points:["tr","br"],overflow:Ct},rightTop:{points:["tr","tl"],overflow:Ct},rightBottom:{points:["br","bl"],overflow:Ct},leftTop:{points:["tl","tr"],overflow:Ct},leftBottom:{points:["bl","br"],overflow:Ct}},Dn=null;function dn(ce,Le,Fe){if(Le)return Le;if(Fe)return Fe[ce]||Fe.other}var un={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Fn(ce){var Le=ce.prefixCls,Fe=ce.visible,Ge=ce.children,ct=ce.popup,ft=ce.popupStyle,Et=ce.popupClassName,Ut=ce.popupOffset,Gt=ce.disabled,Yt=ce.mode,kn=ce.onVisibleChange,qt=m.useContext(L),Zt=qt.getPopupContainer,fn=qt.rtl,gn=qt.subMenuOpenDelay,mn=qt.subMenuCloseDelay,Xt=qt.builtinPlacements,Qt=qt.triggerSubMenuAction,kt=qt.forceSubMenuRender,Nt=qt.rootClassName,Vt=qt.motion,pn=qt.defaultMotions,cn=m.useState(!1),Ht=(0,F.Z)(cn,2),Mn=Ht[0],Hn=Ht[1],qn=fn?(0,Ae.Z)((0,Ae.Z)({},En),Xt):(0,Ae.Z)((0,Ae.Z)({},zt),Xt),vn=un[Yt],ai=dn(Yt,Vt,pn),Qn=m.useRef(ai);Yt!=="inline"&&(Qn.current=ai);var ti=(0,Ae.Z)((0,Ae.Z)({},Qn.current),{},{leavedClassName:"".concat(Le,"-hidden"),removeOnLeave:!1,motionAppear:!0}),li=m.useRef();return m.useEffect(function(){return li.current=(0,Se.Z)(function(){Hn(Fe)}),function(){Se.Z.cancel(li.current)}},[Fe]),m.createElement(bt.Z,{prefixCls:Le,popupClassName:q()("".concat(Le,"-popup"),(0,ue.Z)({},"".concat(Le,"-rtl"),fn),Et,Nt),stretch:Yt==="horizontal"?"minWidth":null,getPopupContainer:Zt,builtinPlacements:qn,popupPlacement:vn,popupVisible:Mn,popup:ct,popupStyle:ft,popupAlign:Ut&&{offset:Ut},action:Gt?[]:[Qt],mouseEnterDelay:gn,mouseLeaveDelay:mn,onPopupVisibleChange:kn,forceRender:kt,popupMotion:ti,fresh:!0},Ge)}var Vn=k(77900);function Nn(ce){var Le=ce.id,Fe=ce.open,Ge=ce.keyPath,ct=ce.children,ft="inline",Et=m.useContext(L),Ut=Et.prefixCls,Gt=Et.forceSubMenuRender,Yt=Et.motion,kn=Et.defaultMotions,qt=Et.mode,Zt=m.useRef(!1);Zt.current=qt===ft;var fn=m.useState(!Zt.current),gn=(0,F.Z)(fn,2),mn=gn[0],Xt=gn[1],Qt=Zt.current?Fe:!1;m.useEffect(function(){Zt.current&&Xt(!1)},[qt]);var kt=(0,Ae.Z)({},dn(ft,Yt,kn));Ge.length>1&&(kt.motionAppear=!1);var Nt=kt.onVisibleChanged;return kt.onVisibleChanged=function(Vt){return!Zt.current&&!Vt&&Xt(!0),Nt==null?void 0:Nt(Vt)},mn?null:m.createElement(z,{mode:ft,locked:!Zt.current},m.createElement(Vn.default,(0,A.Z)({visible:Qt},kt,{forceRender:Gt,removeOnLeave:!1,leavedClassName:"".concat(Ut,"-hidden")}),function(Vt){var pn=Vt.className,cn=Vt.style;return m.createElement(le,{id:Le,className:pn,style:cn},ct)}))}var zn=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Rt=["active"],at=m.forwardRef(function(ce,Le){var Fe=ce.style,Ge=ce.className,ct=ce.title,ft=ce.eventKey,Et=ce.warnKey,Ut=ce.disabled,Gt=ce.internalPopupClose,Yt=ce.children,kn=ce.itemIcon,qt=ce.expandIcon,Zt=ce.popupClassName,fn=ce.popupOffset,gn=ce.popupStyle,mn=ce.onClick,Xt=ce.onMouseEnter,Qt=ce.onMouseLeave,kt=ce.onTitleClick,Nt=ce.onTitleMouseEnter,Vt=ce.onTitleMouseLeave,pn=(0,g.Z)(ce,zn),cn=N(ft),Ht=m.useContext(L),Mn=Ht.prefixCls,Hn=Ht.mode,qn=Ht.openKeys,vn=Ht.disabled,ai=Ht.overflowDisabled,Qn=Ht.activeKey,ti=Ht.selectedKeys,li=Ht.itemIcon,Gn=Ht.expandIcon,_n=Ht.onItemClick,xt=Ht.onOpenChange,yt=Ht.onActive,Wt=m.useContext(K),jt=Wt._internalRenderSubMenuItem,yn=m.useContext(he),Un=yn.isSubPathKey,Wn=xe(),Bn="".concat(Mn,"-submenu"),ri=vn||Ut,bi=m.useRef(),_i=m.useRef(),ci=kn!=null?kn:li,Yn=qt!=null?qt:Gn,wi=qn.includes(ft),Ti=!ai&&wi,Di=Un(ti,ft),rn=Qe(ft,ri,Nt,Vt),gi=rn.active,hi=(0,g.Z)(rn,Rt),Ii=m.useState(!1),Fi=(0,F.Z)(Ii,2),Ni=Fi[0],ki=Fi[1],Ri=function(jn){ri||ki(jn)},oi=function(jn){Ri(!0),Xt==null||Xt({key:ft,domEvent:jn})},Oi=function(jn){Ri(!1),Qt==null||Qt({key:ft,domEvent:jn})},Xi=m.useMemo(function(){return gi||(Hn!=="inline"?Ni||Un([Qn],ft):!1)},[Hn,gi,Qn,Ni,ft,Un]),Ei=We(Wn.length),ir=function(jn){ri||(kt==null||kt({key:ft,domEvent:jn}),Hn==="inline"&&xt(ft,!wi))},rr=Ue(function(di){mn==null||mn(rt(di)),_n(di)}),Qi=function(jn){Hn!=="inline"&&xt(ft,jn)},Ui=function(){yt(ft)},Vi=cn&&"".concat(cn,"-popup"),$i=m.useMemo(function(){return m.createElement(Mt,{icon:Hn!=="horizontal"?Yn:void 0,props:(0,Ae.Z)((0,Ae.Z)({},ce),{},{isOpen:Ti,isSubMenu:!0})},m.createElement("i",{className:"".concat(Bn,"-arrow")}))},[Hn,Yn,ce,Ti,Bn]),xi=m.createElement("div",(0,A.Z)({role:"menuitem",style:Ei,className:"".concat(Bn,"-title"),tabIndex:ri?null:-1,ref:bi,title:typeof ct=="string"?ct:null,"data-menu-id":ai&&cn?null:cn,"aria-expanded":Ti,"aria-haspopup":!0,"aria-controls":Vi,"aria-disabled":ri,onClick:ir,onFocus:Ui},hi),ct,$i),Mi=m.useRef(Hn);if(Hn!=="inline"&&Wn.length>1?Mi.current="vertical":Mi.current=Hn,!ai){var Hi=Mi.current;xi=m.createElement(Fn,{mode:Hi,prefixCls:Bn,visible:!Gt&&Ti&&Hn!=="inline",popupClassName:Zt,popupOffset:fn,popupStyle:gn,popup:m.createElement(z,{mode:Hi==="horizontal"?"vertical":Hi},m.createElement(le,{id:Vi,ref:_i},Yt)),disabled:ri,onVisibleChange:Qi},xi)}var Jn=m.createElement(l.Z.Item,(0,A.Z)({ref:Le,role:"none"},pn,{component:"li",style:Fe,className:q()(Bn,"".concat(Bn,"-").concat(Hn),Ge,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(Bn,"-open"),Ti),"".concat(Bn,"-active"),Xi),"".concat(Bn,"-selected"),Di),"".concat(Bn,"-disabled"),ri)),onMouseEnter:oi,onMouseLeave:Oi}),xi,!ai&&m.createElement(Nn,{id:Vi,open:Ti,keyPath:Wn},Yt));return jt&&(Jn=jt(Jn,ce,{selected:Di,active:Xi,open:Ti,disabled:ri})),m.createElement(z,{onItemClick:rr,mode:Hn==="horizontal"?"vertical":Hn,itemIcon:ci,expandIcon:Yn},Jn)}),Kt=m.forwardRef(function(ce,Le){var Fe=ce.eventKey,Ge=ce.children,ct=xe(Fe),ft=it(Ge,ct),Et=J();m.useEffect(function(){if(Et)return Et.registerPath(Fe,ct),function(){Et.unregisterPath(Fe,ct)}},[ct]);var Ut;return Et?Ut=ft:Ut=m.createElement(at,(0,A.Z)({ref:Le},ce),ft),m.createElement(X.Provider,{value:ct},Ut)}),xn=Kt,$n=k(26420);function me(ce){var Le=ce.className,Fe=ce.style,Ge=m.useContext(L),ct=Ge.prefixCls,ft=J();return ft?null:m.createElement("li",{role:"separator",className:q()("".concat(ct,"-item-divider"),Le),style:Fe})}var pe=["className","title","eventKey","children"],vt=m.forwardRef(function(ce,Le){var Fe=ce.className,Ge=ce.title,ct=ce.eventKey,ft=ce.children,Et=(0,g.Z)(ce,pe),Ut=m.useContext(L),Gt=Ut.prefixCls,Yt="".concat(Gt,"-item-group");return m.createElement("li",(0,A.Z)({ref:Le,role:"presentation"},Et,{onClick:function(qt){return qt.stopPropagation()},className:q()(Yt,Fe)}),m.createElement("div",{role:"presentation",className:"".concat(Yt,"-title"),title:typeof Ge=="string"?Ge:void 0},Ge),m.createElement("ul",{role:"group",className:"".concat(Yt,"-list")},ft))}),qe=m.forwardRef(function(ce,Le){var Fe=ce.eventKey,Ge=ce.children,ct=xe(Fe),ft=it(Ge,ct),Et=J();return Et?ft:m.createElement(vt,(0,A.Z)({ref:Le},(0,ye.Z)(ce,["warnKey"])),ft)}),pt=qe,Dt=["label","children","key","type","extra"];function Pt(ce,Le,Fe){var Ge=Le.item,ct=Le.group,ft=Le.submenu,Et=Le.divider;return(ce||[]).map(function(Ut,Gt){if(Ut&&(0,$n.Z)(Ut)==="object"){var Yt=Ut,kn=Yt.label,qt=Yt.children,Zt=Yt.key,fn=Yt.type,gn=Yt.extra,mn=(0,g.Z)(Yt,Dt),Xt=Zt!=null?Zt:"tmp-".concat(Gt);return qt||fn==="group"?fn==="group"?m.createElement(ct,(0,A.Z)({key:Xt},mn,{title:kn}),Pt(qt,Le,Fe)):m.createElement(ft,(0,A.Z)({key:Xt},mn,{title:kn}),Pt(qt,Le,Fe)):fn==="divider"?m.createElement(Et,(0,A.Z)({key:Xt},mn)):m.createElement(Ge,(0,A.Z)({key:Xt},mn,{extra:gn}),kn,(!!gn||gn===0)&&m.createElement("span",{className:"".concat(Fe,"-item-extra")},gn))}return null}).filter(function(Ut){return Ut})}function Tt(ce,Le,Fe,Ge,ct){var ft=ce,Et=(0,Ae.Z)({divider:me,item:be,group:pt,submenu:xn},Ge);return Le&&(ft=Pt(Le,Et,ct)),it(ft,Fe)}var Bt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],tt=[],Ot=m.forwardRef(function(ce,Le){var Fe,Ge=ce,ct=Ge.prefixCls,ft=ct===void 0?"rc-menu":ct,Et=Ge.rootClassName,Ut=Ge.style,Gt=Ge.className,Yt=Ge.tabIndex,kn=Yt===void 0?0:Yt,qt=Ge.items,Zt=Ge.children,fn=Ge.direction,gn=Ge.id,mn=Ge.mode,Xt=mn===void 0?"vertical":mn,Qt=Ge.inlineCollapsed,kt=Ge.disabled,Nt=Ge.disabledOverflow,Vt=Ge.subMenuOpenDelay,pn=Vt===void 0?.1:Vt,cn=Ge.subMenuCloseDelay,Ht=cn===void 0?.1:cn,Mn=Ge.forceSubMenuRender,Hn=Ge.defaultOpenKeys,qn=Ge.openKeys,vn=Ge.activeKey,ai=Ge.defaultActiveFirst,Qn=Ge.selectable,ti=Qn===void 0?!0:Qn,li=Ge.multiple,Gn=li===void 0?!1:li,_n=Ge.defaultSelectedKeys,xt=Ge.selectedKeys,yt=Ge.onSelect,Wt=Ge.onDeselect,jt=Ge.inlineIndent,yn=jt===void 0?24:jt,Un=Ge.motion,Wn=Ge.defaultMotions,Bn=Ge.triggerSubMenuAction,ri=Bn===void 0?"hover":Bn,bi=Ge.builtinPlacements,_i=Ge.itemIcon,ci=Ge.expandIcon,Yn=Ge.overflowedIndicator,wi=Yn===void 0?"...":Yn,Ti=Ge.overflowedIndicatorPopupClassName,Di=Ge.getPopupContainer,rn=Ge.onClick,gi=Ge.onOpenChange,hi=Ge.onKeyDown,Ii=Ge.openAnimation,Fi=Ge.openTransitionName,Ni=Ge._internalRenderMenuItem,ki=Ge._internalRenderSubMenuItem,Ri=Ge._internalComponents,oi=(0,g.Z)(Ge,Bt),Oi=m.useMemo(function(){return[Tt(Zt,qt,tt,Ri,ft),Tt(Zt,qt,tt,{},ft)]},[Zt,qt,Ri]),Xi=(0,F.Z)(Oi,2),Ei=Xi[0],ir=Xi[1],rr=m.useState(!1),Qi=(0,F.Z)(rr,2),Ui=Qi[0],Vi=Qi[1],$i=m.useRef(),xi=De(gn),Mi=fn==="rtl",Hi=(0,S.Z)(Hn,{value:qn,postState:function(vi){return vi||tt}}),Jn=(0,F.Z)(Hi,2),di=Jn[0],jn=Jn[1],tn=function(vi){var Ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function qi(){jn(vi),gi==null||gi(vi)}Ai?(0,y.flushSync)(qi):qi()},Pn=m.useState(di),Rn=(0,F.Z)(Pn,2),Ln=Rn[0],ni=Rn[1],fi=m.useRef(!1),Wi=m.useMemo(function(){return(Xt==="inline"||Xt==="vertical")&&Qt?["vertical",Qt]:[Xt,!1]},[Xt,Qt]),sn=(0,F.Z)(Wi,2),An=sn[0],Kn=sn[1],ui=An==="inline",pi=m.useState(An),sr=(0,F.Z)(pi,2),zi=sr[0],fr=sr[1],Bi=m.useState(Kn),Ur=(0,F.Z)(Bi,2),ar=Ur[0],ns=Ur[1];m.useEffect(function(){fr(An),ns(Kn),fi.current&&(ui?jn(Ln):tn(tt))},[An,Kn]);var Tr=m.useState(0),Hr=(0,F.Z)(Tr,2),kr=Hr[0],is=Hr[1],$r=kr>=Ei.length-1||zi!=="horizontal"||Nt;m.useEffect(function(){ui&&ni(di)},[di]),m.useEffect(function(){return fi.current=!0,function(){fi.current=!1}},[]);var br=Te(),Pr=br.registerPath,Wr=br.unregisterPath,Yr=br.refreshOverflowKeys,tr=br.isSubPathKey,rs=br.getKeyPath,Or=br.getKeys,ss=br.getSubPathKeys,ms=m.useMemo(function(){return{registerPath:Pr,unregisterPath:Wr}},[Pr,Wr]),_s=m.useMemo(function(){return{isSubPathKey:tr}},[tr]);m.useEffect(function(){Yr($r?tt:Ei.slice(kr+1).map(function(st){return st.key}))},[kr,$r]);var vs=(0,S.Z)(vn||ai&&((Fe=Ei[0])===null||Fe===void 0?void 0:Fe.key),{value:vn}),Xr=(0,F.Z)(vs,2),hr=Xr[0],ei=Xr[1],Xn=Ue(function(st){ei(st)}),Ki=Ue(function(){ei(void 0)});(0,m.useImperativeHandle)(Le,function(){return{list:$i.current,focus:function(vi){var Ai,qi=Or(),nr=de(qi,xi),Gr=nr.elements,os=nr.key2element,Ws=nr.element2key,Ds=Q($i.current,Gr),ls=hr!=null?hr:Ds[0]?Ws.get(Ds[0]):(Ai=Ei.find(function(Ys){return!Ys.props.disabled}))===null||Ai===void 0?void 0:Ai.key,xr=os.get(ls);if(ls&&xr){var Ar;xr==null||(Ar=xr.focus)===null||Ar===void 0||Ar.call(xr,vi)}}}});var Gi=(0,S.Z)(_n||[],{value:xt,postState:function(vi){return Array.isArray(vi)?vi:vi==null?tt:[vi]}}),Ci=(0,F.Z)(Gi,2),Li=Ci[0],or=Ci[1],Zi=function(vi){if(ti){var Ai=vi.key,qi=Li.includes(Ai),nr;Gn?qi?nr=Li.filter(function(os){return os!==Ai}):nr=[].concat((0,ne.Z)(Li),[Ai]):nr=[Ai],or(nr);var Gr=(0,Ae.Z)((0,Ae.Z)({},vi),{},{selectedKeys:nr});qi?Wt==null||Wt(Gr):yt==null||yt(Gr)}!Gn&&di.length&&zi!=="inline"&&tn(tt)},Er=Ue(function(st){rn==null||rn(rt(st)),Zi(st)}),dr=Ue(function(st,vi){var Ai=di.filter(function(nr){return nr!==st});if(vi)Ai.push(st);else if(zi!=="inline"){var qi=ss(st);Ai=Ai.filter(function(nr){return!qi.has(nr)})}(0,T.Z)(di,Ai,!0)||tn(Ai,!0)}),pr=function(vi,Ai){var qi=Ai!=null?Ai:!di.includes(vi);dr(vi,qi)},Kr=we(zi,hr,Mi,xi,$i,Or,rs,ei,pr,hi);m.useEffect(function(){Vi(!0)},[]);var Mr=m.useMemo(function(){return{_internalRenderMenuItem:Ni,_internalRenderSubMenuItem:ki}},[Ni,ki]),as=zi!=="horizontal"||Nt?Ei:Ei.map(function(st,vi){return m.createElement(z,{key:st.key,overflowDisabled:vi>kr},st)}),Hs=m.createElement(l.Z,(0,A.Z)({id:gn,ref:$i,prefixCls:"".concat(ft,"-overflow"),component:"ul",itemComponent:be,className:q()(ft,"".concat(ft,"-root"),"".concat(ft,"-").concat(zi),Gt,(0,ue.Z)((0,ue.Z)({},"".concat(ft,"-inline-collapsed"),ar),"".concat(ft,"-rtl"),Mi),Et),dir:fn,style:Ut,role:"menu",tabIndex:kn,data:as,renderRawItem:function(vi){return vi},renderRawRest:function(vi){var Ai=vi.length,qi=Ai?Ei.slice(-Ai):null;return m.createElement(xn,{eventKey:Ee,title:wi,disabled:$r,internalPopupClose:Ai===0,popupClassName:Ti},qi)},maxCount:zi!=="horizontal"||Nt?l.Z.INVALIDATE:l.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(vi){is(vi)},onKeyDown:Kr},oi));return m.createElement(K.Provider,{value:Mr},m.createElement(x.Provider,{value:xi},m.createElement(z,{prefixCls:ft,rootClassName:Et,mode:zi,openKeys:di,rtl:Mi,disabled:kt,motion:Ui?Un:null,defaultMotions:Ui?Wn:null,activeKey:hr,onActive:Xn,onInactive:Ki,selectedKeys:Li,inlineIndent:yn,subMenuOpenDelay:pn,subMenuCloseDelay:Ht,forceSubMenuRender:Mn,builtinPlacements:bi,triggerSubMenuAction:ri,getPopupContainer:Di,itemIcon:_i,expandIcon:ci,onItemClick:Er,onOpenChange:dr},m.createElement(he.Provider,{value:_s},Hs),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(re.Provider,{value:ms},ir)))))}),Ft=Ot,Lt=Ft;Lt.Item=be,Lt.SubMenu=xn,Lt.ItemGroup=pt,Lt.Divider=me;var gt=Lt},11780:function(bn,St,k){"use strict";k.d(St,{Z:function(){return H}});var A=k(67711),ue=k(98506),Ae=k(16886),ne=k(33346),F=k(59301),g=k(92310),oe=k.n(g),q=k(29301),l=k(34280),S=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],T=void 0;function d(_,v){var C=_.prefixCls,Y=_.invalidate,Se=_.item,Re=_.renderItem,Ye=_.responsive,He=_.responsiveDisabled,ot=_.registerSize,dt=_.itemKey,Me=_.className,ht=_.style,Oe=_.children,mt=_.display,ze=_.order,ke=_.component,se=ke===void 0?"div":ke,Q=(0,ne.Z)(_,S),$=Ye&&!mt;function de(ge){ot(dt,ge)}F.useEffect(function(){return function(){de(null)}},[]);var we=Re&&Se!==T?Re(Se,{index:ze}):Oe,Ce;Y||(Ce={opacity:$?0:1,height:$?0:T,overflowY:$?"hidden":T,order:Ye?ze:T,pointerEvents:$?"none":T,position:$?"absolute":T});var P={};$&&(P["aria-hidden"]=!0);var te=F.createElement(se,(0,A.Z)({className:oe()(!Y&&C,Me),style:(0,ue.Z)((0,ue.Z)({},Ce),ht)},P,Q,{ref:v}),we);return Ye&&(te=F.createElement(q.Z,{onResize:function(Ee){var Te=Ee.offsetWidth;de(Te)},disabled:He},te)),te}var m=F.forwardRef(d);m.displayName="Item";var y=m,x=k(6089),U=k(4676),N=k(16089);function V(_){if(typeof MessageChannel=="undefined")(0,N.Z)(_);else{var v=new MessageChannel;v.port1.onmessage=function(){return _()},v.port2.postMessage(void 0)}}function I(){var _=F.useRef(null),v=function(Y){_.current||(_.current=[],V(function(){(0,U.unstable_batchedUpdates)(function(){_.current.forEach(function(Se){Se()}),_.current=null})})),_.current.push(Y)};return v}function L(_,v){var C=F.useState(v),Y=(0,Ae.Z)(C,2),Se=Y[0],Re=Y[1],Ye=(0,x.Z)(function(He){_(function(){Re(He)})});return[Se,Ye]}var O=F.createContext(null),z=["component"],ee=["className"],re=["className"],J=function(v,C){var Y=F.useContext(O);if(!Y){var Se=v.component,Re=Se===void 0?"div":Se,Ye=(0,ne.Z)(v,z);return F.createElement(Re,(0,A.Z)({},Ye,{ref:C}))}var He=Y.className,ot=(0,ne.Z)(Y,ee),dt=v.className,Me=(0,ne.Z)(v,re);return F.createElement(O.Provider,{value:null},F.createElement(y,(0,A.Z)({ref:C,className:oe()(He,dt)},ot,Me)))},X=F.forwardRef(J);X.displayName="RawItem";var xe=X,he=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ze="responsive",K="invalidate";function R(_){return"+ ".concat(_.length," ...")}function B(_,v){var C=_.prefixCls,Y=C===void 0?"rc-overflow":C,Se=_.data,Re=Se===void 0?[]:Se,Ye=_.renderItem,He=_.renderRawItem,ot=_.itemKey,dt=_.itemWidth,Me=dt===void 0?10:dt,ht=_.ssr,Oe=_.style,mt=_.className,ze=_.maxCount,ke=_.renderRest,se=_.renderRawRest,Q=_.suffix,$=_.component,de=$===void 0?"div":$,we=_.itemComponent,Ce=_.onVisibleChange,P=(0,ne.Z)(_,he),te=ht==="full",ge=I(),Ee=L(ge,null),Te=(0,Ae.Z)(Ee,2),Ue=Te[0],et=Te[1],Ne=Ue||0,De=L(ge,new Map),Ke=(0,Ae.Z)(De,2),_t=Ke[0],nt=Ke[1],lt=L(ge,0),ye=(0,Ae.Z)(lt,2),wt=ye[0],Qe=ye[1],We=L(ge,0),Mt=(0,Ae.Z)(We,2),$t=Mt[0],rt=Mt[1],Jt=L(ge,0),Tn=(0,Ae.Z)(Jt,2),It=Tn[0],en=Tn[1],Ie=(0,F.useState)(null),ve=(0,Ae.Z)(Ie,2),be=ve[0],M=ve[1],Z=(0,F.useState)(null),ie=(0,Ae.Z)(Z,2),le=ie[0],_e=ie[1],it=F.useMemo(function(){return le===null&&te?Number.MAX_SAFE_INTEGER:le||0},[le,Ue]),bt=(0,F.useState)(!1),Ct=(0,Ae.Z)(bt,2),zt=Ct[0],En=Ct[1],Dn="".concat(Y,"-item"),dn=Math.max(wt,$t),un=ze===Ze,Fn=Re.length&&un,Vn=ze===K,Nn=Fn||typeof ze=="number"&&Re.length>ze,zn=(0,F.useMemo)(function(){var Lt=Re;return Fn?Ue===null&&te?Lt=Re:Lt=Re.slice(0,Math.min(Re.length,Ne/Me)):typeof ze=="number"&&(Lt=Re.slice(0,ze)),Lt},[Re,Me,Ue,ze,Fn]),Rt=(0,F.useMemo)(function(){return Fn?Re.slice(it+1):Re.slice(zn.length)},[Re,zn,Fn,it]),at=(0,F.useCallback)(function(Lt,gt){var ce;return typeof ot=="function"?ot(Lt):(ce=ot&&(Lt==null?void 0:Lt[ot]))!==null&&ce!==void 0?ce:gt},[ot]),Kt=(0,F.useCallback)(Ye||function(Lt){return Lt},[Ye]);function xn(Lt,gt,ce){le===Lt&&(gt===void 0||gt===be)||(_e(Lt),ce||(En(Lt<Re.length-1),Ce==null||Ce(Lt)),gt!==void 0&&M(gt))}function $n(Lt,gt){et(gt.clientWidth)}function me(Lt,gt){nt(function(ce){var Le=new Map(ce);return gt===null?Le.delete(Lt):Le.set(Lt,gt),Le})}function pe(Lt,gt){rt(gt),Qe($t)}function vt(Lt,gt){en(gt)}function qe(Lt){return _t.get(at(zn[Lt],Lt))}(0,l.Z)(function(){if(Ne&&typeof dn=="number"&&zn){var Lt=It,gt=zn.length,ce=gt-1;if(!gt){xn(0,null);return}for(var Le=0;Le<gt;Le+=1){var Fe=qe(Le);if(te&&(Fe=Fe||0),Fe===void 0){xn(Le-1,void 0,!0);break}if(Lt+=Fe,ce===0&&Lt<=Ne||Le===ce-1&&Lt+qe(ce)<=Ne){xn(ce,null);break}else if(Lt+dn>Ne){xn(Le-1,Lt-Fe-It+$t);break}}Q&&qe(0)+It>Ne&&M(null)}},[Ne,_t,$t,It,at,zn]);var pt=zt&&!!Rt.length,Dt={};be!==null&&Fn&&(Dt={position:"absolute",left:be,top:0});var Pt={prefixCls:Dn,responsive:Fn,component:we,invalidate:Vn},Tt=He?function(Lt,gt){var ce=at(Lt,gt);return F.createElement(O.Provider,{key:ce,value:(0,ue.Z)((0,ue.Z)({},Pt),{},{order:gt,item:Lt,itemKey:ce,registerSize:me,display:gt<=it})},He(Lt,gt))}:function(Lt,gt){var ce=at(Lt,gt);return F.createElement(y,(0,A.Z)({},Pt,{order:gt,key:ce,item:Lt,renderItem:Kt,itemKey:ce,registerSize:me,display:gt<=it}))},Bt={order:pt?it:Number.MAX_SAFE_INTEGER,className:"".concat(Dn,"-rest"),registerSize:pe,display:pt},tt=ke||R,Ot=se?F.createElement(O.Provider,{value:(0,ue.Z)((0,ue.Z)({},Pt),Bt)},se(Rt)):F.createElement(y,(0,A.Z)({},Pt,Bt),typeof tt=="function"?tt(Rt):tt),Ft=F.createElement(de,(0,A.Z)({className:oe()(!Vn&&Y,mt),style:Oe,ref:v},P),zn.map(Tt),Nn?Ot:null,Q&&F.createElement(y,(0,A.Z)({},Pt,{responsive:un,responsiveDisabled:!Fn,order:it,className:"".concat(Dn,"-suffix"),registerSize:vt,display:!0,style:Dt}),Q));return un?F.createElement(q.Z,{onResize:$n,disabled:!Fn},Ft):Ft}var G=F.forwardRef(B);G.displayName="Overflow",G.Item=xe,G.RESPONSIVE=Ze,G.INVALIDATE=K;var W=G,H=W},23425:function(bn,St,k){"use strict";k.d(St,{Z:function(){return re}});var A=k(52873),ue=k(67711),Ae=k(26420),ne=k(98506),F=k(16886),g=k(92310),oe=k.n(g),q=k(18929),l=k(10228),S=k(26112),T=k(48736),d=k(59301),m=k(17119),y=[10,20,50,100],x=function(X){var xe=X.pageSizeOptions,he=xe===void 0?y:xe,Ze=X.locale,K=X.changeSize,R=X.pageSize,B=X.goButton,G=X.quickGo,W=X.rootPrefixCls,H=X.disabled,_=X.buildOptionText,v=X.showSizeChanger,C=X.sizeChangerRender,Y=d.useState(""),Se=(0,F.Z)(Y,2),Re=Se[0],Ye=Se[1],He=function(){return!Re||Number.isNaN(Re)?void 0:Number(Re)},ot=typeof _=="function"?_:function(Q){return"".concat(Q," ").concat(Ze.items_per_page)},dt=function($){Ye($.target.value)},Me=function($){B||Re===""||(Ye(""),!($.relatedTarget&&($.relatedTarget.className.indexOf("".concat(W,"-item-link"))>=0||$.relatedTarget.className.indexOf("".concat(W,"-item"))>=0))&&(G==null||G(He())))},ht=function($){Re!==""&&($.keyCode===l.Z.ENTER||$.type==="click")&&(Ye(""),G==null||G(He()))},Oe=function(){return he.some(function($){return $.toString()===R.toString()})?he:he.concat([R]).sort(function($,de){var we=Number.isNaN(Number($))?0:Number($),Ce=Number.isNaN(Number(de))?0:Number(de);return we-Ce})},mt="".concat(W,"-options");if(!v&&!G)return null;var ze=null,ke=null,se=null;return v&&C&&(ze=C({disabled:H,size:R,onSizeChange:function($){K==null||K(Number($))},"aria-label":Ze.page_size,className:"".concat(mt,"-size-changer"),options:Oe().map(function(Q){return{label:ot(Q),value:Q}})})),G&&(B&&(se=typeof B=="boolean"?d.createElement("button",{type:"button",onClick:ht,onKeyUp:ht,disabled:H,className:"".concat(mt,"-quick-jumper-button")},Ze.jump_to_confirm):d.createElement("span",{onClick:ht,onKeyUp:ht},B)),ke=d.createElement("div",{className:"".concat(mt,"-quick-jumper")},Ze.jump_to,d.createElement("input",{disabled:H,type:"text",value:Re,onChange:dt,onKeyUp:ht,onBlur:Me,"aria-label":Ze.page}),Ze.page,se)),d.createElement("li",{className:mt},ze,ke)},U=x,N=function(X){var xe=X.rootPrefixCls,he=X.page,Ze=X.active,K=X.className,R=X.showTitle,B=X.onClick,G=X.onKeyPress,W=X.itemRender,H="".concat(xe,"-item"),_=oe()(H,"".concat(H,"-").concat(he),(0,A.Z)((0,A.Z)({},"".concat(H,"-active"),Ze),"".concat(H,"-disabled"),!he),K),v=function(){B(he)},C=function(Re){G(Re,B,he)},Y=W(he,"page",d.createElement("a",{rel:"nofollow"},he));return Y?d.createElement("li",{title:R?String(he):null,className:_,onClick:v,onKeyDown:C,tabIndex:0},Y):null},V=N,I=function(X,xe,he){return he};function L(){}function O(J){var X=Number(J);return typeof X=="number"&&!Number.isNaN(X)&&isFinite(X)&&Math.floor(X)===X}function z(J,X,xe){var he=typeof J=="undefined"?X:J;return Math.floor((xe-1)/he)+1}var ee=function(X){var xe=X.prefixCls,he=xe===void 0?"rc-pagination":xe,Ze=X.selectPrefixCls,K=Ze===void 0?"rc-select":Ze,R=X.className,B=X.current,G=X.defaultCurrent,W=G===void 0?1:G,H=X.total,_=H===void 0?0:H,v=X.pageSize,C=X.defaultPageSize,Y=C===void 0?10:C,Se=X.onChange,Re=Se===void 0?L:Se,Ye=X.hideOnSinglePage,He=X.align,ot=X.showPrevNextJumpers,dt=ot===void 0?!0:ot,Me=X.showQuickJumper,ht=X.showLessItems,Oe=X.showTitle,mt=Oe===void 0?!0:Oe,ze=X.onShowSizeChange,ke=ze===void 0?L:ze,se=X.locale,Q=se===void 0?m.Z:se,$=X.style,de=X.totalBoundaryShowSizeChanger,we=de===void 0?50:de,Ce=X.disabled,P=X.simple,te=X.showTotal,ge=X.showSizeChanger,Ee=ge===void 0?_>we:ge,Te=X.sizeChangerRender,Ue=X.pageSizeOptions,et=X.itemRender,Ne=et===void 0?I:et,De=X.jumpPrevIcon,Ke=X.jumpNextIcon,_t=X.prevIcon,nt=X.nextIcon,lt=d.useRef(null),ye=(0,q.Z)(10,{value:v,defaultValue:Y}),wt=(0,F.Z)(ye,2),Qe=wt[0],We=wt[1],Mt=(0,q.Z)(1,{value:B,defaultValue:W,postState:function(Nt){return Math.max(1,Math.min(Nt,z(void 0,Qe,_)))}}),$t=(0,F.Z)(Mt,2),rt=$t[0],Jt=$t[1],Tn=d.useState(rt),It=(0,F.Z)(Tn,2),en=It[0],Ie=It[1];(0,d.useEffect)(function(){Ie(rt)},[rt]);var ve=Re!==L,be="current"in X,M=Math.max(1,rt-(ht?3:5)),Z=Math.min(z(void 0,Qe,_),rt+(ht?3:5));function ie(kt,Nt){var Vt=kt||d.createElement("button",{type:"button","aria-label":Nt,className:"".concat(he,"-item-link")});return typeof kt=="function"&&(Vt=d.createElement(kt,(0,ne.Z)({},X))),Vt}function le(kt){var Nt=kt.target.value,Vt=z(void 0,Qe,_),pn;return Nt===""?pn=Nt:Number.isNaN(Number(Nt))?pn=en:Nt>=Vt?pn=Vt:pn=Number(Nt),pn}function _e(kt){return O(kt)&&kt!==rt&&O(_)&&_>0}var it=_>Qe?Me:!1;function bt(kt){(kt.keyCode===l.Z.UP||kt.keyCode===l.Z.DOWN)&&kt.preventDefault()}function Ct(kt){var Nt=le(kt);switch(Nt!==en&&Ie(Nt),kt.keyCode){case l.Z.ENTER:Dn(Nt);break;case l.Z.UP:Dn(Nt-1);break;case l.Z.DOWN:Dn(Nt+1);break;default:break}}function zt(kt){Dn(le(kt))}function En(kt){var Nt=z(kt,Qe,_),Vt=rt>Nt&&Nt!==0?Nt:rt;We(kt),Ie(Vt),ke==null||ke(rt,kt),Jt(Vt),Re==null||Re(Vt,kt)}function Dn(kt){if(_e(kt)&&!Ce){var Nt=z(void 0,Qe,_),Vt=kt;return kt>Nt?Vt=Nt:kt<1&&(Vt=1),Vt!==en&&Ie(Vt),Jt(Vt),Re==null||Re(Vt,Qe),Vt}return rt}var dn=rt>1,un=rt<z(void 0,Qe,_);function Fn(){dn&&Dn(rt-1)}function Vn(){un&&Dn(rt+1)}function Nn(){Dn(M)}function zn(){Dn(Z)}function Rt(kt,Nt){if(kt.key==="Enter"||kt.charCode===l.Z.ENTER||kt.keyCode===l.Z.ENTER){for(var Vt=arguments.length,pn=new Array(Vt>2?Vt-2:0),cn=2;cn<Vt;cn++)pn[cn-2]=arguments[cn];Nt.apply(void 0,pn)}}function at(kt){Rt(kt,Fn)}function Kt(kt){Rt(kt,Vn)}function xn(kt){Rt(kt,Nn)}function $n(kt){Rt(kt,zn)}function me(kt){var Nt=Ne(kt,"prev",ie(_t,"prev page"));return d.isValidElement(Nt)?d.cloneElement(Nt,{disabled:!dn}):Nt}function pe(kt){var Nt=Ne(kt,"next",ie(nt,"next page"));return d.isValidElement(Nt)?d.cloneElement(Nt,{disabled:!un}):Nt}function vt(kt){(kt.type==="click"||kt.keyCode===l.Z.ENTER)&&Dn(en)}var qe=null,pt=(0,S.Z)(X,{aria:!0,data:!0}),Dt=te&&d.createElement("li",{className:"".concat(he,"-total-text")},te(_,[_===0?0:(rt-1)*Qe+1,rt*Qe>_?_:rt*Qe])),Pt=null,Tt=z(void 0,Qe,_);if(Ye&&_<=Qe)return null;var Bt=[],tt={rootPrefixCls:he,onClick:Dn,onKeyPress:Rt,showTitle:mt,itemRender:Ne,page:-1},Ot=rt-1>0?rt-1:0,Ft=rt+1<Tt?rt+1:Tt,Lt=Me&&Me.goButton,gt=(0,Ae.Z)(P)==="object"?P.readOnly:!P,ce=Lt,Le=null;P&&(Lt&&(typeof Lt=="boolean"?ce=d.createElement("button",{type:"button",onClick:vt,onKeyUp:vt},Q.jump_to_confirm):ce=d.createElement("span",{onClick:vt,onKeyUp:vt},Lt),ce=d.createElement("li",{title:mt?"".concat(Q.jump_to).concat(rt,"/").concat(Tt):null,className:"".concat(he,"-simple-pager")},ce)),Le=d.createElement("li",{title:mt?"".concat(rt,"/").concat(Tt):null,className:"".concat(he,"-simple-pager")},gt?en:d.createElement("input",{type:"text","aria-label":Q.jump_to,value:en,disabled:Ce,onKeyDown:bt,onKeyUp:Ct,onChange:Ct,onBlur:zt,size:3}),d.createElement("span",{className:"".concat(he,"-slash")},"/"),Tt));var Fe=ht?1:2;if(Tt<=3+Fe*2){Tt||Bt.push(d.createElement(V,(0,ue.Z)({},tt,{key:"noPager",page:1,className:"".concat(he,"-item-disabled")})));for(var Ge=1;Ge<=Tt;Ge+=1)Bt.push(d.createElement(V,(0,ue.Z)({},tt,{key:Ge,page:Ge,active:rt===Ge})))}else{var ct=ht?Q.prev_3:Q.prev_5,ft=ht?Q.next_3:Q.next_5,Et=Ne(M,"jump-prev",ie(De,"prev page")),Ut=Ne(Z,"jump-next",ie(Ke,"next page"));dt&&(qe=Et?d.createElement("li",{title:mt?ct:null,key:"prev",onClick:Nn,tabIndex:0,onKeyDown:xn,className:oe()("".concat(he,"-jump-prev"),(0,A.Z)({},"".concat(he,"-jump-prev-custom-icon"),!!De))},Et):null,Pt=Ut?d.createElement("li",{title:mt?ft:null,key:"next",onClick:zn,tabIndex:0,onKeyDown:$n,className:oe()("".concat(he,"-jump-next"),(0,A.Z)({},"".concat(he,"-jump-next-custom-icon"),!!Ke))},Ut):null);var Gt=Math.max(1,rt-Fe),Yt=Math.min(rt+Fe,Tt);rt-1<=Fe&&(Yt=1+Fe*2),Tt-rt<=Fe&&(Gt=Tt-Fe*2);for(var kn=Gt;kn<=Yt;kn+=1)Bt.push(d.createElement(V,(0,ue.Z)({},tt,{key:kn,page:kn,active:rt===kn})));if(rt-1>=Fe*2&&rt!==3&&(Bt[0]=d.cloneElement(Bt[0],{className:oe()("".concat(he,"-item-after-jump-prev"),Bt[0].props.className)}),Bt.unshift(qe)),Tt-rt>=Fe*2&&rt!==Tt-2){var qt=Bt[Bt.length-1];Bt[Bt.length-1]=d.cloneElement(qt,{className:oe()("".concat(he,"-item-before-jump-next"),qt.props.className)}),Bt.push(Pt)}Gt!==1&&Bt.unshift(d.createElement(V,(0,ue.Z)({},tt,{key:1,page:1}))),Yt!==Tt&&Bt.push(d.createElement(V,(0,ue.Z)({},tt,{key:Tt,page:Tt})))}var Zt=me(Ot);if(Zt){var fn=!dn||!Tt;Zt=d.createElement("li",{title:mt?Q.prev_page:null,onClick:Fn,tabIndex:fn?null:0,onKeyDown:at,className:oe()("".concat(he,"-prev"),(0,A.Z)({},"".concat(he,"-disabled"),fn)),"aria-disabled":fn},Zt)}var gn=pe(Ft);if(gn){var mn,Xt;P?(mn=!un,Xt=dn?0:null):(mn=!un||!Tt,Xt=mn?null:0),gn=d.createElement("li",{title:mt?Q.next_page:null,onClick:Vn,tabIndex:Xt,onKeyDown:Kt,className:oe()("".concat(he,"-next"),(0,A.Z)({},"".concat(he,"-disabled"),mn)),"aria-disabled":mn},gn)}var Qt=oe()(he,R,(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({},"".concat(he,"-start"),He==="start"),"".concat(he,"-center"),He==="center"),"".concat(he,"-end"),He==="end"),"".concat(he,"-simple"),P),"".concat(he,"-disabled"),Ce));return d.createElement("ul",(0,ue.Z)({className:Qt,style:$,ref:lt},pt),Dt,Zt,P?Le:Bt,gn,d.createElement(U,{locale:Q,rootPrefixCls:he,disabled:Ce,selectPrefixCls:K,changeSize:En,pageSize:Qe,pageSizeOptions:Ue,quickGo:it?Dn:null,goButton:ce,showSizeChanger:Ee,sizeChangerRender:Te}))},re=ee},29301:function(bn,St,k){"use strict";k.d(St,{Z:function(){return K}});var A=k(67711),ue=k(59301),Ae=k(11592),ne=k(48736),F=k(98506),g=k(26420),oe=k(76846),q=k(8654),l=ue.createContext(null);function S(R){var B=R.children,G=R.onBatchResize,W=ue.useRef(0),H=ue.useRef([]),_=ue.useContext(l),v=ue.useCallback(function(C,Y,Se){W.current+=1;var Re=W.current;H.current.push({size:C,element:Y,data:Se}),Promise.resolve().then(function(){Re===W.current&&(G==null||G(H.current),H.current=[])}),_==null||_(C,Y,Se)},[G,_]);return ue.createElement(l.Provider,{value:v},B)}var T=k(76374),d=new Map;function m(R){R.forEach(function(B){var G,W=B.target;(G=d.get(W))===null||G===void 0||G.forEach(function(H){return H(W)})})}var y=new T.Z(m),x=null,U=null;function N(R,B){d.has(R)||(d.set(R,new Set),y.observe(R)),d.get(R).add(B)}function V(R,B){d.has(R)&&(d.get(R).delete(B),d.get(R).size||(y.unobserve(R),d.delete(R)))}var I=k(42573),L=k(58698),O=k(74700),z=k(45080),ee=function(R){(0,O.Z)(G,R);var B=(0,z.Z)(G);function G(){return(0,I.Z)(this,G),B.apply(this,arguments)}return(0,L.Z)(G,[{key:"render",value:function(){return this.props.children}}]),G}(ue.Component);function re(R,B){var G=R.children,W=R.disabled,H=ue.useRef(null),_=ue.useRef(null),v=ue.useContext(l),C=typeof G=="function",Y=C?G(H):G,Se=ue.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Re=!C&&ue.isValidElement(Y)&&(0,q.Yr)(Y),Ye=Re?(0,q.C4)(Y):null,He=(0,q.x1)(Ye,H),ot=function(){var Oe;return(0,oe.ZP)(H.current)||(H.current&&(0,g.Z)(H.current)==="object"?(0,oe.ZP)((Oe=H.current)===null||Oe===void 0?void 0:Oe.nativeElement):null)||(0,oe.ZP)(_.current)};ue.useImperativeHandle(B,function(){return ot()});var dt=ue.useRef(R);dt.current=R;var Me=ue.useCallback(function(ht){var Oe=dt.current,mt=Oe.onResize,ze=Oe.data,ke=ht.getBoundingClientRect(),se=ke.width,Q=ke.height,$=ht.offsetWidth,de=ht.offsetHeight,we=Math.floor(se),Ce=Math.floor(Q);if(Se.current.width!==we||Se.current.height!==Ce||Se.current.offsetWidth!==$||Se.current.offsetHeight!==de){var P={width:we,height:Ce,offsetWidth:$,offsetHeight:de};Se.current=P;var te=$===Math.round(se)?se:$,ge=de===Math.round(Q)?Q:de,Ee=(0,F.Z)((0,F.Z)({},P),{},{offsetWidth:te,offsetHeight:ge});v==null||v(Ee,ht,ze),mt&&Promise.resolve().then(function(){mt(Ee,ht)})}},[]);return ue.useEffect(function(){var ht=ot();return ht&&!W&&N(ht,Me),function(){return V(ht,Me)}},[H.current,W]),ue.createElement(ee,{ref:_},Re?ue.cloneElement(Y,{ref:He}):Y)}var J=ue.forwardRef(re),X=J,xe="rc-observer-key";function he(R,B){var G=R.children,W=typeof G=="function"?[G]:(0,Ae.Z)(G);return W.map(function(H,_){var v=(H==null?void 0:H.key)||"".concat(xe,"-").concat(_);return ue.createElement(X,(0,A.Z)({},R,{key:v,ref:_===0?B:void 0}),H)})}var Ze=ue.forwardRef(he);Ze.Collection=S;var K=Ze},6551:function(bn,St,k){"use strict";k.d(St,{ZP:function(){return oe}});var A=k(16886),ue=k(59301),Ae=k(47273),ne=0,F=(0,Ae.Z)();function g(){var q;return F?(q=ne,ne+=1):q="TEST_OR_SSR",q}function oe(q){var l=ue.useState(),S=(0,A.Z)(l,2),T=S[0],d=S[1];return ue.useEffect(function(){d("rc_select_".concat(g()))},[]),q||T}},37463:function(bn,St,k){"use strict";k.d(St,{Ac:function(){return ye},Xo:function(){return Qe},Wx:function(){return Mt},ZP:function(){return $n},lk:function(){return L}});var A=k(67711),ue=k(15142),Ae=k(52873),ne=k(98506),F=k(16886),g=k(33346),oe=k(26420),q=k(18929),l=k(48736),S=k(59301),T=k(92310),d=k.n(T),m=k(34280),y=k(49658),x=k(8654),U=function(pe){var vt=pe.className,qe=pe.customizeIcon,pt=pe.customizeIconProps,Dt=pe.children,Pt=pe.onMouseDown,Tt=pe.onClick,Bt=typeof qe=="function"?qe(pt):qe;return S.createElement("span",{className:vt,onMouseDown:function(Ot){Ot.preventDefault(),Pt==null||Pt(Ot)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Tt,"aria-hidden":!0},Bt!==void 0?Bt:S.createElement("span",{className:d()(vt.split(/\s+/).map(function(tt){return"".concat(tt,"-icon")}))},Dt))},N=U,V=function(pe,vt,qe,pt,Dt){var Pt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Tt=arguments.length>6?arguments[6]:void 0,Bt=arguments.length>7?arguments[7]:void 0,tt=S.useMemo(function(){if((0,oe.Z)(pt)==="object")return pt.clearIcon;if(Dt)return Dt},[pt,Dt]),Ot=S.useMemo(function(){return!!(!Pt&&pt&&(qe.length||Tt)&&!(Bt==="combobox"&&Tt===""))},[pt,Pt,qe.length,Tt,Bt]);return{allowClear:Ot,clearIcon:S.createElement(N,{className:"".concat(pe,"-clear"),onMouseDown:vt,customizeIcon:tt},"\xD7")}},I=S.createContext(null);function L(){return S.useContext(I)}function O(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,pe=S.useState(!1),vt=(0,F.Z)(pe,2),qe=vt[0],pt=vt[1],Dt=S.useRef(null),Pt=function(){window.clearTimeout(Dt.current)};S.useEffect(function(){return Pt},[]);var Tt=function(tt,Ot){Pt(),Dt.current=window.setTimeout(function(){pt(tt),Ot&&Ot()},me)};return[qe,Tt,Pt]}function z(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,pe=S.useRef(null),vt=S.useRef(null);S.useEffect(function(){return function(){window.clearTimeout(vt.current)}},[]);function qe(pt){(pt||pe.current===null)&&(pe.current=pt),window.clearTimeout(vt.current),vt.current=window.setTimeout(function(){pe.current=null},me)}return[function(){return pe.current},qe]}function ee(me,pe,vt,qe){var pt=S.useRef(null);pt.current={open:pe,triggerOpen:vt,customizedTrigger:qe},S.useEffect(function(){function Dt(Pt){var Tt;if(!((Tt=pt.current)!==null&&Tt!==void 0&&Tt.customizedTrigger)){var Bt=Pt.target;Bt.shadowRoot&&Pt.composed&&(Bt=Pt.composedPath()[0]||Bt),pt.current.open&&me().filter(function(tt){return tt}).every(function(tt){return!tt.contains(Bt)&&tt!==Bt})&&pt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Dt),function(){return window.removeEventListener("mousedown",Dt)}},[])}var re=k(10228);function J(me){return me&&![re.Z.ESC,re.Z.SHIFT,re.Z.BACKSPACE,re.Z.TAB,re.Z.WIN_KEY,re.Z.ALT,re.Z.META,re.Z.WIN_KEY_RIGHT,re.Z.CTRL,re.Z.SEMICOLON,re.Z.EQUALS,re.Z.CAPS_LOCK,re.Z.CONTEXT_MENU,re.Z.F1,re.Z.F2,re.Z.F3,re.Z.F4,re.Z.F5,re.Z.F6,re.Z.F7,re.Z.F8,re.Z.F9,re.Z.F10,re.Z.F11,re.Z.F12].includes(me)}var X=k(26112),xe=k(11780);function he(me,pe,vt){var qe=(0,ne.Z)((0,ne.Z)({},me),vt?pe:{});return Object.keys(pe).forEach(function(pt){var Dt=pe[pt];typeof Dt=="function"&&(qe[pt]=function(){for(var Pt,Tt=arguments.length,Bt=new Array(Tt),tt=0;tt<Tt;tt++)Bt[tt]=arguments[tt];return Dt.apply(void 0,Bt),(Pt=me[pt])===null||Pt===void 0?void 0:Pt.call.apply(Pt,[me].concat(Bt))})}),qe}var Ze=he,K=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],R=function(pe,vt){var qe=pe.prefixCls,pt=pe.id,Dt=pe.inputElement,Pt=pe.autoFocus,Tt=pe.autoComplete,Bt=pe.editable,tt=pe.activeDescendantId,Ot=pe.value,Ft=pe.open,Lt=pe.attrs,gt=(0,g.Z)(pe,K),ce=Dt||S.createElement("input",null),Le=ce,Fe=Le.ref,Ge=Le.props;return(0,l.Kp)(!("maxLength"in ce.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),ce=S.cloneElement(ce,(0,ne.Z)((0,ne.Z)((0,ne.Z)({type:"search"},Ze(gt,Ge,!0)),{},{id:pt,ref:(0,x.sQ)(vt,Fe),autoComplete:Tt||"off",autoFocus:Pt,className:d()("".concat(qe,"-selection-search-input"),Ge==null?void 0:Ge.className),role:"combobox","aria-expanded":Ft||!1,"aria-haspopup":"listbox","aria-owns":"".concat(pt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(pt,"_list"),"aria-activedescendant":Ft?tt:void 0},Lt),{},{value:Bt?Ot:"",readOnly:!Bt,unselectable:Bt?null:"on",style:(0,ne.Z)((0,ne.Z)({},Ge.style),{},{opacity:Bt?null:0})})),ce},B=S.forwardRef(R),G=B;function W(me){return Array.isArray(me)?me:me!==void 0?[me]:[]}var H=typeof window!="undefined"&&window.document&&window.document.documentElement,_=H;function v(me){return me!=null}function C(me){return!me&&me!==0}function Y(me){return["string","number"].includes((0,oe.Z)(me))}function Se(me){var pe=void 0;return me&&(Y(me.title)?pe=me.title.toString():Y(me.label)&&(pe=me.label.toString())),pe}function Re(me,pe){_?S.useLayoutEffect(me,pe):S.useEffect(me,pe)}function Ye(me){var pe;return(pe=me.key)!==null&&pe!==void 0?pe:me.value}var He=function(pe){pe.preventDefault(),pe.stopPropagation()},ot=function(pe){var vt=pe.id,qe=pe.prefixCls,pt=pe.values,Dt=pe.open,Pt=pe.searchValue,Tt=pe.autoClearSearchValue,Bt=pe.inputRef,tt=pe.placeholder,Ot=pe.disabled,Ft=pe.mode,Lt=pe.showSearch,gt=pe.autoFocus,ce=pe.autoComplete,Le=pe.activeDescendantId,Fe=pe.tabIndex,Ge=pe.removeIcon,ct=pe.maxTagCount,ft=pe.maxTagTextLength,Et=pe.maxTagPlaceholder,Ut=Et===void 0?function(Wt){return"+ ".concat(Wt.length," ...")}:Et,Gt=pe.tagRender,Yt=pe.onToggleOpen,kn=pe.onRemove,qt=pe.onInputChange,Zt=pe.onInputPaste,fn=pe.onInputKeyDown,gn=pe.onInputMouseDown,mn=pe.onInputCompositionStart,Xt=pe.onInputCompositionEnd,Qt=pe.onInputBlur,kt=S.useRef(null),Nt=(0,S.useState)(0),Vt=(0,F.Z)(Nt,2),pn=Vt[0],cn=Vt[1],Ht=(0,S.useState)(!1),Mn=(0,F.Z)(Ht,2),Hn=Mn[0],qn=Mn[1],vn="".concat(qe,"-selection"),ai=Dt||Ft==="multiple"&&Tt===!1||Ft==="tags"?Pt:"",Qn=Ft==="tags"||Ft==="multiple"&&Tt===!1||Lt&&(Dt||Hn);Re(function(){cn(kt.current.scrollWidth)},[ai]);var ti=function(jt,yn,Un,Wn,Bn){return S.createElement("span",{title:Se(jt),className:d()("".concat(vn,"-item"),(0,Ae.Z)({},"".concat(vn,"-item-disabled"),Un))},S.createElement("span",{className:"".concat(vn,"-item-content")},yn),Wn&&S.createElement(N,{className:"".concat(vn,"-item-remove"),onMouseDown:He,onClick:Bn,customizeIcon:Ge},"\xD7"))},li=function(jt,yn,Un,Wn,Bn,ri){var bi=function(ci){He(ci),Yt(!Dt)};return S.createElement("span",{onMouseDown:bi},Gt({label:yn,value:jt,disabled:Un,closable:Wn,onClose:Bn,isMaxTag:!!ri}))},Gn=function(jt){var yn=jt.disabled,Un=jt.label,Wn=jt.value,Bn=!Ot&&!yn,ri=Un;if(typeof ft=="number"&&(typeof Un=="string"||typeof Un=="number")){var bi=String(ri);bi.length>ft&&(ri="".concat(bi.slice(0,ft),"..."))}var _i=function(Yn){Yn&&Yn.stopPropagation(),kn(jt)};return typeof Gt=="function"?li(Wn,ri,yn,Bn,_i):ti(jt,ri,yn,Bn,_i)},_n=function(jt){if(!pt.length)return null;var yn=typeof Ut=="function"?Ut(jt):Ut;return typeof Gt=="function"?li(void 0,yn,!1,!1,void 0,!0):ti({title:yn},yn,!1)},xt=S.createElement("div",{className:"".concat(vn,"-search"),style:{width:pn},onFocus:function(){qn(!0)},onBlur:function(){qn(!1)}},S.createElement(G,{ref:Bt,open:Dt,prefixCls:qe,id:vt,inputElement:null,disabled:Ot,autoFocus:gt,autoComplete:ce,editable:Qn,activeDescendantId:Le,value:ai,onKeyDown:fn,onMouseDown:gn,onChange:qt,onPaste:Zt,onCompositionStart:mn,onCompositionEnd:Xt,onBlur:Qt,tabIndex:Fe,attrs:(0,X.Z)(pe,!0)}),S.createElement("span",{ref:kt,className:"".concat(vn,"-search-mirror"),"aria-hidden":!0},ai,"\xA0")),yt=S.createElement(xe.Z,{prefixCls:"".concat(vn,"-overflow"),data:pt,renderItem:Gn,renderRest:_n,suffix:xt,itemKey:Ye,maxCount:ct});return S.createElement("span",{className:"".concat(vn,"-wrap")},yt,!pt.length&&!ai&&S.createElement("span",{className:"".concat(vn,"-placeholder")},tt))},dt=ot,Me=function(pe){var vt=pe.inputElement,qe=pe.prefixCls,pt=pe.id,Dt=pe.inputRef,Pt=pe.disabled,Tt=pe.autoFocus,Bt=pe.autoComplete,tt=pe.activeDescendantId,Ot=pe.mode,Ft=pe.open,Lt=pe.values,gt=pe.placeholder,ce=pe.tabIndex,Le=pe.showSearch,Fe=pe.searchValue,Ge=pe.activeValue,ct=pe.maxLength,ft=pe.onInputKeyDown,Et=pe.onInputMouseDown,Ut=pe.onInputChange,Gt=pe.onInputPaste,Yt=pe.onInputCompositionStart,kn=pe.onInputCompositionEnd,qt=pe.onInputBlur,Zt=pe.title,fn=S.useState(!1),gn=(0,F.Z)(fn,2),mn=gn[0],Xt=gn[1],Qt=Ot==="combobox",kt=Qt||Le,Nt=Lt[0],Vt=Fe||"";Qt&&Ge&&!mn&&(Vt=Ge),S.useEffect(function(){Qt&&Xt(!1)},[Qt,Ge]);var pn=Ot!=="combobox"&&!Ft&&!Le?!1:!!Vt,cn=Zt===void 0?Se(Nt):Zt,Ht=S.useMemo(function(){return Nt?null:S.createElement("span",{className:"".concat(qe,"-selection-placeholder"),style:pn?{visibility:"hidden"}:void 0},gt)},[Nt,pn,gt,qe]);return S.createElement("span",{className:"".concat(qe,"-selection-wrap")},S.createElement("span",{className:"".concat(qe,"-selection-search")},S.createElement(G,{ref:Dt,prefixCls:qe,id:pt,open:Ft,inputElement:vt,disabled:Pt,autoFocus:Tt,autoComplete:Bt,editable:kt,activeDescendantId:tt,value:Vt,onKeyDown:ft,onMouseDown:Et,onChange:function(Hn){Xt(!0),Ut(Hn)},onPaste:Gt,onCompositionStart:Yt,onCompositionEnd:kn,onBlur:qt,tabIndex:ce,attrs:(0,X.Z)(pe,!0),maxLength:Qt?ct:void 0})),!Qt&&Nt?S.createElement("span",{className:"".concat(qe,"-selection-item"),title:cn,style:pn?{visibility:"hidden"}:void 0},Nt.label):null,Ht)},ht=Me,Oe=function(pe,vt){var qe=(0,S.useRef)(null),pt=(0,S.useRef)(!1),Dt=pe.prefixCls,Pt=pe.open,Tt=pe.mode,Bt=pe.showSearch,tt=pe.tokenWithEnter,Ot=pe.disabled,Ft=pe.prefix,Lt=pe.autoClearSearchValue,gt=pe.onSearch,ce=pe.onSearchSubmit,Le=pe.onToggleOpen,Fe=pe.onInputKeyDown,Ge=pe.onInputBlur,ct=pe.domRef;S.useImperativeHandle(vt,function(){return{focus:function(cn){qe.current.focus(cn)},blur:function(){qe.current.blur()}}});var ft=z(0),Et=(0,F.Z)(ft,2),Ut=Et[0],Gt=Et[1],Yt=function(cn){var Ht=cn.which,Mn=qe.current instanceof HTMLTextAreaElement;!Mn&&Pt&&(Ht===re.Z.UP||Ht===re.Z.DOWN)&&cn.preventDefault(),Fe&&Fe(cn),Ht===re.Z.ENTER&&Tt==="tags"&&!pt.current&&!Pt&&(ce==null||ce(cn.target.value)),!(Mn&&!Pt&&~[re.Z.UP,re.Z.DOWN,re.Z.LEFT,re.Z.RIGHT].indexOf(Ht))&&J(Ht)&&Le(!0)},kn=function(){Gt(!0)},qt=(0,S.useRef)(null),Zt=function(cn){gt(cn,!0,pt.current)!==!1&&Le(!0)},fn=function(){pt.current=!0},gn=function(cn){pt.current=!1,Tt!=="combobox"&&Zt(cn.target.value)},mn=function(cn){var Ht=cn.target.value;if(tt&&qt.current&&/[\r\n]/.test(qt.current)){var Mn=qt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ht=Ht.replace(Mn,qt.current)}qt.current=null,Zt(Ht)},Xt=function(cn){var Ht=cn.clipboardData,Mn=Ht==null?void 0:Ht.getData("text");qt.current=Mn||""},Qt=function(cn){var Ht=cn.target;if(Ht!==qe.current){var Mn=document.body.style.msTouchAction!==void 0;Mn?setTimeout(function(){qe.current.focus()}):qe.current.focus()}},kt=function(cn){var Ht=Ut();cn.target!==qe.current&&!Ht&&!(Tt==="combobox"&&Ot)&&cn.preventDefault(),(Tt!=="combobox"&&(!Bt||!Ht)||!Pt)&&(Pt&&Lt!==!1&>("",!0,!1),Le())},Nt={inputRef:qe,onInputKeyDown:Yt,onInputMouseDown:kn,onInputChange:mn,onInputPaste:Xt,onInputCompositionStart:fn,onInputCompositionEnd:gn,onInputBlur:Ge},Vt=Tt==="multiple"||Tt==="tags"?S.createElement(dt,(0,A.Z)({},pe,Nt)):S.createElement(ht,(0,A.Z)({},pe,Nt));return S.createElement("div",{ref:ct,className:"".concat(Dt,"-selector"),onClick:Qt,onMouseDown:kt},Ft&&S.createElement("div",{className:"".concat(Dt,"-prefix")},Ft),Vt)},mt=S.forwardRef(Oe),ze=mt,ke=k(65030),se=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Q=function(pe){var vt=pe===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:vt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:vt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:vt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:vt,adjustY:1},htmlRegion:"scroll"}}},$=function(pe,vt){var qe=pe.prefixCls,pt=pe.disabled,Dt=pe.visible,Pt=pe.children,Tt=pe.popupElement,Bt=pe.animation,tt=pe.transitionName,Ot=pe.dropdownStyle,Ft=pe.dropdownClassName,Lt=pe.direction,gt=Lt===void 0?"ltr":Lt,ce=pe.placement,Le=pe.builtinPlacements,Fe=pe.dropdownMatchSelectWidth,Ge=pe.dropdownRender,ct=pe.dropdownAlign,ft=pe.getPopupContainer,Et=pe.empty,Ut=pe.getTriggerDOMNode,Gt=pe.onPopupVisibleChange,Yt=pe.onPopupMouseEnter,kn=(0,g.Z)(pe,se),qt="".concat(qe,"-dropdown"),Zt=Tt;Ge&&(Zt=Ge(Tt));var fn=S.useMemo(function(){return Le||Q(Fe)},[Le,Fe]),gn=Bt?"".concat(qt,"-").concat(Bt):tt,mn=typeof Fe=="number",Xt=S.useMemo(function(){return mn?null:Fe===!1?"minWidth":"width"},[Fe,mn]),Qt=Ot;mn&&(Qt=(0,ne.Z)((0,ne.Z)({},Qt),{},{width:Fe}));var kt=S.useRef(null);return S.useImperativeHandle(vt,function(){return{getPopupElement:function(){var Vt;return(Vt=kt.current)===null||Vt===void 0?void 0:Vt.popupElement}}}),S.createElement(ke.Z,(0,A.Z)({},kn,{showAction:Gt?["click"]:[],hideAction:Gt?["click"]:[],popupPlacement:ce||(gt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:fn,prefixCls:qt,popupTransitionName:gn,popup:S.createElement("div",{onMouseEnter:Yt},Zt),ref:kt,stretch:Xt,popupAlign:ct,popupVisible:Dt,getPopupContainer:ft,popupClassName:d()(Ft,(0,Ae.Z)({},"".concat(qt,"-empty"),Et)),popupStyle:Qt,getTriggerDOMNode:Ut,onPopupVisibleChange:Gt}),Pt)},de=S.forwardRef($),we=de,Ce=k(57879);function P(me,pe){var vt=me.key,qe;return"value"in me&&(qe=me.value),vt!=null?vt:qe!==void 0?qe:"rc-index-key-".concat(pe)}function te(me){return typeof me!="undefined"&&!Number.isNaN(me)}function ge(me,pe){var vt=me||{},qe=vt.label,pt=vt.value,Dt=vt.options,Pt=vt.groupLabel,Tt=qe||(pe?"children":"label");return{label:Tt,value:pt||"value",options:Dt||"options",groupLabel:Pt||Tt}}function Ee(me){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vt=pe.fieldNames,qe=pe.childrenAsData,pt=[],Dt=ge(vt,!1),Pt=Dt.label,Tt=Dt.value,Bt=Dt.options,tt=Dt.groupLabel;function Ot(Ft,Lt){Array.isArray(Ft)&&Ft.forEach(function(gt){if(Lt||!(Bt in gt)){var ce=gt[Tt];pt.push({key:P(gt,pt.length),groupOption:Lt,data:gt,label:gt[Pt],value:ce})}else{var Le=gt[tt];Le===void 0&&qe&&(Le=gt.label),pt.push({key:P(gt,pt.length),group:!0,data:gt,label:Le}),Ot(gt[Bt],!0)}})}return Ot(me,!1),pt}function Te(me){var pe=(0,ne.Z)({},me);return"props"in pe||Object.defineProperty(pe,"props",{get:function(){return(0,l.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),pe}}),pe}var Ue=function(pe,vt,qe){if(!vt||!vt.length)return null;var pt=!1,Dt=function Tt(Bt,tt){var Ot=(0,Ce.Z)(tt),Ft=Ot[0],Lt=Ot.slice(1);if(!Ft)return[Bt];var gt=Bt.split(Ft);return pt=pt||gt.length>1,gt.reduce(function(ce,Le){return[].concat((0,ue.Z)(ce),(0,ue.Z)(Tt(Le,Lt)))},[]).filter(Boolean)},Pt=Dt(pe,vt);return pt?typeof qe!="undefined"?Pt.slice(0,qe):Pt:null},et=S.createContext(null),Ne=et;function De(me){var pe=me.visible,vt=me.values;if(!pe)return null;var qe=50;return S.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(vt.slice(0,qe).map(function(pt){var Dt=pt.label,Pt=pt.value;return["number","string"].includes((0,oe.Z)(Dt))?Dt:Pt}).join(", ")),vt.length>qe?", ...":null)}var Ke=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],_t=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],nt=function(pe){return pe==="tags"||pe==="multiple"},lt=S.forwardRef(function(me,pe){var vt,qe=me.id,pt=me.prefixCls,Dt=me.className,Pt=me.showSearch,Tt=me.tagRender,Bt=me.direction,tt=me.omitDomProps,Ot=me.displayValues,Ft=me.onDisplayValuesChange,Lt=me.emptyOptions,gt=me.notFoundContent,ce=gt===void 0?"Not Found":gt,Le=me.onClear,Fe=me.mode,Ge=me.disabled,ct=me.loading,ft=me.getInputElement,Et=me.getRawInputElement,Ut=me.open,Gt=me.defaultOpen,Yt=me.onDropdownVisibleChange,kn=me.activeValue,qt=me.onActiveValueChange,Zt=me.activeDescendantId,fn=me.searchValue,gn=me.autoClearSearchValue,mn=me.onSearch,Xt=me.onSearchSplit,Qt=me.tokenSeparators,kt=me.allowClear,Nt=me.prefix,Vt=me.suffixIcon,pn=me.clearIcon,cn=me.OptionList,Ht=me.animation,Mn=me.transitionName,Hn=me.dropdownStyle,qn=me.dropdownClassName,vn=me.dropdownMatchSelectWidth,ai=me.dropdownRender,Qn=me.dropdownAlign,ti=me.placement,li=me.builtinPlacements,Gn=me.getPopupContainer,_n=me.showAction,xt=_n===void 0?[]:_n,yt=me.onFocus,Wt=me.onBlur,jt=me.onKeyUp,yn=me.onKeyDown,Un=me.onMouseDown,Wn=(0,g.Z)(me,Ke),Bn=nt(Fe),ri=(Pt!==void 0?Pt:Bn)||Fe==="combobox",bi=(0,ne.Z)({},Wn);_t.forEach(function(ei){delete bi[ei]}),tt==null||tt.forEach(function(ei){delete bi[ei]});var _i=S.useState(!1),ci=(0,F.Z)(_i,2),Yn=ci[0],wi=ci[1];S.useEffect(function(){wi((0,y.Z)())},[]);var Ti=S.useRef(null),Di=S.useRef(null),rn=S.useRef(null),gi=S.useRef(null),hi=S.useRef(null),Ii=S.useRef(!1),Fi=O(),Ni=(0,F.Z)(Fi,3),ki=Ni[0],Ri=Ni[1],oi=Ni[2];S.useImperativeHandle(pe,function(){var ei,Xn;return{focus:(ei=gi.current)===null||ei===void 0?void 0:ei.focus,blur:(Xn=gi.current)===null||Xn===void 0?void 0:Xn.blur,scrollTo:function(Gi){var Ci;return(Ci=hi.current)===null||Ci===void 0?void 0:Ci.scrollTo(Gi)},nativeElement:Ti.current||Di.current}});var Oi=S.useMemo(function(){var ei;if(Fe!=="combobox")return fn;var Xn=(ei=Ot[0])===null||ei===void 0?void 0:ei.value;return typeof Xn=="string"||typeof Xn=="number"?String(Xn):""},[fn,Fe,Ot]),Xi=Fe==="combobox"&&typeof ft=="function"&&ft()||null,Ei=typeof Et=="function"&&Et(),ir=(0,x.x1)(Di,Ei==null||(vt=Ei.props)===null||vt===void 0?void 0:vt.ref),rr=S.useState(!1),Qi=(0,F.Z)(rr,2),Ui=Qi[0],Vi=Qi[1];(0,m.Z)(function(){Vi(!0)},[]);var $i=(0,q.Z)(!1,{defaultValue:Gt,value:Ut}),xi=(0,F.Z)($i,2),Mi=xi[0],Hi=xi[1],Jn=Ui?Mi:!1,di=!ce&≪(Ge||di&&Jn&&Fe==="combobox")&&(Jn=!1);var jn=di?!1:Jn,tn=S.useCallback(function(ei){var Xn=ei!==void 0?ei:!Jn;Ge||(Hi(Xn),Jn!==Xn&&(Yt==null||Yt(Xn)))},[Ge,Jn,Hi,Yt]),Pn=S.useMemo(function(){return(Qt||[]).some(function(ei){return[`
|
|
`,`\r
|
|
`].includes(ei)})},[Qt]),Rn=S.useContext(Ne)||{},Ln=Rn.maxCount,ni=Rn.rawValues,fi=function(Xn,Ki,Gi){if(!(Bn&&te(Ln)&&(ni==null?void 0:ni.size)>=Ln)){var Ci=!0,Li=Xn;qt==null||qt(null);var or=Ue(Xn,Qt,te(Ln)?Ln-ni.size:void 0),Zi=Gi?null:or;return Fe!=="combobox"&&Zi&&(Li="",Xt==null||Xt(Zi),tn(!1),Ci=!1),mn&&Oi!==Li&&mn(Li,{source:Ki?"typing":"effect"}),Ci}},Wi=function(Xn){!Xn||!Xn.trim()||mn(Xn,{source:"submit"})};S.useEffect(function(){!Jn&&!Bn&&Fe!=="combobox"&&fi("",!1,!1)},[Jn]),S.useEffect(function(){Mi&&Ge&&Hi(!1),Ge&&!Ii.current&&Ri(!1)},[Ge]);var sn=z(),An=(0,F.Z)(sn,2),Kn=An[0],ui=An[1],pi=S.useRef(!1),sr=function(Xn){var Ki=Kn(),Gi=Xn.key,Ci=Gi==="Enter";if(Ci&&(Fe!=="combobox"&&Xn.preventDefault(),Jn||tn(!0)),ui(!!Oi),Gi==="Backspace"&&!Ki&&Bn&&!Oi&&Ot.length){for(var Li=(0,ue.Z)(Ot),or=null,Zi=Li.length-1;Zi>=0;Zi-=1){var Er=Li[Zi];if(!Er.disabled){Li.splice(Zi,1),or=Er;break}}or&&Ft(Li,{type:"remove",values:[or]})}for(var dr=arguments.length,pr=new Array(dr>1?dr-1:0),Kr=1;Kr<dr;Kr++)pr[Kr-1]=arguments[Kr];if(Jn&&(!Ci||!pi.current)){var Mr;Ci&&(pi.current=!0),(Mr=hi.current)===null||Mr===void 0||Mr.onKeyDown.apply(Mr,[Xn].concat(pr))}yn==null||yn.apply(void 0,[Xn].concat(pr))},zi=function(Xn){for(var Ki=arguments.length,Gi=new Array(Ki>1?Ki-1:0),Ci=1;Ci<Ki;Ci++)Gi[Ci-1]=arguments[Ci];if(Jn){var Li;(Li=hi.current)===null||Li===void 0||Li.onKeyUp.apply(Li,[Xn].concat(Gi))}Xn.key==="Enter"&&(pi.current=!1),jt==null||jt.apply(void 0,[Xn].concat(Gi))},fr=function(Xn){var Ki=Ot.filter(function(Gi){return Gi!==Xn});Ft(Ki,{type:"remove",values:[Xn]})},Bi=function(){pi.current=!1},Ur=S.useRef(!1),ar=function(){Ri(!0),Ge||(yt&&!Ur.current&&yt.apply(void 0,arguments),xt.includes("focus")&&tn(!0)),Ur.current=!0},ns=function(){Ii.current=!0,Ri(!1,function(){Ur.current=!1,Ii.current=!1,tn(!1)}),!Ge&&(Oi&&(Fe==="tags"?mn(Oi,{source:"submit"}):Fe==="multiple"&&mn("",{source:"blur"})),Wt&&Wt.apply(void 0,arguments))},Tr=[];S.useEffect(function(){return function(){Tr.forEach(function(ei){return clearTimeout(ei)}),Tr.splice(0,Tr.length)}},[]);var Hr=function(Xn){var Ki,Gi=Xn.target,Ci=(Ki=rn.current)===null||Ki===void 0?void 0:Ki.getPopupElement();if(Ci&&Ci.contains(Gi)){var Li=setTimeout(function(){var dr=Tr.indexOf(Li);if(dr!==-1&&Tr.splice(dr,1),oi(),!Yn&&!Ci.contains(document.activeElement)){var pr;(pr=gi.current)===null||pr===void 0||pr.focus()}});Tr.push(Li)}for(var or=arguments.length,Zi=new Array(or>1?or-1:0),Er=1;Er<or;Er++)Zi[Er-1]=arguments[Er];Un==null||Un.apply(void 0,[Xn].concat(Zi))},kr=S.useState({}),is=(0,F.Z)(kr,2),$r=is[1];function br(){$r({})}var Pr;Ei&&(Pr=function(Xn){tn(Xn)}),ee(function(){var ei;return[Ti.current,(ei=rn.current)===null||ei===void 0?void 0:ei.getPopupElement()]},jn,tn,!!Ei);var Wr=S.useMemo(function(){return(0,ne.Z)((0,ne.Z)({},me),{},{notFoundContent:ce,open:Jn,triggerOpen:jn,id:qe,showSearch:ri,multiple:Bn,toggleOpen:tn})},[me,ce,jn,Jn,qe,ri,Bn,tn]),Yr=!!Vt||ct,tr;Yr&&(tr=S.createElement(N,{className:d()("".concat(pt,"-arrow"),(0,Ae.Z)({},"".concat(pt,"-arrow-loading"),ct)),customizeIcon:Vt,customizeIconProps:{loading:ct,searchValue:Oi,open:Jn,focused:ki,showSearch:ri}}));var rs=function(){var Xn;Le==null||Le(),(Xn=gi.current)===null||Xn===void 0||Xn.focus(),Ft([],{type:"clear",values:Ot}),fi("",!1,!1)},Or=V(pt,rs,Ot,kt,pn,Ge,Oi,Fe),ss=Or.allowClear,ms=Or.clearIcon,_s=S.createElement(cn,{ref:hi}),vs=d()(pt,Dt,(0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)({},"".concat(pt,"-focused"),ki),"".concat(pt,"-multiple"),Bn),"".concat(pt,"-single"),!Bn),"".concat(pt,"-allow-clear"),kt),"".concat(pt,"-show-arrow"),Yr),"".concat(pt,"-disabled"),Ge),"".concat(pt,"-loading"),ct),"".concat(pt,"-open"),Jn),"".concat(pt,"-customize-input"),Xi),"".concat(pt,"-show-search"),ri)),Xr=S.createElement(we,{ref:rn,disabled:Ge,prefixCls:pt,visible:jn,popupElement:_s,animation:Ht,transitionName:Mn,dropdownStyle:Hn,dropdownClassName:qn,direction:Bt,dropdownMatchSelectWidth:vn,dropdownRender:ai,dropdownAlign:Qn,placement:ti,builtinPlacements:li,getPopupContainer:Gn,empty:Lt,getTriggerDOMNode:function(Xn){return Di.current||Xn},onPopupVisibleChange:Pr,onPopupMouseEnter:br},Ei?S.cloneElement(Ei,{ref:ir}):S.createElement(ze,(0,A.Z)({},me,{domRef:Di,prefixCls:pt,inputElement:Xi,ref:gi,id:qe,prefix:Nt,showSearch:ri,autoClearSearchValue:gn,mode:Fe,activeDescendantId:Zt,tagRender:Tt,values:Ot,open:Jn,onToggleOpen:tn,activeValue:kn,searchValue:Oi,onSearch:fi,onSearchSubmit:Wi,onRemove:fr,tokenWithEnter:Pn,onInputBlur:Bi}))),hr;return Ei?hr=Xr:hr=S.createElement("div",(0,A.Z)({className:vs},bi,{ref:Ti,onMouseDown:Hr,onKeyDown:sr,onKeyUp:zi,onFocus:ar,onBlur:ns}),S.createElement(De,{visible:ki&&!Jn,values:Ot}),Xr,tr,ss&&ms),S.createElement(I.Provider,{value:Wr},hr)}),ye=lt,wt=function(){return null};wt.isSelectOptGroup=!0;var Qe=wt,We=function(){return null};We.isSelectOption=!0;var Mt=We,$t=k(80547),rt=k(2738),Jt=k(6790);function Tn(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var It=["disabled","title","children","style","className"];function en(me){return typeof me=="string"||typeof me=="number"}var Ie=function(pe,vt){var qe=L(),pt=qe.prefixCls,Dt=qe.id,Pt=qe.open,Tt=qe.multiple,Bt=qe.mode,tt=qe.searchValue,Ot=qe.toggleOpen,Ft=qe.notFoundContent,Lt=qe.onPopupScroll,gt=S.useContext(Ne),ce=gt.maxCount,Le=gt.flattenOptions,Fe=gt.onActiveValue,Ge=gt.defaultActiveFirstOption,ct=gt.onSelect,ft=gt.menuItemSelectedIcon,Et=gt.rawValues,Ut=gt.fieldNames,Gt=gt.virtual,Yt=gt.direction,kn=gt.listHeight,qt=gt.listItemHeight,Zt=gt.optionRender,fn="".concat(pt,"-item"),gn=(0,$t.Z)(function(){return Le},[Pt,Le],function(_n,xt){return xt[0]&&_n[1]!==xt[1]}),mn=S.useRef(null),Xt=S.useMemo(function(){return Tt&&te(ce)&&(Et==null?void 0:Et.size)>=ce},[Tt,ce,Et==null?void 0:Et.size]),Qt=function(xt){xt.preventDefault()},kt=function(xt){var yt;(yt=mn.current)===null||yt===void 0||yt.scrollTo(typeof xt=="number"?{index:xt}:xt)},Nt=S.useCallback(function(_n){return Bt==="combobox"?!1:Et.has(_n)},[Bt,(0,ue.Z)(Et).toString(),Et.size]),Vt=function(xt){for(var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Wt=gn.length,jt=0;jt<Wt;jt+=1){var yn=(xt+jt*yt+Wt)%Wt,Un=gn[yn]||{},Wn=Un.group,Bn=Un.data;if(!Wn&&!(Bn!=null&&Bn.disabled)&&(Nt(Bn.value)||!Xt))return yn}return-1},pn=S.useState(function(){return Vt(0)}),cn=(0,F.Z)(pn,2),Ht=cn[0],Mn=cn[1],Hn=function(xt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Mn(xt);var Wt={source:yt?"keyboard":"mouse"},jt=gn[xt];if(!jt){Fe(null,-1,Wt);return}Fe(jt.value,xt,Wt)};(0,S.useEffect)(function(){Hn(Ge!==!1?Vt(0):-1)},[gn.length,tt]);var qn=S.useCallback(function(_n){return Bt==="combobox"?String(_n).toLowerCase()===tt.toLowerCase():Et.has(_n)},[Bt,tt,(0,ue.Z)(Et).toString(),Et.size]);(0,S.useEffect)(function(){var _n=setTimeout(function(){if(!Tt&&Pt&&Et.size===1){var yt=Array.from(Et)[0],Wt=gn.findIndex(function(jt){var yn=jt.data;return tt?String(yn.value).startsWith(tt):yn.value===yt});Wt!==-1&&(Hn(Wt),kt(Wt))}});if(Pt){var xt;(xt=mn.current)===null||xt===void 0||xt.scrollTo(void 0)}return function(){return clearTimeout(_n)}},[Pt,tt]);var vn=function(xt){xt!==void 0&&ct(xt,{selected:!Et.has(xt)}),Tt||Ot(!1)};if(S.useImperativeHandle(vt,function(){return{onKeyDown:function(xt){var yt=xt.which,Wt=xt.ctrlKey;switch(yt){case re.Z.N:case re.Z.P:case re.Z.UP:case re.Z.DOWN:{var jt=0;if(yt===re.Z.UP?jt=-1:yt===re.Z.DOWN?jt=1:Tn()&&Wt&&(yt===re.Z.N?jt=1:yt===re.Z.P&&(jt=-1)),jt!==0){var yn=Vt(Ht+jt,jt);kt(yn),Hn(yn,!0)}break}case re.Z.TAB:case re.Z.ENTER:{var Un,Wn=gn[Ht];Wn&&!(Wn!=null&&(Un=Wn.data)!==null&&Un!==void 0&&Un.disabled)&&!Xt?vn(Wn.value):vn(void 0),Pt&&xt.preventDefault();break}case re.Z.ESC:Ot(!1),Pt&&xt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(xt){kt(xt)}}}),gn.length===0)return S.createElement("div",{role:"listbox",id:"".concat(Dt,"_list"),className:"".concat(fn,"-empty"),onMouseDown:Qt},Ft);var ai=Object.keys(Ut).map(function(_n){return Ut[_n]}),Qn=function(xt){return xt.label};function ti(_n,xt){var yt=_n.group;return{role:yt?"presentation":"option",id:"".concat(Dt,"_list_").concat(xt)}}var li=function(xt){var yt=gn[xt];if(!yt)return null;var Wt=yt.data||{},jt=Wt.value,yn=yt.group,Un=(0,X.Z)(Wt,!0),Wn=Qn(yt);return yt?S.createElement("div",(0,A.Z)({"aria-label":typeof Wn=="string"&&!yn?Wn:null},Un,{key:xt},ti(yt,xt),{"aria-selected":qn(jt)}),jt):null},Gn={role:"listbox",id:"".concat(Dt,"_list")};return S.createElement(S.Fragment,null,Gt&&S.createElement("div",(0,A.Z)({},Gn,{style:{height:0,width:0,overflow:"hidden"}}),li(Ht-1),li(Ht),li(Ht+1)),S.createElement(Jt.Z,{itemKey:"key",ref:mn,data:gn,height:kn,itemHeight:qt,fullHeight:!1,onMouseDown:Qt,onScroll:Lt,virtual:Gt,direction:Yt,innerProps:Gt?null:Gn},function(_n,xt){var yt=_n.group,Wt=_n.groupOption,jt=_n.data,yn=_n.label,Un=_n.value,Wn=jt.key;if(yt){var Bn,ri=(Bn=jt.title)!==null&&Bn!==void 0?Bn:en(yn)?yn.toString():void 0;return S.createElement("div",{className:d()(fn,"".concat(fn,"-group"),jt.className),title:ri},yn!==void 0?yn:Wn)}var bi=jt.disabled,_i=jt.title,ci=jt.children,Yn=jt.style,wi=jt.className,Ti=(0,g.Z)(jt,It),Di=(0,rt.Z)(Ti,ai),rn=Nt(Un),gi=bi||!rn&&Xt,hi="".concat(fn,"-option"),Ii=d()(fn,hi,wi,(0,Ae.Z)((0,Ae.Z)((0,Ae.Z)((0,Ae.Z)({},"".concat(hi,"-grouped"),Wt),"".concat(hi,"-active"),Ht===xt&&!gi),"".concat(hi,"-disabled"),gi),"".concat(hi,"-selected"),rn)),Fi=Qn(_n),Ni=!ft||typeof ft=="function"||rn,ki=typeof Fi=="number"?Fi:Fi||Un,Ri=en(ki)?ki.toString():void 0;return _i!==void 0&&(Ri=_i),S.createElement("div",(0,A.Z)({},(0,X.Z)(Di),Gt?{}:ti(_n,xt),{"aria-selected":qn(Un),className:Ii,title:Ri,onMouseMove:function(){Ht===xt||gi||Hn(xt)},onClick:function(){gi||vn(Un)},style:Yn}),S.createElement("div",{className:"".concat(hi,"-content")},typeof Zt=="function"?Zt(_n,{index:xt}):ki),S.isValidElement(ft)||rn,Ni&&S.createElement(N,{className:"".concat(fn,"-option-state"),customizeIcon:ft,customizeIconProps:{value:Un,disabled:gi,isSelected:rn}},rn?"\u2713":null))}))},ve=S.forwardRef(Ie),be=ve,M=function(me,pe){var vt=S.useRef({values:new Map,options:new Map}),qe=S.useMemo(function(){var Dt=vt.current,Pt=Dt.values,Tt=Dt.options,Bt=me.map(function(Ft){if(Ft.label===void 0){var Lt;return(0,ne.Z)((0,ne.Z)({},Ft),{},{label:(Lt=Pt.get(Ft.value))===null||Lt===void 0?void 0:Lt.label})}return Ft}),tt=new Map,Ot=new Map;return Bt.forEach(function(Ft){tt.set(Ft.value,Ft),Ot.set(Ft.value,pe.get(Ft.value)||Tt.get(Ft.value))}),vt.current.values=tt,vt.current.options=Ot,Bt},[me,pe]),pt=S.useCallback(function(Dt){return pe.get(Dt)||vt.current.options.get(Dt)},[pe]);return[qe,pt]};function Z(me,pe){return W(me).join("").toUpperCase().includes(pe)}var ie=function(me,pe,vt,qe,pt){return S.useMemo(function(){if(!vt||qe===!1)return me;var Dt=pe.options,Pt=pe.label,Tt=pe.value,Bt=[],tt=typeof qe=="function",Ot=vt.toUpperCase(),Ft=tt?qe:function(gt,ce){return pt?Z(ce[pt],Ot):ce[Dt]?Z(ce[Pt!=="children"?Pt:"label"],Ot):Z(ce[Tt],Ot)},Lt=tt?function(gt){return Te(gt)}:function(gt){return gt};return me.forEach(function(gt){if(gt[Dt]){var ce=Ft(vt,Lt(gt));if(ce)Bt.push(gt);else{var Le=gt[Dt].filter(function(Fe){return Ft(vt,Lt(Fe))});Le.length&&Bt.push((0,ne.Z)((0,ne.Z)({},gt),{},(0,Ae.Z)({},Dt,Le)))}return}Ft(vt,Lt(gt))&&Bt.push(gt)}),Bt},[me,qe,pt,vt,pe])},le=k(6551),_e=k(11592),it=["children","value"],bt=["children"];function Ct(me){var pe=me,vt=pe.key,qe=pe.props,pt=qe.children,Dt=qe.value,Pt=(0,g.Z)(qe,it);return(0,ne.Z)({key:vt,value:Dt!==void 0?Dt:vt,children:pt},Pt)}function zt(me){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,_e.Z)(me).map(function(vt,qe){if(!S.isValidElement(vt)||!vt.type)return null;var pt=vt,Dt=pt.type.isSelectOptGroup,Pt=pt.key,Tt=pt.props,Bt=Tt.children,tt=(0,g.Z)(Tt,bt);return pe||!Dt?Ct(vt):(0,ne.Z)((0,ne.Z)({key:"__RC_SELECT_GRP__".concat(Pt===null?qe:Pt,"__"),label:Pt},tt),{},{options:zt(Bt)})}).filter(function(vt){return vt})}var En=function(pe,vt,qe,pt,Dt){return S.useMemo(function(){var Pt=pe,Tt=!pe;Tt&&(Pt=zt(vt));var Bt=new Map,tt=new Map,Ot=function(gt,ce,Le){Le&&typeof Le=="string"&>.set(ce[Le],ce)},Ft=function Lt(gt){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=0;Le<gt.length;Le+=1){var Fe=gt[Le];!Fe[qe.options]||ce?(Bt.set(Fe[qe.value],Fe),Ot(tt,Fe,qe.label),Ot(tt,Fe,pt),Ot(tt,Fe,Dt)):Lt(Fe[qe.options],!0)}};return Ft(Pt),{options:Pt,valueOptions:Bt,labelOptions:tt}},[pe,vt,qe,pt,Dt])},Dn=En;function dn(me){var pe=S.useRef();pe.current=me;var vt=S.useCallback(function(){return pe.current.apply(pe,arguments)},[]);return vt}function un(me){var pe=me.mode,vt=me.options,qe=me.children,pt=me.backfill,Dt=me.allowClear,Pt=me.placeholder,Tt=me.getInputElement,Bt=me.showSearch,tt=me.onSearch,Ot=me.defaultOpen,Ft=me.autoFocus,Lt=me.labelInValue,gt=me.value,ce=me.inputValue,Le=me.optionLabelProp,Fe=isMultiple(pe),Ge=Bt!==void 0?Bt:Fe||pe==="combobox",ct=vt||convertChildrenToData(qe);if(warning(pe!=="tags"||ct.every(function(Gt){return!Gt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),pe==="tags"||pe==="combobox"){var ft=ct.some(function(Gt){return Gt.options?Gt.options.some(function(Yt){return typeof("value"in Yt?Yt.value:Yt.key)=="number"}):typeof("value"in Gt?Gt.value:Gt.key)=="number"});warning(!ft,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(pe!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(pe==="combobox"||!pt,"`backfill` only works with `combobox` mode."),warning(pe==="combobox"||!Tt,"`getInputElement` only work with `combobox` mode."),noteOnce(pe!=="combobox"||!Tt||!Dt||!Pt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),tt&&!Ge&&pe!=="combobox"&&pe!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ot||Ft,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),gt!=null){var Et=toArray(gt);warning(!Lt||Et.every(function(Gt){return _typeof(Gt)==="object"&&("key"in Gt||"value"in Gt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Fe||Array.isArray(gt),"`value` should be array when `mode` is `multiple` or `tags`")}if(qe){var Ut=null;toNodeArray(qe).some(function(Gt){if(!React.isValidElement(Gt)||!Gt.type)return!1;var Yt=Gt,kn=Yt.type;if(kn.isSelectOption)return!1;if(kn.isSelectOptGroup){var qt=toNodeArray(Gt.props.children).every(function(Zt){return!React.isValidElement(Zt)||!Gt.type||Zt.type.isSelectOption?!0:(Ut=Zt.type,!1)});return!qt}return Ut=kn,!0}),Ut&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ut.displayName||Ut.name||Ut,"`.")),warning(ce===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Fn(me,pe){if(me){var vt=function qe(pt){for(var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pt=0;Pt<pt.length;Pt++){var Tt=pt[Pt];if(Tt[pe==null?void 0:pe.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Dt&&Array.isArray(Tt[pe==null?void 0:pe.options])&&qe(Tt[pe==null?void 0:pe.options],!0))break}};vt(me)}}var Vn=null,Nn=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],zn=["inputValue"];function Rt(me){return!me||(0,oe.Z)(me)!=="object"}var at=S.forwardRef(function(me,pe){var vt=me.id,qe=me.mode,pt=me.prefixCls,Dt=pt===void 0?"rc-select":pt,Pt=me.backfill,Tt=me.fieldNames,Bt=me.inputValue,tt=me.searchValue,Ot=me.onSearch,Ft=me.autoClearSearchValue,Lt=Ft===void 0?!0:Ft,gt=me.onSelect,ce=me.onDeselect,Le=me.dropdownMatchSelectWidth,Fe=Le===void 0?!0:Le,Ge=me.filterOption,ct=me.filterSort,ft=me.optionFilterProp,Et=me.optionLabelProp,Ut=me.options,Gt=me.optionRender,Yt=me.children,kn=me.defaultActiveFirstOption,qt=me.menuItemSelectedIcon,Zt=me.virtual,fn=me.direction,gn=me.listHeight,mn=gn===void 0?200:gn,Xt=me.listItemHeight,Qt=Xt===void 0?20:Xt,kt=me.labelRender,Nt=me.value,Vt=me.defaultValue,pn=me.labelInValue,cn=me.onChange,Ht=me.maxCount,Mn=(0,g.Z)(me,Nn),Hn=(0,le.ZP)(vt),qn=nt(qe),vn=!!(!Ut&&Yt),ai=S.useMemo(function(){return Ge===void 0&&qe==="combobox"?!1:Ge},[Ge,qe]),Qn=S.useMemo(function(){return ge(Tt,vn)},[JSON.stringify(Tt),vn]),ti=(0,q.Z)("",{value:tt!==void 0?tt:Bt,postState:function(Pn){return Pn||""}}),li=(0,F.Z)(ti,2),Gn=li[0],_n=li[1],xt=Dn(Ut,Yt,Qn,ft,Et),yt=xt.valueOptions,Wt=xt.labelOptions,jt=xt.options,yn=S.useCallback(function(tn){var Pn=W(tn);return Pn.map(function(Rn){var Ln,ni,fi,Wi,sn;if(Rt(Rn))Ln=Rn;else{var An;fi=Rn.key,ni=Rn.label,Ln=(An=Rn.value)!==null&&An!==void 0?An:fi}var Kn=yt.get(Ln);if(Kn){var ui;if(ni===void 0&&(ni=Kn==null?void 0:Kn[Et||Qn.label]),fi===void 0&&(fi=(ui=Kn==null?void 0:Kn.key)!==null&&ui!==void 0?ui:Ln),Wi=Kn==null?void 0:Kn.disabled,sn=Kn==null?void 0:Kn.title,0)var pi}return{label:ni,value:Ln,key:fi,disabled:Wi,title:sn}})},[Qn,Et,yt]),Un=(0,q.Z)(Vt,{value:Nt}),Wn=(0,F.Z)(Un,2),Bn=Wn[0],ri=Wn[1],bi=S.useMemo(function(){var tn,Pn=qn&&Bn===null?[]:Bn,Rn=yn(Pn);return qe==="combobox"&&C((tn=Rn[0])===null||tn===void 0?void 0:tn.value)?[]:Rn},[Bn,yn,qe,qn]),_i=M(bi,yt),ci=(0,F.Z)(_i,2),Yn=ci[0],wi=ci[1],Ti=S.useMemo(function(){if(!qe&&Yn.length===1){var tn=Yn[0];if(tn.value===null&&(tn.label===null||tn.label===void 0))return[]}return Yn.map(function(Pn){var Rn;return(0,ne.Z)((0,ne.Z)({},Pn),{},{label:(Rn=typeof kt=="function"?kt(Pn):Pn.label)!==null&&Rn!==void 0?Rn:Pn.value})})},[qe,Yn,kt]),Di=S.useMemo(function(){return new Set(Yn.map(function(tn){return tn.value}))},[Yn]);S.useEffect(function(){if(qe==="combobox"){var tn,Pn=(tn=Yn[0])===null||tn===void 0?void 0:tn.value;_n(v(Pn)?String(Pn):"")}},[Yn]);var rn=dn(function(tn,Pn){var Rn=Pn!=null?Pn:tn;return(0,Ae.Z)((0,Ae.Z)({},Qn.value,tn),Qn.label,Rn)}),gi=S.useMemo(function(){if(qe!=="tags")return jt;var tn=(0,ue.Z)(jt),Pn=function(Ln){return yt.has(Ln)};return(0,ue.Z)(Yn).sort(function(Rn,Ln){return Rn.value<Ln.value?-1:1}).forEach(function(Rn){var Ln=Rn.value;Pn(Ln)||tn.push(rn(Ln,Rn.label))}),tn},[rn,jt,yt,Yn,qe]),hi=ie(gi,Qn,Gn,ai,ft),Ii=S.useMemo(function(){return qe!=="tags"||!Gn||hi.some(function(tn){return tn[ft||"value"]===Gn})||hi.some(function(tn){return tn[Qn.value]===Gn})?hi:[rn(Gn)].concat((0,ue.Z)(hi))},[rn,ft,qe,hi,Gn,Qn]),Fi=function tn(Pn){var Rn=(0,ue.Z)(Pn).sort(function(Ln,ni){return ct(Ln,ni,{searchValue:Gn})});return Rn.map(function(Ln){return Array.isArray(Ln.options)?(0,ne.Z)((0,ne.Z)({},Ln),{},{options:Ln.options.length>0?tn(Ln.options):Ln.options}):Ln})},Ni=S.useMemo(function(){return ct?Fi(Ii):Ii},[Ii,ct,Gn]),ki=S.useMemo(function(){return Ee(Ni,{fieldNames:Qn,childrenAsData:vn})},[Ni,Qn,vn]),Ri=function(Pn){var Rn=yn(Pn);if(ri(Rn),cn&&(Rn.length!==Yn.length||Rn.some(function(fi,Wi){var sn;return((sn=Yn[Wi])===null||sn===void 0?void 0:sn.value)!==(fi==null?void 0:fi.value)}))){var Ln=pn?Rn:Rn.map(function(fi){return fi.value}),ni=Rn.map(function(fi){return Te(wi(fi.value))});cn(qn?Ln:Ln[0],qn?ni:ni[0])}},oi=S.useState(null),Oi=(0,F.Z)(oi,2),Xi=Oi[0],Ei=Oi[1],ir=S.useState(0),rr=(0,F.Z)(ir,2),Qi=rr[0],Ui=rr[1],Vi=kn!==void 0?kn:qe!=="combobox",$i=S.useCallback(function(tn,Pn){var Rn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ln=Rn.source,ni=Ln===void 0?"keyboard":Ln;Ui(Pn),Pt&&qe==="combobox"&&tn!==null&&ni==="keyboard"&&Ei(String(tn))},[Pt,qe]),xi=function(Pn,Rn,Ln){var ni=function(){var fr,Bi=wi(Pn);return[pn?{label:Bi==null?void 0:Bi[Qn.label],value:Pn,key:(fr=Bi==null?void 0:Bi.key)!==null&&fr!==void 0?fr:Pn}:Pn,Te(Bi)]};if(Rn&>){var fi=ni(),Wi=(0,F.Z)(fi,2),sn=Wi[0],An=Wi[1];gt(sn,An)}else if(!Rn&&ce&&Ln!=="clear"){var Kn=ni(),ui=(0,F.Z)(Kn,2),pi=ui[0],sr=ui[1];ce(pi,sr)}},Mi=dn(function(tn,Pn){var Rn,Ln=qn?Pn.selected:!0;Ln?Rn=qn?[].concat((0,ue.Z)(Yn),[tn]):[tn]:Rn=Yn.filter(function(ni){return ni.value!==tn}),Ri(Rn),xi(tn,Ln),qe==="combobox"?Ei(""):(!nt||Lt)&&(_n(""),Ei(""))}),Hi=function(Pn,Rn){Ri(Pn);var Ln=Rn.type,ni=Rn.values;(Ln==="remove"||Ln==="clear")&&ni.forEach(function(fi){xi(fi.value,!1,Ln)})},Jn=function(Pn,Rn){if(_n(Pn),Ei(null),Rn.source==="submit"){var Ln=(Pn||"").trim();if(Ln){var ni=Array.from(new Set([].concat((0,ue.Z)(Di),[Ln])));Ri(ni),xi(Ln,!0),_n("")}return}Rn.source!=="blur"&&(qe==="combobox"&&Ri(Pn),Ot==null||Ot(Pn))},di=function(Pn){var Rn=Pn;qe!=="tags"&&(Rn=Pn.map(function(ni){var fi=Wt.get(ni);return fi==null?void 0:fi.value}).filter(function(ni){return ni!==void 0}));var Ln=Array.from(new Set([].concat((0,ue.Z)(Di),(0,ue.Z)(Rn))));Ri(Ln),Ln.forEach(function(ni){xi(ni,!0)})},jn=S.useMemo(function(){var tn=Zt!==!1&&Fe!==!1;return(0,ne.Z)((0,ne.Z)({},xt),{},{flattenOptions:ki,onActiveValue:$i,defaultActiveFirstOption:Vi,onSelect:Mi,menuItemSelectedIcon:qt,rawValues:Di,fieldNames:Qn,virtual:tn,direction:fn,listHeight:mn,listItemHeight:Qt,childrenAsData:vn,maxCount:Ht,optionRender:Gt})},[Ht,xt,ki,$i,Vi,Mi,qt,Di,Qn,Zt,Fe,fn,mn,Qt,vn,Gt]);return S.createElement(Ne.Provider,{value:jn},S.createElement(ye,(0,A.Z)({},Mn,{id:Hn,prefixCls:Dt,ref:pe,omitDomProps:zn,mode:qe,displayValues:Ti,onDisplayValuesChange:Hi,direction:fn,searchValue:Gn,onSearch:Jn,autoClearSearchValue:Lt,onSearchSplit:di,dropdownMatchSelectWidth:Fe,OptionList:be,emptyOptions:!ki.length,activeValue:Xi,activeDescendantId:"".concat(Hn,"_list_").concat(Qi)})))}),Kt=at;Kt.Option=Mt,Kt.OptGroup=Qe;var xn=Kt,$n=xn},22711:function(bn,St,k){"use strict";k.r(St),k.d(St,{ResizableTextArea:function(){return Ze},default:function(){return G}});var A=k(67711),ue=k(52873),Ae=k(98506),ne=k(15142),F=k(16886),g=k(33346),oe=k(92310),q=k.n(oe),l=k(36901),S=k(66003),T=k(30292),d=k(18929),m=k(59301),y=k(26420),x=k(29301),U=k(34280),N=k(16089),V=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,I=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],L={},O;function z(W){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=W.getAttribute("id")||W.getAttribute("data-reactid")||W.getAttribute("name");if(H&&L[_])return L[_];var v=window.getComputedStyle(W),C=v.getPropertyValue("box-sizing")||v.getPropertyValue("-moz-box-sizing")||v.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(v.getPropertyValue("padding-bottom"))+parseFloat(v.getPropertyValue("padding-top")),Se=parseFloat(v.getPropertyValue("border-bottom-width"))+parseFloat(v.getPropertyValue("border-top-width")),Re=I.map(function(He){return"".concat(He,":").concat(v.getPropertyValue(He))}).join(";"),Ye={sizingStyle:Re,paddingSize:Y,borderSize:Se,boxSizing:C};return H&&_&&(L[_]=Ye),Ye}function ee(W){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;O||(O=document.createElement("textarea"),O.setAttribute("tab-index","-1"),O.setAttribute("aria-hidden","true"),O.setAttribute("name","hiddenTextarea"),document.body.appendChild(O)),W.getAttribute("wrap")?O.setAttribute("wrap",W.getAttribute("wrap")):O.removeAttribute("wrap");var C=z(W,H),Y=C.paddingSize,Se=C.borderSize,Re=C.boxSizing,Ye=C.sizingStyle;O.setAttribute("style","".concat(Ye,";").concat(V)),O.value=W.value||W.placeholder||"";var He=void 0,ot=void 0,dt,Me=O.scrollHeight;if(Re==="border-box"?Me+=Se:Re==="content-box"&&(Me-=Y),_!==null||v!==null){O.value=" ";var ht=O.scrollHeight-Y;_!==null&&(He=ht*_,Re==="border-box"&&(He=He+Y+Se),Me=Math.max(He,Me)),v!==null&&(ot=ht*v,Re==="border-box"&&(ot=ot+Y+Se),dt=Me>ot?"":"hidden",Me=Math.min(ot,Me))}var Oe={height:Me,overflowY:dt,resize:"none"};return He&&(Oe.minHeight=He),ot&&(Oe.maxHeight=ot),Oe}var re=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],J=0,X=1,xe=2,he=m.forwardRef(function(W,H){var _=W,v=_.prefixCls,C=_.defaultValue,Y=_.value,Se=_.autoSize,Re=_.onResize,Ye=_.className,He=_.style,ot=_.disabled,dt=_.onChange,Me=_.onInternalAutoSize,ht=(0,g.Z)(_,re),Oe=(0,d.Z)(C,{value:Y,postState:function(Mt){return Mt!=null?Mt:""}}),mt=(0,F.Z)(Oe,2),ze=mt[0],ke=mt[1],se=function(Mt){ke(Mt.target.value),dt==null||dt(Mt)},Q=m.useRef();m.useImperativeHandle(H,function(){return{textArea:Q.current}});var $=m.useMemo(function(){return Se&&(0,y.Z)(Se)==="object"?[Se.minRows,Se.maxRows]:[]},[Se]),de=(0,F.Z)($,2),we=de[0],Ce=de[1],P=!!Se,te=function(){try{if(document.activeElement===Q.current){var Mt=Q.current,$t=Mt.selectionStart,rt=Mt.selectionEnd,Jt=Mt.scrollTop;Q.current.setSelectionRange($t,rt),Q.current.scrollTop=Jt}}catch(Tn){}},ge=m.useState(xe),Ee=(0,F.Z)(ge,2),Te=Ee[0],Ue=Ee[1],et=m.useState(),Ne=(0,F.Z)(et,2),De=Ne[0],Ke=Ne[1],_t=function(){Ue(J)};(0,U.Z)(function(){P&&_t()},[Y,we,Ce,P]),(0,U.Z)(function(){if(Te===J)Ue(X);else if(Te===X){var We=ee(Q.current,!1,we,Ce);Ue(xe),Ke(We)}else te()},[Te]);var nt=m.useRef(),lt=function(){N.Z.cancel(nt.current)},ye=function(Mt){Te===xe&&(Re==null||Re(Mt),Se&&(lt(),nt.current=(0,N.Z)(function(){_t()})))};m.useEffect(function(){return lt},[]);var wt=P?De:null,Qe=(0,Ae.Z)((0,Ae.Z)({},He),wt);return(Te===J||Te===X)&&(Qe.overflowY="hidden",Qe.overflowX="hidden"),m.createElement(x.Z,{onResize:ye,disabled:!(Se||Re)},m.createElement("textarea",(0,A.Z)({},ht,{ref:Q,style:Qe,className:q()(v,Ye,(0,ue.Z)({},"".concat(v,"-disabled"),ot)),disabled:ot,value:ze,onChange:se})))}),Ze=he,K=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],R=m.forwardRef(function(W,H){var _,v=W.defaultValue,C=W.value,Y=W.onFocus,Se=W.onBlur,Re=W.onChange,Ye=W.allowClear,He=W.maxLength,ot=W.onCompositionStart,dt=W.onCompositionEnd,Me=W.suffix,ht=W.prefixCls,Oe=ht===void 0?"rc-textarea":ht,mt=W.showCount,ze=W.count,ke=W.className,se=W.style,Q=W.disabled,$=W.hidden,de=W.classNames,we=W.styles,Ce=W.onResize,P=W.onClear,te=W.onPressEnter,ge=W.readOnly,Ee=W.autoSize,Te=W.onKeyDown,Ue=(0,g.Z)(W,K),et=(0,d.Z)(v,{value:C,defaultValue:v}),Ne=(0,F.Z)(et,2),De=Ne[0],Ke=Ne[1],_t=De==null?"":String(De),nt=m.useState(!1),lt=(0,F.Z)(nt,2),ye=lt[0],wt=lt[1],Qe=m.useRef(!1),We=m.useState(null),Mt=(0,F.Z)(We,2),$t=Mt[0],rt=Mt[1],Jt=(0,m.useRef)(null),Tn=(0,m.useRef)(null),It=function(){var Kt;return(Kt=Tn.current)===null||Kt===void 0?void 0:Kt.textArea},en=function(){It().focus()};(0,m.useImperativeHandle)(H,function(){var at;return{resizableTextArea:Tn.current,focus:en,blur:function(){It().blur()},nativeElement:((at=Jt.current)===null||at===void 0?void 0:at.nativeElement)||It()}}),(0,m.useEffect)(function(){wt(function(at){return!Q&&at})},[Q]);var Ie=m.useState(null),ve=(0,F.Z)(Ie,2),be=ve[0],M=ve[1];m.useEffect(function(){if(be){var at;(at=It()).setSelectionRange.apply(at,(0,ne.Z)(be))}},[be]);var Z=(0,S.Z)(ze,mt),ie=(_=Z.max)!==null&&_!==void 0?_:He,le=Number(ie)>0,_e=Z.strategy(_t),it=!!ie&&_e>ie,bt=function(Kt,xn){var $n=xn;!Qe.current&&Z.exceedFormatter&&Z.max&&Z.strategy(xn)>Z.max&&($n=Z.exceedFormatter(xn,{max:Z.max}),xn!==$n&&M([It().selectionStart||0,It().selectionEnd||0])),Ke($n),(0,T.rJ)(Kt.currentTarget,Kt,Re,$n)},Ct=function(Kt){Qe.current=!0,ot==null||ot(Kt)},zt=function(Kt){Qe.current=!1,bt(Kt,Kt.currentTarget.value),dt==null||dt(Kt)},En=function(Kt){bt(Kt,Kt.target.value)},Dn=function(Kt){Kt.key==="Enter"&&te&&te(Kt),Te==null||Te(Kt)},dn=function(Kt){wt(!0),Y==null||Y(Kt)},un=function(Kt){wt(!1),Se==null||Se(Kt)},Fn=function(Kt){Ke(""),en(),(0,T.rJ)(It(),Kt,Re)},Vn=Me,Nn;Z.show&&(Z.showFormatter?Nn=Z.showFormatter({value:_t,count:_e,maxLength:ie}):Nn="".concat(_e).concat(le?" / ".concat(ie):""),Vn=m.createElement(m.Fragment,null,Vn,m.createElement("span",{className:q()("".concat(Oe,"-data-count"),de==null?void 0:de.count),style:we==null?void 0:we.count},Nn)));var zn=function(Kt){var xn;Ce==null||Ce(Kt),(xn=It())!==null&&xn!==void 0&&xn.style.height&&rt(!0)},Rt=!Ee&&!mt&&!Ye;return m.createElement(l.BaseInput,{ref:Jt,value:_t,allowClear:Ye,handleReset:Fn,suffix:Vn,prefixCls:Oe,classNames:(0,Ae.Z)((0,Ae.Z)({},de),{},{affixWrapper:q()(de==null?void 0:de.affixWrapper,(0,ue.Z)((0,ue.Z)({},"".concat(Oe,"-show-count"),mt),"".concat(Oe,"-textarea-allow-clear"),Ye))}),disabled:Q,focused:ye,className:q()(ke,it&&"".concat(Oe,"-out-of-range")),style:(0,Ae.Z)((0,Ae.Z)({},se),$t&&!Rt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Nn=="string"?Nn:void 0}},hidden:$,readOnly:ge,onClear:P},m.createElement(Ze,(0,A.Z)({},Ue,{autoSize:Ee,maxLength:He,onKeyDown:Dn,onChange:En,onFocus:dn,onBlur:un,onCompositionStart:Ct,onCompositionEnd:zt,className:q()(de==null?void 0:de.textarea),style:(0,Ae.Z)((0,Ae.Z)({},we==null?void 0:we.textarea),{},{resize:se==null?void 0:se.resize}),disabled:Q,prefixCls:Oe,onResize:zn,ref:Tn,readOnly:ge})))}),B=R,G=B},29125:function(bn,St,k){"use strict";k.d(St,{G:function(){return ne},Z:function(){return V}});var A=k(92310),ue=k.n(A),Ae=k(59301);function ne(I){var L=I.children,O=I.prefixCls,z=I.id,ee=I.overlayInnerStyle,re=I.bodyClassName,J=I.className,X=I.style;return Ae.createElement("div",{className:ue()("".concat(O,"-content"),J),style:X},Ae.createElement("div",{className:ue()("".concat(O,"-inner"),re),id:z,role:"tooltip",style:ee},typeof L=="function"?L():L))}var F=k(67711),g=k(98506),oe=k(33346),q=k(65030),l={shiftX:64,adjustY:1},S={adjustX:1,shiftY:!0},T=[0,0],d={left:{points:["cr","cl"],overflow:S,offset:[-4,0],targetOffset:T},right:{points:["cl","cr"],overflow:S,offset:[4,0],targetOffset:T},top:{points:["bc","tc"],overflow:l,offset:[0,-4],targetOffset:T},bottom:{points:["tc","bc"],overflow:l,offset:[0,4],targetOffset:T},topLeft:{points:["bl","tl"],overflow:l,offset:[0,-4],targetOffset:T},leftTop:{points:["tr","tl"],overflow:S,offset:[-4,0],targetOffset:T},topRight:{points:["br","tr"],overflow:l,offset:[0,-4],targetOffset:T},rightTop:{points:["tl","tr"],overflow:S,offset:[4,0],targetOffset:T},bottomRight:{points:["tr","br"],overflow:l,offset:[0,4],targetOffset:T},rightBottom:{points:["bl","br"],overflow:S,offset:[4,0],targetOffset:T},bottomLeft:{points:["tl","bl"],overflow:l,offset:[0,4],targetOffset:T},leftBottom:{points:["br","bl"],overflow:S,offset:[-4,0],targetOffset:T}},m=null,y=k(80402),x=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],U=function(L,O){var z=L.overlayClassName,ee=L.trigger,re=ee===void 0?["hover"]:ee,J=L.mouseEnterDelay,X=J===void 0?0:J,xe=L.mouseLeaveDelay,he=xe===void 0?.1:xe,Ze=L.overlayStyle,K=L.prefixCls,R=K===void 0?"rc-tooltip":K,B=L.children,G=L.onVisibleChange,W=L.afterVisibleChange,H=L.transitionName,_=L.animation,v=L.motion,C=L.placement,Y=C===void 0?"right":C,Se=L.align,Re=Se===void 0?{}:Se,Ye=L.destroyTooltipOnHide,He=Ye===void 0?!1:Ye,ot=L.defaultVisible,dt=L.getTooltipContainer,Me=L.overlayInnerStyle,ht=L.arrowContent,Oe=L.overlay,mt=L.id,ze=L.showArrow,ke=ze===void 0?!0:ze,se=L.classNames,Q=L.styles,$=(0,oe.Z)(L,x),de=(0,y.Z)(mt),we=(0,Ae.useRef)(null);(0,Ae.useImperativeHandle)(O,function(){return we.current});var Ce=(0,g.Z)({},$);"visible"in L&&(Ce.popupVisible=L.visible);var P=function(){return Ae.createElement(ne,{key:"content",prefixCls:R,id:de,bodyClassName:se==null?void 0:se.body,overlayInnerStyle:(0,g.Z)((0,g.Z)({},Me),Q==null?void 0:Q.body)},Oe)},te=function(){var Ee=Ae.Children.only(B),Te=(Ee==null?void 0:Ee.props)||{},Ue=(0,g.Z)((0,g.Z)({},Te),{},{"aria-describedby":Oe?de:null});return Ae.cloneElement(B,Ue)};return Ae.createElement(q.Z,(0,F.Z)({popupClassName:ue()(z,se==null?void 0:se.root),prefixCls:R,popup:P,action:re,builtinPlacements:d,popupPlacement:Y,ref:we,popupAlign:Re,getPopupContainer:dt,onPopupVisibleChange:G,afterPopupVisibleChange:W,popupTransitionName:H,popupAnimation:_,popupMotion:v,defaultPopupVisible:ot,autoDestroy:He,mouseLeaveDelay:he,popupStyle:(0,g.Z)((0,g.Z)({},Ze),Q==null?void 0:Q.root),mouseEnterDelay:X,arrow:ke},Ce),te())},N=(0,Ae.forwardRef)(U),V=N},49658:function(bn,St){"use strict";St.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var k=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(k)||/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(k==null?void 0:k.substr(0,4))}},6790:function(bn,St,k){"use strict";k.d(St,{Z:function(){return ze}});var A=k(67711),ue=k(26420),Ae=k(98506),ne=k(52873),F=k(16886),g=k(33346),oe=k(92310),q=k.n(oe),l=k(29301),S=k(70425),T=k(34280),d=k(59301),m=k(4676),y=d.forwardRef(function(ke,se){var Q=ke.height,$=ke.offsetY,de=ke.offsetX,we=ke.children,Ce=ke.prefixCls,P=ke.onInnerResize,te=ke.innerProps,ge=ke.rtl,Ee=ke.extra,Te={},Ue={display:"flex",flexDirection:"column"};return $!==void 0&&(Te={height:Q,position:"relative",overflow:"hidden"},Ue=(0,Ae.Z)((0,Ae.Z)({},Ue),{},(0,ne.Z)((0,ne.Z)((0,ne.Z)((0,ne.Z)((0,ne.Z)({transform:"translateY(".concat($,"px)")},ge?"marginRight":"marginLeft",-de),"position","absolute"),"left",0),"right",0),"top",0))),d.createElement("div",{style:Te},d.createElement(l.Z,{onResize:function(Ne){var De=Ne.offsetHeight;De&&P&&P()}},d.createElement("div",(0,A.Z)({style:Ue,className:q()((0,ne.Z)({},"".concat(Ce,"-holder-inner"),Ce)),ref:se},te),we,Ee)))});y.displayName="Filler";var x=y;function U(ke){var se=ke.children,Q=ke.setRef,$=d.useCallback(function(de){Q(de)},[]);return d.cloneElement(se,{ref:$})}function N(ke,se,Q,$,de,we,Ce,P){var te=P.getKey;return ke.slice(se,Q+1).map(function(ge,Ee){var Te=se+Ee,Ue=Ce(ge,Te,{style:{width:$},offsetX:de}),et=te(ge);return d.createElement(U,{key:et,setRef:function(De){return we(ge,De)}},Ue)})}function V(ke,se,Q,$){var de=Q-ke,we=se-Q,Ce=Math.min(de,we)*2;if($<=Ce){var P=Math.floor($/2);return $%2?Q+P+1:Q-P}return de>we?Q-($-we):Q+($-de)}function I(ke,se,Q){var $=ke.length,de=se.length,we,Ce;if($===0&&de===0)return null;$<de?(we=ke,Ce=se):(we=se,Ce=ke);var P={__EMPTY_ITEM__:!0};function te(Ne){return Ne!==void 0?Q(Ne):P}for(var ge=null,Ee=Math.abs($-de)!==1,Te=0;Te<Ce.length;Te+=1){var Ue=te(we[Te]),et=te(Ce[Te]);if(Ue!==et){ge=Te,Ee=Ee||Ue!==te(Ce[Te+1]);break}}return ge===null?null:{index:ge,multiple:Ee}}function L(ke,se,Q){var $=d.useState(ke),de=(0,F.Z)($,2),we=de[0],Ce=de[1],P=d.useState(null),te=(0,F.Z)(P,2),ge=te[0],Ee=te[1];return d.useEffect(function(){var Te=I(we||[],ke||[],se);(Te==null?void 0:Te.index)!==void 0&&(Q==null||Q(Te.index),Ee(ke[Te.index])),Ce(ke)},[ke]),[ge]}var O=k(16089),z=(typeof navigator=="undefined"?"undefined":(0,ue.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),ee=z,re=function(ke,se,Q,$){var de=(0,d.useRef)(!1),we=(0,d.useRef)(null);function Ce(){clearTimeout(we.current),de.current=!0,we.current=setTimeout(function(){de.current=!1},50)}var P=(0,d.useRef)({top:ke,bottom:se,left:Q,right:$});return P.current.top=ke,P.current.bottom=se,P.current.left=Q,P.current.right=$,function(te,ge){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Te=te?ge<0&&P.current.left||ge>0&&P.current.right:ge<0&&P.current.top||ge>0&&P.current.bottom;return Ee&&Te?(clearTimeout(we.current),de.current=!1):(!Te||de.current)&&Ce(),!de.current&&Te}};function J(ke,se,Q,$,de,we,Ce){var P=(0,d.useRef)(0),te=(0,d.useRef)(null),ge=(0,d.useRef)(null),Ee=(0,d.useRef)(!1),Te=re(se,Q,$,de);function Ue(nt,lt){if(O.Z.cancel(te.current),!Te(!1,lt)){var ye=nt;if(!ye._virtualHandled)ye._virtualHandled=!0;else return;P.current+=lt,ge.current=lt,ee||ye.preventDefault(),te.current=(0,O.Z)(function(){var wt=Ee.current?10:1;Ce(P.current*wt,!1),P.current=0})}}function et(nt,lt){Ce(lt,!0),ee||nt.preventDefault()}var Ne=(0,d.useRef)(null),De=(0,d.useRef)(null);function Ke(nt){if(ke){O.Z.cancel(De.current),De.current=(0,O.Z)(function(){Ne.current=null},2);var lt=nt.deltaX,ye=nt.deltaY,wt=nt.shiftKey,Qe=lt,We=ye;(Ne.current==="sx"||!Ne.current&&wt&&ye&&!lt)&&(Qe=ye,We=0,Ne.current="sx");var Mt=Math.abs(Qe),$t=Math.abs(We);Ne.current===null&&(Ne.current=we&&Mt>$t?"x":"y"),Ne.current==="y"?Ue(nt,We):et(nt,Qe)}}function _t(nt){ke&&(Ee.current=nt.detail===ge.current)}return[Ke,_t]}function X(ke,se,Q,$){var de=d.useMemo(function(){return[new Map,[]]},[ke,Q.id,$]),we=(0,F.Z)(de,2),Ce=we[0],P=we[1],te=function(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee,Ue=Ce.get(Ee),et=Ce.get(Te);if(Ue===void 0||et===void 0)for(var Ne=ke.length,De=P.length;De<Ne;De+=1){var Ke,_t=ke[De],nt=se(_t);Ce.set(nt,De);var lt=(Ke=Q.get(nt))!==null&&Ke!==void 0?Ke:$;if(P[De]=(P[De-1]||0)+lt,nt===Ee&&(Ue=De),nt===Te&&(et=De),Ue!==void 0&&et!==void 0)break}return{top:P[Ue-1]||0,bottom:P[et]}};return te}var xe=k(42573),he=k(58698),Ze=function(){function ke(){(0,xe.Z)(this,ke),(0,ne.Z)(this,"maps",void 0),(0,ne.Z)(this,"id",0),(0,ne.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,he.Z)(ke,[{key:"set",value:function(Q,$){this.diffRecords.set(Q,this.maps[Q]),this.maps[Q]=$,this.id+=1}},{key:"get",value:function(Q){return this.maps[Q]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ke}(),K=Ze;function R(ke){var se=parseFloat(ke);return isNaN(se)?0:se}function B(ke,se,Q){var $=d.useState(0),de=(0,F.Z)($,2),we=de[0],Ce=de[1],P=(0,d.useRef)(new Map),te=(0,d.useRef)(new K),ge=(0,d.useRef)(0);function Ee(){ge.current+=1}function Te(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ee();var Ne=function(){var _t=!1;P.current.forEach(function(nt,lt){if(nt&&nt.offsetParent){var ye=nt.offsetHeight,wt=getComputedStyle(nt),Qe=wt.marginTop,We=wt.marginBottom,Mt=R(Qe),$t=R(We),rt=ye+Mt+$t;te.current.get(lt)!==rt&&(te.current.set(lt,rt),_t=!0)}}),_t&&Ce(function(nt){return nt+1})};if(et)Ne();else{ge.current+=1;var De=ge.current;Promise.resolve().then(function(){De===ge.current&&Ne()})}}function Ue(et,Ne){var De=ke(et),Ke=P.current.get(De);Ne?(P.current.set(De,Ne),Te()):P.current.delete(De),!Ke!=!Ne&&(Ne?se==null||se(et):Q==null||Q(et))}return(0,d.useEffect)(function(){return Ee},[]),[Ue,Te,te.current,we]}var G=14/15;function W(ke,se,Q){var $=(0,d.useRef)(!1),de=(0,d.useRef)(0),we=(0,d.useRef)(0),Ce=(0,d.useRef)(null),P=(0,d.useRef)(null),te,ge=function(et){if($.current){var Ne=Math.ceil(et.touches[0].pageX),De=Math.ceil(et.touches[0].pageY),Ke=de.current-Ne,_t=we.current-De,nt=Math.abs(Ke)>Math.abs(_t);nt?de.current=Ne:we.current=De;var lt=Q(nt,nt?Ke:_t,!1,et);lt&&et.preventDefault(),clearInterval(P.current),lt&&(P.current=setInterval(function(){nt?Ke*=G:_t*=G;var ye=Math.floor(nt?Ke:_t);(!Q(nt,ye,!0)||Math.abs(ye)<=.1)&&clearInterval(P.current)},16))}},Ee=function(){$.current=!1,te()},Te=function(et){te(),et.touches.length===1&&!$.current&&($.current=!0,de.current=Math.ceil(et.touches[0].pageX),we.current=Math.ceil(et.touches[0].pageY),Ce.current=et.target,Ce.current.addEventListener("touchmove",ge,{passive:!1}),Ce.current.addEventListener("touchend",Ee,{passive:!0}))};te=function(){Ce.current&&(Ce.current.removeEventListener("touchmove",ge),Ce.current.removeEventListener("touchend",Ee))},(0,T.Z)(function(){return ke&&se.current.addEventListener("touchstart",Te,{passive:!0}),function(){var Ue;(Ue=se.current)===null||Ue===void 0||Ue.removeEventListener("touchstart",Te),te(),clearInterval(P.current)}},[ke])}function H(ke){return Math.floor(Math.pow(ke,.5))}function _(ke,se){var Q="touches"in ke?ke.touches[0]:ke;return Q[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function v(ke,se,Q){d.useEffect(function(){var $=se.current;if(ke&&$){var de=!1,we,Ce,P=function(){O.Z.cancel(we)},te=function Ue(){P(),we=(0,O.Z)(function(){Q(Ce),Ue()})},ge=function(et){if(!(et.target.draggable||et.button!==0)){var Ne=et;Ne._virtualHandled||(Ne._virtualHandled=!0,de=!0)}},Ee=function(){de=!1,P()},Te=function(et){if(de){var Ne=_(et,!1),De=$.getBoundingClientRect(),Ke=De.top,_t=De.bottom;if(Ne<=Ke){var nt=Ke-Ne;Ce=-H(nt),te()}else if(Ne>=_t){var lt=Ne-_t;Ce=H(lt),te()}else P()}};return $.addEventListener("mousedown",ge),$.ownerDocument.addEventListener("mouseup",Ee),$.ownerDocument.addEventListener("mousemove",Te),function(){$.removeEventListener("mousedown",ge),$.ownerDocument.removeEventListener("mouseup",Ee),$.ownerDocument.removeEventListener("mousemove",Te),P()}}},[ke])}var C=10;function Y(ke,se,Q,$,de,we,Ce,P){var te=d.useRef(),ge=d.useState(null),Ee=(0,F.Z)(ge,2),Te=Ee[0],Ue=Ee[1];return(0,T.Z)(function(){if(Te&&Te.times<C){if(!ke.current){Ue(function(Z){return(0,Ae.Z)({},Z)});return}we();var et=Te.targetAlign,Ne=Te.originAlign,De=Te.index,Ke=Te.offset,_t=ke.current.clientHeight,nt=!1,lt=et,ye=null;if(_t){for(var wt=et||Ne,Qe=0,We=0,Mt=0,$t=Math.min(se.length-1,De),rt=0;rt<=$t;rt+=1){var Jt=de(se[rt]);We=Qe;var Tn=Q.get(Jt);Mt=We+(Tn===void 0?$:Tn),Qe=Mt}for(var It=wt==="top"?Ke:_t-Ke,en=$t;en>=0;en-=1){var Ie=de(se[en]),ve=Q.get(Ie);if(ve===void 0){nt=!0;break}if(It-=ve,It<=0)break}switch(wt){case"top":ye=We-Ke;break;case"bottom":ye=Mt-_t+Ke;break;default:{var be=ke.current.scrollTop,M=be+_t;We<be?lt="top":Mt>M&&(lt="bottom")}}ye!==null&&Ce(ye),ye!==Te.lastTop&&(nt=!0)}nt&&Ue((0,Ae.Z)((0,Ae.Z)({},Te),{},{times:Te.times+1,targetAlign:lt,lastTop:ye}))}},[Te,ke.current]),function(et){if(et==null){P();return}if(O.Z.cancel(te.current),typeof et=="number")Ce(et);else if(et&&(0,ue.Z)(et)==="object"){var Ne,De=et.align;"index"in et?Ne=et.index:Ne=se.findIndex(function(nt){return de(nt)===et.key});var Ke=et.offset,_t=Ke===void 0?0:Ke;Ue({times:0,index:Ne,offset:_t,originAlign:De})}}}var Se=d.forwardRef(function(ke,se){var Q=ke.prefixCls,$=ke.rtl,de=ke.scrollOffset,we=ke.scrollRange,Ce=ke.onStartMove,P=ke.onStopMove,te=ke.onScroll,ge=ke.horizontal,Ee=ke.spinSize,Te=ke.containerSize,Ue=ke.style,et=ke.thumbStyle,Ne=ke.showScrollBar,De=d.useState(!1),Ke=(0,F.Z)(De,2),_t=Ke[0],nt=Ke[1],lt=d.useState(null),ye=(0,F.Z)(lt,2),wt=ye[0],Qe=ye[1],We=d.useState(null),Mt=(0,F.Z)(We,2),$t=Mt[0],rt=Mt[1],Jt=!$,Tn=d.useRef(),It=d.useRef(),en=d.useState(Ne),Ie=(0,F.Z)(en,2),ve=Ie[0],be=Ie[1],M=d.useRef(),Z=function(){Ne===!0||Ne===!1||(clearTimeout(M.current),be(!0),M.current=setTimeout(function(){be(!1)},3e3))},ie=we-Te||0,le=Te-Ee||0,_e=d.useMemo(function(){if(de===0||ie===0)return 0;var Fn=de/ie;return Fn*le},[de,ie,le]),it=function(Vn){Vn.stopPropagation(),Vn.preventDefault()},bt=d.useRef({top:_e,dragging:_t,pageY:wt,startTop:$t});bt.current={top:_e,dragging:_t,pageY:wt,startTop:$t};var Ct=function(Vn){nt(!0),Qe(_(Vn,ge)),rt(bt.current.top),Ce(),Vn.stopPropagation(),Vn.preventDefault()};d.useEffect(function(){var Fn=function(Rt){Rt.preventDefault()},Vn=Tn.current,Nn=It.current;return Vn.addEventListener("touchstart",Fn,{passive:!1}),Nn.addEventListener("touchstart",Ct,{passive:!1}),function(){Vn.removeEventListener("touchstart",Fn),Nn.removeEventListener("touchstart",Ct)}},[]);var zt=d.useRef();zt.current=ie;var En=d.useRef();En.current=le,d.useEffect(function(){if(_t){var Fn,Vn=function(Rt){var at=bt.current,Kt=at.dragging,xn=at.pageY,$n=at.startTop;O.Z.cancel(Fn);var me=Tn.current.getBoundingClientRect(),pe=Te/(ge?me.width:me.height);if(Kt){var vt=(_(Rt,ge)-xn)*pe,qe=$n;!Jt&&ge?qe-=vt:qe+=vt;var pt=zt.current,Dt=En.current,Pt=Dt?qe/Dt:0,Tt=Math.ceil(Pt*pt);Tt=Math.max(Tt,0),Tt=Math.min(Tt,pt),Fn=(0,O.Z)(function(){te(Tt,ge)})}},Nn=function(){nt(!1),P()};return window.addEventListener("mousemove",Vn,{passive:!0}),window.addEventListener("touchmove",Vn,{passive:!0}),window.addEventListener("mouseup",Nn,{passive:!0}),window.addEventListener("touchend",Nn,{passive:!0}),function(){window.removeEventListener("mousemove",Vn),window.removeEventListener("touchmove",Vn),window.removeEventListener("mouseup",Nn),window.removeEventListener("touchend",Nn),O.Z.cancel(Fn)}}},[_t]),d.useEffect(function(){return Z(),function(){clearTimeout(M.current)}},[de]),d.useImperativeHandle(se,function(){return{delayHidden:Z}});var Dn="".concat(Q,"-scrollbar"),dn={position:"absolute",visibility:ve?null:"hidden"},un={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return ge?(Object.assign(dn,{height:8,left:0,right:0,bottom:0}),Object.assign(un,(0,ne.Z)({height:"100%",width:Ee},Jt?"left":"right",_e))):(Object.assign(dn,(0,ne.Z)({width:8,top:0,bottom:0},Jt?"right":"left",0)),Object.assign(un,{width:"100%",height:Ee,top:_e})),d.createElement("div",{ref:Tn,className:q()(Dn,(0,ne.Z)((0,ne.Z)((0,ne.Z)({},"".concat(Dn,"-horizontal"),ge),"".concat(Dn,"-vertical"),!ge),"".concat(Dn,"-visible"),ve)),style:(0,Ae.Z)((0,Ae.Z)({},dn),Ue),onMouseDown:it,onMouseMove:Z},d.createElement("div",{ref:It,className:q()("".concat(Dn,"-thumb"),(0,ne.Z)({},"".concat(Dn,"-thumb-moving"),_t)),style:(0,Ae.Z)((0,Ae.Z)({},un),et),onMouseDown:Ct}))}),Re=Se,Ye=20;function He(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Q=ke/se*ke;return isNaN(Q)&&(Q=0),Q=Math.max(Q,Ye),Math.floor(Q)}var ot=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],dt=[],Me={overflowY:"auto",overflowAnchor:"none"};function ht(ke,se){var Q=ke.prefixCls,$=Q===void 0?"rc-virtual-list":Q,de=ke.className,we=ke.height,Ce=ke.itemHeight,P=ke.fullHeight,te=P===void 0?!0:P,ge=ke.style,Ee=ke.data,Te=ke.children,Ue=ke.itemKey,et=ke.virtual,Ne=ke.direction,De=ke.scrollWidth,Ke=ke.component,_t=Ke===void 0?"div":Ke,nt=ke.onScroll,lt=ke.onVirtualScroll,ye=ke.onVisibleChange,wt=ke.innerProps,Qe=ke.extraRender,We=ke.styles,Mt=ke.showScrollBar,$t=Mt===void 0?"optional":Mt,rt=(0,g.Z)(ke,ot),Jt=d.useCallback(function(xt){return typeof Ue=="function"?Ue(xt):xt==null?void 0:xt[Ue]},[Ue]),Tn=B(Jt,null,null),It=(0,F.Z)(Tn,4),en=It[0],Ie=It[1],ve=It[2],be=It[3],M=!!(et!==!1&&we&&Ce),Z=d.useMemo(function(){return Object.values(ve.maps).reduce(function(xt,yt){return xt+yt},0)},[ve.id,ve.maps]),ie=M&&Ee&&(Math.max(Ce*Ee.length,Z)>we||!!De),le=Ne==="rtl",_e=q()($,(0,ne.Z)({},"".concat($,"-rtl"),le),de),it=Ee||dt,bt=(0,d.useRef)(),Ct=(0,d.useRef)(),zt=(0,d.useRef)(),En=(0,d.useState)(0),Dn=(0,F.Z)(En,2),dn=Dn[0],un=Dn[1],Fn=(0,d.useState)(0),Vn=(0,F.Z)(Fn,2),Nn=Vn[0],zn=Vn[1],Rt=(0,d.useState)(!1),at=(0,F.Z)(Rt,2),Kt=at[0],xn=at[1],$n=function(){xn(!0)},me=function(){xn(!1)},pe={getKey:Jt};function vt(xt){un(function(yt){var Wt;typeof xt=="function"?Wt=xt(yt):Wt=xt;var jt=kn(Wt);return bt.current.scrollTop=jt,jt})}var qe=(0,d.useRef)({start:0,end:it.length}),pt=(0,d.useRef)(),Dt=L(it,Jt),Pt=(0,F.Z)(Dt,1),Tt=Pt[0];pt.current=Tt;var Bt=d.useMemo(function(){if(!M)return{scrollHeight:void 0,start:0,end:it.length-1,offset:void 0};if(!ie){var xt;return{scrollHeight:((xt=Ct.current)===null||xt===void 0?void 0:xt.offsetHeight)||0,start:0,end:it.length-1,offset:void 0}}for(var yt=0,Wt,jt,yn,Un=it.length,Wn=0;Wn<Un;Wn+=1){var Bn=it[Wn],ri=Jt(Bn),bi=ve.get(ri),_i=yt+(bi===void 0?Ce:bi);_i>=dn&&Wt===void 0&&(Wt=Wn,jt=yt),_i>dn+we&&yn===void 0&&(yn=Wn),yt=_i}return Wt===void 0&&(Wt=0,jt=0,yn=Math.ceil(we/Ce)),yn===void 0&&(yn=it.length-1),yn=Math.min(yn+1,it.length-1),{scrollHeight:yt,start:Wt,end:yn,offset:jt}},[ie,M,dn,it,be,we]),tt=Bt.scrollHeight,Ot=Bt.start,Ft=Bt.end,Lt=Bt.offset;qe.current.start=Ot,qe.current.end=Ft,d.useLayoutEffect(function(){var xt=ve.getRecord();if(xt.size===1){var yt=Array.from(xt.keys())[0],Wt=xt.get(yt),jt=it[Ot];if(jt&&Wt===void 0){var yn=Jt(jt);if(yn===yt){var Un=ve.get(yt),Wn=Un-Ce;vt(function(Bn){return Bn+Wn})}}}ve.resetRecord()},[tt]);var gt=d.useState({width:0,height:we}),ce=(0,F.Z)(gt,2),Le=ce[0],Fe=ce[1],Ge=function(yt){Fe({width:yt.offsetWidth,height:yt.offsetHeight})},ct=(0,d.useRef)(),ft=(0,d.useRef)(),Et=d.useMemo(function(){return He(Le.width,De)},[Le.width,De]),Ut=d.useMemo(function(){return He(Le.height,tt)},[Le.height,tt]),Gt=tt-we,Yt=(0,d.useRef)(Gt);Yt.current=Gt;function kn(xt){var yt=xt;return Number.isNaN(Yt.current)||(yt=Math.min(yt,Yt.current)),yt=Math.max(yt,0),yt}var qt=dn<=0,Zt=dn>=Gt,fn=Nn<=0,gn=Nn>=De,mn=re(qt,Zt,fn,gn),Xt=function(){return{x:le?-Nn:Nn,y:dn}},Qt=(0,d.useRef)(Xt()),kt=(0,S.zX)(function(xt){if(lt){var yt=(0,Ae.Z)((0,Ae.Z)({},Xt()),xt);(Qt.current.x!==yt.x||Qt.current.y!==yt.y)&&(lt(yt),Qt.current=yt)}});function Nt(xt,yt){var Wt=xt;yt?((0,m.flushSync)(function(){zn(Wt)}),kt()):vt(Wt)}function Vt(xt){var yt=xt.currentTarget.scrollTop;yt!==dn&&vt(yt),nt==null||nt(xt),kt()}var pn=function(yt){var Wt=yt,jt=De?De-Le.width:0;return Wt=Math.max(Wt,0),Wt=Math.min(Wt,jt),Wt},cn=(0,S.zX)(function(xt,yt){yt?((0,m.flushSync)(function(){zn(function(Wt){var jt=Wt+(le?-xt:xt);return pn(jt)})}),kt()):vt(function(Wt){var jt=Wt+xt;return jt})}),Ht=J(M,qt,Zt,fn,gn,!!De,cn),Mn=(0,F.Z)(Ht,2),Hn=Mn[0],qn=Mn[1];W(M,bt,function(xt,yt,Wt,jt){var yn=jt;return mn(xt,yt,Wt)?!1:!yn||!yn._virtualHandled?(yn&&(yn._virtualHandled=!0),Hn({preventDefault:function(){},deltaX:xt?yt:0,deltaY:xt?0:yt}),!0):!1}),v(ie,bt,function(xt){vt(function(yt){return yt+xt})}),(0,T.Z)(function(){function xt(Wt){var jt=qt&&Wt.detail<0,yn=Zt&&Wt.detail>0;M&&!jt&&!yn&&Wt.preventDefault()}var yt=bt.current;return yt.addEventListener("wheel",Hn,{passive:!1}),yt.addEventListener("DOMMouseScroll",qn,{passive:!0}),yt.addEventListener("MozMousePixelScroll",xt,{passive:!1}),function(){yt.removeEventListener("wheel",Hn),yt.removeEventListener("DOMMouseScroll",qn),yt.removeEventListener("MozMousePixelScroll",xt)}},[M,qt,Zt]),(0,T.Z)(function(){if(De){var xt=pn(Nn);zn(xt),kt({x:xt})}},[Le.width,De]);var vn=function(){var yt,Wt;(yt=ct.current)===null||yt===void 0||yt.delayHidden(),(Wt=ft.current)===null||Wt===void 0||Wt.delayHidden()},ai=Y(bt,it,ve,Ce,Jt,function(){return Ie(!0)},vt,vn);d.useImperativeHandle(se,function(){return{nativeElement:zt.current,getScrollInfo:Xt,scrollTo:function(yt){function Wt(jt){return jt&&(0,ue.Z)(jt)==="object"&&("left"in jt||"top"in jt)}Wt(yt)?(yt.left!==void 0&&zn(pn(yt.left)),ai(yt.top)):ai(yt)}}}),(0,T.Z)(function(){if(ye){var xt=it.slice(Ot,Ft+1);ye(xt,it)}},[Ot,Ft,it]);var Qn=X(it,Jt,ve,Ce),ti=Qe==null?void 0:Qe({start:Ot,end:Ft,virtual:ie,offsetX:Nn,offsetY:Lt,rtl:le,getSize:Qn}),li=N(it,Ot,Ft,De,Nn,en,Te,pe),Gn=null;we&&(Gn=(0,Ae.Z)((0,ne.Z)({},te?"height":"maxHeight",we),Me),M&&(Gn.overflowY="hidden",De&&(Gn.overflowX="hidden"),Kt&&(Gn.pointerEvents="none")));var _n={};return le&&(_n.dir="rtl"),d.createElement("div",(0,A.Z)({ref:zt,style:(0,Ae.Z)((0,Ae.Z)({},ge),{},{position:"relative"}),className:_e},_n,rt),d.createElement(l.Z,{onResize:Ge},d.createElement(_t,{className:"".concat($,"-holder"),style:Gn,ref:bt,onScroll:Vt,onMouseEnter:vn},d.createElement(x,{prefixCls:$,height:tt,offsetX:Nn,offsetY:Lt,scrollWidth:De,onInnerResize:Ie,ref:Ct,innerProps:wt,rtl:le,extra:ti},li))),ie&&tt>we&&d.createElement(Re,{ref:ct,prefixCls:$,scrollOffset:dn,scrollRange:tt,rtl:le,onScroll:Nt,onStartMove:$n,onStopMove:me,spinSize:Ut,containerSize:Le.height,style:We==null?void 0:We.verticalScrollBar,thumbStyle:We==null?void 0:We.verticalScrollBarThumb,showScrollBar:$t}),ie&&De>Le.width&&d.createElement(Re,{ref:ft,prefixCls:$,scrollOffset:Nn,scrollRange:De,rtl:le,onScroll:Nt,onStartMove:$n,onStopMove:me,spinSize:Et,containerSize:Le.width,horizontal:!0,style:We==null?void 0:We.horizontalScrollBar,thumbStyle:We==null?void 0:We.horizontalScrollBarThumb,showScrollBar:$t}))}var Oe=d.forwardRef(ht);Oe.displayName="List";var mt=Oe,ze=mt},83145:function(bn,St,k){"use strict";Object.defineProperty(St,"__esModule",{value:!0}),St.CopyToClipboard=void 0;var A=Ae(k(59301)),ue=Ae(k(25769));function Ae(I){return I&&I.__esModule?I:{default:I}}function ne(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ne=function(O){return typeof O}:ne=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},ne(I)}function F(I,L){var O=Object.keys(I);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(I);L&&(z=z.filter(function(ee){return Object.getOwnPropertyDescriptor(I,ee).enumerable})),O.push.apply(O,z)}return O}function g(I){for(var L=1;L<arguments.length;L++){var O=arguments[L]!=null?arguments[L]:{};L%2?F(O,!0).forEach(function(z){N(I,z,O[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(O)):F(O).forEach(function(z){Object.defineProperty(I,z,Object.getOwnPropertyDescriptor(O,z))})}return I}function oe(I,L){if(I==null)return{};var O=q(I,L),z,ee;if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(I);for(ee=0;ee<re.length;ee++)z=re[ee],!(L.indexOf(z)>=0)&&Object.prototype.propertyIsEnumerable.call(I,z)&&(O[z]=I[z])}return O}function q(I,L){if(I==null)return{};var O={},z=Object.keys(I),ee,re;for(re=0;re<z.length;re++)ee=z[re],!(L.indexOf(ee)>=0)&&(O[ee]=I[ee]);return O}function l(I,L){if(!(I instanceof L))throw new TypeError("Cannot call a class as a function")}function S(I,L){for(var O=0;O<L.length;O++){var z=L[O];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(I,z.key,z)}}function T(I,L,O){return L&&S(I.prototype,L),O&&S(I,O),I}function d(I,L){return L&&(ne(L)==="object"||typeof L=="function")?L:y(I)}function m(I){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},m(I)}function y(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(I,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(L&&L.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),L&&U(I,L)}function U(I,L){return U=Object.setPrototypeOf||function(z,ee){return z.__proto__=ee,z},U(I,L)}function N(I,L,O){return L in I?Object.defineProperty(I,L,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[L]=O,I}var V=function(I){x(L,I);function L(){var O,z;l(this,L);for(var ee=arguments.length,re=new Array(ee),J=0;J<ee;J++)re[J]=arguments[J];return z=d(this,(O=m(L)).call.apply(O,[this].concat(re))),N(y(z),"onClick",function(X){var xe=z.props,he=xe.text,Ze=xe.onCopy,K=xe.children,R=xe.options,B=A.default.Children.only(K),G=(0,ue.default)(he,R);Ze&&Ze(he,G),B&&B.props&&typeof B.props.onClick=="function"&&B.props.onClick(X)}),z}return T(L,[{key:"render",value:function(){var z=this.props,ee=z.text,re=z.onCopy,J=z.options,X=z.children,xe=oe(z,["text","onCopy","options","children"]),he=A.default.Children.only(X);return A.default.cloneElement(he,g({},xe,{onClick:this.onClick}))}}]),L}(A.default.PureComponent);St.CopyToClipboard=V,N(V,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(bn,St,k){"use strict";var A=k(83145),ue=A.CopyToClipboard;ue.CopyToClipboard=ue,bn.exports=ue},76374:function(bn,St,k){"use strict";var A=function(){if(typeof Map!="undefined")return Map;function K(R,B){var G=-1;return R.some(function(W,H){return W[0]===B?(G=H,!0):!1}),G}return function(){function R(){this.__entries__=[]}return Object.defineProperty(R.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),R.prototype.get=function(B){var G=K(this.__entries__,B),W=this.__entries__[G];return W&&W[1]},R.prototype.set=function(B,G){var W=K(this.__entries__,B);~W?this.__entries__[W][1]=G:this.__entries__.push([B,G])},R.prototype.delete=function(B){var G=this.__entries__,W=K(G,B);~W&&G.splice(W,1)},R.prototype.has=function(B){return!!~K(this.__entries__,B)},R.prototype.clear=function(){this.__entries__.splice(0)},R.prototype.forEach=function(B,G){G===void 0&&(G=null);for(var W=0,H=this.__entries__;W<H.length;W++){var _=H[W];B.call(G,_[1],_[0])}},R}()}(),ue=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Ae=function(){return typeof k.g!="undefined"&&k.g.Math===Math?k.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(K){return setTimeout(function(){return K(Date.now())},1e3/60)}}(),F=2;function g(K,R){var B=!1,G=!1,W=0;function H(){B&&(B=!1,K()),G&&v()}function _(){ne(H)}function v(){var C=Date.now();if(B){if(C-W<F)return;G=!0}else B=!0,G=!1,setTimeout(_,R);W=C}return v}var oe=20,q=["top","right","bottom","left","width","height","size","weight"],l=typeof MutationObserver!="undefined",S=function(){function K(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=g(this.refresh.bind(this),oe)}return K.prototype.addObserver=function(R){~this.observers_.indexOf(R)||this.observers_.push(R),this.connected_||this.connect_()},K.prototype.removeObserver=function(R){var B=this.observers_,G=B.indexOf(R);~G&&B.splice(G,1),!B.length&&this.connected_&&this.disconnect_()},K.prototype.refresh=function(){var R=this.updateObservers_();R&&this.refresh()},K.prototype.updateObservers_=function(){var R=this.observers_.filter(function(B){return B.gatherActive(),B.hasActive()});return R.forEach(function(B){return B.broadcastActive()}),R.length>0},K.prototype.connect_=function(){!ue||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},K.prototype.disconnect_=function(){!ue||!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)},K.prototype.onTransitionEnd_=function(R){var B=R.propertyName,G=B===void 0?"":B,W=q.some(function(H){return!!~G.indexOf(H)});W&&this.refresh()},K.getInstance=function(){return this.instance_||(this.instance_=new K),this.instance_},K.instance_=null,K}(),T=function(K,R){for(var B=0,G=Object.keys(R);B<G.length;B++){var W=G[B];Object.defineProperty(K,W,{value:R[W],enumerable:!1,writable:!1,configurable:!0})}return K},d=function(K){var R=K&&K.ownerDocument&&K.ownerDocument.defaultView;return R||Ae},m=ee(0,0,0,0);function y(K){return parseFloat(K)||0}function x(K){for(var R=[],B=1;B<arguments.length;B++)R[B-1]=arguments[B];return R.reduce(function(G,W){var H=K["border-"+W+"-width"];return G+y(H)},0)}function U(K){for(var R=["top","right","bottom","left"],B={},G=0,W=R;G<W.length;G++){var H=W[G],_=K["padding-"+H];B[H]=y(_)}return B}function N(K){var R=K.getBBox();return ee(0,0,R.width,R.height)}function V(K){var R=K.clientWidth,B=K.clientHeight;if(!R&&!B)return m;var G=d(K).getComputedStyle(K),W=U(G),H=W.left+W.right,_=W.top+W.bottom,v=y(G.width),C=y(G.height);if(G.boxSizing==="border-box"&&(Math.round(v+H)!==R&&(v-=x(G,"left","right")+H),Math.round(C+_)!==B&&(C-=x(G,"top","bottom")+_)),!L(K)){var Y=Math.round(v+H)-R,Se=Math.round(C+_)-B;Math.abs(Y)!==1&&(v-=Y),Math.abs(Se)!==1&&(C-=Se)}return ee(W.left,W.top,v,C)}var I=function(){return typeof SVGGraphicsElement!="undefined"?function(K){return K instanceof d(K).SVGGraphicsElement}:function(K){return K instanceof d(K).SVGElement&&typeof K.getBBox=="function"}}();function L(K){return K===d(K).document.documentElement}function O(K){return ue?I(K)?N(K):V(K):m}function z(K){var R=K.x,B=K.y,G=K.width,W=K.height,H=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,_=Object.create(H.prototype);return T(_,{x:R,y:B,width:G,height:W,top:B,right:R+G,bottom:W+B,left:R}),_}function ee(K,R,B,G){return{x:K,y:R,width:B,height:G}}var re=function(){function K(R){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ee(0,0,0,0),this.target=R}return K.prototype.isActive=function(){var R=O(this.target);return this.contentRect_=R,R.width!==this.broadcastWidth||R.height!==this.broadcastHeight},K.prototype.broadcastRect=function(){var R=this.contentRect_;return this.broadcastWidth=R.width,this.broadcastHeight=R.height,R},K}(),J=function(){function K(R,B){var G=z(B);T(this,{target:R,contentRect:G})}return K}(),X=function(){function K(R,B,G){if(this.activeObservations_=[],this.observations_=new A,typeof R!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=R,this.controller_=B,this.callbackCtx_=G}return K.prototype.observe=function(R){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(R instanceof d(R).Element))throw new TypeError('parameter 1 is not of type "Element".');var B=this.observations_;B.has(R)||(B.set(R,new re(R)),this.controller_.addObserver(this),this.controller_.refresh())}},K.prototype.unobserve=function(R){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(R instanceof d(R).Element))throw new TypeError('parameter 1 is not of type "Element".');var B=this.observations_;B.has(R)&&(B.delete(R),B.size||this.controller_.removeObserver(this))}},K.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},K.prototype.gatherActive=function(){var R=this;this.clearActive(),this.observations_.forEach(function(B){B.isActive()&&R.activeObservations_.push(B)})},K.prototype.broadcastActive=function(){if(this.hasActive()){var R=this.callbackCtx_,B=this.activeObservations_.map(function(G){return new J(G.target,G.broadcastRect())});this.callback_.call(R,B,R),this.clearActive()}},K.prototype.clearActive=function(){this.activeObservations_.splice(0)},K.prototype.hasActive=function(){return this.activeObservations_.length>0},K}(),xe=typeof WeakMap!="undefined"?new WeakMap:new A,he=function(){function K(R){if(!(this instanceof K))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var B=S.getInstance(),G=new X(R,B,this);xe.set(this,G)}return K}();["observe","unobserve","disconnect"].forEach(function(K){he.prototype[K]=function(){var R;return(R=xe.get(this))[K].apply(R,arguments)}});var Ze=function(){return typeof Ae.ResizeObserver!="undefined"?Ae.ResizeObserver:he}();St.Z=Ze},98040:function(bn){bn.exports=function(){var St=document.getSelection();if(!St.rangeCount)return function(){};for(var k=document.activeElement,A=[],ue=0;ue<St.rangeCount;ue++)A.push(St.getRangeAt(ue));switch(k.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":k.blur();break;default:k=null;break}return St.removeAllRanges(),function(){St.type==="Caret"&&St.removeAllRanges(),St.rangeCount||A.forEach(function(Ae){St.addRange(Ae)}),k&&k.focus()}}},93314:function(bn){"use strict";bn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},39394:function(bn,St,k){"use strict";k.d(St,{ZP:function(){return jr}});const A=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ue=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Ae},Ae=Number.MAX_SAFE_INTEGER||9007199254740991;let ne=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}({}),F=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),g=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var oe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},q={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class l{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class S{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new l(e),this.fast_=new l(t),this.defaultTTFB_=i,this.ttfb_=new l(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new l(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new l(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new l(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function T(a,e,t){return(e=U(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function d(){return d=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},d.apply(null,arguments)}function m(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m(Object(t),!0).forEach(function(n){T(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function x(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function U(a){var e=x(a,"string");return typeof e=="symbol"?e:e+""}class N{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=V,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const V=function(){},I={trace:V,debug:V,log:V,warn:V,info:V,error:V};function L(){return d({},I)}function O(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):V}function z(a,e,t){return e[a]?e[a].bind(e):O(a,t)}const ee=L();function re(a,e,t){const n=L();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=z(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.9`)}catch(r){return L()}i.forEach(r=>{ee[r]=z(r,a)})}else d(ee,n);return n}const J=ee;function X(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function xe(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function he(a,e){const t=Object.keys(a),n=Object.keys(e),i=t.length,r=n.length;return!i||!r||i===r&&!t.some(s=>n.indexOf(s)===-1)}function Ze(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",o=0;for(;o<t;){if(n=a[o++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:i=a[o++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}const K={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function R(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function B(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var G={exports:{}},W;function H(){return W||(W=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var h=o.parseURL(c);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var p=o.parseURL(u);if(!p)throw new Error("Error trying to parse relative URL.");if(p.scheme)return f.alwaysNormalize?(p.path=o.normalizePath(p.path),o.buildURLFromParts(p)):u;var b=o.parseURL(c);if(!b)throw new Error("Error trying to parse base URL.");if(!b.netLoc&&b.path&&b.path[0]!=="/"){var E=i.exec(b.path);b.netLoc=E[1],b.path=E[2]}b.netLoc&&!b.path&&(b.path="/");var D={scheme:b.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(D.netLoc=b.netLoc,p.path[0]!=="/"))if(!p.path)D.path=b.path,p.params||(D.params=b.params,p.query||(D.query=b.query));else{var w=b.path,j=w.substring(0,w.lastIndexOf("/")+1)+p.path;D.path=o.normalizePath(j)}return D.path===null&&(D.path=f.alwaysNormalize?o.normalizePath(p.path):p.path),o.buildURLFromParts(D)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=o})()}(G)),G.exports}var _=H();class v{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 C={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Y{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,ot(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[C.AUDIO]:null,[C.VIDEO]:null,[C.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new v),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=_.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[C.AUDIO]=null,e[C.VIDEO]=null,e[C.AUDIOVIDEO]=null}}function Se(a){return a.sn!=="initSegment"}class Re extends Y{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(A(e)&&A(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1){const i=this._decryptdata=this.levelkeys[n[0]]||null;if(i)return i.getDecryptData(this.sn)}}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=A(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){var t;const n=Object.keys(this.levelkeys),i=n.length;if(i>1||i===1&&(t=this.levelkeys[n[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!A(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Se(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class Ye extends Y{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function He(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||He(t,e)}}function ot(a,e){const t=He(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const dt=Math.pow(2,32)-1,Me=[].push,ht={video:1,audio:2,id3:3,text:4};function Oe(a){return String.fromCharCode.apply(null,a)}function mt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function ze(a,e){const t=se(a,e);return t<0?4294967296+t:t}function ke(a,e){let t=ze(a,e);return t*=Math.pow(2,32),t+=ze(a,e+4),t}function se(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Q(a){const e=a.byteLength;for(let t=0;t<e;){const n=ze(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 $(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=ze(a,i),s=Oe(a.subarray(i+4,i+8)),o=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=$(a.subarray(i+8,o),e.slice(1));c.length&&Me.apply(t,c)}i=o}return t}function de(a){const e=[],t=a[0];let n=8;const i=ze(a,n);n+=4;let r=0,s=0;t===0?(r=ze(a,n),s=ze(a,n+4),n+=8):(r=ke(a,n),s=ke(a,n+8),n+=16),n+=2;let o=a.length+s;const c=mt(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const h=ze(a,f);f+=4;const p=h&2147483647;if((h&2147483648)>>>31===1)return J.warn("SIDX has hierarchical references (not supported)"),null;const E=ze(a,f);f+=4,e.push({referenceSize:p,subsegmentDuration:E,info:{duration:E/i,start:o,end:o+p-1}}),o+=p,f+=4,n=f}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function we(a){const e=[],t=$(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=$(r,["tkhd"])[0];if(s){let o=s[0];const c=ze(s,o===0?12:20),u=$(r,["mdia","mdhd"])[0];if(u){o=u[0];const f=ze(u,o===0?12:20),h=$(r,["mdia","hdlr"])[0];if(h){const p=Oe(h.subarray(8,12)),b={soun:C.AUDIO,vide:C.VIDEO}[p],E=$(r,["mdia","minf","stbl","stsd"])[0],D=Ce(E);b?(e[c]={timescale:f,type:b,stsd:D},e[b]=y({timescale:f,id:c},D)):e[c]={timescale:f,type:p,stsd:D}}}}}return $(a,["moov","mvex","trex"]).forEach(i=>{const r=ze(i,4),s=e[r];s&&(s.default={duration:ze(i,12),flags:ze(i,20)})}),e}function Ce(a){const e=a.subarray(8),t=e.subarray(86),n=Oe(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const u=$(e,[n])[0].subarray(n==="enca"?28:78);$(u,["sinf"]).forEach(h=>{const p=$(h,["schm"])[0];if(p){const b=Oe(p.subarray(4,8));if(b==="cbcs"||b==="cenc"){const E=$(h,["frma"])[0];E&&(i=Oe(E))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=$(t,["avcC"])[0];c&&c.length>3&&(i+="."+Ee(c[1])+Ee(c[2])+Ee(c[3]),r=P(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=$(e,[n])[0],u=$(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=ge(u,f),f+=2;const h=u[f++];if(h&128&&(f+=2),h&64&&(f+=u[f++]),u[f++]!==4)break;f=ge(u,f);const p=u[f++];if(p===64)i+="."+Ee(p);else break;if(f+=12,u[f++]!==5)break;f=ge(u,f);const b=u[f++];let E=(b&248)>>3;E===31&&(E+=1+((b&7)<<3)+((u[f]&224)>>5)),i+="."+E}break}case"hvc1":case"hev1":{const c=$(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],h=u&31,p=ze(c,2),b=(u&32)>>5?"H":"L",E=c[12],D=c.subarray(6,12);i+="."+f+h,i+="."+te(p).toString(16).toUpperCase(),i+="."+b+E;let w="";for(let j=D.length;j--;){const fe=D[j];(fe||w)&&(w="."+fe.toString(16).toUpperCase()+w)}i+=w}r=P(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=P(i,t)||i;break}case"vp09":{const c=$(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],h=c[6]>>4&15;i+="."+Te(u)+"."+Te(f)+"."+Te(h)}break}case"av01":{const c=$(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,h=c[2]>>>7?"H":"M",p=(c[2]&64)>>6,b=(c[2]&32)>>5,E=u===2&&p?b?12:10:p?10:8,D=(c[2]&16)>>4,w=(c[2]&8)>>3,j=(c[2]&4)>>2,fe=c[2]&3;i+="."+u+"."+Te(f)+h+"."+Te(E)+"."+D+"."+w+j+fe+"."+Te(1)+"."+Te(1)+"."+Te(1)+"."+0,r=P("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function P(a,e){const t=$(e,["dvvC"]),n=t.length?t[0]:$(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+Te(i)+"."+Te(r)}}function te(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function ge(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function Ee(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function Te(a){return(a<10?"0":"")+a}function Ue(a,e){if(!a||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&$(a,["moov","trak"]).forEach(i=>{const s=$(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=$(s,["enca"]);const c=o.length>0;c||(o=$(s,["encv"])),o.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);$(f,["sinf"]).forEach(p=>{const b=et(p);if(b){const E=b.subarray(8,24);E.some(D=>D!==0)||(J.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${K.hexDump(E)} -> ${K.hexDump(t)}`),b.set(t,8))}})})})}function et(a){const e=$(a,["schm"])[0];if(e){const t=Oe(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return $(a,["schi","tenc"])[0]}return null}function Ne(a,e,t){const n={},i=$(a,["moof","traf"]);for(let r=0;r<i.length;r++){const s=i[r],o=$(s,["tfhd"])[0],c=ze(o,4),u=e[c];if(!u)continue;n[c]||(n[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});const f=n[c],h=$(s,["tfdt"])[0];if(h){const ae=h[0];let Pe=ze(h,4);ae===1&&(Pe===dt?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Pe*=dt+1,Pe+=ze(h,8))),A(Pe)&&(!A(f.start)||Pe<f.start)&&(f.start=Pe)}const p=u.default,b=ze(o,0)|(p==null?void 0:p.flags);let E=(p==null?void 0:p.duration)||0;b&8&&(b&2?E=ze(o,12):E=ze(o,8));const D=$(s,["trun"]);let w=f.start||0,j=0,fe=E;for(let ae=0;ae<D.length;ae++){const Pe=D[ae],Ve=ze(Pe,4),ut=f.sampleCount;f.sampleCount+=Ve;const Be=Pe[3]&1,Xe=Pe[3]&4,Je=Pe[2]&1,$e=Pe[2]&2,At=Pe[2]&4,ln=Pe[2]&8;let Sn=8,On=Ve;for(Be&&(Sn+=4),Xe&&Ve&&(!(Pe[Sn+1]&1)&&f.keyFrameIndex===void 0&&(f.keyFrameIndex=ut),Sn+=4,Je?(fe=ze(Pe,Sn),Sn+=4):fe=E,$e&&(Sn+=4),ln&&(Sn+=4),w+=fe,j+=fe,On--);On--;)Je?(fe=ze(Pe,Sn),Sn+=4):fe=E,$e&&(Sn+=4),At&&(Pe[Sn+1]&1||f.keyFrameIndex===void 0&&(f.keyFrameIndex=f.sampleCount-(On+1),f.keyFrameStart=w),Sn+=4),ln&&(Sn+=4),w+=fe,j+=fe;!j&&E&&(j+=E*Ve)}f.duration+=j}if(!Object.keys(n).some(r=>n[r].duration)){let r=1/0,s=0;const o=$(a,["sidx"]);for(let c=0;c<o.length;c++){const u=de(o[c]);if(u!=null&&u.references){r=Math.min(r,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((h,p)=>h+p.info.duration||0,0);s=Math.max(s,f+u.earliestPresentationTime/u.timescale)}}s&&A(s)&&Object.keys(n).forEach(c=>{n[c].duration||(n[c].duration=s*n[c].timescale-n[c].start)})}return n}function De(a){const e={valid:null,remainder:null},t=$(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function Ke(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function _t(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return $(n,["moof"]).map(c=>{const u=c.byteOffset-8;$(c,["traf"]).map(h=>{const p=$(h,["tfdt"]).map(b=>{const E=b[0];let D=ze(b,4);return E===1&&(D*=Math.pow(2,32),D+=ze(b,8)),D/i})[0];return p!==void 0&&(a=p),$(h,["tfhd"]).map(b=>{const E=ze(b,4),D=ze(b,0)&16777215,w=(D&1)!==0,j=(D&2)!==0,fe=(D&8)!==0;let ae=0;const Pe=(D&16)!==0;let Ve=0;const ut=(D&32)!==0;let Be=8;E===r&&(w&&(Be+=8),j&&(Be+=4),fe&&(ae=ze(b,Be),Be+=4),Pe&&(Ve=ze(b,Be),Be+=4),ut&&(Be+=4),e.type==="video"&&(s=nt(e.codec)),$(h,["trun"]).map(Xe=>{const Je=Xe[0],$e=ze(Xe,0)&16777215,At=($e&1)!==0;let ln=0;const Sn=($e&4)!==0,On=($e&256)!==0;let wn=0;const nn=($e&512)!==0;let In=0;const hn=($e&1024)!==0,Cn=($e&2048)!==0;let Zn=0;const an=ze(Xe,4);let on=8;At&&(ln=ze(Xe,on),on+=4),Sn&&(on+=4);let ii=ln+u;for(let Si=0;Si<an;Si++){if(On?(wn=ze(Xe,on),on+=4):wn=ae,nn?(In=ze(Xe,on),on+=4):In=Ve,hn&&(on+=4),Cn&&(Je===0?Zn=ze(Xe,on):Zn=se(Xe,on),on+=4),e.type===C.VIDEO){let si=0;for(;si<In;){const mi=ze(n,ii);if(ii+=4,lt(s,n[ii])){const Ji=n.subarray(ii,ii+mi);ye(Ji,s?2:1,a+Zn/i,t)}ii+=mi,si+=mi+4}}a+=wn/i}}))})})}),t}function nt(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function lt(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function ye(a,e,t,n){const i=wt(a);let r=0;r+=e;let s=0,o=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const u=i.length-r;let f=r;if(o<u)r+=o;else if(o>u){J.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(i[f++]===181){const p=mt(i,f);if(f+=2,p===49){const b=ze(i,f);if(f+=4,b===1195456820){const E=i[f++];if(E===3){const D=i[f++],w=31&D,j=64&D,fe=j?2+w*3:0,ae=new Uint8Array(fe);if(j){ae[0]=D;for(let Pe=1;Pe<fe;Pe++)ae[Pe]=i[f++]}n.push({type:E,payloadType:s,pts:t,bytes:ae})}}}}}else if(s===5&&o>16){const h=[];for(let E=0;E<16;E++){const D=i[f++].toString(16);h.push(D.length==1?"0"+D:D),(E===3||E===5||E===7||E===9)&&h.push("-")}const p=o-16,b=new Uint8Array(p);for(let E=0;E<p;E++)b[E]=i[f++];n.push({payloadType:s,pts:t,uuid:h.join(""),userData:Ze(b),userDataBytes:b})}}}function wt(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 Qe(a){const e=a[0];let t="",n="",i=0,r=0,s=0,o=0,c=0,u=0;if(e===0){for(;Oe(a.subarray(u,u+1))!=="\0";)t+=Oe(a.subarray(u,u+1)),u+=1;for(t+=Oe(a.subarray(u,u+1)),u+=1;Oe(a.subarray(u,u+1))!=="\0";)n+=Oe(a.subarray(u,u+1)),u+=1;n+=Oe(a.subarray(u,u+1)),u+=1,i=ze(a,12),r=ze(a,16),o=ze(a,20),c=ze(a,24),u=28}else if(e===1){u+=4,i=ze(a,u),u+=4;const h=ze(a,u);u+=4;const p=ze(a,u);for(u+=4,s=ol(2,32)*h+p,ue(s)||(s=Number.MAX_SAFE_INTEGER,J.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=ze(a,u),u+=4,c=ze(a,u),u+=4;Oe(a.subarray(u,u+1))!=="\0";)t+=Oe(a.subarray(u,u+1)),u+=1;for(t+=Oe(a.subarray(u,u+1)),u+=1;Oe(a.subarray(u,u+1))!=="\0";)n+=Oe(a.subarray(u,u+1)),u+=1;n+=Oe(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:c,payload:f}}function We(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 Mt(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),We([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t)}const $t=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),rt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Jt(a,e){const t=rt[e];return!!t&&!!t[a.slice(0,4)]}function Tn(a,e,t=!0){return!a.split(",").some(n=>!It(n,e,t))}function It(a,e,t=!0){var n;const i=X(t);return(n=i==null?void 0:i.isTypeSupported(en(a,e)))!=null?n:!1}function en(a,e){return`${e}/mp4;codecs=${a}`}function Ie(a){if(a){const e=a.substring(0,4);return rt.video[e]}return 2}function ve(a){const e=$t();return a.split(",").reduce((t,n)=>{const r=e&&nt(n)?9:rt.video[n];return r?(r*2+t)/(t?3:2):(rt.audio[n]+t)/(t?2:1)},0)}const be={};function M(a,e=!0){if(be[a])return be[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var n;if(It(t[i],"audio",e))return be[a]=t[i],t[i];if(t[i]==="mp3"&&(n=X(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const Z=/flac|opus|mp4a\.40\.34/i;function ie(a,e=!0){return a.replace(Z,t=>M(t.toLowerCase(),e))}function le(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)Jt(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function _e(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(it(a,"audio")||it(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function it(a,e){return Jt(a,e)&&It(a,e)}function bt(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Ct(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function zt(a){const e=X(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function En(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Dn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function dn(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}function un(a,e,t,n,i,r){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=r==null?void 0:r.audioCodec,u=r==null?void 0:r.channels,f=u?parseInt(u):c?1/0:2;let h=null;if(o!=null&&o.length)try{o.length===1&&o[0]?h=e.groups[o[0]].channels:h=o.reduce((p,b)=>{if(b){const E=e.groups[b];if(!E)throw new Error(`Audio track group ${b} not found`);Object.keys(E.channels).forEach(D=>{p[D]=(p[D]||0)+E.channels[D]})}return p},{2:0})}catch(p){return!0}return s!==void 0&&(s.split(",").some(p=>nt(p))||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))||!!h&&A(f)&&Object.keys(h).some(p=>parseInt(p)>f)}function Fn(a,e,t,n={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(Dn);const r=[],s=Vn(a),o=s.length,c=Nn(a,e,o>0),u=c.length;for(let f=o||1*u||1;f--;){const h={type:"media-source"};if(o&&(h.video=s[f%o]),u){h.audio=c[f%u];const p=h.audio.bitrate;h.video&&p&&(h.video.bitrate-=p)}r.push(h)}if(i){const f=navigator.userAgent;if(i.split(",").some(h=>nt(h))&&$t())return Promise.resolve(dn(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${f})`),r))}return Promise.all(r.map(f=>{const h=at(f);return n[h]||(n[h]=t.decodingInfo(f))})).then(f=>({supported:!f.some(h=>!h.supported),configurations:r,decodingInfoResults:f})).catch(f=>({supported:!1,configurations:r,decodingInfoResults:[],error:f}))}function Vn(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),n=Rt(a),i=a.width||640,r=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const u={contentType:en(Ct(c),"video"),width:i,height:r,bitrate:n,framerate:s};return o!=="sdr"&&(u.transferFunction=o),u}):[]}function Nn(a,e,t){var n;const i=(n=a.audioCodec)==null?void 0:n.split(","),r=Rt(a);return i&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var c;const u=o?(c=e.groups[o])==null?void 0:c.tracks:null;return u?u.reduce((f,h)=>{if(h.groupId===o){const p=parseFloat(h.channels||"");i.forEach(b=>{const E={contentType:en(b,"audio"),bitrate:t?zn(b,r):r};p&&(E.channels=""+p),f.push(E)})}return f},s):s},[]):[]}function zn(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function Rt(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function at(a){let e="";const{audio:t,video:n}=a;if(n){const i=En(n.contentType);e+=`${i}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const i=En(t.contentType);e+=`${n?"_":""}${i}_c${t.channels}`}return e}const Kt=["NONE","TYPE-0","TYPE-1",null];function xn(a){return Kt.indexOf(a)>-1}const $n=["SDR","PQ","HLG"];function me(a){return!!a&&$n.indexOf(a)>-1}var pe={No:"",Yes:"YES",v2:"v2"};function vt(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?pe.v2:pe.Yes:pe.No}class qe{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 pt{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Dt(this._audioGroups,e)}hasSubtitleGroup(e){return Dt(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 Dt(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Pt(){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 Tt(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||$n.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Pt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Bt=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},tt=(a,e)=>JSON.stringify(a,Bt(e));function Ot(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,c=i==null?void 0:i.videoCodec,u=s&&parseInt(s)===2;let f=!1,h=!1,p=1/0,b=1/0,E=1/0,D=1/0,w=0,j=[];const{preferHDR:fe,allowedVideoRanges:ae}=Tt(e,i);for(let Xe=r.length;Xe--;){const Je=a[r[Xe]];f||(f=Je.channels[2]>0),p=Math.min(p,Je.minHeight),b=Math.min(b,Je.minFramerate),E=Math.min(E,Je.minBitrate),ae.filter(At=>Je.videoRanges[At]>0).length>0&&(h=!0)}p=A(p)?p:0,b=A(b)?b:0;const Pe=Math.max(1080,p),Ve=Math.max(30,b);E=A(E)?E:t,t=Math.max(E,t),h||(e=void 0);const ut=r.length>1;return{codecSet:r.reduce((Xe,Je)=>{const $e=a[Je];if(Je===Xe)return Xe;if(j=h?ae.filter(At=>$e.videoRanges[At]>0):[],ut){if($e.minBitrate>t)return Ft(Je,`min bitrate of ${$e.minBitrate} > current estimate of ${t}`),Xe;if(!$e.hasDefaultAudio)return Ft(Je,"no renditions with default or auto-select sound found"),Xe;if(o&&Je.indexOf(o.substring(0,4))%5!==0)return Ft(Je,`audio codec preference "${o}" not found`),Xe;if(s&&!u){if(!$e.channels[s])return Ft(Je,`no renditions with ${s} channel sound found (channels options: ${Object.keys($e.channels)})`),Xe}else if((!o||u)&&f&&$e.channels[2]===0)return Ft(Je,"no renditions with stereo sound found"),Xe;if($e.minHeight>Pe)return Ft(Je,`min resolution of ${$e.minHeight} > maximum of ${Pe}`),Xe;if($e.minFramerate>Ve)return Ft(Je,`min framerate of ${$e.minFramerate} > maximum of ${Ve}`),Xe;if(!j.some(At=>$e.videoRanges[At]>0))return Ft(Je,`no variants with VIDEO-RANGE of ${tt(j)} found`),Xe;if(c&&Je.indexOf(c.substring(0,4))%5!==0)return Ft(Je,`video codec preference "${c}" not found`),Xe;if($e.maxScore<w)return Ft(Je,`max score of ${$e.maxScore} < selected max of ${w}`),Xe}return Xe&&(ve(Je)>=ve(Xe)||$e.fragmentError>a[Xe].fragmentError)?Xe:(D=$e.minIndex,w=$e.maxScore,Je)},void 0),videoRanges:j,preferHDR:fe,minFramerate:b,minBitrate:E,minIndex:D}}function Ft(a,e){J.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Lt(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 gt(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const u=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(f=>{if(!f)return;const h=e.groups[f];h&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(p=>{c.channels[p]=(c.channels[p]||0)+h.channels[p]}))}),i},{})}function ce(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}}function Le(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(Fe(a,i,t))return n}return-1}function Fe(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||Ge(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||ct(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function Ge(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function ct(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function ft(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 Et(a,e,t,n,i){const r=e[n],o=e.reduce((p,b,E)=>{const D=b.uri;return(p[D]||(p[D]=[])).push(E),p},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const c=r.videoRange,u=r.frameRate,f=r.codecSet.substring(0,4),h=Ut(e,n,p=>{if(p.videoRange!==c||p.frameRate!==u||p.codecSet.substring(0,4)!==f)return!1;const b=p.audioGroups,E=t.filter(D=>!b||b.indexOf(D.groupId)!==-1);return Le(a,E,i)>-1});return h>-1?h:Ut(e,n,p=>{const b=p.audioGroups,E=t.filter(D=>!b||b.indexOf(D.groupId)!==-1);return Le(a,E,i)>-1})}function Ut(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function Gt(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Yt extends N{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!i||!c)return;const u=performance.now(),f=r?r.stats:i.stats,h=r?r.duration:i.duration,p=u-f.loading.start,b=s.minAutoLevel,E=i.level,D=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||E<=b){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const w=D>-1&&D!==E,j=!!t||w;if(!j&&(c.paused||!c.playbackRate||!c.readyState))return;const fe=s.mainForwardBufferInfo;if(!j&&fe===null)return;const ae=this.bwEstimator.getEstimateTTFB(),Pe=Math.abs(c.playbackRate);if(p<=Math.max(ae,1e3*(h/(Pe*2))))return;const Ve=fe?fe.len/Pe:0,ut=f.loading.first?f.loading.first-f.loading.start:-1,Be=f.loaded&&ut>-1,Xe=this.getBwEstimate(),Je=s.levels,$e=Je[E],At=Math.max(f.loaded,Math.round(h*(i.bitrate||$e.averageBitrate)/8));let ln=Be?p-ut:p;ln<1&&Be&&(ln=Math.min(p,f.loaded*8/Xe));const Sn=Be?f.loaded*1e3/ln:0,On=ae/1e3,wn=Sn?(At-f.loaded)/Sn:At*8/Xe+On;if(wn<=Ve)return;const nn=Sn?Sn*8:Xe,In=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,hn=this.hls.config.abrBandWidthUpFactor;let Cn=Number.POSITIVE_INFINITY,Zn;for(Zn=E-1;Zn>b;Zn--){const Si=Je[Zn].maxBitrate,si=!Je[Zn].details||In;if(Cn=this.getTimeToLoadFrag(On,nn,h*Si,si),Cn<Math.min(Ve,h+On))break}if(Cn>=wn||Cn>h*10)return;Be?this.bwEstimator.sample(p-Math.min(ae,ut),f.loaded):this.bwEstimator.sampleTTFB(p);const an=Je[Zn].maxBitrate;this.getBwEstimate()*hn>an&&this.resetEstimator(an);const on=this.findBestLevel(an,b,Zn,0,Ve,1,1);on>-1&&(Zn=on),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${E} is loading too slowly;
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
Time to underbuffer: ${Ve.toFixed(3)} s
|
|
Estimated load time for current fragment: ${wn.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Cn.toFixed(3)} s
|
|
TTFB estimate: ${ut|0} ms
|
|
Current BW estimate: ${A(Xe)?Xe|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Zn} @ ${an|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Zn,this.clearTimer();const ii=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Zn&&Zn>0){const Si=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Zn>0?"and switching down":""}
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
Time to underbuffer: ${Si.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Zn>b){let si=this.findBestLevel(this.hls.levels[b].bitrate,b,Zn,0,Si,1,1);si===-1&&(si=b),this.hls.nextLoadLevel=this.hls.nextAutoLevel=si,this.resetEstimator(this.hls.levels[si].bitrate)}}};w||wn>Cn*2?ii():this.timer=self.setInterval(ii,Cn*1e3),s.trigger(g.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:f})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new S(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(g.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},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 F.BUFFER_ADD_CODEC_ERROR:case F.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case F.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),o=r?r.stats:n.stats,c=s-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const h=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(h,u),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?e+this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;A(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===q.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(g.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!==q.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:s}=n,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=r.abrBandWidthFactor,h=r.abrBandWidthUpFactor;if(u){const w=this.findBestLevel(c,s,i,u,0,f,h);if(w>=0)return this.rebufferNotice=-1,w}let p=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!u){const w=this.bitrateTestDelay;w&&(p=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-w,this.info(`bitrate test took ${Math.round(1e3*w)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),f=h=1)}const b=this.findBestLevel(c,s,i,u,p,f,h);if(this.rebufferNotice!==b&&(this.rebufferNotice=b,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${b}`)),b>-1)return b;const E=n.levels[s],D=n.loadLevelObj;return D&&(E==null?void 0:E.bitrate)<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,o){var c;const u=i+r,f=this.lastLoadedFragLevel,h=f===-1?this.hls.firstLevel:f,{fragCurrent:p,partCurrent:b}=this,{levels:E,allAudioTracks:D,loadLevel:w,config:j}=this.hls;if(E.length===1)return 0;const fe=E[h],ae=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Pe=w===-1||f===-1;let Ve,ut="SDR",Be=(fe==null?void 0:fe.frameRate)||0;const{audioPreference:Xe,videoPreference:Je}=j,$e=this.audioTracksByGroup||(this.audioTracksByGroup=Lt(D));let At=-1;if(Pe){if(this.firstSelection!==-1)return this.firstSelection;const nn=this.codecTiers||(this.codecTiers=gt(E,$e,t,n)),In=Ot(nn,ut,e,Xe,Je),{codecSet:hn,videoRanges:Cn,minFramerate:Zn,minBitrate:an,minIndex:on,preferHDR:ii}=In;At=on,Ve=hn,ut=ii?Cn[Cn.length-1]:Cn[0],Be=Zn,e=Math.max(e,an),this.log(`picked start tier ${tt(In)}`)}else Ve=fe==null?void 0:fe.codecSet,ut=fe==null?void 0:fe.videoRange;const ln=b?b.duration:p?p.duration:0,Sn=this.bwEstimator.getEstimateTTFB()/1e3,On=[];for(let nn=n;nn>=t;nn--){var wn;const In=E[nn],hn=nn>h;if(!In)continue;if(j.useMediaCapabilities&&!In.supportedResult&&!In.supportedPromise){const si=navigator.mediaCapabilities;typeof(si==null?void 0:si.decodingInfo)=="function"&&un(In,$e,ut,Be,e,Xe)?(In.supportedPromise=Fn(In,$e,si,this.supportedCache),In.supportedPromise.then(mi=>{if(!this.hls)return;In.supportedResult=mi;const Ji=this.hls.levels,Yi=Ji.indexOf(In);mi.error?this.warn(`MediaCapabilities decodingInfo error: "${mi.error}" for level ${Yi} ${tt(mi)}`):mi.supported?mi.decodingInfoResults.some(vr=>vr.smooth===!1||vr.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Yi} not smooth or powerEfficient: ${tt(mi)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Yi} ${tt(mi)}`),Yi>-1&&Ji.length>1&&(this.log(`Removing unsupported level ${Yi}`),this.hls.removeLevel(Yi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):In.supportedResult=Dn}if((Ve&&In.codecSet!==Ve||ut&&In.videoRange!==ut||hn&&Be>In.frameRate||!hn&&Be>0&&Be<In.frameRate||(wn=In.supportedResult)!=null&&(wn=wn.decodingInfoResults)!=null&&wn.some(si=>si.smooth===!1))&&(!Pe||nn!==At)){On.push(nn);continue}const Cn=In.details,Zn=(b?Cn==null?void 0:Cn.partTarget:Cn==null?void 0:Cn.averagetargetduration)||ln;let an;hn?an=o*e:an=s*e;const on=ln&&i>=ln*2&&r===0?In.averageBitrate:In.maxBitrate,ii=this.getTimeToLoadFrag(Sn,an,on*Zn,Cn===void 0);if(an>=on&&(nn===f||In.loadError===0&&In.fragmentError===0)&&(ii<=Sn||!A(ii)||ae&&!this.bitrateTestDelay||ii<u)){const si=this.forcedAutoLevel;return nn!==w&&(si===-1||si!==w)&&(On.length&&this.trace(`Skipped level(s) ${On.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${E[On[0]].codecs}" ${E[On[0]].videoRange}; not compatible with "${Ve}" ${ut}`),this.info(`switch candidate:${h}->${nn} adjustedbw(${Math.round(an)})-bitrate=${Math.round(an-on)} ttfb:${Sn.toFixed(1)} avgDuration:${Zn.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${ii.toFixed(1)} firstSelection:${Pe} codecSet:${In.codecSet} videoRange:${In.videoRange} hls.loadLevel:${w}`)),Pe&&(this.firstSelection=nn),nn}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const kn={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 qt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!A(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;for(let r=0;r<a.length;++r){const s=a[r];if(mn(e,t,s))return s}return null}function Zt(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&gn(t,n,r)===0||fn(r,a,Math.min(i,n))))return r;const s=kn.search(e,gn.bind(null,t,n));return s&&(s!==a||!r)?s:r}function fn(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 gn(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 mn(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Xt(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let n=a.fragments;const{fragmentHint:i}=a;i&&(n=n.concat(i));let r;return kn.search(n,s=>s.cc<e?1:s.cc>e?-1:(r=s,s.end<=t?1:s.start>t?-1:0)),r||null}return null}function Qt(a){switch(a.details){case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_TIMEOUT:case F.LEVEL_LOAD_TIMEOUT:case F.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function kt(a,e){const t=Qt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Nt(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Vt(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function pn(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(cn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function cn(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Ht={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Mn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Hn extends N{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(g.ERROR,this.onError,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(g.ERROR,this.onError,this),e.off(g.ERROR,this.onErrorOut,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.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)===q.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case F.FRAG_LOAD_ERROR:case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_ERROR:case F.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case F.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=qn();return}case F.FRAG_GAP:case F.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Ht.SendAlternateToPenaltyBox;return}case F.LEVEL_EMPTY_ERROR:case F.LEVEL_PARSING_ERROR:{var s;const c=t.parent===q.MAIN?t.level:i.loadLevel;t.details===F.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(s=s.levelDetails)!=null&&s.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case F.LEVEL_LOAD_ERROR:case F.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case F.AUDIO_TRACK_LOAD_ERROR:case F.AUDIO_TRACK_LOAD_TIMEOUT:case F.SUBTITLE_LOAD_ERROR:case F.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=i.loadLevelObj;if(c&&(r.type===oe.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===oe.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Ht.SendAlternateToPenaltyBox,t.errorAction.flags=Mn.MoveAllAlternatesMatchingHost;return}}return;case F.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=i.loadLevelObj,u=c==null?void 0:c.attrs["HDCP-LEVEL"];u?t.errorAction={action:Ht.SendAlternateToPenaltyBox,flags:Mn.MoveAllAlternatesMatchingHDCP,hdcpLevel:u}:this.keySystemError(t)}return;case F.BUFFER_ADD_CODEC_ERROR:case F.REMUX_ALLOC_ERROR:case F.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case F.INTERNAL_EXCEPTION:case F.BUFFER_APPENDING_ERROR:case F.BUFFER_FULL_ERROR:case F.LEVEL_SWITCH_ERROR:case F.BUFFER_STALLED_ERROR:case F.BUFFER_SEEK_OVER_HOLE:case F.BUFFER_NUDGE_ON_STALL:t.errorAction=qn();return}t.type===ne.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=kt(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(pn(i,r,Qt(e),e.response))return{action:Ht.RetryRequest,flags:Mn.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,o=kt(e.details.startsWith("key")?s:r,e),c=t.levels.reduce((f,h)=>f+h.fragmentError,0);if(i&&(e.details!==F.FRAG_GAP&&i.fragmentError++,pn(o,c,Qt(e),e.response)))return{action:Ht.RetryRequest,flags:Mn.None,retryConfig:o,retryCount:c};const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const u=e.details;i.loadError++,u===F.BUFFER_APPEND_ERROR&&i.fragmentError++;let f=-1;const{levels:h,loadLevel:p,minAutoLevel:b,maxAutoLevel:E}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const D=(r=e.frag)==null?void 0:r.type,j=(D===q.AUDIO&&u===F.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===F.BUFFER_ADD_CODEC_ERROR||u===F.BUFFER_APPEND_ERROR))&&h.some(({audioCodec:ut})=>i.audioCodec!==ut),ae=e.sourceBufferName==="video"&&(u===F.BUFFER_ADD_CODEC_ERROR||u===F.BUFFER_APPEND_ERROR)&&h.some(({codecSet:ut,audioCodec:Be})=>i.codecSet!==ut&&i.audioCodec===Be),{type:Pe,groupId:Ve}=(s=e.context)!=null?s:{};for(let ut=h.length;ut--;){const Be=(ut+p)%h.length;if(Be!==p&&Be>=b&&Be<=E&&h[Be].loadError===0){var o,c;const Xe=h[Be];if(u===F.FRAG_GAP&&D===q.MAIN&&e.frag){const Je=h[Be].details;if(Je){const $e=Zt(e.frag,Je.fragments,e.frag.start);if($e!=null&&$e.gap)continue}}else{if(Pe===oe.AUDIO_TRACK&&Xe.hasAudioGroup(Ve)||Pe===oe.SUBTITLE_TRACK&&Xe.hasSubtitleGroup(Ve))continue;if(D===q.AUDIO&&(o=i.audioGroups)!=null&&o.some(Je=>Xe.hasAudioGroup(Je))||D===q.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(Je=>Xe.hasSubtitleGroup(Je))||j&&i.audioCodec===Xe.audioCodec||ae&&i.codecSet===Xe.codecSet||!j&&i.codecSet!==Xe.codecSet)continue}f=Be;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:Ht.SendAlternateToPenaltyBox,flags:Mn.None,nextAutoLevel:f}}return{action:Ht.SendAlternateToPenaltyBox,flags:Mn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Ht.DoNothing:break;case Ht.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==F.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 Ht.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 Mn.None:this.switchLevel(e,s);break;case Mn.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=Kt[Kt.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===F.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=En(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function qn(a){const e={action:Ht.DoNothing,flags:Mn.None};return a&&(e.resolved=!0),e}var vn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class ai{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&&(e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.BUFFER_APPENDED,this.onBufferAppended,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=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;if(r.start<=e&&e<=r.end&&r.loaded)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let s=r.length;s--;){const o=i[r[s]];if((o==null?void 0:o.body.type)===t&&(!n||o.buffered)){const c=o.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const h=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return h&&this.removeFragment(c.body),h})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=ti(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const c=n.elementaryStreams[o];if(!c)return;const u=t[o],f=s||c.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,f,u)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),Qn(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=li(n,i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=ti(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,o=e.end,c=e.minEndPTS||o,u=e.maxStartPTS||s;for(let f=0;f<i.length;f++){const h=i.start(f)-this.bufferPadding,p=i.end(f)+this.bufferPadding;if(u>=h&&c<=p){r.time.push({startPTS:Math.max(s,i.start(f)),endPTS:Math.min(o,i.end(f))});break}else if(s<p&&o>h){const b=Math.max(s,i.start(f)),E=Math.min(o,i.end(f));E>b&&(r.partial=!0,r.time.push({startPTS:b,endPTS:E}))}else if(o<=h)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&Qn(f)&&(i=f.body.start-o,r=f.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Qn(t))}getState(e){const t=ti(e),n=this.fragments[t];return n?n.buffered?Qn(n)?vn.PARTIAL:vn.OK:vn.APPENDING:vn.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=ti(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let u=this.activePartLists[o];u||(this.activePartLists[o]=u=[]),u.push(i)}this.timeRanges=r;const c=r[s];this.detectEvictedFragments(s,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ti(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=ti(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=li(n,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(n=>n.clearElementaryStreamInfo())}}function Qn(a){var e,t,n;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(n=a.range.audiovideo)!=null&&n.partial)}function ti(a){return`${a.type}_${a.level}_${a.sn}`}function li(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var Gn={cbc:0,ctr:1};class _n{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case Gn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Gn.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function xt(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class yt{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],o=n[3],c=this.invSubMix,u=c[0],f=c[1],h=c[2],p=c[3],b=new Uint32Array(256);let E=0,D=0,w=0;for(w=0;w<256;w++)w<128?b[w]=w<<1:b[w]=w<<1^283;for(w=0;w<256;w++){let j=D^D<<1^D<<2^D<<3^D<<4;j=j>>>8^j&255^99,e[E]=j,t[j]=E;const fe=b[E],ae=b[fe],Pe=b[ae];let Ve=b[j]*257^j*16843008;i[E]=Ve<<24|Ve>>>8,r[E]=Ve<<16|Ve>>>16,s[E]=Ve<<8|Ve>>>24,o[E]=Ve,Ve=Pe*16843009^ae*65537^fe*257^E*16843008,u[j]=Ve<<24|Ve>>>8,f[j]=Ve<<16|Ve>>>16,h[j]=Ve<<8|Ve>>>24,p[j]=Ve,E?(E=fe^b[b[b[Pe^fe]]],D^=b[b[D]]):E=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 o,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),h=this.sBox,p=this.rcon,b=this.invSubMix,E=b[0],D=b[1],w=b[2],j=b[3];let fe,ae;for(o=0;o<s;o++){if(o<r){fe=u[o]=t[o];continue}ae=fe,o%r===0?(ae=ae<<8|ae>>>24,ae=h[ae>>>24]<<24|h[ae>>>16&255]<<16|h[ae>>>8&255]<<8|h[ae&255],ae^=p[o/r|0]<<24):r>6&&o%r===4&&(ae=h[ae>>>24]<<24|h[ae>>>16&255]<<16|h[ae>>>8&255]<<8|h[ae&255]),u[o]=fe=(u[o-r]^ae)>>>0}for(c=0;c<s;c++)o=s-c,c&3?ae=u[o]:ae=u[o-4],c<4||o<=4?f[c]=ae:f[c]=E[h[ae>>>24]]^D[h[ae>>>16&255]]^w[h[ae>>>8&255]]^j[h[ae&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,c=o[0],u=o[1],f=o[2],h=o[3],p=this.uint8ArrayToUint32Array_(n);let b=p[0],E=p[1],D=p[2],w=p[3];const j=new Int32Array(e),fe=new Int32Array(j.length);let ae,Pe,Ve,ut,Be,Xe,Je,$e,At,ln,Sn,On,wn,nn;const In=this.networkToHostOrderSwap;for(;t<j.length;){for(At=In(j[t]),ln=In(j[t+1]),Sn=In(j[t+2]),On=In(j[t+3]),Be=At^r[0],Xe=On^r[1],Je=Sn^r[2],$e=ln^r[3],wn=4,nn=1;nn<i;nn++)ae=c[Be>>>24]^u[Xe>>16&255]^f[Je>>8&255]^h[$e&255]^r[wn],Pe=c[Xe>>>24]^u[Je>>16&255]^f[$e>>8&255]^h[Be&255]^r[wn+1],Ve=c[Je>>>24]^u[$e>>16&255]^f[Be>>8&255]^h[Xe&255]^r[wn+2],ut=c[$e>>>24]^u[Be>>16&255]^f[Xe>>8&255]^h[Je&255]^r[wn+3],Be=ae,Xe=Pe,Je=Ve,$e=ut,wn=wn+4;ae=s[Be>>>24]<<24^s[Xe>>16&255]<<16^s[Je>>8&255]<<8^s[$e&255]^r[wn],Pe=s[Xe>>>24]<<24^s[Je>>16&255]<<16^s[$e>>8&255]<<8^s[Be&255]^r[wn+1],Ve=s[Je>>>24]<<24^s[$e>>16&255]<<16^s[Be>>8&255]<<8^s[Xe&255]^r[wn+2],ut=s[$e>>>24]<<24^s[Be>>16&255]<<16^s[Xe>>8&255]<<8^s[Je&255]^r[wn+3],fe[t]=In(ae^b),fe[t+1]=In(ut^E),fe[t+2]=In(Ve^D),fe[t+3]=In(Pe^w),b=At,E=ln,D=Sn,w=On,t=t+4}return fe.buffer}}class Wt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=jt(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function jt(a){switch(a){case Gn.cbc:return"AES-CBC";case Gn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const yn=16;class Un{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?xt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise((r,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,n,i);const c=this.flush();c?r(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:s,remainderData:o}=this;if(i!==Gn.cbc||t.byteLength!==16)return J.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Ke(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new yt),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new Wt(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new _n(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(J.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i)))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%yn;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(J.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Wn=Math.pow(2,17);class Bn{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 ci({type:ne.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(E=>E[0]==="GAP")){c(bi(e));return}else e.gap=!1;const u=this.loader=r?new r(i):new s(i),f=ri(e);e.loader=u;const h=Vt(i.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Wn};e.stats=u.stats;const b={onSuccess:(E,D,w,j)=>{this.resetLoader(e,u);let fe=E.data;w.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(fe.slice(0,16)),fe=fe.slice(16)),o({frag:e,part:null,payload:fe,networkDetails:j})},onError:(E,D,w,j)=>{this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},E),error:new Error(`HTTP Error ${E.code} ${E.text}`),networkDetails:w,stats:j}))},onAbort:(E,D,w)=>{this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:w,stats:E}))},onTimeout:(E,D,w)=>{this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:w,stats:E}))}};t&&(b.onProgress=(E,D,w,j)=>t({frag:e,part:null,payload:w,networkDetails:j})),u.load(f,p,b)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(bi(e,t));return}const u=this.loader=r?new r(i):new s(i),f=ri(e,t);e.loader=u;const h=Vt(i.fragLoadPolicy.default),p={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Wn};t.stats=u.stats,u.load(f,p,{onSuccess:(b,E,D,w)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const j={frag:e,part:t,payload:b.data,networkDetails:w};n(j),o(j)},onError:(b,E,D,w)=>{this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},b),error:new Error(`HTTP Error ${b.code} ${b.text}`),networkDetails:D,stats:w}))},onAbort:(b,E,D)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:D,stats:b}))},onTimeout:(b,E,D)=>{this.resetLoader(e,u),c(new ci({type:ne.NETWORK_ERROR,details:F.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:D,stats:b}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/r),c),h=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+h}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function ri(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(A(i)&&A(r)){var s;let o=i,c=r;if(a.sn==="initSegment"&&_i((s=a.decryptdata)==null?void 0:s.method)){const u=r-i;u%16&&(c=r+(16-u%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=c}return n}function bi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:ne.MEDIA_ERROR,details:F.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new ci(n)}function _i(a){return a==="AES-128"||a==="AES-256"}class ci extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Yn extends N{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class wi{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=Ti(),this.buffering={audio:Ti(),video:Ti(),audiovideo:Ti()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function Ti(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Di={length:0,start:()=>0,end:()=>0};class rn{static isBuffered(e,t){if(e){const n=rn.getBuffered(e);for(let i=n.length;i--;)if(t>=n.start(i)&&t<=n.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=rn.getBuffered(e);return rn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=rn.bufferedRanges(e);if(i.length)return rn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((f,h)=>f.start-h.start||h.end-f.end);let i=-1,r=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(i=f);const h=r.length;if(h){const p=r[h-1].end;e[f].start-p<n?e[f].end>p&&(r[h-1].end=e[f].end):r.push(e[f])}else r.push(e[f])}else r=e;let s=0,o,c=t,u=t;for(let f=0;f<r.length;f++){const h=r[f].start,p=r[f].end;if(i===-1&&t>=h&&t<=p&&(i=f),t+n>=h&&t<p)c=h,u=p,s=u-t;else if(t+n<h){o=h;break}}return{len:s,start:c||0,end:u||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||Di}catch(t){return J.log("failed to get media.buffered",t),Di}}}const gi=/\{\$([a-zA-Z0-9-_]+)\}/g;function hi(a){return gi.test(a)}function Ii(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(gi,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 Fi(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 Ni(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const ki=/^(\d+)x(\d+)$/,Ri=/(.+?)=(".*?"|.*?)(?:,|$)/g;class oi{constructor(e,t){typeof e=="string"&&(e=oi.parseAttrList(e,t)),d(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=ki.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={},r='"';for(Ri.lastIndex=0;(n=Ri.exec(e))!==null;){const s=n[1].trim();let o=n[2];const c=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let u=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))o=Ii(t,o);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":J.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const Oi="com.apple.hls.interstitial";function Xi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Ei(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class ir{constructor(e,t,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:n,t){const r=t.attr;for(const s in r)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==r[s]){J.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=d(new oi({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);A(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(J.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(A(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Oi}get isValid(){return!!this.id&&!this._badValueForSameId&&A(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const rr=10;class Qi{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?A(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||rr}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(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Ui(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Vi(a){switch(a){case"AES-128":case"AES-256":return Gn.cbc;case"AES-256-CTR":return Gn.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function $i(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function xi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Mi(a){const e=xi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Hi(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 Jn(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=$i(s)):t=Mi(s)}}return t}const di=typeof self!="undefined"?self:void 0;var jn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},tn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Pn(a){switch(a){case tn.FAIRPLAY:return jn.FAIRPLAY;case tn.PLAYREADY:return jn.PLAYREADY;case tn.WIDEVINE:return jn.WIDEVINE;case tn.CLEARKEY:return jn.CLEARKEY}}function Rn(a){switch(a){case jn.FAIRPLAY:return tn.FAIRPLAY;case jn.PLAYREADY:return tn.PLAYREADY;case jn.WIDEVINE:return tn.WIDEVINE;case jn.CLEARKEY:return tn.CLEARKEY}}function Ln(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[jn.FAIRPLAY,jn.WIDEVINE,jn.PLAYREADY,jn.CLEARKEY].filter(i=>!!e[i]):[];return!n[jn.WIDEVINE]&&t&&n.push(jn.WIDEVINE),n}const ni=function(a){return di!=null&&(a=di.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function fi(a,e,t,n){let i;switch(a){case jn.FAIRPLAY:i=["cenc","sinf"];break;case jn.WIDEVINE:case jn.PLAYREADY:i=["cenc"];break;case jn.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Wi(i,e,t,n)}function Wi(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 sn(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function An(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=$i(o).subarray(0,16);return Hi(c),c}}return null}let Kn={};class ui{static clearKeyUriToKeyIdMap(){Kn={}}constructor(e,t,n,i=[1],r=null,s){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&&!Ui(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(R(s)))}matches(e){var t,n;return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&e.keyFormatVersions.join(",")===this.keyFormatVersions.join(",")&&((t=e.iv)==null?void 0:t.join(","))===((n=this.iv)==null?void 0:n.join(","))}isSupported(){if(this.method){if(Ui(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case tn.FAIRPLAY:case tn.WIDEVINE:case tn.PLAYREADY:case tn.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(Ui(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(J.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=pi(e);return new ui(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.pssh&&this.keyId)return this;const t=Jn(this.uri);if(t)switch(this.keyFormat){case tn.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const n=t.length-22;this.keyId=t.subarray(n,n+16)}break;case tn.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Mt(n,null,t),this.keyId=An(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=Kn[this.uri];if(!n){const i=Object.keys(Kn).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Kn[this.uri]=n}this.keyId=n}return this}}function pi(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const sr=/#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,zi=/#EXT-X-MEDIA:(.*)/g,fr=/^#EXT(?:INF|-X-TARGETDURATION):/m,Bi=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Ur=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ar{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 _.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return fr.test(e)}static parseMasterPlaylist(e,t){const n=hi(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];sr.lastIndex=0;let s;for(;(s=sr.exec(e))!=null;)if(s[1]){var o;const u=new oi(s[1],i),f=Ii(i,s[2]),h={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:ar.resolve(f,t)},p=u.decimalResolution("RESOLUTION");p&&(h.width=p.width,h.height=p.height),is(u.CODECS,h);const b=u["SUPPLEMENTAL-CODECS"];b&&(h.supplemental={},is(b,h.supplemental)),(o=h.unknownCodecs)!=null&&o.length||r.push(h),i.levels.push(h)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const h=new oi(f,i),p=h["DATA-ID"];p&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[p]=h);break}case"SESSION-KEY":{const h=Hr(f,t,i);h.encrypted&&h.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(h)):J.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const h=new oi(f,i);Fi(i,h,t)}break}case"CONTENT-STEERING":{const h=new oi(f,i);i.contentSteering={uri:ar.resolve(h["SERVER-URI"],t),pathwayId:h["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=kr(f);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,o={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(zi.lastIndex=0;(i=zi.exec(e))!==null;){const u=new oi(i[1],n),f=u.TYPE;if(f){const h=o[f],p=r[f]||[];r[f]=p;const b=u.LANGUAGE,E=u["ASSOC-LANGUAGE"],D=u.CHANNELS,w=u.CHARACTERISTICS,j=u["INSTREAM-ID"],fe={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||b||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:b,url:u.URI?ar.resolve(u.URI,t):""};if(E&&(fe.assocLang=E),D&&(fe.channels=D),w&&(fe.characteristics=w),j&&(fe.instreamId=j),h!=null&&h.length){const ae=ar.findGroup(h,fe.groupId)||h[0];$r(fe,ae,"audioCodec"),$r(fe,ae,"textCodec")}p.push(fe)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const c={url:t},u=new Qi(t),f=u.fragments,h=[];let p=null,b=0,E=0,D=0,w=0,j=0,fe=null,ae=new Re(i,c),Pe,Ve,ut,Be=-1,Xe=!1,Je=null,$e;if(Bi.lastIndex=0,u.m3u8=e,u.hasVariableRefs=hi(e),((o=Bi.exec(e))==null?void 0:o[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Pe=Bi.exec(e))!==null;){Xe&&(Xe=!1,ae=new Re(i,c),ae.playlistOffset=D,ae.setStart(D),ae.sn=b,ae.cc=w,j&&(ae.bitrate=j),ae.level=n,p&&(ae.initSegment=p,p.rawProgramDateTime&&(ae.rawProgramDateTime=p.rawProgramDateTime,p.rawProgramDateTime=null),Je&&(ae.setByteRange(Je),Je=null)));const On=Pe[1];if(On){ae.duration=parseFloat(On);const wn=(" "+Pe[2]).slice(1);ae.title=wn||null,ae.tagList.push(wn?["INF",On,wn]:["INF",On])}else if(Pe[3]){if(A(ae.duration)){ae.playlistOffset=D,ae.setStart(D),ut&&Yr(ae,ut,u),ae.sn=b,ae.level=n,ae.cc=w,f.push(ae);const wn=(" "+Pe[3]).slice(1);ae.relurl=Ii(u,wn),Pr(ae,fe,h),fe=ae,D+=ae.duration,b++,E=0,Xe=!0}}else{if(Pe=Pe[0].match(Ur),!Pe){J.warn("No matches on slow regex match for level playlist!");continue}for(Ve=1;Ve<Pe.length&&Pe[Ve]===void 0;Ve++);const wn=(" "+Pe[Ve]).slice(1),nn=(" "+Pe[Ve+1]).slice(1),In=Pe[Ve+2]?(" "+Pe[Ve+2]).slice(1):null;switch(wn){case"BYTERANGE":fe?ae.setByteRange(nn,fe):ae.setByteRange(nn);break;case"PROGRAM-DATE-TIME":ae.rawProgramDateTime=nn,ae.tagList.push(["PROGRAM-DATE-TIME",nn]),Be===-1&&(Be=f.length);break;case"PLAYLIST-TYPE":u.type&&tr(u,wn,Pe),u.type=nn.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?tr(u,wn,Pe):f.length>0&&rs(u,wn,Pe),b=u.startSN=parseInt(nn);break;case"SKIP":{u.skippedSegments&&tr(u,wn,Pe);const hn=new oi(nn,u),Cn=hn.decimalInteger("SKIPPED-SEGMENTS");if(A(Cn)){u.skippedSegments+=Cn;for(let an=Cn;an--;)f.push(null);b+=Cn}const Zn=hn.enumeratedString("RECENTLY-REMOVED-DATERANGES");Zn&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(Zn.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&tr(u,wn,Pe),u.targetduration=Math.max(parseInt(nn),1);break;case"VERSION":u.version!==null&&tr(u,wn,Pe),u.version=parseInt(nn);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||tr(u,wn,Pe),u.live=!1;break;case"#":(nn||In)&&ae.tagList.push(In?[nn,In]:[nn]);break;case"DISCONTINUITY":w++,ae.tagList.push(["DIS"]);break;case"GAP":ae.gap=!0,ae.tagList.push([wn]);break;case"BITRATE":ae.tagList.push([wn,nn]),j=parseInt(nn)*1e3,A(j)?ae.bitrate=j:j=0;break;case"DATERANGE":{const hn=new oi(nn,u),Cn=new ir(hn,u.dateRanges[hn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,Cn.isValid||u.skippedSegments?u.dateRanges[Cn.id]=Cn:J.warn(`Ignoring invalid DATERANGE tag: "${nn}"`),ae.tagList.push(["EXT-X-DATERANGE",nn]);break}case"DEFINE":{{const hn=new oi(nn,u);"IMPORT"in hn?Ni(u,hn,s):Fi(u,hn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?tr(u,wn,Pe):f.length>0&&rs(u,wn,Pe),u.startCC=w=parseInt(nn);break;case"KEY":{const hn=Hr(nn,t,u);if(hn.isSupported()){if(hn.method==="NONE"){ut=void 0;break}ut||(ut={});const Cn=ut[hn.keyFormat];Cn!=null&&Cn.matches(hn)||(Cn&&(ut=d({},ut)),ut[hn.keyFormat]=hn)}else J.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${nn}"`);break}case"START":u.startTimeOffset=kr(nn);break;case"MAP":{const hn=new oi(nn,u);if(ae.duration){const Cn=new Re(i,c);Wr(Cn,hn,n,ut),p=Cn,ae.initSegment=p,p.rawProgramDateTime&&!ae.rawProgramDateTime&&(ae.rawProgramDateTime=p.rawProgramDateTime)}else{const Cn=ae.byteRangeEndOffset;if(Cn){const Zn=ae.byteRangeStartOffset;Je=`${Cn-Zn}@${Zn}`}else Je=null;Wr(ae,hn,n,ut),p=ae,Xe=!0}p.cc=w;break}case"SERVER-CONTROL":{$e&&tr(u,wn,Pe),$e=new oi(nn),u.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),u.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&tr(u,wn,Pe);const hn=new oi(nn);u.partTarget=hn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let hn=u.partList;hn||(hn=u.partList=[]);const Cn=E>0?hn[hn.length-1]:void 0,Zn=E++,an=new oi(nn,u),on=new Ye(an,ae,c,Zn,Cn);hn.push(on),ae.duration+=on.duration;break}case"PRELOAD-HINT":{const hn=new oi(nn,u);u.preloadHint=hn;break}case"RENDITION-REPORT":{const hn=new oi(nn,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(hn);break}default:J.warn(`line parsed but not handled: ${Pe}`);break}}}fe&&!fe.relurl?(f.pop(),D-=fe.duration,u.partList&&(u.fragmentHint=fe)):u.partList&&(Pr(ae,fe,h),ae.cc=w,u.fragmentHint=ae,ut&&Yr(ae,ut,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const At=f.length,ln=f[0],Sn=f[At-1];if(D+=u.skippedSegments*u.targetduration,D>0&&At&&Sn){u.averagetargetduration=D/At;const On=Sn.sn;u.endSN=On!=="initSegment"?On:0,u.live||(Sn.endList=!0),Be>0&&(br(f,Be),ln&&h.unshift(ln))}return u.fragmentHint&&(D+=u.fragmentHint.duration),u.totalduration=D,h.length&&u.dateRangeTagCount&&ln&&ns(h,u),u.endCC=w,u}}function ns(a,e){const t=a.length;if(!t)return;const n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const c=e.dateRanges[r[o]],u=c.startDate.getTime();c.tagAnchor=n.ref;for(let f=t;f--;){var s;if(((s=a[f])==null?void 0:s.sn)<e.startSN)break;const h=Tr(e,u,a,f,i);if(h!==-1){c.tagAnchor=e.fragments[h].ref;break}}}}function Tr(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+c*1e3){const u=t[n].sn-a.startSN;if(u<0)return-1;const f=a.fragments;if(f.length>t.length){const p=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let b=p;b>u;b--){const E=f[b].programDateTime;if(e>=E&&e<E+f[b].duration*1e3)return b}}return u}}}return-1}function Hr(a,e,t){var n,i;const r=new oi(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,c=r.hexadecimalInteger("IV"),u=r.KEYFORMATVERSIONS,f=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!c&&J.error(`Invalid IV: ${r.IV}`);const h=o?ar.resolve(o,e):"",p=(u||"1").split("/").map(Number).filter(Number.isFinite);return new ui(s,h,f,p,c,r.KEYID)}function kr(a){const t=new oi(a).decimalFloatingPoint("TIME-OFFSET");return A(t)?t:null}function is(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Jt(r,n));i.length&&(e[`${n}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function $r(a,e,t){const n=e[t];n&&(a[t]=n)}function br(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 Pr(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Wr(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 Yr(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}function tr(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function rs(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Or(a,e){const t=e.startPTS;if(A(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&i.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function ss(a,e,t,n,i,r,s){n-t<=0&&(s.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let c=t,u=n;const f=e.startPTS,h=e.endPTS;if(A(f)){const j=Math.abs(f-t);a&&j>a.totalduration?s.warn(`media timestamps and playlist times differ by ${j}s for level ${e.level} ${a.url}`):A(e.deltaPTS)?e.deltaPTS=Math.max(j,e.deltaPTS):e.deltaPTS=j,c=Math.max(t,f),t=Math.min(t,f),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,u=Math.min(n,h),n=Math.max(n,h),r=e.endDTS!==void 0?Math.max(r,e.endDTS):r}const p=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=i,e.endPTS=n,e.minEndPTS=u,e.endDTS=r;const b=e.sn;if(!a||b<a.startSN||b>a.endSN)return 0;let E;const D=b-a.startSN,w=a.fragments;for(w[D]=e,E=D;E>0;E--)Or(w[E],w[E-1]);for(E=D;E<w.length-1;E++)Or(w[E],w[E+1]);return a.fragmentHint&&Or(w[w.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,p}function ms(a,e,t){if(a===e)return;let n=null;const i=a.fragments;for(let f=i.length-1;f>=0;f--){const h=i[f].initSegment;if(h){n=h;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;Xr(a,e,(f,h,p,b)=>{if((!e.startCC||e.skippedSegments)&&h.cc!==f.cc){const E=f.cc-h.cc;for(let D=p;D<b.length;D++)b[D].cc+=E;e.endCC=b[b.length-1].cc}A(f.startPTS)&&A(f.endPTS)&&(h.setStart(h.startPTS=f.startPTS),h.startDTS=f.startDTS,h.maxStartPTS=f.maxStartPTS,h.endPTS=f.endPTS,h.endDTS=f.endDTS,h.minEndPTS=f.minEndPTS,h.setDuration(f.endPTS-f.startPTS),h.duration&&(r=h),e.PTSKnown=e.alignedSliding=!0),f.hasStreams&&(h.elementaryStreams=f.elementaryStreams),h.loader=f.loader,f.hasStats&&(h.stats=f.stats),f.initSegment&&(h.initSegment=f.initSegment,n=f.initSegment)});const s=e.fragments,o=e.fragmentHint?s.concat(e.fragmentHint):s;if(n&&o.forEach(f=>{var h;f&&(!f.initSegment||f.initSegment.relurl===((h=n)==null?void 0:h.relurl))&&(f.initSegment=n)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(f=>!f),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let f=e.skippedSegments;f--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=_s(a.dateRanges,e,t));const f=a.fragments.filter(h=>h.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let h=1;h<o.length;h++)o[h].programDateTime===null&&Pr(o[h],o[h-1],f);ns(f,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var c;const f=Gi(a,e.startSN-1);e.startCC=(c=f==null?void 0:f.cc)!=null?c:s[0].cc}vs(a.partList,e.partList,(f,h)=>{h.elementaryStreams=f.elementaryStreams,h.stats=f.stats}),r?ss(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS,t):ei(a,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const u=e.advancedDateTime;if(e.advanced&&u){const f=e.edge;e.driftStart||(e.driftStartTime=u,e.driftStart=f),e.driftEndTime=u,e.driftEnd=f}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function _s(a,e,t){const{dateRanges:n,recentlyRemovedDateranges:i}=e,r=d({},a);i&&i.forEach(c=>{delete r[c]});const o=Object.keys(r).length;return o&&Object.keys(n).forEach(c=>{const u=r[c],f=new ir(n[c].attr,u);f.isValid?(r[c]=f,u||(f.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${tt(n[c].attr)}"`)}),r}function vs(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function Xr(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=i;u<=r;u++){const f=c[s+u];let h=o[u];if(n&&!h&&f&&(h=e.fragments[u]=f),f&&h){if(t(f,h,u,o),f.url&&f.url!==h.url){e.playlistParsingError=hr(`media sequence mismatch ${h.sn}:`,a,e,f,h);return}else if(f.cc!==h.cc){e.playlistParsingError=hr(`discontinuity sequence mismatch (${f.cc}!=${h.cc})`,a,e,f,h);return}}}}function hr(a,e,t,n,i){return new Error(`${a} ${i.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function ei(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=n>=0;let s=0;if(r&&n<i.length)s=i[n].start;else if(r&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(r&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Xn(e,s)}function Xn(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function Ki(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 Gi(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function Ci(a,e,t){return a?Li(a.partList,e,t):null}function Li(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 or(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function Zi(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 Er(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function dr(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function pr(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)dr(t[n],a);e.fragmentHint&&dr(e.fragmentHint,a),e.alignedSliding=!0}function Kr(a,e){a&&(Mr(e,a),e.alignedSliding||as(e,a),!e.alignedSliding&&!e.skippedSegments&&ei(a,e,!1))}function Mr(a,e){if(!Er(e,a))return;const t=Math.min(e.endCC,a.endCC),n=Zi(e.fragments,t),i=Zi(a.fragments,t);if(!n||!i)return;J.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;pr(r,a)}function as(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=Zi(n,s),r=Zi(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=Zi(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,c=r.programDateTime;if(!o||!c)return;const u=(c-o)/1e3-(r.start-i.start);pr(u,a)}const Hs={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}},st={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 vi extends Yn{constructor(e,t,n,i,r){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=st.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:c,mediaBuffer:u,state:f}=this,h=c?c.currentTime:0,p=rn.bufferInfo(u||c,h,s.maxBufferHole),b=!p.len;if(this.log(`Media seeking to ${A(h)?h.toFixed(3):h}, state: ${f}, ${b?"out of":"in"} buffer`),this.state===st.ENDED)this.resetLoadingState();else if(o){const E=s.maxFragLookUpTolerance,D=o.start-E,w=o.start+o.duration+E;if(b||w<p.start||D>p.end){const j=h>w;(h<D||j)&&(j&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(h,1/0,this.playlistType,!0);const E=this.lastCurrentTime;if(h>E&&(this.lastCurrentTime=h),!this.loadingParts){const D=Math.max(p.end,h),w=this.shouldLoadParts(this.getLevelDetails(),D);w&&(this.log(`LL-Part loading ON after seeking to ${h.toFixed(2)} with buffer @${D.toFixed(2)}`),this.loadingParts=w)}}this.hls.hasEnoughToStart||(this.log(`Setting ${b?"startPosition":"nextLoadPosition"} to ${h} for seek without enough to start`),this.nextLoadPosition=h,b&&(this.startPosition=h)),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new Bn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Un(e.config)}registerListeners(){const{hls:e}=this;e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===st.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=st.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=rn.bufferedInfo(r,e.start,0));const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const f=c[c.length-1];return rn.isBuffered(this.media,f.start+f.duration/2)}const u=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(u)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===st.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=st.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{const s=r.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(s,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state,o=r.frag;if(this.fragContextChanged(o)){(s===st.FRAG_LOADING||!this.fragCurrent&&s===st.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=st.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(g.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===st.STOPPED||this.state===st.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)===vn.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===vn.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(g.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:r,payload:s}=n,o=r.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Ui(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Vi(o.method)).catch(u=>{throw i.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:r}),u}).then(u=>{const f=self.performance.now();return i.trigger(g.FRAG_DECRYPTED,{frag:r,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===st.STOPPED||this.state===st.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!==st.STOPPED&&(this.state=st.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()}unhandledEncryptionError(e,t){var n,i;const r=e.tracks;if(r&&!t.encrypted&&((n=r.audio)!=null&&n.encrypted||(i=r.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const s=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${s?"attached mediaKeys: "+s.mediaKeys:"detached"})`);return this.warn(o.message),!s||s.mediaKeys?!1:(this.hls.trigger(g.ERROR,{type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Hs.toString(rn.getBuffered(n)):"(detached)"})`),Se(e)){var i;if(e.type!==q.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=st.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=st.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(c=>!c),o=new wi(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=st.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(p=>{if(!this.fragContextChanged(p.frag))return this.hls.trigger(g.KEY_LOADED,p),this.state===st.KEY_LOADING&&(this.state=st.IDLE),p}),this.hls.trigger(g.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(Se(e)&&(!c||e.sn!==c.sn)){const p=this.shouldLoadParts(t.details,e.end);p!==this.loadingParts&&(this.log(`LL-Part loading ${p?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=p)}if(n=Math.max(e.start,n||0),this.loadingParts&&Se(e)){const p=s.partList;if(p&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const b=this.getNextPart(p,e,n);if(b>-1){const E=p[b];e=this.fragCurrent=E.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${E.index} (${b}/${p.length-1}) of ${this.fragInfo(e,!1,E)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=E.start+E.duration,this.state=st.FRAG_LOADING;let D;return o?D=o.then(w=>!w||this.fragContextChanged(w.frag)?null:this.doFragPartsLoad(e,E,t,i)).catch(w=>this.handleFragLoadError(w)):D=this.doFragPartsLoad(e,E,t,i).catch(w=>this.handleFragLoadError(w)),this.hls.trigger(g.FRAG_LOADING,{frag:e,part:E,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):D}else if(!e.url||this.loadedEndOfParts(p,n))return Promise.resolve(null)}}if(Se(e)&&this.loadingParts){var u;this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(u=s.partList)==null?void 0:u.filter(p=>p.loaded).map(p=>`[${p.start}-${p.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),A(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=st.FRAG_LOADING;const f=this.config.progressive;let h;return f&&o?h=o.then(p=>!p||this.fragContextChanged(p.frag)?null:this.fragmentLoader.load(e,i)).catch(p=>this.handleFragLoadError(p)):h=Promise.all([this.fragmentLoader.load(e,f?i:void 0),o]).then(([p])=>(!f&&i&&i(p),p)).catch(p=>this.handleFragLoadError(p)),this.hls.trigger(g.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 o;const c=[],u=(o=n.details)==null?void 0:o.partList,f=h=>{this.fragmentLoader.loadPart(e,h,i).then(p=>{c[h.index]=p;const b=p.part;this.hls.trigger(g.FRAG_LOADED,p);const E=Ci(n.details,e.sn,h.index+1)||Li(u,e.sn,h.index+1);if(E)f(E);else return r({frag:e,part:b,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t&&t.details===F.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(g.ERROR,t)}else this.hls.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==st.PARSING){!this.fragCurrent&&this.state!==st.STOPPED&&this.state!==st.ERROR&&(this.state=st.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const o=this.getLevelDetails(),u=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const r=e.partList[0],s=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],c=o.details,u=s>-1?Ci(c,r,s):null,f=u?u.fragment:Gi(c,r,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:o}):null}bufferFragmentData(e,t,n,i,r){if(this.state!==st.PARSING)return;const{data1:s,data2:o}=e;let c=s;if(o&&(c=Ke(s,o)),!c.length)return;const u=this.initPTS[t.cc],f=u?-u.baseTime/u.timescale:void 0,h={type:e.type,frag:t,part:n,chunkMeta:i,offset:f,parent:t.type,data:c};if(this.hls.trigger(g.BUFFER_APPENDING,h),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!rn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=rn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!A(i))return null;const s=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,n,i){const r=rn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(r.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(r.nextStart,s.end)-t,i);return rn.bufferInfo(e,t,o)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=q.MAIN){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;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,o=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const h=r.initialLiveManifestSize;if(i<h)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${h})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const p=this.hls.startPosition,b=this.hls.liveSyncPosition,E=c?(p!==-1&&p>=s?p:b)||c.start:e;this.log(`Setting startPosition to ${E} to match start frag at live edge. mainStart: ${p} liveSyncPosition: ${b} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=E}}else e<=s&&(c=n[0]);if(!c){const h=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,h,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const h=c.sn-t.startSN;f=this.filterReplacedPrimary(n[h+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===vn.OK||n===vn.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(o!==null&&n.len+o.len>=r){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Ai(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Ai(this.config)&&e.type!==q.SUBTITLE){const n=this.hls.interstitialsManager,i=n==null?void 0:n.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let s=r.length;s--;){const o=r[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let o=0,c=e.length;o<c;o++){const u=e[o];if(s=s&&!u.independent,i>-1&&n<u.start)break;const f=u.loaded;f?i=-1:(r||(u.independent||s)&&u.fragment===t)&&(u.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${u.start}`),i=o),r=f}return i}loadedEndOfParts(e,t){let n;for(let i=e.length;i--;){if(n=e[i],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,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=qt(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=Xt(e,n.cc,n.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:o}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=i,f=n.partList,h=!!(this.loadingParts&&f!=null&&f.length&&c);h&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let p;if(e<t){var b;const D=e<this.lastCurrentTime||e>t-u||(b=this.media)!=null&&b.paused||!this.startFragRequested?0:u;p=Zt(r,s,e,D)}else p=s[s.length-1];if(p){const E=p.sn-n.startSN,D=this.fragmentTracker.getState(p);if((D===vn.OK||D===vn.PARTIAL&&p.gap)&&(r=p),r&&p.sn===r.sn&&(!h||f[0].fragment.sn>p.sn||!n.live)&&p.level===r.level){const j=s[E+1];p.sn<o&&this.fragmentTracker.getState(j)!==vn.OK?p=j:p=null}}return p}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,s=!t,o=e.alignedSliding&&A(r);if(s||!o&&!r){Kr(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const i=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,s=r?this.startTimeOffset:e.startTimeOffset;s!==null&&A(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&Se(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==st.FRAG_LOADING_WAITING_RETRY)&&(this.state=st.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const E=this.getCurrentContext(t.chunkMeta);E&&(t.frag=E.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===F.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:o,flags:c,retryCount:u=0,retryConfig:f}=s||{},h=!!s&&!!f,p=h&&o===Ht.RetryRequest,b=h&&!s.resolved&&c===Mn.MoveAllAlternatesMatchingHost;if(!p&&b&&Se(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((p||b)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const E=Nt(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${E}ms`),s.resolved=!0,this.retryDate=self.performance.now()+E,this.state=st.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!r&&o!==Ht.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else o===Ht.SendAlternateToPenaltyBox?this.state=st.WAITING_LEVEL:this.state=st.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===st.PARSING||this.state===st.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 (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===q.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==st.STOPPED&&(this.state=st.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=rn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===st.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==st.STOPPED&&(this.state=st.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const f=e.elementaryStreams[u];if(f){const h=f.endPTS-f.startPTS;if(h<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${h})`),c||!1;const p=i?0:ss(r,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS,this);return this.hls.trigger(g.LEVEL_PTS_UPDATED,{details:r,level:n,drift:p,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var o;if(n.fragmentError===0&&this.treatAsGap(e,n),((o=this.transmuxer)==null?void 0:o.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=st.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(g.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===q.MAIN?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((i=t&&!n?e.startPTS:(n||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Ai(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class qi{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=nr(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function nr(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}var Gr={exports:{}},os;function Ws(){return os||(os=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function r(c,u,f,h,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var b=new i(f,h||c,p),E=t?t+u:u;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],b]:c._events[E].push(b):(c._events[E]=b,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)e.call(f,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=t?t+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,b=h.length,E=new Array(b);p<b;p++)E[p]=h[p].fn;return E},o.prototype.listenerCount=function(u){var f=t?t+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,p,b,E){var D=t?t+u:u;if(!this._events[D])return!1;var w=this._events[D],j=arguments.length,fe,ae;if(w.fn){switch(w.once&&this.removeListener(u,w.fn,void 0,!0),j){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,f),!0;case 3:return w.fn.call(w.context,f,h),!0;case 4:return w.fn.call(w.context,f,h,p),!0;case 5:return w.fn.call(w.context,f,h,p,b),!0;case 6:return w.fn.call(w.context,f,h,p,b,E),!0}for(ae=1,fe=new Array(j-1);ae<j;ae++)fe[ae-1]=arguments[ae];w.fn.apply(w.context,fe)}else{var Pe=w.length,Ve;for(ae=0;ae<Pe;ae++)switch(w[ae].once&&this.removeListener(u,w[ae].fn,void 0,!0),j){case 1:w[ae].fn.call(w[ae].context);break;case 2:w[ae].fn.call(w[ae].context,f);break;case 3:w[ae].fn.call(w[ae].context,f,h);break;case 4:w[ae].fn.call(w[ae].context,f,h,p);break;default:if(!fe)for(Ve=1,fe=new Array(j-1);Ve<j;Ve++)fe[Ve-1]=arguments[Ve];w[ae].fn.apply(w[ae].context,fe)}}return!0},o.prototype.on=function(u,f,h){return r(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return r(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,p){var b=t?t+u:u;if(!this._events[b])return this;if(!f)return s(this,b),this;var E=this._events[b];if(E.fn)E.fn===f&&(!p||E.once)&&(!h||E.context===h)&&s(this,b);else{for(var D=0,w=[],j=E.length;D<j;D++)(E[D].fn!==f||p&&!E[D].once||h&&E[D].context!==h)&&w.push(E[D]);w.length?this._events[b]=w.length===1?w[0]:w:s(this,b)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(Gr)),Gr.exports}var Ds=Ws(),ls=B(Ds);const xr="1.6.9",Ar={};function Ys(){return typeof __HLS_WORKER_BUNDLE__=="function"}function cl(){const a=Ar[xr];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ar[xr]=i,i}function fl(a){const e=Ar[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ar[a]=i,i}function hl(a){const e=Ar[a||xr];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete Ar[a||xr],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Ma(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Xs(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Rs(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function ys(a,e){const t=e;let n=0;for(;Xs(a,e);){n+=10;const i=Rs(a,e+6);n+=i,Ma(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function dl(a,e,t,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],s=r>>2&15;if(s>12){const b=new Error(`invalid ADTS sampling index:${s}`);a.emit(g.ERROR,g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!0,error:b,reason:b.message});return}const o=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,u="mp4a.40."+o,f=i[s];let h=s;(o===5||o===29)&&(h-=3);const p=[o<<3|(h&14)>>1,(h&1)<<7|c<<3];return J.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${o} sampling index:${s})`),{config:p,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Fa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Na(a,e){return a[e+1]&1?7:9}function Qs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function pl(a,e){return e+5<a.length}function Is(a,e){return e+1<a.length&&Fa(a,e)}function gl(a,e){return pl(a,e)&&Fa(a,e)&&Qs(a,e)<=a.length-e}function ml(a,e){if(Is(a,e)){const t=Na(a,e);if(e+t>=a.length)return!1;const n=Qs(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Is(a,i)}return!1}function Ba(a,e,t,n,i){if(!a.samplerate){const r=dl(e,t,n,i);if(!r)return;d(a,r)}}function Ua(a){return 1024*9e4/a}function _l(a,e){const t=Na(a,e);if(e+t<=a.length){const n=Qs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function $a(a,e,t,n,i){const r=Ua(a.samplerate),s=n+i*r,o=_l(e,t);let c;if(o){const{frameLength:h,headerLength:p}=o,b=p+h,E=Math.max(0,t+b-e.length);E?(c=new Uint8Array(b-p),c.set(e.subarray(t+p,e.length),0)):c=e.subarray(t+p,t+b);const D={unit:c,pts:s};return E||a.samples.push(D),{sample:D,length:b,missing:E}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function vl(a,e){return Xs(a,e)&&Rs(a,e+6)+10<=a.length-e}function yl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function qs(a,e=0,t=1/0){return bl(a,e,t,Uint8Array)}function bl(a,e,t,n){const i=El(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=xl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,c=(s+e)/r,u=Math.floor(Math.max(0,Math.min(c,o))),f=Math.floor(Math.min(u+Math.max(t,0),o));return new n(i,u,f-u)}function El(a){return a instanceof ArrayBuffer?a:a.buffer}function xl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function Sl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const i=Ze(qs(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=Ze(qs(a.data,3+n,s));let c;return i==="-->"?c=Ze(qs(a.data,4+n+s)):c=yl(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=c,e}function wl(a){if(a.size<2)return;const e=Ze(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function Tl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Ze(a.data.subarray(t),!0);t+=n.length+1;const i=Ze(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ze(a.data.subarray(1));return{key:a.type,info:"",data:e}}function Al(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Ze(a.data.subarray(t),!0);t+=n.length+1;const i=Ze(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ze(a.data);return{key:a.type,info:"",data:e}}function Dl(a){return a.type==="PRIV"?wl(a):a.type[0]==="W"?Al(a):a.type==="APIC"?Sl(a):Tl(a)}function Rl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Rs(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Cs=10,Il=10;function Ka(a){let e=0;const t=[];for(;Xs(a,e);){const n=Rs(a,e+6);a[e+5]>>6&1&&(e+=Cs),e+=Cs;const i=e+n;for(;e+Il<i;){const r=Rl(a.subarray(e)),s=Dl(r);s&&t.push(s),e+=r.size+Cs}Ma(a,e)&&(e+=Cs)}return t}function Ga(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Cl(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function Js(a){const e=Ka(a);for(let t=0;t<e.length;t++){const n=e[t];if(Ga(n))return Cl(n)}}let ur=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function Dr(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ea{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=Ke(this.cachedData,e),this.cachedData=null);let n=ys(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,c=n?Js(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&A(c))&&(this.basePTS=Ll(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ur.audioId3,duration:Number.POSITIVE_INFINITY});i<u;){if(this.canParse(e,i)){const f=this.appendFrame(s,e,i);f?(this.frameIndex++,this.lastPTS=f.sample.pts,i+=f.length,r=i):i=u}else vl(e,i)?(n=ys(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ur.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===u&&r!==u){const f=e.slice(r);this.cachedData?this.cachedData=Ke(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Dr(),id3Track:o,textTrack:Dr()}}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:Dr(),id3Track:this._id3Track,textTrack:Dr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Ll=(a,e,t)=>{if(A(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Ls=null;const kl=[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],Pl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Ol=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ml=[0,1,1,4];function Va(a,e,t,n,i){if(t+24>e.length)return;const r=za(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,c={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function za(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=kl[c*14+i-1]*1e3,h=Pl[(t===3?0:t===2?1:2)*3+r],p=o===3?1:2,b=Ol[t][n],E=Ml[n],D=b*8*E,w=Math.floor(b*u/h+s)*E;if(Ls===null){const ae=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ls=ae?parseInt(ae[1]):0}return!!Ls&&Ls<=87&&n===2&&u>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:h,channelCount:p,frameLength:w,samplesPerFrame:D}}}function ta(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Za(a,e){return e+1<a.length&&ta(a,e)}function Fl(a,e){return ta(a,e)&&4<=a.length-e}function ja(a,e){if(e+1<a.length&&ta(a,e)){const n=za(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Za(a,r)}return!1}class Nl extends ea{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=ys(e,0);let i=(n==null?void 0:n.length)||0;if(ja(e,i))return!1;for(let r=e.length;i<r;i++)if(ml(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return gl(e,t)}appendFrame(e,t,n){Ba(e,this.observer,t,n,e.manifestCodec);const i=$a(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ha=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const o=Math.min(n,8),c=8-o;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class Bl extends ea{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=Wa(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=ys(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Js(t)!==void 0&&Ha(e,n)<16}}function Wa(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+f>e.length)return-1;const h=e[t+6]>>5;let p=0;h===2?p+=2:(h&1&&h!==1&&(p+=2),h&4&&(p+=2));const b=(e[t+6]<<8|e[t+7])>>12-p&1,D=[2,1,2,3,3,4,4,5][h]+b,w=e[t+5]>>3,j=e[t+5]&7,fe=new Uint8Array([r<<6|w<<1|j>>2,(j&3)<<6|h<<3|b<<2|c>>4,c<<4&224]),ae=1536/o*9e4,Pe=n+i*ae,Ve=e.subarray(t,t+f);return a.config=fe,a.channelCount=D,a.samplerate=o,a.samples.push({unit:Ve,pts:Pe}),f}class Ul extends ea{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=ys(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Js(t)!==void 0&&Ha(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(ja(e,n))return J.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Fl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Va(e,t,n,this.basePTS,this.frameIndex)}}const $l=/\/emsg[-/]ID3/i;class Kl{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=Dr("video",1),s=this.audioTrack=Dr("audio",1),o=this.txtTrack=Dr("text",1);if(this.id3Track=Dr("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=we(e);if(c.video){const{id:u,timescale:f,codec:h,supplemental:p}=c.video;r.id=u,r.timescale=o.timescale=f,r.codec=h,r.supplemental=p}if(c.audio){const{id:u,timescale:f,codec:h}=c.audio;s.id=u,s.timescale=f,s.codec=h}o.id=ht.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Q(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ke(this.remainderData,e));const o=De(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=_t(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=_t(e,t),{videoTrack:t,audioTrack:Dr(),id3Track:i,textTrack:Dr()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=$(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Qe(r);if($l.test(s.schemeIdUri)){const o=Ya(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:ur.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Ya(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:ur.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function Ya(a,e){return A(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Gl{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Un(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Gn.cbc)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=wt(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}class Xa{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const s=r,o=[];let c=0,u,f,h,p=-1,b=0;for(r===-1&&(p=0,b=this.getNALuType(t,0),r=0,c=1);c<i;){if(u=t[c++],!r){r=u?0:1;continue}if(r===1){r=u?0:2;continue}if(!u)r=3;else if(u===1){if(f=c-r-1,p>=0){const E={data:t.subarray(p,f),type:b};o.push(E)}else{const E=this.getLastNalUnit(e.samples);E&&(s&&c<=4-s&&E.state&&(E.data=E.data.subarray(0,E.data.byteLength-s)),f>0&&(E.data=Ke(E.data,t.subarray(0,f)),E.state=0))}c<i?(h=this.getNALuType(t,c),p=c,b=h,r=0):r=-1}else r=0}if(p>=0&&r>=0){const E={data:t.subarray(p,i),type:b,state:r};o.push(E)}if(o.length===0){const E=this.getLastNalUnit(e.samples);E&&(E.data=Ke(E.data,t))}return e.naluState=r,o}}class bs{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&&J.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Vl extends Xa{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var f,h;switch(u.type){case 1:{let D=!1;o=!0;const w=u.data;if(c&&w.length>4){const j=this.readSliceType(w);(j===2||j===4||j===7||j===9)&&(D=!0)}if(D){var p;(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=D;break}case 5:o=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,ye(u.data,1,n.pts,t.samples);break}case 7:{var b,E;o=!0,c=!0;const D=u.data,w=this.readSPS(D);if(!e.sps||e.width!==w.width||e.height!==w.height||((b=e.pixelRatio)==null?void 0:b[0])!==w.pixelRatio[0]||((E=e.pixelRatio)==null?void 0:E[1])!==w.pixelRatio[1]){e.width=w.width,e.height=w.height,e.pixelRatio=w.pixelRatio,e.sps=[D];const j=D.subarray(1,4);let fe="avc1.";for(let ae=0;ae<3;ae++){let Pe=j[ae].toString(16);Pe.length<2&&(Pe="0"+Pe),fe+=Pe}e.codec=fe}break}case 8:o=!0,e.pps=[u.data];break;case 9:o=!0,e.audFound=!0,(h=s)!=null&&h.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new bs(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,i=8,r;for(let s=0;s<e;s++)i!==0&&(r=t.readEG(),i=(n+r+256)%256),n=i===0?n:i}readSPS(e){const t=new bs(e);let n=0,i=0,r=0,s=0,o,c,u;const f=t.readUByte.bind(t),h=t.readBits.bind(t),p=t.readUEG.bind(t),b=t.readBoolean.bind(t),E=t.skipBits.bind(t),D=t.skipEG.bind(t),w=t.skipUEG.bind(t),j=this.skipScalingList.bind(this);f();const fe=f();if(h(5),E(3),f(),w(),fe===100||fe===110||fe===122||fe===244||fe===44||fe===83||fe===86||fe===118||fe===128){const Xe=p();if(Xe===3&&E(1),w(),w(),E(1),b())for(c=Xe!==3?8:12,u=0;u<c;u++)b()&&(u<6?j(16,t):j(64,t))}w();const ae=p();if(ae===0)p();else if(ae===1)for(E(1),D(),D(),o=p(),u=0;u<o;u++)D();w(),E(1);const Pe=p(),Ve=p(),ut=h(1);ut===0&&E(1),E(1),b()&&(n=p(),i=p(),r=p(),s=p());let Be=[1,1];if(b()&&b())switch(f()){case 1:Be=[1,1];break;case 2:Be=[12,11];break;case 3:Be=[10,11];break;case 4:Be=[16,11];break;case 5:Be=[40,33];break;case 6:Be=[24,11];break;case 7:Be=[20,11];break;case 8:Be=[32,11];break;case 9:Be=[80,33];break;case 10:Be=[18,11];break;case 11:Be=[15,11];break;case 12:Be=[64,33];break;case 13:Be=[160,99];break;case 14:Be=[4,3];break;case 15:Be=[3,2];break;case 16:Be=[2,1];break;case 255:{Be=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((Pe+1)*16-n*2-i*2),height:(2-ut)*(Ve+1)*16-(ut?2:4)*(r+s),pixelRatio:Be}}}class zl extends Xa{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var f,h;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var p;(p=s)!=null&&p.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,ye(u.data,2,n.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=d(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const b=this.readSPS(u.data);e.width=b.width,e.height=b.height,e.pixelRatio=b.pixelRatio,e.codec=b.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const E in b.params)e.params[E]=b.params[E]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const b=this.readPPS(u.data);for(const E in b)e.params[E]=b[E]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(h=s)!=null&&h.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new bs(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(e){const t=new bs(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),h=t.readUByte(),p=t.readUByte(),b=t.readUByte(),E=t.readUByte(),D=t.readUByte(),w=t.readUByte(),j=t.readUByte(),fe=[],ae=[];for(let yi=0;yi<n;yi++)fe.push(t.readBoolean()),ae.push(t.readBoolean());if(n>0)for(let yi=n;yi<8;yi++)t.readBits(2);for(let yi=0;yi<n;yi++)fe[yi]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),ae[yi]&&t.readUByte();t.readUEG();const Pe=t.readUEG();Pe==3&&t.skipBits(1);const Ve=t.readUEG(),ut=t.readUEG(),Be=t.readBoolean();let Xe=0,Je=0,$e=0,At=0;Be&&(Xe+=t.readUEG(),Je+=t.readUEG(),$e+=t.readUEG(),At+=t.readUEG());const ln=t.readUEG(),Sn=t.readUEG(),On=t.readUEG(),wn=t.readBoolean();for(let yi=wn?0:n;yi<=n;yi++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let er=0;er<4;er++)for(let yr=0;yr<(er===3?2:6);yr++)if(!t.readBoolean())t.readUEG();else{const wr=Math.min(64,1<<4+(er<<1));er>1&&t.readEG();for(let gs=0;gs<wr;gs++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const hn=t.readUEG();let Cn=0;for(let yi=0;yi<hn;yi++){let er=!1;if(yi!==0&&(er=t.readBoolean()),er){yi===hn&&t.readUEG(),t.readBoolean(),t.readUEG();let yr=0;for(let es=0;es<=Cn;es++){const wr=t.readBoolean();let gs=!1;wr||(gs=t.readBoolean()),(wr||gs)&&yr++}Cn=yr}else{const yr=t.readUEG(),es=t.readUEG();Cn=yr+es;for(let wr=0;wr<yr;wr++)t.readUEG(),t.readBoolean();for(let wr=0;wr<es;wr++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const yi=t.readUEG();for(let er=0;er<yi;er++){for(let yr=0;yr<On+4;yr++)t.readBits(1);t.readBits(1)}}let an=0,on=1,ii=1,Si=!0,si=1,mi=0;t.readBoolean(),t.readBoolean();let Ji=!1;if(t.readBoolean()){if(t.readBoolean()){const ts=t.readUByte(),nl=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],js=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ts>0&&ts<16?(on=nl[ts-1],ii=js[ts-1]):ts===255&&(on=t.readBits(16),ii=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),Ji=t.readBoolean(),Ji&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(si=t.readBits(32),mi=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const js=t.readBoolean(),il=t.readBoolean();let Ts=!1;(js||il)&&(Ts=t.readBoolean(),Ts&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Ts&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let rl=0;rl<=n;rl++){Si=t.readBoolean();const wf=Si||t.readBoolean();let sl=!1;wf?t.readEG():sl=t.readBoolean();const al=sl?1:t.readUEG()+1;if(js)for(let As=0;As<al;As++)t.readUEG(),t.readUEG(),Ts&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(il)for(let As=0;As<al;As++)t.readUEG(),t.readUEG(),Ts&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),an=t.readUEG())}let vr=Ve,Lr=ut;if(Be){let yi=1,er=1;Pe===1?yi=er=2:Pe==2&&(yi=2),vr=Ve-yi*Je-yi*Xe,Lr=ut-er*At-er*$e}const Jr=i?["A","B","C"][i]:"",Sf=o<<24|c<<16|u<<8|f;let Pa=0;for(let yi=0;yi<32;yi++)Pa=(Pa|(Sf>>yi&1)<<31-yi)>>>0;let Oa=Pa.toString(16);return s===1&&Oa==="2"&&(Oa="6"),{codecString:`hvc1.${Jr}${s}.${Oa}.${r?"H":"L"}${j}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,c,u,f],general_constraint_indicator_flags:[h,p,b,E,D,w],general_level_idc:j,bit_depth:ln+8,bit_depth_luma_minus8:ln,bit_depth_chroma_minus8:Sn,min_spatial_segmentation_idc:an,chroma_format_idc:Pe,frame_rate:{fixed:Si,fps:mi/si}},width:vr,height:Lr,pixelRatio:[on,ii]}}readPPS(e){const t=new bs(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),r=t.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const ji=188;class Vr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=Vr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(ji*5,t-ji)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let c=i;c<t;c+=ji)if(e[c]===71&&(t-c===ji||e[c+ji]===71)){if(o++,s===-1&&(s=c,s!==0&&(n=Math.min(s+ji*99,e.length-ji)+1)),r||(r=na(e,c)===0),r&&o>1&&(s===0&&o>2||c+ji>n))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ht[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=Vr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=Vr.createTrack("audio",i),this._id3Track=Vr.createTrack("id3"),this._txtTrack=Vr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,u=this._txtTrack;let f=s.pid,h=s.pesData,p=o.pid,b=c.pid,E=o.pesData,D=c.pesData,w=null,j=this.pmtParsed,fe=this._pmtId,ae=e.length;if(this.remainderData&&(e=Ke(this.remainderData,e),ae=e.length,this.remainderData=null),ae<ji&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};const Pe=Math.max(0,Vr.syncOffset(e));ae-=(ae-Pe)%ji,ae<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,ae,e.buffer.byteLength-ae));let Ve=0;for(let Be=Pe;Be<ae;Be+=ji)if(e[Be]===71){const Xe=!!(e[Be+1]&64),Je=na(e,Be),$e=(e[Be+3]&48)>>4;let At;if($e>1){if(At=Be+5+e[Be+4],At===Be+ji)continue}else At=Be+4;switch(Je){case f:Xe&&(h&&(r=us(h,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,u,r,!1)),h={data:[],size:0}),h&&(h.data.push(e.subarray(At,Be+ji)),h.size+=Be+ji-At);break;case p:if(Xe){if(E&&(r=us(E,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}E={data:[],size:0}}E&&(E.data.push(e.subarray(At,Be+ji)),E.size+=Be+ji-At);break;case b:Xe&&(D&&(r=us(D,this.logger))&&this.parseID3PES(c,r),D={data:[],size:0}),D&&(D.data.push(e.subarray(At,Be+ji)),D.size+=Be+ji-At);break;case 0:Xe&&(At+=e[At]+1),fe=this._pmtId=Zl(e,At);break;case fe:{Xe&&(At+=e[At]+1);const ln=jl(e,At,this.typeSupported,n,this.observer,this.logger);f=ln.videoPid,f>0&&(s.pid=f,s.segmentCodec=ln.segmentVideoCodec),p=ln.audioPid,p>0&&(o.pid=p,o.segmentCodec=ln.segmentAudioCodec),b=ln.id3Pid,b>0&&(c.pid=b),w!==null&&!j&&(this.logger.warn(`MPEG-TS PMT found at ${Be} after unknown PID '${w}'. Backtracking to sync byte @${Pe} to parse all TS packets.`),w=null,Be=Pe-188),j=this.pmtParsed=!0;break}case 17:case 8191:break;default:w=Je;break}}else Ve++;Ve>0&&ia(this.observer,new Error(`Found ${Ve} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=h,o.pesData=E,c.pesData=D;const ut={audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};return i&&this.extractRemainingSamples(ut),ut}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,s=n.pesData,o=t.pesData,c=i.pesData;let u;if(s&&(u=us(s,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,r,u,!0),n.pesData=null)):n.pesData=s,o&&(u=us(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(u=us(c,this.logger))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new Gl(this.observer,this.config,t);return this.decrypt(i,r)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new Vl:e==="hevc"&&(this.videoParser=new zl))}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const h=i.missing,p=i.sample.unit.byteLength;if(h===-1)r=Ke(i.sample.unit,r);else{const b=p-h;i.sample.unit.set(r.subarray(0,h),b),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!Is(r,s);s++);if(s!==n){let h;const p=s<o-1;if(p?h=`AAC PES did not start with ADTS header,offset:${s}`:h="No ADTS header found in AAC PES",ia(this.observer,new Error(h),p,this.logger),!p)return}Ba(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const h=Ua(e.samplerate);c=i.sample.pts+h}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<o;)if(f=$a(e,r,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<o-1&&!Is(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Za(n,s)){const c=Va(e,n,s,o,r);if(c)s+=c.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,o=0,c;for(;o<r&&(c=Wa(e,n,o,i,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=d({},t,{type:this._videoTrack?ur.emsg:ur.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function na(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Zl(a,e){return(a[e+10]&31)<<8|a[e+11]}function jl(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=na(a,e),h=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){ra("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){ra("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){ra("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&h>0){let p=e+5,b=h;for(;b>2;){switch(a[p]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const D=a[p+1]+2;p+=D,b-=D}}break;case 194:case 135:return ia(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=h+5}return s}function ia(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(g.ERROR,g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function ra(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function us(a,e){let t=0,n,i,r,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ke(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>a.size-6)return null;const f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&64?(o=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),r=n[8];let h=r+9;if(a.size<=h)return null;a.size-=h;const p=new Uint8Array(a.size);for(let b=0,E=c.length;b<E;b++){n=c[b];let D=n.byteLength;if(h)if(h>D){h-=D;continue}else n=n.subarray(h),D-=h,h=0;p.set(n,t),t+=D}return i&&(i-=r+3),{data:p,pts:s,dts:o,len:i}}return null}class Hl{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 zr=Math.pow(2,32)-1;class je{static init(){je.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in je.types)je.types.hasOwnProperty(e)&&(je.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]);je.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]);je.STTS=je.STSC=je.STCO=r,je.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),je.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),je.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),je.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);je.FTYP=je.box(je.types.ftyp,s,c,s,o),je.DINF=je.box(je.types.dinf,je.box(je.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 je.box(je.types.hdlr,je.HDLR_TYPES[e])}static mdat(e){return je.box(je.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(zr+1)),i=Math.floor(t%(zr+1));return je.box(je.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 je.box(je.types.mdia,je.mdhd(e.timescale||0,e.duration||0),je.hdlr(e.type),je.minf(e))}static mfhd(e){return je.box(je.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"?je.box(je.types.minf,je.box(je.types.smhd,je.SMHD),je.DINF,je.stbl(e)):je.box(je.types.minf,je.box(je.types.vmhd,je.VMHD),je.DINF,je.stbl(e))}static moof(e,t,n){return je.box(je.types.moof,je.mfhd(e),je.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=je.trak(e[t]);return je.box.apply(null,[je.types.moov,je.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(je.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=je.trex(e[t]);return je.box.apply(null,[je.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(zr+1)),i=Math.floor(t%(zr+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 je.box(je.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 je.box(je.types.sdtp,n)}static stbl(e){return je.box(je.types.stbl,je.stsd(e),je.box(je.types.stts,je.STTS),je.box(je.types.stsc,je.STSC),je.box(je.types.stsz,je.STSZ),je.box(je.types.stco,je.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const o=je.box(je.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],h=e.pixelRatio[1];return je.box(je.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,je.box(je.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),je.box(je.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return je.box(je.types.mp4a,je.audioStsd(e),je.box(je.types.esds,je.esds(e)))}static mp3(e){return je.box(je.types[".mp3"],je.audioStsd(e))}static ac3(e){return je.box(je.types["ac-3"],je.audioStsd(e),je.box(je.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return je.box(je.types.stsd,je.STSD,je.mp4a(e));if(t==="ac3"&&e.config)return je.box(je.types.stsd,je.STSD,je.ac3(e));if(t==="mp3"&&e.codec==="mp3")return je.box(je.types.stsd,je.STSD,je.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return je.box(je.types.stsd,je.STSD,je.avc1(e));if(t==="hevc"&&e.vps)return je.box(je.types.stsd,je.STSD,je.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,s=Math.floor(n/(zr+1)),o=Math.floor(n%(zr+1));return je.box(je.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=je.sdtp(e),i=e.id,r=Math.floor(t/(zr+1)),s=Math.floor(t%(zr+1));return je.box(je.types.traf,je.box(je.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),je.box(je.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])),je.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,je.box(je.types.trak,je.tkhd(e),je.mdia(e))}static trex(e){const t=e.id;return je.box(je.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let o,c,u,f,h,p;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<i;o++)c=n[o],u=c.duration,f=c.size,h=c.flags,p=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&61440,h.degradPrio&15,p>>>24&255,p>>>16&255,p>>>8&255,p&255],12+16*o);return je.box(je.types.trun,s)}static initSegment(e){je.types||je.init();const t=je.moov(e);return Ke(je.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let E=0;E<n.length;E+=1){s+=3;for(let D=0;D<n[E].length;D+=1)s+=2+n[E][D].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const c=n.length-1;for(let E=0;E<n.length;E+=1){o.set(new Uint8Array([32+E|(E===c?128:0),0,n[E].length]),s),s+=3;for(let D=0;D<n[E].length;D+=1)o.set(new Uint8Array([n[E][D].length>>8,n[E][D].length&255]),s),s+=2,o.set(n[E][D],s),s+=n[E][D].length}const u=je.box(je.types.hvcC,o),f=e.width,h=e.height,p=e.pixelRatio[0],b=e.pixelRatio[1];return je.box(je.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,f>>8&255,f&255,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,je.box(je.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),je.box(je.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,b>>24,b>>16&255,b>>8&255,b&255])))}}je.types=void 0,je.HDLR_TYPES=void 0,je.STTS=void 0,je.STSC=void 0,je.STCO=void 0,je.STSZ=void 0,je.VMHD=void 0,je.SMHD=void 0,je.STSD=void 0,je.FTYP=void 0,je.DINF=void 0;const Qa=9e4;function sa(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function Wl(a,e,t=1,n=!1){return sa(a,e,1/t,n)}function Es(a,e=!1){return sa(a,1e3,1/Qa,e)}function Yl(a,e=1){return sa(a,Qa,1/e)}const Xl=10*1e3,Ql=1024,ql=1152,Jl=1536;let cs=null,aa=null;function qa(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class ks extends N{constructor(e,t,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=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,cs===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);cs=s?parseInt(s[1]):0}if(aa===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);aa=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let o=s.pts,c=o-r;return c<-4294967296&&(t=!0,o=gr(o,n),c=o-r),c>0?r:o},n);return t&&this.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,c){let u,f,h,p,b,E,D=r,w=r;const j=e.pid>-1,fe=t.pid>-1,ae=t.samples.length,Pe=e.samples.length>0,Ve=o&&ae>0||ae>1;if((!j||Pe)&&(!fe||Ve)||this.ISGenerated||o){if(this.ISGenerated){var Be,Xe,Je,$e;const On=this.videoTrackConfig;(On&&(t.width!==On.width||t.height!==On.height||((Be=t.pixelRatio)==null?void 0:Be[0])!==((Xe=On.pixelRatio)==null?void 0:Xe[0])||((Je=t.pixelRatio)==null?void 0:Je[1])!==(($e=On.pixelRatio)==null?void 0:$e[1]))||!On&&Ve||this.nextAudioTs===null&&Pe)&&this.resetInitSegment()}this.ISGenerated||(h=this.generateIS(e,t,r,s));const At=this.isVideoContiguous;let ln=-1,Sn;if(Ve&&(ln=eu(t.samples),!At&&this.config.forceKeyFrameOnDiscontinuity))if(E=!0,ln>0){this.warn(`Dropped ${ln} out of ${ae} video samples due to a missing keyframe`);const On=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(ln),t.dropped+=ln,w+=(t.samples[0].pts-On)/t.inputTimeScale,Sn=w}else ln===-1&&(this.warn(`No keyframe found out of ${ae} video samples`),E=!1);if(this.ISGenerated){if(Pe&&Ve){const On=this.getVideoStartPts(t.samples),nn=(gr(e.samples[0].pts,On)-On)/t.inputTimeScale;D+=Math.max(0,nn),w+=Math.max(0,-nn)}if(Pe){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),h=this.generateIS(e,t,r,s)),f=this.remuxAudio(e,D,this.isAudioContiguous,s,fe||Ve||c===q.AUDIO?w:void 0),Ve){const On=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),h=this.generateIS(e,t,r,s)),u=this.remuxVideo(t,w,At,On)}}else Ve&&(u=this.remuxVideo(t,w,At,0));u&&(u.firstKeyFrame=ln,u.independent=ln!==-1,u.firstKeyFramePTS=Sn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(b=Ja(n,r,this._initPTS,this._initDTS)),i.samples.length&&(p=eo(i,r,this._initPTS))),{audio:f,video:u,initSegment:h,independent:E,text:p,id3:b}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,c={},u=this._initPTS;let f=!u||i,h="audio/mp4",p,b,E,D=-1;if(f&&(p=b=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(h="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:h,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):je.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(D=e.id,E=e.inputTimeScale,!u||E!==u.timescale?p=b=r[0].pts-Math.round(E*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:je.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(D=t.id,E=t.inputTimeScale,!u||E!==u.timescale){const w=this.getVideoStartPts(s),j=Math.round(E*n);b=Math.min(b,gr(s[0].dts,w)-j),p=Math.min(p,w-j)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(u&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${n} ${p/E} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${p/E} (${p}/${E}) trackId: ${D}`),this._initPTS={baseTime:p,timescale:E,trackId:D},this._initDTS={baseTime:b,timescale:E,trackId:D}):p=E=void 0,{tracks:c,initPTS:p,timescale:E,trackId:D}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],c=s.length,u=this._initPTS,f=u.baseTime*r/u.timescale;let h=this.nextVideoTs,p=8,b=this.videoSampleDuration,E,D,w=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,fe=!1;if(!n||h===null){const an=f+t*r,on=s[0].pts-gr(s[0].dts,s[0].pts);cs&&h!==null&&Math.abs(an-on-(h+f))<15e3?n=!0:h=an-on-f}const ae=h+f;for(let an=0;an<c;an++){const on=s[an];on.pts=gr(on.pts,ae),on.dts=gr(on.dts,ae),on.dts<s[an>0?an-1:an].dts&&(fe=!0)}fe&&s.sort(function(an,on){const ii=an.dts-on.dts,Si=an.pts-on.pts;return ii||Si}),E=s[0].dts,D=s[s.length-1].dts;const Pe=D-E,Ve=Pe?Math.round(Pe/(c-1)):b||e.inputTimeScale/30;if(n){const an=E-ae,on=an>Ve,ii=an<-1;if((on||ii)&&(on?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Es(an,!0)} ms (${an}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Es(-an,!0)} ms (${an}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!ii||ae>=s[0].pts||cs)){E=ae;const Si=s[0].pts-an;if(on)s[0].dts=E,s[0].pts=Si;else{let si=!0;for(let mi=0;mi<s.length&&!(s[mi].dts>Si&&si);mi++){const Ji=s[mi].pts;if(s[mi].dts-=an,s[mi].pts-=an,mi<s.length-1){const Yi=s[mi+1].pts,vr=s[mi].pts,Lr=Yi<=vr,Jr=Yi<=Ji;si=Lr==Jr}}}this.log(`Video: Initial PTS/DTS adjusted: ${Es(Si,!0)}/${Es(E,!0)}, delta: ${Es(an,!0)} ms`)}}E=Math.max(0,E);let ut=0,Be=0,Xe=E;for(let an=0;an<c;an++){const on=s[an],ii=on.units,Si=ii.length;let si=0;for(let mi=0;mi<Si;mi++)si+=ii[mi].data.length;Be+=si,ut+=Si,on.length=si,on.dts<Xe?(on.dts=Xe,Xe+=Ve/4|0||1):Xe=on.dts,w=Math.min(on.pts,w),j=Math.max(on.pts,j)}D=s[c-1].dts;const Je=Be+4*ut+8;let $e;try{$e=new Uint8Array(Je)}catch(an){this.observer.emit(g.ERROR,g.ERROR,{type:ne.MUX_ERROR,details:F.REMUX_ALLOC_ERROR,fatal:!1,error:an,bytes:Je,reason:`fail allocating video mdat ${Je}`});return}const At=new DataView($e.buffer);At.setUint32(0,Je),$e.set(je.types.mdat,4);let ln=!1,Sn=Number.POSITIVE_INFINITY,On=Number.POSITIVE_INFINITY,wn=Number.NEGATIVE_INFINITY,nn=Number.NEGATIVE_INFINITY;for(let an=0;an<c;an++){const on=s[an],ii=on.units;let Si=0;for(let Ji=0,Yi=ii.length;Ji<Yi;Ji++){const vr=ii[Ji],Lr=vr.data,Jr=vr.data.byteLength;At.setUint32(p,Jr),p+=4,$e.set(Lr,p),p+=Jr,Si+=4+Jr}let si;if(an<c-1)b=s[an+1].dts-on.dts,si=s[an+1].pts-on.pts;else{const Ji=this.config,Yi=an>0?on.dts-s[an-1].dts:Ve;if(si=an>0?on.pts-s[an-1].pts:Ve,Ji.stretchShortVideoTrack&&this.nextAudioTs!==null){const vr=Math.floor(Ji.maxBufferHole*r),Lr=(i?w+i*r:this.nextAudioTs+f)-on.pts;Lr>vr?(b=Lr-Yi,b<0?b=Yi:ln=!0,this.log(`It is approximately ${Lr/90} ms to the next segment; using duration ${b/90} ms for the last video frame.`)):b=Yi}else b=Yi}const mi=Math.round(on.pts-on.dts);Sn=Math.min(Sn,b),wn=Math.max(wn,b),On=Math.min(On,si),nn=Math.max(nn,si),o.push(qa(on.key,b,Si,mi))}if(o.length){if(cs){if(cs<70){const an=o[0].flags;an.dependsOn=2,an.isNonSync=0}}else if(aa&&nn-On<wn-Sn&&Ve/wn<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let an=E;for(let on=0,ii=o.length;on<ii;on++){const Si=an+o[on].duration,si=an+o[on].cts;if(on<ii-1){const mi=Si+o[on+1].cts;o[on].duration=mi-si}else o[on].duration=on?o[on-1].duration:Ve;o[on].cts=0,an=Si}}}b=ln||!b?Ve:b;const In=D+b;this.nextVideoTs=h=In-f,this.videoSampleDuration=b,this.isVideoContiguous=!0;const Zn={data1:je.moof(e.sequenceNumber++,E,d(e,{samples:o})),data2:$e,startPTS:(w-f)/r,endPTS:(j+b-f)/r,startDTS:(E-f)/r,endDTS:h/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Zn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return ql;case"ac3":return Jl;default:return Ql}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,u=this.getSamplesPerFrame(e),f=u*c,h=this._initPTS,p=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,b=[],E=r!==void 0;let D=e.samples,w=p?0:8,j=this.nextAudioTs||-1;const fe=h.baseTime*s/h.timescale,ae=fe+t*s;if(this.isAudioContiguous=n=n||D.length&&j>0&&(i&&Math.abs(ae-(j+fe))<9e3||Math.abs(gr(D[0].pts,ae)-(j+fe))<20*f),D.forEach(function(nn){nn.pts=gr(nn.pts,ae)}),!n||j<0){if(D=D.filter(nn=>nn.pts>=0),!D.length)return;r===0?j=0:i&&!E?j=Math.max(0,ae-fe):j=D[0].pts-fe}if(e.segmentCodec==="aac"){const nn=this.config.maxAudioFramesDrift;for(let In=0,hn=j+fe;In<D.length;In++){const Cn=D[In],Zn=Cn.pts,an=Zn-hn,on=Math.abs(1e3*an/s);if(an<=-nn*f&&E)In===0&&(this.warn(`Audio frame @ ${(Zn/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*an/s)} ms.`),this.nextAudioTs=j=Zn-fe,hn=Zn);else if(an>=nn*f&&on<Xl&&E){let ii=Math.round(an/f);for(hn=Zn-ii*f;hn<0&&ii&&f;)ii--,hn+=f;In===0&&(this.nextAudioTs=j=hn-fe),this.warn(`Injecting ${ii} audio frames @ ${((hn-fe)/s).toFixed(3)}s due to ${Math.round(1e3*an/s)} ms gap.`);for(let Si=0;Si<ii;Si++){let si=Hl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);si||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),si=Cn.unit.subarray()),D.splice(In,0,{unit:si,pts:hn}),hn+=f,In++}}Cn.pts=hn,hn+=f}}let Pe=null,Ve=null,ut,Be=0,Xe=D.length;for(;Xe--;)Be+=D[Xe].unit.byteLength;for(let nn=0,In=D.length;nn<In;nn++){const hn=D[nn],Cn=hn.unit;let Zn=hn.pts;if(Ve!==null){const on=b[nn-1];on.duration=Math.round((Zn-Ve)/c)}else if(n&&e.segmentCodec==="aac"&&(Zn=j+fe),Pe=Zn,Be>0){Be+=w;try{ut=new Uint8Array(Be)}catch(on){this.observer.emit(g.ERROR,g.ERROR,{type:ne.MUX_ERROR,details:F.REMUX_ALLOC_ERROR,fatal:!1,error:on,bytes:Be,reason:`fail allocating audio mdat ${Be}`});return}p||(new DataView(ut.buffer).setUint32(0,Be),ut.set(je.types.mdat,4))}else return;ut.set(Cn,w);const an=Cn.byteLength;w+=an,b.push(qa(!0,u,an,0)),Ve=Zn}const Je=b.length;if(!Je)return;const $e=b[b.length-1];j=Ve-fe,this.nextAudioTs=j+c*$e.duration;const At=p?new Uint8Array(0):je.moof(e.sequenceNumber++,Pe/c,d({},e,{samples:b}));e.samples=[];const ln=(Pe-fe)/s,Sn=j/s,wn={data1:At,data2:ut,startPTS:ln,endPTS:Sn,startDTS:ln,endDTS:Sn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Je};return this.isAudioContiguous=!0,wn}}function gr(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 eu(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function Ja(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const c=a.samples[o];c.pts=gr(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=gr(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function eo(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const o=a.samples[s];o.pts=gr(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class tu extends N{constructor(e,t,n,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:r,video:s}=this.initData=we(e);if(t)Ue(e,t);else{const c=r||s;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}r&&(n=to(r,C.AUDIO,this)),s&&(i=to(s,C.VIDEO,this));const o={};r&&s?o.audiovideo={container:"video/mp4",codec:n+","+i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:r?o.audio={container:"audio/mp4",codec:n,encrypted:r.encrypted,initSegment:e,id:"audio"}:s?o.video={container:"video/mp4",codec:i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,n,i,r,s){var o,c;let{initPTS:u,lastEndTime:f}=this;const h={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};A(f)||(f=this.lastEndTime=r||0);const p=t.samples;if(!p.length)return h;const b={initPTS:void 0,timescale:void 0,trackId:void 0};let E=this.initData;if((o=E)!=null&&o.length||(this.generateInitSegment(p),E=this.initData),!((c=E)!=null&&c.length))return this.warn("Failed to generate initSegment."),h;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1);const D=Ne(p,E,this),w=E.audio?D[E.audio.id]:null,j=E.video?D[E.video.id]:null,fe=Ps(j,1/0),ae=Ps(w,1/0),Pe=Ps(j,0,!0),Ve=Ps(w,0,!0);let ut=r,Be=0;const Xe=w&&(!j||!u&&ae<fe||u&&u.trackId===E.audio.id),Je=Xe?w:j;if(Je){const hn=Je.timescale,Cn=Je.start-r*hn,Zn=Xe?E.audio.id:E.video.id;ut=Je.start/hn,Be=Xe?Ve-ae:Pe-fe,(s||!u)&&(nu(u,ut,r,Be)||hn!==u.timescale)&&(u&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${r} ${Cn/hn} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${ut-r} (${Cn}/${hn}) trackId: ${Zn}`),u=null,b.initPTS=Cn,b.timescale=hn,b.trackId=Zn)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${r}`);u?(b.initPTS=u.baseTime,b.timescale=u.timescale,b.trackId=u.trackId):((!b.timescale||b.trackId===void 0||b.initPTS===void 0)&&(this.warn("Could not set initPTS"),b.initPTS=ut,b.timescale=1,b.trackId=-1),this.initPTS=u={baseTime:b.initPTS,timescale:b.timescale,trackId:b.trackId});const $e=ut-u.baseTime/u.timescale,At=$e+Be;Be>0?this.lastEndTime=At:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const ln=!!E.audio,Sn=!!E.video;let On="";ln&&(On+="audio"),Sn&&(On+="video");const wn=(E.audio?E.audio.encrypted:!1)||(E.video?E.video.encrypted:!1),nn={data1:p,startPTS:$e,startDTS:$e,endPTS:At,endDTS:At,type:On,hasAudio:ln,hasVideo:Sn,nb:1,dropped:0,encrypted:wn};h.audio=ln&&!Sn?nn:void 0,h.video=Sn?nn:void 0;const In=j==null?void 0:j.sampleCount;if(In){const hn=j.keyFrameIndex,Cn=hn!==-1;nn.nb=In,nn.dropped=hn===0||this.isVideoContiguous?0:Cn?hn:In,nn.independent=Cn,nn.firstKeyFrame=hn,Cn&&j.keyFrameStart&&(nn.firstKeyFramePTS=(j.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(h.independent=Cn),this.isVideoContiguous||(this.isVideoContiguous=Cn),nn.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${hn}/${In} dropped: ${nn.dropped} start: ${nn.firstKeyFramePTS||"NA"}`)}return h.initSegment=b,h.id3=Ja(n,r,u,u),i.samples.length&&(h.text=eo(i,r,u)),h}}function Ps(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function nu(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 to(a,e,t){const n=a.codec;return n&&n.length>4?n:e===C.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?ie(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let Fr;try{Fr=self.performance.now.bind(self.performance)}catch(a){Fr=Date.now}const Os=[{demux:Kl,remux:tu},{demux:Vr,remux:ks},{demux:Nl,remux:ks},{demux:Ul,remux:ks}];Os.splice(2,0,{demux:Bl,remux:ks});class no{constructor(e,t,n,i,r,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Fr();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:f,trackSwitch:h,accurateTimeOffset:p,timeOffset:b,initSegmentChange:E}=i||o,{audioCodec:D,videoCodec:w,defaultInitPts:j,duration:fe,initSegmentData:ae}=c,Pe=iu(s,t);if(Pe&&Ui(Pe.method)){const Xe=this.getDecrypter(),Je=Vi(Pe.method);if(Xe.isSync()){let $e=Xe.softwareDecrypt(s,Pe.key.buffer,Pe.iv.buffer,Je);if(n.part>-1){const ln=Xe.flush();$e=ln&&ln.buffer}if(!$e)return r.executeEnd=Fr(),oa(n);s=new Uint8Array($e)}else return this.asyncResult=!0,this.decryptionPromise=Xe.webCryptoDecrypt(s,Pe.key.buffer,Pe.iv.buffer,Je).then($e=>{const At=this.push($e,null,n);return this.decryptionPromise=null,At}),this.decryptionPromise}const Ve=this.needsProbing(f,h);if(Ve){const Xe=this.configureTransmuxer(s);if(Xe)return this.logger.warn(`[transmuxer] ${Xe.message}`),this.observer.emit(g.ERROR,g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,error:Xe,reason:Xe.message}),r.executeEnd=Fr(),oa(n)}(f||h||E||Ve)&&this.resetInitSegment(ae,D,w,fe,t),(f||E||Ve)&&this.resetInitialTimestamp(j),u||this.resetContiguity();const ut=this.transmux(s,Pe,b,p,n);this.asyncResult=xs(ut);const Be=this.currentTransmuxState;return Be.contiguous=!0,Be.discontinuity=!1,Be.trackSwitch=!1,r.executeEnd=Fr(),ut}flush(e){const t=e.transmuxing;t.executeStart=Fr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const h=n.flush();h&&s.push(this.push(h.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Fr();const h=[oa(e)];return this.asyncResult?Promise.resolve(h):h}const f=c.flush(o);return xs(f)?(this.asyncResult=!0,f.then(h=>(this.flushRemux(s,h,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===q.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(i,r,s,o,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=Fr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,n,i),o.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,c,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let h=0,p=Os.length;h<p;h++){var s;if((s=Os[h].demux)!=null&&s.probe(e,this.logger)){r=Os[h];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,u=r.remux,f=r.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,i,this.logger)),(!o||!(o instanceof f))&&(this.demuxer=new f(n,t,i,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Un(this.config)),e}}function iu(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 oa=a=>({remuxResult:{},chunkMeta:a});function xs(a){return"then"in a&&a.then instanceof Function}class ru{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 su{constructor(e,t,n,i,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}let io=0;class ro{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=io++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var h;const p=(h=this.workerContext)==null?void 0:h.objectURL;p&&self.URL.revokeObjectURL(p);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===g.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new ls,this.observer.on(g.FRAG_DECRYPTED,s),this.observer.on(g.ERROR,s);const o=zt(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(r.workerPath||Ys()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=fl(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=cl());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:tt(r)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.terminateWorker(),this.error=null,this.transmuxer=new no(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new no(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=io++;const t=this.hls.config,n=zt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:tt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),hl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,o,c,u,f){var h,p;u.transmuxing.start=self.performance.now();const{instanceNo:b,transmuxer:E}=this,D=s?s.start:r.start,w=r.decryptdata,j=this.frag,fe=!(j&&r.cc===j.cc),ae=!(j&&u.level===j.level),Pe=j?u.sn-j.sn:-1,Ve=this.part?u.part-this.part.index:-1,ut=Pe===0&&u.id>1&&u.id===(j==null?void 0:j.stats.chunkCount),Be=!ae&&(Pe===1||Pe===0&&(Ve===1||ut&&Ve<=0)),Xe=self.performance.now();(ae||Pe||r.stats.parsing.start===0)&&(r.stats.parsing.start=Xe),s&&(Ve||!Be)&&(s.stats.parsing.start=Xe);const Je=!(j&&((h=r.initSegment)==null?void 0:h.url)===((p=j.initSegment)==null?void 0:p.url)),$e=new su(fe,Be,c,ae,D,Je);if(!Be||fe||Je){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===q.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${fe}
|
|
trackSwitch: ${ae}
|
|
contiguous: ${Be}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${D}
|
|
initSegmentChange: ${Je}`);const At=new ru(n,i,t,o,f);this.configureTransmuxer(At)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:b,cmd:"demux",data:e,decryptdata:w,chunkMeta:u,state:$e},e instanceof ArrayBuffer?[e]:[]);else if(E){const At=E.push(e,w,u,$e);xs(At)?At.then(ln=>{this.handleTransmuxComplete(ln)}).catch(ln=>{this.transmuxerError(ln,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(At)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const i=n.flush(e);xs(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const so=100;class au extends vi{constructor(e,t,n){super(e,t,n,"audio-stream-controller",q.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(g.BUFFER_RESET,this.onBufferReset,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(g.BUFFER_RESET,this.onBufferReset,this),e.off(g.BUFFER_CREATED,this.onBufferCreated,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){if(n===q.MAIN){const o=t.cc,c=this.fragCurrent;if(this.initPTS[o]={baseTime:i,timescale:r,trackId:s},this.log(`InitPTS for cc: ${o} found from main: ${i/r} (${i}/${r}) trackId: ${s}`),this.mainAnchor=t,this.state===st.WAITING_INIT_PTS){const u=this.waitingData;(!u&&!this.loadingParts||u&&u.frag.cc!==o)&&this.syncWithAnchor(t,u==null?void 0:u.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==o?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===st.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const r=(i||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),c=Xt(s,r,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===st.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=st.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(so),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=st.IDLE):this.state=st.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case st.IDLE:this.doTickIdle();break;case st.WAITING_TRACK:{const{levels:t,trackId:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=st.WAITING_INIT_PTS}break}case st.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,trackId:r}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[r])||null),this.state=st.IDLE}break}case st.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:i,cache:r,complete:s}=t,o=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=st.FRAG_LOADING;const c=r.flush().buffer,u={frag:n,part:i,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else o&&o.cc!==t.frag.cc&&this.syncWithAnchor(o,t.frag)}else this.state=st.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[r]))return;const o=n[r],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=st.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,C.AUDIO,q.AUDIO));const f=this.getFwdBufferInfo(u,q.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(g.BUFFER_EOS,{type:"audio"}),this.state=st.ENDED;return}const h=f.len,p=t.maxBufferLength,b=c.fragments,E=b[0].start,D=this.getLoadPosition(),w=this.flushing?D:f.end;if(this.switchingTrack&&i){const ae=D;c.PTSKnown&&ae<E&&(f.end>E||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=E+.05)}if(h>=p&&!this.switchingTrack&&w<b[b.length-1].start)return;let j=this.getNextFragment(w,c);if(j&&this.isLoopLoading(j,w)&&(j=this.getNextFragmentLoopLoading(j,c,f,q.MAIN,p)),!j){this.bufferFlushed=!0;return}let fe=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&fe&&Se(j)&&!j.endList&&(!c.live||!this.loadingParts&&w<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(fe)===vn.OK&&(this.mainFragLoading=fe=null),fe&&Se(fe))){if(j.start>fe.end){const Pe=this.fragmentTracker.getFragAtPos(w,q.MAIN);Pe&&Pe.end>fe.end&&(fe=Pe,this.mainFragLoading={frag:Pe,targetBufferTime:null})}if(j.start>fe.end)return}this.loadFragment(j,o,w)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new pt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==st.STOPPED&&(this.setInterval(so),this.state=st.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(g.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==st.STOPPED&&(this.state=st.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const f=i[s];let h=0;if(r.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(f.details){var p;h=this.alignPlaylists(r,f.details,(p=this.levelLastLoaded)==null?void 0:p.details)}r.alignedSliding||(Mr(r,u),r.alignedSliding||as(r,u),h=r.fragmentStart)}f.details=r,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,h),this.hls.trigger(g.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===st.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=st.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const h=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let p=this.transmuxer;p||(p=this.transmuxer=new ro(this.hls,q.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const b=this.initPTS[n.cc],E=(t=n.initSegment)==null?void 0:t.data;if(b!==void 0){const w=i?i.index:-1,j=w!==-1,fe=new wi(n.level,n.sn,n.stats.chunkCount,r.byteLength,w,j);p.push(r,E,h,"",n,i,f.totalduration,!1,fe,b)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${o}`);const{cache:D}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new qi,complete:!1};D.push(new Uint8Array(r)),this.state!==st.STOPPED&&(this.state=st.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===q.MAIN&&Se(t.frag)&&(this.mainFragLoading=t,this.state===st.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==q.AUDIO){!this.audioOnly&&n.type===q.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(Se(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(g.AUDIO_TRACK_SWITCHED,y({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=st.ERROR;return}switch(t.details){case F.FRAG_GAP:case F.FRAG_PARSING_ERROR:case F.FRAG_DECRYPT_ERROR:case F.FRAG_LOAD_ERROR:case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_ERROR:case F.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(q.AUDIO,t);break;case F.AUDIO_TRACK_LOAD_ERROR:case F.AUDIO_TRACK_LOAD_TIMEOUT:case F.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===st.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===oe.AUDIO_TRACK&&(this.state=st.IDLE);break;case F.BUFFER_ADD_CODEC_ERROR:case F.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case F.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case F.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==C.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==C.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===st.ENDED&&(this.state=st.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,q.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=o,{details:h}=f,{audio:p,text:b,id3:E,initSegment:D}=r;if(this.fragContextChanged(c)||!h){this.fragmentTracker.removeFragment(c);return}if(this.state=st.PARSING,this.switchingTrack&&p&&this.completeAudioSwitch(this.switchingTrack),D!=null&&D.tracks){const w=c.initSegment||c;if(this.unhandledEncryptionError(D,c))return;this._bufferInitSegment(f,D.tracks,w,s),i.trigger(g.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:n,tracks:D.tracks})}if(p){const{startPTS:w,endPTS:j,startDTS:fe,endDTS:ae}=p;u&&(u.elementaryStreams[C.AUDIO]={startPTS:w,endPTS:j,startDTS:fe,endDTS:ae}),c.setElementaryStreamInfo(C.AUDIO,w,j,fe,ae),this.bufferFragmentData(p,c,u,s)}if(E!=null&&(t=E.samples)!=null&&t.length){const w=d({id:n,frag:c,details:h},E);i.trigger(g.FRAG_PARSING_METADATA,w)}if(b){const w=d({id:n,frag:c,details:h},b);i.trigger(g.FRAG_PARSING_USERDATA,w)}}_bufferInitSegment(e,t,n,i){if(this.state!==st.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=q.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(g.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(g.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===vn.NOT_LOADED||i===vn.PARTIAL){var r;if(!Se(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=st.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&as(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o}=this.bufferedTrack;Fe({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,ft)||(Gt(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(g.AUDIO_TRACK_SWITCHED,y({},e))}}class la extends N{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const o=i[s];let c;try{c=new self.URL(o.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=o.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||t.lastPartSn;let c=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&vt(n);return new qe(o,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),o=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const f=Math.max(c||0,0);i.appliedTimelineOffset=f,i.fragments.forEach(h=>{h.setStart(h.playlistOffset+f)})}if(i.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){ms(n,i,this);const fe=i.playlistParsingError;if(fe){this.warn(fe);const ae=this.hls;if(!ae.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Pe}=t;ae.trigger(g.ERROR,{type:ne.NETWORK_ERROR,details:F.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:fe,reason:fe.message,level:t.level||void 0,parent:(u=i.fragments[0])==null?void 0:u.type,networkDetails:Pe,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const h=this.hls.mainForwardBufferInfo,p=h?h.end-h.len:0,b=(i.edge-p)*1e3,E=Ki(i,b);if(i.requestScheduled+E<s?i.requestScheduled=s:i.requestScheduled+=E,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let D,w,j;if(i.canBlockReload&&i.endSN&&i.advanced){const fe=this.hls.config.lowLatencyMode,ae=i.lastPartSn,Pe=i.endSN,Ve=i.lastPartIndex,ut=Ve!==-1,Be=ae===Pe;ut?Be?(w=Pe+1,j=fe?0:Ve):(w=ae,j=fe?Ve+1:i.maxPartIndex):w=Pe+1;const Xe=i.age,Je=Xe+i.ageHeader;let $e=Math.min(Je-i.partTarget,i.targetduration*1.5);if($e>0){if(Je>i.targetduration*3)this.log(`Playlist last advanced ${Xe.toFixed(2)}s ago. Omitting segment and part directives.`),w=void 0,j=void 0;else if(n!=null&&n.tuneInGoal&&Je-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${$e} with playlist age: ${i.age}`),$e=0;else{const At=Math.floor($e/i.targetduration);if(w+=At,j!==void 0){const ln=Math.round($e%i.targetduration/i.partTarget);j+=ln}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Xe.toFixed(2)}s goal: ${$e} skip sn ${At} to part ${j}`)}i.tuneInGoal=$e}if(D=this.getDeliveryDirectives(i,t.deliveryDirectives,w,j),fe||!Be){i.requestScheduled=s,this.loadingPlaylist(f,D);return}}else(i.canBlockReload||i.canSkipUntil)&&(D=this.getDeliveryDirectives(i,t.deliveryDirectives,w,j));D&&w!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(E-o*2,E/2)),this.scheduleLoading(f,D,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),s=i.requestScheduled;if(r>=s){this.loadingPlaylist(e,t);return}const o=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,n,i){let r=vt(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=pe.No),new qe(n,i,r)}checkRetry(e){const t=e.details,n=Qt(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},c=!!i&&!!o&&(r===Ht.RetryRequest||!i.resolved&&r===Ht.SendAlternateToPenaltyBox);if(c){var u;if(s>=o.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=Nt(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function ao(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!Ss(a[t].attrs,e[t].attrs))return!1;return!0}function Ss(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 ua(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class ou extends la{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(g.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(p=>!n||n.indexOf(p.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(p=>p.default)&&(this.selectDefaultTrack=!1),o.forEach((p,b)=>{p.id=b});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!r&&c){const p=Le(c,o,ft);if(p>-1)r=o[p];else{const b=Le(c,this.tracks);r=this.tracks[b]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const f={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(g.AUDIO_TRACKS_UPDATED,f);const h=this.trackId;if(u!==-1&&h===-1)this.setAudioTrack(u);else if(o.length&&h===-1){var s;const p=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(p.message),this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:p})}}}onError(e,t){t.fatal||!t.context||t.context.type===oe.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&Fe(e,i,ft))return i;const r=Le(e,this.tracksInGroup,ft);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=Et(e,t.levels,n,s,ft);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Le(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(g.AUDIO_TRACK_SWITCHING,y({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||Fe(e,i,ft)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(Fe({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c},f,ft))return u}for(let u=0;u<t.length;u++){const f=t[u];if(Ss(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(Ss(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Gt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(g.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class lu{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(r){var n;if(i.onError(r),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],i=n==null?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const oo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,lo="HlsJsTrackRemovedError";class uu extends Error{constructor(e){super(e),this.name=lo}}class cu extends N{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:r}=this;n&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(g.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=xe(X(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.BUFFER_RESET,this.onBufferReset,this),e.on(g.BUFFER_APPENDING,this.onBufferAppending,this),e.on(g.BUFFER_CODECS,this.onBufferCodecs,this),e.on(g.BUFFER_EOS,this.onBufferEos,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.FRAG_PARSED,this.onFragParsed,this),e.on(g.FRAG_CHANGED,this.onFragChanged,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.BUFFER_RESET,this.onBufferReset,this),e.off(g.BUFFER_APPENDING,this.onBufferAppending,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.BUFFER_EOS,this.onBufferEos,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.FRAG_PARSED,this.onFragParsed,this),e.off(g.FRAG_CHANGED,this.onFragChanged,this),e.off(g.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const s=this.isQueued();(r||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?d(n,i.tracks):this.sourceBuffers.forEach(r=>{const[s]=r;s&&(n[s]=d({},this.tracks[s]),this.removeBuffer(s)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media;this.transferData=this.overrides=void 0;const i=X(this.appendSource);if(i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),r)this._objectUrl=n.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,uo(n),fu(n,o),n.load()}catch(c){n.src=o}else n.src=o}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,s=r?r.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&r&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${tt(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${tt(i,(c,u)=>c==="initSegment"?void 0:u)}}`),!he(i,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(g.MEDIA_DETACHING,{}),this.onMediaAttaching(g.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,r.forEach(c=>{const u=c,f=i[u];if(f){const h=f.buffer;if(h){const p=this.fragmentTracker,b=f.id;if(p.hasFragments(b)||p.hasParts(b)){const w=rn.getBuffered(h);p.detectEvictedFragments(u,w,b,null,!0)}const E=ca(u),D=[u,h];this.sourceBuffers[E]=D,h.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:s}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const c=r.sourceBuffers;for(let u=c.length;u--;)o&&c[u].abort(),r.removeSourceBuffer(c[u]);o&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&uo(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(g.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ca(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new lu(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!r&&this.sourceBufferCount&&this.media&&i.some(o=>!n[o]);if(r||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(o=>{var c,u;const f=t[o],{id:h,codec:p,levelCodec:b,container:E,metadata:D,supplemental:w}=f;let j=n[o];const fe=(c=this.transferData)==null||(c=c.tracks)==null?void 0:c[o],ae=fe!=null&&fe.buffer?fe:j,Pe=(ae==null?void 0:ae.pendingCodec)||(ae==null?void 0:ae.codec),Ve=ae==null?void 0:ae.levelCodec;j||(j=n[o]={buffer:void 0,listeners:[],codec:p,supplemental:w,container:E,levelCodec:b,metadata:D,id:h});const ut=_e(Pe,Ve),Be=ut==null?void 0:ut.replace(oo,"$1");let Xe=_e(p,b);const Je=(u=Xe)==null?void 0:u.replace(oo,"$1");Xe&&ut&&Be!==Je&&(o.slice(0,5)==="audio"&&(Xe=ie(Xe,this.appendSource)),this.log(`switching codec ${Pe} to ${Xe}`),Xe!==(j.pendingCodec||j.codec)&&(j.pendingCodec=Xe),j.container=E,this.appendChangeType(o,E,Xe))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,q.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&rn.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,q.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:s,frag:o,part:c,chunkMeta:u,offset:f}=t,h=u.buffering[r],{sn:p,cc:b}=o,E=self.performance.now();h.start=E;const D=o.stats.buffering,w=c?c.stats.buffering:null;D.start===0&&(D.start=E),w&&w.start===0&&(w.start=E);const j=n.audio;let fe=!1;r==="audio"&&(j==null?void 0:j.container)==="audio/mpeg"&&(fe=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const ae=n.video,Pe=ae==null?void 0:ae.buffer;if(Pe&&p!=="initSegment"){const Be=c||o,Xe=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(ae.ending||ae.ended)){const $e=Be.start+Be.duration*.05,At=Pe.buffered,ln=this.currentOp("video");!At.length&&!ln?this.blockAudio(Be):!ln&&!rn.isBuffered(Pe,$e)&&this.lastVideoAppendEnd<$e&&this.blockAudio(Be)}else if(r==="video"){const Je=Be.end;if(Xe){const $e=Xe.frag.start;(Je>$e||Je<this.lastVideoAppendEnd||rn.isBuffered(Pe,$e))&&this.unblockAudio()}this.lastVideoAppendEnd=Je}}const Ve=(c||o).start,ut={label:`append-${r}`,execute:()=>{var Be;h.executeStart=self.performance.now();const Xe=(Be=this.tracks[r])==null?void 0:Be.buffer;Xe&&(fe?this.updateTimestampOffset(Xe,Ve,.1,r,p,b):f!==void 0&&A(f)&&this.updateTimestampOffset(Xe,f,1e-6,r,p,b)),this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const Be=self.performance.now();h.executeEnd=h.end=Be,D.first===0&&(D.first=Be),w&&w.first===0&&(w.first=Be);const Xe={};this.sourceBuffers.forEach(([Je,$e])=>{Je&&(Xe[Je]=rn.getBuffered($e))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(g.BUFFER_APPENDED,{type:r,frag:o,part:c,chunkMeta:u,parent:o.type,timeRanges:Xe})},onError:Be=>{var Xe;const Je={type:ne.MEDIA_ERROR,parent:o.type,details:F.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:c,chunkMeta:u,error:Be,err:Be,fatal:!1},$e=(Xe=this.media)==null?void 0:Xe.error;if(Be.code===DOMException.QUOTA_EXCEEDED_ERR||Be.name=="QuotaExceededError"||"quota"in Be)Je.details=F.BUFFER_FULL_ERROR;else if(Be.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!$e)Je.errorAction=qn(!0);else if(Be.name===lo&&this.sourceBufferCount===0)Je.errorAction=qn(!0);else{const At=++this.appendErrors[r];this.warn(`Failed ${At}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${$e||"no media error"})`),(At>=this.hls.config.appendErrorMaxRetry||$e)&&(Je.fatal=!0)}this.hls.trigger(g.ERROR,Je)}};this.append(ut,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(g.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,r),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[C.AUDIOVIDEO]?r.push("audiovideo"):(s[C.AUDIO]&&r.push("audio"),s[C.VIDEO]&&r.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const u=i?i.stats:n.stats;this.hls.trigger(g.FRAG_BUFFERED,{frag:n,part:i,stats:u,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,r).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})?i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(g.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(g.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===F.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;A(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const i=e.config,r=n.currentTime,s=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(A(o)&&o>=0){const u=Math.max(o,s),f=Math.floor(r/s)*s-u;this.flushBackBuffer(r,s,f)}const c=i.frontBufferFlushThreshold;if(A(c)&&c>0){const u=Math.max(i.maxBufferLength,c),f=Math.max(u,s),h=Math.floor(r/s)*s+f;this.flushFrontBuffer(r,s,h)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=rn.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(g.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(g.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(g.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=rn.getBuffered(r),o=s.length;if(o<2)return;const c=s.start(o-1),u=s.end(o-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(g.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),f=Math.max(u,i);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return A(r)?{duration:r}:null;const s=this.media.duration,o=A(n.duration)?n.duration:0;return i>o&&i>s||!A(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(A(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${n}.`),i.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${tt(n)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(g.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const s=r,o=e[s];if(this.isPending(o)){const c=this.getTrackCodec(o,s),u=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${tt(o)}`);try{const f=n.addSourceBuffer(u),h=ca(s),p=[s,f];t[h]=p,o.buffer=f}catch(f){var i;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&Tn(n,"video")&&(i=le(i,n));const r=_e(i,e.levelCodec);return r?t.slice(0,5)==="audio"?ie(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(g.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,n,i,r,s){const o=t-e.timestampOffset;Math.abs(o)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=A(i.duration)?i.duration:1/0,u=A(r.duration)?r.duration:1/0,f=Math.max(0,t),h=Math.min(n,c,u);h>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${h}] from the ${e} SourceBuffer`),o.remove(f,h)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new uu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const i=(n=this.tracks[t])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const s=n.bind(this,e);i.listeners.push({event:t,listener:s}),r.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function uo(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function fu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ca(a){return a==="audio"?1:0}class fa{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(g.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.BUFFER_CODECS,this.onBufferCodecs,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(g.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.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&&A(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,fa.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&i(c,e[o+1])){r=o;break}}return r}}const lr={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},hu={HLS:"h"};class Rr{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Rr?n:new Rr(n))),this.value=e,this.params=t}}const du="Dict";function pu(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 gu(a,e,t,n){return new Error(`failed to ${a} "${pu(e)}" as ${t}`,{cause:n})}function Ir(a,e,t){return gu("serialize",a,e,t)}class co{constructor(e){this.description=e}}const fo="Bare Item",mu="Boolean";function _u(a){if(typeof a!="boolean")throw Ir(a,mu);return a?"?1":"?0"}function vu(a){return btoa(String.fromCharCode(...a))}const yu="Byte Sequence";function bu(a){if(ArrayBuffer.isView(a)===!1)throw Ir(a,yu);return`:${vu(a)}:`}const Eu="Integer";function xu(a){return a<-999999999999999||999999999999999<a}function ho(a){if(xu(a))throw Ir(a,Eu);return a.toString()}function Su(a){return`@${ho(a.getTime()/1e3)}`}function po(a,e){if(a<0)return-po(-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}const wu="Decimal";function Tu(a){const e=po(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Ir(a,wu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Au="String",Du=/[\x00-\x1f\x7f]+/;function Ru(a){if(Du.test(a))throw Ir(a,Au);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Iu(a){return a.description||a.toString().slice(7,-1)}const Cu="Token";function go(a){const e=Iu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ir(e,Cu);return e}function ha(a){switch(typeof a){case"number":if(!A(a))throw Ir(a,fo);return Number.isInteger(a)?ho(a):Tu(a);case"string":return Ru(a);case"symbol":return go(a);case"boolean":return _u(a);case"object":if(a instanceof Date)return Su(a);if(a instanceof Uint8Array)return bu(a);if(a instanceof co)return go(a);default:throw Ir(a,fo)}}const Lu="Key";function da(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ir(a,Lu);return a}function pa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${da(e)}`:`;${da(e)}=${ha(t)}`).join("")}function mo(a){return a instanceof Rr?`${ha(a.value)}${pa(a.params)}`:ha(a)}function ku(a){return`(${a.value.map(mo).join(" ")})${pa(a.params)}`}function Pu(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw Ir(a,du);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=da(i);return r.value===!0?s+=pa(r.params):(s+="=",Array.isArray(r.value)?s+=ku(r):s+=mo(r)),s}).join(`,${n}`)}function _o(a,e){return Pu(a,e)}const Cr="CMCD-Object",Pi="CMCD-Request",Qr="CMCD-Session",Zr="CMCD-Status",Ou={br:Cr,ab:Cr,d:Cr,ot:Cr,tb:Cr,tpb:Cr,lb:Cr,tab:Cr,lab:Cr,url:Cr,pb:Pi,bl:Pi,tbl:Pi,dl:Pi,ltc:Pi,mtp:Pi,nor:Pi,nrr:Pi,rc:Pi,sn:Pi,sta:Pi,su:Pi,ttfb:Pi,ttfbb:Pi,ttlb:Pi,cmsdd:Pi,cmsds:Pi,smrt:Pi,df:Pi,cs:Pi,ts:Pi,cid:Qr,pr:Qr,sf:Qr,sid:Qr,st:Qr,v:Qr,msd:Qr,bs:Zr,bsd:Zr,cdn:Zr,rtp:Zr,bg:Zr,pt:Zr,ec:Zr,e:Zr},Mu={REQUEST:Pi};function Fu(a){return Object.keys(a).reduce((e,t)=>{var n;return(n=a[t])===null||n===void 0||n.forEach(i=>e[i]=t),e},{})}function Nu(a,e){const t={};if(!a)return t;const n=Object.keys(a),i=e?Fu(e):{};return n.reduce((r,s)=>{var o;const c=Ou[s]||i[s]||Mu.REQUEST,u=(o=r[c])!==null&&o!==void 0?o:r[c]={};return u[s]=a[s],r},t)}function Bu(a){return["ot","sf","st","e","sta"].includes(a)}function Uu(a){return typeof a=="number"?A(a):a!=null&&a!==""&&a!==!1}const vo="event";function $u(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("/")+t.search+t.hash}const Ms=a=>Math.round(a),ga=(a,e)=>Array.isArray(a)?a.map(t=>ga(t,e)):a instanceof Rr&&typeof a.value=="string"?new Rr(ga(a.value,e),a.params):(e.baseUrl&&(a=$u(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),Fs=a=>Ms(a/100)*100,Ku={br:Ms,d:Ms,bl:Fs,dl:Fs,mtp:Fs,nor:(a,e)=>{let t=a;return e.version>=2&&(a instanceof Rr&&typeof a.value=="string"?t=new Rr([a]):typeof a=="string"&&(t=[a])),ga(t,e)},rtp:Fs,tb:Ms},yo="request",bo="response",ma=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],Gu=["e"],Vu=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Ns(a){return Vu.test(a)}function zu(a){return ma.includes(a)||Gu.includes(a)||Ns(a)}const Eo=["d","dl","nor","ot","rtp","su"];function Zu(a){return ma.includes(a)||Eo.includes(a)||Ns(a)}const ju=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function Hu(a){return ma.includes(a)||Eo.includes(a)||ju.includes(a)||Ns(a)}const Wu=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function Yu(a){return Wu.includes(a)||Ns(a)}const Xu={[bo]:Hu,[vo]:zu,[yo]:Zu};function xo(a,e={}){const t={};if(a==null||typeof a!="object")return t;const n=e.version||a.v||1,i=e.reportingMode||yo,r=n===1?Yu:Xu[i];let s=Object.keys(a).filter(r);const o=e.filter;typeof o=="function"&&(s=s.filter(o));const c=i===bo||i===vo;c&&!s.includes("ts")&&s.push("ts"),n>1&&!s.includes("v")&&s.push("v");const u=d({},Ku,e.formatters),f={version:n,reportingMode:i,baseUrl:e.baseUrl};return s.sort().forEach(h=>{let p=a[h];const b=u[h];if(typeof b=="function"&&(p=b(p,f)),h==="v"){if(n===1)return;p=n}h=="pr"&&p===1||(c&&h==="ts"&&!A(p)&&(p=Date.now()),Uu(p)&&(Bu(h)&&typeof p=="string"&&(p=new co(p)),t[h]=p))}),t}function Qu(a,e={}){const t={};if(!a)return t;const n=xo(a,e),i=Nu(n,e==null?void 0:e.customHeaderMap);return Object.entries(i).reduce((r,[s,o])=>{const c=_o(o,{whitespace:!1});return c&&(r[s]=c),r},t)}function qu(a,e,t){return d(a,Qu(e,t))}const Ju="CMCD";function ec(a,e={}){return a?_o(xo(a,e),{whitespace:!1}):""}function tc(a,e={}){if(!a)return"";const t=ec(a,e);return encodeURIComponent(t)}function nc(a,e={}){if(!a)return"";const t=tc(a,e);return`${Ju}=${t}`}const So=/CMCD=[^&#]+/;function ic(a,e,t){const n=nc(e,t);if(!n)return a;if(So.test(a))return a.replace(So,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class rc{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:lr.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:s}=i,o=this.hls.levels[r.level],c=this.getObjectType(r),u={d:(s||r).duration*1e3,ot:c};(c===lr.VIDEO||c===lr.AUDIO||c==lr.MUXED)&&(u.br=o.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(r);f!=null&&f.url&&f.url!==r.url&&(u.nor=f.url),this.apply(i,u)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHED,this.onMediaDetached,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHED,this.onMediaDetached,this),e.off(g.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:hu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){d(t,this.createData());const n=t.ot===lr.INIT||t.ot===lr.VIDEO||t.ot===lr.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),qu(e.headers,t,r)):e.url=ic(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const i=e.sn-n.startSN;return n.fragments[i+1]}}getNextPart(e){var t;const{index:n,fragment:i}=e,r=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(r){const{sn:s}=i;for(let o=r.length-1;o>=0;o--){const c=r[o];if(c.index===n&&c.fragment.sn===s)return r[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return lr.TIMED_TEXT;if(e.sn==="initSegment")return lr.INIT;if(t==="audio")return lr.AUDIO;if(t==="main")return this.hls.audioTracks.length?lr.VIDEO:lr.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===lr.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}return n.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===lr.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:rn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}}const sc=3e5;class ac extends N{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Ht.SendAlternateToPenaltyBox&&n.flags===Mn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:u}=t.context;o&&i?s=this.getPathwayForGroupId(o,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),t.details===F.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${tt(r)} penalized: ${tt(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]>sc&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,or(t),this.hls.trigger(g.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===oe.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===oe.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=r;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(o).map(f=>{const h=new oi(f.attrs);h["PATHWAY-ID"]=s;const p=h.AUDIO&&`${h.AUDIO}_clone_${s}`,b=h.SUBTITLES&&`${h.SUBTITLES}_clone_${s}`;p&&(n[h.AUDIO]=p,h.AUDIO=p),b&&(i[h.SUBTITLES]=b,h.SUBTITLES=b);const E=To(f.uri,h["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),D=new pt({attrs:h,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:E,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let w=1;w<f.audioGroups.length;w++)D.addGroupId("audio",`${f.audioGroups[w]}_clone_${s}`);if(f.subtitleGroups)for(let w=1;w<f.subtitleGroups.length;w++)D.addGroupId("text",`${f.subtitleGroups[w]}_clone_${s}`);return D});t.push(...u),wo(this.audioTracks,n,c,s),wo(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+f)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},u={onSuccess:(f,h,p,b)=>{this.log(`Loaded steering manifest: "${i}"`);const E=f.data;if((E==null?void 0:E.VERSION)!==1){this.log(`Steering VERSION ${E.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=E.TTL;const{"RELOAD-URI":D,"PATHWAY-CLONES":w,"PATHWAY-PRIORITY":j}=E;if(D)try{this.uri=new self.URL(D,i).href}catch(ae){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${D}`);return}this.scheduleRefresh(this.uri||p.url),w&&this.clonePathways(w);const fe={steeringManifest:E,url:i.toString()};this.hls.trigger(g.STEERING_MANIFEST_LOADED,fe),j&&this.updatePathwayPriority(j)},onError:(f,h,p,b)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${h.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${h.url} no longer available`);return}let E=this.timeToLoad*1e3;if(f.code===429){const D=this.loader;if(typeof(D==null?void 0:D.getResponseHeader)=="function"){const w=D.getResponseHeader("Retry-After");w&&(E=parseFloat(w)*1e3)}this.log(`Steering manifest ${h.url} rate limited`);return}this.scheduleRefresh(this.uri||h.url,E)},onTimeout:(f,h,p)=>{this.log(`Timeout loading steering manifest (${h.url})`),this.scheduleRefresh(this.uri||h.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function wo(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const o=d({},s);return o.details=void 0,o.attrs=new oi(o.attrs),o.url=o.attrs.URI=To(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});a.push(...r)})}function To(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return i&&!o&&(c.host=i),r&&Object.keys(r).sort().forEach(u=>{u&&c.searchParams.set(u,r[u])}),c.href}function cr(a,e,t){mr(a,e,t),a.addEventListener(e,t)}function mr(a,e,t){a.removeEventListener(e,t)}class fs extends N{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=fs.CDMCleanupPromise?[fs.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=Ln(this.config));const o=s.map(Rn).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Pn(s);if(n!=="sinf"||o!==jn.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}let c;try{const b=Oe(new Uint8Array(i)),E=$i(JSON.parse(b).sinf),D=et(E);if(!D)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(D.subarray(8,24))}catch(b){this.warn(`${r} Failed to parse sinf: ${b}`);return}const u=K.hexDump(c),{keyIdToKeySessionPromise:f,mediaKeySessions:h}=this;let p=f[u];for(let b=0;b<h.length;b++){const E=h[b],D=E.decryptdata;if(!D.keyId)continue;const w=K.hexDump(D.keyId);if(u===w||D.uri.replace(/-/g,"").indexOf(u)!==-1){if(p=f[w],!p)continue;if(D.pssh)break;delete f[w],D.pssh=new Uint8Array(i),D.keyId=c,p=f[u]=p.then(()=>this.generateRequestWithPreferredKeySession(E,n,i,"encrypted-event-key-match")),p.catch(j=>this.handleError(j));break}}p||this.handleError(new Error(`Key ID ${u} not encountered in playlist. Key-system sessions ${h.length}.`))}).catch(s=>this.handleError(s))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),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.onWaitingForKey=null}registerListeners(){this.hls.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(g.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(g.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(g.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(g.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(g.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(g.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===jn.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,o,c)=>!!s&&c.indexOf(s)===o,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,o)=>{const c=u=>{const f=u.shift();this.getMediaKeysPromise(f,i,r).then(h=>s({keySystem:f,mediaKeys:h})).catch(h=>{u.length?c(u):h instanceof _r?o(h):o(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_NO_ACCESS,error:h,fatal:!0},h.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return ni===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=fi(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: ${tt(i)}`),s=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),o.hasMediaKeys=!0,u.then(h=>h?this.setMediaKeysServerCertificate(f,e,h):f))),o.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),o.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${K.hexDump(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return K.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${K.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Rn(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const r=Rn(i);r?t(r):n(new Error(`Unable to find format for key-system "${i}"`))}).catch(n))}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){const t=Ln(this.config),n=e.map(Pn).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:o,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(o=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(o,c,u,"playlist-key")})).catch(o=>this.handleError(o))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof _r?this.hls.trigger(g.ERROR,e.data):this.hls.trigger(g.ERROR,{type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Pn(e.keyFormat),r=i?[i]:Ln(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Ln(this.config)),e.length===0)throw new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${tt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,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;const s=(r=this.config.drmSystems)==null||(r=r[e.keySystem])==null?void 0:r.generateRequest;if(s)try{const b=s.call(this.hls,t,n,e);if(!b)throw new Error("Invalid response from configured generateRequest filter");t=b.initDataType,n=b.initData?b.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(b){var o;if(this.warn(b.message),(o=this.hls)!=null&&o.config.debug)throw b}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${n?n.byteLength:null})`);const u=new ls,f=e._onmessage=b=>{const E=e.mediaKeysSession;if(!E){u.emit("error",new Error("invalid state"));return}const{messageType:D,message:w}=b;this.log(`"${D}" message event for session "${E.sessionId}" message size: ${w.byteLength}`),D==="license-request"||D==="license-renewal"?this.renewLicense(e,w).catch(j=>{u.eventNames().length?u.emit("error",j):this.handleError(j)}):D==="license-release"?e.keySystem===jn.FAIRPLAY&&(this.updateKeySession(e,xi("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${D}"`)},h=e._onkeystatuseschange=b=>{if(!e.mediaKeysSession){u.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const D=e.keyStatus;u.emit("keyStatus",D),D==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};cr(e.mediaKeysSession,"message",f),cr(e.mediaKeysSession,"keystatuseschange",h);const p=new Promise((b,E)=>{u.on("error",E),u.on("keyStatus",D=>{D.startsWith("usable")?b():D==="output-restricted"?E(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):D==="internal-error"?E(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${D}"`)):D==="expired"?E(new Error("key expired while generating request")):this.warn(`unhandled key status change "${D}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var b;this.log(`Request generated for key-session "${(b=e.mediaKeysSession)==null?void 0:b.sessionId}" keyId: ${c}`)}).catch(b=>{throw new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_NO_SESSION,error:b,fatal:!1},`Error generating key-session request: ${b}`)}).then(()=>p).catch(b=>{throw u.removeAllListeners(),this.removeSession(e),b}).then(()=>(u.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const i=n;n=t,t=i}this.log(`key status change "${t}" for keyStatuses keyId: ${K.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${K.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:r},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(p,b,E,D)=>{s(p.data)},onError:(p,b,E,D)=>{o(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:y({url:c.url,data:void 0},p)},`"${e}" certificate request failed (${r}). Status: ${p.code} (${p.text})`))},onTimeout:(p,b,E)=>{o(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(p,b,E)=>{o(new Error("aborted"))}};i.load(c,f,h)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.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 _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let f;for(let h=0,p=r.length;h<p;h++){var s,o;f=r[h];const b=(s=f.querySelector("name"))==null?void 0:s.textContent,E=(o=f.querySelector("value"))==null?void 0:o.textContent;b&&E&&e.setRequestHeader(b,E)}}const c=i.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return xi(atob(u))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,o,s,e)}catch(f){this.error(f)}i(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)r(new _r({type:ne.KEY_SYSTEM_ERROR,details:F.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==jn.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,cr(n,"encrypted",this.onMediaEncrypted),cr(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(mr(e,"encrypted",this.onMediaEncrypted),mr(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,ui.clearKeyUriToKeyIdMap();const i=n.length;fs.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(r=>{var s;this.log(`Could not clear media keys: ${r}`),(s=this.hls)==null||s.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).catch(r=>{var s;this.log(`Could not close sessions and clear media keys: ${r}`),(s=this.hls)==null||s.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})}).then(()=>{i&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{drmSystemOptions:r}=this.config;return(sn(r)?new Promise((o,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(o)}):Promise.resolve()).catch(o=>{var c;this.log(`Could not remove session: ${o}`),(c=this.hls)==null||c.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${o}`)})}).then(()=>t.close()).catch(o=>{var c;this.log(`Could not close session: ${o}`),(c=this.hls)==null||c.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${o}`)})})}}}fs.CDMCleanupPromise=void 0;class _r extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class oc{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(g.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(g.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(g.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/r,u=this.hls;if(u.trigger(g.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*o){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(g.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function Ao(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 Do(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){J.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){J.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function hs(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function _a(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=uc(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 lc(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t,r;for(;n<=i;)if(r=Math.floor((i+n)/2),e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r;return a[n].startTime-e<e-a[i].startTime?n:i}function uc(a,e,t){const n=[],i=lc(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const o=a[r];if(o.startTime>=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Bs(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class cc extends la{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Bs(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(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(g.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(g.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;Bs(n.textTracks).forEach(s=>{hs(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,h)=>{f.id=h});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const f=Le(o,s);if(f>-1)r=s[f];else{const h=Le(o,this.tracks);r=this.tracks[h]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(g.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||Fe(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(Ss(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(Ss(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(ua(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===oe.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Fe(e,n))return n;const i=Le(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Le(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(g.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Bs(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>ua(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||!A(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(g.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:o="",name:c,type:u,url:f}=i;this.hls.trigger(g.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:f});const h=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(h)}}function fc(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function ws(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const ds=.025;let Us=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function hc(a,e,t){return`${a.identifier}-${t+1}-${ws(e)}`}class dc{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return va(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=va(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=A(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return va(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<ds))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Us.Range:Us.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return pc(this)}}function va(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<ds)?e.start:e.start+e.duration}function Ro(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function ya(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function pc(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ps(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class gc{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(g.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;const s=()=>{this.hasDetails=!0};r.once(g.LEVEL_LOADED,s),r.once(g.AUDIO_TRACK_LOADED,s),r.once(g.SUBTITLE_TRACK_LOADED,s),r.on(g.MEDIA_ATTACHING,(o,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(g.BUFFER_APPENDED,()=>{const f=this.bufferedEnd;this.reachedPlayout(f)&&(this._bufferedEosTime=f,r.trigger(g.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Ro(t,e.config.primarySessionId||"").href}catch(n){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,r=rn.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=n-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=rn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,n){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,n){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${ps(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Io=.033;class mc extends N{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=i[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const r=n[i].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if(((n=t[i].event)==null?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let r=0;r<i;r++){const s=n[r];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&(t<o+(s.duration||0)||r===i-1))return r}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const n=t.assetList,i=n[n.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,s=this.parseDateRanges(i,{url:n.url},t),o=Object.keys(i),c=r?r.filter(u=>!o.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const h=u.cue.pre,p=u.cue.post,b=f.cue.pre,E=f.cue.post;if(h&&!b)return-1;if(b&&!h||p&&!E)return 1;if(E&&!p)return-1;if(!h&&!b&&!p&&!E){const D=u.startTime,w=f.startTime;if(D!==w)return D-w}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],n=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,s=this.parseSchedule(i,e);(n||t.length||(r==null?void 0:r.length)!==s.length||s.some((c,u)=>Math.abs(c.playout.start-r[u].playout.start)>.005||Math.abs(c.playout.end-r[u].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],c=e[o];if(c.isInterstitial){let u=this.eventMap[o];u?u.setDateRange(c):(u=new dc(c,t),this.eventMap[o]=u,n===!1&&(u.appendInPlace=n)),i.push(u)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,h)=>{const p=f.cue.pre,b=f.cue.post,E=e[h-1]||null,D=f.appendInPlace,w=b?r:f.startOffset,j=f.duration,fe=f.timelineOccupancy===Us.Range?j:0,ae=f.resumptionOffset,Pe=(E==null?void 0:E.startTime)===w,Ve=w+f.cumulativeDuration;let ut=D?Ve+j:w+ae;if(p||!b&&w<=0){const Xe=u;u+=fe,f.timelineStart=Ve;const Je=s;s+=j,n.push({event:f,start:Ve,end:ut,playout:{start:Je,end:s},integrated:{start:Xe,end:u}})}else if(w<=r){if(!Pe){const $e=w-c;if($e>Io){const At=c,ln=u;u+=$e;const Sn=s;s+=$e;const On={previousEvent:e[h-1]||null,nextEvent:f,start:At,end:At+$e,playout:{start:Sn,end:s},integrated:{start:ln,end:u}};n.push(On)}else $e>0&&E&&(E.cumulativeDuration+=$e,n[n.length-1].end=w)}b&&(ut=Ve),f.timelineStart=Ve;const Xe=u;u+=fe;const Je=s;s+=j,n.push({event:f,start:Ve,end:ut,playout:{start:Je,end:s},integrated:{start:Xe,end:u}})}else return;const Be=f.resumeTime;b||Be>r?c=r:c=Be}),c<r){var o;const f=c,h=u,p=r-c;u+=p;const b=s;s+=p,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:f+p,playout:{start:b,end:s},integrated:{start:h,end:u}})}this.setDurations(r,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,i=n.live?1/0:n.edge;let r=0,s=-1;e.forEach((o,c)=>{const u=o.cue.pre,f=o.cue.post,h=u?0:f?i:o.startTime;this.updateAssetDurations(o),s===h?o.cumulativeDuration=r:(r=0,s=h),!f&&o.snapOptions.in&&(o.resumeAnchor=Zt(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<Io&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const b=A(o.resumeOffset)?o.resumeOffset:o.duration;r+=b})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>ds?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):!Object.keys(t).some(s=>{const o=t[s].details,c=o.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=Zt(null,o.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<ds+f||Math.abs(u.end-n)<ds+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;for(let s=0;s<e.assetList.length;s++){const o=e.assetList[s],c=t+n;o.startOffset=n,o.timelineStart=c,i||(i=o.duration===null),r||(r=!!o.error);const u=o.error?0:o.duration||0;n+=u}i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Nr(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class _c{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=Ro(n,this.hls.sessionId,e.baseUrl)}catch(p){const b=this.assignAssetListError(e,F.ASSET_LIST_LOAD_ERROR,p,n);this.hls.trigger(g.ERROR,b);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),c={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(p,b,E,D)=>{const w=p.data,j=w==null?void 0:w.ASSETS;if(!Array.isArray(j)){const fe=this.assignAssetListError(e,F.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),E.url,b,D);this.hls.trigger(g.ERROR,fe);return}e.assetListResponse=w,this.hls.trigger(g.ASSET_LIST_LOADED,{event:e,assetListResponse:w,networkDetails:D})},onError:(p,b,E,D)=>{const w=this.assignAssetListError(e,F.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${p.code} ${p.text} (${b.url})`),b.url,D,E);this.hls.trigger(g.ERROR,w)},onTimeout:(p,b,E)=>{const D=this.assignAssetListError(e,F.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${b.url})`),b.url,p,E);this.hls.trigger(g.ERROR,D)}};return o.load(c,f,h),this.hls.trigger(g.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:ne.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function Co(a){a==null||a.play().catch(()=>{})}class vc extends N{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled||!this.schedule)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(!0),this.checkBuffer(),s&&n<o.start||n>=o.end){var c;const b=this.findItemIndex(o);let E=this.schedule.findItemIndexAtTime(n);if(E===-1&&(E=b+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${n} (resolving from ${b} to ${E})`)),!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s&&E>b){const D=this.schedule.findJumpRestrictedIndex(b+1,E);if(D>b){this.setSchedulePosition(D);return}}this.setSchedulePosition(E);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(o)){const b=o.event.assetList[0];b&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,b))}return}const f=u.timelineStart,h=u.duration||0;if(s&&n<f||n>=f+h){var p;(p=o.event)!=null&&p.appendInPlace&&(this.clearInterstitial(o.event,o),this.flushFrontBuffer(n)),this.setScheduleToAssetAtTime(n,u)}},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const r=this.playingAsset;if(!r)return;const s=r.timelineStart+(r.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,i)=>{const r=this.schedule;if(!r)return;const s=this.playingItem,o=r.events||[],c=r.items||[],u=r.durations,f=n.map(D=>D.identifier),h=!!(o.length||f.length);(h||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${c.map(D=>Nr(D))} pos: ${this.timelinePos}`),f.length&&this.log(`Removed events ${f}`);let p=null,b=null;s&&(p=this.updateItem(s,this.timelinePos),this.itemsMatch(s,p)?this.playingItem=p:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const E=this.bufferingItem;if(E&&(b=this.updateItem(E,this.bufferedPos),this.itemsMatch(E,b)?this.bufferingItem=b:E.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(E.event,null))),n.forEach(D=>{D.assetList.forEach(w=>{this.clearAssetPlayer(w.identifier,null)})}),this.playerQueue.forEach(D=>{if(D.interstitial.appendInPlace){const w=D.assetItem.timelineStart,j=D.timelineOffset-w;if(j)try{D.timelineOffset=w}catch(fe){Math.abs(j)>ds&&this.warn(`${fe} ("${D.assetId}" ${D.timelineOffset}->${w})`)}}}),h||i){if(this.hls.trigger(g.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(p,s),E&&this.trimInPlace(b,E),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new _c(e),this.schedule=new mc(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(g.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(g.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(g.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(g.MEDIA_ENDED,this.onMediaEnded,this),e.on(g.ERROR,this.onError,this),e.on(g.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(g.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(g.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(g.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(g.BUFFER_CODECS,this.onBufferCodecs,this),e.off(g.BUFFER_APPENDED,this.onBufferAppended,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(g.MEDIA_ENDED,this.onMediaEnded,this),e.off(g.ERROR,this.onError,this),e.off(g.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){mr(e,"play",this.onPlay),mr(e,"pause",this.onPause),mr(e,"seeking",this.onSeeking),mr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;cr(n,"seeking",this.onSeeking),cr(n,"timeupdate",this.onTimeupdate),cr(n,"play",this.onPlay),cr(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=h=>h&&e.getAssetPlayer(h.identifier),i=(h,p,b,E,D)=>{if(h){let w=h[p].start;const j=h.event;if(j){if(p==="playout"||j.timelineOccupancy!==Us.Point){const fe=n(b);(fe==null?void 0:fe.interstitial)===j&&(w+=fe.assetItem.startOffset+fe[D])}}else{const fe=E==="bufferedPos"?s():e[E];w+=fe-h.start}return w}return 0},r=(h,p)=>{var b;if(h!==0&&p!=="primary"&&(b=e.schedule)!=null&&b.length){var E;const D=e.schedule.findItemIndexAtTime(h),w=(E=e.schedule.items)==null?void 0:E[D];if(w){const j=w[p].start-w.start;return h+j}}return h},s=()=>{const h=e.bufferedPos;return h===Number.MAX_VALUE?o("primary"):Math.max(h,0)},o=h=>{var p,b;return(p=e.primaryDetails)!=null&&p.live?e.primaryDetails.edge:((b=e.schedule)==null?void 0:b.durations[h])||0},c=(h,p)=>{var b,E;const D=e.effectivePlayingItem;if(D!=null&&(b=D.event)!=null&&b.restrictions.skip||!e.schedule)return;e.log(`seek to ${h} "${p}"`);const w=e.effectivePlayingItem,j=e.schedule.findItemIndexAtTime(h,p),fe=(E=e.schedule.items)==null?void 0:E[j],ae=e.getBufferingPlayer(),Pe=ae==null?void 0:ae.interstitial,Ve=Pe==null?void 0:Pe.appendInPlace,ut=w&&e.itemsMatch(w,fe);if(w&&(Ve||ut)){const Be=n(e.playingAsset),Xe=(Be==null?void 0:Be.media)||e.primaryMedia;if(Xe){const Je=p==="primary"?Xe.currentTime:i(w,p,e.playingAsset,"timelinePos","currentTime"),$e=h-Je,At=(Ve?Je:Xe.currentTime)+$e;if(At>=0&&(!Be||Ve||At<=Be.duration)){Xe.currentTime=At;return}}}if(fe){let Be=h;if(p!=="primary"){const Je=fe[p].start,$e=h-Je;Be=fe.start+$e}const Xe=!e.isInterstitial(fe);if((!e.isInterstitial(w)||w.event.appendInPlace)&&(Xe||fe.event.appendInPlace)){const Je=e.media||(Ve?ae==null?void 0:ae.media:null);Je&&(Je.currentTime=Be)}else if(w){const Je=e.findItemIndex(w);if(j>Je){const At=e.schedule.findJumpRestrictedIndex(Je+1,j);if(At>Je){e.setSchedulePosition(At);return}}let $e=0;if(Xe)e.timelinePos=Be,e.checkBuffer();else{const At=fe.event.assetList,ln=h-(fe[p]||fe).start;for(let Sn=At.length;Sn--;){const On=At[Sn];if(On.duration&&ln>=On.startOffset&&ln<On.startOffset+On.duration){$e=Sn;break}}}e.setSchedulePosition(j,$e)}}},u=()=>{const h=e.effectivePlayingItem;if(e.isInterstitial(h))return h;const p=t();return e.isInterstitial(p)?p:null},f={get bufferedEnd(){const h=t(),p=e.bufferingItem;if(p&&p===h){var b;return i(p,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-p.playout.start||((b=e.bufferingAsset)==null?void 0:b.startOffset)||0}return 0},get currentTime(){const h=u(),p=e.effectivePlayingItem;return p&&p===h?i(p,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-p.playout.start:0},set currentTime(h){const p=u(),b=e.effectivePlayingItem;b&&b===p&&c(h+b.playout.start,"playout")},get duration(){const h=u();return h?h.playout.end-h.playout.start:0},get assetPlayers(){var h;const p=(h=u())==null?void 0:h.event.assetList;return p?p.map(b=>e.getAssetPlayer(b.identifier)):[]},get playingIndex(){var h;const p=(h=u())==null?void 0:h.event;return p&&e.effectivePlayingAsset?p.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};return this.manager={get events(){var h;return((h=e.schedule)==null||(h=h.events)==null?void 0:h.slice(0))||[]},get schedule(){var h;return((h=e.schedule)==null||(h=h.items)==null?void 0:h.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const h=t();return e.findItemIndex(h)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const h=e.effectivePlayingItem;return e.findItemIndex(h)},primary:{get bufferedEnd(){return s()},get currentTime(){const h=e.timelinePos;return h>0?h:0},set currentTime(h){c(h,"primary")},get duration(){return o("primary")},get seekableStart(){var h;return((h=e.primaryDetails)==null?void 0:h.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(h){c(h,"integrated")},get duration(){return o("integrated")},get seekableStart(){var h;return r(((h=e.primaryDetails)==null?void 0:h.fragmentStart)||0,"integrated")}},skip:()=>{const h=e.effectivePlayingItem,p=h==null?void 0:h.event;if(p&&!p.restrictions.skip){const b=e.findItemIndex(h);if(p.appendInPlace){const E=h.playout.start+h.event.duration;c(E+.001,"playout")}else e.advanceAfterAssetEnded(p,b,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const r=(t=i)==null?void 0:t.currentTime;if(!(r===void 0||!A(r)))return r}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${tt(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const s=this.hls,o=e!==s,c=o&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(r=s.transferMedia(),this.detachedData=r),f="Primary";else if(u){const E=this.getBufferingPlayer();E?(r=E.transferMedia(),f=`${E}`):f="detached MediaSource"}else f="detached media";if(!r){if(u)r=this.detachedData,this.log(`using detachedData: MediaSource ${tt(r)}`);else if(!this.detachedData||s.media===t){const E=this.playerQueue;E.length>1&&E.forEach(D=>{if(o&&D.interstitial.appendInPlace!==c){const w=D.interstitial;this.clearInterstitial(D.interstitial,null),w.appendInPlace=!1,w.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${w}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const h=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",p=h&&r?r:t;this.log(`${h?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${f} (media.currentTime: ${t.currentTime})`);const b=this.schedule;if(p===r&&b){const E=o&&e.assetId===b.assetIdAtEnd;p.overrides={duration:b.duration,endOfStream:!o||E,cueRemoval:!o}}e.attachMedia(p)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.timelinePos=r,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(r>=0||!this.primaryLive){const s=this.timelinePos=r>0?r:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAssetBuffering(e,t){const n=e.event,i=n.findAssetIndex(t),r=ya(n,i);if(!n.isAssetPastPlayoutLimit(r))this.bufferedToEvent(e,r);else if(this.schedule){var s;const o=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,n){const i=ya(e,n);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const r=this.schedule.items;if(r){const s=t+1,o=r.length;if(s>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,e.appendInPlace&&this.advanceInPlace(c),this.checkBuffer(this.bufferedPos<c)),this.setSchedulePosition(s)}}}else{if(e.appendInPlace){const r=e.assetList[i];r&&this.advanceInPlace(r.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),o=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,s,o-1)}}setSchedulePosition(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(!i||this.playbackDisabled)return;const r=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r&&Nr(r)})`);const s=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(s)){const f=s.event,h=this.playingAsset,p=h==null?void 0:h.identifier,b=p?this.getAssetPlayer(p):null;if(b&&p&&(!this.eventItemsMatch(s,r)||t!==void 0&&p!==f.assetList[t].identifier)){var c;const E=f.findAssetIndex(h);if(this.log(`INTERSTITIAL_ASSET_ENDED ${E+1}/${f.assetList.length} ${ps(h)}`),this.endedAsset=h,this.playingAsset=null,this.hls.trigger(g.INTERSTITIAL_ASSET_ENDED,{asset:h,assetListIndex:E,event:f,schedule:i.slice(0),scheduleIndex:e,player:b}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(f,this.findItemIndex(this.playingItem),E);return}this.retreiveMediaSource(p,r),b.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&b.detachMedia()}if(!this.eventItemsMatch(s,r)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${f} ${Nr(s)}`),f.hasPlayed=!0,this.hls.trigger(g.INTERSTITIAL_ENDED,{event:f,schedule:i.slice(0),scheduleIndex:e}),f.cue.once)){var u;this.updateSchedule();const E=(u=this.schedule)==null?void 0:u.items;if(r&&E){const D=this.findItemIndex(r);this.advanceSchedule(D,E,t,s,o)}return}}this.advanceSchedule(e,i,t,s,o)}advanceSchedule(e,t,n,i,r){const s=this.schedule;if(!s)return;const o=e>=0?t[e]:null,c=this.primaryMedia,u=this.playerQueue;if(u.length&&u.forEach(f=>{const h=f.interstitial,p=s.findEventIndex(h.identifier);(p<e||p>e+1)&&this.clearInterstitial(h,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const f=o.event;if(n===void 0){n=s.findAssetIndex(f,this.timelinePos);const E=ya(f,n-1);if(f.isAssetPastPlayoutLimit(E)||f.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(f,e,n);return}n=E}const h=this.waitingItem;this.assetsBuffered(o,c)||this.setBufferingItem(o);let p=this.preloadAssets(f,n);if(this.eventItemsMatch(o,h||i)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${Nr(o)} ${f.appendInPlace?"append in place":""}`),this.hls.trigger(g.INTERSTITIAL_STARTED,{event:f,schedule:t.slice(0),scheduleIndex:e})),!f.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${f}`);return}if(f.assetListLoader&&(f.assetListLoader.destroy(),f.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${f}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const b=f.assetList[n];if(!b){this.advanceAfterAssetEnded(f,e,n||0);return}if(p||(p=this.getAssetPlayer(b.identifier)),p===null||p.destroyed){const E=f.assetList.length;this.warn(`asset ${n+1}/${E} player destroyed ${f}`),p=this.createAssetPlayer(f,b,n),p.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&f.appendInPlace&&this.isAssetBuffered(b))return;this.startAssetPlayer(p,n,t,e,c),this.shouldPlay&&Co(p.media)}else o!==null?(this.resumePrimary(o,e,i),this.shouldPlay&&Co(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i,r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Nr(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.timelinePos=o),this.attachPrimary(o,e)}if(!n)return;const s=(r=this.schedule)==null?void 0:r.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Nr(e)}`),this.hls.trigger(g.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:rn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(g.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(g.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const n=this.hls.levels[t.level],i=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const r=y(y({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const r=y(y({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=ce(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){const n=ce(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.setSubtitleOption(n)))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const r=t[i];if(r.cue.post){var n;const s=this.schedule.findEventIndex(r.identifier),o=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(e&&i){const r=this.findItemIndex(e,t);return i[r]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((r,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(r.identifier,null)});const n=e.end+.25,i=rn.bufferInfo(this.primaryMedia,n,0);(i.end>n||(i.nextStart||0)>n)&&(this.attachPrimary(n,null),this.flushFrontBuffer(n))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&((t=this.schedule)==null||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=(t=this.schedule)==null?void 0:t.items;if(!n)return;const i=rn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,n,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var u;const f=this.findItemIndex(r),h=Math.min(f+1,t.length-1),p=t[h];if((c===-1&&r&&e>=r.end||(u=p.event)!=null&&u.appendInPlace&&e+.01>=p.start)&&(c=h),this.isInterstitial(r)){const b=r.event;if(h-o>1&&b.appendInPlace===!1||b.assetList.length===0&&b.assetListLoader)return}if(this.bufferedPos=e,c>f&&c>o)this.bufferedToItem(p);else{const b=this.primaryDetails;this.primaryLive&&b&&e>b.edge-b.targetduration&&p.start<b.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(p)&&this.preloadAssets(p.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Nr(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const u=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((f,h)=>{const p=this.getAssetPlayer(f.identifier);p&&(h===u&&p.loadSource(),p.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering());this.hls.trigger(g.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(i||!r){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(s,o)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var o;const p=this.playingItem;!this.isInterstitial(p)&&(p==null||(o=p.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const p=f-c;p>0&&(u=Math.round(p*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const h=this.assetListLoader.loadAssetList(e,u);h&&(e.assetListLoader=h)}else if(!s&&i){for(let u=t;u<i;u++){const f=e.assetList[u],h=this.getAssetPlayerQueueIndex(f.identifier);(h===-1||this.playerQueue[h].destroyed)&&!f.error&&this.createAssetPlayer(e,f,u)}const c=e.assetList[t];if(c){const u=this.getAssetPlayer(c.identifier);return u&&u.loadSource(),u}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(g.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,i,r,s){const o={parentIdentifier:e.identifier,identifier:hc(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){const i=this.hls,r=i.userConfig;let s=r.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=d({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const c=i.audioTracks[i.audioTrack],u=i.subtitleTracks[i.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const Pe=this.timelinePos-t.timelineStart;if(Pe>1){const Ve=t.duration;Ve&&Pe<Ve&&(f=Pe)}}const h=t.identifier,p=y(y({},r),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:h,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||r.audioPreference,subtitlePreference:u||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(p.timelineOffset=t.timelineStart));const b=p.cmcd;b!=null&&b.sessionId&&b.contentId&&(p.cmcd=d({},b,{contentId:ws(t.uri)})),this.getAssetPlayer(h)&&this.warn(`Duplicate date range identifier ${e} and asset ${h}`);const E=new gc(this.HlsPlayerClass,p,e,t);this.playerQueue.push(E),e.assetList[n]=t;let D=!0;const w=Pe=>{if(Pe.live){var Ve;const Xe=new Error(`Interstitials MUST be VOD assets ${e}`),Je={fatal:!0,type:ne.OTHER_ERROR,details:F.INTERSTITIAL_ASSET_ITEM_ERROR,error:Xe},$e=((Ve=this.schedule)==null?void 0:Ve.findEventIndex(e.identifier))||-1;this.handleAssetItemError(Je,e,$e,n,Xe.message);return}const ut=Pe.edge-Pe.fragmentStart,Be=t.duration;(D||Be===null||ut>Be)&&(D=!1,this.log(`Interstitial asset "${h}" duration change ${Be} > ${ut}`),t.duration=ut,this.updateSchedule())};E.on(g.LEVEL_UPDATED,(Pe,{details:Ve})=>w(Ve)),E.on(g.LEVEL_PTS_UPDATED,(Pe,{details:Ve})=>w(Ve)),E.on(g.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const j=(Pe,Ve)=>{const ut=this.getAssetPlayer(h);if(ut&&Ve.tracks){ut.off(g.BUFFER_CODECS,j),ut.tracks=Ve.tracks;const Be=this.primaryMedia;this.bufferingAsset===ut.assetItem&&Be&&!ut.media&&this.bufferAssetPlayer(ut,Be)}};E.on(g.BUFFER_CODECS,j);const fe=()=>{var Pe;const Ve=this.getAssetPlayer(h);if(this.log(`buffered to end of asset ${Ve}`),!Ve||!this.schedule)return;const ut=this.schedule.findEventIndex(e.identifier),Be=(Pe=this.schedule.items)==null?void 0:Pe[ut];this.isInterstitial(Be)&&this.advanceAssetBuffering(Be,t)};E.on(g.BUFFERED_TO_END,fe);const ae=Pe=>()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;this.shouldPlay=!0;const ut=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,ut,Pe)};return E.once(g.MEDIA_ENDED,ae(n)),E.once(g.PLAYOUT_LIMIT_REACHED,ae(1/0)),E.on(g.ERROR,(Pe,Ve)=>{if(!this.schedule)return;const ut=this.getAssetPlayer(h);if(Ve.details===F.BUFFER_STALLED_ERROR){if(ut!=null&&ut.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(Ve,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Ve.error} ${e}`)}),E.on(g.DESTROYING,()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;const Ve=new Error(`Asset player destroyed unexpectedly ${h}`),ut={fatal:!0,type:ne.OTHER_ERROR,details:F.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ve};this.handleAssetItemError(ut,e,this.schedule.findEventIndex(e.identifier),n,Ve.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ps(t)}`),this.hls.trigger(g.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:E}),E}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&Nr(t)}`);const i=this.playerQueue[n];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:s,assetItem:o,assetId:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[i]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${ps(o)}`),this.hls.trigger(g.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;if(!this.schedule)return;const{interstitial:r,assetItem:s}=e,o=this.schedule.findEventIndex(r.identifier),c=(n=this.schedule.items)==null?void 0:n[o];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=s;const u=this.getBufferingPlayer();if(u===e)return;const f=r.appendInPlace;if(f&&(u==null?void 0:u.interstitial.appendInPlace)===!1)return;const h=(u==null?void 0:u.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(f&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(h&&!he(h,e.tracks)){const p=new Error(`Asset ${ps(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),b={fatal:!0,type:ne.OTHER_ERROR,details:F.INTERSTITIAL_ASSET_ITEM_ERROR,error:p},E=r.findAssetIndex(s);this.handleAssetItemError(b,r,o,E,p.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const i=n.currentTime,r=t.findAssetIndex(e,i),s=e.assetList[r];if(s){const o=this.getAssetPlayer(s.identifier);if(o){const c=o.currentTime||i-s.timelineStart,u=o.duration-c;if(this.warn(`Stalled at ${c} of ${c+u} in ${o} ${e} (media.currentTime: ${i})`),c&&(u/n.playbackRate<.5||o.bufferedInPlaceToEnd(n))&&o.hls){const f=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,f,r)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,i,r){if(e.details===F.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&ps(s)} ${e.error}`),!this.schedule)return;const o=(s==null?void 0:s.identifier)||"",c=this.getAssetPlayerQueueIndex(o),u=this.playerQueue[c]||null,f=this.schedule.items,h=d({},e,{fatal:!1,errorAction:qn(!0),asset:s,assetListIndex:i,event:t,schedule:f,scheduleIndex:n,player:u});if(this.hls.trigger(g.INTERSTITIAL_ASSET_ERROR,h),!e.fatal)return;const p=this.playingAsset,b=this.bufferingAsset,E=new Error(r);if(s&&(this.clearAssetPlayer(o,null),s.error=E),!t.assetList.some(D=>!D.error))t.error=E;else for(let D=i;D<t.assetList.length;D++)this.resetAssetPlayer(t.assetList[D].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):p&&p.identifier===o?this.advanceAfterAssetEnded(t,n,i):b&&b.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,b)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${Nr(n)} error: ${e.error}`);let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const r=this.updateItem(n,i);if(this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t)),!this.schedule)return;const s=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(s)}else this.checkStart()}onAssetListLoaded(e,t){var n,i;const r=t.event,s=r.identifier,o=t.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(s)))return;const c=r.timelineStart,u=r.duration;let f=0;o.forEach((D,w)=>{const j=parseFloat(D.DURATION);this.createAsset(r,w,f,c+f,j,D.URI),f+=j}),r.duration=f,this.log(`Loaded asset-list with duration: ${f} (was: ${u}) ${r}`);const h=this.waitingItem,p=(h==null?void 0:h.event.identifier)===s;this.updateSchedule();const b=(i=this.bufferingItem)==null?void 0:i.event;if(p){var E;const D=this.schedule.findEventIndex(s),w=(E=this.schedule.items)==null?void 0:E[D];if(w){if(!this.playingItem&&this.timelinePos>w.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==D){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.updateSchedule(!0),this.primaryFallback(r);return}this.setBufferingItem(w)}this.setSchedulePosition(D)}else if((b==null?void 0:b.identifier)===s){const D=r.assetList[0];if(D){const w=this.getAssetPlayer(D.identifier);if(b.appendInPlace){const j=this.primaryMedia;w&&j&&this.bufferAssetPlayer(w,j)}else w&&w.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case F.ASSET_LIST_PARSING_ERROR:case F.ASSET_LIST_LOAD_ERROR:case F.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&(this.updateSchedule(!0),this.primaryFallback(n));break}case F.BUFFER_STALLED_ERROR:{const n=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&n.event.appendInPlace){this.handleInPlaceStall(n.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Lo=500;class yc extends vi{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",q.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(g.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(g.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(g.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(g.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=st.IDLE,this.setInterval(Lo),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragContextChanged(n)||(Se(n)&&(this.fragPrevious=n),this.state=st.IDLE),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let u=0;u<r.length;u++)if(o>=r[u].start&&o<=r[u].end){s=r[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=r){s.shift();continue}else if(s[o].start<r)s[o].start=r;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(n,r,q.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===q.SUBTITLE&&(t.details===F.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==st.STOPPED&&(this.state=st.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&ao(this.levels,t)){this.levels=t.map(n=>new pt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new pt(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,q.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==st.STOPPED&&this.setInterval(Lo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=r[o];if(o>=r.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){if(s.deltaUpdateFailed)return;const h=this.mainDetails;if(!h){this.startFragRequested=!1;return}const p=h.fragments[0];if(!c.details)s.hasProgramDateTime&&h.hasProgramDateTime?(as(s,h),u=s.fragmentStart):p&&(u=p.start,Xn(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&p&&(u=p.start,Xn(s,u))}h&&!this.startFragRequested&&this.setStartPosition(h,u)}c.details=s,this.levelLastLoaded=c,o===i&&(this.hls.trigger(g.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===st.IDLE&&(Zt(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&&Ui(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,Vi(i.method)).catch(o=>{throw r.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();r.trigger(g.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=st.IDLE})}}doTick(){if(!this.media){this.state=st.IDLE;return}if(this.state===st.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),s=rn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const h=u.fragments,p=h.length,b=u.edge;let E=null;const D=this.fragPrevious;if(o<b){const fe=i.maxFragLookUpTolerance,ae=o>b-fe?0:fe;E=Zt(D,h,Math.max(h[0].start,o),ae),!E&&D&&D.start<h[0].start&&(E=h[0])}else E=h[p-1];if(E=this.filterReplacedPrimary(E,n.details),!E)return;const w=E.sn-u.startSN,j=h[w-1];if(j&&j.cc===E.cc&&this.fragmentTracker.getState(j)===vn.NOT_LOADED&&(E=j),this.fragmentTracker.getState(E)===vn.NOT_LOADED){const fe=this.mapToInitFragWhenRequired(E);fe&&this.loadFragment(fe,n,o)}}}loadFragment(e,t,n){Se(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new bc(this.tracksBuffered[this.currentTrackId]||[])}}class bc{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Ec={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},ko=a=>String.fromCharCode(Ec[a]||a),Sr=15,Br=100,xc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Sc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},wc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Tc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Ac=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Dc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;J.log(`${this.time} [${e}] ${n}`)}}}const qr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Po{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 Rc{constructor(){this.uchar=" ",this.penState=new Po}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 Ic{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Po,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Br;t++)this.chars.push(new Rc);this.logger=e}equals(e){for(let t=0;t<Br;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Br;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Br;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>Br&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Br)}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=ko(e);if(this.pos>=Br){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<Br;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<Br;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 ba{constructor(e){this.rows=[],this.currRow=Sr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Sr;t++)this.rows.push(new Ic(e));this.logger=e}reset(){for(let e=0;e<Sr;e++)this.rows[e].clear();this.currRow=Sr-1}equals(e){let t=!0;for(let n=0;n<Sr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Sr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Sr;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 = "+tt(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<Sr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[r+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+tt(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<Sr;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 Oo{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 ba(n),this.nonDisplayedMemory=new ba(n),this.lastOutputScreen=new ba(n),this.currRollUpRow=this.displayedMemory.rows[Sr-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[Sr-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: "+tt(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 Mo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Lc(),this.logger=void 0;const i=this.logger=new Dc;this.channels=[null,new Oo(e,t,i),new Oo(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,o=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+qr([t[n],t[n+1]])+"] -> ("+qr([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(Cc(i,r,c)){$s(null,null,c),this.logger.log(3,()=>"Repeated command ("+qr([i,r])+") is dropped");continue}$s(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 $s(null,null,c);if(!s&&(o=this.parseChars(i,r),o)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+qr([i,r])+" orig: "+qr([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 ("+qr([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?xc[e]:wc[e]:n=s===1?Sc[e]:Tc[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+ko(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 = "+qr(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=Ac[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}$s(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 $s(a,e,t){t.a=a,t.b=e}function Cc(a,e,t){return t.a===a&&t.b===e}function Lc(){return{a:null,b:null}}var Ea=function(){if(di!=null&&di.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const u=c.toLowerCase();return~o.indexOf(u)?u:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const h in f)o[h]=f[h]}return o}function s(o,c,u){const f=this,h={enumerable:!0};f.hasBeenReset=!1;let p="",b=!1,E=o,D=c,w=u,j=null,fe="",ae=!0,Pe="auto",Ve="start",ut=50,Be="middle",Xe=50,Je="middle";Object.defineProperty(f,"id",r({},h,{get:function(){return p},set:function($e){p=""+$e}})),Object.defineProperty(f,"pauseOnExit",r({},h,{get:function(){return b},set:function($e){b=!!$e}})),Object.defineProperty(f,"startTime",r({},h,{get:function(){return E},set:function($e){if(typeof $e!="number")throw new TypeError("Start time must be set to a number.");E=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",r({},h,{get:function(){return D},set:function($e){if(typeof $e!="number")throw new TypeError("End time must be set to a number.");D=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",r({},h,{get:function(){return w},set:function($e){w=""+$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",r({},h,{get:function(){return j},set:function($e){j=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",r({},h,{get:function(){return fe},set:function($e){const At=n($e);if(At===!1)throw new SyntaxError("An invalid or illegal string was specified.");fe=At,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",r({},h,{get:function(){return ae},set:function($e){ae=!!$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",r({},h,{get:function(){return Pe},set:function($e){if(typeof $e!="number"&&$e!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Pe=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",r({},h,{get:function(){return Ve},set:function($e){const At=i($e);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");Ve=At,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",r({},h,{get:function(){return ut},set:function($e){if($e<0||$e>100)throw new Error("Position must be between 0 and 100.");ut=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",r({},h,{get:function(){return Be},set:function($e){const At=i($e);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");Be=At,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",r({},h,{get:function(){return Xe},set:function($e){if($e<0||$e>100)throw new Error("Size must be between 0 and 100.");Xe=$e,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",r({},h,{get:function(){return Je},set:function($e){const At=i($e);if(!At)throw new SyntaxError("An invalid or illegal string was specified.");Je=At,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class kc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Fo(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 Pc{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 No(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const xa=new Ea(0,0,""),Ks=xa.align==="middle"?"middle":"center";function Oc(a,e,t){const n=a;function i(){const o=Fo(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,c){const u=new Pc;No(o,function(p,b){let E;switch(p){case"region":for(let D=t.length-1;D>=0;D--)if(t[D].id===b){u.set(p,t[D].region);break}break;case"vertical":u.alt(p,b,["rl","lr"]);break;case"line":E=b.split(","),u.integer(p,E[0]),u.percent(p,E[0])&&u.set("snapToLines",!1),u.alt(p,E[0],["auto"]),E.length===2&&u.alt("lineAlign",E[1],["start",Ks,"end"]);break;case"position":E=b.split(","),u.percent(p,E[0]),E.length===2&&u.alt("positionAlign",E[1],["start",Ks,"end","line-left","line-right","auto"]);break;case"size":u.percent(p,b);break;case"align":u.alt(p,b,["start",Ks,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&xa.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Ks);let h=u.get("position","auto");h==="auto"&&xa.position===50&&(h=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=h}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function Bo(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class Mc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new kc,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=Bo(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const o=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),o}function i(r){No(r,function(s,o){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const o=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new Ea(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Oc(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Fc=/\r\n|\n\r|\n|\r/g,Sa=function(e,t,n=0){return e.slice(n,n+t.length)===t},Nc=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(!A(t)||!A(n)||!A(i)||!A(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function wa(a,e,t){return ws(a.toString())+ws(e.toString())+ws(t)}const Bc=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 Uc(a,e,t,n,i,r,s){const o=new Mc,c=Ze(new Uint8Array(a)).trim().replace(Fc,`
|
|
`).split(`
|
|
`),u=[],f=e?Yl(e.baseTime,e.timescale):0;let h="00:00.000",p=0,b=0,E,D=!0;o.oncue=function(w){const j=t[n];let fe=t.ccOffset;const ae=(p-f)/9e4;if(j!=null&&j.new&&(b!==void 0?fe=t.ccOffset=j.start:Bc(t,n,ae)),ae){if(!e){E=new Error("Missing initPTS for VTT MPEGTS");return}fe=ae-t.presentationOffset}const Pe=w.endTime-w.startTime,Ve=gr((w.startTime+fe-b)*9e4,i*9e4)/9e4;w.startTime=Math.max(Ve,0),w.endTime=Math.max(Ve+Pe,0);const ut=w.text.trim();w.text=decodeURIComponent(encodeURIComponent(ut)),w.id||(w.id=wa(w.startTime,w.endTime,ut)),w.endTime>0&&u.push(w)},o.onparsingerror=function(w){E=w},o.onflush=function(){if(E){s(E);return}r(u)},c.forEach(w=>{if(D)if(Sa(w,"X-TIMESTAMP-MAP=")){D=!1,w.slice(16).split(",").forEach(j=>{Sa(j,"LOCAL:")?h=j.slice(6):Sa(j,"MPEGTS:")&&(p=parseInt(j.slice(7)))});try{b=Nc(h)/1e3}catch(j){E=j}return}else w===""&&(D=!1);o.parse(w+`
|
|
`)}),o.flush()}const Ta="stpp.ttml.im1t",Uo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,$o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,$c={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ko(a,e,t,n){const i=$(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Ze(o)),s=Wl(e.baseTime,1,e.timescale);try{r.forEach(o=>t(Kc(o,s)))}catch(o){n(o)}}function Kc(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((h,p)=>(h[p]=i.getAttribute(`ttp:${p}`)||r[p],h),{}),o=i.getAttribute("xml:space")!=="preserve",c=Go(Aa(i,"styling","style")),u=Go(Aa(i,"layout","region")),f=Aa(i,"body","[begin]");return[].map.call(f,h=>{const p=Vo(h,o);if(!p||!h.hasAttribute("begin"))return null;const b=Ra(h.getAttribute("begin"),s),E=Ra(h.getAttribute("dur"),s);let D=Ra(h.getAttribute("end"),s);if(b===null)throw zo(h);if(D===null){if(E===null)throw zo(h);D=b+E}const w=new Ea(b-e,D-e,p);w.id=wa(w.startTime,w.endTime,w.text);const j=u[h.getAttribute("region")],fe=c[h.getAttribute("style")],ae=Gc(j,fe,c),{textAlign:Pe}=ae;if(Pe){const Ve=$c[Pe];Ve&&(w.lineAlign=Ve),w.align=Pe}return d(w,ae),w}).filter(h=>h!==null)}function Aa(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Go(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Vo(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?Vo(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function Gc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((o,c)=>{const u=Da(e,n,c)||Da(a,n,c)||Da(i,n,c);return u&&(o[c]=u),o},{})}function Da(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function zo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function Ra(a,e){if(!a)return null;let t=Fo(a);return t===null&&(Uo.test(a)?t=Vc(a,e):$o.test(a)&&(t=zc(a,e))),t}function Vc(a,e){const t=Uo.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 zc(a,e){const t=$o.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 Gs{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Zc{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=Ho(),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(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(g.FRAG_LOADING,this.onFragLoading,this),e.on(g.FRAG_LOADED,this.onFragLoaded,this),e.on(g.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(g.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(g.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(g.FRAG_LOADING,this.onFragLoading,this),e.off(g.FRAG_LOADED,this.onFragLoaded,this),e.off(g.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(g.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(g.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(g.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Gs(this,"textTrack1"),t=new Gs(this,"textTrack2"),n=new Gs(this,"textTrack3"),i=new Gs(this,"textTrack4");this.cea608Parser1=new Mo(1,e,t),this.cea608Parser2=new Mo(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const c=r[o],u=jc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,i)}else{const o=this.Cues.newCue(null,t,n,i);this.hls.trigger(g.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){const{unparsedVttFrags:o}=this;n===q.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r,trackId:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(g.FRAG_LOADED,c):this.hls.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(jo(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],o=this.getExistingTrack(r,s);if(o)n[e]=o,hs(n[e]),Ao(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(g.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach(r=>{hs(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Ho(),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++)hs(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===Ta);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ao(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Bs(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(o){let h=null;for(let p=0;p<o.length;p++)if(o[p]&&jo(o[p],c)){h=o[p],o[p]=null;break}h&&(f=h)}if(f)hs(f);else{const h=Zo(c);f=this.createTextTrack(h,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(g.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===q.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:u}=t.frag,f=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(u!==o+1||u===o&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===q.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===Ta?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ko(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,o=r.length-1;if(!r[n.cc]&&o===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?Ke(n.initSegment.data,new Uint8Array(i)).buffer:i;Uc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const h=f.message==="Missing initPTS for VTT MPEGTS";h?s.push(e):this._fallbackToIMSC1(n,i),c.logger.log(`Failed to parse VTT cue: ${f}`),!(h&&o>n.cc)&&c.trigger(g.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ko(t,this.initPTS[e.cc],()=>{n.textCodec=Ta,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=>Do(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(g.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===q.SUBTITLE&&this.onFragLoaded(g.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(!(n.type===q.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<i.length;r++){const s=i[r].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,o[0]),this.cea608Parser2.addData(i[r].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>_a(o[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>_a(o[c],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],o=127&e[i++],c=127&e[i++];if(o===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(o),t[f].push(c))}}return t}}function Zo(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function jo(a,e){return!!a&&a.kind===Zo(e)&&ua(e,a)}function jc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Ho(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const Hc=/\s/,Wc={newCue(a,e,t,n){const i=[];let r,s,o,c,u;const f=self.VTTCue||self.TextTrackCue;for(let p=0;p<n.rows.length;p++)if(r=n.rows[p],o=!0,c=0,u="",!r.isEmpty()){var h;for(let D=0;D<r.chars.length;D++)Hc.test(r.chars[D].uchar)&&o?c++:(u+=r.chars[D].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const b=Bo(u.trim()),E=wa(e,t,b);a!=null&&(h=a.cues)!=null&&h.getCueById(E)||(s=new f(e,t,b),s.id=E,s.line=p+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((p,b)=>p.line==="auto"||b.line==="auto"?0:p.line>8&&b.line>8?b.line-p.line:p.line-b.line),i.forEach(p=>Do(a,p))),i}};function Yc(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Xc=/(\d+)-(\d+)\/(\d+)/;class Wo{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||ef,this.controller=new self.AbortController,this.stats=new v}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=Qc(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&A(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(xs(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(h=>{var p;this.response=this.loader=h;const b=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},u-(b-i.loading.start)),!h.ok){const{status:D,statusText:w}=h;throw new tf(w||"fetch, bad network response",D,h)}i.loading.first=b,i.total=Jc(h.headers)||i.total;const E=(p=this.callbacks)==null?void 0:p.onProgress;return E&&A(t.highWaterMark)?this.loadProgressively(h,i,e,t.highWaterMark,E):s?h.arrayBuffer():e.responseType==="json"?h.json():h.text()}).then(h=>{var p,b;const E=this.response;if(!E)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const D=h[o];D&&(i.loaded=i.total=D);const w={url:E.url,data:h,code:E.status},j=(p=this.callbacks)==null?void 0:p.onProgress;j&&!A(t.highWaterMark)&&j(i,e,h,E),(b=this.callbacks)==null||b.onSuccess(w,i,e,E)}).catch(h=>{var p;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const b=h&&h.code||0,E=h?h.message:null;(p=this.callbacks)==null||p.onError({code:b,text:E},e,h?h.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const s=new qi,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,h=f.length;return t.loaded+=h,h<i||s.dataLength?(s.push(f),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Qc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(d({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function qc(a){const e=Xc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Jc(a){const e=a.get("Content-Range");if(e){const n=qc(e);if(A(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function ef(a,e){return new self.Request(a.url,e)}class tf extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const nf=/^age:\s*[\d.]+\s*$/im;class Yo{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 v,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&A(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const E=f!=null?f:t.response;if(E!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const D=t.responseType==="arraybuffer"?E.byteLength:E.length;n.loaded=n.total=D,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const w=(s=this.callbacks)==null?void 0:s.onProgress;w&&w(n,e,E,t);const j={url:t.responseURL,data:E,code:u};(o=this.callbacks)==null||o.onSuccess(j,n,e,t);return}}const h=r.loadPolicy.errorRetry,p=n.retry,b={url:e.url,data:void 0,code:u};if(pn(h,p,!1,b))this.retry(h);else{var c;J.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(pn(e,t,!0))this.retry(e);else{var n;J.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=Nt(e,n.retry),n.retry++,J.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&&nf.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const rf={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},sf=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Yo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Yt,bufferController:cu,capLevelController:fa,errorController:Hn,fpsController:oc,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:ni,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:rf},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},af()),{},{subtitleStreamController:yc,subtitleTrackController:cc,timelineController:Zc,audioStreamController:au,audioTrackController:ou,emeController:fs,cmcdController:rc,contentSteeringController:ac,interstitialsController:vc});function af(){return{cueHandler:Wc,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 of(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Ia(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,u=[];r.forEach(f=>{const h=`${s}Loading${f}`,p=e[h];if(p!==void 0&&c){u.push(h);const b=n[o].default;switch(e[o]={default:b},f){case"TimeOut":b.maxLoadTimeMs=p,b.maxTimeToFirstByteMs=p;break;case"MaxRetry":b.errorRetry.maxNumRetry=p,b.timeoutRetry.maxNumRetry=p;break;case"RetryDelay":b.errorRetry.retryDelayMs=p,b.timeoutRetry.retryDelayMs=p;break;case"MaxRetryTimeout":b.errorRetry.maxRetryDelayMs=p,b.timeoutRetry.maxRetryDelayMs=p;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${tt(e[o])}`)}),y(y({},n),e)}function Ia(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Ia):Object.keys(a).reduce((e,t)=>(e[t]=Ia(a[t]),e),{}):a}function lf(a,e){const t=a.loader;t!==Wo&&t!==Yo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Yc()&&(a.loader=Wo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Vs=2,uf=.1,cf=.05,ff=100;class hf extends Yn{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(g.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(ff),this.mediaSource=t.mediaSource;const n=this.media=t.media;cr(n,"playing",this.onMediaPlaying),cr(n,"waiting",this.onMediaWaiting),cr(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(mr(n,"playing",this.onMediaPlaying),mr(n,"waiting",this.onMediaWaiting),mr(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const s=this.media;if(!s)return;const{seeking:o}=s,c=this.seeking&&!o,u=!this.seeking&&o,f=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&this.stallResolved(e);return}if(f){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(g.MEDIA_ENDED,{stalled:!1}));return}if(!rn.getBuffered(s).length){this.nudgeRetry=0;return}const h=rn.bufferInfo(s,e,0),p=h.nextStart||0,b=this.fragmentTracker;if(o&&b&&this.hls){const ut=Xo(this.hls.inFlightFragments,e),Be=h.len>Vs,Xe=!p||ut||p-e>Vs&&!b.getPartialFragment(e);if(Be||Xe)return;this.moved=!1}const E=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&b){if(!(h.len>0)&&!p)return;const Be=Math.max(p,h.start||0)-e,Je=!!(E!=null&&E.live)?E.targetduration*2:Vs,$e=zs(e,b);if(Be>0&&(Be<=Je||$e)){s.paused||this._trySkipBufferHole($e);return}}const D=r.detectStallWithCurrentTimeMs,w=self.performance.now(),j=this.waiting;let fe=this.stalled;if(fe===null)if(j>0&&w-j<D)fe=this.stalled=j;else{this.stalled=w;return}const ae=w-fe;if(!o&&(ae>=D||j)&&this.hls){var Pe;if(((Pe=this.mediaSource)==null?void 0:Pe.readyState)==="ended"&&!(E!=null&&E.live)&&Math.abs(e-((E==null?void 0:E.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(g.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(h),!this.media||!this.hls)return}const Ve=rn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(Ve,ae,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(g.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&e>i.end(0)){const r=rn.bufferedInfo(rn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=rn.timeRangesToArray(i),o=rn.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=rn.bufferedInfo(s,e,0).bufferedIndex,u=s[o].end,f=s[o+1].start;if((c===-1||c>o)&&f-u<1&&e-u<2){const h=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(h.message),this.media.currentTime+=1e-6;let p=zs(e,this.fragmentTracker);p&&"fragment"in p?p=p.fragment:p||(p=void 0);const b=rn.bufferInfo(this.media,e,0);this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:h,reason:h.message,frag:p,buffer:b.len,bufferInfo:b})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:s,media:o}=this,c=(i=this.hls)==null?void 0:i.config;if(!o||!s||!c)return;const u=(r=this.hls)==null?void 0:r.latestLevelDetails,f=zs(n,s);if((f||u!=null&&u.live&&n<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const h=e.buffered,p=this.adjacentTraversal(e,n);(h&&h.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-n<c.maxBufferHole||p))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const r=n.getFragAtPos(t,q.MAIN),s=n.getFragAtPos(i,q.MAIN);if(r&&s)return s.sn-r.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&r!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${tt(e)})`);this.warn(s.message),t.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!n||!r)return 0;const s=i.currentTime,o=rn.bufferInfo(i,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const f=o.len<=r.maxBufferHole,h=o.len>0&&o.len<1&&i.readyState<3,p=c-s;if(p>0&&(f||h)){if(p>r.maxBufferHole){let E=!1;if(s===0){const D=n.getAppendedFrag(0,q.MAIN);D&&c<D.end&&(E=!0)}if(!E&&e){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||Xo(this.hls.inFlightFragments,c))return 0;let w=!1,j=e.end;for(;j<c;){const fe=zs(j,n);if(fe)j+=fe.duration;else{w=!0;break}}if(w)return 0}}const b=Math.max(c+cf,s+uf);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${b}`),this.moved=!0,i.currentTime=b,!(e!=null&&e.gap)){const E=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${b}`),D={type:ne.MEDIA_ERROR,details:F.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:E,reason:E.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?D.part=e:D.frag=e),this.hls.trigger(g.ERROR,D)}return b}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const s=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const o=s+(i+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),n.currentTime=o,t.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Xo(a,e){const t=Qo(a.main);if(t&&t.start<=e)return t;const n=Qo(a.audio);return n&&n.start<=e?n:null}function Qo(a){if(!a)return null;switch(a.state){case st.IDLE:case st.STOPPED:case st.ENDED:case st.ERROR:return null}return a.frag}function zs(a,e){return e.getAppendedFrag(a,q.MAIN)||e.getPartialFragment(a)}const df=.25;function Ca(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function La(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,tt(i?y({type:i},n):n))}return r}const Zs=(()=>{const a=Ca();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class pf{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(g.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(g.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&hs(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return Ao(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:i}=this.hls.config;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Ca();if(s)for(let o=0;o<r.length;o++){const c=r[o].type;if(c===ur.emsg&&!n||!i)continue;const u=Ka(r[o].data),f=r[o].pts;let h=f+r[o].duration;h>Zs&&(h=Zs),h-f<=0&&(h=f+df);for(let b=0;b<u.length;b++){const E=u[b];if(!Ga(E)){this.updateId3CueEnds(f,c);const D=La(s,f,h,E,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===Zs&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=s;if(r&&(o||c)){let u;i==="audio"?u=f=>f.type===ur.audioId3&&c:i==="video"?u=f=>f.type===ur.emsg&&o:u=f=>f.type===ur.audioId3&&c||f.type===ur.emsg&&o,_a(r,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:i,enableDateRangeMetadataCues:r,interstitialsController:s}=this.hls.config;if(!r)return;const o=Ca();if(n&&i&&!s){const{fragmentStart:D,fragmentEnd:w}=e;let j=this.assetCue;j?(j.startTime=D,j.endTime=w):o&&(j=this.assetCue=La(o,D,w,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),j&&(j.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(j),j.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:u}=e,f=Object.keys(u);let h=this.dateRangeCuesAppended;if(c&&t){var p;if((p=c.cues)!=null&&p.length){const D=Object.keys(h).filter(w=>!f.includes(w));for(let w=D.length;w--;){var b;const j=D[w],fe=(b=h[j])==null?void 0:b.cues;delete h[j],fe&&Object.keys(fe).forEach(ae=>{const Pe=fe[ae];if(Pe){Pe.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(Pe)}catch(Ve){}}})}}else h=this.dateRangeCuesAppended={}}const E=e.fragments[e.fragments.length-1];if(!(f.length===0||!A(E==null?void 0:E.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let D=0;D<f.length;D++){const w=f[D],j=u[w],fe=j.startTime,ae=h[w],Pe=(ae==null?void 0:ae.cues)||{};let Ve=(ae==null?void 0:ae.durationKnown)||!1,ut=Zs;const{duration:Be,endDate:Xe}=j;if(Xe&&Be!==null)ut=fe+Be,Ve=!0;else if(j.endOnNext&&!Ve){const $e=f.reduce((At,ln)=>{if(ln!==j.id){const Sn=u[ln];if(Sn.class===j.class&&Sn.startDate>j.startDate&&(!At||j.startDate<At.startDate))return Sn}return At},null);$e&&(ut=$e.startTime,Ve=!0)}const Je=Object.keys(j.attr);for(let $e=0;$e<Je.length;$e++){const At=Je[$e];if(!Xi(At))continue;const ln=Pe[At];if(ln)Ve&&!(ae!=null&&ae.durationKnown)?ln.endTime=ut:Math.abs(ln.startTime-fe)>.01&&(ln.startTime=fe,ln.endTime=ut);else if(o){let Sn=j.attr[At];Ei(At)&&(Sn=R(Sn));const wn=La(o,fe,ut,{key:At,data:Sn},ur.dateRange);wn&&(wn.id=w,this.id3Track.addCue(wn),Pe[At]=wn,s&&(At==="X-ASSET-LIST"||At==="X-ASSET-URL")&&wn.addEventListener("enter",this.onEventCueEnter))}}h[w]={cues:Pe,dateRange:j,durationKnown:Ve}}}}}class gf{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||s===1||!n.live)return;const o=this.targetLatency;if(o===null)return;const c=i-o,u=Math.min(this.maxLatency,o+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,s)),p=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,b=Math.min(h,Math.max(1,p));this.changeMediaPlaybackRate(t,b)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=r!==void 0?r:s*i);const f=i;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(g.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(g.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(g.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(g.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===F.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class mf extends la{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(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this),e.on(g.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this),e.off(g.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let o=!1,c=!1,u=!1;t.levels.forEach(f=>{const h=f.attrs;let{audioCodec:p,videoCodec:b}=f;p&&(f.audioCodec=p=ie(p,n)||void 0),b&&(b=f.videoCodec=bt(b));const{width:E,height:D,unknownCodecs:w}=f;let j=w?w.length:0;if(w)for(let $e=j;$e--;){const At=w[$e];this.isAudioSupported(At)?(f.audioCodec=p=p?`${p},${At}`:At,j--,rt.audio[p.substring(0,4)]=2):this.isVideoSupported(At)&&(f.videoCodec=b=b?`${b},${At}`:At,j--,rt.video[b.substring(0,4)]=2)}if(o||(o=!!(E&&D)),c||(c=!!b),u||(u=!!p),j||p&&!this.isAudioSupported(p)||b&&!this.isVideoSupported(b)){this.log(`Some or all CODECS not supported "${h.CODECS}"`);return}const{CODECS:fe,"FRAME-RATE":ae,"HDCP-LEVEL":Pe,"PATHWAY-ID":Ve,RESOLUTION:ut,"VIDEO-RANGE":Be}=h,Je=`${`${Ve||"."}-`}${f.bitrate}-${ut}-${ae}-${fe}-${Be}-${Pe}`;if(r[Je])if(r[Je].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const $e=s[Je]+=1;f.attrs["PATHWAY-ID"]=new Array($e+1).join(".");const At=this.createLevel(f);r[Je]=At,i.push(At)}else r[Je].addGroupId("audio",h.AUDIO),r[Je].addGroupId("text",h.SUBTITLES);else{const $e=this.createLevel(f);r[Je]=$e,s[Je]=1,i.push($e)}}),this.filterAndSortMediaOptions(i,t,o,c,u)}createLevel(e){const t=new pt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),t.supportedResult=dn(i,[])}return t}isAudioSupported(e){return Tn(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Tn(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],o=[],c=e;if((n||i)&&r&&(c=c.filter(({videoCodec:w,videoRange:j,width:fe,height:ae})=>(!!w||!!(fe&&ae))&&me(j))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let w="no level with compatible codecs found in manifest",j=w;t.levels.length&&(j=`one or more CODECS in variant not supported: ${tt(t.levels.map(ae=>ae.attrs.CODECS).filter((ae,Pe,Ve)=>Ve.indexOf(ae)===Pe))}`,this.warn(j),w+=` (${j})`);const fe=new Error(w);this.hls.trigger(g.ERROR,{type:ne.MEDIA_ERROR,details:F.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:fe,reason:j})}});return}t.audioTracks&&(s=t.audioTracks.filter(w=>!w.audioCodec||this.isAudioSupported(w.audioCodec)),qo(s)),t.subtitles&&(o=t.subtitles,qo(o));const u=c.slice(0);c.sort((w,j)=>{if(w.attrs["HDCP-LEVEL"]!==j.attrs["HDCP-LEVEL"])return(w.attrs["HDCP-LEVEL"]||"")>(j.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&w.height!==j.height)return w.height-j.height;if(w.frameRate!==j.frameRate)return w.frameRate-j.frameRate;if(w.videoRange!==j.videoRange)return $n.indexOf(w.videoRange)-$n.indexOf(j.videoRange);if(w.videoCodec!==j.videoCodec){const fe=Ie(w.videoCodec),ae=Ie(j.videoCodec);if(fe!==ae)return ae-fe}if(w.uri===j.uri&&w.codecSet!==j.codecSet){const fe=ve(w.codecSet),ae=ve(j.codecSet);if(fe!==ae)return ae-fe}return w.averageBitrate!==j.averageBitrate?w.averageBitrate-j.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let w=0;w<u.length;w++)if(u[w].pathwayId===c[0].pathwayId){f=u[w];break}}this._levels=c;for(let w=0;w<c.length;w++)if(c[w]===f){var h;this._firstLevel=w;const j=f.bitrate,fe=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${j}`),((h=this.hls.userConfig)==null?void 0:h.abrEwmaDefaultEstimate)===void 0){const ae=Math.min(j,this.hls.config.abrEwmaDefaultEstimateMax);ae>fe&&fe===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=ae)}break}const p=r&&!i,b=this.hls.config,E=!!(b.audioStreamController&&b.audioTrackController),D={levels:c,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:E&&!p&&s.some(w=>!!w.url)};this.hls.trigger(g.MANIFEST_PARSED,D)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),h=e<0;if(this.hls.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.LEVEL_SWITCH_ERROR,level:e,fatal:h,error:f,reason:f.message}),h)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${r?" with Pathway "+r:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(g.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,i==null?void 0:i.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===oe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===q.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(g.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((r,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(o=>o.level=-1)),!1));or(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(g.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(g.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function qo(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Jo(){return self.SourceBuffer||self.WebKitSourceBuffer}function el(){if(!X())return!1;const e=Jo();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function _f(){if(!el())return!1;const a=X();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(en(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(en(e,"audio"))))}function vf(){var a;const e=Jo();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const yf=100;class bf extends vi{constructor(e,t,n){super(e,t,n,"stream-controller",q.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,r=i?i.currentTime:null;if(r===null||!A(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,q.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(g.MANIFEST_PARSED,this.onManifestParsed,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.LEVEL_LOADED,this.onLevelLoaded,this),e.on(g.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(g.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(g.BUFFER_CREATED,this.onBufferCreated,this),e.on(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(g.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(g.MANIFEST_PARSED,this.onManifestParsed,this),e.off(g.LEVEL_LOADED,this.onLevelLoaded,this),e.off(g.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(g.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(g.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(g.BUFFER_CREATED,this.onBufferCreated,this),e.off(g.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(g.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(yf),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=st.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=st.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case st.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=st.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=st.IDLE;break}break}case st.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=st.IDLE}}break}this.state===st.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const D={};this.altAudio===2&&(D.type="video"),this.hls.trigger(g.BUFFER_EOS,D),this.state=st.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const u=s.details;if(!u||this.state===st.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=st.WAITING_LEVEL,this.startFragRequested=!1;return}const f=o.len,h=this.getMaxBufferLength(s.maxBitrate);if(f>=h)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const p=this.backtrackFragment?this.backtrackFragment.start:o.end;let b=this.getNextFragment(p,u);if(this.couldBacktrack&&!this.fragPrevious&&b&&Se(b)&&this.fragmentTracker.getState(b)!==vn.OK){var E;const w=((E=this.backtrackFragment)!=null?E:b).sn-u.startSN,j=u.fragments[w-1];j&&b.cc===j.cc&&(b=j,this.fragmentTracker.removeFragment(j))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(b&&this.isLoopLoading(b,p)){if(!b.gap){const w=this.audioOnly&&!this.altAudio?C.AUDIO:C.VIDEO,j=(w===C.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;j&&this.afterBufferFlushed(j,w,q.MAIN)}b=this.getNextFragmentLoopLoading(b,u,o,q.MAIN,h)}b&&(b.initSegment&&!b.initSegment.data&&!this.bitrateTest&&(b=b.initSegment),this.loadFragment(b,s,p))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===vn.NOT_LOADED||i===vn.PARTIAL?Se(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,q.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<r.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case st.KEY_LOADING:case st.FRAG_LOADING:case st.FRAG_LOADING_WAITING_RETRY:case st.PARSING:case st.PARSED:this.state=st.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;cr(n,"playing",this.onMediaPlaying),cr(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(mr(n,"playing",this.onMediaPlaying),mr(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(g.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;for(let r=0;r<t.levels.length;r++){const s=t.levels[r].audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=n&&i&&!vf(),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!==st.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=st.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,c=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===st.FRAG_LOADING||this.state===st.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let h=0;if(o.live||(n=u.details)!=null&&n.live){var p;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;h=this.alignPlaylists(o,u.details,(p=this.levelLastLoaded)==null?void 0:p.details)}if(u.details=o,this.levelLastLoaded=u,r||this.setStartPosition(o,h),this.hls.trigger(g.LEVEL_UPDATED,{details:o,level:s}),this.state===st.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=st.IDLE}r&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,c=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!c)){const f=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&n.readyState<4||r<o-f)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const h=rn.bufferInfo(n,i,0);if(!((u=h.buffered)!=null&&u.length)){n.currentTime=i;return}if(h.start<=r){n.currentTime=i;return}const{nextStart:b}=rn.bufferedInfo(h.buffered,r,0);b&&(n.currentTime=b)}else n.currentTime=i}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level];if(!o){this.warn(`Level ${n.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=o.videoCodec,f=c.PTSKnown||!c.live,h=(t=n.initSegment)==null?void 0:t.data,p=this._getAudioCodec(o),b=this.transmuxer=this.transmuxer||new ro(this.hls,q.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),E=i?i.index:-1,D=E!==-1,w=new wi(n.level,n.sn,n.stats.chunkCount,r.byteLength,E,D),j=this.initPTS[n.cc];b.push(r,h,p,u,n,i,c.totalduration,f,w,j)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(Gt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.fragmentTracker.removeAllFragments(),n.once(g.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(g.AUDIO_TRACK_SWITCHED,t)}),n.trigger(g.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(g.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Gt(t.url,this.hls);if(n){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const o in n){const c=n[o];if(c.id==="main"){if(r=o,i=c,o==="video"){const u=n[o];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===q.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===st.PARSED&&(this.state=st.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),Se(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&rn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=st.ERROR;return}switch(t.details){case F.FRAG_GAP:case F.FRAG_PARSING_ERROR:case F.FRAG_DECRYPT_ERROR:case F.FRAG_LOAD_ERROR:case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_ERROR:case F.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(q.MAIN,t);break;case F.LEVEL_LOAD_ERROR:case F.LEVEL_LOAD_TIMEOUT:case F.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===st.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===oe.LEVEL&&(this.state=st.IDLE);break;case F.BUFFER_ADD_CODEC_ERROR:case F.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case F.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case F.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=st.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==C.AUDIO||!this.altAudio){const n=(t===C.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,q.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),s=rn.getBuffered(e),o=s.length?s.start(0):0,c=o-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=st.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(g.FRAG_LOADED,n),r.bitrateTest=!1})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:r}=e,s=this.getCurrentContext(r);if(!s){this.resetWhenMissingContext(r);return}const{frag:o,part:c,level:u}=s,{video:f,text:h,id3:p,initSegment:b}=i,{details:E}=u,D=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=st.PARSING,b){const w=b.tracks;if(w){const Pe=o.initSegment||o;if(this.unhandledEncryptionError(b,o))return;this._bufferInitSegment(u,w,Pe,r),n.trigger(g.FRAG_PARSING_INIT_SEGMENT,{frag:Pe,id:t,tracks:w})}const j=b.initPTS,fe=b.timescale,ae=this.initPTS[o.cc];if(A(j)&&(!ae||ae.baseTime!==j||ae.timescale!==fe)){const Pe=b.trackId;this.initPTS[o.cc]={baseTime:j,timescale:fe,trackId:Pe},n.trigger(g.INIT_PTS_FOUND,{frag:o,id:t,initPTS:j,timescale:fe,trackId:Pe})}}if(f&&E){D&&f.type==="audiovideo"&&this.logMuxedErr(o);const w=E.fragments[o.sn-1-E.startSN],j=o.sn===E.startSN,fe=!w||o.cc>w.cc;if(i.independent!==!1){const{startPTS:ae,endPTS:Pe,startDTS:Ve,endDTS:ut}=f;if(c)c.elementaryStreams[f.type]={startPTS:ae,endPTS:Pe,startDTS:Ve,endDTS:ut};else if(f.firstKeyFrame&&f.independent&&r.id===1&&!fe&&(this.couldBacktrack=!0),f.dropped&&f.independent){const Be=this.getMainFwdBufferInfo(),Xe=(Be?Be.end:this.getLoadPosition())+this.config.maxBufferHole,Je=f.firstKeyFramePTS?f.firstKeyFramePTS:ae;if(!j&&Xe<Je-this.config.maxBufferHole&&!fe){this.backtrack(o);return}else fe&&(o.gap=!0);o.setElementaryStreamInfo(f.type,o.start,Pe,o.start,ut,!0)}else j&&ae-(E.appliedTimelineOffset||0)>Vs&&(o.gap=!0);o.setElementaryStreamInfo(f.type,ae,Pe,Ve,ut),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(f,o,c,r,j||fe)}else if(j||fe)o.gap=!0;else{this.backtrack(o);return}}if(D){const{startPTS:w,endPTS:j,startDTS:fe,endDTS:ae}=D;c&&(c.elementaryStreams[C.AUDIO]={startPTS:w,endPTS:j,startDTS:fe,endDTS:ae}),o.setElementaryStreamInfo(C.AUDIO,w,j,fe,ae),this.bufferFragmentData(D,o,c,r)}if(E&&p!=null&&p.samples.length){const w={id:t,frag:o,details:E,samples:p.samples};n.trigger(g.FRAG_PARSING_METADATA,w)}if(E&&h){const w={id:t,frag:o,details:E,samples:h.samples};n.trigger(g.FRAG_PARSING_USERDATA,w)}}logMuxedErr(e){this.warn(`${Se(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==st.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:s,audiovideo:o}=t;if(r){const u=e.audioCodec;let f=_e(r.codec,u);f==="mp4a"&&(f="mp4a.40.5");const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){f&&(f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5");const p=r.metadata;p&&"channelCount"in p&&(p.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(f="mp4a.40.5")}f&&f.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(f="mp4a.40.2",this.log(`Android: force audio codec to ${f}`)),u&&u!==f&&this.log(`Swapping manifest audio codec "${u}" for "${f}"`),r.levelCodec=f,r.id=q.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${f||""}/${u||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=q.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(g.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const h=t[u].initSegment;h!=null&&h.byteLength&&this.hls.trigger(g.BUFFER_APPENDING,{type:u,data:h,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,q.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=st.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(rn.isBuffered(e,n)?t=this.getAppendedFrag(n):rn.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(g.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(g.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return A(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(A(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?Zt(null,n.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const s=r+(t-i.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Ef{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=F.KEY_LOAD_ERROR,n,i,r){return new ci({type:ne.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i<r;i++){const s=t[i];if(e.cc<=s.cc&&(!Se(e)||!Se(s)||e.sn<s.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const c=Pn(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const i=Ln(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,F.KEY_LOAD_ERROR,u))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,F.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((n=o)!=null&&n.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var c;switch((c=o.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(u=>(r.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,F.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(p,b,E,D)=>{const{frag:w,keyInfo:j,url:fe}=E;if(!w.decryptdata||j!==this.keyUriToKeyInfo[fe])return o(this.createKeyLoadError(w,F.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),D));j.decryptdata.key=w.decryptdata.key=new Uint8Array(p.data),w.keyLoader=null,j.loader=null,s({frag:w,keyInfo:j})},onError:(p,b,E,D)=>{this.resetLoader(b),o(this.createKeyLoadError(t,F.KEY_LOAD_ERROR,new Error(`HTTP Error ${p.code} loading key ${p.text}`),E,y({url:c.url,data:void 0},p)))},onTimeout:(p,b,E)=>{this.resetLoader(b),o(this.createKeyLoadError(t,F.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),E))},onAbort:(p,b,E)=>{this.resetLoader(b),o(this.createKeyLoadError(t,F.INTERNAL_ABORTED,new Error("key loading aborted"),E))}};r.load(c,f,h)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function tl(a){const{type:e}=a;switch(e){case oe.AUDIO_TRACK:return q.AUDIO;case oe.SUBTITLE_TRACK:return q.SUBTITLE;default:return q.MAIN}}function ka(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class xf{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(g.MANIFEST_LOADING,this.onManifestLoading,this),e.on(g.LEVEL_LOADING,this.onLevelLoading,this),e.on(g.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(g.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(g.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(g.MANIFEST_LOADING,this.onManifestLoading,this),e.off(g.LEVEL_LOADING,this.onLevelLoading,this),e.off(g.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(g.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(g.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:oe.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:oe.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:oe.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:oe.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[oe.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[oe.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=this.hls.logger,f=i.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===oe.MANIFEST?r=n.manifestLoadPolicy.default:r=d({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),A((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===oe.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===oe.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===oe.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,h=u.targetduration;if(f&&h){const p=Math.max(f*3,h*.8)*1e3;r=d({},r,{maxTimeToFirstByteMs:Math.min(p,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(p,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,f,h,p)=>{const b=this.getInternalLoader(h);this.resetInternalLoader(h.type);const E=u.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,h,new Error("no EXTM3U delimiter"),p||null,f);return}f.parsing.start=performance.now(),ar.isMediaPlaylist(E)||h.type!==oe.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,h,p||null,b):this.handleMasterPlaylist(u,f,h,p)},onError:(u,f,h,p)=>{this.handleNetworkError(f,h,!1,u,p)},onTimeout:(u,f,h)=>{this.handleNetworkError(f,h,!0,void 0,u)}};i.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,o=ka(e,n),c=ar.parseMasterPlaylist(s,o);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:u,levels:f,sessionData:h,sessionKeys:p,startTimeOffset:b,variableList:E}=c;this.variableList=E;const{AUDIO:D=[],SUBTITLES:w,"CLOSED-CAPTIONS":j}=ar.parseMasterPlaylistMedia(s,o,c);D.length&&!D.some(ae=>!ae.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),D.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new oi({}),bitrate:0,url:""})),r.trigger(g.MANIFEST_LOADED,{levels:f,audioTracks:D,subtitles:w,captions:j,contentSteering:u,url:o,stats:t,networkDetails:i,sessionData:h,sessionKeys:p,startTimeOffset:b,variableList:E})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:c,type:u}=n,f=ka(e,n),h=A(c)?c:A(o)?o:0,p=tl(n),b=ar.parseLevelPlaylist(e.data,f,h,p,0,this.variableList);if(u===oe.MANIFEST){const E={attrs:new oi({}),bitrate:0,details:b,name:"",url:f};b.requestScheduled=t.loading.start+Ki(b,0),s.trigger(g.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:f,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=b,this.handlePlaylistLoaded(b,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(g.ERROR,{type:ne.NETWORK_ERROR,details:F.MANIFEST_PARSING_ERROR,fatal:t.type===oe.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===oe.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===oe.AUDIO_TRACK||e.type===oe.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=F.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case oe.MANIFEST:c=n?F.MANIFEST_LOAD_TIMEOUT:F.MANIFEST_LOAD_ERROR,u=!0;break;case oe.LEVEL:c=n?F.LEVEL_LOAD_TIMEOUT:F.LEVEL_LOAD_ERROR,u=!1;break;case oe.AUDIO_TRACK:c=n?F.AUDIO_TRACK_LOAD_TIMEOUT:F.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case oe.SUBTITLE_TRACK:c=n?F.SUBTITLE_TRACK_LOAD_TIMEOUT:F.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const h={type:ne.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:o,networkDetails:t,stats:r};if(i){const p=(t==null?void 0:t.url)||e.url;h.response=y({url:p,data:void 0},i)}this.hls.trigger(g.ERROR,h)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:c,level:u,id:f,groupId:h,deliveryDirectives:p}=i,b=ka(t,i),E=tl(i),D=typeof i.level=="number"&&E===q.MAIN?u:void 0;if(!e.fragments.length){const j=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(g.ERROR,{type:ne.NETWORK_ERROR,details:F.LEVEL_EMPTY_ERROR,fatal:!1,url:b,error:j,reason:j.message,response:t,context:i,level:D,parent:E,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const w=e.playlistParsingError;if(w){if(this.hls.logger.warn(`${w} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(g.ERROR,{type:ne.NETWORK_ERROR,details:F.LEVEL_PARSING_ERROR,fatal:!1,url:b,error:w,reason:w.message,response:t,context:i,level:D,parent:E,networkDetails:r,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case oe.MANIFEST:case oe.LEVEL:o.trigger(g.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||o.levels[0],level:D||0,id:f||0,stats:n,networkDetails:r,deliveryDirectives:p,withoutMultiVariant:c===oe.MANIFEST});break;case oe.AUDIO_TRACK:o.trigger(g.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:p});break;case oe.SUBTITLE_TRACK:o.trigger(g.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:p});break}}}class jr{static get version(){return xr}static isMSESupported(){return el()}static isSupported(){return _f()}static getMediaSource(){return X()}static get Events(){return g}static get MetadataSchema(){return ur}static get ErrorTypes(){return ne}static get ErrorDetails(){return F}static get DefaultConfig(){return jr.defaultConfig?jr.defaultConfig:sf}static set DefaultConfig(e){jr.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ls,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=re(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=of(jr.DefaultConfig,e,t);this.userConfig=e,n.progressive&&lf(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:c}=n,u=new o(this),f=this.abrController=new i(this),h=new ai(this),p=n.interstitialsController,b=p?this.interstitialsController=new p(this,jr):null,E=this.bufferController=new r(this,h),D=this.capLevelController=new s(this),w=new c(this),j=new xf(this),fe=n.contentSteeringController,ae=fe?new fe(this):null,Pe=this.levelController=new mf(this,ae),Ve=new pf(this),ut=new Ef(this.config),Be=this.streamController=new bf(this,h,ut),Xe=this.gapController=new hf(this,h);D.setStreamController(Be),w.setStreamController(Be);const Je=[j,Pe,Be];b&&Je.splice(1,0,b),ae&&Je.splice(1,0,ae),this.networkControllers=Je;const $e=[f,E,Xe,D,w,Ve,h];this.audioTrackController=this.createController(n.audioTrackController,Je);const At=n.audioStreamController;At&&Je.push(this.audioStreamController=new At(this,h,ut)),this.subtitleTrackController=this.createController(n.subtitleTrackController,Je);const ln=n.subtitleStreamController;ln&&Je.push(this.subtititleStreamController=new ln(this,h,ut)),this.createController(n.timelineController,$e),ut.emeController=this.emeController=this.createController(n.emeController,$e),this.cmcdController=this.createController(n.cmcdController,$e),this.latencyController=this.createController(gf,$e),this.coreComponents=$e,Je.push(u);const Sn=u.onErrorOut;typeof Sn=="function"&&this.on(g.ERROR,Sn,u),this.on(g.MANIFEST_LOADED,j.onManifestLoaded,j)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===g.ERROR;this.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(g.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(g.ERROR,{type:ne.OTHER_ERROR,details:F.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(g.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(g.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(g.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=_.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(g.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[q.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[q.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[q.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=fc()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){xn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=Lt(t);return Fn(e,n,navigator.mediaCapabilities)}}jr.defaultConfig=void 0},16722:function(bn,St,k){"use strict";k.d(St,{Z:function(){return q}});const A=l=>typeof l=="object"&&l!=null&&l.nodeType===1,ue=(l,S)=>(!S||l!=="hidden")&&l!=="visible"&&l!=="clip",Ae=(l,S)=>{if(l.clientHeight<l.scrollHeight||l.clientWidth<l.scrollWidth){const T=getComputedStyle(l,null);return ue(T.overflowY,S)||ue(T.overflowX,S)||(d=>{const m=(y=>{if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(x){return null}})(d);return!!m&&(m.clientHeight<d.scrollHeight||m.clientWidth<d.scrollWidth)})(l)}return!1},ne=(l,S,T,d,m,y,x,U)=>y<l&&x>S||y>l&&x<S?0:y<=l&&U<=T||x>=S&&U>=T?y-l-d:x>S&&U<T||y<l&&U>T?x-S+m:0,F=l=>{const S=l.parentElement;return S==null?l.getRootNode().host||null:S},g=(l,S)=>{var T,d,m,y;if(typeof document=="undefined")return[];const{scrollMode:x,block:U,inline:N,boundary:V,skipOverflowHiddenElements:I}=S,L=typeof V=="function"?V:Re=>Re!==V;if(!A(l))throw new TypeError("Invalid target");const O=document.scrollingElement||document.documentElement,z=[];let ee=l;for(;A(ee)&&L(ee);){if(ee=F(ee),ee===O){z.push(ee);break}ee!=null&&ee===document.body&&Ae(ee)&&!Ae(document.documentElement)||ee!=null&&Ae(ee,I)&&z.push(ee)}const re=(d=(T=window.visualViewport)==null?void 0:T.width)!=null?d:innerWidth,J=(y=(m=window.visualViewport)==null?void 0:m.height)!=null?y:innerHeight,{scrollX:X,scrollY:xe}=window,{height:he,width:Ze,top:K,right:R,bottom:B,left:G}=l.getBoundingClientRect(),{top:W,right:H,bottom:_,left:v}=(Re=>{const Ye=window.getComputedStyle(Re);return{top:parseFloat(Ye.scrollMarginTop)||0,right:parseFloat(Ye.scrollMarginRight)||0,bottom:parseFloat(Ye.scrollMarginBottom)||0,left:parseFloat(Ye.scrollMarginLeft)||0}})(l);let C=U==="start"||U==="nearest"?K-W:U==="end"?B+_:K+he/2-W+_,Y=N==="center"?G+Ze/2-v+H:N==="end"?R+H:G-v;const Se=[];for(let Re=0;Re<z.length;Re++){const Ye=z[Re],{height:He,width:ot,top:dt,right:Me,bottom:ht,left:Oe}=Ye.getBoundingClientRect();if(x==="if-needed"&&K>=0&&G>=0&&B<=J&&R<=re&&(Ye===O&&!Ae(Ye)||K>=dt&&B<=ht&&G>=Oe&&R<=Me))return Se;const mt=getComputedStyle(Ye),ze=parseInt(mt.borderLeftWidth,10),ke=parseInt(mt.borderTopWidth,10),se=parseInt(mt.borderRightWidth,10),Q=parseInt(mt.borderBottomWidth,10);let $=0,de=0;const we="offsetWidth"in Ye?Ye.offsetWidth-Ye.clientWidth-ze-se:0,Ce="offsetHeight"in Ye?Ye.offsetHeight-Ye.clientHeight-ke-Q:0,P="offsetWidth"in Ye?Ye.offsetWidth===0?0:ot/Ye.offsetWidth:0,te="offsetHeight"in Ye?Ye.offsetHeight===0?0:He/Ye.offsetHeight:0;if(O===Ye)$=U==="start"?C:U==="end"?C-J:U==="nearest"?ne(xe,xe+J,J,ke,Q,xe+C,xe+C+he,he):C-J/2,de=N==="start"?Y:N==="center"?Y-re/2:N==="end"?Y-re:ne(X,X+re,re,ze,se,X+Y,X+Y+Ze,Ze),$=Math.max(0,$+xe),de=Math.max(0,de+X);else{$=U==="start"?C-dt-ke:U==="end"?C-ht+Q+Ce:U==="nearest"?ne(dt,ht,He,ke,Q+Ce,C,C+he,he):C-(dt+He/2)+Ce/2,de=N==="start"?Y-Oe-ze:N==="center"?Y-(Oe+ot/2)+we/2:N==="end"?Y-Me+se+we:ne(Oe,Me,ot,ze,se+we,Y,Y+Ze,Ze);const{scrollLeft:ge,scrollTop:Ee}=Ye;$=te===0?0:Math.max(0,Math.min(Ee+$/te,Ye.scrollHeight-He/te+Ce)),de=P===0?0:Math.max(0,Math.min(ge+de/P,Ye.scrollWidth-ot/P+we)),C+=Ee-$,Y+=ge-de}Se.push({el:Ye,top:$,left:de})}return Se},oe=l=>l===!1?{block:"end",inline:"nearest"}:(S=>S===Object(S)&&Object.keys(S).length!==0)(l)?l:{block:"start",inline:"nearest"};function q(l,S){if(!l.isConnected||!(m=>{let y=m;for(;y&&y.parentNode;){if(y.parentNode===document)return!0;y=y.parentNode instanceof ShadowRoot?y.parentNode.host:y.parentNode}return!1})(l))return;const T=(m=>{const y=window.getComputedStyle(m);return{top:parseFloat(y.scrollMarginTop)||0,right:parseFloat(y.scrollMarginRight)||0,bottom:parseFloat(y.scrollMarginBottom)||0,left:parseFloat(y.scrollMarginLeft)||0}})(l);if((m=>typeof m=="object"&&typeof m.behavior=="function")(S))return S.behavior(g(l,S));const d=typeof S=="boolean"||S==null?void 0:S.behavior;for(const{el:m,top:y,left:x}of g(l,oe(S))){const U=y-T.top+T.bottom,N=x-T.left+T.right;m.scroll({top:U,left:N,behavior:d})}}}}]);
|
|
}()); |